@galacean/engine-spine-core-3.8 2.0.0-alpha.57 → 2.0.0-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +4 -4
package/dist/browser.js
CHANGED
package/dist/browser.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/engine")):"function"==typeof define&&define.amd?define(["exports","@galacean/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Galacean=t.Galacean||{},t.Galacean.SpineCore38={}),t.Galacean)}(this,function(t,e){"use strict";function r(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}!function(){if(!Math.fround){var t;Math.fround=(t=new Float32Array(1),function(e){return t[0]=e,t[0]})}}();var o,h,l,u,c,f,d,v,g,m,p=/*#__PURE__*/function(){function t(){this.array=[]}var e=t.prototype;return e.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},e.contains=function(t){return void 0!=this.array[0|t]},e.remove=function(t){this.array[0|t]=void 0},e.clear=function(){this.array.length=0},t}(),E=/*#__PURE__*/function(){function t(t,e,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===a&&(a=0),this.r=t,this.g=e,this.b=r,this.a=a}var e=t.prototype;return e.set=function(t,e,r,a){return this.r=t,this.g=e,this.b=r,this.a=a,this.clamp(),this},e.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},e.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},e.add=function(t,e,r,a){return this.r+=t,this.g+=e,this.b+=r,this.a+=a,this.clamp(),this},e.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((0xff000000&e)>>>24)/255,t.g=((0xff0000&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((0xff0000&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t}();E.WHITE=new E(1,1,1,1),E.RED=new E(1,0,0,1),E.GREEN=new E(0,1,0,1),E.BLUE=new E(0,0,1,1),E.MAGENTA=new E(1,0,1,1);var b=/*#__PURE__*/function(){function t(){}return t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,r){return t.randomTriangularWith(e,r,(e+r)*.5)},t.randomTriangularWith=function(t,e,r){var a=Math.random(),n=e-t;return a<=(r-t)/n?t+Math.sqrt(a*n*(r-t)):e-Math.sqrt((1-a)*n*(e-r))},t}();b.PI=3.1415927,b.PI2=2*b.PI,b.radiansToDegrees=180/b.PI,b.radDeg=b.radiansToDegrees,b.degreesToRadians=b.PI/180,b.degRad=b.degreesToRadians;var x=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}return s(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this)||this).power=2,r.power=e,r}return s(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1},e}(/*#__PURE__*/function(){function t(){}return t.prototype.apply=function(t,e,r){return t+(e-t)*this.applyInternal(r)},t}())),S=/*#__PURE__*/function(){function t(){}return t.arrayCopy=function(t,e,r,a,n){for(var i=e,s=a;i<e+n;i++,s++)r[s]=t[i]},t.setArraySize=function(t,e,r){void 0===r&&(r=0);var a=t.length;if(a==e)return t;if(t.length=e,a<e)for(var n=a;n<e;n++)t[n]=r;return t},t.ensureArrayCapacity=function(e,r,a){return(void 0===a&&(a=0),e.length>=r)?e:t.setArraySize(e,r,a)},t.newArray=function(t,e){for(var r=Array(t),a=0;a<t;a++)r[a]=e;return r},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var r=Array(e),a=0;a<r.length;a++)r[a]=0;return r},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var r=Array(e),a=0;a<r.length;a++)r[a]=0;return r},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(t,e){},t.contains=function(t,e,r){for(var a=0;a<t.length;a++)if(t[a]==e)return!0;return!1},t}();S.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;var w=/*#__PURE__*/function(){function t(t){this.items=[],this.instantiator=t}var e=t.prototype;return e.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},e.free=function(t){t.reset&&t.reset(),this.items.push(t)},e.freeAll=function(t){for(var e=0;e<t.length;e++)this.free(t[e])},e.clear=function(){this.items.length=0},t}(),M=/*#__PURE__*/function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},e.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t}(),y=function(t){if(null==t)throw Error("name cannot be null.");this.name=t},I=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).id=(65535&e.nextID++)<<11,a.worldVerticesLength=0,a.deformAttachment=a,a}s(e,t);var r=e.prototype;return r.computeWorldVertices=function(t,e,r,a,n,i){r=n+(r>>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null==l){o.length>0&&(h=o);for(var u=t.bone,c=u.worldX,f=u.worldY,d=u.a,v=u.b,g=u.c,m=u.d,p=e,E=n;E<r;p+=2,E+=i){var b=h[p],x=h[p+1];a[E]=b*d+x*v+c,a[E+1]=b*g+x*m+f}return}for(var S=0,w=0,M=0;M<e;M+=2){var y=l[S];S+=y+1,w+=y}var I=s.bones;if(0==o.length)for(var R=n,T=3*w;R<r;R+=i){var A=0,k=0,V=l[S++];for(V+=S;S<V;S++,T+=3){var C=I[l[S]],P=h[T],F=h[T+1],N=h[T+2];A+=(P*C.a+F*C.b+C.worldX)*N,k+=(P*C.c+F*C.d+C.worldY)*N}a[R]=A,a[R+1]=k}else for(var _=n,Y=3*w,X=w<<1;_<r;_+=i){var O=0,L=0,D=l[S++];for(D+=S;S<D;S++,Y+=3,X+=2){var B=I[l[S]],W=h[Y]+o[X],q=h[Y+1]+o[X+1],U=h[Y+2];O+=(W*B.a+q*B.b+B.worldX)*U,L+=(W*B.c+q*B.d+B.worldY)*U}a[_]=O,a[_+1]=L}},r.copyTo=function(t){null!=this.bones?(t.bones=Array(this.bones.length),S.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,null!=this.vertices?(t.vertices=S.newFloatArray(this.vertices.length),S.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment},e}(y);I.nextID=0;var R=/*#__PURE__*/function(){function t(t,e,r){if(null==t)throw Error("name cannot be null.");if(null==e)throw Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var a=0;a<e.length;a++)this.timelineIds[e[a].getPropertyId()]=!0;this.duration=r}var e=t.prototype;return e.hasTimeline=function(t){return!0==this.timelineIds[t]},e.apply=function(t,e,r,a,n,i,s,o){if(null==t)throw Error("skeleton cannot be null.");a&&0!=this.duration&&(r%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l<u;l++)h[l].apply(t,e,r,n,i,s,o)},t.binarySearch=function(t,e,r){void 0===r&&(r=1);var a=0,n=t.length/r-2;if(0==n)return r;for(var i=n>>>1;;){if(t[(i+1)*r]<=e?a=i+1:n=i,a==n)return(a+1)*r;i=a+n>>>1}},t.linearSearch=function(t,e,r){for(var a=0,n=t.length-r;a<=n;a+=r)if(t[a]>e)return a;return -1},t}(),T=((o={})[o.setup=0]="setup",o[o.first=1]="first",o[o.replace=2]="replace",o[o.add=3]="add",o),A=((h={})[h.mixIn=0]="mixIn",h[h.mixOut=1]="mixOut",h),k=/*#__PURE__*/function(){function t(e){if(e<=0)throw Error("frameCount must be > 0: "+e);this.curves=S.newFloatArray((e-1)*t.BEZIER_SIZE)}var e=t.prototype;return e.getFrameCount=function(){return this.curves.length/t.BEZIER_SIZE+1},e.setLinear=function(e){this.curves[e*t.BEZIER_SIZE]=t.LINEAR},e.setStepped=function(e){this.curves[e*t.BEZIER_SIZE]=t.STEPPED},e.getCurveType=function(e){var r=e*t.BEZIER_SIZE;if(r==this.curves.length)return t.LINEAR;var a=this.curves[r];return a==t.LINEAR?t.LINEAR:a==t.STEPPED?t.STEPPED:t.BEZIER},e.setCurve=function(e,r,a,n,i){var s=(-(2*r)+n)*.03,o=(-(2*a)+i)*.03,h=((r-n)*3+1)*.006,l=((a-i)*3+1)*.006,u=2*s+h,c=2*o+l,f=.3*r+s+.16666667*h,d=.3*a+o+.16666667*l,v=e*t.BEZIER_SIZE,g=this.curves;g[v++]=t.BEZIER;for(var m=f,p=d,E=v+t.BEZIER_SIZE-1;v<E;v+=2)g[v]=m,g[v+1]=p,f+=u,d+=c,u+=h,c+=l,m+=f,p+=d},e.getCurvePercent=function(e,r){r=b.clamp(r,0,1);var a=this.curves,n=e*t.BEZIER_SIZE,i=a[n];if(i==t.LINEAR)return r;if(i==t.STEPPED)return 0;n++;for(var s=0,o=n,h=n+t.BEZIER_SIZE-1;n<h;n+=2)if((s=a[n])>=r){var l=void 0,u=void 0;return n==o?(l=0,u=0):(l=a[n-2],u=a[n-1]),u+(a[n+1]-u)*(r-l)/(s-l)}var c=a[n-1];return c+(1-c)*(r-s)/(1-s)},t}();k.LINEAR=0,k.STEPPED=1,k.BEZIER=2,k.BEZIER_SIZE=19;var V=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).frames=S.newFloatArray(e<<1),r}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0+this.boneIndex},r.setFrame=function(t,r,a){t<<=1,this.frames[t]=r,this.frames[t+e.ROTATION]=a},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.rotation=l.data.rotation;break;case 1:var u=l.data.rotation-l.rotation;l.rotation+=(u-(16384-(16384.499999999996-u/360|0))*360)*i}return}if(a>=h[h.length-e.ENTRIES]){var c=h[h.length+e.PREV_ROTATION];switch(s){case 0:l.rotation=l.data.rotation+c*i;break;case 1:case 2:c+=l.data.rotation-l.rotation,c-=(16384-(16384.499999999996-c/360|0))*360;case 3:l.rotation+=c*i}return}var f=R.binarySearch(h,a,e.ENTRIES),d=h[f+e.PREV_ROTATION],v=h[f],g=this.getCurvePercent((f>>1)-1,1-(a-v)/(h[f+e.PREV_TIME]-v)),m=h[f+e.ROTATION]-d;switch(m=d+(m-(16384-(16384.499999999996-m/360|0))*360)*g,s){case 0:l.rotation=l.data.rotation+(m-(16384-(16384.499999999996-m/360|0))*360)*i;break;case 1:case 2:m+=l.data.rotation-l.rotation;case 3:l.rotation+=(m-(16384-(16384.499999999996-m/360|0))*360)*i}}},e}(k);V.ENTRIES=2,V.PREV_TIME=-2,V.PREV_ROTATION=-1,V.ROTATION=1;var C=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x1000000+this.boneIndex},r.setFrame=function(t,r,a,n){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.X]=a,this.frames[t+e.Y]=n},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.x=l.data.x,l.y=l.data.y;break;case 1:l.x+=(l.data.x-l.x)*i,l.y+=(l.data.y-l.y)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X],c=h[h.length+e.PREV_Y];else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_X],c=h[f+e.PREV_Y];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u+=(h[f+e.X]-u)*v,c+=(h[f+e.Y]-c)*v}switch(s){case 0:l.x=l.data.x+u*i,l.y=l.data.y+c*i;break;case 1:case 2:l.x+=(l.data.x+u-l.x)*i,l.y+=(l.data.y+c-l.y)*i;break;case 3:l.x+=u*i,l.y+=c*i}}},e}(k);C.ENTRIES=3,C.PREV_TIME=-3,C.PREV_X=-2,C.PREV_Y=-1,C.X=1,C.Y=2;var P=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x2000000+this.boneIndex},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.scaleX=l.data.scaleX,l.scaleY=l.data.scaleY;break;case 1:l.scaleX+=(l.data.scaleX-l.scaleX)*i,l.scaleY+=(l.data.scaleY-l.scaleY)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X]*l.data.scaleX,c=h[h.length+e.PREV_Y]*l.data.scaleY;else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_X],c=h[f+e.PREV_Y];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u=(u+(h[f+e.X]-u)*v)*l.data.scaleX,c=(c+(h[f+e.Y]-c)*v)*l.data.scaleY}if(1==i)3==s?(l.scaleX+=u-l.data.scaleX,l.scaleY+=c-l.data.scaleY):(l.scaleX=u,l.scaleY=c);else{var g=0,m=0;if(1==o)switch(s){case 0:g=l.data.scaleX,m=l.data.scaleY,l.scaleX=g+(Math.abs(u)*b.signum(g)-g)*i,l.scaleY=m+(Math.abs(c)*b.signum(m)-m)*i;break;case 1:case 2:g=l.scaleX,m=l.scaleY,l.scaleX=g+(Math.abs(u)*b.signum(g)-g)*i,l.scaleY=m+(Math.abs(c)*b.signum(m)-m)*i;break;case 3:g=l.scaleX,m=l.scaleY,l.scaleX=g+(Math.abs(u)*b.signum(g)-l.data.scaleX)*i,l.scaleY=m+(Math.abs(c)*b.signum(m)-l.data.scaleY)*i}else switch(s){case 0:g=Math.abs(l.data.scaleX)*b.signum(u),m=Math.abs(l.data.scaleY)*b.signum(c),l.scaleX=g+(u-g)*i,l.scaleY=m+(c-m)*i;break;case 1:case 2:g=Math.abs(l.scaleX)*b.signum(u),m=Math.abs(l.scaleY)*b.signum(c),l.scaleX=g+(u-g)*i,l.scaleY=m+(c-m)*i;break;case 3:g=b.signum(u),m=b.signum(c),l.scaleX=Math.abs(l.scaleX)*g+(u-Math.abs(l.data.scaleX)*g)*i,l.scaleY=Math.abs(l.scaleY)*m+(c-Math.abs(l.data.scaleY)*m)*i}}}},e}(C),F=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x3000000+this.boneIndex},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.shearX=l.data.shearX,l.shearY=l.data.shearY;break;case 1:l.shearX+=(l.data.shearX-l.shearX)*i,l.shearY+=(l.data.shearY-l.shearY)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X],c=h[h.length+e.PREV_Y];else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_X],c=h[f+e.PREV_Y];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u+=(h[f+e.X]-u)*v,c+=(h[f+e.Y]-c)*v}switch(s){case 0:l.shearX=l.data.shearX+u*i,l.shearY=l.data.shearY+c*i;break;case 1:case 2:l.shearX+=(l.data.shearX+u-l.shearX)*i,l.shearY+=(l.data.shearY+c-l.shearY)*i;break;case 3:l.shearX+=u*i,l.shearY+=c*i}}},e}(C),N=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x5000000+this.slotIndex},r.setFrame=function(t,r,a,n,i,s){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.R]=a,this.frames[t+e.G]=n,this.frames[t+e.B]=i,this.frames[t+e.A]=s},r.apply=function(t,r,a,n,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=this.frames;if(a<l[0]){switch(s){case 0:h.color.setFromColor(h.data.color);break;case 1:var u=h.color,c=h.data.color;u.add((c.r-u.r)*i,(c.g-u.g)*i,(c.b-u.b)*i,(c.a-u.a)*i)}return}var f=0,d=0,v=0,g=0;if(a>=l[l.length-e.ENTRIES]){var m=l.length;f=l[m+e.PREV_R],d=l[m+e.PREV_G],v=l[m+e.PREV_B],g=l[m+e.PREV_A]}else{var p=R.binarySearch(l,a,e.ENTRIES);f=l[p+e.PREV_R],d=l[p+e.PREV_G],v=l[p+e.PREV_B],g=l[p+e.PREV_A];var E=l[p],b=this.getCurvePercent(p/e.ENTRIES-1,1-(a-E)/(l[p+e.PREV_TIME]-E));f+=(l[p+e.R]-f)*b,d+=(l[p+e.G]-d)*b,v+=(l[p+e.B]-v)*b,g+=(l[p+e.A]-g)*b}if(1==i)h.color.set(f,d,v,g);else{var x=h.color;0==s&&x.setFromColor(h.data.color),x.add((f-x.r)*i,(d-x.g)*i,(v-x.b)*i,(g-x.a)*i)}}},e}(k);N.ENTRIES=5,N.PREV_TIME=-5,N.PREV_R=-4,N.PREV_G=-3,N.PREV_B=-2,N.PREV_A=-1,N.R=1,N.G=2,N.B=3,N.A=4;var _=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xe000000+this.slotIndex},r.setFrame=function(t,r,a,n,i,s,o,h,l){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.R]=a,this.frames[t+e.G]=n,this.frames[t+e.B]=i,this.frames[t+e.A]=s,this.frames[t+e.R2]=o,this.frames[t+e.G2]=h,this.frames[t+e.B2]=l},r.apply=function(t,r,a,n,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=this.frames;if(a<l[0]){switch(s){case 0:h.color.setFromColor(h.data.color),h.darkColor.setFromColor(h.data.darkColor);break;case 1:var u=h.color,c=h.darkColor,f=h.data.color,d=h.data.darkColor;u.add((f.r-u.r)*i,(f.g-u.g)*i,(f.b-u.b)*i,(f.a-u.a)*i),c.add((d.r-c.r)*i,(d.g-c.g)*i,(d.b-c.b)*i,0)}return}var v=0,g=0,m=0,p=0,E=0,b=0,x=0;if(a>=l[l.length-e.ENTRIES]){var S=l.length;v=l[S+e.PREV_R],g=l[S+e.PREV_G],m=l[S+e.PREV_B],p=l[S+e.PREV_A],E=l[S+e.PREV_R2],b=l[S+e.PREV_G2],x=l[S+e.PREV_B2]}else{var w=R.binarySearch(l,a,e.ENTRIES);v=l[w+e.PREV_R],g=l[w+e.PREV_G],m=l[w+e.PREV_B],p=l[w+e.PREV_A],E=l[w+e.PREV_R2],b=l[w+e.PREV_G2],x=l[w+e.PREV_B2];var M=l[w],y=this.getCurvePercent(w/e.ENTRIES-1,1-(a-M)/(l[w+e.PREV_TIME]-M));v+=(l[w+e.R]-v)*y,g+=(l[w+e.G]-g)*y,m+=(l[w+e.B]-m)*y,p+=(l[w+e.A]-p)*y,E+=(l[w+e.R2]-E)*y,b+=(l[w+e.G2]-b)*y,x+=(l[w+e.B2]-x)*y}if(1==i)h.color.set(v,g,m,p),h.darkColor.set(E,b,x,1);else{var I=h.color,T=h.darkColor;0==s&&(I.setFromColor(h.data.color),T.setFromColor(h.data.darkColor)),I.add((v-I.r)*i,(g-I.g)*i,(m-I.b)*i,(p-I.a)*i),T.add((E-T.r)*i,(b-T.g)*i,(x-T.b)*i,0)}}},e}(k);_.ENTRIES=8,_.PREV_TIME=-8,_.PREV_R=-7,_.PREV_G=-6,_.PREV_B=-5,_.PREV_A=-4,_.PREV_R2=-3,_.PREV_G2=-2,_.PREV_B2=-1,_.R=1,_.G=2,_.B=3,_.A=4,_.R2=5,_.G2=6,_.B2=7;var Y=/*#__PURE__*/function(){function t(t){this.frames=S.newFloatArray(t),this.attachmentNames=Array(t)}var e=t.prototype;return e.getPropertyId=function(){return 0x4000000+this.slotIndex},e.getFrameCount=function(){return this.frames.length},e.setFrame=function(t,e,r){this.frames[t]=e,this.attachmentNames[t]=r},e.apply=function(t,e,r,a,n,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){if(1==s){0==i&&this.setAttachment(t,o,o.data.attachmentName);return}var h=this.frames;if(r<h[0]){(0==i||1==i)&&this.setAttachment(t,o,o.data.attachmentName);return}var l=0;l=r>=h[h.length-1]?h.length-1:R.binarySearch(h,r,1)-1;var u=this.attachmentNames[l];t.slots[this.slotIndex].setAttachment(null==u?null:t.getAttachment(this.slotIndex,u))}},e.setAttachment=function(t,e,r){e.attachment=null==r?null:t.getAttachment(this.slotIndex,r)},t}(),X=null,O=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).frames=S.newFloatArray(e),r.frameVertices=Array(e),null==X&&(X=S.newFloatArray(64)),r}s(e,t);var a=e.prototype;return a.getPropertyId=function(){return 0x30000000+ +this.attachment.id+this.slotIndex},a.setFrame=function(t,e,r){this.frames[t]=e,this.frameVertices[t]=r},a.apply=function(t,e,a,n,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.getAttachment();if(r(l,I)&&l.deformAttachment==this.attachment){var u=h.deform;0==u.length&&(s=0);var c=this.frameVertices,f=c[0].length,d=this.frames;if(a<d[0]){switch(s){case 0:u.length=0;break;case 1:if(1==i){u.length=0;break}var v=S.setArraySize(u,f);if(null==l.bones)for(var g=l.vertices,m=0;m<f;m++)v[m]+=(g[m]-v[m])*i;else{i=1-i;for(var m=0;m<f;m++)v[m]*=i}}return}var p=S.setArraySize(u,f);if(a>=d[d.length-1]){var E=c[d.length-1];if(1==i){if(3==s){if(null==l.bones)for(var b=l.vertices,x=0;x<f;x++)p[x]+=E[x]-b[x];else for(var w=0;w<f;w++)p[w]+=E[w]}else S.arrayCopy(E,0,p,0,f)}else switch(s){case 0:if(null==l.bones)for(var M=l.vertices,y=0;y<f;y++){var T=M[y];p[y]=T+(E[y]-T)*i}else for(var A=0;A<f;A++)p[A]=E[A]*i;break;case 1:case 2:for(var k=0;k<f;k++)p[k]+=(E[k]-p[k])*i;break;case 3:if(null==l.bones)for(var V=l.vertices,C=0;C<f;C++)p[C]+=(E[C]-V[C])*i;else for(var P=0;P<f;P++)p[P]+=E[P]*i}return}var F=R.binarySearch(d,a),N=c[F-1],_=c[F],Y=d[F],X=this.getCurvePercent(F-1,1-(a-Y)/(d[F-1]-Y));if(1==i){if(3==s){if(null==l.bones)for(var O=l.vertices,L=0;L<f;L++){var D=N[L];p[L]+=D+(_[L]-D)*X-O[L]}else for(var B=0;B<f;B++){var W=N[B];p[B]+=W+(_[B]-W)*X}}else for(var q=0;q<f;q++){var U=N[q];p[q]=U+(_[q]-U)*X}}else switch(s){case 0:if(null==l.bones)for(var H=l.vertices,G=0;G<f;G++){var j=N[G],z=H[G];p[G]=z+(j+(_[G]-j)*X-z)*i}else for(var Z=0;Z<f;Z++){var Q=N[Z];p[Z]=(Q+(_[Z]-Q)*X)*i}break;case 1:case 2:for(var K=0;K<f;K++){var J=N[K];p[K]+=(J+(_[K]-J)*X-p[K])*i}break;case 3:if(null==l.bones)for(var $=l.vertices,tt=0;tt<f;tt++){var te=N[tt];p[tt]+=(te+(_[tt]-te)*X-$[tt])*i}else for(var tr=0;tr<f;tr++){var ta=N[tr];p[tr]+=(ta+(_[tr]-ta)*X)*i}}}}},e}(k),L=/*#__PURE__*/function(){function t(t){this.frames=S.newFloatArray(t),this.events=Array(t)}var e=t.prototype;return e.getPropertyId=function(){return 0x7000000},e.getFrameCount=function(){return this.frames.length},e.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.apply=function(t,e,r,a,n,i,s){if(null!=a){var o=this.frames,h=this.frames.length;if(e>r)this.apply(t,e,Number.MAX_VALUE,a,n,i,s),e=-1;else if(e>=o[h-1])return;if(!(r<o[0])){var l=0;if(e<o[0])l=0;else{l=R.binarySearch(o,e);for(var u=o[l];l>0&&o[l-1]==u;)l--}for(;l<h&&r>=o[l];l++)a.push(this.events[l])}}},t}(),D=/*#__PURE__*/function(){function t(t){this.frames=S.newFloatArray(t),this.drawOrders=Array(t)}var e=t.prototype;return e.getPropertyId=function(){return 0x8000000},e.getFrameCount=function(){return this.frames.length},e.setFrame=function(t,e,r){this.frames[t]=e,this.drawOrders[t]=r},e.apply=function(t,e,r,a,n,i,s){var o=t.drawOrder,h=t.slots;if(1==s){0==i&&S.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}var l=this.frames;if(r<l[0]){(0==i||1==i)&&S.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}var u=0;u=r>=l[l.length-1]?l.length-1:R.binarySearch(l,r)-1;var c=this.drawOrders[u];if(null==c)S.arrayCopy(h,0,o,0,h.length);else for(var f=0,d=c.length;f<d;f++)o[f]=h[c[f]]},t}(),B=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x9000000+this.ikConstraintIndex},r.setFrame=function(t,r,a,n,i,s,o){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.MIX]=a,this.frames[t+e.SOFTNESS]=n,this.frames[t+e.BEND_DIRECTION]=i,this.frames[t+e.COMPRESS]=s?1:0,this.frames[t+e.STRETCH]=o?1:0},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.ikConstraints[this.ikConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.mix=l.data.mix,l.softness=l.data.softness,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch;break;case 1:l.mix+=(l.data.mix-l.mix)*i,l.softness+=(l.data.softness-l.softness)*i,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch}return}if(a>=h[h.length-e.ENTRIES]){0==s?(l.mix=l.data.mix+(h[h.length+e.PREV_MIX]-l.data.mix)*i,l.softness=l.data.softness+(h[h.length+e.PREV_SOFTNESS]-l.data.softness)*i,1==o?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=h[h.length+e.PREV_BEND_DIRECTION],l.compress=0!=h[h.length+e.PREV_COMPRESS],l.stretch=0!=h[h.length+e.PREV_STRETCH])):(l.mix+=(h[h.length+e.PREV_MIX]-l.mix)*i,l.softness+=(h[h.length+e.PREV_SOFTNESS]-l.softness)*i,0==o&&(l.bendDirection=h[h.length+e.PREV_BEND_DIRECTION],l.compress=0!=h[h.length+e.PREV_COMPRESS],l.stretch=0!=h[h.length+e.PREV_STRETCH]));return}var u=R.binarySearch(h,a,e.ENTRIES),c=h[u+e.PREV_MIX],f=h[u+e.PREV_SOFTNESS],d=h[u],v=this.getCurvePercent(u/e.ENTRIES-1,1-(a-d)/(h[u+e.PREV_TIME]-d));0==s?(l.mix=l.data.mix+(c+(h[u+e.MIX]-c)*v-l.data.mix)*i,l.softness=l.data.softness+(f+(h[u+e.SOFTNESS]-f)*v-l.data.softness)*i,1==o?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=h[u+e.PREV_BEND_DIRECTION],l.compress=0!=h[u+e.PREV_COMPRESS],l.stretch=0!=h[u+e.PREV_STRETCH])):(l.mix+=(c+(h[u+e.MIX]-c)*v-l.mix)*i,l.softness+=(f+(h[u+e.SOFTNESS]-f)*v-l.softness)*i,0==o&&(l.bendDirection=h[u+e.PREV_BEND_DIRECTION],l.compress=0!=h[u+e.PREV_COMPRESS],l.stretch=0!=h[u+e.PREV_STRETCH]))}},e}(k);B.ENTRIES=6,B.PREV_TIME=-6,B.PREV_MIX=-5,B.PREV_SOFTNESS=-4,B.PREV_BEND_DIRECTION=-3,B.PREV_COMPRESS=-2,B.PREV_STRETCH=-1,B.MIX=1,B.SOFTNESS=2,B.BEND_DIRECTION=3,B.COMPRESS=4,B.STRETCH=5;var W=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xa000000+this.transformConstraintIndex},r.setFrame=function(t,r,a,n,i,s){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.ROTATE]=a,this.frames[t+e.TRANSLATE]=n,this.frames[t+e.SCALE]=i,this.frames[t+e.SHEAR]=s},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.transformConstraints[this.transformConstraintIndex];if(l.active){if(a<h[0]){var u=l.data;switch(s){case 0:l.rotateMix=u.rotateMix,l.translateMix=u.translateMix,l.scaleMix=u.scaleMix,l.shearMix=u.shearMix;break;case 1:l.rotateMix+=(u.rotateMix-l.rotateMix)*i,l.translateMix+=(u.translateMix-l.translateMix)*i,l.scaleMix+=(u.scaleMix-l.scaleMix)*i,l.shearMix+=(u.shearMix-l.shearMix)*i}return}var c=0,f=0,d=0,v=0;if(a>=h[h.length-e.ENTRIES]){var g=h.length;c=h[g+e.PREV_ROTATE],f=h[g+e.PREV_TRANSLATE],d=h[g+e.PREV_SCALE],v=h[g+e.PREV_SHEAR]}else{var m=R.binarySearch(h,a,e.ENTRIES);c=h[m+e.PREV_ROTATE],f=h[m+e.PREV_TRANSLATE],d=h[m+e.PREV_SCALE],v=h[m+e.PREV_SHEAR];var p=h[m],E=this.getCurvePercent(m/e.ENTRIES-1,1-(a-p)/(h[m+e.PREV_TIME]-p));c+=(h[m+e.ROTATE]-c)*E,f+=(h[m+e.TRANSLATE]-f)*E,d+=(h[m+e.SCALE]-d)*E,v+=(h[m+e.SHEAR]-v)*E}if(0==s){var b=l.data;l.rotateMix=b.rotateMix+(c-b.rotateMix)*i,l.translateMix=b.translateMix+(f-b.translateMix)*i,l.scaleMix=b.scaleMix+(d-b.scaleMix)*i,l.shearMix=b.shearMix+(v-b.shearMix)*i}else l.rotateMix+=(c-l.rotateMix)*i,l.translateMix+=(f-l.translateMix)*i,l.scaleMix+=(d-l.scaleMix)*i,l.shearMix+=(v-l.shearMix)*i}},e}(k);W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4;var q=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xb000000+this.pathConstraintIndex},r.setFrame=function(t,r,a){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.VALUE]=a},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.position=l.data.position;break;case 1:l.position+=(l.data.position-l.position)*i}return}var u=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_VALUE];else{var c=R.binarySearch(h,a,e.ENTRIES);u=h[c+e.PREV_VALUE];var f=h[c],d=this.getCurvePercent(c/e.ENTRIES-1,1-(a-f)/(h[c+e.PREV_TIME]-f));u+=(h[c+e.VALUE]-u)*d}0==s?l.position=l.data.position+(u-l.data.position)*i:l.position+=(u-l.position)*i}},e}(k);q.ENTRIES=2,q.PREV_TIME=-2,q.PREV_VALUE=-1,q.VALUE=1;var U=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xc000000+this.pathConstraintIndex},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.spacing=l.data.spacing;break;case 1:l.spacing+=(l.data.spacing-l.spacing)*i}return}var u=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_VALUE];else{var c=R.binarySearch(h,a,e.ENTRIES);u=h[c+e.PREV_VALUE];var f=h[c],d=this.getCurvePercent(c/e.ENTRIES-1,1-(a-f)/(h[c+e.PREV_TIME]-f));u+=(h[c+e.VALUE]-u)*d}0==s?l.spacing=l.data.spacing+(u-l.data.spacing)*i:l.spacing+=(u-l.spacing)*i}},e}(q),H=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xd000000+this.pathConstraintIndex},r.setFrame=function(t,r,a,n){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.ROTATE]=a,this.frames[t+e.TRANSLATE]=n},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.rotateMix=l.data.rotateMix,l.translateMix=l.data.translateMix;break;case 1:l.rotateMix+=(l.data.rotateMix-l.rotateMix)*i,l.translateMix+=(l.data.translateMix-l.translateMix)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_ROTATE],c=h[h.length+e.PREV_TRANSLATE];else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_ROTATE],c=h[f+e.PREV_TRANSLATE];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u+=(h[f+e.ROTATE]-u)*v,c+=(h[f+e.TRANSLATE]-c)*v}0==s?(l.rotateMix=l.data.rotateMix+(u-l.data.rotateMix)*i,l.translateMix=l.data.translateMix+(c-l.data.translateMix)*i):(l.rotateMix+=(u-l.rotateMix)*i,l.translateMix+=(c-l.translateMix)*i)}},e}(k);H.ENTRIES=3,H.PREV_TIME=-3,H.PREV_ROTATE=-2,H.PREV_TRANSLATE=-1,H.ROTATE=1,H.TRANSLATE=2;var G=/*#__PURE__*/function(){function t(t){this.tracks=[],this.timeScale=1,this.unkeyedState=0,this.events=[],this.listeners=[],this.queue=new z(this),this.propertyIDs=new p,this.animationsChanged=!1,this.trackEntryPool=new w(function(){return new j}),this.data=t}var e=t.prototype;return e.update=function(t){t*=this.timeScale;for(var e=this.tracks,r=0,a=e.length;r<a;r++){var n=e[r];if(null!=n){n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;var i=t*n.timeScale;if(n.delay>0){if(n.delay-=i,n.delay>0)continue;i=-n.delay,n.delay=0}var s=n.next;if(null!=s){var o=n.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==n.timeScale?0:(o/n.timeScale+t)*s.timeScale,n.trackTime+=i,this.setCurrent(r,s,!0);null!=s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&null==n.mixingFrom){e[r]=null,this.queue.end(n),this.disposeNext(n);continue}if(null!=n.mixingFrom&&this.updateMixingFrom(n,t)){var h=n.mixingFrom;for(n.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}n.trackTime+=i}}this.queue.drain()},e.updateMixingFrom=function(t,e){var r=t.mixingFrom;if(null==r)return!0;var a=this.updateMixingFrom(r,e);return(r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration)?((0==r.totalAlpha||0==t.mixDuration)&&(t.mixingFrom=r.mixingFrom,null!=r.mixingFrom&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),a):(r.trackTime+=e*r.timeScale,t.mixTime+=e,!1)},e.apply=function(e){if(null==e)throw Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var a=this.events,n=this.tracks,i=!1,s=0,o=n.length;s<o;s++){var h=n[s];if(null!=h&&!(h.delay>0)){i=!0;var l=0==s?T.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,e,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,v=h.animation.timelines;if(0==s&&1==u||l==T.add)for(var g=0;g<d;g++){S.webkit602BugfixHelper(u,l);var m=v[g];r(m,Y)?this.applyAttachmentTimeline(m,e,f,l,!0):m.apply(e,c,f,a,u,l,A.mixIn)}else{var p=h.timelineMode,E=0==h.timelinesRotation.length;E&&S.setArraySize(h.timelinesRotation,d<<1,null);for(var b=h.timelinesRotation,x=0;x<d;x++){var w=v[x],M=p[x]==t.SUBSEQUENT?l:T.setup;r(w,V)?this.applyRotateTimeline(w,e,f,u,M,b,x<<1,E):r(w,Y)?this.applyAttachmentTimeline(w,e,f,l,!0):(S.webkit602BugfixHelper(u,l),w.apply(e,c,f,a,u,M,A.mixIn))}}this.queueEvents(h,f),a.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}for(var y=this.unkeyedState+t.SETUP,I=e.slots,R=0,k=e.slots.length;R<k;R++){var C=I[R];if(C.attachmentState==y){var P=C.data.attachmentName;C.attachment=null==P?null:e.getAttachment(C.data.index,P)}}return this.unkeyedState+=2,this.queue.drain(),i},e.applyMixingFrom=function(e,a,n){var i=e.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,a,n);var s=0;0==e.mixDuration?(s=1,n==T.first&&(n=T.setup)):((s=e.mixTime/e.mixDuration)>1&&(s=1),n!=T.first&&(n=i.mixBlend));var o=s<i.eventThreshold?this.events:null,h=s<i.attachmentThreshold,l=s<i.drawOrderThreshold,u=i.animationLast,c=i.getAnimationTime(),f=i.animation.timelines.length,d=i.animation.timelines,v=i.alpha*e.interruptAlpha,g=v*(1-s);if(n==T.add)for(var m=0;m<f;m++)d[m].apply(a,u,c,o,g,n,A.mixOut);else{var p=i.timelineMode,E=i.timelineHoldMix,b=0==i.timelinesRotation.length;b&&S.setArraySize(i.timelinesRotation,f<<1,null);var x=i.timelinesRotation;i.totalAlpha=0;for(var w=0;w<f;w++){var M=d[w],y=A.mixOut,I=void 0,R=0;switch(p[w]){case t.SUBSEQUENT:if(!l&&r(M,D))continue;I=n,R=g;break;case t.FIRST:I=T.setup,R=g;break;case t.HOLD_SUBSEQUENT:I=n,R=v;break;case t.HOLD_FIRST:I=T.setup,R=v;break;default:I=T.setup;var k=E[w];R=v*Math.max(0,1-k.mixTime/k.mixDuration)}i.totalAlpha+=R,r(M,V)?this.applyRotateTimeline(M,a,c,R,I,x,w<<1,b):r(M,Y)?this.applyAttachmentTimeline(M,a,c,I,h):(S.webkit602BugfixHelper(R,n),l&&r(M,D)&&I==T.setup&&(y=A.mixIn),M.apply(a,u,c,o,R,I,y))}}return e.mixDuration>0&&this.queueEvents(i,c),this.events.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime,s},e.applyAttachmentTimeline=function(e,r,a,n,i){var s,o=r.slots[e.slotIndex];if(o.bone.active){var h=e.frames;a<h[0]?(n==T.setup||n==T.first)&&this.setAttachment(r,o,o.data.attachmentName,i):(s=a>=h[h.length-1]?h.length-1:R.binarySearch(h,a)-1,this.setAttachment(r,o,e.attachmentNames[s],i)),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+t.SETUP)}},e.setAttachment=function(e,r,a,n){r.attachment=null==a?null:e.getAttachment(r.data.index,a),n&&(r.attachmentState=this.unkeyedState+t.CURRENT)},e.applyRotateTimeline=function(t,e,r,a,n,i,s,o){if(o&&(i[s]=0),1==a){t.apply(e,0,r,null,1,n,A.mixIn);return}var h=t.frames,l=e.bones[t.boneIndex];if(l.active){var u=0,c=0;if(r<h[0])switch(n){case T.setup:l.rotation=l.data.rotation;default:return;case T.first:u=l.rotation,c=l.data.rotation}else if(u=n==T.setup?l.data.rotation:l.rotation,r>=h[h.length-V.ENTRIES])c=l.data.rotation+h[h.length+V.PREV_ROTATION];else{var f=R.binarySearch(h,r,V.ENTRIES),d=h[f+V.PREV_ROTATION],v=h[f],g=t.getCurvePercent((f>>1)-1,1-(r-v)/(h[f+V.PREV_TIME]-v));c=h[f+V.ROTATION]-d,c-=(16384-(16384.499999999996-c/360|0))*360,c=d+c*g+l.data.rotation,c-=(16384-(16384.499999999996-c/360|0))*360}var m=0,p=c-u;if(0==(p-=(16384-(16384.499999999996-p/360|0))*360))m=i[s];else{var E=0,x=0;o?(E=0,x=p):(E=i[s],x=i[s+1]);var S=p>0,w=E>=0;b.signum(x)!=b.signum(p)&&90>=Math.abs(x)&&(Math.abs(E)>180&&(E+=360*b.signum(E)),w=S),m=p+E-E%360,w!=S&&(m+=360*b.signum(E)),i[s]=m}i[s+1]=p,u+=m*a,l.rotation=u-(16384-(16384.499999999996-u/360|0))*360}},e.queueEvents=function(t,e){for(var r=t.animationStart,a=t.animationEnd,n=a-r,i=t.trackLast%n,s=this.events,o=0,h=s.length;o<h;o++){var l=s[o];if(l.time<i)break;l.time>a||this.queue.event(t,l)}for((t.loop?0==n||i>t.trackTime%n:e>=a&&t.animationLast<a)&&this.queue.complete(t);o<h;o++)s[o].time<r||this.queue.event(t,s[o])},e.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,r=this.tracks.length;e<r;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var r=e;;){var a=r.mixingFrom;if(null==a)break;this.queue.end(a),r.mixingFrom=null,r.mixingTo=null,r=a}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.setCurrent=function(t,e,r){var a=this.expandToIndex(t);this.tracks[t]=e,null!=a&&(r&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,null!=a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)},e.setAnimation=function(t,e,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw Error("Animation not found: "+e);return this.setAnimationWith(t,a,r)},e.setAnimationWith=function(t,e,r){if(null==e)throw Error("animation cannot be null.");var a=!0,n=this.expandToIndex(t);null!=n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.disposeNext(n),n=n.mixingFrom,a=!1):this.disposeNext(n));var i=this.trackEntry(t,e,r,n);return this.setCurrent(t,i,a),this.queue.drain(),i},e.addAnimation=function(t,e,r,a){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw Error("Animation not found: "+e);return this.addAnimationWith(t,n,r,a)},e.addAnimationWith=function(t,e,r,a){if(null==e)throw Error("animation cannot be null.");var n=this.expandToIndex(t);if(null!=n)for(;null!=n.next;)n=n.next;var i=this.trackEntry(t,e,r,n);if(null==n)this.setCurrent(t,i,!0),this.queue.drain();else if(n.next=i,a<=0){var s=n.animationEnd-n.animationStart;0!=s?(n.loop?a+=s*(1+(n.trackTime/s|0)):a+=Math.max(s,n.trackTime),a-=this.data.getMix(n.animation,e)):a=n.trackTime}return i.delay=a,i},e.setEmptyAnimation=function(e,r){var a=this.setAnimationWith(e,t.emptyAnimation,!1);return a.mixDuration=r,a.trackEnd=r,a},e.addEmptyAnimation=function(e,r,a){a<=0&&(a-=r);var n=this.addAnimationWith(e,t.emptyAnimation,!1,a);return n.mixDuration=r,n.trackEnd=r,n},e.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var r=0,a=this.tracks.length;r<a;r++){var n=this.tracks[r];null!=n&&this.setEmptyAnimation(n.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.expandToIndex=function(t){return t<this.tracks.length?this.tracks[t]:(S.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)},e.trackEntry=function(t,e,r,a){var n=this.trackEntryPool.obtain();return n.trackIndex=t,n.animation=e,n.loop=r,n.holdPrevious=!1,n.eventThreshold=0,n.attachmentThreshold=0,n.drawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.interruptAlpha=1,n.mixTime=0,n.mixDuration=null==a?0:this.data.getMix(a.animation,e),n.mixBlend=T.replace,n},e.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},e._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var t=0,e=this.tracks.length;t<e;t++){var r=this.tracks[t];if(null!=r){for(;null!=r.mixingFrom;)r=r.mixingFrom;do(null==r.mixingFrom||r.mixBlend!=T.add)&&this.computeHold(r),r=r.mixingTo;while(null!=r)}}},e.computeHold=function(e){var a=e.mixingTo,n=e.animation.timelines,i=e.animation.timelines.length,s=S.setArraySize(e.timelineMode,i);e.timelineHoldMix.length=0;var o=S.setArraySize(e.timelineHoldMix,i),h=this.propertyIDs;if(null!=a&&a.holdPrevious){for(var l=0;l<i;l++)s[l]=h.add(n[l].getPropertyId())?t.HOLD_FIRST:t.HOLD_SUBSEQUENT;return}t:for(var u=0;u<i;u++){var c=n[u],f=c.getPropertyId();if(h.add(f)){if(null==a||r(c,Y)||r(c,D)||r(c,L)||!a.animation.hasTimeline(f))s[u]=t.FIRST;else{for(var d=a.mixingTo;null!=d;d=d.mixingTo)if(!d.animation.hasTimeline(f)){if(e.mixDuration>0){s[u]=t.HOLD_MIX,o[u]=d;continue t}break}s[u]=t.HOLD_FIRST}}else s[u]=t.SUBSEQUENT}},e.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.addListener=function(t){if(null==t)throw Error("listener cannot be null.");this.listeners.push(t)},e.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.clearListeners=function(){this.listeners.length=0},e.clearListenerNotifications=function(){this.queue.clear()},t}();G.emptyAnimation=new R("<empty>",[],0),G.SUBSEQUENT=0,G.FIRST=1,G.HOLD_SUBSEQUENT=2,G.HOLD_FIRST=3,G.HOLD_MIX=4,G.SETUP=1,G.CURRENT=2;var j=/*#__PURE__*/function(){function t(){this.mixBlend=T.replace,this.timelineMode=[],this.timelineHoldMix=[],this.timelinesRotation=[]}var e=t.prototype;return e.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.resetRotationDirections=function(){this.timelinesRotation.length=0},t}(),z=/*#__PURE__*/function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}var e=t.prototype;return e.start=function(t){this.objects.push(0),this.objects.push(t),this.animState.animationsChanged=!0},e.interrupt=function(t){this.objects.push(1),this.objects.push(t)},e.end=function(t){this.objects.push(2),this.objects.push(t),this.animState.animationsChanged=!0},e.dispose=function(t){this.objects.push(3),this.objects.push(t)},e.complete=function(t){this.objects.push(4),this.objects.push(t)},e.event=function(t,e){this.objects.push(5),this.objects.push(t),this.objects.push(e)},e.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];switch(a){case 0:null!=n.listener&&n.listener.start&&n.listener.start(n);for(var i=0;i<e.length;i++)e[i].start&&e[i].start(n);break;case 1:null!=n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(var s=0;s<e.length;s++)e[s].interrupt&&e[s].interrupt(n);break;case 2:null!=n.listener&&n.listener.end&&n.listener.end(n);for(var o=0;o<e.length;o++)e[o].end&&e[o].end(n);case 3:null!=n.listener&&n.listener.dispose&&n.listener.dispose(n);for(var h=0;h<e.length;h++)e[h].dispose&&e[h].dispose(n);this.animState.trackEntryPool.free(n);break;case 4:null!=n.listener&&n.listener.complete&&n.listener.complete(n);for(var l=0;l<e.length;l++)e[l].complete&&e[l].complete(n);break;case 5:var u=t[r+++2];null!=n.listener&&n.listener.event&&n.listener.event(n,u);for(var c=0;c<e.length;c++)e[c].event&&e[c].event(n,u)}}this.clear(),this.drainDisabled=!1}},e.clear=function(){this.objects.length=0},t}(),Z=/*#__PURE__*/function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw Error("skeletonData cannot be null.");this.skeletonData=t}var e=t.prototype;return e.setMix=function(t,e,r){var a=this.skeletonData.findAnimation(t);if(null==a)throw Error("Animation not found: "+t);var n=this.skeletonData.findAnimation(e);if(null==n)throw Error("Animation not found: "+e);this.setMixWith(a,n,r)},e.setMixWith=function(t,e,r){if(null==t)throw Error("from cannot be null.");if(null==e)throw Error("to cannot be null.");var a=t.name+"."+e.name;this.animationToMixTime[a]=r},e.getMix=function(t,e){var r=t.name+"."+e.name,a=this.animationToMixTime[r];return void 0===a?this.defaultMix:a},t}(),Q=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).x=0,r.y=0,r.scaleX=1,r.scaleY=1,r.rotation=0,r.width=0,r.height=0,r.color=new E(1,1,1,1),r.offset=S.newFloatArray(8),r.uvs=S.newFloatArray(8),r.tempColor=new E(1,1,1,1),r}s(e,t);var r=e.prototype;return r.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*t,n=-this.height/2*this.scaleY+this.region.offsetY*r,i=a+this.region.width*t,s=n+this.region.height*r,o=this.rotation*Math.PI/180,h=Math.cos(o),l=Math.sin(o),u=a*h+this.x,c=a*l,f=n*h+this.y,d=n*l,v=i*h+this.x,g=i*l,m=s*h+this.y,p=s*l,E=this.offset;E[e.OX1]=u-d,E[e.OY1]=f+c,E[e.OX2]=u-p,E[e.OY2]=m+c,E[e.OX3]=v-p,E[e.OY3]=m+g,E[e.OX4]=v-d,E[e.OY4]=f+g},r.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},r.computeWorldVertices=function(t,r,a,n){var i=this.offset,s=t.worldX,o=t.worldY,h=t.a,l=t.b,u=t.c,c=t.d,f=0,d=0;f=i[e.OX1],d=i[e.OY1],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o,a+=n,f=i[e.OX2],d=i[e.OY2],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o,a+=n,f=i[e.OX3],d=i[e.OY3],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o,a+=n,f=i[e.OX4],d=i[e.OY4],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o},r.copy=function(){var t=new e(this.name);return t.region=this.region,t.rendererObject=this.rendererObject,t.path=this.path,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,S.arrayCopy(this.uvs,0,t.uvs,0,8),S.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t},e}(y);Q.OX1=0,Q.OY1=1,Q.OX2=2,Q.OY2=3,Q.OX3=4,Q.OY3=5,Q.OX4=6,Q.OY4=7,Q.X1=0,Q.Y1=1,Q.C1R=2,Q.C1G=3,Q.C1B=4,Q.C1A=5,Q.U1=6,Q.V1=7,Q.X2=8,Q.Y2=9,Q.C2R=10,Q.C2G=11,Q.C2B=12,Q.C2A=13,Q.U2=14,Q.V2=15,Q.X3=16,Q.Y3=17,Q.C3R=18,Q.C3G=19,Q.C3B=20,Q.C3A=21,Q.U3=22,Q.V3=23,Q.X4=24,Q.Y4=25,Q.C4R=26,Q.C4G=27,Q.C4B=28,Q.C4A=29,Q.U4=30,Q.V4=31;var K=/*#__PURE__*/function(){var t;function e(t){this._texture=t}return e.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return 9728;case"linear":return 9729;case"mipmap":case"mipmaplinearlinear":return 9987;case"mipmapnearestnearest":return 9984;case"mipmaplinearnearest":return 9985;case"mipmapnearestlinear":return 9986;default:throw Error("Unknown texture filter "+t)}},e.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return 33648;case"clamptoedge":return 33071;case"repeat":return 10497;default:throw Error("Unknown texture wrap "+t)}},t=[{key:"width",get:function(){return this._texture.width}},{key:"height",get:function(){return this._texture.height}},{key:"texture",get:function(){return this._texture}}],function(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}(e.prototype,t),e}(),J=((l={})[l.Nearest=9728]="Nearest",l[l.Linear=9729]="Linear",l[l.MipMap=9987]="MipMap",l[l.MipMapNearestNearest=9984]="MipMapNearestNearest",l[l.MipMapLinearNearest=9985]="MipMapLinearNearest",l[l.MipMapNearestLinear=9986]="MipMapNearestLinear",l[l.MipMapLinearLinear=9987]="MipMapLinearLinear",l),$=((u={})[u.MirroredRepeat=33648]="MirroredRepeat",u[u.ClampToEdge=33071]="ClampToEdge",u[u.Repeat=10497]="Repeat",u),tt=/*#__PURE__*/function(){function t(t,e){this.pages=[],this.regions=[],this.load(t,e)}var e=t.prototype;return e.load=function(t,e){if(null==e)throw Error("textureLoader cannot be null.");for(var r=new te(t),a=[,,,,],n=null;;){var i=r.readLine();if(null==i)break;if(0==(i=i.trim()).length)n=null;else if(n){var s=new ta;s.name=i,s.page=n;var o=r.readValue();"true"==o.toLocaleLowerCase()?s.degrees=90:"false"==o.toLocaleLowerCase()?s.degrees=0:s.degrees=parseFloat(o),s.rotate=90==s.degrees,r.readTuple(a);var h=parseInt(a[0]),l=parseInt(a[1]);r.readTuple(a);var u=parseInt(a[0]),c=parseInt(a[1]);s.u=h/n.width,s.v=l/n.height,s.rotate?(s.u2=(h+c)/n.width,s.v2=(l+u)/n.height):(s.u2=(h+u)/n.width,s.v2=(l+c)/n.height),s.x=h,s.y=l,s.width=Math.abs(u),s.height=Math.abs(c),4==r.readTuple(a)&&4==r.readTuple(a)&&r.readTuple(a),s.originalWidth=parseInt(a[0]),s.originalHeight=parseInt(a[1]),r.readTuple(a),s.offsetX=parseInt(a[0]),s.offsetY=parseInt(a[1]),s.index=parseInt(r.readValue()),s.texture=n.texture,this.regions.push(s)}else{(n=new tr).name=i,2==r.readTuple(a)&&(n.width=parseInt(a[0]),n.height=parseInt(a[1]),r.readTuple(a)),r.readTuple(a),n.minFilter=K.filterFromString(a[0]),n.magFilter=K.filterFromString(a[1]);var f=r.readValue();n.uWrap=$.ClampToEdge,n.vWrap=$.ClampToEdge,"x"==f?n.uWrap=$.Repeat:"y"==f?n.vWrap=$.Repeat:"xy"==f&&(n.uWrap=n.vWrap=$.Repeat),n.texture=e(i),n.texture.setFilters(n.minFilter,n.magFilter),n.texture.setWraps(n.uWrap,n.vWrap),n.width=n.texture.width,n.height=n.texture.height,this.pages.push(n)}}},e.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},e.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()},t}(),te=/*#__PURE__*/function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var e=t.prototype;return e.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},e.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw Error("Invalid line: "+t);return t.substring(e+1).trim()},e.readTuple=function(t){var e=this.readLine(),r=e.indexOf(":");if(-1==r)throw Error("Invalid line: "+e);for(var a=0,n=r+1;a<3;a++){var i=e.indexOf(",",n);if(-1==i)break;t[a]=e.substr(n,i-n).trim(),n=i+1}return t[a]=e.substring(n).trim(),a+1},t}(),tr=function(){},ta=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e}(function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}),tn=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(1,1,1,1),r.tempColor=new E(0,0,0,0),r}s(e,t);var a=e.prototype;return a.updateUVs=function(){var t=this.regionUVs;(null==this.uvs||this.uvs.length!=t.length)&&(this.uvs=S.newFloatArray(t.length));var e=this.uvs,a=this.uvs.length,n=this.region.u,i=this.region.v,s=0,o=0;if(r(this.region,ta)){var h=this.region,l=h.texture.width,u=h.texture.height;switch(h.degrees){case 90:n-=(h.originalHeight-h.offsetY-h.height)/l,i-=(h.originalWidth-h.offsetX-h.width)/u,s=h.originalHeight/l,o=h.originalWidth/u;for(var c=0;c<a;c+=2)e[c]=n+t[c+1]*s,e[c+1]=i+(1-t[c])*o;return;case 180:n-=(h.originalWidth-h.offsetX-h.width)/l,i-=h.offsetY/u,s=h.originalWidth/l,o=h.originalHeight/u;for(var f=0;f<a;f+=2)e[f]=n+(1-t[f])*s,e[f+1]=i+(1-t[f+1])*o;return;case 270:n-=h.offsetY/l,i-=h.offsetX/u,s=h.originalHeight/l,o=h.originalWidth/u;for(var d=0;d<a;d+=2)e[d]=n+(1-t[d+1])*s,e[d+1]=i+t[d]*o;return}n-=h.offsetX/l,i-=(h.originalHeight-h.offsetY-h.height)/u,s=h.originalWidth/l,o=h.originalHeight/u}else null==this.region?(n=i=0,s=o=1):(s=this.region.u2-n,o=this.region.v2-i);for(var v=0;v<a;v+=2)e[v]=n+t[v]*s,e[v+1]=i+t[v+1]*o},a.getParentMesh=function(){return this.parentMesh},a.setParentMesh=function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},a.copy=function(){if(null!=this.parentMesh)return this.newLinkedMesh();var t=new e(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=Array(this.regionUVs.length),S.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=Array(this.uvs.length),S.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=Array(this.triangles.length),S.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,null!=this.edges&&(t.edges=Array(this.edges.length),S.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t},a.newLinkedMesh=function(){var t=new e(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(null!=this.parentMesh?this.parentMesh:this),t.updateUVs(),t},e}(I),ti=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(1,1,1,1),r}return s(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(I),ts=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).closed=!1,r.constantSpeed=!1,r.color=new E(1,1,1,1),r}return s(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.lengths=Array(this.lengths.length),S.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t},e}(I),to=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(.38,.94,0,1),r.name=e,r}s(e,t);var r=e.prototype;return r.computeWorldPosition=function(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e},r.computeWorldRotation=function(t){var e=b.cosDeg(this.rotation),r=b.sinDeg(this.rotation),a=e*t.a+r*t.b;return Math.atan2(e*t.c+r*t.d,a)*b.radDeg},r.copy=function(){var t=new e(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},e}(I),th=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(.2275,.2275,.8078,1),r}return s(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},e}(I),tl=/*#__PURE__*/function(){function t(t){this.atlas=t}var e=t.prototype;return e.newRegionAttachment=function(t,e,r){var a=this.atlas.findRegion(r);if(null==a)throw Error("Region not found in atlas: "+r+" (region attachment: "+e+")");a.renderObject=a;var n=new Q(e);return n.setRegion(a),n},e.newMeshAttachment=function(t,e,r){var a=this.atlas.findRegion(r);if(null==a)throw Error("Region not found in atlas: "+r+" (mesh attachment: "+e+")");a.renderObject=a;var n=new tn(e);return n.region=a,n},e.newBoundingBoxAttachment=function(t,e){return new ti(e)},e.newPathAttachment=function(t,e){return new ts(e)},e.newPointAttachment=function(t,e){return new to(e)},e.newClippingAttachment=function(t,e){return new th(e)},t}(),tu=((c={})[c.Normal=0]="Normal",c[c.Additive=1]="Additive",c[c.Multiply=2]="Multiply",c[c.Screen=3]="Screen",c),tc=function(t,e,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=0,this.skinRequired=!1,this.color=new E,t<0)throw Error("index must be >= 0.");if(null==e)throw Error("name cannot be null.");this.index=t,this.name=e,this.parent=r},tf=((f={})[f.Normal=0]="Normal",f[f.OnlyTranslation=1]="OnlyTranslation",f[f.NoRotationOrReflection=2]="NoRotationOrReflection",f[f.NoScale=3]="NoScale",f[f.NoScaleOrReflection=4]="NoScaleOrReflection",f),td=/*#__PURE__*/function(){function t(t,e,r){if(this.children=[],this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=r,this.setToSetupPose()}var e=t.prototype;return e.isActive=function(){return this.active},e.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.updateWorldTransformWith=function(t,e,r,a,n,i,s){this.ax=t,this.ay=e,this.arotation=r,this.ascaleX=a,this.ascaleY=n,this.ashearX=i,this.ashearY=s,this.appliedValid=!0;var o=this.parent;if(null==o){var h=this.skeleton,l=r+90+s,u=h.scaleX,c=h.scaleY;this.a=b.cosDeg(r+i)*a*u,this.b=b.cosDeg(l)*n*u,this.c=b.sinDeg(r+i)*a*c,this.d=b.sinDeg(l)*n*c,this.worldX=t*u+h.x,this.worldY=e*c+h.y;return}var f=o.a,d=o.b,v=o.c,g=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+g*e+o.worldY,this.data.transformMode){case tf.Normal:var m=r+90+s,p=b.cosDeg(r+i)*a,E=b.cosDeg(m)*n,x=b.sinDeg(r+i)*a,S=b.sinDeg(m)*n;this.a=f*p+d*x,this.b=f*E+d*S,this.c=v*p+g*x,this.d=v*E+g*S;return;case tf.OnlyTranslation:var w=r+90+s;this.a=b.cosDeg(r+i)*a,this.b=b.cosDeg(w)*n,this.c=b.sinDeg(r+i)*a,this.d=b.sinDeg(w)*n;break;case tf.NoRotationOrReflection:var M=f*f+v*v,y=0;M>1e-4?(M=Math.abs(f*g-d*v)/M,f/=this.skeleton.scaleX,v/=this.skeleton.scaleY,d=v*M,g=f*M,y=Math.atan2(v,f)*b.radDeg):(f=0,v=0,y=90-Math.atan2(g,d)*b.radDeg);var I=r+i-y,R=r+s-y+90,T=b.cosDeg(I)*a,A=b.cosDeg(R)*n,k=b.sinDeg(I)*a,V=b.sinDeg(R)*n;this.a=f*T-d*k,this.b=f*A-d*V,this.c=v*T+g*k,this.d=v*A+g*V;break;case tf.NoScale:case tf.NoScaleOrReflection:var C=b.cosDeg(r),P=b.sinDeg(r),F=(f*C+d*P)/this.skeleton.scaleX,N=(v*C+g*P)/this.skeleton.scaleY,_=Math.sqrt(F*F+N*N);_>1e-5&&(_=1/_),F*=_,N*=_,_=Math.sqrt(F*F+N*N),this.data.transformMode==tf.NoScale&&f*g-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(_=-_);var Y=Math.PI/2+Math.atan2(N,F),X=Math.cos(Y)*_,O=Math.sin(Y)*_,L=b.cosDeg(i)*a,D=b.cosDeg(90+s)*n,B=b.sinDeg(i)*a,W=b.sinDeg(90+s)*n;this.a=F*L+X*B,this.b=F*D+X*W,this.c=N*L+O*B,this.d=N*D+O*W}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*b.radDeg},e.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*b.radDeg},e.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.updateAppliedTransform=function(){this.appliedValid=!0;var t=this.parent;if(null==t){this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*b.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*b.radDeg;return}var e=t.a,r=t.b,a=t.c,n=t.d,i=1/(e*n-r*a),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*n*i-o*r*i,this.ay=o*e*i-s*a*i;var h=i*n,l=i*e,u=i*r,c=i*a,f=h*this.a-u*this.c,d=h*this.b-u*this.d,v=l*this.c-c*this.a,g=l*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-d*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*d+v*g,m)*b.radDeg,this.arotation=Math.atan2(v,f)*b.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,d)*b.radDeg},e.worldToLocal=function(t){var e=this.a,r=this.b,a=this.c,n=this.d,i=1/(e*n-r*a),s=t.x-this.worldX,o=t.y-this.worldY;return t.x=s*n*i-o*r*i,t.y=o*e*i-s*a*i,t},e.localToWorld=function(t){var e=t.x,r=t.y;return t.x=e*this.a+r*this.b+this.worldX,t.y=e*this.c+r*this.d+this.worldY,t},e.worldToLocalRotation=function(t){var e=b.sinDeg(t),r=b.cosDeg(t);return Math.atan2(this.a*e-this.c*r,this.d*r-this.b*e)*b.radDeg+this.rotation-this.shearX},e.localToWorldRotation=function(t){t-=this.rotation-this.shearX;var e=b.sinDeg(t),r=b.cosDeg(t);return Math.atan2(r*this.c+e*this.d,r*this.a+e*this.b)*b.radDeg},e.rotateWorld=function(t){var e=this.a,r=this.b,a=this.c,n=this.d,i=b.cosDeg(t),s=b.sinDeg(t);this.a=i*e-s*a,this.b=i*r-s*n,this.c=s*e+i*a,this.d=s*r+i*n,this.appliedValid=!1},t}(),tv=function(t,e,r){this.name=t,this.order=e,this.skinRequired=r},tg=function(t,e){if(null==e)throw Error("data cannot be null.");this.time=t,this.data=e},tm=function(t){this.name=t},tp=/*#__PURE__*/function(){function t(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)}var e=t.prototype;return e.isActive=function(){return this.active},e.apply=function(){this.update()},e.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},e.apply1=function(t,e,r,a,n,i,s){t.appliedValid||t.updateAppliedTransform();var o=t.parent,h=o.a,l=o.b,u=o.c,c=o.d,f=-t.ashearX-t.arotation,d=0,v=0;switch(t.data.transformMode){case tf.OnlyTranslation:d=e-t.worldX,v=r-t.worldY;break;case tf.NoRotationOrReflection:var g=Math.abs(h*c-l*u)/(h*h+u*u),m=h/t.skeleton.scaleX,p=u/t.skeleton.scaleY;l=-p*g*t.skeleton.scaleX,c=m*g*t.skeleton.scaleY,f+=Math.atan2(p,m)*b.radDeg;default:var E=e-o.worldX,x=r-o.worldY,S=h*c-l*u;d=(E*c-x*l)/S-t.ax,v=(x*h-E*u)/S-t.ay}f+=Math.atan2(v,d)*b.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);var w=t.ascaleX,M=t.ascaleY;if(a||n){switch(t.data.transformMode){case tf.NoScale:case tf.NoScaleOrReflection:d=e-t.worldX,v=r-t.worldY}var y=t.data.length*w,I=Math.sqrt(d*d+v*v);if(a&&I<y||n&&I>y&&y>1e-4){var R=(I/y-1)*s+1;w*=R,i&&(M*=R)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,w,M,t.ashearX,t.ashearY)},e.apply2=function(t,e,r,a,n,i,s,o){if(0==o){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();var h=t.ax,l=t.ay,u=t.ascaleX,c=u,f=t.ascaleY,d=e.ascaleX,v=0,g=0,m=0;u<0?(u=-u,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),d<0?(d=-d,g=180):g=0;var p=e.ax,E=0,x=0,S=0,w=t.a,M=t.b,y=t.c,I=t.d,R=1e-4>=Math.abs(u-f);R?(x=w*p+M*(E=e.ay)+t.worldX,S=y*p+I*E+t.worldY):(E=0,x=w*p+t.worldX,S=y*p+t.worldY);var T=t.parent;w=T.a,M=T.b,y=T.c;var A,k,V=1/(w*(I=T.d)-M*y),C=x-T.worldX,P=S-T.worldY,F=(C*I-P*M)*V-h,N=(P*w-C*y)*V-l,_=Math.sqrt(F*F+N*N),Y=e.data.length*d;if(_<1e-4){this.apply1(t,r,a,!1,i,!1,o),e.updateWorldTransformWith(p,E,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}var X=((C=r-T.worldX)*I-(P=a-T.worldY)*M)*V-h,O=(P*w-C*y)*V-l,L=X*X+O*O;if(0!=s){s*=u*(d+1)/2;var D=Math.sqrt(L),B=D-_-Y*u+s;if(B>0){var W=Math.min(1,B/(2*s))-1;W=(B-s*(1-W*W))/D,X-=W*X,O-=W*O,L=X*X+O*O}}t:if(R){var q=(L-_*_-(Y*=u)*Y)/(2*_*Y);q<-1?q=-1:q>1&&(q=1,i&&(c*=(Math.sqrt(L)/(_+Y)-1)*o+1)),k=Math.acos(q)*n,A=Math.atan2(O*(w=_+Y*q)-X*(M=Y*Math.sin(k)),X*w+O*M)}else{var U=(w=u*Y)*w,H=(M=f*Y)*M,G=Math.atan2(O,X);y=H*_*_+U*L-U*H;var j=-2*H*_,z=H-U;if((I=j*j-4*z*y)>=0){var Z=Math.sqrt(I);j<0&&(Z=-Z);var Q=(Z=-(j+Z)/2)/z,K=y/Z,J=Math.abs(Q)<Math.abs(K)?Q:K;if(J*J<=L){A=G-Math.atan2(P=Math.sqrt(L-J*J)*n,J),k=Math.atan2(P/f,(J-_)/u);break t}}var $=b.PI,tt=_-w,te=tt*tt,tr=0,ta=0,tn=_+w,ti=tn*tn,ts=0;(y=-w*_/(U-H))>=-1&&y<=1&&((I=(C=w*Math.cos(y=Math.acos(y))+_)*C+(P=M*Math.sin(y))*P)<te&&($=y,te=I,tt=C,tr=P),I>ti&&(ta=y,ti=I,tn=C,ts=P)),L<=(te+ti)/2?(A=G-Math.atan2(tr*n,tt),k=$*n):(A=G-Math.atan2(ts*n,tn),k=ta*n)}var to=Math.atan2(E,p)*m,th=t.arotation;(A=(A-to)*b.radDeg+v-th)>180?A-=360:A<-180&&(A+=360),t.updateWorldTransformWith(h,l,th+A*o,c,t.ascaleY,0,0),th=e.arotation,(k=((k+to)*b.radDeg-e.ashearX)*m+g-th)>180?k-=360:k<-180&&(k+=360),e.updateWorldTransformWith(p,E,th+k*o,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},t}(),tE=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e,0,!1)||this).bones=[],r.bendDirection=1,r.compress=!1,r.stretch=!1,r.uniform=!1,r.mix=1,r.softness=0,r}return s(e,t),e}(tv),tb=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e,0,!1)||this).bones=[],r}return s(e,t),e}(tv),tx=((d={})[d.Fixed=0]="Fixed",d[d.Percent=1]="Percent",d),tS=((v={})[v.Length=0]="Length",v[v.Fixed=1]="Fixed",v[v.Percent=2]="Percent",v),tw=((g={})[g.Tangent=0]="Tangent",g[g.Chain=1]="Chain",g[g.ChainScale=2]="ChainScale",g),tM=/*#__PURE__*/function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=[],this.positions=[],this.world=[],this.curves=[],this.lengths=[],this.segments=[],this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.bones=[];for(var r=0,a=t.bones.length;r<a;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}var e=t.prototype;return e.isActive=function(){return this.active},e.apply=function(){this.update()},e.update=function(){var e=this.target.getAttachment();if(r(e,ts)){var a=this.rotateMix,n=this.translateMix,i=a>0;if(n>0||i){var s=this.data,o=s.spacingMode==tS.Percent,h=s.rotateMode,l=h==tw.Tangent,u=h==tw.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,v=S.setArraySize(this.spaces,f),g=null,m=this.spacing;if(u||!o){u&&(g=S.setArraySize(this.lengths,c));for(var p=s.spacingMode==tS.Length,E=0,x=f-1;E<x;){var w=d[E],M=w.data.length;if(M<t.epsilon)u&&(g[E]=0),v[++E]=0;else if(o){if(u){var y=M*w.a,I=M*w.c,R=Math.sqrt(y*y+I*I);g[E]=R}v[++E]=m}else{var T=M*w.a,A=M*w.c,k=Math.sqrt(T*T+A*A);u&&(g[E]=k),v[++E]=(p?M+m:m)*k/M}}}else for(var V=1;V<f;V++)v[V]=m;var C=this.computeWorldPositions(e,f,l,s.positionMode==tx.Percent,o),P=C[0],F=C[1],N=s.offsetRotation,_=!1;if(0==N)_=h==tw.Chain;else{_=!1;var Y=this.target.bone;N*=Y.a*Y.d-Y.b*Y.c>0?b.degRad:-b.degRad}for(var X=0,O=3;X<c;X++,O+=3){var L=d[X];L.worldX+=(P-L.worldX)*n,L.worldY+=(F-L.worldY)*n;var D=C[O],B=C[O+1],W=D-P,q=B-F;if(u){var U=g[X];if(0!=U){var H=(Math.sqrt(W*W+q*q)/U-1)*a+1;L.a*=H,L.c*=H}}if(P=D,F=B,i){var G=L.a,j=L.b,z=L.c,Z=L.d,Q=0,K=0,J=0;if(Q=(l?C[O-1]:0==v[X+1]?C[O+2]:Math.atan2(q,W))-Math.atan2(z,G),_){K=Math.cos(Q),J=Math.sin(Q);var $=L.data.length;P+=($*(K*G-J*z)-W)*a,F+=($*(J*G+K*z)-q)*a}else Q+=N;Q>b.PI?Q-=b.PI2:Q<-b.PI&&(Q+=b.PI2),Q*=a,K=Math.cos(Q),J=Math.sin(Q),L.a=K*G-J*z,L.b=K*j-J*Z,L.c=J*G+K*z,L.d=J*j+K*Z}L.appliedValid=!1}}}},e.computeWorldPositions=function(e,r,a,n,i){var s=this.target,o=this.position,h=this.spaces,l=S.setArraySize(this.positions,3*r+2),u=null,c=e.closed,f=e.worldVerticesLength,d=f/6,v=t.NONE;if(!e.constantSpeed){var g=e.lengths,m=g[d-=c?1:2];if(n&&(o*=m),i)for(var p=1;p<r;p++)h[p]*=m;u=S.setArraySize(this.world,8);for(var E=0,b=0,x=0;E<r;E++,b+=3){var w=h[E],M=o+=w;if(c)(M%=m)<0&&(M+=m),x=0;else if(M<0){v!=t.BEFORE&&(v=t.BEFORE,e.computeWorldVertices(s,2,4,u,0,2)),this.addBeforePosition(M,u,0,l,b);continue}else if(M>m){v!=t.AFTER&&(v=t.AFTER,e.computeWorldVertices(s,f-6,4,u,0,2)),this.addAfterPosition(M-m,u,0,l,b);continue}for(;;x++){var y=g[x];if(!(M>y)){if(0==x)M/=y;else{var I=g[x-1];M=(M-I)/(y-I)}break}}x!=v&&(v=x,c&&x==d?(e.computeWorldVertices(s,f-4,4,u,0,2),e.computeWorldVertices(s,0,4,u,4,2)):e.computeWorldVertices(s,6*x+2,8,u,0,2)),this.addCurvePosition(M,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,b,a||E>0&&0==w)}return l}c?(f+=2,u=S.setArraySize(this.world,f),e.computeWorldVertices(s,2,f-4,u,0,2),e.computeWorldVertices(s,0,2,u,f-4,2),u[f-2]=u[0],u[f-1]=u[1]):(d--,f-=4,u=S.setArraySize(this.world,f),e.computeWorldVertices(s,2,f,u,0,2));for(var R=S.setArraySize(this.curves,d),T=0,A=u[0],k=u[1],V=0,C=0,P=0,F=0,N=0,_=0,Y=0,X=0,O=0,L=0,D=0,B=0,W=0,q=0,U=0,H=2;U<d;U++,H+=6)V=u[H],C=u[H+1],P=u[H+2],F=u[H+3],N=u[H+4],_=u[H+5],Y=(A-2*V+P)*.1875,X=(k-2*C+F)*.1875,O=((V-P)*3-A+N)*.09375,L=((C-F)*3-k+_)*.09375,D=2*Y+O,B=2*X+L,T+=Math.sqrt((W=(V-A)*.75+Y+.16666667*O)*W+(q=(C-k)*.75+X+.16666667*L)*q),W+=D,q+=B,D+=O,B+=L,T+=Math.sqrt(W*W+q*q),W+=D,q+=B,T+=Math.sqrt(W*W+q*q),W+=D+O,q+=B+L,T+=Math.sqrt(W*W+q*q),R[U]=T,A=N,k=_;if(n?o*=T:o*=T/e.lengths[d-1],i)for(var G=1;G<r;G++)h[G]*=T;for(var j=this.segments,z=0,Z=0,Q=0,K=0,J=0;Z<r;Z++,Q+=3){var $=h[Z],tt=o+=$;if(c)(tt%=T)<0&&(tt+=T),K=0;else if(tt<0){this.addBeforePosition(tt,u,0,l,Q);continue}else if(tt>T){this.addAfterPosition(tt-T,u,f-4,l,Q);continue}for(;;K++){var te=R[K];if(!(tt>te)){if(0==K)tt/=te;else{var tr=R[K-1];tt=(tt-tr)/(te-tr)}break}}if(K!=v){v=K;var ta=6*K;for(A=u[ta],k=u[ta+1],V=u[ta+2],C=u[ta+3],P=u[ta+4],F=u[ta+5],N=u[ta+6],_=u[ta+7],Y=(A-2*V+P)*.03,X=(k-2*C+F)*.03,O=((V-P)*3-A+N)*.006,L=((C-F)*3-k+_)*.006,D=2*Y+O,B=2*X+L,z=Math.sqrt((W=(V-A)*.3+Y+.16666667*O)*W+(q=(C-k)*.3+X+.16666667*L)*q),j[0]=z,ta=1;ta<8;ta++)W+=D,q+=B,D+=O,B+=L,z+=Math.sqrt(W*W+q*q),j[ta]=z;W+=D,q+=B,z+=Math.sqrt(W*W+q*q),j[8]=z,W+=D+O,q+=B+L,z+=Math.sqrt(W*W+q*q),j[9]=z,J=0}for(tt*=z;;J++){var tn=j[J];if(!(tt>tn)){if(0==J)tt/=tn;else{var ti=j[J-1];tt=J+(tt-ti)/(tn-ti)}break}}this.addCurvePosition(.1*tt,A,k,V,C,P,F,N,_,l,Q,a||Z>0&&0==$)}return l},e.addBeforePosition=function(t,e,r,a,n){var i=e[r],s=e[r+1],o=e[r+2]-i,h=Math.atan2(e[r+3]-s,o);a[n]=i+t*Math.cos(h),a[n+1]=s+t*Math.sin(h),a[n+2]=h},e.addAfterPosition=function(t,e,r,a,n){var i=e[r+2],s=e[r+3],o=i-e[r],h=Math.atan2(s-e[r+1],o);a[n]=i+t*Math.cos(h),a[n+1]=s+t*Math.sin(h),a[n+2]=h},e.addCurvePosition=function(t,e,r,a,n,i,s,o,h,l,u,c){if(0==t||isNaN(t)){l[u]=e,l[u+1]=r,l[u+2]=Math.atan2(n-r,a-e);return}var f=t*t,d=f*t,v=1-t,g=v*v,m=g*v,p=v*t,E=3*p,b=v*E,x=E*t,S=e*m+a*b+i*x+o*d,w=r*m+n*b+s*x+h*d;l[u]=S,l[u+1]=w,c&&(t<.001?l[u+2]=Math.atan2(n-r,a-e):l[u+2]=Math.atan2(w-(r*g+n*p*2+s*f),S-(e*g+a*p*2+i*f)))},t}();tM.NONE=-1,tM.BEFORE=-2,tM.AFTER=-3,tM.epsilon=1e-5;var ty=/*#__PURE__*/function(){function t(t,e){if(this.deform=[],null==t)throw Error("data cannot be null.");if(null==e)throw Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new E,this.darkColor=null==t.darkColor?null:new E,this.setToSetupPose()}var e=t.prototype;return e.getSkeleton=function(){return this.bone.skeleton},e.getAttachment=function(){return this.attachment},e.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)},e.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},e.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},e.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},t}(),tI=/*#__PURE__*/function(){function t(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new M,this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)}var e=t.prototype;return e.isActive=function(){return this.active},e.apply=function(){this.update()},e.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target,i=n.a,s=n.b,o=n.c,h=n.d,l=i*h-s*o>0?b.degRad:-b.degRad,u=this.data.offsetRotation*l,c=this.data.offsetShearY*l,f=this.bones,d=0,v=f.length;d<v;d++){var g=f[d],m=!1;if(0!=t){var p=g.a,E=g.b,x=g.c,S=g.d,w=Math.atan2(o,i)-Math.atan2(x,p)+u;w>b.PI?w-=b.PI2:w<-b.PI&&(w+=b.PI2);var M=Math.cos(w*=t),y=Math.sin(w);g.a=M*p-y*x,g.b=M*E-y*S,g.c=y*p+M*x,g.d=y*E+M*S,m=!0}if(0!=e){var I=this.temp;n.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(I.x-g.worldX)*e,g.worldY+=(I.y-g.worldY)*e,m=!0}if(r>0){var R=Math.sqrt(g.a*g.a+g.c*g.c),T=Math.sqrt(i*i+o*o);R>1e-5&&(R=(R+(T-R+this.data.offsetScaleX)*r)/R),g.a*=R,g.c*=R,R=Math.sqrt(g.b*g.b+g.d*g.d),T=Math.sqrt(s*s+h*h),R>1e-5&&(R=(R+(T-R+this.data.offsetScaleY)*r)/R),g.b*=R,g.d*=R,m=!0}if(a>0){var A=g.b,k=g.d,V=Math.atan2(k,A),C=Math.atan2(h,s)-Math.atan2(o,i)-(V-Math.atan2(g.c,g.a));C>b.PI?C-=b.PI2:C<-b.PI&&(C+=b.PI2),C=V+(C+c)*a;var P=Math.sqrt(A*A+k*k);g.b=Math.cos(C)*P,g.d=Math.sin(C)*P,m=!0}m&&(g.appliedValid=!1)}},e.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target,i=n.a,s=n.b,o=n.c,h=n.d,l=i*h-s*o>0?b.degRad:-b.degRad,u=this.data.offsetRotation*l,c=this.data.offsetShearY*l,f=this.bones,d=0,v=f.length;d<v;d++){var g=f[d],m=!1;if(0!=t){var p=g.a,E=g.b,x=g.c,S=g.d,w=Math.atan2(o,i)+u;w>b.PI?w-=b.PI2:w<-b.PI&&(w+=b.PI2);var M=Math.cos(w*=t),y=Math.sin(w);g.a=M*p-y*x,g.b=M*E-y*S,g.c=y*p+M*x,g.d=y*E+M*S,m=!0}if(0!=e){var I=this.temp;n.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),g.worldX+=I.x*e,g.worldY+=I.y*e,m=!0}if(r>0){var R=(Math.sqrt(i*i+o*o)-1+this.data.offsetScaleX)*r+1;g.a*=R,g.c*=R,R=(Math.sqrt(s*s+h*h)-1+this.data.offsetScaleY)*r+1,g.b*=R,g.d*=R,m=!0}if(a>0){var T=Math.atan2(h,s)-Math.atan2(o,i);T>b.PI?T-=b.PI2:T<-b.PI&&(T+=b.PI2);var A=g.b,k=g.d;T=Math.atan2(k,A)+(T-b.PI/2+c)*a;var V=Math.sqrt(A*A+k*k);g.b=Math.cos(T)*V,g.d=Math.sin(T)*V,m=!0}m&&(g.appliedValid=!1)}},e.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s<o;s++){var h=i[s];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;if(0!=t){var u=n.arotation-l+this.data.offsetRotation;u-=(16384-(16384.499999999996-u/360|0))*360,l+=u*t}var c=h.ax,f=h.ay;0!=e&&(c+=(n.ax-c+this.data.offsetX)*e,f+=(n.ay-f+this.data.offsetY)*e);var d=h.ascaleX,v=h.ascaleY;0!=r&&(d>1e-5&&(d=(d+(n.ascaleX-d+this.data.offsetScaleX)*r)/d),v>1e-5&&(v=(v+(n.ascaleY-v+this.data.offsetScaleY)*r)/v));var g=h.ashearY;if(0!=a){var m=n.ashearY-g+this.data.offsetShearY;m-=(16384-(16384.499999999996-m/360|0))*360,h.shearY+=m*a}h.updateWorldTransformWith(c,f,l,d,v,h.ashearX,g)}},e.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s<o;s++){var h=i[s];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;0!=t&&(l+=(n.arotation+this.data.offsetRotation)*t);var u=h.ax,c=h.ay;0!=e&&(u+=(n.ax+this.data.offsetX)*e,c+=(n.ay+this.data.offsetY)*e);var f=h.ascaleX,d=h.ascaleY;0!=r&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*r+1),d>1e-5&&(d*=(n.ascaleY-1+this.data.offsetScaleY)*r+1));var v=h.ashearY;0!=a&&(v+=(n.ashearY+this.data.offsetShearY)*a),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,v)}},t}(),tR=/*#__PURE__*/function(){function t(t){if(this._updateCache=[],this.updateCacheReset=[],this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw Error("data cannot be null.");this.data=t,this.bones=[];for(var e=0;e<t.bones.length;e++){var r=t.bones[e],a=void 0;if(null==r.parent)a=new td(r,this,null);else{var n=this.bones[r.parent.index];a=new td(r,this,n),n.children.push(a)}this.bones.push(a)}this.slots=[],this.drawOrder=[];for(var i=0;i<t.slots.length;i++){var s=t.slots[i],o=this.bones[s.boneData.index],h=new ty(s,o);this.slots.push(h),this.drawOrder.push(h)}this.ikConstraints=[];for(var l=0;l<t.ikConstraints.length;l++){var u=t.ikConstraints[l];this.ikConstraints.push(new tp(u,this))}this.transformConstraints=[];for(var c=0;c<t.transformConstraints.length;c++){var f=t.transformConstraints[c];this.transformConstraints.push(new tI(f,this))}this.pathConstraints=[];for(var d=0;d<t.pathConstraints.length;d++){var v=t.pathConstraints[d];this.pathConstraints.push(new tM(v,this))}this.color=new E(1,1,1,1),this.updateCache()}var e=t.prototype;return e.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,r=t.length;e<r;e++){var a=t[e];a.sorted=a.data.skinRequired,a.active=!a.sorted}if(null!=this.skin)for(var n=this.skin.bones,i=0,s=this.skin.bones.length;i<s;i++){var o=this.bones[n[i].index];do o.sorted=!1,o.active=!0,o=o.parent;while(null!=o)}var h=this.ikConstraints,l=this.transformConstraints,u=this.pathConstraints,c=h.length,f=l.length,d=u.length,v=c+f+d;t:for(var g=0;g<v;g++){for(var m=0;m<c;m++){var p=h[m];if(p.data.order==g){this.sortIkConstraint(p);continue t}}for(var E=0;E<f;E++){var b=l[E];if(b.data.order==g){this.sortTransformConstraint(b);continue t}}for(var x=0;x<d;x++){var S=u[x];if(S.data.order==g){this.sortPathConstraint(S);continue t}}}for(var w=0,M=t.length;w<M;w++)this.sortBone(t[w])},e.sortIkConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&S.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target;this.sortBone(e);var r=t.bones,a=r[0];if(this.sortBone(a),r.length>1){var n=r[r.length-1];this._updateCache.indexOf(n)>-1||this.updateCacheReset.push(n)}this._updateCache.push(t),this.sortReset(a.children),r[r.length-1].sorted=!0}},e.sortPathConstraint=function(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||null!=this.skin&&S.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target,a=e.data.index,n=e.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,a,n),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,a,n);for(var i=0,s=this.data.skins.length;i<s;i++)this.sortPathConstraintAttachment(this.data.skins[i],a,n);var o=e.getAttachment();r(o,ts)&&this.sortPathConstraintAttachmentWith(o,n);for(var h=t.bones,l=h.length,u=0;u<l;u++)this.sortBone(h[u]);this._updateCache.push(t);for(var c=0;c<l;c++)this.sortReset(h[c].children);for(var f=0;f<l;f++)h[f].sorted=!0}},e.sortTransformConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&S.contains(this.skin.constraints,t.data,!0)),t.active){this.sortBone(t.target);var e=t.bones,r=e.length;if(t.data.local)for(var a=0;a<r;a++){var n=e[a];this.sortBone(n.parent),this._updateCache.indexOf(n)>-1||this.updateCacheReset.push(n)}else for(var i=0;i<r;i++)this.sortBone(e[i]);this._updateCache.push(t);for(var s=0;s<r;s++)this.sortReset(e[s].children);for(var o=0;o<r;o++)e[o].sorted=!0}},e.sortPathConstraintAttachment=function(t,e,r){var a=t.attachments[e];if(a)for(var n in a)this.sortPathConstraintAttachmentWith(a[n],r)},e.sortPathConstraintAttachmentWith=function(t,e){if(r(t,ts)){var a=t.bones;if(null==a)this.sortBone(e);else for(var n=this.bones,i=0;i<a.length;)for(var s=a[i++],o=i+s;i<o;i++){var h=a[i];this.sortBone(n[h])}}},e.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},e.sortReset=function(t){for(var e=0,r=t.length;e<r;e++){var a=t[e];a.active&&(a.sorted&&this.sortReset(a.children),a.sorted=!1)}},e.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,r=t.length;e<r;e++){var a=t[e];a.ax=a.x,a.ay=a.y,a.arotation=a.rotation,a.ascaleX=a.scaleX,a.ascaleY=a.scaleY,a.ashearX=a.shearX,a.ashearY=a.shearY,a.appliedValid=!0}for(var n=this._updateCache,i=0,s=n.length;i<s;i++)n[i].update()},e.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},e.setBonesToSetupPose=function(){for(var t=this.bones,e=0,r=t.length;e<r;e++)t[e].setToSetupPose();for(var a=this.ikConstraints,n=0,i=a.length;n<i;n++){var s=a[n];s.mix=s.data.mix,s.softness=s.data.softness,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch}for(var o=this.transformConstraints,h=0,l=o.length;h<l;h++){var u=o[h],c=u.data;u.rotateMix=c.rotateMix,u.translateMix=c.translateMix,u.scaleMix=c.scaleMix,u.shearMix=c.shearMix}for(var f=this.pathConstraints,d=0,v=f.length;d<v;d++){var g=f[d],m=g.data;g.position=m.position,g.spacing=m.spacing,g.rotateMix=m.rotateMix,g.translateMix=m.translateMix}},e.setSlotsToSetupPose=function(){var t=this.slots;S.arrayCopy(t,0,this.drawOrder,0,t.length);for(var e=0,r=t.length;e<r;e++)t[e].setToSetupPose()},e.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},e.findBone=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findBoneIndex=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++)if(e[r].data.name==t)return r;return -1},e.findSlot=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findSlotIndex=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++)if(e[r].data.name==t)return r;return -1},e.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw Error("Skin not found: "+t);this.setSkin(e)},e.setSkin=function(t){if(t!=this.skin){if(null!=t){if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,r=0,a=e.length;r<a;r++){var n=e[r],i=n.data.attachmentName;if(null!=i){var s=t.getAttachment(r,i);null!=s&&n.setAttachment(s)}}}this.skin=t,this.updateCache()}},e.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},e.getAttachment=function(t,e){if(null==e)throw Error("attachmentName cannot be null.");if(null!=this.skin){var r=this.skin.getAttachment(t,e);if(null!=r)return r}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},e.setAttachment=function(t,e){if(null==t)throw Error("slotName cannot be null.");for(var r=this.slots,a=0,n=r.length;a<n;a++){var i=r[a];if(i.data.name==t){var s=null;if(null!=e&&null==(s=this.getAttachment(a,e)))throw Error("Attachment not found: "+e+", for slot: "+t);i.setAttachment(s);return}}throw Error("Slot not found: "+t)},e.findIkConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.ikConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findTransformConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.transformConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findPathConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.pathConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.getBounds=function(t,e,a){if(void 0===a&&(a=[,,]),null==t)throw Error("offset cannot be null.");if(null==e)throw Error("size cannot be null.");for(var n=this.drawOrder,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=0,u=n.length;l<u;l++){var c=n[l];if(c.bone.active){var f=0,d=null,v=c.getAttachment();if(r(v,Q)?(f=8,d=S.setArraySize(a,f,0),v.computeWorldVertices(c.bone,d,0,2)):r(v,tn)&&(f=v.worldVerticesLength,d=S.setArraySize(a,f,0),v.computeWorldVertices(c,0,f,d,0,2)),null!=d)for(var g=0,m=d.length;g<m;g+=2){var p=d[g],E=d[g+1];i=Math.min(i,p),s=Math.min(s,E),o=Math.max(o,p),h=Math.max(h,E)}}}t.set(i,s),e.set(o-i,h-s)},e.update=function(t){this.time+=t},t}(),tT=/*#__PURE__*/function(){function t(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[],this.transformConstraints=[],this.pathConstraints=[],this.fps=0}var e=t.prototype;return e.findBone=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findBoneIndex=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++)if(e[r].name==t)return r;return -1},e.findSlot=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findSlotIndex=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++)if(e[r].name==t)return r;return -1},e.findSkin=function(t){if(null==t)throw Error("skinName cannot be null.");for(var e=this.skins,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findEvent=function(t){if(null==t)throw Error("eventDataName cannot be null.");for(var e=this.events,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findAnimation=function(t){if(null==t)throw Error("animationName cannot be null.");for(var e=this.animations,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findIkConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.ikConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findTransformConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.transformConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findPathConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.pathConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findPathConstraintIndex=function(t){if(null==t)throw Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,r=0,a=e.length;r<a;r++)if(e[r].name==t)return r;return -1},t}(),tA=function(t,e,r){if(this.color=new E(1,1,1,1),t<0)throw Error("index must be >= 0.");if(null==e)throw Error("name cannot be null.");if(null==r)throw Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=r},tk=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e,0,!1)||this).bones=[],r.rotateMix=0,r.translateMix=0,r.scaleMix=0,r.shearMix=0,r.offsetRotation=0,r.offsetX=0,r.offsetY=0,r.offsetScaleX=0,r.offsetScaleY=0,r.offsetShearY=0,r.relative=!1,r.local=!1,r}return s(e,t),e}(tv),tV=function(t,e,r){this.slotIndex=t,this.name=e,this.attachment=r},tC=/*#__PURE__*/function(){function t(t){if(this.attachments=[],this.bones=[],this.constraints=[],null==t)throw Error("name cannot be null.");this.name=t}var e=t.prototype;return e.setAttachment=function(t,e,r){if(null==r)throw Error("attachment cannot be null.");var a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=r},e.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var r=t.bones[e],a=!1,n=0;n<this.bones.length;n++)if(this.bones[n]==r){a=!0;break}a||this.bones.push(r)}for(var i=0;i<t.constraints.length;i++){for(var s=t.constraints[i],o=!1,h=0;h<this.constraints.length;h++)if(this.constraints[h]==s){o=!0;break}o||this.constraints.push(s)}for(var l=t.getAttachments(),u=0;u<l.length;u++){var c=l[u];this.setAttachment(c.slotIndex,c.name,c.attachment)}},e.copySkin=function(t){for(var e=0;e<t.bones.length;e++){for(var a=t.bones[e],n=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==a){n=!0;break}n||this.bones.push(a)}for(var s=0;s<t.constraints.length;s++){for(var o=t.constraints[s],h=!1,l=0;l<this.constraints.length;l++)if(this.constraints[l]==o){h=!0;break}h||this.constraints.push(o)}for(var u=t.getAttachments(),c=0;c<u.length;c++){var f=u[c];null!=f.attachment&&(r(f.attachment,tn)?f.attachment=f.attachment.newLinkedMesh():f.attachment=f.attachment.copy(),this.setAttachment(f.slotIndex,f.name,f.attachment))}},e.getAttachment=function(t,e){var r=this.attachments[t];return r?r[e]:null},e.removeAttachment=function(t,e){var r=this.attachments[t];r&&(r[e]=null)},e.getAttachments=function(){for(var t=[],e=0;e<this.attachments.length;e++){var r=this.attachments[e];if(r)for(var a in r){var n=r[a];n&&t.push(new tV(e,a,n))}}return t},e.getAttachmentsForSlot=function(t,e){var r=this.attachments[t];if(r)for(var a in r){var n=r[a];n&&e.push(new tV(t,a,n))}},e.clear=function(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0},e.attachAll=function(t,e){for(var r=0,a=0;a<t.slots.length;a++){var n=t.slots[a],i=n.getAttachment();if(i&&r<e.attachments.length){var s=e.attachments[r];for(var o in s)if(i==s[o]){var h=this.getAttachment(r,o);null!=h&&n.setAttachment(h);break}}r++}},t}(),tP=((m={})[m.Region=0]="Region",m[m.BoundingBox=1]="BoundingBox",m[m.Mesh=2]="Mesh",m[m.LinkedMesh=3]="LinkedMesh",m[m.Path=4]="Path",m[m.Point=5]="Point",m[m.Clipping=6]="Clipping",m),tF=/*#__PURE__*/function(){function t(t){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=t}var e=t.prototype;return e.readSkeletonData=function(e){var r=this.scale,a=new tT;a.name="";var n=new tN(e);if(a.hash=n.readString(),a.version=n.readString(),"3.8.75"==a.version)throw Error("Unsupported skeleton data, please export with a newer version of Spine.");a.x=n.readFloat(),a.y=n.readFloat(),a.width=n.readFloat(),a.height=n.readFloat();var i=n.readBoolean();i&&(a.fps=n.readFloat(),a.imagesPath=n.readString(),a.audioPath=n.readString());var s=0;s=n.readInt(!0);for(var o=0;o<s;o++)n.strings.push(n.readString());s=n.readInt(!0);for(var h=0;h<s;h++){var l=n.readString(),u=0==h?null:a.bones[n.readInt(!0)],c=new tc(h,l,u);c.rotation=n.readFloat(),c.x=n.readFloat()*r,c.y=n.readFloat()*r,c.scaleX=n.readFloat(),c.scaleY=n.readFloat(),c.shearX=n.readFloat(),c.shearY=n.readFloat(),c.length=n.readFloat()*r,c.transformMode=t.TransformModeValues[n.readInt(!0)],c.skinRequired=n.readBoolean(),i&&E.rgba8888ToColor(c.color,n.readInt32()),a.bones.push(c)}s=n.readInt(!0);for(var f=0;f<s;f++){var d=new tA(f,n.readString(),a.bones[n.readInt(!0)]);E.rgba8888ToColor(d.color,n.readInt32());var v=n.readInt32();-1!=v&&E.rgb888ToColor(d.darkColor=new E,v),d.attachmentName=n.readStringRef(),d.blendMode=t.BlendModeValues[n.readInt(!0)],a.slots.push(d)}s=n.readInt(!0);for(var g,m=0;m<s;m++){var p=new tE(n.readString());p.order=n.readInt(!0),p.skinRequired=n.readBoolean(),g=n.readInt(!0);for(var b=0;b<g;b++)p.bones.push(a.bones[n.readInt(!0)]);p.target=a.bones[n.readInt(!0)],p.mix=n.readFloat(),p.softness=n.readFloat()*r,p.bendDirection=n.readByte(),p.compress=n.readBoolean(),p.stretch=n.readBoolean(),p.uniform=n.readBoolean(),a.ikConstraints.push(p)}s=n.readInt(!0);for(var x,w=0;w<s;w++){var M=new tk(n.readString());M.order=n.readInt(!0),M.skinRequired=n.readBoolean(),x=n.readInt(!0);for(var y=0;y<x;y++)M.bones.push(a.bones[n.readInt(!0)]);M.target=a.bones[n.readInt(!0)],M.local=n.readBoolean(),M.relative=n.readBoolean(),M.offsetRotation=n.readFloat(),M.offsetX=n.readFloat()*r,M.offsetY=n.readFloat()*r,M.offsetScaleX=n.readFloat(),M.offsetScaleY=n.readFloat(),M.offsetShearY=n.readFloat(),M.rotateMix=n.readFloat(),M.translateMix=n.readFloat(),M.scaleMix=n.readFloat(),M.shearMix=n.readFloat(),a.transformConstraints.push(M)}s=n.readInt(!0);for(var I,R=0;R<s;R++){var T=new tb(n.readString());T.order=n.readInt(!0),T.skinRequired=n.readBoolean(),I=n.readInt(!0);for(var A=0;A<I;A++)T.bones.push(a.bones[n.readInt(!0)]);T.target=a.slots[n.readInt(!0)],T.positionMode=t.PositionModeValues[n.readInt(!0)],T.spacingMode=t.SpacingModeValues[n.readInt(!0)],T.rotateMode=t.RotateModeValues[n.readInt(!0)],T.offsetRotation=n.readFloat(),T.position=n.readFloat(),T.positionMode==tx.Fixed&&(T.position*=r),T.spacing=n.readFloat(),(T.spacingMode==tS.Length||T.spacingMode==tS.Fixed)&&(T.spacing*=r),T.rotateMix=n.readFloat(),T.translateMix=n.readFloat(),a.pathConstraints.push(T)}var k=this.readSkin(n,a,!0,i);null!=k&&(a.defaultSkin=k,a.skins.push(k));var V=a.skins.length;for(S.setArraySize(a.skins,s=V+n.readInt(!0));V<s;V++)a.skins[V]=this.readSkin(n,a,!1,i);s=this.linkedMeshes.length;for(var C=0;C<s;C++){var P=this.linkedMeshes[C],F=null==P.skin?a.defaultSkin:a.findSkin(P.skin);if(null==F)throw Error("Skin not found: "+P.skin);var N=F.getAttachment(P.slotIndex,P.parent);if(null==N)throw Error("Parent mesh not found: "+P.parent);P.mesh.deformAttachment=P.inheritDeform?N:P.mesh,P.mesh.setParentMesh(N),P.mesh.updateUVs()}this.linkedMeshes.length=0,s=n.readInt(!0);for(var _=0;_<s;_++){var Y=new tm(n.readStringRef());Y.intValue=n.readInt(!1),Y.floatValue=n.readFloat(),Y.stringValue=n.readString(),Y.audioPath=n.readString(),null!=Y.audioPath&&(Y.volume=n.readFloat(),Y.balance=n.readFloat()),a.events.push(Y)}s=n.readInt(!0);for(var X=0;X<s;X++)a.animations.push(this.readAnimation(n,n.readString(),a));return a},e.readSkin=function(t,e,r,a){var n=null,i=0;if(r){if(0==(i=t.readInt(!0)))return null;n=new tC("default")}else{(n=new tC(t.readStringRef())).bones.length=t.readInt(!0);for(var s=0,o=n.bones.length;s<o;s++)n.bones[s]=e.bones[t.readInt(!0)];for(var h=0,l=t.readInt(!0);h<l;h++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(var u=0,c=t.readInt(!0);u<c;u++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(var f=0,d=t.readInt(!0);f<d;f++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);i=t.readInt(!0)}for(var v=0;v<i;v++)for(var g=t.readInt(!0),m=0,p=t.readInt(!0);m<p;m++){var E=t.readStringRef(),b=this.readAttachment(t,e,n,g,E,a);null!=b&&n.setAttachment(g,E,b)}return n},e.readAttachment=function(e,r,a,n,i,s){var o=this.scale,h=e.readStringRef();null==h&&(h=i);var l=e.readByte();switch(t.AttachmentTypeValues[l]){case tP.Region:var u=e.readStringRef(),c=e.readFloat(),f=e.readFloat(),d=e.readFloat(),v=e.readFloat(),g=e.readFloat(),m=e.readFloat(),p=e.readFloat(),b=e.readInt32();null==u&&(u=h);var x=this.attachmentLoader.newRegionAttachment(a,h,u);if(null==x)break;return x.path=u,x.x=f*o,x.y=d*o,x.scaleX=v,x.scaleY=g,x.rotation=c,x.width=m*o,x.height=p*o,E.rgba8888ToColor(x.color,b),x.updateOffset(),x;case tP.BoundingBox:var w=e.readInt(!0),M=this.readVertices(e,w),y=s?e.readInt32():0,I=this.attachmentLoader.newBoundingBoxAttachment(a,h);if(null==I)break;return I.worldVerticesLength=w<<1,I.vertices=M.vertices,I.bones=M.bones,s&&E.rgba8888ToColor(I.color,y),I;case tP.Mesh:var R=e.readStringRef(),T=e.readInt32(),A=e.readInt(!0),k=this.readFloatArray(e,A<<1,1),V=this.readShortArray(e),C=this.readVertices(e,A),P=e.readInt(!0),F=null,N=0,_=0;s&&(F=this.readShortArray(e),N=e.readFloat(),_=e.readFloat()),null==R&&(R=h);var Y=this.attachmentLoader.newMeshAttachment(a,h,R);if(null==Y)break;return Y.path=R,E.rgba8888ToColor(Y.color,T),Y.bones=C.bones,Y.vertices=C.vertices,Y.worldVerticesLength=A<<1,Y.triangles=V,Y.regionUVs=k,Y.updateUVs(),Y.hullLength=P<<1,s&&(Y.edges=F,Y.width=N*o,Y.height=_*o),Y;case tP.LinkedMesh:var X=e.readStringRef(),O=e.readInt32(),L=e.readStringRef(),D=e.readStringRef(),B=e.readBoolean(),W=0,q=0;s&&(W=e.readFloat(),q=e.readFloat()),null==X&&(X=h);var U=this.attachmentLoader.newMeshAttachment(a,h,X);if(null==U)break;return U.path=X,E.rgba8888ToColor(U.color,O),s&&(U.width=W*o,U.height=q*o),this.linkedMeshes.push(new t_(U,L,n,D,B)),U;case tP.Path:for(var H=e.readBoolean(),G=e.readBoolean(),j=e.readInt(!0),z=this.readVertices(e,j),Z=S.newArray(j/3,0),Q=0,K=Z.length;Q<K;Q++)Z[Q]=e.readFloat()*o;var J=s?e.readInt32():0,$=this.attachmentLoader.newPathAttachment(a,h);if(null==$)break;return $.closed=H,$.constantSpeed=G,$.worldVerticesLength=j<<1,$.vertices=z.vertices,$.bones=z.bones,$.lengths=Z,s&&E.rgba8888ToColor($.color,J),$;case tP.Point:var tt=e.readFloat(),te=e.readFloat(),tr=e.readFloat(),ta=s?e.readInt32():0,tn=this.attachmentLoader.newPointAttachment(a,h);if(null==tn)break;return tn.x=te*o,tn.y=tr*o,tn.rotation=tt,s&&E.rgba8888ToColor(tn.color,ta),tn;case tP.Clipping:var ti=e.readInt(!0),ts=e.readInt(!0),to=this.readVertices(e,ts),th=s?e.readInt32():0,tl=this.attachmentLoader.newClippingAttachment(a,h);if(null==tl)break;return tl.endSlot=r.slots[ti],tl.worldVerticesLength=ts<<1,tl.vertices=to.vertices,tl.bones=to.bones,s&&E.rgba8888ToColor(tl.color,th),tl}return null},e.readVertices=function(t,e){var r=new tY,a=this.scale;if(!t.readBoolean())return r.vertices=this.readFloatArray(t,e<<1,a),r;for(var n=[],i=[],s=0;s<e;s++){var o=t.readInt(!0);i.push(o);for(var h=0;h<o;h++)i.push(t.readInt(!0)),n.push(t.readFloat()*a),n.push(t.readFloat()*a),n.push(t.readFloat())}return r.vertices=S.toFloatArray(n),r.bones=i,r},e.readFloatArray=function(t,e,r){var a=Array(e);if(1==r)for(var n=0;n<e;n++)a[n]=t.readFloat();else for(var i=0;i<e;i++)a[i]=t.readFloat()*r;return a},e.readShortArray=function(t){for(var e=t.readInt(!0),r=Array(e),a=0;a<e;a++)r[a]=t.readShort();return r},e.readAnimation=function(e,r,a){for(var n=[],i=this.scale,s=0,o=new E,h=new E,l=0,u=e.readInt(!0);l<u;l++)for(var c=e.readInt(!0),f=0,d=e.readInt(!0);f<d;f++){var v=e.readByte(),g=e.readInt(!0);switch(v){case t.SLOT_ATTACHMENT:var m=new Y(g);m.slotIndex=c;for(var p=0;p<g;p++)m.setFrame(p,e.readFloat(),e.readStringRef());n.push(m),s=Math.max(s,m.frames[g-1]);break;case t.SLOT_COLOR:var b=new N(g);b.slotIndex=c;for(var x=0;x<g;x++){var w=e.readFloat();E.rgba8888ToColor(o,e.readInt32()),b.setFrame(x,w,o.r,o.g,o.b,o.a),x<g-1&&this.readCurve(e,x,b)}n.push(b),s=Math.max(s,b.frames[(g-1)*N.ENTRIES]);break;case t.SLOT_TWO_COLOR:var M=new _(g);M.slotIndex=c;for(var y=0;y<g;y++){var I=e.readFloat();E.rgba8888ToColor(o,e.readInt32()),E.rgb888ToColor(h,e.readInt32()),M.setFrame(y,I,o.r,o.g,o.b,o.a,h.r,h.g,h.b),y<g-1&&this.readCurve(e,y,M)}n.push(M),s=Math.max(s,M.frames[(g-1)*_.ENTRIES])}}for(var T=0,A=e.readInt(!0);T<A;T++)for(var k=e.readInt(!0),X=0,G=e.readInt(!0);X<G;X++){var j=e.readByte(),z=e.readInt(!0);switch(j){case t.BONE_ROTATE:var Z=new V(z);Z.boneIndex=k;for(var Q=0;Q<z;Q++)Z.setFrame(Q,e.readFloat(),e.readFloat()),Q<z-1&&this.readCurve(e,Q,Z);n.push(Z),s=Math.max(s,Z.frames[(z-1)*V.ENTRIES]);break;case t.BONE_TRANSLATE:case t.BONE_SCALE:case t.BONE_SHEAR:var K=void 0,J=1;j==t.BONE_SCALE?K=new P(z):j==t.BONE_SHEAR?K=new F(z):(K=new C(z),J=i),K.boneIndex=k;for(var $=0;$<z;$++)K.setFrame($,e.readFloat(),e.readFloat()*J,e.readFloat()*J),$<z-1&&this.readCurve(e,$,K);n.push(K),s=Math.max(s,K.frames[(z-1)*C.ENTRIES])}}for(var tt=0,te=e.readInt(!0);tt<te;tt++){var tr=e.readInt(!0),ta=e.readInt(!0),tn=new B(ta);tn.ikConstraintIndex=tr;for(var ti=0;ti<ta;ti++)tn.setFrame(ti,e.readFloat(),e.readFloat(),e.readFloat()*i,e.readByte(),e.readBoolean(),e.readBoolean()),ti<ta-1&&this.readCurve(e,ti,tn);n.push(tn),s=Math.max(s,tn.frames[(ta-1)*B.ENTRIES])}for(var ts=0,to=e.readInt(!0);ts<to;ts++){var th=e.readInt(!0),tl=e.readInt(!0),tu=new W(tl);tu.transformConstraintIndex=th;for(var tc=0;tc<tl;tc++)tu.setFrame(tc,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat()),tc<tl-1&&this.readCurve(e,tc,tu);n.push(tu),s=Math.max(s,tu.frames[(tl-1)*W.ENTRIES])}for(var tf=0,td=e.readInt(!0);tf<td;tf++)for(var tv=e.readInt(!0),tm=a.pathConstraints[tv],tp=0,tE=e.readInt(!0);tp<tE;tp++){var tb=e.readByte(),tw=e.readInt(!0);switch(tb){case t.PATH_POSITION:case t.PATH_SPACING:var tM=void 0,ty=1;tb==t.PATH_SPACING?(tM=new U(tw),(tm.spacingMode==tS.Length||tm.spacingMode==tS.Fixed)&&(ty=i)):(tM=new q(tw),tm.positionMode==tx.Fixed&&(ty=i)),tM.pathConstraintIndex=tv;for(var tI=0;tI<tw;tI++)tM.setFrame(tI,e.readFloat(),e.readFloat()*ty),tI<tw-1&&this.readCurve(e,tI,tM);n.push(tM),s=Math.max(s,tM.frames[(tw-1)*q.ENTRIES]);break;case t.PATH_MIX:var tR=new H(tw);tR.pathConstraintIndex=tv;for(var tT=0;tT<tw;tT++)tR.setFrame(tT,e.readFloat(),e.readFloat(),e.readFloat()),tT<tw-1&&this.readCurve(e,tT,tR);n.push(tR),s=Math.max(s,tR.frames[(tw-1)*H.ENTRIES])}}for(var tA=0,tk=e.readInt(!0);tA<tk;tA++)for(var tV=a.skins[e.readInt(!0)],tC=0,tP=e.readInt(!0);tC<tP;tC++)for(var tF=e.readInt(!0),tN=0,t_=e.readInt(!0);tN<t_;tN++){var tY=tV.getAttachment(tF,e.readStringRef()),tX=null!=tY.bones,tO=tY.vertices,tL=tX?tO.length/3*2:tO.length,tD=e.readInt(!0),tB=new O(tD);tB.slotIndex=tF,tB.attachment=tY;for(var tW=0;tW<tD;tW++){var tq=e.readFloat(),tU=void 0,tH=e.readInt(!0);if(0==tH)tU=tX?S.newFloatArray(tL):tO;else{tU=S.newFloatArray(tL);var tG=e.readInt(!0);if(tH+=tG,1==i)for(var tj=tG;tj<tH;tj++)tU[tj]=e.readFloat();else for(var tz=tG;tz<tH;tz++)tU[tz]=e.readFloat()*i;if(!tX)for(var tZ=0,tQ=tU.length;tZ<tQ;tZ++)tU[tZ]+=tO[tZ]}tB.setFrame(tW,tq,tU),tW<tD-1&&this.readCurve(e,tW,tB)}n.push(tB),s=Math.max(s,tB.frames[tD-1])}var tK=e.readInt(!0);if(tK>0){for(var tJ=new D(tK),t$=a.slots.length,t0=0;t0<tK;t0++){for(var t1=e.readFloat(),t2=e.readInt(!0),t3=S.newArray(t$,0),t9=t$-1;t9>=0;t9--)t3[t9]=-1;for(var t6=S.newArray(t$-t2,0),t8=0,t4=0,t5=0;t5<t2;t5++){for(var t7=e.readInt(!0);t8!=t7;)t6[t4++]=t8++;t3[t8+e.readInt(!0)]=t8++}for(;t8<t$;)t6[t4++]=t8++;for(var et=t$-1;et>=0;et--)-1==t3[et]&&(t3[et]=t6[--t4]);tJ.setFrame(t0,t1,t3)}n.push(tJ),s=Math.max(s,tJ.frames[tK-1])}var ee=e.readInt(!0);if(ee>0){for(var er=new L(ee),ea=0;ea<ee;ea++){var en=e.readFloat(),ei=a.events[e.readInt(!0)],es=new tg(en,ei);es.intValue=e.readInt(!1),es.floatValue=e.readFloat(),es.stringValue=e.readBoolean()?e.readString():ei.stringValue,null!=es.data.audioPath&&(es.volume=e.readFloat(),es.balance=e.readFloat()),er.setFrame(ea,es)}n.push(er),s=Math.max(s,er.frames[ee-1])}return new R(r,n,s)},e.readCurve=function(e,r,a){switch(e.readByte()){case t.CURVE_STEPPED:a.setStepped(r);break;case t.CURVE_BEZIER:this.setCurve(a,r,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat())}},e.setCurve=function(t,e,r,a,n,i){t.setCurve(e,r,a,n,i)},t}();tF.AttachmentTypeValues=[0,1,2,3,4,5,6],tF.TransformModeValues=[tf.Normal,tf.OnlyTranslation,tf.NoRotationOrReflection,tf.NoScale,tf.NoScaleOrReflection],tF.PositionModeValues=[tx.Fixed,tx.Percent],tF.SpacingModeValues=[tS.Length,tS.Fixed,tS.Percent],tF.RotateModeValues=[tw.Tangent,tw.Chain,tw.ChainScale],tF.BlendModeValues=[tu.Normal,tu.Additive,tu.Multiply,tu.Screen],tF.BONE_ROTATE=0,tF.BONE_TRANSLATE=1,tF.BONE_SCALE=2,tF.BONE_SHEAR=3,tF.SLOT_ATTACHMENT=0,tF.SLOT_COLOR=1,tF.SLOT_TWO_COLOR=2,tF.PATH_POSITION=0,tF.PATH_SPACING=1,tF.PATH_MIX=2,tF.CURVE_LINEAR=0,tF.CURVE_STEPPED=1,tF.CURVE_BEZIER=2;var tN=/*#__PURE__*/function(){function t(t,e,r,a){void 0===e&&(e=[]),void 0===r&&(r=0),void 0===a&&(a=new DataView(t.buffer)),this.strings=e,this.index=r,this.buffer=a}var e=t.prototype;return e.readByte=function(){return this.buffer.getInt8(this.index++)},e.readShort=function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t},e.readInt32=function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t},e.readInt=function(t){var e=this.readByte(),r=127&e;return(128&e)!=0&&(r|=(127&(e=this.readByte()))<<7,(128&e)!=0&&(r|=(127&(e=this.readByte()))<<14,(128&e)!=0&&(r|=(127&(e=this.readByte()))<<21,(128&e)!=0&&(r|=(127&(e=this.readByte()))<<28)))),t?r:r>>>1^-(1&r)},e.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",r=0;r<t;){var a=this.readByte();switch(a>>4){case 12:case 13:e+=String.fromCharCode((31&a)<<6|63&this.readByte()),r+=2;break;case 14:e+=String.fromCharCode((15&a)<<12|(63&this.readByte())<<6|63&this.readByte()),r+=3;break;default:e+=String.fromCharCode(a),r++}}return e},e.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.readBoolean=function(){return 0!=this.readByte()},t}(),t_=function(t,e,r,a,n){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=a,this.inheritDeform=n},tY=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e},tX=/*#__PURE__*/function(){function t(){this.convexPolygons=[],this.convexPolygonsIndices=[],this.indicesArray=[],this.isConcaveArray=[],this.triangles=[],this.polygonPool=new w(function(){return[]}),this.polygonIndicesPool=new w(function(){return[]})}var e=t.prototype;return e.triangulate=function(e){var r=e.length>>1,a=this.indicesArray;a.length=0;for(var n=0;n<r;n++)a[n]=n;var i=this.isConcaveArray;i.length=0;for(var s=0,o=r;s<o;++s)i[s]=t.isConcave(s,r,e,a);var h=this.triangles;for(h.length=0;r>3;){for(var l=r-1,u=0,c=1;;){t:if(!i[u]){for(var f=a[l]<<1,d=a[u]<<1,v=a[c]<<1,g=e[f],m=e[f+1],p=e[d],E=e[d+1],b=e[v],x=e[v+1],S=(c+1)%r;S!=l;S=(S+1)%r)if(i[S]){var w=a[S]<<1,M=e[w],y=e[w+1];if(t.positiveArea(b,x,g,m,M,y)&&t.positiveArea(g,m,p,E,M,y)&&t.positiveArea(p,E,b,x,M,y))break t}break}if(0==c){do{if(!i[u])break;u--}while(u>0);break}l=u,u=c,c=(c+1)%r}h.push(a[(r+u-1)%r]),h.push(a[u]),h.push(a[(u+1)%r]),a.splice(u,1),i.splice(u,1);var I=(--r+u-1)%r,R=u==r?0:u;i[I]=t.isConcave(I,r,e,a),i[R]=t.isConcave(R,r,e,a)}return 3==r&&(h.push(a[2]),h.push(a[0]),h.push(a[1])),h},e.decompose=function(e,r){var a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;var i=this.polygonIndicesPool.obtain();i.length=0;var s=this.polygonPool.obtain();s.length=0;for(var o=-1,h=0,l=0,u=r.length;l<u;l+=3){var c=r[l]<<1,f=r[l+1]<<1,d=r[l+2]<<1,v=e[c],g=e[c+1],m=e[f],p=e[f+1],E=e[d],b=e[d+1],x=!1;if(o==c){var S=s.length-4,w=t.winding(s[S],s[S+1],s[S+2],s[S+3],E,b),M=t.winding(E,b,s[0],s[1],s[2],s[3]);w==h&&M==h&&(s.push(E),s.push(b),i.push(d),x=!0)}x||(s.length>0?(a.push(s),n.push(i)):(this.polygonPool.free(s),this.polygonIndicesPool.free(i)),(s=this.polygonPool.obtain()).length=0,s.push(v),s.push(g),s.push(m),s.push(p),s.push(E),s.push(b),(i=this.polygonIndicesPool.obtain()).length=0,i.push(c),i.push(f),i.push(d),h=t.winding(v,g,m,p,E,b),o=c)}s.length>0&&(a.push(s),n.push(i));for(var y=0,I=a.length;y<I;y++)if(0!=(i=n[y]).length){for(var R=i[0],T=i[i.length-1],A=(s=a[y]).length-4,k=s[A],V=s[A+1],C=s[A+2],P=s[A+3],F=s[0],N=s[1],_=s[2],Y=s[3],X=t.winding(k,V,C,P,F,N),O=0;O<I;O++)if(O!=y){var L=n[O];if(3==L.length){var D=L[0],B=L[1],W=L[2],q=a[O],U=q[q.length-2],H=q[q.length-1];if(D==R&&B==T){var G=t.winding(k,V,C,P,U,H),j=t.winding(U,H,F,N,_,Y);G==X&&j==X&&(q.length=0,L.length=0,s.push(U),s.push(H),i.push(W),k=C,V=P,C=U,P=H,O=0)}}}}for(var z=a.length-1;z>=0;z--)0==(s=a[z]).length&&(a.splice(z,1),this.polygonPool.free(s),i=n[z],n.splice(z,1),this.polygonIndicesPool.free(i));return a},t.isConcave=function(t,e,r,a){var n=a[(e+t-1)%e]<<1,i=a[t]<<1,s=a[(t+1)%e]<<1;return!this.positiveArea(r[n],r[n+1],r[i],r[i+1],r[s],r[s+1])},t.positiveArea=function(t,e,r,a,n,i){return t*(i-a)+r*(e-i)+n*(a-e)>=0},t.winding=function(t,e,r,a,n,i){var s=r-t,o=a-e;return n*o-i*s+s*e-t*o>=0?1:-1},t}(),tO=/*#__PURE__*/function(){function t(){this.triangulator=new tX,this.clippingPolygon=[],this.clipOutput=[],this.clippedVertices=[],this.clippedTriangles=[],this.scratch=[]}var e=t.prototype;return e.clipStart=function(e,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,n=S.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(e,0,a,n,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o<h;o++){var l=s[o];t.makeClockwise(l),l.push(l[0]),l.push(l[1])}return s.length},e.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},e.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},e.isClipping=function(){return null!=this.clipAttachment},e.clipTriangles=function(t,e,r,a,n,i,s,o){var h=this.clipOutput,l=this.clippedVertices,u=this.clippedTriangles,c=this.clippingPolygons,f=this.clippingPolygons.length,d=o?12:8,v=0;l.length=0,u.length=0;t:for(var g=0;g<a;g+=3)for(var m=r[g]<<1,p=t[m],E=t[m+1],b=n[m],x=n[m+1],w=t[m=r[g+1]<<1],M=t[m+1],y=n[m],I=n[m+1],R=t[m=r[g+2]<<1],T=t[m+1],A=n[m],k=n[m+1],V=0;V<f;V++){var C=l.length;if(this.clip(p,E,w,M,R,T,c[V],h)){var P=h.length;if(0==P)continue;for(var F=M-T,N=R-w,_=p-R,Y=T-E,X=1/(F*_+N*(E-T)),O=P>>1,L=this.clipOutput,D=S.setArraySize(l,C+O*d),B=0;B<P;B+=2){var W=L[B],q=L[B+1];D[C]=W,D[C+1]=q,D[C+2]=i.r,D[C+3]=i.g,D[C+4]=i.b,D[C+5]=i.a;var U=W-R,H=q-T,G=(F*U+N*H)*X,j=(Y*U+_*H)*X,z=1-G-j;D[C+6]=b*G+y*j+A*z,D[C+7]=x*G+I*j+k*z,o&&(D[C+8]=s.r,D[C+9]=s.g,D[C+10]=s.b,D[C+11]=s.a),C+=d}C=u.length;var Z=S.setArraySize(u,C+3*(O-2));O--;for(var Q=1;Q<O;Q++)Z[C]=v,Z[C+1]=v+Q,Z[C+2]=v+Q+1,C+=3;v+=O+1}else{var K=S.setArraySize(l,C+3*d);K[C]=p,K[C+1]=E,K[C+2]=i.r,K[C+3]=i.g,K[C+4]=i.b,K[C+5]=i.a,o?(K[C+6]=b,K[C+7]=x,K[C+8]=s.r,K[C+9]=s.g,K[C+10]=s.b,K[C+11]=s.a,K[C+12]=w,K[C+13]=M,K[C+14]=i.r,K[C+15]=i.g,K[C+16]=i.b,K[C+17]=i.a,K[C+18]=y,K[C+19]=I,K[C+20]=s.r,K[C+21]=s.g,K[C+22]=s.b,K[C+23]=s.a,K[C+24]=R,K[C+25]=T,K[C+26]=i.r,K[C+27]=i.g,K[C+28]=i.b,K[C+29]=i.a,K[C+30]=A,K[C+31]=k,K[C+32]=s.r,K[C+33]=s.g,K[C+34]=s.b,K[C+35]=s.a):(K[C+6]=b,K[C+7]=x,K[C+8]=w,K[C+9]=M,K[C+10]=i.r,K[C+11]=i.g,K[C+12]=i.b,K[C+13]=i.a,K[C+14]=y,K[C+15]=I,K[C+16]=R,K[C+17]=T,K[C+18]=i.r,K[C+19]=i.g,K[C+20]=i.b,K[C+21]=i.a,K[C+22]=A,K[C+23]=k),C=u.length;var J=S.setArraySize(u,C+3);J[C]=v,J[C+1]=v+1,J[C+2]=v+2,v+=3;continue t}}},e.clip=function(t,e,r,a,n,i,s,o){var h=o,l=!1,u=null;s.length%4>=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(r),u.push(a),u.push(n),u.push(i),u.push(t),u.push(e),o.length=0;for(var c=s.length-4,f=0;;f+=2){for(var d=s[f],v=s[f+1],g=s[f+2],m=s[f+3],p=d-g,E=v-m,b=u,x=u.length-2,S=o.length,w=0;w<x;w+=2){var M=b[w],y=b[w+1],I=b[w+2],R=b[w+3],T=p*(R-m)-E*(I-g)>0;if(p*(y-m)-E*(M-g)>0){if(T){o.push(I),o.push(R);continue}var A=R-y,k=I-M,V=A*(g-d)-k*(m-v);if(Math.abs(V)>1e-6){var C=(k*(v-y)-A*(d-M))/V;o.push(d+(g-d)*C),o.push(v+(m-v)*C)}else o.push(d),o.push(v)}else if(T){var P=R-y,F=I-M,N=P*(g-d)-F*(m-v);if(Math.abs(N)>1e-6){var _=(F*(v-y)-P*(d-M))/N;o.push(d+(g-d)*_),o.push(v+(m-v)*_)}else o.push(d),o.push(v);o.push(I),o.push(R)}l=!0}if(S==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==c)break;var Y=o;(o=u).length=0,u=Y}if(h!=o){h.length=0;for(var X=0,O=o.length-2;X<O;X++)h[X]=o[X]}else h.length=h.length-2;return l},t.makeClockwise=function(t){for(var e=t.length,r=t[e-2]*t[1]-t[0]*t[e-1],a=0,n=0,i=0,s=0,o=e-3;s<o;s+=2)a=t[s],n=t[s+1],i=t[s+2],r+=a*t[s+3]-i*n;if(!(r<0))for(var h=0,l=e-2,u=e>>1;h<u;h+=2){var c=t[h],f=t[h+1],d=l-h;t[h]=t[d],t[h+1]=t[d+1],t[d]=c,t[d+1]=f}},t}(),tL=/*#__PURE__*/function(){function t(t){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=t}var e=t.prototype;return e.readSkeletonData=function(e){var r=this.scale,a=new tT,n="string"==typeof e?JSON.parse(e):e,i=n.skeleton;if(null!=i){if(a.hash=i.hash,a.version=i.spine,"3.8.75"==a.version)throw Error("Unsupported skeleton data, please export with a newer version of Spine.");a.x=i.x,a.y=i.y,a.width=i.width,a.height=i.height,a.fps=i.fps,a.imagesPath=i.images}if(n.bones)for(var s=0;s<n.bones.length;s++){var o=n.bones[s],h=null,l=this.getValue(o,"parent",null);if(null!=l&&null==(h=a.findBone(l)))throw Error("Parent bone not found: "+l);var u=new tc(a.bones.length,o.name,h);u.length=this.getValue(o,"length",0)*r,u.x=this.getValue(o,"x",0)*r,u.y=this.getValue(o,"y",0)*r,u.rotation=this.getValue(o,"rotation",0),u.scaleX=this.getValue(o,"scaleX",1),u.scaleY=this.getValue(o,"scaleY",1),u.shearX=this.getValue(o,"shearX",0),u.shearY=this.getValue(o,"shearY",0),u.transformMode=t.transformModeFromString(this.getValue(o,"transform","normal")),u.skinRequired=this.getValue(o,"skin",!1),a.bones.push(u)}if(n.slots)for(var c=0;c<n.slots.length;c++){var f=n.slots[c],d=f.name,v=f.bone,g=a.findBone(v);if(null==g)throw Error("Slot bone not found: "+v);var m=new tA(a.slots.length,d,g),p=this.getValue(f,"color",null);null!=p&&m.color.setFromString(p);var b=this.getValue(f,"dark",null);null!=b&&(m.darkColor=new E(1,1,1,1),m.darkColor.setFromString(b)),m.attachmentName=this.getValue(f,"attachment",null),m.blendMode=t.blendModeFromString(this.getValue(f,"blend","normal")),a.slots.push(m)}if(n.ik)for(var x=0;x<n.ik.length;x++){var S=n.ik[x],w=new tE(S.name);w.order=this.getValue(S,"order",0),w.skinRequired=this.getValue(S,"skin",!1);for(var M=0;M<S.bones.length;M++){var y=S.bones[M],I=a.findBone(y);if(null==I)throw Error("IK bone not found: "+y);w.bones.push(I)}var R=S.target;if(w.target=a.findBone(R),null==w.target)throw Error("IK target bone not found: "+R);w.mix=this.getValue(S,"mix",1),w.softness=this.getValue(S,"softness",0)*r,w.bendDirection=this.getValue(S,"bendPositive",!0)?1:-1,w.compress=this.getValue(S,"compress",!1),w.stretch=this.getValue(S,"stretch",!1),w.uniform=this.getValue(S,"uniform",!1),a.ikConstraints.push(w)}if(n.transform)for(var T=0;T<n.transform.length;T++){var A=n.transform[T],k=new tk(A.name);k.order=this.getValue(A,"order",0),k.skinRequired=this.getValue(A,"skin",!1);for(var V=0;V<A.bones.length;V++){var C=A.bones[V],P=a.findBone(C);if(null==P)throw Error("Transform constraint bone not found: "+C);k.bones.push(P)}var F=A.target;if(k.target=a.findBone(F),null==k.target)throw Error("Transform constraint target bone not found: "+F);k.local=this.getValue(A,"local",!1),k.relative=this.getValue(A,"relative",!1),k.offsetRotation=this.getValue(A,"rotation",0),k.offsetX=this.getValue(A,"x",0)*r,k.offsetY=this.getValue(A,"y",0)*r,k.offsetScaleX=this.getValue(A,"scaleX",0),k.offsetScaleY=this.getValue(A,"scaleY",0),k.offsetShearY=this.getValue(A,"shearY",0),k.rotateMix=this.getValue(A,"rotateMix",1),k.translateMix=this.getValue(A,"translateMix",1),k.scaleMix=this.getValue(A,"scaleMix",1),k.shearMix=this.getValue(A,"shearMix",1),a.transformConstraints.push(k)}if(n.path)for(var N=0;N<n.path.length;N++){var _=n.path[N],Y=new tb(_.name);Y.order=this.getValue(_,"order",0),Y.skinRequired=this.getValue(_,"skin",!1);for(var X=0;X<_.bones.length;X++){var O=_.bones[X],L=a.findBone(O);if(null==L)throw Error("Transform constraint bone not found: "+O);Y.bones.push(L)}var D=_.target;if(Y.target=a.findSlot(D),null==Y.target)throw Error("Path target slot not found: "+D);Y.positionMode=t.positionModeFromString(this.getValue(_,"positionMode","percent")),Y.spacingMode=t.spacingModeFromString(this.getValue(_,"spacingMode","length")),Y.rotateMode=t.rotateModeFromString(this.getValue(_,"rotateMode","tangent")),Y.offsetRotation=this.getValue(_,"rotation",0),Y.position=this.getValue(_,"position",0),Y.positionMode==tx.Fixed&&(Y.position*=r),Y.spacing=this.getValue(_,"spacing",0),(Y.spacingMode==tS.Length||Y.spacingMode==tS.Fixed)&&(Y.spacing*=r),Y.rotateMix=this.getValue(_,"rotateMix",1),Y.translateMix=this.getValue(_,"translateMix",1),a.pathConstraints.push(Y)}if(n.skins)for(var B=0;B<n.skins.length;B++){var W=n.skins[B],q=new tC(W.name);if(W.bones)for(var U=0;U<W.bones.length;U++){var H=a.findBone(W.bones[U]);if(null==H)throw Error("Skin bone not found: "+W.bones[B]);q.bones.push(H)}if(W.ik)for(var G=0;G<W.ik.length;G++){var j=a.findIkConstraint(W.ik[G]);if(null==j)throw Error("Skin IK constraint not found: "+W.ik[B]);q.constraints.push(j)}if(W.transform)for(var z=0;z<W.transform.length;z++){var Z=a.findTransformConstraint(W.transform[z]);if(null==Z)throw Error("Skin transform constraint not found: "+W.transform[B]);q.constraints.push(Z)}if(W.path)for(var Q=0;Q<W.path.length;Q++){var K=a.findPathConstraint(W.path[Q]);if(null==K)throw Error("Skin path constraint not found: "+W.path[B]);q.constraints.push(K)}for(var J in W.attachments){var $=a.findSlot(J);if(null==$)throw Error("Slot not found: "+J);var tt=W.attachments[J];for(var te in tt){var tr=this.readAttachment(tt[te],q,$.index,te,a);null!=tr&&q.setAttachment($.index,te,tr)}}a.skins.push(q),"default"==q.name&&(a.defaultSkin=q)}for(var ta=0,tn=this.linkedMeshes.length;ta<tn;ta++){var ti=this.linkedMeshes[ta],ts=null==ti.skin?a.defaultSkin:a.findSkin(ti.skin);if(null==ts)throw Error("Skin not found: "+ti.skin);var to=ts.getAttachment(ti.slotIndex,ti.parent);if(null==to)throw Error("Parent mesh not found: "+ti.parent);ti.mesh.deformAttachment=ti.inheritDeform?to:ti.mesh,ti.mesh.setParentMesh(to),ti.mesh.updateUVs()}if(this.linkedMeshes.length=0,n.events)for(var th in n.events){var tl=n.events[th],tu=new tm(th);tu.intValue=this.getValue(tl,"int",0),tu.floatValue=this.getValue(tl,"float",0),tu.stringValue=this.getValue(tl,"string",""),tu.audioPath=this.getValue(tl,"audio",null),null!=tu.audioPath&&(tu.volume=this.getValue(tl,"volume",1),tu.balance=this.getValue(tl,"balance",0)),a.events.push(tu)}if(n.animations)for(var tf in n.animations){var td=n.animations[tf];this.readAnimation(td,tf,a)}return a},e.readAttachment=function(t,e,r,a,n){var i=this.scale;switch(a=this.getValue(t,"name",a),this.getValue(t,"type","region")){case"region":var s=this.getValue(t,"path",a),o=this.attachmentLoader.newRegionAttachment(e,a,s);if(null==o)break;o.path=s,o.x=this.getValue(t,"x",0)*i,o.y=this.getValue(t,"y",0)*i,o.scaleX=this.getValue(t,"scaleX",1),o.scaleY=this.getValue(t,"scaleY",1),o.rotation=this.getValue(t,"rotation",0),o.width=t.width*i,o.height=t.height*i;var h=this.getValue(t,"color",null);return null!=h&&o.color.setFromString(h),o.updateOffset(),o;case"boundingbox":var l=this.attachmentLoader.newBoundingBoxAttachment(e,a);if(null==l)break;this.readVertices(t,l,t.vertexCount<<1);var u=this.getValue(t,"color",null);return null!=u&&l.color.setFromString(u),l;case"mesh":case"linkedmesh":var c=this.getValue(t,"path",a),f=this.attachmentLoader.newMeshAttachment(e,a,c);if(null==f)break;f.path=c;var d=this.getValue(t,"color",null);null!=d&&f.color.setFromString(d),f.width=this.getValue(t,"width",0)*i,f.height=this.getValue(t,"height",0)*i;var v=this.getValue(t,"parent",null);if(null!=v)return this.linkedMeshes.push(new tD(f,this.getValue(t,"skin",null),r,v,this.getValue(t,"deform",!0))),f;var g=t.uvs;return this.readVertices(t,f,g.length),f.triangles=t.triangles,f.regionUVs=g,f.updateUVs(),f.edges=this.getValue(t,"edges",null),f.hullLength=2*this.getValue(t,"hull",0),f;case"path":var m=this.attachmentLoader.newPathAttachment(e,a);if(null==m)break;m.closed=this.getValue(t,"closed",!1),m.constantSpeed=this.getValue(t,"constantSpeed",!0);var p=t.vertexCount;this.readVertices(t,m,p<<1);for(var E=S.newArray(p/3,0),b=0;b<t.lengths.length;b++)E[b]=t.lengths[b]*i;m.lengths=E;var x=this.getValue(t,"color",null);return null!=x&&m.color.setFromString(x),m;case"point":var w=this.attachmentLoader.newPointAttachment(e,a);if(null==w)break;w.x=this.getValue(t,"x",0)*i,w.y=this.getValue(t,"y",0)*i,w.rotation=this.getValue(t,"rotation",0);var M=this.getValue(t,"color",null);return null!=M&&w.color.setFromString(M),w;case"clipping":var y=this.attachmentLoader.newClippingAttachment(e,a);if(null==y)break;var I=this.getValue(t,"end",null);if(null!=I){var R=n.findSlot(I);if(null==R)throw Error("Clipping end slot not found: "+I);y.endSlot=R}var T=t.vertexCount;this.readVertices(t,y,T<<1);var A=this.getValue(t,"color",null);return null!=A&&y.color.setFromString(A),y}return null},e.readVertices=function(t,e,r){var a=this.scale;e.worldVerticesLength=r;var n=t.vertices;if(r==n.length){var i=S.toFloatArray(n);if(1!=a)for(var s=0,o=n.length;s<o;s++)i[s]*=a;e.vertices=i;return}for(var h=[],l=[],u=0,c=n.length;u<c;){var f=n[u++];l.push(f);for(var d=u+4*f;u<d;u+=4)l.push(n[u]),h.push(n[u+1]*a),h.push(n[u+2]*a),h.push(n[u+3])}e.bones=l,e.vertices=S.toFloatArray(h)},e.readAnimation=function(t,e,r){var a=this.scale,n=[],i=0;if(t.slots)for(var s in t.slots){var o=t.slots[s],h=r.findSlotIndex(s);if(-1==h)throw Error("Slot not found: "+s);for(var l in o){var u=o[l];if("attachment"==l){var c=new Y(u.length);c.slotIndex=h;for(var f=0,d=0;d<u.length;d++){var v=u[d];c.setFrame(f++,this.getValue(v,"time",0),v.name)}n.push(c),i=Math.max(i,c.frames[c.getFrameCount()-1])}else if("color"==l){var g=new N(u.length);g.slotIndex=h;for(var m=0,p=0;p<u.length;p++){var b=u[p],x=new E;x.setFromString(b.color),g.setFrame(m,this.getValue(b,"time",0),x.r,x.g,x.b,x.a),this.readCurve(b,g,m),m++}n.push(g),i=Math.max(i,g.frames[(g.getFrameCount()-1)*N.ENTRIES])}else if("twoColor"==l){var w=new _(u.length);w.slotIndex=h;for(var M=0,y=0;y<u.length;y++){var I=u[y],T=new E,A=new E;T.setFromString(I.light),A.setFromString(I.dark),w.setFrame(M,this.getValue(I,"time",0),T.r,T.g,T.b,T.a,A.r,A.g,A.b),this.readCurve(I,w,M),M++}n.push(w),i=Math.max(i,w.frames[(w.getFrameCount()-1)*_.ENTRIES])}else throw Error("Invalid timeline type for a slot: "+l+" ("+s+")")}}if(t.bones)for(var k in t.bones){var X=t.bones[k],G=r.findBoneIndex(k);if(-1==G)throw Error("Bone not found: "+k);for(var j in X){var z=X[j];if("rotate"===j){var Z=new V(z.length);Z.boneIndex=G;for(var Q=0,K=0;K<z.length;K++){var J=z[K];Z.setFrame(Q,this.getValue(J,"time",0),this.getValue(J,"angle",0)),this.readCurve(J,Z,Q),Q++}n.push(Z),i=Math.max(i,Z.frames[(Z.getFrameCount()-1)*V.ENTRIES])}else if("translate"===j||"scale"===j||"shear"===j){var $=null,tt=1,te=0;"scale"===j?($=new P(z.length),te=1):"shear"===j?$=new F(z.length):($=new C(z.length),tt=a),$.boneIndex=G;for(var tr=0,ta=0;ta<z.length;ta++){var tn=z[ta],ti=this.getValue(tn,"x",te),ts=this.getValue(tn,"y",te);$.setFrame(tr,this.getValue(tn,"time",0),ti*tt,ts*tt),this.readCurve(tn,$,tr),tr++}n.push($),i=Math.max(i,$.frames[($.getFrameCount()-1)*C.ENTRIES])}else throw Error("Invalid timeline type for a bone: "+j+" ("+k+")")}}if(t.ik)for(var to in t.ik){var th=t.ik[to],tl=r.findIkConstraint(to),tu=new B(th.length);tu.ikConstraintIndex=r.ikConstraints.indexOf(tl);for(var tc=0,tf=0;tf<th.length;tf++){var td=th[tf];tu.setFrame(tc,this.getValue(td,"time",0),this.getValue(td,"mix",1),this.getValue(td,"softness",0)*a,this.getValue(td,"bendPositive",!0)?1:-1,this.getValue(td,"compress",!1),this.getValue(td,"stretch",!1)),this.readCurve(td,tu,tc),tc++}n.push(tu),i=Math.max(i,tu.frames[(tu.getFrameCount()-1)*B.ENTRIES])}if(t.transform)for(var tv in t.transform){var tm=t.transform[tv],tp=r.findTransformConstraint(tv),tE=new W(tm.length);tE.transformConstraintIndex=r.transformConstraints.indexOf(tp);for(var tb=0,tw=0;tw<tm.length;tw++){var tM=tm[tw];tE.setFrame(tb,this.getValue(tM,"time",0),this.getValue(tM,"rotateMix",1),this.getValue(tM,"translateMix",1),this.getValue(tM,"scaleMix",1),this.getValue(tM,"shearMix",1)),this.readCurve(tM,tE,tb),tb++}n.push(tE),i=Math.max(i,tE.frames[(tE.getFrameCount()-1)*W.ENTRIES])}if(t.path)for(var ty in t.path){var tI=t.path[ty],tR=r.findPathConstraintIndex(ty);if(-1==tR)throw Error("Path constraint not found: "+ty);var tT=r.pathConstraints[tR];for(var tA in tI){var tk=tI[tA];if("position"===tA||"spacing"===tA){var tV=null,tC=1;"spacing"===tA?(tV=new U(tk.length),(tT.spacingMode==tS.Length||tT.spacingMode==tS.Fixed)&&(tC=a)):(tV=new q(tk.length),tT.positionMode==tx.Fixed&&(tC=a)),tV.pathConstraintIndex=tR;for(var tP=0,tF=0;tF<tk.length;tF++){var tN=tk[tF];tV.setFrame(tP,this.getValue(tN,"time",0),this.getValue(tN,tA,0)*tC),this.readCurve(tN,tV,tP),tP++}n.push(tV),i=Math.max(i,tV.frames[(tV.getFrameCount()-1)*q.ENTRIES])}else if("mix"===tA){var t_=new H(tk.length);t_.pathConstraintIndex=tR;for(var tY=0,tX=0;tX<tk.length;tX++){var tO=tk[tX];t_.setFrame(tY,this.getValue(tO,"time",0),this.getValue(tO,"rotateMix",1),this.getValue(tO,"translateMix",1)),this.readCurve(tO,t_,tY),tY++}n.push(t_),i=Math.max(i,t_.frames[(t_.getFrameCount()-1)*H.ENTRIES])}}}if(t.deform)for(var tL in t.deform){var tD=t.deform[tL],tB=r.findSkin(tL);if(null==tB)throw Error("Skin not found: "+tL);for(var tW in tD){var tq=tD[tW],tU=r.findSlotIndex(tW);if(-1==tU)throw Error("Slot not found: "+tq.name);for(var tH in tq){var tG=tq[tH],tj=tB.getAttachment(tU,tH);if(null==tj)throw Error("Deform attachment not found: "+tG.name);var tz=null!=tj.bones,tZ=tj.vertices,tQ=tz?tZ.length/3*2:tZ.length,tK=new O(tG.length);tK.slotIndex=tU,tK.attachment=tj;for(var tJ=0,t$=0;t$<tG.length;t$++){var t0=tG[t$],t1=void 0,t2=this.getValue(t0,"vertices",null);if(null==t2)t1=tz?S.newFloatArray(tQ):tZ;else{t1=S.newFloatArray(tQ);var t3=this.getValue(t0,"offset",0);if(S.arrayCopy(t2,0,t1,t3,t2.length),1!=a)for(var t9=t3,t6=t9+t2.length;t9<t6;t9++)t1[t9]*=a;if(!tz)for(var t8=0;t8<tQ;t8++)t1[t8]+=tZ[t8]}tK.setFrame(tJ,this.getValue(t0,"time",0),t1),this.readCurve(t0,tK,tJ),tJ++}n.push(tK),i=Math.max(i,tK.frames[tK.getFrameCount()-1])}}}var t4=t.drawOrder;if(null==t4&&(t4=t.draworder),null!=t4){for(var t5=new D(t4.length),t7=r.slots.length,et=0,ee=0;ee<t4.length;ee++){var er=t4[ee],ea=null,en=this.getValue(er,"offsets",null);if(null!=en){ea=S.newArray(t7,-1);for(var ei=S.newArray(t7-en.length,0),es=0,eo=0,eh=0;eh<en.length;eh++){var el=en[eh],eu=r.findSlotIndex(el.slot);if(-1==eu)throw Error("Slot not found: "+el.slot);for(;es!=eu;)ei[eo++]=es++;ea[es+el.offset]=es++}for(;es<t7;)ei[eo++]=es++;for(var ec=t7-1;ec>=0;ec--)-1==ea[ec]&&(ea[ec]=ei[--eo])}t5.setFrame(et++,this.getValue(er,"time",0),ea)}n.push(t5),i=Math.max(i,t5.frames[t5.getFrameCount()-1])}if(t.events){for(var ef=new L(t.events.length),ed=0,ev=0;ev<t.events.length;ev++){var eg=t.events[ev],em=r.findEvent(eg.name);if(null==em)throw Error("Event not found: "+eg.name);var ep=new tg(S.toSinglePrecision(this.getValue(eg,"time",0)),em);ep.intValue=this.getValue(eg,"int",em.intValue),ep.floatValue=this.getValue(eg,"float",em.floatValue),ep.stringValue=this.getValue(eg,"string",em.stringValue),null!=ep.data.audioPath&&(ep.volume=this.getValue(eg,"volume",1),ep.balance=this.getValue(eg,"balance",0)),ef.setFrame(ed++,ep)}n.push(ef),i=Math.max(i,ef.frames[ef.getFrameCount()-1])}if(isNaN(i))throw Error("Error while parsing animation, duration is NaN");r.animations.push(new R(e,n,i))},e.readCurve=function(t,e,r){if(t.hasOwnProperty("curve")){if("stepped"==t.curve)e.setStepped(r);else{var a=t.curve;e.setCurve(r,a,this.getValue(t,"c2",0),this.getValue(t,"c3",1),this.getValue(t,"c4",1))}}},e.getValue=function(t,e,r){return void 0!==t[e]?t[e]:r},t.blendModeFromString=function(t){if("normal"==(t=t.toLowerCase()))return tu.Normal;if("additive"==t)return tu.Additive;if("multiply"==t)return tu.Multiply;if("screen"==t)return tu.Screen;throw Error("Unknown blend mode: "+t)},t.positionModeFromString=function(t){if("fixed"==(t=t.toLowerCase()))return tx.Fixed;if("percent"==t)return tx.Percent;throw Error("Unknown position mode: "+t)},t.spacingModeFromString=function(t){if("length"==(t=t.toLowerCase()))return tS.Length;if("fixed"==t)return tS.Fixed;if("percent"==t)return tS.Percent;throw Error("Unknown position mode: "+t)},t.rotateModeFromString=function(t){if("tangent"==(t=t.toLowerCase()))return tw.Tangent;if("chain"==t)return tw.Chain;if("chainscale"==t)return tw.ChainScale;throw Error("Unknown rotate mode: "+t)},t.transformModeFromString=function(t){if("normal"==(t=t.toLowerCase()))return tf.Normal;if("onlytranslation"==t)return tf.OnlyTranslation;if("norotationorreflection"==t)return tf.NoRotationOrReflection;if("noscale"==t)return tf.NoScale;if("noscaleorreflection"==t)return tf.NoScaleOrReflection;throw Error("Unknown transform mode: "+t)},t}(),tD=function(t,e,r,a,n){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=a,this.inheritDeform=n};new x(2);var tB=/*#__PURE__*/function(){function t(){this._clipper=new tO}return t.prototype.buildGeometry=function(e,r){for(var a,n,i=r.tintBlack,s=this._clipper,o=t.tempVerts,h=e.drawOrder,l=0,u=h.length;l<u;++l){var c=h[l];if(!c.bone.active){s.clipEndWithSlot(c);continue}var f=c.getAttachment();if(!f){s.clipEndWithSlot(c);continue}var d=s.isClipping(),v=0,g=null,m=void 0,p=i?12:8,E=d?2:p;switch(f.constructor){case Q:g=f.color,v=E<<2,f.computeWorldVertices(c.bone,o,0,E),a=t.QUAD_TRIANGLES,n=f.uvs,m=f.region.texture;break;case tn:g=f.color,(v=(f.worldVerticesLength>>1)*E)>o.length&&(o.length=v),f.computeWorldVertices(c,0,f.worldVerticesLength,o,0,E),a=f.triangles,n=f.uvs,m=f.region.texture;break;case th:s.clipStart(c,f);continue;default:s.clipEndWithSlot(c);continue}if(null!=m){var b=void 0,x=void 0,S=void 0,w=void 0,M=c.bone.skeleton.color,y=c.color,I=t.tempColor,R=M.a*y.a*g.a;I.r=M.r*y.r*g.r,I.g=M.g*y.g*g.g,I.b=M.b*y.b*g.b,I.a=R;var T=t.tempDark,A=c.darkColor;if(A?T.setFromColor(A):T.set(0,0,0,1),d)s.clipTriangles(o,v,a,a.length,n,I,T,i),x=(b=s.clippedVertices).length,w=(S=s.clippedTriangles).length;else{for(var k=I.r,V=I.g,C=I.b,P=I.a,F=2,N=0,_=v;F<_;F+=p,N+=2)o[F]=k,o[F+1]=V,o[F+2]=C,o[F+3]=P,o[F+4]=n[N],o[F+5]=n[N+1],i&&(o[F+6]=T.r,o[F+7]=T.g,o[F+8]=T.b,o[F+9]=T.a);b=o,x=v,S=a,w=a.length}r.append(b,x/p,S,w,m.getImage(),c.data.blendMode,l,c.data.index)}s.clipEndWithSlot(c)}s.clipEnd()},t}();tB.tempDark=new E,tB.tempColor=new E,tB.tempVerts=Array(8),tB.QUAD_TRIANGLES=[0,1,2,2,3,0];var tW=/*#__PURE__*/function(t){function r(e){return t.call(this,e)||this}s(r,t);var a=r.prototype;return a.getImage=function(){return this._texture},a.setFilters=function(t,r){t===J.Nearest?this._texture.filterMode=e.TextureFilterMode.Point:t===J.Linear?this._texture.filterMode=e.TextureFilterMode.Bilinear:this._texture.filterMode=e.TextureFilterMode.Trilinear},a.setWraps=function(t,e){this._texture.wrapModeU=this._convertWrapMode(t),this._texture.wrapModeV=this._convertWrapMode(e)},a.dispose=function(){},a._convertWrapMode=function(t){switch(t){case $.ClampToEdge:return e.TextureWrapMode.Clamp;case $.Repeat:return e.TextureWrapMode.Repeat;case $.MirroredRepeat:return e.TextureWrapMode.Mirror;default:throw Error("Unsupported texture wrap mode.")}},r}(K),tq=/*#__PURE__*/function(){function t(){this.version="3.8",this._generator=new tB}var a=t.prototype;return a.getTextures=function(t){for(var a,i=new Set,s=n(t.skins);!(a=s()).done;)for(var o,h=a.value,l=n(h.getAttachments());!(o=l()).done;){var u=o.value.attachment;if(r(u,Q)||r(u,tn)){var c,f=u.region,d=r(f,ta)?null==(c=f.texture)?void 0:c.texture:null;r(d,e.Texture2D)&&i.add(d)}}return Array.from(i)},a.getPhysics=function(t){return{supported:!1,reason:"Spine 3.8 does not support physics constraints."}},a.createSkin=function(t){return new tC(t)},a.createTextureAtlas=function(t,e){var r=0;return new tt(t,function(){return new tW(e[r++])})},a.createSkeletonData=function(t,e,r){var a=new tl(e);if("string"==typeof t){var n=new tL(a);return n.scale=r,n.readSkeletonData(t)}var i=new tF(a);return i.scale=r,i.readSkeletonData(new Uint8Array(t))},a.createAnimationStateData=function(t){return new Z(t)},a.createSkeleton=function(t){return new tR(t)},a.createAnimationState=function(t){return new G(t)},a.batchAnimationStateEvents=function(t,e){var r=t.queue,a=r.drainDisabled;r.drainDisabled=!0;var n=e();return r.drainDisabled=a,r.drain(),n},a.advanceState=function(t,e,r){e.update(r),t.update(r)},a.applyState=function(t,e){e.apply(t)},a.updateWorldTransform=function(t,e){t.updateWorldTransform()},a.buildGeometry=function(t,e){this._generator.buildGeometry(t,e)},t}(),tU="2.0.0-alpha.57";console.log("Galacean spine-core-3.8 version: "+tU),t.Spine38Runtime=tq,t.version=tU,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/engine")):"function"==typeof define&&define.amd?define(["exports","@galacean/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Galacean=t.Galacean||{},t.Galacean.SpineCore38={}),t.Galacean)}(this,function(t,e){"use strict";function r(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}!function(){if(!Math.fround){var t;Math.fround=(t=new Float32Array(1),function(e){return t[0]=e,t[0]})}}();var o,h,l,u,c,f,d,v,g,m,p=/*#__PURE__*/function(){function t(){this.array=[]}var e=t.prototype;return e.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},e.contains=function(t){return void 0!=this.array[0|t]},e.remove=function(t){this.array[0|t]=void 0},e.clear=function(){this.array.length=0},t}(),E=/*#__PURE__*/function(){function t(t,e,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===a&&(a=0),this.r=t,this.g=e,this.b=r,this.a=a}var e=t.prototype;return e.set=function(t,e,r,a){return this.r=t,this.g=e,this.b=r,this.a=a,this.clamp(),this},e.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},e.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},e.add=function(t,e,r,a){return this.r+=t,this.g+=e,this.b+=r,this.a+=a,this.clamp(),this},e.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((0xff000000&e)>>>24)/255,t.g=((0xff0000&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((0xff0000&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t}();E.WHITE=new E(1,1,1,1),E.RED=new E(1,0,0,1),E.GREEN=new E(0,1,0,1),E.BLUE=new E(0,0,1,1),E.MAGENTA=new E(1,0,1,1);var b=/*#__PURE__*/function(){function t(){}return t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,r){return t.randomTriangularWith(e,r,(e+r)*.5)},t.randomTriangularWith=function(t,e,r){var a=Math.random(),n=e-t;return a<=(r-t)/n?t+Math.sqrt(a*n*(r-t)):e-Math.sqrt((1-a)*n*(e-r))},t}();b.PI=3.1415927,b.PI2=2*b.PI,b.radiansToDegrees=180/b.PI,b.radDeg=b.radiansToDegrees,b.degreesToRadians=b.PI/180,b.degRad=b.degreesToRadians;var x=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}return s(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this)||this).power=2,r.power=e,r}return s(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1},e}(/*#__PURE__*/function(){function t(){}return t.prototype.apply=function(t,e,r){return t+(e-t)*this.applyInternal(r)},t}())),S=/*#__PURE__*/function(){function t(){}return t.arrayCopy=function(t,e,r,a,n){for(var i=e,s=a;i<e+n;i++,s++)r[s]=t[i]},t.setArraySize=function(t,e,r){void 0===r&&(r=0);var a=t.length;if(a==e)return t;if(t.length=e,a<e)for(var n=a;n<e;n++)t[n]=r;return t},t.ensureArrayCapacity=function(e,r,a){return(void 0===a&&(a=0),e.length>=r)?e:t.setArraySize(e,r,a)},t.newArray=function(t,e){for(var r=Array(t),a=0;a<t;a++)r[a]=e;return r},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var r=Array(e),a=0;a<r.length;a++)r[a]=0;return r},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var r=Array(e),a=0;a<r.length;a++)r[a]=0;return r},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(t,e){},t.contains=function(t,e,r){for(var a=0;a<t.length;a++)if(t[a]==e)return!0;return!1},t}();S.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;var w=/*#__PURE__*/function(){function t(t){this.items=[],this.instantiator=t}var e=t.prototype;return e.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},e.free=function(t){t.reset&&t.reset(),this.items.push(t)},e.freeAll=function(t){for(var e=0;e<t.length;e++)this.free(t[e])},e.clear=function(){this.items.length=0},t}(),M=/*#__PURE__*/function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},e.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t}(),y=function(t){if(null==t)throw Error("name cannot be null.");this.name=t},I=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).id=(65535&e.nextID++)<<11,a.worldVerticesLength=0,a.deformAttachment=a,a}s(e,t);var r=e.prototype;return r.computeWorldVertices=function(t,e,r,a,n,i){r=n+(r>>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null==l){o.length>0&&(h=o);for(var u=t.bone,c=u.worldX,f=u.worldY,d=u.a,v=u.b,g=u.c,m=u.d,p=e,E=n;E<r;p+=2,E+=i){var b=h[p],x=h[p+1];a[E]=b*d+x*v+c,a[E+1]=b*g+x*m+f}return}for(var S=0,w=0,M=0;M<e;M+=2){var y=l[S];S+=y+1,w+=y}var I=s.bones;if(0==o.length)for(var R=n,T=3*w;R<r;R+=i){var A=0,k=0,V=l[S++];for(V+=S;S<V;S++,T+=3){var C=I[l[S]],P=h[T],F=h[T+1],N=h[T+2];A+=(P*C.a+F*C.b+C.worldX)*N,k+=(P*C.c+F*C.d+C.worldY)*N}a[R]=A,a[R+1]=k}else for(var _=n,Y=3*w,X=w<<1;_<r;_+=i){var O=0,L=0,D=l[S++];for(D+=S;S<D;S++,Y+=3,X+=2){var B=I[l[S]],W=h[Y]+o[X],q=h[Y+1]+o[X+1],U=h[Y+2];O+=(W*B.a+q*B.b+B.worldX)*U,L+=(W*B.c+q*B.d+B.worldY)*U}a[_]=O,a[_+1]=L}},r.copyTo=function(t){null!=this.bones?(t.bones=Array(this.bones.length),S.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,null!=this.vertices?(t.vertices=S.newFloatArray(this.vertices.length),S.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment},e}(y);I.nextID=0;var R=/*#__PURE__*/function(){function t(t,e,r){if(null==t)throw Error("name cannot be null.");if(null==e)throw Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var a=0;a<e.length;a++)this.timelineIds[e[a].getPropertyId()]=!0;this.duration=r}var e=t.prototype;return e.hasTimeline=function(t){return!0==this.timelineIds[t]},e.apply=function(t,e,r,a,n,i,s,o){if(null==t)throw Error("skeleton cannot be null.");a&&0!=this.duration&&(r%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l<u;l++)h[l].apply(t,e,r,n,i,s,o)},t.binarySearch=function(t,e,r){void 0===r&&(r=1);var a=0,n=t.length/r-2;if(0==n)return r;for(var i=n>>>1;;){if(t[(i+1)*r]<=e?a=i+1:n=i,a==n)return(a+1)*r;i=a+n>>>1}},t.linearSearch=function(t,e,r){for(var a=0,n=t.length-r;a<=n;a+=r)if(t[a]>e)return a;return -1},t}(),T=((o={})[o.setup=0]="setup",o[o.first=1]="first",o[o.replace=2]="replace",o[o.add=3]="add",o),A=((h={})[h.mixIn=0]="mixIn",h[h.mixOut=1]="mixOut",h),k=/*#__PURE__*/function(){function t(e){if(e<=0)throw Error("frameCount must be > 0: "+e);this.curves=S.newFloatArray((e-1)*t.BEZIER_SIZE)}var e=t.prototype;return e.getFrameCount=function(){return this.curves.length/t.BEZIER_SIZE+1},e.setLinear=function(e){this.curves[e*t.BEZIER_SIZE]=t.LINEAR},e.setStepped=function(e){this.curves[e*t.BEZIER_SIZE]=t.STEPPED},e.getCurveType=function(e){var r=e*t.BEZIER_SIZE;if(r==this.curves.length)return t.LINEAR;var a=this.curves[r];return a==t.LINEAR?t.LINEAR:a==t.STEPPED?t.STEPPED:t.BEZIER},e.setCurve=function(e,r,a,n,i){var s=(-(2*r)+n)*.03,o=(-(2*a)+i)*.03,h=((r-n)*3+1)*.006,l=((a-i)*3+1)*.006,u=2*s+h,c=2*o+l,f=.3*r+s+.16666667*h,d=.3*a+o+.16666667*l,v=e*t.BEZIER_SIZE,g=this.curves;g[v++]=t.BEZIER;for(var m=f,p=d,E=v+t.BEZIER_SIZE-1;v<E;v+=2)g[v]=m,g[v+1]=p,f+=u,d+=c,u+=h,c+=l,m+=f,p+=d},e.getCurvePercent=function(e,r){r=b.clamp(r,0,1);var a=this.curves,n=e*t.BEZIER_SIZE,i=a[n];if(i==t.LINEAR)return r;if(i==t.STEPPED)return 0;n++;for(var s=0,o=n,h=n+t.BEZIER_SIZE-1;n<h;n+=2)if((s=a[n])>=r){var l=void 0,u=void 0;return n==o?(l=0,u=0):(l=a[n-2],u=a[n-1]),u+(a[n+1]-u)*(r-l)/(s-l)}var c=a[n-1];return c+(1-c)*(r-s)/(1-s)},t}();k.LINEAR=0,k.STEPPED=1,k.BEZIER=2,k.BEZIER_SIZE=19;var V=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).frames=S.newFloatArray(e<<1),r}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0+this.boneIndex},r.setFrame=function(t,r,a){t<<=1,this.frames[t]=r,this.frames[t+e.ROTATION]=a},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.rotation=l.data.rotation;break;case 1:var u=l.data.rotation-l.rotation;l.rotation+=(u-(16384-(16384.499999999996-u/360|0))*360)*i}return}if(a>=h[h.length-e.ENTRIES]){var c=h[h.length+e.PREV_ROTATION];switch(s){case 0:l.rotation=l.data.rotation+c*i;break;case 1:case 2:c+=l.data.rotation-l.rotation,c-=(16384-(16384.499999999996-c/360|0))*360;case 3:l.rotation+=c*i}return}var f=R.binarySearch(h,a,e.ENTRIES),d=h[f+e.PREV_ROTATION],v=h[f],g=this.getCurvePercent((f>>1)-1,1-(a-v)/(h[f+e.PREV_TIME]-v)),m=h[f+e.ROTATION]-d;switch(m=d+(m-(16384-(16384.499999999996-m/360|0))*360)*g,s){case 0:l.rotation=l.data.rotation+(m-(16384-(16384.499999999996-m/360|0))*360)*i;break;case 1:case 2:m+=l.data.rotation-l.rotation;case 3:l.rotation+=(m-(16384-(16384.499999999996-m/360|0))*360)*i}}},e}(k);V.ENTRIES=2,V.PREV_TIME=-2,V.PREV_ROTATION=-1,V.ROTATION=1;var C=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x1000000+this.boneIndex},r.setFrame=function(t,r,a,n){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.X]=a,this.frames[t+e.Y]=n},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.x=l.data.x,l.y=l.data.y;break;case 1:l.x+=(l.data.x-l.x)*i,l.y+=(l.data.y-l.y)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X],c=h[h.length+e.PREV_Y];else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_X],c=h[f+e.PREV_Y];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u+=(h[f+e.X]-u)*v,c+=(h[f+e.Y]-c)*v}switch(s){case 0:l.x=l.data.x+u*i,l.y=l.data.y+c*i;break;case 1:case 2:l.x+=(l.data.x+u-l.x)*i,l.y+=(l.data.y+c-l.y)*i;break;case 3:l.x+=u*i,l.y+=c*i}}},e}(k);C.ENTRIES=3,C.PREV_TIME=-3,C.PREV_X=-2,C.PREV_Y=-1,C.X=1,C.Y=2;var P=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x2000000+this.boneIndex},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.scaleX=l.data.scaleX,l.scaleY=l.data.scaleY;break;case 1:l.scaleX+=(l.data.scaleX-l.scaleX)*i,l.scaleY+=(l.data.scaleY-l.scaleY)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X]*l.data.scaleX,c=h[h.length+e.PREV_Y]*l.data.scaleY;else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_X],c=h[f+e.PREV_Y];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u=(u+(h[f+e.X]-u)*v)*l.data.scaleX,c=(c+(h[f+e.Y]-c)*v)*l.data.scaleY}if(1==i)3==s?(l.scaleX+=u-l.data.scaleX,l.scaleY+=c-l.data.scaleY):(l.scaleX=u,l.scaleY=c);else{var g=0,m=0;if(1==o)switch(s){case 0:g=l.data.scaleX,m=l.data.scaleY,l.scaleX=g+(Math.abs(u)*b.signum(g)-g)*i,l.scaleY=m+(Math.abs(c)*b.signum(m)-m)*i;break;case 1:case 2:g=l.scaleX,m=l.scaleY,l.scaleX=g+(Math.abs(u)*b.signum(g)-g)*i,l.scaleY=m+(Math.abs(c)*b.signum(m)-m)*i;break;case 3:g=l.scaleX,m=l.scaleY,l.scaleX=g+(Math.abs(u)*b.signum(g)-l.data.scaleX)*i,l.scaleY=m+(Math.abs(c)*b.signum(m)-l.data.scaleY)*i}else switch(s){case 0:g=Math.abs(l.data.scaleX)*b.signum(u),m=Math.abs(l.data.scaleY)*b.signum(c),l.scaleX=g+(u-g)*i,l.scaleY=m+(c-m)*i;break;case 1:case 2:g=Math.abs(l.scaleX)*b.signum(u),m=Math.abs(l.scaleY)*b.signum(c),l.scaleX=g+(u-g)*i,l.scaleY=m+(c-m)*i;break;case 3:g=b.signum(u),m=b.signum(c),l.scaleX=Math.abs(l.scaleX)*g+(u-Math.abs(l.data.scaleX)*g)*i,l.scaleY=Math.abs(l.scaleY)*m+(c-Math.abs(l.data.scaleY)*m)*i}}}},e}(C),F=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x3000000+this.boneIndex},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.shearX=l.data.shearX,l.shearY=l.data.shearY;break;case 1:l.shearX+=(l.data.shearX-l.shearX)*i,l.shearY+=(l.data.shearY-l.shearY)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X],c=h[h.length+e.PREV_Y];else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_X],c=h[f+e.PREV_Y];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u+=(h[f+e.X]-u)*v,c+=(h[f+e.Y]-c)*v}switch(s){case 0:l.shearX=l.data.shearX+u*i,l.shearY=l.data.shearY+c*i;break;case 1:case 2:l.shearX+=(l.data.shearX+u-l.shearX)*i,l.shearY+=(l.data.shearY+c-l.shearY)*i;break;case 3:l.shearX+=u*i,l.shearY+=c*i}}},e}(C),N=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x5000000+this.slotIndex},r.setFrame=function(t,r,a,n,i,s){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.R]=a,this.frames[t+e.G]=n,this.frames[t+e.B]=i,this.frames[t+e.A]=s},r.apply=function(t,r,a,n,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=this.frames;if(a<l[0]){switch(s){case 0:h.color.setFromColor(h.data.color);break;case 1:var u=h.color,c=h.data.color;u.add((c.r-u.r)*i,(c.g-u.g)*i,(c.b-u.b)*i,(c.a-u.a)*i)}return}var f=0,d=0,v=0,g=0;if(a>=l[l.length-e.ENTRIES]){var m=l.length;f=l[m+e.PREV_R],d=l[m+e.PREV_G],v=l[m+e.PREV_B],g=l[m+e.PREV_A]}else{var p=R.binarySearch(l,a,e.ENTRIES);f=l[p+e.PREV_R],d=l[p+e.PREV_G],v=l[p+e.PREV_B],g=l[p+e.PREV_A];var E=l[p],b=this.getCurvePercent(p/e.ENTRIES-1,1-(a-E)/(l[p+e.PREV_TIME]-E));f+=(l[p+e.R]-f)*b,d+=(l[p+e.G]-d)*b,v+=(l[p+e.B]-v)*b,g+=(l[p+e.A]-g)*b}if(1==i)h.color.set(f,d,v,g);else{var x=h.color;0==s&&x.setFromColor(h.data.color),x.add((f-x.r)*i,(d-x.g)*i,(v-x.b)*i,(g-x.a)*i)}}},e}(k);N.ENTRIES=5,N.PREV_TIME=-5,N.PREV_R=-4,N.PREV_G=-3,N.PREV_B=-2,N.PREV_A=-1,N.R=1,N.G=2,N.B=3,N.A=4;var _=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xe000000+this.slotIndex},r.setFrame=function(t,r,a,n,i,s,o,h,l){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.R]=a,this.frames[t+e.G]=n,this.frames[t+e.B]=i,this.frames[t+e.A]=s,this.frames[t+e.R2]=o,this.frames[t+e.G2]=h,this.frames[t+e.B2]=l},r.apply=function(t,r,a,n,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=this.frames;if(a<l[0]){switch(s){case 0:h.color.setFromColor(h.data.color),h.darkColor.setFromColor(h.data.darkColor);break;case 1:var u=h.color,c=h.darkColor,f=h.data.color,d=h.data.darkColor;u.add((f.r-u.r)*i,(f.g-u.g)*i,(f.b-u.b)*i,(f.a-u.a)*i),c.add((d.r-c.r)*i,(d.g-c.g)*i,(d.b-c.b)*i,0)}return}var v=0,g=0,m=0,p=0,E=0,b=0,x=0;if(a>=l[l.length-e.ENTRIES]){var S=l.length;v=l[S+e.PREV_R],g=l[S+e.PREV_G],m=l[S+e.PREV_B],p=l[S+e.PREV_A],E=l[S+e.PREV_R2],b=l[S+e.PREV_G2],x=l[S+e.PREV_B2]}else{var w=R.binarySearch(l,a,e.ENTRIES);v=l[w+e.PREV_R],g=l[w+e.PREV_G],m=l[w+e.PREV_B],p=l[w+e.PREV_A],E=l[w+e.PREV_R2],b=l[w+e.PREV_G2],x=l[w+e.PREV_B2];var M=l[w],y=this.getCurvePercent(w/e.ENTRIES-1,1-(a-M)/(l[w+e.PREV_TIME]-M));v+=(l[w+e.R]-v)*y,g+=(l[w+e.G]-g)*y,m+=(l[w+e.B]-m)*y,p+=(l[w+e.A]-p)*y,E+=(l[w+e.R2]-E)*y,b+=(l[w+e.G2]-b)*y,x+=(l[w+e.B2]-x)*y}if(1==i)h.color.set(v,g,m,p),h.darkColor.set(E,b,x,1);else{var I=h.color,T=h.darkColor;0==s&&(I.setFromColor(h.data.color),T.setFromColor(h.data.darkColor)),I.add((v-I.r)*i,(g-I.g)*i,(m-I.b)*i,(p-I.a)*i),T.add((E-T.r)*i,(b-T.g)*i,(x-T.b)*i,0)}}},e}(k);_.ENTRIES=8,_.PREV_TIME=-8,_.PREV_R=-7,_.PREV_G=-6,_.PREV_B=-5,_.PREV_A=-4,_.PREV_R2=-3,_.PREV_G2=-2,_.PREV_B2=-1,_.R=1,_.G=2,_.B=3,_.A=4,_.R2=5,_.G2=6,_.B2=7;var Y=/*#__PURE__*/function(){function t(t){this.frames=S.newFloatArray(t),this.attachmentNames=Array(t)}var e=t.prototype;return e.getPropertyId=function(){return 0x4000000+this.slotIndex},e.getFrameCount=function(){return this.frames.length},e.setFrame=function(t,e,r){this.frames[t]=e,this.attachmentNames[t]=r},e.apply=function(t,e,r,a,n,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){if(1==s){0==i&&this.setAttachment(t,o,o.data.attachmentName);return}var h=this.frames;if(r<h[0]){(0==i||1==i)&&this.setAttachment(t,o,o.data.attachmentName);return}var l=0;l=r>=h[h.length-1]?h.length-1:R.binarySearch(h,r,1)-1;var u=this.attachmentNames[l];t.slots[this.slotIndex].setAttachment(null==u?null:t.getAttachment(this.slotIndex,u))}},e.setAttachment=function(t,e,r){e.attachment=null==r?null:t.getAttachment(this.slotIndex,r)},t}(),X=null,O=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).frames=S.newFloatArray(e),r.frameVertices=Array(e),null==X&&(X=S.newFloatArray(64)),r}s(e,t);var a=e.prototype;return a.getPropertyId=function(){return 0x30000000+ +this.attachment.id+this.slotIndex},a.setFrame=function(t,e,r){this.frames[t]=e,this.frameVertices[t]=r},a.apply=function(t,e,a,n,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.getAttachment();if(r(l,I)&&l.deformAttachment==this.attachment){var u=h.deform;0==u.length&&(s=0);var c=this.frameVertices,f=c[0].length,d=this.frames;if(a<d[0]){switch(s){case 0:u.length=0;break;case 1:if(1==i){u.length=0;break}var v=S.setArraySize(u,f);if(null==l.bones)for(var g=l.vertices,m=0;m<f;m++)v[m]+=(g[m]-v[m])*i;else{i=1-i;for(var m=0;m<f;m++)v[m]*=i}}return}var p=S.setArraySize(u,f);if(a>=d[d.length-1]){var E=c[d.length-1];if(1==i){if(3==s){if(null==l.bones)for(var b=l.vertices,x=0;x<f;x++)p[x]+=E[x]-b[x];else for(var w=0;w<f;w++)p[w]+=E[w]}else S.arrayCopy(E,0,p,0,f)}else switch(s){case 0:if(null==l.bones)for(var M=l.vertices,y=0;y<f;y++){var T=M[y];p[y]=T+(E[y]-T)*i}else for(var A=0;A<f;A++)p[A]=E[A]*i;break;case 1:case 2:for(var k=0;k<f;k++)p[k]+=(E[k]-p[k])*i;break;case 3:if(null==l.bones)for(var V=l.vertices,C=0;C<f;C++)p[C]+=(E[C]-V[C])*i;else for(var P=0;P<f;P++)p[P]+=E[P]*i}return}var F=R.binarySearch(d,a),N=c[F-1],_=c[F],Y=d[F],X=this.getCurvePercent(F-1,1-(a-Y)/(d[F-1]-Y));if(1==i){if(3==s){if(null==l.bones)for(var O=l.vertices,L=0;L<f;L++){var D=N[L];p[L]+=D+(_[L]-D)*X-O[L]}else for(var B=0;B<f;B++){var W=N[B];p[B]+=W+(_[B]-W)*X}}else for(var q=0;q<f;q++){var U=N[q];p[q]=U+(_[q]-U)*X}}else switch(s){case 0:if(null==l.bones)for(var H=l.vertices,G=0;G<f;G++){var j=N[G],z=H[G];p[G]=z+(j+(_[G]-j)*X-z)*i}else for(var Z=0;Z<f;Z++){var Q=N[Z];p[Z]=(Q+(_[Z]-Q)*X)*i}break;case 1:case 2:for(var K=0;K<f;K++){var J=N[K];p[K]+=(J+(_[K]-J)*X-p[K])*i}break;case 3:if(null==l.bones)for(var $=l.vertices,tt=0;tt<f;tt++){var te=N[tt];p[tt]+=(te+(_[tt]-te)*X-$[tt])*i}else for(var tr=0;tr<f;tr++){var ta=N[tr];p[tr]+=(ta+(_[tr]-ta)*X)*i}}}}},e}(k),L=/*#__PURE__*/function(){function t(t){this.frames=S.newFloatArray(t),this.events=Array(t)}var e=t.prototype;return e.getPropertyId=function(){return 0x7000000},e.getFrameCount=function(){return this.frames.length},e.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.apply=function(t,e,r,a,n,i,s){if(null!=a){var o=this.frames,h=this.frames.length;if(e>r)this.apply(t,e,Number.MAX_VALUE,a,n,i,s),e=-1;else if(e>=o[h-1])return;if(!(r<o[0])){var l=0;if(e<o[0])l=0;else{l=R.binarySearch(o,e);for(var u=o[l];l>0&&o[l-1]==u;)l--}for(;l<h&&r>=o[l];l++)a.push(this.events[l])}}},t}(),D=/*#__PURE__*/function(){function t(t){this.frames=S.newFloatArray(t),this.drawOrders=Array(t)}var e=t.prototype;return e.getPropertyId=function(){return 0x8000000},e.getFrameCount=function(){return this.frames.length},e.setFrame=function(t,e,r){this.frames[t]=e,this.drawOrders[t]=r},e.apply=function(t,e,r,a,n,i,s){var o=t.drawOrder,h=t.slots;if(1==s){0==i&&S.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}var l=this.frames;if(r<l[0]){(0==i||1==i)&&S.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}var u=0;u=r>=l[l.length-1]?l.length-1:R.binarySearch(l,r)-1;var c=this.drawOrders[u];if(null==c)S.arrayCopy(h,0,o,0,h.length);else for(var f=0,d=c.length;f<d;f++)o[f]=h[c[f]]},t}(),B=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0x9000000+this.ikConstraintIndex},r.setFrame=function(t,r,a,n,i,s,o){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.MIX]=a,this.frames[t+e.SOFTNESS]=n,this.frames[t+e.BEND_DIRECTION]=i,this.frames[t+e.COMPRESS]=s?1:0,this.frames[t+e.STRETCH]=o?1:0},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.ikConstraints[this.ikConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.mix=l.data.mix,l.softness=l.data.softness,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch;break;case 1:l.mix+=(l.data.mix-l.mix)*i,l.softness+=(l.data.softness-l.softness)*i,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch}return}if(a>=h[h.length-e.ENTRIES]){0==s?(l.mix=l.data.mix+(h[h.length+e.PREV_MIX]-l.data.mix)*i,l.softness=l.data.softness+(h[h.length+e.PREV_SOFTNESS]-l.data.softness)*i,1==o?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=h[h.length+e.PREV_BEND_DIRECTION],l.compress=0!=h[h.length+e.PREV_COMPRESS],l.stretch=0!=h[h.length+e.PREV_STRETCH])):(l.mix+=(h[h.length+e.PREV_MIX]-l.mix)*i,l.softness+=(h[h.length+e.PREV_SOFTNESS]-l.softness)*i,0==o&&(l.bendDirection=h[h.length+e.PREV_BEND_DIRECTION],l.compress=0!=h[h.length+e.PREV_COMPRESS],l.stretch=0!=h[h.length+e.PREV_STRETCH]));return}var u=R.binarySearch(h,a,e.ENTRIES),c=h[u+e.PREV_MIX],f=h[u+e.PREV_SOFTNESS],d=h[u],v=this.getCurvePercent(u/e.ENTRIES-1,1-(a-d)/(h[u+e.PREV_TIME]-d));0==s?(l.mix=l.data.mix+(c+(h[u+e.MIX]-c)*v-l.data.mix)*i,l.softness=l.data.softness+(f+(h[u+e.SOFTNESS]-f)*v-l.data.softness)*i,1==o?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=h[u+e.PREV_BEND_DIRECTION],l.compress=0!=h[u+e.PREV_COMPRESS],l.stretch=0!=h[u+e.PREV_STRETCH])):(l.mix+=(c+(h[u+e.MIX]-c)*v-l.mix)*i,l.softness+=(f+(h[u+e.SOFTNESS]-f)*v-l.softness)*i,0==o&&(l.bendDirection=h[u+e.PREV_BEND_DIRECTION],l.compress=0!=h[u+e.PREV_COMPRESS],l.stretch=0!=h[u+e.PREV_STRETCH]))}},e}(k);B.ENTRIES=6,B.PREV_TIME=-6,B.PREV_MIX=-5,B.PREV_SOFTNESS=-4,B.PREV_BEND_DIRECTION=-3,B.PREV_COMPRESS=-2,B.PREV_STRETCH=-1,B.MIX=1,B.SOFTNESS=2,B.BEND_DIRECTION=3,B.COMPRESS=4,B.STRETCH=5;var W=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xa000000+this.transformConstraintIndex},r.setFrame=function(t,r,a,n,i,s){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.ROTATE]=a,this.frames[t+e.TRANSLATE]=n,this.frames[t+e.SCALE]=i,this.frames[t+e.SHEAR]=s},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.transformConstraints[this.transformConstraintIndex];if(l.active){if(a<h[0]){var u=l.data;switch(s){case 0:l.rotateMix=u.rotateMix,l.translateMix=u.translateMix,l.scaleMix=u.scaleMix,l.shearMix=u.shearMix;break;case 1:l.rotateMix+=(u.rotateMix-l.rotateMix)*i,l.translateMix+=(u.translateMix-l.translateMix)*i,l.scaleMix+=(u.scaleMix-l.scaleMix)*i,l.shearMix+=(u.shearMix-l.shearMix)*i}return}var c=0,f=0,d=0,v=0;if(a>=h[h.length-e.ENTRIES]){var g=h.length;c=h[g+e.PREV_ROTATE],f=h[g+e.PREV_TRANSLATE],d=h[g+e.PREV_SCALE],v=h[g+e.PREV_SHEAR]}else{var m=R.binarySearch(h,a,e.ENTRIES);c=h[m+e.PREV_ROTATE],f=h[m+e.PREV_TRANSLATE],d=h[m+e.PREV_SCALE],v=h[m+e.PREV_SHEAR];var p=h[m],E=this.getCurvePercent(m/e.ENTRIES-1,1-(a-p)/(h[m+e.PREV_TIME]-p));c+=(h[m+e.ROTATE]-c)*E,f+=(h[m+e.TRANSLATE]-f)*E,d+=(h[m+e.SCALE]-d)*E,v+=(h[m+e.SHEAR]-v)*E}if(0==s){var b=l.data;l.rotateMix=b.rotateMix+(c-b.rotateMix)*i,l.translateMix=b.translateMix+(f-b.translateMix)*i,l.scaleMix=b.scaleMix+(d-b.scaleMix)*i,l.shearMix=b.shearMix+(v-b.shearMix)*i}else l.rotateMix+=(c-l.rotateMix)*i,l.translateMix+=(f-l.translateMix)*i,l.scaleMix+=(d-l.scaleMix)*i,l.shearMix+=(v-l.shearMix)*i}},e}(k);W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4;var q=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xb000000+this.pathConstraintIndex},r.setFrame=function(t,r,a){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.VALUE]=a},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.position=l.data.position;break;case 1:l.position+=(l.data.position-l.position)*i}return}var u=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_VALUE];else{var c=R.binarySearch(h,a,e.ENTRIES);u=h[c+e.PREV_VALUE];var f=h[c],d=this.getCurvePercent(c/e.ENTRIES-1,1-(a-f)/(h[c+e.PREV_TIME]-f));u+=(h[c+e.VALUE]-u)*d}0==s?l.position=l.data.position+(u-l.data.position)*i:l.position+=(u-l.position)*i}},e}(k);q.ENTRIES=2,q.PREV_TIME=-2,q.PREV_VALUE=-1,q.VALUE=1;var U=/*#__PURE__*/function(t){function e(e){return t.call(this,e)||this}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xc000000+this.pathConstraintIndex},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.spacing=l.data.spacing;break;case 1:l.spacing+=(l.data.spacing-l.spacing)*i}return}var u=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_VALUE];else{var c=R.binarySearch(h,a,e.ENTRIES);u=h[c+e.PREV_VALUE];var f=h[c],d=this.getCurvePercent(c/e.ENTRIES-1,1-(a-f)/(h[c+e.PREV_TIME]-f));u+=(h[c+e.VALUE]-u)*d}0==s?l.spacing=l.data.spacing+(u-l.data.spacing)*i:l.spacing+=(u-l.spacing)*i}},e}(q),H=/*#__PURE__*/function(t){function e(r){var a;return(a=t.call(this,r)||this).frames=S.newFloatArray(r*e.ENTRIES),a}s(e,t);var r=e.prototype;return r.getPropertyId=function(){return 0xd000000+this.pathConstraintIndex},r.setFrame=function(t,r,a,n){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.ROTATE]=a,this.frames[t+e.TRANSLATE]=n},r.apply=function(t,r,a,n,i,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active){if(a<h[0]){switch(s){case 0:l.rotateMix=l.data.rotateMix,l.translateMix=l.data.translateMix;break;case 1:l.rotateMix+=(l.data.rotateMix-l.rotateMix)*i,l.translateMix+=(l.data.translateMix-l.translateMix)*i}return}var u=0,c=0;if(a>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_ROTATE],c=h[h.length+e.PREV_TRANSLATE];else{var f=R.binarySearch(h,a,e.ENTRIES);u=h[f+e.PREV_ROTATE],c=h[f+e.PREV_TRANSLATE];var d=h[f],v=this.getCurvePercent(f/e.ENTRIES-1,1-(a-d)/(h[f+e.PREV_TIME]-d));u+=(h[f+e.ROTATE]-u)*v,c+=(h[f+e.TRANSLATE]-c)*v}0==s?(l.rotateMix=l.data.rotateMix+(u-l.data.rotateMix)*i,l.translateMix=l.data.translateMix+(c-l.data.translateMix)*i):(l.rotateMix+=(u-l.rotateMix)*i,l.translateMix+=(c-l.translateMix)*i)}},e}(k);H.ENTRIES=3,H.PREV_TIME=-3,H.PREV_ROTATE=-2,H.PREV_TRANSLATE=-1,H.ROTATE=1,H.TRANSLATE=2;var G=/*#__PURE__*/function(){function t(t){this.tracks=[],this.timeScale=1,this.unkeyedState=0,this.events=[],this.listeners=[],this.queue=new z(this),this.propertyIDs=new p,this.animationsChanged=!1,this.trackEntryPool=new w(function(){return new j}),this.data=t}var e=t.prototype;return e.update=function(t){t*=this.timeScale;for(var e=this.tracks,r=0,a=e.length;r<a;r++){var n=e[r];if(null!=n){n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;var i=t*n.timeScale;if(n.delay>0){if(n.delay-=i,n.delay>0)continue;i=-n.delay,n.delay=0}var s=n.next;if(null!=s){var o=n.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==n.timeScale?0:(o/n.timeScale+t)*s.timeScale,n.trackTime+=i,this.setCurrent(r,s,!0);null!=s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&null==n.mixingFrom){e[r]=null,this.queue.end(n),this.disposeNext(n);continue}if(null!=n.mixingFrom&&this.updateMixingFrom(n,t)){var h=n.mixingFrom;for(n.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}n.trackTime+=i}}this.queue.drain()},e.updateMixingFrom=function(t,e){var r=t.mixingFrom;if(null==r)return!0;var a=this.updateMixingFrom(r,e);return(r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration)?((0==r.totalAlpha||0==t.mixDuration)&&(t.mixingFrom=r.mixingFrom,null!=r.mixingFrom&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),a):(r.trackTime+=e*r.timeScale,t.mixTime+=e,!1)},e.apply=function(e){if(null==e)throw Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var a=this.events,n=this.tracks,i=!1,s=0,o=n.length;s<o;s++){var h=n[s];if(null!=h&&!(h.delay>0)){i=!0;var l=0==s?T.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,e,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,v=h.animation.timelines;if(0==s&&1==u||l==T.add)for(var g=0;g<d;g++){S.webkit602BugfixHelper(u,l);var m=v[g];r(m,Y)?this.applyAttachmentTimeline(m,e,f,l,!0):m.apply(e,c,f,a,u,l,A.mixIn)}else{var p=h.timelineMode,E=0==h.timelinesRotation.length;E&&S.setArraySize(h.timelinesRotation,d<<1,null);for(var b=h.timelinesRotation,x=0;x<d;x++){var w=v[x],M=p[x]==t.SUBSEQUENT?l:T.setup;r(w,V)?this.applyRotateTimeline(w,e,f,u,M,b,x<<1,E):r(w,Y)?this.applyAttachmentTimeline(w,e,f,l,!0):(S.webkit602BugfixHelper(u,l),w.apply(e,c,f,a,u,M,A.mixIn))}}this.queueEvents(h,f),a.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}for(var y=this.unkeyedState+t.SETUP,I=e.slots,R=0,k=e.slots.length;R<k;R++){var C=I[R];if(C.attachmentState==y){var P=C.data.attachmentName;C.attachment=null==P?null:e.getAttachment(C.data.index,P)}}return this.unkeyedState+=2,this.queue.drain(),i},e.applyMixingFrom=function(e,a,n){var i=e.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,a,n);var s=0;0==e.mixDuration?(s=1,n==T.first&&(n=T.setup)):((s=e.mixTime/e.mixDuration)>1&&(s=1),n!=T.first&&(n=i.mixBlend));var o=s<i.eventThreshold?this.events:null,h=s<i.attachmentThreshold,l=s<i.drawOrderThreshold,u=i.animationLast,c=i.getAnimationTime(),f=i.animation.timelines.length,d=i.animation.timelines,v=i.alpha*e.interruptAlpha,g=v*(1-s);if(n==T.add)for(var m=0;m<f;m++)d[m].apply(a,u,c,o,g,n,A.mixOut);else{var p=i.timelineMode,E=i.timelineHoldMix,b=0==i.timelinesRotation.length;b&&S.setArraySize(i.timelinesRotation,f<<1,null);var x=i.timelinesRotation;i.totalAlpha=0;for(var w=0;w<f;w++){var M=d[w],y=A.mixOut,I=void 0,R=0;switch(p[w]){case t.SUBSEQUENT:if(!l&&r(M,D))continue;I=n,R=g;break;case t.FIRST:I=T.setup,R=g;break;case t.HOLD_SUBSEQUENT:I=n,R=v;break;case t.HOLD_FIRST:I=T.setup,R=v;break;default:I=T.setup;var k=E[w];R=v*Math.max(0,1-k.mixTime/k.mixDuration)}i.totalAlpha+=R,r(M,V)?this.applyRotateTimeline(M,a,c,R,I,x,w<<1,b):r(M,Y)?this.applyAttachmentTimeline(M,a,c,I,h):(S.webkit602BugfixHelper(R,n),l&&r(M,D)&&I==T.setup&&(y=A.mixIn),M.apply(a,u,c,o,R,I,y))}}return e.mixDuration>0&&this.queueEvents(i,c),this.events.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime,s},e.applyAttachmentTimeline=function(e,r,a,n,i){var s,o=r.slots[e.slotIndex];if(o.bone.active){var h=e.frames;a<h[0]?(n==T.setup||n==T.first)&&this.setAttachment(r,o,o.data.attachmentName,i):(s=a>=h[h.length-1]?h.length-1:R.binarySearch(h,a)-1,this.setAttachment(r,o,e.attachmentNames[s],i)),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+t.SETUP)}},e.setAttachment=function(e,r,a,n){r.attachment=null==a?null:e.getAttachment(r.data.index,a),n&&(r.attachmentState=this.unkeyedState+t.CURRENT)},e.applyRotateTimeline=function(t,e,r,a,n,i,s,o){if(o&&(i[s]=0),1==a){t.apply(e,0,r,null,1,n,A.mixIn);return}var h=t.frames,l=e.bones[t.boneIndex];if(l.active){var u=0,c=0;if(r<h[0])switch(n){case T.setup:l.rotation=l.data.rotation;default:return;case T.first:u=l.rotation,c=l.data.rotation}else if(u=n==T.setup?l.data.rotation:l.rotation,r>=h[h.length-V.ENTRIES])c=l.data.rotation+h[h.length+V.PREV_ROTATION];else{var f=R.binarySearch(h,r,V.ENTRIES),d=h[f+V.PREV_ROTATION],v=h[f],g=t.getCurvePercent((f>>1)-1,1-(r-v)/(h[f+V.PREV_TIME]-v));c=h[f+V.ROTATION]-d,c-=(16384-(16384.499999999996-c/360|0))*360,c=d+c*g+l.data.rotation,c-=(16384-(16384.499999999996-c/360|0))*360}var m=0,p=c-u;if(0==(p-=(16384-(16384.499999999996-p/360|0))*360))m=i[s];else{var E=0,x=0;o?(E=0,x=p):(E=i[s],x=i[s+1]);var S=p>0,w=E>=0;b.signum(x)!=b.signum(p)&&90>=Math.abs(x)&&(Math.abs(E)>180&&(E+=360*b.signum(E)),w=S),m=p+E-E%360,w!=S&&(m+=360*b.signum(E)),i[s]=m}i[s+1]=p,u+=m*a,l.rotation=u-(16384-(16384.499999999996-u/360|0))*360}},e.queueEvents=function(t,e){for(var r=t.animationStart,a=t.animationEnd,n=a-r,i=t.trackLast%n,s=this.events,o=0,h=s.length;o<h;o++){var l=s[o];if(l.time<i)break;l.time>a||this.queue.event(t,l)}for((t.loop?0==n||i>t.trackTime%n:e>=a&&t.animationLast<a)&&this.queue.complete(t);o<h;o++)s[o].time<r||this.queue.event(t,s[o])},e.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,r=this.tracks.length;e<r;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var r=e;;){var a=r.mixingFrom;if(null==a)break;this.queue.end(a),r.mixingFrom=null,r.mixingTo=null,r=a}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.setCurrent=function(t,e,r){var a=this.expandToIndex(t);this.tracks[t]=e,null!=a&&(r&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,null!=a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)},e.setAnimation=function(t,e,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw Error("Animation not found: "+e);return this.setAnimationWith(t,a,r)},e.setAnimationWith=function(t,e,r){if(null==e)throw Error("animation cannot be null.");var a=!0,n=this.expandToIndex(t);null!=n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.disposeNext(n),n=n.mixingFrom,a=!1):this.disposeNext(n));var i=this.trackEntry(t,e,r,n);return this.setCurrent(t,i,a),this.queue.drain(),i},e.addAnimation=function(t,e,r,a){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw Error("Animation not found: "+e);return this.addAnimationWith(t,n,r,a)},e.addAnimationWith=function(t,e,r,a){if(null==e)throw Error("animation cannot be null.");var n=this.expandToIndex(t);if(null!=n)for(;null!=n.next;)n=n.next;var i=this.trackEntry(t,e,r,n);if(null==n)this.setCurrent(t,i,!0),this.queue.drain();else if(n.next=i,a<=0){var s=n.animationEnd-n.animationStart;0!=s?(n.loop?a+=s*(1+(n.trackTime/s|0)):a+=Math.max(s,n.trackTime),a-=this.data.getMix(n.animation,e)):a=n.trackTime}return i.delay=a,i},e.setEmptyAnimation=function(e,r){var a=this.setAnimationWith(e,t.emptyAnimation,!1);return a.mixDuration=r,a.trackEnd=r,a},e.addEmptyAnimation=function(e,r,a){a<=0&&(a-=r);var n=this.addAnimationWith(e,t.emptyAnimation,!1,a);return n.mixDuration=r,n.trackEnd=r,n},e.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var r=0,a=this.tracks.length;r<a;r++){var n=this.tracks[r];null!=n&&this.setEmptyAnimation(n.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.expandToIndex=function(t){return t<this.tracks.length?this.tracks[t]:(S.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)},e.trackEntry=function(t,e,r,a){var n=this.trackEntryPool.obtain();return n.trackIndex=t,n.animation=e,n.loop=r,n.holdPrevious=!1,n.eventThreshold=0,n.attachmentThreshold=0,n.drawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.interruptAlpha=1,n.mixTime=0,n.mixDuration=null==a?0:this.data.getMix(a.animation,e),n.mixBlend=T.replace,n},e.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},e._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var t=0,e=this.tracks.length;t<e;t++){var r=this.tracks[t];if(null!=r){for(;null!=r.mixingFrom;)r=r.mixingFrom;do(null==r.mixingFrom||r.mixBlend!=T.add)&&this.computeHold(r),r=r.mixingTo;while(null!=r)}}},e.computeHold=function(e){var a=e.mixingTo,n=e.animation.timelines,i=e.animation.timelines.length,s=S.setArraySize(e.timelineMode,i);e.timelineHoldMix.length=0;var o=S.setArraySize(e.timelineHoldMix,i),h=this.propertyIDs;if(null!=a&&a.holdPrevious){for(var l=0;l<i;l++)s[l]=h.add(n[l].getPropertyId())?t.HOLD_FIRST:t.HOLD_SUBSEQUENT;return}t:for(var u=0;u<i;u++){var c=n[u],f=c.getPropertyId();if(h.add(f)){if(null==a||r(c,Y)||r(c,D)||r(c,L)||!a.animation.hasTimeline(f))s[u]=t.FIRST;else{for(var d=a.mixingTo;null!=d;d=d.mixingTo)if(!d.animation.hasTimeline(f)){if(e.mixDuration>0){s[u]=t.HOLD_MIX,o[u]=d;continue t}break}s[u]=t.HOLD_FIRST}}else s[u]=t.SUBSEQUENT}},e.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.addListener=function(t){if(null==t)throw Error("listener cannot be null.");this.listeners.push(t)},e.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.clearListeners=function(){this.listeners.length=0},e.clearListenerNotifications=function(){this.queue.clear()},t}();G.emptyAnimation=new R("<empty>",[],0),G.SUBSEQUENT=0,G.FIRST=1,G.HOLD_SUBSEQUENT=2,G.HOLD_FIRST=3,G.HOLD_MIX=4,G.SETUP=1,G.CURRENT=2;var j=/*#__PURE__*/function(){function t(){this.mixBlend=T.replace,this.timelineMode=[],this.timelineHoldMix=[],this.timelinesRotation=[]}var e=t.prototype;return e.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.resetRotationDirections=function(){this.timelinesRotation.length=0},t}(),z=/*#__PURE__*/function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}var e=t.prototype;return e.start=function(t){this.objects.push(0),this.objects.push(t),this.animState.animationsChanged=!0},e.interrupt=function(t){this.objects.push(1),this.objects.push(t)},e.end=function(t){this.objects.push(2),this.objects.push(t),this.animState.animationsChanged=!0},e.dispose=function(t){this.objects.push(3),this.objects.push(t)},e.complete=function(t){this.objects.push(4),this.objects.push(t)},e.event=function(t,e){this.objects.push(5),this.objects.push(t),this.objects.push(e)},e.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];switch(a){case 0:null!=n.listener&&n.listener.start&&n.listener.start(n);for(var i=0;i<e.length;i++)e[i].start&&e[i].start(n);break;case 1:null!=n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(var s=0;s<e.length;s++)e[s].interrupt&&e[s].interrupt(n);break;case 2:null!=n.listener&&n.listener.end&&n.listener.end(n);for(var o=0;o<e.length;o++)e[o].end&&e[o].end(n);case 3:null!=n.listener&&n.listener.dispose&&n.listener.dispose(n);for(var h=0;h<e.length;h++)e[h].dispose&&e[h].dispose(n);this.animState.trackEntryPool.free(n);break;case 4:null!=n.listener&&n.listener.complete&&n.listener.complete(n);for(var l=0;l<e.length;l++)e[l].complete&&e[l].complete(n);break;case 5:var u=t[r+++2];null!=n.listener&&n.listener.event&&n.listener.event(n,u);for(var c=0;c<e.length;c++)e[c].event&&e[c].event(n,u)}}this.clear(),this.drainDisabled=!1}},e.clear=function(){this.objects.length=0},t}(),Z=/*#__PURE__*/function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw Error("skeletonData cannot be null.");this.skeletonData=t}var e=t.prototype;return e.setMix=function(t,e,r){var a=this.skeletonData.findAnimation(t);if(null==a)throw Error("Animation not found: "+t);var n=this.skeletonData.findAnimation(e);if(null==n)throw Error("Animation not found: "+e);this.setMixWith(a,n,r)},e.setMixWith=function(t,e,r){if(null==t)throw Error("from cannot be null.");if(null==e)throw Error("to cannot be null.");var a=t.name+"."+e.name;this.animationToMixTime[a]=r},e.getMix=function(t,e){var r=t.name+"."+e.name,a=this.animationToMixTime[r];return void 0===a?this.defaultMix:a},t}(),Q=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).x=0,r.y=0,r.scaleX=1,r.scaleY=1,r.rotation=0,r.width=0,r.height=0,r.color=new E(1,1,1,1),r.offset=S.newFloatArray(8),r.uvs=S.newFloatArray(8),r.tempColor=new E(1,1,1,1),r}s(e,t);var r=e.prototype;return r.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*t,n=-this.height/2*this.scaleY+this.region.offsetY*r,i=a+this.region.width*t,s=n+this.region.height*r,o=this.rotation*Math.PI/180,h=Math.cos(o),l=Math.sin(o),u=a*h+this.x,c=a*l,f=n*h+this.y,d=n*l,v=i*h+this.x,g=i*l,m=s*h+this.y,p=s*l,E=this.offset;E[e.OX1]=u-d,E[e.OY1]=f+c,E[e.OX2]=u-p,E[e.OY2]=m+c,E[e.OX3]=v-p,E[e.OY3]=m+g,E[e.OX4]=v-d,E[e.OY4]=f+g},r.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},r.computeWorldVertices=function(t,r,a,n){var i=this.offset,s=t.worldX,o=t.worldY,h=t.a,l=t.b,u=t.c,c=t.d,f=0,d=0;f=i[e.OX1],d=i[e.OY1],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o,a+=n,f=i[e.OX2],d=i[e.OY2],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o,a+=n,f=i[e.OX3],d=i[e.OY3],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o,a+=n,f=i[e.OX4],d=i[e.OY4],r[a]=f*h+d*l+s,r[a+1]=f*u+d*c+o},r.copy=function(){var t=new e(this.name);return t.region=this.region,t.rendererObject=this.rendererObject,t.path=this.path,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,S.arrayCopy(this.uvs,0,t.uvs,0,8),S.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t},e}(y);Q.OX1=0,Q.OY1=1,Q.OX2=2,Q.OY2=3,Q.OX3=4,Q.OY3=5,Q.OX4=6,Q.OY4=7,Q.X1=0,Q.Y1=1,Q.C1R=2,Q.C1G=3,Q.C1B=4,Q.C1A=5,Q.U1=6,Q.V1=7,Q.X2=8,Q.Y2=9,Q.C2R=10,Q.C2G=11,Q.C2B=12,Q.C2A=13,Q.U2=14,Q.V2=15,Q.X3=16,Q.Y3=17,Q.C3R=18,Q.C3G=19,Q.C3B=20,Q.C3A=21,Q.U3=22,Q.V3=23,Q.X4=24,Q.Y4=25,Q.C4R=26,Q.C4G=27,Q.C4B=28,Q.C4A=29,Q.U4=30,Q.V4=31;var K=/*#__PURE__*/function(){var t;function e(t){this._texture=t}return e.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return 9728;case"linear":return 9729;case"mipmap":case"mipmaplinearlinear":return 9987;case"mipmapnearestnearest":return 9984;case"mipmaplinearnearest":return 9985;case"mipmapnearestlinear":return 9986;default:throw Error("Unknown texture filter "+t)}},e.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return 33648;case"clamptoedge":return 33071;case"repeat":return 10497;default:throw Error("Unknown texture wrap "+t)}},t=[{key:"width",get:function(){return this._texture.width}},{key:"height",get:function(){return this._texture.height}},{key:"texture",get:function(){return this._texture}}],function(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}(e.prototype,t),e}(),J=((l={})[l.Nearest=9728]="Nearest",l[l.Linear=9729]="Linear",l[l.MipMap=9987]="MipMap",l[l.MipMapNearestNearest=9984]="MipMapNearestNearest",l[l.MipMapLinearNearest=9985]="MipMapLinearNearest",l[l.MipMapNearestLinear=9986]="MipMapNearestLinear",l[l.MipMapLinearLinear=9987]="MipMapLinearLinear",l),$=((u={})[u.MirroredRepeat=33648]="MirroredRepeat",u[u.ClampToEdge=33071]="ClampToEdge",u[u.Repeat=10497]="Repeat",u),tt=/*#__PURE__*/function(){function t(t,e){this.pages=[],this.regions=[],this.load(t,e)}var e=t.prototype;return e.load=function(t,e){if(null==e)throw Error("textureLoader cannot be null.");for(var r=new te(t),a=[,,,,],n=null;;){var i=r.readLine();if(null==i)break;if(0==(i=i.trim()).length)n=null;else if(n){var s=new ta;s.name=i,s.page=n;var o=r.readValue();"true"==o.toLocaleLowerCase()?s.degrees=90:"false"==o.toLocaleLowerCase()?s.degrees=0:s.degrees=parseFloat(o),s.rotate=90==s.degrees,r.readTuple(a);var h=parseInt(a[0]),l=parseInt(a[1]);r.readTuple(a);var u=parseInt(a[0]),c=parseInt(a[1]);s.u=h/n.width,s.v=l/n.height,s.rotate?(s.u2=(h+c)/n.width,s.v2=(l+u)/n.height):(s.u2=(h+u)/n.width,s.v2=(l+c)/n.height),s.x=h,s.y=l,s.width=Math.abs(u),s.height=Math.abs(c),4==r.readTuple(a)&&4==r.readTuple(a)&&r.readTuple(a),s.originalWidth=parseInt(a[0]),s.originalHeight=parseInt(a[1]),r.readTuple(a),s.offsetX=parseInt(a[0]),s.offsetY=parseInt(a[1]),s.index=parseInt(r.readValue()),s.texture=n.texture,this.regions.push(s)}else{(n=new tr).name=i,2==r.readTuple(a)&&(n.width=parseInt(a[0]),n.height=parseInt(a[1]),r.readTuple(a)),r.readTuple(a),n.minFilter=K.filterFromString(a[0]),n.magFilter=K.filterFromString(a[1]);var f=r.readValue();n.uWrap=$.ClampToEdge,n.vWrap=$.ClampToEdge,"x"==f?n.uWrap=$.Repeat:"y"==f?n.vWrap=$.Repeat:"xy"==f&&(n.uWrap=n.vWrap=$.Repeat),n.texture=e(i),n.texture.setFilters(n.minFilter,n.magFilter),n.texture.setWraps(n.uWrap,n.vWrap),n.width=n.texture.width,n.height=n.texture.height,this.pages.push(n)}}},e.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},e.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()},t}(),te=/*#__PURE__*/function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var e=t.prototype;return e.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},e.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw Error("Invalid line: "+t);return t.substring(e+1).trim()},e.readTuple=function(t){var e=this.readLine(),r=e.indexOf(":");if(-1==r)throw Error("Invalid line: "+e);for(var a=0,n=r+1;a<3;a++){var i=e.indexOf(",",n);if(-1==i)break;t[a]=e.substr(n,i-n).trim(),n=i+1}return t[a]=e.substring(n).trim(),a+1},t}(),tr=function(){},ta=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e}(function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}),tn=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(1,1,1,1),r.tempColor=new E(0,0,0,0),r}s(e,t);var a=e.prototype;return a.updateUVs=function(){var t=this.regionUVs;(null==this.uvs||this.uvs.length!=t.length)&&(this.uvs=S.newFloatArray(t.length));var e=this.uvs,a=this.uvs.length,n=this.region.u,i=this.region.v,s=0,o=0;if(r(this.region,ta)){var h=this.region,l=h.texture.width,u=h.texture.height;switch(h.degrees){case 90:n-=(h.originalHeight-h.offsetY-h.height)/l,i-=(h.originalWidth-h.offsetX-h.width)/u,s=h.originalHeight/l,o=h.originalWidth/u;for(var c=0;c<a;c+=2)e[c]=n+t[c+1]*s,e[c+1]=i+(1-t[c])*o;return;case 180:n-=(h.originalWidth-h.offsetX-h.width)/l,i-=h.offsetY/u,s=h.originalWidth/l,o=h.originalHeight/u;for(var f=0;f<a;f+=2)e[f]=n+(1-t[f])*s,e[f+1]=i+(1-t[f+1])*o;return;case 270:n-=h.offsetY/l,i-=h.offsetX/u,s=h.originalHeight/l,o=h.originalWidth/u;for(var d=0;d<a;d+=2)e[d]=n+(1-t[d+1])*s,e[d+1]=i+t[d]*o;return}n-=h.offsetX/l,i-=(h.originalHeight-h.offsetY-h.height)/u,s=h.originalWidth/l,o=h.originalHeight/u}else null==this.region?(n=i=0,s=o=1):(s=this.region.u2-n,o=this.region.v2-i);for(var v=0;v<a;v+=2)e[v]=n+t[v]*s,e[v+1]=i+t[v+1]*o},a.getParentMesh=function(){return this.parentMesh},a.setParentMesh=function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},a.copy=function(){if(null!=this.parentMesh)return this.newLinkedMesh();var t=new e(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=Array(this.regionUVs.length),S.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=Array(this.uvs.length),S.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=Array(this.triangles.length),S.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,null!=this.edges&&(t.edges=Array(this.edges.length),S.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t},a.newLinkedMesh=function(){var t=new e(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(null!=this.parentMesh?this.parentMesh:this),t.updateUVs(),t},e}(I),ti=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(1,1,1,1),r}return s(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(I),ts=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).closed=!1,r.constantSpeed=!1,r.color=new E(1,1,1,1),r}return s(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.lengths=Array(this.lengths.length),S.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t},e}(I),to=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(.38,.94,0,1),r.name=e,r}s(e,t);var r=e.prototype;return r.computeWorldPosition=function(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e},r.computeWorldRotation=function(t){var e=b.cosDeg(this.rotation),r=b.sinDeg(this.rotation),a=e*t.a+r*t.b;return Math.atan2(e*t.c+r*t.d,a)*b.radDeg},r.copy=function(){var t=new e(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},e}(I),th=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e)||this).color=new E(.2275,.2275,.8078,1),r}return s(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},e}(I),tl=/*#__PURE__*/function(){function t(t){this.atlas=t}var e=t.prototype;return e.newRegionAttachment=function(t,e,r){var a=this.atlas.findRegion(r);if(null==a)throw Error("Region not found in atlas: "+r+" (region attachment: "+e+")");a.renderObject=a;var n=new Q(e);return n.setRegion(a),n},e.newMeshAttachment=function(t,e,r){var a=this.atlas.findRegion(r);if(null==a)throw Error("Region not found in atlas: "+r+" (mesh attachment: "+e+")");a.renderObject=a;var n=new tn(e);return n.region=a,n},e.newBoundingBoxAttachment=function(t,e){return new ti(e)},e.newPathAttachment=function(t,e){return new ts(e)},e.newPointAttachment=function(t,e){return new to(e)},e.newClippingAttachment=function(t,e){return new th(e)},t}(),tu=((c={})[c.Normal=0]="Normal",c[c.Additive=1]="Additive",c[c.Multiply=2]="Multiply",c[c.Screen=3]="Screen",c),tc=function(t,e,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=0,this.skinRequired=!1,this.color=new E,t<0)throw Error("index must be >= 0.");if(null==e)throw Error("name cannot be null.");this.index=t,this.name=e,this.parent=r},tf=((f={})[f.Normal=0]="Normal",f[f.OnlyTranslation=1]="OnlyTranslation",f[f.NoRotationOrReflection=2]="NoRotationOrReflection",f[f.NoScale=3]="NoScale",f[f.NoScaleOrReflection=4]="NoScaleOrReflection",f),td=/*#__PURE__*/function(){function t(t,e,r){if(this.children=[],this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=r,this.setToSetupPose()}var e=t.prototype;return e.isActive=function(){return this.active},e.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.updateWorldTransformWith=function(t,e,r,a,n,i,s){this.ax=t,this.ay=e,this.arotation=r,this.ascaleX=a,this.ascaleY=n,this.ashearX=i,this.ashearY=s,this.appliedValid=!0;var o=this.parent;if(null==o){var h=this.skeleton,l=r+90+s,u=h.scaleX,c=h.scaleY;this.a=b.cosDeg(r+i)*a*u,this.b=b.cosDeg(l)*n*u,this.c=b.sinDeg(r+i)*a*c,this.d=b.sinDeg(l)*n*c,this.worldX=t*u+h.x,this.worldY=e*c+h.y;return}var f=o.a,d=o.b,v=o.c,g=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+g*e+o.worldY,this.data.transformMode){case tf.Normal:var m=r+90+s,p=b.cosDeg(r+i)*a,E=b.cosDeg(m)*n,x=b.sinDeg(r+i)*a,S=b.sinDeg(m)*n;this.a=f*p+d*x,this.b=f*E+d*S,this.c=v*p+g*x,this.d=v*E+g*S;return;case tf.OnlyTranslation:var w=r+90+s;this.a=b.cosDeg(r+i)*a,this.b=b.cosDeg(w)*n,this.c=b.sinDeg(r+i)*a,this.d=b.sinDeg(w)*n;break;case tf.NoRotationOrReflection:var M=f*f+v*v,y=0;M>1e-4?(M=Math.abs(f*g-d*v)/M,f/=this.skeleton.scaleX,v/=this.skeleton.scaleY,d=v*M,g=f*M,y=Math.atan2(v,f)*b.radDeg):(f=0,v=0,y=90-Math.atan2(g,d)*b.radDeg);var I=r+i-y,R=r+s-y+90,T=b.cosDeg(I)*a,A=b.cosDeg(R)*n,k=b.sinDeg(I)*a,V=b.sinDeg(R)*n;this.a=f*T-d*k,this.b=f*A-d*V,this.c=v*T+g*k,this.d=v*A+g*V;break;case tf.NoScale:case tf.NoScaleOrReflection:var C=b.cosDeg(r),P=b.sinDeg(r),F=(f*C+d*P)/this.skeleton.scaleX,N=(v*C+g*P)/this.skeleton.scaleY,_=Math.sqrt(F*F+N*N);_>1e-5&&(_=1/_),F*=_,N*=_,_=Math.sqrt(F*F+N*N),this.data.transformMode==tf.NoScale&&f*g-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(_=-_);var Y=Math.PI/2+Math.atan2(N,F),X=Math.cos(Y)*_,O=Math.sin(Y)*_,L=b.cosDeg(i)*a,D=b.cosDeg(90+s)*n,B=b.sinDeg(i)*a,W=b.sinDeg(90+s)*n;this.a=F*L+X*B,this.b=F*D+X*W,this.c=N*L+O*B,this.d=N*D+O*W}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*b.radDeg},e.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*b.radDeg},e.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.updateAppliedTransform=function(){this.appliedValid=!0;var t=this.parent;if(null==t){this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*b.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*b.radDeg;return}var e=t.a,r=t.b,a=t.c,n=t.d,i=1/(e*n-r*a),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*n*i-o*r*i,this.ay=o*e*i-s*a*i;var h=i*n,l=i*e,u=i*r,c=i*a,f=h*this.a-u*this.c,d=h*this.b-u*this.d,v=l*this.c-c*this.a,g=l*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var m=f*g-d*v;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(f*d+v*g,m)*b.radDeg,this.arotation=Math.atan2(v,f)*b.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,d)*b.radDeg},e.worldToLocal=function(t){var e=this.a,r=this.b,a=this.c,n=this.d,i=1/(e*n-r*a),s=t.x-this.worldX,o=t.y-this.worldY;return t.x=s*n*i-o*r*i,t.y=o*e*i-s*a*i,t},e.localToWorld=function(t){var e=t.x,r=t.y;return t.x=e*this.a+r*this.b+this.worldX,t.y=e*this.c+r*this.d+this.worldY,t},e.worldToLocalRotation=function(t){var e=b.sinDeg(t),r=b.cosDeg(t);return Math.atan2(this.a*e-this.c*r,this.d*r-this.b*e)*b.radDeg+this.rotation-this.shearX},e.localToWorldRotation=function(t){t-=this.rotation-this.shearX;var e=b.sinDeg(t),r=b.cosDeg(t);return Math.atan2(r*this.c+e*this.d,r*this.a+e*this.b)*b.radDeg},e.rotateWorld=function(t){var e=this.a,r=this.b,a=this.c,n=this.d,i=b.cosDeg(t),s=b.sinDeg(t);this.a=i*e-s*a,this.b=i*r-s*n,this.c=s*e+i*a,this.d=s*r+i*n,this.appliedValid=!1},t}(),tv=function(t,e,r){this.name=t,this.order=e,this.skinRequired=r},tg=function(t,e){if(null==e)throw Error("data cannot be null.");this.time=t,this.data=e},tm=function(t){this.name=t},tp=/*#__PURE__*/function(){function t(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)}var e=t.prototype;return e.isActive=function(){return this.active},e.apply=function(){this.update()},e.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},e.apply1=function(t,e,r,a,n,i,s){t.appliedValid||t.updateAppliedTransform();var o=t.parent,h=o.a,l=o.b,u=o.c,c=o.d,f=-t.ashearX-t.arotation,d=0,v=0;switch(t.data.transformMode){case tf.OnlyTranslation:d=e-t.worldX,v=r-t.worldY;break;case tf.NoRotationOrReflection:var g=Math.abs(h*c-l*u)/(h*h+u*u),m=h/t.skeleton.scaleX,p=u/t.skeleton.scaleY;l=-p*g*t.skeleton.scaleX,c=m*g*t.skeleton.scaleY,f+=Math.atan2(p,m)*b.radDeg;default:var E=e-o.worldX,x=r-o.worldY,S=h*c-l*u;d=(E*c-x*l)/S-t.ax,v=(x*h-E*u)/S-t.ay}f+=Math.atan2(v,d)*b.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);var w=t.ascaleX,M=t.ascaleY;if(a||n){switch(t.data.transformMode){case tf.NoScale:case tf.NoScaleOrReflection:d=e-t.worldX,v=r-t.worldY}var y=t.data.length*w,I=Math.sqrt(d*d+v*v);if(a&&I<y||n&&I>y&&y>1e-4){var R=(I/y-1)*s+1;w*=R,i&&(M*=R)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,w,M,t.ashearX,t.ashearY)},e.apply2=function(t,e,r,a,n,i,s,o){if(0==o){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();var h=t.ax,l=t.ay,u=t.ascaleX,c=u,f=t.ascaleY,d=e.ascaleX,v=0,g=0,m=0;u<0?(u=-u,v=180,m=-1):(v=0,m=1),f<0&&(f=-f,m=-m),d<0?(d=-d,g=180):g=0;var p=e.ax,E=0,x=0,S=0,w=t.a,M=t.b,y=t.c,I=t.d,R=1e-4>=Math.abs(u-f);R?(x=w*p+M*(E=e.ay)+t.worldX,S=y*p+I*E+t.worldY):(E=0,x=w*p+t.worldX,S=y*p+t.worldY);var T=t.parent;w=T.a,M=T.b,y=T.c;var A,k,V=1/(w*(I=T.d)-M*y),C=x-T.worldX,P=S-T.worldY,F=(C*I-P*M)*V-h,N=(P*w-C*y)*V-l,_=Math.sqrt(F*F+N*N),Y=e.data.length*d;if(_<1e-4){this.apply1(t,r,a,!1,i,!1,o),e.updateWorldTransformWith(p,E,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}var X=((C=r-T.worldX)*I-(P=a-T.worldY)*M)*V-h,O=(P*w-C*y)*V-l,L=X*X+O*O;if(0!=s){s*=u*(d+1)/2;var D=Math.sqrt(L),B=D-_-Y*u+s;if(B>0){var W=Math.min(1,B/(2*s))-1;W=(B-s*(1-W*W))/D,X-=W*X,O-=W*O,L=X*X+O*O}}t:if(R){var q=(L-_*_-(Y*=u)*Y)/(2*_*Y);q<-1?q=-1:q>1&&(q=1,i&&(c*=(Math.sqrt(L)/(_+Y)-1)*o+1)),k=Math.acos(q)*n,A=Math.atan2(O*(w=_+Y*q)-X*(M=Y*Math.sin(k)),X*w+O*M)}else{var U=(w=u*Y)*w,H=(M=f*Y)*M,G=Math.atan2(O,X);y=H*_*_+U*L-U*H;var j=-2*H*_,z=H-U;if((I=j*j-4*z*y)>=0){var Z=Math.sqrt(I);j<0&&(Z=-Z);var Q=(Z=-(j+Z)/2)/z,K=y/Z,J=Math.abs(Q)<Math.abs(K)?Q:K;if(J*J<=L){A=G-Math.atan2(P=Math.sqrt(L-J*J)*n,J),k=Math.atan2(P/f,(J-_)/u);break t}}var $=b.PI,tt=_-w,te=tt*tt,tr=0,ta=0,tn=_+w,ti=tn*tn,ts=0;(y=-w*_/(U-H))>=-1&&y<=1&&((I=(C=w*Math.cos(y=Math.acos(y))+_)*C+(P=M*Math.sin(y))*P)<te&&($=y,te=I,tt=C,tr=P),I>ti&&(ta=y,ti=I,tn=C,ts=P)),L<=(te+ti)/2?(A=G-Math.atan2(tr*n,tt),k=$*n):(A=G-Math.atan2(ts*n,tn),k=ta*n)}var to=Math.atan2(E,p)*m,th=t.arotation;(A=(A-to)*b.radDeg+v-th)>180?A-=360:A<-180&&(A+=360),t.updateWorldTransformWith(h,l,th+A*o,c,t.ascaleY,0,0),th=e.arotation,(k=((k+to)*b.radDeg-e.ashearX)*m+g-th)>180?k-=360:k<-180&&(k+=360),e.updateWorldTransformWith(p,E,th+k*o,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},t}(),tE=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e,0,!1)||this).bones=[],r.bendDirection=1,r.compress=!1,r.stretch=!1,r.uniform=!1,r.mix=1,r.softness=0,r}return s(e,t),e}(tv),tb=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e,0,!1)||this).bones=[],r}return s(e,t),e}(tv),tx=((d={})[d.Fixed=0]="Fixed",d[d.Percent=1]="Percent",d),tS=((v={})[v.Length=0]="Length",v[v.Fixed=1]="Fixed",v[v.Percent=2]="Percent",v),tw=((g={})[g.Tangent=0]="Tangent",g[g.Chain=1]="Chain",g[g.ChainScale=2]="ChainScale",g),tM=/*#__PURE__*/function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=[],this.positions=[],this.world=[],this.curves=[],this.lengths=[],this.segments=[],this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.bones=[];for(var r=0,a=t.bones.length;r<a;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}var e=t.prototype;return e.isActive=function(){return this.active},e.apply=function(){this.update()},e.update=function(){var e=this.target.getAttachment();if(r(e,ts)){var a=this.rotateMix,n=this.translateMix,i=a>0;if(n>0||i){var s=this.data,o=s.spacingMode==tS.Percent,h=s.rotateMode,l=h==tw.Tangent,u=h==tw.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,v=S.setArraySize(this.spaces,f),g=null,m=this.spacing;if(u||!o){u&&(g=S.setArraySize(this.lengths,c));for(var p=s.spacingMode==tS.Length,E=0,x=f-1;E<x;){var w=d[E],M=w.data.length;if(M<t.epsilon)u&&(g[E]=0),v[++E]=0;else if(o){if(u){var y=M*w.a,I=M*w.c,R=Math.sqrt(y*y+I*I);g[E]=R}v[++E]=m}else{var T=M*w.a,A=M*w.c,k=Math.sqrt(T*T+A*A);u&&(g[E]=k),v[++E]=(p?M+m:m)*k/M}}}else for(var V=1;V<f;V++)v[V]=m;var C=this.computeWorldPositions(e,f,l,s.positionMode==tx.Percent,o),P=C[0],F=C[1],N=s.offsetRotation,_=!1;if(0==N)_=h==tw.Chain;else{_=!1;var Y=this.target.bone;N*=Y.a*Y.d-Y.b*Y.c>0?b.degRad:-b.degRad}for(var X=0,O=3;X<c;X++,O+=3){var L=d[X];L.worldX+=(P-L.worldX)*n,L.worldY+=(F-L.worldY)*n;var D=C[O],B=C[O+1],W=D-P,q=B-F;if(u){var U=g[X];if(0!=U){var H=(Math.sqrt(W*W+q*q)/U-1)*a+1;L.a*=H,L.c*=H}}if(P=D,F=B,i){var G=L.a,j=L.b,z=L.c,Z=L.d,Q=0,K=0,J=0;if(Q=(l?C[O-1]:0==v[X+1]?C[O+2]:Math.atan2(q,W))-Math.atan2(z,G),_){K=Math.cos(Q),J=Math.sin(Q);var $=L.data.length;P+=($*(K*G-J*z)-W)*a,F+=($*(J*G+K*z)-q)*a}else Q+=N;Q>b.PI?Q-=b.PI2:Q<-b.PI&&(Q+=b.PI2),Q*=a,K=Math.cos(Q),J=Math.sin(Q),L.a=K*G-J*z,L.b=K*j-J*Z,L.c=J*G+K*z,L.d=J*j+K*Z}L.appliedValid=!1}}}},e.computeWorldPositions=function(e,r,a,n,i){var s=this.target,o=this.position,h=this.spaces,l=S.setArraySize(this.positions,3*r+2),u=null,c=e.closed,f=e.worldVerticesLength,d=f/6,v=t.NONE;if(!e.constantSpeed){var g=e.lengths,m=g[d-=c?1:2];if(n&&(o*=m),i)for(var p=1;p<r;p++)h[p]*=m;u=S.setArraySize(this.world,8);for(var E=0,b=0,x=0;E<r;E++,b+=3){var w=h[E],M=o+=w;if(c)(M%=m)<0&&(M+=m),x=0;else if(M<0){v!=t.BEFORE&&(v=t.BEFORE,e.computeWorldVertices(s,2,4,u,0,2)),this.addBeforePosition(M,u,0,l,b);continue}else if(M>m){v!=t.AFTER&&(v=t.AFTER,e.computeWorldVertices(s,f-6,4,u,0,2)),this.addAfterPosition(M-m,u,0,l,b);continue}for(;;x++){var y=g[x];if(!(M>y)){if(0==x)M/=y;else{var I=g[x-1];M=(M-I)/(y-I)}break}}x!=v&&(v=x,c&&x==d?(e.computeWorldVertices(s,f-4,4,u,0,2),e.computeWorldVertices(s,0,4,u,4,2)):e.computeWorldVertices(s,6*x+2,8,u,0,2)),this.addCurvePosition(M,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,b,a||E>0&&0==w)}return l}c?(f+=2,u=S.setArraySize(this.world,f),e.computeWorldVertices(s,2,f-4,u,0,2),e.computeWorldVertices(s,0,2,u,f-4,2),u[f-2]=u[0],u[f-1]=u[1]):(d--,f-=4,u=S.setArraySize(this.world,f),e.computeWorldVertices(s,2,f,u,0,2));for(var R=S.setArraySize(this.curves,d),T=0,A=u[0],k=u[1],V=0,C=0,P=0,F=0,N=0,_=0,Y=0,X=0,O=0,L=0,D=0,B=0,W=0,q=0,U=0,H=2;U<d;U++,H+=6)V=u[H],C=u[H+1],P=u[H+2],F=u[H+3],N=u[H+4],_=u[H+5],Y=(A-2*V+P)*.1875,X=(k-2*C+F)*.1875,O=((V-P)*3-A+N)*.09375,L=((C-F)*3-k+_)*.09375,D=2*Y+O,B=2*X+L,T+=Math.sqrt((W=(V-A)*.75+Y+.16666667*O)*W+(q=(C-k)*.75+X+.16666667*L)*q),W+=D,q+=B,D+=O,B+=L,T+=Math.sqrt(W*W+q*q),W+=D,q+=B,T+=Math.sqrt(W*W+q*q),W+=D+O,q+=B+L,T+=Math.sqrt(W*W+q*q),R[U]=T,A=N,k=_;if(n?o*=T:o*=T/e.lengths[d-1],i)for(var G=1;G<r;G++)h[G]*=T;for(var j=this.segments,z=0,Z=0,Q=0,K=0,J=0;Z<r;Z++,Q+=3){var $=h[Z],tt=o+=$;if(c)(tt%=T)<0&&(tt+=T),K=0;else if(tt<0){this.addBeforePosition(tt,u,0,l,Q);continue}else if(tt>T){this.addAfterPosition(tt-T,u,f-4,l,Q);continue}for(;;K++){var te=R[K];if(!(tt>te)){if(0==K)tt/=te;else{var tr=R[K-1];tt=(tt-tr)/(te-tr)}break}}if(K!=v){v=K;var ta=6*K;for(A=u[ta],k=u[ta+1],V=u[ta+2],C=u[ta+3],P=u[ta+4],F=u[ta+5],N=u[ta+6],_=u[ta+7],Y=(A-2*V+P)*.03,X=(k-2*C+F)*.03,O=((V-P)*3-A+N)*.006,L=((C-F)*3-k+_)*.006,D=2*Y+O,B=2*X+L,z=Math.sqrt((W=(V-A)*.3+Y+.16666667*O)*W+(q=(C-k)*.3+X+.16666667*L)*q),j[0]=z,ta=1;ta<8;ta++)W+=D,q+=B,D+=O,B+=L,z+=Math.sqrt(W*W+q*q),j[ta]=z;W+=D,q+=B,z+=Math.sqrt(W*W+q*q),j[8]=z,W+=D+O,q+=B+L,z+=Math.sqrt(W*W+q*q),j[9]=z,J=0}for(tt*=z;;J++){var tn=j[J];if(!(tt>tn)){if(0==J)tt/=tn;else{var ti=j[J-1];tt=J+(tt-ti)/(tn-ti)}break}}this.addCurvePosition(.1*tt,A,k,V,C,P,F,N,_,l,Q,a||Z>0&&0==$)}return l},e.addBeforePosition=function(t,e,r,a,n){var i=e[r],s=e[r+1],o=e[r+2]-i,h=Math.atan2(e[r+3]-s,o);a[n]=i+t*Math.cos(h),a[n+1]=s+t*Math.sin(h),a[n+2]=h},e.addAfterPosition=function(t,e,r,a,n){var i=e[r+2],s=e[r+3],o=i-e[r],h=Math.atan2(s-e[r+1],o);a[n]=i+t*Math.cos(h),a[n+1]=s+t*Math.sin(h),a[n+2]=h},e.addCurvePosition=function(t,e,r,a,n,i,s,o,h,l,u,c){if(0==t||isNaN(t)){l[u]=e,l[u+1]=r,l[u+2]=Math.atan2(n-r,a-e);return}var f=t*t,d=f*t,v=1-t,g=v*v,m=g*v,p=v*t,E=3*p,b=v*E,x=E*t,S=e*m+a*b+i*x+o*d,w=r*m+n*b+s*x+h*d;l[u]=S,l[u+1]=w,c&&(t<.001?l[u+2]=Math.atan2(n-r,a-e):l[u+2]=Math.atan2(w-(r*g+n*p*2+s*f),S-(e*g+a*p*2+i*f)))},t}();tM.NONE=-1,tM.BEFORE=-2,tM.AFTER=-3,tM.epsilon=1e-5;var ty=/*#__PURE__*/function(){function t(t,e){if(this.deform=[],null==t)throw Error("data cannot be null.");if(null==e)throw Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new E,this.darkColor=null==t.darkColor?null:new E,this.setToSetupPose()}var e=t.prototype;return e.getSkeleton=function(){return this.bone.skeleton},e.getAttachment=function(){return this.attachment},e.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)},e.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},e.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},e.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},t}(),tI=/*#__PURE__*/function(){function t(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new M,this.active=!1,null==t)throw Error("data cannot be null.");if(null==e)throw Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)}var e=t.prototype;return e.isActive=function(){return this.active},e.apply=function(){this.update()},e.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target,i=n.a,s=n.b,o=n.c,h=n.d,l=i*h-s*o>0?b.degRad:-b.degRad,u=this.data.offsetRotation*l,c=this.data.offsetShearY*l,f=this.bones,d=0,v=f.length;d<v;d++){var g=f[d],m=!1;if(0!=t){var p=g.a,E=g.b,x=g.c,S=g.d,w=Math.atan2(o,i)-Math.atan2(x,p)+u;w>b.PI?w-=b.PI2:w<-b.PI&&(w+=b.PI2);var M=Math.cos(w*=t),y=Math.sin(w);g.a=M*p-y*x,g.b=M*E-y*S,g.c=y*p+M*x,g.d=y*E+M*S,m=!0}if(0!=e){var I=this.temp;n.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(I.x-g.worldX)*e,g.worldY+=(I.y-g.worldY)*e,m=!0}if(r>0){var R=Math.sqrt(g.a*g.a+g.c*g.c),T=Math.sqrt(i*i+o*o);R>1e-5&&(R=(R+(T-R+this.data.offsetScaleX)*r)/R),g.a*=R,g.c*=R,R=Math.sqrt(g.b*g.b+g.d*g.d),T=Math.sqrt(s*s+h*h),R>1e-5&&(R=(R+(T-R+this.data.offsetScaleY)*r)/R),g.b*=R,g.d*=R,m=!0}if(a>0){var A=g.b,k=g.d,V=Math.atan2(k,A),C=Math.atan2(h,s)-Math.atan2(o,i)-(V-Math.atan2(g.c,g.a));C>b.PI?C-=b.PI2:C<-b.PI&&(C+=b.PI2),C=V+(C+c)*a;var P=Math.sqrt(A*A+k*k);g.b=Math.cos(C)*P,g.d=Math.sin(C)*P,m=!0}m&&(g.appliedValid=!1)}},e.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target,i=n.a,s=n.b,o=n.c,h=n.d,l=i*h-s*o>0?b.degRad:-b.degRad,u=this.data.offsetRotation*l,c=this.data.offsetShearY*l,f=this.bones,d=0,v=f.length;d<v;d++){var g=f[d],m=!1;if(0!=t){var p=g.a,E=g.b,x=g.c,S=g.d,w=Math.atan2(o,i)+u;w>b.PI?w-=b.PI2:w<-b.PI&&(w+=b.PI2);var M=Math.cos(w*=t),y=Math.sin(w);g.a=M*p-y*x,g.b=M*E-y*S,g.c=y*p+M*x,g.d=y*E+M*S,m=!0}if(0!=e){var I=this.temp;n.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),g.worldX+=I.x*e,g.worldY+=I.y*e,m=!0}if(r>0){var R=(Math.sqrt(i*i+o*o)-1+this.data.offsetScaleX)*r+1;g.a*=R,g.c*=R,R=(Math.sqrt(s*s+h*h)-1+this.data.offsetScaleY)*r+1,g.b*=R,g.d*=R,m=!0}if(a>0){var T=Math.atan2(h,s)-Math.atan2(o,i);T>b.PI?T-=b.PI2:T<-b.PI&&(T+=b.PI2);var A=g.b,k=g.d;T=Math.atan2(k,A)+(T-b.PI/2+c)*a;var V=Math.sqrt(A*A+k*k);g.b=Math.cos(T)*V,g.d=Math.sin(T)*V,m=!0}m&&(g.appliedValid=!1)}},e.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s<o;s++){var h=i[s];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;if(0!=t){var u=n.arotation-l+this.data.offsetRotation;u-=(16384-(16384.499999999996-u/360|0))*360,l+=u*t}var c=h.ax,f=h.ay;0!=e&&(c+=(n.ax-c+this.data.offsetX)*e,f+=(n.ay-f+this.data.offsetY)*e);var d=h.ascaleX,v=h.ascaleY;0!=r&&(d>1e-5&&(d=(d+(n.ascaleX-d+this.data.offsetScaleX)*r)/d),v>1e-5&&(v=(v+(n.ascaleY-v+this.data.offsetScaleY)*r)/v));var g=h.ashearY;if(0!=a){var m=n.ashearY-g+this.data.offsetShearY;m-=(16384-(16384.499999999996-m/360|0))*360,h.shearY+=m*a}h.updateWorldTransformWith(c,f,l,d,v,h.ashearX,g)}},e.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,a=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s<o;s++){var h=i[s];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;0!=t&&(l+=(n.arotation+this.data.offsetRotation)*t);var u=h.ax,c=h.ay;0!=e&&(u+=(n.ax+this.data.offsetX)*e,c+=(n.ay+this.data.offsetY)*e);var f=h.ascaleX,d=h.ascaleY;0!=r&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*r+1),d>1e-5&&(d*=(n.ascaleY-1+this.data.offsetScaleY)*r+1));var v=h.ashearY;0!=a&&(v+=(n.ashearY+this.data.offsetShearY)*a),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,v)}},t}(),tR=/*#__PURE__*/function(){function t(t){if(this._updateCache=[],this.updateCacheReset=[],this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw Error("data cannot be null.");this.data=t,this.bones=[];for(var e=0;e<t.bones.length;e++){var r=t.bones[e],a=void 0;if(null==r.parent)a=new td(r,this,null);else{var n=this.bones[r.parent.index];a=new td(r,this,n),n.children.push(a)}this.bones.push(a)}this.slots=[],this.drawOrder=[];for(var i=0;i<t.slots.length;i++){var s=t.slots[i],o=this.bones[s.boneData.index],h=new ty(s,o);this.slots.push(h),this.drawOrder.push(h)}this.ikConstraints=[];for(var l=0;l<t.ikConstraints.length;l++){var u=t.ikConstraints[l];this.ikConstraints.push(new tp(u,this))}this.transformConstraints=[];for(var c=0;c<t.transformConstraints.length;c++){var f=t.transformConstraints[c];this.transformConstraints.push(new tI(f,this))}this.pathConstraints=[];for(var d=0;d<t.pathConstraints.length;d++){var v=t.pathConstraints[d];this.pathConstraints.push(new tM(v,this))}this.color=new E(1,1,1,1),this.updateCache()}var e=t.prototype;return e.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,r=t.length;e<r;e++){var a=t[e];a.sorted=a.data.skinRequired,a.active=!a.sorted}if(null!=this.skin)for(var n=this.skin.bones,i=0,s=this.skin.bones.length;i<s;i++){var o=this.bones[n[i].index];do o.sorted=!1,o.active=!0,o=o.parent;while(null!=o)}var h=this.ikConstraints,l=this.transformConstraints,u=this.pathConstraints,c=h.length,f=l.length,d=u.length,v=c+f+d;t:for(var g=0;g<v;g++){for(var m=0;m<c;m++){var p=h[m];if(p.data.order==g){this.sortIkConstraint(p);continue t}}for(var E=0;E<f;E++){var b=l[E];if(b.data.order==g){this.sortTransformConstraint(b);continue t}}for(var x=0;x<d;x++){var S=u[x];if(S.data.order==g){this.sortPathConstraint(S);continue t}}}for(var w=0,M=t.length;w<M;w++)this.sortBone(t[w])},e.sortIkConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&S.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target;this.sortBone(e);var r=t.bones,a=r[0];if(this.sortBone(a),r.length>1){var n=r[r.length-1];this._updateCache.indexOf(n)>-1||this.updateCacheReset.push(n)}this._updateCache.push(t),this.sortReset(a.children),r[r.length-1].sorted=!0}},e.sortPathConstraint=function(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||null!=this.skin&&S.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target,a=e.data.index,n=e.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,a,n),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,a,n);for(var i=0,s=this.data.skins.length;i<s;i++)this.sortPathConstraintAttachment(this.data.skins[i],a,n);var o=e.getAttachment();r(o,ts)&&this.sortPathConstraintAttachmentWith(o,n);for(var h=t.bones,l=h.length,u=0;u<l;u++)this.sortBone(h[u]);this._updateCache.push(t);for(var c=0;c<l;c++)this.sortReset(h[c].children);for(var f=0;f<l;f++)h[f].sorted=!0}},e.sortTransformConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&S.contains(this.skin.constraints,t.data,!0)),t.active){this.sortBone(t.target);var e=t.bones,r=e.length;if(t.data.local)for(var a=0;a<r;a++){var n=e[a];this.sortBone(n.parent),this._updateCache.indexOf(n)>-1||this.updateCacheReset.push(n)}else for(var i=0;i<r;i++)this.sortBone(e[i]);this._updateCache.push(t);for(var s=0;s<r;s++)this.sortReset(e[s].children);for(var o=0;o<r;o++)e[o].sorted=!0}},e.sortPathConstraintAttachment=function(t,e,r){var a=t.attachments[e];if(a)for(var n in a)this.sortPathConstraintAttachmentWith(a[n],r)},e.sortPathConstraintAttachmentWith=function(t,e){if(r(t,ts)){var a=t.bones;if(null==a)this.sortBone(e);else for(var n=this.bones,i=0;i<a.length;)for(var s=a[i++],o=i+s;i<o;i++){var h=a[i];this.sortBone(n[h])}}},e.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},e.sortReset=function(t){for(var e=0,r=t.length;e<r;e++){var a=t[e];a.active&&(a.sorted&&this.sortReset(a.children),a.sorted=!1)}},e.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,r=t.length;e<r;e++){var a=t[e];a.ax=a.x,a.ay=a.y,a.arotation=a.rotation,a.ascaleX=a.scaleX,a.ascaleY=a.scaleY,a.ashearX=a.shearX,a.ashearY=a.shearY,a.appliedValid=!0}for(var n=this._updateCache,i=0,s=n.length;i<s;i++)n[i].update()},e.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},e.setBonesToSetupPose=function(){for(var t=this.bones,e=0,r=t.length;e<r;e++)t[e].setToSetupPose();for(var a=this.ikConstraints,n=0,i=a.length;n<i;n++){var s=a[n];s.mix=s.data.mix,s.softness=s.data.softness,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch}for(var o=this.transformConstraints,h=0,l=o.length;h<l;h++){var u=o[h],c=u.data;u.rotateMix=c.rotateMix,u.translateMix=c.translateMix,u.scaleMix=c.scaleMix,u.shearMix=c.shearMix}for(var f=this.pathConstraints,d=0,v=f.length;d<v;d++){var g=f[d],m=g.data;g.position=m.position,g.spacing=m.spacing,g.rotateMix=m.rotateMix,g.translateMix=m.translateMix}},e.setSlotsToSetupPose=function(){var t=this.slots;S.arrayCopy(t,0,this.drawOrder,0,t.length);for(var e=0,r=t.length;e<r;e++)t[e].setToSetupPose()},e.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},e.findBone=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findBoneIndex=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++)if(e[r].data.name==t)return r;return -1},e.findSlot=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findSlotIndex=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++)if(e[r].data.name==t)return r;return -1},e.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw Error("Skin not found: "+t);this.setSkin(e)},e.setSkin=function(t){if(t!=this.skin){if(null!=t){if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,r=0,a=e.length;r<a;r++){var n=e[r],i=n.data.attachmentName;if(null!=i){var s=t.getAttachment(r,i);null!=s&&n.setAttachment(s)}}}this.skin=t,this.updateCache()}},e.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},e.getAttachment=function(t,e){if(null==e)throw Error("attachmentName cannot be null.");if(null!=this.skin){var r=this.skin.getAttachment(t,e);if(null!=r)return r}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},e.setAttachment=function(t,e){if(null==t)throw Error("slotName cannot be null.");for(var r=this.slots,a=0,n=r.length;a<n;a++){var i=r[a];if(i.data.name==t){var s=null;if(null!=e&&null==(s=this.getAttachment(a,e)))throw Error("Attachment not found: "+e+", for slot: "+t);i.setAttachment(s);return}}throw Error("Slot not found: "+t)},e.findIkConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.ikConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findTransformConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.transformConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.findPathConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.pathConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.data.name==t)return n}return null},e.getBounds=function(t,e,a){if(void 0===a&&(a=[,,]),null==t)throw Error("offset cannot be null.");if(null==e)throw Error("size cannot be null.");for(var n=this.drawOrder,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=0,u=n.length;l<u;l++){var c=n[l];if(c.bone.active){var f=0,d=null,v=c.getAttachment();if(r(v,Q)?(f=8,d=S.setArraySize(a,f,0),v.computeWorldVertices(c.bone,d,0,2)):r(v,tn)&&(f=v.worldVerticesLength,d=S.setArraySize(a,f,0),v.computeWorldVertices(c,0,f,d,0,2)),null!=d)for(var g=0,m=d.length;g<m;g+=2){var p=d[g],E=d[g+1];i=Math.min(i,p),s=Math.min(s,E),o=Math.max(o,p),h=Math.max(h,E)}}}t.set(i,s),e.set(o-i,h-s)},e.update=function(t){this.time+=t},t}(),tT=/*#__PURE__*/function(){function t(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[],this.transformConstraints=[],this.pathConstraints=[],this.fps=0}var e=t.prototype;return e.findBone=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findBoneIndex=function(t){if(null==t)throw Error("boneName cannot be null.");for(var e=this.bones,r=0,a=e.length;r<a;r++)if(e[r].name==t)return r;return -1},e.findSlot=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findSlotIndex=function(t){if(null==t)throw Error("slotName cannot be null.");for(var e=this.slots,r=0,a=e.length;r<a;r++)if(e[r].name==t)return r;return -1},e.findSkin=function(t){if(null==t)throw Error("skinName cannot be null.");for(var e=this.skins,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findEvent=function(t){if(null==t)throw Error("eventDataName cannot be null.");for(var e=this.events,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findAnimation=function(t){if(null==t)throw Error("animationName cannot be null.");for(var e=this.animations,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findIkConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.ikConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findTransformConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.transformConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findPathConstraint=function(t){if(null==t)throw Error("constraintName cannot be null.");for(var e=this.pathConstraints,r=0,a=e.length;r<a;r++){var n=e[r];if(n.name==t)return n}return null},e.findPathConstraintIndex=function(t){if(null==t)throw Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,r=0,a=e.length;r<a;r++)if(e[r].name==t)return r;return -1},t}(),tA=function(t,e,r){if(this.color=new E(1,1,1,1),t<0)throw Error("index must be >= 0.");if(null==e)throw Error("name cannot be null.");if(null==r)throw Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=r},tk=/*#__PURE__*/function(t){function e(e){var r;return(r=t.call(this,e,0,!1)||this).bones=[],r.rotateMix=0,r.translateMix=0,r.scaleMix=0,r.shearMix=0,r.offsetRotation=0,r.offsetX=0,r.offsetY=0,r.offsetScaleX=0,r.offsetScaleY=0,r.offsetShearY=0,r.relative=!1,r.local=!1,r}return s(e,t),e}(tv),tV=function(t,e,r){this.slotIndex=t,this.name=e,this.attachment=r},tC=/*#__PURE__*/function(){function t(t){if(this.attachments=[],this.bones=[],this.constraints=[],null==t)throw Error("name cannot be null.");this.name=t}var e=t.prototype;return e.setAttachment=function(t,e,r){if(null==r)throw Error("attachment cannot be null.");var a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=r},e.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var r=t.bones[e],a=!1,n=0;n<this.bones.length;n++)if(this.bones[n]==r){a=!0;break}a||this.bones.push(r)}for(var i=0;i<t.constraints.length;i++){for(var s=t.constraints[i],o=!1,h=0;h<this.constraints.length;h++)if(this.constraints[h]==s){o=!0;break}o||this.constraints.push(s)}for(var l=t.getAttachments(),u=0;u<l.length;u++){var c=l[u];this.setAttachment(c.slotIndex,c.name,c.attachment)}},e.copySkin=function(t){for(var e=0;e<t.bones.length;e++){for(var a=t.bones[e],n=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==a){n=!0;break}n||this.bones.push(a)}for(var s=0;s<t.constraints.length;s++){for(var o=t.constraints[s],h=!1,l=0;l<this.constraints.length;l++)if(this.constraints[l]==o){h=!0;break}h||this.constraints.push(o)}for(var u=t.getAttachments(),c=0;c<u.length;c++){var f=u[c];null!=f.attachment&&(r(f.attachment,tn)?f.attachment=f.attachment.newLinkedMesh():f.attachment=f.attachment.copy(),this.setAttachment(f.slotIndex,f.name,f.attachment))}},e.getAttachment=function(t,e){var r=this.attachments[t];return r?r[e]:null},e.removeAttachment=function(t,e){var r=this.attachments[t];r&&(r[e]=null)},e.getAttachments=function(){for(var t=[],e=0;e<this.attachments.length;e++){var r=this.attachments[e];if(r)for(var a in r){var n=r[a];n&&t.push(new tV(e,a,n))}}return t},e.getAttachmentsForSlot=function(t,e){var r=this.attachments[t];if(r)for(var a in r){var n=r[a];n&&e.push(new tV(t,a,n))}},e.clear=function(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0},e.attachAll=function(t,e){for(var r=0,a=0;a<t.slots.length;a++){var n=t.slots[a],i=n.getAttachment();if(i&&r<e.attachments.length){var s=e.attachments[r];for(var o in s)if(i==s[o]){var h=this.getAttachment(r,o);null!=h&&n.setAttachment(h);break}}r++}},t}(),tP=((m={})[m.Region=0]="Region",m[m.BoundingBox=1]="BoundingBox",m[m.Mesh=2]="Mesh",m[m.LinkedMesh=3]="LinkedMesh",m[m.Path=4]="Path",m[m.Point=5]="Point",m[m.Clipping=6]="Clipping",m),tF=/*#__PURE__*/function(){function t(t){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=t}var e=t.prototype;return e.readSkeletonData=function(e){var r=this.scale,a=new tT;a.name="";var n=new tN(e);if(a.hash=n.readString(),a.version=n.readString(),"3.8.75"==a.version)throw Error("Unsupported skeleton data, please export with a newer version of Spine.");a.x=n.readFloat(),a.y=n.readFloat(),a.width=n.readFloat(),a.height=n.readFloat();var i=n.readBoolean();i&&(a.fps=n.readFloat(),a.imagesPath=n.readString(),a.audioPath=n.readString());var s=0;s=n.readInt(!0);for(var o=0;o<s;o++)n.strings.push(n.readString());s=n.readInt(!0);for(var h=0;h<s;h++){var l=n.readString(),u=0==h?null:a.bones[n.readInt(!0)],c=new tc(h,l,u);c.rotation=n.readFloat(),c.x=n.readFloat()*r,c.y=n.readFloat()*r,c.scaleX=n.readFloat(),c.scaleY=n.readFloat(),c.shearX=n.readFloat(),c.shearY=n.readFloat(),c.length=n.readFloat()*r,c.transformMode=t.TransformModeValues[n.readInt(!0)],c.skinRequired=n.readBoolean(),i&&E.rgba8888ToColor(c.color,n.readInt32()),a.bones.push(c)}s=n.readInt(!0);for(var f=0;f<s;f++){var d=new tA(f,n.readString(),a.bones[n.readInt(!0)]);E.rgba8888ToColor(d.color,n.readInt32());var v=n.readInt32();-1!=v&&E.rgb888ToColor(d.darkColor=new E,v),d.attachmentName=n.readStringRef(),d.blendMode=t.BlendModeValues[n.readInt(!0)],a.slots.push(d)}s=n.readInt(!0);for(var g,m=0;m<s;m++){var p=new tE(n.readString());p.order=n.readInt(!0),p.skinRequired=n.readBoolean(),g=n.readInt(!0);for(var b=0;b<g;b++)p.bones.push(a.bones[n.readInt(!0)]);p.target=a.bones[n.readInt(!0)],p.mix=n.readFloat(),p.softness=n.readFloat()*r,p.bendDirection=n.readByte(),p.compress=n.readBoolean(),p.stretch=n.readBoolean(),p.uniform=n.readBoolean(),a.ikConstraints.push(p)}s=n.readInt(!0);for(var x,w=0;w<s;w++){var M=new tk(n.readString());M.order=n.readInt(!0),M.skinRequired=n.readBoolean(),x=n.readInt(!0);for(var y=0;y<x;y++)M.bones.push(a.bones[n.readInt(!0)]);M.target=a.bones[n.readInt(!0)],M.local=n.readBoolean(),M.relative=n.readBoolean(),M.offsetRotation=n.readFloat(),M.offsetX=n.readFloat()*r,M.offsetY=n.readFloat()*r,M.offsetScaleX=n.readFloat(),M.offsetScaleY=n.readFloat(),M.offsetShearY=n.readFloat(),M.rotateMix=n.readFloat(),M.translateMix=n.readFloat(),M.scaleMix=n.readFloat(),M.shearMix=n.readFloat(),a.transformConstraints.push(M)}s=n.readInt(!0);for(var I,R=0;R<s;R++){var T=new tb(n.readString());T.order=n.readInt(!0),T.skinRequired=n.readBoolean(),I=n.readInt(!0);for(var A=0;A<I;A++)T.bones.push(a.bones[n.readInt(!0)]);T.target=a.slots[n.readInt(!0)],T.positionMode=t.PositionModeValues[n.readInt(!0)],T.spacingMode=t.SpacingModeValues[n.readInt(!0)],T.rotateMode=t.RotateModeValues[n.readInt(!0)],T.offsetRotation=n.readFloat(),T.position=n.readFloat(),T.positionMode==tx.Fixed&&(T.position*=r),T.spacing=n.readFloat(),(T.spacingMode==tS.Length||T.spacingMode==tS.Fixed)&&(T.spacing*=r),T.rotateMix=n.readFloat(),T.translateMix=n.readFloat(),a.pathConstraints.push(T)}var k=this.readSkin(n,a,!0,i);null!=k&&(a.defaultSkin=k,a.skins.push(k));var V=a.skins.length;for(S.setArraySize(a.skins,s=V+n.readInt(!0));V<s;V++)a.skins[V]=this.readSkin(n,a,!1,i);s=this.linkedMeshes.length;for(var C=0;C<s;C++){var P=this.linkedMeshes[C],F=null==P.skin?a.defaultSkin:a.findSkin(P.skin);if(null==F)throw Error("Skin not found: "+P.skin);var N=F.getAttachment(P.slotIndex,P.parent);if(null==N)throw Error("Parent mesh not found: "+P.parent);P.mesh.deformAttachment=P.inheritDeform?N:P.mesh,P.mesh.setParentMesh(N),P.mesh.updateUVs()}this.linkedMeshes.length=0,s=n.readInt(!0);for(var _=0;_<s;_++){var Y=new tm(n.readStringRef());Y.intValue=n.readInt(!1),Y.floatValue=n.readFloat(),Y.stringValue=n.readString(),Y.audioPath=n.readString(),null!=Y.audioPath&&(Y.volume=n.readFloat(),Y.balance=n.readFloat()),a.events.push(Y)}s=n.readInt(!0);for(var X=0;X<s;X++)a.animations.push(this.readAnimation(n,n.readString(),a));return a},e.readSkin=function(t,e,r,a){var n=null,i=0;if(r){if(0==(i=t.readInt(!0)))return null;n=new tC("default")}else{(n=new tC(t.readStringRef())).bones.length=t.readInt(!0);for(var s=0,o=n.bones.length;s<o;s++)n.bones[s]=e.bones[t.readInt(!0)];for(var h=0,l=t.readInt(!0);h<l;h++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(var u=0,c=t.readInt(!0);u<c;u++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(var f=0,d=t.readInt(!0);f<d;f++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);i=t.readInt(!0)}for(var v=0;v<i;v++)for(var g=t.readInt(!0),m=0,p=t.readInt(!0);m<p;m++){var E=t.readStringRef(),b=this.readAttachment(t,e,n,g,E,a);null!=b&&n.setAttachment(g,E,b)}return n},e.readAttachment=function(e,r,a,n,i,s){var o=this.scale,h=e.readStringRef();null==h&&(h=i);var l=e.readByte();switch(t.AttachmentTypeValues[l]){case tP.Region:var u=e.readStringRef(),c=e.readFloat(),f=e.readFloat(),d=e.readFloat(),v=e.readFloat(),g=e.readFloat(),m=e.readFloat(),p=e.readFloat(),b=e.readInt32();null==u&&(u=h);var x=this.attachmentLoader.newRegionAttachment(a,h,u);if(null==x)break;return x.path=u,x.x=f*o,x.y=d*o,x.scaleX=v,x.scaleY=g,x.rotation=c,x.width=m*o,x.height=p*o,E.rgba8888ToColor(x.color,b),x.updateOffset(),x;case tP.BoundingBox:var w=e.readInt(!0),M=this.readVertices(e,w),y=s?e.readInt32():0,I=this.attachmentLoader.newBoundingBoxAttachment(a,h);if(null==I)break;return I.worldVerticesLength=w<<1,I.vertices=M.vertices,I.bones=M.bones,s&&E.rgba8888ToColor(I.color,y),I;case tP.Mesh:var R=e.readStringRef(),T=e.readInt32(),A=e.readInt(!0),k=this.readFloatArray(e,A<<1,1),V=this.readShortArray(e),C=this.readVertices(e,A),P=e.readInt(!0),F=null,N=0,_=0;s&&(F=this.readShortArray(e),N=e.readFloat(),_=e.readFloat()),null==R&&(R=h);var Y=this.attachmentLoader.newMeshAttachment(a,h,R);if(null==Y)break;return Y.path=R,E.rgba8888ToColor(Y.color,T),Y.bones=C.bones,Y.vertices=C.vertices,Y.worldVerticesLength=A<<1,Y.triangles=V,Y.regionUVs=k,Y.updateUVs(),Y.hullLength=P<<1,s&&(Y.edges=F,Y.width=N*o,Y.height=_*o),Y;case tP.LinkedMesh:var X=e.readStringRef(),O=e.readInt32(),L=e.readStringRef(),D=e.readStringRef(),B=e.readBoolean(),W=0,q=0;s&&(W=e.readFloat(),q=e.readFloat()),null==X&&(X=h);var U=this.attachmentLoader.newMeshAttachment(a,h,X);if(null==U)break;return U.path=X,E.rgba8888ToColor(U.color,O),s&&(U.width=W*o,U.height=q*o),this.linkedMeshes.push(new t_(U,L,n,D,B)),U;case tP.Path:for(var H=e.readBoolean(),G=e.readBoolean(),j=e.readInt(!0),z=this.readVertices(e,j),Z=S.newArray(j/3,0),Q=0,K=Z.length;Q<K;Q++)Z[Q]=e.readFloat()*o;var J=s?e.readInt32():0,$=this.attachmentLoader.newPathAttachment(a,h);if(null==$)break;return $.closed=H,$.constantSpeed=G,$.worldVerticesLength=j<<1,$.vertices=z.vertices,$.bones=z.bones,$.lengths=Z,s&&E.rgba8888ToColor($.color,J),$;case tP.Point:var tt=e.readFloat(),te=e.readFloat(),tr=e.readFloat(),ta=s?e.readInt32():0,tn=this.attachmentLoader.newPointAttachment(a,h);if(null==tn)break;return tn.x=te*o,tn.y=tr*o,tn.rotation=tt,s&&E.rgba8888ToColor(tn.color,ta),tn;case tP.Clipping:var ti=e.readInt(!0),ts=e.readInt(!0),to=this.readVertices(e,ts),th=s?e.readInt32():0,tl=this.attachmentLoader.newClippingAttachment(a,h);if(null==tl)break;return tl.endSlot=r.slots[ti],tl.worldVerticesLength=ts<<1,tl.vertices=to.vertices,tl.bones=to.bones,s&&E.rgba8888ToColor(tl.color,th),tl}return null},e.readVertices=function(t,e){var r=new tY,a=this.scale;if(!t.readBoolean())return r.vertices=this.readFloatArray(t,e<<1,a),r;for(var n=[],i=[],s=0;s<e;s++){var o=t.readInt(!0);i.push(o);for(var h=0;h<o;h++)i.push(t.readInt(!0)),n.push(t.readFloat()*a),n.push(t.readFloat()*a),n.push(t.readFloat())}return r.vertices=S.toFloatArray(n),r.bones=i,r},e.readFloatArray=function(t,e,r){var a=Array(e);if(1==r)for(var n=0;n<e;n++)a[n]=t.readFloat();else for(var i=0;i<e;i++)a[i]=t.readFloat()*r;return a},e.readShortArray=function(t){for(var e=t.readInt(!0),r=Array(e),a=0;a<e;a++)r[a]=t.readShort();return r},e.readAnimation=function(e,r,a){for(var n=[],i=this.scale,s=0,o=new E,h=new E,l=0,u=e.readInt(!0);l<u;l++)for(var c=e.readInt(!0),f=0,d=e.readInt(!0);f<d;f++){var v=e.readByte(),g=e.readInt(!0);switch(v){case t.SLOT_ATTACHMENT:var m=new Y(g);m.slotIndex=c;for(var p=0;p<g;p++)m.setFrame(p,e.readFloat(),e.readStringRef());n.push(m),s=Math.max(s,m.frames[g-1]);break;case t.SLOT_COLOR:var b=new N(g);b.slotIndex=c;for(var x=0;x<g;x++){var w=e.readFloat();E.rgba8888ToColor(o,e.readInt32()),b.setFrame(x,w,o.r,o.g,o.b,o.a),x<g-1&&this.readCurve(e,x,b)}n.push(b),s=Math.max(s,b.frames[(g-1)*N.ENTRIES]);break;case t.SLOT_TWO_COLOR:var M=new _(g);M.slotIndex=c;for(var y=0;y<g;y++){var I=e.readFloat();E.rgba8888ToColor(o,e.readInt32()),E.rgb888ToColor(h,e.readInt32()),M.setFrame(y,I,o.r,o.g,o.b,o.a,h.r,h.g,h.b),y<g-1&&this.readCurve(e,y,M)}n.push(M),s=Math.max(s,M.frames[(g-1)*_.ENTRIES])}}for(var T=0,A=e.readInt(!0);T<A;T++)for(var k=e.readInt(!0),X=0,G=e.readInt(!0);X<G;X++){var j=e.readByte(),z=e.readInt(!0);switch(j){case t.BONE_ROTATE:var Z=new V(z);Z.boneIndex=k;for(var Q=0;Q<z;Q++)Z.setFrame(Q,e.readFloat(),e.readFloat()),Q<z-1&&this.readCurve(e,Q,Z);n.push(Z),s=Math.max(s,Z.frames[(z-1)*V.ENTRIES]);break;case t.BONE_TRANSLATE:case t.BONE_SCALE:case t.BONE_SHEAR:var K=void 0,J=1;j==t.BONE_SCALE?K=new P(z):j==t.BONE_SHEAR?K=new F(z):(K=new C(z),J=i),K.boneIndex=k;for(var $=0;$<z;$++)K.setFrame($,e.readFloat(),e.readFloat()*J,e.readFloat()*J),$<z-1&&this.readCurve(e,$,K);n.push(K),s=Math.max(s,K.frames[(z-1)*C.ENTRIES])}}for(var tt=0,te=e.readInt(!0);tt<te;tt++){var tr=e.readInt(!0),ta=e.readInt(!0),tn=new B(ta);tn.ikConstraintIndex=tr;for(var ti=0;ti<ta;ti++)tn.setFrame(ti,e.readFloat(),e.readFloat(),e.readFloat()*i,e.readByte(),e.readBoolean(),e.readBoolean()),ti<ta-1&&this.readCurve(e,ti,tn);n.push(tn),s=Math.max(s,tn.frames[(ta-1)*B.ENTRIES])}for(var ts=0,to=e.readInt(!0);ts<to;ts++){var th=e.readInt(!0),tl=e.readInt(!0),tu=new W(tl);tu.transformConstraintIndex=th;for(var tc=0;tc<tl;tc++)tu.setFrame(tc,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat()),tc<tl-1&&this.readCurve(e,tc,tu);n.push(tu),s=Math.max(s,tu.frames[(tl-1)*W.ENTRIES])}for(var tf=0,td=e.readInt(!0);tf<td;tf++)for(var tv=e.readInt(!0),tm=a.pathConstraints[tv],tp=0,tE=e.readInt(!0);tp<tE;tp++){var tb=e.readByte(),tw=e.readInt(!0);switch(tb){case t.PATH_POSITION:case t.PATH_SPACING:var tM=void 0,ty=1;tb==t.PATH_SPACING?(tM=new U(tw),(tm.spacingMode==tS.Length||tm.spacingMode==tS.Fixed)&&(ty=i)):(tM=new q(tw),tm.positionMode==tx.Fixed&&(ty=i)),tM.pathConstraintIndex=tv;for(var tI=0;tI<tw;tI++)tM.setFrame(tI,e.readFloat(),e.readFloat()*ty),tI<tw-1&&this.readCurve(e,tI,tM);n.push(tM),s=Math.max(s,tM.frames[(tw-1)*q.ENTRIES]);break;case t.PATH_MIX:var tR=new H(tw);tR.pathConstraintIndex=tv;for(var tT=0;tT<tw;tT++)tR.setFrame(tT,e.readFloat(),e.readFloat(),e.readFloat()),tT<tw-1&&this.readCurve(e,tT,tR);n.push(tR),s=Math.max(s,tR.frames[(tw-1)*H.ENTRIES])}}for(var tA=0,tk=e.readInt(!0);tA<tk;tA++)for(var tV=a.skins[e.readInt(!0)],tC=0,tP=e.readInt(!0);tC<tP;tC++)for(var tF=e.readInt(!0),tN=0,t_=e.readInt(!0);tN<t_;tN++){var tY=tV.getAttachment(tF,e.readStringRef()),tX=null!=tY.bones,tO=tY.vertices,tL=tX?tO.length/3*2:tO.length,tD=e.readInt(!0),tB=new O(tD);tB.slotIndex=tF,tB.attachment=tY;for(var tW=0;tW<tD;tW++){var tq=e.readFloat(),tU=void 0,tH=e.readInt(!0);if(0==tH)tU=tX?S.newFloatArray(tL):tO;else{tU=S.newFloatArray(tL);var tG=e.readInt(!0);if(tH+=tG,1==i)for(var tj=tG;tj<tH;tj++)tU[tj]=e.readFloat();else for(var tz=tG;tz<tH;tz++)tU[tz]=e.readFloat()*i;if(!tX)for(var tZ=0,tQ=tU.length;tZ<tQ;tZ++)tU[tZ]+=tO[tZ]}tB.setFrame(tW,tq,tU),tW<tD-1&&this.readCurve(e,tW,tB)}n.push(tB),s=Math.max(s,tB.frames[tD-1])}var tK=e.readInt(!0);if(tK>0){for(var tJ=new D(tK),t$=a.slots.length,t0=0;t0<tK;t0++){for(var t1=e.readFloat(),t2=e.readInt(!0),t3=S.newArray(t$,0),t9=t$-1;t9>=0;t9--)t3[t9]=-1;for(var t6=S.newArray(t$-t2,0),t8=0,t4=0,t5=0;t5<t2;t5++){for(var t7=e.readInt(!0);t8!=t7;)t6[t4++]=t8++;t3[t8+e.readInt(!0)]=t8++}for(;t8<t$;)t6[t4++]=t8++;for(var et=t$-1;et>=0;et--)-1==t3[et]&&(t3[et]=t6[--t4]);tJ.setFrame(t0,t1,t3)}n.push(tJ),s=Math.max(s,tJ.frames[tK-1])}var ee=e.readInt(!0);if(ee>0){for(var er=new L(ee),ea=0;ea<ee;ea++){var en=e.readFloat(),ei=a.events[e.readInt(!0)],es=new tg(en,ei);es.intValue=e.readInt(!1),es.floatValue=e.readFloat(),es.stringValue=e.readBoolean()?e.readString():ei.stringValue,null!=es.data.audioPath&&(es.volume=e.readFloat(),es.balance=e.readFloat()),er.setFrame(ea,es)}n.push(er),s=Math.max(s,er.frames[ee-1])}return new R(r,n,s)},e.readCurve=function(e,r,a){switch(e.readByte()){case t.CURVE_STEPPED:a.setStepped(r);break;case t.CURVE_BEZIER:this.setCurve(a,r,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat())}},e.setCurve=function(t,e,r,a,n,i){t.setCurve(e,r,a,n,i)},t}();tF.AttachmentTypeValues=[0,1,2,3,4,5,6],tF.TransformModeValues=[tf.Normal,tf.OnlyTranslation,tf.NoRotationOrReflection,tf.NoScale,tf.NoScaleOrReflection],tF.PositionModeValues=[tx.Fixed,tx.Percent],tF.SpacingModeValues=[tS.Length,tS.Fixed,tS.Percent],tF.RotateModeValues=[tw.Tangent,tw.Chain,tw.ChainScale],tF.BlendModeValues=[tu.Normal,tu.Additive,tu.Multiply,tu.Screen],tF.BONE_ROTATE=0,tF.BONE_TRANSLATE=1,tF.BONE_SCALE=2,tF.BONE_SHEAR=3,tF.SLOT_ATTACHMENT=0,tF.SLOT_COLOR=1,tF.SLOT_TWO_COLOR=2,tF.PATH_POSITION=0,tF.PATH_SPACING=1,tF.PATH_MIX=2,tF.CURVE_LINEAR=0,tF.CURVE_STEPPED=1,tF.CURVE_BEZIER=2;var tN=/*#__PURE__*/function(){function t(t,e,r,a){void 0===e&&(e=[]),void 0===r&&(r=0),void 0===a&&(a=new DataView(t.buffer)),this.strings=e,this.index=r,this.buffer=a}var e=t.prototype;return e.readByte=function(){return this.buffer.getInt8(this.index++)},e.readShort=function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t},e.readInt32=function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t},e.readInt=function(t){var e=this.readByte(),r=127&e;return(128&e)!=0&&(r|=(127&(e=this.readByte()))<<7,(128&e)!=0&&(r|=(127&(e=this.readByte()))<<14,(128&e)!=0&&(r|=(127&(e=this.readByte()))<<21,(128&e)!=0&&(r|=(127&(e=this.readByte()))<<28)))),t?r:r>>>1^-(1&r)},e.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",r=0;r<t;){var a=this.readByte();switch(a>>4){case 12:case 13:e+=String.fromCharCode((31&a)<<6|63&this.readByte()),r+=2;break;case 14:e+=String.fromCharCode((15&a)<<12|(63&this.readByte())<<6|63&this.readByte()),r+=3;break;default:e+=String.fromCharCode(a),r++}}return e},e.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.readBoolean=function(){return 0!=this.readByte()},t}(),t_=function(t,e,r,a,n){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=a,this.inheritDeform=n},tY=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e},tX=/*#__PURE__*/function(){function t(){this.convexPolygons=[],this.convexPolygonsIndices=[],this.indicesArray=[],this.isConcaveArray=[],this.triangles=[],this.polygonPool=new w(function(){return[]}),this.polygonIndicesPool=new w(function(){return[]})}var e=t.prototype;return e.triangulate=function(e){var r=e.length>>1,a=this.indicesArray;a.length=0;for(var n=0;n<r;n++)a[n]=n;var i=this.isConcaveArray;i.length=0;for(var s=0,o=r;s<o;++s)i[s]=t.isConcave(s,r,e,a);var h=this.triangles;for(h.length=0;r>3;){for(var l=r-1,u=0,c=1;;){t:if(!i[u]){for(var f=a[l]<<1,d=a[u]<<1,v=a[c]<<1,g=e[f],m=e[f+1],p=e[d],E=e[d+1],b=e[v],x=e[v+1],S=(c+1)%r;S!=l;S=(S+1)%r)if(i[S]){var w=a[S]<<1,M=e[w],y=e[w+1];if(t.positiveArea(b,x,g,m,M,y)&&t.positiveArea(g,m,p,E,M,y)&&t.positiveArea(p,E,b,x,M,y))break t}break}if(0==c){do{if(!i[u])break;u--}while(u>0);break}l=u,u=c,c=(c+1)%r}h.push(a[(r+u-1)%r]),h.push(a[u]),h.push(a[(u+1)%r]),a.splice(u,1),i.splice(u,1);var I=(--r+u-1)%r,R=u==r?0:u;i[I]=t.isConcave(I,r,e,a),i[R]=t.isConcave(R,r,e,a)}return 3==r&&(h.push(a[2]),h.push(a[0]),h.push(a[1])),h},e.decompose=function(e,r){var a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;var i=this.polygonIndicesPool.obtain();i.length=0;var s=this.polygonPool.obtain();s.length=0;for(var o=-1,h=0,l=0,u=r.length;l<u;l+=3){var c=r[l]<<1,f=r[l+1]<<1,d=r[l+2]<<1,v=e[c],g=e[c+1],m=e[f],p=e[f+1],E=e[d],b=e[d+1],x=!1;if(o==c){var S=s.length-4,w=t.winding(s[S],s[S+1],s[S+2],s[S+3],E,b),M=t.winding(E,b,s[0],s[1],s[2],s[3]);w==h&&M==h&&(s.push(E),s.push(b),i.push(d),x=!0)}x||(s.length>0?(a.push(s),n.push(i)):(this.polygonPool.free(s),this.polygonIndicesPool.free(i)),(s=this.polygonPool.obtain()).length=0,s.push(v),s.push(g),s.push(m),s.push(p),s.push(E),s.push(b),(i=this.polygonIndicesPool.obtain()).length=0,i.push(c),i.push(f),i.push(d),h=t.winding(v,g,m,p,E,b),o=c)}s.length>0&&(a.push(s),n.push(i));for(var y=0,I=a.length;y<I;y++)if(0!=(i=n[y]).length){for(var R=i[0],T=i[i.length-1],A=(s=a[y]).length-4,k=s[A],V=s[A+1],C=s[A+2],P=s[A+3],F=s[0],N=s[1],_=s[2],Y=s[3],X=t.winding(k,V,C,P,F,N),O=0;O<I;O++)if(O!=y){var L=n[O];if(3==L.length){var D=L[0],B=L[1],W=L[2],q=a[O],U=q[q.length-2],H=q[q.length-1];if(D==R&&B==T){var G=t.winding(k,V,C,P,U,H),j=t.winding(U,H,F,N,_,Y);G==X&&j==X&&(q.length=0,L.length=0,s.push(U),s.push(H),i.push(W),k=C,V=P,C=U,P=H,O=0)}}}}for(var z=a.length-1;z>=0;z--)0==(s=a[z]).length&&(a.splice(z,1),this.polygonPool.free(s),i=n[z],n.splice(z,1),this.polygonIndicesPool.free(i));return a},t.isConcave=function(t,e,r,a){var n=a[(e+t-1)%e]<<1,i=a[t]<<1,s=a[(t+1)%e]<<1;return!this.positiveArea(r[n],r[n+1],r[i],r[i+1],r[s],r[s+1])},t.positiveArea=function(t,e,r,a,n,i){return t*(i-a)+r*(e-i)+n*(a-e)>=0},t.winding=function(t,e,r,a,n,i){var s=r-t,o=a-e;return n*o-i*s+s*e-t*o>=0?1:-1},t}(),tO=/*#__PURE__*/function(){function t(){this.triangulator=new tX,this.clippingPolygon=[],this.clipOutput=[],this.clippedVertices=[],this.clippedTriangles=[],this.scratch=[]}var e=t.prototype;return e.clipStart=function(e,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,n=S.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(e,0,a,n,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o<h;o++){var l=s[o];t.makeClockwise(l),l.push(l[0]),l.push(l[1])}return s.length},e.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},e.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},e.isClipping=function(){return null!=this.clipAttachment},e.clipTriangles=function(t,e,r,a,n,i,s,o){var h=this.clipOutput,l=this.clippedVertices,u=this.clippedTriangles,c=this.clippingPolygons,f=this.clippingPolygons.length,d=o?12:8,v=0;l.length=0,u.length=0;t:for(var g=0;g<a;g+=3)for(var m=r[g]<<1,p=t[m],E=t[m+1],b=n[m],x=n[m+1],w=t[m=r[g+1]<<1],M=t[m+1],y=n[m],I=n[m+1],R=t[m=r[g+2]<<1],T=t[m+1],A=n[m],k=n[m+1],V=0;V<f;V++){var C=l.length;if(this.clip(p,E,w,M,R,T,c[V],h)){var P=h.length;if(0==P)continue;for(var F=M-T,N=R-w,_=p-R,Y=T-E,X=1/(F*_+N*(E-T)),O=P>>1,L=this.clipOutput,D=S.setArraySize(l,C+O*d),B=0;B<P;B+=2){var W=L[B],q=L[B+1];D[C]=W,D[C+1]=q,D[C+2]=i.r,D[C+3]=i.g,D[C+4]=i.b,D[C+5]=i.a;var U=W-R,H=q-T,G=(F*U+N*H)*X,j=(Y*U+_*H)*X,z=1-G-j;D[C+6]=b*G+y*j+A*z,D[C+7]=x*G+I*j+k*z,o&&(D[C+8]=s.r,D[C+9]=s.g,D[C+10]=s.b,D[C+11]=s.a),C+=d}C=u.length;var Z=S.setArraySize(u,C+3*(O-2));O--;for(var Q=1;Q<O;Q++)Z[C]=v,Z[C+1]=v+Q,Z[C+2]=v+Q+1,C+=3;v+=O+1}else{var K=S.setArraySize(l,C+3*d);K[C]=p,K[C+1]=E,K[C+2]=i.r,K[C+3]=i.g,K[C+4]=i.b,K[C+5]=i.a,o?(K[C+6]=b,K[C+7]=x,K[C+8]=s.r,K[C+9]=s.g,K[C+10]=s.b,K[C+11]=s.a,K[C+12]=w,K[C+13]=M,K[C+14]=i.r,K[C+15]=i.g,K[C+16]=i.b,K[C+17]=i.a,K[C+18]=y,K[C+19]=I,K[C+20]=s.r,K[C+21]=s.g,K[C+22]=s.b,K[C+23]=s.a,K[C+24]=R,K[C+25]=T,K[C+26]=i.r,K[C+27]=i.g,K[C+28]=i.b,K[C+29]=i.a,K[C+30]=A,K[C+31]=k,K[C+32]=s.r,K[C+33]=s.g,K[C+34]=s.b,K[C+35]=s.a):(K[C+6]=b,K[C+7]=x,K[C+8]=w,K[C+9]=M,K[C+10]=i.r,K[C+11]=i.g,K[C+12]=i.b,K[C+13]=i.a,K[C+14]=y,K[C+15]=I,K[C+16]=R,K[C+17]=T,K[C+18]=i.r,K[C+19]=i.g,K[C+20]=i.b,K[C+21]=i.a,K[C+22]=A,K[C+23]=k),C=u.length;var J=S.setArraySize(u,C+3);J[C]=v,J[C+1]=v+1,J[C+2]=v+2,v+=3;continue t}}},e.clip=function(t,e,r,a,n,i,s,o){var h=o,l=!1,u=null;s.length%4>=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(r),u.push(a),u.push(n),u.push(i),u.push(t),u.push(e),o.length=0;for(var c=s.length-4,f=0;;f+=2){for(var d=s[f],v=s[f+1],g=s[f+2],m=s[f+3],p=d-g,E=v-m,b=u,x=u.length-2,S=o.length,w=0;w<x;w+=2){var M=b[w],y=b[w+1],I=b[w+2],R=b[w+3],T=p*(R-m)-E*(I-g)>0;if(p*(y-m)-E*(M-g)>0){if(T){o.push(I),o.push(R);continue}var A=R-y,k=I-M,V=A*(g-d)-k*(m-v);if(Math.abs(V)>1e-6){var C=(k*(v-y)-A*(d-M))/V;o.push(d+(g-d)*C),o.push(v+(m-v)*C)}else o.push(d),o.push(v)}else if(T){var P=R-y,F=I-M,N=P*(g-d)-F*(m-v);if(Math.abs(N)>1e-6){var _=(F*(v-y)-P*(d-M))/N;o.push(d+(g-d)*_),o.push(v+(m-v)*_)}else o.push(d),o.push(v);o.push(I),o.push(R)}l=!0}if(S==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==c)break;var Y=o;(o=u).length=0,u=Y}if(h!=o){h.length=0;for(var X=0,O=o.length-2;X<O;X++)h[X]=o[X]}else h.length=h.length-2;return l},t.makeClockwise=function(t){for(var e=t.length,r=t[e-2]*t[1]-t[0]*t[e-1],a=0,n=0,i=0,s=0,o=e-3;s<o;s+=2)a=t[s],n=t[s+1],i=t[s+2],r+=a*t[s+3]-i*n;if(!(r<0))for(var h=0,l=e-2,u=e>>1;h<u;h+=2){var c=t[h],f=t[h+1],d=l-h;t[h]=t[d],t[h+1]=t[d+1],t[d]=c,t[d+1]=f}},t}(),tL=/*#__PURE__*/function(){function t(t){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=t}var e=t.prototype;return e.readSkeletonData=function(e){var r=this.scale,a=new tT,n="string"==typeof e?JSON.parse(e):e,i=n.skeleton;if(null!=i){if(a.hash=i.hash,a.version=i.spine,"3.8.75"==a.version)throw Error("Unsupported skeleton data, please export with a newer version of Spine.");a.x=i.x,a.y=i.y,a.width=i.width,a.height=i.height,a.fps=i.fps,a.imagesPath=i.images}if(n.bones)for(var s=0;s<n.bones.length;s++){var o=n.bones[s],h=null,l=this.getValue(o,"parent",null);if(null!=l&&null==(h=a.findBone(l)))throw Error("Parent bone not found: "+l);var u=new tc(a.bones.length,o.name,h);u.length=this.getValue(o,"length",0)*r,u.x=this.getValue(o,"x",0)*r,u.y=this.getValue(o,"y",0)*r,u.rotation=this.getValue(o,"rotation",0),u.scaleX=this.getValue(o,"scaleX",1),u.scaleY=this.getValue(o,"scaleY",1),u.shearX=this.getValue(o,"shearX",0),u.shearY=this.getValue(o,"shearY",0),u.transformMode=t.transformModeFromString(this.getValue(o,"transform","normal")),u.skinRequired=this.getValue(o,"skin",!1),a.bones.push(u)}if(n.slots)for(var c=0;c<n.slots.length;c++){var f=n.slots[c],d=f.name,v=f.bone,g=a.findBone(v);if(null==g)throw Error("Slot bone not found: "+v);var m=new tA(a.slots.length,d,g),p=this.getValue(f,"color",null);null!=p&&m.color.setFromString(p);var b=this.getValue(f,"dark",null);null!=b&&(m.darkColor=new E(1,1,1,1),m.darkColor.setFromString(b)),m.attachmentName=this.getValue(f,"attachment",null),m.blendMode=t.blendModeFromString(this.getValue(f,"blend","normal")),a.slots.push(m)}if(n.ik)for(var x=0;x<n.ik.length;x++){var S=n.ik[x],w=new tE(S.name);w.order=this.getValue(S,"order",0),w.skinRequired=this.getValue(S,"skin",!1);for(var M=0;M<S.bones.length;M++){var y=S.bones[M],I=a.findBone(y);if(null==I)throw Error("IK bone not found: "+y);w.bones.push(I)}var R=S.target;if(w.target=a.findBone(R),null==w.target)throw Error("IK target bone not found: "+R);w.mix=this.getValue(S,"mix",1),w.softness=this.getValue(S,"softness",0)*r,w.bendDirection=this.getValue(S,"bendPositive",!0)?1:-1,w.compress=this.getValue(S,"compress",!1),w.stretch=this.getValue(S,"stretch",!1),w.uniform=this.getValue(S,"uniform",!1),a.ikConstraints.push(w)}if(n.transform)for(var T=0;T<n.transform.length;T++){var A=n.transform[T],k=new tk(A.name);k.order=this.getValue(A,"order",0),k.skinRequired=this.getValue(A,"skin",!1);for(var V=0;V<A.bones.length;V++){var C=A.bones[V],P=a.findBone(C);if(null==P)throw Error("Transform constraint bone not found: "+C);k.bones.push(P)}var F=A.target;if(k.target=a.findBone(F),null==k.target)throw Error("Transform constraint target bone not found: "+F);k.local=this.getValue(A,"local",!1),k.relative=this.getValue(A,"relative",!1),k.offsetRotation=this.getValue(A,"rotation",0),k.offsetX=this.getValue(A,"x",0)*r,k.offsetY=this.getValue(A,"y",0)*r,k.offsetScaleX=this.getValue(A,"scaleX",0),k.offsetScaleY=this.getValue(A,"scaleY",0),k.offsetShearY=this.getValue(A,"shearY",0),k.rotateMix=this.getValue(A,"rotateMix",1),k.translateMix=this.getValue(A,"translateMix",1),k.scaleMix=this.getValue(A,"scaleMix",1),k.shearMix=this.getValue(A,"shearMix",1),a.transformConstraints.push(k)}if(n.path)for(var N=0;N<n.path.length;N++){var _=n.path[N],Y=new tb(_.name);Y.order=this.getValue(_,"order",0),Y.skinRequired=this.getValue(_,"skin",!1);for(var X=0;X<_.bones.length;X++){var O=_.bones[X],L=a.findBone(O);if(null==L)throw Error("Transform constraint bone not found: "+O);Y.bones.push(L)}var D=_.target;if(Y.target=a.findSlot(D),null==Y.target)throw Error("Path target slot not found: "+D);Y.positionMode=t.positionModeFromString(this.getValue(_,"positionMode","percent")),Y.spacingMode=t.spacingModeFromString(this.getValue(_,"spacingMode","length")),Y.rotateMode=t.rotateModeFromString(this.getValue(_,"rotateMode","tangent")),Y.offsetRotation=this.getValue(_,"rotation",0),Y.position=this.getValue(_,"position",0),Y.positionMode==tx.Fixed&&(Y.position*=r),Y.spacing=this.getValue(_,"spacing",0),(Y.spacingMode==tS.Length||Y.spacingMode==tS.Fixed)&&(Y.spacing*=r),Y.rotateMix=this.getValue(_,"rotateMix",1),Y.translateMix=this.getValue(_,"translateMix",1),a.pathConstraints.push(Y)}if(n.skins)for(var B=0;B<n.skins.length;B++){var W=n.skins[B],q=new tC(W.name);if(W.bones)for(var U=0;U<W.bones.length;U++){var H=a.findBone(W.bones[U]);if(null==H)throw Error("Skin bone not found: "+W.bones[B]);q.bones.push(H)}if(W.ik)for(var G=0;G<W.ik.length;G++){var j=a.findIkConstraint(W.ik[G]);if(null==j)throw Error("Skin IK constraint not found: "+W.ik[B]);q.constraints.push(j)}if(W.transform)for(var z=0;z<W.transform.length;z++){var Z=a.findTransformConstraint(W.transform[z]);if(null==Z)throw Error("Skin transform constraint not found: "+W.transform[B]);q.constraints.push(Z)}if(W.path)for(var Q=0;Q<W.path.length;Q++){var K=a.findPathConstraint(W.path[Q]);if(null==K)throw Error("Skin path constraint not found: "+W.path[B]);q.constraints.push(K)}for(var J in W.attachments){var $=a.findSlot(J);if(null==$)throw Error("Slot not found: "+J);var tt=W.attachments[J];for(var te in tt){var tr=this.readAttachment(tt[te],q,$.index,te,a);null!=tr&&q.setAttachment($.index,te,tr)}}a.skins.push(q),"default"==q.name&&(a.defaultSkin=q)}for(var ta=0,tn=this.linkedMeshes.length;ta<tn;ta++){var ti=this.linkedMeshes[ta],ts=null==ti.skin?a.defaultSkin:a.findSkin(ti.skin);if(null==ts)throw Error("Skin not found: "+ti.skin);var to=ts.getAttachment(ti.slotIndex,ti.parent);if(null==to)throw Error("Parent mesh not found: "+ti.parent);ti.mesh.deformAttachment=ti.inheritDeform?to:ti.mesh,ti.mesh.setParentMesh(to),ti.mesh.updateUVs()}if(this.linkedMeshes.length=0,n.events)for(var th in n.events){var tl=n.events[th],tu=new tm(th);tu.intValue=this.getValue(tl,"int",0),tu.floatValue=this.getValue(tl,"float",0),tu.stringValue=this.getValue(tl,"string",""),tu.audioPath=this.getValue(tl,"audio",null),null!=tu.audioPath&&(tu.volume=this.getValue(tl,"volume",1),tu.balance=this.getValue(tl,"balance",0)),a.events.push(tu)}if(n.animations)for(var tf in n.animations){var td=n.animations[tf];this.readAnimation(td,tf,a)}return a},e.readAttachment=function(t,e,r,a,n){var i=this.scale;switch(a=this.getValue(t,"name",a),this.getValue(t,"type","region")){case"region":var s=this.getValue(t,"path",a),o=this.attachmentLoader.newRegionAttachment(e,a,s);if(null==o)break;o.path=s,o.x=this.getValue(t,"x",0)*i,o.y=this.getValue(t,"y",0)*i,o.scaleX=this.getValue(t,"scaleX",1),o.scaleY=this.getValue(t,"scaleY",1),o.rotation=this.getValue(t,"rotation",0),o.width=t.width*i,o.height=t.height*i;var h=this.getValue(t,"color",null);return null!=h&&o.color.setFromString(h),o.updateOffset(),o;case"boundingbox":var l=this.attachmentLoader.newBoundingBoxAttachment(e,a);if(null==l)break;this.readVertices(t,l,t.vertexCount<<1);var u=this.getValue(t,"color",null);return null!=u&&l.color.setFromString(u),l;case"mesh":case"linkedmesh":var c=this.getValue(t,"path",a),f=this.attachmentLoader.newMeshAttachment(e,a,c);if(null==f)break;f.path=c;var d=this.getValue(t,"color",null);null!=d&&f.color.setFromString(d),f.width=this.getValue(t,"width",0)*i,f.height=this.getValue(t,"height",0)*i;var v=this.getValue(t,"parent",null);if(null!=v)return this.linkedMeshes.push(new tD(f,this.getValue(t,"skin",null),r,v,this.getValue(t,"deform",!0))),f;var g=t.uvs;return this.readVertices(t,f,g.length),f.triangles=t.triangles,f.regionUVs=g,f.updateUVs(),f.edges=this.getValue(t,"edges",null),f.hullLength=2*this.getValue(t,"hull",0),f;case"path":var m=this.attachmentLoader.newPathAttachment(e,a);if(null==m)break;m.closed=this.getValue(t,"closed",!1),m.constantSpeed=this.getValue(t,"constantSpeed",!0);var p=t.vertexCount;this.readVertices(t,m,p<<1);for(var E=S.newArray(p/3,0),b=0;b<t.lengths.length;b++)E[b]=t.lengths[b]*i;m.lengths=E;var x=this.getValue(t,"color",null);return null!=x&&m.color.setFromString(x),m;case"point":var w=this.attachmentLoader.newPointAttachment(e,a);if(null==w)break;w.x=this.getValue(t,"x",0)*i,w.y=this.getValue(t,"y",0)*i,w.rotation=this.getValue(t,"rotation",0);var M=this.getValue(t,"color",null);return null!=M&&w.color.setFromString(M),w;case"clipping":var y=this.attachmentLoader.newClippingAttachment(e,a);if(null==y)break;var I=this.getValue(t,"end",null);if(null!=I){var R=n.findSlot(I);if(null==R)throw Error("Clipping end slot not found: "+I);y.endSlot=R}var T=t.vertexCount;this.readVertices(t,y,T<<1);var A=this.getValue(t,"color",null);return null!=A&&y.color.setFromString(A),y}return null},e.readVertices=function(t,e,r){var a=this.scale;e.worldVerticesLength=r;var n=t.vertices;if(r==n.length){var i=S.toFloatArray(n);if(1!=a)for(var s=0,o=n.length;s<o;s++)i[s]*=a;e.vertices=i;return}for(var h=[],l=[],u=0,c=n.length;u<c;){var f=n[u++];l.push(f);for(var d=u+4*f;u<d;u+=4)l.push(n[u]),h.push(n[u+1]*a),h.push(n[u+2]*a),h.push(n[u+3])}e.bones=l,e.vertices=S.toFloatArray(h)},e.readAnimation=function(t,e,r){var a=this.scale,n=[],i=0;if(t.slots)for(var s in t.slots){var o=t.slots[s],h=r.findSlotIndex(s);if(-1==h)throw Error("Slot not found: "+s);for(var l in o){var u=o[l];if("attachment"==l){var c=new Y(u.length);c.slotIndex=h;for(var f=0,d=0;d<u.length;d++){var v=u[d];c.setFrame(f++,this.getValue(v,"time",0),v.name)}n.push(c),i=Math.max(i,c.frames[c.getFrameCount()-1])}else if("color"==l){var g=new N(u.length);g.slotIndex=h;for(var m=0,p=0;p<u.length;p++){var b=u[p],x=new E;x.setFromString(b.color),g.setFrame(m,this.getValue(b,"time",0),x.r,x.g,x.b,x.a),this.readCurve(b,g,m),m++}n.push(g),i=Math.max(i,g.frames[(g.getFrameCount()-1)*N.ENTRIES])}else if("twoColor"==l){var w=new _(u.length);w.slotIndex=h;for(var M=0,y=0;y<u.length;y++){var I=u[y],T=new E,A=new E;T.setFromString(I.light),A.setFromString(I.dark),w.setFrame(M,this.getValue(I,"time",0),T.r,T.g,T.b,T.a,A.r,A.g,A.b),this.readCurve(I,w,M),M++}n.push(w),i=Math.max(i,w.frames[(w.getFrameCount()-1)*_.ENTRIES])}else throw Error("Invalid timeline type for a slot: "+l+" ("+s+")")}}if(t.bones)for(var k in t.bones){var X=t.bones[k],G=r.findBoneIndex(k);if(-1==G)throw Error("Bone not found: "+k);for(var j in X){var z=X[j];if("rotate"===j){var Z=new V(z.length);Z.boneIndex=G;for(var Q=0,K=0;K<z.length;K++){var J=z[K];Z.setFrame(Q,this.getValue(J,"time",0),this.getValue(J,"angle",0)),this.readCurve(J,Z,Q),Q++}n.push(Z),i=Math.max(i,Z.frames[(Z.getFrameCount()-1)*V.ENTRIES])}else if("translate"===j||"scale"===j||"shear"===j){var $=null,tt=1,te=0;"scale"===j?($=new P(z.length),te=1):"shear"===j?$=new F(z.length):($=new C(z.length),tt=a),$.boneIndex=G;for(var tr=0,ta=0;ta<z.length;ta++){var tn=z[ta],ti=this.getValue(tn,"x",te),ts=this.getValue(tn,"y",te);$.setFrame(tr,this.getValue(tn,"time",0),ti*tt,ts*tt),this.readCurve(tn,$,tr),tr++}n.push($),i=Math.max(i,$.frames[($.getFrameCount()-1)*C.ENTRIES])}else throw Error("Invalid timeline type for a bone: "+j+" ("+k+")")}}if(t.ik)for(var to in t.ik){var th=t.ik[to],tl=r.findIkConstraint(to),tu=new B(th.length);tu.ikConstraintIndex=r.ikConstraints.indexOf(tl);for(var tc=0,tf=0;tf<th.length;tf++){var td=th[tf];tu.setFrame(tc,this.getValue(td,"time",0),this.getValue(td,"mix",1),this.getValue(td,"softness",0)*a,this.getValue(td,"bendPositive",!0)?1:-1,this.getValue(td,"compress",!1),this.getValue(td,"stretch",!1)),this.readCurve(td,tu,tc),tc++}n.push(tu),i=Math.max(i,tu.frames[(tu.getFrameCount()-1)*B.ENTRIES])}if(t.transform)for(var tv in t.transform){var tm=t.transform[tv],tp=r.findTransformConstraint(tv),tE=new W(tm.length);tE.transformConstraintIndex=r.transformConstraints.indexOf(tp);for(var tb=0,tw=0;tw<tm.length;tw++){var tM=tm[tw];tE.setFrame(tb,this.getValue(tM,"time",0),this.getValue(tM,"rotateMix",1),this.getValue(tM,"translateMix",1),this.getValue(tM,"scaleMix",1),this.getValue(tM,"shearMix",1)),this.readCurve(tM,tE,tb),tb++}n.push(tE),i=Math.max(i,tE.frames[(tE.getFrameCount()-1)*W.ENTRIES])}if(t.path)for(var ty in t.path){var tI=t.path[ty],tR=r.findPathConstraintIndex(ty);if(-1==tR)throw Error("Path constraint not found: "+ty);var tT=r.pathConstraints[tR];for(var tA in tI){var tk=tI[tA];if("position"===tA||"spacing"===tA){var tV=null,tC=1;"spacing"===tA?(tV=new U(tk.length),(tT.spacingMode==tS.Length||tT.spacingMode==tS.Fixed)&&(tC=a)):(tV=new q(tk.length),tT.positionMode==tx.Fixed&&(tC=a)),tV.pathConstraintIndex=tR;for(var tP=0,tF=0;tF<tk.length;tF++){var tN=tk[tF];tV.setFrame(tP,this.getValue(tN,"time",0),this.getValue(tN,tA,0)*tC),this.readCurve(tN,tV,tP),tP++}n.push(tV),i=Math.max(i,tV.frames[(tV.getFrameCount()-1)*q.ENTRIES])}else if("mix"===tA){var t_=new H(tk.length);t_.pathConstraintIndex=tR;for(var tY=0,tX=0;tX<tk.length;tX++){var tO=tk[tX];t_.setFrame(tY,this.getValue(tO,"time",0),this.getValue(tO,"rotateMix",1),this.getValue(tO,"translateMix",1)),this.readCurve(tO,t_,tY),tY++}n.push(t_),i=Math.max(i,t_.frames[(t_.getFrameCount()-1)*H.ENTRIES])}}}if(t.deform)for(var tL in t.deform){var tD=t.deform[tL],tB=r.findSkin(tL);if(null==tB)throw Error("Skin not found: "+tL);for(var tW in tD){var tq=tD[tW],tU=r.findSlotIndex(tW);if(-1==tU)throw Error("Slot not found: "+tq.name);for(var tH in tq){var tG=tq[tH],tj=tB.getAttachment(tU,tH);if(null==tj)throw Error("Deform attachment not found: "+tG.name);var tz=null!=tj.bones,tZ=tj.vertices,tQ=tz?tZ.length/3*2:tZ.length,tK=new O(tG.length);tK.slotIndex=tU,tK.attachment=tj;for(var tJ=0,t$=0;t$<tG.length;t$++){var t0=tG[t$],t1=void 0,t2=this.getValue(t0,"vertices",null);if(null==t2)t1=tz?S.newFloatArray(tQ):tZ;else{t1=S.newFloatArray(tQ);var t3=this.getValue(t0,"offset",0);if(S.arrayCopy(t2,0,t1,t3,t2.length),1!=a)for(var t9=t3,t6=t9+t2.length;t9<t6;t9++)t1[t9]*=a;if(!tz)for(var t8=0;t8<tQ;t8++)t1[t8]+=tZ[t8]}tK.setFrame(tJ,this.getValue(t0,"time",0),t1),this.readCurve(t0,tK,tJ),tJ++}n.push(tK),i=Math.max(i,tK.frames[tK.getFrameCount()-1])}}}var t4=t.drawOrder;if(null==t4&&(t4=t.draworder),null!=t4){for(var t5=new D(t4.length),t7=r.slots.length,et=0,ee=0;ee<t4.length;ee++){var er=t4[ee],ea=null,en=this.getValue(er,"offsets",null);if(null!=en){ea=S.newArray(t7,-1);for(var ei=S.newArray(t7-en.length,0),es=0,eo=0,eh=0;eh<en.length;eh++){var el=en[eh],eu=r.findSlotIndex(el.slot);if(-1==eu)throw Error("Slot not found: "+el.slot);for(;es!=eu;)ei[eo++]=es++;ea[es+el.offset]=es++}for(;es<t7;)ei[eo++]=es++;for(var ec=t7-1;ec>=0;ec--)-1==ea[ec]&&(ea[ec]=ei[--eo])}t5.setFrame(et++,this.getValue(er,"time",0),ea)}n.push(t5),i=Math.max(i,t5.frames[t5.getFrameCount()-1])}if(t.events){for(var ef=new L(t.events.length),ed=0,ev=0;ev<t.events.length;ev++){var eg=t.events[ev],em=r.findEvent(eg.name);if(null==em)throw Error("Event not found: "+eg.name);var ep=new tg(S.toSinglePrecision(this.getValue(eg,"time",0)),em);ep.intValue=this.getValue(eg,"int",em.intValue),ep.floatValue=this.getValue(eg,"float",em.floatValue),ep.stringValue=this.getValue(eg,"string",em.stringValue),null!=ep.data.audioPath&&(ep.volume=this.getValue(eg,"volume",1),ep.balance=this.getValue(eg,"balance",0)),ef.setFrame(ed++,ep)}n.push(ef),i=Math.max(i,ef.frames[ef.getFrameCount()-1])}if(isNaN(i))throw Error("Error while parsing animation, duration is NaN");r.animations.push(new R(e,n,i))},e.readCurve=function(t,e,r){if(t.hasOwnProperty("curve")){if("stepped"==t.curve)e.setStepped(r);else{var a=t.curve;e.setCurve(r,a,this.getValue(t,"c2",0),this.getValue(t,"c3",1),this.getValue(t,"c4",1))}}},e.getValue=function(t,e,r){return void 0!==t[e]?t[e]:r},t.blendModeFromString=function(t){if("normal"==(t=t.toLowerCase()))return tu.Normal;if("additive"==t)return tu.Additive;if("multiply"==t)return tu.Multiply;if("screen"==t)return tu.Screen;throw Error("Unknown blend mode: "+t)},t.positionModeFromString=function(t){if("fixed"==(t=t.toLowerCase()))return tx.Fixed;if("percent"==t)return tx.Percent;throw Error("Unknown position mode: "+t)},t.spacingModeFromString=function(t){if("length"==(t=t.toLowerCase()))return tS.Length;if("fixed"==t)return tS.Fixed;if("percent"==t)return tS.Percent;throw Error("Unknown position mode: "+t)},t.rotateModeFromString=function(t){if("tangent"==(t=t.toLowerCase()))return tw.Tangent;if("chain"==t)return tw.Chain;if("chainscale"==t)return tw.ChainScale;throw Error("Unknown rotate mode: "+t)},t.transformModeFromString=function(t){if("normal"==(t=t.toLowerCase()))return tf.Normal;if("onlytranslation"==t)return tf.OnlyTranslation;if("norotationorreflection"==t)return tf.NoRotationOrReflection;if("noscale"==t)return tf.NoScale;if("noscaleorreflection"==t)return tf.NoScaleOrReflection;throw Error("Unknown transform mode: "+t)},t}(),tD=function(t,e,r,a,n){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=a,this.inheritDeform=n};new x(2);var tB=/*#__PURE__*/function(){function t(){this._clipper=new tO}return t.prototype.buildGeometry=function(e,r){for(var a,n,i=r.tintBlack,s=this._clipper,o=t.tempVerts,h=e.drawOrder,l=0,u=h.length;l<u;++l){var c=h[l];if(!c.bone.active){s.clipEndWithSlot(c);continue}var f=c.getAttachment();if(!f){s.clipEndWithSlot(c);continue}var d=s.isClipping(),v=0,g=null,m=void 0,p=i?12:8,E=d?2:p;switch(f.constructor){case Q:g=f.color,v=E<<2,f.computeWorldVertices(c.bone,o,0,E),a=t.QUAD_TRIANGLES,n=f.uvs,m=f.region.texture;break;case tn:g=f.color,(v=(f.worldVerticesLength>>1)*E)>o.length&&(o.length=v),f.computeWorldVertices(c,0,f.worldVerticesLength,o,0,E),a=f.triangles,n=f.uvs,m=f.region.texture;break;case th:s.clipStart(c,f);continue;default:s.clipEndWithSlot(c);continue}if(null!=m){var b=void 0,x=void 0,S=void 0,w=void 0,M=c.bone.skeleton.color,y=c.color,I=t.tempColor,R=M.a*y.a*g.a;I.r=M.r*y.r*g.r,I.g=M.g*y.g*g.g,I.b=M.b*y.b*g.b,I.a=R;var T=t.tempDark,A=c.darkColor;if(A?T.setFromColor(A):T.set(0,0,0,1),d)s.clipTriangles(o,v,a,a.length,n,I,T,i),x=(b=s.clippedVertices).length,w=(S=s.clippedTriangles).length;else{for(var k=I.r,V=I.g,C=I.b,P=I.a,F=2,N=0,_=v;F<_;F+=p,N+=2)o[F]=k,o[F+1]=V,o[F+2]=C,o[F+3]=P,o[F+4]=n[N],o[F+5]=n[N+1],i&&(o[F+6]=T.r,o[F+7]=T.g,o[F+8]=T.b,o[F+9]=T.a);b=o,x=v,S=a,w=a.length}r.append(b,x/p,S,w,m.getImage(),c.data.blendMode,l,c.data.index)}s.clipEndWithSlot(c)}s.clipEnd()},t}();tB.tempDark=new E,tB.tempColor=new E,tB.tempVerts=Array(8),tB.QUAD_TRIANGLES=[0,1,2,2,3,0];var tW=/*#__PURE__*/function(t){function r(e){return t.call(this,e)||this}s(r,t);var a=r.prototype;return a.getImage=function(){return this._texture},a.setFilters=function(t,r){t===J.Nearest?this._texture.filterMode=e.TextureFilterMode.Point:t===J.Linear?this._texture.filterMode=e.TextureFilterMode.Bilinear:this._texture.filterMode=e.TextureFilterMode.Trilinear},a.setWraps=function(t,e){this._texture.wrapModeU=this._convertWrapMode(t),this._texture.wrapModeV=this._convertWrapMode(e)},a.dispose=function(){},a._convertWrapMode=function(t){switch(t){case $.ClampToEdge:return e.TextureWrapMode.Clamp;case $.Repeat:return e.TextureWrapMode.Repeat;case $.MirroredRepeat:return e.TextureWrapMode.Mirror;default:throw Error("Unsupported texture wrap mode.")}},r}(K),tq=/*#__PURE__*/function(){function t(){this.version="3.8",this._generator=new tB}var a=t.prototype;return a.getTextures=function(t){for(var a,i=new Set,s=n(t.skins);!(a=s()).done;)for(var o,h=a.value,l=n(h.getAttachments());!(o=l()).done;){var u=o.value.attachment;if(r(u,Q)||r(u,tn)){var c,f=u.region,d=r(f,ta)?null==(c=f.texture)?void 0:c.texture:null;r(d,e.Texture2D)&&i.add(d)}}return Array.from(i)},a.getPhysics=function(t){return{supported:!1,reason:"Spine 3.8 does not support physics constraints."}},a.createSkin=function(t){return new tC(t)},a.createTextureAtlas=function(t,e){var r=0;return new tt(t,function(){return new tW(e[r++])})},a.createSkeletonData=function(t,e,r){var a=new tl(e);if("string"==typeof t){var n=new tL(a);return n.scale=r,n.readSkeletonData(t)}var i=new tF(a);return i.scale=r,i.readSkeletonData(new Uint8Array(t))},a.createAnimationStateData=function(t){return new Z(t)},a.createSkeleton=function(t){return new tR(t)},a.createAnimationState=function(t){return new G(t)},a.batchAnimationStateEvents=function(t,e){var r=t.queue,a=r.drainDisabled;r.drainDisabled=!0;var n=e();return r.drainDisabled=a,r.drain(),n},a.advanceState=function(t,e,r){e.update(r),t.update(r)},a.applyState=function(t,e){e.apply(t)},a.updateWorldTransform=function(t,e){t.updateWorldTransform()},a.buildGeometry=function(t,e){this._generator.buildGeometry(t,e)},t}(),tU="2.0.0-alpha.60";console.log("Galacean spine-core-3.8 version: "+tU),t.Spine38Runtime=tq,t.version=tU,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=browser.min.js.map
|
package/dist/main.js
CHANGED
|
@@ -7551,7 +7551,7 @@ SpineGenerator.QUAD_TRIANGLES = [
|
|
|
7551
7551
|
return Spine38Runtime;
|
|
7552
7552
|
}();
|
|
7553
7553
|
|
|
7554
|
-
var version = "2.0.0-alpha.
|
|
7554
|
+
var version = "2.0.0-alpha.60";
|
|
7555
7555
|
console.log("Galacean spine-core-3.8 version: " + version);
|
|
7556
7556
|
|
|
7557
7557
|
exports.Spine38Runtime = Spine38Runtime;
|
package/dist/module.js
CHANGED
|
@@ -7547,7 +7547,7 @@ SpineGenerator.QUAD_TRIANGLES = [
|
|
|
7547
7547
|
return Spine38Runtime;
|
|
7548
7548
|
}();
|
|
7549
7549
|
|
|
7550
|
-
var version = "2.0.0-alpha.
|
|
7550
|
+
var version = "2.0.0-alpha.60";
|
|
7551
7551
|
console.log("Galacean spine-core-3.8 version: " + version);
|
|
7552
7552
|
|
|
7553
7553
|
export { Spine38Runtime, version };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-spine-core-3.8",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.60",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"types/**/*"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@galacean/engine-design": "2.0.0-alpha.
|
|
28
|
+
"@galacean/engine-design": "2.0.0-alpha.60"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@galacean/engine": "2.0.0-alpha.
|
|
31
|
+
"@galacean/engine": "2.0.0-alpha.60"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@galacean/engine": "2.0.0-alpha.
|
|
34
|
+
"@galacean/engine": "2.0.0-alpha.60"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"b:types": "tsc"
|