pixi-spine
Advanced tools
Comparing version 1.0.15 to 1.0.17
@@ -1,2 +0,2 @@ | ||
!function t(e,n,i){function a(s,o){if(!n[s]){if(!e[s]){var h="function"==typeof require&&require;if(!o&&h)return h(s,!0);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return a(n?n:t)},u,u.exports,t,e,n,i)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(t,e,n){e.exports=PIXI.spine={Spine:t("./Spine"),SpineRuntime:t("./SpineRuntime"),loaders:t("./loaders")}},{"./Spine":41,"./SpineRuntime":39,"./loaders":45}],2:[function(t,e,n){var i=t("../SpineUtil");i.Animation=function(t,e,n){this.name=t,this.timelines=e,this.duration=n},i.Animation.prototype={apply:function(t,e,n,i,a){i&&0!=this.duration&&(n%=this.duration,e%=this.duration);for(var r=this.timelines,s=0,o=r.length;o>s;s++)r[s].apply(t,e,n,a,1)},mix:function(t,e,n,i,a,r){i&&0!=this.duration&&(n%=this.duration,e%=this.duration);for(var s=this.timelines,o=0,h=s.length;h>o;o++)s[o].apply(t,e,n,a,r)}},i.Animation.binarySearch=function(t,e,n){var i=0,a=Math.floor(t.length/n)-2;if(!a)return n;for(var r=a>>>1;;){if(t[(r+1)*n]<=e?i=r+1:a=r,i==a)return(i+1)*n;r=i+a>>>1}},i.Animation.binarySearch1=function(t,e){var n=0,i=t.length-2;if(!i)return 1;for(var a=i>>>1;;){if(t[a+1]<=e?n=a+1:i=a,n==i)return n+1;a=n+i>>>1}},i.Animation.linearSearch=function(t,e,n){for(var i=0,a=t.length-n;a>=i;i+=n)if(t[i]>e)return i;return-1},e.exports=i.Animation},{"../SpineUtil":40}],3:[function(t,e,n){var i=t("../SpineUtil");i.TrackEntry=t("./TrackEntry"),i.AnimationState=function(t){this.data=t,this.tracks=[],this.events=[]},i.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(t){t*=this.timeScale;for(var e=0;e<this.tracks.length;e++){var n=this.tracks[e];if(n){if(n.time+=t*n.timeScale,n.previous){var i=t*n.previous.timeScale;n.previous.time+=i,n.mixTime+=i}var a=n.next;a?(a.time=n.lastTime-a.delay,a.time>=0&&this.setCurrent(e,a)):!n.loop&&n.lastTime>=n.endTime&&this.clearTrack(e)}}},apply:function(t){t.resetDrawOrder();for(var e=0;e<this.tracks.length;e++){var n=this.tracks[e];if(n){this.events.length=0;var i=n.time,a=n.lastTime,r=n.endTime,s=n.loop;!s&&i>r&&(i=r);var o=n.previous;if(o){var h=o.time;!o.loop&&h>o.endTime&&(h=o.endTime),o.animation.apply(t,h,h,o.loop,null);var l=n.mixTime/n.mixDuration*n.mix;l>=1&&(l=1,n.previous=null),n.animation.mix(t,n.lastTime,i,s,this.events,l)}else 1==n.mix?n.animation.apply(t,n.lastTime,i,s,this.events):n.animation.mix(t,n.lastTime,i,s,this.events,n.mix);for(var u=0,m=this.events.length;m>u;u++){var f=this.events[u];n.onEvent&&n.onEvent(e,f),this.onEvent&&this.onEvent(e,f)}if(s?a%r>i%r:r>a&&i>=r){var c=Math.floor(i/r);n.onComplete&&n.onComplete(e,c),this.onComplete&&this.onComplete(e,c)}n.lastTime=n.time}}},clearTracks:function(){for(var t=0,e=this.tracks.length;e>t;t++)this.clearTrack(t);this.tracks.length=0},clearTrack:function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];e&&(e.onEnd&&e.onEnd(t),this.onEnd&&this.onEnd(t),this.tracks[t]=null)}},_expandToIndex:function(t){if(t<this.tracks.length)return this.tracks[t];for(;t>=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(t,e){var n=this._expandToIndex(t);if(n){var i=n.previous;n.previous=null,n.onEnd&&n.onEnd(t),this.onEnd&&this.onEnd(t),e.mixDuration=this.data.getMix(n.animation,e.animation),e.mixDuration>0&&(e.mixTime=0,i&&n.mixTime/n.mixDuration<.5?e.previous=i:e.previous=n)}this.tracks[t]=e,e.onStart&&e.onStart(t),this.onStart&&this.onStart(t)},setAnimationByName:function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(!i)throw"Animation not found: "+e;return this.setAnimation(t,i,n)},setAnimation:function(t,e,n){var a=new i.TrackEntry;return a.animation=e,a.loop=n,a.endTime=e.duration,this.setCurrent(t,a),a},addAnimationByName:function(t,e,n,i){var a=this.data.skeletonData.findAnimation(e);if(!a)throw"Animation not found: "+e;return this.addAnimation(t,a,n,i)},addAnimation:function(t,e,n,a){var r=new i.TrackEntry;r.animation=e,r.loop=n,r.endTime=e.duration;var s=this._expandToIndex(t);if(s){for(;s.next;)s=s.next;s.next=r}else this.tracks[t]=r;return 0>=a&&(s?a+=s.endTime-this.data.getMix(s.animation,e):a=0),r.delay=a,r},getCurrent:function(t){return t>=this.tracks.length?null:this.tracks[t]}},e.exports=i.AnimationState},{"../SpineUtil":40,"./TrackEntry":36}],4:[function(t,e,n){var i=t("../SpineUtil");i.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},i.AnimationStateData.prototype={defaultMix:0,setMixByName:function(t,e,n){var i=this.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;var a=this.skeletonData.findAnimation(e);if(!a)throw"Animation not found: "+e;this.setMix(i,a,n)},setMix:function(t,e,n){this.animationToMixTime[t.name+":"+e.name]=n},getMix:function(t,e){var n=t.name+":"+e.name;return this.animationToMixTime.hasOwnProperty(n)?this.animationToMixTime[n]:this.defaultMix}},e.exports=i.AnimationStateData},{"../SpineUtil":40}],5:[function(t,e,n){var i=t("../SpineUtil");i.AtlasReader=t("./AtlasReader"),i.AtlasPage=t("./AtlasPage"),i.AtlasRegion=t("./AtlasRegion");var a=t("../loaders/syncImageLoaderAdapter.js");i.Atlas=function(t,e,n){this.pages=[],this.regions=[],"string"==typeof t&&this.addSpineAtlas.call(this,t,e,n)},i.Atlas.prototype={addTexture:function(t,e){for(var n=this.pages,i=null,a=0;a<n.length;a++)if(n[a].rendererObject===e.baseTexture){i=n[a];break}if(null===i){i=new AtlasPage,i.name="texturePage";var r=e.baseTexture;i.width=r.realWidth,i.height=r.realHeight,i.rendererObject=r,i.format="RGBA8888",i.minFilter=i.magFilter="Nearest",i.uWrap=Atlas.TextureWrap.clampToEdge,i.vWrap=Atlas.TextureWrap.clampToEdge,n.push(i)}var s=new AtlasRegion;return s.name=t,s.page=i,s.rendererObject=e,s.index=-1,this.regions.push(s),s},addTextureHash:function(t){for(var e in t)t.hasOwnProperty(e)&&this.addTexture(e,t[e])},addSpineAtlas:function(t,e,n){function r(){for(;;){var t=l.readLine();if(null===t)return n&&n(h);if(t=l.trim(t),t.length){if(!m){m=new i.AtlasPage,m.name=t,2==l.readTuple(u)&&(m.width=parseInt(u[0]),m.height=parseInt(u[1]),l.readTuple(u)),m.format=i.Atlas.Format[u[0]],l.readTuple(u),m.minFilter=i.Atlas.TextureFilter[u[0]],m.magFilter=i.Atlas.TextureFilter[u[1]];var a=l.readValue();m.uWrap=i.Atlas.TextureWrap.clampToEdge,m.vWrap=i.Atlas.TextureWrap.clampToEdge,"x"==a?m.uWrap=i.Atlas.TextureWrap.repeat:"y"==a?m.vWrap=i.Atlas.TextureWrap.repeat:"xy"==a&&(m.uWrap=m.vWrap=i.Atlas.TextureWrap.repeat),e(t,function(t){m.rendererObject=t,h.pages.push(m),m.width&&m.height||(m.width=t.realWidth,m.height=t.realHeight,m.width&&m.height||console.log("ERROR spine atlas page "+m.name+": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)")),r()});break}var s=new i.AtlasRegion;s.name=t,s.page=m;var o="true"===l.readValue()?6:0;l.readTuple(u);var f=parseInt(u[0]),c=parseInt(u[1]);l.readTuple(u);var p=parseInt(u[0]),d=parseInt(u[1]),g=m.rendererObject.resolution;f/=g,c/=g,p/=g,d/=g;var v=new PIXI.Rectangle(f,c,o?d:p,o?p:d);4==l.readTuple(u)&&(s.splits=[parseInt(u[0]),parseInt(u[1]),parseInt(u[2]),parseInt(u[3])],4==l.readTuple(u)&&(s.pads=[parseInt(u[0]),parseInt(u[1]),parseInt(u[2]),parseInt(u[3])],l.readTuple(u)));var x=parseInt(u[0])/g,A=parseInt(u[1])/g;l.readTuple(u);var y=parseInt(u[0])/g,S=parseInt(u[1])/g,T=new PIXI.Rectangle(0,0,x,A),b=new PIXI.Rectangle(y,A-d-S,p,d);if("4"==PIXI.VERSION[0])s.texture=new PIXI.Texture(s.page.rendererObject,v,T,b,o);else{var w=new PIXI.Rectangle(f,c,p,d),I=w.clone();b.width=x,b.height=A,s.texture=new PIXI.Texture(s.page.rendererObject,w,I,b,o)}s.index=parseInt(l.readValue()),h.regions.push(s)}else m=null}}if("function"!=typeof e){var s=e,o=n;e=a(s,o),n=null}this.texturesLoading=0;var h=this,l=new i.AtlasReader(t),u=[];u.length=4;var m=null;r()},findRegion:function(t){for(var e=this.regions,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},dispose:function(){for(var t=this.pages,e=0,n=t.length;n>e;e++)t[e].rendererObject.destroy(!0)},updateUVs:function(t){for(var e=this.regions,n=0,i=e.length;i>n;n++){var a=e[n];a.page==t&&a.texture._updateUvs()}}},i.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},i.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},i.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},e.exports=i.Atlas},{"../SpineUtil":40,"../loaders/syncImageLoaderAdapter.js":46,"./AtlasPage":7,"./AtlasReader":8,"./AtlasRegion":9}],6:[function(t,e,n){var i=t("../SpineUtil");i.RegionAttachment=t("./RegionAttachment"),i.MeshAttachment=t("./MeshAttachment"),i.WeightedMeshAttachment=t("./WeightedMeshAttachment"),i.BoundingBoxAttachment=t("./BoundingBoxAttachment"),i.AtlasAttachmentParser=function(t){this.atlas=t},i.AtlasAttachmentParser.prototype={newRegionAttachment:function(t,e,n){var a=this.atlas.findRegion(n);if(!a)throw"Region not found in atlas: "+n+" (region attachment: "+e+")";var r=new i.RegionAttachment(e);return r.rendererObject=a,r.setUVs(a.u,a.v,a.u2,a.v2,a.rotate),r.regionOffsetX=a.offsetX,r.regionOffsetY=a.spineOffsetY,r.regionWidth=a.width,r.regionHeight=a.height,r.regionOriginalWidth=a.originalWidth,r.regionOriginalHeight=a.originalHeight,r},newMeshAttachment:function(t,e,n){var a=this.atlas.findRegion(n);if(!a)throw"Region not found in atlas: "+n+" (mesh attachment: "+e+")";var r=new i.MeshAttachment(e);return r.rendererObject=a,r},newWeightedMeshAttachment:function(t,e,n){var a=this.atlas.findRegion(n);if(!a)throw"Region not found in atlas: "+n+" (skinned mesh attachment: "+e+")";var r=new i.WeightedMeshAttachment(e);return r.rendererObject=a,r},newBoundingBoxAttachment:function(t,e){return new i.BoundingBoxAttachment(e)}},e.exports=i.AtlasAttachmentParser},{"../SpineUtil":40,"./BoundingBoxAttachment":14,"./MeshAttachment":25,"./RegionAttachment":26,"./WeightedMeshAttachment":38}],7:[function(t,e,n){var i=t("../SpineUtil");i.AtlasPage=function(){},i.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},e.exports=i.AtlasPage},{"../SpineUtil":40}],8:[function(t,e,n){var i=t("../SpineUtil");i.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},i.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw"Invalid line: "+e;for(var i=0,a=n+1;3>i;i++){var r=e.indexOf(",",a);if(-1==r)break;t[i]=this.trim(e.substr(a,r-a)),a=r+1}return t[i]=this.trim(e.substring(a)),i+1}},e.exports=i.AtlasReader},{"../SpineUtil":40}],9:[function(t,e,n){var i=t("../SpineUtil");i.AtlasRegion=function(){},i.AtlasRegion.prototype={name:null,texture:null,page:null,index:0,splits:null,pads:null},Object.defineProperties(i.AtlasRegion.prototype,{x:{get:function(){return this.texture.frame.x}},y:{get:function(){return this.texture.frame.y}},width:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.width:t.trim?t.trim.width:t.orig.width}},height:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.height:t.trim?t.trim.height:t.orig.height}},u:{get:function(){return this.texture._uvs.x0}},v:{get:function(){return this.texture._uvs.y0}},u2:{get:function(){return this.texture._uvs.x2}},v2:{get:function(){return this.texture._uvs.y2}},rotate:{get:function(){return!!this.texture.rotate}},offsetX:{get:function(){var t=this.texture;return t.trim?t.trim.x:0}},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}},pixiOffsetY:{get:function(){var t=this.texture;return t.trim?t.trim.y:0}},spineOffsetY:{get:function(){var t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}},originalWidth:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.width:t.crop.width:t.orig.width}},originalHeight:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.height:t.crop.height:t.orig.height}}}),e.exports=i.AtlasRegion},{"../SpineUtil":40}],10:[function(t,e,n){var i=t("../SpineUtil");i.Curves=t("./Curves"),i.Animation=t("./Animation"),i.AttachmentTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},i.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},apply:function(t,e,n,a,r){var s=this.frames;if(n<s[0])return void(e>n&&this.apply(t,e,Number.MAX_VALUE,null,0));e>n&&(e=-1);var o=n>=s[s.length-1]?s.length-1:i.Animation.binarySearch1(s,n)-1;if(!(s[o]<e)){var h=this.attachmentNames[o];t.slots[this.slotIndex].setAttachment(h?t.getAttachmentBySlotIndex(this.slotIndex,h):null)}}},e.exports=i.AttachmentTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],11:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType={region:0,boundingbox:1,mesh:2,weightedmesh:3,skinnedmesh:3,linkedmesh:4,weightedlinkedmesh:5},e.exports=i.AttachmentType},{"../SpineUtil":40}],12:[function(t,e,n){var i=t("../SpineUtil");i.Bone=function(t,e,n){this.data=t,this.skeleton=e,this.parent=n,this.matrix=new PIXI.Matrix,this.setToSetupPose()},i.Bone.yDown=!1,i.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,worldSignX:1,worldSignY:1,updateWorldTransform:function(){var t=this.rotationIK,e=this.scaleX,n=this.scaleY,a=this.x,r=this.y,s=Math.cos(t*i.degRad),o=Math.sin(t*i.degRad),h=s*e,l=-o*n,u=o*e,m=s*n,f=this.parent,c=this.matrix,p=this.skeleton;if(!f)return p.flipX&&(a=-a,h=-h,l=-l),p.flipY!==i.Bone.yDown&&(r=-r,u=-u,m=-m),c.a=h,c.c=l,c.b=u,c.d=m,c.tx=a,c.ty=r,this.worldSignX=i.signum(e),void(this.worldSignY=i.signum(n));var d=f.matrix.a,g=f.matrix.c,v=f.matrix.b,x=f.matrix.d;c.tx=d*a+g*r+f.matrix.tx,c.ty=v*a+x*r+f.matrix.ty,this.worldSignX=f.worldSignX*i.signum(e),this.worldSignY=f.worldSignY*i.signum(n);var A=this.data;if(A.inheritRotation&&A.inheritScale)c.a=d*h+g*u,c.c=d*l+g*m,c.b=v*h+x*u,c.d=v*l+x*m;else if(A.inheritRotation){d=1,g=0,v=0,x=1;do{s=Math.cos(f.rotationIK*i.degRad),o=Math.sin(f.rotationIK*i.degRad);var y=d*s+g*o;if(g=d*-o+g*s,d=y,y=v*s+x*o,x=v*-o+x*s,v=y,!f.data.inheritRotation)break;f=f.parent}while(null!=f);c.a=d*h+g*u,c.c=d*l+g*m,c.b=v*h+x*u,c.d=v*l+x*m,p.flipX&&(c.a=-c.a,c.c=-c.c),p.flipY!==i.Bone.yDown&&(c.b=-c.b,c.d=-c.d)}else if(A.inheritScale){d=1,g=0,v=0,x=1;do{var S=f.rotation;s=Math.cos(S*i.degRad),o=Math.sin(S*i.degRad);var T=f.scaleX,b=f.scaleY,w=s*T,I=-o*b,k=o*T,C=s*b;if(y=d*w+g*k,g=d*I+g*C,d=y,y=v*w+x*k,x=v*I+x*C,v=y,0>T?S=-S:o=-o,y=d*s+g*o,g=d*-o+g*s,d=y,y=v*s+x*o,x=v*-o+x*s,v=y,!f.data.inheritScale)break;f=f.parent}while(null!=f);c.a=d*h+g*u,c.c=d*l+g*m,c.b=v*h+x*u,c.d=v*l+x*m,p.flipX&&(c.a=-c.a,c.c=-c.c),p.flipY!==i.Bone.yDown&&(c.b=-c.b,c.d=-c.d)}else c.a=h,c.c=l,c.b=u,c.d=m},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.rotationIK=this.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY},worldToLocal:function(t){var e=this.matrix,n=t[0]-e.tx,i=e.ty,a=1/(e.a*e.d-e.b*e.c);t[0]=n*e.a*a-i*e.c*a,t[1]=i*e.d*a-n*e.b*a},localToWorld:function(t){var e=t[0],n=t[1],i=this.matrix;t[0]=e*i.a+n*i.c+i.tx,t[1]=e*i.b+n*i.d+i.ty},getWorldRotationX:function(){return Math.atan2(this.matrix.b,this.matrix.a)*i.radDeg},getWorldRotationY:function(){return Math.atan2(this.matrix.d,this.matrix.c)*i.radDeg},getWorldScaleX:function(){var t=this.matrix.a,e=this.matrix.b;return Math.sqrt(t*t+e*e)},getWorldScaleY:function(){var t=this.matrix.c,e=this.matrix.d;return Math.sqrt(t*t+e*e)}},Object.defineProperties(i.Bone.prototype,{worldX:{get:function(){return this.matrix.tx}},worldY:{get:function(){return this.matrix.ty}}}),e.exports=i.Bone},{"../SpineUtil":40}],13:[function(t,e,n){var i=t("../SpineUtil");i.BoneData=function(t,e){this.name=t,this.parent=e},i.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0},e.exports=i.BoneData},{"../SpineUtil":40}],14:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType=t("./AttachmentType"),i.BoundingBoxAttachment=function(t){this.name=t,this.vertices=[]},i.BoundingBoxAttachment.prototype={type:i.AttachmentType.boundingbox,computeWorldVertices:function(t,e,n,i){t+=n.worldX,e+=n.worldY;for(var a=n.matrix.a,r=n.matrix.c,s=n.matrix.b,o=n.matrix.d,h=this.vertices,l=0,u=h.length;u>l;l+=2){var m=h[l],f=h[l+1];i[l]=m*a+f*r+t,i[l+1]=m*s+f*o+e}}},e.exports=i.BoundingBoxAttachment},{"../SpineUtil":40,"./AttachmentType":11}],15:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.ColorTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=5*t},i.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(t,e,n,i,a,r){t*=5,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=a,this.frames[t+4]=r},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o,h,l,u;if(n>=s[s.length-5]){var m=s.length-1;o=s[m-3],h=s[m-2],l=s[m-1],u=s[m]}else{var f=i.Animation.binarySearch(s,n,5),c=s[f-4],p=s[f-3],d=s[f-2],g=s[f-1],v=s[f],x=1-(n-v)/(s[f-5]-v);x=this.curves.getCurvePercent(f/5-1,x),o=c+(s[f+1]-c)*x,h=p+(s[f+2]-p)*x,l=d+(s[f+3]-d)*x,u=g+(s[f+4]-g)*x}var A=t.slots[this.slotIndex];1>r?(A.r+=(o-A.r)*r,A.g+=(h-A.g)*r,A.b+=(l-A.b)*r,A.a+=(u-A.a)*r):(A.r=o,A.g=h,A.b=l,A.a=u)}}},e.exports=i.ColorTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],16:[function(t,e,n){var i=t("../SpineUtil");i.Curves=function(t){this.curves=[]},i.Curves.prototype={setLinear:function(t){this.curves[19*t]=0},setStepped:function(t){this.curves[19*t]=1},setCurve:function(t,e,n,i,a){var r=.1,s=r*r,o=s*r,h=3*r,l=3*s,u=6*s,m=6*o,f=2*-e+i,c=2*-n+a,p=3*(e-i)+1,d=3*(n-a)+1,g=e*h+f*l+p*o,v=n*h+c*l+d*o,x=f*u+p*m,A=c*u+d*m,y=p*m,S=d*m,T=19*t,b=this.curves;b[T++]=2;for(var w=g,I=v,k=T+19-1;k>T;T+=2)b[T]=w,b[T+1]=I,g+=x,v+=A,x+=y,A+=S,w+=g,I+=v},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var n=this.curves,i=19*t,a=n[i];if(0===a)return e;if(1==a)return 0;i++;for(var r=0,s=i,o=i+19-1;o>i;i+=2)if(r=n[i],r>=e){var h,l;return i==s?(h=0,l=0):(h=n[i-2],l=n[i-1]),l+(n[i+1]-l)*(e-h)/(r-h)}var u=n[i-1];return u+(1-u)*(e-r)/(1-r)}},e.exports=i.Curves},{"../SpineUtil":40}],17:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.DrawOrderTimeline=function(t){this.frames=[],this.frames.length=t,this.drawOrders=[],this.drawOrders.length=t},i.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o;o=n>=s[s.length-1]?s.length-1:i.Animation.binarySearch1(s,n)-1;var h=t.drawOrder,l=(t.slots,this.drawOrders[o]);if(l)for(var u=0,m=l.length;m>u;u++)h[u]=l[u]}}},e.exports=i.DrawOrderTimeline},{"../SpineUtil":40,"./Animation":2}],18:[function(t,e,n){var i=t("../SpineUtil");i.Event=function(t){this.data=t},i.Event.prototype={intValue:0,floatValue:0,stringValue:null},e.exports=i.Event},{"../SpineUtil":40}],19:[function(t,e,n){var i=t("../SpineUtil");i.EventData=function(t){this.name=t},i.EventData.prototype={intValue:0,floatValue:0,stringValue:null},e.exports=i.EventData},{"../SpineUtil":40}],20:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.EventTimeline=function(t){this.frames=[],this.frames.length=t,this.events=[],this.events.length=t},i.EventTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.events[t]=n},apply:function(t,e,n,a,r){if(a){var s=this.frames,o=s.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,a,r),e=-1;else if(e>=s[o-1])return;if(!(n<s[0])){var h;if(e<s[0])h=0;else{h=i.Animation.binarySearch1(s,e);for(var l=s[h];h>0&&s[h-1]==l;)h--}for(var u=this.events;o>h&&n>=s[h];h++)a.push(u[h])}}}},e.exports=i.EventTimeline},{"../SpineUtil":40,"./Animation":2}],21:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.FfdTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.frameVertices=[],this.frameVertices.length=t},i.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},apply:function(t,e,n,a,r){var s=t.slots[this.slotIndex],o=s.attachment;if(!o||o.applyFFD&&o.applyFFD(this.attachment)){var h=this.frames;if(!(n<h[0])){var l=this.frameVertices,u=l[0].length,m=s.attachmentVertices;if(m.length!=u){m=s.attachmentVertices=[];for(var f=0;u>f;f++)m.push(0);r=1}if(n>=h[h.length-1]){var c=l[h.length-1];if(1>r)for(var p=0;u>p;p++)m[p]+=(c[p]-m[p])*r;else for(var p=0;u>p;p++)m[p]=c[p]}else{var d=i.Animation.binarySearch1(h,n),g=h[d],v=1-(n-g)/(h[d-1]-g);v=this.curves.getCurvePercent(d-1,0>v?0:v>1?1:v);var x=l[d-1],A=l[d];if(1>r)for(var p=0;u>p;p++){var y=x[p];m[p]+=(y+(A[p]-y)*v-m[p])*r}else for(var p=0;u>p;p++){var y=x[p];m[p]=y+(A[p]-y)*v}}}}}},e.exports=i.FfdTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],22:[function(t,e,n){var i=t("../SpineUtil");i.IkConstraint=function(t,e){this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=[];for(var n=0,i=t.bones.length;i>n;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)},i.IkConstraint.prototype={apply:function(){var t=this.target,e=this.bones;switch(e.length){case 1:i.IkConstraint.apply1(e[0],t.worldX,t.worldY,this.mix);break;case 2:i.IkConstraint.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}}},i.IkConstraint.apply1=function(t,e,n,a){var r=t.parent?t.parent.getWorldRotationX():0,s=t.rotation,o=Math.atan2(n-t.worldY,e-t.worldX)*i.radDeg-r;t.worldSignX!=t.worldSignY!=(t.skeleton.flipX!=(t.skeleton.flipY!=i.Bone.yDown))&&(o=360-o),o>180?o-=360:-180>o&&(o+=360),t.rotationIK=s+(o-s)*a},i.IkConstraint.apply2=function(t,e,n,a,r,s){if(0!=s){var o,h,l,u=t.x,m=t.y,f=t.scaleX,c=t.scaleY,p=e.scaleX,d=e.y;0>f?(f=-f,o=180,l=-1):(o=0,l=1),0>c&&(c=-c,l=-l),0>p?(p=-p,h=180):h=0;var g,v,x,A,y=t.parent,S=y.matrix;if(null==y)g=n-u,v=a-m,x=e.worldX-u,A=e.worldY-m;else{var T=S.a,b=S.c,w=S.b,I=S.d,k=1/(T*I-b*w),C=S.tx,D=S.ty,M=n-C,P=a-D;g=(M*I-P*b)*k-u,v=(P*T-M*w)*k-m,M=e.worldX-C,P=e.worldY-D,x=(M*I-P*b)*k-u,A=(P*T-M*w)*k-m}var O,U,X=Math.sqrt(x*x+A*A),E=e.data.length*p;t:if(Math.abs(f-c)<=1e-4){E*=f;var R=(g*g+v*v-X*X-E*E)/(2*X*E);-1>R?R=-1:R>1&&(R=1),U=Math.acos(R)*r;var T=X+E*R,B=E*Math.sin(U);O=Math.atan2(v*T-g*B,g*T+v*B)}else{d=0;var T=f*E,b=c*E,F=Math.atan2(v,g),Y=T*T,V=b*b,L=X*X,W=g*g+v*v,N=V*L+Y*W-Y*V,_=-2*V*X,j=V-Y,I=_*_-4*j*N;if(I>=0){var H=Math.sqrt(I);0>_&&(H=-H),H=-(_+H)/2;var q=H/j,K=N/H,J=Math.abs(q)<Math.abs(K)?q:K;if(W>=J*J){var P=Math.sqrt(W-J*J)*r;O=F-Math.atan2(P,J),U=Math.atan2(P/c,(J-X)/f);break t}}var z=0,G=1/0,$=0,Q=0,Z=0,tt=0,et=0,nt=0,M=X+T,it=M*M;it>tt&&(Z=0,tt=it,et=M),M=X-T,it=M*M,G>it&&(z=Math.PI,G=it,$=M);var at=Math.acos(-T*X/(Y-V));M=T*Math.cos(at)+X;var P=b*Math.sin(at);it=M*M+P*P,G>it&&(z=at,G=it,$=M,Q=P),it>tt&&(Z=at,tt=it,et=M,nt=P),(G+tt)/2>=W?(O=F-Math.atan2(Q*r,$),U=z*r):(O=F-Math.atan2(nt*r,et),U=Z*r)}var rt=Math.atan2(d,e.x)*l;O=(O-rt)*i.radDeg+o,U=(U+rt)*i.radDeg*l+h,O>180?O-=360:-180>O&&(O+=360),U>180?U-=360:-180>U&&(U+=360);var st=t.rotation;t.rotationIK=st+(O-st)*s,st=e.rotation,e.rotationIK=st+(U-st)*s}},e.exports=i.IkConstraint},{"../SpineUtil":40}],23:[function(t,e,n){var i=t("../SpineUtil")||{};i.IkConstraintData=function(t){this.name=t,this.bones=[]},i.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},e.exports=i.IkConstraintData},{"../SpineUtil":40}],24:[function(t,e,n){var i=t("../SpineUtil")||{};i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.IkConstraintTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.ikConstraints[this.ikConstraintIndex];if(n>=s[s.length-3])return o.mix+=(s[s.length-2]-o.mix)*r,void(o.bendDirection=s[s.length-1]);var h=i.Animation.binarySearch(s,n,3),l=s[h+-2],u=s[h],m=1-(n-u)/(s[h+-3]-u);m=this.curves.getCurvePercent(h/3-1,m);var f=l+(s[h+1]-l)*m;o.mix+=(f-o.mix)*r,o.bendDirection=s[h+-1]}}},e.exports=i.IkConstraintTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],25:[function(t,e,n){var i=t("../SpineUtil")||{};i.AttachmentType=t("./AttachmentType"),i.MeshAttachment=function(t){this.name=t},i.MeshAttachment.prototype={type:i.AttachmentType.mesh,parentMesh:null,inheritFFD:!1,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,edges:null,width:0,height:0,updateUVs:function(){var t=this.regionUVs.length;this.uvs&&this.uvs.length==t||(this.uvs=new i.Float32Array(t));var e=this.rendererObject;if(e)for(var n=e.texture,a=n._uvs,r=e.width,s=e.height,o=e.originalWidth,h=e.originalHeight,l=e.offsetX,u=e.pixiOffsetY,m=0;t>m;m+=2){var f=this.regionUVs[m],c=this.regionUVs[m+1];f=(f*o-l)/r,c=(c*h-u)/s,this.uvs[m]=(a.x0*(1-f)+a.x1*f)*(1-c)+(a.x3*(1-f)+a.x2*f)*c,this.uvs[m+1]=(a.y0*(1-f)+a.y1*f)*(1-c)+(a.y3*(1-f)+a.y2*f)*c}},computeWorldVertices:function(t,e,n,i){var a=n.bone;t+=a.worldX,e+=a.worldY;var r=a.matrix.a,s=a.matrix.c,o=a.matrix.b,h=a.matrix.d,l=this.vertices,u=l.length;n.attachmentVertices.length==u&&(l=n.attachmentVertices);for(var m=0;u>m;m+=2){var f=l[m],c=l[m+1];i[m]=f*r+c*s+t,i[m+1]=f*o+c*h+e}},applyFFD:function(t){return this===t||this.inheritFFD&&parentMesh===t},setParentMesh:function(t){this.parentMesh=t,null!=t&&(this.vertices=t.vertices,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength)}},e.exports=i.MeshAttachment},{"../SpineUtil":40,"./AttachmentType":11}],26:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType=t("./AttachmentType"),i.RegionAttachment=function(t){this.name=t,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},i.RegionAttachment.prototype={type:i.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,n,i,a){var r=this.uvs;a?(r[2]=t,r[3]=i,r[4]=t,r[5]=e,r[6]=n,r[7]=e,r[0]=n,r[1]=i):(r[0]=t,r[1]=i,r[2]=t,r[3]=e,r[4]=n,r[5]=e,r[6]=n,r[7]=i)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.regionOffsetX*t,a=-this.height/2*this.scaleY+this.regionOffsetY*e,r=n+this.regionWidth*t,s=a+this.regionHeight*e,o=this.rotation*i.degRad,h=Math.cos(o),l=Math.sin(o),u=n*h+this.x,m=n*l,f=a*h+this.y,c=a*l,p=r*h+this.x,d=r*l,g=s*h+this.y,v=s*l,x=this.offset;x[0]=u-c,x[1]=f+m,x[2]=u-v,x[3]=g+m,x[4]=p-v,x[5]=g+d,x[6]=p-c,x[7]=f+d},computeVertices:function(t,e,n,i){t+=n.worldX,e+=n.worldY;var a=n.matrix.a,r=n.matrix.c,s=n.matrix.b,o=n.matrix.d,h=this.offset;i[0]=h[0]*a+h[1]*r+t,i[1]=h[0]*s+h[1]*o+e,i[2]=h[2]*a+h[3]*r+t,i[3]=h[2]*s+h[3]*o+e,i[4]=h[4]*a+h[5]*r+t,i[5]=h[4]*s+h[5]*o+e,i[6]=h[6]*a+h[7]*r+t,i[7]=h[6]*s+h[7]*o+e}},e.exports=i.RegionAttachment},{"../SpineUtil":40,"./AttachmentType":11}],27:[function(t,e,n){var i=t("../SpineUtil")||{};i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.RotateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.bones[this.boneIndex];if(n>=s[s.length-2]){for(var h=o.data.rotation+s[s.length-1]-o.rotation;h>180;)h-=360;for(;-180>h;)h+=360;return void(o.rotation+=h*r)}var l=i.Animation.binarySearch(s,n,2),u=s[l-1],m=s[l],f=1-(n-m)/(s[l-2]-m);f=this.curves.getCurvePercent(l/2-1,f);for(var h=s[l+1]-u;h>180;)h-=360;for(;-180>h;)h+=360;for(h=o.data.rotation+(u+h*f)-o.rotation;h>180;)h-=360;for(;-180>h;)h+=360;o.rotation+=h*r}}},e.exports=i.RotateTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],28:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.ScaleTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.bones[this.boneIndex];if(n>=s[s.length-3])return o.scaleX+=(o.data.scaleX*s[s.length-2]-o.scaleX)*r,void(o.scaleY+=(o.data.scaleY*s[s.length-1]-o.scaleY)*r);var h=i.Animation.binarySearch(s,n,3),l=s[h-2],u=s[h-1],m=s[h],f=1-(n-m)/(s[h+-3]-m);f=this.curves.getCurvePercent(h/3-1,f),o.scaleX+=(o.data.scaleX*(l+(s[h+1]-l)*f)-o.scaleX)*r,o.scaleY+=(o.data.scaleY*(u+(s[h+2]-u)*f)-o.scaleY)*r}}},e.exports=i.ScaleTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],29:[function(t,e,n){var i=t("../SpineUtil");i.Bone=t("./Bone"),i.Slot=t("./Slot"),i.IkConstraint=t("./IkConstraint"),i.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,n=t.bones.length;n>e;e++){var a=t.bones[e],r=a.parent?this.bones[t.bones.indexOf(a.parent)]:null;this.bones.push(new i.Bone(a,this,r))}this.slots=[],this.drawOrder=[];for(var e=0,n=t.slots.length;n>e;e++){var s=t.slots[e],o=this.bones[t.bones.indexOf(s.boneData)],h=new i.Slot(s,o);this.slots.push(h),this.drawOrder.push(e)}this.ikConstraints=[];for(var e=0,n=t.ikConstraints.length;n>e;e++)this.ikConstraints.push(new i.IkConstraint(t.ikConstraints[e],this));this.boneCache=[],this.updateCache()},i.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var t=this.ikConstraints,e=t.length,n=e+1,i=this.boneCache;i.length>n&&(i.length=n);for(var a=0,r=i.length;r>a;a++)i[a].length=0;for(;i.length<n;)i[i.length]=[];var s=i[0],o=this.bones;t:for(var a=0,r=o.length;r>a;a++){var h=o[a],l=h;do{for(var u=0;e>u;u++)for(var m=t[u],f=m.bones[0],c=m.bones[m.bones.length-1];;){if(l==c){i[u].push(h),i[u+1].push(h);continue t}if(c==f)break;c=c.parent}l=l.parent}while(l);s[s.length]=h}},updateWorldTransform:function(){for(var t=this.bones,e=0,n=t.length;n>e;e++){var i=t[e];i.rotationIK=i.rotation}for(var e=0,a=this.boneCache.length-1;;){for(var r=this.boneCache[e],s=0,o=r.length;o>s;s++)r[s].updateWorldTransform();if(e==a)break;this.ikConstraints[e].apply(),e++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,n=t.length;n>e;e++)t[e].setToSetupPose();for(var i=this.ikConstraints,e=0,n=i.length;n>e;e++){var a=i[e];a.bendDirection=a.data.bendDirection,a.mix=a.data.mix}},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,n=t.length;n>e;e++)t[e].setToSetupPose(e);this.resetDrawOrder()},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},findBoneIndex:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return n; | ||
return-1},findSlot:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},findSlotIndex:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return n;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){if(t)if(this.skin)t._attachAll(this,this.skin);else for(var e=this.slots,n=0,i=e.length;i>n;n++){var a=e[n],r=a.data.attachmentName;if(r){var s=t.getAttachment(n,r);s&&a.setAttachment(s)}}this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var n=this.skin.getAttachment(t,e);if(n)return n}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var n=this.slots,i=0,a=n.length;a>i;i++){var r=n[i];if(r.data.name==t){var s=null;if(e&&(s=this.getAttachmentBySlotIndex(i,e),!s))throw"Attachment not found: "+e+", for slot: "+t;return void r.setAttachment(s)}}throw"Slot not found: "+t},findIkConstraint:function(t){for(var e=this.ikConstraints,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},update:function(t){this.time+=t},resetDrawOrder:function(){for(var t=0,e=this.drawOrder.length;e>t;t++)this.drawOrder[t]=t}},e.exports=i.Skeleton},{"../SpineUtil":40,"./Bone":12,"./IkConstraint":22,"./Slot":34}],30:[function(t,e,n){var i=t("../SpineRuntime")||{};i.AttachmentType=t("./AttachmentType"),i.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},i.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(t,e){var n=t.slots,a=n.length,r=t.x,s=t.y,o=this.boundingBoxes,h=this.polygonPool,l=this.polygons;o.length=0;for(var u=0,m=l.length;m>u;u++)h.push(l[u]);l.length=0;for(var u=0;a>u;u++){var f=n[u],c=f.attachment;if(c.type==i.AttachmentType.boundingbox){o.push(c);var p,d=h.length;d>0?(p=h[d-1],h.splice(d-1,1)):p=[],l.push(p),p.length=c.vertices.length,c.computeWorldVertices(r,s,f.bone,p)}}e&&this.aabbCompute()},aabbCompute:function(){for(var t=this.polygons,e=Number.MAX_VALUE,n=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE,r=0,s=t.length;s>r;r++)for(var o=t[r],h=0,l=o.length;l>h;h+=2){var u=o[h],m=o[h+1];e=Math.min(e,u),n=Math.min(n,m),i=Math.max(i,u),a=Math.max(a,m)}this.minX=e,this.minY=n,this.maxX=i,this.maxY=a},aabbContainsPoint:function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},aabbIntersectsSegment:function(t,e,n,i){var a=this.minX,r=this.minY,s=this.maxX,o=this.maxY;if(a>=t&&a>=n||r>=e&&r>=i||t>=s&&n>=s||e>=o&&i>=o)return!1;var h=(i-e)/(n-t),l=h*(a-t)+e;if(l>r&&o>l)return!0;if(l=h*(s-t)+e,l>r&&o>l)return!0;var u=(r-e)/h+t;return u>a&&s>u?!0:(u=(o-e)/h+t,u>a&&s>u)},aabbIntersectsSkeleton:function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},containsPoint:function(t,e){for(var n=this.polygons,i=0,a=n.length;a>i;i++)if(this.polygonContainsPoint(n[i],t,e))return this.boundingBoxes[i];return null},intersectsSegment:function(t,e,n,i){for(var a=this.polygons,r=0,s=a.length;s>r;r++)if(a[r].intersectsSegment(t,e,n,i))return this.boundingBoxes[r];return null},polygonContainsPoint:function(t,e,n){for(var i=t.length,a=i-2,r=!1,s=0;i>s;s+=2){var o=t[s+1],h=t[a+1];if(n>o&&h>=n||n>h&&o>=n){var l=t[s];l+(n-o)/(h-o)*(t[a]-l)<e&&(r=!r)}a=s}return r},polygonIntersectsSegment:function(t,e,n,i,a){for(var r=t.length,s=e-i,o=n-a,h=e*a-n*i,l=t[r-2],u=t[r-1],m=0;r>m;m+=2){var f=t[m],c=t[m+1],p=l*c-u*f,d=l-f,g=u-c,v=s*g-o*d,x=(h*d-s*p)/v;if((x>=l&&f>=x||x>=f&&l>=x)&&(x>=e&&i>=x||x>=i&&e>=x)){var A=(h*g-o*p)/v;if((A>=u&&c>=A||A>=c&&u>=A)&&(A>=n&&a>=A||A>=a&&n>=A))return!0}l=f,u=c}return!1},getPolygon:function(t){var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},e.exports=i.SkeletonBounds},{"../SpineRuntime":39,"./AttachmentType":11}],31:[function(t,e,n){var i=t("../SpineUtil");i.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[]},i.SkeletonData.prototype={name:null,defaultSkin:null,width:0,height:0,version:null,hash:null,findBone:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findBoneIndex:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].name==t)return n;return-1},findSlot:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].name==t)return this.slots[n];return null},findSlotIndex:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].name==t)return n;return-1},findSkin:function(t){for(var e=this.skins,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findEvent:function(t){for(var e=this.events,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findAnimation:function(t){for(var e=this.animations,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findIkConstraint:function(t){for(var e=this.ikConstraints,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null}},e.exports=i.SkeletonData},{"../SpineUtil":40}],32:[function(t,e,n){function i(t,e,n,i){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i}var a=t("../SpineUtil");a.SkeletonData=t("./SkeletonData"),a.BoneData=t("./BoneData"),a.IkConstraintData=t("./IkConstraintData"),a.SlotData=t("./SlotData"),a.Skin=t("./Skin"),a.EventData=t("./EventData"),a.AttachmentType=t("./AttachmentType"),a.ColorTimeline=t("./ColorTimeline"),a.AttachmentTimeline=t("./AttachmentTimeline"),a.RotateTimeline=t("./RotateTimeline"),a.ScaleTimeline=t("./ScaleTimeline"),a.TranslateTimeline=t("./TranslateTimeline"),a.IkConstraintTimeline=t("./IkConstraintTimeline"),a.FfdTimeline=t("./FfdTimeline"),a.DrawOrderTimeline=t("./DrawOrderTimeline"),a.EventTimeline=t("./EventTimeline"),a.Event=t("./Event"),a.Animation=t("./Animation"),a.SkeletonJsonParser=function(t){this.attachmentLoader=t,this.linkedMeshes=[]},a.SkeletonJsonParser.prototype={scale:1,readSkeletonData:function(t,e){var n=new a.SkeletonData;n.name=e;var i=t.skeleton;i&&(n.hash=i.hash,n.version=i.spine,n.width=i.width||0,n.height=i.height||0);for(var r=t.bones,s=0,o=r.length;o>s;s++){var h=r[s],l=null;if(h.parent&&(l=n.findBone(h.parent),!l))throw"Parent bone not found: "+h.parent;var u=new a.BoneData(h.name,l);u.length=(h.length||0)*this.scale,u.x=(h.x||0)*this.scale,u.y=(h.y||0)*this.scale,u.rotation=h.rotation||0,u.scaleX=h.hasOwnProperty("scaleX")?h.scaleX:1,u.scaleY=h.hasOwnProperty("scaleY")?h.scaleY:1,u.inheritScale=h.hasOwnProperty("inheritScale")?h.inheritScale:!0,u.inheritRotation=h.hasOwnProperty("inheritRotation")?h.inheritRotation:!0,n.bones.push(u)}var m=t.ik;if(m)for(var s=0,o=m.length;o>s;s++){for(var f=m[s],c=new a.IkConstraintData(f.name),r=f.bones,p=0,d=r.length;d>p;p++){var g=n.findBone(r[p]);if(!g)throw"IK bone not found: "+r[p];c.bones.push(g)}if(c.target=n.findBone(f.target),!c.target)throw"Target bone not found: "+f.target;c.bendDirection=!f.hasOwnProperty("bendPositive")||f.bendPositive?1:-1,c.mix=f.hasOwnProperty("mix")?f.mix:1,n.ikConstraints.push(c)}for(var v=t.slots,s=0,o=v.length;o>s;s++){var x=v[s],u=n.findBone(x.bone);if(!u)throw"Slot bone not found: "+x.bone;var A=new a.SlotData(x.name,u),y=x.color;y&&(A.r=this.toColor(y,0),A.g=this.toColor(y,1),A.b=this.toColor(y,2),A.a=this.toColor(y,3)),A.attachmentName=x.attachment,A.blendMode=x.blend&&a.SlotData.PIXI_BLEND_MODE_MAP[x.blend]||a.SlotData.PIXI_BLEND_MODE_MAP.normal,n.slots.push(A)}var S=t.skins;for(var T in S)if(S.hasOwnProperty(T)){var b=S[T],w=new a.Skin(T);for(var I in b)if(b.hasOwnProperty(I)){var k=n.findSlotIndex(I),C=b[I];for(var D in C)if(C.hasOwnProperty(D)){var M=this.readAttachment(w,k,D,C[D]);M&&w.addAttachment(k,D,M)}}n.skins.push(w),"default"==w.name&&(n.defaultSkin=w)}for(var P=this.linkedMeshes,s=0,o=P.size;o>s;s++){var O=P[s],w=O.skin?n.findSkin(O.skin):n.defaultSkin,l=w.getAttachment(O.slotIndex,O.parent);O.mesh.setParentMesh(l),O.mesh.updateUVs()}P.length=0;var U=t.events;for(var X in U)if(U.hasOwnProperty(X)){var E=U[X],R=new a.EventData(X);R.intValue=E["int"]||0,R.floatValue=E["float"]||0,R.stringValue=E.string||null,n.events.push(R)}var B=t.animations;for(var F in B)B.hasOwnProperty(F)&&this.readAnimation(F,B[F],n);return n},readAttachment:function(t,e,n,r){n=r.name||n;var s=a.AttachmentType[r.type||"region"],o=r.path||n,h=this.scale;if(s==a.AttachmentType.region){var l=this.attachmentLoader.newRegionAttachment(t,n,o);if(!l)return null;l.path=o,l.x=(r.x||0)*h,l.y=(r.y||0)*h,l.scaleX=r.hasOwnProperty("scaleX")?r.scaleX:1,l.scaleY=r.hasOwnProperty("scaleY")?r.scaleY:1,l.rotation=r.rotation||0,l.width=(r.width||0)*h,l.height=(r.height||0)*h;var u=r.color;return u&&(l.r=this.toColor(u,0),l.g=this.toColor(u,1),l.b=this.toColor(u,2),l.a=this.toColor(u,3)),l.updateOffset(),l}if(s==a.AttachmentType.boundingbox){for(var m=this.attachmentLoader.newBoundingBoxAttachment(t,n),f=r.vertices,c=0,p=f.length;p>c;c++)m.vertices.push(f[c]*h);return m}if(s==a.AttachmentType.mesh||s==a.AttachmentType.linkedmesh){var d=this.attachmentLoader.newMeshAttachment(t,n,o);if(!d)return null;d.path=o,u=r.color,u&&(d.r=this.toColor(u,0),d.g=this.toColor(u,1),d.b=this.toColor(u,2),d.a=this.toColor(u,3)),d.width=(r.width||0)*h,d.height=(r.height||0)*h;var g=r.parent;return g?(d.inheritFFD=!!r.ffd,this.linkedMeshes.push(new i(d,r.skin||null,e,g))):(d.vertices=this.getFloatArray(r,"vertices",h),d.triangles=this.getIntArray(r,"triangles"),d.regionUVs=this.getFloatArray(r,"uvs",1),d.updateUVs(),d.hullLength=2*(r.hull||0),r.edges&&(d.edges=this.getIntArray(r,"edges"))),d}if(s==a.AttachmentType.weightedmesh||s==a.AttachmentType.weightedlinkedmesh){var d=this.attachmentLoader.newWeightedMeshAttachment(t,n,o);if(!d)return null;d.path=o,u=r.color,u&&(d.r=this.toColor(u,0),d.g=this.toColor(u,1),d.b=this.toColor(u,2),d.a=this.toColor(u,3)),d.width=(r.width||0)*h,d.height=(r.height||0)*h;var g=r.parent;if(g)d.inheritFFD=!!r.ffd,this.linkedMeshes.push(new i(d,r.skin||null,e,g));else{for(var v=this.getFloatArray(r,"uvs",1),f=this.getFloatArray(r,"vertices",1),x=[],A=[],c=0,p=f.length;p>c;){var y=0|f[c++];A[A.length]=y;for(var S=c+4*y;S>c;)A[A.length]=f[c],x[x.length]=f[c+1]*h,x[x.length]=f[c+2]*h,x[x.length]=f[c+3],c+=4}d.bones=A,d.weights=x,d.triangles=this.getIntArray(r,"triangles"),d.regionUVs=v,d.updateUVs(),d.hullLength=2*(r.hull||0),r.edges&&(d.edges=this.getIntArray(r,"edges"))}return d}throw"Unknown attachment type: "+s},readAnimation:function(t,e,n){var i=[],r=0,s=e.slots;for(var o in s)if(s.hasOwnProperty(o)){var h=s[o],l=n.findSlotIndex(o);for(var u in h)if(h.hasOwnProperty(u)){var m=h[u];if("color"==u){var f=new a.ColorTimeline(m.length);f.slotIndex=l;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p],v=g.color,x=this.toColor(v,0),A=this.toColor(v,1),y=this.toColor(v,2),S=this.toColor(v,3);f.setFrame(c,g.time,x,A,y,S),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[5*f.getFrameCount()-5])}else{if("attachment"!=u)throw"Invalid timeline type for a slot: "+u+" ("+o+")";var f=new a.AttachmentTimeline(m.length);f.slotIndex=l;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p];f.setFrame(c++,g.time,g.name)}i.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}}}var T=e.bones;for(var b in T)if(T.hasOwnProperty(b)){var w=n.findBoneIndex(b);if(-1==w)throw"Bone not found: "+b;var I=T[b];for(var u in I)if(I.hasOwnProperty(u)){var m=I[u];if("rotate"==u){var f=new a.RotateTimeline(m.length);f.boneIndex=w;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p];f.setFrame(c,g.time,g.angle),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[2*f.getFrameCount()-2])}else{if("translate"!=u&&"scale"!=u)throw"flipX"==u||"flipY"==u?"flipX and flipY are not supported in spine v3: ("+b+")":"Invalid timeline type for a bone: "+u+" ("+b+")";var f,k=1;"scale"==u?f=new a.ScaleTimeline(m.length):(f=new a.TranslateTimeline(m.length),k=this.scale),f.boneIndex=w;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p],C=(g.x||0)*k,D=(g.y||0)*k;f.setFrame(c,g.time,C,D),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[3*f.getFrameCount()-3])}}}var M=e.ik;for(var P in M)if(M.hasOwnProperty(P)){var O=n.findIkConstraint(P),m=M[P],f=new a.IkConstraintTimeline(m.length);f.ikConstraintIndex=n.ikConstraints.indexOf(O);for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p],U=g.hasOwnProperty("mix")?g.mix:1,X=!g.hasOwnProperty("bendPositive")||g.bendPositive?1:-1;f.setFrame(c,g.time,U,X),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[3*f.getFrameCount()-3])}var E=e.ffd;for(var R in E){var B=n.findSkin(R),h=E[R];for(o in h){var l=n.findSlotIndex(o),F=h[o];for(var Y in F){var m=F[Y],f=new a.FfdTimeline(m.length),V=B.getAttachment(l,Y);if(!V)throw"FFD attachment not found: "+Y;f.slotIndex=l,f.attachment=V;var L,W=V.type==a.AttachmentType.mesh;L=W?V.vertices.length:V.weights.length/3*2;for(var c=0,p=0,d=m.length;d>p;p++){var N,g=m[p];if(g.vertices){var _=g.vertices;N=[];for(var j=0;L>j;++j)N.push(0);var H=g.offset||0,q=_.length;if(1==this.scale)for(var K=0;q>K;K++)N[K+H]=_[K];else for(var K=0;q>K;K++)N[K+H]=_[K]*this.scale;if(W)for(var J=V.vertices,K=0,q=N.length;q>K;K++)N[K]+=J[K]}else if(W)N=V.vertices;else{N=[];for(var j=0;L>j;++j)N.push(0)}f.setFrame(c,g.time,N),this.readCurve(f,c,g),c++}i[i.length]=f,r=Math.max(r,f.frames[f.getFrameCount()-1])}}}var z=e.drawOrder;if(z||(z=e.draworder),z){for(var f=new a.DrawOrderTimeline(z.length),G=n.slots.length,c=0,p=0,d=z.length;d>p;p++){var $=z[p],Q=null;if($.offsets){Q=[],Q.length=G;for(var K=G-1;K>=0;K--)Q[K]=-1;var Z=$.offsets,tt=[];tt.length=G-Z.length;for(var et=0,nt=0,K=0,q=Z.length;q>K;K++){var it=Z[K],l=n.findSlotIndex(it.slot);if(-1==l)throw"Slot not found: "+it.slot;for(;et!=l;)tt[nt++]=et++;Q[et+it.offset]=et++}for(;G>et;)tt[nt++]=et++;for(var K=G-1;K>=0;K--)-1==Q[K]&&(Q[K]=tt[--nt])}f.setFrame(c++,$.time,Q)}i.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}var at=e.events;if(at){for(var f=new a.EventTimeline(at.length),c=0,p=0,d=at.length;d>p;p++){var rt=at[p],st=n.findEvent(rt.name);if(!st)throw"Event not found: "+rt.name;var ot=new a.Event(st);ot.intValue=rt.hasOwnProperty("int")?rt["int"]:st.intValue,ot.floatValue=rt.hasOwnProperty("float")?rt["float"]:st.floatValue,ot.stringValue=rt.hasOwnProperty("string")?rt.string:st.stringValue,f.setFrame(c++,rt.time,ot)}i.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}n.animations.push(new a.Animation(t,i,r))},readCurve:function(t,e,n){var i=n.curve;i?"stepped"==i?t.curves.setStepped(e):i instanceof Array&&t.curves.setCurve(e,i[0],i[1],i[2],i[3]):t.curves.setLinear(e)},toColor:function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2*e+2),16)/255},getFloatArray:function(t,e,n){var i=t[e],r=new a.Float32Array(i.length),s=0,o=i.length;if(1==n)for(;o>s;s++)r[s]=i[s];else for(;o>s;s++)r[s]=i[s]*n;return r},getIntArray:function(t,e){for(var n=t[e],i=new a.Uint16Array(n.length),r=0,s=n.length;s>r;r++)i[r]=0|n[r];return i}},e.exports=a.SkeletonJsonParser},{"../SpineUtil":40,"./Animation":2,"./AttachmentTimeline":10,"./AttachmentType":11,"./BoneData":13,"./ColorTimeline":15,"./DrawOrderTimeline":17,"./Event":18,"./EventData":19,"./EventTimeline":20,"./FfdTimeline":21,"./IkConstraintData":23,"./IkConstraintTimeline":24,"./RotateTimeline":27,"./ScaleTimeline":28,"./SkeletonData":31,"./Skin":33,"./SlotData":35,"./TranslateTimeline":37}],33:[function(t,e,n){var i=t("../SpineUtil");i.Skin=function(t){this.name=t,this.attachments={}},i.Skin.prototype={addAttachment:function(t,e,n){this.attachments[t+":"+e]=n},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var n in e.attachments){var i=n.indexOf(":"),a=parseInt(n.substring(0,i)),r=n.substring(i+1),s=t.slots[a];if(s.attachment&&s.attachment.name==r){var o=this.getAttachment(a,r);o&&s.setAttachment(o)}}}},e.exports=i.Skin},{"../SpineUtil":40}],34:[function(t,e,n){var i=t("../SpineUtil");i.Slot=function(t,e){this.data=t,this.bone=e,this.setToSetupPose()},i.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(t){this.attachment=t,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(t){this._attachmentTime=this.bone.skeleton.time-t},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this.blendMode=t.blendMode;for(var e=this.bone.skeleton.data.slots,n=0,i=e.length;i>n;n++)if(e[n]==t){this.setAttachment(t.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(n,t.attachmentName):null);break}}},e.exports=i.Slot},{"../SpineUtil":40}],35:[function(t,e,n){var i=t("../SpineUtil");i.SlotData=function(t,e){this.name=t,this.boneData=e},i.SlotData.PIXI_BLEND_MODE_MAP={multiply:PIXI.BLEND_MODES.MULTIPLY,screen:PIXI.BLEND_MODES.SCREEN,additive:PIXI.BLEND_MODES.ADD,normal:PIXI.BLEND_MODES.NORMAL},i.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,blendMode:PIXI.BLEND_MODES.NORMAL},e.exports=i.SlotData},{"../SpineUtil":40}],36:[function(t,e,n){var i=t("../SpineUtil");i.TrackEntry=function(){},i.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},e.exports=i.TrackEntry},{"../SpineUtil":40}],37:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.TranslateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.bones[this.boneIndex];if(n>=s[s.length-3])return o.x+=(o.data.x+s[s.length-2]-o.x)*r,void(o.y+=(o.data.y+s[s.length-1]-o.y)*r);var h=i.Animation.binarySearch(s,n,3),l=s[h-2],u=s[h-1],m=s[h],f=1-(n-m)/(s[h+-3]-m);f=this.curves.getCurvePercent(h/3-1,f),o.x+=(o.data.x+l+(s[h+1]-l)*f-o.x)*r,o.y+=(o.data.y+u+(s[h+2]-u)*f-o.y)*r}}},e.exports=i.TranslateTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],38:[function(t,e,n){var i=t("../SpineUtil")||{};i.AttachmentType=t("./AttachmentType"),i.WeightedMeshAttachment=function(t){this.name=t},i.WeightedMeshAttachment.prototype={type:i.AttachmentType.weightedmesh,parentMesh:null,inheritFFD:!1,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,edges:null,width:0,height:0,updateUVs:function(t,e,n,a,r){var s=(this.regionU2-this.regionU,this.regionV2-this.regionV,this.regionUVs.length);this.uvs&&this.uvs.length==s||(this.uvs=new i.Float32Array(s));var o=this.rendererObject;if(o)for(var h=o.texture,l=h._uvs,u=o.width,m=o.height,f=o.originalWidth,c=o.originalHeight,p=o.offsetX,d=o.pixiOffsetY,g=0;s>g;g+=2){var t=this.regionUVs[g],e=this.regionUVs[g+1];t=(t*f-p)/u,e=(e*c-d)/m,this.uvs[g]=(l.x0*(1-t)+l.x1*t)*(1-e)+(l.x3*(1-t)+l.x2*t)*e,this.uvs[g+1]=(l.y0*(1-t)+l.y1*t)*(1-e)+(l.y3*(1-t)+l.y2*t)*e}},computeWorldVertices:function(t,e,n,i){var a,r,s,o,h,l,u,m=n.bone.skeleton.bones,f=this.weights,c=this.bones,p=0,d=0,g=0,v=0,x=c.length;if(n.attachmentVertices.length)for(var A=n.attachmentVertices;x>d;p+=2){for(r=0,s=0,a=c[d++]+d;a>d;d++,g+=3,v+=2)u=m[c[d]].matrix,o=f[g]+A[v],h=f[g+1]+A[v+1],l=f[g+2],r+=(o*u.a+h*u.c+u.tx)*l,s+=(o*u.b+h*u.d+u.ty)*l;i[p]=r+t,i[p+1]=s+e}else for(;x>d;p+=2){for(r=0,s=0,a=c[d++]+d;a>d;d++,g+=3)u=m[c[d]].matrix,o=f[g],h=f[g+1],l=f[g+2],r+=(o*u.a+h*u.c+u.tx)*l,s+=(o*u.b+h*u.d+u.ty)*l;i[p]=r+t,i[p+1]=s+e}},applyFFD:function(t){return this===t||this.inheritFFD&&parentMesh===t},setParentMesh:function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.weights=t.weights,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength)}},e.exports=i.WeightedMeshAttachment},{"../SpineUtil":40,"./AttachmentType":11}],39:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.AnimationStateData=t("./AnimationStateData"),i.AnimationState=t("./AnimationState"),i.AtlasAttachmentParser=t("./AtlasAttachmentParser"),i.Atlas=t("./Atlas"),i.AtlasPage=t("./AtlasPage"),i.AtlasReader=t("./AtlasReader"),i.AtlasRegion=t("./AtlasRegion"),i.AttachmentTimeline=t("./AttachmentTimeline"),i.AttachmentType=t("./AttachmentType"),i.BoneData=t("./BoneData"),i.Bone=t("./Bone"),i.BoundingBoxAttachment=t("./BoundingBoxAttachment"),i.ColorTimeline=t("./ColorTimeline"),i.Curves=t("./Curves"),i.DrawOrderTimeline=t("./DrawOrderTimeline"),i.EventData=t("./EventData"),i.Event=t("./Event"),i.EventTimeline=t("./EventTimeline"),i.FfdTimeline=t("./FfdTimeline"),i.IkConstraintData=t("./IkConstraintData"),i.IkConstraint=t("./IkConstraint"),i.IkConstraintTimeline=t("./IkConstraintTimeline"),i.MeshAttachment=t("./MeshAttachment"),i.RegionAttachment=t("./RegionAttachment"),i.RotateTimeline=t("./RotateTimeline"),i.ScaleTimeline=t("./ScaleTimeline"),i.SkeletonBounds=t("./SkeletonBounds"),i.SkeletonData=t("./SkeletonData"),i.Skeleton=t("./Skeleton"),i.SkeletonJsonParser=t("./SkeletonJsonParser"),i.Skin=t("./Skin.js"),i.WeightedMeshAttachment=t("./WeightedMeshAttachment"),i.SlotData=t("./SlotData"),i.Slot=t("./Slot"),i.TrackEntry=t("./TrackEntry"),i.TranslateTimeline=t("./TranslateTimeline"),e.exports=i},{"../SpineUtil":40,"./Animation":2,"./AnimationState":3,"./AnimationStateData":4,"./Atlas":5,"./AtlasAttachmentParser":6,"./AtlasPage":7,"./AtlasReader":8,"./AtlasRegion":9,"./AttachmentTimeline":10,"./AttachmentType":11,"./Bone":12,"./BoneData":13,"./BoundingBoxAttachment":14,"./ColorTimeline":15,"./Curves":16,"./DrawOrderTimeline":17,"./Event":18,"./EventData":19,"./EventTimeline":20,"./FfdTimeline":21,"./IkConstraint":22,"./IkConstraintData":23,"./IkConstraintTimeline":24,"./MeshAttachment":25,"./RegionAttachment":26,"./RotateTimeline":27,"./ScaleTimeline":28,"./Skeleton":29,"./SkeletonBounds":30,"./SkeletonData":31,"./SkeletonJsonParser":32,"./Skin.js":33,"./Slot":34,"./SlotData":35,"./TrackEntry":36,"./TranslateTimeline":37,"./WeightedMeshAttachment":38}],40:[function(t,e,n){e.exports={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array,signum:function(t){return t>0?1:0>t?-1:0}}},{}],41:[function(t,e,n){function i(t){if(PIXI.Container.call(this),!t)throw new Error("The spineData param is required.");if("string"==typeof t)throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=t,this.skeleton=new r.Skeleton(t),this.skeleton.updateWorldTransform(),this.stateData=new r.AnimationStateData(t),this.state=new r.AnimationState(this.stateData),this.slotContainers=[];for(var e=0,n=this.skeleton.slots.length;n>e;e++){var i=this.skeleton.slots[e],a=i.attachment,s=new PIXI.Container;if(this.slotContainers.push(s),this.addChild(s),a instanceof r.RegionAttachment){var o=a.rendererObject.name,h=this.createSprite(i,a);i.currentSprite=h,i.currentSpriteName=o,s.addChild(h)}else{if(!(a instanceof r.MeshAttachment))continue;var l=this.createMesh(i,a);i.currentMesh=l,i.currentMeshName=a.name,s.addChild(l)}}this.autoUpdate=!0}function a(){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}var r=t("../SpineRuntime"),s=t("../loaders/atlasParser");r.Bone.yDown=!0,i.fromAtlas=function(t){var e=s.AnimCache[t];if(!e)throw new Error('Spine data "'+t+'" does not exist in the animation cache');return new i(e)},i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,e.exports=i,i.globalAutoUpdate=!0,Object.defineProperties(i.prototype,{autoUpdate:{get:function(){return this.updateTransform===i.prototype.autoUpdateTransform},set:function(t){this.updateTransform=t?i.prototype.autoUpdateTransform:PIXI.Container.prototype.updateTransform}}}),i.prototype.update=function(t){this.state.update(t),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var e=this.skeleton.drawOrder,n=this.skeleton.slots,i=0,s=e.length;s>i;i++)this.children[i]=this.slotContainers[e[i]];for(i=0,s=n.length;s>i;i++){var o=n[i],h=o.attachment,l=this.slotContainers[i];if(h){var u=h.type;if(u===r.AttachmentType.region){if(h.rendererObject&&(!o.currentSpriteName||o.currentSpriteName!==h.rendererObject.name)){var m=h.rendererObject.name;if(void 0!==o.currentSprite&&(o.currentSprite.visible=!1),o.sprites=o.sprites||{},void 0!==o.sprites[m])o.sprites[m].visible=!0;else{var f=this.createSprite(o,h);l.addChild(f)}o.currentSprite=o.sprites[m],o.currentSpriteName=m}if(l.transform){l.transform._dirtyLocal||(l.transform=new PIXI.TransformStatic);var c=l.transform,p=c.localTransform;c._dirtyParentVersion=-1,c._dirtyLocal=1,c._versionLocal=1,o.bone.matrix.copy(p),p.tx+=o.bone.skeleton.x,p.ty+=o.bone.skeleton.y}else{var p=l.localTransform||new PIXI.Matrix;o.bone.matrix.copy(p),p.tx+=o.bone.skeleton.x,p.ty+=o.bone.skeleton.y,l.localTransform=p,l.displayObjectUpdateTransform=a}o.currentSprite.blendMode=o.blendMode,o.currentSprite.tint=PIXI.utils.rgb2hex([o.r,o.g,o.b])}else{if(u!==r.AttachmentType.skinnedmesh&&u!==r.AttachmentType.mesh){l.visible=!1;continue}if(!o.currentMeshName||o.currentMeshName!==h.name){var d=h.name;if(void 0!==o.currentMesh&&(o.currentMesh.visible=!1),o.meshes=o.meshes||{},void 0!==o.meshes[d])o.meshes[d].visible=!0;else{var g=this.createMesh(o,h);l.addChild(g)}o.currentMesh=o.meshes[d],o.currentMeshName=d}h.computeWorldVertices(o.bone.skeleton.x,o.bone.skeleton.y,o,o.currentMesh.vertices)}l.visible=!0,l.alpha=o.a}else l.visible=!1}},i.prototype.autoUpdateTransform=function(){if(i.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;PIXI.Container.prototype.updateTransform.call(this)},i.prototype.createSprite=function(t,e){var n=e.rendererObject,i=n.texture,a=new PIXI.Sprite(i);return a.scale.x=e.scaleX*e.width/n.originalWidth,a.scale.y=-e.scaleY*e.height/n.originalHeight,a.rotation=e.rotation*r.degRad,a.anchor.x=.5,a.anchor.y=.5,a.position.x=e.x,a.position.y=e.y,a.alpha=e.a,t.sprites=t.sprites||{},t.sprites[n.name]=a,a},i.prototype.createMesh=function(t,e){var n=e.rendererObject,i=n.page.rendererObject,a=new PIXI.Texture(i),r=new PIXI.mesh.Mesh(a,new Float32Array(e.uvs.length),new Float32Array(e.uvs),new Uint16Array(e.triangles),PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);return r.canvasPadding=1.5,r.alpha=e.a,t.meshes=t.meshes||{},t.meshes[e.name]=r,r}},{"../SpineRuntime":39,"../loaders/atlasParser":43}],42:[function(t,e,n){var i=t("./atlasParser");PIXI.loaders.Loader.addPixiMiddleware(i),PIXI.loader.use(i())},{"./atlasParser":43}],43:[function(t,e,n){var i=PIXI.loaders.Resource,a=t("../SpineRuntime"),r=t("./imageLoaderAdapter"),s=e.exports=function(){return function(t,e){if(!t.data||!t.isJson||!t.data.bones)return e();var n=t.url.substr(0,t.url.lastIndexOf("."))+".atlas";n=n.replace(this.baseUrl,"");var o={crossOrigin:t.crossOrigin,xhrType:i.XHR_RESPONSE_TYPE.TEXT,metadata:t.metadata?t.metadata.spineMetadata:null},h={crossOrigin:t.crossOrigin,metadata:t.metadata?t.metadata.imageMetadata:null},l=t.url.substr(0,t.url.lastIndexOf("/")+1);l=l.replace(this.baseUrl,"");var u=r(this,t.name+"_atlas_page_",l,h);this.add(t.name+"_atlas",n,o,function(n){new a.Atlas(this.xhr.responseText,u,function(n){var i=new a.SkeletonJsonParser(new a.AtlasAttachmentParser(n)),r=i.readSkeletonData(t.data);t.spineData=r,t.spineAtlas=n,s.enableCaching&&(s.AnimCache[t.name]=t.spineData),e()})})}};s.AnimCache={},s.enableCaching=!0},{"../SpineRuntime":39,"./imageLoaderAdapter":44}],44:[function(t,e,n){t("../SpineRuntime");e.exports=function(t,e,n,i){return n&&n.lastIndexOf("/")!==n.length-1&&(n+="/"),function(a,r){var s=e+a,o=n+a;t.add(s,o,i,function(t){r(t.texture.baseTexture)})}}},{"../SpineRuntime":39}],45:[function(t,e,n){e.exports={atlasParser:t("./atlasParser"),Loader:t("./Loader"),syncImageLoaderAdapter:t("./syncImageLoaderAdapter"),imageLoaderAdapter:t("./imageLoaderAdapter")}},{"./Loader":42,"./atlasParser":43,"./imageLoaderAdapter":44,"./syncImageLoaderAdapter":46}],46:[function(t,e,n){t("../SpineRuntime");e.exports=function(t,e){return t&&t.lastIndexOf("/")!==t.length-1&&(t+="/"),function(t,n){n(PIXI.BaseTexture.fromImage(t,e))}}},{"../SpineRuntime":39}]},{},[1]); | ||
!function t(e,n,i){function a(s,o){if(!n[s]){if(!e[s]){var h="function"==typeof require&&require;if(!o&&h)return h(s,!0);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return a(n?n:t)},u,u.exports,t,e,n,i)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(t,e,n){e.exports=PIXI.spine={Spine:t("./Spine"),SpineRuntime:t("./SpineRuntime"),loaders:t("./loaders")}},{"./Spine":41,"./SpineRuntime":39,"./loaders":45}],2:[function(t,e,n){var i=t("../SpineUtil");i.Animation=function(t,e,n){this.name=t,this.timelines=e,this.duration=n},i.Animation.prototype={apply:function(t,e,n,i,a){i&&0!=this.duration&&(n%=this.duration,e%=this.duration);for(var r=this.timelines,s=0,o=r.length;o>s;s++)r[s].apply(t,e,n,a,1)},mix:function(t,e,n,i,a,r){i&&0!=this.duration&&(n%=this.duration,e%=this.duration);for(var s=this.timelines,o=0,h=s.length;h>o;o++)s[o].apply(t,e,n,a,r)}},i.Animation.binarySearch=function(t,e,n){var i=0,a=Math.floor(t.length/n)-2;if(!a)return n;for(var r=a>>>1;;){if(t[(r+1)*n]<=e?i=r+1:a=r,i==a)return(i+1)*n;r=i+a>>>1}},i.Animation.binarySearch1=function(t,e){var n=0,i=t.length-2;if(!i)return 1;for(var a=i>>>1;;){if(t[a+1]<=e?n=a+1:i=a,n==i)return n+1;a=n+i>>>1}},i.Animation.linearSearch=function(t,e,n){for(var i=0,a=t.length-n;a>=i;i+=n)if(t[i]>e)return i;return-1},e.exports=i.Animation},{"../SpineUtil":40}],3:[function(t,e,n){var i=t("../SpineUtil");i.TrackEntry=t("./TrackEntry"),i.AnimationState=function(t){this.data=t,this.tracks=[],this.events=[]},i.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(t){t*=this.timeScale;for(var e=0;e<this.tracks.length;e++){var n=this.tracks[e];if(n){if(n.time+=t*n.timeScale,n.previous){var i=t*n.previous.timeScale;n.previous.time+=i,n.mixTime+=i}var a=n.next;a?(a.time=n.lastTime-a.delay,a.time>=0&&this.setCurrent(e,a)):!n.loop&&n.lastTime>=n.endTime&&this.clearTrack(e)}}},apply:function(t){t.resetDrawOrder();for(var e=0;e<this.tracks.length;e++){var n=this.tracks[e];if(n){this.events.length=0;var i=n.time,a=n.lastTime,r=n.endTime,s=n.loop;!s&&i>r&&(i=r);var o=n.previous;if(o){var h=o.time;!o.loop&&h>o.endTime&&(h=o.endTime),o.animation.apply(t,h,h,o.loop,null);var l=n.mixTime/n.mixDuration*n.mix;l>=1&&(l=1,n.previous=null),n.animation.mix(t,n.lastTime,i,s,this.events,l)}else 1==n.mix?n.animation.apply(t,n.lastTime,i,s,this.events):n.animation.mix(t,n.lastTime,i,s,this.events,n.mix);for(var u=0,m=this.events.length;m>u;u++){var f=this.events[u];n.onEvent&&n.onEvent(e,f),this.onEvent&&this.onEvent(e,f)}if(s?a%r>i%r:r>a&&i>=r){var c=Math.floor(i/r);n.onComplete&&n.onComplete(e,c),this.onComplete&&this.onComplete(e,c)}n.lastTime=n.time}}},clearTracks:function(){for(var t=0,e=this.tracks.length;e>t;t++)this.clearTrack(t);this.tracks.length=0},clearTrack:function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];e&&(e.onEnd&&e.onEnd(t),this.onEnd&&this.onEnd(t),this.tracks[t]=null)}},_expandToIndex:function(t){if(t<this.tracks.length)return this.tracks[t];for(;t>=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(t,e){var n=this._expandToIndex(t);if(n){var i=n.previous;n.previous=null,n.onEnd&&n.onEnd(t),this.onEnd&&this.onEnd(t),e.mixDuration=this.data.getMix(n.animation,e.animation),e.mixDuration>0&&(e.mixTime=0,i&&n.mixTime/n.mixDuration<.5?e.previous=i:e.previous=n)}this.tracks[t]=e,e.onStart&&e.onStart(t),this.onStart&&this.onStart(t)},setAnimationByName:function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(!i)throw"Animation not found: "+e;return this.setAnimation(t,i,n)},setAnimation:function(t,e,n){var a=new i.TrackEntry;return a.animation=e,a.loop=n,a.endTime=e.duration,this.setCurrent(t,a),a},addAnimationByName:function(t,e,n,i){var a=this.data.skeletonData.findAnimation(e);if(!a)throw"Animation not found: "+e;return this.addAnimation(t,a,n,i)},addAnimation:function(t,e,n,a){var r=new i.TrackEntry;r.animation=e,r.loop=n,r.endTime=e.duration;var s=this._expandToIndex(t);if(s){for(;s.next;)s=s.next;s.next=r}else this.tracks[t]=r;return 0>=a&&(s?a+=s.endTime-this.data.getMix(s.animation,e):a=0),r.delay=a,r},getCurrent:function(t){return t>=this.tracks.length?null:this.tracks[t]}},e.exports=i.AnimationState},{"../SpineUtil":40,"./TrackEntry":36}],4:[function(t,e,n){var i=t("../SpineUtil");i.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},i.AnimationStateData.prototype={defaultMix:0,setMixByName:function(t,e,n){var i=this.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;var a=this.skeletonData.findAnimation(e);if(!a)throw"Animation not found: "+e;this.setMix(i,a,n)},setMix:function(t,e,n){this.animationToMixTime[t.name+":"+e.name]=n},getMix:function(t,e){var n=t.name+":"+e.name;return this.animationToMixTime.hasOwnProperty(n)?this.animationToMixTime[n]:this.defaultMix}},e.exports=i.AnimationStateData},{"../SpineUtil":40}],5:[function(t,e,n){var i=t("../SpineUtil");i.AtlasReader=t("./AtlasReader"),i.AtlasPage=t("./AtlasPage"),i.AtlasRegion=t("./AtlasRegion");var a=t("../loaders/syncImageLoaderAdapter.js");i.Atlas=function(t,e,n){this.pages=[],this.regions=[],"string"==typeof t&&this.addSpineAtlas.call(this,t,e,n)},i.Atlas.prototype={addTexture:function(t,e){for(var n=this.pages,a=null,r=0;r<n.length;r++)if(n[r].rendererObject===e.baseTexture){a=n[r];break}if(null===a){a=new i.AtlasPage,a.name="texturePage";var s=e.baseTexture;a.width=s.realWidth,a.height=s.realHeight,a.rendererObject=s,a.format="RGBA8888",a.minFilter=a.magFilter="Nearest",a.uWrap=i.Atlas.TextureWrap.clampToEdge,a.vWrap=i.Atlas.TextureWrap.clampToEdge,n.push(a)}var o=new i.AtlasRegion;return o.name=t,o.page=a,o.rendererObject=e,o.index=-1,this.regions.push(o),o},addTextureHash:function(t){for(var e in t)t.hasOwnProperty(e)&&this.addTexture(e,t[e])},addSpineAtlas:function(t,e,n){function r(){for(;;){var t=l.readLine();if(null===t)return n&&n(h);if(t=l.trim(t),t.length){if(!m){m=new i.AtlasPage,m.name=t,2==l.readTuple(u)&&(m.width=parseInt(u[0]),m.height=parseInt(u[1]),l.readTuple(u)),m.format=i.Atlas.Format[u[0]],l.readTuple(u),m.minFilter=i.Atlas.TextureFilter[u[0]],m.magFilter=i.Atlas.TextureFilter[u[1]];var a=l.readValue();m.uWrap=i.Atlas.TextureWrap.clampToEdge,m.vWrap=i.Atlas.TextureWrap.clampToEdge,"x"==a?m.uWrap=i.Atlas.TextureWrap.repeat:"y"==a?m.vWrap=i.Atlas.TextureWrap.repeat:"xy"==a&&(m.uWrap=m.vWrap=i.Atlas.TextureWrap.repeat),e(t,function(t){m.rendererObject=t,t.hasLoaded||(t.width=m.width,t.height=m.height),h.pages.push(m),m.width&&m.height||(m.width=t.realWidth,m.height=t.realHeight,m.width&&m.height||console.log("ERROR spine atlas page "+m.name+": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)")),r()});break}var s=new i.AtlasRegion;s.name=t,s.page=m;var o="true"===l.readValue()?6:0;l.readTuple(u);var f=parseInt(u[0]),c=parseInt(u[1]);l.readTuple(u);var p=parseInt(u[0]),d=parseInt(u[1]),g=m.rendererObject.resolution;f/=g,c/=g,p/=g,d/=g;var v=new PIXI.Rectangle(f,c,o?d:p,o?p:d);4==l.readTuple(u)&&(s.splits=[parseInt(u[0]),parseInt(u[1]),parseInt(u[2]),parseInt(u[3])],4==l.readTuple(u)&&(s.pads=[parseInt(u[0]),parseInt(u[1]),parseInt(u[2]),parseInt(u[3])],l.readTuple(u)));var x=parseInt(u[0])/g,A=parseInt(u[1])/g;l.readTuple(u);var y=parseInt(u[0])/g,S=parseInt(u[1])/g,T=new PIXI.Rectangle(0,0,x,A),w=new PIXI.Rectangle(y,A-d-S,p,d);if("4"==PIXI.VERSION[0])s.texture=new PIXI.Texture(s.page.rendererObject,v,T,w,o);else{var b=new PIXI.Rectangle(f,c,p,d),I=b.clone();w.width=x,w.height=A,s.texture=new PIXI.Texture(s.page.rendererObject,b,I,w,o)}s.index=parseInt(l.readValue()),s.texture._updateUvs(),h.regions.push(s)}else m=null}}if("function"!=typeof e){var s=e,o=n;e=a(s,o),n=null}this.texturesLoading=0;var h=this,l=new i.AtlasReader(t),u=[];u.length=4;var m=null;r()},findRegion:function(t){for(var e=this.regions,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},dispose:function(){for(var t=this.pages,e=0,n=t.length;n>e;e++)t[e].rendererObject.destroy(!0)},updateUVs:function(t){for(var e=this.regions,n=0,i=e.length;i>n;n++){var a=e[n];a.page==t&&a.texture._updateUvs()}}},i.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},i.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},i.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},e.exports=i.Atlas},{"../SpineUtil":40,"../loaders/syncImageLoaderAdapter.js":46,"./AtlasPage":7,"./AtlasReader":8,"./AtlasRegion":9}],6:[function(t,e,n){var i=t("../SpineUtil");i.RegionAttachment=t("./RegionAttachment"),i.MeshAttachment=t("./MeshAttachment"),i.WeightedMeshAttachment=t("./WeightedMeshAttachment"),i.BoundingBoxAttachment=t("./BoundingBoxAttachment"),i.AtlasAttachmentParser=function(t){this.atlas=t},i.AtlasAttachmentParser.prototype={newRegionAttachment:function(t,e,n){var a=this.atlas.findRegion(n);if(!a)throw"Region not found in atlas: "+n+" (region attachment: "+e+")";var r=new i.RegionAttachment(e);return r.rendererObject=a,r.setUVs(a.u,a.v,a.u2,a.v2,a.rotate),r.regionOffsetX=a.offsetX,r.regionOffsetY=a.spineOffsetY,r.regionWidth=a.width,r.regionHeight=a.height,r.regionOriginalWidth=a.originalWidth,r.regionOriginalHeight=a.originalHeight,r},newMeshAttachment:function(t,e,n){var a=this.atlas.findRegion(n);if(!a)throw"Region not found in atlas: "+n+" (mesh attachment: "+e+")";var r=new i.MeshAttachment(e);return r.rendererObject=a,r},newWeightedMeshAttachment:function(t,e,n){var a=this.atlas.findRegion(n);if(!a)throw"Region not found in atlas: "+n+" (skinned mesh attachment: "+e+")";var r=new i.WeightedMeshAttachment(e);return r.rendererObject=a,r},newBoundingBoxAttachment:function(t,e){return new i.BoundingBoxAttachment(e)}},e.exports=i.AtlasAttachmentParser},{"../SpineUtil":40,"./BoundingBoxAttachment":14,"./MeshAttachment":25,"./RegionAttachment":26,"./WeightedMeshAttachment":38}],7:[function(t,e,n){var i=t("../SpineUtil");i.AtlasPage=function(){},i.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},e.exports=i.AtlasPage},{"../SpineUtil":40}],8:[function(t,e,n){var i=t("../SpineUtil");i.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},i.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw"Invalid line: "+e;for(var i=0,a=n+1;3>i;i++){var r=e.indexOf(",",a);if(-1==r)break;t[i]=this.trim(e.substr(a,r-a)),a=r+1}return t[i]=this.trim(e.substring(a)),i+1}},e.exports=i.AtlasReader},{"../SpineUtil":40}],9:[function(t,e,n){var i=t("../SpineUtil");i.AtlasRegion=function(){},i.AtlasRegion.prototype={name:null,texture:null,page:null,index:0,splits:null,pads:null},Object.defineProperties(i.AtlasRegion.prototype,{x:{get:function(){return this.texture.frame.x}},y:{get:function(){return this.texture.frame.y}},width:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.width:t.trim?t.trim.width:t.orig.width}},height:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.height:t.trim?t.trim.height:t.orig.height}},u:{get:function(){return this.texture._uvs.x0}},v:{get:function(){return this.texture._uvs.y0}},u2:{get:function(){return this.texture._uvs.x2}},v2:{get:function(){return this.texture._uvs.y2}},rotate:{get:function(){return!!this.texture.rotate}},offsetX:{get:function(){var t=this.texture;return t.trim?t.trim.x:0}},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}},pixiOffsetY:{get:function(){var t=this.texture;return t.trim?t.trim.y:0}},spineOffsetY:{get:function(){var t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}},originalWidth:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.width:t.crop.width:t.orig.width}},originalHeight:{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.height:t.crop.height:t.orig.height}}}),e.exports=i.AtlasRegion},{"../SpineUtil":40}],10:[function(t,e,n){var i=t("../SpineUtil");i.Curves=t("./Curves"),i.Animation=t("./Animation"),i.AttachmentTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},i.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},apply:function(t,e,n,a,r){var s=this.frames;if(n<s[0])return void(e>n&&this.apply(t,e,Number.MAX_VALUE,null,0));e>n&&(e=-1);var o=n>=s[s.length-1]?s.length-1:i.Animation.binarySearch1(s,n)-1;if(!(s[o]<e)){var h=this.attachmentNames[o];t.slots[this.slotIndex].setAttachment(h?t.getAttachmentBySlotIndex(this.slotIndex,h):null)}}},e.exports=i.AttachmentTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],11:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType={region:0,boundingbox:1,mesh:2,weightedmesh:3,skinnedmesh:3,linkedmesh:4,weightedlinkedmesh:5},e.exports=i.AttachmentType},{"../SpineUtil":40}],12:[function(t,e,n){var i=t("../SpineUtil");i.Bone=function(t,e,n){this.data=t,this.skeleton=e,this.parent=n,this.matrix=new PIXI.Matrix,this.setToSetupPose()},i.Bone.yDown=!1,i.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,worldSignX:1,worldSignY:1,updateWorldTransform:function(){var t=this.rotationIK,e=this.scaleX,n=this.scaleY,a=this.x,r=this.y,s=Math.cos(t*i.degRad),o=Math.sin(t*i.degRad),h=s*e,l=-o*n,u=o*e,m=s*n,f=this.parent,c=this.matrix,p=this.skeleton;if(!f)return p.flipX&&(a=-a,h=-h,l=-l),p.flipY!==i.Bone.yDown&&(r=-r,u=-u,m=-m),c.a=h,c.c=l,c.b=u,c.d=m,c.tx=a,c.ty=r,this.worldSignX=i.signum(e),void(this.worldSignY=i.signum(n));var d=f.matrix.a,g=f.matrix.c,v=f.matrix.b,x=f.matrix.d;c.tx=d*a+g*r+f.matrix.tx,c.ty=v*a+x*r+f.matrix.ty,this.worldSignX=f.worldSignX*i.signum(e),this.worldSignY=f.worldSignY*i.signum(n);var A=this.data;if(A.inheritRotation&&A.inheritScale)c.a=d*h+g*u,c.c=d*l+g*m,c.b=v*h+x*u,c.d=v*l+x*m;else if(A.inheritRotation){d=1,g=0,v=0,x=1;do{s=Math.cos(f.rotationIK*i.degRad),o=Math.sin(f.rotationIK*i.degRad);var y=d*s+g*o;if(g=d*-o+g*s,d=y,y=v*s+x*o,x=v*-o+x*s,v=y,!f.data.inheritRotation)break;f=f.parent}while(null!=f);c.a=d*h+g*u,c.c=d*l+g*m,c.b=v*h+x*u,c.d=v*l+x*m,p.flipX&&(c.a=-c.a,c.c=-c.c),p.flipY!==i.Bone.yDown&&(c.b=-c.b,c.d=-c.d)}else if(A.inheritScale){d=1,g=0,v=0,x=1;do{var S=f.rotation;s=Math.cos(S*i.degRad),o=Math.sin(S*i.degRad);var T=f.scaleX,w=f.scaleY,b=s*T,I=-o*w,k=o*T,C=s*w;if(y=d*b+g*k,g=d*I+g*C,d=y,y=v*b+x*k,x=v*I+x*C,v=y,0>T?S=-S:o=-o,y=d*s+g*o,g=d*-o+g*s,d=y,y=v*s+x*o,x=v*-o+x*s,v=y,!f.data.inheritScale)break;f=f.parent}while(null!=f);c.a=d*h+g*u,c.c=d*l+g*m,c.b=v*h+x*u,c.d=v*l+x*m,p.flipX&&(c.a=-c.a,c.c=-c.c),p.flipY!==i.Bone.yDown&&(c.b=-c.b,c.d=-c.d)}else c.a=h,c.c=l,c.b=u,c.d=m},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.rotationIK=this.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY},worldToLocal:function(t){var e=this.matrix,n=t[0]-e.tx,i=e.ty,a=1/(e.a*e.d-e.b*e.c);t[0]=n*e.a*a-i*e.c*a,t[1]=i*e.d*a-n*e.b*a},localToWorld:function(t){var e=t[0],n=t[1],i=this.matrix;t[0]=e*i.a+n*i.c+i.tx,t[1]=e*i.b+n*i.d+i.ty},getWorldRotationX:function(){return Math.atan2(this.matrix.b,this.matrix.a)*i.radDeg},getWorldRotationY:function(){return Math.atan2(this.matrix.d,this.matrix.c)*i.radDeg},getWorldScaleX:function(){var t=this.matrix.a,e=this.matrix.b;return Math.sqrt(t*t+e*e)},getWorldScaleY:function(){var t=this.matrix.c,e=this.matrix.d;return Math.sqrt(t*t+e*e)}},Object.defineProperties(i.Bone.prototype,{worldX:{get:function(){return this.matrix.tx}},worldY:{get:function(){return this.matrix.ty}}}),e.exports=i.Bone},{"../SpineUtil":40}],13:[function(t,e,n){var i=t("../SpineUtil");i.BoneData=function(t,e){this.name=t,this.parent=e},i.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0},e.exports=i.BoneData},{"../SpineUtil":40}],14:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType=t("./AttachmentType"),i.BoundingBoxAttachment=function(t){this.name=t,this.vertices=[]},i.BoundingBoxAttachment.prototype={type:i.AttachmentType.boundingbox,computeWorldVertices:function(t,e,n,i){t+=n.worldX,e+=n.worldY;for(var a=n.matrix.a,r=n.matrix.c,s=n.matrix.b,o=n.matrix.d,h=this.vertices,l=0,u=h.length;u>l;l+=2){var m=h[l],f=h[l+1];i[l]=m*a+f*r+t,i[l+1]=m*s+f*o+e}}},e.exports=i.BoundingBoxAttachment},{"../SpineUtil":40,"./AttachmentType":11}],15:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.ColorTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=5*t},i.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(t,e,n,i,a,r){t*=5,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=a,this.frames[t+4]=r},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o,h,l,u;if(n>=s[s.length-5]){var m=s.length-1;o=s[m-3],h=s[m-2],l=s[m-1],u=s[m]}else{var f=i.Animation.binarySearch(s,n,5),c=s[f-4],p=s[f-3],d=s[f-2],g=s[f-1],v=s[f],x=1-(n-v)/(s[f-5]-v);x=this.curves.getCurvePercent(f/5-1,x),o=c+(s[f+1]-c)*x,h=p+(s[f+2]-p)*x,l=d+(s[f+3]-d)*x,u=g+(s[f+4]-g)*x}var A=t.slots[this.slotIndex];1>r?(A.r+=(o-A.r)*r,A.g+=(h-A.g)*r,A.b+=(l-A.b)*r,A.a+=(u-A.a)*r):(A.r=o,A.g=h,A.b=l,A.a=u)}}},e.exports=i.ColorTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],16:[function(t,e,n){var i=t("../SpineUtil");i.Curves=function(t){this.curves=[]},i.Curves.prototype={setLinear:function(t){this.curves[19*t]=0},setStepped:function(t){this.curves[19*t]=1},setCurve:function(t,e,n,i,a){var r=.1,s=r*r,o=s*r,h=3*r,l=3*s,u=6*s,m=6*o,f=2*-e+i,c=2*-n+a,p=3*(e-i)+1,d=3*(n-a)+1,g=e*h+f*l+p*o,v=n*h+c*l+d*o,x=f*u+p*m,A=c*u+d*m,y=p*m,S=d*m,T=19*t,w=this.curves;w[T++]=2;for(var b=g,I=v,k=T+19-1;k>T;T+=2)w[T]=b,w[T+1]=I,g+=x,v+=A,x+=y,A+=S,b+=g,I+=v},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var n=this.curves,i=19*t,a=n[i];if(0===a)return e;if(1==a)return 0;i++;for(var r=0,s=i,o=i+19-1;o>i;i+=2)if(r=n[i],r>=e){var h,l;return i==s?(h=0,l=0):(h=n[i-2],l=n[i-1]),l+(n[i+1]-l)*(e-h)/(r-h)}var u=n[i-1];return u+(1-u)*(e-r)/(1-r)}},e.exports=i.Curves},{"../SpineUtil":40}],17:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.DrawOrderTimeline=function(t){this.frames=[],this.frames.length=t,this.drawOrders=[],this.drawOrders.length=t},i.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o;o=n>=s[s.length-1]?s.length-1:i.Animation.binarySearch1(s,n)-1;var h=t.drawOrder,l=(t.slots,this.drawOrders[o]);if(l)for(var u=0,m=l.length;m>u;u++)h[u]=l[u]}}},e.exports=i.DrawOrderTimeline},{"../SpineUtil":40,"./Animation":2}],18:[function(t,e,n){var i=t("../SpineUtil");i.Event=function(t){this.data=t},i.Event.prototype={intValue:0,floatValue:0,stringValue:null},e.exports=i.Event},{"../SpineUtil":40}],19:[function(t,e,n){var i=t("../SpineUtil");i.EventData=function(t){this.name=t},i.EventData.prototype={intValue:0,floatValue:0,stringValue:null},e.exports=i.EventData},{"../SpineUtil":40}],20:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.EventTimeline=function(t){this.frames=[],this.frames.length=t,this.events=[],this.events.length=t},i.EventTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.events[t]=n},apply:function(t,e,n,a,r){if(a){var s=this.frames,o=s.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,a,r),e=-1;else if(e>=s[o-1])return;if(!(n<s[0])){var h;if(e<s[0])h=0;else{h=i.Animation.binarySearch1(s,e);for(var l=s[h];h>0&&s[h-1]==l;)h--}for(var u=this.events;o>h&&n>=s[h];h++)a.push(u[h])}}}},e.exports=i.EventTimeline},{"../SpineUtil":40,"./Animation":2}],21:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.FfdTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.frameVertices=[],this.frameVertices.length=t},i.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},apply:function(t,e,n,a,r){var s=t.slots[this.slotIndex],o=s.attachment;if(!o||o.applyFFD&&o.applyFFD(this.attachment)){var h=this.frames;if(!(n<h[0])){var l=this.frameVertices,u=l[0].length,m=s.attachmentVertices;if(m.length!=u){m=s.attachmentVertices=[];for(var f=0;u>f;f++)m.push(0);r=1}if(n>=h[h.length-1]){var c=l[h.length-1];if(1>r)for(var p=0;u>p;p++)m[p]+=(c[p]-m[p])*r;else for(var p=0;u>p;p++)m[p]=c[p]}else{var d=i.Animation.binarySearch1(h,n),g=h[d],v=1-(n-g)/(h[d-1]-g);v=this.curves.getCurvePercent(d-1,0>v?0:v>1?1:v);var x=l[d-1],A=l[d];if(1>r)for(var p=0;u>p;p++){var y=x[p];m[p]+=(y+(A[p]-y)*v-m[p])*r}else for(var p=0;u>p;p++){var y=x[p];m[p]=y+(A[p]-y)*v}}}}}},e.exports=i.FfdTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],22:[function(t,e,n){var i=t("../SpineUtil");i.IkConstraint=function(t,e){this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=[];for(var n=0,i=t.bones.length;i>n;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)},i.IkConstraint.prototype={apply:function(){var t=this.target,e=this.bones;switch(e.length){case 1:i.IkConstraint.apply1(e[0],t.worldX,t.worldY,this.mix);break;case 2:i.IkConstraint.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}}},i.IkConstraint.apply1=function(t,e,n,a){var r=t.parent?t.parent.getWorldRotationX():0,s=t.rotation,o=Math.atan2(n-t.worldY,e-t.worldX)*i.radDeg-r;t.worldSignX!=t.worldSignY!=(t.skeleton.flipX!=(t.skeleton.flipY!=i.Bone.yDown))&&(o=360-o),o>180?o-=360:-180>o&&(o+=360),t.rotationIK=s+(o-s)*a},i.IkConstraint.apply2=function(t,e,n,a,r,s){if(0!=s){var o,h,l,u=t.x,m=t.y,f=t.scaleX,c=t.scaleY,p=e.scaleX,d=e.y;0>f?(f=-f,o=180,l=-1):(o=0,l=1),0>c&&(c=-c,l=-l),0>p?(p=-p,h=180):h=0;var g,v,x,A,y=t.parent,S=y.matrix;if(null==y)g=n-u,v=a-m,x=e.worldX-u,A=e.worldY-m;else{var T=S.a,w=S.c,b=S.b,I=S.d,k=1/(T*I-w*b),C=S.tx,D=S.ty,M=n-C,P=a-D;g=(M*I-P*w)*k-u,v=(P*T-M*b)*k-m,M=e.worldX-C,P=e.worldY-D,x=(M*I-P*w)*k-u,A=(P*T-M*b)*k-m}var O,U,X=Math.sqrt(x*x+A*A),E=e.data.length*p;t:if(Math.abs(f-c)<=1e-4){E*=f;var R=(g*g+v*v-X*X-E*E)/(2*X*E);-1>R?R=-1:R>1&&(R=1),U=Math.acos(R)*r;var T=X+E*R,B=E*Math.sin(U);O=Math.atan2(v*T-g*B,g*T+v*B)}else{d=0;var T=f*E,w=c*E,F=Math.atan2(v,g),Y=T*T,V=w*w,L=X*X,W=g*g+v*v,N=V*L+Y*W-Y*V,_=-2*V*X,j=V-Y,I=_*_-4*j*N;if(I>=0){var H=Math.sqrt(I);0>_&&(H=-H),H=-(_+H)/2;var q=H/j,K=N/H,J=Math.abs(q)<Math.abs(K)?q:K;if(W>=J*J){var P=Math.sqrt(W-J*J)*r;O=F-Math.atan2(P,J),U=Math.atan2(P/c,(J-X)/f);break t}}var z=0,G=1/0,$=0,Q=0,Z=0,tt=0,et=0,nt=0,M=X+T,it=M*M;it>tt&&(Z=0,tt=it,et=M),M=X-T,it=M*M,G>it&&(z=Math.PI,G=it,$=M);var at=Math.acos(-T*X/(Y-V));M=T*Math.cos(at)+X;var P=w*Math.sin(at);it=M*M+P*P,G>it&&(z=at,G=it,$=M,Q=P),it>tt&&(Z=at,tt=it,et=M,nt=P),(G+tt)/2>=W?(O=F-Math.atan2(Q*r,$),U=z*r):(O=F-Math.atan2(nt*r,et),U=Z*r)}var rt=Math.atan2(d,e.x)*l;O=(O-rt)*i.radDeg+o,U=(U+rt)*i.radDeg*l+h,O>180?O-=360:-180>O&&(O+=360),U>180?U-=360:-180>U&&(U+=360);var st=t.rotation;t.rotationIK=st+(O-st)*s,st=e.rotation,e.rotationIK=st+(U-st)*s}},e.exports=i.IkConstraint},{"../SpineUtil":40}],23:[function(t,e,n){var i=t("../SpineUtil")||{};i.IkConstraintData=function(t){this.name=t,this.bones=[]},i.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},e.exports=i.IkConstraintData},{"../SpineUtil":40}],24:[function(t,e,n){var i=t("../SpineUtil")||{};i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.IkConstraintTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.ikConstraints[this.ikConstraintIndex];if(n>=s[s.length-3])return o.mix+=(s[s.length-2]-o.mix)*r,void(o.bendDirection=s[s.length-1]);var h=i.Animation.binarySearch(s,n,3),l=s[h+-2],u=s[h],m=1-(n-u)/(s[h+-3]-u);m=this.curves.getCurvePercent(h/3-1,m);var f=l+(s[h+1]-l)*m;o.mix+=(f-o.mix)*r,o.bendDirection=s[h+-1]}}},e.exports=i.IkConstraintTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],25:[function(t,e,n){var i=t("../SpineUtil")||{};i.AttachmentType=t("./AttachmentType"),i.MeshAttachment=function(t){this.name=t},i.MeshAttachment.prototype={type:i.AttachmentType.mesh,parentMesh:null,inheritFFD:!1,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,edges:null,width:0,height:0,updateUVs:function(){var t=this.regionUVs.length;this.uvs&&this.uvs.length==t||(this.uvs=new i.Float32Array(t));var e=this.rendererObject;if(e)for(var n=e.texture,a=n._uvs,r=e.width,s=e.height,o=e.originalWidth,h=e.originalHeight,l=e.offsetX,u=e.pixiOffsetY,m=0;t>m;m+=2){var f=this.regionUVs[m],c=this.regionUVs[m+1];f=(f*o-l)/r,c=(c*h-u)/s,this.uvs[m]=(a.x0*(1-f)+a.x1*f)*(1-c)+(a.x3*(1-f)+a.x2*f)*c,this.uvs[m+1]=(a.y0*(1-f)+a.y1*f)*(1-c)+(a.y3*(1-f)+a.y2*f)*c}},computeWorldVertices:function(t,e,n,i){var a=n.bone;t+=a.worldX,e+=a.worldY;var r=a.matrix.a,s=a.matrix.c,o=a.matrix.b,h=a.matrix.d,l=this.vertices,u=l.length;n.attachmentVertices.length==u&&(l=n.attachmentVertices);for(var m=0;u>m;m+=2){var f=l[m],c=l[m+1];i[m]=f*r+c*s+t,i[m+1]=f*o+c*h+e}},applyFFD:function(t){return this===t||this.inheritFFD&&parentMesh===t},setParentMesh:function(t){this.parentMesh=t,null!=t&&(this.vertices=t.vertices,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength)}},e.exports=i.MeshAttachment},{"../SpineUtil":40,"./AttachmentType":11}],26:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType=t("./AttachmentType"),i.RegionAttachment=function(t){this.name=t,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},i.RegionAttachment.prototype={type:i.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,n,i,a){var r=this.uvs;a?(r[2]=t,r[3]=i,r[4]=t,r[5]=e,r[6]=n,r[7]=e,r[0]=n,r[1]=i):(r[0]=t,r[1]=i,r[2]=t,r[3]=e,r[4]=n,r[5]=e,r[6]=n,r[7]=i)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.regionOffsetX*t,a=-this.height/2*this.scaleY+this.regionOffsetY*e,r=n+this.regionWidth*t,s=a+this.regionHeight*e,o=this.rotation*i.degRad,h=Math.cos(o),l=Math.sin(o),u=n*h+this.x,m=n*l,f=a*h+this.y,c=a*l,p=r*h+this.x,d=r*l,g=s*h+this.y,v=s*l,x=this.offset;x[0]=u-c,x[1]=f+m,x[2]=u-v,x[3]=g+m,x[4]=p-v,x[5]=g+d,x[6]=p-c,x[7]=f+d},computeVertices:function(t,e,n,i){t+=n.worldX,e+=n.worldY;var a=n.matrix.a,r=n.matrix.c,s=n.matrix.b,o=n.matrix.d,h=this.offset;i[0]=h[0]*a+h[1]*r+t,i[1]=h[0]*s+h[1]*o+e,i[2]=h[2]*a+h[3]*r+t,i[3]=h[2]*s+h[3]*o+e,i[4]=h[4]*a+h[5]*r+t,i[5]=h[4]*s+h[5]*o+e,i[6]=h[6]*a+h[7]*r+t,i[7]=h[6]*s+h[7]*o+e}},e.exports=i.RegionAttachment},{"../SpineUtil":40,"./AttachmentType":11}],27:[function(t,e,n){var i=t("../SpineUtil")||{};i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.RotateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.bones[this.boneIndex];if(n>=s[s.length-2]){for(var h=o.data.rotation+s[s.length-1]-o.rotation;h>180;)h-=360;for(;-180>h;)h+=360;return void(o.rotation+=h*r)}var l=i.Animation.binarySearch(s,n,2),u=s[l-1],m=s[l],f=1-(n-m)/(s[l-2]-m);f=this.curves.getCurvePercent(l/2-1,f);for(var h=s[l+1]-u;h>180;)h-=360;for(;-180>h;)h+=360;for(h=o.data.rotation+(u+h*f)-o.rotation;h>180;)h-=360;for(;-180>h;)h+=360;o.rotation+=h*r}}},e.exports=i.RotateTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],28:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.ScaleTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.bones[this.boneIndex];if(n>=s[s.length-3])return o.scaleX+=(o.data.scaleX*s[s.length-2]-o.scaleX)*r,void(o.scaleY+=(o.data.scaleY*s[s.length-1]-o.scaleY)*r);var h=i.Animation.binarySearch(s,n,3),l=s[h-2],u=s[h-1],m=s[h],f=1-(n-m)/(s[h+-3]-m);f=this.curves.getCurvePercent(h/3-1,f),o.scaleX+=(o.data.scaleX*(l+(s[h+1]-l)*f)-o.scaleX)*r,o.scaleY+=(o.data.scaleY*(u+(s[h+2]-u)*f)-o.scaleY)*r}}},e.exports=i.ScaleTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],29:[function(t,e,n){var i=t("../SpineUtil");i.Bone=t("./Bone"),i.Slot=t("./Slot"),i.IkConstraint=t("./IkConstraint"),i.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,n=t.bones.length;n>e;e++){var a=t.bones[e],r=a.parent?this.bones[t.bones.indexOf(a.parent)]:null;this.bones.push(new i.Bone(a,this,r))}this.slots=[],this.drawOrder=[];for(var e=0,n=t.slots.length;n>e;e++){var s=t.slots[e],o=this.bones[t.bones.indexOf(s.boneData)],h=new i.Slot(s,o);this.slots.push(h),this.drawOrder.push(e)}this.ikConstraints=[];for(var e=0,n=t.ikConstraints.length;n>e;e++)this.ikConstraints.push(new i.IkConstraint(t.ikConstraints[e],this));this.boneCache=[],this.updateCache()},i.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var t=this.ikConstraints,e=t.length,n=e+1,i=this.boneCache;i.length>n&&(i.length=n);for(var a=0,r=i.length;r>a;a++)i[a].length=0;for(;i.length<n;)i[i.length]=[];var s=i[0],o=this.bones;t:for(var a=0,r=o.length;r>a;a++){var h=o[a],l=h;do{for(var u=0;e>u;u++)for(var m=t[u],f=m.bones[0],c=m.bones[m.bones.length-1];;){if(l==c){i[u].push(h),i[u+1].push(h);continue t}if(c==f)break;c=c.parent}l=l.parent}while(l);s[s.length]=h}},updateWorldTransform:function(){for(var t=this.bones,e=0,n=t.length;n>e;e++){var i=t[e];i.rotationIK=i.rotation}for(var e=0,a=this.boneCache.length-1;;){for(var r=this.boneCache[e],s=0,o=r.length;o>s;s++)r[s].updateWorldTransform();if(e==a)break;this.ikConstraints[e].apply(),e++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,n=t.length;n>e;e++)t[e].setToSetupPose();for(var i=this.ikConstraints,e=0,n=i.length;n>e;e++){var a=i[e];a.bendDirection=a.data.bendDirection,a.mix=a.data.mix}},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,n=t.length;n>e;e++)t[e].setToSetupPose(e);this.resetDrawOrder()},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n]; | ||
return null},findBoneIndex:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return n;return-1},findSlot:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},findSlotIndex:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return n;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){if(t)if(this.skin)t._attachAll(this,this.skin);else for(var e=this.slots,n=0,i=e.length;i>n;n++){var a=e[n],r=a.data.attachmentName;if(r){var s=t.getAttachment(n,r);s&&a.setAttachment(s)}}this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var n=this.skin.getAttachment(t,e);if(n)return n}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var n=this.slots,i=0,a=n.length;a>i;i++){var r=n[i];if(r.data.name==t){var s=null;if(e&&(s=this.getAttachmentBySlotIndex(i,e),!s))throw"Attachment not found: "+e+", for slot: "+t;return void r.setAttachment(s)}}throw"Slot not found: "+t},findIkConstraint:function(t){for(var e=this.ikConstraints,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},update:function(t){this.time+=t},resetDrawOrder:function(){for(var t=0,e=this.drawOrder.length;e>t;t++)this.drawOrder[t]=t}},e.exports=i.Skeleton},{"../SpineUtil":40,"./Bone":12,"./IkConstraint":22,"./Slot":34}],30:[function(t,e,n){var i=t("../SpineRuntime")||{};i.AttachmentType=t("./AttachmentType"),i.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},i.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(t,e){var n=t.slots,a=n.length,r=t.x,s=t.y,o=this.boundingBoxes,h=this.polygonPool,l=this.polygons;o.length=0;for(var u=0,m=l.length;m>u;u++)h.push(l[u]);l.length=0;for(var u=0;a>u;u++){var f=n[u],c=f.attachment;if(c.type==i.AttachmentType.boundingbox){o.push(c);var p,d=h.length;d>0?(p=h[d-1],h.splice(d-1,1)):p=[],l.push(p),p.length=c.vertices.length,c.computeWorldVertices(r,s,f.bone,p)}}e&&this.aabbCompute()},aabbCompute:function(){for(var t=this.polygons,e=Number.MAX_VALUE,n=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE,r=0,s=t.length;s>r;r++)for(var o=t[r],h=0,l=o.length;l>h;h+=2){var u=o[h],m=o[h+1];e=Math.min(e,u),n=Math.min(n,m),i=Math.max(i,u),a=Math.max(a,m)}this.minX=e,this.minY=n,this.maxX=i,this.maxY=a},aabbContainsPoint:function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},aabbIntersectsSegment:function(t,e,n,i){var a=this.minX,r=this.minY,s=this.maxX,o=this.maxY;if(a>=t&&a>=n||r>=e&&r>=i||t>=s&&n>=s||e>=o&&i>=o)return!1;var h=(i-e)/(n-t),l=h*(a-t)+e;if(l>r&&o>l)return!0;if(l=h*(s-t)+e,l>r&&o>l)return!0;var u=(r-e)/h+t;return u>a&&s>u?!0:(u=(o-e)/h+t,u>a&&s>u)},aabbIntersectsSkeleton:function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},containsPoint:function(t,e){for(var n=this.polygons,i=0,a=n.length;a>i;i++)if(this.polygonContainsPoint(n[i],t,e))return this.boundingBoxes[i];return null},intersectsSegment:function(t,e,n,i){for(var a=this.polygons,r=0,s=a.length;s>r;r++)if(a[r].intersectsSegment(t,e,n,i))return this.boundingBoxes[r];return null},polygonContainsPoint:function(t,e,n){for(var i=t.length,a=i-2,r=!1,s=0;i>s;s+=2){var o=t[s+1],h=t[a+1];if(n>o&&h>=n||n>h&&o>=n){var l=t[s];l+(n-o)/(h-o)*(t[a]-l)<e&&(r=!r)}a=s}return r},polygonIntersectsSegment:function(t,e,n,i,a){for(var r=t.length,s=e-i,o=n-a,h=e*a-n*i,l=t[r-2],u=t[r-1],m=0;r>m;m+=2){var f=t[m],c=t[m+1],p=l*c-u*f,d=l-f,g=u-c,v=s*g-o*d,x=(h*d-s*p)/v;if((x>=l&&f>=x||x>=f&&l>=x)&&(x>=e&&i>=x||x>=i&&e>=x)){var A=(h*g-o*p)/v;if((A>=u&&c>=A||A>=c&&u>=A)&&(A>=n&&a>=A||A>=a&&n>=A))return!0}l=f,u=c}return!1},getPolygon:function(t){var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},e.exports=i.SkeletonBounds},{"../SpineRuntime":39,"./AttachmentType":11}],31:[function(t,e,n){var i=t("../SpineUtil");i.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[]},i.SkeletonData.prototype={name:null,defaultSkin:null,width:0,height:0,version:null,hash:null,findBone:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findBoneIndex:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].name==t)return n;return-1},findSlot:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].name==t)return this.slots[n];return null},findSlotIndex:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].name==t)return n;return-1},findSkin:function(t){for(var e=this.skins,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findEvent:function(t){for(var e=this.events,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findAnimation:function(t){for(var e=this.animations,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findIkConstraint:function(t){for(var e=this.ikConstraints,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null}},e.exports=i.SkeletonData},{"../SpineUtil":40}],32:[function(t,e,n){function i(t,e,n,i){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i}var a=t("../SpineUtil");a.SkeletonData=t("./SkeletonData"),a.BoneData=t("./BoneData"),a.IkConstraintData=t("./IkConstraintData"),a.SlotData=t("./SlotData"),a.Skin=t("./Skin"),a.EventData=t("./EventData"),a.AttachmentType=t("./AttachmentType"),a.ColorTimeline=t("./ColorTimeline"),a.AttachmentTimeline=t("./AttachmentTimeline"),a.RotateTimeline=t("./RotateTimeline"),a.ScaleTimeline=t("./ScaleTimeline"),a.TranslateTimeline=t("./TranslateTimeline"),a.IkConstraintTimeline=t("./IkConstraintTimeline"),a.FfdTimeline=t("./FfdTimeline"),a.DrawOrderTimeline=t("./DrawOrderTimeline"),a.EventTimeline=t("./EventTimeline"),a.Event=t("./Event"),a.Animation=t("./Animation"),a.SkeletonJsonParser=function(t){this.attachmentLoader=t,this.linkedMeshes=[]},a.SkeletonJsonParser.prototype={scale:1,readSkeletonData:function(t,e){var n=new a.SkeletonData;n.name=e;var i=t.skeleton;i&&(n.hash=i.hash,n.version=i.spine,n.width=i.width||0,n.height=i.height||0);for(var r=t.bones,s=0,o=r.length;o>s;s++){var h=r[s],l=null;if(h.parent&&(l=n.findBone(h.parent),!l))throw"Parent bone not found: "+h.parent;var u=new a.BoneData(h.name,l);u.length=(h.length||0)*this.scale,u.x=(h.x||0)*this.scale,u.y=(h.y||0)*this.scale,u.rotation=h.rotation||0,u.scaleX=h.hasOwnProperty("scaleX")?h.scaleX:1,u.scaleY=h.hasOwnProperty("scaleY")?h.scaleY:1,u.inheritScale=h.hasOwnProperty("inheritScale")?h.inheritScale:!0,u.inheritRotation=h.hasOwnProperty("inheritRotation")?h.inheritRotation:!0,n.bones.push(u)}var m=t.ik;if(m)for(var s=0,o=m.length;o>s;s++){for(var f=m[s],c=new a.IkConstraintData(f.name),r=f.bones,p=0,d=r.length;d>p;p++){var g=n.findBone(r[p]);if(!g)throw"IK bone not found: "+r[p];c.bones.push(g)}if(c.target=n.findBone(f.target),!c.target)throw"Target bone not found: "+f.target;c.bendDirection=!f.hasOwnProperty("bendPositive")||f.bendPositive?1:-1,c.mix=f.hasOwnProperty("mix")?f.mix:1,n.ikConstraints.push(c)}for(var v=t.slots,s=0,o=v.length;o>s;s++){var x=v[s],u=n.findBone(x.bone);if(!u)throw"Slot bone not found: "+x.bone;var A=new a.SlotData(x.name,u),y=x.color;y&&(A.r=this.toColor(y,0),A.g=this.toColor(y,1),A.b=this.toColor(y,2),A.a=this.toColor(y,3)),A.attachmentName=x.attachment,A.blendMode=x.blend&&a.SlotData.PIXI_BLEND_MODE_MAP[x.blend]||a.SlotData.PIXI_BLEND_MODE_MAP.normal,n.slots.push(A)}var S=t.skins;for(var T in S)if(S.hasOwnProperty(T)){var w=S[T],b=new a.Skin(T);for(var I in w)if(w.hasOwnProperty(I)){var k=n.findSlotIndex(I),C=w[I];for(var D in C)if(C.hasOwnProperty(D)){var M=this.readAttachment(b,k,D,C[D]);M&&b.addAttachment(k,D,M)}}n.skins.push(b),"default"==b.name&&(n.defaultSkin=b)}for(var P=this.linkedMeshes,s=0,o=P.size;o>s;s++){var O=P[s],b=O.skin?n.findSkin(O.skin):n.defaultSkin,l=b.getAttachment(O.slotIndex,O.parent);O.mesh.setParentMesh(l),O.mesh.updateUVs()}P.length=0;var U=t.events;for(var X in U)if(U.hasOwnProperty(X)){var E=U[X],R=new a.EventData(X);R.intValue=E["int"]||0,R.floatValue=E["float"]||0,R.stringValue=E.string||null,n.events.push(R)}var B=t.animations;for(var F in B)B.hasOwnProperty(F)&&this.readAnimation(F,B[F],n);return n},readAttachment:function(t,e,n,r){n=r.name||n;var s=a.AttachmentType[r.type||"region"],o=r.path||n,h=this.scale;if(s==a.AttachmentType.region){var l=this.attachmentLoader.newRegionAttachment(t,n,o);if(!l)return null;l.path=o,l.x=(r.x||0)*h,l.y=(r.y||0)*h,l.scaleX=r.hasOwnProperty("scaleX")?r.scaleX:1,l.scaleY=r.hasOwnProperty("scaleY")?r.scaleY:1,l.rotation=r.rotation||0,l.width=(r.width||0)*h,l.height=(r.height||0)*h;var u=r.color;return u&&(l.r=this.toColor(u,0),l.g=this.toColor(u,1),l.b=this.toColor(u,2),l.a=this.toColor(u,3)),l.updateOffset(),l}if(s==a.AttachmentType.boundingbox){for(var m=this.attachmentLoader.newBoundingBoxAttachment(t,n),f=r.vertices,c=0,p=f.length;p>c;c++)m.vertices.push(f[c]*h);return m}if(s==a.AttachmentType.mesh||s==a.AttachmentType.linkedmesh){var d=this.attachmentLoader.newMeshAttachment(t,n,o);if(!d)return null;d.path=o,u=r.color,u&&(d.r=this.toColor(u,0),d.g=this.toColor(u,1),d.b=this.toColor(u,2),d.a=this.toColor(u,3)),d.width=(r.width||0)*h,d.height=(r.height||0)*h;var g=r.parent;return g?(d.inheritFFD=!!r.ffd,this.linkedMeshes.push(new i(d,r.skin||null,e,g))):(d.vertices=this.getFloatArray(r,"vertices",h),d.triangles=this.getIntArray(r,"triangles"),d.regionUVs=this.getFloatArray(r,"uvs",1),d.updateUVs(),d.hullLength=2*(r.hull||0),r.edges&&(d.edges=this.getIntArray(r,"edges"))),d}if(s==a.AttachmentType.weightedmesh||s==a.AttachmentType.weightedlinkedmesh){var d=this.attachmentLoader.newWeightedMeshAttachment(t,n,o);if(!d)return null;d.path=o,u=r.color,u&&(d.r=this.toColor(u,0),d.g=this.toColor(u,1),d.b=this.toColor(u,2),d.a=this.toColor(u,3)),d.width=(r.width||0)*h,d.height=(r.height||0)*h;var g=r.parent;if(g)d.inheritFFD=!!r.ffd,this.linkedMeshes.push(new i(d,r.skin||null,e,g));else{for(var v=this.getFloatArray(r,"uvs",1),f=this.getFloatArray(r,"vertices",1),x=[],A=[],c=0,p=f.length;p>c;){var y=0|f[c++];A[A.length]=y;for(var S=c+4*y;S>c;)A[A.length]=f[c],x[x.length]=f[c+1]*h,x[x.length]=f[c+2]*h,x[x.length]=f[c+3],c+=4}d.bones=A,d.weights=x,d.triangles=this.getIntArray(r,"triangles"),d.regionUVs=v,d.updateUVs(),d.hullLength=2*(r.hull||0),r.edges&&(d.edges=this.getIntArray(r,"edges"))}return d}throw"Unknown attachment type: "+s},readAnimation:function(t,e,n){var i=[],r=0,s=e.slots;for(var o in s)if(s.hasOwnProperty(o)){var h=s[o],l=n.findSlotIndex(o);for(var u in h)if(h.hasOwnProperty(u)){var m=h[u];if("color"==u){var f=new a.ColorTimeline(m.length);f.slotIndex=l;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p],v=g.color,x=this.toColor(v,0),A=this.toColor(v,1),y=this.toColor(v,2),S=this.toColor(v,3);f.setFrame(c,g.time,x,A,y,S),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[5*f.getFrameCount()-5])}else{if("attachment"!=u)throw"Invalid timeline type for a slot: "+u+" ("+o+")";var f=new a.AttachmentTimeline(m.length);f.slotIndex=l;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p];f.setFrame(c++,g.time,g.name)}i.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}}}var T=e.bones;for(var w in T)if(T.hasOwnProperty(w)){var b=n.findBoneIndex(w);if(-1==b)throw"Bone not found: "+w;var I=T[w];for(var u in I)if(I.hasOwnProperty(u)){var m=I[u];if("rotate"==u){var f=new a.RotateTimeline(m.length);f.boneIndex=b;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p];f.setFrame(c,g.time,g.angle),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[2*f.getFrameCount()-2])}else{if("translate"!=u&&"scale"!=u)throw"flipX"==u||"flipY"==u?"flipX and flipY are not supported in spine v3: ("+w+")":"Invalid timeline type for a bone: "+u+" ("+w+")";var f,k=1;"scale"==u?f=new a.ScaleTimeline(m.length):(f=new a.TranslateTimeline(m.length),k=this.scale),f.boneIndex=b;for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p],C=(g.x||0)*k,D=(g.y||0)*k;f.setFrame(c,g.time,C,D),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[3*f.getFrameCount()-3])}}}var M=e.ik;for(var P in M)if(M.hasOwnProperty(P)){var O=n.findIkConstraint(P),m=M[P],f=new a.IkConstraintTimeline(m.length);f.ikConstraintIndex=n.ikConstraints.indexOf(O);for(var c=0,p=0,d=m.length;d>p;p++){var g=m[p],U=g.hasOwnProperty("mix")?g.mix:1,X=!g.hasOwnProperty("bendPositive")||g.bendPositive?1:-1;f.setFrame(c,g.time,U,X),this.readCurve(f,c,g),c++}i.push(f),r=Math.max(r,f.frames[3*f.getFrameCount()-3])}var E=e.ffd;for(var R in E){var B=n.findSkin(R),h=E[R];for(o in h){var l=n.findSlotIndex(o),F=h[o];for(var Y in F){var m=F[Y],f=new a.FfdTimeline(m.length),V=B.getAttachment(l,Y);if(!V)throw"FFD attachment not found: "+Y;f.slotIndex=l,f.attachment=V;var L,W=V.type==a.AttachmentType.mesh;L=W?V.vertices.length:V.weights.length/3*2;for(var c=0,p=0,d=m.length;d>p;p++){var N,g=m[p];if(g.vertices){var _=g.vertices;N=[];for(var j=0;L>j;++j)N.push(0);var H=g.offset||0,q=_.length;if(1==this.scale)for(var K=0;q>K;K++)N[K+H]=_[K];else for(var K=0;q>K;K++)N[K+H]=_[K]*this.scale;if(W)for(var J=V.vertices,K=0,q=N.length;q>K;K++)N[K]+=J[K]}else if(W)N=V.vertices;else{N=[];for(var j=0;L>j;++j)N.push(0)}f.setFrame(c,g.time,N),this.readCurve(f,c,g),c++}i[i.length]=f,r=Math.max(r,f.frames[f.getFrameCount()-1])}}}var z=e.drawOrder;if(z||(z=e.draworder),z){for(var f=new a.DrawOrderTimeline(z.length),G=n.slots.length,c=0,p=0,d=z.length;d>p;p++){var $=z[p],Q=null;if($.offsets){Q=[],Q.length=G;for(var K=G-1;K>=0;K--)Q[K]=-1;var Z=$.offsets,tt=[];tt.length=G-Z.length;for(var et=0,nt=0,K=0,q=Z.length;q>K;K++){var it=Z[K],l=n.findSlotIndex(it.slot);if(-1==l)throw"Slot not found: "+it.slot;for(;et!=l;)tt[nt++]=et++;Q[et+it.offset]=et++}for(;G>et;)tt[nt++]=et++;for(var K=G-1;K>=0;K--)-1==Q[K]&&(Q[K]=tt[--nt])}f.setFrame(c++,$.time,Q)}i.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}var at=e.events;if(at){for(var f=new a.EventTimeline(at.length),c=0,p=0,d=at.length;d>p;p++){var rt=at[p],st=n.findEvent(rt.name);if(!st)throw"Event not found: "+rt.name;var ot=new a.Event(st);ot.intValue=rt.hasOwnProperty("int")?rt["int"]:st.intValue,ot.floatValue=rt.hasOwnProperty("float")?rt["float"]:st.floatValue,ot.stringValue=rt.hasOwnProperty("string")?rt.string:st.stringValue,f.setFrame(c++,rt.time,ot)}i.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}n.animations.push(new a.Animation(t,i,r))},readCurve:function(t,e,n){var i=n.curve;i?"stepped"==i?t.curves.setStepped(e):i instanceof Array&&t.curves.setCurve(e,i[0],i[1],i[2],i[3]):t.curves.setLinear(e)},toColor:function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2*e+2),16)/255},getFloatArray:function(t,e,n){var i=t[e],r=new a.Float32Array(i.length),s=0,o=i.length;if(1==n)for(;o>s;s++)r[s]=i[s];else for(;o>s;s++)r[s]=i[s]*n;return r},getIntArray:function(t,e){for(var n=t[e],i=new a.Uint16Array(n.length),r=0,s=n.length;s>r;r++)i[r]=0|n[r];return i}},e.exports=a.SkeletonJsonParser},{"../SpineUtil":40,"./Animation":2,"./AttachmentTimeline":10,"./AttachmentType":11,"./BoneData":13,"./ColorTimeline":15,"./DrawOrderTimeline":17,"./Event":18,"./EventData":19,"./EventTimeline":20,"./FfdTimeline":21,"./IkConstraintData":23,"./IkConstraintTimeline":24,"./RotateTimeline":27,"./ScaleTimeline":28,"./SkeletonData":31,"./Skin":33,"./SlotData":35,"./TranslateTimeline":37}],33:[function(t,e,n){var i=t("../SpineUtil");i.Skin=function(t){this.name=t,this.attachments={}},i.Skin.prototype={addAttachment:function(t,e,n){this.attachments[t+":"+e]=n},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var n in e.attachments){var i=n.indexOf(":"),a=parseInt(n.substring(0,i)),r=n.substring(i+1),s=t.slots[a];if(s.attachment&&s.attachment.name==r){var o=this.getAttachment(a,r);o&&s.setAttachment(o)}}}},e.exports=i.Skin},{"../SpineUtil":40}],34:[function(t,e,n){var i=t("../SpineUtil");i.Slot=function(t,e){this.data=t,this.bone=e,this.setToSetupPose()},i.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(t){this.attachment=t,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(t){this._attachmentTime=this.bone.skeleton.time-t},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this.blendMode=t.blendMode;for(var e=this.bone.skeleton.data.slots,n=0,i=e.length;i>n;n++)if(e[n]==t){this.setAttachment(t.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(n,t.attachmentName):null);break}}},e.exports=i.Slot},{"../SpineUtil":40}],35:[function(t,e,n){var i=t("../SpineUtil");i.SlotData=function(t,e){this.name=t,this.boneData=e},i.SlotData.PIXI_BLEND_MODE_MAP={multiply:PIXI.BLEND_MODES.MULTIPLY,screen:PIXI.BLEND_MODES.SCREEN,additive:PIXI.BLEND_MODES.ADD,normal:PIXI.BLEND_MODES.NORMAL},i.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,blendMode:PIXI.BLEND_MODES.NORMAL},e.exports=i.SlotData},{"../SpineUtil":40}],36:[function(t,e,n){var i=t("../SpineUtil");i.TrackEntry=function(){},i.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},e.exports=i.TrackEntry},{"../SpineUtil":40}],37:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.TranslateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,a,r){var s=this.frames;if(!(n<s[0])){var o=t.bones[this.boneIndex];if(n>=s[s.length-3])return o.x+=(o.data.x+s[s.length-2]-o.x)*r,void(o.y+=(o.data.y+s[s.length-1]-o.y)*r);var h=i.Animation.binarySearch(s,n,3),l=s[h-2],u=s[h-1],m=s[h],f=1-(n-m)/(s[h+-3]-m);f=this.curves.getCurvePercent(h/3-1,f),o.x+=(o.data.x+l+(s[h+1]-l)*f-o.x)*r,o.y+=(o.data.y+u+(s[h+2]-u)*f-o.y)*r}}},e.exports=i.TranslateTimeline},{"../SpineUtil":40,"./Animation":2,"./Curves":16}],38:[function(t,e,n){var i=t("../SpineUtil")||{};i.AttachmentType=t("./AttachmentType"),i.WeightedMeshAttachment=function(t){this.name=t},i.WeightedMeshAttachment.prototype={type:i.AttachmentType.weightedmesh,parentMesh:null,inheritFFD:!1,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,edges:null,width:0,height:0,updateUVs:function(t,e,n,a,r){var s=(this.regionU2-this.regionU,this.regionV2-this.regionV,this.regionUVs.length);this.uvs&&this.uvs.length==s||(this.uvs=new i.Float32Array(s));var o=this.rendererObject;if(o)for(var h=o.texture,l=h._uvs,u=o.width,m=o.height,f=o.originalWidth,c=o.originalHeight,p=o.offsetX,d=o.pixiOffsetY,g=0;s>g;g+=2){var t=this.regionUVs[g],e=this.regionUVs[g+1];t=(t*f-p)/u,e=(e*c-d)/m,this.uvs[g]=(l.x0*(1-t)+l.x1*t)*(1-e)+(l.x3*(1-t)+l.x2*t)*e,this.uvs[g+1]=(l.y0*(1-t)+l.y1*t)*(1-e)+(l.y3*(1-t)+l.y2*t)*e}},computeWorldVertices:function(t,e,n,i){var a,r,s,o,h,l,u,m=n.bone.skeleton.bones,f=this.weights,c=this.bones,p=0,d=0,g=0,v=0,x=c.length;if(n.attachmentVertices.length)for(var A=n.attachmentVertices;x>d;p+=2){for(r=0,s=0,a=c[d++]+d;a>d;d++,g+=3,v+=2)u=m[c[d]].matrix,o=f[g]+A[v],h=f[g+1]+A[v+1],l=f[g+2],r+=(o*u.a+h*u.c+u.tx)*l,s+=(o*u.b+h*u.d+u.ty)*l;i[p]=r+t,i[p+1]=s+e}else for(;x>d;p+=2){for(r=0,s=0,a=c[d++]+d;a>d;d++,g+=3)u=m[c[d]].matrix,o=f[g],h=f[g+1],l=f[g+2],r+=(o*u.a+h*u.c+u.tx)*l,s+=(o*u.b+h*u.d+u.ty)*l;i[p]=r+t,i[p+1]=s+e}},applyFFD:function(t){return this===t||this.inheritFFD&&parentMesh===t},setParentMesh:function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.weights=t.weights,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength)}},e.exports=i.WeightedMeshAttachment},{"../SpineUtil":40,"./AttachmentType":11}],39:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.AnimationStateData=t("./AnimationStateData"),i.AnimationState=t("./AnimationState"),i.AtlasAttachmentParser=t("./AtlasAttachmentParser"),i.Atlas=t("./Atlas"),i.AtlasPage=t("./AtlasPage"),i.AtlasReader=t("./AtlasReader"),i.AtlasRegion=t("./AtlasRegion"),i.AttachmentTimeline=t("./AttachmentTimeline"),i.AttachmentType=t("./AttachmentType"),i.BoneData=t("./BoneData"),i.Bone=t("./Bone"),i.BoundingBoxAttachment=t("./BoundingBoxAttachment"),i.ColorTimeline=t("./ColorTimeline"),i.Curves=t("./Curves"),i.DrawOrderTimeline=t("./DrawOrderTimeline"),i.EventData=t("./EventData"),i.Event=t("./Event"),i.EventTimeline=t("./EventTimeline"),i.FfdTimeline=t("./FfdTimeline"),i.IkConstraintData=t("./IkConstraintData"),i.IkConstraint=t("./IkConstraint"),i.IkConstraintTimeline=t("./IkConstraintTimeline"),i.MeshAttachment=t("./MeshAttachment"),i.RegionAttachment=t("./RegionAttachment"),i.RotateTimeline=t("./RotateTimeline"),i.ScaleTimeline=t("./ScaleTimeline"),i.SkeletonBounds=t("./SkeletonBounds"),i.SkeletonData=t("./SkeletonData"),i.Skeleton=t("./Skeleton"),i.SkeletonJsonParser=t("./SkeletonJsonParser"),i.Skin=t("./Skin.js"),i.WeightedMeshAttachment=t("./WeightedMeshAttachment"),i.SlotData=t("./SlotData"),i.Slot=t("./Slot"),i.TrackEntry=t("./TrackEntry"),i.TranslateTimeline=t("./TranslateTimeline"),e.exports=i},{"../SpineUtil":40,"./Animation":2,"./AnimationState":3,"./AnimationStateData":4,"./Atlas":5,"./AtlasAttachmentParser":6,"./AtlasPage":7,"./AtlasReader":8,"./AtlasRegion":9,"./AttachmentTimeline":10,"./AttachmentType":11,"./Bone":12,"./BoneData":13,"./BoundingBoxAttachment":14,"./ColorTimeline":15,"./Curves":16,"./DrawOrderTimeline":17,"./Event":18,"./EventData":19,"./EventTimeline":20,"./FfdTimeline":21,"./IkConstraint":22,"./IkConstraintData":23,"./IkConstraintTimeline":24,"./MeshAttachment":25,"./RegionAttachment":26,"./RotateTimeline":27,"./ScaleTimeline":28,"./Skeleton":29,"./SkeletonBounds":30,"./SkeletonData":31,"./SkeletonJsonParser":32,"./Skin.js":33,"./Slot":34,"./SlotData":35,"./TrackEntry":36,"./TranslateTimeline":37,"./WeightedMeshAttachment":38}],40:[function(t,e,n){e.exports={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array,signum:function(t){return t>0?1:0>t?-1:0}}},{}],41:[function(t,e,n){function i(t){if(PIXI.Container.call(this),!t)throw new Error("The spineData param is required.");if("string"==typeof t)throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=t,this.skeleton=new r.Skeleton(t),this.skeleton.updateWorldTransform(),this.stateData=new r.AnimationStateData(t),this.state=new r.AnimationState(this.stateData),this.slotContainers=[];for(var e=0,n=this.skeleton.slots.length;n>e;e++){var i=this.skeleton.slots[e],a=i.attachment,s=new PIXI.Container;if(this.slotContainers.push(s),this.addChild(s),a instanceof r.RegionAttachment){var o=a.rendererObject.name,h=this.createSprite(i,a);i.currentSprite=h,i.currentSpriteName=o,s.addChild(h)}else{if(!(a instanceof r.MeshAttachment))continue;var l=this.createMesh(i,a);i.currentMesh=l,i.currentMeshName=a.name,s.addChild(l)}}this.autoUpdate=!0}function a(){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}var r=t("../SpineRuntime"),s=t("../loaders/atlasParser");r.Bone.yDown=!0,i.fromAtlas=function(t){var e=s.AnimCache[t];if(!e)throw new Error('Spine data "'+t+'" does not exist in the animation cache');return new i(e)},i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,e.exports=i,i.globalAutoUpdate=!0,Object.defineProperties(i.prototype,{autoUpdate:{get:function(){return this.updateTransform===i.prototype.autoUpdateTransform},set:function(t){this.updateTransform=t?i.prototype.autoUpdateTransform:PIXI.Container.prototype.updateTransform}}}),i.prototype.update=function(t){this.state.update(t),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var e=this.skeleton.drawOrder,n=this.skeleton.slots,i=0,s=e.length;s>i;i++)this.children[i]=this.slotContainers[e[i]];for(i=0,s=n.length;s>i;i++){var o=n[i],h=o.attachment,l=this.slotContainers[i];if(h){var u=h.type;if(u===r.AttachmentType.region){if(h.rendererObject&&(!o.currentSpriteName||o.currentSpriteName!==h.rendererObject.name)){var m=h.rendererObject.name;if(void 0!==o.currentSprite&&(o.currentSprite.visible=!1),o.sprites=o.sprites||{},void 0!==o.sprites[m])o.sprites[m].visible=!0;else{var f=this.createSprite(o,h);l.addChild(f)}o.currentSprite=o.sprites[m],o.currentSpriteName=m}if(l.transform){l.transform._dirtyLocal||(l.transform=new PIXI.TransformStatic);var c=l.transform,p=c.localTransform;c._dirtyParentVersion=-1,c._dirtyLocal=1,c._versionLocal=1,o.bone.matrix.copy(p),p.tx+=o.bone.skeleton.x,p.ty+=o.bone.skeleton.y}else{var p=l.localTransform||new PIXI.Matrix;o.bone.matrix.copy(p),p.tx+=o.bone.skeleton.x,p.ty+=o.bone.skeleton.y,l.localTransform=p,l.displayObjectUpdateTransform=a}o.currentSprite.blendMode=o.blendMode,o.currentSprite.tint=PIXI.utils.rgb2hex([o.r,o.g,o.b])}else{if(u!==r.AttachmentType.skinnedmesh&&u!==r.AttachmentType.mesh){l.visible=!1;continue}if(!o.currentMeshName||o.currentMeshName!==h.name){var d=h.name;if(void 0!==o.currentMesh&&(o.currentMesh.visible=!1),o.meshes=o.meshes||{},void 0!==o.meshes[d])o.meshes[d].visible=!0;else{var g=this.createMesh(o,h);l.addChild(g)}o.currentMesh=o.meshes[d],o.currentMeshName=d}h.computeWorldVertices(o.bone.skeleton.x,o.bone.skeleton.y,o,o.currentMesh.vertices)}l.visible=!0,l.alpha=o.a}else l.visible=!1}},i.prototype.autoUpdateTransform=function(){if(i.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;PIXI.Container.prototype.updateTransform.call(this)},i.prototype.createSprite=function(t,e){var n=e.rendererObject,i=n.texture,a=new PIXI.Sprite(i);return a.scale.x=e.scaleX*e.width/n.originalWidth,a.scale.y=-e.scaleY*e.height/n.originalHeight,a.rotation=e.rotation*r.degRad,a.anchor.x=.5,a.anchor.y=.5,a.position.x=e.x,a.position.y=e.y,a.alpha=e.a,t.sprites=t.sprites||{},t.sprites[n.name]=a,a},i.prototype.createMesh=function(t,e){var n=e.rendererObject,i=n.page.rendererObject,a=new PIXI.Texture(i),r=new PIXI.mesh.Mesh(a,new Float32Array(e.uvs.length),new Float32Array(e.uvs),new Uint16Array(e.triangles),PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);return r.canvasPadding=1.5,r.alpha=e.a,t.meshes=t.meshes||{},t.meshes[e.name]=r,r}},{"../SpineRuntime":39,"../loaders/atlasParser":43}],42:[function(t,e,n){var i=t("./atlasParser");PIXI.loaders.Loader.addPixiMiddleware(i),PIXI.loader.use(i())},{"./atlasParser":43}],43:[function(t,e,n){var i=PIXI.loaders.Resource,a=t("../SpineRuntime"),r=t("./imageLoaderAdapter"),s=e.exports=function(){return function(t,e){if(!t.data||!t.isJson||!t.data.bones)return e();var n=t.metadata?t.metadata.spineAtlas:null;if(n===!1)return e();if(n&&n.pages){var o=new a.SkeletonJsonParser(new a.AtlasAttachmentParser(n)),h=o.readSkeletonData(t.data);t.spineData=h,t.spineAtlas=n,s.enableCaching&&(s.AnimCache[t.name]=t.spineData),e()}var l=t.url.substr(0,t.url.lastIndexOf("."))+".atlas";l=l.replace(this.baseUrl,"");var u={crossOrigin:t.crossOrigin,xhrType:i.XHR_RESPONSE_TYPE.TEXT,metadata:t.metadata?t.metadata.spineMetadata:null},m={crossOrigin:t.crossOrigin,metadata:t.metadata?t.metadata.imageMetadata:null},f=t.url.substr(0,t.url.lastIndexOf("/")+1);f=f.replace(this.baseUrl,"");var c=r(this,t.name+"_atlas_page_",f,m);this.add(t.name+"_atlas",l,u,function(n){new a.Atlas(this.xhr.responseText,c,function(n){var i=new a.SkeletonJsonParser(new a.AtlasAttachmentParser(n)),r=i.readSkeletonData(t.data);t.spineData=r,t.spineAtlas=n,s.enableCaching&&(s.AnimCache[t.name]=t.spineData),e()})})}};s.AnimCache={},s.enableCaching=!1},{"../SpineRuntime":39,"./imageLoaderAdapter":44}],44:[function(t,e,n){t("../SpineRuntime");e.exports=function(t,e,n,i){return n&&n.lastIndexOf("/")!==n.length-1&&(n+="/"),function(a,r){var s=e+a,o=n+a;t.add(s,o,i,function(t){r(t.texture.baseTexture)})}}},{"../SpineRuntime":39}],45:[function(t,e,n){e.exports={atlasParser:t("./atlasParser"),Loader:t("./Loader"),syncImageLoaderAdapter:t("./syncImageLoaderAdapter"),imageLoaderAdapter:t("./imageLoaderAdapter")}},{"./Loader":42,"./atlasParser":43,"./imageLoaderAdapter":44,"./syncImageLoaderAdapter":46}],46:[function(t,e,n){t("../SpineRuntime");e.exports=function(t,e){return t&&t.lastIndexOf("/")!==t.length-1&&(t+="/"),function(t,n){n(PIXI.BaseTexture.fromImage(t,e))}}},{"../SpineRuntime":39}]},{},[1]); |
{ | ||
"name": "pixi-spine", | ||
"version": "1.0.15", | ||
"version": "1.0.17", | ||
"description": "Spine implementation for pixi v3", | ||
@@ -5,0 +5,0 @@ "author": "Mat Groves", |
@@ -12,2 +12,20 @@ var Resource = PIXI.loaders.Resource, | ||
var metadataAtlas = resource.metadata ? resource.metadata.spineAtlas: null; | ||
if (metadataAtlas === false) { | ||
return next(); | ||
} | ||
if (metadataAtlas && metadataAtlas.pages) { | ||
//its an atlas! | ||
var spineJsonParser = new spine.SkeletonJsonParser(new spine.AtlasAttachmentParser(metadataAtlas)); | ||
var skeletonData = spineJsonParser.readSkeletonData(resource.data); | ||
resource.spineData = skeletonData; | ||
resource.spineAtlas = metadataAtlas; | ||
if (atlasParser.enableCaching) { | ||
atlasParser.AnimCache[resource.name] = resource.spineData; | ||
} | ||
next(); | ||
} | ||
/** | ||
@@ -36,2 +54,3 @@ * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files | ||
var adapter = imageLoaderAdapter(this, resource.name + '_atlas_page_', baseUrl, imageOptions); | ||
this.add(resource.name + '_atlas', atlasPath, atlasOptions, function (res) { | ||
@@ -44,4 +63,5 @@ new spine.Atlas(this.xhr.responseText, adapter, function(spineAtlas) { | ||
resource.spineAtlas = spineAtlas; | ||
if (atlasParser.enableCaching) | ||
if (atlasParser.enableCaching) { | ||
atlasParser.AnimCache[resource.name] = resource.spineData; | ||
} | ||
@@ -55,2 +75,2 @@ next(); | ||
atlasParser.AnimCache = {}; | ||
atlasParser.enableCaching = true; | ||
atlasParser.enableCaching = false; |
@@ -26,3 +26,3 @@ var spine = require('../SpineUtil'); | ||
if (page === null) { | ||
page = new AtlasPage(); | ||
page = new spine.AtlasPage(); | ||
page.name = 'texturePage'; | ||
@@ -36,7 +36,7 @@ var baseTexture = texture.baseTexture; | ||
page.minFilter = page.magFilter = "Nearest"; | ||
page.uWrap = Atlas.TextureWrap.clampToEdge; | ||
page.vWrap = Atlas.TextureWrap.clampToEdge; | ||
page.uWrap = spine.Atlas.TextureWrap.clampToEdge; | ||
page.vWrap = spine.Atlas.TextureWrap.clampToEdge; | ||
pages.push(page); | ||
} | ||
var region = new AtlasRegion(); | ||
var region = new spine.AtlasRegion(); | ||
region.name = name; | ||
@@ -117,2 +117,6 @@ region.page = page; | ||
page.rendererObject = texture; | ||
if (!texture.hasLoaded) { | ||
texture.width = page.width; | ||
texture.height = page.height; | ||
} | ||
self.pages.push(page); | ||
@@ -186,2 +190,3 @@ if (!page.width || !page.height) { | ||
region.index = parseInt(reader.readValue()); | ||
region.texture._updateUvs(); | ||
@@ -188,0 +193,0 @@ self.regions.push(region); |
@@ -32,2 +32,3 @@ var spine = require('../SpineUtil'); | ||
attachment.rendererObject = region; | ||
// region.texture.on('update', spine.MeshAttachment.prototype.updateUVs.bind(attachment)); | ||
return attachment; | ||
@@ -41,2 +42,3 @@ }, | ||
attachment.rendererObject = region; | ||
// region.texture.on('update', spine.WeightedMeshAttachment.prototype.updateUVs.bind(attachment)); | ||
return attachment; | ||
@@ -43,0 +45,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
972884
8531