@esotericsoftware/spine-canvas 4.2.112 → 4.2.113

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.
@@ -1,2 +1,2 @@
1
- "use strict";var Ns=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},_e=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,r=e.length;s<r;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},D=class ge{constructor(t=0,s=0,r=0,i=0){this.r=t,this.g=s,this.b=r,this.a=i}static WHITE=new ge(1,1,1,1);static RED=new ge(1,0,0,1);static GREEN=new ge(0,1,0,1);static BLUE=new ge(0,0,1,1);static MAGENTA=new ge(1,0,1,1);set(t,s,r,i){return this.r=t,this.g=s,this.b=r,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=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,s,r,i){return this.r+=t,this.g+=s,this.b+=r,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,s){t.r=((s&4278190080)>>>24)/255,t.g=((s&16711680)>>>16)/255,t.b=((s&65280)>>>8)/255,t.a=(s&255)/255}static rgb888ToColor(t,s){t.r=((s&16711680)>>>16)/255,t.g=((s&65280)>>>8)/255,t.b=(s&255)/255}toRgb888(){const t=s=>("0"+(s*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,s=new ge){return s.setFromString(t)}},R=class le{static PI=3.1415927;static PI2=le.PI*2;static invPI2=1/le.PI2;static radiansToDegrees=180/le.PI;static radDeg=le.radiansToDegrees;static degreesToRadians=le.PI/180;static degRad=le.degreesToRadians;static clamp(t,s,r){return t<s?s:t>r?r:t}static cosDeg(t){return Math.cos(t*le.degRad)}static sinDeg(t){return Math.sin(t*le.degRad)}static atan2Deg(t,s){return Math.atan2(t,s)*le.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 s=Math.pow(Math.abs(t),.3333333333333333);return t<0?-s:s}static randomTriangular(t,s){return le.randomTriangularWith(t,s,(t+s)*.5)}static randomTriangularWith(t,s,r){let i=Math.random(),h=s-t;return i<=(r-t)/h?t+Math.sqrt(i*h*(r-t)):s-Math.sqrt((1-i)*h*(s-r))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},ts=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},ss=class extends ts{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Os=class extends ss{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},P=class pe{static SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";static arrayCopy(t,s,r,i,h){for(let o=s,a=i;o<s+h;o++,a++)r[a]=t[o]}static arrayFill(t,s,r,i){for(let h=s;h<r;h++)t[h]=i}static setArraySize(t,s,r=0){let i=t.length;if(i==s)return t;if(t.length=s,i<s)for(let h=i;h<s;h++)t[h]=r;return t}static ensureArrayCapacity(t,s,r=0){return t.length>=s?t:pe.setArraySize(t,s,r)}static newArray(t,s){let r=new Array(t);for(let i=0;i<t;i++)r[i]=s;return r}static newFloatArray(t){if(pe.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let s=new Array(t);for(let r=0;r<s.length;r++)s[r]=0;return s}}static newShortArray(t){if(pe.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let s=new Array(t);for(let r=0;r<s.length;r++)s[r]=0;return s}}static toFloatArray(t){return pe.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return pe.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,s){}static contains(t,s,r=!0){for(var i=0;i<t.length;i++)if(t[i]==s)return!0;return!1}static enumValue(t,s){return t[s[0].toUpperCase()+s.slice(1)]}},Ds=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}},Ae=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Xe=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},qs=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},Ws=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Ge=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},oe=class Ms extends Ge{static nextID=0;id=Ms.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,s,r,i,h,o){r=h+(r>>1)*o;let a=t.bone.skeleton,n=t.deform,l=this.vertices,c=this.bones;if(!c){n.length>0&&(l=n);let u=t.bone,x=u.worldX,w=u.worldY,p=u.a,g=u.b,b=u.c,y=u.d;for(let v=s,A=h;A<r;v+=2,A+=o){let S=l[v],I=l[v+1];i[A]=S*p+I*g+x,i[A+1]=S*b+I*y+w}return}let d=0,f=0;for(let u=0;u<s;u+=2){let x=c[d];d+=x+1,f+=x}let m=a.bones;if(n.length==0)for(let u=h,x=f*3;u<r;u+=o){let w=0,p=0,g=c[d++];for(g+=d;d<g;d++,x+=3){let b=m[c[d]],y=l[x],v=l[x+1],A=l[x+2];w+=(y*b.a+v*b.b+b.worldX)*A,p+=(y*b.c+v*b.d+b.worldY)*A}i[u]=w,i[u+1]=p}else{let u=n;for(let x=h,w=f*3,p=f<<1;x<r;x+=o){let g=0,b=0,y=c[d++];for(y+=d;d<y;d++,w+=3,p+=2){let v=m[c[d]],A=l[w]+u[p],S=l[w+1]+u[p+1],I=l[w+2];g+=(A*v.a+S*v.b+v.worldX)*I,b+=(A*v.c+S*v.d+v.worldY)*I}i[x]=g,i[x+1]=b}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),P.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=P.newFloatArray(this.vertices.length),P.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}},is=class Oe{static _nextID=0;id=Oe.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new Oe(this.regions.length);return P.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,s){let r=t.sequenceIndex;r==-1&&(r=this.setupIndex),r>=this.regions.length&&(r=this.regions.length-1);let i=this.regions[r];s.region!=i&&(s.region=i,s.updateRegion())}getPath(t,s){let r=t,i=(this.start+s).toString();for(let h=this.digits-i.length;h>0;h--)r+="0";return r+=i,r}static nextID(){return Oe._nextID++}},rs=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(rs||{}),as=[0,1,2,3,4,5,6],Fe=class{name;timelines=[];timelineIds=new _e;duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,s,r,i,h,o,a){if(!e)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let n=this.timelines;for(let l=0,c=n.length;l<c;l++)n[l].apply(e,t,s,i,h,o,a)}},ns=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(ns||{}),ls=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(ls||{}),q={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},J=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=P.newFloatArray(e*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(e,t){let s=e.length;for(let r=1;r<s;r++)if(e[r]>t)return r-1;return s-1}static search(e,t,s){let r=e.length;for(let i=s;i<r;i+=s)if(e[i]>t)return i-s;return r-s}},ae=class extends J{curves;constructor(e,t,s){super(e,s),this.curves=P.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let s=P.newFloatArray(t);P.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,r,i,h,o,a,n,l,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let m=(r-h*2+a)*.03,u=(i-o*2+n)*.03,x=((h-a)*3-r+l)*.006,w=((o-n)*3-i+c)*.006,p=m*2+x,g=u*2+w,b=(h-r)*.3+m+x*.16666667,y=(o-i)*.3+u+w*.16666667,v=r+b,A=i+y;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,b+=p,y+=g,p+=x,g+=w,v+=b,A+=y}getBezierValue(e,t,s,r){let i=this.curves;if(i[r]>e){let n=this.frames[t],l=this.frames[t+s];return l+(e-n)/(i[r]-n)*(i[r+1]-l)}let h=r+18;for(r+=2;r<h;r+=2)if(i[r]>=e){let n=i[r-2],l=i[r-1];return l+(e-n)/(i[r]-n)*(i[r+1]-l)}t+=this.getFrameEntries();let o=i[h-2],a=i[h-1];return a+(e-o)/(this.frames[t]-o)*(this.frames[t+s]-a)}},ie=class extends ae{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let i=2;i<=s;i+=2)if(t[i]>e){s=i-2;break}let r=this.curves[s>>1];switch(r){case 0:let i=t[s],h=t[s+1];return h+(e-i)/(t[s+2]-i)*(t[s+2+1]-h);case 1:return t[s+1]}return this.getBezierValue(e,s,1,r-2)}getRelativeValue(e,t,s,r,i){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}let h=this.getCurveValue(e);switch(s){case 0:return i+h*t;case 1:case 2:h+=i-r}return r+h*t}getAbsoluteValue(e,t,s,r,i){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}let h=this.getCurveValue(e);return s==0?i+(h-i)*t:r+(h-r)*t}getAbsoluteValue2(e,t,s,r,i,h){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}return s==0?i+(h-i)*t:r+(h-r)*t}getScaleValue(e,t,s,r,i,h){const o=this.frames;if(e<o[0]){switch(s){case 0:return h;case 1:return i+(h-i)*t}return i}let a=this.getCurveValue(e)*h;if(t==1)return s==3?i+a-h:a;if(r==1)switch(s){case 0:return h+(Math.abs(a)*R.signum(h)-h)*t;case 1:case 2:return i+(Math.abs(a)*R.signum(i)-i)*t}else{let n=0;switch(s){case 0:return n=Math.abs(h)*R.signum(a),n+(a-n)*t;case 1:case 2:return n=Math.abs(i)*R.signum(a),n+(a-n)*t}}return i+(a-h)*t}},Ee=class extends ae{constructor(e,t,s,r){super(e,t,[s,r])}getFrameEntries(){return 3}setFrame(e,t,s,r){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r}},Se=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.rotation=this.getRelativeValue(s,i,h,a.rotation,a.data.rotation))}},$e=class extends Ee{boneIndex=0;constructor(e,t,s){super(e,t,q.x+"|"+s,q.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.x=a.data.x,a.y=a.data.y;return;case 1:a.x+=(a.data.x-a.x)*i,a.y+=(a.data.y-a.y)*i}return}let l=0,c=0,d=J.search(n,s,3),f=this.curves[d/3];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+3]-m);l+=(n[d+3+1]-l)*u,c+=(n[d+3+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:a.x=a.data.x+l*i,a.y=a.data.y+c*i;break;case 1:case 2:a.x+=(a.data.x+l-a.x)*i,a.y+=(a.data.y+c-a.y)*i;break;case 3:a.x+=l*i,a.y+=c*i}}},He=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.x+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.x=this.getRelativeValue(s,i,h,a.x,a.data.x))}},Je=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.y=this.getRelativeValue(s,i,h,a.y,a.data.y))}},je=class extends Ee{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleX+"|"+s,q.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.scaleX=a.data.scaleX,a.scaleY=a.data.scaleY;return;case 1:a.scaleX+=(a.data.scaleX-a.scaleX)*i,a.scaleY+=(a.data.scaleY-a.scaleY)*i}return}let l,c,d=J.search(n,s,3),f=this.curves[d/3];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+3]-m);l+=(n[d+3+1]-l)*u,c+=(n[d+3+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}if(l*=a.data.scaleX,c*=a.data.scaleY,i==1)h==3?(a.scaleX+=l-a.data.scaleX,a.scaleY+=c-a.data.scaleY):(a.scaleX=l,a.scaleY=c);else{let m=0,u=0;if(o==1)switch(h){case 0:m=a.data.scaleX,u=a.data.scaleY,a.scaleX=m+(Math.abs(l)*R.signum(m)-m)*i,a.scaleY=u+(Math.abs(c)*R.signum(u)-u)*i;break;case 1:case 2:m=a.scaleX,u=a.scaleY,a.scaleX=m+(Math.abs(l)*R.signum(m)-m)*i,a.scaleY=u+(Math.abs(c)*R.signum(u)-u)*i;break;case 3:a.scaleX+=(l-a.data.scaleX)*i,a.scaleY+=(c-a.data.scaleY)*i}else switch(h){case 0:m=Math.abs(a.data.scaleX)*R.signum(l),u=Math.abs(a.data.scaleY)*R.signum(c),a.scaleX=m+(l-m)*i,a.scaleY=u+(c-u)*i;break;case 1:case 2:m=Math.abs(a.scaleX)*R.signum(l),u=Math.abs(a.scaleY)*R.signum(c),a.scaleX=m+(l-m)*i,a.scaleY=u+(c-u)*i;break;case 3:a.scaleX+=(l-a.data.scaleX)*i,a.scaleY+=(c-a.data.scaleY)*i}}}},Ke=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.scaleX=this.getScaleValue(s,i,h,o,a.scaleX,a.data.scaleX))}},Qe=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.scaleY=this.getScaleValue(s,i,h,o,a.scaleY,a.data.scaleY))}},Ze=class extends Ee{boneIndex=0;constructor(e,t,s){super(e,t,q.shearX+"|"+s,q.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.shearX=a.data.shearX,a.shearY=a.data.shearY;return;case 1:a.shearX+=(a.data.shearX-a.shearX)*i,a.shearY+=(a.data.shearY-a.shearY)*i}return}let l=0,c=0,d=J.search(n,s,3),f=this.curves[d/3];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+3]-m);l+=(n[d+3+1]-l)*u,c+=(n[d+3+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:a.shearX=a.data.shearX+l*i,a.shearY=a.data.shearY+c*i;break;case 1:case 2:a.shearX+=(a.data.shearX+l-a.shearX)*i,a.shearY+=(a.data.shearY+c-a.shearY)*i;break;case 3:a.shearX+=l*i,a.shearY+=c*i}}},et=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.shearX=this.getRelativeValue(s,i,h,a.shearX,a.data.shearX))}},tt=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.shearY=this.getRelativeValue(s,i,h,a.shearY,a.data.shearY))}},st=class extends J{boneIndex=0;constructor(e,t){super(e,[q.inherit+"|"+t]),this.boneIndex=t}getFrameEntries(){return 2}setFrame(e,t,s){e*=2,this.frames[e]=t,this.frames[e+1]=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;if(o==1){h==0&&(a.inherit=a.data.inherit);return}let n=this.frames;if(s<n[0]){(h==0||h==1)&&(a.inherit=a.data.inherit);return}a.inherit=this.frames[J.search(n,s,2)+1]}},it=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(e,t,s,r,i,h){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color;if(s<n[0]){let w=a.data.color;switch(h){case 0:l.setFromColor(w);return;case 1:l.add((w.r-l.r)*i,(w.g-l.g)*i,(w.b-l.b)*i,(w.a-l.a)*i)}return}let c=0,d=0,f=0,m=0,u=J.search(n,s,5),x=this.curves[u/5];switch(x){case 0:let w=n[u];c=n[u+1],d=n[u+2],f=n[u+3],m=n[u+4];let p=(s-w)/(n[u+5]-w);c+=(n[u+5+1]-c)*p,d+=(n[u+5+2]-d)*p,f+=(n[u+5+3]-f)*p,m+=(n[u+5+4]-m)*p;break;case 1:c=n[u+1],d=n[u+2],f=n[u+3],m=n[u+4];break;default:c=this.getBezierValue(s,u,1,x-2),d=this.getBezierValue(s,u,2,x+18-2),f=this.getBezierValue(s,u,3,x+18*2-2),m=this.getBezierValue(s,u,4,x+18*3-2)}i==1?l.set(c,d,f,m):(h==0&&l.setFromColor(a.data.color),l.add((c-l.r)*i,(d-l.g)*i,(f-l.b)*i,(m-l.a)*i))}},rt=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,i){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color;if(s<n[0]){let x=a.data.color;switch(h){case 0:l.r=x.r,l.g=x.g,l.b=x.b;return;case 1:l.r+=(x.r-l.r)*i,l.g+=(x.g-l.g)*i,l.b+=(x.b-l.b)*i}return}let c=0,d=0,f=0,m=J.search(n,s,4),u=this.curves[m>>2];switch(u){case 0:let x=n[m];c=n[m+1],d=n[m+2],f=n[m+3];let w=(s-x)/(n[m+4]-x);c+=(n[m+4+1]-c)*w,d+=(n[m+4+2]-d)*w,f+=(n[m+4+3]-f)*w;break;case 1:c=n[m+1],d=n[m+2],f=n[m+3];break;default:c=this.getBezierValue(s,m,1,u-2),d=this.getBezierValue(s,m,2,u+18-2),f=this.getBezierValue(s,m,3,u+18*2-2)}if(i==1)l.r=c,l.g=d,l.b=f;else{if(h==0){let x=a.data.color;l.r=x.r,l.g=x.g,l.b=x.b}l.r+=(c-l.r)*i,l.g+=(d-l.g)*i,l.b+=(f-l.b)*i}}},at=class extends ie{slotIndex=0;constructor(e,t,s){super(e,t,q.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=a.color;if(s<this.frames[0]){let c=a.data.color;switch(h){case 0:n.a=c.a;return;case 1:n.a+=(c.a-n.a)*i}return}let l=this.getCurveValue(s);i==1?n.a=l:(h==0&&(n.a=a.data.color.a),n.a+=(l-n.a)*i)}},nt=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.alpha+"|"+s,q.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,r,i,h,o,a,n){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=a,this.frames[e+7]=n}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color,c=a.darkColor;if(s<n[0]){let y=a.data.color,v=a.data.darkColor;switch(h){case 0:l.setFromColor(y),c.r=v.r,c.g=v.g,c.b=v.b;return;case 1:l.add((y.r-l.r)*i,(y.g-l.g)*i,(y.b-l.b)*i,(y.a-l.a)*i),c.r+=(v.r-c.r)*i,c.g+=(v.g-c.g)*i,c.b+=(v.b-c.b)*i}return}let d=0,f=0,m=0,u=0,x=0,w=0,p=0,g=J.search(n,s,8),b=this.curves[g>>3];switch(b){case 0:let y=n[g];d=n[g+1],f=n[g+2],m=n[g+3],u=n[g+4],x=n[g+5],w=n[g+6],p=n[g+7];let v=(s-y)/(n[g+8]-y);d+=(n[g+8+1]-d)*v,f+=(n[g+8+2]-f)*v,m+=(n[g+8+3]-m)*v,u+=(n[g+8+4]-u)*v,x+=(n[g+8+5]-x)*v,w+=(n[g+8+6]-w)*v,p+=(n[g+8+7]-p)*v;break;case 1:d=n[g+1],f=n[g+2],m=n[g+3],u=n[g+4],x=n[g+5],w=n[g+6],p=n[g+7];break;default:d=this.getBezierValue(s,g,1,b-2),f=this.getBezierValue(s,g,2,b+18-2),m=this.getBezierValue(s,g,3,b+18*2-2),u=this.getBezierValue(s,g,4,b+18*3-2),x=this.getBezierValue(s,g,5,b+18*4-2),w=this.getBezierValue(s,g,6,b+18*5-2),p=this.getBezierValue(s,g,7,b+18*6-2)}if(i==1)l.set(d,f,m,u),c.r=x,c.g=w,c.b=p;else{if(h==0){l.setFromColor(a.data.color);let y=a.data.darkColor;c.r=y.r,c.g=y.g,c.b=y.b}l.add((d-l.r)*i,(f-l.g)*i,(m-l.b)*i,(u-l.a)*i),c.r+=(x-c.r)*i,c.g+=(w-c.g)*i,c.b+=(p-c.b)*i}}},lt=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,i,h,o,a){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=a}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color,c=a.darkColor;if(s<n[0]){let y=a.data.color,v=a.data.darkColor;switch(h){case 0:l.r=y.r,l.g=y.g,l.b=y.b,c.r=v.r,c.g=v.g,c.b=v.b;return;case 1:l.r+=(y.r-l.r)*i,l.g+=(y.g-l.g)*i,l.b+=(y.b-l.b)*i,c.r+=(v.r-c.r)*i,c.g+=(v.g-c.g)*i,c.b+=(v.b-c.b)*i}return}let d=0,f=0,m=0,u=0,x=0,w=0,p=0,g=J.search(n,s,7),b=this.curves[g/7];switch(b){case 0:let y=n[g];d=n[g+1],f=n[g+2],m=n[g+3],x=n[g+4],w=n[g+5],p=n[g+6];let v=(s-y)/(n[g+7]-y);d+=(n[g+7+1]-d)*v,f+=(n[g+7+2]-f)*v,m+=(n[g+7+3]-m)*v,x+=(n[g+7+4]-x)*v,w+=(n[g+7+5]-w)*v,p+=(n[g+7+6]-p)*v;break;case 1:d=n[g+1],f=n[g+2],m=n[g+3],x=n[g+4],w=n[g+5],p=n[g+6];break;default:d=this.getBezierValue(s,g,1,b-2),f=this.getBezierValue(s,g,2,b+18-2),m=this.getBezierValue(s,g,3,b+18*2-2),x=this.getBezierValue(s,g,4,b+18*3-2),w=this.getBezierValue(s,g,5,b+18*4-2),p=this.getBezierValue(s,g,6,b+18*5-2)}if(i==1)l.r=d,l.g=f,l.b=m,c.r=x,c.g=w,c.b=p;else{if(h==0){let y=a.data.color,v=a.data.darkColor;l.r=y.r,l.g=y.g,l.b=y.b,c.r=v.r,c.g=v.g,c.b=v.b}l.r+=(d-l.r)*i,l.g+=(f-l.g)*i,l.b+=(m-l.b)*i,c.r+=(x-c.r)*i,c.g+=(w-c.g)*i,c.b+=(p-c.b)*i}}},me=class extends J{slotIndex=0;attachmentNames;constructor(e,t){super(e,[q.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(a.bone.active){if(o==1){h==0&&this.setAttachment(e,a,a.data.attachmentName);return}if(s<this.frames[0]){(h==0||h==1)&&this.setAttachment(e,a,a.data.attachmentName);return}this.setAttachment(e,a,this.attachmentNames[J.search1(this.frames,s)])}}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},ot=class extends ae{slotIndex=0;attachment;vertices;constructor(e,t,s,r){super(e,t,[q.deform+"|"+s+"|"+r.id]),this.slotIndex=s,this.attachment=r,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,r,i,h,o,a,n,l,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let m=(r-h*2+a)*.03,u=n*.03-o*.06,x=((h-a)*3-r+l)*.006,w=(o-n+.33333333)*.018,p=m*2+x,g=u*2+w,b=(h-r)*.3+m+x*.16666667,y=o*.3+u+w*.16666667,v=r+b,A=y;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,b+=p,y+=g,p+=x,g+=w,v+=b,A+=y}getCurvePercent(e,t){let s=this.curves,r=s[t];switch(r){case 0:let a=this.frames[t];return(e-a)/(this.frames[t+this.getFrameEntries()]-a);case 1:return 0}if(r-=2,s[r]>e){let a=this.frames[t];return s[r+1]*(e-a)/(s[r]-a)}let i=r+18;for(r+=2;r<i;r+=2)if(s[r]>=e){let a=s[r-2],n=s[r-1];return n+(e-a)/(s[r]-a)*(s[r+1]-n)}let h=s[i-2],o=s[i-1];return o+(1-o)*(e-h)/(this.frames[t+this.getFrameEntries()]-h)}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=a.getAttachment();if(!n||!(n instanceof oe)||n.timelineAttachment!=this.attachment)return;let l=a.deform;l.length==0&&(h=0);let c=this.vertices,d=c[0].length,f=this.frames;if(s<f[0]){switch(h){case 0:l.length=0;return;case 1:if(i==1){l.length=0;return}l.length=d;let g=n;if(g.bones){i=1-i;for(var m=0;m<d;m++)l[m]*=i}else{let b=g.vertices;for(var m=0;m<d;m++)l[m]+=(b[m]-l[m])*i}}return}if(l.length=d,s>=f[f.length-1]){let g=c[f.length-1];if(i==1)if(h==3){let b=n;if(b.bones)for(let y=0;y<d;y++)l[y]+=g[y];else{let y=b.vertices;for(let v=0;v<d;v++)l[v]+=g[v]-y[v]}}else P.arrayCopy(g,0,l,0,d);else switch(h){case 0:{let y=n;if(y.bones)for(let v=0;v<d;v++)l[v]=g[v]*i;else{let v=y.vertices;for(let A=0;A<d;A++){let S=v[A];l[A]=S+(g[A]-S)*i}}break}case 1:case 2:for(let y=0;y<d;y++)l[y]+=(g[y]-l[y])*i;break;case 3:let b=n;if(b.bones)for(let y=0;y<d;y++)l[y]+=g[y]*i;else{let y=b.vertices;for(let v=0;v<d;v++)l[v]+=(g[v]-y[v])*i}}return}let u=J.search1(f,s),x=this.getCurvePercent(s,u),w=c[u],p=c[u+1];if(i==1)if(h==3){let g=n;if(g.bones)for(let b=0;b<d;b++){let y=w[b];l[b]+=y+(p[b]-y)*x}else{let b=g.vertices;for(let y=0;y<d;y++){let v=w[y];l[y]+=v+(p[y]-v)*x-b[y]}}}else for(let g=0;g<d;g++){let b=w[g];l[g]=b+(p[g]-b)*x}else switch(h){case 0:{let b=n;if(b.bones)for(let y=0;y<d;y++){let v=w[y];l[y]=(v+(p[y]-v)*x)*i}else{let y=b.vertices;for(let v=0;v<d;v++){let A=w[v],S=y[v];l[v]=S+(A+(p[v]-A)*x-S)*i}}break}case 1:case 2:for(let b=0;b<d;b++){let y=w[b];l[b]+=(y+(p[b]-y)*x-l[b])*i}break;case 3:let g=n;if(g.bones)for(let b=0;b<d;b++){let y=w[b];l[b]+=(y+(p[b]-y)*x)*i}else{let b=g.vertices;for(let y=0;y<d;y++){let v=w[y];l[y]+=(v+(p[y]-v)*x-b[y])*i}}}}},Re=class Xs extends J{static propertyIds=[""+q.event];events;constructor(t){super(t,Xs.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s.time,this.events[t]=s}apply(t,s,r,i,h,o,a){if(!i)return;let n=this.frames,l=this.frames.length;if(s>r)this.apply(t,s,Number.MAX_VALUE,i,h,o,a),s=-1;else if(s>=n[l-1])return;if(r<n[0])return;let c=0;if(s<n[0])c=0;else{c=J.search1(n,s)+1;let d=n[c];for(;c>0&&n[c-1]==d;)c--}for(;c<l&&r>=n[c];c++)i.push(this.events[c])}},we=class Fs extends J{static propertyIds=[""+q.drawOrder];drawOrders;constructor(t){super(t,Fs.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,r){this.frames[t]=s,this.drawOrders[t]=r}apply(t,s,r,i,h,o,a){if(a==1){o==0&&P.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(r<this.frames[0]){(o==0||o==1)&&P.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let n=J.search1(this.frames,r),l=this.drawOrders[n];if(!l)P.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let c=t.drawOrder,d=t.slots;for(let f=0,m=l.length;f<m;f++)c[f]=d[l[f]]}}},ht=class extends ae{constraintIndex=0;constructor(e,t,s){super(e,t,[q.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,r,i,h,o){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h?1:0,this.frames[e+5]=o?1:0}apply(e,t,s,r,i,h,o){let a=e.ikConstraints[this.constraintIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch;return;case 1:a.mix+=(a.data.mix-a.mix)*i,a.softness+=(a.data.softness-a.softness)*i,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}return}let l=0,c=0,d=J.search(n,s,6),f=this.curves[d/6];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+6]-m);l+=(n[d+6+1]-l)*u,c+=(n[d+6+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}h==0?(a.mix=a.data.mix+(l-a.data.mix)*i,a.softness=a.data.softness+(c-a.data.softness)*i,o==1?(a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch):(a.bendDirection=n[d+3],a.compress=n[d+4]!=0,a.stretch=n[d+5]!=0)):(a.mix+=(l-a.mix)*i,a.softness+=(c-a.softness)*i,o==0&&(a.bendDirection=n[d+3],a.compress=n[d+4]!=0,a.stretch=n[d+5]!=0))}},ct=class extends ae{constraintIndex=0;constructor(e,t,s){super(e,t,[q.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,i,h,o,a){let n=this.frames;e*=7,n[e]=t,n[e+1]=s,n[e+2]=r,n[e+3]=i,n[e+4]=h,n[e+5]=o,n[e+6]=a}apply(e,t,s,r,i,h,o){let a=e.transformConstraints[this.constraintIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){let p=a.data;switch(h){case 0:a.mixRotate=p.mixRotate,a.mixX=p.mixX,a.mixY=p.mixY,a.mixScaleX=p.mixScaleX,a.mixScaleY=p.mixScaleY,a.mixShearY=p.mixShearY;return;case 1:a.mixRotate+=(p.mixRotate-a.mixRotate)*i,a.mixX+=(p.mixX-a.mixX)*i,a.mixY+=(p.mixY-a.mixY)*i,a.mixScaleX+=(p.mixScaleX-a.mixScaleX)*i,a.mixScaleY+=(p.mixScaleY-a.mixScaleY)*i,a.mixShearY+=(p.mixShearY-a.mixShearY)*i}return}let l,c,d,f,m,u,x=J.search(n,s,7),w=this.curves[x/7];switch(w){case 0:let p=n[x];l=n[x+1],c=n[x+2],d=n[x+3],f=n[x+4],m=n[x+5],u=n[x+6];let g=(s-p)/(n[x+7]-p);l+=(n[x+7+1]-l)*g,c+=(n[x+7+2]-c)*g,d+=(n[x+7+3]-d)*g,f+=(n[x+7+4]-f)*g,m+=(n[x+7+5]-m)*g,u+=(n[x+7+6]-u)*g;break;case 1:l=n[x+1],c=n[x+2],d=n[x+3],f=n[x+4],m=n[x+5],u=n[x+6];break;default:l=this.getBezierValue(s,x,1,w-2),c=this.getBezierValue(s,x,2,w+18-2),d=this.getBezierValue(s,x,3,w+18*2-2),f=this.getBezierValue(s,x,4,w+18*3-2),m=this.getBezierValue(s,x,5,w+18*4-2),u=this.getBezierValue(s,x,6,w+18*5-2)}if(h==0){let p=a.data;a.mixRotate=p.mixRotate+(l-p.mixRotate)*i,a.mixX=p.mixX+(c-p.mixX)*i,a.mixY=p.mixY+(d-p.mixY)*i,a.mixScaleX=p.mixScaleX+(f-p.mixScaleX)*i,a.mixScaleY=p.mixScaleY+(m-p.mixScaleY)*i,a.mixShearY=p.mixShearY+(u-p.mixShearY)*i}else a.mixRotate+=(l-a.mixRotate)*i,a.mixX+=(c-a.mixX)*i,a.mixY+=(d-a.mixY)*i,a.mixScaleX+=(f-a.mixScaleX)*i,a.mixScaleY+=(m-a.mixScaleY)*i,a.mixShearY+=(u-a.mixShearY)*i}},dt=class extends ie{constraintIndex=0;constructor(e,t,s){super(e,t,q.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,h,o){let a=e.pathConstraints[this.constraintIndex];a.active&&(a.position=this.getAbsoluteValue(s,i,h,a.position,a.data.position))}},ft=class extends ie{constraintIndex=0;constructor(e,t,s){super(e,t,q.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,h,o){let a=e.pathConstraints[this.constraintIndex];a.active&&(a.spacing=this.getAbsoluteValue(s,i,h,a.spacing,a.data.spacing))}},ut=class extends ae{constraintIndex=0;constructor(e,t,s){super(e,t,[q.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,i){let h=this.frames;e<<=2,h[e]=t,h[e+1]=s,h[e+2]=r,h[e+3]=i}apply(e,t,s,r,i,h,o){let a=e.pathConstraints[this.constraintIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.mixRotate=a.data.mixRotate,a.mixX=a.data.mixX,a.mixY=a.data.mixY;return;case 1:a.mixRotate+=(a.data.mixRotate-a.mixRotate)*i,a.mixX+=(a.data.mixX-a.mixX)*i,a.mixY+=(a.data.mixY-a.mixY)*i}return}let l,c,d,f=J.search(n,s,4),m=this.curves[f>>2];switch(m){case 0:let u=n[f];l=n[f+1],c=n[f+2],d=n[f+3];let x=(s-u)/(n[f+4]-u);l+=(n[f+4+1]-l)*x,c+=(n[f+4+2]-c)*x,d+=(n[f+4+3]-d)*x;break;case 1:l=n[f+1],c=n[f+2],d=n[f+3];break;default:l=this.getBezierValue(s,f,1,m-2),c=this.getBezierValue(s,f,2,m+18-2),d=this.getBezierValue(s,f,3,m+18*2-2)}if(h==0){let u=a.data;a.mixRotate=u.mixRotate+(l-u.mixRotate)*i,a.mixX=u.mixX+(c-u.mixX)*i,a.mixY=u.mixY+(d-u.mixY)*i}else a.mixRotate+=(l-a.mixRotate)*i,a.mixX+=(c-a.mixX)*i,a.mixY+=(d-a.mixY)*i}},de=class extends ie{constraintIndex=0;constructor(e,t,s,r){super(e,t,r+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,h,o){let a;if(this.constraintIndex==-1){const n=s>=this.frames[0]?this.getCurveValue(s):0;for(const l of e.physicsConstraints)l.active&&this.global(l.data)&&this.set(l,this.getAbsoluteValue2(s,i,h,this.get(l),this.setup(l),n))}else a=e.physicsConstraints[this.constraintIndex],a.active&&this.set(a,this.getAbsoluteValue(s,i,h,this.get(a),this.setup(a)))}},mt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},gt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},xt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},bt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},wt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},pt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},yt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},vt=class Es extends J{static propertyIds=[q.physicsConstraintReset.toString()];constraintIndex;constructor(t,s){super(t,Es.propertyIds),this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,r,i,h,o,a){let n;if(this.constraintIndex!=-1&&(n=t.physicsConstraints[this.constraintIndex],!n.active))return;const l=this.frames;if(s>r)this.apply(t,s,Number.MAX_VALUE,[],h,o,a),s=-1;else if(s>=l[l.length-1])return;if(!(r<l[0])&&(s<l[0]||r>=l[J.search1(l,s)+1]))if(n!=null)n.reset();else for(const c of t.physicsConstraints)c.active&&c.reset()}},At=class fe extends J{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,s,r){super(t,[q.sequence+"|"+s+"|"+r.sequence.id]),this.slotIndex=s,this.attachment=r}getFrameEntries(){return fe.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,r,i,h){let o=this.frames;t*=fe.ENTRIES,o[t]=s,o[t+fe.MODE]=r|i<<4,o[t+fe.DELAY]=h}apply(t,s,r,i,h,o,a){let n=t.slots[this.slotIndex];if(!n.bone.active)return;let l=n.attachment,c=this.attachment;if(l!=c&&(!(l instanceof oe)||l.timelineAttachment!=c))return;if(a==1){o==0&&(n.sequenceIndex=-1);return}let d=this.frames;if(r<d[0]){(o==0||o==1)&&(n.sequenceIndex=-1);return}let f=J.search(d,r,fe.ENTRIES),m=d[f],u=d[f+fe.MODE],x=d[f+fe.DELAY];if(!this.attachment.sequence)return;let w=u>>4,p=this.attachment.sequence.regions.length,g=as[u&15];if(g!=0)switch(w+=(r-m)/x+1e-5|0,g){case 1:w=Math.min(p-1,w);break;case 2:w%=p;break;case 3:{let b=(p<<1)-2;w=b==0?0:w%b,w>=p&&(w=b-w);break}case 4:w=Math.max(p-1-w,0);break;case 5:w=p-1-w%p;break;case 6:{let b=(p<<1)-2;w=b==0?0:(w+p-1)%b,w>=p&&(w=b-w)}}n.sequenceIndex=w}},Us=class De{static _emptyAnimation=new Fe("<empty>",[],0);static emptyAnimation(){return De._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new hs(this);propertyIDs=new _e;animationsChanged=!1;trackEntryPool=new Ae(()=>new os);constructor(t){this.data=t}update(t){t*=this.timeScale;let s=this.tracks;for(let r=0,i=s.length;r<i;r++){let h=s[r];if(!h)continue;h.animationLast=h.nextAnimationLast,h.trackLast=h.nextTrackLast;let o=t*h.timeScale;if(h.delay>0){if(h.delay-=o,h.delay>0)continue;o=-h.delay,h.delay=0}let a=h.next;if(a){let n=h.trackLast-a.delay;if(n>=0){for(a.delay=0,a.trackTime+=h.timeScale==0?0:(n/h.timeScale+t)*a.timeScale,h.trackTime+=o,this.setCurrent(r,a,!0);a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(h.trackLast>=h.trackEnd&&!h.mixingFrom){s[r]=null,this.queue.end(h),this.clearNext(h);continue}if(h.mixingFrom&&this.updateMixingFrom(h,t)){let n=h.mixingFrom;for(h.mixingFrom=null,n&&(n.mixingTo=null);n;)this.queue.end(n),n=n.mixingFrom}h.trackTime+=o}this.queue.drain()}updateMixingFrom(t,s){let r=t.mixingFrom;if(!r)return!0;let i=this.updateMixingFrom(r,s);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,t.nextTrackLast!=-1&&t.mixTime>=t.mixDuration?((r.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=r.mixingFrom,r.mixingFrom!=null&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),i):(r.trackTime+=s*r.timeScale,t.mixTime+=s,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,r=this.tracks,i=!1;for(let f=0,m=r.length;f<m;f++){let u=r[f];if(!u||u.delay>0)continue;i=!0;let x=f==0?1:u.mixBlend,w=u.alpha;u.mixingFrom?w*=this.applyMixingFrom(u,t,x):u.trackTime>=u.trackEnd&&!u.next&&(w=0);let p=w>=u.alphaAttachmentThreshold,g=u.animationLast,b=u.getAnimationTime(),y=b,v=s;u.reverse&&(y=u.animation.duration-y,v=null);let A=u.animation.timelines,S=A.length;if(f==0&&w==1||x==3){f==0&&(p=!0);for(let I=0;I<S;I++){P.webkit602BugfixHelper(w,x);var h=A[I];h instanceof me?this.applyAttachmentTimeline(h,t,y,x,p):h.apply(t,g,y,v,w,x,0)}}else{let I=u.timelineMode,T=u.shortestRotation,M=!T&&u.timelinesRotation.length!=S<<1;M&&(u.timelinesRotation.length=S<<1);for(let Y=0;Y<S;Y++){let F=A[Y],E=I[Y]==Pe?x:0;!T&&F instanceof Se?this.applyRotateTimeline(F,t,y,w,E,u.timelinesRotation,Y<<1,M):F instanceof me?this.applyAttachmentTimeline(F,t,y,x,p):(P.webkit602BugfixHelper(w,x),F.apply(t,g,y,v,w,E,0))}}this.queueEvents(u,b),s.length=0,u.nextAnimationLast=b,u.nextTrackLast=u.trackTime}for(var o=this.unkeyedState+It,a=t.slots,n=0,l=t.slots.length;n<l;n++){var c=a[n];if(c.attachmentState==o){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,s,r){let i=t.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,s,r);let h=0;t.mixDuration==0?(h=1,r==1&&(r=0)):(h=t.mixTime/t.mixDuration,h>1&&(h=1),r!=1&&(r=i.mixBlend));let o=h<i.mixAttachmentThreshold,a=h<i.mixDrawOrderThreshold,n=i.animation.timelines,l=n.length,c=i.alpha*t.interruptAlpha,d=c*(1-h),f=i.animationLast,m=i.getAnimationTime(),u=m,x=null;if(i.reverse?u=i.animation.duration-u:h<i.eventThreshold&&(x=this.events),r==3)for(let w=0;w<l;w++)n[w].apply(s,f,u,x,d,r,1);else{let w=i.timelineMode,p=i.timelineHoldMix,g=i.shortestRotation,b=!g&&i.timelinesRotation.length!=l<<1;b&&(i.timelinesRotation.length=l<<1),i.totalAlpha=0;for(let y=0;y<l;y++){let v=n[y],A=1,S,I=0;switch(w[y]){case Pe:if(!a&&v instanceof we)continue;S=r,I=d;break;case St:S=0,I=d;break;case Ct:S=r,I=c;break;case Be:S=0,I=c;break;default:S=0;let T=p[y];I=c*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=I,!g&&v instanceof Se?this.applyRotateTimeline(v,s,u,I,S,i.timelinesRotation,y<<1,b):v instanceof me?this.applyAttachmentTimeline(v,s,u,S,o&&I>=i.alphaAttachmentThreshold):(P.webkit602BugfixHelper(I,r),a&&v instanceof we&&S==0&&(A=0),v.apply(s,f,u,x,I,S,A))}}return t.mixDuration>0&&this.queueEvents(i,m),this.events.length=0,i.nextAnimationLast=m,i.nextTrackLast=i.trackTime,h}applyAttachmentTimeline(t,s,r,i,h){var o=s.slots[t.slotIndex];o.bone.active&&(r<t.frames[0]?(i==0||i==1)&&this.setAttachment(s,o,o.data.attachmentName,h):this.setAttachment(s,o,t.attachmentNames[J.search1(t.frames,r)],h),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+It))}setAttachment(t,s,r,i){s.setAttachment(r?t.getAttachment(s.data.index,r):null),i&&(s.attachmentState=this.unkeyedState+fs)}applyRotateTimeline(t,s,r,i,h,o,a,n){if(n&&(o[a]=0),i==1){t.apply(s,0,r,null,1,h,0);return}let l=s.bones[t.boneIndex];if(!l.active)return;let c=t.frames,d=0,f=0;if(r<c[0])switch(h){case 0:l.rotation=l.data.rotation;default:return;case 1:d=l.rotation,f=l.data.rotation}else d=h==0?l.data.rotation:l.rotation,f=l.data.rotation+t.getCurveValue(r);let m=0,u=f-d;if(u-=Math.ceil(u/360-.5)*360,u==0)m=o[a];else{let x=0,w=0;n?(x=0,w=u):(x=o[a],w=o[a+1]);let p=x-x%360;m=u+p;let g=u>=0,b=x>=0;Math.abs(w)<=90&&R.signum(w)!=R.signum(u)&&(Math.abs(x-p)>180?(m+=360*R.signum(x),b=g):p!=0?m-=360*R.signum(x):b=g),b!=g&&(m+=360*R.signum(x)),o[a]=m}o[a+1]=u,l.rotation=d+m*i}queueEvents(t,s){let r=t.animationStart,i=t.animationEnd,h=i-r,o=t.trackLast%h,a=this.events,n=0,l=a.length;for(;n<l;n++){let d=a[n];if(d.time<o)break;d.time>i||this.queue.event(t,d)}let c=!1;if(t.loop)if(h==0)c=!0;else{const d=Math.floor(t.trackTime/h);c=d>0&&d>Math.floor(t.trackLast/h)}else c=s>=i&&t.animationLast<i;for(c&&this.queue.complete(t);n<l;n++){let d=a[n];d.time<r||this.queue.event(t,d)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++)this.clearTrack(s);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let s=this.tracks[t];if(!s)return;this.queue.end(s),this.clearNext(s);let r=s;for(;;){let i=r.mixingFrom;if(!i)break;this.queue.end(i),r.mixingFrom=null,r.mixingTo=null,r=i}this.tracks[s.trackIndex]=null,this.queue.drain()}setCurrent(t,s,r){let i=this.expandToIndex(t);this.tracks[t]=s,s.previous=null,i&&(r&&this.queue.interrupt(i),s.mixingFrom=i,i.mixingTo=s,s.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(s.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(s)}setAnimation(t,s,r=!1){let i=this.data.skeletonData.findAnimation(s);if(!i)throw new Error("Animation not found: "+s);return this.setAnimationWith(t,i,r)}setAnimationWith(t,s,r=!1){if(!s)throw new Error("animation cannot be null.");let i=!0,h=this.expandToIndex(t);h&&(h.nextTrackLast==-1?(this.tracks[t]=h.mixingFrom,this.queue.interrupt(h),this.queue.end(h),this.clearNext(h),h=h.mixingFrom,i=!1):this.clearNext(h));let o=this.trackEntry(t,s,r,h);return this.setCurrent(t,o,i),this.queue.drain(),o}addAnimation(t,s,r=!1,i=0){let h=this.data.skeletonData.findAnimation(s);if(!h)throw new Error("Animation not found: "+s);return this.addAnimationWith(t,h,r,i)}addAnimationWith(t,s,r=!1,i=0){if(!s)throw new Error("animation cannot be null.");let h=this.expandToIndex(t);if(h)for(;h.next;)h=h.next;let o=this.trackEntry(t,s,r,h);return h?(h.next=o,o.previous=h,i<=0&&(i=Math.max(i+h.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(t,o,!0),this.queue.drain(),i<0&&(i=0)),o.delay=i,o}setEmptyAnimation(t,s=0){let r=this.setAnimationWith(t,De.emptyAnimation(),!1);return r.mixDuration=s,r.trackEnd=s,r}addEmptyAnimation(t,s=0,r=0){let i=this.addAnimationWith(t,De.emptyAnimation(),!1,r);return r<=0&&(i.delay=Math.max(i.delay+i.mixDuration-s,0)),i.mixDuration=s,i.trackEnd=s,i}setEmptyAnimations(t=0){let s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let r=0,i=this.tracks.length;r<i;r++){let h=this.tracks[r];h&&this.setEmptyAnimation(h.trackIndex,t)}this.queue.drainDisabled=s,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(P.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,s,r,i){let h=this.trackEntryPool.obtain();return h.reset(),h.trackIndex=t,h.animation=s,h.loop=r,h.holdPrevious=!1,h.reverse=!1,h.shortestRotation=!1,h.eventThreshold=0,h.alphaAttachmentThreshold=0,h.mixAttachmentThreshold=0,h.mixDrawOrderThreshold=0,h.animationStart=0,h.animationEnd=s.duration,h.animationLast=-1,h.nextAnimationLast=-1,h.delay=0,h.trackTime=0,h.trackLast=-1,h.nextTrackLast=-1,h.trackEnd=Number.MAX_VALUE,h.timeScale=1,h.alpha=1,h.mixTime=0,h.mixDuration=i?this.data.getMix(i.animation,s):0,h.interruptAlpha=1,h.totalAlpha=0,h.mixBlend=2,h}clearNext(t){let s=t.next;for(;s;)this.queue.dispose(s),s=s.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do(!i.mixingTo||i.mixBlend!=3)&&this.computeHold(i),i=i.mixingTo;while(i)}}}computeHold(t){let s=t.mixingTo,r=t.animation.timelines,i=t.animation.timelines.length,h=t.timelineMode;h.length=i;let o=t.timelineHoldMix;o.length=0;let a=this.propertyIDs;if(s&&s.holdPrevious){for(let n=0;n<i;n++)h[n]=a.addAll(r[n].getPropertyIds())?Be:Ct;return}e:for(let n=0;n<i;n++){let l=r[n],c=l.getPropertyIds();if(!a.addAll(c))h[n]=Pe;else if(!s||l instanceof me||l instanceof we||l instanceof Re||!s.animation.hasTimeline(c))h[n]=St;else{for(let d=s.mixingTo;d;d=d.mixingTo)if(!d.animation.hasTimeline(c)){if(t.mixDuration>0){h[n]=ds,o[n]=d;continue e}break}h[n]=Be}}}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 s=this.listeners.indexOf(t);s>=0&&this.listeners.splice(s,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},os=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;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 e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}},hs=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(0),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(1),this.objects.push(e)}end(e){this.objects.push(2),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(3),this.objects.push(e)}complete(e){this.objects.push(4),this.objects.push(e)}event(e,t){this.objects.push(5),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let s=0;s<e.length;s+=2){let r=e[s],i=e[s+1];switch(r){case 0:i.listener&&i.listener.start&&i.listener.start(i);for(let o=0;o<t.length;o++){let a=t[o];a.start&&a.start(i)}break;case 1:i.listener&&i.listener.interrupt&&i.listener.interrupt(i);for(let o=0;o<t.length;o++){let a=t[o];a.interrupt&&a.interrupt(i)}break;case 2:i.listener&&i.listener.end&&i.listener.end(i);for(let o=0;o<t.length;o++){let a=t[o];a.end&&a.end(i)}case 3:i.listener&&i.listener.dispose&&i.listener.dispose(i);for(let o=0;o<t.length;o++){let a=t[o];a.dispose&&a.dispose(i)}this.animState.trackEntryPool.free(i);break;case 4:i.listener&&i.listener.complete&&i.listener.complete(i);for(let o=0;o<t.length;o++){let a=t[o];a.complete&&a.complete(i)}break;case 5:let h=e[s+++2];i.listener&&i.listener.event&&i.listener.event(i,h);for(let o=0;o<t.length;o++){let a=t[o];a.event&&a.event(i,h)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},cs=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(cs||{}),zs=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},Pe=0,St=1,Ct=2,Be=3,ds=4,It=1,fs=2,_s=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,s){let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);this.setMixWith(r,i,s)}setMixWith(e,t,s){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let r=e.name+"."+t.name;this.animationToMixTime[r]=s}getMix(e,t){let s=e.name+"."+t.name,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}},kt=class Rs extends oe{color=new D(1,1,1,1);constructor(t){super(t)}copy(){let t=new Rs(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Tt=class Ps extends oe{endSlot=null;color=new D(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new Ps(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},Yt=class{_image;constructor(e){this._image=e}getImage(){return this._image}},Ve=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(Ve||{}),us=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(us||{}),ms=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},Gs=class extends Yt{setFilters(e,t){}setWraps(e,t){}dispose(){}},Mt=class{pages=new Array;regions=new Array;constructor(e){let t=new $s(e),s=new Array(4),r={};r.size=l=>{l.width=parseInt(s[1]),l.height=parseInt(s[2])},r.format=()=>{},r.filter=l=>{l.minFilter=P.enumValue(Ve,s[1]),l.magFilter=P.enumValue(Ve,s[2])},r.repeat=l=>{s[1].indexOf("x")!=-1&&(l.uWrap=10497),s[1].indexOf("y")!=-1&&(l.vWrap=10497)},r.pma=l=>{l.pma=s[1]=="true"};var i={};i.xy=l=>{l.x=parseInt(s[1]),l.y=parseInt(s[2])},i.size=l=>{l.width=parseInt(s[1]),l.height=parseInt(s[2])},i.bounds=l=>{l.x=parseInt(s[1]),l.y=parseInt(s[2]),l.width=parseInt(s[3]),l.height=parseInt(s[4])},i.offset=l=>{l.offsetX=parseInt(s[1]),l.offsetY=parseInt(s[2])},i.orig=l=>{l.originalWidth=parseInt(s[1]),l.originalHeight=parseInt(s[2])},i.offsets=l=>{l.offsetX=parseInt(s[1]),l.offsetY=parseInt(s[2]),l.originalWidth=parseInt(s[3]),l.originalHeight=parseInt(s[4])},i.rotate=l=>{let c=s[1];c=="true"?l.degrees=90:c!="false"&&(l.degrees=parseInt(c))},i.index=l=>{l.index=parseInt(s[1])};let h=t.readLine();for(;h&&h.trim().length==0;)h=t.readLine();for(;!(!h||h.trim().length==0||t.readEntry(s,h)==0);)h=t.readLine();let o=null,a=null,n=null;for(;h!==null;)if(h.trim().length==0)o=null,h=t.readLine();else if(o){let l=new Xt(o,h);for(;;){let c=t.readEntry(s,h=t.readLine());if(c==0)break;let d=i[s[0]];if(d)d(l);else{a||(a=[]),n||(n=[]),a.push(s[0]);let f=[];for(let m=0;m<c;m++)f.push(parseInt(s[m+1]));n.push(f)}}l.originalWidth==0&&l.originalHeight==0&&(l.originalWidth=l.width,l.originalHeight=l.height),a&&a.length>0&&n&&n.length>0&&(l.names=a,l.values=n,a=null,n=null),l.u=l.x/o.width,l.v=l.y/o.height,l.degrees==90?(l.u2=(l.x+l.height)/o.width,l.v2=(l.y+l.width)/o.height):(l.u2=(l.x+l.width)/o.width,l.v2=(l.y+l.height)/o.height),this.regions.push(l)}else{for(o=new gs(h.trim());t.readEntry(s,h=t.readLine())!=0;){let l=r[s[0]];l&&l(o)}this.pages.push(o)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let s of this.pages)s.setTexture(e.get(t+s.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},$s=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let r=1,i=s+1;;r++){let h=t.indexOf(",",i);if(h==-1)return e[r]=t.substr(i).trim(),r;if(e[r]=t.substr(i,h-i).trim(),i=h+1,r==4)return 4}}},gs=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Xt=class extends ms{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},Ce=class Ht extends oe{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new D(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new D(0,0,0,0);constructor(t,s){super(t),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=P.newFloatArray(t.length));let s=this.uvs,r=this.uvs.length,i=this.region.u,h=this.region.v,o=0,a=0;if(this.region instanceof Xt){let n=this.region,l=n.page,c=l.width,d=l.height;switch(n.degrees){case 90:i-=(n.originalHeight-n.offsetY-n.height)/c,h-=(n.originalWidth-n.offsetX-n.width)/d,o=n.originalHeight/c,a=n.originalWidth/d;for(let f=0;f<r;f+=2)s[f]=i+t[f+1]*o,s[f+1]=h+(1-t[f])*a;return;case 180:i-=(n.originalWidth-n.offsetX-n.width)/c,h-=n.offsetY/d,o=n.originalWidth/c,a=n.originalHeight/d;for(let f=0;f<r;f+=2)s[f]=i+(1-t[f])*o,s[f+1]=h+(1-t[f+1])*a;return;case 270:i-=n.offsetY/c,h-=n.offsetX/d,o=n.originalHeight/c,a=n.originalWidth/d;for(let f=0;f<r;f+=2)s[f]=i+(1-t[f+1])*o,s[f+1]=h+t[f]*a;return}i-=n.offsetX/c,h-=(n.originalHeight-n.offsetY-n.height)/d,o=n.originalWidth/c,a=n.originalHeight/d}else this.region?(o=this.region.u2-i,a=this.region.v2-h):(i=h=0,o=a=1);for(let n=0;n<r;n+=2)s[n]=i+t[n]*o,s[n+1]=h+t[n+1]*a}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,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)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new Ht(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),P.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=this.uvs instanceof Float32Array?P.newFloatArray(this.uvs.length):new Array(this.uvs.length),P.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),P.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),P.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,s,r,i,h,o){this.sequence!=null&&this.sequence.apply(t,this),super.computeWorldVertices(t,s,r,i,h,o)}newLinkedMesh(){let t=new Ht(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.region!=null&&t.updateRegion(),t}},Ie=class Bs extends oe{lengths=[];closed=!1;constantSpeed=!1;color=new D(1,1,1,1);constructor(t){super(t)}copy(){let t=new Bs(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),P.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},xs=class Vs extends oe{x=0;y=0;rotation=0;color=new D(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,s){return s.x=this.x*t.a+this.y*t.b+t.worldX,s.y=this.x*t.c+this.y*t.d+t.worldY,s}computeWorldRotation(t){const s=this.rotation*R.degRad,r=Math.cos(s),i=Math.sin(s),h=r*t.a+i*t.b,o=r*t.c+i*t.d;return R.atan2Deg(o,h)}copy(){let t=new Vs(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},H=class Ls extends Ge{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new D(1,1,1,1);path;region=null;sequence=null;offset=P.newFloatArray(8);uvs=P.newFloatArray(8);tempColor=new D(1,1,1,1);constructor(t,s){super(t),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,s=this.uvs;if(t==null){s[0]=0,s[1]=0,s[2]=0,s[3]=1,s[4]=1,s[5]=1,s[6]=1,s[7]=0;return}let r=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,h=-this.width/2*this.scaleX+this.region.offsetX*r,o=-this.height/2*this.scaleY+this.region.offsetY*i,a=h+this.region.width*r,n=o+this.region.height*i,l=this.rotation*R.degRad,c=Math.cos(l),d=Math.sin(l),f=this.x,m=this.y,u=h*c+f,x=h*d,w=o*c+m,p=o*d,g=a*c+f,b=a*d,y=n*c+m,v=n*d,A=this.offset;A[0]=u-p,A[1]=w+x,A[2]=u-v,A[3]=y+x,A[4]=g-v,A[5]=y+b,A[6]=g-p,A[7]=w+b,t.degrees==90?(s[0]=t.u2,s[1]=t.v2,s[2]=t.u,s[3]=t.v2,s[4]=t.u,s[5]=t.v,s[6]=t.u2,s[7]=t.v):(s[0]=t.u,s[1]=t.v2,s[2]=t.u,s[3]=t.v,s[4]=t.u2,s[5]=t.v,s[6]=t.u2,s[7]=t.v2)}computeWorldVertices(t,s,r,i){this.sequence!=null&&this.sequence.apply(t,this);let h=t.bone,o=this.offset,a=h.worldX,n=h.worldY,l=h.a,c=h.b,d=h.c,f=h.d,m=0,u=0;m=o[0],u=o[1],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n,r+=i,m=o[2],u=o[3],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n,r+=i,m=o[4],u=o[5],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n,r+=i,m=o[6],u=o[7],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n}copy(){let t=new Ls(this.name,this.path);return t.region=this.region,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,P.arrayCopy(this.uvs,0,t.uvs,0,8),P.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=this.sequence!=null?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31},Hs=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,s){let r=s.regions;for(let i=0,h=r.length;i<h;i++){let o=s.getPath(t,i),a=this.atlas.findRegion(o);if(a==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+e+")");r[i]=a}}newRegionAttachment(e,t,s,r){let i=new H(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (region attachment: "+t+")");i.region=h}return i}newMeshAttachment(e,t,s,r){let i=new Ce(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+t+")");i.region=h}return i}newBoundingBoxAttachment(e,t){return new kt(t)}newPathAttachment(e,t){return new Ie(t)}newPointAttachment(e,t){return new xs(t)}newClippingAttachment(e,t){return new Tt(t)}},Ft=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=0;skinRequired=!1;color=new D;icon;visible=!1;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}},Le=(e=>(e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection",e))(Le||{}),Et=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=0;sorted=!1;active=!1;constructor(e,t,s){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,r,i,h,o){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=r,this.ascaleY=i,this.ashearX=h,this.ashearY=o;let a=this.parent;if(!a){let f=this.skeleton;const m=f.scaleX,u=f.scaleY,x=(s+h)*R.degRad,w=(s+90+o)*R.degRad;this.a=Math.cos(x)*r*m,this.b=Math.cos(w)*i*m,this.c=Math.sin(x)*r*u,this.d=Math.sin(w)*i*u,this.worldX=e*m+f.x,this.worldY=t*u+f.y;return}let n=a.a,l=a.b,c=a.c,d=a.d;switch(this.worldX=n*e+l*t+a.worldX,this.worldY=c*e+d*t+a.worldY,this.inherit){case 0:{const f=(s+h)*R.degRad,m=(s+90+o)*R.degRad,u=Math.cos(f)*r,x=Math.cos(m)*i,w=Math.sin(f)*r,p=Math.sin(m)*i;this.a=n*u+l*w,this.b=n*x+l*p,this.c=c*u+d*w,this.d=c*x+d*p;return}case 1:{const f=(s+h)*R.degRad,m=(s+90+o)*R.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(m)*i,this.c=Math.sin(f)*r,this.d=Math.sin(m)*i;break}case 2:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;n*=f,c*=m;let u=n*n+c*c,x=0;u>1e-4?(u=Math.abs(n*d*m-l*f*c)/u,l=c*u,d=n*u,x=Math.atan2(c,n)*R.radDeg):(n=0,c=0,x=90-Math.atan2(d,l)*R.radDeg);const w=(s+h-x)*R.degRad,p=(s+o-x+90)*R.degRad,g=Math.cos(w)*r,b=Math.cos(p)*i,y=Math.sin(w)*r,v=Math.sin(p)*i;this.a=n*g-l*y,this.b=n*b-l*v,this.c=c*g+d*y,this.d=c*b+d*v;break}case 3:case 4:{s*=R.degRad;const f=Math.cos(s),m=Math.sin(s);let u=(n*f+l*m)/this.skeleton.scaleX,x=(c*f+d*m)/this.skeleton.scaleY,w=Math.sqrt(u*u+x*x);w>1e-5&&(w=1/w),u*=w,x*=w,w=Math.sqrt(u*u+x*x),this.inherit==3&&n*d-l*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w),s=Math.PI/2+Math.atan2(x,u);const p=Math.cos(s)*w,g=Math.sin(s)*w;h*=R.degRad,o=(90+o)*R.degRad;const b=Math.cos(h)*r,y=Math.cos(o)*i,v=Math.sin(h)*r,A=Math.sin(o)*i;this.a=u*b+p*v,this.b=u*y+p*A,this.c=x*b+g*v,this.d=x*y+g*A;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*R.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)*R.radDeg;return}let t=e.a,s=e.b,r=e.c,i=e.d,h=1/(t*i-s*r),o=i*h,a=s*h,n=r*h,l=t*h,c=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=c*o-d*a,this.ay=d*l-c*n;let f,m,u,x;if(this.inherit==1)f=this.a,m=this.b,u=this.c,x=this.d;else{switch(this.inherit){case 2:{let y=Math.abs(t*i-s*r)/(t*t+r*r);s=-r*this.skeleton.scaleX*y/this.skeleton.scaleY,i=t*this.skeleton.scaleY*y/this.skeleton.scaleX,h=1/(t*i-s*r),o=i*h,a=s*h;break}case 3:case 4:let w=R.cosDeg(this.rotation),p=R.sinDeg(this.rotation);t=(t*w+s*p)/this.skeleton.scaleX,r=(r*w+i*p)/this.skeleton.scaleY;let g=Math.sqrt(t*t+r*r);g>1e-5&&(g=1/g),t*=g,r*=g,g=Math.sqrt(t*t+r*r),this.inherit==3&&h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(g=-g);let b=R.PI/2+Math.atan2(r,t);s=Math.cos(b)*g,i=Math.sin(b)*g,h=1/(t*i-s*r),o=i*h,a=s*h,n=r*h,l=t*h}f=o*this.a-a*this.c,m=o*this.b-a*this.d,u=l*this.c-n*this.a,x=l*this.d-n*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+u*u),this.ascaleX>1e-4){let w=f*x-m*u;this.ascaleY=w/this.ascaleX,this.ashearY=-Math.atan2(f*m+u*x,w)*R.radDeg,this.arotation=Math.atan2(u,f)*R.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,m)*R.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*R.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*R.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,r=e.y-this.worldY;return e.x=s*this.d*t-r*this.b*t,e.y=r*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=R.sinDeg(e),s=R.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*R.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=R.sinDeg(e),s=R.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*R.radDeg}rotateWorld(e){e*=R.degRad;const t=Math.sin(e),s=Math.cos(e),r=this.a,i=this.b;this.a=s*r-t*this.c,this.b=s*i-t*this.d,this.c=t*r+s*this.c,this.d=t*i+s*this.d}},ke=class{constructor(e,t,s){this.name=e,this.order=t,this.skinRequired=s}},bs=class{pathPrefix="";textureLoader;downloader;cache;errors={};toLoad=0;loaded=0;constructor(e,t="",s=new Rt,r=new ws){this.textureLoader=e,this.pathPrefix=t,this.downloader=s,this.cache=r}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,s){this.toLoad--,this.loaded++,this.cache.assets[t]=s,this.cache.assetsRefCount[t]=(this.cache.assetsRefCount[t]||0)+1,e&&e(t,s)}error(e,t,s){this.toLoad--,this.loaded++,this.errors[t]=s,e&&e(t,s)}loadAll(){return new Promise((t,s)=>{let r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):t(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((r,i)=>{this.downloader.downloadBinary(e,h=>{this.success(t,e,h),r(h)},(h,o)=>{const a=`Couldn't load binary ${e}: status ${h}, ${o}`;this.error(s,e,a),i(a)})}))}loadText(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadText(e,r=>{this.success(t,e,r)},(r,i)=>{this.error(s,e,`Couldn't load text ${e}: status ${r}, ${i}`)})}loadJson(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((r,i)=>{this.downloader.downloadJson(e,h=>{this.success(t,e,h),r(h)},(h,o)=>{const a=`Couldn't load JSON ${e}: status ${h}, ${o}`;this.error(s,e,a),i(a)})}))}reuseAssets(e,t=()=>{},s=()=>{}){const r=this.cache.assetsLoaded[e],i=r!==void 0;return i&&(this.cache.assetsLoaded[e]=r.then(h=>(h=h instanceof Image||h instanceof ImageBitmap?this.textureLoader(h):h,this.success(t,e,h),h)).catch(h=>this.error(s,e,h))),i}loadTexture(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((r,i)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(a=>{if(a.ok)return a.blob();const n=`Couldn't load image: ${e}`;this.error(s,e,`Couldn't load image: ${e}`),i(n)}).then(a=>a?createImageBitmap(a,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(a=>{if(a){const n=this.createTexture(e,a);this.success(t,e,n),r(n)}});else{let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{const n=this.createTexture(e,a);this.success(t,e,n),r(n)},a.onerror=()=>{const n=`Couldn't load image: ${e}`;this.error(s,e,n),i(n)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),a.src=e}}))}loadTextureAtlas(e,t=()=>{},s=()=>{},r){let i=e.lastIndexOf("/"),h=i>=0?e.substring(0,i+1):"";e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((o,a)=>{this.downloader.downloadText(e,n=>{try{const l=this.createTextureAtlas(e,n);let c=l.pages.length,d=!1;for(let f of l.pages)this.loadTexture(r?r[f.name]:h+f.name,(m,u)=>{d||(f.setTexture(u),--c==0&&(this.success(t,e,l),o(l)))},(m,u)=>{if(!d){const x=`Couldn't load texture ${e} page image: ${m}`;this.error(s,e,x),a(x)}d=!0})}catch(l){const c=`Couldn't parse texture atlas ${e}: ${l.message}`;this.error(s,e,c),a(c)}},(n,l)=>{const c=`Couldn't load texture atlas ${e}: status ${n}, ${l}`;this.error(s,e,c),a(c)})}))}loadTextureAtlasButNoTextures(e,t=()=>{},s=()=>{},r){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((i,h)=>{this.downloader.downloadText(e,o=>{try{const a=this.createTextureAtlas(e,o);this.success(t,e,a),i(a)}catch(a){const n=`Couldn't parse texture atlas ${e}: ${a.message}`;this.error(s,e,n),h(n)}},(o,a)=>{const n=`Couldn't load texture atlas ${e}: status ${o}, ${a}`;this.error(s,e,n),h(n)})}))}async loadBinaryAsync(e){return new Promise((t,s)=>{this.loadBinary(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadJsonAsync(e){return new Promise((t,s)=>{this.loadJson(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAsync(e){return new Promise((t,s)=>{this.loadTexture(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAtlasAsync(e){return new Promise((t,s)=>{this.loadTextureAtlas(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAtlasButNoTexturesAsync(e){return new Promise((t,s)=>{this.loadTextureAtlasButNoTextures(e,(r,i)=>t(i),(r,i)=>s(i))})}setCache(e){this.cache=e}get(e){return this.cache.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.cache.assets[e];if(t)return t;let s=this.errors[e];throw Error("Asset not found: "+e+(s?`
1
+ "use strict";var Ns=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},_e=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,r=e.length;s<r;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},D=class ge{constructor(t=0,s=0,r=0,i=0){this.r=t,this.g=s,this.b=r,this.a=i}static WHITE=new ge(1,1,1,1);static RED=new ge(1,0,0,1);static GREEN=new ge(0,1,0,1);static BLUE=new ge(0,0,1,1);static MAGENTA=new ge(1,0,1,1);set(t,s,r,i){return this.r=t,this.g=s,this.b=r,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=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,s,r,i){return this.r+=t,this.g+=s,this.b+=r,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,s){t.r=((s&4278190080)>>>24)/255,t.g=((s&16711680)>>>16)/255,t.b=((s&65280)>>>8)/255,t.a=(s&255)/255}static rgb888ToColor(t,s){t.r=((s&16711680)>>>16)/255,t.g=((s&65280)>>>8)/255,t.b=(s&255)/255}toRgb888(){const t=s=>("0"+(s*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,s=new ge){return s.setFromString(t)}},R=class le{static PI=3.1415927;static PI2=le.PI*2;static invPI2=1/le.PI2;static radiansToDegrees=180/le.PI;static radDeg=le.radiansToDegrees;static degreesToRadians=le.PI/180;static degRad=le.degreesToRadians;static clamp(t,s,r){return t<s?s:t>r?r:t}static cosDeg(t){return Math.cos(t*le.degRad)}static sinDeg(t){return Math.sin(t*le.degRad)}static atan2Deg(t,s){return Math.atan2(t,s)*le.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 s=Math.pow(Math.abs(t),.3333333333333333);return t<0?-s:s}static randomTriangular(t,s){return le.randomTriangularWith(t,s,(t+s)*.5)}static randomTriangularWith(t,s,r){let i=Math.random(),h=s-t;return i<=(r-t)/h?t+Math.sqrt(i*h*(r-t)):s-Math.sqrt((1-i)*h*(s-r))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},ts=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},ss=class extends ts{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Os=class extends ss{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},P=class pe{static SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";static arrayCopy(t,s,r,i,h){for(let o=s,a=i;o<s+h;o++,a++)r[a]=t[o]}static arrayFill(t,s,r,i){for(let h=s;h<r;h++)t[h]=i}static setArraySize(t,s,r=0){let i=t.length;if(i==s)return t;if(t.length=s,i<s)for(let h=i;h<s;h++)t[h]=r;return t}static ensureArrayCapacity(t,s,r=0){return t.length>=s?t:pe.setArraySize(t,s,r)}static newArray(t,s){let r=new Array(t);for(let i=0;i<t;i++)r[i]=s;return r}static newFloatArray(t){if(pe.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let s=new Array(t);for(let r=0;r<s.length;r++)s[r]=0;return s}}static newShortArray(t){if(pe.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let s=new Array(t);for(let r=0;r<s.length;r++)s[r]=0;return s}}static toFloatArray(t){return pe.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return pe.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,s){}static contains(t,s,r=!0){for(var i=0;i<t.length;i++)if(t[i]==s)return!0;return!1}static enumValue(t,s){return t[s[0].toUpperCase()+s.slice(1)]}},Ds=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}},Ae=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Xe=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},qs=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},Ws=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Ge=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},oe=class Ms extends Ge{static nextID=0;id=Ms.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,s,r,i,h,o){r=h+(r>>1)*o;let a=t.bone.skeleton,n=t.deform,l=this.vertices,c=this.bones;if(!c){n.length>0&&(l=n);let u=t.bone,x=u.worldX,w=u.worldY,p=u.a,g=u.b,b=u.c,y=u.d;for(let v=s,A=h;A<r;v+=2,A+=o){let S=l[v],I=l[v+1];i[A]=S*p+I*g+x,i[A+1]=S*b+I*y+w}return}let d=0,f=0;for(let u=0;u<s;u+=2){let x=c[d];d+=x+1,f+=x}let m=a.bones;if(n.length==0)for(let u=h,x=f*3;u<r;u+=o){let w=0,p=0,g=c[d++];for(g+=d;d<g;d++,x+=3){let b=m[c[d]],y=l[x],v=l[x+1],A=l[x+2];w+=(y*b.a+v*b.b+b.worldX)*A,p+=(y*b.c+v*b.d+b.worldY)*A}i[u]=w,i[u+1]=p}else{let u=n;for(let x=h,w=f*3,p=f<<1;x<r;x+=o){let g=0,b=0,y=c[d++];for(y+=d;d<y;d++,w+=3,p+=2){let v=m[c[d]],A=l[w]+u[p],S=l[w+1]+u[p+1],I=l[w+2];g+=(A*v.a+S*v.b+v.worldX)*I,b+=(A*v.c+S*v.d+v.worldY)*I}i[x]=g,i[x+1]=b}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),P.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=P.newFloatArray(this.vertices.length),P.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}},is=class Oe{static _nextID=0;id=Oe.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new Oe(this.regions.length);return P.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,s){let r=t.sequenceIndex;r==-1&&(r=this.setupIndex),r>=this.regions.length&&(r=this.regions.length-1);let i=this.regions[r];s.region!=i&&(s.region=i,s.updateRegion())}getPath(t,s){let r=t,i=(this.start+s).toString();for(let h=this.digits-i.length;h>0;h--)r+="0";return r+=i,r}static nextID(){return Oe._nextID++}},rs=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(rs||{}),as=[0,1,2,3,4,5,6],Fe=class{name;timelines=[];timelineIds=new _e;duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,s,r,i,h,o,a){if(!e)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let n=this.timelines;for(let l=0,c=n.length;l<c;l++)n[l].apply(e,t,s,i,h,o,a)}},ns=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(ns||{}),ls=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(ls||{}),q={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},J=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=P.newFloatArray(e*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(e,t){let s=e.length;for(let r=1;r<s;r++)if(e[r]>t)return r-1;return s-1}static search(e,t,s){let r=e.length;for(let i=s;i<r;i+=s)if(e[i]>t)return i-s;return r-s}},ae=class extends J{curves;constructor(e,t,s){super(e,s),this.curves=P.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let s=P.newFloatArray(t);P.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,r,i,h,o,a,n,l,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let m=(r-h*2+a)*.03,u=(i-o*2+n)*.03,x=((h-a)*3-r+l)*.006,w=((o-n)*3-i+c)*.006,p=m*2+x,g=u*2+w,b=(h-r)*.3+m+x*.16666667,y=(o-i)*.3+u+w*.16666667,v=r+b,A=i+y;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,b+=p,y+=g,p+=x,g+=w,v+=b,A+=y}getBezierValue(e,t,s,r){let i=this.curves;if(i[r]>e){let n=this.frames[t],l=this.frames[t+s];return l+(e-n)/(i[r]-n)*(i[r+1]-l)}let h=r+18;for(r+=2;r<h;r+=2)if(i[r]>=e){let n=i[r-2],l=i[r-1];return l+(e-n)/(i[r]-n)*(i[r+1]-l)}t+=this.getFrameEntries();let o=i[h-2],a=i[h-1];return a+(e-o)/(this.frames[t]-o)*(this.frames[t+s]-a)}},ie=class extends ae{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let i=2;i<=s;i+=2)if(t[i]>e){s=i-2;break}let r=this.curves[s>>1];switch(r){case 0:let i=t[s],h=t[s+1];return h+(e-i)/(t[s+2]-i)*(t[s+2+1]-h);case 1:return t[s+1]}return this.getBezierValue(e,s,1,r-2)}getRelativeValue(e,t,s,r,i){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}let h=this.getCurveValue(e);switch(s){case 0:return i+h*t;case 1:case 2:h+=i-r}return r+h*t}getAbsoluteValue(e,t,s,r,i){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}let h=this.getCurveValue(e);return s==0?i+(h-i)*t:r+(h-r)*t}getAbsoluteValue2(e,t,s,r,i,h){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}return s==0?i+(h-i)*t:r+(h-r)*t}getScaleValue(e,t,s,r,i,h){const o=this.frames;if(e<o[0]){switch(s){case 0:return h;case 1:return i+(h-i)*t}return i}let a=this.getCurveValue(e)*h;if(t==1)return s==3?i+a-h:a;if(r==1)switch(s){case 0:return h+(Math.abs(a)*R.signum(h)-h)*t;case 1:case 2:return i+(Math.abs(a)*R.signum(i)-i)*t}else{let n=0;switch(s){case 0:return n=Math.abs(h)*R.signum(a),n+(a-n)*t;case 1:case 2:return n=Math.abs(i)*R.signum(a),n+(a-n)*t}}return i+(a-h)*t}},Ee=class extends ae{constructor(e,t,s,r){super(e,t,[s,r])}getFrameEntries(){return 3}setFrame(e,t,s,r){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r}},Se=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.rotation=this.getRelativeValue(s,i,h,a.rotation,a.data.rotation))}},$e=class extends Ee{boneIndex=0;constructor(e,t,s){super(e,t,q.x+"|"+s,q.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.x=a.data.x,a.y=a.data.y;return;case 1:a.x+=(a.data.x-a.x)*i,a.y+=(a.data.y-a.y)*i}return}let l=0,c=0,d=J.search(n,s,3),f=this.curves[d/3];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+3]-m);l+=(n[d+3+1]-l)*u,c+=(n[d+3+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:a.x=a.data.x+l*i,a.y=a.data.y+c*i;break;case 1:case 2:a.x+=(a.data.x+l-a.x)*i,a.y+=(a.data.y+c-a.y)*i;break;case 3:a.x+=l*i,a.y+=c*i}}},He=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.x+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.x=this.getRelativeValue(s,i,h,a.x,a.data.x))}},Je=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.y=this.getRelativeValue(s,i,h,a.y,a.data.y))}},je=class extends Ee{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleX+"|"+s,q.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.scaleX=a.data.scaleX,a.scaleY=a.data.scaleY;return;case 1:a.scaleX+=(a.data.scaleX-a.scaleX)*i,a.scaleY+=(a.data.scaleY-a.scaleY)*i}return}let l,c,d=J.search(n,s,3),f=this.curves[d/3];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+3]-m);l+=(n[d+3+1]-l)*u,c+=(n[d+3+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}if(l*=a.data.scaleX,c*=a.data.scaleY,i==1)h==3?(a.scaleX+=l-a.data.scaleX,a.scaleY+=c-a.data.scaleY):(a.scaleX=l,a.scaleY=c);else{let m=0,u=0;if(o==1)switch(h){case 0:m=a.data.scaleX,u=a.data.scaleY,a.scaleX=m+(Math.abs(l)*R.signum(m)-m)*i,a.scaleY=u+(Math.abs(c)*R.signum(u)-u)*i;break;case 1:case 2:m=a.scaleX,u=a.scaleY,a.scaleX=m+(Math.abs(l)*R.signum(m)-m)*i,a.scaleY=u+(Math.abs(c)*R.signum(u)-u)*i;break;case 3:a.scaleX+=(l-a.data.scaleX)*i,a.scaleY+=(c-a.data.scaleY)*i}else switch(h){case 0:m=Math.abs(a.data.scaleX)*R.signum(l),u=Math.abs(a.data.scaleY)*R.signum(c),a.scaleX=m+(l-m)*i,a.scaleY=u+(c-u)*i;break;case 1:case 2:m=Math.abs(a.scaleX)*R.signum(l),u=Math.abs(a.scaleY)*R.signum(c),a.scaleX=m+(l-m)*i,a.scaleY=u+(c-u)*i;break;case 3:a.scaleX+=(l-a.data.scaleX)*i,a.scaleY+=(c-a.data.scaleY)*i}}}},Ke=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.scaleX=this.getScaleValue(s,i,h,o,a.scaleX,a.data.scaleX))}},Qe=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.scaleY=this.getScaleValue(s,i,h,o,a.scaleY,a.data.scaleY))}},Ze=class extends Ee{boneIndex=0;constructor(e,t,s){super(e,t,q.shearX+"|"+s,q.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.shearX=a.data.shearX,a.shearY=a.data.shearY;return;case 1:a.shearX+=(a.data.shearX-a.shearX)*i,a.shearY+=(a.data.shearY-a.shearY)*i}return}let l=0,c=0,d=J.search(n,s,3),f=this.curves[d/3];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+3]-m);l+=(n[d+3+1]-l)*u,c+=(n[d+3+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:a.shearX=a.data.shearX+l*i,a.shearY=a.data.shearY+c*i;break;case 1:case 2:a.shearX+=(a.data.shearX+l-a.shearX)*i,a.shearY+=(a.data.shearY+c-a.shearY)*i;break;case 3:a.shearX+=l*i,a.shearY+=c*i}}},et=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.shearX=this.getRelativeValue(s,i,h,a.shearX,a.data.shearX))}},tt=class extends ie{boneIndex=0;constructor(e,t,s){super(e,t,q.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];a.active&&(a.shearY=this.getRelativeValue(s,i,h,a.shearY,a.data.shearY))}},st=class extends J{boneIndex=0;constructor(e,t){super(e,[q.inherit+"|"+t]),this.boneIndex=t}getFrameEntries(){return 2}setFrame(e,t,s){e*=2,this.frames[e]=t,this.frames[e+1]=s}apply(e,t,s,r,i,h,o){let a=e.bones[this.boneIndex];if(!a.active)return;if(o==1){h==0&&(a.inherit=a.data.inherit);return}let n=this.frames;if(s<n[0]){(h==0||h==1)&&(a.inherit=a.data.inherit);return}a.inherit=this.frames[J.search(n,s,2)+1]}},it=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(e,t,s,r,i,h){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color;if(s<n[0]){let w=a.data.color;switch(h){case 0:l.setFromColor(w);return;case 1:l.add((w.r-l.r)*i,(w.g-l.g)*i,(w.b-l.b)*i,(w.a-l.a)*i)}return}let c=0,d=0,f=0,m=0,u=J.search(n,s,5),x=this.curves[u/5];switch(x){case 0:let w=n[u];c=n[u+1],d=n[u+2],f=n[u+3],m=n[u+4];let p=(s-w)/(n[u+5]-w);c+=(n[u+5+1]-c)*p,d+=(n[u+5+2]-d)*p,f+=(n[u+5+3]-f)*p,m+=(n[u+5+4]-m)*p;break;case 1:c=n[u+1],d=n[u+2],f=n[u+3],m=n[u+4];break;default:c=this.getBezierValue(s,u,1,x-2),d=this.getBezierValue(s,u,2,x+18-2),f=this.getBezierValue(s,u,3,x+18*2-2),m=this.getBezierValue(s,u,4,x+18*3-2)}i==1?l.set(c,d,f,m):(h==0&&l.setFromColor(a.data.color),l.add((c-l.r)*i,(d-l.g)*i,(f-l.b)*i,(m-l.a)*i))}},rt=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,i){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color;if(s<n[0]){let x=a.data.color;switch(h){case 0:l.r=x.r,l.g=x.g,l.b=x.b;return;case 1:l.r+=(x.r-l.r)*i,l.g+=(x.g-l.g)*i,l.b+=(x.b-l.b)*i}return}let c=0,d=0,f=0,m=J.search(n,s,4),u=this.curves[m>>2];switch(u){case 0:let x=n[m];c=n[m+1],d=n[m+2],f=n[m+3];let w=(s-x)/(n[m+4]-x);c+=(n[m+4+1]-c)*w,d+=(n[m+4+2]-d)*w,f+=(n[m+4+3]-f)*w;break;case 1:c=n[m+1],d=n[m+2],f=n[m+3];break;default:c=this.getBezierValue(s,m,1,u-2),d=this.getBezierValue(s,m,2,u+18-2),f=this.getBezierValue(s,m,3,u+18*2-2)}if(i==1)l.r=c,l.g=d,l.b=f;else{if(h==0){let x=a.data.color;l.r=x.r,l.g=x.g,l.b=x.b}l.r+=(c-l.r)*i,l.g+=(d-l.g)*i,l.b+=(f-l.b)*i}}},at=class extends ie{slotIndex=0;constructor(e,t,s){super(e,t,q.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=a.color;if(s<this.frames[0]){let c=a.data.color;switch(h){case 0:n.a=c.a;return;case 1:n.a+=(c.a-n.a)*i}return}let l=this.getCurveValue(s);i==1?n.a=l:(h==0&&(n.a=a.data.color.a),n.a+=(l-n.a)*i)}},nt=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.alpha+"|"+s,q.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,r,i,h,o,a,n){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=a,this.frames[e+7]=n}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color,c=a.darkColor;if(s<n[0]){let y=a.data.color,v=a.data.darkColor;switch(h){case 0:l.setFromColor(y),c.r=v.r,c.g=v.g,c.b=v.b;return;case 1:l.add((y.r-l.r)*i,(y.g-l.g)*i,(y.b-l.b)*i,(y.a-l.a)*i),c.r+=(v.r-c.r)*i,c.g+=(v.g-c.g)*i,c.b+=(v.b-c.b)*i}return}let d=0,f=0,m=0,u=0,x=0,w=0,p=0,g=J.search(n,s,8),b=this.curves[g>>3];switch(b){case 0:let y=n[g];d=n[g+1],f=n[g+2],m=n[g+3],u=n[g+4],x=n[g+5],w=n[g+6],p=n[g+7];let v=(s-y)/(n[g+8]-y);d+=(n[g+8+1]-d)*v,f+=(n[g+8+2]-f)*v,m+=(n[g+8+3]-m)*v,u+=(n[g+8+4]-u)*v,x+=(n[g+8+5]-x)*v,w+=(n[g+8+6]-w)*v,p+=(n[g+8+7]-p)*v;break;case 1:d=n[g+1],f=n[g+2],m=n[g+3],u=n[g+4],x=n[g+5],w=n[g+6],p=n[g+7];break;default:d=this.getBezierValue(s,g,1,b-2),f=this.getBezierValue(s,g,2,b+18-2),m=this.getBezierValue(s,g,3,b+18*2-2),u=this.getBezierValue(s,g,4,b+18*3-2),x=this.getBezierValue(s,g,5,b+18*4-2),w=this.getBezierValue(s,g,6,b+18*5-2),p=this.getBezierValue(s,g,7,b+18*6-2)}if(i==1)l.set(d,f,m,u),c.r=x,c.g=w,c.b=p;else{if(h==0){l.setFromColor(a.data.color);let y=a.data.darkColor;c.r=y.r,c.g=y.g,c.b=y.b}l.add((d-l.r)*i,(f-l.g)*i,(m-l.b)*i,(u-l.a)*i),c.r+=(x-c.r)*i,c.g+=(w-c.g)*i,c.b+=(p-c.b)*i}}},lt=class extends ae{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,i,h,o,a){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=a}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=this.frames,l=a.color,c=a.darkColor;if(s<n[0]){let y=a.data.color,v=a.data.darkColor;switch(h){case 0:l.r=y.r,l.g=y.g,l.b=y.b,c.r=v.r,c.g=v.g,c.b=v.b;return;case 1:l.r+=(y.r-l.r)*i,l.g+=(y.g-l.g)*i,l.b+=(y.b-l.b)*i,c.r+=(v.r-c.r)*i,c.g+=(v.g-c.g)*i,c.b+=(v.b-c.b)*i}return}let d=0,f=0,m=0,u=0,x=0,w=0,p=0,g=J.search(n,s,7),b=this.curves[g/7];switch(b){case 0:let y=n[g];d=n[g+1],f=n[g+2],m=n[g+3],x=n[g+4],w=n[g+5],p=n[g+6];let v=(s-y)/(n[g+7]-y);d+=(n[g+7+1]-d)*v,f+=(n[g+7+2]-f)*v,m+=(n[g+7+3]-m)*v,x+=(n[g+7+4]-x)*v,w+=(n[g+7+5]-w)*v,p+=(n[g+7+6]-p)*v;break;case 1:d=n[g+1],f=n[g+2],m=n[g+3],x=n[g+4],w=n[g+5],p=n[g+6];break;default:d=this.getBezierValue(s,g,1,b-2),f=this.getBezierValue(s,g,2,b+18-2),m=this.getBezierValue(s,g,3,b+18*2-2),x=this.getBezierValue(s,g,4,b+18*3-2),w=this.getBezierValue(s,g,5,b+18*4-2),p=this.getBezierValue(s,g,6,b+18*5-2)}if(i==1)l.r=d,l.g=f,l.b=m,c.r=x,c.g=w,c.b=p;else{if(h==0){let y=a.data.color,v=a.data.darkColor;l.r=y.r,l.g=y.g,l.b=y.b,c.r=v.r,c.g=v.g,c.b=v.b}l.r+=(d-l.r)*i,l.g+=(f-l.g)*i,l.b+=(m-l.b)*i,c.r+=(x-c.r)*i,c.g+=(w-c.g)*i,c.b+=(p-c.b)*i}}},me=class extends J{slotIndex=0;attachmentNames;constructor(e,t){super(e,[q.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(a.bone.active){if(o==1){h==0&&this.setAttachment(e,a,a.data.attachmentName);return}if(s<this.frames[0]){(h==0||h==1)&&this.setAttachment(e,a,a.data.attachmentName);return}this.setAttachment(e,a,this.attachmentNames[J.search1(this.frames,s)])}}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},ot=class extends ae{slotIndex=0;attachment;vertices;constructor(e,t,s,r){super(e,t,[q.deform+"|"+s+"|"+r.id]),this.slotIndex=s,this.attachment=r,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,r,i,h,o,a,n,l,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let m=(r-h*2+a)*.03,u=n*.03-o*.06,x=((h-a)*3-r+l)*.006,w=(o-n+.33333333)*.018,p=m*2+x,g=u*2+w,b=(h-r)*.3+m+x*.16666667,y=o*.3+u+w*.16666667,v=r+b,A=y;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,b+=p,y+=g,p+=x,g+=w,v+=b,A+=y}getCurvePercent(e,t){let s=this.curves,r=s[t];switch(r){case 0:let a=this.frames[t];return(e-a)/(this.frames[t+this.getFrameEntries()]-a);case 1:return 0}if(r-=2,s[r]>e){let a=this.frames[t];return s[r+1]*(e-a)/(s[r]-a)}let i=r+18;for(r+=2;r<i;r+=2)if(s[r]>=e){let a=s[r-2],n=s[r-1];return n+(e-a)/(s[r]-a)*(s[r+1]-n)}let h=s[i-2],o=s[i-1];return o+(1-o)*(e-h)/(this.frames[t+this.getFrameEntries()]-h)}apply(e,t,s,r,i,h,o){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let n=a.getAttachment();if(!n||!(n instanceof oe)||n.timelineAttachment!=this.attachment)return;let l=a.deform;l.length==0&&(h=0);let c=this.vertices,d=c[0].length,f=this.frames;if(s<f[0]){switch(h){case 0:l.length=0;return;case 1:if(i==1){l.length=0;return}l.length=d;let g=n;if(g.bones){i=1-i;for(var m=0;m<d;m++)l[m]*=i}else{let b=g.vertices;for(var m=0;m<d;m++)l[m]+=(b[m]-l[m])*i}}return}if(l.length=d,s>=f[f.length-1]){let g=c[f.length-1];if(i==1)if(h==3){let b=n;if(b.bones)for(let y=0;y<d;y++)l[y]+=g[y];else{let y=b.vertices;for(let v=0;v<d;v++)l[v]+=g[v]-y[v]}}else P.arrayCopy(g,0,l,0,d);else switch(h){case 0:{let y=n;if(y.bones)for(let v=0;v<d;v++)l[v]=g[v]*i;else{let v=y.vertices;for(let A=0;A<d;A++){let S=v[A];l[A]=S+(g[A]-S)*i}}break}case 1:case 2:for(let y=0;y<d;y++)l[y]+=(g[y]-l[y])*i;break;case 3:let b=n;if(b.bones)for(let y=0;y<d;y++)l[y]+=g[y]*i;else{let y=b.vertices;for(let v=0;v<d;v++)l[v]+=(g[v]-y[v])*i}}return}let u=J.search1(f,s),x=this.getCurvePercent(s,u),w=c[u],p=c[u+1];if(i==1)if(h==3){let g=n;if(g.bones)for(let b=0;b<d;b++){let y=w[b];l[b]+=y+(p[b]-y)*x}else{let b=g.vertices;for(let y=0;y<d;y++){let v=w[y];l[y]+=v+(p[y]-v)*x-b[y]}}}else for(let g=0;g<d;g++){let b=w[g];l[g]=b+(p[g]-b)*x}else switch(h){case 0:{let b=n;if(b.bones)for(let y=0;y<d;y++){let v=w[y];l[y]=(v+(p[y]-v)*x)*i}else{let y=b.vertices;for(let v=0;v<d;v++){let A=w[v],S=y[v];l[v]=S+(A+(p[v]-A)*x-S)*i}}break}case 1:case 2:for(let b=0;b<d;b++){let y=w[b];l[b]+=(y+(p[b]-y)*x-l[b])*i}break;case 3:let g=n;if(g.bones)for(let b=0;b<d;b++){let y=w[b];l[b]+=(y+(p[b]-y)*x)*i}else{let b=g.vertices;for(let y=0;y<d;y++){let v=w[y];l[y]+=(v+(p[y]-v)*x-b[y])*i}}}}},Re=class Xs extends J{static propertyIds=[""+q.event];events;constructor(t){super(t,Xs.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s.time,this.events[t]=s}apply(t,s,r,i,h,o,a){if(!i)return;let n=this.frames,l=this.frames.length;if(s>r)this.apply(t,s,Number.MAX_VALUE,i,h,o,a),s=-1;else if(s>=n[l-1])return;if(r<n[0])return;let c=0;if(s<n[0])c=0;else{c=J.search1(n,s)+1;let d=n[c];for(;c>0&&n[c-1]==d;)c--}for(;c<l&&r>=n[c];c++)i.push(this.events[c])}},we=class Fs extends J{static propertyIds=[""+q.drawOrder];drawOrders;constructor(t){super(t,Fs.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,r){this.frames[t]=s,this.drawOrders[t]=r}apply(t,s,r,i,h,o,a){if(a==1){o==0&&P.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(r<this.frames[0]){(o==0||o==1)&&P.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let n=J.search1(this.frames,r),l=this.drawOrders[n];if(!l)P.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let c=t.drawOrder,d=t.slots;for(let f=0,m=l.length;f<m;f++)c[f]=d[l[f]]}}},ht=class extends ae{constraintIndex=0;constructor(e,t,s){super(e,t,[q.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,r,i,h,o){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=h?1:0,this.frames[e+5]=o?1:0}apply(e,t,s,r,i,h,o){let a=e.ikConstraints[this.constraintIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch;return;case 1:a.mix+=(a.data.mix-a.mix)*i,a.softness+=(a.data.softness-a.softness)*i,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}return}let l=0,c=0,d=J.search(n,s,6),f=this.curves[d/6];switch(f){case 0:let m=n[d];l=n[d+1],c=n[d+2];let u=(s-m)/(n[d+6]-m);l+=(n[d+6+1]-l)*u,c+=(n[d+6+2]-c)*u;break;case 1:l=n[d+1],c=n[d+2];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}h==0?(a.mix=a.data.mix+(l-a.data.mix)*i,a.softness=a.data.softness+(c-a.data.softness)*i,o==1?(a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch):(a.bendDirection=n[d+3],a.compress=n[d+4]!=0,a.stretch=n[d+5]!=0)):(a.mix+=(l-a.mix)*i,a.softness+=(c-a.softness)*i,o==0&&(a.bendDirection=n[d+3],a.compress=n[d+4]!=0,a.stretch=n[d+5]!=0))}},ct=class extends ae{constraintIndex=0;constructor(e,t,s){super(e,t,[q.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,i,h,o,a){let n=this.frames;e*=7,n[e]=t,n[e+1]=s,n[e+2]=r,n[e+3]=i,n[e+4]=h,n[e+5]=o,n[e+6]=a}apply(e,t,s,r,i,h,o){let a=e.transformConstraints[this.constraintIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){let p=a.data;switch(h){case 0:a.mixRotate=p.mixRotate,a.mixX=p.mixX,a.mixY=p.mixY,a.mixScaleX=p.mixScaleX,a.mixScaleY=p.mixScaleY,a.mixShearY=p.mixShearY;return;case 1:a.mixRotate+=(p.mixRotate-a.mixRotate)*i,a.mixX+=(p.mixX-a.mixX)*i,a.mixY+=(p.mixY-a.mixY)*i,a.mixScaleX+=(p.mixScaleX-a.mixScaleX)*i,a.mixScaleY+=(p.mixScaleY-a.mixScaleY)*i,a.mixShearY+=(p.mixShearY-a.mixShearY)*i}return}let l,c,d,f,m,u,x=J.search(n,s,7),w=this.curves[x/7];switch(w){case 0:let p=n[x];l=n[x+1],c=n[x+2],d=n[x+3],f=n[x+4],m=n[x+5],u=n[x+6];let g=(s-p)/(n[x+7]-p);l+=(n[x+7+1]-l)*g,c+=(n[x+7+2]-c)*g,d+=(n[x+7+3]-d)*g,f+=(n[x+7+4]-f)*g,m+=(n[x+7+5]-m)*g,u+=(n[x+7+6]-u)*g;break;case 1:l=n[x+1],c=n[x+2],d=n[x+3],f=n[x+4],m=n[x+5],u=n[x+6];break;default:l=this.getBezierValue(s,x,1,w-2),c=this.getBezierValue(s,x,2,w+18-2),d=this.getBezierValue(s,x,3,w+18*2-2),f=this.getBezierValue(s,x,4,w+18*3-2),m=this.getBezierValue(s,x,5,w+18*4-2),u=this.getBezierValue(s,x,6,w+18*5-2)}if(h==0){let p=a.data;a.mixRotate=p.mixRotate+(l-p.mixRotate)*i,a.mixX=p.mixX+(c-p.mixX)*i,a.mixY=p.mixY+(d-p.mixY)*i,a.mixScaleX=p.mixScaleX+(f-p.mixScaleX)*i,a.mixScaleY=p.mixScaleY+(m-p.mixScaleY)*i,a.mixShearY=p.mixShearY+(u-p.mixShearY)*i}else a.mixRotate+=(l-a.mixRotate)*i,a.mixX+=(c-a.mixX)*i,a.mixY+=(d-a.mixY)*i,a.mixScaleX+=(f-a.mixScaleX)*i,a.mixScaleY+=(m-a.mixScaleY)*i,a.mixShearY+=(u-a.mixShearY)*i}},dt=class extends ie{constraintIndex=0;constructor(e,t,s){super(e,t,q.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,h,o){let a=e.pathConstraints[this.constraintIndex];a.active&&(a.position=this.getAbsoluteValue(s,i,h,a.position,a.data.position))}},ft=class extends ie{constraintIndex=0;constructor(e,t,s){super(e,t,q.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,h,o){let a=e.pathConstraints[this.constraintIndex];a.active&&(a.spacing=this.getAbsoluteValue(s,i,h,a.spacing,a.data.spacing))}},ut=class extends ae{constraintIndex=0;constructor(e,t,s){super(e,t,[q.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,i){let h=this.frames;e<<=2,h[e]=t,h[e+1]=s,h[e+2]=r,h[e+3]=i}apply(e,t,s,r,i,h,o){let a=e.pathConstraints[this.constraintIndex];if(!a.active)return;let n=this.frames;if(s<n[0]){switch(h){case 0:a.mixRotate=a.data.mixRotate,a.mixX=a.data.mixX,a.mixY=a.data.mixY;return;case 1:a.mixRotate+=(a.data.mixRotate-a.mixRotate)*i,a.mixX+=(a.data.mixX-a.mixX)*i,a.mixY+=(a.data.mixY-a.mixY)*i}return}let l,c,d,f=J.search(n,s,4),m=this.curves[f>>2];switch(m){case 0:let u=n[f];l=n[f+1],c=n[f+2],d=n[f+3];let x=(s-u)/(n[f+4]-u);l+=(n[f+4+1]-l)*x,c+=(n[f+4+2]-c)*x,d+=(n[f+4+3]-d)*x;break;case 1:l=n[f+1],c=n[f+2],d=n[f+3];break;default:l=this.getBezierValue(s,f,1,m-2),c=this.getBezierValue(s,f,2,m+18-2),d=this.getBezierValue(s,f,3,m+18*2-2)}if(h==0){let u=a.data;a.mixRotate=u.mixRotate+(l-u.mixRotate)*i,a.mixX=u.mixX+(c-u.mixX)*i,a.mixY=u.mixY+(d-u.mixY)*i}else a.mixRotate+=(l-a.mixRotate)*i,a.mixX+=(c-a.mixX)*i,a.mixY+=(d-a.mixY)*i}},de=class extends ie{constraintIndex=0;constructor(e,t,s,r){super(e,t,r+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,h,o){let a;if(this.constraintIndex==-1){const n=s>=this.frames[0]?this.getCurveValue(s):0;for(const l of e.physicsConstraints)l.active&&this.global(l.data)&&this.set(l,this.getAbsoluteValue2(s,i,h,this.get(l),this.setup(l),n))}else a=e.physicsConstraints[this.constraintIndex],a.active&&this.set(a,this.getAbsoluteValue(s,i,h,this.get(a),this.setup(a)))}},mt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},gt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},xt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},bt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},wt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},pt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},yt=class extends de{constructor(e,t,s){super(e,t,s,q.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},vt=class Es extends J{static propertyIds=[q.physicsConstraintReset.toString()];constraintIndex;constructor(t,s){super(t,Es.propertyIds),this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,r,i,h,o,a){let n;if(this.constraintIndex!=-1&&(n=t.physicsConstraints[this.constraintIndex],!n.active))return;const l=this.frames;if(s>r)this.apply(t,s,Number.MAX_VALUE,[],h,o,a),s=-1;else if(s>=l[l.length-1])return;if(!(r<l[0])&&(s<l[0]||r>=l[J.search1(l,s)+1]))if(n!=null)n.reset();else for(const c of t.physicsConstraints)c.active&&c.reset()}},At=class fe extends J{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,s,r){super(t,[q.sequence+"|"+s+"|"+r.sequence.id]),this.slotIndex=s,this.attachment=r}getFrameEntries(){return fe.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,r,i,h){let o=this.frames;t*=fe.ENTRIES,o[t]=s,o[t+fe.MODE]=r|i<<4,o[t+fe.DELAY]=h}apply(t,s,r,i,h,o,a){let n=t.slots[this.slotIndex];if(!n.bone.active)return;let l=n.attachment,c=this.attachment;if(l!=c&&(!(l instanceof oe)||l.timelineAttachment!=c))return;if(a==1){o==0&&(n.sequenceIndex=-1);return}let d=this.frames;if(r<d[0]){(o==0||o==1)&&(n.sequenceIndex=-1);return}let f=J.search(d,r,fe.ENTRIES),m=d[f],u=d[f+fe.MODE],x=d[f+fe.DELAY];if(!this.attachment.sequence)return;let w=u>>4,p=this.attachment.sequence.regions.length,g=as[u&15];if(g!=0)switch(w+=(r-m)/x+1e-5|0,g){case 1:w=Math.min(p-1,w);break;case 2:w%=p;break;case 3:{let b=(p<<1)-2;w=b==0?0:w%b,w>=p&&(w=b-w);break}case 4:w=Math.max(p-1-w,0);break;case 5:w=p-1-w%p;break;case 6:{let b=(p<<1)-2;w=b==0?0:(w+p-1)%b,w>=p&&(w=b-w)}}n.sequenceIndex=w}},Us=class De{static _emptyAnimation=new Fe("<empty>",[],0);static emptyAnimation(){return De._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new hs(this);propertyIDs=new _e;animationsChanged=!1;trackEntryPool=new Ae(()=>new os);constructor(t){this.data=t}update(t){t*=this.timeScale;let s=this.tracks;for(let r=0,i=s.length;r<i;r++){let h=s[r];if(!h)continue;h.animationLast=h.nextAnimationLast,h.trackLast=h.nextTrackLast;let o=t*h.timeScale;if(h.delay>0){if(h.delay-=o,h.delay>0)continue;o=-h.delay,h.delay=0}let a=h.next;if(a){let n=h.trackLast-a.delay;if(n>=0){for(a.delay=0,a.trackTime+=h.timeScale==0?0:(n/h.timeScale+t)*a.timeScale,h.trackTime+=o,this.setCurrent(r,a,!0);a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(h.trackLast>=h.trackEnd&&!h.mixingFrom){s[r]=null,this.queue.end(h),this.clearNext(h);continue}if(h.mixingFrom&&this.updateMixingFrom(h,t)){let n=h.mixingFrom;for(h.mixingFrom=null,n&&(n.mixingTo=null);n;)this.queue.end(n),n=n.mixingFrom}h.trackTime+=o}this.queue.drain()}updateMixingFrom(t,s){let r=t.mixingFrom;if(!r)return!0;let i=this.updateMixingFrom(r,s);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,t.nextTrackLast!=-1&&t.mixTime>=t.mixDuration?((r.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=r.mixingFrom,r.mixingFrom!=null&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),i):(r.trackTime+=s*r.timeScale,t.mixTime+=s,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,r=this.tracks,i=!1;for(let f=0,m=r.length;f<m;f++){let u=r[f];if(!u||u.delay>0)continue;i=!0;let x=f==0?1:u.mixBlend,w=u.alpha;u.mixingFrom?w*=this.applyMixingFrom(u,t,x):u.trackTime>=u.trackEnd&&!u.next&&(w=0);let p=w>=u.alphaAttachmentThreshold,g=u.animationLast,b=u.getAnimationTime(),y=b,v=s;u.reverse&&(y=u.animation.duration-y,v=null);let A=u.animation.timelines,S=A.length;if(f==0&&w==1||x==3){f==0&&(p=!0);for(let I=0;I<S;I++){P.webkit602BugfixHelper(w,x);var h=A[I];h instanceof me?this.applyAttachmentTimeline(h,t,y,x,p):h.apply(t,g,y,v,w,x,0)}}else{let I=u.timelineMode,T=u.shortestRotation,M=!T&&u.timelinesRotation.length!=S<<1;M&&(u.timelinesRotation.length=S<<1);for(let Y=0;Y<S;Y++){let F=A[Y],E=I[Y]==Pe?x:0;!T&&F instanceof Se?this.applyRotateTimeline(F,t,y,w,E,u.timelinesRotation,Y<<1,M):F instanceof me?this.applyAttachmentTimeline(F,t,y,x,p):(P.webkit602BugfixHelper(w,x),F.apply(t,g,y,v,w,E,0))}}this.queueEvents(u,b),s.length=0,u.nextAnimationLast=b,u.nextTrackLast=u.trackTime}for(var o=this.unkeyedState+It,a=t.slots,n=0,l=t.slots.length;n<l;n++){var c=a[n];if(c.attachmentState==o){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,s,r){let i=t.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,s,r);let h=0;t.mixDuration==0?(h=1,r==1&&(r=0)):(h=t.mixTime/t.mixDuration,h>1&&(h=1),r!=1&&(r=i.mixBlend));let o=h<i.mixAttachmentThreshold,a=h<i.mixDrawOrderThreshold,n=i.animation.timelines,l=n.length,c=i.alpha*t.interruptAlpha,d=c*(1-h),f=i.animationLast,m=i.getAnimationTime(),u=m,x=null;if(i.reverse?u=i.animation.duration-u:h<i.eventThreshold&&(x=this.events),r==3)for(let w=0;w<l;w++)n[w].apply(s,f,u,x,d,r,1);else{let w=i.timelineMode,p=i.timelineHoldMix,g=i.shortestRotation,b=!g&&i.timelinesRotation.length!=l<<1;b&&(i.timelinesRotation.length=l<<1),i.totalAlpha=0;for(let y=0;y<l;y++){let v=n[y],A=1,S,I=0;switch(w[y]){case Pe:if(!a&&v instanceof we)continue;S=r,I=d;break;case St:S=0,I=d;break;case Ct:S=r,I=c;break;case Be:S=0,I=c;break;default:S=0;let T=p[y];I=c*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=I,!g&&v instanceof Se?this.applyRotateTimeline(v,s,u,I,S,i.timelinesRotation,y<<1,b):v instanceof me?this.applyAttachmentTimeline(v,s,u,S,o&&I>=i.alphaAttachmentThreshold):(P.webkit602BugfixHelper(I,r),a&&v instanceof we&&S==0&&(A=0),v.apply(s,f,u,x,I,S,A))}}return t.mixDuration>0&&this.queueEvents(i,m),this.events.length=0,i.nextAnimationLast=m,i.nextTrackLast=i.trackTime,h}applyAttachmentTimeline(t,s,r,i,h){var o=s.slots[t.slotIndex];o.bone.active&&(r<t.frames[0]?(i==0||i==1)&&this.setAttachment(s,o,o.data.attachmentName,h):this.setAttachment(s,o,t.attachmentNames[J.search1(t.frames,r)],h),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+It))}setAttachment(t,s,r,i){s.setAttachment(r?t.getAttachment(s.data.index,r):null),i&&(s.attachmentState=this.unkeyedState+fs)}applyRotateTimeline(t,s,r,i,h,o,a,n){if(n&&(o[a]=0),i==1){t.apply(s,0,r,null,1,h,0);return}let l=s.bones[t.boneIndex];if(!l.active)return;let c=t.frames,d=0,f=0;if(r<c[0])switch(h){case 0:l.rotation=l.data.rotation;default:return;case 1:d=l.rotation,f=l.data.rotation}else d=h==0?l.data.rotation:l.rotation,f=l.data.rotation+t.getCurveValue(r);let m=0,u=f-d;if(u-=Math.ceil(u/360-.5)*360,u==0)m=o[a];else{let x=0,w=0;n?(x=0,w=u):(x=o[a],w=o[a+1]);let p=x-x%360;m=u+p;let g=u>=0,b=x>=0;Math.abs(w)<=90&&R.signum(w)!=R.signum(u)&&(Math.abs(x-p)>180?(m+=360*R.signum(x),b=g):p!=0?m-=360*R.signum(x):b=g),b!=g&&(m+=360*R.signum(x)),o[a]=m}o[a+1]=u,l.rotation=d+m*i}queueEvents(t,s){let r=t.animationStart,i=t.animationEnd,h=i-r,o=t.trackLast%h,a=this.events,n=0,l=a.length;for(;n<l;n++){let d=a[n];if(d.time<o)break;d.time>i||this.queue.event(t,d)}let c=!1;if(t.loop)if(h==0)c=!0;else{const d=Math.floor(t.trackTime/h);c=d>0&&d>Math.floor(t.trackLast/h)}else c=s>=i&&t.animationLast<i;for(c&&this.queue.complete(t);n<l;n++){let d=a[n];d.time<r||this.queue.event(t,d)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++)this.clearTrack(s);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let s=this.tracks[t];if(!s)return;this.queue.end(s),this.clearNext(s);let r=s;for(;;){let i=r.mixingFrom;if(!i)break;this.queue.end(i),r.mixingFrom=null,r.mixingTo=null,r=i}this.tracks[s.trackIndex]=null,this.queue.drain()}setCurrent(t,s,r){let i=this.expandToIndex(t);this.tracks[t]=s,s.previous=null,i&&(r&&this.queue.interrupt(i),s.mixingFrom=i,i.mixingTo=s,s.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(s.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(s)}setAnimation(t,s,r=!1){let i=this.data.skeletonData.findAnimation(s);if(!i)throw new Error("Animation not found: "+s);return this.setAnimationWith(t,i,r)}setAnimationWith(t,s,r=!1){if(!s)throw new Error("animation cannot be null.");let i=!0,h=this.expandToIndex(t);h&&(h.nextTrackLast==-1?(this.tracks[t]=h.mixingFrom,this.queue.interrupt(h),this.queue.end(h),this.clearNext(h),h=h.mixingFrom,i=!1):this.clearNext(h));let o=this.trackEntry(t,s,r,h);return this.setCurrent(t,o,i),this.queue.drain(),o}addAnimation(t,s,r=!1,i=0){let h=this.data.skeletonData.findAnimation(s);if(!h)throw new Error("Animation not found: "+s);return this.addAnimationWith(t,h,r,i)}addAnimationWith(t,s,r=!1,i=0){if(!s)throw new Error("animation cannot be null.");let h=this.expandToIndex(t);if(h)for(;h.next;)h=h.next;let o=this.trackEntry(t,s,r,h);return h?(h.next=o,o.previous=h,i<=0&&(i=Math.max(i+h.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(t,o,!0),this.queue.drain(),i<0&&(i=0)),o.delay=i,o}setEmptyAnimation(t,s=0){let r=this.setAnimationWith(t,De.emptyAnimation(),!1);return r.mixDuration=s,r.trackEnd=s,r}addEmptyAnimation(t,s=0,r=0){let i=this.addAnimationWith(t,De.emptyAnimation(),!1,r);return r<=0&&(i.delay=Math.max(i.delay+i.mixDuration-s,0)),i.mixDuration=s,i.trackEnd=s,i}setEmptyAnimations(t=0){let s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let r=0,i=this.tracks.length;r<i;r++){let h=this.tracks[r];h&&this.setEmptyAnimation(h.trackIndex,t)}this.queue.drainDisabled=s,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(P.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,s,r,i){let h=this.trackEntryPool.obtain();return h.reset(),h.trackIndex=t,h.animation=s,h.loop=r,h.holdPrevious=!1,h.reverse=!1,h.shortestRotation=!1,h.eventThreshold=0,h.alphaAttachmentThreshold=0,h.mixAttachmentThreshold=0,h.mixDrawOrderThreshold=0,h.animationStart=0,h.animationEnd=s.duration,h.animationLast=-1,h.nextAnimationLast=-1,h.delay=0,h.trackTime=0,h.trackLast=-1,h.nextTrackLast=-1,h.trackEnd=Number.MAX_VALUE,h.timeScale=1,h.alpha=1,h.mixTime=0,h.mixDuration=i?this.data.getMix(i.animation,s):0,h.interruptAlpha=1,h.totalAlpha=0,h.mixBlend=2,h}clearNext(t){let s=t.next;for(;s;)this.queue.dispose(s),s=s.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do(!i.mixingTo||i.mixBlend!=3)&&this.computeHold(i),i=i.mixingTo;while(i)}}}computeHold(t){let s=t.mixingTo,r=t.animation.timelines,i=t.animation.timelines.length,h=t.timelineMode;h.length=i;let o=t.timelineHoldMix;o.length=0;let a=this.propertyIDs;if(s&&s.holdPrevious){for(let n=0;n<i;n++)h[n]=a.addAll(r[n].getPropertyIds())?Be:Ct;return}e:for(let n=0;n<i;n++){let l=r[n],c=l.getPropertyIds();if(!a.addAll(c))h[n]=Pe;else if(!s||l instanceof me||l instanceof we||l instanceof Re||!s.animation.hasTimeline(c))h[n]=St;else{for(let d=s.mixingTo;d;d=d.mixingTo)if(!d.animation.hasTimeline(c)){if(t.mixDuration>0){h[n]=ds,o[n]=d;continue e}break}h[n]=Be}}}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 s=this.listeners.indexOf(t);s>=0&&this.listeners.splice(s,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},os=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;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 e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}},hs=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(0),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(1),this.objects.push(e)}end(e){this.objects.push(2),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(3),this.objects.push(e)}complete(e){this.objects.push(4),this.objects.push(e)}event(e,t){this.objects.push(5),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let s=0;s<e.length;s+=2){let r=e[s],i=e[s+1];switch(r){case 0:i.listener&&i.listener.start&&i.listener.start(i);for(let o=0;o<t.length;o++){let a=t[o];a.start&&a.start(i)}break;case 1:i.listener&&i.listener.interrupt&&i.listener.interrupt(i);for(let o=0;o<t.length;o++){let a=t[o];a.interrupt&&a.interrupt(i)}break;case 2:i.listener&&i.listener.end&&i.listener.end(i);for(let o=0;o<t.length;o++){let a=t[o];a.end&&a.end(i)}case 3:i.listener&&i.listener.dispose&&i.listener.dispose(i);for(let o=0;o<t.length;o++){let a=t[o];a.dispose&&a.dispose(i)}this.animState.trackEntryPool.free(i);break;case 4:i.listener&&i.listener.complete&&i.listener.complete(i);for(let o=0;o<t.length;o++){let a=t[o];a.complete&&a.complete(i)}break;case 5:let h=e[s+++2];i.listener&&i.listener.event&&i.listener.event(i,h);for(let o=0;o<t.length;o++){let a=t[o];a.event&&a.event(i,h)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},cs=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(cs||{}),zs=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},Pe=0,St=1,Ct=2,Be=3,ds=4,It=1,fs=2,_s=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,s){let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);this.setMixWith(r,i,s)}setMixWith(e,t,s){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let r=e.name+"."+t.name;this.animationToMixTime[r]=s}getMix(e,t){let s=e.name+"."+t.name,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}},kt=class Rs extends oe{color=new D(1,1,1,1);constructor(t){super(t)}copy(){let t=new Rs(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Tt=class Ps extends oe{endSlot=null;color=new D(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new Ps(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},Yt=class{_image;constructor(e){this._image=e}getImage(){return this._image}},Ve=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(Ve||{}),us=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(us||{}),ms=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},Gs=class extends Yt{setFilters(e,t){}setWraps(e,t){}dispose(){}},Mt=class{pages=new Array;regions=new Array;constructor(e){let t=new $s(e),s=new Array(4),r={};r.size=l=>{l.width=parseInt(s[1]),l.height=parseInt(s[2])},r.format=()=>{},r.filter=l=>{l.minFilter=P.enumValue(Ve,s[1]),l.magFilter=P.enumValue(Ve,s[2])},r.repeat=l=>{s[1].indexOf("x")!=-1&&(l.uWrap=10497),s[1].indexOf("y")!=-1&&(l.vWrap=10497)},r.pma=l=>{l.pma=s[1]=="true"};var i={};i.xy=l=>{l.x=parseInt(s[1]),l.y=parseInt(s[2])},i.size=l=>{l.width=parseInt(s[1]),l.height=parseInt(s[2])},i.bounds=l=>{l.x=parseInt(s[1]),l.y=parseInt(s[2]),l.width=parseInt(s[3]),l.height=parseInt(s[4])},i.offset=l=>{l.offsetX=parseInt(s[1]),l.offsetY=parseInt(s[2])},i.orig=l=>{l.originalWidth=parseInt(s[1]),l.originalHeight=parseInt(s[2])},i.offsets=l=>{l.offsetX=parseInt(s[1]),l.offsetY=parseInt(s[2]),l.originalWidth=parseInt(s[3]),l.originalHeight=parseInt(s[4])},i.rotate=l=>{let c=s[1];c=="true"?l.degrees=90:c!="false"&&(l.degrees=parseInt(c))},i.index=l=>{l.index=parseInt(s[1])};let h=t.readLine();for(;h&&h.trim().length==0;)h=t.readLine();for(;!(!h||h.trim().length==0||t.readEntry(s,h)==0);)h=t.readLine();let o=null,a=null,n=null;for(;h!==null;)if(h.trim().length==0)o=null,h=t.readLine();else if(o){let l=new Xt(o,h);for(;;){let c=t.readEntry(s,h=t.readLine());if(c==0)break;let d=i[s[0]];if(d)d(l);else{a||(a=[]),n||(n=[]),a.push(s[0]);let f=[];for(let m=0;m<c;m++)f.push(parseInt(s[m+1]));n.push(f)}}l.originalWidth==0&&l.originalHeight==0&&(l.originalWidth=l.width,l.originalHeight=l.height),a&&a.length>0&&n&&n.length>0&&(l.names=a,l.values=n,a=null,n=null),l.u=l.x/o.width,l.v=l.y/o.height,l.degrees==90?(l.u2=(l.x+l.height)/o.width,l.v2=(l.y+l.width)/o.height):(l.u2=(l.x+l.width)/o.width,l.v2=(l.y+l.height)/o.height),this.regions.push(l)}else{for(o=new gs(h.trim());t.readEntry(s,h=t.readLine())!=0;){let l=r[s[0]];l&&l(o)}this.pages.push(o)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let s of this.pages)s.setTexture(e.get(t+s.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},$s=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let r=1,i=s+1;;r++){let h=t.indexOf(",",i);if(h==-1)return e[r]=t.substr(i).trim(),r;if(e[r]=t.substr(i,h-i).trim(),i=h+1,r==4)return 4}}},gs=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Xt=class extends ms{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},Ce=class Ht extends oe{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new D(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new D(0,0,0,0);constructor(t,s){super(t),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=P.newFloatArray(t.length));let s=this.uvs,r=this.uvs.length,i=this.region.u,h=this.region.v,o=0,a=0;if(this.region instanceof Xt){let n=this.region,l=n.page,c=l.width,d=l.height;switch(n.degrees){case 90:i-=(n.originalHeight-n.offsetY-n.height)/c,h-=(n.originalWidth-n.offsetX-n.width)/d,o=n.originalHeight/c,a=n.originalWidth/d;for(let f=0;f<r;f+=2)s[f]=i+t[f+1]*o,s[f+1]=h+(1-t[f])*a;return;case 180:i-=(n.originalWidth-n.offsetX-n.width)/c,h-=n.offsetY/d,o=n.originalWidth/c,a=n.originalHeight/d;for(let f=0;f<r;f+=2)s[f]=i+(1-t[f])*o,s[f+1]=h+(1-t[f+1])*a;return;case 270:i-=n.offsetY/c,h-=n.offsetX/d,o=n.originalHeight/c,a=n.originalWidth/d;for(let f=0;f<r;f+=2)s[f]=i+(1-t[f+1])*o,s[f+1]=h+t[f]*a;return}i-=n.offsetX/c,h-=(n.originalHeight-n.offsetY-n.height)/d,o=n.originalWidth/c,a=n.originalHeight/d}else this.region?(o=this.region.u2-i,a=this.region.v2-h):(i=h=0,o=a=1);for(let n=0;n<r;n+=2)s[n]=i+t[n]*o,s[n+1]=h+t[n+1]*a}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,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)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new Ht(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),P.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=this.uvs instanceof Float32Array?P.newFloatArray(this.uvs.length):new Array(this.uvs.length),P.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),P.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),P.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,s,r,i,h,o){this.sequence!=null&&this.sequence.apply(t,this),super.computeWorldVertices(t,s,r,i,h,o)}newLinkedMesh(){let t=new Ht(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.region!=null&&t.updateRegion(),t}},Ie=class Bs extends oe{lengths=[];closed=!1;constantSpeed=!1;color=new D(1,1,1,1);constructor(t){super(t)}copy(){let t=new Bs(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),P.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},xs=class Vs extends oe{x=0;y=0;rotation=0;color=new D(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,s){return s.x=this.x*t.a+this.y*t.b+t.worldX,s.y=this.x*t.c+this.y*t.d+t.worldY,s}computeWorldRotation(t){const s=this.rotation*R.degRad,r=Math.cos(s),i=Math.sin(s),h=r*t.a+i*t.b,o=r*t.c+i*t.d;return R.atan2Deg(o,h)}copy(){let t=new Vs(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},H=class Ls extends Ge{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new D(1,1,1,1);path;region=null;sequence=null;offset=P.newFloatArray(8);uvs=P.newFloatArray(8);tempColor=new D(1,1,1,1);constructor(t,s){super(t),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,s=this.uvs;if(t==null){s[0]=0,s[1]=0,s[2]=0,s[3]=1,s[4]=1,s[5]=1,s[6]=1,s[7]=0;return}let r=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,h=-this.width/2*this.scaleX+this.region.offsetX*r,o=-this.height/2*this.scaleY+this.region.offsetY*i,a=h+this.region.width*r,n=o+this.region.height*i,l=this.rotation*R.degRad,c=Math.cos(l),d=Math.sin(l),f=this.x,m=this.y,u=h*c+f,x=h*d,w=o*c+m,p=o*d,g=a*c+f,b=a*d,y=n*c+m,v=n*d,A=this.offset;A[0]=u-p,A[1]=w+x,A[2]=u-v,A[3]=y+x,A[4]=g-v,A[5]=y+b,A[6]=g-p,A[7]=w+b,t.degrees==90?(s[0]=t.u2,s[1]=t.v2,s[2]=t.u,s[3]=t.v2,s[4]=t.u,s[5]=t.v,s[6]=t.u2,s[7]=t.v):(s[0]=t.u,s[1]=t.v2,s[2]=t.u,s[3]=t.v,s[4]=t.u2,s[5]=t.v,s[6]=t.u2,s[7]=t.v2)}computeWorldVertices(t,s,r,i){this.sequence!=null&&this.sequence.apply(t,this);let h=t.bone,o=this.offset,a=h.worldX,n=h.worldY,l=h.a,c=h.b,d=h.c,f=h.d,m=0,u=0;m=o[0],u=o[1],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n,r+=i,m=o[2],u=o[3],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n,r+=i,m=o[4],u=o[5],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n,r+=i,m=o[6],u=o[7],s[r]=m*l+u*c+a,s[r+1]=m*d+u*f+n}copy(){let t=new Ls(this.name,this.path);return t.region=this.region,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,P.arrayCopy(this.uvs,0,t.uvs,0,8),P.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=this.sequence!=null?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31},Hs=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,s){let r=s.regions;for(let i=0,h=r.length;i<h;i++){let o=s.getPath(t,i),a=this.atlas.findRegion(o);if(a==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+e+")");r[i]=a}}newRegionAttachment(e,t,s,r){let i=new H(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (region attachment: "+t+")");i.region=h}return i}newMeshAttachment(e,t,s,r){let i=new Ce(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+t+")");i.region=h}return i}newBoundingBoxAttachment(e,t){return new kt(t)}newPathAttachment(e,t){return new Ie(t)}newPointAttachment(e,t){return new xs(t)}newClippingAttachment(e,t){return new Tt(t)}},Ft=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=0;skinRequired=!1;color=new D;icon;visible=!1;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}},Le=(e=>(e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection",e))(Le||{}),Et=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=0;sorted=!1;active=!1;constructor(e,t,s){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,r,i,h,o){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=r,this.ascaleY=i,this.ashearX=h,this.ashearY=o;let a=this.parent;if(!a){let f=this.skeleton;const m=f.scaleX,u=f.scaleY,x=(s+h)*R.degRad,w=(s+90+o)*R.degRad;this.a=Math.cos(x)*r*m,this.b=Math.cos(w)*i*m,this.c=Math.sin(x)*r*u,this.d=Math.sin(w)*i*u,this.worldX=e*m+f.x,this.worldY=t*u+f.y;return}let n=a.a,l=a.b,c=a.c,d=a.d;switch(this.worldX=n*e+l*t+a.worldX,this.worldY=c*e+d*t+a.worldY,this.inherit){case 0:{const f=(s+h)*R.degRad,m=(s+90+o)*R.degRad,u=Math.cos(f)*r,x=Math.cos(m)*i,w=Math.sin(f)*r,p=Math.sin(m)*i;this.a=n*u+l*w,this.b=n*x+l*p,this.c=c*u+d*w,this.d=c*x+d*p;return}case 1:{const f=(s+h)*R.degRad,m=(s+90+o)*R.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(m)*i,this.c=Math.sin(f)*r,this.d=Math.sin(m)*i;break}case 2:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;n*=f,c*=m;let u=n*n+c*c,x=0;u>1e-4?(u=Math.abs(n*d*m-l*f*c)/u,l=c*u,d=n*u,x=Math.atan2(c,n)*R.radDeg):(n=0,c=0,x=90-Math.atan2(d,l)*R.radDeg);const w=(s+h-x)*R.degRad,p=(s+o-x+90)*R.degRad,g=Math.cos(w)*r,b=Math.cos(p)*i,y=Math.sin(w)*r,v=Math.sin(p)*i;this.a=n*g-l*y,this.b=n*b-l*v,this.c=c*g+d*y,this.d=c*b+d*v;break}case 3:case 4:{s*=R.degRad;const f=Math.cos(s),m=Math.sin(s);let u=(n*f+l*m)/this.skeleton.scaleX,x=(c*f+d*m)/this.skeleton.scaleY,w=Math.sqrt(u*u+x*x);w>1e-5&&(w=1/w),u*=w,x*=w,w=Math.sqrt(u*u+x*x),this.inherit==3&&n*d-l*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w),s=Math.PI/2+Math.atan2(x,u);const p=Math.cos(s)*w,g=Math.sin(s)*w;h*=R.degRad,o=(90+o)*R.degRad;const b=Math.cos(h)*r,y=Math.cos(o)*i,v=Math.sin(h)*r,A=Math.sin(o)*i;this.a=u*b+p*v,this.b=u*y+p*A,this.c=x*b+g*v,this.d=x*y+g*A;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*R.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)*R.radDeg;return}let t=e.a,s=e.b,r=e.c,i=e.d,h=1/(t*i-s*r),o=i*h,a=s*h,n=r*h,l=t*h,c=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=c*o-d*a,this.ay=d*l-c*n;let f,m,u,x;if(this.inherit==1)f=this.a,m=this.b,u=this.c,x=this.d;else{switch(this.inherit){case 2:{let y=Math.abs(t*i-s*r)/(t*t+r*r);s=-r*this.skeleton.scaleX*y/this.skeleton.scaleY,i=t*this.skeleton.scaleY*y/this.skeleton.scaleX,h=1/(t*i-s*r),o=i*h,a=s*h;break}case 3:case 4:let w=R.cosDeg(this.rotation),p=R.sinDeg(this.rotation);t=(t*w+s*p)/this.skeleton.scaleX,r=(r*w+i*p)/this.skeleton.scaleY;let g=Math.sqrt(t*t+r*r);g>1e-5&&(g=1/g),t*=g,r*=g,g=Math.sqrt(t*t+r*r),this.inherit==3&&h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(g=-g);let b=R.PI/2+Math.atan2(r,t);s=Math.cos(b)*g,i=Math.sin(b)*g,h=1/(t*i-s*r),o=i*h,a=s*h,n=r*h,l=t*h}f=o*this.a-a*this.c,m=o*this.b-a*this.d,u=l*this.c-n*this.a,x=l*this.d-n*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+u*u),this.ascaleX>1e-4){let w=f*x-m*u;this.ascaleY=w/this.ascaleX,this.ashearY=-Math.atan2(f*m+u*x,w)*R.radDeg,this.arotation=Math.atan2(u,f)*R.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,m)*R.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*R.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*R.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,r=e.y-this.worldY;return e.x=s*this.d*t-r*this.b*t,e.y=r*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=R.sinDeg(e),s=R.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*R.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=R.sinDeg(e),s=R.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*R.radDeg}rotateWorld(e){e*=R.degRad;const t=Math.sin(e),s=Math.cos(e),r=this.a,i=this.b;this.a=s*r-t*this.c,this.b=s*i-t*this.d,this.c=t*r+s*this.c,this.d=t*i+s*this.d}},ke=class{constructor(e,t,s){this.name=e,this.order=t,this.skinRequired=s}},bs=class{pathPrefix="";textureLoader;downloader;cache;errors={};toLoad=0;loaded=0;constructor(e,t="",s=new Rt,r=new ws){this.textureLoader=e,this.pathPrefix=t,this.downloader=s,this.cache=r}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,s){this.toLoad--,this.loaded++,this.cache.assets[t]=s,this.cache.assetsRefCount[t]=(this.cache.assetsRefCount[t]||0)+1,e&&e(t,s)}error(e,t,s){this.toLoad--,this.loaded++,this.errors[t]=s,e&&e(t,s)}loadAll(){return new Promise((t,s)=>{let r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):t(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((r,i)=>{this.downloader.downloadBinary(e,h=>{this.success(t,e,h),r(h)},(h,o)=>{const a=`Couldn't load binary ${e}: status ${h}, ${o}`;this.error(s,e,a),i(a)})}))}loadText(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadText(e,r=>{this.success(t,e,r)},(r,i)=>{this.error(s,e,`Couldn't load text ${e}: status ${r}, ${i}`)})}loadJson(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((r,i)=>{this.downloader.downloadJson(e,h=>{this.success(t,e,h),r(h)},(h,o)=>{const a=`Couldn't load JSON ${e}: status ${h}, ${o}`;this.error(s,e,a),i(a)})}))}reuseAssets(e,t=()=>{},s=()=>{}){const r=this.cache.assetsLoaded[e],i=r!==void 0;return i&&(this.cache.assetsLoaded[e]=r.then(h=>(h=h instanceof Image||h instanceof ImageBitmap?this.textureLoader(h):h,this.success(t,e,h),h)).catch(h=>this.error(s,e,h))),i}loadTexture(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((r,i)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(a=>{if(a.ok)return a.blob();const n=`Couldn't load image: ${e}`;this.error(s,e,`Couldn't load image: ${e}`),i(n)}).then(a=>a?createImageBitmap(a,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(a=>{if(a){const n=this.createTexture(e,a);this.success(t,e,n),r(n)}});else{let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{const n=this.createTexture(e,a);this.success(t,e,n),r(n)},a.onerror=()=>{const n=`Couldn't load image: ${e}`;this.error(s,e,n),i(n)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),a.src=e}}))}loadTextureAtlas(e,t=()=>{},s=()=>{},r){let i=e.lastIndexOf("/"),h=i>=0?e.substring(0,i+1):"";e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((o,a)=>{this.downloader.downloadText(e,n=>{try{const l=this.createTextureAtlas(e,n);let c=l.pages.length,d=!1;if(c===0){this.success(t,e,l),o(l);return}for(let f of l.pages)this.loadTexture(r?r[f.name]:h+f.name,(m,u)=>{d||(f.setTexture(u),--c==0&&(this.success(t,e,l),o(l)))},(m,u)=>{if(!d){const x=`Couldn't load texture ${e} page image: ${m}`;this.error(s,e,x),a(x)}d=!0})}catch(l){const c=`Couldn't parse texture atlas ${e}: ${l.message}`;this.error(s,e,c),a(c)}},(n,l)=>{const c=`Couldn't load texture atlas ${e}: status ${n}, ${l}`;this.error(s,e,c),a(c)})}))}loadTextureAtlasButNoTextures(e,t=()=>{},s=()=>{},r){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.cache.assetsLoaded[e]=new Promise((i,h)=>{this.downloader.downloadText(e,o=>{try{const a=this.createTextureAtlas(e,o);this.success(t,e,a),i(a)}catch(a){const n=`Couldn't parse texture atlas ${e}: ${a.message}`;this.error(s,e,n),h(n)}},(o,a)=>{const n=`Couldn't load texture atlas ${e}: status ${o}, ${a}`;this.error(s,e,n),h(n)})}))}async loadBinaryAsync(e){return new Promise((t,s)=>{this.loadBinary(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadJsonAsync(e){return new Promise((t,s)=>{this.loadJson(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAsync(e){return new Promise((t,s)=>{this.loadTexture(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAtlasAsync(e){return new Promise((t,s)=>{this.loadTextureAtlas(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAtlasButNoTexturesAsync(e){return new Promise((t,s)=>{this.loadTextureAtlasButNoTextures(e,(r,i)=>t(i),(r,i)=>s(i))})}setCache(e){this.cache=e}get(e){return this.cache.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.cache.assets[e];if(t)return t;let s=this.errors[e];throw Error("Asset not found: "+e+(s?`
2
2
  `+s:""))}remove(e){e=this.pathPrefix+e;let t=this.cache.assets[e];return t.dispose&&t.dispose(),delete this.cache.assets[e],delete this.cache.assetsRefCount[e],delete this.cache.assetsLoaded[e],t}removeAll(){for(let e in this.cache.assets){let t=this.cache.assets[e];t.dispose&&t.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(e){const t=this.cache.assets[e];if(t instanceof Mt){t.dispose();return}this.disposeAssetInternal(e)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(e){if(this.cache.assetsRefCount[e]>0&&--this.cache.assetsRefCount[e]===0)return this.remove(e)}createTextureAtlas(e,t){const s=new Mt(t);return s.dispose=()=>{if(!(this.cache.assetsRefCount[e]<=0)){this.disposeAssetInternal(e);for(const r of s.pages)r.texture?.dispose()}},s}createTexture(e,t){const s=this.textureLoader(t),r=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(e)&&r()},s}},ws=class qe{assets={};assetsRefCount={};assetsLoaded={};static AVAILABLE_CACHES=new Map;static getCache(t){const s=qe.AVAILABLE_CACHES.get(t);if(s)return s;const r=new qe;return qe.AVAILABLE_CACHES.set(t,r),r}async addAsset(t,s){this.assetsLoaded[t]=Promise.resolve(s),this.assets[t]=await s}},Rt=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),s=t.length,r=new Uint8Array(s),i=0;i<s;i++)r[i]=t.charCodeAt(i);return r}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;const r=this.rawDataUris[e];if(r&&!r.includes(".")){try{this.finish(e,200,this.dataUriToString(r))}catch(o){this.finish(e,400,JSON.stringify(o))}return}let i=new XMLHttpRequest;i.overrideMimeType("text/html"),i.open("GET",r||e,!0);let h=()=>{this.finish(e,i.status,i.responseText)};i.onload=h,i.onerror=h,i.send()}downloadJson(e,t,s){this.downloadText(e,r=>{t(JSON.parse(r))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;const r=this.rawDataUris[e];if(r&&!r.includes(".")){try{this.finish(e,200,this.dataUriToUint8Array(r))}catch(o){this.finish(e,400,JSON.stringify(o))}return}let i=new XMLHttpRequest;i.open("GET",r||e,!0),i.responseType="arraybuffer";let h=()=>{this.finish(e,i.status,i.response)};i.onload=()=>{i.status==200||i.status==0?this.finish(e,200,new Uint8Array(i.response)):h()},i.onerror=h,i.send()}start(e,t,s){let r=this.callbacks[e];try{if(r)return!0;this.callbacks[e]=r=[]}finally{r.push(t,s)}}finish(e,t,s){let r=this.callbacks[e];delete this.callbacks[e];let i=t==200||t==0?[s]:[t,s];for(let h=i.length-1,o=r.length;h<o;h+=2)r[h].apply(null,i)}},Pt=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},Bt=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},ps=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let i=t.findBone(e.bones[r].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[r].name}`);this.bones.push(i)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=s,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}update(e){if(this.mix==0)return;let t=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,s,r,i,h,o){let a=e.parent;if(!a)throw new Error("IK bone must have parent.");let n=a.a,l=a.b,c=a.c,d=a.d,f=-e.ashearX-e.arotation,m=0,u=0;switch(e.inherit){case 1:m=(t-e.worldX)*R.signum(e.skeleton.scaleX),u=(s-e.worldY)*R.signum(e.skeleton.scaleY);break;case 2:let p=Math.abs(n*d-l*c)/Math.max(1e-4,n*n+c*c),g=n/e.skeleton.scaleX,b=c/e.skeleton.scaleY;l=-b*p*e.skeleton.scaleX,d=g*p*e.skeleton.scaleY,f+=Math.atan2(b,g)*R.radDeg;default:let y=t-a.worldX,v=s-a.worldY,A=n*d-l*c;Math.abs(A)<=1e-4?(m=0,u=0):(m=(y*d-v*l)/A-e.ax,u=(v*n-y*c)/A-e.ay)}f+=Math.atan2(u,m)*R.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=e.ascaleX,w=e.ascaleY;if(r||i){switch(e.inherit){case 3:case 4:m=t-e.worldX,u=s-e.worldY}const p=e.data.length*x;if(p>1e-4){const g=m*m+u*u;if(r&&g<p*p||i&&g>p*p){const b=(Math.sqrt(g)/p-1)*o+1;x*=b,h&&(w*=b)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,x,w,e.ashearX,e.ashearY)}apply2(e,t,s,r,i,h,o,a,n){if(e.inherit!=0||t.inherit!=0)return;let l=e.ax,c=e.ay,d=e.ascaleX,f=e.ascaleY,m=d,u=f,x=t.ascaleX,w=0,p=0,g=0;d<0?(d=-d,w=180,g=-1):(w=0,g=1),f<0&&(f=-f,g=-g),x<0?(x=-x,p=180):p=0;let b=t.ax,y=0,v=0,A=0,S=e.a,I=e.b,T=e.c,M=e.d,Y=Math.abs(d-f)<=1e-4;!Y||h?(y=0,v=S*b+e.worldX,A=T*b+e.worldY):(y=t.ay,v=S*b+I*y+e.worldX,A=T*b+M*y+e.worldY);let F=e.parent;if(!F)throw new Error("IK parent must itself have a parent.");S=F.a,I=F.b,T=F.c,M=F.d;let E=S*M-I*T,k=v-F.worldX,X=A-F.worldY;E=Math.abs(E)<=1e-4?0:1/E;let B=(k*M-X*I)*E-l,N=(X*S-k*T)*E-c,L=Math.sqrt(B*B+N*N),O=t.data.length*x,$,z;if(L<1e-4){this.apply1(e,s,r,!1,h,!1,n),t.updateWorldTransformWith(b,y,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}k=s-F.worldX,X=r-F.worldY;let j=(k*M-X*I)*E-l,V=(X*S-k*T)*E-c,W=j*j+V*V;if(a!=0){a*=d*(x+1)*.5;let K=Math.sqrt(W),Q=K-L-O*d+a;if(Q>0){let Z=Math.min(1,Q/(a*2))-1;Z=(Q-a*(1-Z*Z))/K,j-=Z*j,V-=Z*V,W=j*j+V*V}}e:if(Y){O*=d;let K=(W-L*L-O*O)/(2*L*O);K<-1?(K=-1,z=Math.PI*i):K>1?(K=1,z=0,h&&(S=(Math.sqrt(W)/(L+O)-1)*n+1,m*=S,o&&(u*=S))):z=Math.acos(K)*i,S=L+O*K,I=O*Math.sin(z),$=Math.atan2(V*S-j*I,j*S+V*I)}else{S=d*O,I=f*O;let K=S*S,Q=I*I,Z=Math.atan2(V,j);T=Q*L*L+K*W-K*Q;let re=-2*Q*L,xe=Q-K;if(M=re*re-4*xe*T,M>=0){let be=Math.sqrt(M);re<0&&(be=-be),be=-(re+be)*.5;let ve=be/xe,es=T/be,Me=Math.abs(ve)<Math.abs(es)?ve:es;if(ve=W-Me*Me,ve>=0){X=Math.sqrt(ve)*i,$=Z-Math.atan2(X,Me),z=Math.atan2(X/f,(Me-L)/d);break e}}let ye=R.PI,Te=L-S,Ue=Te*Te,Kt=0,Qt=0,Ye=L+S,ze=Ye*Ye,Zt=0;T=-S*L/(K-Q),T>=-1&&T<=1&&(T=Math.acos(T),k=S*Math.cos(T)+L,X=I*Math.sin(T),M=k*k+X*X,M<Ue&&(ye=T,Ue=M,Te=k,Kt=X),M>ze&&(Qt=T,ze=M,Ye=k,Zt=X)),W<=(Ue+ze)*.5?($=Z-Math.atan2(Kt*i,Te),z=ye*i):($=Z-Math.atan2(Zt*i,Ye),z=Qt*i)}let G=Math.atan2(y,b)*g,te=e.arotation;$=($-G)*R.radDeg+w-te,$>180?$-=360:$<-180&&($+=360),e.updateWorldTransformWith(l,c,te+$*n,m,u,0,0),te=t.arotation,z=((z+G)*R.radDeg-t.ashearX)*g+p-te,z>180?z-=360:z<-180&&(z+=360),t.updateWorldTransformWith(b,y,te+z*n,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Vt=class extends ke{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(e){super(e,0,!1)}},Lt=class extends ke{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=0;spacingMode=1;rotateMode=1;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(e){super(e,0,!1)}},Nt=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(Nt||{}),Ot=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(Ot||{}),Dt=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(Dt||{}),ys=class ue{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(t,s){if(!t)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,h=t.bones.length;i<h;i++){let o=s.findBone(t.bones[i].name);if(!o)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(o)}let r=s.findSlot(t.target.name);if(!r)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=r,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let s=this.target.getAttachment();if(!(s instanceof Ie))return;let r=this.mixRotate,i=this.mixX,h=this.mixY;if(r==0&&i==0&&h==0)return;let o=this.data,a=o.rotateMode==0,n=o.rotateMode==2,l=this.bones,c=l.length,d=a?c:c+1,f=P.setArraySize(this.spaces,d),m=n?this.lengths=P.setArraySize(this.lengths,c):[],u=this.spacing;switch(o.spacingMode){case 2:if(n)for(let A=0,S=d-1;A<S;A++){let I=l[A],T=I.data.length,M=T*I.a,Y=T*I.c;m[A]=Math.sqrt(M*M+Y*Y)}P.arrayFill(f,1,d,u);break;case 3:let y=0;for(let A=0,S=d-1;A<S;){let I=l[A],T=I.data.length;if(T<ue.epsilon)n&&(m[A]=0),f[++A]=u;else{let M=T*I.a,Y=T*I.c,F=Math.sqrt(M*M+Y*Y);n&&(m[A]=F),f[++A]=F,y+=F}}if(y>0){y=d/y*u;for(let A=1;A<d;A++)f[A]*=y}break;default:let v=o.spacingMode==0;for(let A=0,S=d-1;A<S;){let I=l[A],T=I.data.length;if(T<ue.epsilon)n&&(m[A]=0),f[++A]=u;else{let M=T*I.a,Y=T*I.c,F=Math.sqrt(M*M+Y*Y);n&&(m[A]=F),f[++A]=(v?T+u:u)*F/T}}}let x=this.computeWorldPositions(s,d,a),w=x[0],p=x[1],g=o.offsetRotation,b=!1;if(g==0)b=o.rotateMode==1;else{b=!1;let y=this.target.bone;g*=y.a*y.d-y.b*y.c>0?R.degRad:-R.degRad}for(let y=0,v=3;y<c;y++,v+=3){let A=l[y];A.worldX+=(w-A.worldX)*i,A.worldY+=(p-A.worldY)*h;let S=x[v],I=x[v+1],T=S-w,M=I-p;if(n){let Y=m[y];if(Y!=0){let F=(Math.sqrt(T*T+M*M)/Y-1)*r+1;A.a*=F,A.c*=F}}if(w=S,p=I,r>0){let Y=A.a,F=A.b,E=A.c,k=A.d,X=0,B=0,N=0;if(a?X=x[v-1]:f[y+1]==0?X=x[v+2]:X=Math.atan2(M,T),X-=Math.atan2(E,Y),b){B=Math.cos(X),N=Math.sin(X);let L=A.data.length;w+=(L*(B*Y-N*E)-T)*r,p+=(L*(N*Y+B*E)-M)*r}else X+=g;X>R.PI?X-=R.PI2:X<-R.PI&&(X+=R.PI2),X*=r,B=Math.cos(X),N=Math.sin(X),A.a=B*Y-N*E,A.b=B*F-N*k,A.c=N*Y+B*E,A.d=N*F+B*k}A.updateAppliedTransform()}}computeWorldPositions(t,s,r){let i=this.target,h=this.position,o=this.spaces,a=P.setArraySize(this.positions,s*3+2),n=this.world,l=t.closed,c=t.worldVerticesLength,d=c/6,f=ue.NONE;if(!t.constantSpeed){let L=t.lengths;d-=l?1:2;let O=L[d];this.data.positionMode==1&&(h*=O);let $;switch(this.data.spacingMode){case 2:$=O;break;case 3:$=O/s;break;default:$=1}n=P.setArraySize(this.world,8);for(let z=0,j=0,V=0;z<s;z++,j+=3){let W=o[z]*$;h+=W;let G=h;if(l)G%=O,G<0&&(G+=O),V=0;else if(G<0){f!=ue.BEFORE&&(f=ue.BEFORE,t.computeWorldVertices(i,2,4,n,0,2)),this.addBeforePosition(G,n,0,a,j);continue}else if(G>O){f!=ue.AFTER&&(f=ue.AFTER,t.computeWorldVertices(i,c-6,4,n,0,2)),this.addAfterPosition(G-O,n,0,a,j);continue}for(;;V++){let te=L[V];if(!(G>te)){if(V==0)G/=te;else{let K=L[V-1];G=(G-K)/(te-K)}break}}V!=f&&(f=V,l&&V==d?(t.computeWorldVertices(i,c-4,4,n,0,2),t.computeWorldVertices(i,0,4,n,4,2)):t.computeWorldVertices(i,V*6+2,8,n,0,2)),this.addCurvePosition(G,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],a,j,r||z>0&&W==0)}return a}l?(c+=2,n=P.setArraySize(this.world,c),t.computeWorldVertices(i,2,c-4,n,0,2),t.computeWorldVertices(i,0,2,n,c-4,2),n[c-2]=n[0],n[c-1]=n[1]):(d--,c-=4,n=P.setArraySize(this.world,c),t.computeWorldVertices(i,2,c,n,0,2));let m=P.setArraySize(this.curves,d),u=0,x=n[0],w=n[1],p=0,g=0,b=0,y=0,v=0,A=0,S=0,I=0,T=0,M=0,Y=0,F=0,E=0,k=0;for(let L=0,O=2;L<d;L++,O+=6)p=n[O],g=n[O+1],b=n[O+2],y=n[O+3],v=n[O+4],A=n[O+5],S=(x-p*2+b)*.1875,I=(w-g*2+y)*.1875,T=((p-b)*3-x+v)*.09375,M=((g-y)*3-w+A)*.09375,Y=S*2+T,F=I*2+M,E=(p-x)*.75+S+T*.16666667,k=(g-w)*.75+I+M*.16666667,u+=Math.sqrt(E*E+k*k),E+=Y,k+=F,Y+=T,F+=M,u+=Math.sqrt(E*E+k*k),E+=Y,k+=F,u+=Math.sqrt(E*E+k*k),E+=Y+T,k+=F+M,u+=Math.sqrt(E*E+k*k),m[L]=u,x=v,w=A;this.data.positionMode==1&&(h*=u);let X;switch(this.data.spacingMode){case 2:X=u;break;case 3:X=u/s;break;default:X=1}let B=this.segments,N=0;for(let L=0,O=0,$=0,z=0;L<s;L++,O+=3){let j=o[L]*X;h+=j;let V=h;if(l)V%=u,V<0&&(V+=u),$=0;else if(V<0){this.addBeforePosition(V,n,0,a,O);continue}else if(V>u){this.addAfterPosition(V-u,n,c-4,a,O);continue}for(;;$++){let W=m[$];if(!(V>W)){if($==0)V/=W;else{let G=m[$-1];V=(V-G)/(W-G)}break}}if($!=f){f=$;let W=$*6;for(x=n[W],w=n[W+1],p=n[W+2],g=n[W+3],b=n[W+4],y=n[W+5],v=n[W+6],A=n[W+7],S=(x-p*2+b)*.03,I=(w-g*2+y)*.03,T=((p-b)*3-x+v)*.006,M=((g-y)*3-w+A)*.006,Y=S*2+T,F=I*2+M,E=(p-x)*.3+S+T*.16666667,k=(g-w)*.3+I+M*.16666667,N=Math.sqrt(E*E+k*k),B[0]=N,W=1;W<8;W++)E+=Y,k+=F,Y+=T,F+=M,N+=Math.sqrt(E*E+k*k),B[W]=N;E+=Y,k+=F,N+=Math.sqrt(E*E+k*k),B[8]=N,E+=Y+T,k+=F+M,N+=Math.sqrt(E*E+k*k),B[9]=N,z=0}for(V*=N;;z++){let W=B[z];if(!(V>W)){if(z==0)V/=W;else{let G=B[z-1];V=z+(V-G)/(W-G)}break}}this.addCurvePosition(V*.1,x,w,p,g,b,y,v,A,a,O,r||L>0&&j==0)}return a}addBeforePosition(t,s,r,i,h){let o=s[r],a=s[r+1],n=s[r+2]-o,l=s[r+3]-a,c=Math.atan2(l,n);i[h]=o+t*Math.cos(c),i[h+1]=a+t*Math.sin(c),i[h+2]=c}addAfterPosition(t,s,r,i,h){let o=s[r+2],a=s[r+3],n=o-s[r],l=a-s[r+1],c=Math.atan2(l,n);i[h]=o+t*Math.cos(c),i[h+1]=a+t*Math.sin(c),i[h+2]=c}addCurvePosition(t,s,r,i,h,o,a,n,l,c,d,f){if(t==0||isNaN(t)){c[d]=s,c[d+1]=r,c[d+2]=Math.atan2(h-r,i-s);return}let m=t*t,u=m*t,x=1-t,w=x*x,p=w*x,g=x*t,b=g*3,y=x*b,v=b*t,A=s*p+i*y+o*v+n*u,S=r*p+h*y+a*v+l*u;c[d]=A,c[d+1]=S,f&&(t<.001?c[d+2]=Math.atan2(h-r,i-s):c[d+2]=Math.atan2(S-(r*w+h*g*2+a*m),A-(s*w+i*g*2+o*m)))}},Js=class{data;_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(e,t){this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,r=this.data.y>0,i=this.data.rotate>0||this.data.shearX>0,h=this.data.scaleX>0,o=this.bone,a=o.data.length;switch(e){case 0:return;case 1:this.reset();case 2:const n=this.skeleton,l=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=l,this.lastTime=n.time;const c=o.worldX,d=o.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=d;else{let f=this.remaining,m=this.inertia,u=this.data.step,x=this.skeleton.data.referenceScale,w=-1,p=this.data.limit*l,g=p*Math.abs(n.scaleY);if(p*=Math.abs(n.scaleX),s||r){if(s){const b=(this.ux-c)*m;this.xOffset+=b>p?p:b<-p?-p:b,this.ux=c}if(r){const b=(this.uy-d)*m;this.yOffset+=b>g?g:b<-g?-g:b,this.uy=d}if(f>=u){w=Math.pow(this.damping,60*u);const b=this.massInverse*u,y=this.strength,v=this.wind*x*n.scaleX,A=this.gravity*x*n.scaleY;do s&&(this.xVelocity+=(v-this.xOffset*y)*b,this.xOffset+=this.xVelocity*u,this.xVelocity*=w),r&&(this.yVelocity-=(A+this.yOffset*y)*b,this.yOffset+=this.yVelocity*u,this.yVelocity*=w),f-=u;while(f>=u)}s&&(o.worldX+=this.xOffset*t*this.data.x),r&&(o.worldY+=this.yOffset*t*this.data.y)}if(i||h){let b=Math.atan2(o.c,o.a),y=0,v=0,A=0,S=this.cx-o.worldX,I=this.cy-o.worldY;if(S>p?S=p:S<-p&&(S=-p),I>g?I=g:I<-g&&(I=-g),i){A=(this.data.rotate+this.data.shearX)*t;let T=Math.atan2(I+this.ty,S+this.tx)-b-this.rotateOffset*A;this.rotateOffset+=(T-Math.ceil(T*R.invPI2-.5)*R.PI2)*m,T=this.rotateOffset*A+b,y=Math.cos(T),v=Math.sin(T),h&&(T=a*o.getWorldScaleX(),T>0&&(this.scaleOffset+=(S*y+I*v)*m/T))}else{y=Math.cos(b),v=Math.sin(b);const T=a*o.getWorldScaleX();T>0&&(this.scaleOffset+=(S*y+I*v)*m/T)}if(f=this.remaining,f>=u){w==-1&&(w=Math.pow(this.damping,60*u));const T=this.massInverse*u,M=this.strength,Y=this.wind,F=Ss.yDown?-this.gravity:this.gravity,E=a/x;for(;;)if(f-=u,h&&(this.scaleVelocity+=(Y*y-F*v-this.scaleOffset*M)*T,this.scaleOffset+=this.scaleVelocity*u,this.scaleVelocity*=w),i){if(this.rotateVelocity-=((Y*v+F*y)*E+this.rotateOffset*M)*T,this.rotateOffset+=this.rotateVelocity*u,this.rotateVelocity*=w,f<u)break;const k=this.rotateOffset*A+b;y=Math.cos(k),v=Math.sin(k)}else if(f<u)break}}this.remaining=f}this.cx=o.worldX,this.cy=o.worldY;break;case 3:s&&(o.worldX+=this.xOffset*t*this.data.x),r&&(o.worldY+=this.yOffset*t*this.data.y)}if(i){let n=this.rotateOffset*t,l=0,c=0,d=0;if(this.data.shearX>0){let f=0;this.data.rotate>0&&(f=n*this.data.rotate,l=Math.sin(f),c=Math.cos(f),d=o.b,o.b=c*d-l*o.d,o.d=l*d+c*o.d),f+=n*this.data.shearX,l=Math.sin(f),c=Math.cos(f),d=o.a,o.a=c*d-l*o.c,o.c=l*d+c*o.c}else n*=this.data.rotate,l=Math.sin(n),c=Math.cos(n),d=o.a,o.a=c*d-l*o.c,o.c=l*d+c*o.c,d=o.b,o.b=c*d-l*o.d,o.d=l*d+c*o.d}if(h){const n=1+this.scaleOffset*t*this.data.scaleX;o.a*=n,o.c*=n}e!=3&&(this.tx=a*o.a,this.ty=a*o.c),o.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const r=s*R.degRad,i=Math.cos(r),h=Math.sin(r),o=this.cx-e,a=this.cy-t;this.translate(o*i-a*h-o,o*h+a*i-a)}},vs=class{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new D,this.darkColor=e.darkColor?new D:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof oe)||!(this.attachment instanceof oe)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},As=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new Xe;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let i=t.findBone(e.bones[r].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[r].name}.`);this.bones.push(i)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=s,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}update(e){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,h=this.mixShearY,o=t!=0||s!=0,a=this.target,n=a.a,l=a.b,c=a.c,d=a.d,f=n*d-l*c>0?R.degRad:-R.degRad,m=this.data.offsetRotation*f,u=this.data.offsetShearY*f,x=this.bones;for(let w=0,p=x.length;w<p;w++){let g=x[w];if(e!=0){let b=g.a,y=g.b,v=g.c,A=g.d,S=Math.atan2(c,n)-Math.atan2(v,b)+m;S>R.PI?S-=R.PI2:S<-R.PI&&(S+=R.PI2),S*=e;let I=Math.cos(S),T=Math.sin(S);g.a=I*b-T*v,g.b=I*y-T*A,g.c=T*b+I*v,g.d=T*y+I*A}if(o){let b=this.temp;a.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(b.x-g.worldX)*t,g.worldY+=(b.y-g.worldY)*s}if(r!=0){let b=Math.sqrt(g.a*g.a+g.c*g.c);b!=0&&(b=(b+(Math.sqrt(n*n+c*c)-b+this.data.offsetScaleX)*r)/b),g.a*=b,g.c*=b}if(i!=0){let b=Math.sqrt(g.b*g.b+g.d*g.d);b!=0&&(b=(b+(Math.sqrt(l*l+d*d)-b+this.data.offsetScaleY)*i)/b),g.b*=b,g.d*=b}if(h>0){let b=g.b,y=g.d,v=Math.atan2(y,b),A=Math.atan2(d,l)-Math.atan2(c,n)-(v-Math.atan2(g.c,g.a));A>R.PI?A-=R.PI2:A<-R.PI&&(A+=R.PI2),A=v+(A+u)*h;let S=Math.sqrt(b*b+y*y);g.b=Math.cos(A)*S,g.d=Math.sin(A)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,h=this.mixShearY,o=t!=0||s!=0,a=this.target,n=a.a,l=a.b,c=a.c,d=a.d,f=n*d-l*c>0?R.degRad:-R.degRad,m=this.data.offsetRotation*f,u=this.data.offsetShearY*f,x=this.bones;for(let w=0,p=x.length;w<p;w++){let g=x[w];if(e!=0){let b=g.a,y=g.b,v=g.c,A=g.d,S=Math.atan2(c,n)+m;S>R.PI?S-=R.PI2:S<-R.PI&&(S+=R.PI2),S*=e;let I=Math.cos(S),T=Math.sin(S);g.a=I*b-T*v,g.b=I*y-T*A,g.c=T*b+I*v,g.d=T*y+I*A}if(o){let b=this.temp;a.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),g.worldX+=b.x*t,g.worldY+=b.y*s}if(r!=0){let b=(Math.sqrt(n*n+c*c)-1+this.data.offsetScaleX)*r+1;g.a*=b,g.c*=b}if(i!=0){let b=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*i+1;g.b*=b,g.d*=b}if(h>0){let b=Math.atan2(d,l)-Math.atan2(c,n);b>R.PI?b-=R.PI2:b<-R.PI&&(b+=R.PI2);let y=g.b,v=g.d;b=Math.atan2(v,y)+(b-R.PI/2+u)*h;let A=Math.sqrt(y*y+v*v);g.b=Math.cos(b)*A,g.d=Math.sin(b)*A}g.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,h=this.mixShearY,o=this.target,a=this.bones;for(let n=0,l=a.length;n<l;n++){let c=a[n],d=c.arotation;e!=0&&(d+=(o.arotation-d+this.data.offsetRotation)*e);let f=c.ax,m=c.ay;f+=(o.ax-f+this.data.offsetX)*t,m+=(o.ay-m+this.data.offsetY)*s;let u=c.ascaleX,x=c.ascaleY;r!=0&&u!=0&&(u=(u+(o.ascaleX-u+this.data.offsetScaleX)*r)/u),i!=0&&x!=0&&(x=(x+(o.ascaleY-x+this.data.offsetScaleY)*i)/x);let w=c.ashearY;h!=0&&(w+=(o.ashearY-w+this.data.offsetShearY)*h),c.updateWorldTransformWith(f,m,d,u,x,c.ashearX,w)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,h=this.mixShearY,o=this.target,a=this.bones;for(let n=0,l=a.length;n<l;n++){let c=a[n],d=c.arotation+(o.arotation+this.data.offsetRotation)*e,f=c.ax+(o.ax+this.data.offsetX)*t,m=c.ay+(o.ay+this.data.offsetY)*s,u=c.ascaleX*((o.ascaleX-1+this.data.offsetScaleX)*r+1),x=c.ascaleY*((o.ascaleY-1+this.data.offsetScaleY)*i+1),w=c.ashearY+(o.ashearY+this.data.offsetShearY)*h;c.updateWorldTransformWith(f,m,d,u,x,c.ashearX,w)}}},Ss=class Jt{static quadTriangles=[0,1,2,2,3,0];static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return Jt.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;time=0;constructor(t){if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let s=0;s<t.bones.length;s++){let r=t.bones[s],i;if(!r.parent)i=new Et(r,this,null);else{let h=this.bones[r.parent.index];i=new Et(r,this,h),h.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<t.slots.length;s++){let r=t.slots[s],i=this.bones[r.boneData.index],h=new vs(r,i);this.slots.push(h),this.drawOrder.push(h)}this.ikConstraints=new Array;for(let s=0;s<t.ikConstraints.length;s++){let r=t.ikConstraints[s];this.ikConstraints.push(new ps(r,this))}this.transformConstraints=new Array;for(let s=0;s<t.transformConstraints.length;s++){let r=t.transformConstraints[s];this.transformConstraints.push(new As(r,this))}this.pathConstraints=new Array;for(let s=0;s<t.pathConstraints.length;s++){let r=t.pathConstraints[s];this.pathConstraints.push(new ys(r,this))}this.physicsConstraints=new Array;for(let s=0;s<t.physicsConstraints.length;s++){let r=t.physicsConstraints[s];this.physicsConstraints.push(new Js(r,this))}this.color=new D(1,1,1,1),this.updateCache()}updateCache(){let t=this._updateCache;t.length=0;let s=this.bones;for(let f=0,m=s.length;f<m;f++){let u=s[f];u.sorted=u.data.skinRequired,u.active=!u.sorted}if(this.skin){let f=this.skin.bones;for(let m=0,u=this.skin.bones.length;m<u;m++){let x=this.bones[f[m].index];do x.sorted=!1,x.active=!0,x=x.parent;while(x)}}let r=this.ikConstraints,i=this.transformConstraints,h=this.pathConstraints,o=this.physicsConstraints,a=r.length,n=i.length,l=h.length,c=this.physicsConstraints.length,d=a+n+l+c;e:for(let f=0;f<d;f++){for(let m=0;m<a;m++){let u=r[m];if(u.data.order==f){this.sortIkConstraint(u);continue e}}for(let m=0;m<n;m++){let u=i[m];if(u.data.order==f){this.sortTransformConstraint(u);continue e}}for(let m=0;m<l;m++){let u=h[m];if(u.data.order==f){this.sortPathConstraint(u);continue e}}for(let m=0;m<c;m++){const u=o[m];if(u.data.order==f){this.sortPhysicsConstraint(u);continue e}}}for(let f=0,m=s.length;f<m;f++)this.sortBone(s[f])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&P.contains(this.skin.constraints,t.data,!0)),!t.active)return;let s=t.target;this.sortBone(s);let r=t.bones,i=r[0];if(this.sortBone(i),r.length==1)this._updateCache.push(t),this.sortReset(i.children);else{let h=r[r.length-1];this.sortBone(h),this._updateCache.push(t),this.sortReset(i.children),h.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&P.contains(this.skin.constraints,t.data,!0)),!t.active)return;let s=t.target,r=s.data.index,i=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,r,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(let n=0,l=this.data.skins.length;n<l;n++)this.sortPathConstraintAttachment(this.data.skins[n],r,i);let h=s.getAttachment();h instanceof Ie&&this.sortPathConstraintAttachmentWith(h,i);let o=t.bones,a=o.length;for(let n=0;n<a;n++)this.sortBone(o[n]);this._updateCache.push(t);for(let n=0;n<a;n++)this.sortReset(o[n].children);for(let n=0;n<a;n++)o[n].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&P.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let s=t.bones,r=s.length;if(t.data.local)for(let i=0;i<r;i++){let h=s[i];this.sortBone(h.parent),this.sortBone(h)}else for(let i=0;i<r;i++)this.sortBone(s[i]);this._updateCache.push(t);for(let i=0;i<r;i++)this.sortReset(s[i].children);for(let i=0;i<r;i++)s[i].sorted=!0}sortPathConstraintAttachment(t,s,r){let i=t.attachments[s];if(i)for(let h in i)this.sortPathConstraintAttachmentWith(i[h],r)}sortPathConstraintAttachmentWith(t,s){if(!(t instanceof Ie))return;let r=t.bones;if(!r)this.sortBone(s);else{let i=this.bones;for(let h=0,o=r.length;h<o;){let a=r[h++];for(a+=h;h<a;)this.sortBone(i[r[h++]])}}}sortPhysicsConstraint(t){const s=t.bone;t.active=s.active&&(!t.data.skinRequired||this.skin!=null&&P.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(s),this._updateCache.push(t),this.sortReset(s.children),s.sorted=!0)}sortBone(t){if(!t||t.sorted)return;let s=t.parent;s&&this.sortBone(s),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let s=0,r=t.length;s<r;s++){let i=t[s];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(t){if(t==null)throw new Error("physics is undefined");let s=this.bones;for(let i=0,h=s.length;i<h;i++){let o=s[i];o.ax=o.x,o.ay=o.y,o.arotation=o.rotation,o.ascaleX=o.scaleX,o.ascaleY=o.scaleY,o.ashearX=o.shearX,o.ashearY=o.shearY}let r=this._updateCache;for(let i=0,h=r.length;i<h;i++)r[i].update(t)}updateWorldTransformWith(t,s){if(!s)throw new Error("parent cannot be null.");let r=this.bones;for(let w=1,p=r.length;w<p;w++){let g=r[w];g.ax=g.x,g.ay=g.y,g.arotation=g.rotation,g.ascaleX=g.scaleX,g.ascaleY=g.scaleY,g.ashearX=g.shearX,g.ashearY=g.shearY}let i=this.getRootBone();if(!i)throw new Error("Root bone must not be null.");let h=s.a,o=s.b,a=s.c,n=s.d;i.worldX=h*this.x+o*this.y+s.worldX,i.worldY=a*this.x+n*this.y+s.worldY;const l=(i.rotation+i.shearX)*R.degRad,c=(i.rotation+90+i.shearY)*R.degRad,d=Math.cos(l)*i.scaleX,f=Math.cos(c)*i.scaleY,m=Math.sin(l)*i.scaleX,u=Math.sin(c)*i.scaleY;i.a=(h*d+o*m)*this.scaleX,i.b=(h*f+o*u)*this.scaleX,i.c=(a*d+n*m)*this.scaleY,i.d=(a*f+n*u)*this.scaleY;let x=this._updateCache;for(let w=0,p=x.length;w<p;w++){let g=x[w];g!=i&&g.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;P.arrayCopy(t,0,this.drawOrder,0,t.length);for(let s=0,r=t.length;s<r;s++)t[s].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let s=this.bones;for(let r=0,i=s.length;r<i;r++){let h=s[r];if(h.data.name==t)return h}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let r=0,i=s.length;r<i;r++){let h=s[r];if(h.data.name==t)return h}return null}setSkinByName(t){let s=this.data.findSkin(t);if(!s)throw new Error("Skin not found: "+t);this.setSkin(s)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let s=this.slots;for(let r=0,i=s.length;r<i;r++){let h=s[r],o=h.data.attachmentName;if(o){let a=t.getAttachment(r,o);a&&h.setAttachment(a)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,s){let r=this.data.findSlot(t);if(!r)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(r.index,s)}getAttachment(t,s){if(!s)throw new Error("attachmentName cannot be null.");if(this.skin){let r=this.skin.getAttachment(t,s);if(r)return r}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,s):null}setAttachment(t,s){if(!t)throw new Error("slotName cannot be null.");let r=this.slots;for(let i=0,h=r.length;i<h;i++){let o=r[i];if(o.data.name==t){let a=null;if(s&&(a=this.getAttachment(i,s),!a))throw new Error("Attachment not found: "+s+", for slot: "+t);o.setAttachment(a);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(s=>s.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(s=>s.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(s=>s.data.name==t)??null}findPhysicsConstraint(t){if(t==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(s=>s.data.name==t)??null}getBoundsRect(t){let s=new Xe,r=new Xe;return this.getBounds(s,r,void 0,t),{x:s.x,y:s.y,width:r.x,height:r.y}}getBounds(t,s,r=new Array(2),i=null){if(!t)throw new Error("offset cannot be null.");if(!s)throw new Error("size cannot be null.");let h=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,d=h.length;c<d;c++){let f=h[c];if(!f.bone.active)continue;let m=0,u=null,x=null,w=f.getAttachment();if(w instanceof H)m=8,u=P.setArraySize(r,m,0),w.computeWorldVertices(f,u,0,2),x=Jt.quadTriangles;else if(w instanceof Ce){let p=w;m=p.worldVerticesLength,u=P.setArraySize(r,m,0),p.computeWorldVertices(f,0,m,u,0,2),x=p.triangles}else if(w instanceof Tt&&i!=null){i.clipStart(f,w);continue}if(u&&x){i!=null&&i.isClipping()&&(i.clipTriangles(u,x,x.length),u=i.clippedVertices,m=i.clippedVertices.length);for(let p=0,g=u.length;p<g;p+=2){let b=u[p],y=u[p+1];o=Math.min(o,b),a=Math.min(a,y),n=Math.max(n,b),l=Math.max(l,y)}}i?.clipEndWithSlot(f)}i?.clipEnd(),t.set(o,a),s.set(n-o,l-a)}update(t){this.time+=t}physicsTranslate(t,s){const r=this.physicsConstraints;for(let i=0,h=r.length;i<h;i++)r[i].translate(t,s)}physicsRotate(t,s,r){const i=this.physicsConstraints;for(let h=0,o=i.length;h<o;h++)i[h].rotate(t,s,r)}},Cs=(e=>(e[e.none=0]="none",e[e.reset=1]="reset",e[e.update=2]="update",e[e.pose=3]="pose",e))(Cs||{}),Is=class extends ke{_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(e){super(e,0,!1)}},qt=class{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}findPhysicsConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.physicsConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}},Wt=class{constructor(e=0,t,s){this.slotIndex=e,this.name=t,this.attachment=s}},Ne=class{name;attachments=new Array;bones=Array();constraints=new Array;color=new D(.99607843,.61960787,.30980393,1);constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,s){if(!s)throw new Error("attachment cannot be null.");let r=this.attachments;e>=r.length&&(r.length=e+1),r[e]||(r[e]={}),r[e][t]=s}addSkin(e){for(let r=0;r<e.bones.length;r++){let i=e.bones[r],h=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==i){h=!0;break}h||this.bones.push(i)}for(let r=0;r<e.constraints.length;r++){let i=e.constraints[r],h=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==i){h=!0;break}h||this.constraints.push(i)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let r=0;r<e.bones.length;r++){let i=e.bones[r],h=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==i){h=!0;break}h||this.bones.push(i)}for(let r=0;r<e.constraints.length;r++){let i=e.constraints[r],h=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==i){h=!0;break}h||this.constraints.push(i)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];s.attachment&&(s.attachment instanceof Ce?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(e,t){let s=this.attachments[e];return s?s[t]:null}removeAttachment(e,t){let s=this.attachments[e];s&&delete s[t]}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let s=this.attachments[t];if(s)for(let r in s){let i=s[r];i&&e.push(new Wt(t,r,i))}}return e}getAttachmentsForSlot(e,t){let s=this.attachments[e];if(s)for(let r in s){let i=s[r];i&&t.push(new Wt(e,r,i))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let s=0;for(let r=0;r<e.slots.length;r++){let i=e.slots[r],h=i.getAttachment();if(h&&s<t.attachments.length){let o=t.attachments[s];for(let a in o){let n=o[a];if(h==n){let l=this.getAttachment(s,a);l&&i.setAttachment(l);break}}}s++}}},Ut=class{index=0;name;boneData;color=new D(1,1,1,1);darkColor=null;attachmentName=null;blendMode=0;visible=!0;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}},zt=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(zt||{}),_t=class extends ke{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(e){super(e,0,!1)}},js=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new qt;s.name="";let r=new ks(e),i=r.readInt32(),h=r.readInt32();s.hash=h==0&&i==0?null:h.toString(16)+i.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*t;let o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let a=0;a=r.readInt(!0);for(let l=0;l<a;l++){let c=r.readString();if(!c)throw new Error("String in string table must not be null.");r.strings.push(c)}a=r.readInt(!0);for(let l=0;l<a;l++){let c=r.readString();if(!c)throw new Error("Bone name must not be null.");let d=l==0?null:s.bones[r.readInt(!0)],f=new Ft(l,c,d);f.rotation=r.readFloat(),f.x=r.readFloat()*t,f.y=r.readFloat()*t,f.scaleX=r.readFloat(),f.scaleY=r.readFloat(),f.shearX=r.readFloat(),f.shearY=r.readFloat(),f.length=r.readFloat()*t,f.inherit=r.readByte(),f.skinRequired=r.readBoolean(),o&&(D.rgba8888ToColor(f.color,r.readInt32()),f.icon=r.readString()??void 0,f.visible=r.readBoolean()),s.bones.push(f)}a=r.readInt(!0);for(let l=0;l<a;l++){let c=r.readString();if(!c)throw new Error("Slot name must not be null.");let d=s.bones[r.readInt(!0)],f=new Ut(l,c,d);D.rgba8888ToColor(f.color,r.readInt32());let m=r.readInt32();m!=-1&&D.rgb888ToColor(f.darkColor=new D,m),f.attachmentName=r.readStringRef(),f.blendMode=r.readInt(!0),o&&(f.visible=r.readBoolean()),s.slots.push(f)}a=r.readInt(!0);for(let l=0,c;l<a;l++){let d=r.readString();if(!d)throw new Error("IK constraint data name must not be null.");let f=new Vt(d);f.order=r.readInt(!0),c=r.readInt(!0);for(let u=0;u<c;u++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let m=r.readByte();f.skinRequired=(m&1)!=0,f.bendDirection=(m&2)!=0?1:-1,f.compress=(m&4)!=0,f.stretch=(m&8)!=0,f.uniform=(m&16)!=0,(m&32)!=0&&(f.mix=(m&64)!=0?r.readFloat():1),(m&128)!=0&&(f.softness=r.readFloat()*t),s.ikConstraints.push(f)}a=r.readInt(!0);for(let l=0,c;l<a;l++){let d=r.readString();if(!d)throw new Error("Transform constraint data name must not be null.");let f=new _t(d);f.order=r.readInt(!0),c=r.readInt(!0);for(let u=0;u<c;u++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let m=r.readByte();f.skinRequired=(m&1)!=0,f.local=(m&2)!=0,f.relative=(m&4)!=0,(m&8)!=0&&(f.offsetRotation=r.readFloat()),(m&16)!=0&&(f.offsetX=r.readFloat()*t),(m&32)!=0&&(f.offsetY=r.readFloat()*t),(m&64)!=0&&(f.offsetScaleX=r.readFloat()),(m&128)!=0&&(f.offsetScaleY=r.readFloat()),m=r.readByte(),(m&1)!=0&&(f.offsetShearY=r.readFloat()),(m&2)!=0&&(f.mixRotate=r.readFloat()),(m&4)!=0&&(f.mixX=r.readFloat()),(m&8)!=0&&(f.mixY=r.readFloat()),(m&16)!=0&&(f.mixScaleX=r.readFloat()),(m&32)!=0&&(f.mixScaleY=r.readFloat()),(m&64)!=0&&(f.mixShearY=r.readFloat()),s.transformConstraints.push(f)}a=r.readInt(!0);for(let l=0,c;l<a;l++){let d=r.readString();if(!d)throw new Error("Path constraint data name must not be null.");let f=new Lt(d);f.order=r.readInt(!0),f.skinRequired=r.readBoolean(),c=r.readInt(!0);for(let u=0;u<c;u++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.slots[r.readInt(!0)];const m=r.readByte();f.positionMode=m&1,f.spacingMode=m>>1&3,f.rotateMode=m>>3&3,(m&128)!=0&&(f.offsetRotation=r.readFloat()),f.position=r.readFloat(),f.positionMode==0&&(f.position*=t),f.spacing=r.readFloat(),(f.spacingMode==0||f.spacingMode==1)&&(f.spacing*=t),f.mixRotate=r.readFloat(),f.mixX=r.readFloat(),f.mixY=r.readFloat(),s.pathConstraints.push(f)}a=r.readInt(!0);for(let l=0,c;l<a;l++){const d=r.readString();if(!d)throw new Error("Physics constraint data name must not be null.");const f=new Is(d);f.order=r.readInt(!0),f.bone=s.bones[r.readInt(!0)];let m=r.readByte();f.skinRequired=(m&1)!=0,(m&2)!=0&&(f.x=r.readFloat()),(m&4)!=0&&(f.y=r.readFloat()),(m&8)!=0&&(f.rotate=r.readFloat()),(m&16)!=0&&(f.scaleX=r.readFloat()),(m&32)!=0&&(f.shearX=r.readFloat()),f.limit=((m&64)!=0?r.readFloat():5e3)*t,f.step=1/r.readUnsignedByte(),f.inertia=r.readFloat(),f.strength=r.readFloat(),f.damping=r.readFloat(),f.massInverse=(m&128)!=0?r.readFloat():1,f.wind=r.readFloat(),f.gravity=r.readFloat(),m=r.readByte(),(m&1)!=0&&(f.inertiaGlobal=!0),(m&2)!=0&&(f.strengthGlobal=!0),(m&4)!=0&&(f.dampingGlobal=!0),(m&8)!=0&&(f.massGlobal=!0),(m&16)!=0&&(f.windGlobal=!0),(m&32)!=0&&(f.gravityGlobal=!0),(m&64)!=0&&(f.mixGlobal=!0),f.mix=(m&128)!=0?r.readFloat():1,s.physicsConstraints.push(f)}let n=this.readSkin(r,s,!0,o);n&&(s.defaultSkin=n,s.skins.push(n));{let l=s.skins.length;for(P.setArraySize(s.skins,a=l+r.readInt(!0));l<a;l++){let c=this.readSkin(r,s,!1,o);if(!c)throw new Error("readSkin() should not have returned null.");s.skins[l]=c}}a=this.linkedMeshes.length;for(let l=0;l<a;l++){let c=this.linkedMeshes[l];const d=s.skins[c.skinIndex];if(!c.parent)throw new Error("Linked mesh parent must not be null");let f=d.getAttachment(c.slotIndex,c.parent);if(!f)throw new Error(`Parent mesh not found: ${c.parent}`);c.mesh.timelineAttachment=c.inheritTimeline?f:c.mesh,c.mesh.setParentMesh(f),c.mesh.region!=null&&c.mesh.updateRegion()}this.linkedMeshes.length=0,a=r.readInt(!0);for(let l=0;l<a;l++){let c=r.readString();if(!c)throw new Error("Event data name must not be null");let d=new Bt(c);d.intValue=r.readInt(!1),d.floatValue=r.readFloat(),d.stringValue=r.readString(),d.audioPath=r.readString(),d.audioPath&&(d.volume=r.readFloat(),d.balance=r.readFloat()),s.events.push(d)}a=r.readInt(!0);for(let l=0;l<a;l++){let c=r.readString();if(!c)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(r,c,s))}return s}readSkin(e,t,s,r){let i=null,h=0;if(s){if(h=e.readInt(!0),h==0)return null;i=new Ne("default")}else{let o=e.readString();if(!o)throw new Error("Skin name must not be null.");i=new Ne(o),r&&D.rgba8888ToColor(i.color,e.readInt32()),i.bones.length=e.readInt(!0);for(let a=0,n=i.bones.length;a<n;a++)i.bones[a]=t.bones[e.readInt(!0)];for(let a=0,n=e.readInt(!0);a<n;a++)i.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let a=0,n=e.readInt(!0);a<n;a++)i.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let a=0,n=e.readInt(!0);a<n;a++)i.constraints.push(t.pathConstraints[e.readInt(!0)]);for(let a=0,n=e.readInt(!0);a<n;a++)i.constraints.push(t.physicsConstraints[e.readInt(!0)]);h=e.readInt(!0)}for(let o=0;o<h;o++){let a=e.readInt(!0);for(let n=0,l=e.readInt(!0);n<l;n++){let c=e.readStringRef();if(!c)throw new Error("Attachment name must not be null");let d=this.readAttachment(e,t,i,a,c,r);d&&i.setAttachment(a,c,d)}}return i}readAttachment(e,t,s,r,i,h){let o=this.scale,a=e.readByte();const n=(a&8)!=0?e.readStringRef():i;if(!n)throw new Error("Attachment name must not be null");switch(a&7){case 0:{let l=(a&16)!=0?e.readStringRef():null;const c=(a&32)!=0?e.readInt32():4294967295,d=(a&64)!=0?this.readSequence(e):null;let f=(a&128)!=0?e.readFloat():0,m=e.readFloat(),u=e.readFloat(),x=e.readFloat(),w=e.readFloat(),p=e.readFloat(),g=e.readFloat();l||(l=n);let b=this.attachmentLoader.newRegionAttachment(s,n,l,d);return b?(b.path=l,b.x=m*o,b.y=u*o,b.scaleX=x,b.scaleY=w,b.rotation=f,b.width=p*o,b.height=g*o,D.rgba8888ToColor(b.color,c),b.sequence=d,d==null&&b.updateRegion(),b):null}case 1:{let l=this.readVertices(e,(a&16)!=0),c=h?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(s,n);return d?(d.worldVerticesLength=l.length,d.vertices=l.vertices,d.bones=l.bones,h&&D.rgba8888ToColor(d.color,c),d):null}case 2:{let l=(a&16)!=0?e.readStringRef():n;const c=(a&32)!=0?e.readInt32():4294967295,d=(a&64)!=0?this.readSequence(e):null,f=e.readInt(!0),m=this.readVertices(e,(a&128)!=0),u=this.readFloatArray(e,m.length,1),x=this.readShortArray(e,(m.length-f-2)*3);let w=[],p=0,g=0;h&&(w=this.readShortArray(e,e.readInt(!0)),p=e.readFloat(),g=e.readFloat()),l||(l=n);let b=this.attachmentLoader.newMeshAttachment(s,n,l,d);return b?(b.path=l,D.rgba8888ToColor(b.color,c),b.bones=m.bones,b.vertices=m.vertices,b.worldVerticesLength=m.length,b.triangles=x,b.regionUVs=u,d==null&&b.updateRegion(),b.hullLength=f<<1,b.sequence=d,h&&(b.edges=w,b.width=p*o,b.height=g*o),b):null}case 3:{const l=(a&16)!=0?e.readStringRef():n;if(l==null)throw new Error("Path of linked mesh must not be null");const c=(a&32)!=0?e.readInt32():4294967295,d=(a&64)!=0?this.readSequence(e):null,f=(a&128)!=0,m=e.readInt(!0),u=e.readStringRef();let x=0,w=0;h&&(x=e.readFloat(),w=e.readFloat());let p=this.attachmentLoader.newMeshAttachment(s,n,l,d);return p?(p.path=l,D.rgba8888ToColor(p.color,c),p.sequence=d,h&&(p.width=x*o,p.height=w*o),this.linkedMeshes.push(new Ks(p,m,r,u,f)),p):null}case 4:{const l=(a&16)!=0,c=(a&32)!=0,d=this.readVertices(e,(a&64)!=0),f=P.newArray(d.length/6,0);for(let x=0,w=f.length;x<w;x++)f[x]=e.readFloat()*o;const m=h?e.readInt32():0,u=this.attachmentLoader.newPathAttachment(s,n);return u?(u.closed=l,u.constantSpeed=c,u.worldVerticesLength=d.length,u.vertices=d.vertices,u.bones=d.bones,u.lengths=f,h&&D.rgba8888ToColor(u.color,m),u):null}case 5:{const l=e.readFloat(),c=e.readFloat(),d=e.readFloat(),f=h?e.readInt32():0,m=this.attachmentLoader.newPointAttachment(s,n);return m?(m.x=c*o,m.y=d*o,m.rotation=l,h&&D.rgba8888ToColor(m.color,f),m):null}case 6:{const l=e.readInt(!0),c=this.readVertices(e,(a&16)!=0);let d=h?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(s,n);return f?(f.endSlot=t.slots[l],f.worldVerticesLength=c.length,f.vertices=c.vertices,f.bones=c.bones,h&&D.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){let t=new is(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){const s=this.scale,r=e.readInt(!0),i=new Qs;if(i.length=r<<1,!t)return i.vertices=this.readFloatArray(e,i.length,s),i;let h=new Array,o=new Array;for(let a=0;a<r;a++){let n=e.readInt(!0);o.push(n);for(let l=0;l<n;l++)o.push(e.readInt(!0)),h.push(e.readFloat()*s),h.push(e.readFloat()*s),h.push(e.readFloat())}return i.vertices=P.toFloatArray(h),i.bones=o,i}readFloatArray(e,t,s){let r=new Array(t);if(s==1)for(let i=0;i<t;i++)r[i]=e.readFloat();else for(let i=0;i<t;i++)r[i]=e.readFloat()*s;return r}readShortArray(e,t){let s=new Array(t);for(let r=0;r<t;r++)s[r]=e.readInt(!0);return s}readAnimation(e,t,s){e.readInt(!0);let r=new Array,i=this.scale;for(let n=0,l=e.readInt(!0);n<l;n++){let c=e.readInt(!0);for(let d=0,f=e.readInt(!0);d<f;d++){let m=e.readByte(),u=e.readInt(!0),x=u-1;switch(m){case ci:{let w=new me(u,c);for(let p=0;p<u;p++)w.setFrame(p,e.readFloat(),e.readStringRef());r.push(w);break}case di:{let w=e.readInt(!0),p=new it(u,w,c),g=e.readFloat(),b=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;for(let S=0,I=0;p.setFrame(S,g,b,y,v,A),S!=x;S++){let T=e.readFloat(),M=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;switch(e.readByte()){case he:p.setStepped(S);break;case ce:U(e,p,I++,S,0,g,T,b,M,1),U(e,p,I++,S,1,g,T,y,Y,1),U(e,p,I++,S,2,g,T,v,F,1),U(e,p,I++,S,3,g,T,A,E,1)}g=T,b=M,y=Y,v=F,A=E}r.push(p);break}case fi:{let w=e.readInt(!0),p=new rt(u,w,c),g=e.readFloat(),b=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255;for(let A=0,S=0;p.setFrame(A,g,b,y,v),A!=x;A++){let I=e.readFloat(),T=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255;switch(e.readByte()){case he:p.setStepped(A);break;case ce:U(e,p,S++,A,0,g,I,b,T,1),U(e,p,S++,A,1,g,I,y,M,1),U(e,p,S++,A,2,g,I,v,Y,1)}g=I,b=T,y=M,v=Y}r.push(p);break}case ui:{let w=e.readInt(!0),p=new nt(u,w,c),g=e.readFloat(),b=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255;for(let M=0,Y=0;p.setFrame(M,g,b,y,v,A,S,I,T),M!=x;M++){let F=e.readFloat(),E=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,N=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255;switch(e.readByte()){case he:p.setStepped(M);break;case ce:U(e,p,Y++,M,0,g,F,b,E,1),U(e,p,Y++,M,1,g,F,y,k,1),U(e,p,Y++,M,2,g,F,v,X,1),U(e,p,Y++,M,3,g,F,A,B,1),U(e,p,Y++,M,4,g,F,S,N,1),U(e,p,Y++,M,5,g,F,I,L,1),U(e,p,Y++,M,6,g,F,T,O,1)}g=F,b=E,y=k,v=X,A=B,S=N,I=L,T=O}r.push(p);break}case mi:{let w=e.readInt(!0),p=new lt(u,w,c),g=e.readFloat(),b=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;for(let T=0,M=0;p.setFrame(T,g,b,y,v,A,S,I),T!=x;T++){let Y=e.readFloat(),F=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,N=e.readUnsignedByte()/255;switch(e.readByte()){case he:p.setStepped(T);break;case ce:U(e,p,M++,T,0,g,Y,b,F,1),U(e,p,M++,T,1,g,Y,y,E,1),U(e,p,M++,T,2,g,Y,v,k,1),U(e,p,M++,T,3,g,Y,A,X,1),U(e,p,M++,T,4,g,Y,S,B,1),U(e,p,M++,T,5,g,Y,I,N,1)}g=Y,b=F,y=E,v=k,A=X,S=B,I=N}r.push(p);break}case gi:{let w=new at(u,e.readInt(!0),c),p=e.readFloat(),g=e.readUnsignedByte()/255;for(let b=0,y=0;w.setFrame(b,p,g),b!=x;b++){let v=e.readFloat(),A=e.readUnsignedByte()/255;switch(e.readByte()){case he:w.setStepped(b);break;case ce:U(e,w,y++,b,0,p,v,g,A,1)}p=v,g=A}r.push(w)}}}}for(let n=0,l=e.readInt(!0);n<l;n++){let c=e.readInt(!0);for(let d=0,f=e.readInt(!0);d<f;d++){let m=e.readByte(),u=e.readInt(!0);if(m==hi){let w=new st(u,c);for(let p=0;p<u;p++)w.setFrame(p,e.readFloat(),e.readByte());r.push(w);continue}let x=e.readInt(!0);switch(m){case Zs:r.push(ee(e,new Se(u,x,c),1));break;case ei:r.push(Gt(e,new $e(u,x,c),i));break;case ti:r.push(ee(e,new He(u,x,c),i));break;case si:r.push(ee(e,new Je(u,x,c),i));break;case ii:r.push(Gt(e,new je(u,x,c),1));break;case ri:r.push(ee(e,new Ke(u,x,c),1));break;case ai:r.push(ee(e,new Qe(u,x,c),1));break;case ni:r.push(Gt(e,new Ze(u,x,c),1));break;case li:r.push(ee(e,new et(u,x,c),1));break;case oi:r.push(ee(e,new tt(u,x,c),1))}}}for(let n=0,l=e.readInt(!0);n<l;n++){let c=e.readInt(!0),d=e.readInt(!0),f=d-1,m=new ht(d,e.readInt(!0),c),u=e.readByte(),x=e.readFloat(),w=(u&1)!=0?(u&2)!=0?e.readFloat():1:0,p=(u&4)!=0?e.readFloat()*i:0;for(let g=0,b=0;m.setFrame(g,x,w,p,(u&8)!=0?1:-1,(u&16)!=0,(u&32)!=0),g!=f;g++){u=e.readByte();const y=e.readFloat(),v=(u&1)!=0?(u&2)!=0?e.readFloat():1:0,A=(u&4)!=0?e.readFloat()*i:0;(u&64)!=0?m.setStepped(g):(u&128)!=0&&(U(e,m,b++,g,0,x,y,w,v,1),U(e,m,b++,g,1,x,y,p,A,i)),x=y,w=v,p=A}r.push(m)}for(let n=0,l=e.readInt(!0);n<l;n++){let c=e.readInt(!0),d=e.readInt(!0),f=d-1,m=new ct(d,e.readInt(!0),c),u=e.readFloat(),x=e.readFloat(),w=e.readFloat(),p=e.readFloat(),g=e.readFloat(),b=e.readFloat(),y=e.readFloat();for(let v=0,A=0;m.setFrame(v,u,x,w,p,g,b,y),v!=f;v++){let S=e.readFloat(),I=e.readFloat(),T=e.readFloat(),M=e.readFloat(),Y=e.readFloat(),F=e.readFloat(),E=e.readFloat();switch(e.readByte()){case he:m.setStepped(v);break;case ce:U(e,m,A++,v,0,u,S,x,I,1),U(e,m,A++,v,1,u,S,w,T,1),U(e,m,A++,v,2,u,S,p,M,1),U(e,m,A++,v,3,u,S,g,Y,1),U(e,m,A++,v,4,u,S,b,F,1),U(e,m,A++,v,5,u,S,y,E,1)}u=S,x=I,w=T,p=M,g=Y,b=F,y=E}r.push(m)}for(let n=0,l=e.readInt(!0);n<l;n++){let c=e.readInt(!0),d=s.pathConstraints[c];for(let f=0,m=e.readInt(!0);f<m;f++){const u=e.readByte(),x=e.readInt(!0),w=e.readInt(!0);switch(u){case wi:r.push(ee(e,new dt(x,w,c),d.positionMode==0?i:1));break;case pi:r.push(ee(e,new ft(x,w,c),d.spacingMode==0||d.spacingMode==1?i:1));break;case yi:let p=new ut(x,w,c),g=e.readFloat(),b=e.readFloat(),y=e.readFloat(),v=e.readFloat();for(let A=0,S=0,I=p.getFrameCount()-1;p.setFrame(A,g,b,y,v),A!=I;A++){let T=e.readFloat(),M=e.readFloat(),Y=e.readFloat(),F=e.readFloat();switch(e.readByte()){case he:p.setStepped(A);break;case ce:U(e,p,S++,A,0,g,T,b,M,1),U(e,p,S++,A,1,g,T,y,Y,1),U(e,p,S++,A,2,g,T,v,F,1)}g=T,b=M,y=Y,v=F}r.push(p)}}}for(let n=0,l=e.readInt(!0);n<l;n++){const c=e.readInt(!0)-1;for(let d=0,f=e.readInt(!0);d<f;d++){const m=e.readByte(),u=e.readInt(!0);if(m==Yi){const w=new vt(u,c);for(let p=0;p<u;p++)w.setFrame(p,e.readFloat());r.push(w);continue}const x=e.readInt(!0);switch(m){case vi:r.push(ee(e,new mt(u,x,c),1));break;case Ai:r.push(ee(e,new gt(u,x,c),1));break;case Si:r.push(ee(e,new xt(u,x,c),1));break;case Ci:r.push(ee(e,new bt(u,x,c),1));break;case Ii:r.push(ee(e,new wt(u,x,c),1));break;case ki:r.push(ee(e,new pt(u,x,c),1));break;case Ti:r.push(ee(e,new yt(u,x,c),1))}}}for(let n=0,l=e.readInt(!0);n<l;n++){let c=s.skins[e.readInt(!0)];for(let d=0,f=e.readInt(!0);d<f;d++){let m=e.readInt(!0);for(let u=0,x=e.readInt(!0);u<x;u++){let w=e.readStringRef();if(!w)throw new Error("attachmentName must not be null.");let p=c.getAttachment(m,w),g=e.readByte(),b=e.readInt(!0),y=b-1;switch(g){case xi:{let v=p,A=v.bones,S=v.vertices,I=A?S.length/3*2:S.length,T=e.readInt(!0),M=new ot(b,T,m,v),Y=e.readFloat();for(let F=0,E=0;;F++){let k,X=e.readInt(!0);if(X==0)k=A?P.newFloatArray(I):S;else{k=P.newFloatArray(I);let N=e.readInt(!0);if(X+=N,i==1)for(let L=N;L<X;L++)k[L]=e.readFloat();else for(let L=N;L<X;L++)k[L]=e.readFloat()*i;if(!A)for(let L=0,O=k.length;L<O;L++)k[L]+=S[L]}if(M.setFrame(F,Y,k),F==y)break;let B=e.readFloat();switch(e.readByte()){case he:M.setStepped(F);break;case ce:U(e,M,E++,F,0,Y,B,0,1,1)}Y=B}r.push(M);break}case bi:{let v=new At(b,m,p);for(let A=0;A<b;A++){let S=e.readFloat(),I=e.readInt32();v.setFrame(A,S,as[I&15],I>>4,e.readFloat())}r.push(v);break}}}}}let h=e.readInt(!0);if(h>0){let n=new we(h),l=s.slots.length;for(let c=0;c<h;c++){let d=e.readFloat(),f=e.readInt(!0),m=P.newArray(l,0);for(let p=l-1;p>=0;p--)m[p]=-1;let u=P.newArray(l-f,0),x=0,w=0;for(let p=0;p<f;p++){let g=e.readInt(!0);for(;x!=g;)u[w++]=x++;m[x+e.readInt(!0)]=x++}for(;x<l;)u[w++]=x++;for(let p=l-1;p>=0;p--)m[p]==-1&&(m[p]=u[--w]);n.setFrame(c,d,m)}r.push(n)}let o=e.readInt(!0);if(o>0){let n=new Re(o);for(let l=0;l<o;l++){let c=e.readFloat(),d=s.events[e.readInt(!0)],f=new Pt(c,d);f.intValue=e.readInt(!1),f.floatValue=e.readFloat(),f.stringValue=e.readString(),f.stringValue==null&&(f.stringValue=d.stringValue),f.data.audioPath&&(f.volume=e.readFloat(),f.balance=e.readFloat()),n.setFrame(l,f)}r.push(n)}let a=0;for(let n=0,l=r.length;n<l;n++)a=Math.max(a,r[n].getDuration());return new Fe(t,r,a)}},ks=class{constructor(e,t=new Array,s=0,r=new DataView(e instanceof ArrayBuffer?e:e.buffer)){this.strings=t,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),s=t&127;return(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<7,(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<14,(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<21,(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<28)))),e?s:s>>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",s=0;for(let r=0;r<e;){let i=this.readUnsignedByte();switch(i>>4){case 12:case 13:t+=String.fromCharCode((i&31)<<6|this.readByte()&63),r+=2;break;case 14:t+=String.fromCharCode((i&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),r+=3;break;default:t+=String.fromCharCode(i),r++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Ks=class{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,i){this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=i}},Qs=class{constructor(e=null,t=null,s=0){this.bones=e,this.vertices=t,this.length=s}};function ee(e,t,s){let r=e.readFloat(),i=e.readFloat()*s;for(let h=0,o=0,a=t.getFrameCount()-1;t.setFrame(h,r,i),h!=a;h++){let n=e.readFloat(),l=e.readFloat()*s;switch(e.readByte()){case he:t.setStepped(h);break;case ce:U(e,t,o++,h,0,r,n,i,l,s)}r=n,i=l}return t}function Gt(e,t,s){let r=e.readFloat(),i=e.readFloat()*s,h=e.readFloat()*s;for(let o=0,a=0,n=t.getFrameCount()-1;t.setFrame(o,r,i,h),o!=n;o++){let l=e.readFloat(),c=e.readFloat()*s,d=e.readFloat()*s;switch(e.readByte()){case he:t.setStepped(o);break;case ce:U(e,t,a++,o,0,r,l,i,c,s),U(e,t,a++,o,1,r,l,h,d,s)}r=l,i=c,h=d}return t}function U(e,t,s,r,i,h,o,a,n,l){t.setBezier(s,r,i,h,a,e.readFloat(),e.readFloat()*l,e.readFloat(),e.readFloat()*l,o,n)}var Zs=0,ei=1,ti=2,si=3,ii=4,ri=5,ai=6,ni=7,li=8,oi=9,hi=10,ci=0,di=1,fi=2,ui=3,mi=4,gi=5,xi=0,bi=1,wi=0,pi=1,yi=2,vi=0,Ai=1,Si=2,Ci=4,Ii=5,ki=6,Ti=7,Yi=8,he=1,ce=2,Mi=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Ae(()=>P.newFloatArray(16));update(e,t){if(!e)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,r=this.polygons,i=this.polygonPool,h=e.slots,o=h.length;s.length=0,i.freeAll(r),r.length=0;for(let a=0;a<o;a++){let n=h[a];if(!n.bone.active)continue;let l=n.getAttachment();if(l instanceof kt){let c=l;s.push(c);let d=i.obtain();d.length!=c.worldVerticesLength&&(d=P.newFloatArray(c.worldVerticesLength)),r.push(d),c.computeWorldVertices(n,0,c.worldVerticesLength,d,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=this.polygons;for(let h=0,o=i.length;h<o;h++){let a=i[h],n=a;for(let l=0,c=a.length;l<c;l+=2){let d=n[l],f=n[l+1];e=Math.min(e,d),t=Math.min(t,f),s=Math.max(s,d),r=Math.max(r,f)}}this.minX=e,this.minY=t,this.maxX=s,this.maxY=r}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,s,r){let i=this.minX,h=this.minY,o=this.maxX,a=this.maxY;if(e<=i&&s<=i||t<=h&&r<=h||e>=o&&s>=o||t>=a&&r>=a)return!1;let n=(r-t)/(s-e),l=n*(i-e)+t;if(l>h&&l<a||(l=n*(o-e)+t,l>h&&l<a))return!0;let c=(h-t)/n+e;return c>i&&c<o||(c=(a-t)/n+e,c>i&&c<o)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let s=this.polygons;for(let r=0,i=s.length;r<i;r++)if(this.containsPointPolygon(s[r],e,t))return this.boundingBoxes[r];return null}containsPointPolygon(e,t,s){let r=e,i=e.length,h=i-2,o=!1;for(let a=0;a<i;a+=2){let n=r[a+1],l=r[h+1];if(n<s&&l>=s||l<s&&n>=s){let c=r[a];c+(s-n)/(l-n)*(r[h]-c)<t&&(o=!o)}h=a}return o}intersectsSegment(e,t,s,r){let i=this.polygons;for(let h=0,o=i.length;h<o;h++)if(this.intersectsSegmentPolygon(i[h],e,t,s,r))return this.boundingBoxes[h];return null}intersectsSegmentPolygon(e,t,s,r,i){let h=e,o=e.length,a=t-r,n=s-i,l=t*i-s*r,c=h[o-2],d=h[o-1];for(let f=0;f<o;f+=2){let m=h[f],u=h[f+1],x=c*u-d*m,w=c-m,p=d-u,g=a*p-n*w,b=(l*w-a*x)/g;if((b>=c&&b<=m||b>=m&&b<=c)&&(b>=t&&b<=r||b>=r&&b<=t)){let y=(l*p-n*x)/g;if((y>=d&&y<=u||y>=u&&y<=d)&&(y>=s&&y<=i||y>=i&&y<=s))return!0}c=m,d=u}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},Ts=class se{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Ae(()=>new Array);polygonIndicesPool=new Ae(()=>new Array);triangulate(t){let s=t,r=t.length>>1,i=this.indicesArray;i.length=0;for(let a=0;a<r;a++)i[a]=a;let h=this.isConcaveArray;h.length=0;for(let a=0,n=r;a<n;++a)h[a]=se.isConcave(a,r,s,i);let o=this.triangles;for(o.length=0;r>3;){let a=r-1,n=0,l=1;for(;;){e:if(!h[n]){let f=i[a]<<1,m=i[n]<<1,u=i[l]<<1,x=s[f],w=s[f+1],p=s[m],g=s[m+1],b=s[u],y=s[u+1];for(let v=(l+1)%r;v!=a;v=(v+1)%r){if(!h[v])continue;let A=i[v]<<1,S=s[A],I=s[A+1];if(se.positiveArea(b,y,x,w,S,I)&&se.positiveArea(x,w,p,g,S,I)&&se.positiveArea(p,g,b,y,S,I))break e}break}if(l==0){do{if(!h[n])break;n--}while(n>0);break}a=n,n=l,l=(l+1)%r}o.push(i[(r+n-1)%r]),o.push(i[n]),o.push(i[(n+1)%r]),i.splice(n,1),h.splice(n,1),r--;let c=(r+n-1)%r,d=n==r?0:n;h[c]=se.isConcave(c,r,s,i),h[d]=se.isConcave(d,r,s,i)}return r==3&&(o.push(i[2]),o.push(i[0]),o.push(i[1])),o}decompose(t,s){let r=t,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;let h=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(h),h.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let n=-1,l=0;for(let c=0,d=s.length;c<d;c+=3){let f=s[c]<<1,m=s[c+1]<<1,u=s[c+2]<<1,x=r[f],w=r[f+1],p=r[m],g=r[m+1],b=r[u],y=r[u+1],v=!1;if(n==f){let A=a.length-4,S=se.winding(a[A],a[A+1],a[A+2],a[A+3],b,y),I=se.winding(b,y,a[0],a[1],a[2],a[3]);S==l&&I==l&&(a.push(b),a.push(y),o.push(u),v=!0)}v||(a.length>0?(i.push(a),h.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(x),a.push(w),a.push(p),a.push(g),a.push(b),a.push(y),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(f),o.push(m),o.push(u),l=se.winding(x,w,p,g,b,y),n=f)}a.length>0&&(i.push(a),h.push(o));for(let c=0,d=i.length;c<d;c++){if(o=h[c],o.length==0)continue;let f=o[0],m=o[o.length-1];a=i[c];let u=a.length-4,x=a[u],w=a[u+1],p=a[u+2],g=a[u+3],b=a[0],y=a[1],v=a[2],A=a[3],S=se.winding(x,w,p,g,b,y);for(let I=0;I<d;I++){if(I==c)continue;let T=h[I];if(T.length!=3)continue;let M=T[0],Y=T[1],F=T[2],E=i[I],k=E[E.length-2],X=E[E.length-1];if(M!=f||Y!=m)continue;let B=se.winding(x,w,p,g,k,X),N=se.winding(k,X,b,y,v,A);B==S&&N==S&&(E.length=0,T.length=0,a.push(k),a.push(X),o.push(F),x=p,w=g,p=k,g=X,I=0)}}for(let c=i.length-1;c>=0;c--)a=i[c],a.length==0&&(i.splice(c,1),this.polygonPool.free(a),o=h[c],h.splice(c,1),this.polygonIndicesPool.free(o));return i}static isConcave(t,s,r,i){let h=i[(s+t-1)%s]<<1,o=i[t]<<1,a=i[(t+1)%s]<<1;return!this.positiveArea(r[h],r[h+1],r[o],r[o+1],r[a],r[a+1])}static positiveArea(t,s,r,i,h,o){return t*(o-i)+r*(s-o)+h*(i-s)>=0}static winding(t,s,r,i,h,o){let a=r-t,n=i-s;return h*n-o*a+a*s-t*n>=0?1:-1}},Xi=class jt{triangulator=new Ts;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(t,s){if(this.clipAttachment)return 0;this.clipAttachment=s;let r=s.worldVerticesLength,i=P.setArraySize(this.clippingPolygon,r);s.computeWorldVertices(t,0,r,i,0,2);let h=this.clippingPolygon;jt.makeClockwise(h);let o=this.clippingPolygons=this.triangulator.decompose(h,this.triangulator.triangulate(h));for(let a=0,n=o.length;a<n;a++){let l=o[a];jt.makeClockwise(l),l.push(l[0]),l.push(l[1])}return o.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,s,r,i,h,o,a,n){let l,c,d,f,m,u;typeof s=="number"?(l=r,c=i,d=h,f=o,m=a,u=n):(l=s,c=r,d=i,f=h,m=o,u=a),d&&f&&m&&typeof u=="boolean"?this.clipTrianglesRender(t,l,c,d,f,m,u):this.clipTrianglesNoRender(t,l,c)}clipTrianglesNoRender(t,s,r){let i=this.clipOutput,h=this.clippedVertices,o=this.clippedTriangles,a=this.clippingPolygons,n=a.length,l=0;h.length=0,o.length=0;for(let c=0;c<r;c+=3){let d=s[c]<<1,f=t[d],m=t[d+1];d=s[c+1]<<1;let u=t[d],x=t[d+1];d=s[c+2]<<1;let w=t[d],p=t[d+1];for(let g=0;g<n;g++){let b=h.length;if(this.clip(f,m,u,x,w,p,a[g],i)){let y=i.length;if(y==0)continue;let v=y>>1,A=this.clipOutput,S=P.setArraySize(h,b+v*2);for(let T=0;T<y;T+=2,b+=2){let M=A[T],Y=A[T+1];S[b]=M,S[b+1]=Y}b=o.length;let I=P.setArraySize(o,b+3*(v-2));v--;for(let T=1;T<v;T++,b+=3)I[b]=l,I[b+1]=l+T,I[b+2]=l+T+1;l+=v+1}else{let y=P.setArraySize(h,b+6);y[b]=f,y[b+1]=m,y[b+2]=u,y[b+3]=x,y[b+4]=w,y[b+5]=p,b=o.length;let v=P.setArraySize(o,b+3);v[b]=l,v[b+1]=l+1,v[b+2]=l+2,l+=3;break}}}}clipTrianglesRender(t,s,r,i,h,o,a){let n=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,d=this.clippingPolygons,f=d.length,m=a?12:8,u=0;l.length=0,c.length=0;for(let x=0;x<r;x+=3){let w=s[x]<<1,p=t[w],g=t[w+1],b=i[w],y=i[w+1];w=s[x+1]<<1;let v=t[w],A=t[w+1],S=i[w],I=i[w+1];w=s[x+2]<<1;let T=t[w],M=t[w+1],Y=i[w],F=i[w+1];for(let E=0;E<f;E++){let k=l.length;if(this.clip(p,g,v,A,T,M,d[E],n)){let X=n.length;if(X==0)continue;let B=A-M,N=T-v,L=p-T,O=M-g,$=1/(B*L+N*(g-M)),z=X>>1,j=this.clipOutput,V=P.setArraySize(l,k+z*m);for(let G=0;G<X;G+=2,k+=m){let te=j[G],K=j[G+1];V[k]=te,V[k+1]=K,V[k+2]=h.r,V[k+3]=h.g,V[k+4]=h.b,V[k+5]=h.a;let Q=te-T,Z=K-M,re=(B*Q+N*Z)*$,xe=(O*Q+L*Z)*$,ye=1-re-xe;V[k+6]=b*re+S*xe+Y*ye,V[k+7]=y*re+I*xe+F*ye,a&&(V[k+8]=o.r,V[k+9]=o.g,V[k+10]=o.b,V[k+11]=o.a)}k=c.length;let W=P.setArraySize(c,k+3*(z-2));z--;for(let G=1;G<z;G++,k+=3)W[k]=u,W[k+1]=u+G,W[k+2]=u+G+1;u+=z+1}else{let X=P.setArraySize(l,k+3*m);X[k]=p,X[k+1]=g,X[k+2]=h.r,X[k+3]=h.g,X[k+4]=h.b,X[k+5]=h.a,a?(X[k+6]=b,X[k+7]=y,X[k+8]=o.r,X[k+9]=o.g,X[k+10]=o.b,X[k+11]=o.a,X[k+12]=v,X[k+13]=A,X[k+14]=h.r,X[k+15]=h.g,X[k+16]=h.b,X[k+17]=h.a,X[k+18]=S,X[k+19]=I,X[k+20]=o.r,X[k+21]=o.g,X[k+22]=o.b,X[k+23]=o.a,X[k+24]=T,X[k+25]=M,X[k+26]=h.r,X[k+27]=h.g,X[k+28]=h.b,X[k+29]=h.a,X[k+30]=Y,X[k+31]=F,X[k+32]=o.r,X[k+33]=o.g,X[k+34]=o.b,X[k+35]=o.a):(X[k+6]=b,X[k+7]=y,X[k+8]=v,X[k+9]=A,X[k+10]=h.r,X[k+11]=h.g,X[k+12]=h.b,X[k+13]=h.a,X[k+14]=S,X[k+15]=I,X[k+16]=T,X[k+17]=M,X[k+18]=h.r,X[k+19]=h.g,X[k+20]=h.b,X[k+21]=h.a,X[k+22]=Y,X[k+23]=F),k=c.length;let B=P.setArraySize(c,k+3);B[k]=u,B[k+1]=u+1,B[k+2]=u+2,u+=3;break}}}}clipTrianglesUnpacked(t,s,r,i){let h=this.clipOutput,o=this.clippedVertices,a=this.clippedUVs,n=this.clippedTriangles,l=this.clippingPolygons,c=l.length,d=0;o.length=0,a.length=0,n.length=0;for(let f=0;f<r;f+=3){let m=s[f]<<1,u=t[m],x=t[m+1],w=i[m],p=i[m+1];m=s[f+1]<<1;let g=t[m],b=t[m+1],y=i[m],v=i[m+1];m=s[f+2]<<1;let A=t[m],S=t[m+1],I=i[m],T=i[m+1];for(let M=0;M<c;M++){let Y=o.length;if(this.clip(u,x,g,b,A,S,l[M],h)){let F=h.length;if(F==0)continue;let E=b-S,k=A-g,X=u-A,B=S-x,N=1/(E*X+k*(x-S)),L=F>>1,O=this.clipOutput,$=P.setArraySize(o,Y+L*2),z=P.setArraySize(a,Y+L*2);for(let V=0;V<F;V+=2,Y+=2){let W=O[V],G=O[V+1];$[Y]=W,$[Y+1]=G;let te=W-A,K=G-S,Q=(E*te+k*K)*N,Z=(B*te+X*K)*N,re=1-Q-Z;z[Y]=w*Q+y*Z+I*re,z[Y+1]=p*Q+v*Z+T*re}Y=n.length;let j=P.setArraySize(n,Y+3*(L-2));L--;for(let V=1;V<L;V++,Y+=3)j[Y]=d,j[Y+1]=d+V,j[Y+2]=d+V+1;d+=L+1}else{let F=P.setArraySize(o,Y+6);F[Y]=u,F[Y+1]=x,F[Y+2]=g,F[Y+3]=b,F[Y+4]=A,F[Y+5]=S;let E=P.setArraySize(a,Y+3*2);E[Y]=w,E[Y+1]=p,E[Y+2]=y,E[Y+3]=v,E[Y+4]=I,E[Y+5]=T,Y=n.length;let k=P.setArraySize(n,Y+3);k[Y]=d,k[Y+1]=d+1,k[Y+2]=d+2,d+=3;break}}}}clip(t,s,r,i,h,o,a,n){let l=n,c=!1,d;a.length%4>=2?(d=n,n=this.scratch):d=this.scratch,d.length=0,d.push(t),d.push(s),d.push(r),d.push(i),d.push(h),d.push(o),d.push(t),d.push(s),n.length=0;let f=a.length-4,m=a;for(let u=0;;u+=2){let x=m[u],w=m[u+1],p=x-m[u+2],g=w-m[u+3],b=n.length,y=d;for(let A=0,S=d.length-2;A<S;){let I=y[A],T=y[A+1];A+=2;let M=y[A],Y=y[A+1],F=g*(x-M)>p*(w-Y),E=g*(x-I)-p*(w-T);if(E>0){if(F){n.push(M),n.push(Y);continue}let k=M-I,X=Y-T,B=E/(k*g-X*p);if(B>=0&&B<=1)n.push(I+k*B),n.push(T+X*B);else{n.push(M),n.push(Y);continue}}else if(F){let k=M-I,X=Y-T,B=E/(k*g-X*p);if(B>=0&&B<=1)n.push(I+k*B),n.push(T+X*B),n.push(M),n.push(Y);else{n.push(M),n.push(Y);continue}}c=!0}if(b==n.length)return l.length=0,!0;if(n.push(n[0]),n.push(n[1]),u==f)break;let v=n;n=d,n.length=0,d=v}if(l!=n){l.length=0;for(let u=0,x=n.length-2;u<x;u++)l[u]=n[u]}else l.length=l.length-2;return c}static makeClockwise(t){let s=t,r=t.length,i=s[r-2]*s[1]-s[0]*s[r-1],h=0,o=0,a=0,n=0;for(let l=0,c=r-3;l<c;l+=2)h=s[l],o=s[l+1],a=s[l+2],n=s[l+3],i+=h*n-a*o;if(!(i<0))for(let l=0,c=r-2,d=r>>1;l<d;l+=2){let f=s[l],m=s[l+1],u=c-l;s[l]=s[u],s[l+1]=s[u+1],s[u]=f,s[u+1]=m}}},Fi=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new qt,r=typeof e=="string"?JSON.parse(e):e,i=r.skeleton;if(i&&(s.hash=i.hash,s.version=i.spine,s.x=i.x,s.y=i.y,s.width=i.width,s.height=i.height,s.referenceScale=C(i,"referenceScale",100)*t,s.fps=i.fps,s.imagesPath=i.images??null,s.audioPath=i.audio??null),r.bones)for(let h=0;h<r.bones.length;h++){let o=r.bones[h],a=null,n=C(o,"parent",null);n&&(a=s.findBone(n));let l=new Ft(s.bones.length,o.name,a);l.length=C(o,"length",0)*t,l.x=C(o,"x",0)*t,l.y=C(o,"y",0)*t,l.rotation=C(o,"rotation",0),l.scaleX=C(o,"scaleX",1),l.scaleY=C(o,"scaleY",1),l.shearX=C(o,"shearX",0),l.shearY=C(o,"shearY",0),l.inherit=P.enumValue(Le,C(o,"inherit","Normal")),l.skinRequired=C(o,"skin",!1);let c=C(o,"color",null);c&&l.color.setFromString(c),s.bones.push(l)}if(r.slots)for(let h=0;h<r.slots.length;h++){let o=r.slots[h],a=o.name,n=s.findBone(o.bone);if(!n)throw new Error(`Couldn't find bone ${o.bone} for slot ${a}`);let l=new Ut(s.slots.length,a,n),c=C(o,"color",null);c&&l.color.setFromString(c);let d=C(o,"dark",null);d&&(l.darkColor=D.fromString(d)),l.attachmentName=C(o,"attachment",null),l.blendMode=P.enumValue(zt,C(o,"blend","normal")),l.visible=C(o,"visible",!0),s.slots.push(l)}if(r.ik)for(let h=0;h<r.ik.length;h++){let o=r.ik[h],a=new Vt(o.name);a.order=C(o,"order",0),a.skinRequired=C(o,"skin",!1);for(let l=0;l<o.bones.length;l++){let c=s.findBone(o.bones[l]);if(!c)throw new Error(`Couldn't find bone ${o.bones[l]} for IK constraint ${o.name}.`);a.bones.push(c)}let n=s.findBone(o.target);if(!n)throw new Error(`Couldn't find target bone ${o.target} for IK constraint ${o.name}.`);a.target=n,a.mix=C(o,"mix",1),a.softness=C(o,"softness",0)*t,a.bendDirection=C(o,"bendPositive",!0)?1:-1,a.compress=C(o,"compress",!1),a.stretch=C(o,"stretch",!1),a.uniform=C(o,"uniform",!1),s.ikConstraints.push(a)}if(r.transform)for(let h=0;h<r.transform.length;h++){let o=r.transform[h],a=new _t(o.name);a.order=C(o,"order",0),a.skinRequired=C(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let d=o.bones[c],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for transform constraint ${o.name}.`);a.bones.push(f)}let n=o.target,l=s.findBone(n);if(!l)throw new Error(`Couldn't find target bone ${n} for transform constraint ${o.name}.`);a.target=l,a.local=C(o,"local",!1),a.relative=C(o,"relative",!1),a.offsetRotation=C(o,"rotation",0),a.offsetX=C(o,"x",0)*t,a.offsetY=C(o,"y",0)*t,a.offsetScaleX=C(o,"scaleX",0),a.offsetScaleY=C(o,"scaleY",0),a.offsetShearY=C(o,"shearY",0),a.mixRotate=C(o,"mixRotate",1),a.mixX=C(o,"mixX",1),a.mixY=C(o,"mixY",a.mixX),a.mixScaleX=C(o,"mixScaleX",1),a.mixScaleY=C(o,"mixScaleY",a.mixScaleX),a.mixShearY=C(o,"mixShearY",1),s.transformConstraints.push(a)}if(r.path)for(let h=0;h<r.path.length;h++){let o=r.path[h],a=new Lt(o.name);a.order=C(o,"order",0),a.skinRequired=C(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let d=o.bones[c],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for path constraint ${o.name}.`);a.bones.push(f)}let n=o.target,l=s.findSlot(n);if(!l)throw new Error(`Couldn't find target slot ${n} for path constraint ${o.name}.`);a.target=l,a.positionMode=P.enumValue(Nt,C(o,"positionMode","Percent")),a.spacingMode=P.enumValue(Ot,C(o,"spacingMode","Length")),a.rotateMode=P.enumValue(Dt,C(o,"rotateMode","Tangent")),a.offsetRotation=C(o,"rotation",0),a.position=C(o,"position",0),a.positionMode==0&&(a.position*=t),a.spacing=C(o,"spacing",0),(a.spacingMode==0||a.spacingMode==1)&&(a.spacing*=t),a.mixRotate=C(o,"mixRotate",1),a.mixX=C(o,"mixX",1),a.mixY=C(o,"mixY",a.mixX),s.pathConstraints.push(a)}if(r.physics)for(let h=0;h<r.physics.length;h++){const o=r.physics[h],a=new Is(o.name);a.order=C(o,"order",0),a.skinRequired=C(o,"skin",!1);const n=o.bone,l=s.findBone(n);if(l==null)throw new Error("Physics bone not found: "+n);a.bone=l,a.x=C(o,"x",0),a.y=C(o,"y",0),a.rotate=C(o,"rotate",0),a.scaleX=C(o,"scaleX",0),a.shearX=C(o,"shearX",0),a.limit=C(o,"limit",5e3)*t,a.step=1/C(o,"fps",60),a.inertia=C(o,"inertia",1),a.strength=C(o,"strength",100),a.damping=C(o,"damping",1),a.massInverse=1/C(o,"mass",1),a.wind=C(o,"wind",0),a.gravity=C(o,"gravity",0),a.mix=C(o,"mix",1),a.inertiaGlobal=C(o,"inertiaGlobal",!1),a.strengthGlobal=C(o,"strengthGlobal",!1),a.dampingGlobal=C(o,"dampingGlobal",!1),a.massGlobal=C(o,"massGlobal",!1),a.windGlobal=C(o,"windGlobal",!1),a.gravityGlobal=C(o,"gravityGlobal",!1),a.mixGlobal=C(o,"mixGlobal",!1),s.physicsConstraints.push(a)}if(r.skins)for(let h=0;h<r.skins.length;h++){let o=r.skins[h],a=new Ne(o.name);if(o.bones)for(let n=0;n<o.bones.length;n++){let l=o.bones[n],c=s.findBone(l);if(!c)throw new Error(`Couldn't find bone ${l} for skin ${o.name}.`);a.bones.push(c)}if(o.ik)for(let n=0;n<o.ik.length;n++){let l=o.ik[n],c=s.findIkConstraint(l);if(!c)throw new Error(`Couldn't find IK constraint ${l} for skin ${o.name}.`);a.constraints.push(c)}if(o.transform)for(let n=0;n<o.transform.length;n++){let l=o.transform[n],c=s.findTransformConstraint(l);if(!c)throw new Error(`Couldn't find transform constraint ${l} for skin ${o.name}.`);a.constraints.push(c)}if(o.path)for(let n=0;n<o.path.length;n++){let l=o.path[n],c=s.findPathConstraint(l);if(!c)throw new Error(`Couldn't find path constraint ${l} for skin ${o.name}.`);a.constraints.push(c)}if(o.physics)for(let n=0;n<o.physics.length;n++){let l=o.physics[n],c=s.findPhysicsConstraint(l);if(!c)throw new Error(`Couldn't find physics constraint ${l} for skin ${o.name}.`);a.constraints.push(c)}for(let n in o.attachments){let l=s.findSlot(n);if(!l)throw new Error(`Couldn't find slot ${n} for skin ${o.name}.`);let c=o.attachments[n];for(let d in c){let f=this.readAttachment(c[d],a,l.index,d,s);f&&a.setAttachment(l.index,d,f)}}s.skins.push(a),a.name=="default"&&(s.defaultSkin=a)}for(let h=0,o=this.linkedMeshes.length;h<o;h++){let a=this.linkedMeshes[h],n=a.skin?s.findSkin(a.skin):s.defaultSkin;if(!n)throw new Error(`Skin not found: ${a.skin}`);let l=n.getAttachment(a.slotIndex,a.parent);if(!l)throw new Error(`Parent mesh not found: ${a.parent}`);a.mesh.timelineAttachment=a.inheritTimeline?l:a.mesh,a.mesh.setParentMesh(l),a.mesh.region!=null&&a.mesh.updateRegion()}if(this.linkedMeshes.length=0,r.events)for(let h in r.events){let o=r.events[h],a=new Bt(h);a.intValue=C(o,"int",0),a.floatValue=C(o,"float",0),a.stringValue=C(o,"string",""),a.audioPath=C(o,"audio",null),a.audioPath&&(a.volume=C(o,"volume",1),a.balance=C(o,"balance",0)),s.events.push(a)}if(r.animations)for(let h in r.animations){let o=r.animations[h];this.readAnimation(o,h,s)}return s}readAttachment(e,t,s,r,i){let h=this.scale;switch(r=C(e,"name",r),C(e,"type","region")){case"region":{let o=C(e,"path",r),a=this.readSequence(C(e,"sequence",null)),n=this.attachmentLoader.newRegionAttachment(t,r,o,a);if(!n)return null;n.path=o,n.x=C(e,"x",0)*h,n.y=C(e,"y",0)*h,n.scaleX=C(e,"scaleX",1),n.scaleY=C(e,"scaleY",1),n.rotation=C(e,"rotation",0),n.width=e.width*h,n.height=e.height*h,n.sequence=a;let l=C(e,"color",null);return l&&n.color.setFromString(l),n.region!=null&&n.updateRegion(),n}case"boundingbox":{let o=this.attachmentLoader.newBoundingBoxAttachment(t,r);if(!o)return null;this.readVertices(e,o,e.vertexCount<<1);let a=C(e,"color",null);return a&&o.color.setFromString(a),o}case"mesh":case"linkedmesh":{let o=C(e,"path",r),a=this.readSequence(C(e,"sequence",null)),n=this.attachmentLoader.newMeshAttachment(t,r,o,a);if(!n)return null;n.path=o;let l=C(e,"color",null);l&&n.color.setFromString(l),n.width=C(e,"width",0)*h,n.height=C(e,"height",0)*h,n.sequence=a;let c=C(e,"parent",null);if(c)return this.linkedMeshes.push(new Ei(n,C(e,"skin",null),s,c,C(e,"timelines",!0))),n;let d=e.uvs;return this.readVertices(e,n,d.length),n.triangles=e.triangles,n.regionUVs=d,n.region!=null&&n.updateRegion(),n.edges=C(e,"edges",null),n.hullLength=C(e,"hull",0)*2,n}case"path":{let o=this.attachmentLoader.newPathAttachment(t,r);if(!o)return null;o.closed=C(e,"closed",!1),o.constantSpeed=C(e,"constantSpeed",!0);let a=e.vertexCount;this.readVertices(e,o,a<<1);let n=P.newArray(a/3,0);for(let c=0;c<e.lengths.length;c++)n[c]=e.lengths[c]*h;o.lengths=n;let l=C(e,"color",null);return l&&o.color.setFromString(l),o}case"point":{let o=this.attachmentLoader.newPointAttachment(t,r);if(!o)return null;o.x=C(e,"x",0)*h,o.y=C(e,"y",0)*h,o.rotation=C(e,"rotation",0);let a=C(e,"color",null);return a&&o.color.setFromString(a),o}case"clipping":{let o=this.attachmentLoader.newClippingAttachment(t,r);if(!o)return null;let a=C(e,"end",null);a&&(o.endSlot=i.findSlot(a));let n=e.vertexCount;this.readVertices(e,o,n<<1);let l=C(e,"color",null);return l&&o.color.setFromString(l),o}}return null}readSequence(e){if(e==null)return null;let t=new is(C(e,"count",0));return t.start=C(e,"start",1),t.digits=C(e,"digits",0),t.setupIndex=C(e,"setup",0),t}readVertices(e,t,s){let r=this.scale;t.worldVerticesLength=s;let i=e.vertices;if(s==i.length){let a=P.toFloatArray(i);if(r!=1)for(let n=0,l=i.length;n<l;n++)a[n]*=r;t.vertices=a;return}let h=new Array,o=new Array;for(let a=0,n=i.length;a<n;){let l=i[a++];o.push(l);for(let c=a+l*4;a<c;a+=4)o.push(i[a]),h.push(i[a+1]*r),h.push(i[a+2]*r),h.push(i[a+3])}t.bones=o,t.vertices=P.toFloatArray(h)}readAnimation(e,t,s){let r=this.scale,i=new Array;if(e.slots)for(let o in e.slots){let a=e.slots[o],n=s.findSlot(o);if(!n)throw new Error("Slot not found: "+o);let l=n.index;for(let c in a){let d=a[c];if(!d)continue;let f=d.length;if(c=="attachment"){let m=new me(f,l);for(let u=0;u<f;u++){let x=d[u];m.setFrame(u,C(x,"time",0),C(x,"name",null))}i.push(m)}else if(c=="rgba"){let m=new it(f,f<<2,l),u=d[0],x=C(u,"time",0),w=D.fromString(u.color);for(let p=0,g=0;;p++){m.setFrame(p,x,w.r,w.g,w.b,w.a);let b=d[p+1];if(!b){m.shrink(g);break}let y=C(b,"time",0),v=D.fromString(b.color),A=u.curve;A&&(g=_(A,m,g,p,0,x,y,w.r,v.r,1),g=_(A,m,g,p,1,x,y,w.g,v.g,1),g=_(A,m,g,p,2,x,y,w.b,v.b,1),g=_(A,m,g,p,3,x,y,w.a,v.a,1)),x=y,w=v,u=b}i.push(m)}else if(c=="rgb"){let m=new rt(f,f*3,l),u=d[0],x=C(u,"time",0),w=D.fromString(u.color);for(let p=0,g=0;;p++){m.setFrame(p,x,w.r,w.g,w.b);let b=d[p+1];if(!b){m.shrink(g);break}let y=C(b,"time",0),v=D.fromString(b.color),A=u.curve;A&&(g=_(A,m,g,p,0,x,y,w.r,v.r,1),g=_(A,m,g,p,1,x,y,w.g,v.g,1),g=_(A,m,g,p,2,x,y,w.b,v.b,1)),x=y,w=v,u=b}i.push(m)}else if(c=="alpha")i.push(ne(d,new at(f,f,l),0,1));else if(c=="rgba2"){let m=new nt(f,f*7,l),u=d[0],x=C(u,"time",0),w=D.fromString(u.light),p=D.fromString(u.dark);for(let g=0,b=0;;g++){m.setFrame(g,x,w.r,w.g,w.b,w.a,p.r,p.g,p.b);let y=d[g+1];if(!y){m.shrink(b);break}let v=C(y,"time",0),A=D.fromString(y.light),S=D.fromString(y.dark),I=u.curve;I&&(b=_(I,m,b,g,0,x,v,w.r,A.r,1),b=_(I,m,b,g,1,x,v,w.g,A.g,1),b=_(I,m,b,g,2,x,v,w.b,A.b,1),b=_(I,m,b,g,3,x,v,w.a,A.a,1),b=_(I,m,b,g,4,x,v,p.r,S.r,1),b=_(I,m,b,g,5,x,v,p.g,S.g,1),b=_(I,m,b,g,6,x,v,p.b,S.b,1)),x=v,w=A,p=S,u=y}i.push(m)}else if(c=="rgb2"){let m=new lt(f,f*6,l),u=d[0],x=C(u,"time",0),w=D.fromString(u.light),p=D.fromString(u.dark);for(let g=0,b=0;;g++){m.setFrame(g,x,w.r,w.g,w.b,p.r,p.g,p.b);let y=d[g+1];if(!y){m.shrink(b);break}let v=C(y,"time",0),A=D.fromString(y.light),S=D.fromString(y.dark),I=u.curve;I&&(b=_(I,m,b,g,0,x,v,w.r,A.r,1),b=_(I,m,b,g,1,x,v,w.g,A.g,1),b=_(I,m,b,g,2,x,v,w.b,A.b,1),b=_(I,m,b,g,3,x,v,p.r,S.r,1),b=_(I,m,b,g,4,x,v,p.g,S.g,1),b=_(I,m,b,g,5,x,v,p.b,S.b,1)),x=v,w=A,p=S,u=y}i.push(m)}}}if(e.bones)for(let o in e.bones){let a=e.bones[o],n=s.findBone(o);if(!n)throw new Error("Bone not found: "+o);let l=n.index;for(let c in a){let d=a[c],f=d.length;if(f!=0){if(c==="rotate")i.push(ne(d,new Se(f,f,l),0,1));else if(c==="translate"){let m=new $e(f,f<<1,l);i.push($t(d,m,"x","y",0,r))}else if(c==="translatex"){let m=new He(f,f,l);i.push(ne(d,m,0,r))}else if(c==="translatey"){let m=new Je(f,f,l);i.push(ne(d,m,0,r))}else if(c==="scale"){let m=new je(f,f<<1,l);i.push($t(d,m,"x","y",1,1))}else if(c==="scalex"){let m=new Ke(f,f,l);i.push(ne(d,m,1,1))}else if(c==="scaley"){let m=new Qe(f,f,l);i.push(ne(d,m,1,1))}else if(c==="shear"){let m=new Ze(f,f<<1,l);i.push($t(d,m,"x","y",0,1))}else if(c==="shearx"){let m=new et(f,f,l);i.push(ne(d,m,0,1))}else if(c==="sheary"){let m=new tt(f,f,l);i.push(ne(d,m,0,1))}else if(c==="inherit"){let m=new st(f,n.index);for(let u=0;u<d.length;u++){let x=d[u];m.setFrame(u,C(x,"time",0),P.enumValue(Le,C(x,"inherit","Normal")))}i.push(m)}}}}if(e.ik)for(let o in e.ik){let a=e.ik[o],n=a[0];if(!n)continue;let l=s.findIkConstraint(o);if(!l)throw new Error("IK Constraint not found: "+o);let c=s.ikConstraints.indexOf(l),d=new ht(a.length,a.length<<1,c),f=C(n,"time",0),m=C(n,"mix",1),u=C(n,"softness",0)*r;for(let x=0,w=0;;x++){d.setFrame(x,f,m,u,C(n,"bendPositive",!0)?1:-1,C(n,"compress",!1),C(n,"stretch",!1));let p=a[x+1];if(!p){d.shrink(w);break}let g=C(p,"time",0),b=C(p,"mix",1),y=C(p,"softness",0)*r,v=n.curve;v&&(w=_(v,d,w,x,0,f,g,m,b,1),w=_(v,d,w,x,1,f,g,u,y,r)),f=g,m=b,u=y,n=p}i.push(d)}if(e.transform)for(let o in e.transform){let a=e.transform[o],n=a[0];if(!n)continue;let l=s.findTransformConstraint(o);if(!l)throw new Error("Transform constraint not found: "+o);let c=s.transformConstraints.indexOf(l),d=new ct(a.length,a.length*6,c),f=C(n,"time",0),m=C(n,"mixRotate",1),u=C(n,"mixX",1),x=C(n,"mixY",u),w=C(n,"mixScaleX",1),p=C(n,"mixScaleY",w),g=C(n,"mixShearY",1);for(let b=0,y=0;;b++){d.setFrame(b,f,m,u,x,w,p,g);let v=a[b+1];if(!v){d.shrink(y);break}let A=C(v,"time",0),S=C(v,"mixRotate",1),I=C(v,"mixX",1),T=C(v,"mixY",I),M=C(v,"mixScaleX",1),Y=C(v,"mixScaleY",M),F=C(v,"mixShearY",1),E=n.curve;E&&(y=_(E,d,y,b,0,f,A,m,S,1),y=_(E,d,y,b,1,f,A,u,I,1),y=_(E,d,y,b,2,f,A,x,T,1),y=_(E,d,y,b,3,f,A,w,M,1),y=_(E,d,y,b,4,f,A,p,Y,1),y=_(E,d,y,b,5,f,A,g,F,1)),f=A,m=S,u=I,x=T,w=M,p=Y,w=M,n=v}i.push(d)}if(e.path)for(let o in e.path){let a=e.path[o],n=s.findPathConstraint(o);if(!n)throw new Error("Path constraint not found: "+o);let l=s.pathConstraints.indexOf(n);for(let c in a){let d=a[c],f=d[0];if(!f)continue;let m=d.length;if(c==="position"){let u=new dt(m,m,l);i.push(ne(d,u,0,n.positionMode==0?r:1))}else if(c==="spacing"){let u=new ft(m,m,l);i.push(ne(d,u,0,n.spacingMode==0||n.spacingMode==1?r:1))}else if(c==="mix"){let u=new ut(m,m*3,l),x=C(f,"time",0),w=C(f,"mixRotate",1),p=C(f,"mixX",1),g=C(f,"mixY",p);for(let b=0,y=0;;b++){u.setFrame(b,x,w,p,g);let v=d[b+1];if(!v){u.shrink(y);break}let A=C(v,"time",0),S=C(v,"mixRotate",1),I=C(v,"mixX",1),T=C(v,"mixY",I),M=f.curve;M&&(y=_(M,u,y,b,0,x,A,w,S,1),y=_(M,u,y,b,1,x,A,p,I,1),y=_(M,u,y,b,2,x,A,g,T,1)),x=A,w=S,p=I,g=T,f=v}i.push(u)}}}if(e.physics)for(let o in e.physics){let a=e.physics[o],n=-1;if(o.length>0){let l=s.findPhysicsConstraint(o);if(!l)throw new Error("Physics constraint not found: "+o);n=s.physicsConstraints.indexOf(l)}for(let l in a){let c=a[l],d=c[0];if(!d)continue;let f=c.length;if(l=="reset"){const u=new vt(f,n);for(let x=0;d!=null;d=c[x+1],x++)u.setFrame(x,C(d,"time",0));i.push(u);continue}let m;if(l=="inertia")m=new mt(f,f,n);else if(l=="strength")m=new gt(f,f,n);else if(l=="damping")m=new xt(f,f,n);else if(l=="mass")m=new bt(f,f,n);else if(l=="wind")m=new wt(f,f,n);else if(l=="gravity")m=new pt(f,f,n);else if(l=="mix")m=new yt(f,f,n);else continue;i.push(ne(c,m,0,1))}}if(e.attachments)for(let o in e.attachments){let a=e.attachments[o],n=s.findSkin(o);if(!n)throw new Error("Skin not found: "+o);for(let l in a){let c=a[l],d=s.findSlot(l);if(!d)throw new Error("Slot not found: "+l);let f=d.index;for(let m in c){let u=c[m],x=n.getAttachment(f,m);for(let w in u){let p=u[w],g=p[0];if(g){if(w=="deform"){let b=x.bones,y=x.vertices,v=b?y.length/3*2:y.length,A=new ot(p.length,p.length,f,x),S=C(g,"time",0);for(let I=0,T=0;;I++){let M,Y=C(g,"vertices",null);if(!Y)M=b?P.newFloatArray(v):y;else{M=P.newFloatArray(v);let X=C(g,"offset",0);if(P.arrayCopy(Y,0,M,X,Y.length),r!=1)for(let B=X,N=B+Y.length;B<N;B++)M[B]*=r;if(!b)for(let B=0;B<v;B++)M[B]+=y[B]}A.setFrame(I,S,M);let F=p[I+1];if(!F){A.shrink(T);break}let E=C(F,"time",0),k=g.curve;k&&(T=_(k,A,T,I,0,S,E,0,1,1)),S=E,g=F}i.push(A)}else if(w=="sequence"){let b=new At(p.length,f,x),y=0;for(let v=0;v<p.length;v++){let A=C(g,"delay",y),S=C(g,"time",0),I=rs[C(g,"mode","hold")],T=C(g,"index",0);b.setFrame(v,S,I,T,A),y=A,g=p[v+1]}i.push(b)}}}}}}if(e.drawOrder){let o=new we(e.drawOrder.length),a=s.slots.length,n=0;for(let l=0;l<e.drawOrder.length;l++,n++){let c=e.drawOrder[l],d=null,f=C(c,"offsets",null);if(f){d=P.newArray(a,-1);let m=P.newArray(a-f.length,0),u=0,x=0;for(let w=0;w<f.length;w++){let p=f[w],g=s.findSlot(p.slot);if(!g)throw new Error("Slot not found: "+g);let b=g.index;for(;u!=b;)m[x++]=u++;d[u+p.offset]=u++}for(;u<a;)m[x++]=u++;for(let w=a-1;w>=0;w--)d[w]==-1&&(d[w]=m[--x])}o.setFrame(n,C(c,"time",0),d)}i.push(o)}if(e.events){let o=new Re(e.events.length),a=0;for(let n=0;n<e.events.length;n++,a++){let l=e.events[n],c=s.findEvent(l.name);if(!c)throw new Error("Event not found: "+l.name);let d=new Pt(P.toSinglePrecision(C(l,"time",0)),c);d.intValue=C(l,"int",c.intValue),d.floatValue=C(l,"float",c.floatValue),d.stringValue=C(l,"string",c.stringValue),d.data.audioPath&&(d.volume=C(l,"volume",1),d.balance=C(l,"balance",0)),o.setFrame(a,d)}i.push(o)}let h=0;for(let o=0,a=i.length;o<a;o++)h=Math.max(h,i[o].getDuration());s.animations.push(new Fe(t,i,h))}},Ei=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,i){this.mesh=e,this.skin=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=i}};function ne(e,t,s,r){let i=e[0],h=C(i,"time",0),o=C(i,"value",s)*r,a=0;for(let n=0;;n++){t.setFrame(n,h,o);let l=e[n+1];if(!l)return t.shrink(a),t;let c=C(l,"time",0),d=C(l,"value",s)*r;i.curve&&(a=_(i.curve,t,a,n,0,h,c,o,d,r)),h=c,o=d,i=l}}function $t(e,t,s,r,i,h){let o=e[0],a=C(o,"time",0),n=C(o,s,i)*h,l=C(o,r,i)*h,c=0;for(let d=0;;d++){t.setFrame(d,a,n,l);let f=e[d+1];if(!f)return t.shrink(c),t;let m=C(f,"time",0),u=C(f,s,i)*h,x=C(f,r,i)*h,w=o.curve;w&&(c=_(w,t,c,d,0,a,m,n,u,h),c=_(w,t,c,d,1,a,m,l,x,h)),a=m,n=u,l=x,o=f}}function _(e,t,s,r,i,h,o,a,n,l){if(e=="stepped")return t.setStepped(r),s;let c=i<<2,d=e[c],f=e[c+1]*l,m=e[c+2],u=e[c+3]*l;return t.setBezier(s,r,i,h,a,d,f,m,u,o,n),s+1}function C(e,t,s){return e[t]!==void 0?e[t]:s}typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)));var Ys=class extends Yt{constructor(e){super(e)}setFilters(e,t){}setWraps(e,t){}dispose(){}},Ri=class extends bs{constructor(e="",t=new Rt){super(s=>new Ys(s),e,t)}},Pi=P.newFloatArray(8),Bi=class We{static QUAD_TRIANGLES=[0,1,2,2,3,0];static VERTEX_SIZE=8;ctx;triangleRendering=!1;debugRendering=!1;vertices=P.newFloatArray(8*1024);tempColor=new D;constructor(t){this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let s=this.ctx,r=this.tempColor,i=t.color,h=t.drawOrder;this.debugRendering&&(s.strokeStyle="green");for(let o=0,a=h.length;o<a;o++){let n=h[o],l=n.bone;if(!l.active)continue;let c=n.getAttachment();if(!(c instanceof H))continue;c.computeWorldVertices(n,Pi,0,2);let d=c.region,f=d.texture.getImage(),m=n.color,u=c.color;r.set(i.r*m.r*u.r,i.g*m.g*u.g,i.b*m.b*u.b,i.a*m.a*u.a),s.save(),s.transform(l.a,l.c,l.b,l.d,l.worldX,l.worldY),s.translate(c.offset[0],c.offset[1]),s.rotate(c.rotation*Math.PI/180);let x=c.width/d.originalWidth;s.scale(x*c.scaleX,x*c.scaleY);let w=d.width,p=d.height;if(s.translate(w/2,p/2),c.region.degrees==90){let g=w;w=p,p=g,s.rotate(-Math.PI/2)}s.scale(1,-1),s.translate(-w/2,-p/2),s.globalAlpha=r.a,s.drawImage(f,f.width*d.u,f.height*d.v,w,p,0,0,w,p),this.debugRendering&&s.strokeRect(0,0,w,p),s.restore()}}drawTriangles(t){let s=this.ctx,r=this.tempColor,i=t.color,h=t.drawOrder,o=null,a=this.vertices,n=null;for(let c=0,d=h.length;c<d;c++){let f=h[c],m=f.getAttachment(),u,x;if(m instanceof H){let w=m;a=this.computeRegionVertices(f,w,!1),n=We.QUAD_TRIANGLES,u=w.region.texture.getImage()}else if(m instanceof Ce){let w=m;a=this.computeMeshVertices(f,w,!1),n=w.triangles,u=w.region.texture.getImage()}else continue;if(u){f.data.blendMode!=o&&(o=f.data.blendMode);let w=f.color,p=m.color;r.set(i.r*w.r*p.r,i.g*w.g*p.g,i.b*w.b*p.b,i.a*w.a*p.a),s.globalAlpha=r.a;for(var l=0;l<n.length;l+=3){let g=n[l]*8,b=n[l+1]*8,y=n[l+2]*8,v=a[g],A=a[g+1],S=a[g+6],I=a[g+7],T=a[b],M=a[b+1],Y=a[b+6],F=a[b+7],E=a[y],k=a[y+1],X=a[y+6],B=a[y+7];this.drawTriangle(u,v,A,S,I,T,M,Y,F,E,k,X,B),this.debugRendering&&(s.strokeStyle="green",s.beginPath(),s.moveTo(v,A),s.lineTo(T,M),s.lineTo(E,k),s.lineTo(v,A),s.stroke())}}}this.ctx.globalAlpha=1}drawTriangle(t,s,r,i,h,o,a,n,l,c,d,f,m){let u=this.ctx;const x=t.width-1,w=t.height-1;i*=x,h*=w,n*=x,l*=w,f*=x,m*=w,u.beginPath(),u.moveTo(s,r),u.lineTo(o,a),u.lineTo(c,d),u.closePath(),o-=s,a-=r,c-=s,d-=r,n-=i,l-=h,f-=i,m-=h;let p=n*m-f*l;if(p==0)return;p=1/p;const g=(m*o-l*c)*p,b=(m*a-l*d)*p,y=(n*c-f*o)*p,v=(n*d-f*a)*p,A=s-g*i-y*h,S=r-b*i-v*h;u.save(),u.transform(g,b,y,v,A,S),u.clip(),u.drawImage(t,0,0),u.restore()}computeRegionVertices(t,s,r){let i=t.bone.skeleton.color,h=t.color,o=s.color,a=i.a*h.a*o.a,n=r?a:1,l=this.tempColor;l.set(i.r*h.r*o.r*n,i.g*h.g*o.g*n,i.b*h.b*o.b*n,a),s.computeWorldVertices(t,this.vertices,0,We.VERTEX_SIZE);let c=this.vertices,d=s.uvs;return c[H.C1R]=l.r,c[H.C1G]=l.g,c[H.C1B]=l.b,c[H.C1A]=l.a,c[H.U1]=d[0],c[H.V1]=d[1],c[H.C2R]=l.r,c[H.C2G]=l.g,c[H.C2B]=l.b,c[H.C2A]=l.a,c[H.U2]=d[2],c[H.V2]=d[3],c[H.C3R]=l.r,c[H.C3G]=l.g,c[H.C3B]=l.b,c[H.C3A]=l.a,c[H.U3]=d[4],c[H.V3]=d[5],c[H.C4R]=l.r,c[H.C4G]=l.g,c[H.C4B]=l.b,c[H.C4A]=l.a,c[H.U4]=d[6],c[H.V4]=d[7],c}computeMeshVertices(t,s,r){let i=t.bone.skeleton.color,h=t.color,o=s.color,a=i.a*h.a*o.a,n=r?a:1,l=this.tempColor;l.set(i.r*h.r*o.r*n,i.g*h.g*o.g*n,i.b*h.b*o.b*n,a);let c=s.worldVerticesLength/2,d=this.vertices;d.length<s.worldVerticesLength&&(this.vertices=d=P.newFloatArray(s.worldVerticesLength)),s.computeWorldVertices(t,0,s.worldVerticesLength,d,0,We.VERTEX_SIZE);let f=s.uvs;for(let m=0,u=0,x=2;m<c;m++)d[x++]=l.r,d[x++]=l.g,d[x++]=l.b,d[x++]=l.a,d[x++]=f[u++],d[x++]=f[u++],x+=2;return d}};export{at as AlphaTimeline,Fe as Animation,Us as AnimationState,zs as AnimationStateAdapter,_s as AnimationStateData,ws as AssetCache,Ri as AssetManager,bs as AssetManagerBase,Hs as AtlasAttachmentLoader,Ge as Attachment,me as AttachmentTimeline,ks as BinaryInput,zt as BlendMode,Et as Bone,Ft as BoneData,kt as BoundingBoxAttachment,fs as CURRENT,Ys as CanvasTexture,Tt as ClippingAttachment,D as Color,ke as ConstraintData,ae as CurveTimeline,ie as CurveTimeline1,Ee as CurveTimeline2,Ds as DebugUtils,ot as DeformTimeline,Rt as Downloader,we as DrawOrderTimeline,Pt as Event,Bt as EventData,hs as EventQueue,Re as EventTimeline,cs as EventType,St as FIRST,Gs as FakeTexture,Be as HOLD_FIRST,ds as HOLD_MIX,Ct as HOLD_SUBSEQUENT,ps as IkConstraint,Vt as IkConstraintData,ht as IkConstraintTimeline,Le as Inherit,st as InheritTimeline,Ns as IntSet,ts as Interpolation,R as MathUtils,Ce as MeshAttachment,ns as MixBlend,ls as MixDirection,Ie as PathAttachment,ys as PathConstraint,Lt as PathConstraintData,ut as PathConstraintMixTimeline,dt as PathConstraintPositionTimeline,ft as PathConstraintSpacingTimeline,Cs as Physics,xt as PhysicsConstraintDampingTimeline,pt as PhysicsConstraintGravityTimeline,mt as PhysicsConstraintInertiaTimeline,bt as PhysicsConstraintMassTimeline,yt as PhysicsConstraintMixTimeline,vt as PhysicsConstraintResetTimeline,gt as PhysicsConstraintStrengthTimeline,de as PhysicsConstraintTimeline,wt as PhysicsConstraintWindTimeline,xs as PointAttachment,Ae as Pool,Nt as PositionMode,ss as Pow,Os as PowOut,lt as RGB2Timeline,nt as RGBA2Timeline,it as RGBATimeline,rt as RGBTimeline,H as RegionAttachment,Dt as RotateMode,Se as RotateTimeline,It as SETUP,Pe as SUBSEQUENT,je as ScaleTimeline,Ke as ScaleXTimeline,Qe as ScaleYTimeline,At as SequenceTimeline,Ze as ShearTimeline,et as ShearXTimeline,tt as ShearYTimeline,Ss as Skeleton,js as SkeletonBinary,Mi as SkeletonBounds,Xi as SkeletonClipping,qt as SkeletonData,Fi as SkeletonJson,Bi as SkeletonRenderer,Ne as Skin,Wt as SkinEntry,vs as Slot,Ut as SlotData,Ot as SpacingMode,_e as StringSet,Yt as Texture,Mt as TextureAtlas,gs as TextureAtlasPage,Xt as TextureAtlasRegion,Ve as TextureFilter,ms as TextureRegion,us as TextureWrap,qs as TimeKeeper,J as Timeline,os as TrackEntry,As as TransformConstraint,_t as TransformConstraintData,ct as TransformConstraintTimeline,$e as TranslateTimeline,He as TranslateXTimeline,Je as TranslateYTimeline,Ts as Triangulator,P as Utils,Xe as Vector2,oe as VertexAttachment,Ws as WindowedMean};
@@ -5678,6 +5678,11 @@ var AssetManagerBase = class {
5678
5678
  try {
5679
5679
  const atlas = this.createTextureAtlas(path, atlasText);
5680
5680
  let toLoad = atlas.pages.length, abort = false;
5681
+ if (toLoad === 0) {
5682
+ this.success(success, path, atlas);
5683
+ resolve(atlas);
5684
+ return;
5685
+ }
5681
5686
  for (let page of atlas.pages) {
5682
5687
  this.loadTexture(
5683
5688
  !fileAlias ? parent + page.name : fileAlias[page.name],