@esotericsoftware/spine-core 4.1.5 → 4.2.1

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
- var spine=(()=>{var Ut=Object.defineProperty,ps=e=>Ut(e,"__esModule",{value:!0}),ys=(e,s)=>{ps(e);for(var t in s)Ut(e,t,{get:s[t],enumerable:!0})},Wt={};ys(Wt,{AlphaTimeline:()=>ct,Animation:()=>Oe,AnimationState:()=>pt,AnimationStateAdapter:()=>Ys,AnimationStateData:()=>Is,AssetManagerBase:()=>Ms,AtlasAttachmentLoader:()=>Xs,Attachment:()=>Qe,AttachmentTimeline:()=>Se,BinaryInput:()=>ds,BlendMode:()=>je,Bone:()=>Tt,BoneData:()=>Ct,BoundingBoxAttachment:()=>ze,CURRENT:()=>ts,ClippingAttachment:()=>kt,Color:()=>D,ConstraintData:()=>_e,CurveTimeline:()=>ne,CurveTimeline1:()=>le,CurveTimeline2:()=>qe,DebugUtils:()=>Ss,DeformTimeline:()=>ut,Downloader:()=>ls,DrawOrderTimeline:()=>Ae,Event:()=>Xt,EventData:()=>Mt,EventQueue:()=>Zt,EventTimeline:()=>Ve,EventType:()=>ee,FIRST:()=>yt,FakeTexture:()=>Cs,HOLD_FIRST:()=>We,HOLD_MIX:()=>es,HOLD_SUBSEQUENT:()=>vt,IkConstraint:()=>os,IkConstraintData:()=>Ft,IkConstraintTimeline:()=>mt,IntSet:()=>vs,Interpolation:()=>zt,JitterEffect:()=>ai,MathUtils:()=>X,MeshAttachment:()=>Xe,MixBlend:()=>$,MixDirection:()=>ge,PathAttachment:()=>Me,PathConstraint:()=>Fe,PathConstraintData:()=>Rt,PathConstraintMixTimeline:()=>wt,PathConstraintPositionTimeline:()=>xt,PathConstraintSpacingTimeline:()=>bt,PointAttachment:()=>It,Pool:()=>Pe,PositionMode:()=>fe,Pow:()=>_t,PowOut:()=>Ht,RGB2Timeline:()=>ft,RGBA2Timeline:()=>dt,RGBATimeline:()=>ot,RGBTimeline:()=>ht,RegionAttachment:()=>W,RotateMode:()=>Ie,RotateTimeline:()=>Le,SETUP:()=>St,SUBSEQUENT:()=>Ue,ScaleTimeline:()=>st,ScaleXTimeline:()=>it,ScaleYTimeline:()=>rt,SequenceTimeline:()=>Te,ShearTimeline:()=>at,ShearXTimeline:()=>nt,ShearYTimeline:()=>lt,Skeleton:()=>Fs,SkeletonBinary:()=>Rs,SkeletonBounds:()=>si,SkeletonClipping:()=>Dt,SkeletonData:()=>Bt,SkeletonJson:()=>ii,Skin:()=>He,SkinEntry:()=>Et,Slot:()=>hs,SlotData:()=>Pt,SpacingMode:()=>Q,StringSet:()=>Je,SwirlEffect:()=>us,Texture:()=>ss,TextureAtlas:()=>rs,TextureAtlasPage:()=>as,TextureAtlasRegion:()=>Yt,TextureFilter:()=>ke,TextureRegion:()=>is,TextureWrap:()=>Ye,TimeKeeper:()=>As,Timeline:()=>J,TrackEntry:()=>Kt,TransformConstraint:()=>cs,TransformConstraintData:()=>Lt,TransformConstraintTimeline:()=>gt,TransformMode:()=>te,TranslateTimeline:()=>Ze,TranslateXTimeline:()=>et,TranslateYTimeline:()=>tt,Triangulator:()=>se,Utils:()=>B,Vector2:()=>jt,VertexAttachment:()=>ae,WindowedMean:()=>ks});var vs=class{constructor(){this.array=new Array}add(e){let s=this.contains(e);return this.array[e|0]=e|0,!s}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Je=class{constructor(){this.entries={},this.size=0}add(e){let s=this.entries[e];return this.entries[e]=!0,s?!1:(this.size++,!0)}addAll(e){let s=this.size;for(var t=0,a=e.length;t<a;t++)this.add(e[t]);return s!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},ve=class{constructor(e=0,s=0,t=0,a=0){this.r=e,this.g=s,this.b=t,this.a=a}set(e,s,t,a){return this.r=e,this.g=s,this.b=t,this.a=a,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,s,t,a){return this.r+=e,this.g+=s,this.b+=t,this.a+=a,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(e,s){e.r=((s&4278190080)>>>24)/255,e.g=((s&16711680)>>>16)/255,e.b=((s&65280)>>>8)/255,e.a=(s&255)/255}static rgb888ToColor(e,s){e.r=((s&16711680)>>>16)/255,e.g=((s&65280)>>>8)/255,e.b=(s&255)/255}static fromString(e){return new ve().setFromString(e)}},D=ve;D.WHITE=new ve(1,1,1,1),D.RED=new ve(1,0,0,1),D.GREEN=new ve(0,1,0,1),D.BLUE=new ve(0,0,1,1),D.MAGENTA=new ve(1,0,1,1);var me=class{static clamp(e,s,t){return e<s?s:e>t?t:e}static cosDeg(e){return Math.cos(e*me.degRad)}static sinDeg(e){return Math.sin(e*me.degRad)}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let s=Math.pow(Math.abs(e),1/3);return e<0?-s:s}static randomTriangular(e,s){return me.randomTriangularWith(e,s,(e+s)*.5)}static randomTriangularWith(e,s,t){let a=Math.random(),r=s-e;return a<=(t-e)/r?e+Math.sqrt(a*r*(t-e)):s-Math.sqrt((1-a)*r*(s-t))}static isPowerOfTwo(e){return e&&(e&e-1)==0}},X=me;X.PI=3.1415927,X.PI2=me.PI*2,X.radiansToDegrees=180/me.PI,X.radDeg=me.radiansToDegrees,X.degreesToRadians=me.PI/180,X.degRad=me.degreesToRadians;var zt=class{apply(e,s,t){return e+(s-e)*this.applyInternal(t)}},_t=class extends zt{constructor(e){super();this.power=2,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}},Ht=class extends _t{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},Ce=class{static arrayCopy(e,s,t,a,r){for(let c=s,n=a;c<s+r;c++,n++)t[n]=e[c]}static arrayFill(e,s,t,a){for(let r=s;r<t;r++)e[r]=a}static setArraySize(e,s,t=0){let a=e.length;if(a==s)return e;if(e.length=s,a<s)for(let r=a;r<s;r++)e[r]=t;return e}static ensureArrayCapacity(e,s,t=0){return e.length>=s?e:Ce.setArraySize(e,s,t)}static newArray(e,s){let t=new Array(e);for(let a=0;a<e;a++)t[a]=s;return t}static newFloatArray(e){if(Ce.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let s=new Array(e);for(let t=0;t<s.length;t++)s[t]=0;return s}}static newShortArray(e){if(Ce.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let s=new Array(e);for(let t=0;t<s.length;t++)s[t]=0;return s}}static toFloatArray(e){return Ce.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return Ce.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,s){}static contains(e,s,t=!0){for(var a=0;a<e.length;a++)if(e[a]==s)return!0;return!1}static enumValue(e,s){return e[s[0].toUpperCase()+s.slice(1)]}},B=Ce;B.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var Ss=class{static logBones(e){for(let s=0;s<e.bones.length;s++){let t=e.bones[s];console.log(t.data.name+", "+t.a+", "+t.b+", "+t.c+", "+t.d+", "+t.worldX+", "+t.worldY)}}},Pe=class{constructor(e){this.items=new Array,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 s=0;s<e.length;s++)this.free(e[s])}clear(){this.items.length=0}},jt=class{constructor(e=0,s=0){this.x=e,this.y=s}set(e,s){return this.x=e,this.y=s,this}length(){let e=this.x,s=this.y;return Math.sqrt(e*e+s*s)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},As=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let 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)}},ks=class{constructor(e=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,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 s=0;s<this.values.length;s++)e+=this.values[s];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Qe=class{constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},Gt=class extends Qe{constructor(e){super(e);this.id=Gt.nextID++,this.bones=null,this.vertices=null,this.worldVerticesLength=0,this.timelineAttahment=this}computeWorldVertices(e,s,t,a,r,c){t=r+(t>>1)*c;let n=e.bone.skeleton,i=e.deform,l=this.vertices,o=this.bones;if(!o){i.length>0&&(l=i);let u=e.bone,g=u.worldX,x=u.worldY,p=u.a,y=u.b,m=u.c,b=u.d;for(let w=s,v=r;v<t;w+=2,v+=c){let A=l[w],S=l[w+1];a[v]=A*p+S*y+g,a[v+1]=A*m+S*b+x}return}let h=0,d=0;for(let u=0;u<s;u+=2){let g=o[h];h+=g+1,d+=g}let f=n.bones;if(i.length==0)for(let u=r,g=d*3;u<t;u+=c){let x=0,p=0,y=o[h++];for(y+=h;h<y;h++,g+=3){let m=f[o[h]],b=l[g],w=l[g+1],v=l[g+2];x+=(b*m.a+w*m.b+m.worldX)*v,p+=(b*m.c+w*m.d+m.worldY)*v}a[u]=x,a[u+1]=p}else{let u=i;for(let g=r,x=d*3,p=d<<1;g<t;g+=c){let y=0,m=0,b=o[h++];for(b+=h;h<b;h++,x+=3,p+=2){let w=f[o[h]],v=l[x]+u[p],A=l[x+1]+u[p+1],S=l[x+2];y+=(v*w.a+A*w.b+w.worldX)*S,m+=(v*w.c+A*w.d+w.worldY)*S}a[g]=y,a[g+1]=m}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),B.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices?(e.vertices=B.newFloatArray(this.vertices.length),B.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)):e.vertices=null,e.worldVerticesLength=this.worldVerticesLength,e.timelineAttahment=this.timelineAttahment}},ae=Gt;ae.nextID=0;var Ne=class{constructor(e){this.id=Ne.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(e)}copy(){let e=new Ne(this.regions.length);return B.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,s){let t=e.sequenceIndex;t==-1&&(t=this.setupIndex),t>=this.regions.length&&(t=this.regions.length-1);let a=this.regions[t];s.region!=a&&(s.region=a,s.updateRegion())}getPath(e,s){let t=e,a=(this.start+s).toString();for(let r=this.digits-a.length;r>0;r--)t+="0";return t+=a,t}static nextID(){return Ne._nextID++}},Ke=Ne;Ke._nextID=0;var de;(function(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"})(de||(de={}));var $t=[0,1,2,3,4,5,6],Oe=class{constructor(e,s,t){if(this.timelines=null,this.timelineIds=null,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(s),this.duration=t}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds=new Je;for(var s=0;s<e.length;s++)this.timelineIds.addAll(e[s].getPropertyIds())}hasTimeline(e){for(let s=0;s<e.length;s++)if(this.timelineIds.contains(e[s]))return!0;return!1}apply(e,s,t,a,r,c,n,i){if(!e)throw new Error("skeleton cannot be null.");a&&this.duration!=0&&(t%=this.duration,s>0&&(s%=this.duration));let l=this.timelines;for(let o=0,h=l.length;o<h;o++)l[o].apply(e,s,t,r,c,n,i)}},$;(function(e){e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add"})($||($={}));var ge;(function(e){e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut"})(ge||(ge={}));var j={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,sequence:19},J=class{constructor(e,s){this.propertyIds=null,this.frames=null,this.propertyIds=s,this.frames=B.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,s){let t=e.length;for(let a=1;a<t;a++)if(e[a]>s)return a-1;return t-1}static search(e,s,t){let a=e.length;for(let r=t;r<a;r+=t)if(e[r]>s)return r-t;return a-t}},ne=class extends J{constructor(e,s,t){super(e,t);this.curves=null,this.curves=B.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let s=this.getFrameCount()+e*18;if(this.curves.length>s){let t=B.newFloatArray(s);B.arrayCopy(this.curves,0,t,0,s),this.curves=t}}setBezier(e,s,t,a,r,c,n,i,l,o,h){let d=this.curves,f=this.getFrameCount()+e*18;t==0&&(d[s]=2+f);let u=(a-c*2+i)*.03,g=(r-n*2+l)*.03,x=((c-i)*3-a+o)*.006,p=((n-l)*3-r+h)*.006,y=u*2+x,m=g*2+p,b=(c-a)*.3+u+x*.16666667,w=(n-r)*.3+g+p*.16666667,v=a+b,A=r+w;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,b+=y,w+=m,y+=x,m+=p,v+=b,A+=w}getBezierValue(e,s,t,a){let r=this.curves;if(r[a]>e){let l=this.frames[s],o=this.frames[s+t];return o+(e-l)/(r[a]-l)*(r[a+1]-o)}let c=a+18;for(a+=2;a<c;a+=2)if(r[a]>=e){let l=r[a-2],o=r[a-1];return o+(e-l)/(r[a]-l)*(r[a+1]-o)}s+=this.getFrameEntries();let n=r[c-2],i=r[c-1];return i+(e-n)/(this.frames[s]-n)*(this.frames[s+t]-i)}},le=class extends ne{constructor(e,s,t){super(e,s,[t])}getFrameEntries(){return 2}setFrame(e,s,t){e<<=1,this.frames[e]=s,this.frames[e+1]=t}getCurveValue(e){let s=this.frames,t=s.length-2;for(let r=2;r<=t;r+=2)if(s[r]>e){t=r-2;break}let a=this.curves[t>>1];switch(a){case 0:let r=s[t],c=s[t+1];return c+(e-r)/(s[t+2]-r)*(s[t+2+1]-c);case 1:return s[t+1]}return this.getBezierValue(e,t,1,a-2)}},qe=class extends ne{constructor(e,s,t,a){super(e,s,[t,a])}getFrameEntries(){return 3}setFrame(e,s,t,a){e*=3,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a}},Le=class extends le{constructor(e,s,t){super(e,s,j.rotate+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.rotation=i.data.rotation;return;case 1:i.rotation+=(i.data.rotation-i.rotation)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.rotation=i.data.rotation+o*r;break;case 1:case 2:o+=i.data.rotation-i.rotation;case 3:i.rotation+=o*r}}},Ze=class extends qe{constructor(e,s,t){super(e,s,j.x+"|"+t,j.y+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.x=i.data.x,i.y=i.data.y;return;case 1:i.x+=(i.data.x-i.x)*r,i.y+=(i.data.y-i.y)*r}return}let o=0,h=0,d=J.search(l,t,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];o=l[d+1],h=l[d+2];let g=(t-u)/(l[d+3]-u);o+=(l[d+3+1]-o)*g,h+=(l[d+3+2]-h)*g;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}switch(c){case 0:i.x=i.data.x+o*r,i.y=i.data.y+h*r;break;case 1:case 2:i.x+=(i.data.x+o-i.x)*r,i.y+=(i.data.y+h-i.y)*r;break;case 3:i.x+=o*r,i.y+=h*r}}},et=class extends le{constructor(e,s,t){super(e,s,j.x+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.x=i.data.x;return;case 1:i.x+=(i.data.x-i.x)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.x=i.data.x+o*r;break;case 1:case 2:i.x+=(i.data.x+o-i.x)*r;break;case 3:i.x+=o*r}}},tt=class extends le{constructor(e,s,t){super(e,s,j.y+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.y=i.data.y;return;case 1:i.y+=(i.data.y-i.y)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.y=i.data.y+o*r;break;case 1:case 2:i.y+=(i.data.y+o-i.y)*r;break;case 3:i.y+=o*r}}},st=class extends qe{constructor(e,s,t){super(e,s,j.scaleX+"|"+t,j.scaleY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.scaleX=i.data.scaleX,i.scaleY=i.data.scaleY;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*r,i.scaleY+=(i.data.scaleY-i.scaleY)*r}return}let o,h,d=J.search(l,t,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];o=l[d+1],h=l[d+2];let g=(t-u)/(l[d+3]-u);o+=(l[d+3+1]-o)*g,h+=(l[d+3+2]-h)*g;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}if(o*=i.data.scaleX,h*=i.data.scaleY,r==1)c==3?(i.scaleX+=o-i.data.scaleX,i.scaleY+=h-i.data.scaleY):(i.scaleX=o,i.scaleY=h);else{let u=0,g=0;if(n==1)switch(c){case 0:u=i.data.scaleX,g=i.data.scaleY,i.scaleX=u+(Math.abs(o)*X.signum(u)-u)*r,i.scaleY=g+(Math.abs(h)*X.signum(g)-g)*r;break;case 1:case 2:u=i.scaleX,g=i.scaleY,i.scaleX=u+(Math.abs(o)*X.signum(u)-u)*r,i.scaleY=g+(Math.abs(h)*X.signum(g)-g)*r;break;case 3:i.scaleX=(o-i.data.scaleX)*r,i.scaleY=(h-i.data.scaleY)*r}else switch(c){case 0:u=Math.abs(i.data.scaleX)*X.signum(o),g=Math.abs(i.data.scaleY)*X.signum(h),i.scaleX=u+(o-u)*r,i.scaleY=g+(h-g)*r;break;case 1:case 2:u=Math.abs(i.scaleX)*X.signum(o),g=Math.abs(i.scaleY)*X.signum(h),i.scaleX=u+(o-u)*r,i.scaleY=g+(h-g)*r;break;case 3:i.scaleX+=(o-i.data.scaleX)*r,i.scaleY+=(h-i.data.scaleY)*r}}}},it=class extends le{constructor(e,s,t){super(e,s,j.scaleX+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.scaleX=i.data.scaleX;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*r}return}let o=this.getCurveValue(t)*i.data.scaleX;if(r==1)c==3?i.scaleX+=o-i.data.scaleX:i.scaleX=o;else{let h=0;if(n==1)switch(c){case 0:h=i.data.scaleX,i.scaleX=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 1:case 2:h=i.scaleX,i.scaleX=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 3:i.scaleX=(o-i.data.scaleX)*r}else switch(c){case 0:h=Math.abs(i.data.scaleX)*X.signum(o),i.scaleX=h+(o-h)*r;break;case 1:case 2:h=Math.abs(i.scaleX)*X.signum(o),i.scaleX=h+(o-h)*r;break;case 3:i.scaleX+=(o-i.data.scaleX)*r}}}},rt=class extends le{constructor(e,s,t){super(e,s,j.scaleY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.scaleY=i.data.scaleY;return;case 1:i.scaleY+=(i.data.scaleY-i.scaleY)*r}return}let o=this.getCurveValue(t)*i.data.scaleY;if(r==1)c==3?i.scaleY+=o-i.data.scaleY:i.scaleY=o;else{let h=0;if(n==1)switch(c){case 0:h=i.data.scaleY,i.scaleY=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 1:case 2:h=i.scaleY,i.scaleY=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 3:i.scaleY=(o-i.data.scaleY)*r}else switch(c){case 0:h=Math.abs(i.data.scaleY)*X.signum(o),i.scaleY=h+(o-h)*r;break;case 1:case 2:h=Math.abs(i.scaleY)*X.signum(o),i.scaleY=h+(o-h)*r;break;case 3:i.scaleY+=(o-i.data.scaleY)*r}}}},at=class extends qe{constructor(e,s,t){super(e,s,j.shearX+"|"+t,j.shearY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.shearX=i.data.shearX,i.shearY=i.data.shearY;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*r,i.shearY+=(i.data.shearY-i.shearY)*r}return}let o=0,h=0,d=J.search(l,t,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];o=l[d+1],h=l[d+2];let g=(t-u)/(l[d+3]-u);o+=(l[d+3+1]-o)*g,h+=(l[d+3+2]-h)*g;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}switch(c){case 0:i.shearX=i.data.shearX+o*r,i.shearY=i.data.shearY+h*r;break;case 1:case 2:i.shearX+=(i.data.shearX+o-i.shearX)*r,i.shearY+=(i.data.shearY+h-i.shearY)*r;break;case 3:i.shearX+=o*r,i.shearY+=h*r}}},nt=class extends le{constructor(e,s,t){super(e,s,j.shearX+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.shearX=i.data.shearX;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.shearX=i.data.shearX+o*r;break;case 1:case 2:i.shearX+=(i.data.shearX+o-i.shearX)*r;break;case 3:i.shearX+=o*r}}},lt=class extends le{constructor(e,s,t){super(e,s,j.shearY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,n){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.shearY=i.data.shearY;return;case 1:i.shearY+=(i.data.shearY-i.shearY)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.shearY=i.data.shearY+o*r;break;case 1:case 2:i.shearY+=(i.data.shearY+o-i.shearY)*r;break;case 3:i.shearY+=o*r}}},ot=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t,j.alpha+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 5}setFrame(e,s,t,a,r,c){e*=5,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color;if(t<l[0]){let p=i.data.color;switch(c){case 0:o.setFromColor(p);return;case 1:o.add((p.r-o.r)*r,(p.g-o.g)*r,(p.b-o.b)*r,(p.a-o.a)*r)}return}let h=0,d=0,f=0,u=0,g=J.search(l,t,5),x=this.curves[g/5];switch(x){case 0:let p=l[g];h=l[g+1],d=l[g+2],f=l[g+3],u=l[g+4];let y=(t-p)/(l[g+5]-p);h+=(l[g+5+1]-h)*y,d+=(l[g+5+2]-d)*y,f+=(l[g+5+3]-f)*y,u+=(l[g+5+4]-u)*y;break;case 1:h=l[g+1],d=l[g+2],f=l[g+3],u=l[g+4];break;default:h=this.getBezierValue(t,g,1,x-2),d=this.getBezierValue(t,g,2,x+18-2),f=this.getBezierValue(t,g,3,x+18*2-2),u=this.getBezierValue(t,g,4,x+18*3-2)}r==1?o.set(h,d,f,u):(c==0&&o.setFromColor(i.data.color),o.add((h-o.r)*r,(d-o.g)*r,(f-o.b)*r,(u-o.a)*r))}},ht=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 4}setFrame(e,s,t,a,r){e<<=2,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color;if(t<l[0]){let x=i.data.color;switch(c){case 0:o.r=x.r,o.g=x.g,o.b=x.b;return;case 1:o.r+=(x.r-o.r)*r,o.g+=(x.g-o.g)*r,o.b+=(x.b-o.b)*r}return}let h=0,d=0,f=0,u=J.search(l,t,4),g=this.curves[u>>2];switch(g){case 0:let x=l[u];h=l[u+1],d=l[u+2],f=l[u+3];let p=(t-x)/(l[u+4]-x);h+=(l[u+4+1]-h)*p,d+=(l[u+4+2]-d)*p,f+=(l[u+4+3]-f)*p;break;case 1:h=l[u+1],d=l[u+2],f=l[u+3];break;default:h=this.getBezierValue(t,u,1,g-2),d=this.getBezierValue(t,u,2,g+18-2),f=this.getBezierValue(t,u,3,g+18*2-2)}if(r==1)o.r=h,o.g=d,o.b=f;else{if(c==0){let x=i.data.color;o.r=x.r,o.g=x.g,o.b=x.b}o.r+=(h-o.r)*r,o.g+=(d-o.g)*r,o.b+=(f-o.b)*r}}},ct=class extends le{constructor(e,s,t){super(e,s,j.alpha+"|"+t);this.slotIndex=0,this.slotIndex=t}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.color;if(t<this.frames[0]){let h=i.data.color;switch(c){case 0:l.a=h.a;return;case 1:l.a+=(h.a-l.a)*r}return}let o=this.getCurveValue(t);r==1?l.a=o:(c==0&&(l.a=i.data.color.a),l.a+=(o-l.a)*r)}},dt=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t,j.alpha+"|"+t,j.rgb2+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 8}setFrame(e,s,t,a,r,c,n,i,l){e<<=3,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=n,this.frames[e+6]=i,this.frames[e+7]=l}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color,h=i.darkColor;if(t<l[0]){let w=i.data.color,v=i.data.darkColor;switch(c){case 0:o.setFromColor(w),h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:o.add((w.r-o.r)*r,(w.g-o.g)*r,(w.b-o.b)*r,(w.a-o.a)*r),h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,g=0,x=0,p=0,y=0,m=J.search(l,t,8),b=this.curves[m>>3];switch(b){case 0:let w=l[m];d=l[m+1],f=l[m+2],u=l[m+3],g=l[m+4],x=l[m+5],p=l[m+6],y=l[m+7];let v=(t-w)/(l[m+8]-w);d+=(l[m+8+1]-d)*v,f+=(l[m+8+2]-f)*v,u+=(l[m+8+3]-u)*v,g+=(l[m+8+4]-g)*v,x+=(l[m+8+5]-x)*v,p+=(l[m+8+6]-p)*v,y+=(l[m+8+7]-y)*v;break;case 1:d=l[m+1],f=l[m+2],u=l[m+3],g=l[m+4],x=l[m+5],p=l[m+6],y=l[m+7];break;default:d=this.getBezierValue(t,m,1,b-2),f=this.getBezierValue(t,m,2,b+18-2),u=this.getBezierValue(t,m,3,b+18*2-2),g=this.getBezierValue(t,m,4,b+18*3-2),x=this.getBezierValue(t,m,5,b+18*4-2),p=this.getBezierValue(t,m,6,b+18*5-2),y=this.getBezierValue(t,m,7,b+18*6-2)}if(r==1)o.set(d,f,u,g),h.r=x,h.g=p,h.b=y;else{if(c==0){o.setFromColor(i.data.color);let w=i.data.darkColor;h.r=w.r,h.g=w.g,h.b=w.b}o.add((d-o.r)*r,(f-o.g)*r,(u-o.b)*r,(g-o.a)*r),h.r+=(x-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},ft=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t,j.rgb2+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 7}setFrame(e,s,t,a,r,c,n,i){e*=7,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=n,this.frames[e+6]=i}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color,h=i.darkColor;if(t<l[0]){let w=i.data.color,v=i.data.darkColor;switch(c){case 0:o.r=w.r,o.g=w.g,o.b=w.b,h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:o.r+=(w.r-o.r)*r,o.g+=(w.g-o.g)*r,o.b+=(w.b-o.b)*r,h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,g=0,x=0,p=0,y=0,m=J.search(l,t,7),b=this.curves[m/7];switch(b){case 0:let w=l[m];d=l[m+1],f=l[m+2],u=l[m+3],x=l[m+4],p=l[m+5],y=l[m+6];let v=(t-w)/(l[m+7]-w);d+=(l[m+7+1]-d)*v,f+=(l[m+7+2]-f)*v,u+=(l[m+7+3]-u)*v,x+=(l[m+7+4]-x)*v,p+=(l[m+7+5]-p)*v,y+=(l[m+7+6]-y)*v;break;case 1:d=l[m+1],f=l[m+2],u=l[m+3],x=l[m+4],p=l[m+5],y=l[m+6];break;default:d=this.getBezierValue(t,m,1,b-2),f=this.getBezierValue(t,m,2,b+18-2),u=this.getBezierValue(t,m,3,b+18*2-2),x=this.getBezierValue(t,m,4,b+18*3-2),p=this.getBezierValue(t,m,5,b+18*4-2),y=this.getBezierValue(t,m,6,b+18*5-2)}if(r==1)o.r=d,o.g=f,o.b=u,h.r=x,h.g=p,h.b=y;else{if(c==0){let w=i.data.color,v=i.data.darkColor;o.r=w.r,o.g=w.g,o.b=w.b,h.r=v.r,h.g=v.g,h.b=v.b}o.r+=(d-o.r)*r,o.g+=(f-o.g)*r,o.b+=(u-o.b)*r,h.r+=(x-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},Se=class extends J{constructor(e,s){super(e,[j.attachment+"|"+s]);this.slotIndex=0,this.slotIndex=s,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.attachmentNames[e]=t}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!!i.bone.active){if(n==1){c==0&&this.setAttachment(e,i,i.data.attachmentName);return}if(t<this.frames[0]){(c==0||c==1)&&this.setAttachment(e,i,i.data.attachmentName);return}this.setAttachment(e,i,this.attachmentNames[J.search1(this.frames,t)])}}setAttachment(e,s,t){s.setAttachment(t?e.getAttachment(this.slotIndex,t):null)}},ut=class extends ne{constructor(e,s,t,a){super(e,s,[j.deform+"|"+t+"|"+a.id]);this.slotIndex=0,this.attachment=null,this.vertices=null,this.slotIndex=t,this.attachment=a,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.vertices[e]=t}setBezier(e,s,t,a,r,c,n,i,l,o,h){let d=this.curves,f=this.getFrameCount()+e*18;t==0&&(d[s]=2+f);let u=(a-c*2+i)*.03,g=l*.03-n*.06,x=((c-i)*3-a+o)*.006,p=(n-l+.33333333)*.018,y=u*2+x,m=g*2+p,b=(c-a)*.3+u+x*.16666667,w=n*.3+g+p*.16666667,v=a+b,A=w;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,b+=y,w+=m,y+=x,m+=p,v+=b,A+=w}getCurvePercent(e,s){let t=this.curves,a=t[s];switch(a){case 0:let i=this.frames[s];return(e-i)/(this.frames[s+this.getFrameEntries()]-i);case 1:return 0}if(a-=2,t[a]>e){let i=this.frames[s];return t[a+1]*(e-i)/(t[a]-i)}let r=a+18;for(a+=2;a<r;a+=2)if(t[a]>=e){let i=t[a-2],l=t[a-1];return l+(e-i)/(t[a]-i)*(t[a+1]-l)}let c=t[r-2],n=t[r-1];return n+(1-n)*(e-c)/(this.frames[s+this.getFrameEntries()]-c)}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.getAttachment();if(!(l instanceof ae)||l.timelineAttahment!=this.attachment)return;let o=i.deform;o.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(t<f[0]){switch(c){case 0:o.length=0;return;case 1:if(r==1){o.length=0;return}o.length=d;let m=l;if(m.bones){r=1-r;for(var u=0;u<d;u++)o[u]*=r}else{let b=m.vertices;for(var u=0;u<d;u++)o[u]+=(b[u]-o[u])*r}}return}if(o.length=d,t>=f[f.length-1]){let m=h[f.length-1];if(r==1)if(c==3){let b=l;if(b.bones)for(let w=0;w<d;w++)o[w]+=m[w];else{let w=b.vertices;for(let v=0;v<d;v++)o[v]+=m[v]-w[v]}}else B.arrayCopy(m,0,o,0,d);else switch(c){case 0:{let w=l;if(w.bones)for(let v=0;v<d;v++)o[v]=m[v]*r;else{let v=w.vertices;for(let A=0;A<d;A++){let S=v[A];o[A]=S+(m[A]-S)*r}}break}case 1:case 2:for(let w=0;w<d;w++)o[w]+=(m[w]-o[w])*r;break;case 3:let b=l;if(b.bones)for(let w=0;w<d;w++)o[w]+=m[w]*r;else{let w=b.vertices;for(let v=0;v<d;v++)o[v]+=(m[v]-w[v])*r}}return}let g=J.search1(f,t),x=this.getCurvePercent(t,g),p=h[g],y=h[g+1];if(r==1)if(c==3){let m=l;if(m.bones)for(let b=0;b<d;b++){let w=p[b];o[b]+=w+(y[b]-w)*x}else{let b=m.vertices;for(let w=0;w<d;w++){let v=p[w];o[w]+=v+(y[w]-v)*x-b[w]}}}else for(let m=0;m<d;m++){let b=p[m];o[m]=b+(y[m]-b)*x}else switch(c){case 0:{let b=l;if(b.bones)for(let w=0;w<d;w++){let v=p[w];o[w]=(v+(y[w]-v)*x)*r}else{let w=b.vertices;for(let v=0;v<d;v++){let A=p[v],S=w[v];o[v]=S+(A+(y[v]-A)*x-S)*r}}break}case 1:case 2:for(let b=0;b<d;b++){let w=p[b];o[b]+=(w+(y[b]-w)*x-o[b])*r}break;case 3:let m=l;if(m.bones)for(let b=0;b<d;b++){let w=p[b];o[b]+=(w+(y[b]-w)*x)*r}else{let b=m.vertices;for(let w=0;w<d;w++){let v=p[w];o[w]+=(v+(y[w]-v)*x-b[w])*r}}}}},Jt=class extends J{constructor(e){super(e,Jt.propertyIds);this.events=null,this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s.time,this.events[e]=s}apply(e,s,t,a,r,c,n){if(!a)return;let i=this.frames,l=this.frames.length;if(s>t)this.apply(e,s,Number.MAX_VALUE,a,r,c,n),s=-1;else if(s>=i[l-1])return;if(t<i[0])return;let o=0;if(s<i[0])o=0;else{o=J.search1(i,s)+1;let h=i[o];for(;o>0&&i[o-1]==h;)o--}for(;o<l&&t>=i[o];o++)a.push(this.events[o])}},Ve=Jt;Ve.propertyIds=[""+j.event];var Qt=class extends J{constructor(e){super(e,Qt.propertyIds);this.drawOrders=null,this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.drawOrders[e]=t}apply(e,s,t,a,r,c,n){if(n==1){c==0&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(t<this.frames[0]){(c==0||c==1)&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let i=this.drawOrders[J.search1(this.frames,t)];if(!i)B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let l=e.drawOrder,o=e.slots;for(let h=0,d=i.length;h<d;h++)l[h]=o[i[h]]}}},Ae=Qt;Ae.propertyIds=[""+j.drawOrder];var mt=class extends ne{constructor(e,s,t){super(e,s,[j.ikConstraint+"|"+t]);this.ikConstraintIndex=0,this.ikConstraintIndex=t}getFrameEntries(){return 6}setFrame(e,s,t,a,r,c,n){e*=6,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c?1:0,this.frames[e+5]=n?1:0}apply(e,s,t,a,r,c,n){let i=e.ikConstraints[this.ikConstraintIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch;return;case 1:i.mix+=(i.data.mix-i.mix)*r,i.softness+=(i.data.softness-i.softness)*r,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}return}let o=0,h=0,d=J.search(l,t,6),f=this.curves[d/6];switch(f){case 0:let u=l[d];o=l[d+1],h=l[d+2];let g=(t-u)/(l[d+6]-u);o+=(l[d+6+1]-o)*g,h+=(l[d+6+2]-h)*g;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}c==0?(i.mix=i.data.mix+(o-i.data.mix)*r,i.softness=i.data.softness+(h-i.data.softness)*r,n==1?(i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch):(i.bendDirection=l[d+3],i.compress=l[d+4]!=0,i.stretch=l[d+5]!=0)):(i.mix+=(o-i.mix)*r,i.softness+=(h-i.softness)*r,n==0&&(i.bendDirection=l[d+3],i.compress=l[d+4]!=0,i.stretch=l[d+5]!=0))}},gt=class extends ne{constructor(e,s,t){super(e,s,[j.transformConstraint+"|"+t]);this.transformConstraintIndex=0,this.transformConstraintIndex=t}getFrameEntries(){return 7}setFrame(e,s,t,a,r,c,n,i){let l=this.frames;e*=7,l[e]=s,l[e+1]=t,l[e+2]=a,l[e+3]=r,l[e+4]=c,l[e+5]=n,l[e+6]=i}apply(e,s,t,a,r,c,n){let i=e.transformConstraints[this.transformConstraintIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){let y=i.data;switch(c){case 0:i.mixRotate=y.mixRotate,i.mixX=y.mixX,i.mixY=y.mixY,i.mixScaleX=y.mixScaleX,i.mixScaleY=y.mixScaleY,i.mixShearY=y.mixShearY;return;case 1:i.mixRotate+=(y.mixRotate-i.mixRotate)*r,i.mixX+=(y.mixX-i.mixX)*r,i.mixY+=(y.mixY-i.mixY)*r,i.mixScaleX+=(y.mixScaleX-i.mixScaleX)*r,i.mixScaleY+=(y.mixScaleY-i.mixScaleY)*r,i.mixShearY+=(y.mixShearY-i.mixShearY)*r}return}let o,h,d,f,u,g,x=J.search(l,t,7),p=this.curves[x/7];switch(p){case 0:let y=l[x];o=l[x+1],h=l[x+2],d=l[x+3],f=l[x+4],u=l[x+5],g=l[x+6];let m=(t-y)/(l[x+7]-y);o+=(l[x+7+1]-o)*m,h+=(l[x+7+2]-h)*m,d+=(l[x+7+3]-d)*m,f+=(l[x+7+4]-f)*m,u+=(l[x+7+5]-u)*m,g+=(l[x+7+6]-g)*m;break;case 1:o=l[x+1],h=l[x+2],d=l[x+3],f=l[x+4],u=l[x+5],g=l[x+6];break;default:o=this.getBezierValue(t,x,1,p-2),h=this.getBezierValue(t,x,2,p+18-2),d=this.getBezierValue(t,x,3,p+18*2-2),f=this.getBezierValue(t,x,4,p+18*3-2),u=this.getBezierValue(t,x,5,p+18*4-2),g=this.getBezierValue(t,x,6,p+18*5-2)}if(c==0){let y=i.data;i.mixRotate=y.mixRotate+(o-y.mixRotate)*r,i.mixX=y.mixX+(h-y.mixX)*r,i.mixY=y.mixY+(d-y.mixY)*r,i.mixScaleX=y.mixScaleX+(f-y.mixScaleX)*r,i.mixScaleY=y.mixScaleY+(u-y.mixScaleY)*r,i.mixShearY=y.mixShearY+(g-y.mixShearY)*r}else i.mixRotate+=(o-i.mixRotate)*r,i.mixX+=(h-i.mixX)*r,i.mixY+=(d-i.mixY)*r,i.mixScaleX+=(f-i.mixScaleX)*r,i.mixScaleY+=(u-i.mixScaleY)*r,i.mixShearY+=(g-i.mixShearY)*r}},xt=class extends le{constructor(e,s,t){super(e,s,j.pathConstraintPosition+"|"+t);this.pathConstraintIndex=0,this.pathConstraintIndex=t}apply(e,s,t,a,r,c,n){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.position=i.data.position;return;case 1:i.position+=(i.data.position-i.position)*r}return}let o=this.getCurveValue(t);c==0?i.position=i.data.position+(o-i.data.position)*r:i.position+=(o-i.position)*r}},bt=class extends le{constructor(e,s,t){super(e,s,j.pathConstraintSpacing+"|"+t);this.pathConstraintIndex=0,this.pathConstraintIndex=t}apply(e,s,t,a,r,c,n){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.spacing=i.data.spacing;return;case 1:i.spacing+=(i.data.spacing-i.spacing)*r}return}let o=this.getCurveValue(t);c==0?i.spacing=i.data.spacing+(o-i.data.spacing)*r:i.spacing+=(o-i.spacing)*r}},wt=class extends ne{constructor(e,s,t){super(e,s,[j.pathConstraintMix+"|"+t]);this.pathConstraintIndex=0,this.pathConstraintIndex=t}getFrameEntries(){return 4}setFrame(e,s,t,a,r){let c=this.frames;e<<=2,c[e]=s,c[e+1]=t,c[e+2]=a,c[e+3]=r}apply(e,s,t,a,r,c,n){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let l=this.frames;if(t<l[0]){switch(c){case 0:i.mixRotate=i.data.mixRotate,i.mixX=i.data.mixX,i.mixY=i.data.mixY;return;case 1:i.mixRotate+=(i.data.mixRotate-i.mixRotate)*r,i.mixX+=(i.data.mixX-i.mixX)*r,i.mixY+=(i.data.mixY-i.mixY)*r}return}let o,h,d,f=J.search(l,t,4),u=this.curves[f>>2];switch(u){case 0:let g=l[f];o=l[f+1],h=l[f+2],d=l[f+3];let x=(t-g)/(l[f+4]-g);o+=(l[f+4+1]-o)*x,h+=(l[f+4+2]-h)*x,d+=(l[f+4+3]-d)*x;break;case 1:o=l[f+1],h=l[f+2],d=l[f+3];break;default:o=this.getBezierValue(t,f,1,u-2),h=this.getBezierValue(t,f,2,u+18-2),d=this.getBezierValue(t,f,3,u+18*2-2)}if(c==0){let g=i.data;i.mixRotate=g.mixRotate+(o-g.mixRotate)*r,i.mixX=g.mixX+(h-g.mixX)*r,i.mixY=g.mixY+(d-g.mixY)*r}else i.mixRotate+=(o-i.mixRotate)*r,i.mixX+=(h-i.mixX)*r,i.mixY+=(d-i.mixY)*r}},pe=class extends J{constructor(e,s,t){super(e,[j.sequence+"|"+s+"|"+t.sequence.id]);this.slotIndex=s,this.attachment=t}getFrameEntries(){return pe.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,s,t,a,r){let c=this.frames;e*=pe.ENTRIES,c[e]=s,c[e+pe.MODE]=t|a<<4,c[e+pe.DELAY]=r}apply(e,s,t,a,r,c,n){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.attachment,o=this.attachment;if(l!=o&&(!(l instanceof ae)||l.timelineAttahment!=o))return;let h=this.frames;if(t<h[0]){(c==0||c==1)&&(i.sequenceIndex=-1);return}let d=J.search(h,t,pe.ENTRIES),f=h[d],u=h[d+pe.MODE],g=h[d+pe.DELAY],x=u>>4,p=this.attachment.sequence.regions.length,y=$t[u&15];if(y!=de.hold)switch(x+=(t-f)/g+1e-5|0,y){case de.once:x=Math.min(p-1,x);break;case de.loop:x%=p;break;case de.pingpong:{let m=(p<<1)-2;x%=m,x>=p&&(x=m-x);break}case de.onceReverse:x=Math.max(p-1-x,0);break;case de.loopReverse:x=p-1-x%p;break;case de.pingpongReverse:{let m=(p<<1)-2;x=(x+p-1)%m,x>=p&&(x=m-x)}}i.sequenceIndex=x}},Te=pe;Te.ENTRIES=3,Te.MODE=1,Te.DELAY=2;var pt=class{constructor(e){this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Zt(this),this.propertyIDs=new Je,this.animationsChanged=!1,this.trackEntryPool=new Pe(()=>new Kt),this.data=e}static emptyAnimation(){return At||(At=new Oe("<empty>",[],0)),At}update(e){e*=this.timeScale;let s=this.tracks;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let c=e*r.timeScale;if(r.delay>0){if(r.delay-=c,r.delay>0)continue;c=-r.delay,r.delay=0}let n=r.next;if(n){let i=r.trackLast-n.delay;if(i>=0){for(n.delay=0,n.trackTime+=r.timeScale==0?0:(i/r.timeScale+e)*n.timeScale,r.trackTime+=c,this.setCurrent(t,n,!0);n.mixingFrom;)n.mixTime+=e,n=n.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){s[t]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let i=r.mixingFrom;for(r.mixingFrom=null,i&&(i.mixingTo=null);i;)this.queue.end(i),i=i.mixingFrom}r.trackTime+=c}this.queue.drain()}updateMixingFrom(e,s){let t=e.mixingFrom;if(!t)return!0;let a=this.updateMixingFrom(t,s);return t.animationLast=t.nextAnimationLast,t.trackLast=t.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((t.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=t.mixingFrom,t.mixingFrom&&(t.mixingFrom.mixingTo=e),e.interruptAlpha=t.interruptAlpha,this.queue.end(t)),a):(t.trackTime+=s*t.timeScale,e.mixTime+=s,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,t=this.tracks,a=!1;for(let d=0,f=t.length;d<f;d++){let u=t[d];if(!u||u.delay>0)continue;a=!0;let g=d==0?$.first:u.mixBlend,x=u.alpha;u.mixingFrom?x*=this.applyMixingFrom(u,e,g):u.trackTime>=u.trackEnd&&!u.next&&(x=0);let p=u.animationLast,y=u.getAnimationTime(),m=y,b=s;u.reverse&&(m=u.animation.duration-m,b=null);let w=u.animation.timelines,v=w.length;if(d==0&&x==1||g==$.add)for(let A=0;A<v;A++){B.webkit602BugfixHelper(x,g);var r=w[A];r instanceof Se?this.applyAttachmentTimeline(r,e,m,g,!0):r.apply(e,p,m,b,x,g,ge.mixIn)}else{let A=u.timelineMode,S=u.timelinesRotation.length!=v<<1;S&&(u.timelinesRotation.length=v<<1);for(let C=0;C<v;C++){let I=w[C],M=A[C]==Ue?g:$.setup;I instanceof Le?this.applyRotateTimeline(I,e,m,x,M,u.timelinesRotation,C<<1,S):I instanceof Se?this.applyAttachmentTimeline(I,e,m,g,!0):(B.webkit602BugfixHelper(x,g),I.apply(e,p,m,b,x,M,ge.mixIn))}}this.queueEvents(u,y),s.length=0,u.nextAnimationLast=y,u.nextTrackLast=u.trackTime}for(var c=this.unkeyedState+St,n=e.slots,i=0,l=e.slots.length;i<l;i++){var o=n[i];if(o.attachmentState==c){var h=o.data.attachmentName;o.setAttachment(h?e.getAttachment(o.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),a}applyMixingFrom(e,s,t){let a=e.mixingFrom;a.mixingFrom&&this.applyMixingFrom(a,s,t);let r=0;e.mixDuration==0?(r=1,t==$.first&&(t=$.setup)):(r=e.mixTime/e.mixDuration,r>1&&(r=1),t!=$.first&&(t=a.mixBlend));let c=r<a.attachmentThreshold,n=r<a.drawOrderThreshold,i=a.animation.timelines,l=i.length,o=a.alpha*e.interruptAlpha,h=o*(1-r),d=a.animationLast,f=a.getAnimationTime(),u=f,g=null;if(a.reverse?u=a.animation.duration-u:r<a.eventThreshold&&(g=this.events),t==$.add)for(let x=0;x<l;x++)i[x].apply(s,d,u,g,h,t,ge.mixOut);else{let x=a.timelineMode,p=a.timelineHoldMix,y=a.timelinesRotation.length!=l<<1;y&&(a.timelinesRotation.length=l<<1),a.totalAlpha=0;for(let m=0;m<l;m++){let b=i[m],w=ge.mixOut,v,A=0;switch(x[m]){case Ue:if(!n&&b instanceof Ae)continue;v=t,A=h;break;case yt:v=$.setup,A=h;break;case vt:v=t,A=o;break;case We:v=$.setup,A=o;break;default:v=$.setup;let S=p[m];A=o*Math.max(0,1-S.mixTime/S.mixDuration);break}a.totalAlpha+=A,b instanceof Le?this.applyRotateTimeline(b,s,u,A,v,a.timelinesRotation,m<<1,y):b instanceof Se?this.applyAttachmentTimeline(b,s,u,v,c):(B.webkit602BugfixHelper(A,t),n&&b instanceof Ae&&v==$.setup&&(w=ge.mixIn),b.apply(s,d,u,g,A,v,w))}}return e.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(e,s,t,a,r){var c=s.slots[e.slotIndex];!c.bone.active||(t<e.frames[0]?(a==$.setup||a==$.first)&&this.setAttachment(s,c,c.data.attachmentName,r):this.setAttachment(s,c,e.attachmentNames[J.search1(e.frames,t)],r),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+St))}setAttachment(e,s,t,a){s.setAttachment(t?e.getAttachment(s.data.index,t):null),a&&(s.attachmentState=this.unkeyedState+ts)}applyRotateTimeline(e,s,t,a,r,c,n,i){if(i&&(c[n]=0),a==1){e.apply(s,0,t,null,1,r,ge.mixIn);return}let l=s.bones[e.boneIndex];if(!l.active)return;let o=e.frames,h=0,d=0;if(t<o[0])switch(r){case $.setup:l.rotation=l.data.rotation;default:return;case $.first:h=l.rotation,d=l.data.rotation}else h=r==$.setup?l.data.rotation:l.rotation,d=l.data.rotation+e.getCurveValue(t);let f=0,u=d-h;if(u-=(16384-(16384.499999999996-u/360|0))*360,u==0)f=c[n];else{let g=0,x=0;i?(g=0,x=u):(g=c[n],x=c[n+1]);let p=u>0,y=g>=0;X.signum(x)!=X.signum(u)&&Math.abs(x)<=90&&(Math.abs(g)>180&&(g+=360*X.signum(g)),y=p),f=u+g-g%360,y!=p&&(f+=360*X.signum(g)),c[n]=f}c[n+1]=u,l.rotation=h+f*a}queueEvents(e,s){let t=e.animationStart,a=e.animationEnd,r=a-t,c=e.trackLast%r,n=this.events,i=0,l=n.length;for(;i<l;i++){let h=n[i];if(h.time<c)break;h.time>a||this.queue.event(e,h)}let o=!1;for(e.loop?o=r==0||c>e.trackTime%r:o=s>=a&&e.animationLast<a,o&&this.queue.complete(e);i<l;i++){let h=n[i];h.time<t||this.queue.event(e,h)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,t=this.tracks.length;s<t;s++)this.clearTrack(s);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let s=this.tracks[e];if(!s)return;this.queue.end(s),this.clearNext(s);let t=s;for(;;){let a=t.mixingFrom;if(!a)break;this.queue.end(a),t.mixingFrom=null,t.mixingTo=null,t=a}this.tracks[s.trackIndex]=null,this.queue.drain()}setCurrent(e,s,t){let a=this.expandToIndex(e);this.tracks[e]=s,s.previous=null,a&&(t&&this.queue.interrupt(a),s.mixingFrom=a,a.mixingTo=s,s.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(s.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(s)}setAnimation(e,s,t=!1){let a=this.data.skeletonData.findAnimation(s);if(!a)throw new Error("Animation not found: "+s);return this.setAnimationWith(e,a,t)}setAnimationWith(e,s,t=!1){if(!s)throw new Error("animation cannot be null.");let a=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));let c=this.trackEntry(e,s,t,r);return this.setCurrent(e,c,a),this.queue.drain(),c}addAnimation(e,s,t=!1,a=0){let r=this.data.skeletonData.findAnimation(s);if(!r)throw new Error("Animation not found: "+s);return this.addAnimationWith(e,r,t,a)}addAnimationWith(e,s,t=!1,a=0){if(!s)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let c=this.trackEntry(e,s,t,r);return r?(r.next=c,c.previous=r,a<=0&&(a+=r.getTrackComplete()-c.mixDuration)):(this.setCurrent(e,c,!0),this.queue.drain()),c.delay=a,c}setEmptyAnimation(e,s=0){let t=this.setAnimationWith(e,pt.emptyAnimation(),!1);return t.mixDuration=s,t.trackEnd=s,t}addEmptyAnimation(e,s=0,t=0){let a=this.addAnimationWith(e,pt.emptyAnimation(),!1,t);return t<=0&&(a.delay+=a.mixDuration-s),a.mixDuration=s,a.trackEnd=s,a}setEmptyAnimations(e=0){let s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,a=this.tracks.length;t<a;t++){let r=this.tracks[t];r&&this.setEmptyAnimation(r.trackIndex,e)}this.queue.drainDisabled=s,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(B.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,s,t,a){let r=this.trackEntryPool.obtain();return r.reset(),r.trackIndex=e,r.animation=s,r.loop=t,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=s.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=a?this.data.getMix(a.animation,s):0,r.mixBlend=$.replace,r}clearNext(e){let s=e.next;for(;s;)this.queue.dispose(s),s=s.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let s=0,t=e.length;s<t;s++){let a=e[s];if(!!a){for(;a.mixingFrom;)a=a.mixingFrom;do(!a.mixingTo||a.mixBlend!=$.add)&&this.computeHold(a),a=a.mixingTo;while(a)}}}computeHold(e){let s=e.mixingTo,t=e.animation.timelines,a=e.animation.timelines.length,r=e.timelineMode;r.length=a;let c=e.timelineHoldMix;c.length=0;let n=this.propertyIDs;if(s&&s.holdPrevious){for(let i=0;i<a;i++)r[i]=n.addAll(t[i].getPropertyIds())?We:vt;return}e:for(let i=0;i<a;i++){let l=t[i],o=l.getPropertyIds();if(!n.addAll(o))r[i]=Ue;else if(!s||l instanceof Se||l instanceof Ae||l instanceof Ve||!s.animation.hasTimeline(o))r[i]=yt;else{for(let h=s.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(o)){if(e.mixDuration>0){r[i]=es,c[i]=h;continue e}break}r[i]=We}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let s=this.listeners.indexOf(e);s>=0&&this.listeners.splice(s,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Kt=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=$.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let 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}},Zt=class{constructor(e){this.objects=[],this.drainDisabled=!1,this.animState=null,this.animState=e}start(e){this.objects.push(ee.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ee.interrupt),this.objects.push(e)}end(e){this.objects.push(ee.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ee.dispose),this.objects.push(e)}complete(e){this.objects.push(ee.complete),this.objects.push(e)}event(e,s){this.objects.push(ee.event),this.objects.push(e),this.objects.push(s)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,s=this.animState.listeners;for(let t=0;t<e.length;t+=2){let a=e[t],r=e[t+1];switch(a){case ee.start:r.listener&&r.listener.start&&r.listener.start(r);for(let n=0;n<s.length;n++)s[n].start&&s[n].start(r);break;case ee.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let n=0;n<s.length;n++)s[n].interrupt&&s[n].interrupt(r);break;case ee.end:r.listener&&r.listener.end&&r.listener.end(r);for(let n=0;n<s.length;n++)s[n].end&&s[n].end(r);case ee.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let n=0;n<s.length;n++)s[n].dispose&&s[n].dispose(r);this.animState.trackEntryPool.free(r);break;case ee.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let n=0;n<s.length;n++)s[n].complete&&s[n].complete(r);break;case ee.event:let c=e[t+++2];r.listener&&r.listener.event&&r.listener.event(r,c);for(let n=0;n<s.length;n++)s[n].event&&s[n].event(r,c);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},ee;(function(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"})(ee||(ee={}));var Ys=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,s){}},Ue=0,yt=1,vt=2,We=3,es=4,St=1,ts=2,At=null,Is=class{constructor(e){if(this.skeletonData=null,this.animationToMixTime={},this.defaultMix=0,!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,s,t){let a=this.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);let r=this.skeletonData.findAnimation(s);if(!r)throw new Error("Animation not found: "+s);this.setMixWith(a,r,t)}setMixWith(e,s,t){if(!e)throw new Error("from cannot be null.");if(!s)throw new Error("to cannot be null.");let a=e.name+"."+s.name;this.animationToMixTime[a]=t}getMix(e,s){let t=e.name+"."+s.name,a=this.animationToMixTime[t];return a===void 0?this.defaultMix:a}},ze=class extends ae{constructor(e){super(e);this.color=new D(1,1,1,1)}copy(){let e=new ze(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},kt=class extends ae{constructor(e){super(e);this.endSlot=null,this.color=new D(.2275,.2275,.8078,1)}copy(){let e=new kt(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},ss=class{constructor(e){this._image=e}getImage(){return this._image}},ke;(function(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"})(ke||(ke={}));var Ye;(function(e){e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat"})(Ye||(Ye={}));var is=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Cs=class extends ss{setFilters(e,s){}setWraps(e,s){}dispose(){}},rs=class{constructor(e){this.pages=new Array,this.regions=new Array;let s=new Ts(e),t=new Array(4),a=null,r=null,c={};c.size=()=>{a.width=parseInt(t[1]),a.height=parseInt(t[2])},c.format=()=>{},c.filter=()=>{a.minFilter=B.enumValue(ke,t[1]),a.magFilter=B.enumValue(ke,t[2])},c.repeat=()=>{t[1].indexOf("x")!=-1&&(a.uWrap=Ye.Repeat),t[1].indexOf("y")!=-1&&(a.vWrap=Ye.Repeat)},c.pma=()=>{a.pma=t[1]=="true"};var n={};n.xy=()=>{r.x=parseInt(t[1]),r.y=parseInt(t[2])},n.size=()=>{r.width=parseInt(t[1]),r.height=parseInt(t[2])},n.bounds=()=>{r.x=parseInt(t[1]),r.y=parseInt(t[2]),r.width=parseInt(t[3]),r.height=parseInt(t[4])},n.offset=()=>{r.offsetX=parseInt(t[1]),r.offsetY=parseInt(t[2])},n.orig=()=>{r.originalWidth=parseInt(t[1]),r.originalHeight=parseInt(t[2])},n.offsets=()=>{r.offsetX=parseInt(t[1]),r.offsetY=parseInt(t[2]),r.originalWidth=parseInt(t[3]),r.originalHeight=parseInt(t[4])},n.rotate=()=>{let h=t[1];h=="true"?r.degrees=90:h!="false"&&(r.degrees=parseInt(h))},n.index=()=>{r.index=parseInt(t[1])};let i=s.readLine();for(;i&&i.trim().length==0;)i=s.readLine();for(;!(!i||i.trim().length==0||s.readEntry(t,i)==0);)i=s.readLine();let l=null,o=null;for(;i!==null;)if(i.trim().length==0)a=null,i=s.readLine();else if(a){for(r=new Yt,r.page=a,r.name=i;;){let h=s.readEntry(t,i=s.readLine());if(h==0)break;let d=n[t[0]];if(d)d();else{l||(l=[],o=[]),l.push(t[0]);let f=[];for(let u=0;u<h;u++)f.push(parseInt(t[u+1]));o.push(f)}}r.originalWidth==0&&r.originalHeight==0&&(r.originalWidth=r.width,r.originalHeight=r.height),l&&l.length>0&&(r.names=l,r.values=o,l=null,o=null),r.u=r.x/a.width,r.v=r.y/a.height,r.degrees==90?(r.u2=(r.x+r.height)/a.width,r.v2=(r.y+r.width)/a.height):(r.u2=(r.x+r.width)/a.width,r.v2=(r.y+r.height)/a.height),this.regions.push(r)}else{for(a=new as,a.name=i.trim();s.readEntry(t,i=s.readLine())!=0;){let h=c[t[0]];h&&h()}this.pages.push(a)}}findRegion(e){for(let s=0;s<this.regions.length;s++)if(this.regions[s].name==e)return this.regions[s];return null}setTextures(e,s=""){for(let t of this.pages)t.setTexture(e.get(s+t.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture.dispose()}},Ts=class{constructor(e){this.lines=null,this.index=0,this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,s){if(!s||(s=s.trim(),s.length==0))return 0;let t=s.indexOf(":");if(t==-1)return 0;e[0]=s.substr(0,t).trim();for(let a=1,r=t+1;;a++){let c=s.indexOf(",",r);if(c==-1)return e[a]=s.substr(r).trim(),a;if(e[a]=s.substr(r,c-r).trim(),r=c+1,a==4)return 4}}},as=class{constructor(){this.name=null,this.minFilter=ke.Nearest,this.magFilter=ke.Nearest,this.uWrap=Ye.ClampToEdge,this.vWrap=Ye.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap)}},Yt=class extends is{constructor(){super(...arguments);this.page=null,this.name=null,this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null}},Xe=class extends ae{constructor(e){super(e);this.region=null,this.path=null,this.regionUVs=null,this.uvs=null,this.triangles=null,this.color=new D(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=null,this.parentMesh=null,this.sequence=null,this.tempColor=new D(0,0,0,0)}updateRegion(){let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=B.newFloatArray(e.length));let s=this.uvs,t=this.uvs.length,a=this.region.u,r=this.region.v,c=0,n=0;if(this.region instanceof Yt){let i=this.region,l=i.page.texture.getImage(),o=l.width,h=l.height;switch(i.degrees){case 90:a-=(i.originalHeight-i.offsetY-i.height)/o,r-=(i.originalWidth-i.offsetX-i.width)/h,c=i.originalHeight/o,n=i.originalWidth/h;for(let d=0;d<t;d+=2)s[d]=a+e[d+1]*c,s[d+1]=r+(1-e[d])*n;return;case 180:a-=(i.originalWidth-i.offsetX-i.width)/o,r-=i.offsetY/h,c=i.originalWidth/o,n=i.originalHeight/h;for(let d=0;d<t;d+=2)s[d]=a+(1-e[d])*c,s[d+1]=r+(1-e[d+1])*n;return;case 270:a-=i.offsetY/o,r-=i.offsetX/h,c=i.originalHeight/o,n=i.originalWidth/h;for(let d=0;d<t;d+=2)s[d]=a+(1-e[d+1])*c,s[d+1]=r+e[d]*n;return}a-=i.offsetX/o,r-=(i.originalHeight-i.offsetY-i.height)/h,c=i.originalWidth/o,n=i.originalHeight/h}else this.region?(c=this.region.u2-a,n=this.region.v2-r):(a=r=0,c=n=1);for(let i=0;i<t;i+=2)s[i]=a+e[i]*c,s[i+1]=r+e[i+1]*n}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new Xe(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),B.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),B.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),B.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),B.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,s,t,a,r,c){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,s,t,a,r,c)}newLinkedMesh(){let e=new Xe(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),e.timelineAttahment=this.timelineAttahment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},Me=class extends ae{constructor(e){super(e);this.lengths=null,this.closed=!1,this.constantSpeed=!1,this.color=new D(1,1,1,1)}copy(){let e=new Me(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),B.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},It=class extends ae{constructor(e){super(e);this.x=0,this.y=0,this.rotation=0,this.color=new D(.38,.94,0,1)}computeWorldPosition(e,s){return s.x=this.x*e.a+this.y*e.b+e.worldX,s.y=this.x*e.c+this.y*e.d+e.worldY,s}computeWorldRotation(e){let s=X.cosDeg(this.rotation),t=X.sinDeg(this.rotation),a=s*e.a+t*e.b,r=s*e.c+t*e.d;return Math.atan2(r,a)*X.radDeg}copy(){let e=new It(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},ns=class extends Qe{constructor(e){super(e);this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new D(1,1,1,1),this.path=null,this.rendererObject=null,this.region=null,this.sequence=null,this.offset=B.newFloatArray(8),this.uvs=B.newFloatArray(8),this.tempColor=new D(1,1,1,1)}updateRegion(){let e=this.region,s=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*s,r=-this.height/2*this.scaleY+this.region.offsetY*t,c=a+this.region.width*s,n=r+this.region.height*t,i=this.rotation*Math.PI/180,l=Math.cos(i),o=Math.sin(i),h=this.x,d=this.y,f=a*l+h,u=a*o,g=r*l+d,x=r*o,p=c*l+h,y=c*o,m=n*l+d,b=n*o,w=this.offset;w[0]=f-x,w[1]=g+u,w[2]=f-b,w[3]=m+u,w[4]=p-b,w[5]=m+y,w[6]=p-x,w[7]=g+y;let v=this.uvs;e.degrees==90?(v[2]=e.u,v[3]=e.v2,v[4]=e.u,v[5]=e.v,v[6]=e.u2,v[7]=e.v,v[0]=e.u2,v[1]=e.v2):(v[0]=e.u,v[1]=e.v2,v[2]=e.u,v[3]=e.v,v[4]=e.u2,v[5]=e.v,v[6]=e.u2,v[7]=e.v2)}computeWorldVertices(e,s,t,a){this.sequence!=null&&this.sequence.apply(e,this);let r=e.bone,c=this.offset,n=r.worldX,i=r.worldY,l=r.a,o=r.b,h=r.c,d=r.d,f=0,u=0;f=c[0],u=c[1],s[t]=f*l+u*o+n,s[t+1]=f*h+u*d+i,t+=a,f=c[2],u=c[3],s[t]=f*l+u*o+n,s[t+1]=f*h+u*d+i,t+=a,f=c[4],u=c[5],s[t]=f*l+u*o+n,s[t+1]=f*h+u*d+i,t+=a,f=c[6],u=c[7],s[t]=f*l+u*o+n,s[t+1]=f*h+u*d+i}copy(){let e=new ns(this.name);return e.region=this.region,e.rendererObject=this.rendererObject,e.path=this.path,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,B.arrayCopy(this.uvs,0,e.uvs,0,8),B.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},W=ns;W.X1=0,W.Y1=1,W.C1R=2,W.C1G=3,W.C1B=4,W.C1A=5,W.U1=6,W.V1=7,W.X2=8,W.Y2=9,W.C2R=10,W.C2G=11,W.C2B=12,W.C2A=13,W.U2=14,W.V2=15,W.X3=16,W.Y3=17,W.C3R=18,W.C3G=19,W.C3B=20,W.C3A=21,W.U3=22,W.V3=23,W.X4=24,W.Y4=25,W.C4R=26,W.C4G=27,W.C4B=28,W.C4A=29,W.U4=30,W.V4=31;var Xs=class{constructor(e){this.atlas=null,this.atlas=e}loadSequence(e,s,t){let a=t.regions;for(let r=0,c=a.length;r<c;r++){let n=t.getPath(s,r);if(a[r]=this.atlas.findRegion(n),a[r].renderObject=a[r],a[r]==null)throw new Error("Region not found in atlas: "+n+" (sequence: "+e+")")}}newRegionAttachment(e,s,t,a){let r=new W(s);if(a!=null)this.loadSequence(s,t,a);else{let c=this.atlas.findRegion(t);if(!c)throw new Error("Region not found in atlas: "+t+" (region attachment: "+s+")");c.renderObject=c,r.region=c}return r}newMeshAttachment(e,s,t,a){let r=new Xe(s);if(a!=null)this.loadSequence(s,t,a);else{let c=this.atlas.findRegion(t);if(!c)throw new Error("Region not found in atlas: "+t+" (mesh attachment: "+s+")");c.renderObject=c,r.region=c}return r}newBoundingBoxAttachment(e,s){return new ze(s)}newPathAttachment(e,s){return new Me(s)}newPointAttachment(e,s){return new It(s)}newClippingAttachment(e,s){return new kt(s)}},Ct=class{constructor(e,s,t){if(this.index=0,this.name=null,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=te.Normal,this.skinRequired=!1,this.color=new D,e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");this.index=e,this.name=s,this.parent=t}},te;(function(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"})(te||(te={}));var Tt=class{constructor(e,s,t){if(this.data=null,this.skeleton=null,this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=s,this.parent=t,this.setToSetupPose()}isActive(){return this.active}update(){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,s,t,a,r,c,n){this.ax=e,this.ay=s,this.arotation=t,this.ascaleX=a,this.ascaleY=r,this.ashearX=c,this.ashearY=n;let i=this.parent;if(!i){let f=this.skeleton,u=t+90+n,g=f.scaleX,x=f.scaleY;this.a=X.cosDeg(t+c)*a*g,this.b=X.cosDeg(u)*r*g,this.c=X.sinDeg(t+c)*a*x,this.d=X.sinDeg(u)*r*x,this.worldX=e*g+f.x,this.worldY=s*x+f.y;return}let l=i.a,o=i.b,h=i.c,d=i.d;switch(this.worldX=l*e+o*s+i.worldX,this.worldY=h*e+d*s+i.worldY,this.data.transformMode){case te.Normal:{let f=t+90+n,u=X.cosDeg(t+c)*a,g=X.cosDeg(f)*r,x=X.sinDeg(t+c)*a,p=X.sinDeg(f)*r;this.a=l*u+o*x,this.b=l*g+o*p,this.c=h*u+d*x,this.d=h*g+d*p;return}case te.OnlyTranslation:{let f=t+90+n;this.a=X.cosDeg(t+c)*a,this.b=X.cosDeg(f)*r,this.c=X.sinDeg(t+c)*a,this.d=X.sinDeg(f)*r;break}case te.NoRotationOrReflection:{let f=l*l+h*h,u=0;f>1e-4?(f=Math.abs(l*d-o*h)/f,l/=this.skeleton.scaleX,h/=this.skeleton.scaleY,o=h*f,d=l*f,u=Math.atan2(h,l)*X.radDeg):(l=0,h=0,u=90-Math.atan2(d,o)*X.radDeg);let g=t+c-u,x=t+n-u+90,p=X.cosDeg(g)*a,y=X.cosDeg(x)*r,m=X.sinDeg(g)*a,b=X.sinDeg(x)*r;this.a=l*p-o*m,this.b=l*y-o*b,this.c=h*p+d*m,this.d=h*y+d*b;break}case te.NoScale:case te.NoScaleOrReflection:{let f=X.cosDeg(t),u=X.sinDeg(t),g=(l*f+o*u)/this.skeleton.scaleX,x=(h*f+d*u)/this.skeleton.scaleY,p=Math.sqrt(g*g+x*x);p>1e-5&&(p=1/p),g*=p,x*=p,p=Math.sqrt(g*g+x*x),this.data.transformMode==te.NoScale&&l*d-o*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let y=Math.PI/2+Math.atan2(x,g),m=Math.cos(y)*p,b=Math.sin(y)*p,w=X.cosDeg(c)*a,v=X.cosDeg(90+n)*r,A=X.sinDeg(c)*a,S=X.sinDeg(90+n)*r;this.a=g*w+m*A,this.b=g*v+m*S,this.c=x*w+b*A,this.d=x*v+b*S;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}getWorldRotationX(){return Math.atan2(this.c,this.a)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.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)}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)*X.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)*X.radDeg;return}let s=e.a,t=e.b,a=e.c,r=e.d,c=1/(s*r-t*a),n=this.worldX-e.worldX,i=this.worldY-e.worldY;this.ax=n*r*c-i*t*c,this.ay=i*s*c-n*a*c;let l=c*r,o=c*s,h=c*t,d=c*a,f=l*this.a-h*this.c,u=l*this.b-h*this.d,g=o*this.c-d*this.a,x=o*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+g*g),this.ascaleX>1e-4){let p=f*x-u*g;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*u+g*x,p)*X.radDeg,this.arotation=Math.atan2(g,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,u)*X.radDeg}worldToLocal(e){let s=1/(this.a*this.d-this.b*this.c),t=e.x-this.worldX,a=e.y-this.worldY;return e.x=t*this.d*s-a*this.b*s,e.y=a*this.a*s-t*this.c*s,e}localToWorld(e){let s=e.x,t=e.y;return e.x=s*this.a+t*this.b+this.worldX,e.y=s*this.c+t*this.d+this.worldY,e}worldToLocalRotation(e){let s=X.sinDeg(e),t=X.cosDeg(e);return Math.atan2(this.a*s-this.c*t,this.d*t-this.b*s)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=X.sinDeg(e),t=X.cosDeg(e);return Math.atan2(t*this.c+s*this.d,t*this.a+s*this.b)*X.radDeg}rotateWorld(e){let s=this.a,t=this.b,a=this.c,r=this.d,c=X.cosDeg(e),n=X.sinDeg(e);this.a=c*s-n*a,this.b=c*t-n*r,this.c=n*s+c*a,this.d=n*t+c*r}},_e=class{constructor(e,s,t){this.name=e,this.order=s,this.skinRequired=t}},Ms=class{constructor(e,s="",t=null){this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=s,this.downloader=t||new ls}start(e){return this.toLoad++,this.pathPrefix+e}success(e,s,t){this.toLoad--,this.loaded++,this.assets[s]=t,e&&e(s,t)}error(e,s,t){this.toLoad--,this.loaded++,this.errors[s]=t,e&&e(s,t)}setRawDataURI(e,s){this.downloader.rawDataUris[this.pathPrefix+e]=s}loadBinary(e,s=null,t=null){e=this.start(e),this.downloader.downloadBinary(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load binary ${e}: status ${a}, ${r}`)})}loadText(e,s=null,t=null){e=this.start(e),this.downloader.downloadText(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load text ${e}: status ${a}, ${r}`)})}loadJson(e,s=null,t=null){e=this.start(e),this.downloader.downloadJson(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load JSON ${e}: status ${a}, ${r}`)})}loadTexture(e,s=null,t=null){if(e=this.start(e),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(e,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(t,e,`Couldn't load image: ${e}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(s,e,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(s,e,this.textureLoader(c))},c.onerror=()=>{this.error(t,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),c.src=e}}loadTextureAtlas(e,s=null,t=null){let a=e.lastIndexOf("/"),r=a>=0?e.substring(0,a+1):"";e=this.start(e),this.downloader.downloadText(e,c=>{try{let n=new rs(c),i=n.pages.length,l=!1;for(let o of n.pages)this.loadTexture(r+o.name,(h,d)=>{l||(o.setTexture(d),--i==0&&this.success(s,e,n))},(h,d)=>{l||this.error(t,e,`Couldn't load texture atlas ${e} page image: ${h}`),l=!0})}catch(n){this.error(t,e,`Couldn't parse texture atlas ${e}: ${n.message}`)}},(c,n)=>{this.error(t,e,`Couldn't load texture atlas ${e}: status ${c}, ${n}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let s=this.assets[e];if(s)return s;let t=this.errors[e];throw Error("Asset not found: "+e+(t?`
2
- `+t:""))}remove(e){e=this.pathPrefix+e;let s=this.assets[e];return s.dispose&&s.dispose(),delete this.assets[e],s}removeAll(){for(let e in this.assets){let s=this.assets[e];s.dispose&&s.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ls=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let s=e.indexOf("base64,");return s!=-1?(s+="base64,".length,atob(e.substr(s))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var s=window.atob(e),t=s.length,a=new Uint8Array(t),r=0;r<t;r++)a[r]=s.charCodeAt(r);return a}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let s=e.indexOf("base64,");if(s==-1)throw new Error("Not a binary data URI.");return s+="base64,".length,this.base64ToUint8Array(e.substr(s))}downloadText(e,s,t){if(this.start(e,s,t))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",e,!0);let r=()=>{this.finish(e,a.status,a.responseText)};a.onload=r,a.onerror=r,a.send()}downloadJson(e,s,t){this.downloadText(e,a=>{s(JSON.parse(a))},t)}downloadBinary(e,s,t){if(this.start(e,s,t))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer";let r=()=>{this.finish(e,a.status,a.response)};a.onload=()=>{a.status==200||a.status==0?this.finish(e,200,new Uint8Array(a.response)):r()},a.onerror=r,a.send()}start(e,s,t){let a=this.callbacks[e];try{if(a)return!0;this.callbacks[e]=a=[]}finally{a.push(s,t)}}finish(e,s,t){let a=this.callbacks[e];delete this.callbacks[e];let r=s==200||s==0?[t]:[s,t];for(let c=r.length-1,n=a.length;c<n;c+=2)a[c].apply(null,r)}},Xt=class{constructor(e,s){if(this.data=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!s)throw new Error("data cannot be null.");this.time=e,this.data=s}},Mt=class{constructor(e){this.name=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=e}},os=class{constructor(e,s){if(this.data=null,this.bones=null,this.target=null,this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch,this.bones=new Array;for(let t=0;t<e.bones.length;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findBone(e.target.name)}isActive(){return this.active}update(){if(this.mix==0)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,s,t,a,r,c,n){let i=e.parent,l=i.a,o=i.b,h=i.c,d=i.d,f=-e.ashearX-e.arotation,u=0,g=0;switch(e.data.transformMode){case te.OnlyTranslation:u=s-e.worldX,g=t-e.worldY;break;case te.NoRotationOrReflection:let y=Math.abs(l*d-o*h)/(l*l+h*h),m=l/e.skeleton.scaleX,b=h/e.skeleton.scaleY;o=-b*y*e.skeleton.scaleX,d=m*y*e.skeleton.scaleY,f+=Math.atan2(b,m)*X.radDeg;default:let w=s-i.worldX,v=t-i.worldY,A=l*d-o*h;u=(w*d-v*o)/A-e.ax,g=(v*l-w*h)/A-e.ay}f+=Math.atan2(g,u)*X.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=e.ascaleX,p=e.ascaleY;if(a||r){switch(e.data.transformMode){case te.NoScale:case te.NoScaleOrReflection:u=s-e.worldX,g=t-e.worldY}let y=e.data.length*x,m=Math.sqrt(u*u+g*g);if(a&&m<y||r&&m>y&&y>1e-4){let b=(m/y-1)*n+1;x*=b,c&&(p*=b)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*n,x,p,e.ashearX,e.ashearY)}apply2(e,s,t,a,r,c,n,i,l){let o=e.ax,h=e.ay,d=e.ascaleX,f=e.ascaleY,u=d,g=f,x=s.ascaleX,p=0,y=0,m=0;d<0?(d=-d,p=180,m=-1):(p=0,m=1),f<0&&(f=-f,m=-m),x<0?(x=-x,y=180):y=0;let b=s.ax,w=0,v=0,A=0,S=e.a,C=e.b,I=e.c,M=e.d,E=Math.abs(d-f)<=1e-4;!E||c?(w=0,v=S*b+e.worldX,A=I*b+e.worldY):(w=s.ay,v=S*b+C*w+e.worldX,A=I*b+M*w+e.worldY);let R=e.parent;S=R.a,C=R.b,I=R.c,M=R.d;let F=1/(S*M-C*I),Y=v-R.worldX,T=A-R.worldY,L=(Y*M-T*C)*F-o,_=(T*S-Y*I)*F-h,P=Math.sqrt(L*L+_*_),U=s.data.length*x,N,H;if(P<1e-4){this.apply1(e,t,a,!1,c,!1,l),s.updateWorldTransformWith(b,w,0,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY);return}Y=t-R.worldX,T=a-R.worldY;let O=(Y*M-T*C)*F-o,V=(T*S-Y*I)*F-h,G=O*O+V*V;if(i!=0){i*=d*(x+1)*.5;let K=Math.sqrt(G),ie=K-P-U*d+i;if(ie>0){let re=Math.min(1,ie/(i*2))-1;re=(ie-i*(1-re*re))/K,O-=re*O,V-=re*V,G=O*O+V*V}}e:if(E){U*=d;let K=(G-P*P-U*U)/(2*P*U);K<-1?(K=-1,H=Math.PI*r):K>1?(K=1,H=0,c&&(S=(Math.sqrt(G)/(P+U)-1)*l+1,u*=S,n&&(g*=S))):H=Math.acos(K)*r,S=P+U*K,C=U*Math.sin(H),N=Math.atan2(V*S-O*C,O*S+V*C)}else{S=d*U,C=f*U;let K=S*S,ie=C*C,re=Math.atan2(V,O);I=ie*P*P+K*G-K*ie;let ye=-2*ie*P,Re=ie-K;if(M=ye*ye-4*Re*I,M>=0){let Be=Math.sqrt(M);ye<0&&(Be=-Be),Be=-(ye+Be)*.5;let bs=Be/Re,ws=I/Be,Ee=Math.abs(bs)<Math.abs(ws)?bs:ws;if(Ee*Ee<=G){T=Math.sqrt(G-Ee*Ee)*r,N=re-Math.atan2(T,Ee),H=Math.atan2(T/f,(Ee-P)/d);break e}}let De=X.PI,Ge=P-S,Ot=Ge*Ge,ms=0,gs=0,$e=P+S,qt=$e*$e,xs=0;I=-S*P/(K-ie),I>=-1&&I<=1&&(I=Math.acos(I),Y=S*Math.cos(I)+P,T=C*Math.sin(I),M=Y*Y+T*T,M<Ot&&(De=I,Ot=M,Ge=Y,ms=T),M>qt&&(gs=I,qt=M,$e=Y,xs=T)),G<=(Ot+qt)*.5?(N=re-Math.atan2(ms*r,Ge),H=De*r):(N=re-Math.atan2(xs*r,$e),H=gs*r)}let Z=Math.atan2(w,b)*m,ce=e.arotation;N=(N-Z)*X.radDeg+p-ce,N>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(o,h,ce+N*l,u,g,0,0),ce=s.arotation,H=((H+Z)*X.radDeg-s.ashearX)*m+y-ce,H>180?H-=360:H<-180&&(H+=360),s.updateWorldTransformWith(b,w,ce+H*l,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}},Ft=class extends _e{constructor(e){super(e,0,!1);this.bones=new Array,this.target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}},Rt=class extends _e{constructor(e){super(e,0,!1);this.bones=new Array,this.target=null,this.positionMode=null,this.spacingMode=null,this.rotateMode=null,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}},fe;(function(e){e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent"})(fe||(fe={}));var Q;(function(e){e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional"})(Q||(Q={}));var Ie;(function(e){e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale"})(Ie||(Ie={}));var xe=class{constructor(e,s){if(this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let t=0,a=e.bones.length;t<a;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findSlot(e.target.name),this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}update(){let e=this.target.getAttachment();if(!(e instanceof Me))return;let s=this.mixRotate,t=this.mixX,a=this.mixY;if(s==0&&t==0&&a==0)return;let r=this.data,c=r.rotateMode==Ie.Tangent,n=r.rotateMode==Ie.ChainScale,i=this.bones,l=i.length,o=c?l:l+1,h=B.setArraySize(this.spaces,o),d=n?this.lengths=B.setArraySize(this.lengths,l):null,f=this.spacing;switch(r.spacingMode){case Q.Percent:if(n)for(let w=0,v=o-1;w<v;w++){let A=i[w],S=A.data.length;if(S<xe.epsilon)d[w]=0;else{let C=S*A.a,I=S*A.c;d[w]=Math.sqrt(C*C+I*I)}}B.arrayFill(h,1,o,f);break;case Q.Proportional:let m=0;for(let w=0,v=o-1;w<v;){let A=i[w],S=A.data.length;if(S<xe.epsilon)n&&(d[w]=0),h[++w]=f;else{let C=S*A.a,I=S*A.c,M=Math.sqrt(C*C+I*I);n&&(d[w]=M),h[++w]=M,m+=M}}if(m>0){m=o/m*f;for(let w=1;w<o;w++)h[w]*=m}break;default:let b=r.spacingMode==Q.Length;for(let w=0,v=o-1;w<v;){let A=i[w],S=A.data.length;if(S<xe.epsilon)n&&(d[w]=0),h[++w]=f;else{let C=S*A.a,I=S*A.c,M=Math.sqrt(C*C+I*I);n&&(d[w]=M),h[++w]=(b?S+f:f)*M/S}}}let u=this.computeWorldPositions(e,o,c),g=u[0],x=u[1],p=r.offsetRotation,y=!1;if(p==0)y=r.rotateMode==Ie.Chain;else{y=!1;let m=this.target.bone;p*=m.a*m.d-m.b*m.c>0?X.degRad:-X.degRad}for(let m=0,b=3;m<l;m++,b+=3){let w=i[m];w.worldX+=(g-w.worldX)*t,w.worldY+=(x-w.worldY)*a;let v=u[b],A=u[b+1],S=v-g,C=A-x;if(n){let I=d[m];if(I!=0){let M=(Math.sqrt(S*S+C*C)/I-1)*s+1;w.a*=M,w.c*=M}}if(g=v,x=A,s>0){let I=w.a,M=w.b,E=w.c,R=w.d,F=0,Y=0,T=0;if(c?F=u[b-1]:h[m+1]==0?F=u[b+2]:F=Math.atan2(C,S),F-=Math.atan2(E,I),y){Y=Math.cos(F),T=Math.sin(F);let L=w.data.length;g+=(L*(Y*I-T*E)-S)*s,x+=(L*(T*I+Y*E)-C)*s}else F+=p;F>X.PI?F-=X.PI2:F<-X.PI&&(F+=X.PI2),F*=s,Y=Math.cos(F),T=Math.sin(F),w.a=Y*I-T*E,w.b=Y*M-T*R,w.c=T*I+Y*E,w.d=T*M+Y*R}w.updateAppliedTransform()}}computeWorldPositions(e,s,t){let a=this.target,r=this.position,c=this.spaces,n=B.setArraySize(this.positions,s*3+2),i=null,l=e.closed,o=e.worldVerticesLength,h=o/6,d=xe.NONE;if(!e.constantSpeed){let _=e.lengths;h-=l?1:2;let P=_[h];this.data.positionMode==fe.Percent&&(r*=P);let U;switch(this.data.spacingMode){case Q.Percent:U=P;break;case Q.Proportional:U=P/s;break;default:U=1}i=B.setArraySize(this.world,8);for(let N=0,H=0,O=0;N<s;N++,H+=3){let V=c[N]*U;r+=V;let G=r;if(l)G%=P,G<0&&(G+=P),O=0;else if(G<0){d!=xe.BEFORE&&(d=xe.BEFORE,e.computeWorldVertices(a,2,4,i,0,2)),this.addBeforePosition(G,i,0,n,H);continue}else if(G>P){d!=xe.AFTER&&(d=xe.AFTER,e.computeWorldVertices(a,o-6,4,i,0,2)),this.addAfterPosition(G-P,i,0,n,H);continue}for(;;O++){let Z=_[O];if(!(G>Z)){if(O==0)G/=Z;else{let ce=_[O-1];G=(G-ce)/(Z-ce)}break}}O!=d&&(d=O,l&&O==h?(e.computeWorldVertices(a,o-4,4,i,0,2),e.computeWorldVertices(a,0,4,i,4,2)):e.computeWorldVertices(a,O*6+2,8,i,0,2)),this.addCurvePosition(G,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],n,H,t||N>0&&V==0)}return n}l?(o+=2,i=B.setArraySize(this.world,o),e.computeWorldVertices(a,2,o-4,i,0,2),e.computeWorldVertices(a,0,2,i,o-4,2),i[o-2]=i[0],i[o-1]=i[1]):(h--,o-=4,i=B.setArraySize(this.world,o),e.computeWorldVertices(a,2,o,i,0,2));let f=B.setArraySize(this.curves,h),u=0,g=i[0],x=i[1],p=0,y=0,m=0,b=0,w=0,v=0,A=0,S=0,C=0,I=0,M=0,E=0,R=0,F=0;for(let _=0,P=2;_<h;_++,P+=6)p=i[P],y=i[P+1],m=i[P+2],b=i[P+3],w=i[P+4],v=i[P+5],A=(g-p*2+m)*.1875,S=(x-y*2+b)*.1875,C=((p-m)*3-g+w)*.09375,I=((y-b)*3-x+v)*.09375,M=A*2+C,E=S*2+I,R=(p-g)*.75+A+C*.16666667,F=(y-x)*.75+S+I*.16666667,u+=Math.sqrt(R*R+F*F),R+=M,F+=E,M+=C,E+=I,u+=Math.sqrt(R*R+F*F),R+=M,F+=E,u+=Math.sqrt(R*R+F*F),R+=M+C,F+=E+I,u+=Math.sqrt(R*R+F*F),f[_]=u,g=w,x=v;this.data.positionMode==fe.Percent&&(r*=u);let Y;switch(this.data.spacingMode){case Q.Percent:Y=u;break;case Q.Proportional:Y=u/s;break;default:Y=1}let T=this.segments,L=0;for(let _=0,P=0,U=0,N=0;_<s;_++,P+=3){let H=c[_]*Y;r+=H;let O=r;if(l)O%=u,O<0&&(O+=u),U=0;else if(O<0){this.addBeforePosition(O,i,0,n,P);continue}else if(O>u){this.addAfterPosition(O-u,i,o-4,n,P);continue}for(;;U++){let V=f[U];if(!(O>V)){if(U==0)O/=V;else{let G=f[U-1];O=(O-G)/(V-G)}break}}if(U!=d){d=U;let V=U*6;for(g=i[V],x=i[V+1],p=i[V+2],y=i[V+3],m=i[V+4],b=i[V+5],w=i[V+6],v=i[V+7],A=(g-p*2+m)*.03,S=(x-y*2+b)*.03,C=((p-m)*3-g+w)*.006,I=((y-b)*3-x+v)*.006,M=A*2+C,E=S*2+I,R=(p-g)*.3+A+C*.16666667,F=(y-x)*.3+S+I*.16666667,L=Math.sqrt(R*R+F*F),T[0]=L,V=1;V<8;V++)R+=M,F+=E,M+=C,E+=I,L+=Math.sqrt(R*R+F*F),T[V]=L;R+=M,F+=E,L+=Math.sqrt(R*R+F*F),T[8]=L,R+=M+C,F+=E+I,L+=Math.sqrt(R*R+F*F),T[9]=L,N=0}for(O*=L;;N++){let V=T[N];if(!(O>V)){if(N==0)O/=V;else{let G=T[N-1];O=N+(O-G)/(V-G)}break}}this.addCurvePosition(O*.1,g,x,p,y,m,b,w,v,n,P,t||_>0&&H==0)}return n}addBeforePosition(e,s,t,a,r){let c=s[t],n=s[t+1],i=s[t+2]-c,l=s[t+3]-n,o=Math.atan2(l,i);a[r]=c+e*Math.cos(o),a[r+1]=n+e*Math.sin(o),a[r+2]=o}addAfterPosition(e,s,t,a,r){let c=s[t+2],n=s[t+3],i=c-s[t],l=n-s[t+1],o=Math.atan2(l,i);a[r]=c+e*Math.cos(o),a[r+1]=n+e*Math.sin(o),a[r+2]=o}addCurvePosition(e,s,t,a,r,c,n,i,l,o,h,d){if(e==0||isNaN(e)){o[h]=s,o[h+1]=t,o[h+2]=Math.atan2(r-t,a-s);return}let f=e*e,u=f*e,g=1-e,x=g*g,p=x*g,y=g*e,m=y*3,b=g*m,w=m*e,v=s*p+a*b+c*w+i*u,A=t*p+r*b+n*w+l*u;o[h]=v,o[h+1]=A,d&&(e<.001?o[h+2]=Math.atan2(r-t,a-s):o[h+2]=Math.atan2(A-(t*x+r*y*2+n*f),v-(s*x+a*y*2+c*f)))}},Fe=xe;Fe.NONE=-1,Fe.BEFORE=-2,Fe.AFTER=-3,Fe.epsilon=1e-5;var hs=class{constructor(e,s){if(this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentState=0,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!s)throw new Error("bone cannot be null.");this.data=e,this.bone=s,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 ae)||!(this.attachment instanceof ae)||e.timelineAttahment!=this.attachment.timelineAttahment)&&(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}},cs=class{constructor(e,s){if(this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new jt,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(let t=0;t<e.bones.length;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findBone(e.target.name)}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleX==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,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=s!=0||t!=0,i=this.target,l=i.a,o=i.b,h=i.c,d=i.d,f=l*d-o*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,g=this.data.offsetShearY*f,x=this.bones;for(let p=0,y=x.length;p<y;p++){let m=x[p];if(e!=0){let b=m.a,w=m.b,v=m.c,A=m.d,S=Math.atan2(h,l)-Math.atan2(v,b)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let C=Math.cos(S),I=Math.sin(S);m.a=C*b-I*v,m.b=C*w-I*A,m.c=I*b+C*v,m.d=I*w+C*A}if(n){let b=this.temp;i.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(b.x-m.worldX)*s,m.worldY+=(b.y-m.worldY)*t}if(a!=0){let b=Math.sqrt(m.a*m.a+m.c*m.c);b!=0&&(b=(b+(Math.sqrt(l*l+h*h)-b+this.data.offsetScaleX)*a)/b),m.a*=b,m.c*=b}if(r!=0){let b=Math.sqrt(m.b*m.b+m.d*m.d);b!=0&&(b=(b+(Math.sqrt(o*o+d*d)-b+this.data.offsetScaleY)*r)/b),m.b*=b,m.d*=b}if(c>0){let b=m.b,w=m.d,v=Math.atan2(w,b),A=Math.atan2(d,o)-Math.atan2(h,l)-(v-Math.atan2(m.c,m.a));A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A=v+(A+g)*c;let S=Math.sqrt(b*b+w*w);m.b=Math.cos(A)*S,m.d=Math.sin(A)*S}m.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=s!=0||t!=0,i=this.target,l=i.a,o=i.b,h=i.c,d=i.d,f=l*d-o*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,g=this.data.offsetShearY*f,x=this.bones;for(let p=0,y=x.length;p<y;p++){let m=x[p];if(e!=0){let b=m.a,w=m.b,v=m.c,A=m.d,S=Math.atan2(h,l)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let C=Math.cos(S),I=Math.sin(S);m.a=C*b-I*v,m.b=C*w-I*A,m.c=I*b+C*v,m.d=I*w+C*A}if(n){let b=this.temp;i.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),m.worldX+=b.x*s,m.worldY+=b.y*t}if(a!=0){let b=(Math.sqrt(l*l+h*h)-1+this.data.offsetScaleX)*a+1;m.a*=b,m.c*=b}if(r!=0){let b=(Math.sqrt(o*o+d*d)-1+this.data.offsetScaleY)*r+1;m.b*=b,m.d*=b}if(c>0){let b=Math.atan2(d,o)-Math.atan2(h,l);b>X.PI?b-=X.PI2:b<-X.PI&&(b+=X.PI2);let w=m.b,v=m.d;b=Math.atan2(v,w)+(b-X.PI/2+g)*c;let A=Math.sqrt(w*w+v*v);m.b=Math.cos(b)*A,m.d=Math.sin(b)*A}m.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,i=this.bones;for(let l=0,o=i.length;l<o;l++){let h=i[l],d=h.arotation;if(e!=0){let y=n.arotation-d+this.data.offsetRotation;y-=(16384-(16384.499999999996-y/360|0))*360,d+=y*e}let f=h.ax,u=h.ay;f+=(n.ax-f+this.data.offsetX)*s,u+=(n.ay-u+this.data.offsetY)*t;let g=h.ascaleX,x=h.ascaleY;a!=0&&g!=0&&(g=(g+(n.ascaleX-g+this.data.offsetScaleX)*a)/g),r!=0&&x!=0&&(x=(x+(n.ascaleY-x+this.data.offsetScaleY)*r)/x);let p=h.ashearY;if(c!=0){let y=n.ashearY-p+this.data.offsetShearY;y-=(16384-(16384.499999999996-y/360|0))*360,p+=y*c}h.updateWorldTransformWith(f,u,d,g,x,h.ashearX,p)}}applyRelativeLocal(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,i=this.bones;for(let l=0,o=i.length;l<o;l++){let h=i[l],d=h.arotation+(n.arotation+this.data.offsetRotation)*e,f=h.ax+(n.ax+this.data.offsetX)*s,u=h.ay+(n.ay+this.data.offsetY)*t,g=h.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*a+1),x=h.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*r+1),p=h.ashearY+(n.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,u,d,g,x,h.ashearX,p)}}},Fs=class{constructor(e){if(this.data=null,this.bones=null,this.slots=null,this.drawOrder=null,this.ikConstraints=null,this.transformConstraints=null,this.pathConstraints=null,this._updateCache=new Array,this.skin=null,this.color=null,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let s=0;s<e.bones.length;s++){let t=e.bones[s],a;if(!t.parent)a=new Tt(t,this,null);else{let r=this.bones[t.parent.index];a=new Tt(t,this,r),r.children.push(a)}this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<e.slots.length;s++){let t=e.slots[s],a=this.bones[t.boneData.index],r=new hs(t,a);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let s=0;s<e.ikConstraints.length;s++){let t=e.ikConstraints[s];this.ikConstraints.push(new os(t,this))}this.transformConstraints=new Array;for(let s=0;s<e.transformConstraints.length;s++){let t=e.transformConstraints[s];this.transformConstraints.push(new cs(t,this))}this.pathConstraints=new Array;for(let s=0;s<e.pathConstraints.length;s++){let t=e.pathConstraints[s];this.pathConstraints.push(new Fe(t,this))}this.color=new D(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let s=this.bones;for(let o=0,h=s.length;o<h;o++){let d=s[o];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let o=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let f=this.bones[o[h].index];do f.sorted=!1,f.active=!0,f=f.parent;while(f)}}let t=this.ikConstraints,a=this.transformConstraints,r=this.pathConstraints,c=t.length,n=a.length,i=r.length,l=c+n+i;e:for(let o=0;o<l;o++){for(let h=0;h<c;h++){let d=t[h];if(d.data.order==o){this.sortIkConstraint(d);continue e}}for(let h=0;h<n;h++){let d=a[h];if(d.data.order==o){this.sortTransformConstraint(d);continue e}}for(let h=0;h<i;h++){let d=r[h];if(d.data.order==o){this.sortPathConstraint(d);continue e}}}for(let o=0,h=s.length;o<h;o++)this.sortBone(s[o])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target;this.sortBone(s);let t=e.bones,a=t[0];if(this.sortBone(a),t.length==1)this._updateCache.push(e),this.sortReset(a.children);else{let r=t[t.length-1];this.sortBone(r),this._updateCache.push(e),this.sortReset(a.children),r.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target,t=s.data.index,a=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,t,a),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,t,a);for(let i=0,l=this.data.skins.length;i<l;i++)this.sortPathConstraintAttachment(this.data.skins[i],t,a);let r=s.getAttachment();r instanceof Me&&this.sortPathConstraintAttachmentWith(r,a);let c=e.bones,n=c.length;for(let i=0;i<n;i++)this.sortBone(c[i]);this._updateCache.push(e);for(let i=0;i<n;i++)this.sortReset(c[i].children);for(let i=0;i<n;i++)c[i].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let s=e.bones,t=s.length;if(e.data.local)for(let a=0;a<t;a++){let r=s[a];this.sortBone(r.parent),this.sortBone(r)}else for(let a=0;a<t;a++)this.sortBone(s[a]);this._updateCache.push(e);for(let a=0;a<t;a++)this.sortReset(s[a].children);for(let a=0;a<t;a++)s[a].sorted=!0}sortPathConstraintAttachment(e,s,t){let a=e.attachments[s];if(!!a)for(let r in a)this.sortPathConstraintAttachmentWith(a[r],t)}sortPathConstraintAttachmentWith(e,s){if(!(e instanceof Me))return;let t=e.bones;if(!t)this.sortBone(s);else{let a=this.bones;for(let r=0,c=t.length;r<c;){let n=t[r++];for(n+=r;r<n;)this.sortBone(a[t[r++]])}}}sortBone(e){if(e.sorted)return;let s=e.parent;s&&this.sortBone(s),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let s=0,t=e.length;s<t;s++){let a=e[s];!a.active||(a.sorted&&this.sortReset(a.children),a.sorted=!1)}}updateWorldTransform(){let e=this.bones;for(let t=0,a=e.length;t<a;t++){let r=e[t];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let s=this._updateCache;for(let t=0,a=s.length;t<a;t++)s[t].update()}updateWorldTransformWith(e){let s=this.getRootBone(),t=e.a,a=e.b,r=e.c,c=e.d;s.worldX=t*this.x+a*this.y+e.worldX,s.worldY=r*this.x+c*this.y+e.worldY;let n=s.rotation+90+s.shearY,i=X.cosDeg(s.rotation+s.shearX)*s.scaleX,l=X.cosDeg(n)*s.scaleY,o=X.sinDeg(s.rotation+s.shearX)*s.scaleX,h=X.sinDeg(n)*s.scaleY;s.a=(t*i+a*o)*this.scaleX,s.b=(t*l+a*h)*this.scaleX,s.c=(r*i+c*o)*this.scaleY,s.d=(r*l+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,u=d.length;f<u;f++){let g=d[f];g!=s&&g.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let e=this.bones;for(let r=0,c=e.length;r<c;r++)e[r].setToSetupPose();let s=this.ikConstraints;for(let r=0,c=s.length;r<c;r++){let n=s[r];n.mix=n.data.mix,n.softness=n.data.softness,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch}let t=this.transformConstraints;for(let r=0,c=t.length;r<c;r++){let n=t[r],i=n.data;n.mixRotate=i.mixRotate,n.mixX=i.mixX,n.mixY=i.mixY,n.mixScaleX=i.mixScaleX,n.mixScaleY=i.mixScaleY,n.mixShearY=i.mixShearY}let a=this.pathConstraints;for(let r=0,c=a.length;r<c;r++){let n=a[r],i=n.data;n.position=i.position,n.spacing=i.spacing,n.mixRotate=i.mixRotate,n.mixX=i.mixX,n.mixY=i.mixY}}setSlotsToSetupPose(){let e=this.slots;B.arrayCopy(e,0,this.drawOrder,0,e.length);for(let s=0,t=e.length;s<t;s++)e[s].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let s=this.bones;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}setSkinByName(e){let s=this.data.findSkin(e);if(!s)throw new Error("Skin not found: "+e);this.setSkin(s)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t],c=r.data.attachmentName;if(c){let n=e.getAttachment(t,c);n&&r.setAttachment(n)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,s){return this.getAttachment(this.data.findSlot(e).index,s)}getAttachment(e,s){if(!s)throw new Error("attachmentName cannot be null.");if(this.skin){let t=this.skin.getAttachment(e,s);if(t)return t}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,s):null}setAttachment(e,s){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let a=0,r=t.length;a<r;a++){let c=t[a];if(c.data.name==e){let n=null;if(s&&(n=this.getAttachment(a,s),!n))throw new Error("Attachment not found: "+s+", for slot: "+e);c.setAttachment(n);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.ikConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.transformConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.pathConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}getBounds(e,s,t=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!s)throw new Error("size cannot be null.");let a=this.drawOrder,r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let l=0,o=a.length;l<o;l++){let h=a[l];if(!h.bone.active)continue;let d=0,f=null,u=h.getAttachment();if(u instanceof W)d=8,f=B.setArraySize(t,d,0),u.computeWorldVertices(h,f,0,2);else if(u instanceof Xe){let g=u;d=g.worldVerticesLength,f=B.setArraySize(t,d,0),g.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let g=0,x=f.length;g<x;g+=2){let p=f[g],y=f[g+1];r=Math.min(r,p),c=Math.min(c,y),n=Math.max(n,p),i=Math.max(i,y)}}e.set(r,c),s.set(n-r,i-c)}},Bt=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(e){if(!e)throw new Error("boneName cannot be null.");let s=this.bones;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let s=this.skins;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let s=this.events;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let s=this.animations;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.ikConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.transformConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.pathConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}},Et=class{constructor(e=0,s=null,t=null){this.slotIndex=e,this.name=s,this.attachment=t}},He=class{constructor(e){if(this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,s,t){if(!t)throw new Error("attachment cannot be null.");let a=this.attachments;e>=a.length&&(a.length=e+1),a[e]||(a[e]={}),a[e][s]=t}addSkin(e){for(let a=0;a<e.bones.length;a++){let r=e.bones[a],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<e.constraints.length;a++){let r=e.constraints[a],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let s=e.getAttachments();for(let a=0;a<s.length;a++){var t=s[a];this.setAttachment(t.slotIndex,t.name,t.attachment)}}copySkin(e){for(let a=0;a<e.bones.length;a++){let r=e.bones[a],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<e.constraints.length;a++){let r=e.constraints[a],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let s=e.getAttachments();for(let a=0;a<s.length;a++){var t=s[a];!t.attachment||(t.attachment instanceof Xe?(t.attachment=t.attachment.newLinkedMesh(),this.setAttachment(t.slotIndex,t.name,t.attachment)):(t.attachment=t.attachment.copy(),this.setAttachment(t.slotIndex,t.name,t.attachment)))}}getAttachment(e,s){let t=this.attachments[e];return t?t[s]:null}removeAttachment(e,s){let t=this.attachments[e];t&&(t[s]=null)}getAttachments(){let e=new Array;for(var s=0;s<this.attachments.length;s++){let t=this.attachments[s];if(t)for(let a in t){let r=t[a];r&&e.push(new Et(s,a,r))}}return e}getAttachmentsForSlot(e,s){let t=this.attachments[e];if(t)for(let a in t){let r=t[a];r&&s.push(new Et(e,a,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,s){let t=0;for(let a=0;a<e.slots.length;a++){let r=e.slots[a],c=r.getAttachment();if(c&&t<s.attachments.length){let n=s.attachments[t];for(let i in n){let l=n[i];if(c==l){let o=this.getAttachment(t,i);o&&r.setAttachment(o);break}}}t++}}},Pt=class{constructor(e,s,t){if(this.index=0,this.name=null,this.boneData=null,this.color=new D(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=null,e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");if(!t)throw new Error("boneData cannot be null.");this.index=e,this.name=s,this.boneData=t}},je;(function(e){e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"})(je||(je={}));var Lt=class extends _e{constructor(e){super(e,0,!1);this.bones=new Array,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}},Rs=class{constructor(e){this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let s=this.scale,t=new Bt;t.name="";let a=new ds(e),r=a.readInt32(),c=a.readInt32();t.hash=c==0&&r==0?null:c.toString(16)+r.toString(16),t.version=a.readString(),t.x=a.readFloat(),t.y=a.readFloat(),t.width=a.readFloat(),t.height=a.readFloat();let n=a.readBoolean();n&&(t.fps=a.readFloat(),t.imagesPath=a.readString(),t.audioPath=a.readString());let i=0;i=a.readInt(!0);for(let o=0;o<i;o++)a.strings.push(a.readString());i=a.readInt(!0);for(let o=0;o<i;o++){let h=a.readString(),d=o==0?null:t.bones[a.readInt(!0)],f=new Ct(o,h,d);f.rotation=a.readFloat(),f.x=a.readFloat()*s,f.y=a.readFloat()*s,f.scaleX=a.readFloat(),f.scaleY=a.readFloat(),f.shearX=a.readFloat(),f.shearY=a.readFloat(),f.length=a.readFloat()*s,f.transformMode=a.readInt(!0),f.skinRequired=a.readBoolean(),n&&D.rgba8888ToColor(f.color,a.readInt32()),t.bones.push(f)}i=a.readInt(!0);for(let o=0;o<i;o++){let h=a.readString(),d=t.bones[a.readInt(!0)],f=new Pt(o,h,d);D.rgba8888ToColor(f.color,a.readInt32());let u=a.readInt32();u!=-1&&D.rgb888ToColor(f.darkColor=new D,u),f.attachmentName=a.readStringRef(),f.blendMode=a.readInt(!0),t.slots.push(f)}i=a.readInt(!0);for(let o=0,h;o<i;o++){let d=new Ft(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(t.bones[a.readInt(!0)]);d.target=t.bones[a.readInt(!0)],d.mix=a.readFloat(),d.softness=a.readFloat()*s,d.bendDirection=a.readByte(),d.compress=a.readBoolean(),d.stretch=a.readBoolean(),d.uniform=a.readBoolean(),t.ikConstraints.push(d)}i=a.readInt(!0);for(let o=0,h;o<i;o++){let d=new Lt(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(t.bones[a.readInt(!0)]);d.target=t.bones[a.readInt(!0)],d.local=a.readBoolean(),d.relative=a.readBoolean(),d.offsetRotation=a.readFloat(),d.offsetX=a.readFloat()*s,d.offsetY=a.readFloat()*s,d.offsetScaleX=a.readFloat(),d.offsetScaleY=a.readFloat(),d.offsetShearY=a.readFloat(),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),d.mixScaleX=a.readFloat(),d.mixScaleY=a.readFloat(),d.mixShearY=a.readFloat(),t.transformConstraints.push(d)}i=a.readInt(!0);for(let o=0,h;o<i;o++){let d=new Rt(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(t.bones[a.readInt(!0)]);d.target=t.slots[a.readInt(!0)],d.positionMode=a.readInt(!0),d.spacingMode=a.readInt(!0),d.rotateMode=a.readInt(!0),d.offsetRotation=a.readFloat(),d.position=a.readFloat(),d.positionMode==fe.Fixed&&(d.position*=s),d.spacing=a.readFloat(),(d.spacingMode==Q.Length||d.spacingMode==Q.Fixed)&&(d.spacing*=s),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),t.pathConstraints.push(d)}let l=this.readSkin(a,t,!0,n);l&&(t.defaultSkin=l,t.skins.push(l));{let o=t.skins.length;for(B.setArraySize(t.skins,i=o+a.readInt(!0));o<i;o++)t.skins[o]=this.readSkin(a,t,!1,n)}i=this.linkedMeshes.length;for(let o=0;o<i;o++){let h=this.linkedMeshes[o],f=(h.skin?t.findSkin(h.skin):t.defaultSkin).getAttachment(h.slotIndex,h.parent);h.mesh.timelineAttahment=h.inheritTimeline?f:h.mesh,h.mesh.setParentMesh(f),h.mesh.region!=null&&h.mesh.updateRegion()}this.linkedMeshes.length=0,i=a.readInt(!0);for(let o=0;o<i;o++){let h=new Mt(a.readStringRef());h.intValue=a.readInt(!1),h.floatValue=a.readFloat(),h.stringValue=a.readString(),h.audioPath=a.readString(),h.audioPath&&(h.volume=a.readFloat(),h.balance=a.readFloat()),t.events.push(h)}i=a.readInt(!0);for(let o=0;o<i;o++)t.animations.push(this.readAnimation(a,a.readString(),t));return t}readSkin(e,s,t,a){let r=null,c=0;if(t){if(c=e.readInt(!0),c==0)return null;r=new He("default")}else{r=new He(e.readStringRef()),r.bones.length=e.readInt(!0);for(let n=0,i=r.bones.length;n<i;n++)r.bones[n]=s.bones[e.readInt(!0)];for(let n=0,i=e.readInt(!0);n<i;n++)r.constraints.push(s.ikConstraints[e.readInt(!0)]);for(let n=0,i=e.readInt(!0);n<i;n++)r.constraints.push(s.transformConstraints[e.readInt(!0)]);for(let n=0,i=e.readInt(!0);n<i;n++)r.constraints.push(s.pathConstraints[e.readInt(!0)]);c=e.readInt(!0)}for(let n=0;n<c;n++){let i=e.readInt(!0);for(let l=0,o=e.readInt(!0);l<o;l++){let h=e.readStringRef(),d=this.readAttachment(e,s,r,i,h,a);d&&r.setAttachment(i,h,d)}}return r}readAttachment(e,s,t,a,r,c){let n=this.scale,i=e.readStringRef();switch(i||(i=r),e.readByte()){case be.Region:{let l=e.readStringRef(),o=e.readFloat(),h=e.readFloat(),d=e.readFloat(),f=e.readFloat(),u=e.readFloat(),g=e.readFloat(),x=e.readFloat(),p=e.readInt32(),y=this.readSequence(e);l||(l=i);let m=this.attachmentLoader.newRegionAttachment(t,i,l,y);return m?(m.path=l,m.x=h*n,m.y=d*n,m.scaleX=f,m.scaleY=u,m.rotation=o,m.width=g*n,m.height=x*n,D.rgba8888ToColor(m.color,p),m.sequence=y,y==null&&m.updateRegion(),m):null}case be.BoundingBox:{let l=e.readInt(!0),o=this.readVertices(e,l),h=c?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(t,i);return d?(d.worldVerticesLength=l<<1,d.vertices=o.vertices,d.bones=o.bones,c&&D.rgba8888ToColor(d.color,h),d):null}case be.Mesh:{let l=e.readStringRef(),o=e.readInt32(),h=e.readInt(!0),d=this.readFloatArray(e,h<<1,1),f=this.readShortArray(e),u=this.readVertices(e,h),g=e.readInt(!0),x=this.readSequence(e),p=null,y=0,m=0;c&&(p=this.readShortArray(e),y=e.readFloat(),m=e.readFloat()),l||(l=i);let b=this.attachmentLoader.newMeshAttachment(t,i,l,x);return b?(b.path=l,D.rgba8888ToColor(b.color,o),b.bones=u.bones,b.vertices=u.vertices,b.worldVerticesLength=h<<1,b.triangles=f,b.regionUVs=d,x==null&&b.updateRegion(),b.hullLength=g<<1,b.sequence=x,c&&(b.edges=p,b.width=y*n,b.height=m*n),b):null}case be.LinkedMesh:{let l=e.readStringRef(),o=e.readInt32(),h=e.readStringRef(),d=e.readStringRef(),f=e.readBoolean(),u=this.readSequence(e),g=0,x=0;c&&(g=e.readFloat(),x=e.readFloat()),l||(l=i);let p=this.attachmentLoader.newMeshAttachment(t,i,l,u);return p?(p.path=l,D.rgba8888ToColor(p.color,o),p.sequence=u,c&&(p.width=g*n,p.height=x*n),this.linkedMeshes.push(new Bs(p,h,a,d,f)),p):null}case be.Path:{let l=e.readBoolean(),o=e.readBoolean(),h=e.readInt(!0),d=this.readVertices(e,h),f=B.newArray(h/3,0);for(let x=0,p=f.length;x<p;x++)f[x]=e.readFloat()*n;let u=c?e.readInt32():0,g=this.attachmentLoader.newPathAttachment(t,i);return g?(g.closed=l,g.constantSpeed=o,g.worldVerticesLength=h<<1,g.vertices=d.vertices,g.bones=d.bones,g.lengths=f,c&&D.rgba8888ToColor(g.color,u),g):null}case be.Point:{let l=e.readFloat(),o=e.readFloat(),h=e.readFloat(),d=c?e.readInt32():0,f=this.attachmentLoader.newPointAttachment(t,i);return f?(f.x=o*n,f.y=h*n,f.rotation=l,c&&D.rgba8888ToColor(f.color,d),f):null}case be.Clipping:{let l=e.readInt(!0),o=e.readInt(!0),h=this.readVertices(e,o),d=c?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(t,i);return f?(f.endSlot=s.slots[l],f.worldVerticesLength=o<<1,f.vertices=h.vertices,f.bones=h.bones,c&&D.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){if(!e.readBoolean())return null;let s=new Ke(e.readInt(!0));return s.start=e.readInt(!0),s.digits=e.readInt(!0),s.setupIndex=e.readInt(!0),s}readVertices(e,s){let t=this.scale,a=s<<1,r=new Es;if(!e.readBoolean())return r.vertices=this.readFloatArray(e,a,t),r;let c=new Array,n=new Array;for(let i=0;i<s;i++){let l=e.readInt(!0);n.push(l);for(let o=0;o<l;o++)n.push(e.readInt(!0)),c.push(e.readFloat()*t),c.push(e.readFloat()*t),c.push(e.readFloat())}return r.vertices=B.toFloatArray(c),r.bones=n,r}readFloatArray(e,s,t){let a=new Array(s);if(t==1)for(let r=0;r<s;r++)a[r]=e.readFloat();else for(let r=0;r<s;r++)a[r]=e.readFloat()*t;return a}readShortArray(e){let s=e.readInt(!0),t=new Array(s);for(let a=0;a<s;a++)t[a]=e.readShort();return t}readAnimation(e,s,t){e.readInt(!0);let a=new Array,r=this.scale,c=new D,n=new D;for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readByte(),p=e.readInt(!0),y=p-1;switch(x){case _s:{let m=new Se(p,f);for(let b=0;b<p;b++)m.setFrame(b,e.readFloat(),e.readStringRef());a.push(m);break}case Hs:{let m=e.readInt(!0),b=new ot(p,m,f),w=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255;for(let I=0,M=0;b.setFrame(I,w,v,A,S,C),I!=y;I++){let E=e.readFloat(),R=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255;switch(e.readByte()){case oe:b.setStepped(I);break;case he:q(e,b,M++,I,0,w,E,v,R,1),q(e,b,M++,I,1,w,E,A,F,1),q(e,b,M++,I,2,w,E,S,Y,1),q(e,b,M++,I,3,w,E,C,T,1)}w=E,v=R,A=F,S=Y,C=T}a.push(b);break}case js:{let m=e.readInt(!0),b=new ht(p,m,f),w=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255;for(let C=0,I=0;b.setFrame(C,w,v,A,S),C!=y;C++){let M=e.readFloat(),E=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255;switch(e.readByte()){case oe:b.setStepped(C);break;case he:q(e,b,I++,C,0,w,M,v,E,1),q(e,b,I++,C,1,w,M,A,R,1),q(e,b,I++,C,2,w,M,S,F,1)}w=M,v=E,A=R,S=F}a.push(b);break}case Gs:{let m=e.readInt(!0),b=new dt(p,m,f),w=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;for(let R=0,F=0;b.setFrame(R,w,v,A,S,C,I,M,E),R!=y;R++){let Y=e.readFloat(),T=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,N=e.readUnsignedByte()/255,H=e.readUnsignedByte()/255;switch(e.readByte()){case oe:b.setStepped(R);break;case he:q(e,b,F++,R,0,w,Y,v,T,1),q(e,b,F++,R,1,w,Y,A,L,1),q(e,b,F++,R,2,w,Y,S,_,1),q(e,b,F++,R,3,w,Y,C,P,1),q(e,b,F++,R,4,w,Y,I,U,1),q(e,b,F++,R,5,w,Y,M,N,1),q(e,b,F++,R,6,w,Y,E,H,1)}w=Y,v=T,A=L,S=_,C=P,I=U,M=N,E=H}a.push(b);break}case $s:{let m=e.readInt(!0),b=new ft(p,m,f),w=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let E=0,R=0;b.setFrame(E,w,v,A,S,C,I,M),E!=y;E++){let F=e.readFloat(),Y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255;switch(e.readByte()){case oe:b.setStepped(E);break;case he:q(e,b,R++,E,0,w,F,v,Y,1),q(e,b,R++,E,1,w,F,A,T,1),q(e,b,R++,E,2,w,F,S,L,1),q(e,b,R++,E,3,w,F,C,_,1),q(e,b,R++,E,4,w,F,I,P,1),q(e,b,R++,E,5,w,F,M,U,1)}w=F,v=Y,A=T,S=L,C=_,I=P,M=U}a.push(b);break}case Js:{let m=new ct(p,e.readInt(!0),f),b=e.readFloat(),w=e.readUnsignedByte()/255;for(let v=0,A=0;m.setFrame(v,b,w),v!=y;v++){let S=e.readFloat(),C=e.readUnsignedByte()/255;switch(e.readByte()){case oe:m.setStepped(v);break;case he:q(e,m,A++,v,0,b,S,w,C,1)}b=S,w=C}a.push(m)}}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readByte(),p=e.readInt(!0),y=e.readInt(!0);switch(x){case Ps:a.push(we(e,new Le(p,y,f),1));break;case Ls:a.push(Vt(e,new Ze(p,y,f),r));break;case Vs:a.push(we(e,new et(p,y,f),r));break;case Ds:a.push(we(e,new tt(p,y,f),r));break;case Ns:a.push(Vt(e,new st(p,y,f),1));break;case Os:a.push(we(e,new it(p,y,f),1));break;case qs:a.push(we(e,new rt(p,y,f),1));break;case Us:a.push(Vt(e,new at(p,y,f),1));break;case Ws:a.push(we(e,new nt(p,y,f),1));break;case zs:a.push(we(e,new lt(p,y,f),1))}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),g=u-1,x=new mt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),m=e.readFloat()*r;for(let b=0,w=0;x.setFrame(b,p,y,m,e.readByte(),e.readBoolean(),e.readBoolean()),b!=g;b++){let v=e.readFloat(),A=e.readFloat(),S=e.readFloat()*r;switch(e.readByte()){case oe:x.setStepped(b);break;case he:q(e,x,w++,b,0,p,v,y,A,1),q(e,x,w++,b,1,p,v,m,S,r)}p=v,y=A,m=S}a.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),g=u-1,x=new gt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),m=e.readFloat(),b=e.readFloat(),w=e.readFloat(),v=e.readFloat(),A=e.readFloat();for(let S=0,C=0;x.setFrame(S,p,y,m,b,w,v,A),S!=g;S++){let I=e.readFloat(),M=e.readFloat(),E=e.readFloat(),R=e.readFloat(),F=e.readFloat(),Y=e.readFloat(),T=e.readFloat();switch(e.readByte()){case oe:x.setStepped(S);break;case he:q(e,x,C++,S,0,p,I,y,M,1),q(e,x,C++,S,1,p,I,m,E,1),q(e,x,C++,S,2,p,I,b,R,1),q(e,x,C++,S,3,p,I,w,F,1),q(e,x,C++,S,4,p,I,v,Y,1),q(e,x,C++,S,5,p,I,A,T,1)}p=I,y=M,m=E,b=R,w=F,v=Y,A=T}a.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=t.pathConstraints[f];for(let g=0,x=e.readInt(!0);g<x;g++)switch(e.readByte()){case Zs:a.push(we(e,new xt(e.readInt(!0),e.readInt(!0),f),u.positionMode==fe.Fixed?r:1));break;case ei:a.push(we(e,new bt(e.readInt(!0),e.readInt(!0),f),u.spacingMode==Q.Length||u.spacingMode==Q.Fixed?r:1));break;case ti:let p=new wt(e.readInt(!0),e.readInt(!0),f),y=e.readFloat(),m=e.readFloat(),b=e.readFloat(),w=e.readFloat();for(let v=0,A=0,S=p.getFrameCount()-1;p.setFrame(v,y,m,b,w),v!=S;v++){let C=e.readFloat(),I=e.readFloat(),M=e.readFloat(),E=e.readFloat();switch(e.readByte()){case oe:p.setStepped(v);break;case he:q(e,p,A++,v,0,y,C,m,I,1),q(e,p,A++,v,1,y,C,b,M,1),q(e,p,A++,v,2,y,C,w,E,1)}y=C,m=I,b=M,w=E}a.push(p)}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=t.skins[e.readInt(!0)];for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readInt(!0);for(let p=0,y=e.readInt(!0);p<y;p++){let m=e.readStringRef(),b=f.getAttachment(x,m),w=e.readByte(),v=e.readInt(!0),A=v-1;switch(w){case Qs:{let S=b,C=S.bones,I=S.vertices,M=C?I.length/3*2:I.length,E=e.readInt(!0),R=new ut(v,E,x,S),F=e.readFloat();for(let Y=0,T=0;;Y++){let L,_=e.readInt(!0);if(_==0)L=C?B.newFloatArray(M):I;else{L=B.newFloatArray(M);let U=e.readInt(!0);if(_+=U,r==1)for(let N=U;N<_;N++)L[N]=e.readFloat();else for(let N=U;N<_;N++)L[N]=e.readFloat()*r;if(!C)for(let N=0,H=L.length;N<H;N++)L[N]+=I[N]}if(R.setFrame(Y,F,L),Y==A)break;let P=e.readFloat();switch(e.readByte()){case oe:R.setStepped(Y);break;case he:q(e,R,T++,Y,0,F,P,0,1,1)}F=P}a.push(R);break}case Ks:{let S=new Te(v,x,b);for(let C=0;C<v;C++){let I=e.readFloat(),M=e.readInt32();S.setFrame(C,I,$t[M&15],M>>4,e.readFloat())}a.push(S);break}}}}}let i=e.readInt(!0);if(i>0){let h=new Ae(i),d=t.slots.length;for(let f=0;f<i;f++){let u=e.readFloat(),g=e.readInt(!0),x=B.newArray(d,0);for(let b=d-1;b>=0;b--)x[b]=-1;let p=B.newArray(d-g,0),y=0,m=0;for(let b=0;b<g;b++){let w=e.readInt(!0);for(;y!=w;)p[m++]=y++;x[y+e.readInt(!0)]=y++}for(;y<d;)p[m++]=y++;for(let b=d-1;b>=0;b--)x[b]==-1&&(x[b]=p[--m]);h.setFrame(f,u,x)}a.push(h)}let l=e.readInt(!0);if(l>0){let h=new Ve(l);for(let d=0;d<l;d++){let f=e.readFloat(),u=t.events[e.readInt(!0)],g=new Xt(f,u);g.intValue=e.readInt(!1),g.floatValue=e.readFloat(),g.stringValue=e.readBoolean()?e.readString():u.stringValue,g.data.audioPath&&(g.volume=e.readFloat(),g.balance=e.readFloat()),h.setFrame(d,g)}a.push(h)}let o=0;for(let h=0,d=a.length;h<d;h++)o=Math.max(o,a[h].getDuration());return new Oe(s,a,o)}},ds=class{constructor(e,s=new Array,t=0,a=new DataView(e.buffer)){this.strings=s,this.index=t,this.buffer=a}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 s=this.readByte(),t=s&127;return(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<7,(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<14,(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<21,(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<28)))),e?t:t>>>1^-(t&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 s="",t=0;for(let a=0;a<e;){let r=this.readByte();switch(r>>4){case 12:case 13:s+=String.fromCharCode((r&31)<<6|this.readByte()&63),a+=2;break;case 14:s+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),a+=3;break;default:s+=String.fromCharCode(r),a++}}return s}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Bs=class{constructor(e,s,t,a,r){this.mesh=e,this.skin=s,this.slotIndex=t,this.parent=a,this.inheritTimeline=r}},Es=class{constructor(e=null,s=null){this.bones=e,this.vertices=s}},be;(function(e){e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping"})(be||(be={}));function we(e,s,t){let a=e.readFloat(),r=e.readFloat()*t;for(let c=0,n=0,i=s.getFrameCount()-1;s.setFrame(c,a,r),c!=i;c++){let l=e.readFloat(),o=e.readFloat()*t;switch(e.readByte()){case oe:s.setStepped(c);break;case he:q(e,s,n++,c,0,a,l,r,o,t)}a=l,r=o}return s}function Vt(e,s,t){let a=e.readFloat(),r=e.readFloat()*t,c=e.readFloat()*t;for(let n=0,i=0,l=s.getFrameCount()-1;s.setFrame(n,a,r,c),n!=l;n++){let o=e.readFloat(),h=e.readFloat()*t,d=e.readFloat()*t;switch(e.readByte()){case oe:s.setStepped(n);break;case he:q(e,s,i++,n,0,a,o,r,h,t),q(e,s,i++,n,1,a,o,c,d,t)}a=o,r=h,c=d}return s}function q(e,s,t,a,r,c,n,i,l,o){s.setBezier(t,a,r,c,i,e.readFloat(),e.readFloat()*o,e.readFloat(),e.readFloat()*o,n,l)}var Ps=0,Ls=1,Vs=2,Ds=3,Ns=4,Os=5,qs=6,Us=7,Ws=8,zs=9,_s=0,Hs=1,js=2,Gs=3,$s=4,Js=5,Qs=0,Ks=1,Zs=0,ei=1,ti=2,oe=1,he=2,si=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new Pe(()=>B.newFloatArray(16))}update(e,s){if(!e)throw new Error("skeleton cannot be null.");let t=this.boundingBoxes,a=this.polygons,r=this.polygonPool,c=e.slots,n=c.length;t.length=0,r.freeAll(a),a.length=0;for(let i=0;i<n;i++){let l=c[i];if(!l.bone.active)continue;let o=l.getAttachment();if(o instanceof ze){let h=o;t.push(h);let d=r.obtain();d.length!=h.worldVerticesLength&&(d=B.newFloatArray(h.worldVerticesLength)),a.push(d),h.computeWorldVertices(l,0,h.worldVerticesLength,d,0,2)}}s?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,s=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,r=this.polygons;for(let c=0,n=r.length;c<n;c++){let i=r[c],l=i;for(let o=0,h=i.length;o<h;o+=2){let d=l[o],f=l[o+1];e=Math.min(e,d),s=Math.min(s,f),t=Math.max(t,d),a=Math.max(a,f)}}this.minX=e,this.minY=s,this.maxX=t,this.maxY=a}aabbContainsPoint(e,s){return e>=this.minX&&e<=this.maxX&&s>=this.minY&&s<=this.maxY}aabbIntersectsSegment(e,s,t,a){let r=this.minX,c=this.minY,n=this.maxX,i=this.maxY;if(e<=r&&t<=r||s<=c&&a<=c||e>=n&&t>=n||s>=i&&a>=i)return!1;let l=(a-s)/(t-e),o=l*(r-e)+s;if(o>c&&o<i||(o=l*(n-e)+s,o>c&&o<i))return!0;let h=(c-s)/l+e;return!!(h>r&&h<n||(h=(i-s)/l+e,h>r&&h<n))}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,s){let t=this.polygons;for(let a=0,r=t.length;a<r;a++)if(this.containsPointPolygon(t[a],e,s))return this.boundingBoxes[a];return null}containsPointPolygon(e,s,t){let a=e,r=e.length,c=r-2,n=!1;for(let i=0;i<r;i+=2){let l=a[i+1],o=a[c+1];if(l<t&&o>=t||o<t&&l>=t){let h=a[i];h+(t-l)/(o-l)*(a[c]-h)<s&&(n=!n)}c=i}return n}intersectsSegment(e,s,t,a){let r=this.polygons;for(let c=0,n=r.length;c<n;c++)if(this.intersectsSegmentPolygon(r[c],e,s,t,a))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(e,s,t,a,r){let c=e,n=e.length,i=s-a,l=t-r,o=s*r-t*a,h=c[n-2],d=c[n-1];for(let f=0;f<n;f+=2){let u=c[f],g=c[f+1],x=h*g-d*u,p=h-u,y=d-g,m=i*y-l*p,b=(o*p-i*x)/m;if((b>=h&&b<=u||b>=u&&b<=h)&&(b>=s&&b<=a||b>=a&&b<=s)){let w=(o*y-l*x)/m;if((w>=d&&w<=g||w>=g&&w<=d)&&(w>=t&&w<=r||w>=r&&w<=t))return!0}h=u,d=g}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let s=this.boundingBoxes.indexOf(e);return s==-1?null:this.polygons[s]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},se=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new Pe(()=>new Array),this.polygonIndicesPool=new Pe(()=>new Array)}triangulate(e){let s=e,t=e.length>>1,a=this.indicesArray;a.length=0;for(let n=0;n<t;n++)a[n]=n;let r=this.isConcaveArray;r.length=0;for(let n=0,i=t;n<i;++n)r[n]=se.isConcave(n,t,s,a);let c=this.triangles;for(c.length=0;t>3;){let n=t-1,i=0,l=1;for(;;){e:if(!r[i]){let d=a[n]<<1,f=a[i]<<1,u=a[l]<<1,g=s[d],x=s[d+1],p=s[f],y=s[f+1],m=s[u],b=s[u+1];for(let w=(l+1)%t;w!=n;w=(w+1)%t){if(!r[w])continue;let v=a[w]<<1,A=s[v],S=s[v+1];if(se.positiveArea(m,b,g,x,A,S)&&se.positiveArea(g,x,p,y,A,S)&&se.positiveArea(p,y,m,b,A,S))break e}break}if(l==0){do{if(!r[i])break;i--}while(i>0);break}n=i,i=l,l=(l+1)%t}c.push(a[(t+i-1)%t]),c.push(a[i]),c.push(a[(i+1)%t]),a.splice(i,1),r.splice(i,1),t--;let o=(t+i-1)%t,h=i==t?0:i;r[o]=se.isConcave(o,t,s,a),r[h]=se.isConcave(h,t,s,a)}return t==3&&(c.push(a[2]),c.push(a[0]),c.push(a[1])),c}decompose(e,s){let t=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let n=this.polygonPool.obtain();n.length=0;let i=-1,l=0;for(let o=0,h=s.length;o<h;o+=3){let d=s[o]<<1,f=s[o+1]<<1,u=s[o+2]<<1,g=t[d],x=t[d+1],p=t[f],y=t[f+1],m=t[u],b=t[u+1],w=!1;if(i==d){let v=n.length-4,A=se.winding(n[v],n[v+1],n[v+2],n[v+3],m,b),S=se.winding(m,b,n[0],n[1],n[2],n[3]);A==l&&S==l&&(n.push(m),n.push(b),c.push(u),w=!0)}w||(n.length>0?(a.push(n),r.push(c)):(this.polygonPool.free(n),this.polygonIndicesPool.free(c)),n=this.polygonPool.obtain(),n.length=0,n.push(g),n.push(x),n.push(p),n.push(y),n.push(m),n.push(b),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(u),l=se.winding(g,x,p,y,m,b),i=d)}n.length>0&&(a.push(n),r.push(c));for(let o=0,h=a.length;o<h;o++){if(c=r[o],c.length==0)continue;let d=c[0],f=c[c.length-1];n=a[o];let u=n.length-4,g=n[u],x=n[u+1],p=n[u+2],y=n[u+3],m=n[0],b=n[1],w=n[2],v=n[3],A=se.winding(g,x,p,y,m,b);for(let S=0;S<h;S++){if(S==o)continue;let C=r[S];if(C.length!=3)continue;let I=C[0],M=C[1],E=C[2],R=a[S],F=R[R.length-2],Y=R[R.length-1];if(I!=d||M!=f)continue;let T=se.winding(g,x,p,y,F,Y),L=se.winding(F,Y,m,b,w,v);T==A&&L==A&&(R.length=0,C.length=0,n.push(F),n.push(Y),c.push(E),g=p,x=y,p=F,y=Y,S=0)}}for(let o=a.length-1;o>=0;o--)n=a[o],n.length==0&&(a.splice(o,1),this.polygonPool.free(n),c=r[o],r.splice(o,1),this.polygonIndicesPool.free(c));return a}static isConcave(e,s,t,a){let r=a[(s+e-1)%s]<<1,c=a[e]<<1,n=a[(e+1)%s]<<1;return!this.positiveArea(t[r],t[r+1],t[c],t[c+1],t[n],t[n+1])}static positiveArea(e,s,t,a,r,c){return e*(c-a)+t*(s-c)+r*(a-s)>=0}static winding(e,s,t,a,r,c){let n=t-e,i=a-s;return r*i-c*n+n*s-e*i>=0?1:-1}},Dt=class{constructor(){this.triangulator=new se,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(e,s){if(this.clipAttachment)return 0;this.clipAttachment=s;let t=s.worldVerticesLength,a=B.setArraySize(this.clippingPolygon,t);s.computeWorldVertices(e,0,t,a,0,2);let r=this.clippingPolygon;Dt.makeClockwise(r);let c=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let n=0,i=c.length;n<i;n++){let l=c[n];Dt.makeClockwise(l),l.push(l[0]),l.push(l[1])}return c.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.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(e,s,t,a,r,c,n,i){let l=this.clipOutput,o=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=this.clippingPolygons.length,u=i?12:8,g=0;o.length=0,h.length=0;e:for(let x=0;x<a;x+=3){let p=t[x]<<1,y=e[p],m=e[p+1],b=r[p],w=r[p+1];p=t[x+1]<<1;let v=e[p],A=e[p+1],S=r[p],C=r[p+1];p=t[x+2]<<1;let I=e[p],M=e[p+1],E=r[p],R=r[p+1];for(let F=0;F<f;F++){let Y=o.length;if(this.clip(y,m,v,A,I,M,d[F],l)){let T=l.length;if(T==0)continue;let L=A-M,_=I-v,P=y-I,U=M-m,N=1/(L*P+_*(m-M)),H=T>>1,O=this.clipOutput,V=B.setArraySize(o,Y+H*u);for(let Z=0;Z<T;Z+=2){let ce=O[Z],K=O[Z+1];V[Y]=ce,V[Y+1]=K,V[Y+2]=c.r,V[Y+3]=c.g,V[Y+4]=c.b,V[Y+5]=c.a;let ie=ce-I,re=K-M,ye=(L*ie+_*re)*N,Re=(U*ie+P*re)*N,De=1-ye-Re;V[Y+6]=b*ye+S*Re+E*De,V[Y+7]=w*ye+C*Re+R*De,i&&(V[Y+8]=n.r,V[Y+9]=n.g,V[Y+10]=n.b,V[Y+11]=n.a),Y+=u}Y=h.length;let G=B.setArraySize(h,Y+3*(H-2));H--;for(let Z=1;Z<H;Z++)G[Y]=g,G[Y+1]=g+Z,G[Y+2]=g+Z+1,Y+=3;g+=H+1}else{let T=B.setArraySize(o,Y+3*u);T[Y]=y,T[Y+1]=m,T[Y+2]=c.r,T[Y+3]=c.g,T[Y+4]=c.b,T[Y+5]=c.a,i?(T[Y+6]=b,T[Y+7]=w,T[Y+8]=n.r,T[Y+9]=n.g,T[Y+10]=n.b,T[Y+11]=n.a,T[Y+12]=v,T[Y+13]=A,T[Y+14]=c.r,T[Y+15]=c.g,T[Y+16]=c.b,T[Y+17]=c.a,T[Y+18]=S,T[Y+19]=C,T[Y+20]=n.r,T[Y+21]=n.g,T[Y+22]=n.b,T[Y+23]=n.a,T[Y+24]=I,T[Y+25]=M,T[Y+26]=c.r,T[Y+27]=c.g,T[Y+28]=c.b,T[Y+29]=c.a,T[Y+30]=E,T[Y+31]=R,T[Y+32]=n.r,T[Y+33]=n.g,T[Y+34]=n.b,T[Y+35]=n.a):(T[Y+6]=b,T[Y+7]=w,T[Y+8]=v,T[Y+9]=A,T[Y+10]=c.r,T[Y+11]=c.g,T[Y+12]=c.b,T[Y+13]=c.a,T[Y+14]=S,T[Y+15]=C,T[Y+16]=I,T[Y+17]=M,T[Y+18]=c.r,T[Y+19]=c.g,T[Y+20]=c.b,T[Y+21]=c.a,T[Y+22]=E,T[Y+23]=R),Y=h.length;let L=B.setArraySize(h,Y+3);L[Y]=g,L[Y+1]=g+1,L[Y+2]=g+2,g+=3;continue e}}}}clip(e,s,t,a,r,c,n,i){let l=i,o=!1,h=null;n.length%4>=2?(h=i,i=this.scratch):h=this.scratch,h.length=0,h.push(e),h.push(s),h.push(t),h.push(a),h.push(r),h.push(c),h.push(e),h.push(s),i.length=0;let d=n,f=n.length-4;for(let u=0;;u+=2){let g=d[u],x=d[u+1],p=d[u+2],y=d[u+3],m=g-p,b=x-y,w=h,v=h.length-2,A=i.length;for(let C=0;C<v;C+=2){let I=w[C],M=w[C+1],E=w[C+2],R=w[C+3],F=m*(R-y)-b*(E-p)>0;if(m*(M-y)-b*(I-p)>0){if(F){i.push(E),i.push(R);continue}let Y=R-M,T=E-I,L=Y*(p-g)-T*(y-x);if(Math.abs(L)>1e-6){let _=(T*(x-M)-Y*(g-I))/L;i.push(g+(p-g)*_),i.push(x+(y-x)*_)}else i.push(g),i.push(x)}else if(F){let Y=R-M,T=E-I,L=Y*(p-g)-T*(y-x);if(Math.abs(L)>1e-6){let _=(T*(x-M)-Y*(g-I))/L;i.push(g+(p-g)*_),i.push(x+(y-x)*_)}else i.push(g),i.push(x);i.push(E),i.push(R)}o=!0}if(A==i.length)return l.length=0,!0;if(i.push(i[0]),i.push(i[1]),u==f)break;let S=i;i=h,i.length=0,h=S}if(l!=i){l.length=0;for(let u=0,g=i.length-2;u<g;u++)l[u]=i[u]}else l.length=l.length-2;return o}static makeClockwise(e){let s=e,t=e.length,a=s[t-2]*s[1]-s[0]*s[t-1],r=0,c=0,n=0,i=0;for(let l=0,o=t-3;l<o;l+=2)r=s[l],c=s[l+1],n=s[l+2],i=s[l+3],a+=r*i-n*c;if(!(a<0))for(let l=0,o=t-2,h=t>>1;l<h;l+=2){let d=s[l],f=s[l+1],u=o-l;s[l]=s[u],s[l+1]=s[u+1],s[u]=d,s[u+1]=f}}},ii=class{constructor(e){this.attachmentLoader=null,this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let s=this.scale,t=new Bt,a=typeof e=="string"?JSON.parse(e):e,r=a.skeleton;if(r&&(t.hash=r.hash,t.version=r.spine,t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t.fps=r.fps,t.imagesPath=r.images),a.bones)for(let c=0;c<a.bones.length;c++){let n=a.bones[c],i=null,l=k(n,"parent",null);l&&(i=t.findBone(l));let o=new Ct(t.bones.length,n.name,i);o.length=k(n,"length",0)*s,o.x=k(n,"x",0)*s,o.y=k(n,"y",0)*s,o.rotation=k(n,"rotation",0),o.scaleX=k(n,"scaleX",1),o.scaleY=k(n,"scaleY",1),o.shearX=k(n,"shearX",0),o.shearY=k(n,"shearY",0),o.transformMode=B.enumValue(te,k(n,"transform","Normal")),o.skinRequired=k(n,"skin",!1);let h=k(n,"color",null);h&&o.color.setFromString(h),t.bones.push(o)}if(a.slots)for(let c=0;c<a.slots.length;c++){let n=a.slots[c],i=t.findBone(n.bone),l=new Pt(t.slots.length,n.name,i),o=k(n,"color",null);o&&l.color.setFromString(o);let h=k(n,"dark",null);h&&(l.darkColor=D.fromString(h)),l.attachmentName=k(n,"attachment",null),l.blendMode=B.enumValue(je,k(n,"blend","normal")),t.slots.push(l)}if(a.ik)for(let c=0;c<a.ik.length;c++){let n=a.ik[c],i=new Ft(n.name);i.order=k(n,"order",0),i.skinRequired=k(n,"skin",!1);for(let l=0;l<n.bones.length;l++)i.bones.push(t.findBone(n.bones[l]));i.target=t.findBone(n.target),i.mix=k(n,"mix",1),i.softness=k(n,"softness",0)*s,i.bendDirection=k(n,"bendPositive",!0)?1:-1,i.compress=k(n,"compress",!1),i.stretch=k(n,"stretch",!1),i.uniform=k(n,"uniform",!1),t.ikConstraints.push(i)}if(a.transform)for(let c=0;c<a.transform.length;c++){let n=a.transform[c],i=new Lt(n.name);i.order=k(n,"order",0),i.skinRequired=k(n,"skin",!1);for(let o=0;o<n.bones.length;o++)i.bones.push(t.findBone(n.bones[o]));let l=n.target;i.target=t.findBone(l),i.local=k(n,"local",!1),i.relative=k(n,"relative",!1),i.offsetRotation=k(n,"rotation",0),i.offsetX=k(n,"x",0)*s,i.offsetY=k(n,"y",0)*s,i.offsetScaleX=k(n,"scaleX",0),i.offsetScaleY=k(n,"scaleY",0),i.offsetShearY=k(n,"shearY",0),i.mixRotate=k(n,"mixRotate",1),i.mixX=k(n,"mixX",1),i.mixY=k(n,"mixY",i.mixX),i.mixScaleX=k(n,"mixScaleX",1),i.mixScaleY=k(n,"mixScaleY",i.mixScaleX),i.mixShearY=k(n,"mixShearY",1),t.transformConstraints.push(i)}if(a.path)for(let c=0;c<a.path.length;c++){let n=a.path[c],i=new Rt(n.name);i.order=k(n,"order",0),i.skinRequired=k(n,"skin",!1);for(let o=0;o<n.bones.length;o++)i.bones.push(t.findBone(n.bones[o]));let l=n.target;i.target=t.findSlot(l),i.positionMode=B.enumValue(fe,k(n,"positionMode","Percent")),i.spacingMode=B.enumValue(Q,k(n,"spacingMode","Length")),i.rotateMode=B.enumValue(Ie,k(n,"rotateMode","Tangent")),i.offsetRotation=k(n,"rotation",0),i.position=k(n,"position",0),i.positionMode==fe.Fixed&&(i.position*=s),i.spacing=k(n,"spacing",0),(i.spacingMode==Q.Length||i.spacingMode==Q.Fixed)&&(i.spacing*=s),i.mixRotate=k(n,"mixRotate",1),i.mixX=k(n,"mixX",1),i.mixY=k(n,"mixY",i.mixX),t.pathConstraints.push(i)}if(a.skins)for(let c=0;c<a.skins.length;c++){let n=a.skins[c],i=new He(n.name);if(n.bones)for(let l=0;l<n.bones.length;l++)i.bones.push(t.findBone(n.bones[l]));if(n.ik)for(let l=0;l<n.ik.length;l++)i.constraints.push(t.findIkConstraint(n.ik[l]));if(n.transform)for(let l=0;l<n.transform.length;l++)i.constraints.push(t.findTransformConstraint(n.transform[l]));if(n.path)for(let l=0;l<n.path.length;l++)i.constraints.push(t.findPathConstraint(n.path[l]));for(let l in n.attachments){let o=t.findSlot(l),h=n.attachments[l];for(let d in h){let f=this.readAttachment(h[d],i,o.index,d,t);f&&i.setAttachment(o.index,d,f)}}t.skins.push(i),i.name=="default"&&(t.defaultSkin=i)}for(let c=0,n=this.linkedMeshes.length;c<n;c++){let i=this.linkedMeshes[c],o=(i.skin?t.findSkin(i.skin):t.defaultSkin).getAttachment(i.slotIndex,i.parent);i.mesh.timelineAttahment=i.inheritTimeline?o:i.mesh,i.mesh.setParentMesh(o),i.mesh.region!=null&&i.mesh.updateRegion()}if(this.linkedMeshes.length=0,a.events)for(let c in a.events){let n=a.events[c],i=new Mt(c);i.intValue=k(n,"int",0),i.floatValue=k(n,"float",0),i.stringValue=k(n,"string",""),i.audioPath=k(n,"audio",null),i.audioPath&&(i.volume=k(n,"volume",1),i.balance=k(n,"balance",0)),t.events.push(i)}if(a.animations)for(let c in a.animations){let n=a.animations[c];this.readAnimation(n,c,t)}return t}readAttachment(e,s,t,a,r){let c=this.scale;switch(a=k(e,"name",a),k(e,"type","region")){case"region":{let n=k(e,"path",a),i=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(s,a,n,i);if(!l)return null;l.path=n,l.x=k(e,"x",0)*c,l.y=k(e,"y",0)*c,l.scaleX=k(e,"scaleX",1),l.scaleY=k(e,"scaleY",1),l.rotation=k(e,"rotation",0),l.width=e.width*c,l.height=e.height*c,l.sequence=i;let o=k(e,"color",null);return o&&l.color.setFromString(o),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let n=this.attachmentLoader.newBoundingBoxAttachment(s,a);if(!n)return null;this.readVertices(e,n,e.vertexCount<<1);let i=k(e,"color",null);return i&&n.color.setFromString(i),n}case"mesh":case"linkedmesh":{let n=k(e,"path",a),i=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(s,a,n,i);if(!l)return null;l.path=n;let o=k(e,"color",null);o&&l.color.setFromString(o),l.width=k(e,"width",0)*c,l.height=k(e,"height",0)*c,l.sequence=i;let h=k(e,"parent",null);if(h)return this.linkedMeshes.push(new ri(l,k(e,"skin",null),t,h,k(e,"timelines",!0))),l;let d=e.uvs;return this.readVertices(e,l,d.length),l.triangles=e.triangles,l.regionUVs=d,l.region!=null&&l.updateRegion(),l.edges=k(e,"edges",null),l.hullLength=k(e,"hull",0)*2,l}case"path":{let n=this.attachmentLoader.newPathAttachment(s,a);if(!n)return null;n.closed=k(e,"closed",!1),n.constantSpeed=k(e,"constantSpeed",!0);let i=e.vertexCount;this.readVertices(e,n,i<<1);let l=B.newArray(i/3,0);for(let h=0;h<e.lengths.length;h++)l[h]=e.lengths[h]*c;n.lengths=l;let o=k(e,"color",null);return o&&n.color.setFromString(o),n}case"point":{let n=this.attachmentLoader.newPointAttachment(s,a);if(!n)return null;n.x=k(e,"x",0)*c,n.y=k(e,"y",0)*c,n.rotation=k(e,"rotation",0);let i=k(e,"color",null);return i&&n.color.setFromString(i),n}case"clipping":{let n=this.attachmentLoader.newClippingAttachment(s,a);if(!n)return null;let i=k(e,"end",null);i&&(n.endSlot=r.findSlot(i));let l=e.vertexCount;this.readVertices(e,n,l<<1);let o=k(e,"color",null);return o&&n.color.setFromString(o),n}}return null}readSequence(e){if(e==null)return null;let s=new Ke(k(e,"count",0));return s.start=k(e,"start",1),s.digits=k(e,"digits",0),s.setupIndex=k(e,"setup",0),s}readVertices(e,s,t){let a=this.scale;s.worldVerticesLength=t;let r=e.vertices;if(t==r.length){let i=B.toFloatArray(r);if(a!=1)for(let l=0,o=r.length;l<o;l++)i[l]*=a;s.vertices=i;return}let c=new Array,n=new Array;for(let i=0,l=r.length;i<l;){let o=r[i++];n.push(o);for(let h=i+o*4;i<h;i+=4)n.push(r[i]),c.push(r[i+1]*a),c.push(r[i+2]*a),c.push(r[i+3])}s.bones=n,s.vertices=B.toFloatArray(c)}readAnimation(e,s,t){let a=this.scale,r=new Array;if(e.slots)for(let n in e.slots){let i=e.slots[n],l=t.findSlot(n).index;for(let o in i){let h=i[o];if(!h)continue;let d=h.length;if(o=="attachment"){let f=new Se(d,l);for(let u=0;u<d;u++){let g=h[u];f.setFrame(u,k(g,"time",0),k(g,"name",null))}r.push(f)}else if(o=="rgba"){let f=new ot(d,d<<2,l),u=h[0],g=k(u,"time",0),x=D.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,g,x.r,x.g,x.b,x.a);let m=h[p+1];if(!m){f.shrink(y);break}let b=k(m,"time",0),w=D.fromString(m.color),v=u.curve;v&&(y=z(v,f,y,p,0,g,b,x.r,w.r,1),y=z(v,f,y,p,1,g,b,x.g,w.g,1),y=z(v,f,y,p,2,g,b,x.b,w.b,1),y=z(v,f,y,p,3,g,b,x.a,w.a,1)),g=b,x=w,u=m}r.push(f)}else if(o=="rgb"){let f=new ht(d,d*3,l),u=h[0],g=k(u,"time",0),x=D.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,g,x.r,x.g,x.b);let m=h[p+1];if(!m){f.shrink(y);break}let b=k(m,"time",0),w=D.fromString(m.color),v=u.curve;v&&(y=z(v,f,y,p,0,g,b,x.r,w.r,1),y=z(v,f,y,p,1,g,b,x.g,w.g,1),y=z(v,f,y,p,2,g,b,x.b,w.b,1)),g=b,x=w,u=m}r.push(f)}else if(o=="alpha")r.push(ue(h,new ct(d,d,l),0,1));else if(o=="rgba2"){let f=new dt(d,d*7,l),u=h[0],g=k(u,"time",0),x=D.fromString(u.light),p=D.fromString(u.dark);for(let y=0,m=0;;y++){f.setFrame(y,g,x.r,x.g,x.b,x.a,p.r,p.g,p.b);let b=h[y+1];if(!b){f.shrink(m);break}let w=k(b,"time",0),v=D.fromString(b.light),A=D.fromString(b.dark),S=u.curve;S&&(m=z(S,f,m,y,0,g,w,x.r,v.r,1),m=z(S,f,m,y,1,g,w,x.g,v.g,1),m=z(S,f,m,y,2,g,w,x.b,v.b,1),m=z(S,f,m,y,3,g,w,x.a,v.a,1),m=z(S,f,m,y,4,g,w,p.r,A.r,1),m=z(S,f,m,y,5,g,w,p.g,A.g,1),m=z(S,f,m,y,6,g,w,p.b,A.b,1)),g=w,x=v,p=A,u=b}r.push(f)}else if(o=="rgb2"){let f=new ft(d,d*6,l),u=h[0],g=k(u,"time",0),x=D.fromString(u.light),p=D.fromString(u.dark);for(let y=0,m=0;;y++){f.setFrame(y,g,x.r,x.g,x.b,p.r,p.g,p.b);let b=h[y+1];if(!b){f.shrink(m);break}let w=k(b,"time",0),v=D.fromString(b.light),A=D.fromString(b.dark),S=u.curve;S&&(m=z(S,f,m,y,0,g,w,x.r,v.r,1),m=z(S,f,m,y,1,g,w,x.g,v.g,1),m=z(S,f,m,y,2,g,w,x.b,v.b,1),m=z(S,f,m,y,3,g,w,p.r,A.r,1),m=z(S,f,m,y,4,g,w,p.g,A.g,1),m=z(S,f,m,y,5,g,w,p.b,A.b,1)),g=w,x=v,p=A,u=b}r.push(f)}}}if(e.bones)for(let n in e.bones){let i=e.bones[n],l=t.findBone(n).index;for(let o in i){let h=i[o],d=h.length;if(d!=0){if(o==="rotate")r.push(ue(h,new Le(d,d,l),0,1));else if(o==="translate"){let f=new Ze(d,d<<1,l);r.push(Nt(h,f,"x","y",0,a))}else if(o==="translatex"){let f=new et(d,d,l);r.push(ue(h,f,0,a))}else if(o==="translatey"){let f=new tt(d,d,l);r.push(ue(h,f,0,a))}else if(o==="scale"){let f=new st(d,d<<1,l);r.push(Nt(h,f,"x","y",1,1))}else if(o==="scalex"){let f=new it(d,d,l);r.push(ue(h,f,1,1))}else if(o==="scaley"){let f=new rt(d,d,l);r.push(ue(h,f,1,1))}else if(o==="shear"){let f=new at(d,d<<1,l);r.push(Nt(h,f,"x","y",0,1))}else if(o==="shearx"){let f=new nt(d,d,l);r.push(ue(h,f,0,1))}else if(o==="sheary"){let f=new lt(d,d,l);r.push(ue(h,f,0,1))}}}}if(e.ik)for(let n in e.ik){let i=e.ik[n],l=i[0];if(!l)continue;let o=t.findIkConstraint(n),h=t.ikConstraints.indexOf(o),d=new mt(i.length,i.length<<1,h),f=k(l,"time",0),u=k(l,"mix",1),g=k(l,"softness",0)*a;for(let x=0,p=0;;x++){d.setFrame(x,f,u,g,k(l,"bendPositive",!0)?1:-1,k(l,"compress",!1),k(l,"stretch",!1));let y=i[x+1];if(!y){d.shrink(p);break}let m=k(y,"time",0),b=k(y,"mix",1),w=k(y,"softness",0)*a,v=l.curve;v&&(p=z(v,d,p,x,0,f,m,u,b,1),p=z(v,d,p,x,1,f,m,g,w,a)),f=m,u=b,g=w,l=y}r.push(d)}if(e.transform)for(let n in e.transform){let i=e.transform[n],l=i[0];if(!l)continue;let o=t.findTransformConstraint(n),h=t.transformConstraints.indexOf(o),d=new gt(i.length,i.length*6,h),f=k(l,"time",0),u=k(l,"mixRotate",1),g=k(l,"mixX",1),x=k(l,"mixY",g),p=k(l,"mixScaleX",1),y=k(l,"mixScaleY",p),m=k(l,"mixShearY",1);for(let b=0,w=0;;b++){d.setFrame(b,f,u,g,x,p,y,m);let v=i[b+1];if(!v){d.shrink(w);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),C=k(v,"mixX",1),I=k(v,"mixY",C),M=k(v,"mixScaleX",1),E=k(v,"mixScaleY",M),R=k(v,"mixShearY",1),F=l.curve;F&&(w=z(F,d,w,b,0,f,A,u,S,1),w=z(F,d,w,b,1,f,A,g,C,1),w=z(F,d,w,b,2,f,A,x,I,1),w=z(F,d,w,b,3,f,A,p,M,1),w=z(F,d,w,b,4,f,A,y,E,1),w=z(F,d,w,b,5,f,A,m,R,1)),f=A,u=S,g=C,x=I,p=M,y=E,p=M,l=v}r.push(d)}if(e.path)for(let n in e.path){let i=e.path[n],l=t.findPathConstraint(n),o=t.pathConstraints.indexOf(l);for(let h in i){let d=i[h],f=d[0];if(!f)continue;let u=d.length;if(h==="position"){let g=new xt(u,u,o);r.push(ue(d,g,0,l.positionMode==fe.Fixed?a:1))}else if(h==="spacing"){let g=new bt(u,u,o);r.push(ue(d,g,0,l.spacingMode==Q.Length||l.spacingMode==Q.Fixed?a:1))}else if(h==="mix"){let g=new wt(u,u*3,o),x=k(f,"time",0),p=k(f,"mixRotate",1),y=k(f,"mixX",1),m=k(f,"mixY",y);for(let b=0,w=0;;b++){g.setFrame(b,x,p,y,m);let v=d[b+1];if(!v){g.shrink(w);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),C=k(v,"mixX",1),I=k(v,"mixY",C),M=f.curve;M&&(w=z(M,g,w,b,0,x,A,p,S,1),w=z(M,g,w,b,1,x,A,y,C,1),w=z(M,g,w,b,2,x,A,m,I,1)),x=A,p=S,y=C,m=I,f=v}r.push(g)}}}if(e.attachments)for(let n in e.attachments){let i=e.attachments[n],l=t.findSkin(n);for(let o in i){let h=i[o],d=t.findSlot(o).index;for(let f in h){let u=h[f],g=l.getAttachment(d,f);for(let x in u){let p=u[x],y=p[0];if(!!y){if(x=="deform"){let m=g.bones,b=g.vertices,w=m?b.length/3*2:b.length,v=new ut(p.length,p.length,d,g),A=k(y,"time",0);for(let S=0,C=0;;S++){let I,M=k(y,"vertices",null);if(!M)I=m?B.newFloatArray(w):b;else{I=B.newFloatArray(w);let Y=k(y,"offset",0);if(B.arrayCopy(M,0,I,Y,M.length),a!=1)for(let T=Y,L=T+M.length;T<L;T++)I[T]*=a;if(!m)for(let T=0;T<w;T++)I[T]+=b[T]}v.setFrame(S,A,I);let E=p[S+1];if(!E){v.shrink(C);break}let R=k(E,"time",0),F=y.curve;F&&(C=z(F,v,C,S,0,A,R,0,1,1)),A=R,y=E}r.push(v)}else if(x=="sequence"){let m=new Te(p.length,d,g),b=0;for(let w=0;w<p.length;w++){let v=k(y,"delay",b),A=k(y,"time",0),S=de[k(y,"mode","hold")],C=k(y,"index",0);m.setFrame(w,A,S,C,v),b=v,y=p[w+1]}r.push(m)}}}}}}if(e.drawOrder){let n=new Ae(e.drawOrder.length),i=t.slots.length,l=0;for(let o=0;o<e.drawOrder.length;o++,l++){let h=e.drawOrder[o],d=null,f=k(h,"offsets",null);if(f){d=B.newArray(i,-1);let u=B.newArray(i-f.length,0),g=0,x=0;for(let p=0;p<f.length;p++){let y=f[p],m=t.findSlot(y.slot).index;for(;g!=m;)u[x++]=g++;d[g+y.offset]=g++}for(;g<i;)u[x++]=g++;for(let p=i-1;p>=0;p--)d[p]==-1&&(d[p]=u[--x])}n.setFrame(l,k(h,"time",0),d)}r.push(n)}if(e.events){let n=new Ve(e.events.length),i=0;for(let l=0;l<e.events.length;l++,i++){let o=e.events[l],h=t.findEvent(o.name),d=new Xt(B.toSinglePrecision(k(o,"time",0)),h);d.intValue=k(o,"int",h.intValue),d.floatValue=k(o,"float",h.floatValue),d.stringValue=k(o,"string",h.stringValue),d.data.audioPath&&(d.volume=k(o,"volume",1),d.balance=k(o,"balance",0)),n.setFrame(i,d)}r.push(n)}let c=0;for(let n=0,i=r.length;n<i;n++)c=Math.max(c,r[n].getDuration());t.animations.push(new Oe(s,r,c))}},ri=class{constructor(e,s,t,a,r){this.mesh=e,this.skin=s,this.slotIndex=t,this.parent=a,this.inheritTimeline=r}};function ue(e,s,t,a){let r=e[0],c=k(r,"time",0),n=k(r,"value",t)*a,i=0;for(let l=0;;l++){s.setFrame(l,c,n);let o=e[l+1];if(!o)return s.shrink(i),s;let h=k(o,"time",0),d=k(o,"value",t)*a;r.curve&&(i=z(r.curve,s,i,l,0,c,h,n,d,a)),c=h,n=d,r=o}}function Nt(e,s,t,a,r,c){let n=e[0],i=k(n,"time",0),l=k(n,t,r)*c,o=k(n,a,r)*c,h=0;for(let d=0;;d++){s.setFrame(d,i,l,o);let f=e[d+1];if(!f)return s.shrink(h),s;let u=k(f,"time",0),g=k(f,t,r)*c,x=k(f,a,r)*c,p=n.curve;p&&(h=z(p,s,h,d,0,i,u,l,g,c),h=z(p,s,h,d,1,i,u,o,x,c)),i=u,l=g,o=x,n=f}}function z(e,s,t,a,r,c,n,i,l,o){if(e=="stepped")return s.setStepped(a),t;let h=r<<2,d=e[h],f=e[h+1]*o,u=e[h+2],g=e[h+3]*o;return s.setBezier(t,a,r,c,i,d,f,u,g,n,l),t+1}function k(e,s,t){return e[s]!==void 0?e[s]:t}(()=>{typeof Math.fround=="undefined"&&(Math.fround=function(e){return function(s){return e[0]=s,e[0]}}(new Float32Array(1)))})();var ai=class{constructor(e,s){this.jitterX=0,this.jitterY=0,this.jitterX=e,this.jitterY=s}begin(e){}transform(e,s,t,a){e.x+=X.randomTriangular(-this.jitterX,this.jitterY),e.y+=X.randomTriangular(-this.jitterX,this.jitterY)}end(){}},fs=class{constructor(e){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=e}begin(e){this.worldX=e.x+this.centerX,this.worldY=e.y+this.centerY}transform(e,s,t,a){let r=this.angle*X.degreesToRadians,c=e.x-this.worldX,n=e.y-this.worldY,i=Math.sqrt(c*c+n*n);if(i<this.radius){let l=fs.interpolation.apply(0,r,(this.radius-i)/this.radius),o=Math.cos(l),h=Math.sin(l);e.x=o*c-h*n+this.worldX,e.y=h*c+o*n+this.worldY}}end(){}},us=fs;return us.interpolation=new Ht(2),Wt})();
1
+ var spine=(()=>{var Ut=Object.defineProperty,ps=e=>Ut(e,"__esModule",{value:!0}),ys=(e,s)=>{ps(e);for(var t in s)Ut(e,t,{get:s[t],enumerable:!0})},Wt={};ys(Wt,{AlphaTimeline:()=>ct,Animation:()=>Oe,AnimationState:()=>pt,AnimationStateAdapter:()=>Ys,AnimationStateData:()=>Is,AssetManagerBase:()=>Ms,AtlasAttachmentLoader:()=>Xs,Attachment:()=>Qe,AttachmentTimeline:()=>Se,BinaryInput:()=>ds,BlendMode:()=>je,Bone:()=>Tt,BoneData:()=>Ct,BoundingBoxAttachment:()=>ze,CURRENT:()=>ts,ClippingAttachment:()=>kt,Color:()=>D,ConstraintData:()=>_e,CurveTimeline:()=>ne,CurveTimeline1:()=>le,CurveTimeline2:()=>qe,DebugUtils:()=>Ss,DeformTimeline:()=>ut,Downloader:()=>ls,DrawOrderTimeline:()=>Ae,Event:()=>Xt,EventData:()=>Mt,EventQueue:()=>Zt,EventTimeline:()=>Ve,EventType:()=>ee,FIRST:()=>yt,FakeTexture:()=>Cs,HOLD_FIRST:()=>We,HOLD_MIX:()=>es,HOLD_SUBSEQUENT:()=>vt,IkConstraint:()=>os,IkConstraintData:()=>Ft,IkConstraintTimeline:()=>mt,IntSet:()=>vs,Interpolation:()=>zt,JitterEffect:()=>ai,MathUtils:()=>X,MeshAttachment:()=>Xe,MixBlend:()=>$,MixDirection:()=>ge,PathAttachment:()=>Me,PathConstraint:()=>Fe,PathConstraintData:()=>Rt,PathConstraintMixTimeline:()=>wt,PathConstraintPositionTimeline:()=>xt,PathConstraintSpacingTimeline:()=>bt,PointAttachment:()=>It,Pool:()=>Pe,PositionMode:()=>fe,Pow:()=>_t,PowOut:()=>Ht,RGB2Timeline:()=>ft,RGBA2Timeline:()=>dt,RGBATimeline:()=>ot,RGBTimeline:()=>ht,RegionAttachment:()=>W,RotateMode:()=>Ie,RotateTimeline:()=>Le,SETUP:()=>St,SUBSEQUENT:()=>Ue,ScaleTimeline:()=>st,ScaleXTimeline:()=>it,ScaleYTimeline:()=>rt,SequenceTimeline:()=>Te,ShearTimeline:()=>at,ShearXTimeline:()=>nt,ShearYTimeline:()=>lt,Skeleton:()=>Fs,SkeletonBinary:()=>Rs,SkeletonBounds:()=>si,SkeletonClipping:()=>Dt,SkeletonData:()=>Bt,SkeletonJson:()=>ii,Skin:()=>He,SkinEntry:()=>Et,Slot:()=>hs,SlotData:()=>Pt,SpacingMode:()=>Q,StringSet:()=>Je,SwirlEffect:()=>us,Texture:()=>ss,TextureAtlas:()=>rs,TextureAtlasPage:()=>as,TextureAtlasRegion:()=>Yt,TextureFilter:()=>ke,TextureRegion:()=>is,TextureWrap:()=>Ye,TimeKeeper:()=>As,Timeline:()=>J,TrackEntry:()=>Kt,TransformConstraint:()=>cs,TransformConstraintData:()=>Lt,TransformConstraintTimeline:()=>gt,TransformMode:()=>te,TranslateTimeline:()=>Ze,TranslateXTimeline:()=>et,TranslateYTimeline:()=>tt,Triangulator:()=>se,Utils:()=>E,Vector2:()=>jt,VertexAttachment:()=>ae,WindowedMean:()=>ks});var vs=class{constructor(){this.array=new Array}add(e){let s=this.contains(e);return this.array[e|0]=e|0,!s}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Je=class{constructor(){this.entries={},this.size=0}add(e){let s=this.entries[e];return this.entries[e]=!0,s?!1:(this.size++,!0)}addAll(e){let s=this.size;for(var t=0,a=e.length;t<a;t++)this.add(e[t]);return s!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},ve=class{constructor(e=0,s=0,t=0,a=0){this.r=e,this.g=s,this.b=t,this.a=a}set(e,s,t,a){return this.r=e,this.g=s,this.b=t,this.a=a,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,s,t,a){return this.r+=e,this.g+=s,this.b+=t,this.a+=a,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(e,s){e.r=((s&4278190080)>>>24)/255,e.g=((s&16711680)>>>16)/255,e.b=((s&65280)>>>8)/255,e.a=(s&255)/255}static rgb888ToColor(e,s){e.r=((s&16711680)>>>16)/255,e.g=((s&65280)>>>8)/255,e.b=(s&255)/255}static fromString(e){return new ve().setFromString(e)}},D=ve;D.WHITE=new ve(1,1,1,1),D.RED=new ve(1,0,0,1),D.GREEN=new ve(0,1,0,1),D.BLUE=new ve(0,0,1,1),D.MAGENTA=new ve(1,0,1,1);var me=class{static clamp(e,s,t){return e<s?s:e>t?t:e}static cosDeg(e){return Math.cos(e*me.degRad)}static sinDeg(e){return Math.sin(e*me.degRad)}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let s=Math.pow(Math.abs(e),1/3);return e<0?-s:s}static randomTriangular(e,s){return me.randomTriangularWith(e,s,(e+s)*.5)}static randomTriangularWith(e,s,t){let a=Math.random(),r=s-e;return a<=(t-e)/r?e+Math.sqrt(a*r*(t-e)):s-Math.sqrt((1-a)*r*(s-t))}static isPowerOfTwo(e){return e&&(e&e-1)==0}},X=me;X.PI=3.1415927,X.PI2=me.PI*2,X.radiansToDegrees=180/me.PI,X.radDeg=me.radiansToDegrees,X.degreesToRadians=me.PI/180,X.degRad=me.degreesToRadians;var zt=class{apply(e,s,t){return e+(s-e)*this.applyInternal(t)}},_t=class extends zt{constructor(e){super();this.power=2,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}},Ht=class extends _t{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},Ce=class{static arrayCopy(e,s,t,a,r){for(let c=s,l=a;c<s+r;c++,l++)t[l]=e[c]}static arrayFill(e,s,t,a){for(let r=s;r<t;r++)e[r]=a}static setArraySize(e,s,t=0){let a=e.length;if(a==s)return e;if(e.length=s,a<s)for(let r=a;r<s;r++)e[r]=t;return e}static ensureArrayCapacity(e,s,t=0){return e.length>=s?e:Ce.setArraySize(e,s,t)}static newArray(e,s){let t=new Array(e);for(let a=0;a<e;a++)t[a]=s;return t}static newFloatArray(e){if(Ce.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let s=new Array(e);for(let t=0;t<s.length;t++)s[t]=0;return s}}static newShortArray(e){if(Ce.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let s=new Array(e);for(let t=0;t<s.length;t++)s[t]=0;return s}}static toFloatArray(e){return Ce.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return Ce.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,s){}static contains(e,s,t=!0){for(var a=0;a<e.length;a++)if(e[a]==s)return!0;return!1}static enumValue(e,s){return e[s[0].toUpperCase()+s.slice(1)]}},E=Ce;E.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var Ss=class{static logBones(e){for(let s=0;s<e.bones.length;s++){let t=e.bones[s];console.log(t.data.name+", "+t.a+", "+t.b+", "+t.c+", "+t.d+", "+t.worldX+", "+t.worldY)}}},Pe=class{constructor(e){this.items=new Array,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 s=0;s<e.length;s++)this.free(e[s])}clear(){this.items.length=0}},jt=class{constructor(e=0,s=0){this.x=e,this.y=s}set(e,s){return this.x=e,this.y=s,this}length(){let e=this.x,s=this.y;return Math.sqrt(e*e+s*s)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},As=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let 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)}},ks=class{constructor(e=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,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 s=0;s<this.values.length;s++)e+=this.values[s];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Qe=class{constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},Gt=class extends Qe{constructor(e){super(e);this.id=Gt.nextID++,this.bones=null,this.vertices=null,this.worldVerticesLength=0,this.timelineAttahment=this}computeWorldVertices(e,s,t,a,r,c){t=r+(t>>1)*c;let l=e.bone.skeleton,i=e.deform,n=this.vertices,o=this.bones;if(!o){i.length>0&&(n=i);let u=e.bone,m=u.worldX,x=u.worldY,p=u.a,y=u.b,g=u.c,w=u.d;for(let b=s,v=r;v<t;b+=2,v+=c){let A=n[b],S=n[b+1];a[v]=A*p+S*y+m,a[v+1]=A*g+S*w+x}return}let h=0,d=0;for(let u=0;u<s;u+=2){let m=o[h];h+=m+1,d+=m}let f=l.bones;if(i.length==0)for(let u=r,m=d*3;u<t;u+=c){let x=0,p=0,y=o[h++];for(y+=h;h<y;h++,m+=3){let g=f[o[h]],w=n[m],b=n[m+1],v=n[m+2];x+=(w*g.a+b*g.b+g.worldX)*v,p+=(w*g.c+b*g.d+g.worldY)*v}a[u]=x,a[u+1]=p}else{let u=i;for(let m=r,x=d*3,p=d<<1;m<t;m+=c){let y=0,g=0,w=o[h++];for(w+=h;h<w;h++,x+=3,p+=2){let b=f[o[h]],v=n[x]+u[p],A=n[x+1]+u[p+1],S=n[x+2];y+=(v*b.a+A*b.b+b.worldX)*S,g+=(v*b.c+A*b.d+b.worldY)*S}a[m]=y,a[m+1]=g}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),E.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices?(e.vertices=E.newFloatArray(this.vertices.length),E.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)):e.vertices=null,e.worldVerticesLength=this.worldVerticesLength,e.timelineAttahment=this.timelineAttahment}},ae=Gt;ae.nextID=0;var Ne=class{constructor(e){this.id=Ne.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(e)}copy(){let e=new Ne(this.regions.length);return E.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,s){let t=e.sequenceIndex;t==-1&&(t=this.setupIndex),t>=this.regions.length&&(t=this.regions.length-1);let a=this.regions[t];s.region!=a&&(s.region=a,s.updateRegion())}getPath(e,s){let t=e,a=(this.start+s).toString();for(let r=this.digits-a.length;r>0;r--)t+="0";return t+=a,t}static nextID(){return Ne._nextID++}},Ke=Ne;Ke._nextID=0;var de;(function(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"})(de||(de={}));var $t=[0,1,2,3,4,5,6],Oe=class{constructor(e,s,t){if(this.timelines=null,this.timelineIds=null,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(s),this.duration=t}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds=new Je;for(var s=0;s<e.length;s++)this.timelineIds.addAll(e[s].getPropertyIds())}hasTimeline(e){for(let s=0;s<e.length;s++)if(this.timelineIds.contains(e[s]))return!0;return!1}apply(e,s,t,a,r,c,l,i){if(!e)throw new Error("skeleton cannot be null.");a&&this.duration!=0&&(t%=this.duration,s>0&&(s%=this.duration));let n=this.timelines;for(let o=0,h=n.length;o<h;o++)n[o].apply(e,s,t,r,c,l,i)}},$;(function(e){e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add"})($||($={}));var ge;(function(e){e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut"})(ge||(ge={}));var j={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,sequence:19},J=class{constructor(e,s){this.propertyIds=null,this.frames=null,this.propertyIds=s,this.frames=E.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,s){let t=e.length;for(let a=1;a<t;a++)if(e[a]>s)return a-1;return t-1}static search(e,s,t){let a=e.length;for(let r=t;r<a;r+=t)if(e[r]>s)return r-t;return a-t}},ne=class extends J{constructor(e,s,t){super(e,t);this.curves=null,this.curves=E.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let s=this.getFrameCount()+e*18;if(this.curves.length>s){let t=E.newFloatArray(s);E.arrayCopy(this.curves,0,t,0,s),this.curves=t}}setBezier(e,s,t,a,r,c,l,i,n,o,h){let d=this.curves,f=this.getFrameCount()+e*18;t==0&&(d[s]=2+f);let u=(a-c*2+i)*.03,m=(r-l*2+n)*.03,x=((c-i)*3-a+o)*.006,p=((l-n)*3-r+h)*.006,y=u*2+x,g=m*2+p,w=(c-a)*.3+u+x*.16666667,b=(l-r)*.3+m+p*.16666667,v=a+w,A=r+b;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,b+=g,y+=x,g+=p,v+=w,A+=b}getBezierValue(e,s,t,a){let r=this.curves;if(r[a]>e){let n=this.frames[s],o=this.frames[s+t];return o+(e-n)/(r[a]-n)*(r[a+1]-o)}let c=a+18;for(a+=2;a<c;a+=2)if(r[a]>=e){let n=r[a-2],o=r[a-1];return o+(e-n)/(r[a]-n)*(r[a+1]-o)}s+=this.getFrameEntries();let l=r[c-2],i=r[c-1];return i+(e-l)/(this.frames[s]-l)*(this.frames[s+t]-i)}},le=class extends ne{constructor(e,s,t){super(e,s,[t])}getFrameEntries(){return 2}setFrame(e,s,t){e<<=1,this.frames[e]=s,this.frames[e+1]=t}getCurveValue(e){let s=this.frames,t=s.length-2;for(let r=2;r<=t;r+=2)if(s[r]>e){t=r-2;break}let a=this.curves[t>>1];switch(a){case 0:let r=s[t],c=s[t+1];return c+(e-r)/(s[t+2]-r)*(s[t+2+1]-c);case 1:return s[t+1]}return this.getBezierValue(e,t,1,a-2)}},qe=class extends ne{constructor(e,s,t,a){super(e,s,[t,a])}getFrameEntries(){return 3}setFrame(e,s,t,a){e*=3,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a}},Le=class extends le{constructor(e,s,t){super(e,s,j.rotate+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.rotation=i.data.rotation;return;case 1:i.rotation+=(i.data.rotation-i.rotation)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.rotation=i.data.rotation+o*r;break;case 1:case 2:o+=i.data.rotation-i.rotation;case 3:i.rotation+=o*r}}},Ze=class extends qe{constructor(e,s,t){super(e,s,j.x+"|"+t,j.y+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.x=i.data.x,i.y=i.data.y;return;case 1:i.x+=(i.data.x-i.x)*r,i.y+=(i.data.y-i.y)*r}return}let o=0,h=0,d=J.search(n,t,3),f=this.curves[d/3];switch(f){case 0:let u=n[d];o=n[d+1],h=n[d+2];let m=(t-u)/(n[d+3]-u);o+=(n[d+3+1]-o)*m,h+=(n[d+3+2]-h)*m;break;case 1:o=n[d+1],h=n[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}switch(c){case 0:i.x=i.data.x+o*r,i.y=i.data.y+h*r;break;case 1:case 2:i.x+=(i.data.x+o-i.x)*r,i.y+=(i.data.y+h-i.y)*r;break;case 3:i.x+=o*r,i.y+=h*r}}},et=class extends le{constructor(e,s,t){super(e,s,j.x+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.x=i.data.x;return;case 1:i.x+=(i.data.x-i.x)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.x=i.data.x+o*r;break;case 1:case 2:i.x+=(i.data.x+o-i.x)*r;break;case 3:i.x+=o*r}}},tt=class extends le{constructor(e,s,t){super(e,s,j.y+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.y=i.data.y;return;case 1:i.y+=(i.data.y-i.y)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.y=i.data.y+o*r;break;case 1:case 2:i.y+=(i.data.y+o-i.y)*r;break;case 3:i.y+=o*r}}},st=class extends qe{constructor(e,s,t){super(e,s,j.scaleX+"|"+t,j.scaleY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.scaleX=i.data.scaleX,i.scaleY=i.data.scaleY;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*r,i.scaleY+=(i.data.scaleY-i.scaleY)*r}return}let o,h,d=J.search(n,t,3),f=this.curves[d/3];switch(f){case 0:let u=n[d];o=n[d+1],h=n[d+2];let m=(t-u)/(n[d+3]-u);o+=(n[d+3+1]-o)*m,h+=(n[d+3+2]-h)*m;break;case 1:o=n[d+1],h=n[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}if(o*=i.data.scaleX,h*=i.data.scaleY,r==1)c==3?(i.scaleX+=o-i.data.scaleX,i.scaleY+=h-i.data.scaleY):(i.scaleX=o,i.scaleY=h);else{let u=0,m=0;if(l==1)switch(c){case 0:u=i.data.scaleX,m=i.data.scaleY,i.scaleX=u+(Math.abs(o)*X.signum(u)-u)*r,i.scaleY=m+(Math.abs(h)*X.signum(m)-m)*r;break;case 1:case 2:u=i.scaleX,m=i.scaleY,i.scaleX=u+(Math.abs(o)*X.signum(u)-u)*r,i.scaleY=m+(Math.abs(h)*X.signum(m)-m)*r;break;case 3:i.scaleX+=(o-i.data.scaleX)*r,i.scaleY+=(h-i.data.scaleY)*r}else switch(c){case 0:u=Math.abs(i.data.scaleX)*X.signum(o),m=Math.abs(i.data.scaleY)*X.signum(h),i.scaleX=u+(o-u)*r,i.scaleY=m+(h-m)*r;break;case 1:case 2:u=Math.abs(i.scaleX)*X.signum(o),m=Math.abs(i.scaleY)*X.signum(h),i.scaleX=u+(o-u)*r,i.scaleY=m+(h-m)*r;break;case 3:i.scaleX+=(o-i.data.scaleX)*r,i.scaleY+=(h-i.data.scaleY)*r}}}},it=class extends le{constructor(e,s,t){super(e,s,j.scaleX+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.scaleX=i.data.scaleX;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*r}return}let o=this.getCurveValue(t)*i.data.scaleX;if(r==1)c==3?i.scaleX+=o-i.data.scaleX:i.scaleX=o;else{let h=0;if(l==1)switch(c){case 0:h=i.data.scaleX,i.scaleX=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 1:case 2:h=i.scaleX,i.scaleX=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 3:i.scaleX+=(o-i.data.scaleX)*r}else switch(c){case 0:h=Math.abs(i.data.scaleX)*X.signum(o),i.scaleX=h+(o-h)*r;break;case 1:case 2:h=Math.abs(i.scaleX)*X.signum(o),i.scaleX=h+(o-h)*r;break;case 3:i.scaleX+=(o-i.data.scaleX)*r}}}},rt=class extends le{constructor(e,s,t){super(e,s,j.scaleY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.scaleY=i.data.scaleY;return;case 1:i.scaleY+=(i.data.scaleY-i.scaleY)*r}return}let o=this.getCurveValue(t)*i.data.scaleY;if(r==1)c==3?i.scaleY+=o-i.data.scaleY:i.scaleY=o;else{let h=0;if(l==1)switch(c){case 0:h=i.data.scaleY,i.scaleY=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 1:case 2:h=i.scaleY,i.scaleY=h+(Math.abs(o)*X.signum(h)-h)*r;break;case 3:i.scaleY+=(o-i.data.scaleY)*r}else switch(c){case 0:h=Math.abs(i.data.scaleY)*X.signum(o),i.scaleY=h+(o-h)*r;break;case 1:case 2:h=Math.abs(i.scaleY)*X.signum(o),i.scaleY=h+(o-h)*r;break;case 3:i.scaleY+=(o-i.data.scaleY)*r}}}},at=class extends qe{constructor(e,s,t){super(e,s,j.shearX+"|"+t,j.shearY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.shearX=i.data.shearX,i.shearY=i.data.shearY;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*r,i.shearY+=(i.data.shearY-i.shearY)*r}return}let o=0,h=0,d=J.search(n,t,3),f=this.curves[d/3];switch(f){case 0:let u=n[d];o=n[d+1],h=n[d+2];let m=(t-u)/(n[d+3]-u);o+=(n[d+3+1]-o)*m,h+=(n[d+3+2]-h)*m;break;case 1:o=n[d+1],h=n[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}switch(c){case 0:i.shearX=i.data.shearX+o*r,i.shearY=i.data.shearY+h*r;break;case 1:case 2:i.shearX+=(i.data.shearX+o-i.shearX)*r,i.shearY+=(i.data.shearY+h-i.shearY)*r;break;case 3:i.shearX+=o*r,i.shearY+=h*r}}},nt=class extends le{constructor(e,s,t){super(e,s,j.shearX+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.shearX=i.data.shearX;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.shearX=i.data.shearX+o*r;break;case 1:case 2:i.shearX+=(i.data.shearX+o-i.shearX)*r;break;case 3:i.shearX+=o*r}}},lt=class extends le{constructor(e,s,t){super(e,s,j.shearY+"|"+t);this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.shearY=i.data.shearY;return;case 1:i.shearY+=(i.data.shearY-i.shearY)*r}return}let o=this.getCurveValue(t);switch(c){case 0:i.shearY=i.data.shearY+o*r;break;case 1:case 2:i.shearY+=(i.data.shearY+o-i.shearY)*r;break;case 3:i.shearY+=o*r}}},ot=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t,j.alpha+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 5}setFrame(e,s,t,a,r,c){e*=5,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=this.frames,o=i.color;if(t<n[0]){let p=i.data.color;switch(c){case 0:o.setFromColor(p);return;case 1:o.add((p.r-o.r)*r,(p.g-o.g)*r,(p.b-o.b)*r,(p.a-o.a)*r)}return}let h=0,d=0,f=0,u=0,m=J.search(n,t,5),x=this.curves[m/5];switch(x){case 0:let p=n[m];h=n[m+1],d=n[m+2],f=n[m+3],u=n[m+4];let y=(t-p)/(n[m+5]-p);h+=(n[m+5+1]-h)*y,d+=(n[m+5+2]-d)*y,f+=(n[m+5+3]-f)*y,u+=(n[m+5+4]-u)*y;break;case 1:h=n[m+1],d=n[m+2],f=n[m+3],u=n[m+4];break;default:h=this.getBezierValue(t,m,1,x-2),d=this.getBezierValue(t,m,2,x+18-2),f=this.getBezierValue(t,m,3,x+18*2-2),u=this.getBezierValue(t,m,4,x+18*3-2)}r==1?o.set(h,d,f,u):(c==0&&o.setFromColor(i.data.color),o.add((h-o.r)*r,(d-o.g)*r,(f-o.b)*r,(u-o.a)*r))}},ht=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 4}setFrame(e,s,t,a,r){e<<=2,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=this.frames,o=i.color;if(t<n[0]){let x=i.data.color;switch(c){case 0:o.r=x.r,o.g=x.g,o.b=x.b;return;case 1:o.r+=(x.r-o.r)*r,o.g+=(x.g-o.g)*r,o.b+=(x.b-o.b)*r}return}let h=0,d=0,f=0,u=J.search(n,t,4),m=this.curves[u>>2];switch(m){case 0:let x=n[u];h=n[u+1],d=n[u+2],f=n[u+3];let p=(t-x)/(n[u+4]-x);h+=(n[u+4+1]-h)*p,d+=(n[u+4+2]-d)*p,f+=(n[u+4+3]-f)*p;break;case 1:h=n[u+1],d=n[u+2],f=n[u+3];break;default:h=this.getBezierValue(t,u,1,m-2),d=this.getBezierValue(t,u,2,m+18-2),f=this.getBezierValue(t,u,3,m+18*2-2)}if(r==1)o.r=h,o.g=d,o.b=f;else{if(c==0){let x=i.data.color;o.r=x.r,o.g=x.g,o.b=x.b}o.r+=(h-o.r)*r,o.g+=(d-o.g)*r,o.b+=(f-o.b)*r}}},ct=class extends le{constructor(e,s,t){super(e,s,j.alpha+"|"+t);this.slotIndex=0,this.slotIndex=t}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=i.color;if(t<this.frames[0]){let h=i.data.color;switch(c){case 0:n.a=h.a;return;case 1:n.a+=(h.a-n.a)*r}return}let o=this.getCurveValue(t);r==1?n.a=o:(c==0&&(n.a=i.data.color.a),n.a+=(o-n.a)*r)}},dt=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t,j.alpha+"|"+t,j.rgb2+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 8}setFrame(e,s,t,a,r,c,l,i,n){e<<=3,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=l,this.frames[e+6]=i,this.frames[e+7]=n}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=this.frames,o=i.color,h=i.darkColor;if(t<n[0]){let b=i.data.color,v=i.data.darkColor;switch(c){case 0:o.setFromColor(b),h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:o.add((b.r-o.r)*r,(b.g-o.g)*r,(b.b-o.b)*r,(b.a-o.a)*r),h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,m=0,x=0,p=0,y=0,g=J.search(n,t,8),w=this.curves[g>>3];switch(w){case 0:let b=n[g];d=n[g+1],f=n[g+2],u=n[g+3],m=n[g+4],x=n[g+5],p=n[g+6],y=n[g+7];let v=(t-b)/(n[g+8]-b);d+=(n[g+8+1]-d)*v,f+=(n[g+8+2]-f)*v,u+=(n[g+8+3]-u)*v,m+=(n[g+8+4]-m)*v,x+=(n[g+8+5]-x)*v,p+=(n[g+8+6]-p)*v,y+=(n[g+8+7]-y)*v;break;case 1:d=n[g+1],f=n[g+2],u=n[g+3],m=n[g+4],x=n[g+5],p=n[g+6],y=n[g+7];break;default:d=this.getBezierValue(t,g,1,w-2),f=this.getBezierValue(t,g,2,w+18-2),u=this.getBezierValue(t,g,3,w+18*2-2),m=this.getBezierValue(t,g,4,w+18*3-2),x=this.getBezierValue(t,g,5,w+18*4-2),p=this.getBezierValue(t,g,6,w+18*5-2),y=this.getBezierValue(t,g,7,w+18*6-2)}if(r==1)o.set(d,f,u,m),h.r=x,h.g=p,h.b=y;else{if(c==0){o.setFromColor(i.data.color);let b=i.data.darkColor;h.r=b.r,h.g=b.g,h.b=b.b}o.add((d-o.r)*r,(f-o.g)*r,(u-o.b)*r,(m-o.a)*r),h.r+=(x-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},ft=class extends ne{constructor(e,s,t){super(e,s,[j.rgb+"|"+t,j.rgb2+"|"+t]);this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 7}setFrame(e,s,t,a,r,c,l,i){e*=7,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=l,this.frames[e+6]=i}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=this.frames,o=i.color,h=i.darkColor;if(t<n[0]){let b=i.data.color,v=i.data.darkColor;switch(c){case 0:o.r=b.r,o.g=b.g,o.b=b.b,h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:o.r+=(b.r-o.r)*r,o.g+=(b.g-o.g)*r,o.b+=(b.b-o.b)*r,h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,m=0,x=0,p=0,y=0,g=J.search(n,t,7),w=this.curves[g/7];switch(w){case 0:let b=n[g];d=n[g+1],f=n[g+2],u=n[g+3],x=n[g+4],p=n[g+5],y=n[g+6];let v=(t-b)/(n[g+7]-b);d+=(n[g+7+1]-d)*v,f+=(n[g+7+2]-f)*v,u+=(n[g+7+3]-u)*v,x+=(n[g+7+4]-x)*v,p+=(n[g+7+5]-p)*v,y+=(n[g+7+6]-y)*v;break;case 1:d=n[g+1],f=n[g+2],u=n[g+3],x=n[g+4],p=n[g+5],y=n[g+6];break;default:d=this.getBezierValue(t,g,1,w-2),f=this.getBezierValue(t,g,2,w+18-2),u=this.getBezierValue(t,g,3,w+18*2-2),x=this.getBezierValue(t,g,4,w+18*3-2),p=this.getBezierValue(t,g,5,w+18*4-2),y=this.getBezierValue(t,g,6,w+18*5-2)}if(r==1)o.r=d,o.g=f,o.b=u,h.r=x,h.g=p,h.b=y;else{if(c==0){let b=i.data.color,v=i.data.darkColor;o.r=b.r,o.g=b.g,o.b=b.b,h.r=v.r,h.g=v.g,h.b=v.b}o.r+=(d-o.r)*r,o.g+=(f-o.g)*r,o.b+=(u-o.b)*r,h.r+=(x-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},Se=class extends J{constructor(e,s){super(e,[j.attachment+"|"+s]);this.slotIndex=0,this.slotIndex=s,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.attachmentNames[e]=t}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!!i.bone.active){if(l==1){c==0&&this.setAttachment(e,i,i.data.attachmentName);return}if(t<this.frames[0]){(c==0||c==1)&&this.setAttachment(e,i,i.data.attachmentName);return}this.setAttachment(e,i,this.attachmentNames[J.search1(this.frames,t)])}}setAttachment(e,s,t){s.setAttachment(t?e.getAttachment(this.slotIndex,t):null)}},ut=class extends ne{constructor(e,s,t,a){super(e,s,[j.deform+"|"+t+"|"+a.id]);this.slotIndex=0,this.attachment=null,this.vertices=null,this.slotIndex=t,this.attachment=a,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.vertices[e]=t}setBezier(e,s,t,a,r,c,l,i,n,o,h){let d=this.curves,f=this.getFrameCount()+e*18;t==0&&(d[s]=2+f);let u=(a-c*2+i)*.03,m=n*.03-l*.06,x=((c-i)*3-a+o)*.006,p=(l-n+.33333333)*.018,y=u*2+x,g=m*2+p,w=(c-a)*.3+u+x*.16666667,b=l*.3+m+p*.16666667,v=a+w,A=b;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,b+=g,y+=x,g+=p,v+=w,A+=b}getCurvePercent(e,s){let t=this.curves,a=t[s];switch(a){case 0:let i=this.frames[s];return(e-i)/(this.frames[s+this.getFrameEntries()]-i);case 1:return 0}if(a-=2,t[a]>e){let i=this.frames[s];return t[a+1]*(e-i)/(t[a]-i)}let r=a+18;for(a+=2;a<r;a+=2)if(t[a]>=e){let i=t[a-2],n=t[a-1];return n+(e-i)/(t[a]-i)*(t[a+1]-n)}let c=t[r-2],l=t[r-1];return l+(1-l)*(e-c)/(this.frames[s+this.getFrameEntries()]-c)}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=i.getAttachment();if(!(n instanceof ae)||n.timelineAttahment!=this.attachment)return;let o=i.deform;o.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(t<f[0]){switch(c){case 0:o.length=0;return;case 1:if(r==1){o.length=0;return}o.length=d;let g=n;if(g.bones){r=1-r;for(var u=0;u<d;u++)o[u]*=r}else{let w=g.vertices;for(var u=0;u<d;u++)o[u]+=(w[u]-o[u])*r}}return}if(o.length=d,t>=f[f.length-1]){let g=h[f.length-1];if(r==1)if(c==3){let w=n;if(w.bones)for(let b=0;b<d;b++)o[b]+=g[b];else{let b=w.vertices;for(let v=0;v<d;v++)o[v]+=g[v]-b[v]}}else E.arrayCopy(g,0,o,0,d);else switch(c){case 0:{let b=n;if(b.bones)for(let v=0;v<d;v++)o[v]=g[v]*r;else{let v=b.vertices;for(let A=0;A<d;A++){let S=v[A];o[A]=S+(g[A]-S)*r}}break}case 1:case 2:for(let b=0;b<d;b++)o[b]+=(g[b]-o[b])*r;break;case 3:let w=n;if(w.bones)for(let b=0;b<d;b++)o[b]+=g[b]*r;else{let b=w.vertices;for(let v=0;v<d;v++)o[v]+=(g[v]-b[v])*r}}return}let m=J.search1(f,t),x=this.getCurvePercent(t,m),p=h[m],y=h[m+1];if(r==1)if(c==3){let g=n;if(g.bones)for(let w=0;w<d;w++){let b=p[w];o[w]+=b+(y[w]-b)*x}else{let w=g.vertices;for(let b=0;b<d;b++){let v=p[b];o[b]+=v+(y[b]-v)*x-w[b]}}}else for(let g=0;g<d;g++){let w=p[g];o[g]=w+(y[g]-w)*x}else switch(c){case 0:{let w=n;if(w.bones)for(let b=0;b<d;b++){let v=p[b];o[b]=(v+(y[b]-v)*x)*r}else{let b=w.vertices;for(let v=0;v<d;v++){let A=p[v],S=b[v];o[v]=S+(A+(y[v]-A)*x-S)*r}}break}case 1:case 2:for(let w=0;w<d;w++){let b=p[w];o[w]+=(b+(y[w]-b)*x-o[w])*r}break;case 3:let g=n;if(g.bones)for(let w=0;w<d;w++){let b=p[w];o[w]+=(b+(y[w]-b)*x)*r}else{let w=g.vertices;for(let b=0;b<d;b++){let v=p[b];o[b]+=(v+(y[b]-v)*x-w[b])*r}}}}},Jt=class extends J{constructor(e){super(e,Jt.propertyIds);this.events=null,this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s.time,this.events[e]=s}apply(e,s,t,a,r,c,l){if(!a)return;let i=this.frames,n=this.frames.length;if(s>t)this.apply(e,s,Number.MAX_VALUE,a,r,c,l),s=-1;else if(s>=i[n-1])return;if(t<i[0])return;let o=0;if(s<i[0])o=0;else{o=J.search1(i,s)+1;let h=i[o];for(;o>0&&i[o-1]==h;)o--}for(;o<n&&t>=i[o];o++)a.push(this.events[o])}},Ve=Jt;Ve.propertyIds=[""+j.event];var Qt=class extends J{constructor(e){super(e,Qt.propertyIds);this.drawOrders=null,this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.drawOrders[e]=t}apply(e,s,t,a,r,c,l){if(l==1){c==0&&E.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(t<this.frames[0]){(c==0||c==1)&&E.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let i=this.drawOrders[J.search1(this.frames,t)];if(!i)E.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let n=e.drawOrder,o=e.slots;for(let h=0,d=i.length;h<d;h++)n[h]=o[i[h]]}}},Ae=Qt;Ae.propertyIds=[""+j.drawOrder];var mt=class extends ne{constructor(e,s,t){super(e,s,[j.ikConstraint+"|"+t]);this.ikConstraintIndex=0,this.ikConstraintIndex=t}getFrameEntries(){return 6}setFrame(e,s,t,a,r,c,l){e*=6,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c?1:0,this.frames[e+5]=l?1:0}apply(e,s,t,a,r,c,l){let i=e.ikConstraints[this.ikConstraintIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch;return;case 1:i.mix+=(i.data.mix-i.mix)*r,i.softness+=(i.data.softness-i.softness)*r,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}return}let o=0,h=0,d=J.search(n,t,6),f=this.curves[d/6];switch(f){case 0:let u=n[d];o=n[d+1],h=n[d+2];let m=(t-u)/(n[d+6]-u);o+=(n[d+6+1]-o)*m,h+=(n[d+6+2]-h)*m;break;case 1:o=n[d+1],h=n[d+2];break;default:o=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}c==0?(i.mix=i.data.mix+(o-i.data.mix)*r,i.softness=i.data.softness+(h-i.data.softness)*r,l==1?(i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch):(i.bendDirection=n[d+3],i.compress=n[d+4]!=0,i.stretch=n[d+5]!=0)):(i.mix+=(o-i.mix)*r,i.softness+=(h-i.softness)*r,l==0&&(i.bendDirection=n[d+3],i.compress=n[d+4]!=0,i.stretch=n[d+5]!=0))}},gt=class extends ne{constructor(e,s,t){super(e,s,[j.transformConstraint+"|"+t]);this.transformConstraintIndex=0,this.transformConstraintIndex=t}getFrameEntries(){return 7}setFrame(e,s,t,a,r,c,l,i){let n=this.frames;e*=7,n[e]=s,n[e+1]=t,n[e+2]=a,n[e+3]=r,n[e+4]=c,n[e+5]=l,n[e+6]=i}apply(e,s,t,a,r,c,l){let i=e.transformConstraints[this.transformConstraintIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){let y=i.data;switch(c){case 0:i.mixRotate=y.mixRotate,i.mixX=y.mixX,i.mixY=y.mixY,i.mixScaleX=y.mixScaleX,i.mixScaleY=y.mixScaleY,i.mixShearY=y.mixShearY;return;case 1:i.mixRotate+=(y.mixRotate-i.mixRotate)*r,i.mixX+=(y.mixX-i.mixX)*r,i.mixY+=(y.mixY-i.mixY)*r,i.mixScaleX+=(y.mixScaleX-i.mixScaleX)*r,i.mixScaleY+=(y.mixScaleY-i.mixScaleY)*r,i.mixShearY+=(y.mixShearY-i.mixShearY)*r}return}let o,h,d,f,u,m,x=J.search(n,t,7),p=this.curves[x/7];switch(p){case 0:let y=n[x];o=n[x+1],h=n[x+2],d=n[x+3],f=n[x+4],u=n[x+5],m=n[x+6];let g=(t-y)/(n[x+7]-y);o+=(n[x+7+1]-o)*g,h+=(n[x+7+2]-h)*g,d+=(n[x+7+3]-d)*g,f+=(n[x+7+4]-f)*g,u+=(n[x+7+5]-u)*g,m+=(n[x+7+6]-m)*g;break;case 1:o=n[x+1],h=n[x+2],d=n[x+3],f=n[x+4],u=n[x+5],m=n[x+6];break;default:o=this.getBezierValue(t,x,1,p-2),h=this.getBezierValue(t,x,2,p+18-2),d=this.getBezierValue(t,x,3,p+18*2-2),f=this.getBezierValue(t,x,4,p+18*3-2),u=this.getBezierValue(t,x,5,p+18*4-2),m=this.getBezierValue(t,x,6,p+18*5-2)}if(c==0){let y=i.data;i.mixRotate=y.mixRotate+(o-y.mixRotate)*r,i.mixX=y.mixX+(h-y.mixX)*r,i.mixY=y.mixY+(d-y.mixY)*r,i.mixScaleX=y.mixScaleX+(f-y.mixScaleX)*r,i.mixScaleY=y.mixScaleY+(u-y.mixScaleY)*r,i.mixShearY=y.mixShearY+(m-y.mixShearY)*r}else i.mixRotate+=(o-i.mixRotate)*r,i.mixX+=(h-i.mixX)*r,i.mixY+=(d-i.mixY)*r,i.mixScaleX+=(f-i.mixScaleX)*r,i.mixScaleY+=(u-i.mixScaleY)*r,i.mixShearY+=(m-i.mixShearY)*r}},xt=class extends le{constructor(e,s,t){super(e,s,j.pathConstraintPosition+"|"+t);this.pathConstraintIndex=0,this.pathConstraintIndex=t}apply(e,s,t,a,r,c,l){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.position=i.data.position;return;case 1:i.position+=(i.data.position-i.position)*r}return}let o=this.getCurveValue(t);c==0?i.position=i.data.position+(o-i.data.position)*r:i.position+=(o-i.position)*r}},bt=class extends le{constructor(e,s,t){super(e,s,j.pathConstraintSpacing+"|"+t);this.pathConstraintIndex=0,this.pathConstraintIndex=t}apply(e,s,t,a,r,c,l){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.spacing=i.data.spacing;return;case 1:i.spacing+=(i.data.spacing-i.spacing)*r}return}let o=this.getCurveValue(t);c==0?i.spacing=i.data.spacing+(o-i.data.spacing)*r:i.spacing+=(o-i.spacing)*r}},wt=class extends ne{constructor(e,s,t){super(e,s,[j.pathConstraintMix+"|"+t]);this.pathConstraintIndex=0,this.pathConstraintIndex=t}getFrameEntries(){return 4}setFrame(e,s,t,a,r){let c=this.frames;e<<=2,c[e]=s,c[e+1]=t,c[e+2]=a,c[e+3]=r}apply(e,s,t,a,r,c,l){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let n=this.frames;if(t<n[0]){switch(c){case 0:i.mixRotate=i.data.mixRotate,i.mixX=i.data.mixX,i.mixY=i.data.mixY;return;case 1:i.mixRotate+=(i.data.mixRotate-i.mixRotate)*r,i.mixX+=(i.data.mixX-i.mixX)*r,i.mixY+=(i.data.mixY-i.mixY)*r}return}let o,h,d,f=J.search(n,t,4),u=this.curves[f>>2];switch(u){case 0:let m=n[f];o=n[f+1],h=n[f+2],d=n[f+3];let x=(t-m)/(n[f+4]-m);o+=(n[f+4+1]-o)*x,h+=(n[f+4+2]-h)*x,d+=(n[f+4+3]-d)*x;break;case 1:o=n[f+1],h=n[f+2],d=n[f+3];break;default:o=this.getBezierValue(t,f,1,u-2),h=this.getBezierValue(t,f,2,u+18-2),d=this.getBezierValue(t,f,3,u+18*2-2)}if(c==0){let m=i.data;i.mixRotate=m.mixRotate+(o-m.mixRotate)*r,i.mixX=m.mixX+(h-m.mixX)*r,i.mixY=m.mixY+(d-m.mixY)*r}else i.mixRotate+=(o-i.mixRotate)*r,i.mixX+=(h-i.mixX)*r,i.mixY+=(d-i.mixY)*r}},pe=class extends J{constructor(e,s,t){super(e,[j.sequence+"|"+s+"|"+t.sequence.id]);this.slotIndex=s,this.attachment=t}getFrameEntries(){return pe.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,s,t,a,r){let c=this.frames;e*=pe.ENTRIES,c[e]=s,c[e+pe.MODE]=t|a<<4,c[e+pe.DELAY]=r}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let n=i.attachment,o=this.attachment;if(n!=o&&(!(n instanceof ae)||n.timelineAttahment!=o))return;let h=this.frames;if(t<h[0]){(c==0||c==1)&&(i.sequenceIndex=-1);return}let d=J.search(h,t,pe.ENTRIES),f=h[d],u=h[d+pe.MODE],m=h[d+pe.DELAY],x=u>>4,p=this.attachment.sequence.regions.length,y=$t[u&15];if(y!=de.hold)switch(x+=(t-f)/m+1e-5|0,y){case de.once:x=Math.min(p-1,x);break;case de.loop:x%=p;break;case de.pingpong:{let g=(p<<1)-2;x%=g,x>=p&&(x=g-x);break}case de.onceReverse:x=Math.max(p-1-x,0);break;case de.loopReverse:x=p-1-x%p;break;case de.pingpongReverse:{let g=(p<<1)-2;x=(x+p-1)%g,x>=p&&(x=g-x)}}i.sequenceIndex=x}},Te=pe;Te.ENTRIES=3,Te.MODE=1,Te.DELAY=2;var pt=class{constructor(e){this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Zt(this),this.propertyIDs=new Je,this.animationsChanged=!1,this.trackEntryPool=new Pe(()=>new Kt),this.data=e}static emptyAnimation(){return At||(At=new Oe("<empty>",[],0)),At}update(e){e*=this.timeScale;let s=this.tracks;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let c=e*r.timeScale;if(r.delay>0){if(r.delay-=c,r.delay>0)continue;c=-r.delay,r.delay=0}let l=r.next;if(l){let i=r.trackLast-l.delay;if(i>=0){for(l.delay=0,l.trackTime+=r.timeScale==0?0:(i/r.timeScale+e)*l.timeScale,r.trackTime+=c,this.setCurrent(t,l,!0);l.mixingFrom;)l.mixTime+=e,l=l.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){s[t]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let i=r.mixingFrom;for(r.mixingFrom=null,i&&(i.mixingTo=null);i;)this.queue.end(i),i=i.mixingFrom}r.trackTime+=c}this.queue.drain()}updateMixingFrom(e,s){let t=e.mixingFrom;if(!t)return!0;let a=this.updateMixingFrom(t,s);return t.animationLast=t.nextAnimationLast,t.trackLast=t.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((t.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=t.mixingFrom,t.mixingFrom&&(t.mixingFrom.mixingTo=e),e.interruptAlpha=t.interruptAlpha,this.queue.end(t)),a):(t.trackTime+=s*t.timeScale,e.mixTime+=s,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,t=this.tracks,a=!1;for(let d=0,f=t.length;d<f;d++){let u=t[d];if(!u||u.delay>0)continue;a=!0;let m=d==0?$.first:u.mixBlend,x=u.alpha;u.mixingFrom?x*=this.applyMixingFrom(u,e,m):u.trackTime>=u.trackEnd&&!u.next&&(x=0);let p=u.animationLast,y=u.getAnimationTime(),g=y,w=s;u.reverse&&(g=u.animation.duration-g,w=null);let b=u.animation.timelines,v=b.length;if(d==0&&x==1||m==$.add)for(let A=0;A<v;A++){E.webkit602BugfixHelper(x,m);var r=b[A];r instanceof Se?this.applyAttachmentTimeline(r,e,g,m,!0):r.apply(e,p,g,w,x,m,ge.mixIn)}else{let A=u.timelineMode,S=u.shortestRotation,C=!S&&u.timelinesRotation.length!=v<<1;C&&(u.timelinesRotation.length=v<<1);for(let I=0;I<v;I++){let M=b[I],B=A[I]==Ue?m:$.setup;!S&&M instanceof Le?this.applyRotateTimeline(M,e,g,x,B,u.timelinesRotation,I<<1,C):M instanceof Se?this.applyAttachmentTimeline(M,e,g,m,!0):(E.webkit602BugfixHelper(x,m),M.apply(e,p,g,w,x,B,ge.mixIn))}}this.queueEvents(u,y),s.length=0,u.nextAnimationLast=y,u.nextTrackLast=u.trackTime}for(var c=this.unkeyedState+St,l=e.slots,i=0,n=e.slots.length;i<n;i++){var o=l[i];if(o.attachmentState==c){var h=o.data.attachmentName;o.setAttachment(h?e.getAttachment(o.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),a}applyMixingFrom(e,s,t){let a=e.mixingFrom;a.mixingFrom&&this.applyMixingFrom(a,s,t);let r=0;e.mixDuration==0?(r=1,t==$.first&&(t=$.setup)):(r=e.mixTime/e.mixDuration,r>1&&(r=1),t!=$.first&&(t=a.mixBlend));let c=r<a.attachmentThreshold,l=r<a.drawOrderThreshold,i=a.animation.timelines,n=i.length,o=a.alpha*e.interruptAlpha,h=o*(1-r),d=a.animationLast,f=a.getAnimationTime(),u=f,m=null;if(a.reverse?u=a.animation.duration-u:r<a.eventThreshold&&(m=this.events),t==$.add)for(let x=0;x<n;x++)i[x].apply(s,d,u,m,h,t,ge.mixOut);else{let x=a.timelineMode,p=a.timelineHoldMix,y=a.shortestRotation,g=!y&&a.timelinesRotation.length!=n<<1;g&&(a.timelinesRotation.length=n<<1),a.totalAlpha=0;for(let w=0;w<n;w++){let b=i[w],v=ge.mixOut,A,S=0;switch(x[w]){case Ue:if(!l&&b instanceof Ae)continue;A=t,S=h;break;case yt:A=$.setup,S=h;break;case vt:A=t,S=o;break;case We:A=$.setup,S=o;break;default:A=$.setup;let C=p[w];S=o*Math.max(0,1-C.mixTime/C.mixDuration);break}a.totalAlpha+=S,!y&&b instanceof Le?this.applyRotateTimeline(b,s,u,S,A,a.timelinesRotation,w<<1,g):b instanceof Se?this.applyAttachmentTimeline(b,s,u,A,c):(E.webkit602BugfixHelper(S,t),l&&b instanceof Ae&&A==$.setup&&(v=ge.mixIn),b.apply(s,d,u,m,S,A,v))}}return e.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(e,s,t,a,r){var c=s.slots[e.slotIndex];!c.bone.active||(t<e.frames[0]?(a==$.setup||a==$.first)&&this.setAttachment(s,c,c.data.attachmentName,r):this.setAttachment(s,c,e.attachmentNames[J.search1(e.frames,t)],r),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+St))}setAttachment(e,s,t,a){s.setAttachment(t?e.getAttachment(s.data.index,t):null),a&&(s.attachmentState=this.unkeyedState+ts)}applyRotateTimeline(e,s,t,a,r,c,l,i){if(i&&(c[l]=0),a==1){e.apply(s,0,t,null,1,r,ge.mixIn);return}let n=s.bones[e.boneIndex];if(!n.active)return;let o=e.frames,h=0,d=0;if(t<o[0])switch(r){case $.setup:n.rotation=n.data.rotation;default:return;case $.first:h=n.rotation,d=n.data.rotation}else h=r==$.setup?n.data.rotation:n.rotation,d=n.data.rotation+e.getCurveValue(t);let f=0,u=d-h;if(u-=(16384-(16384.499999999996-u/360|0))*360,u==0)f=c[l];else{let m=0,x=0;i?(m=0,x=u):(m=c[l],x=c[l+1]);let p=u>0,y=m>=0;X.signum(x)!=X.signum(u)&&Math.abs(x)<=90&&(Math.abs(m)>180&&(m+=360*X.signum(m)),y=p),f=u+m-m%360,y!=p&&(f+=360*X.signum(m)),c[l]=f}c[l+1]=u,n.rotation=h+f*a}queueEvents(e,s){let t=e.animationStart,a=e.animationEnd,r=a-t,c=e.trackLast%r,l=this.events,i=0,n=l.length;for(;i<n;i++){let h=l[i];if(h.time<c)break;h.time>a||this.queue.event(e,h)}let o=!1;for(e.loop?o=r==0||c>e.trackTime%r:o=s>=a&&e.animationLast<a,o&&this.queue.complete(e);i<n;i++){let h=l[i];h.time<t||this.queue.event(e,h)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,t=this.tracks.length;s<t;s++)this.clearTrack(s);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let s=this.tracks[e];if(!s)return;this.queue.end(s),this.clearNext(s);let t=s;for(;;){let a=t.mixingFrom;if(!a)break;this.queue.end(a),t.mixingFrom=null,t.mixingTo=null,t=a}this.tracks[s.trackIndex]=null,this.queue.drain()}setCurrent(e,s,t){let a=this.expandToIndex(e);this.tracks[e]=s,s.previous=null,a&&(t&&this.queue.interrupt(a),s.mixingFrom=a,a.mixingTo=s,s.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(s.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(s)}setAnimation(e,s,t=!1){let a=this.data.skeletonData.findAnimation(s);if(!a)throw new Error("Animation not found: "+s);return this.setAnimationWith(e,a,t)}setAnimationWith(e,s,t=!1){if(!s)throw new Error("animation cannot be null.");let a=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));let c=this.trackEntry(e,s,t,r);return this.setCurrent(e,c,a),this.queue.drain(),c}addAnimation(e,s,t=!1,a=0){let r=this.data.skeletonData.findAnimation(s);if(!r)throw new Error("Animation not found: "+s);return this.addAnimationWith(e,r,t,a)}addAnimationWith(e,s,t=!1,a=0){if(!s)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let c=this.trackEntry(e,s,t,r);return r?(r.next=c,c.previous=r,a<=0&&(a+=r.getTrackComplete()-c.mixDuration)):(this.setCurrent(e,c,!0),this.queue.drain()),c.delay=a,c}setEmptyAnimation(e,s=0){let t=this.setAnimationWith(e,pt.emptyAnimation(),!1);return t.mixDuration=s,t.trackEnd=s,t}addEmptyAnimation(e,s=0,t=0){let a=this.addAnimationWith(e,pt.emptyAnimation(),!1,t);return t<=0&&(a.delay+=a.mixDuration-s),a.mixDuration=s,a.trackEnd=s,a}setEmptyAnimations(e=0){let s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,a=this.tracks.length;t<a;t++){let r=this.tracks[t];r&&this.setEmptyAnimation(r.trackIndex,e)}this.queue.drainDisabled=s,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(E.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,s,t,a){let r=this.trackEntryPool.obtain();return r.reset(),r.trackIndex=e,r.animation=s,r.loop=t,r.holdPrevious=!1,r.reverse=!1,r.shortestRotation=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=s.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.mixTime=0,r.mixDuration=a?this.data.getMix(a.animation,s):0,r.interruptAlpha=1,r.totalAlpha=0,r.mixBlend=$.replace,r}clearNext(e){let s=e.next;for(;s;)this.queue.dispose(s),s=s.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let s=0,t=e.length;s<t;s++){let a=e[s];if(!!a){for(;a.mixingFrom;)a=a.mixingFrom;do(!a.mixingTo||a.mixBlend!=$.add)&&this.computeHold(a),a=a.mixingTo;while(a)}}}computeHold(e){let s=e.mixingTo,t=e.animation.timelines,a=e.animation.timelines.length,r=e.timelineMode;r.length=a;let c=e.timelineHoldMix;c.length=0;let l=this.propertyIDs;if(s&&s.holdPrevious){for(let i=0;i<a;i++)r[i]=l.addAll(t[i].getPropertyIds())?We:vt;return}e:for(let i=0;i<a;i++){let n=t[i],o=n.getPropertyIds();if(!l.addAll(o))r[i]=Ue;else if(!s||n instanceof Se||n instanceof Ae||n instanceof Ve||!s.animation.hasTimeline(o))r[i]=yt;else{for(let h=s.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(o)){if(e.mixDuration>0){r[i]=es,c[i]=h;continue e}break}r[i]=We}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let s=this.listeners.indexOf(e);s>=0&&this.listeners.splice(s,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Kt=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=$.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let 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}},Zt=class{constructor(e){this.objects=[],this.drainDisabled=!1,this.animState=null,this.animState=e}start(e){this.objects.push(ee.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ee.interrupt),this.objects.push(e)}end(e){this.objects.push(ee.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ee.dispose),this.objects.push(e)}complete(e){this.objects.push(ee.complete),this.objects.push(e)}event(e,s){this.objects.push(ee.event),this.objects.push(e),this.objects.push(s)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,s=this.animState.listeners;for(let t=0;t<e.length;t+=2){let a=e[t],r=e[t+1];switch(a){case ee.start:r.listener&&r.listener.start&&r.listener.start(r);for(let l=0;l<s.length;l++)s[l].start&&s[l].start(r);break;case ee.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let l=0;l<s.length;l++)s[l].interrupt&&s[l].interrupt(r);break;case ee.end:r.listener&&r.listener.end&&r.listener.end(r);for(let l=0;l<s.length;l++)s[l].end&&s[l].end(r);case ee.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let l=0;l<s.length;l++)s[l].dispose&&s[l].dispose(r);this.animState.trackEntryPool.free(r);break;case ee.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let l=0;l<s.length;l++)s[l].complete&&s[l].complete(r);break;case ee.event:let c=e[t+++2];r.listener&&r.listener.event&&r.listener.event(r,c);for(let l=0;l<s.length;l++)s[l].event&&s[l].event(r,c);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},ee;(function(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"})(ee||(ee={}));var Ys=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,s){}},Ue=0,yt=1,vt=2,We=3,es=4,St=1,ts=2,At=null,Is=class{constructor(e){if(this.skeletonData=null,this.animationToMixTime={},this.defaultMix=0,!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,s,t){let a=this.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);let r=this.skeletonData.findAnimation(s);if(!r)throw new Error("Animation not found: "+s);this.setMixWith(a,r,t)}setMixWith(e,s,t){if(!e)throw new Error("from cannot be null.");if(!s)throw new Error("to cannot be null.");let a=e.name+"."+s.name;this.animationToMixTime[a]=t}getMix(e,s){let t=e.name+"."+s.name,a=this.animationToMixTime[t];return a===void 0?this.defaultMix:a}},ze=class extends ae{constructor(e){super(e);this.color=new D(1,1,1,1)}copy(){let e=new ze(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},kt=class extends ae{constructor(e){super(e);this.endSlot=null,this.color=new D(.2275,.2275,.8078,1)}copy(){let e=new kt(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},ss=class{constructor(e){this._image=e}getImage(){return this._image}},ke;(function(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"})(ke||(ke={}));var Ye;(function(e){e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat"})(Ye||(Ye={}));var is=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Cs=class extends ss{setFilters(e,s){}setWraps(e,s){}dispose(){}},rs=class{constructor(e){this.pages=new Array,this.regions=new Array;let s=new Ts(e),t=new Array(4),a=null,r=null,c={};c.size=()=>{a.width=parseInt(t[1]),a.height=parseInt(t[2])},c.format=()=>{},c.filter=()=>{a.minFilter=E.enumValue(ke,t[1]),a.magFilter=E.enumValue(ke,t[2])},c.repeat=()=>{t[1].indexOf("x")!=-1&&(a.uWrap=Ye.Repeat),t[1].indexOf("y")!=-1&&(a.vWrap=Ye.Repeat)},c.pma=()=>{a.pma=t[1]=="true"};var l={};l.xy=()=>{r.x=parseInt(t[1]),r.y=parseInt(t[2])},l.size=()=>{r.width=parseInt(t[1]),r.height=parseInt(t[2])},l.bounds=()=>{r.x=parseInt(t[1]),r.y=parseInt(t[2]),r.width=parseInt(t[3]),r.height=parseInt(t[4])},l.offset=()=>{r.offsetX=parseInt(t[1]),r.offsetY=parseInt(t[2])},l.orig=()=>{r.originalWidth=parseInt(t[1]),r.originalHeight=parseInt(t[2])},l.offsets=()=>{r.offsetX=parseInt(t[1]),r.offsetY=parseInt(t[2]),r.originalWidth=parseInt(t[3]),r.originalHeight=parseInt(t[4])},l.rotate=()=>{let h=t[1];h=="true"?r.degrees=90:h!="false"&&(r.degrees=parseInt(h))},l.index=()=>{r.index=parseInt(t[1])};let i=s.readLine();for(;i&&i.trim().length==0;)i=s.readLine();for(;!(!i||i.trim().length==0||s.readEntry(t,i)==0);)i=s.readLine();let n=null,o=null;for(;i!==null;)if(i.trim().length==0)a=null,i=s.readLine();else if(a){for(r=new Yt,r.page=a,r.name=i;;){let h=s.readEntry(t,i=s.readLine());if(h==0)break;let d=l[t[0]];if(d)d();else{n||(n=[],o=[]),n.push(t[0]);let f=[];for(let u=0;u<h;u++)f.push(parseInt(t[u+1]));o.push(f)}}r.originalWidth==0&&r.originalHeight==0&&(r.originalWidth=r.width,r.originalHeight=r.height),n&&n.length>0&&(r.names=n,r.values=o,n=null,o=null),r.u=r.x/a.width,r.v=r.y/a.height,r.degrees==90?(r.u2=(r.x+r.height)/a.width,r.v2=(r.y+r.width)/a.height):(r.u2=(r.x+r.width)/a.width,r.v2=(r.y+r.height)/a.height),this.regions.push(r)}else{for(a=new as,a.name=i.trim();s.readEntry(t,i=s.readLine())!=0;){let h=c[t[0]];h&&h()}this.pages.push(a)}}findRegion(e){for(let s=0;s<this.regions.length;s++)if(this.regions[s].name==e)return this.regions[s];return null}setTextures(e,s=""){for(let t of this.pages)t.setTexture(e.get(s+t.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture.dispose()}},Ts=class{constructor(e){this.lines=null,this.index=0,this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,s){if(!s||(s=s.trim(),s.length==0))return 0;let t=s.indexOf(":");if(t==-1)return 0;e[0]=s.substr(0,t).trim();for(let a=1,r=t+1;;a++){let c=s.indexOf(",",r);if(c==-1)return e[a]=s.substr(r).trim(),a;if(e[a]=s.substr(r,c-r).trim(),r=c+1,a==4)return 4}}},as=class{constructor(){this.name=null,this.minFilter=ke.Nearest,this.magFilter=ke.Nearest,this.uWrap=Ye.ClampToEdge,this.vWrap=Ye.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap)}},Yt=class extends is{constructor(){super(...arguments);this.page=null,this.name=null,this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null}},Xe=class extends ae{constructor(e){super(e);this.region=null,this.path=null,this.regionUVs=null,this.uvs=null,this.triangles=null,this.color=new D(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=null,this.parentMesh=null,this.sequence=null,this.tempColor=new D(0,0,0,0)}updateRegion(){let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=E.newFloatArray(e.length));let s=this.uvs,t=this.uvs.length,a=this.region.u,r=this.region.v,c=0,l=0;if(this.region instanceof Yt){let i=this.region,n=i.page.texture.getImage(),o=n.width,h=n.height;switch(i.degrees){case 90:a-=(i.originalHeight-i.offsetY-i.height)/o,r-=(i.originalWidth-i.offsetX-i.width)/h,c=i.originalHeight/o,l=i.originalWidth/h;for(let d=0;d<t;d+=2)s[d]=a+e[d+1]*c,s[d+1]=r+(1-e[d])*l;return;case 180:a-=(i.originalWidth-i.offsetX-i.width)/o,r-=i.offsetY/h,c=i.originalWidth/o,l=i.originalHeight/h;for(let d=0;d<t;d+=2)s[d]=a+(1-e[d])*c,s[d+1]=r+(1-e[d+1])*l;return;case 270:a-=i.offsetY/o,r-=i.offsetX/h,c=i.originalHeight/o,l=i.originalWidth/h;for(let d=0;d<t;d+=2)s[d]=a+(1-e[d+1])*c,s[d+1]=r+e[d]*l;return}a-=i.offsetX/o,r-=(i.originalHeight-i.offsetY-i.height)/h,c=i.originalWidth/o,l=i.originalHeight/h}else this.region?(c=this.region.u2-a,l=this.region.v2-r):(a=r=0,c=l=1);for(let i=0;i<t;i+=2)s[i]=a+e[i]*c,s[i+1]=r+e[i+1]*l}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new Xe(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),E.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),E.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),E.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),E.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,s,t,a,r,c){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,s,t,a,r,c)}newLinkedMesh(){let e=new Xe(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),e.timelineAttahment=this.timelineAttahment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},Me=class extends ae{constructor(e){super(e);this.lengths=null,this.closed=!1,this.constantSpeed=!1,this.color=new D(1,1,1,1)}copy(){let e=new Me(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),E.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},It=class extends ae{constructor(e){super(e);this.x=0,this.y=0,this.rotation=0,this.color=new D(.38,.94,0,1)}computeWorldPosition(e,s){return s.x=this.x*e.a+this.y*e.b+e.worldX,s.y=this.x*e.c+this.y*e.d+e.worldY,s}computeWorldRotation(e){let s=X.cosDeg(this.rotation),t=X.sinDeg(this.rotation),a=s*e.a+t*e.b,r=s*e.c+t*e.d;return Math.atan2(r,a)*X.radDeg}copy(){let e=new It(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},ns=class extends Qe{constructor(e){super(e);this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new D(1,1,1,1),this.path=null,this.rendererObject=null,this.region=null,this.sequence=null,this.offset=E.newFloatArray(8),this.uvs=E.newFloatArray(8),this.tempColor=new D(1,1,1,1)}updateRegion(){let e=this.region,s=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*s,r=-this.height/2*this.scaleY+this.region.offsetY*t,c=a+this.region.width*s,l=r+this.region.height*t,i=this.rotation*Math.PI/180,n=Math.cos(i),o=Math.sin(i),h=this.x,d=this.y,f=a*n+h,u=a*o,m=r*n+d,x=r*o,p=c*n+h,y=c*o,g=l*n+d,w=l*o,b=this.offset;b[0]=f-x,b[1]=m+u,b[2]=f-w,b[3]=g+u,b[4]=p-w,b[5]=g+y,b[6]=p-x,b[7]=m+y;let v=this.uvs;e.degrees==90?(v[2]=e.u,v[3]=e.v2,v[4]=e.u,v[5]=e.v,v[6]=e.u2,v[7]=e.v,v[0]=e.u2,v[1]=e.v2):(v[0]=e.u,v[1]=e.v2,v[2]=e.u,v[3]=e.v,v[4]=e.u2,v[5]=e.v,v[6]=e.u2,v[7]=e.v2)}computeWorldVertices(e,s,t,a){this.sequence!=null&&this.sequence.apply(e,this);let r=e.bone,c=this.offset,l=r.worldX,i=r.worldY,n=r.a,o=r.b,h=r.c,d=r.d,f=0,u=0;f=c[0],u=c[1],s[t]=f*n+u*o+l,s[t+1]=f*h+u*d+i,t+=a,f=c[2],u=c[3],s[t]=f*n+u*o+l,s[t+1]=f*h+u*d+i,t+=a,f=c[4],u=c[5],s[t]=f*n+u*o+l,s[t+1]=f*h+u*d+i,t+=a,f=c[6],u=c[7],s[t]=f*n+u*o+l,s[t+1]=f*h+u*d+i}copy(){let e=new ns(this.name);return e.region=this.region,e.rendererObject=this.rendererObject,e.path=this.path,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,E.arrayCopy(this.uvs,0,e.uvs,0,8),E.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},W=ns;W.X1=0,W.Y1=1,W.C1R=2,W.C1G=3,W.C1B=4,W.C1A=5,W.U1=6,W.V1=7,W.X2=8,W.Y2=9,W.C2R=10,W.C2G=11,W.C2B=12,W.C2A=13,W.U2=14,W.V2=15,W.X3=16,W.Y3=17,W.C3R=18,W.C3G=19,W.C3B=20,W.C3A=21,W.U3=22,W.V3=23,W.X4=24,W.Y4=25,W.C4R=26,W.C4G=27,W.C4B=28,W.C4A=29,W.U4=30,W.V4=31;var Xs=class{constructor(e){this.atlas=null,this.atlas=e}loadSequence(e,s,t){let a=t.regions;for(let r=0,c=a.length;r<c;r++){let l=t.getPath(s,r);if(a[r]=this.atlas.findRegion(l),a[r].renderObject=a[r],a[r]==null)throw new Error("Region not found in atlas: "+l+" (sequence: "+e+")")}}newRegionAttachment(e,s,t,a){let r=new W(s);if(a!=null)this.loadSequence(s,t,a);else{let c=this.atlas.findRegion(t);if(!c)throw new Error("Region not found in atlas: "+t+" (region attachment: "+s+")");c.renderObject=c,r.region=c}return r}newMeshAttachment(e,s,t,a){let r=new Xe(s);if(a!=null)this.loadSequence(s,t,a);else{let c=this.atlas.findRegion(t);if(!c)throw new Error("Region not found in atlas: "+t+" (mesh attachment: "+s+")");c.renderObject=c,r.region=c}return r}newBoundingBoxAttachment(e,s){return new ze(s)}newPathAttachment(e,s){return new Me(s)}newPointAttachment(e,s){return new It(s)}newClippingAttachment(e,s){return new kt(s)}},Ct=class{constructor(e,s,t){if(this.index=0,this.name=null,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=te.Normal,this.skinRequired=!1,this.color=new D,e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");this.index=e,this.name=s,this.parent=t}},te;(function(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"})(te||(te={}));var Tt=class{constructor(e,s,t){if(this.data=null,this.skeleton=null,this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=s,this.parent=t,this.setToSetupPose()}isActive(){return this.active}update(){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,s,t,a,r,c,l){this.ax=e,this.ay=s,this.arotation=t,this.ascaleX=a,this.ascaleY=r,this.ashearX=c,this.ashearY=l;let i=this.parent;if(!i){let f=this.skeleton,u=t+90+l,m=f.scaleX,x=f.scaleY;this.a=X.cosDeg(t+c)*a*m,this.b=X.cosDeg(u)*r*m,this.c=X.sinDeg(t+c)*a*x,this.d=X.sinDeg(u)*r*x,this.worldX=e*m+f.x,this.worldY=s*x+f.y;return}let n=i.a,o=i.b,h=i.c,d=i.d;switch(this.worldX=n*e+o*s+i.worldX,this.worldY=h*e+d*s+i.worldY,this.data.transformMode){case te.Normal:{let f=t+90+l,u=X.cosDeg(t+c)*a,m=X.cosDeg(f)*r,x=X.sinDeg(t+c)*a,p=X.sinDeg(f)*r;this.a=n*u+o*x,this.b=n*m+o*p,this.c=h*u+d*x,this.d=h*m+d*p;return}case te.OnlyTranslation:{let f=t+90+l;this.a=X.cosDeg(t+c)*a,this.b=X.cosDeg(f)*r,this.c=X.sinDeg(t+c)*a,this.d=X.sinDeg(f)*r;break}case te.NoRotationOrReflection:{let f=n*n+h*h,u=0;f>1e-4?(f=Math.abs(n*d-o*h)/f,n/=this.skeleton.scaleX,h/=this.skeleton.scaleY,o=h*f,d=n*f,u=Math.atan2(h,n)*X.radDeg):(n=0,h=0,u=90-Math.atan2(d,o)*X.radDeg);let m=t+c-u,x=t+l-u+90,p=X.cosDeg(m)*a,y=X.cosDeg(x)*r,g=X.sinDeg(m)*a,w=X.sinDeg(x)*r;this.a=n*p-o*g,this.b=n*y-o*w,this.c=h*p+d*g,this.d=h*y+d*w;break}case te.NoScale:case te.NoScaleOrReflection:{let f=X.cosDeg(t),u=X.sinDeg(t),m=(n*f+o*u)/this.skeleton.scaleX,x=(h*f+d*u)/this.skeleton.scaleY,p=Math.sqrt(m*m+x*x);p>1e-5&&(p=1/p),m*=p,x*=p,p=Math.sqrt(m*m+x*x),this.data.transformMode==te.NoScale&&n*d-o*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let y=Math.PI/2+Math.atan2(x,m),g=Math.cos(y)*p,w=Math.sin(y)*p,b=X.cosDeg(c)*a,v=X.cosDeg(90+l)*r,A=X.sinDeg(c)*a,S=X.sinDeg(90+l)*r;this.a=m*b+g*A,this.b=m*v+g*S,this.c=x*b+w*A,this.d=x*v+w*S;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}getWorldRotationX(){return Math.atan2(this.c,this.a)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.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)}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)*X.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)*X.radDeg;return}let s=e.a,t=e.b,a=e.c,r=e.d,c=1/(s*r-t*a),l=this.worldX-e.worldX,i=this.worldY-e.worldY;this.ax=l*r*c-i*t*c,this.ay=i*s*c-l*a*c;let n=c*r,o=c*s,h=c*t,d=c*a,f=n*this.a-h*this.c,u=n*this.b-h*this.d,m=o*this.c-d*this.a,x=o*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let p=f*x-u*m;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*u+m*x,p)*X.radDeg,this.arotation=Math.atan2(m,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,u)*X.radDeg}worldToLocal(e){let s=1/(this.a*this.d-this.b*this.c),t=e.x-this.worldX,a=e.y-this.worldY;return e.x=t*this.d*s-a*this.b*s,e.y=a*this.a*s-t*this.c*s,e}localToWorld(e){let s=e.x,t=e.y;return e.x=s*this.a+t*this.b+this.worldX,e.y=s*this.c+t*this.d+this.worldY,e}worldToLocalRotation(e){let s=X.sinDeg(e),t=X.cosDeg(e);return Math.atan2(this.a*s-this.c*t,this.d*t-this.b*s)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=X.sinDeg(e),t=X.cosDeg(e);return Math.atan2(t*this.c+s*this.d,t*this.a+s*this.b)*X.radDeg}rotateWorld(e){let s=this.a,t=this.b,a=this.c,r=this.d,c=X.cosDeg(e),l=X.sinDeg(e);this.a=c*s-l*a,this.b=c*t-l*r,this.c=l*s+c*a,this.d=l*t+c*r}},_e=class{constructor(e,s,t){this.name=e,this.order=s,this.skinRequired=t}},Ms=class{constructor(e,s="",t=null){this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=s,this.downloader=t||new ls}start(e){return this.toLoad++,this.pathPrefix+e}success(e,s,t){this.toLoad--,this.loaded++,this.assets[s]=t,e&&e(s,t)}error(e,s,t){this.toLoad--,this.loaded++,this.errors[s]=t,e&&e(s,t)}setRawDataURI(e,s){this.downloader.rawDataUris[this.pathPrefix+e]=s}loadBinary(e,s=null,t=null){e=this.start(e),this.downloader.downloadBinary(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load binary ${e}: status ${a}, ${r}`)})}loadText(e,s=null,t=null){e=this.start(e),this.downloader.downloadText(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load text ${e}: status ${a}, ${r}`)})}loadJson(e,s=null,t=null){e=this.start(e),this.downloader.downloadJson(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load JSON ${e}: status ${a}, ${r}`)})}loadTexture(e,s=null,t=null){if(e=this.start(e),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(e,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(t,e,`Couldn't load image: ${e}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(s,e,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(s,e,this.textureLoader(c))},c.onerror=()=>{this.error(t,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),c.src=e}}loadTextureAtlas(e,s=null,t=null,a=null){let r=e.lastIndexOf("/"),c=r>=0?e.substring(0,r+1):"";e=this.start(e),this.downloader.downloadText(e,l=>{try{let i=new rs(l),n=i.pages.length,o=!1;for(let h of i.pages)this.loadTexture(a==null?c+h.name:a[h.name],(d,f)=>{o||(h.setTexture(f),--n==0&&this.success(s,e,i))},(d,f)=>{o||this.error(t,e,`Couldn't load texture atlas ${e} page image: ${d}`),o=!0})}catch(i){this.error(t,e,`Couldn't parse texture atlas ${e}: ${i.message}`)}},(l,i)=>{this.error(t,e,`Couldn't load texture atlas ${e}: status ${l}, ${i}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let s=this.assets[e];if(s)return s;let t=this.errors[e];throw Error("Asset not found: "+e+(t?`
2
+ `+t:""))}remove(e){e=this.pathPrefix+e;let s=this.assets[e];return s.dispose&&s.dispose(),delete this.assets[e],s}removeAll(){for(let e in this.assets){let s=this.assets[e];s.dispose&&s.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ls=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let s=e.indexOf("base64,");return s!=-1?(s+="base64,".length,atob(e.substr(s))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var s=window.atob(e),t=s.length,a=new Uint8Array(t),r=0;r<t;r++)a[r]=s.charCodeAt(r);return a}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let s=e.indexOf("base64,");if(s==-1)throw new Error("Not a binary data URI.");return s+="base64,".length,this.base64ToUint8Array(e.substr(s))}downloadText(e,s,t){if(this.start(e,s,t))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",e,!0);let r=()=>{this.finish(e,a.status,a.responseText)};a.onload=r,a.onerror=r,a.send()}downloadJson(e,s,t){this.downloadText(e,a=>{s(JSON.parse(a))},t)}downloadBinary(e,s,t){if(this.start(e,s,t))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer";let r=()=>{this.finish(e,a.status,a.response)};a.onload=()=>{a.status==200||a.status==0?this.finish(e,200,new Uint8Array(a.response)):r()},a.onerror=r,a.send()}start(e,s,t){let a=this.callbacks[e];try{if(a)return!0;this.callbacks[e]=a=[]}finally{a.push(s,t)}}finish(e,s,t){let a=this.callbacks[e];delete this.callbacks[e];let r=s==200||s==0?[t]:[s,t];for(let c=r.length-1,l=a.length;c<l;c+=2)a[c].apply(null,r)}},Xt=class{constructor(e,s){if(this.data=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!s)throw new Error("data cannot be null.");this.time=e,this.data=s}},Mt=class{constructor(e){this.name=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=e}},os=class{constructor(e,s){if(this.data=null,this.bones=null,this.target=null,this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch,this.bones=new Array;for(let t=0;t<e.bones.length;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findBone(e.target.name)}isActive(){return this.active}update(){if(this.mix==0)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,s,t,a,r,c,l){let i=e.parent,n=i.a,o=i.b,h=i.c,d=i.d,f=-e.ashearX-e.arotation,u=0,m=0;switch(e.data.transformMode){case te.OnlyTranslation:u=s-e.worldX,m=t-e.worldY;break;case te.NoRotationOrReflection:let y=Math.abs(n*d-o*h)/(n*n+h*h),g=n/e.skeleton.scaleX,w=h/e.skeleton.scaleY;o=-w*y*e.skeleton.scaleX,d=g*y*e.skeleton.scaleY,f+=Math.atan2(w,g)*X.radDeg;default:let b=s-i.worldX,v=t-i.worldY,A=n*d-o*h;u=(b*d-v*o)/A-e.ax,m=(v*n-b*h)/A-e.ay}f+=Math.atan2(m,u)*X.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=e.ascaleX,p=e.ascaleY;if(a||r){switch(e.data.transformMode){case te.NoScale:case te.NoScaleOrReflection:u=s-e.worldX,m=t-e.worldY}let y=e.data.length*x,g=Math.sqrt(u*u+m*m);if(a&&g<y||r&&g>y&&y>1e-4){let w=(g/y-1)*l+1;x*=w,c&&(p*=w)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*l,x,p,e.ashearX,e.ashearY)}apply2(e,s,t,a,r,c,l,i,n){let o=e.ax,h=e.ay,d=e.ascaleX,f=e.ascaleY,u=d,m=f,x=s.ascaleX,p=0,y=0,g=0;d<0?(d=-d,p=180,g=-1):(p=0,g=1),f<0&&(f=-f,g=-g),x<0?(x=-x,y=180):y=0;let w=s.ax,b=0,v=0,A=0,S=e.a,C=e.b,I=e.c,M=e.d,B=Math.abs(d-f)<=1e-4;!B||c?(b=0,v=S*w+e.worldX,A=I*w+e.worldY):(b=s.ay,v=S*w+C*b+e.worldX,A=I*w+M*b+e.worldY);let R=e.parent;S=R.a,C=R.b,I=R.c,M=R.d;let F=1/(S*M-C*I),Y=v-R.worldX,T=A-R.worldY,L=(Y*M-T*C)*F-o,_=(T*S-Y*I)*F-h,P=Math.sqrt(L*L+_*_),U=s.data.length*x,N,H;if(P<1e-4){this.apply1(e,t,a,!1,c,!1,n),s.updateWorldTransformWith(w,b,0,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY);return}Y=t-R.worldX,T=a-R.worldY;let O=(Y*M-T*C)*F-o,V=(T*S-Y*I)*F-h,G=O*O+V*V;if(i!=0){i*=d*(x+1)*.5;let K=Math.sqrt(G),ie=K-P-U*d+i;if(ie>0){let re=Math.min(1,ie/(i*2))-1;re=(ie-i*(1-re*re))/K,O-=re*O,V-=re*V,G=O*O+V*V}}e:if(B){U*=d;let K=(G-P*P-U*U)/(2*P*U);K<-1?(K=-1,H=Math.PI*r):K>1?(K=1,H=0,c&&(S=(Math.sqrt(G)/(P+U)-1)*n+1,u*=S,l&&(m*=S))):H=Math.acos(K)*r,S=P+U*K,C=U*Math.sin(H),N=Math.atan2(V*S-O*C,O*S+V*C)}else{S=d*U,C=f*U;let K=S*S,ie=C*C,re=Math.atan2(V,O);I=ie*P*P+K*G-K*ie;let ye=-2*ie*P,Re=ie-K;if(M=ye*ye-4*Re*I,M>=0){let Be=Math.sqrt(M);ye<0&&(Be=-Be),Be=-(ye+Be)*.5;let bs=Be/Re,ws=I/Be,Ee=Math.abs(bs)<Math.abs(ws)?bs:ws;if(Ee*Ee<=G){T=Math.sqrt(G-Ee*Ee)*r,N=re-Math.atan2(T,Ee),H=Math.atan2(T/f,(Ee-P)/d);break e}}let De=X.PI,Ge=P-S,Ot=Ge*Ge,ms=0,gs=0,$e=P+S,qt=$e*$e,xs=0;I=-S*P/(K-ie),I>=-1&&I<=1&&(I=Math.acos(I),Y=S*Math.cos(I)+P,T=C*Math.sin(I),M=Y*Y+T*T,M<Ot&&(De=I,Ot=M,Ge=Y,ms=T),M>qt&&(gs=I,qt=M,$e=Y,xs=T)),G<=(Ot+qt)*.5?(N=re-Math.atan2(ms*r,Ge),H=De*r):(N=re-Math.atan2(xs*r,$e),H=gs*r)}let Z=Math.atan2(b,w)*g,ce=e.arotation;N=(N-Z)*X.radDeg+p-ce,N>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(o,h,ce+N*n,u,m,0,0),ce=s.arotation,H=((H+Z)*X.radDeg-s.ashearX)*g+y-ce,H>180?H-=360:H<-180&&(H+=360),s.updateWorldTransformWith(w,b,ce+H*n,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}},Ft=class extends _e{constructor(e){super(e,0,!1);this.bones=new Array,this.target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}},Rt=class extends _e{constructor(e){super(e,0,!1);this.bones=new Array,this.target=null,this.positionMode=null,this.spacingMode=null,this.rotateMode=null,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}},fe;(function(e){e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent"})(fe||(fe={}));var Q;(function(e){e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional"})(Q||(Q={}));var Ie;(function(e){e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale"})(Ie||(Ie={}));var xe=class{constructor(e,s){if(this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let t=0,a=e.bones.length;t<a;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findSlot(e.target.name),this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}update(){let e=this.target.getAttachment();if(!(e instanceof Me))return;let s=this.mixRotate,t=this.mixX,a=this.mixY;if(s==0&&t==0&&a==0)return;let r=this.data,c=r.rotateMode==Ie.Tangent,l=r.rotateMode==Ie.ChainScale,i=this.bones,n=i.length,o=c?n:n+1,h=E.setArraySize(this.spaces,o),d=l?this.lengths=E.setArraySize(this.lengths,n):null,f=this.spacing;switch(r.spacingMode){case Q.Percent:if(l)for(let b=0,v=o-1;b<v;b++){let A=i[b],S=A.data.length;if(S<xe.epsilon)d[b]=0;else{let C=S*A.a,I=S*A.c;d[b]=Math.sqrt(C*C+I*I)}}E.arrayFill(h,1,o,f);break;case Q.Proportional:let g=0;for(let b=0,v=o-1;b<v;){let A=i[b],S=A.data.length;if(S<xe.epsilon)l&&(d[b]=0),h[++b]=f;else{let C=S*A.a,I=S*A.c,M=Math.sqrt(C*C+I*I);l&&(d[b]=M),h[++b]=M,g+=M}}if(g>0){g=o/g*f;for(let b=1;b<o;b++)h[b]*=g}break;default:let w=r.spacingMode==Q.Length;for(let b=0,v=o-1;b<v;){let A=i[b],S=A.data.length;if(S<xe.epsilon)l&&(d[b]=0),h[++b]=f;else{let C=S*A.a,I=S*A.c,M=Math.sqrt(C*C+I*I);l&&(d[b]=M),h[++b]=(w?S+f:f)*M/S}}}let u=this.computeWorldPositions(e,o,c),m=u[0],x=u[1],p=r.offsetRotation,y=!1;if(p==0)y=r.rotateMode==Ie.Chain;else{y=!1;let g=this.target.bone;p*=g.a*g.d-g.b*g.c>0?X.degRad:-X.degRad}for(let g=0,w=3;g<n;g++,w+=3){let b=i[g];b.worldX+=(m-b.worldX)*t,b.worldY+=(x-b.worldY)*a;let v=u[w],A=u[w+1],S=v-m,C=A-x;if(l){let I=d[g];if(I!=0){let M=(Math.sqrt(S*S+C*C)/I-1)*s+1;b.a*=M,b.c*=M}}if(m=v,x=A,s>0){let I=b.a,M=b.b,B=b.c,R=b.d,F=0,Y=0,T=0;if(c?F=u[w-1]:h[g+1]==0?F=u[w+2]:F=Math.atan2(C,S),F-=Math.atan2(B,I),y){Y=Math.cos(F),T=Math.sin(F);let L=b.data.length;m+=(L*(Y*I-T*B)-S)*s,x+=(L*(T*I+Y*B)-C)*s}else F+=p;F>X.PI?F-=X.PI2:F<-X.PI&&(F+=X.PI2),F*=s,Y=Math.cos(F),T=Math.sin(F),b.a=Y*I-T*B,b.b=Y*M-T*R,b.c=T*I+Y*B,b.d=T*M+Y*R}b.updateAppliedTransform()}}computeWorldPositions(e,s,t){let a=this.target,r=this.position,c=this.spaces,l=E.setArraySize(this.positions,s*3+2),i=null,n=e.closed,o=e.worldVerticesLength,h=o/6,d=xe.NONE;if(!e.constantSpeed){let _=e.lengths;h-=n?1:2;let P=_[h];this.data.positionMode==fe.Percent&&(r*=P);let U;switch(this.data.spacingMode){case Q.Percent:U=P;break;case Q.Proportional:U=P/s;break;default:U=1}i=E.setArraySize(this.world,8);for(let N=0,H=0,O=0;N<s;N++,H+=3){let V=c[N]*U;r+=V;let G=r;if(n)G%=P,G<0&&(G+=P),O=0;else if(G<0){d!=xe.BEFORE&&(d=xe.BEFORE,e.computeWorldVertices(a,2,4,i,0,2)),this.addBeforePosition(G,i,0,l,H);continue}else if(G>P){d!=xe.AFTER&&(d=xe.AFTER,e.computeWorldVertices(a,o-6,4,i,0,2)),this.addAfterPosition(G-P,i,0,l,H);continue}for(;;O++){let Z=_[O];if(!(G>Z)){if(O==0)G/=Z;else{let ce=_[O-1];G=(G-ce)/(Z-ce)}break}}O!=d&&(d=O,n&&O==h?(e.computeWorldVertices(a,o-4,4,i,0,2),e.computeWorldVertices(a,0,4,i,4,2)):e.computeWorldVertices(a,O*6+2,8,i,0,2)),this.addCurvePosition(G,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],l,H,t||N>0&&V==0)}return l}n?(o+=2,i=E.setArraySize(this.world,o),e.computeWorldVertices(a,2,o-4,i,0,2),e.computeWorldVertices(a,0,2,i,o-4,2),i[o-2]=i[0],i[o-1]=i[1]):(h--,o-=4,i=E.setArraySize(this.world,o),e.computeWorldVertices(a,2,o,i,0,2));let f=E.setArraySize(this.curves,h),u=0,m=i[0],x=i[1],p=0,y=0,g=0,w=0,b=0,v=0,A=0,S=0,C=0,I=0,M=0,B=0,R=0,F=0;for(let _=0,P=2;_<h;_++,P+=6)p=i[P],y=i[P+1],g=i[P+2],w=i[P+3],b=i[P+4],v=i[P+5],A=(m-p*2+g)*.1875,S=(x-y*2+w)*.1875,C=((p-g)*3-m+b)*.09375,I=((y-w)*3-x+v)*.09375,M=A*2+C,B=S*2+I,R=(p-m)*.75+A+C*.16666667,F=(y-x)*.75+S+I*.16666667,u+=Math.sqrt(R*R+F*F),R+=M,F+=B,M+=C,B+=I,u+=Math.sqrt(R*R+F*F),R+=M,F+=B,u+=Math.sqrt(R*R+F*F),R+=M+C,F+=B+I,u+=Math.sqrt(R*R+F*F),f[_]=u,m=b,x=v;this.data.positionMode==fe.Percent&&(r*=u);let Y;switch(this.data.spacingMode){case Q.Percent:Y=u;break;case Q.Proportional:Y=u/s;break;default:Y=1}let T=this.segments,L=0;for(let _=0,P=0,U=0,N=0;_<s;_++,P+=3){let H=c[_]*Y;r+=H;let O=r;if(n)O%=u,O<0&&(O+=u),U=0;else if(O<0){this.addBeforePosition(O,i,0,l,P);continue}else if(O>u){this.addAfterPosition(O-u,i,o-4,l,P);continue}for(;;U++){let V=f[U];if(!(O>V)){if(U==0)O/=V;else{let G=f[U-1];O=(O-G)/(V-G)}break}}if(U!=d){d=U;let V=U*6;for(m=i[V],x=i[V+1],p=i[V+2],y=i[V+3],g=i[V+4],w=i[V+5],b=i[V+6],v=i[V+7],A=(m-p*2+g)*.03,S=(x-y*2+w)*.03,C=((p-g)*3-m+b)*.006,I=((y-w)*3-x+v)*.006,M=A*2+C,B=S*2+I,R=(p-m)*.3+A+C*.16666667,F=(y-x)*.3+S+I*.16666667,L=Math.sqrt(R*R+F*F),T[0]=L,V=1;V<8;V++)R+=M,F+=B,M+=C,B+=I,L+=Math.sqrt(R*R+F*F),T[V]=L;R+=M,F+=B,L+=Math.sqrt(R*R+F*F),T[8]=L,R+=M+C,F+=B+I,L+=Math.sqrt(R*R+F*F),T[9]=L,N=0}for(O*=L;;N++){let V=T[N];if(!(O>V)){if(N==0)O/=V;else{let G=T[N-1];O=N+(O-G)/(V-G)}break}}this.addCurvePosition(O*.1,m,x,p,y,g,w,b,v,l,P,t||_>0&&H==0)}return l}addBeforePosition(e,s,t,a,r){let c=s[t],l=s[t+1],i=s[t+2]-c,n=s[t+3]-l,o=Math.atan2(n,i);a[r]=c+e*Math.cos(o),a[r+1]=l+e*Math.sin(o),a[r+2]=o}addAfterPosition(e,s,t,a,r){let c=s[t+2],l=s[t+3],i=c-s[t],n=l-s[t+1],o=Math.atan2(n,i);a[r]=c+e*Math.cos(o),a[r+1]=l+e*Math.sin(o),a[r+2]=o}addCurvePosition(e,s,t,a,r,c,l,i,n,o,h,d){if(e==0||isNaN(e)){o[h]=s,o[h+1]=t,o[h+2]=Math.atan2(r-t,a-s);return}let f=e*e,u=f*e,m=1-e,x=m*m,p=x*m,y=m*e,g=y*3,w=m*g,b=g*e,v=s*p+a*w+c*b+i*u,A=t*p+r*w+l*b+n*u;o[h]=v,o[h+1]=A,d&&(e<.001?o[h+2]=Math.atan2(r-t,a-s):o[h+2]=Math.atan2(A-(t*x+r*y*2+l*f),v-(s*x+a*y*2+c*f)))}},Fe=xe;Fe.NONE=-1,Fe.BEFORE=-2,Fe.AFTER=-3,Fe.epsilon=1e-5;var hs=class{constructor(e,s){if(this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentState=0,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!s)throw new Error("bone cannot be null.");this.data=e,this.bone=s,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 ae)||!(this.attachment instanceof ae)||e.timelineAttahment!=this.attachment.timelineAttahment)&&(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}},cs=class{constructor(e,s){if(this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new jt,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(let t=0;t<e.bones.length;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findBone(e.target.name)}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleX==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,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=s!=0||t!=0,i=this.target,n=i.a,o=i.b,h=i.c,d=i.d,f=n*d-o*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,x=this.bones;for(let p=0,y=x.length;p<y;p++){let g=x[p];if(e!=0){let w=g.a,b=g.b,v=g.c,A=g.d,S=Math.atan2(h,n)-Math.atan2(v,w)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let C=Math.cos(S),I=Math.sin(S);g.a=C*w-I*v,g.b=C*b-I*A,g.c=I*w+C*v,g.d=I*b+C*A}if(l){let w=this.temp;i.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(w.x-g.worldX)*s,g.worldY+=(w.y-g.worldY)*t}if(a!=0){let w=Math.sqrt(g.a*g.a+g.c*g.c);w!=0&&(w=(w+(Math.sqrt(n*n+h*h)-w+this.data.offsetScaleX)*a)/w),g.a*=w,g.c*=w}if(r!=0){let w=Math.sqrt(g.b*g.b+g.d*g.d);w!=0&&(w=(w+(Math.sqrt(o*o+d*d)-w+this.data.offsetScaleY)*r)/w),g.b*=w,g.d*=w}if(c>0){let w=g.b,b=g.d,v=Math.atan2(b,w),A=Math.atan2(d,o)-Math.atan2(h,n)-(v-Math.atan2(g.c,g.a));A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A=v+(A+m)*c;let S=Math.sqrt(w*w+b*b);g.b=Math.cos(A)*S,g.d=Math.sin(A)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=s!=0||t!=0,i=this.target,n=i.a,o=i.b,h=i.c,d=i.d,f=n*d-o*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,x=this.bones;for(let p=0,y=x.length;p<y;p++){let g=x[p];if(e!=0){let w=g.a,b=g.b,v=g.c,A=g.d,S=Math.atan2(h,n)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let C=Math.cos(S),I=Math.sin(S);g.a=C*w-I*v,g.b=C*b-I*A,g.c=I*w+C*v,g.d=I*b+C*A}if(l){let w=this.temp;i.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=w.x*s,g.worldY+=w.y*t}if(a!=0){let w=(Math.sqrt(n*n+h*h)-1+this.data.offsetScaleX)*a+1;g.a*=w,g.c*=w}if(r!=0){let w=(Math.sqrt(o*o+d*d)-1+this.data.offsetScaleY)*r+1;g.b*=w,g.d*=w}if(c>0){let w=Math.atan2(d,o)-Math.atan2(h,n);w>X.PI?w-=X.PI2:w<-X.PI&&(w+=X.PI2);let b=g.b,v=g.d;w=Math.atan2(v,b)+(w-X.PI/2+m)*c;let A=Math.sqrt(b*b+v*v);g.b=Math.cos(w)*A,g.d=Math.sin(w)*A}g.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=this.target,i=this.bones;for(let n=0,o=i.length;n<o;n++){let h=i[n],d=h.arotation;if(e!=0){let y=l.arotation-d+this.data.offsetRotation;y-=(16384-(16384.499999999996-y/360|0))*360,d+=y*e}let f=h.ax,u=h.ay;f+=(l.ax-f+this.data.offsetX)*s,u+=(l.ay-u+this.data.offsetY)*t;let m=h.ascaleX,x=h.ascaleY;a!=0&&m!=0&&(m=(m+(l.ascaleX-m+this.data.offsetScaleX)*a)/m),r!=0&&x!=0&&(x=(x+(l.ascaleY-x+this.data.offsetScaleY)*r)/x);let p=h.ashearY;if(c!=0){let y=l.ashearY-p+this.data.offsetShearY;y-=(16384-(16384.499999999996-y/360|0))*360,p+=y*c}h.updateWorldTransformWith(f,u,d,m,x,h.ashearX,p)}}applyRelativeLocal(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=this.target,i=this.bones;for(let n=0,o=i.length;n<o;n++){let h=i[n],d=h.arotation+(l.arotation+this.data.offsetRotation)*e,f=h.ax+(l.ax+this.data.offsetX)*s,u=h.ay+(l.ay+this.data.offsetY)*t,m=h.ascaleX*((l.ascaleX-1+this.data.offsetScaleX)*a+1),x=h.ascaleY*((l.ascaleY-1+this.data.offsetScaleY)*r+1),p=h.ashearY+(l.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,u,d,m,x,h.ashearX,p)}}},Fs=class{constructor(e){if(this.data=null,this.bones=null,this.slots=null,this.drawOrder=null,this.ikConstraints=null,this.transformConstraints=null,this.pathConstraints=null,this._updateCache=new Array,this.skin=null,this.color=null,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let s=0;s<e.bones.length;s++){let t=e.bones[s],a;if(!t.parent)a=new Tt(t,this,null);else{let r=this.bones[t.parent.index];a=new Tt(t,this,r),r.children.push(a)}this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<e.slots.length;s++){let t=e.slots[s],a=this.bones[t.boneData.index],r=new hs(t,a);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let s=0;s<e.ikConstraints.length;s++){let t=e.ikConstraints[s];this.ikConstraints.push(new os(t,this))}this.transformConstraints=new Array;for(let s=0;s<e.transformConstraints.length;s++){let t=e.transformConstraints[s];this.transformConstraints.push(new cs(t,this))}this.pathConstraints=new Array;for(let s=0;s<e.pathConstraints.length;s++){let t=e.pathConstraints[s];this.pathConstraints.push(new Fe(t,this))}this.color=new D(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let s=this.bones;for(let o=0,h=s.length;o<h;o++){let d=s[o];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let o=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let f=this.bones[o[h].index];do f.sorted=!1,f.active=!0,f=f.parent;while(f)}}let t=this.ikConstraints,a=this.transformConstraints,r=this.pathConstraints,c=t.length,l=a.length,i=r.length,n=c+l+i;e:for(let o=0;o<n;o++){for(let h=0;h<c;h++){let d=t[h];if(d.data.order==o){this.sortIkConstraint(d);continue e}}for(let h=0;h<l;h++){let d=a[h];if(d.data.order==o){this.sortTransformConstraint(d);continue e}}for(let h=0;h<i;h++){let d=r[h];if(d.data.order==o){this.sortPathConstraint(d);continue e}}}for(let o=0,h=s.length;o<h;o++)this.sortBone(s[o])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&E.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target;this.sortBone(s);let t=e.bones,a=t[0];if(this.sortBone(a),t.length==1)this._updateCache.push(e),this.sortReset(a.children);else{let r=t[t.length-1];this.sortBone(r),this._updateCache.push(e),this.sortReset(a.children),r.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&E.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target,t=s.data.index,a=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,t,a),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,t,a);for(let i=0,n=this.data.skins.length;i<n;i++)this.sortPathConstraintAttachment(this.data.skins[i],t,a);let r=s.getAttachment();r instanceof Me&&this.sortPathConstraintAttachmentWith(r,a);let c=e.bones,l=c.length;for(let i=0;i<l;i++)this.sortBone(c[i]);this._updateCache.push(e);for(let i=0;i<l;i++)this.sortReset(c[i].children);for(let i=0;i<l;i++)c[i].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&E.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let s=e.bones,t=s.length;if(e.data.local)for(let a=0;a<t;a++){let r=s[a];this.sortBone(r.parent),this.sortBone(r)}else for(let a=0;a<t;a++)this.sortBone(s[a]);this._updateCache.push(e);for(let a=0;a<t;a++)this.sortReset(s[a].children);for(let a=0;a<t;a++)s[a].sorted=!0}sortPathConstraintAttachment(e,s,t){let a=e.attachments[s];if(!!a)for(let r in a)this.sortPathConstraintAttachmentWith(a[r],t)}sortPathConstraintAttachmentWith(e,s){if(!(e instanceof Me))return;let t=e.bones;if(!t)this.sortBone(s);else{let a=this.bones;for(let r=0,c=t.length;r<c;){let l=t[r++];for(l+=r;r<l;)this.sortBone(a[t[r++]])}}}sortBone(e){if(e.sorted)return;let s=e.parent;s&&this.sortBone(s),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let s=0,t=e.length;s<t;s++){let a=e[s];!a.active||(a.sorted&&this.sortReset(a.children),a.sorted=!1)}}updateWorldTransform(){let e=this.bones;for(let t=0,a=e.length;t<a;t++){let r=e[t];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let s=this._updateCache;for(let t=0,a=s.length;t<a;t++)s[t].update()}updateWorldTransformWith(e){let s=this.getRootBone(),t=e.a,a=e.b,r=e.c,c=e.d;s.worldX=t*this.x+a*this.y+e.worldX,s.worldY=r*this.x+c*this.y+e.worldY;let l=s.rotation+90+s.shearY,i=X.cosDeg(s.rotation+s.shearX)*s.scaleX,n=X.cosDeg(l)*s.scaleY,o=X.sinDeg(s.rotation+s.shearX)*s.scaleX,h=X.sinDeg(l)*s.scaleY;s.a=(t*i+a*o)*this.scaleX,s.b=(t*n+a*h)*this.scaleX,s.c=(r*i+c*o)*this.scaleY,s.d=(r*n+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,u=d.length;f<u;f++){let m=d[f];m!=s&&m.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let e=this.bones;for(let r=0,c=e.length;r<c;r++)e[r].setToSetupPose();let s=this.ikConstraints;for(let r=0,c=s.length;r<c;r++){let l=s[r];l.mix=l.data.mix,l.softness=l.data.softness,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch}let t=this.transformConstraints;for(let r=0,c=t.length;r<c;r++){let l=t[r],i=l.data;l.mixRotate=i.mixRotate,l.mixX=i.mixX,l.mixY=i.mixY,l.mixScaleX=i.mixScaleX,l.mixScaleY=i.mixScaleY,l.mixShearY=i.mixShearY}let a=this.pathConstraints;for(let r=0,c=a.length;r<c;r++){let l=a[r],i=l.data;l.position=i.position,l.spacing=i.spacing,l.mixRotate=i.mixRotate,l.mixX=i.mixX,l.mixY=i.mixY}}setSlotsToSetupPose(){let e=this.slots;E.arrayCopy(e,0,this.drawOrder,0,e.length);for(let s=0,t=e.length;s<t;s++)e[s].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let s=this.bones;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}setSkinByName(e){let s=this.data.findSkin(e);if(!s)throw new Error("Skin not found: "+e);this.setSkin(s)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t],c=r.data.attachmentName;if(c){let l=e.getAttachment(t,c);l&&r.setAttachment(l)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,s){return this.getAttachment(this.data.findSlot(e).index,s)}getAttachment(e,s){if(!s)throw new Error("attachmentName cannot be null.");if(this.skin){let t=this.skin.getAttachment(e,s);if(t)return t}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,s):null}setAttachment(e,s){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let a=0,r=t.length;a<r;a++){let c=t[a];if(c.data.name==e){let l=null;if(s&&(l=this.getAttachment(a,s),!l))throw new Error("Attachment not found: "+s+", for slot: "+e);c.setAttachment(l);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.ikConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.transformConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.pathConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}getBounds(e,s,t=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!s)throw new Error("size cannot be null.");let a=this.drawOrder,r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let n=0,o=a.length;n<o;n++){let h=a[n];if(!h.bone.active)continue;let d=0,f=null,u=h.getAttachment();if(u instanceof W)d=8,f=E.setArraySize(t,d,0),u.computeWorldVertices(h,f,0,2);else if(u instanceof Xe){let m=u;d=m.worldVerticesLength,f=E.setArraySize(t,d,0),m.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let m=0,x=f.length;m<x;m+=2){let p=f[m],y=f[m+1];r=Math.min(r,p),c=Math.min(c,y),l=Math.max(l,p),i=Math.max(i,y)}}e.set(r,c),s.set(l-r,i-c)}},Bt=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(e){if(!e)throw new Error("boneName cannot be null.");let s=this.bones;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let s=this.skins;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let s=this.events;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let s=this.animations;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.ikConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.transformConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.pathConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}},Et=class{constructor(e=0,s=null,t=null){this.slotIndex=e,this.name=s,this.attachment=t}},He=class{constructor(e){if(this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,s,t){if(!t)throw new Error("attachment cannot be null.");let a=this.attachments;e>=a.length&&(a.length=e+1),a[e]||(a[e]={}),a[e][s]=t}addSkin(e){for(let a=0;a<e.bones.length;a++){let r=e.bones[a],c=!1;for(let l=0;l<this.bones.length;l++)if(this.bones[l]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<e.constraints.length;a++){let r=e.constraints[a],c=!1;for(let l=0;l<this.constraints.length;l++)if(this.constraints[l]==r){c=!0;break}c||this.constraints.push(r)}let s=e.getAttachments();for(let a=0;a<s.length;a++){var t=s[a];this.setAttachment(t.slotIndex,t.name,t.attachment)}}copySkin(e){for(let a=0;a<e.bones.length;a++){let r=e.bones[a],c=!1;for(let l=0;l<this.bones.length;l++)if(this.bones[l]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<e.constraints.length;a++){let r=e.constraints[a],c=!1;for(let l=0;l<this.constraints.length;l++)if(this.constraints[l]==r){c=!0;break}c||this.constraints.push(r)}let s=e.getAttachments();for(let a=0;a<s.length;a++){var t=s[a];!t.attachment||(t.attachment instanceof Xe?(t.attachment=t.attachment.newLinkedMesh(),this.setAttachment(t.slotIndex,t.name,t.attachment)):(t.attachment=t.attachment.copy(),this.setAttachment(t.slotIndex,t.name,t.attachment)))}}getAttachment(e,s){let t=this.attachments[e];return t?t[s]:null}removeAttachment(e,s){let t=this.attachments[e];t&&(t[s]=null)}getAttachments(){let e=new Array;for(var s=0;s<this.attachments.length;s++){let t=this.attachments[s];if(t)for(let a in t){let r=t[a];r&&e.push(new Et(s,a,r))}}return e}getAttachmentsForSlot(e,s){let t=this.attachments[e];if(t)for(let a in t){let r=t[a];r&&s.push(new Et(e,a,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,s){let t=0;for(let a=0;a<e.slots.length;a++){let r=e.slots[a],c=r.getAttachment();if(c&&t<s.attachments.length){let l=s.attachments[t];for(let i in l){let n=l[i];if(c==n){let o=this.getAttachment(t,i);o&&r.setAttachment(o);break}}}t++}}},Pt=class{constructor(e,s,t){if(this.index=0,this.name=null,this.boneData=null,this.color=new D(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=null,e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");if(!t)throw new Error("boneData cannot be null.");this.index=e,this.name=s,this.boneData=t}},je;(function(e){e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"})(je||(je={}));var Lt=class extends _e{constructor(e){super(e,0,!1);this.bones=new Array,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}},Rs=class{constructor(e){this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let s=this.scale,t=new Bt;t.name="";let a=new ds(e),r=a.readInt32(),c=a.readInt32();t.hash=c==0&&r==0?null:c.toString(16)+r.toString(16),t.version=a.readString(),t.x=a.readFloat(),t.y=a.readFloat(),t.width=a.readFloat(),t.height=a.readFloat();let l=a.readBoolean();l&&(t.fps=a.readFloat(),t.imagesPath=a.readString(),t.audioPath=a.readString());let i=0;i=a.readInt(!0);for(let o=0;o<i;o++)a.strings.push(a.readString());i=a.readInt(!0);for(let o=0;o<i;o++){let h=a.readString(),d=o==0?null:t.bones[a.readInt(!0)],f=new Ct(o,h,d);f.rotation=a.readFloat(),f.x=a.readFloat()*s,f.y=a.readFloat()*s,f.scaleX=a.readFloat(),f.scaleY=a.readFloat(),f.shearX=a.readFloat(),f.shearY=a.readFloat(),f.length=a.readFloat()*s,f.transformMode=a.readInt(!0),f.skinRequired=a.readBoolean(),l&&D.rgba8888ToColor(f.color,a.readInt32()),t.bones.push(f)}i=a.readInt(!0);for(let o=0;o<i;o++){let h=a.readString(),d=t.bones[a.readInt(!0)],f=new Pt(o,h,d);D.rgba8888ToColor(f.color,a.readInt32());let u=a.readInt32();u!=-1&&D.rgb888ToColor(f.darkColor=new D,u),f.attachmentName=a.readStringRef(),f.blendMode=a.readInt(!0),t.slots.push(f)}i=a.readInt(!0);for(let o=0,h;o<i;o++){let d=new Ft(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(t.bones[a.readInt(!0)]);d.target=t.bones[a.readInt(!0)],d.mix=a.readFloat(),d.softness=a.readFloat()*s,d.bendDirection=a.readByte(),d.compress=a.readBoolean(),d.stretch=a.readBoolean(),d.uniform=a.readBoolean(),t.ikConstraints.push(d)}i=a.readInt(!0);for(let o=0,h;o<i;o++){let d=new Lt(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(t.bones[a.readInt(!0)]);d.target=t.bones[a.readInt(!0)],d.local=a.readBoolean(),d.relative=a.readBoolean(),d.offsetRotation=a.readFloat(),d.offsetX=a.readFloat()*s,d.offsetY=a.readFloat()*s,d.offsetScaleX=a.readFloat(),d.offsetScaleY=a.readFloat(),d.offsetShearY=a.readFloat(),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),d.mixScaleX=a.readFloat(),d.mixScaleY=a.readFloat(),d.mixShearY=a.readFloat(),t.transformConstraints.push(d)}i=a.readInt(!0);for(let o=0,h;o<i;o++){let d=new Rt(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(t.bones[a.readInt(!0)]);d.target=t.slots[a.readInt(!0)],d.positionMode=a.readInt(!0),d.spacingMode=a.readInt(!0),d.rotateMode=a.readInt(!0),d.offsetRotation=a.readFloat(),d.position=a.readFloat(),d.positionMode==fe.Fixed&&(d.position*=s),d.spacing=a.readFloat(),(d.spacingMode==Q.Length||d.spacingMode==Q.Fixed)&&(d.spacing*=s),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),t.pathConstraints.push(d)}let n=this.readSkin(a,t,!0,l);n&&(t.defaultSkin=n,t.skins.push(n));{let o=t.skins.length;for(E.setArraySize(t.skins,i=o+a.readInt(!0));o<i;o++)t.skins[o]=this.readSkin(a,t,!1,l)}i=this.linkedMeshes.length;for(let o=0;o<i;o++){let h=this.linkedMeshes[o],f=(h.skin?t.findSkin(h.skin):t.defaultSkin).getAttachment(h.slotIndex,h.parent);h.mesh.timelineAttahment=h.inheritTimeline?f:h.mesh,h.mesh.setParentMesh(f),h.mesh.region!=null&&h.mesh.updateRegion()}this.linkedMeshes.length=0,i=a.readInt(!0);for(let o=0;o<i;o++){let h=new Mt(a.readStringRef());h.intValue=a.readInt(!1),h.floatValue=a.readFloat(),h.stringValue=a.readString(),h.audioPath=a.readString(),h.audioPath&&(h.volume=a.readFloat(),h.balance=a.readFloat()),t.events.push(h)}i=a.readInt(!0);for(let o=0;o<i;o++)t.animations.push(this.readAnimation(a,a.readString(),t));return t}readSkin(e,s,t,a){let r=null,c=0;if(t){if(c=e.readInt(!0),c==0)return null;r=new He("default")}else{r=new He(e.readStringRef()),r.bones.length=e.readInt(!0);for(let l=0,i=r.bones.length;l<i;l++)r.bones[l]=s.bones[e.readInt(!0)];for(let l=0,i=e.readInt(!0);l<i;l++)r.constraints.push(s.ikConstraints[e.readInt(!0)]);for(let l=0,i=e.readInt(!0);l<i;l++)r.constraints.push(s.transformConstraints[e.readInt(!0)]);for(let l=0,i=e.readInt(!0);l<i;l++)r.constraints.push(s.pathConstraints[e.readInt(!0)]);c=e.readInt(!0)}for(let l=0;l<c;l++){let i=e.readInt(!0);for(let n=0,o=e.readInt(!0);n<o;n++){let h=e.readStringRef(),d=this.readAttachment(e,s,r,i,h,a);d&&r.setAttachment(i,h,d)}}return r}readAttachment(e,s,t,a,r,c){let l=this.scale,i=e.readStringRef();switch(i||(i=r),e.readByte()){case be.Region:{let n=e.readStringRef(),o=e.readFloat(),h=e.readFloat(),d=e.readFloat(),f=e.readFloat(),u=e.readFloat(),m=e.readFloat(),x=e.readFloat(),p=e.readInt32(),y=this.readSequence(e);n||(n=i);let g=this.attachmentLoader.newRegionAttachment(t,i,n,y);return g?(g.path=n,g.x=h*l,g.y=d*l,g.scaleX=f,g.scaleY=u,g.rotation=o,g.width=m*l,g.height=x*l,D.rgba8888ToColor(g.color,p),g.sequence=y,y==null&&g.updateRegion(),g):null}case be.BoundingBox:{let n=e.readInt(!0),o=this.readVertices(e,n),h=c?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(t,i);return d?(d.worldVerticesLength=n<<1,d.vertices=o.vertices,d.bones=o.bones,c&&D.rgba8888ToColor(d.color,h),d):null}case be.Mesh:{let n=e.readStringRef(),o=e.readInt32(),h=e.readInt(!0),d=this.readFloatArray(e,h<<1,1),f=this.readShortArray(e),u=this.readVertices(e,h),m=e.readInt(!0),x=this.readSequence(e),p=null,y=0,g=0;c&&(p=this.readShortArray(e),y=e.readFloat(),g=e.readFloat()),n||(n=i);let w=this.attachmentLoader.newMeshAttachment(t,i,n,x);return w?(w.path=n,D.rgba8888ToColor(w.color,o),w.bones=u.bones,w.vertices=u.vertices,w.worldVerticesLength=h<<1,w.triangles=f,w.regionUVs=d,x==null&&w.updateRegion(),w.hullLength=m<<1,w.sequence=x,c&&(w.edges=p,w.width=y*l,w.height=g*l),w):null}case be.LinkedMesh:{let n=e.readStringRef(),o=e.readInt32(),h=e.readStringRef(),d=e.readStringRef(),f=e.readBoolean(),u=this.readSequence(e),m=0,x=0;c&&(m=e.readFloat(),x=e.readFloat()),n||(n=i);let p=this.attachmentLoader.newMeshAttachment(t,i,n,u);return p?(p.path=n,D.rgba8888ToColor(p.color,o),p.sequence=u,c&&(p.width=m*l,p.height=x*l),this.linkedMeshes.push(new Bs(p,h,a,d,f)),p):null}case be.Path:{let n=e.readBoolean(),o=e.readBoolean(),h=e.readInt(!0),d=this.readVertices(e,h),f=E.newArray(h/3,0);for(let x=0,p=f.length;x<p;x++)f[x]=e.readFloat()*l;let u=c?e.readInt32():0,m=this.attachmentLoader.newPathAttachment(t,i);return m?(m.closed=n,m.constantSpeed=o,m.worldVerticesLength=h<<1,m.vertices=d.vertices,m.bones=d.bones,m.lengths=f,c&&D.rgba8888ToColor(m.color,u),m):null}case be.Point:{let n=e.readFloat(),o=e.readFloat(),h=e.readFloat(),d=c?e.readInt32():0,f=this.attachmentLoader.newPointAttachment(t,i);return f?(f.x=o*l,f.y=h*l,f.rotation=n,c&&D.rgba8888ToColor(f.color,d),f):null}case be.Clipping:{let n=e.readInt(!0),o=e.readInt(!0),h=this.readVertices(e,o),d=c?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(t,i);return f?(f.endSlot=s.slots[n],f.worldVerticesLength=o<<1,f.vertices=h.vertices,f.bones=h.bones,c&&D.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){if(!e.readBoolean())return null;let s=new Ke(e.readInt(!0));return s.start=e.readInt(!0),s.digits=e.readInt(!0),s.setupIndex=e.readInt(!0),s}readVertices(e,s){let t=this.scale,a=s<<1,r=new Es;if(!e.readBoolean())return r.vertices=this.readFloatArray(e,a,t),r;let c=new Array,l=new Array;for(let i=0;i<s;i++){let n=e.readInt(!0);l.push(n);for(let o=0;o<n;o++)l.push(e.readInt(!0)),c.push(e.readFloat()*t),c.push(e.readFloat()*t),c.push(e.readFloat())}return r.vertices=E.toFloatArray(c),r.bones=l,r}readFloatArray(e,s,t){let a=new Array(s);if(t==1)for(let r=0;r<s;r++)a[r]=e.readFloat();else for(let r=0;r<s;r++)a[r]=e.readFloat()*t;return a}readShortArray(e){let s=e.readInt(!0),t=new Array(s);for(let a=0;a<s;a++)t[a]=e.readShort();return t}readAnimation(e,s,t){e.readInt(!0);let a=new Array,r=this.scale,c=new D,l=new D;for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,m=e.readInt(!0);u<m;u++){let x=e.readByte(),p=e.readInt(!0),y=p-1;switch(x){case _s:{let g=new Se(p,f);for(let w=0;w<p;w++)g.setFrame(w,e.readFloat(),e.readStringRef());a.push(g);break}case Hs:{let g=e.readInt(!0),w=new ot(p,g,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255;for(let I=0,M=0;w.setFrame(I,b,v,A,S,C),I!=y;I++){let B=e.readFloat(),R=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255;switch(e.readByte()){case oe:w.setStepped(I);break;case he:q(e,w,M++,I,0,b,B,v,R,1),q(e,w,M++,I,1,b,B,A,F,1),q(e,w,M++,I,2,b,B,S,Y,1),q(e,w,M++,I,3,b,B,C,T,1)}b=B,v=R,A=F,S=Y,C=T}a.push(w);break}case js:{let g=e.readInt(!0),w=new ht(p,g,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255;for(let C=0,I=0;w.setFrame(C,b,v,A,S),C!=y;C++){let M=e.readFloat(),B=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255;switch(e.readByte()){case oe:w.setStepped(C);break;case he:q(e,w,I++,C,0,b,M,v,B,1),q(e,w,I++,C,1,b,M,A,R,1),q(e,w,I++,C,2,b,M,S,F,1)}b=M,v=B,A=R,S=F}a.push(w);break}case Gs:{let g=e.readInt(!0),w=new dt(p,g,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255;for(let R=0,F=0;w.setFrame(R,b,v,A,S,C,I,M,B),R!=y;R++){let Y=e.readFloat(),T=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,N=e.readUnsignedByte()/255,H=e.readUnsignedByte()/255;switch(e.readByte()){case oe:w.setStepped(R);break;case he:q(e,w,F++,R,0,b,Y,v,T,1),q(e,w,F++,R,1,b,Y,A,L,1),q(e,w,F++,R,2,b,Y,S,_,1),q(e,w,F++,R,3,b,Y,C,P,1),q(e,w,F++,R,4,b,Y,I,U,1),q(e,w,F++,R,5,b,Y,M,N,1),q(e,w,F++,R,6,b,Y,B,H,1)}b=Y,v=T,A=L,S=_,C=P,I=U,M=N,B=H}a.push(w);break}case $s:{let g=e.readInt(!0),w=new ft(p,g,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let B=0,R=0;w.setFrame(B,b,v,A,S,C,I,M),B!=y;B++){let F=e.readFloat(),Y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255;switch(e.readByte()){case oe:w.setStepped(B);break;case he:q(e,w,R++,B,0,b,F,v,Y,1),q(e,w,R++,B,1,b,F,A,T,1),q(e,w,R++,B,2,b,F,S,L,1),q(e,w,R++,B,3,b,F,C,_,1),q(e,w,R++,B,4,b,F,I,P,1),q(e,w,R++,B,5,b,F,M,U,1)}b=F,v=Y,A=T,S=L,C=_,I=P,M=U}a.push(w);break}case Js:{let g=new ct(p,e.readInt(!0),f),w=e.readFloat(),b=e.readUnsignedByte()/255;for(let v=0,A=0;g.setFrame(v,w,b),v!=y;v++){let S=e.readFloat(),C=e.readUnsignedByte()/255;switch(e.readByte()){case oe:g.setStepped(v);break;case he:q(e,g,A++,v,0,w,S,b,C,1)}w=S,b=C}a.push(g)}}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,m=e.readInt(!0);u<m;u++){let x=e.readByte(),p=e.readInt(!0),y=e.readInt(!0);switch(x){case Ps:a.push(we(e,new Le(p,y,f),1));break;case Ls:a.push(Vt(e,new Ze(p,y,f),r));break;case Vs:a.push(we(e,new et(p,y,f),r));break;case Ds:a.push(we(e,new tt(p,y,f),r));break;case Ns:a.push(Vt(e,new st(p,y,f),1));break;case Os:a.push(we(e,new it(p,y,f),1));break;case qs:a.push(we(e,new rt(p,y,f),1));break;case Us:a.push(Vt(e,new at(p,y,f),1));break;case Ws:a.push(we(e,new nt(p,y,f),1));break;case zs:a.push(we(e,new lt(p,y,f),1))}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),m=u-1,x=new mt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),g=e.readFloat()*r;for(let w=0,b=0;x.setFrame(w,p,y,g,e.readByte(),e.readBoolean(),e.readBoolean()),w!=m;w++){let v=e.readFloat(),A=e.readFloat(),S=e.readFloat()*r;switch(e.readByte()){case oe:x.setStepped(w);break;case he:q(e,x,b++,w,0,p,v,y,A,1),q(e,x,b++,w,1,p,v,g,S,r)}p=v,y=A,g=S}a.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),m=u-1,x=new gt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),g=e.readFloat(),w=e.readFloat(),b=e.readFloat(),v=e.readFloat(),A=e.readFloat();for(let S=0,C=0;x.setFrame(S,p,y,g,w,b,v,A),S!=m;S++){let I=e.readFloat(),M=e.readFloat(),B=e.readFloat(),R=e.readFloat(),F=e.readFloat(),Y=e.readFloat(),T=e.readFloat();switch(e.readByte()){case oe:x.setStepped(S);break;case he:q(e,x,C++,S,0,p,I,y,M,1),q(e,x,C++,S,1,p,I,g,B,1),q(e,x,C++,S,2,p,I,w,R,1),q(e,x,C++,S,3,p,I,b,F,1),q(e,x,C++,S,4,p,I,v,Y,1),q(e,x,C++,S,5,p,I,A,T,1)}p=I,y=M,g=B,w=R,b=F,v=Y,A=T}a.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=t.pathConstraints[f];for(let m=0,x=e.readInt(!0);m<x;m++)switch(e.readByte()){case Zs:a.push(we(e,new xt(e.readInt(!0),e.readInt(!0),f),u.positionMode==fe.Fixed?r:1));break;case ei:a.push(we(e,new bt(e.readInt(!0),e.readInt(!0),f),u.spacingMode==Q.Length||u.spacingMode==Q.Fixed?r:1));break;case ti:let p=new wt(e.readInt(!0),e.readInt(!0),f),y=e.readFloat(),g=e.readFloat(),w=e.readFloat(),b=e.readFloat();for(let v=0,A=0,S=p.getFrameCount()-1;p.setFrame(v,y,g,w,b),v!=S;v++){let C=e.readFloat(),I=e.readFloat(),M=e.readFloat(),B=e.readFloat();switch(e.readByte()){case oe:p.setStepped(v);break;case he:q(e,p,A++,v,0,y,C,g,I,1),q(e,p,A++,v,1,y,C,w,M,1),q(e,p,A++,v,2,y,C,b,B,1)}y=C,g=I,w=M,b=B}a.push(p)}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=t.skins[e.readInt(!0)];for(let u=0,m=e.readInt(!0);u<m;u++){let x=e.readInt(!0);for(let p=0,y=e.readInt(!0);p<y;p++){let g=e.readStringRef(),w=f.getAttachment(x,g),b=e.readByte(),v=e.readInt(!0),A=v-1;switch(b){case Qs:{let S=w,C=S.bones,I=S.vertices,M=C?I.length/3*2:I.length,B=e.readInt(!0),R=new ut(v,B,x,S),F=e.readFloat();for(let Y=0,T=0;;Y++){let L,_=e.readInt(!0);if(_==0)L=C?E.newFloatArray(M):I;else{L=E.newFloatArray(M);let U=e.readInt(!0);if(_+=U,r==1)for(let N=U;N<_;N++)L[N]=e.readFloat();else for(let N=U;N<_;N++)L[N]=e.readFloat()*r;if(!C)for(let N=0,H=L.length;N<H;N++)L[N]+=I[N]}if(R.setFrame(Y,F,L),Y==A)break;let P=e.readFloat();switch(e.readByte()){case oe:R.setStepped(Y);break;case he:q(e,R,T++,Y,0,F,P,0,1,1)}F=P}a.push(R);break}case Ks:{let S=new Te(v,x,w);for(let C=0;C<v;C++){let I=e.readFloat(),M=e.readInt32();S.setFrame(C,I,$t[M&15],M>>4,e.readFloat())}a.push(S);break}}}}}let i=e.readInt(!0);if(i>0){let h=new Ae(i),d=t.slots.length;for(let f=0;f<i;f++){let u=e.readFloat(),m=e.readInt(!0),x=E.newArray(d,0);for(let w=d-1;w>=0;w--)x[w]=-1;let p=E.newArray(d-m,0),y=0,g=0;for(let w=0;w<m;w++){let b=e.readInt(!0);for(;y!=b;)p[g++]=y++;x[y+e.readInt(!0)]=y++}for(;y<d;)p[g++]=y++;for(let w=d-1;w>=0;w--)x[w]==-1&&(x[w]=p[--g]);h.setFrame(f,u,x)}a.push(h)}let n=e.readInt(!0);if(n>0){let h=new Ve(n);for(let d=0;d<n;d++){let f=e.readFloat(),u=t.events[e.readInt(!0)],m=new Xt(f,u);m.intValue=e.readInt(!1),m.floatValue=e.readFloat(),m.stringValue=e.readBoolean()?e.readString():u.stringValue,m.data.audioPath&&(m.volume=e.readFloat(),m.balance=e.readFloat()),h.setFrame(d,m)}a.push(h)}let o=0;for(let h=0,d=a.length;h<d;h++)o=Math.max(o,a[h].getDuration());return new Oe(s,a,o)}},ds=class{constructor(e,s=new Array,t=0,a=new DataView(e.buffer)){this.strings=s,this.index=t,this.buffer=a}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 s=this.readByte(),t=s&127;return(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<7,(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<14,(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<21,(s&128)!=0&&(s=this.readByte(),t|=(s&127)<<28)))),e?t:t>>>1^-(t&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 s="",t=0;for(let a=0;a<e;){let r=this.readByte();switch(r>>4){case 12:case 13:s+=String.fromCharCode((r&31)<<6|this.readByte()&63),a+=2;break;case 14:s+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),a+=3;break;default:s+=String.fromCharCode(r),a++}}return s}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Bs=class{constructor(e,s,t,a,r){this.mesh=e,this.skin=s,this.slotIndex=t,this.parent=a,this.inheritTimeline=r}},Es=class{constructor(e=null,s=null){this.bones=e,this.vertices=s}},be;(function(e){e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping"})(be||(be={}));function we(e,s,t){let a=e.readFloat(),r=e.readFloat()*t;for(let c=0,l=0,i=s.getFrameCount()-1;s.setFrame(c,a,r),c!=i;c++){let n=e.readFloat(),o=e.readFloat()*t;switch(e.readByte()){case oe:s.setStepped(c);break;case he:q(e,s,l++,c,0,a,n,r,o,t)}a=n,r=o}return s}function Vt(e,s,t){let a=e.readFloat(),r=e.readFloat()*t,c=e.readFloat()*t;for(let l=0,i=0,n=s.getFrameCount()-1;s.setFrame(l,a,r,c),l!=n;l++){let o=e.readFloat(),h=e.readFloat()*t,d=e.readFloat()*t;switch(e.readByte()){case oe:s.setStepped(l);break;case he:q(e,s,i++,l,0,a,o,r,h,t),q(e,s,i++,l,1,a,o,c,d,t)}a=o,r=h,c=d}return s}function q(e,s,t,a,r,c,l,i,n,o){s.setBezier(t,a,r,c,i,e.readFloat(),e.readFloat()*o,e.readFloat(),e.readFloat()*o,l,n)}var Ps=0,Ls=1,Vs=2,Ds=3,Ns=4,Os=5,qs=6,Us=7,Ws=8,zs=9,_s=0,Hs=1,js=2,Gs=3,$s=4,Js=5,Qs=0,Ks=1,Zs=0,ei=1,ti=2,oe=1,he=2,si=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new Pe(()=>E.newFloatArray(16))}update(e,s){if(!e)throw new Error("skeleton cannot be null.");let t=this.boundingBoxes,a=this.polygons,r=this.polygonPool,c=e.slots,l=c.length;t.length=0,r.freeAll(a),a.length=0;for(let i=0;i<l;i++){let n=c[i];if(!n.bone.active)continue;let o=n.getAttachment();if(o instanceof ze){let h=o;t.push(h);let d=r.obtain();d.length!=h.worldVerticesLength&&(d=E.newFloatArray(h.worldVerticesLength)),a.push(d),h.computeWorldVertices(n,0,h.worldVerticesLength,d,0,2)}}s?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,s=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,r=this.polygons;for(let c=0,l=r.length;c<l;c++){let i=r[c],n=i;for(let o=0,h=i.length;o<h;o+=2){let d=n[o],f=n[o+1];e=Math.min(e,d),s=Math.min(s,f),t=Math.max(t,d),a=Math.max(a,f)}}this.minX=e,this.minY=s,this.maxX=t,this.maxY=a}aabbContainsPoint(e,s){return e>=this.minX&&e<=this.maxX&&s>=this.minY&&s<=this.maxY}aabbIntersectsSegment(e,s,t,a){let r=this.minX,c=this.minY,l=this.maxX,i=this.maxY;if(e<=r&&t<=r||s<=c&&a<=c||e>=l&&t>=l||s>=i&&a>=i)return!1;let n=(a-s)/(t-e),o=n*(r-e)+s;if(o>c&&o<i||(o=n*(l-e)+s,o>c&&o<i))return!0;let h=(c-s)/n+e;return!!(h>r&&h<l||(h=(i-s)/n+e,h>r&&h<l))}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,s){let t=this.polygons;for(let a=0,r=t.length;a<r;a++)if(this.containsPointPolygon(t[a],e,s))return this.boundingBoxes[a];return null}containsPointPolygon(e,s,t){let a=e,r=e.length,c=r-2,l=!1;for(let i=0;i<r;i+=2){let n=a[i+1],o=a[c+1];if(n<t&&o>=t||o<t&&n>=t){let h=a[i];h+(t-n)/(o-n)*(a[c]-h)<s&&(l=!l)}c=i}return l}intersectsSegment(e,s,t,a){let r=this.polygons;for(let c=0,l=r.length;c<l;c++)if(this.intersectsSegmentPolygon(r[c],e,s,t,a))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(e,s,t,a,r){let c=e,l=e.length,i=s-a,n=t-r,o=s*r-t*a,h=c[l-2],d=c[l-1];for(let f=0;f<l;f+=2){let u=c[f],m=c[f+1],x=h*m-d*u,p=h-u,y=d-m,g=i*y-n*p,w=(o*p-i*x)/g;if((w>=h&&w<=u||w>=u&&w<=h)&&(w>=s&&w<=a||w>=a&&w<=s)){let b=(o*y-n*x)/g;if((b>=d&&b<=m||b>=m&&b<=d)&&(b>=t&&b<=r||b>=r&&b<=t))return!0}h=u,d=m}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let s=this.boundingBoxes.indexOf(e);return s==-1?null:this.polygons[s]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},se=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new Pe(()=>new Array),this.polygonIndicesPool=new Pe(()=>new Array)}triangulate(e){let s=e,t=e.length>>1,a=this.indicesArray;a.length=0;for(let l=0;l<t;l++)a[l]=l;let r=this.isConcaveArray;r.length=0;for(let l=0,i=t;l<i;++l)r[l]=se.isConcave(l,t,s,a);let c=this.triangles;for(c.length=0;t>3;){let l=t-1,i=0,n=1;for(;;){e:if(!r[i]){let d=a[l]<<1,f=a[i]<<1,u=a[n]<<1,m=s[d],x=s[d+1],p=s[f],y=s[f+1],g=s[u],w=s[u+1];for(let b=(n+1)%t;b!=l;b=(b+1)%t){if(!r[b])continue;let v=a[b]<<1,A=s[v],S=s[v+1];if(se.positiveArea(g,w,m,x,A,S)&&se.positiveArea(m,x,p,y,A,S)&&se.positiveArea(p,y,g,w,A,S))break e}break}if(n==0){do{if(!r[i])break;i--}while(i>0);break}l=i,i=n,n=(n+1)%t}c.push(a[(t+i-1)%t]),c.push(a[i]),c.push(a[(i+1)%t]),a.splice(i,1),r.splice(i,1),t--;let o=(t+i-1)%t,h=i==t?0:i;r[o]=se.isConcave(o,t,s,a),r[h]=se.isConcave(h,t,s,a)}return t==3&&(c.push(a[2]),c.push(a[0]),c.push(a[1])),c}decompose(e,s){let t=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let l=this.polygonPool.obtain();l.length=0;let i=-1,n=0;for(let o=0,h=s.length;o<h;o+=3){let d=s[o]<<1,f=s[o+1]<<1,u=s[o+2]<<1,m=t[d],x=t[d+1],p=t[f],y=t[f+1],g=t[u],w=t[u+1],b=!1;if(i==d){let v=l.length-4,A=se.winding(l[v],l[v+1],l[v+2],l[v+3],g,w),S=se.winding(g,w,l[0],l[1],l[2],l[3]);A==n&&S==n&&(l.push(g),l.push(w),c.push(u),b=!0)}b||(l.length>0?(a.push(l),r.push(c)):(this.polygonPool.free(l),this.polygonIndicesPool.free(c)),l=this.polygonPool.obtain(),l.length=0,l.push(m),l.push(x),l.push(p),l.push(y),l.push(g),l.push(w),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(u),n=se.winding(m,x,p,y,g,w),i=d)}l.length>0&&(a.push(l),r.push(c));for(let o=0,h=a.length;o<h;o++){if(c=r[o],c.length==0)continue;let d=c[0],f=c[c.length-1];l=a[o];let u=l.length-4,m=l[u],x=l[u+1],p=l[u+2],y=l[u+3],g=l[0],w=l[1],b=l[2],v=l[3],A=se.winding(m,x,p,y,g,w);for(let S=0;S<h;S++){if(S==o)continue;let C=r[S];if(C.length!=3)continue;let I=C[0],M=C[1],B=C[2],R=a[S],F=R[R.length-2],Y=R[R.length-1];if(I!=d||M!=f)continue;let T=se.winding(m,x,p,y,F,Y),L=se.winding(F,Y,g,w,b,v);T==A&&L==A&&(R.length=0,C.length=0,l.push(F),l.push(Y),c.push(B),m=p,x=y,p=F,y=Y,S=0)}}for(let o=a.length-1;o>=0;o--)l=a[o],l.length==0&&(a.splice(o,1),this.polygonPool.free(l),c=r[o],r.splice(o,1),this.polygonIndicesPool.free(c));return a}static isConcave(e,s,t,a){let r=a[(s+e-1)%s]<<1,c=a[e]<<1,l=a[(e+1)%s]<<1;return!this.positiveArea(t[r],t[r+1],t[c],t[c+1],t[l],t[l+1])}static positiveArea(e,s,t,a,r,c){return e*(c-a)+t*(s-c)+r*(a-s)>=0}static winding(e,s,t,a,r,c){let l=t-e,i=a-s;return r*i-c*l+l*s-e*i>=0?1:-1}},Dt=class{constructor(){this.triangulator=new se,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(e,s){if(this.clipAttachment)return 0;this.clipAttachment=s;let t=s.worldVerticesLength,a=E.setArraySize(this.clippingPolygon,t);s.computeWorldVertices(e,0,t,a,0,2);let r=this.clippingPolygon;Dt.makeClockwise(r);let c=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let l=0,i=c.length;l<i;l++){let n=c[l];Dt.makeClockwise(n),n.push(n[0]),n.push(n[1])}return c.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.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(e,s,t,a,r,c,l,i){let n=this.clipOutput,o=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=this.clippingPolygons.length,u=i?12:8,m=0;o.length=0,h.length=0;e:for(let x=0;x<a;x+=3){let p=t[x]<<1,y=e[p],g=e[p+1],w=r[p],b=r[p+1];p=t[x+1]<<1;let v=e[p],A=e[p+1],S=r[p],C=r[p+1];p=t[x+2]<<1;let I=e[p],M=e[p+1],B=r[p],R=r[p+1];for(let F=0;F<f;F++){let Y=o.length;if(this.clip(y,g,v,A,I,M,d[F],n)){let T=n.length;if(T==0)continue;let L=A-M,_=I-v,P=y-I,U=M-g,N=1/(L*P+_*(g-M)),H=T>>1,O=this.clipOutput,V=E.setArraySize(o,Y+H*u);for(let Z=0;Z<T;Z+=2){let ce=O[Z],K=O[Z+1];V[Y]=ce,V[Y+1]=K,V[Y+2]=c.r,V[Y+3]=c.g,V[Y+4]=c.b,V[Y+5]=c.a;let ie=ce-I,re=K-M,ye=(L*ie+_*re)*N,Re=(U*ie+P*re)*N,De=1-ye-Re;V[Y+6]=w*ye+S*Re+B*De,V[Y+7]=b*ye+C*Re+R*De,i&&(V[Y+8]=l.r,V[Y+9]=l.g,V[Y+10]=l.b,V[Y+11]=l.a),Y+=u}Y=h.length;let G=E.setArraySize(h,Y+3*(H-2));H--;for(let Z=1;Z<H;Z++)G[Y]=m,G[Y+1]=m+Z,G[Y+2]=m+Z+1,Y+=3;m+=H+1}else{let T=E.setArraySize(o,Y+3*u);T[Y]=y,T[Y+1]=g,T[Y+2]=c.r,T[Y+3]=c.g,T[Y+4]=c.b,T[Y+5]=c.a,i?(T[Y+6]=w,T[Y+7]=b,T[Y+8]=l.r,T[Y+9]=l.g,T[Y+10]=l.b,T[Y+11]=l.a,T[Y+12]=v,T[Y+13]=A,T[Y+14]=c.r,T[Y+15]=c.g,T[Y+16]=c.b,T[Y+17]=c.a,T[Y+18]=S,T[Y+19]=C,T[Y+20]=l.r,T[Y+21]=l.g,T[Y+22]=l.b,T[Y+23]=l.a,T[Y+24]=I,T[Y+25]=M,T[Y+26]=c.r,T[Y+27]=c.g,T[Y+28]=c.b,T[Y+29]=c.a,T[Y+30]=B,T[Y+31]=R,T[Y+32]=l.r,T[Y+33]=l.g,T[Y+34]=l.b,T[Y+35]=l.a):(T[Y+6]=w,T[Y+7]=b,T[Y+8]=v,T[Y+9]=A,T[Y+10]=c.r,T[Y+11]=c.g,T[Y+12]=c.b,T[Y+13]=c.a,T[Y+14]=S,T[Y+15]=C,T[Y+16]=I,T[Y+17]=M,T[Y+18]=c.r,T[Y+19]=c.g,T[Y+20]=c.b,T[Y+21]=c.a,T[Y+22]=B,T[Y+23]=R),Y=h.length;let L=E.setArraySize(h,Y+3);L[Y]=m,L[Y+1]=m+1,L[Y+2]=m+2,m+=3;continue e}}}}clip(e,s,t,a,r,c,l,i){let n=i,o=!1,h=null;l.length%4>=2?(h=i,i=this.scratch):h=this.scratch,h.length=0,h.push(e),h.push(s),h.push(t),h.push(a),h.push(r),h.push(c),h.push(e),h.push(s),i.length=0;let d=l,f=l.length-4;for(let u=0;;u+=2){let m=d[u],x=d[u+1],p=d[u+2],y=d[u+3],g=m-p,w=x-y,b=h,v=h.length-2,A=i.length;for(let C=0;C<v;C+=2){let I=b[C],M=b[C+1],B=b[C+2],R=b[C+3],F=g*(R-y)-w*(B-p)>0;if(g*(M-y)-w*(I-p)>0){if(F){i.push(B),i.push(R);continue}let Y=R-M,T=B-I,L=Y*(p-m)-T*(y-x);if(Math.abs(L)>1e-6){let _=(T*(x-M)-Y*(m-I))/L;i.push(m+(p-m)*_),i.push(x+(y-x)*_)}else i.push(m),i.push(x)}else if(F){let Y=R-M,T=B-I,L=Y*(p-m)-T*(y-x);if(Math.abs(L)>1e-6){let _=(T*(x-M)-Y*(m-I))/L;i.push(m+(p-m)*_),i.push(x+(y-x)*_)}else i.push(m),i.push(x);i.push(B),i.push(R)}o=!0}if(A==i.length)return n.length=0,!0;if(i.push(i[0]),i.push(i[1]),u==f)break;let S=i;i=h,i.length=0,h=S}if(n!=i){n.length=0;for(let u=0,m=i.length-2;u<m;u++)n[u]=i[u]}else n.length=n.length-2;return o}static makeClockwise(e){let s=e,t=e.length,a=s[t-2]*s[1]-s[0]*s[t-1],r=0,c=0,l=0,i=0;for(let n=0,o=t-3;n<o;n+=2)r=s[n],c=s[n+1],l=s[n+2],i=s[n+3],a+=r*i-l*c;if(!(a<0))for(let n=0,o=t-2,h=t>>1;n<h;n+=2){let d=s[n],f=s[n+1],u=o-n;s[n]=s[u],s[n+1]=s[u+1],s[u]=d,s[u+1]=f}}},ii=class{constructor(e){this.attachmentLoader=null,this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let s=this.scale,t=new Bt,a=typeof e=="string"?JSON.parse(e):e,r=a.skeleton;if(r&&(t.hash=r.hash,t.version=r.spine,t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t.fps=r.fps,t.imagesPath=r.images),a.bones)for(let c=0;c<a.bones.length;c++){let l=a.bones[c],i=null,n=k(l,"parent",null);n&&(i=t.findBone(n));let o=new Ct(t.bones.length,l.name,i);o.length=k(l,"length",0)*s,o.x=k(l,"x",0)*s,o.y=k(l,"y",0)*s,o.rotation=k(l,"rotation",0),o.scaleX=k(l,"scaleX",1),o.scaleY=k(l,"scaleY",1),o.shearX=k(l,"shearX",0),o.shearY=k(l,"shearY",0),o.transformMode=E.enumValue(te,k(l,"transform","Normal")),o.skinRequired=k(l,"skin",!1);let h=k(l,"color",null);h&&o.color.setFromString(h),t.bones.push(o)}if(a.slots)for(let c=0;c<a.slots.length;c++){let l=a.slots[c],i=t.findBone(l.bone),n=new Pt(t.slots.length,l.name,i),o=k(l,"color",null);o&&n.color.setFromString(o);let h=k(l,"dark",null);h&&(n.darkColor=D.fromString(h)),n.attachmentName=k(l,"attachment",null),n.blendMode=E.enumValue(je,k(l,"blend","normal")),t.slots.push(n)}if(a.ik)for(let c=0;c<a.ik.length;c++){let l=a.ik[c],i=new Ft(l.name);i.order=k(l,"order",0),i.skinRequired=k(l,"skin",!1);for(let n=0;n<l.bones.length;n++)i.bones.push(t.findBone(l.bones[n]));i.target=t.findBone(l.target),i.mix=k(l,"mix",1),i.softness=k(l,"softness",0)*s,i.bendDirection=k(l,"bendPositive",!0)?1:-1,i.compress=k(l,"compress",!1),i.stretch=k(l,"stretch",!1),i.uniform=k(l,"uniform",!1),t.ikConstraints.push(i)}if(a.transform)for(let c=0;c<a.transform.length;c++){let l=a.transform[c],i=new Lt(l.name);i.order=k(l,"order",0),i.skinRequired=k(l,"skin",!1);for(let o=0;o<l.bones.length;o++)i.bones.push(t.findBone(l.bones[o]));let n=l.target;i.target=t.findBone(n),i.local=k(l,"local",!1),i.relative=k(l,"relative",!1),i.offsetRotation=k(l,"rotation",0),i.offsetX=k(l,"x",0)*s,i.offsetY=k(l,"y",0)*s,i.offsetScaleX=k(l,"scaleX",0),i.offsetScaleY=k(l,"scaleY",0),i.offsetShearY=k(l,"shearY",0),i.mixRotate=k(l,"mixRotate",1),i.mixX=k(l,"mixX",1),i.mixY=k(l,"mixY",i.mixX),i.mixScaleX=k(l,"mixScaleX",1),i.mixScaleY=k(l,"mixScaleY",i.mixScaleX),i.mixShearY=k(l,"mixShearY",1),t.transformConstraints.push(i)}if(a.path)for(let c=0;c<a.path.length;c++){let l=a.path[c],i=new Rt(l.name);i.order=k(l,"order",0),i.skinRequired=k(l,"skin",!1);for(let o=0;o<l.bones.length;o++)i.bones.push(t.findBone(l.bones[o]));let n=l.target;i.target=t.findSlot(n),i.positionMode=E.enumValue(fe,k(l,"positionMode","Percent")),i.spacingMode=E.enumValue(Q,k(l,"spacingMode","Length")),i.rotateMode=E.enumValue(Ie,k(l,"rotateMode","Tangent")),i.offsetRotation=k(l,"rotation",0),i.position=k(l,"position",0),i.positionMode==fe.Fixed&&(i.position*=s),i.spacing=k(l,"spacing",0),(i.spacingMode==Q.Length||i.spacingMode==Q.Fixed)&&(i.spacing*=s),i.mixRotate=k(l,"mixRotate",1),i.mixX=k(l,"mixX",1),i.mixY=k(l,"mixY",i.mixX),t.pathConstraints.push(i)}if(a.skins)for(let c=0;c<a.skins.length;c++){let l=a.skins[c],i=new He(l.name);if(l.bones)for(let n=0;n<l.bones.length;n++)i.bones.push(t.findBone(l.bones[n]));if(l.ik)for(let n=0;n<l.ik.length;n++)i.constraints.push(t.findIkConstraint(l.ik[n]));if(l.transform)for(let n=0;n<l.transform.length;n++)i.constraints.push(t.findTransformConstraint(l.transform[n]));if(l.path)for(let n=0;n<l.path.length;n++)i.constraints.push(t.findPathConstraint(l.path[n]));for(let n in l.attachments){let o=t.findSlot(n),h=l.attachments[n];for(let d in h){let f=this.readAttachment(h[d],i,o.index,d,t);f&&i.setAttachment(o.index,d,f)}}t.skins.push(i),i.name=="default"&&(t.defaultSkin=i)}for(let c=0,l=this.linkedMeshes.length;c<l;c++){let i=this.linkedMeshes[c],o=(i.skin?t.findSkin(i.skin):t.defaultSkin).getAttachment(i.slotIndex,i.parent);i.mesh.timelineAttahment=i.inheritTimeline?o:i.mesh,i.mesh.setParentMesh(o),i.mesh.region!=null&&i.mesh.updateRegion()}if(this.linkedMeshes.length=0,a.events)for(let c in a.events){let l=a.events[c],i=new Mt(c);i.intValue=k(l,"int",0),i.floatValue=k(l,"float",0),i.stringValue=k(l,"string",""),i.audioPath=k(l,"audio",null),i.audioPath&&(i.volume=k(l,"volume",1),i.balance=k(l,"balance",0)),t.events.push(i)}if(a.animations)for(let c in a.animations){let l=a.animations[c];this.readAnimation(l,c,t)}return t}readAttachment(e,s,t,a,r){let c=this.scale;switch(a=k(e,"name",a),k(e,"type","region")){case"region":{let l=k(e,"path",a),i=this.readSequence(k(e,"sequence",null)),n=this.attachmentLoader.newRegionAttachment(s,a,l,i);if(!n)return null;n.path=l,n.x=k(e,"x",0)*c,n.y=k(e,"y",0)*c,n.scaleX=k(e,"scaleX",1),n.scaleY=k(e,"scaleY",1),n.rotation=k(e,"rotation",0),n.width=e.width*c,n.height=e.height*c,n.sequence=i;let o=k(e,"color",null);return o&&n.color.setFromString(o),n.region!=null&&n.updateRegion(),n}case"boundingbox":{let l=this.attachmentLoader.newBoundingBoxAttachment(s,a);if(!l)return null;this.readVertices(e,l,e.vertexCount<<1);let i=k(e,"color",null);return i&&l.color.setFromString(i),l}case"mesh":case"linkedmesh":{let l=k(e,"path",a),i=this.readSequence(k(e,"sequence",null)),n=this.attachmentLoader.newMeshAttachment(s,a,l,i);if(!n)return null;n.path=l;let o=k(e,"color",null);o&&n.color.setFromString(o),n.width=k(e,"width",0)*c,n.height=k(e,"height",0)*c,n.sequence=i;let h=k(e,"parent",null);if(h)return this.linkedMeshes.push(new ri(n,k(e,"skin",null),t,h,k(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=k(e,"edges",null),n.hullLength=k(e,"hull",0)*2,n}case"path":{let l=this.attachmentLoader.newPathAttachment(s,a);if(!l)return null;l.closed=k(e,"closed",!1),l.constantSpeed=k(e,"constantSpeed",!0);let i=e.vertexCount;this.readVertices(e,l,i<<1);let n=E.newArray(i/3,0);for(let h=0;h<e.lengths.length;h++)n[h]=e.lengths[h]*c;l.lengths=n;let o=k(e,"color",null);return o&&l.color.setFromString(o),l}case"point":{let l=this.attachmentLoader.newPointAttachment(s,a);if(!l)return null;l.x=k(e,"x",0)*c,l.y=k(e,"y",0)*c,l.rotation=k(e,"rotation",0);let i=k(e,"color",null);return i&&l.color.setFromString(i),l}case"clipping":{let l=this.attachmentLoader.newClippingAttachment(s,a);if(!l)return null;let i=k(e,"end",null);i&&(l.endSlot=r.findSlot(i));let n=e.vertexCount;this.readVertices(e,l,n<<1);let o=k(e,"color",null);return o&&l.color.setFromString(o),l}}return null}readSequence(e){if(e==null)return null;let s=new Ke(k(e,"count",0));return s.start=k(e,"start",1),s.digits=k(e,"digits",0),s.setupIndex=k(e,"setup",0),s}readVertices(e,s,t){let a=this.scale;s.worldVerticesLength=t;let r=e.vertices;if(t==r.length){let i=E.toFloatArray(r);if(a!=1)for(let n=0,o=r.length;n<o;n++)i[n]*=a;s.vertices=i;return}let c=new Array,l=new Array;for(let i=0,n=r.length;i<n;){let o=r[i++];l.push(o);for(let h=i+o*4;i<h;i+=4)l.push(r[i]),c.push(r[i+1]*a),c.push(r[i+2]*a),c.push(r[i+3])}s.bones=l,s.vertices=E.toFloatArray(c)}readAnimation(e,s,t){let a=this.scale,r=new Array;if(e.slots)for(let l in e.slots){let i=e.slots[l],n=t.findSlot(l).index;for(let o in i){let h=i[o];if(!h)continue;let d=h.length;if(o=="attachment"){let f=new Se(d,n);for(let u=0;u<d;u++){let m=h[u];f.setFrame(u,k(m,"time",0),k(m,"name",null))}r.push(f)}else if(o=="rgba"){let f=new ot(d,d<<2,n),u=h[0],m=k(u,"time",0),x=D.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,m,x.r,x.g,x.b,x.a);let g=h[p+1];if(!g){f.shrink(y);break}let w=k(g,"time",0),b=D.fromString(g.color),v=u.curve;v&&(y=z(v,f,y,p,0,m,w,x.r,b.r,1),y=z(v,f,y,p,1,m,w,x.g,b.g,1),y=z(v,f,y,p,2,m,w,x.b,b.b,1),y=z(v,f,y,p,3,m,w,x.a,b.a,1)),m=w,x=b,u=g}r.push(f)}else if(o=="rgb"){let f=new ht(d,d*3,n),u=h[0],m=k(u,"time",0),x=D.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,m,x.r,x.g,x.b);let g=h[p+1];if(!g){f.shrink(y);break}let w=k(g,"time",0),b=D.fromString(g.color),v=u.curve;v&&(y=z(v,f,y,p,0,m,w,x.r,b.r,1),y=z(v,f,y,p,1,m,w,x.g,b.g,1),y=z(v,f,y,p,2,m,w,x.b,b.b,1)),m=w,x=b,u=g}r.push(f)}else if(o=="alpha")r.push(ue(h,new ct(d,d,n),0,1));else if(o=="rgba2"){let f=new dt(d,d*7,n),u=h[0],m=k(u,"time",0),x=D.fromString(u.light),p=D.fromString(u.dark);for(let y=0,g=0;;y++){f.setFrame(y,m,x.r,x.g,x.b,x.a,p.r,p.g,p.b);let w=h[y+1];if(!w){f.shrink(g);break}let b=k(w,"time",0),v=D.fromString(w.light),A=D.fromString(w.dark),S=u.curve;S&&(g=z(S,f,g,y,0,m,b,x.r,v.r,1),g=z(S,f,g,y,1,m,b,x.g,v.g,1),g=z(S,f,g,y,2,m,b,x.b,v.b,1),g=z(S,f,g,y,3,m,b,x.a,v.a,1),g=z(S,f,g,y,4,m,b,p.r,A.r,1),g=z(S,f,g,y,5,m,b,p.g,A.g,1),g=z(S,f,g,y,6,m,b,p.b,A.b,1)),m=b,x=v,p=A,u=w}r.push(f)}else if(o=="rgb2"){let f=new ft(d,d*6,n),u=h[0],m=k(u,"time",0),x=D.fromString(u.light),p=D.fromString(u.dark);for(let y=0,g=0;;y++){f.setFrame(y,m,x.r,x.g,x.b,p.r,p.g,p.b);let w=h[y+1];if(!w){f.shrink(g);break}let b=k(w,"time",0),v=D.fromString(w.light),A=D.fromString(w.dark),S=u.curve;S&&(g=z(S,f,g,y,0,m,b,x.r,v.r,1),g=z(S,f,g,y,1,m,b,x.g,v.g,1),g=z(S,f,g,y,2,m,b,x.b,v.b,1),g=z(S,f,g,y,3,m,b,p.r,A.r,1),g=z(S,f,g,y,4,m,b,p.g,A.g,1),g=z(S,f,g,y,5,m,b,p.b,A.b,1)),m=b,x=v,p=A,u=w}r.push(f)}}}if(e.bones)for(let l in e.bones){let i=e.bones[l],n=t.findBone(l).index;for(let o in i){let h=i[o],d=h.length;if(d!=0){if(o==="rotate")r.push(ue(h,new Le(d,d,n),0,1));else if(o==="translate"){let f=new Ze(d,d<<1,n);r.push(Nt(h,f,"x","y",0,a))}else if(o==="translatex"){let f=new et(d,d,n);r.push(ue(h,f,0,a))}else if(o==="translatey"){let f=new tt(d,d,n);r.push(ue(h,f,0,a))}else if(o==="scale"){let f=new st(d,d<<1,n);r.push(Nt(h,f,"x","y",1,1))}else if(o==="scalex"){let f=new it(d,d,n);r.push(ue(h,f,1,1))}else if(o==="scaley"){let f=new rt(d,d,n);r.push(ue(h,f,1,1))}else if(o==="shear"){let f=new at(d,d<<1,n);r.push(Nt(h,f,"x","y",0,1))}else if(o==="shearx"){let f=new nt(d,d,n);r.push(ue(h,f,0,1))}else if(o==="sheary"){let f=new lt(d,d,n);r.push(ue(h,f,0,1))}}}}if(e.ik)for(let l in e.ik){let i=e.ik[l],n=i[0];if(!n)continue;let o=t.findIkConstraint(l),h=t.ikConstraints.indexOf(o),d=new mt(i.length,i.length<<1,h),f=k(n,"time",0),u=k(n,"mix",1),m=k(n,"softness",0)*a;for(let x=0,p=0;;x++){d.setFrame(x,f,u,m,k(n,"bendPositive",!0)?1:-1,k(n,"compress",!1),k(n,"stretch",!1));let y=i[x+1];if(!y){d.shrink(p);break}let g=k(y,"time",0),w=k(y,"mix",1),b=k(y,"softness",0)*a,v=n.curve;v&&(p=z(v,d,p,x,0,f,g,u,w,1),p=z(v,d,p,x,1,f,g,m,b,a)),f=g,u=w,m=b,n=y}r.push(d)}if(e.transform)for(let l in e.transform){let i=e.transform[l],n=i[0];if(!n)continue;let o=t.findTransformConstraint(l),h=t.transformConstraints.indexOf(o),d=new gt(i.length,i.length*6,h),f=k(n,"time",0),u=k(n,"mixRotate",1),m=k(n,"mixX",1),x=k(n,"mixY",m),p=k(n,"mixScaleX",1),y=k(n,"mixScaleY",p),g=k(n,"mixShearY",1);for(let w=0,b=0;;w++){d.setFrame(w,f,u,m,x,p,y,g);let v=i[w+1];if(!v){d.shrink(b);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),C=k(v,"mixX",1),I=k(v,"mixY",C),M=k(v,"mixScaleX",1),B=k(v,"mixScaleY",M),R=k(v,"mixShearY",1),F=n.curve;F&&(b=z(F,d,b,w,0,f,A,u,S,1),b=z(F,d,b,w,1,f,A,m,C,1),b=z(F,d,b,w,2,f,A,x,I,1),b=z(F,d,b,w,3,f,A,p,M,1),b=z(F,d,b,w,4,f,A,y,B,1),b=z(F,d,b,w,5,f,A,g,R,1)),f=A,u=S,m=C,x=I,p=M,y=B,p=M,n=v}r.push(d)}if(e.path)for(let l in e.path){let i=e.path[l],n=t.findPathConstraint(l),o=t.pathConstraints.indexOf(n);for(let h in i){let d=i[h],f=d[0];if(!f)continue;let u=d.length;if(h==="position"){let m=new xt(u,u,o);r.push(ue(d,m,0,n.positionMode==fe.Fixed?a:1))}else if(h==="spacing"){let m=new bt(u,u,o);r.push(ue(d,m,0,n.spacingMode==Q.Length||n.spacingMode==Q.Fixed?a:1))}else if(h==="mix"){let m=new wt(u,u*3,o),x=k(f,"time",0),p=k(f,"mixRotate",1),y=k(f,"mixX",1),g=k(f,"mixY",y);for(let w=0,b=0;;w++){m.setFrame(w,x,p,y,g);let v=d[w+1];if(!v){m.shrink(b);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),C=k(v,"mixX",1),I=k(v,"mixY",C),M=f.curve;M&&(b=z(M,m,b,w,0,x,A,p,S,1),b=z(M,m,b,w,1,x,A,y,C,1),b=z(M,m,b,w,2,x,A,g,I,1)),x=A,p=S,y=C,g=I,f=v}r.push(m)}}}if(e.attachments)for(let l in e.attachments){let i=e.attachments[l],n=t.findSkin(l);for(let o in i){let h=i[o],d=t.findSlot(o).index;for(let f in h){let u=h[f],m=n.getAttachment(d,f);for(let x in u){let p=u[x],y=p[0];if(!!y){if(x=="deform"){let g=m.bones,w=m.vertices,b=g?w.length/3*2:w.length,v=new ut(p.length,p.length,d,m),A=k(y,"time",0);for(let S=0,C=0;;S++){let I,M=k(y,"vertices",null);if(!M)I=g?E.newFloatArray(b):w;else{I=E.newFloatArray(b);let Y=k(y,"offset",0);if(E.arrayCopy(M,0,I,Y,M.length),a!=1)for(let T=Y,L=T+M.length;T<L;T++)I[T]*=a;if(!g)for(let T=0;T<b;T++)I[T]+=w[T]}v.setFrame(S,A,I);let B=p[S+1];if(!B){v.shrink(C);break}let R=k(B,"time",0),F=y.curve;F&&(C=z(F,v,C,S,0,A,R,0,1,1)),A=R,y=B}r.push(v)}else if(x=="sequence"){let g=new Te(p.length,d,m),w=0;for(let b=0;b<p.length;b++){let v=k(y,"delay",w),A=k(y,"time",0),S=de[k(y,"mode","hold")],C=k(y,"index",0);g.setFrame(b,A,S,C,v),w=v,y=p[b+1]}r.push(g)}}}}}}if(e.drawOrder){let l=new Ae(e.drawOrder.length),i=t.slots.length,n=0;for(let o=0;o<e.drawOrder.length;o++,n++){let h=e.drawOrder[o],d=null,f=k(h,"offsets",null);if(f){d=E.newArray(i,-1);let u=E.newArray(i-f.length,0),m=0,x=0;for(let p=0;p<f.length;p++){let y=f[p],g=t.findSlot(y.slot).index;for(;m!=g;)u[x++]=m++;d[m+y.offset]=m++}for(;m<i;)u[x++]=m++;for(let p=i-1;p>=0;p--)d[p]==-1&&(d[p]=u[--x])}l.setFrame(n,k(h,"time",0),d)}r.push(l)}if(e.events){let l=new Ve(e.events.length),i=0;for(let n=0;n<e.events.length;n++,i++){let o=e.events[n],h=t.findEvent(o.name),d=new Xt(E.toSinglePrecision(k(o,"time",0)),h);d.intValue=k(o,"int",h.intValue),d.floatValue=k(o,"float",h.floatValue),d.stringValue=k(o,"string",h.stringValue),d.data.audioPath&&(d.volume=k(o,"volume",1),d.balance=k(o,"balance",0)),l.setFrame(i,d)}r.push(l)}let c=0;for(let l=0,i=r.length;l<i;l++)c=Math.max(c,r[l].getDuration());t.animations.push(new Oe(s,r,c))}},ri=class{constructor(e,s,t,a,r){this.mesh=e,this.skin=s,this.slotIndex=t,this.parent=a,this.inheritTimeline=r}};function ue(e,s,t,a){let r=e[0],c=k(r,"time",0),l=k(r,"value",t)*a,i=0;for(let n=0;;n++){s.setFrame(n,c,l);let o=e[n+1];if(!o)return s.shrink(i),s;let h=k(o,"time",0),d=k(o,"value",t)*a;r.curve&&(i=z(r.curve,s,i,n,0,c,h,l,d,a)),c=h,l=d,r=o}}function Nt(e,s,t,a,r,c){let l=e[0],i=k(l,"time",0),n=k(l,t,r)*c,o=k(l,a,r)*c,h=0;for(let d=0;;d++){s.setFrame(d,i,n,o);let f=e[d+1];if(!f)return s.shrink(h),s;let u=k(f,"time",0),m=k(f,t,r)*c,x=k(f,a,r)*c,p=l.curve;p&&(h=z(p,s,h,d,0,i,u,n,m,c),h=z(p,s,h,d,1,i,u,o,x,c)),i=u,n=m,o=x,l=f}}function z(e,s,t,a,r,c,l,i,n,o){if(e=="stepped")return s.setStepped(a),t;let h=r<<2,d=e[h],f=e[h+1]*o,u=e[h+2],m=e[h+3]*o;return s.setBezier(t,a,r,c,i,d,f,u,m,l,n),t+1}function k(e,s,t){return e[s]!==void 0?e[s]:t}(()=>{typeof Math.fround=="undefined"&&(Math.fround=function(e){return function(s){return e[0]=s,e[0]}}(new Float32Array(1)))})();var ai=class{constructor(e,s){this.jitterX=0,this.jitterY=0,this.jitterX=e,this.jitterY=s}begin(e){}transform(e,s,t,a){e.x+=X.randomTriangular(-this.jitterX,this.jitterY),e.y+=X.randomTriangular(-this.jitterX,this.jitterY)}end(){}},fs=class{constructor(e){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=e}begin(e){this.worldX=e.x+this.centerX,this.worldY=e.y+this.centerY}transform(e,s,t,a){let r=this.angle*X.degreesToRadians,c=e.x-this.worldX,l=e.y-this.worldY,i=Math.sqrt(c*c+l*l);if(i<this.radius){let n=fs.interpolation.apply(0,r,(this.radius-i)/this.radius),o=Math.cos(n),h=Math.sin(n);e.x=o*c-h*l+this.worldX,e.y=h*c+o*l+this.worldY}}end(){}},us=fs;return us.interpolation=new Ht(2),Wt})();