jsge
Version:
Javascript Game Engine
1 lines • 181 kB
JavaScript
var t,e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},s={};e.d(s,{Z:()=>ys});class i{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,i=t.length;s<i;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}class r{constructor(t=0,e=0,s=0,i=0){this.r=t,this.g=e,this.b=s,this.a=i}set(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(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?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,i){return this.r+=t,this.g+=e,this.b+=s,this.a+=i,this.clamp()}clamp(){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}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new r).setFromString(t)}}r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1);class n{static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*n.degRad)}static sinDeg(t){return Math.sin(t*n.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return n.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,s){let i=Math.random(),r=e-t;return i<=(s-t)/r?t+Math.sqrt(i*r*(s-t)):e-Math.sqrt((1-i)*r*(e-s))}static isPowerOfTwo(t){return t&&0==(t&t-1)}}n.PI=3.1415927,n.PI2=2*n.PI,n.radiansToDegrees=180/n.PI,n.radDeg=n.radiansToDegrees,n.degreesToRadians=n.PI/180,n.degRad=n.degreesToRadians;class a{static arrayCopy(t,e,s,i,r){for(let n=e,a=i;n<e+r;n++,a++)s[a]=t[n]}static arrayFill(t,e,s,i){for(let r=e;r<s;r++)t[r]=i}static setArraySize(t,e,s=0){let i=t.length;if(i==e)return t;if(t.length=e,i<e)for(let r=i;r<e;r++)t[r]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:a.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let i=0;i<t;i++)s[i]=e;return s}static newFloatArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return a.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return a.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}a.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;class o{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class h{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}class l{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class c{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}class d extends c{constructor(t){super(t),this.id=d.nextID++,this.bones=null,this.vertices=[],this.worldVerticesLength=0,this.timelineAttachment=this}computeWorldVertices(t,e,s,i,r,n){s=r+(s>>1)*n;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,d=a.a,u=a.b,m=a.c,f=a.d;for(let t=e,a=r;a<s;t+=2,a+=n){let e=h[t],s=h[t+1];i[a]=e*d+s*u+l,i[a+1]=e*m+s*f+c}return}let c=0,d=0;for(let t=0;t<e;t+=2){let t=l[c];c+=t+1,d+=t}let u=a.bones;if(0==o.length)for(let t=r,e=3*d;t<s;t+=n){let s=0,r=0,n=l[c++];for(n+=c;c<n;c++,e+=3){let t=u[l[c]],i=h[e],n=h[e+1],a=h[e+2];s+=(i*t.a+n*t.b+t.worldX)*a,r+=(i*t.c+n*t.d+t.worldY)*a}i[t]=s,i[t+1]=r}else{let t=o;for(let e=r,a=3*d,o=d<<1;e<s;e+=n){let s=0,r=0,n=l[c++];for(n+=c;c<n;c++,a+=3,o+=2){let e=u[l[c]],i=h[a]+t[o],n=h[a+1]+t[o+1],d=h[a+2];s+=(i*e.a+n*e.b+e.worldX)*d,r+=(i*e.c+n*e.d+e.worldY)*d}i[e]=s,i[e+1]=r}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),a.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=a.newFloatArray(this.vertices.length),a.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}}d.nextID=0;class u{constructor(t){this.id=u.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(t)}copy(){let t=new u(this.regions.length);return a.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let s=t.sequenceIndex;-1==s&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let i=this.regions[s];e.region!=i&&(e.region=i,e.updateRegion())}getPath(t,e){let s=t,i=(this.start+e).toString();for(let t=this.digits-i.length;t>0;t--)s+="0";return s+=i,s}static nextID(){return u._nextID++}}u._nextID=0,function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(t||(t={}));const m=[t.hold,t.once,t.loop,t.pingpong,t.onceReverse,t.loopReverse,t.pingpongReverse];class f{constructor(t,e,s){if(this.timelines=[],this.timelineIds=new i,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=s}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,i,r,n,a,o){if(!t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(s%=this.duration,e>0&&(e%=this.duration));let h=this.timelines;for(let i=0,l=h.length;i<l;i++)h[i].apply(t,e,s,r,n,a,o)}}var g,p;!function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(g||(g={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(p||(p={}));class x{constructor(t,e){this.propertyIds=e,this.frames=a.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let s=t.length;for(let i=1;i<s;i++)if(t[i]>e)return i-1;return s-1}static search(t,e,s){let i=t.length;for(let r=s;r<i;r+=s)if(t[r]>e)return r-s;return i-s}}class w extends x{constructor(t,e,s){super(t,s),this.curves=a.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=a.newFloatArray(e);a.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,s,i,r,n,a,o,h,l,c){let d=this.curves,u=this.getFrameCount()+18*t;0==s&&(d[e]=2+u);let m=.03*(i-2*n+o),f=.03*(r-2*a+h),g=.006*(3*(n-o)-i+l),p=.006*(3*(a-h)-r+c),x=2*m+g,w=2*f+p,b=.3*(n-i)+m+.16666667*g,y=.3*(a-r)+f+.16666667*p,v=i+b,A=r+y;for(let t=u+18;u<t;u+=2)d[u]=v,d[u+1]=A,b+=x,y+=w,x+=g,w+=p,v+=b,A+=y}getBezierValue(t,e,s,i){let r=this.curves;if(r[i]>t){let n=this.frames[e],a=this.frames[e+s];return a+(t-n)/(r[i]-n)*(r[i+1]-a)}let n=i+18;for(i+=2;i<n;i+=2)if(r[i]>=t){let e=r[i-2],s=r[i-1];return s+(t-e)/(r[i]-e)*(r[i+1]-s)}e+=this.getFrameEntries();let a=r[n-2],o=r[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+s]-o)}}class b extends w{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let i=2;i<=s;i+=2)if(e[i]>t){s=i-2;break}let i=this.curves[s>>1];switch(i){case 0:let i=e[s],r=e[s+1];return r+(t-i)/(e[s+2]-i)*(e[s+2+1]-r);case 1:return e[s+1]}return this.getBezierValue(t,s,1,i-2)}}class y extends w{constructor(t,e,s,i){super(t,e,[s,i])}getFrameEntries(){return 3}setFrame(t,e,s,i){t*=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i}}class v extends b{constructor(t,e,s){super(t,e,"0|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.rotation=o.data.rotation);case g.first:o.rotation+=(o.data.rotation-o.rotation)*r}return}let h=this.getCurveValue(s);switch(n){case g.setup:o.rotation=o.data.rotation+h*r;break;case g.first:case g.replace:h+=o.data.rotation-o.rotation;case g.add:o.rotation+=h*r}}}class A extends y{constructor(t,e,s){super(t,e,"1|"+s,"2|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(s<h[0]){switch(n){case g.setup:return o.x=o.data.x,void(o.y=o.data.y);case g.first:o.x+=(o.data.x-o.x)*r,o.y+=(o.data.y-o.y)*r}return}let l=0,c=0,d=x.search(h,s,3),u=this.curves[d/3];switch(u){case 0:let t=h[d];l=h[d+1],c=h[d+2];let e=(s-t)/(h[d+3]-t);l+=(h[d+3+1]-l)*e,c+=(h[d+3+2]-c)*e;break;case 1:l=h[d+1],c=h[d+2];break;default:l=this.getBezierValue(s,d,1,u-2),c=this.getBezierValue(s,d,2,u+18-2)}switch(n){case g.setup:o.x=o.data.x+l*r,o.y=o.data.y+c*r;break;case g.first:case g.replace:o.x+=(o.data.x+l-o.x)*r,o.y+=(o.data.y+c-o.y)*r;break;case g.add:o.x+=l*r,o.y+=c*r}}}class k extends b{constructor(t,e,s){super(t,e,"1|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.x=o.data.x);case g.first:o.x+=(o.data.x-o.x)*r}return}let h=this.getCurveValue(s);switch(n){case g.setup:o.x=o.data.x+h*r;break;case g.first:case g.replace:o.x+=(o.data.x+h-o.x)*r;break;case g.add:o.x+=h*r}}}class S extends b{constructor(t,e,s){super(t,e,"2|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.y=o.data.y);case g.first:o.y+=(o.data.y-o.y)*r}return}let h=this.getCurveValue(s);switch(n){case g.setup:o.y=o.data.y+h*r;break;case g.first:case g.replace:o.y+=(o.data.y+h-o.y)*r;break;case g.add:o.y+=h*r}}}class I extends y{constructor(t,e,s){super(t,e,"3|"+s,"4|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,a,o){let h=t.bones[this.boneIndex];if(!h.active)return;let l,c,d=this.frames;if(s<d[0]){switch(a){case g.setup:return h.scaleX=h.data.scaleX,void(h.scaleY=h.data.scaleY);case g.first:h.scaleX+=(h.data.scaleX-h.scaleX)*r,h.scaleY+=(h.data.scaleY-h.scaleY)*r}return}let u=x.search(d,s,3),m=this.curves[u/3];switch(m){case 0:let t=d[u];l=d[u+1],c=d[u+2];let e=(s-t)/(d[u+3]-t);l+=(d[u+3+1]-l)*e,c+=(d[u+3+2]-c)*e;break;case 1:l=d[u+1],c=d[u+2];break;default:l=this.getBezierValue(s,u,1,m-2),c=this.getBezierValue(s,u,2,m+18-2)}if(l*=h.data.scaleX,c*=h.data.scaleY,1==r)a==g.add?(h.scaleX+=l-h.data.scaleX,h.scaleY+=c-h.data.scaleY):(h.scaleX=l,h.scaleY=c);else{let t=0,e=0;if(o==p.mixOut)switch(a){case g.setup:t=h.data.scaleX,e=h.data.scaleY,h.scaleX=t+(Math.abs(l)*n.signum(t)-t)*r,h.scaleY=e+(Math.abs(c)*n.signum(e)-e)*r;break;case g.first:case g.replace:t=h.scaleX,e=h.scaleY,h.scaleX=t+(Math.abs(l)*n.signum(t)-t)*r,h.scaleY=e+(Math.abs(c)*n.signum(e)-e)*r;break;case g.add:h.scaleX+=(l-h.data.scaleX)*r,h.scaleY+=(c-h.data.scaleY)*r}else switch(a){case g.setup:t=Math.abs(h.data.scaleX)*n.signum(l),e=Math.abs(h.data.scaleY)*n.signum(c),h.scaleX=t+(l-t)*r,h.scaleY=e+(c-e)*r;break;case g.first:case g.replace:t=Math.abs(h.scaleX)*n.signum(l),e=Math.abs(h.scaleY)*n.signum(c),h.scaleX=t+(l-t)*r,h.scaleY=e+(c-e)*r;break;case g.add:h.scaleX+=(l-h.data.scaleX)*r,h.scaleY+=(c-h.data.scaleY)*r}}}}class C extends b{constructor(t,e,s){super(t,e,"3|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,a,o){let h=t.bones[this.boneIndex];if(!h.active)return;if(s<this.frames[0]){switch(a){case g.setup:return void(h.scaleX=h.data.scaleX);case g.first:h.scaleX+=(h.data.scaleX-h.scaleX)*r}return}let l=this.getCurveValue(s)*h.data.scaleX;if(1==r)a==g.add?h.scaleX+=l-h.data.scaleX:h.scaleX=l;else{let t=0;if(o==p.mixOut)switch(a){case g.setup:t=h.data.scaleX,h.scaleX=t+(Math.abs(l)*n.signum(t)-t)*r;break;case g.first:case g.replace:t=h.scaleX,h.scaleX=t+(Math.abs(l)*n.signum(t)-t)*r;break;case g.add:h.scaleX+=(l-h.data.scaleX)*r}else switch(a){case g.setup:t=Math.abs(h.data.scaleX)*n.signum(l),h.scaleX=t+(l-t)*r;break;case g.first:case g.replace:t=Math.abs(h.scaleX)*n.signum(l),h.scaleX=t+(l-t)*r;break;case g.add:h.scaleX+=(l-h.data.scaleX)*r}}}}class R extends b{constructor(t,e,s){super(t,e,"4|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,a,o){let h=t.bones[this.boneIndex];if(!h.active)return;if(s<this.frames[0]){switch(a){case g.setup:return void(h.scaleY=h.data.scaleY);case g.first:h.scaleY+=(h.data.scaleY-h.scaleY)*r}return}let l=this.getCurveValue(s)*h.data.scaleY;if(1==r)a==g.add?h.scaleY+=l-h.data.scaleY:h.scaleY=l;else{let t=0;if(o==p.mixOut)switch(a){case g.setup:t=h.data.scaleY,h.scaleY=t+(Math.abs(l)*n.signum(t)-t)*r;break;case g.first:case g.replace:t=h.scaleY,h.scaleY=t+(Math.abs(l)*n.signum(t)-t)*r;break;case g.add:h.scaleY+=(l-h.data.scaleY)*r}else switch(a){case g.setup:t=Math.abs(h.data.scaleY)*n.signum(l),h.scaleY=t+(l-t)*r;break;case g.first:case g.replace:t=Math.abs(h.scaleY)*n.signum(l),h.scaleY=t+(l-t)*r;break;case g.add:h.scaleY+=(l-h.data.scaleY)*r}}}}class E extends y{constructor(t,e,s){super(t,e,"5|"+s,"6|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(s<h[0]){switch(n){case g.setup:return o.shearX=o.data.shearX,void(o.shearY=o.data.shearY);case g.first:o.shearX+=(o.data.shearX-o.shearX)*r,o.shearY+=(o.data.shearY-o.shearY)*r}return}let l=0,c=0,d=x.search(h,s,3),u=this.curves[d/3];switch(u){case 0:let t=h[d];l=h[d+1],c=h[d+2];let e=(s-t)/(h[d+3]-t);l+=(h[d+3+1]-l)*e,c+=(h[d+3+2]-c)*e;break;case 1:l=h[d+1],c=h[d+2];break;default:l=this.getBezierValue(s,d,1,u-2),c=this.getBezierValue(s,d,2,u+18-2)}switch(n){case g.setup:o.shearX=o.data.shearX+l*r,o.shearY=o.data.shearY+c*r;break;case g.first:case g.replace:o.shearX+=(o.data.shearX+l-o.shearX)*r,o.shearY+=(o.data.shearY+c-o.shearY)*r;break;case g.add:o.shearX+=l*r,o.shearY+=c*r}}}class M extends b{constructor(t,e,s){super(t,e,"5|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.shearX=o.data.shearX);case g.first:o.shearX+=(o.data.shearX-o.shearX)*r}return}let h=this.getCurveValue(s);switch(n){case g.setup:o.shearX=o.data.shearX+h*r;break;case g.first:case g.replace:o.shearX+=(o.data.shearX+h-o.shearX)*r;break;case g.add:o.shearX+=h*r}}}class F extends b{constructor(t,e,s){super(t,e,"6|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,r,n,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.shearY=o.data.shearY);case g.first:o.shearY+=(o.data.shearY-o.shearY)*r}return}let h=this.getCurveValue(s);switch(n){case g.setup:o.shearY=o.data.shearY+h*r;break;case g.first:case g.replace:o.shearY+=(o.data.shearY+h-o.shearY)*r;break;case g.add:o.shearY+=h*r}}}class T extends w{constructor(t,e,s){super(t,e,["7|"+s,"8|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 5}setFrame(t,e,s,i,r,n){t*=5,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=n}apply(t,e,s,i,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(s<h[0]){let t=o.data.color;switch(n){case g.setup:return void l.setFromColor(t);case g.first:l.add((t.r-l.r)*r,(t.g-l.g)*r,(t.b-l.b)*r,(t.a-l.a)*r)}return}let c=0,d=0,u=0,m=0,f=x.search(h,s,5),p=this.curves[f/5];switch(p){case 0:let t=h[f];c=h[f+1],d=h[f+2],u=h[f+3],m=h[f+4];let e=(s-t)/(h[f+5]-t);c+=(h[f+5+1]-c)*e,d+=(h[f+5+2]-d)*e,u+=(h[f+5+3]-u)*e,m+=(h[f+5+4]-m)*e;break;case 1:c=h[f+1],d=h[f+2],u=h[f+3],m=h[f+4];break;default:c=this.getBezierValue(s,f,1,p-2),d=this.getBezierValue(s,f,2,p+18-2),u=this.getBezierValue(s,f,3,p+36-2),m=this.getBezierValue(s,f,4,p+54-2)}1==r?l.set(c,d,u,m):(n==g.setup&&l.setFromColor(o.data.color),l.add((c-l.r)*r,(d-l.g)*r,(u-l.b)*r,(m-l.a)*r))}}class Y extends w{constructor(t,e,s){super(t,e,["7|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,i,r){t<<=2,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=r}apply(t,e,s,i,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(s<h[0]){let t=o.data.color;switch(n){case g.setup:return l.r=t.r,l.g=t.g,void(l.b=t.b);case g.first:l.r+=(t.r-l.r)*r,l.g+=(t.g-l.g)*r,l.b+=(t.b-l.b)*r}return}let c=0,d=0,u=0,m=x.search(h,s,4),f=this.curves[m>>2];switch(f){case 0:let t=h[m];c=h[m+1],d=h[m+2],u=h[m+3];let e=(s-t)/(h[m+4]-t);c+=(h[m+4+1]-c)*e,d+=(h[m+4+2]-d)*e,u+=(h[m+4+3]-u)*e;break;case 1:c=h[m+1],d=h[m+2],u=h[m+3];break;default:c=this.getBezierValue(s,m,1,f-2),d=this.getBezierValue(s,m,2,f+18-2),u=this.getBezierValue(s,m,3,f+36-2)}if(1==r)l.r=c,l.g=d,l.b=u;else{if(n==g.setup){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*r,l.g+=(d-l.g)*r,l.b+=(u-l.b)*r}}}class X extends b{constructor(t,e,s){super(t,e,"8|"+s),this.slotIndex=0,this.slotIndex=s}apply(t,e,s,i,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(s<this.frames[0]){let t=o.data.color;switch(n){case g.setup:return void(h.a=t.a);case g.first:h.a+=(t.a-h.a)*r}return}let l=this.getCurveValue(s);1==r?h.a=l:(n==g.setup&&(h.a=o.data.color.a),h.a+=(l-h.a)*r)}}class P extends w{constructor(t,e,s){super(t,e,["7|"+s,"8|"+s,"9|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 8}setFrame(t,e,s,i,r,n,a,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o,this.frames[t+7]=h}apply(t,e,s,i,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(s<h[0]){let t=o.data.color,e=o.data.darkColor;switch(n){case g.setup:return l.setFromColor(t),c.r=e.r,c.g=e.g,void(c.b=e.b);case g.first:l.add((t.r-l.r)*r,(t.g-l.g)*r,(t.b-l.b)*r,(t.a-l.a)*r),c.r+=(e.r-c.r)*r,c.g+=(e.g-c.g)*r,c.b+=(e.b-c.b)*r}return}let d=0,u=0,m=0,f=0,p=0,w=0,b=0,y=x.search(h,s,8),v=this.curves[y>>3];switch(v){case 0:let t=h[y];d=h[y+1],u=h[y+2],m=h[y+3],f=h[y+4],p=h[y+5],w=h[y+6],b=h[y+7];let e=(s-t)/(h[y+8]-t);d+=(h[y+8+1]-d)*e,u+=(h[y+8+2]-u)*e,m+=(h[y+8+3]-m)*e,f+=(h[y+8+4]-f)*e,p+=(h[y+8+5]-p)*e,w+=(h[y+8+6]-w)*e,b+=(h[y+8+7]-b)*e;break;case 1:d=h[y+1],u=h[y+2],m=h[y+3],f=h[y+4],p=h[y+5],w=h[y+6],b=h[y+7];break;default:d=this.getBezierValue(s,y,1,v-2),u=this.getBezierValue(s,y,2,v+18-2),m=this.getBezierValue(s,y,3,v+36-2),f=this.getBezierValue(s,y,4,v+54-2),p=this.getBezierValue(s,y,5,v+72-2),w=this.getBezierValue(s,y,6,v+90-2),b=this.getBezierValue(s,y,7,v+108-2)}if(1==r)l.set(d,u,m,f),c.r=p,c.g=w,c.b=b;else{if(n==g.setup){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((d-l.r)*r,(u-l.g)*r,(m-l.b)*r,(f-l.a)*r),c.r+=(p-c.r)*r,c.g+=(w-c.g)*r,c.b+=(b-c.b)*r}}}class L extends w{constructor(t,e,s){super(t,e,["7|"+s,"9|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,i,r,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,s,i,r,n,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(s<h[0]){let t=o.data.color,e=o.data.darkColor;switch(n){case g.setup:return l.r=t.r,l.g=t.g,l.b=t.b,c.r=e.r,c.g=e.g,void(c.b=e.b);case g.first:l.r+=(t.r-l.r)*r,l.g+=(t.g-l.g)*r,l.b+=(t.b-l.b)*r,c.r+=(e.r-c.r)*r,c.g+=(e.g-c.g)*r,c.b+=(e.b-c.b)*r}return}let d=0,u=0,m=0,f=0,p=0,w=0,b=x.search(h,s,7),y=this.curves[b/7];switch(y){case 0:let t=h[b];d=h[b+1],u=h[b+2],m=h[b+3],f=h[b+4],p=h[b+5],w=h[b+6];let e=(s-t)/(h[b+7]-t);d+=(h[b+7+1]-d)*e,u+=(h[b+7+2]-u)*e,m+=(h[b+7+3]-m)*e,f+=(h[b+7+4]-f)*e,p+=(h[b+7+5]-p)*e,w+=(h[b+7+6]-w)*e;break;case 1:d=h[b+1],u=h[b+2],m=h[b+3],f=h[b+4],p=h[b+5],w=h[b+6];break;default:d=this.getBezierValue(s,b,1,y-2),u=this.getBezierValue(s,b,2,y+18-2),m=this.getBezierValue(s,b,3,y+36-2),f=this.getBezierValue(s,b,4,y+54-2),p=this.getBezierValue(s,b,5,y+72-2),w=this.getBezierValue(s,b,6,y+90-2)}if(1==r)l.r=d,l.g=u,l.b=m,c.r=f,c.g=p,c.b=w;else{if(n==g.setup){let t=o.data.color,e=o.data.darkColor;l.r=t.r,l.g=t.g,l.b=t.b,c.r=e.r,c.g=e.g,c.b=e.b}l.r+=(d-l.r)*r,l.g+=(u-l.g)*r,l.b+=(m-l.b)*r,c.r+=(f-c.r)*r,c.g+=(p-c.g)*r,c.b+=(w-c.b)*r}}}class B extends x{constructor(t,e){super(t,["10|"+e]),this.slotIndex=0,this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.attachmentNames[t]=s}apply(t,e,s,i,r,n,a){let o=t.slots[this.slotIndex];o.bone.active&&(a!=p.mixOut?s<this.frames[0]?n!=g.setup&&n!=g.first||this.setAttachment(t,o,o.data.attachmentName):this.setAttachment(t,o,this.attachmentNames[x.search1(this.frames,s)]):n==g.setup&&this.setAttachment(t,o,o.data.attachmentName))}setAttachment(t,e,s){e.setAttachment(s?t.getAttachment(this.slotIndex,s):null)}}class V extends w{constructor(t,e,s,i){super(t,e,["11|"+s+"|"+i.id]),this.slotIndex=0,this.slotIndex=s,this.attachment=i,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.vertices[t]=s}setBezier(t,e,s,i,r,n,a,o,h,l,c){let d=this.curves,u=this.getFrameCount()+18*t;0==s&&(d[e]=2+u);let m=.03*(i-2*n+o),f=.03*h-.06*a,g=.006*(3*(n-o)-i+l),p=.018*(a-h+.33333333),x=2*m+g,w=2*f+p,b=.3*(n-i)+m+.16666667*g,y=.3*a+f+.16666667*p,v=i+b,A=y;for(let t=u+18;u<t;u+=2)d[u]=v,d[u+1]=A,b+=x,y+=w,x+=g,w+=p,v+=b,A+=y}getCurvePercent(t,e){let s=this.curves,i=s[e];switch(i){case 0:let s=this.frames[e];return(t-s)/(this.frames[e+this.getFrameEntries()]-s);case 1:return 0}if(i-=2,s[i]>t){let r=this.frames[e];return s[i+1]*(t-r)/(s[i]-r)}let r=i+18;for(i+=2;i<r;i+=2)if(s[i]>=t){let e=s[i-2],r=s[i-1];return r+(t-e)/(s[i]-e)*(s[i+1]-r)}let n=s[r-2],a=s[r-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,s,i,r,n,o){let h=t.slots[this.slotIndex];if(!h.bone.active)return;let l=h.getAttachment();if(!l)return;if(!(l instanceof d)||l.timelineAttachment!=this.attachment)return;let c=h.deform;0==c.length&&(n=g.setup);let u=this.vertices,m=u[0].length,f=this.frames;if(s<f[0]){switch(n){case g.setup:return void(c.length=0);case g.first:if(1==r)return void(c.length=0);c.length=m;let t=l;if(t.bones)for(r=1-r,p=0;p<m;p++)c[p]*=r;else{let e=t.vertices;for(var p=0;p<m;p++)c[p]+=(e[p]-c[p])*r}}return}if(c.length=m,s>=f[f.length-1]){let t=u[f.length-1];if(1==r)if(n==g.add){let e=l;if(e.bones)for(let e=0;e<m;e++)c[e]+=t[e];else{let s=e.vertices;for(let e=0;e<m;e++)c[e]+=t[e]-s[e]}}else a.arrayCopy(t,0,c,0,m);else switch(n){case g.setup:{let e=l;if(e.bones)for(let e=0;e<m;e++)c[e]=t[e]*r;else{let s=e.vertices;for(let e=0;e<m;e++){let i=s[e];c[e]=i+(t[e]-i)*r}}break}case g.first:case g.replace:for(let e=0;e<m;e++)c[e]+=(t[e]-c[e])*r;break;case g.add:let e=l;if(e.bones)for(let e=0;e<m;e++)c[e]+=t[e]*r;else{let s=e.vertices;for(let e=0;e<m;e++)c[e]+=(t[e]-s[e])*r}}return}let w=x.search1(f,s),b=this.getCurvePercent(s,w),y=u[w],v=u[w+1];if(1==r)if(n==g.add){let t=l;if(t.bones)for(let t=0;t<m;t++){let e=y[t];c[t]+=e+(v[t]-e)*b}else{let e=t.vertices;for(let t=0;t<m;t++){let s=y[t];c[t]+=s+(v[t]-s)*b-e[t]}}}else for(let t=0;t<m;t++){let e=y[t];c[t]=e+(v[t]-e)*b}else switch(n){case g.setup:{let t=l;if(t.bones)for(let t=0;t<m;t++){let e=y[t];c[t]=(e+(v[t]-e)*b)*r}else{let e=t.vertices;for(let t=0;t<m;t++){let s=y[t],i=e[t];c[t]=i+(s+(v[t]-s)*b-i)*r}}break}case g.first:case g.replace:for(let t=0;t<m;t++){let e=y[t];c[t]+=(e+(v[t]-e)*b-c[t])*r}break;case g.add:let t=l;if(t.bones)for(let t=0;t<m;t++){let e=y[t];c[t]+=(e+(v[t]-e)*b)*r}else{let e=t.vertices;for(let t=0;t<m;t++){let s=y[t];c[t]+=(s+(v[t]-s)*b-e[t])*r}}}}}class D extends x{constructor(t){super(t,D.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,s,i,r,n,a){if(!i)return;let o=this.frames,h=this.frames.length;if(e>s)this.apply(t,e,Number.MAX_VALUE,i,r,n,a),e=-1;else if(e>=o[h-1])return;if(s<o[0])return;let l=0;if(e<o[0])l=0;else{l=x.search1(o,e)+1;let t=o[l];for(;l>0&&o[l-1]==t;)l--}for(;l<h&&s>=o[l];l++)i.push(this.events[l])}}D.propertyIds=["12"];class _ extends x{constructor(t){super(t,_.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.drawOrders[t]=s}apply(t,e,s,i,r,n,o){if(o==p.mixOut)return void(n==g.setup&&a.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(s<this.frames[0])return void(n!=g.setup&&n!=g.first||a.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let h=x.search1(this.frames,s),l=this.drawOrders[h];if(l){let e=t.drawOrder,s=t.slots;for(let t=0,i=l.length;t<i;t++)e[t]=s[l[t]]}else a.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)}}_.propertyIds=["13"];class N extends w{constructor(t,e,s){super(t,e,["14|"+s]),this.ikConstraintIndex=0,this.ikConstraintIndex=s}getFrameEntries(){return 6}setFrame(t,e,s,i,r,n,a){t*=6,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=n?1:0,this.frames[t+5]=a?1:0}apply(t,e,s,i,r,n,a){let o=t.ikConstraints[this.ikConstraintIndex];if(!o.active)return;let h=this.frames;if(s<h[0]){switch(n){case g.setup:return o.mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,void(o.stretch=o.data.stretch);case g.first:o.mix+=(o.data.mix-o.mix)*r,o.softness+=(o.data.softness-o.softness)*r,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}return}let l=0,c=0,d=x.search(h,s,6),u=this.curves[d/6];switch(u){case 0:let t=h[d];l=h[d+1],c=h[d+2];let e=(s-t)/(h[d+6]-t);l+=(h[d+6+1]-l)*e,c+=(h[d+6+2]-c)*e;break;case 1:l=h[d+1],c=h[d+2];break;default:l=this.getBezierValue(s,d,1,u-2),c=this.getBezierValue(s,d,2,u+18-2)}n==g.setup?(o.mix=o.data.mix+(l-o.data.mix)*r,o.softness=o.data.softness+(c-o.data.softness)*r,a==p.mixOut?(o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch):(o.bendDirection=h[d+3],o.compress=0!=h[d+4],o.stretch=0!=h[d+5])):(o.mix+=(l-o.mix)*r,o.softness+=(c-o.softness)*r,a==p.mixIn&&(o.bendDirection=h[d+3],o.compress=0!=h[d+4],o.stretch=0!=h[d+5]))}}class O extends w{constructor(t,e,s){super(t,e,["15|"+s]),this.transformConstraintIndex=0,this.transformConstraintIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,i,r,n,a,o){let h=this.frames;h[t*=7]=e,h[t+1]=s,h[t+2]=i,h[t+3]=r,h[t+4]=n,h[t+5]=a,h[t+6]=o}apply(t,e,s,i,r,n,a){let o=t.transformConstraints[this.transformConstraintIndex];if(!o.active)return;let h,l,c,d,u,m,f=this.frames;if(s<f[0]){let t=o.data;switch(n){case g.setup:return o.mixRotate=t.mixRotate,o.mixX=t.mixX,o.mixY=t.mixY,o.mixScaleX=t.mixScaleX,o.mixScaleY=t.mixScaleY,void(o.mixShearY=t.mixShearY);case g.first:o.mixRotate+=(t.mixRotate-o.mixRotate)*r,o.mixX+=(t.mixX-o.mixX)*r,o.mixY+=(t.mixY-o.mixY)*r,o.mixScaleX+=(t.mixScaleX-o.mixScaleX)*r,o.mixScaleY+=(t.mixScaleY-o.mixScaleY)*r,o.mixShearY+=(t.mixShearY-o.mixShearY)*r}return}let p=x.search(f,s,7),w=this.curves[p/7];switch(w){case 0:let t=f[p];h=f[p+1],l=f[p+2],c=f[p+3],d=f[p+4],u=f[p+5],m=f[p+6];let e=(s-t)/(f[p+7]-t);h+=(f[p+7+1]-h)*e,l+=(f[p+7+2]-l)*e,c+=(f[p+7+3]-c)*e,d+=(f[p+7+4]-d)*e,u+=(f[p+7+5]-u)*e,m+=(f[p+7+6]-m)*e;break;case 1:h=f[p+1],l=f[p+2],c=f[p+3],d=f[p+4],u=f[p+5],m=f[p+6];break;default:h=this.getBezierValue(s,p,1,w-2),l=this.getBezierValue(s,p,2,w+18-2),c=this.getBezierValue(s,p,3,w+36-2),d=this.getBezierValue(s,p,4,w+54-2),u=this.getBezierValue(s,p,5,w+72-2),m=this.getBezierValue(s,p,6,w+90-2)}if(n==g.setup){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(l-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r,o.mixScaleX=t.mixScaleX+(d-t.mixScaleX)*r,o.mixScaleY=t.mixScaleY+(u-t.mixScaleY)*r,o.mixShearY=t.mixShearY+(m-t.mixShearY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(l-o.mixX)*r,o.mixY+=(c-o.mixY)*r,o.mixScaleX+=(d-o.mixScaleX)*r,o.mixScaleY+=(u-o.mixScaleY)*r,o.mixShearY+=(m-o.mixShearY)*r}}class U extends b{constructor(t,e,s){super(t,e,"16|"+s),this.pathConstraintIndex=0,this.pathConstraintIndex=s}apply(t,e,s,i,r,n,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.position=o.data.position);case g.first:o.position+=(o.data.position-o.position)*r}return}let h=this.getCurveValue(s);n==g.setup?o.position=o.data.position+(h-o.data.position)*r:o.position+=(h-o.position)*r}}class W extends b{constructor(t,e,s){super(t,e,"17|"+s),this.pathConstraintIndex=0,this.pathConstraintIndex=s}apply(t,e,s,i,r,n,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(s<this.frames[0]){switch(n){case g.setup:return void(o.spacing=o.data.spacing);case g.first:o.spacing+=(o.data.spacing-o.spacing)*r}return}let h=this.getCurveValue(s);n==g.setup?o.spacing=o.data.spacing+(h-o.data.spacing)*r:o.spacing+=(h-o.spacing)*r}}class q extends w{constructor(t,e,s){super(t,e,["18|"+s]),this.pathConstraintIndex=0,this.pathConstraintIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,i,r){let n=this.frames;n[t<<=2]=e,n[t+1]=s,n[t+2]=i,n[t+3]=r}apply(t,e,s,i,r,n,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;let h,l,c,d=this.frames;if(s<d[0]){switch(n){case g.setup:return o.mixRotate=o.data.mixRotate,o.mixX=o.data.mixX,void(o.mixY=o.data.mixY);case g.first:o.mixRotate+=(o.data.mixRotate-o.mixRotate)*r,o.mixX+=(o.data.mixX-o.mixX)*r,o.mixY+=(o.data.mixY-o.mixY)*r}return}let u=x.search(d,s,4),m=this.curves[u>>2];switch(m){case 0:let t=d[u];h=d[u+1],l=d[u+2],c=d[u+3];let e=(s-t)/(d[u+4]-t);h+=(d[u+4+1]-h)*e,l+=(d[u+4+2]-l)*e,c+=(d[u+4+3]-c)*e;break;case 1:h=d[u+1],l=d[u+2],c=d[u+3];break;default:h=this.getBezierValue(s,u,1,m-2),l=this.getBezierValue(s,u,2,m+18-2),c=this.getBezierValue(s,u,3,m+36-2)}if(n==g.setup){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(l-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(l-o.mixX)*r,o.mixY+=(c-o.mixY)*r}}class z extends x{constructor(t,e,s){super(t,["19|"+e+"|"+s.sequence.id]),this.slotIndex=e,this.attachment=s}getFrameEntries(){return z.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,s,i,r){let n=this.frames;n[t*=z.ENTRIES]=e,n[t+z.MODE]=s|i<<4,n[t+z.DELAY]=r}apply(e,s,i,r,n,a,o){let h=e.slots[this.slotIndex];if(!h.bone.active)return;let l=h.attachment,c=this.attachment;if(!(l==c||l instanceof d&&l.timelineAttachment==c))return;let u=this.frames;if(i<u[0])return void(a!=g.setup&&a!=g.first||(h.sequenceIndex=-1));let f=x.search(u,i,z.ENTRIES),p=u[f],w=u[f+z.MODE],b=u[f+z.DELAY];if(!this.attachment.sequence)return;let y=w>>4,v=this.attachment.sequence.regions.length,A=m[15&w];if(A!=t.hold)switch(y+=(i-p)/b+1e-5|0,A){case t.once:y=Math.min(v-1,y);break;case t.loop:y%=v;break;case t.pingpong:{let t=(v<<1)-2;y=0==t?0:y%t,y>=v&&(y=t-y);break}case t.onceReverse:y=Math.max(v-1-y,0);break;case t.loopReverse:y=v-1-y%v;break;case t.pingpongReverse:{let t=(v<<1)-2;y=0==t?0:(y+v-1)%t,y>=v&&(y=t-y)}}h.sequenceIndex=y}}z.ENTRIES=3,z.MODE=1,z.DELAY=2;class ${static emptyAnimation(){return $._emptyAnimation}constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new G(this),this.propertyIDs=new i,this.animationsChanged=!1,this.trackEntryPool=new o((()=>new H)),this.data=t}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(!i)continue;i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast;let r=t*i.timeScale;if(i.delay>0){if(i.delay-=r,i.delay>0)continue;r=-i.delay,i.delay=0}let n=i.next;if(n){let e=i.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==i.timeScale?0:(e/i.timeScale+t)*n.timeScale,i.trackTime+=r,this.setCurrent(s,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&!i.mixingFrom){e[s]=null,this.queue.end(i),this.clearNext(i);continue}if(i.mixingFrom&&this.updateMixingFrom(i,t)){let t=i.mixingFrom;for(i.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}i.trackTime+=r}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let i=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=s.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=s.mixingFrom,s.mixingFrom&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),i):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,s=this.tracks,i=!1;for(let n=0,o=s.length;n<o;n++){let o=s[n];if(!o||o.delay>0)continue;i=!0;let h=0==n?g.first:o.mixBlend,l=o.alpha;o.mixingFrom?l*=this.applyMixingFrom(o,t,h):o.trackTime>=o.trackEnd&&!o.next&&(l=0);let c=o.animationLast,d=o.getAnimationTime(),u=d,m=e;o.reverse&&(u=o.animation.duration-u,m=null);let f=o.animation.timelines,x=f.length;if(0==n&&1==l||h==g.add)for(let e=0;e<x;e++){a.webkit602BugfixHelper(l,h);var r=f[e];r instanceof B?this.applyAttachmentTimeline(r,t,u,h,!0):r.apply(t,c,u,m,l,h,p.mixIn)}else{let e=o.timelineMode,s=o.shortestRotation,i=!s&&o.timelinesRotation.length!=x<<1;i&&(o.timelinesRotation.length=x<<1);for(let r=0;r<x;r++){let n=f[r],d=e[r]==K?h:g.setup;!s&&n instanceof v?this.applyRotateTimeline(n,t,u,l,d,o.timelinesRotation,r<<1,i):n instanceof B?this.applyAttachmentTimeline(n,t,u,h,!0):(a.webkit602BugfixHelper(l,h),n.apply(t,c,u,m,l,d,p.mixIn))}}this.queueEvents(o,d),e.length=0,o.nextAnimationLast=d,o.nextTrackLast=o.trackTime}for(var n=this.unkeyedState+et,o=t.slots,h=0,l=t.slots.length;h<l;h++){var c=o[h];if(c.attachmentState==n){var d=c.data.attachmentName;c.setAttachment(d?t.getAttachment(c.data.index,d):null)}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(t,e,s){let i=t.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,e,s);let r=0;0==t.mixDuration?(r=1,s==g.first&&(s=g.setup)):(r=t.mixTime/t.mixDuration,r>1&&(r=1),s!=g.first&&(s=i.mixBlend));let n=r<i.attachmentThreshold,o=r<i.drawOrderThreshold,h=i.animation.timelines,l=h.length,c=i.alpha*t.interruptAlpha,d=c*(1-r),u=i.animationLast,m=i.getAnimationTime(),f=m,x=null;if(i.reverse?f=i.animation.duration-f:r<i.eventThreshold&&(x=this.events),s==g.add)for(let t=0;t<l;t++)h[t].apply(e,u,f,x,d,s,p.mixOut);else{let t=i.timelineMode,r=i.timelineHoldMix,m=i.shortestRotation,w=!m&&i.timelinesRotation.length!=l<<1;w&&(i.timelinesRotation.length=l<<1),i.totalAlpha=0;for(let b=0;b<l;b++){let l,y=h[b],A=p.mixOut,k=0;switch(t[b]){case K:if(!o&&y instanceof _)continue;l=s,k=d;break;case J:l=g.setup,k=d;break;case Q:l=s,k=c;break;case Z:l=g.setup,k=c;break;default:l=g.setup;let t=r[b];k=c*Math.max(0,1-t.mixTime/t.mixDuration)}i.totalAlpha+=k,!m&&y instanceof v?this.applyRotateTimeline(y,e,f,k,l,i.timelinesRotation,b<<1,w):y instanceof B?this.applyAttachmentTimeline(y,e,f,l,n):(a.webkit602BugfixHelper(k,s),o&&y instanceof _&&l==g.setup&&(A=p.mixIn),y.apply(e,u,f,x,k,l,A))}}return t.mixDuration>0&&this.queueEvents(i,m),this.events.length=0,i.nextAnimationLast=m,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(t,e,s,i,r){var n=e.slots[t.slotIndex];n.bone.active&&(s<t.frames[0]?i!=g.setup&&i!=g.first||this.setAttachment(e,n,n.data.attachmentName,r):this.setAttachment(e,n,t.attachmentNames[x.search1(t.frames,s)],r),n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+et))}setAttachment(t,e,s,i){e.setAttachment(s?t.getAttachment(e.data.index,s):null),i&&(e.attachmentState=this.unkeyedState+st)}applyRotateTimeline(t,e,s,i,r,a,o,h){if(h&&(a[o]=0),1==i)return void t.apply(e,0,s,null,1,r,p.mixIn);let l=e.bones[t.boneIndex];if(!l.active)return;let c=0,d=0;if(s<t.frames[0])switch(r){case g.setup:l.rotation=l.data.rotation;default:return;case g.first:c=l.rotation,d=l.data.rotation}else c=r==g.setup?l.data.rotation:l.rotation,d=l.data.rotation+t.getCurveValue(s);let u=0,m=d-c;if(m-=360*(16384-(16384.499999999996-m/360|0)),0==m)u=a[o];else{let t=0,e=0;h?(t=0,e=m):(t=a[o],e=a[o+1]);let s=t-t%360;u=m+s;let i=m>=0,r=t>=0;Math.abs(e)<=90&&n.signum(e)!=n.signum(m)&&(Math.abs(t-s)>180?(u+=360*n.signum(t),r=i):0!=s?u-=360*n.signum(t):r=i),r!=i&&(u+=360*n.signum(t)),a[o]=u}a[o+1]=m,l.rotation=c+u*i}queueEvents(t,e){let s=t.animationStart,i=t.animationEnd,r=i-s,n=t.trackLast%r,a=this.events,o=0,h=a.length;for(;o<h;o++){let e=a[o];if(e.time<n)break;e.time>i||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==r||n>t.trackTime%r:e>=i&&t.animationLast<i,l&&this.queue.complete(t);o<h;o++){let e=a[o];e.time<s||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){let t=s.mixingFrom;if(!t)break;this.queue.end(t),s.mixingFrom=null,s.mixingTo=null,s=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let i=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,i&&(s&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let i=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,i=!1):this.clearNext(r));let n=this.trackEntry(t,e,s,r);return this.setCurrent(t,n,i),this.queue.drain(),n}addAnimation(t,e,s=!1,i=0){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,s,i)}addAnimationWith(t,e,s=!1,i=0){if(!e)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let n=this.trackEntry(t,e,s,r);return r?(r.next=n,n.previous=r,i<=0&&(i+=r.getTrackComplete()-n.mixDuration)):(this.setCurrent(t,n,!0),this.queue.drain()),n.delay=i,n}setEmptyAnimation(t,e=0){let s=this.setAnimationWith(t,$.emptyAnimation(),!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){let i=this.addAnimationWith(t,$.emptyAnimation(),!1,s);return s<=0&&(i.delay+=i.mixDuration-e),i.mixDuration=e,i.trackEnd=e,i}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++){let s=this.tracks[e];s&&this.setEmptyAnimation(s.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(a.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,s,i){let r=this.trackEntryPool.obtain();return r.reset(),r.trackIndex=t,r.animation=e,r.loop=s,r.holdPrevious=!1,r.reverse=!1,r.shortestRotation=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=e.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.mixTime=0,r.mixDuration=i?this.data.getMix(i.animation,e):0,r.interruptAlpha=1,r.totalAlpha=0,r.mixBlend=g.replace,r}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,s=t.length;e<s;e++){let s=t[e];if(s){for(;s.mixingFrom;)s=s.mixingFrom;do{s.mixingTo&&s.mixBlend==g.add||this.computeHold(s),s=s.mixingTo}while(s)}}}computeHold(t){let e=t.mixingTo,s=t.animation.timelines,i=t.animation.timelines.length,r=t.timelineMode;r.length=i;let n=t.timelineHoldMix;n.length=0;let a=this.propertyIDs;if(e&&e.holdPrevious)for(let t=0;t<i;t++)r[t]=a.addAll(s[t].getPropertyIds())?Z:Q;else t:for(let o=0;o<i;o++){let i=s[o],h=i.getPropertyIds();if(a.addAll(h))if(!e||i instanceof B||i instanceof _||i instanceof D||!e.animation.hasTimeline(h))r[o]=J;else{for(let s=e.mixingTo;s;s=s.mixingTo)if(!s.animation.hasTimeline(h)){if(t.mixDuration>0){r[o]=tt,n[o]=s;continue t}break}r[o]=Z}else r[o]=K}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}$._emptyAnimation=new f("<empty>",[],0);class H{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=g.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=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}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}}class G{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(j.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(j.interrupt),this.objects.push(t)}end(t){this.objects.push(j.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(j.dispose),this.objects.push(t)}complete(t){this.objects.push(j.complete),this.objects.push(t)}event(t,e){this.objects.push(j.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let s=0;s<t.length;s+=2){let i=t[s],r=t[s+1];switch(i){case j.start:r.listener&&r.listener.start&&r.listener.start(r);for(let t=0;t<e.length;t++){let s=e[t];s.start&&s.start(r)}break;case j.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let t=0;t<e.length;t++){let s=e[t];s.interrupt&&s.interrupt(r)}break;case j.end:r.listener&&r.listener.end&&r.listener.end(r);for(let t=0;t<e.length;t++){let s=e[t];s.end&&s.end(r)}case j.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let t=0;t<e.length;t++){let s=e[t];s.dispose&&s.dispose(r)}this.animState.trackEntryPool.free(r);break;case j.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let t=0;t<e.length;t++){let s=e[t];s.complete&&s.complete(r)}break;case j.event:let i=t[2+s++];r.listener&&r.listener.event&&r.listener.event(r,i);for(let t=0;t<e.length;t++){let s=e[t];s.event&&s.event(r,i)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}var j;!function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(j||(j={}));const K=0,J=1,Q=2,Z=3,tt=4,et=1,st=2;class it{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(i,r,s)}setMixWith(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let i=t.name+"."+e.name;this.animationToMixTime[i]=s}getMix(t,e){let s=t.name+"."+e.name,i=this.animationToMixTime[s];return void 0===i?this.defaultMix:i}}class rt extends d{constructor(t){super(t),this.color=new r(1,1,1,1)}copy(){let t=new rt(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}class nt extends d{constructor(t){super(t),this.endSlot=null,this.color=new r(.2275,.2275,.8078,1)}copy(){let t=new nt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}class at{constructor(t){this._image=t}getImage(){return this._image}}var ot,ht,lt,ct,dt,ut,mt,ft,gt;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(ot||(ot={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(ht||(ht={}));class pt{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}}class xt{constructor(t){this.pages=new Array,this.regions=new Array;let e=new wt(t),s=new Array(4),i={size:t=>{t.width=parseInt(s[1]),t.height=parseInt(s[2])},format:()=>{},filter:t=>{t.minFilter=a.enumValue(ot,s[1]),t.magFilter=a.enumValue(ot,s[2])},repeat:t=>{-1!=s[1].indexOf("x")&&(t.uWrap=ht.Repeat),-1!=s[1].indexOf("y")&&(t.vWrap=ht.Repeat)},pma:t=>{t.pma="true"==s[1]}};var r={xy:t=>{t.x=parseInt(s[1]),t.y=parseInt(s[2])},size:t=>{t.width=parseInt(s[1]),t.height=parseInt(s[2])},bounds:t=>{t.x=parseInt(s[1]),t.y=parseInt(s[2]),t.width=parseInt(s[3]),t.height=parseInt(s[4])},offset:t=>{t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2])},orig:t=>{t.originalWidth=parseInt(s[1]),t.originalHeight=parseInt(s[2])},offsets:t=>{t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2]),t.originalWidth=parseInt(s[3]),t.originalHeight=parseInt(s[4])},rotate:t=>{let e=s[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(s[1])}};let n=e.readLine();for(;n&&0==n.trim().length;)n=e.readLine();for(;n&&0!=n.trim().length&&0!=e.readEntry(s,n);)n=e.readLine();let o=null,h=null,l=null;for(;null!==n;)if(0==n.trim().length)o=null,n=e.readLine();else if(o){let t=new yt(o,n);for(;;){let i=e.readEntry(s,n=e.readLine());if(0==i)break;let a=r[s[0]];if(a)a(t);else{h||(h=[]),l||(l=[]),h.push(s[0]);let t=[];for(let e=0;e<i;e++)t.push(parseInt(s[e+1]));l.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),h&&h.length>0&&l&&l.length>0&&(t.names=h,t.values=l,h=null,l=null),t.u=t.x/o.width,t.v=t.y/o.height,90==t.degrees?(t.u2=(t.x+t.height)/o.width,t.v2=(t.y+t.width)/o.height):(t.u2=(t.x+t.width)/o.width,t.v2=(t.y+t.height)/o.height),this.regions.push(t)}else{for(o=new bt(n.trim());0!=e.readEntry(s,n=e.readLine());){let t=i[s[0]];t&&t(o)}this.pages.push(o)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){var t;for(let e=0;e<this.pages.length;e++)null===(t=this.pages[e].texture)||void 0===t||t.dispose()}}class wt{constructor(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let s=e.indexOf(":");if(-1==s)return 0;t[0]=e.substr(0,s).trim();for(let i=1,r=s+1;;i++){let s=e.indexOf("