"use strict";(self.webpackChunkcoinflip=self.webpackChunkcoinflip||[]).push([[873],{2873:(t,e,n)=>{n.r(e),n.d(e,{Animation:()=>x,AnimationState:()=>H,AnimationStateAdapter:()=>K,AnimationStateData:()=>et,AtlasAttachmentLoader:()=>nt,Attachment:()=>a,AttachmentTimeline:()=>F,Bone:()=>at,BoneData:()=>rt,BoundingBoxAttachment:()=>o,ClippingAttachment:()=>l,ColorTimeline:()=>C,ConstraintData:()=>it,CurveTimeline:()=>M,DeformTimeline:()=>N,DrawOrderTimeline:()=>Y,Event:()=>ot,EventData:()=>lt,EventQueue:()=>z,EventTimeline:()=>_,EventType:()=>J,IkConstraint:()=>ht,IkConstraintData:()=>ct,IkConstraintTimeline:()=>D,JitterEffect:()=>g,MeshAttachment:()=>h,PathAttachment:()=>c,PathConstraint:()=>mt,PathConstraintData:()=>dt,PathConstraintMixTimeline:()=>$,PathConstraintPositionTimeline:()=>L,PathConstraintSpacingTimeline:()=>W,PointAttachment:()=>d,RegionAttachment:()=>m,RotateTimeline:()=>I,ScaleTimeline:()=>R,ShearTimeline:()=>y,Skeleton:()=>Et,SkeletonBinary:()=>Tt,SkeletonBounds:()=>yt,SkeletonData:()=>xt,SkeletonJson:()=>kt,Skin:()=>St,SkinEntry:()=>Mt,Slot:()=>u,SlotData:()=>bt,SpacingMode:()=>ut,Spine:()=>Vt,SwirlEffect:()=>E,TimelineType:()=>b,TrackEntry:()=>j,TransformConstraint:()=>gt,TransformConstraintData:()=>wt,TransformConstraintTimeline:()=>q,TranslateTimeline:()=>A,TwoColorTimeline:()=>P,VertexAttachment:()=>i});var s=n(8766);class a{constructor(t){if(null==t)throw new Error("name cannot be null.");this.name=t}}const r=class extends a{constructor(t){super(t),this.id=(65535&r.nextID++)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(t,e){this.computeWorldVertices(t,0,this.worldVerticesLength,e,0,2)}computeWorldVertices(t,e,n,s,a,r){n=a+(n>>1)*r;const i=t.bone.skeleton,o=t.deform;let l=this.vertices;const h=this.bones;if(null==h){o.length>0&&(l=o);const i=t.bone.matrix,h=i.tx,c=i.ty,d=i.a,u=i.c,f=i.b,m=i.d;for(let t=e,i=a;i<n;t+=2,i+=r){const e=l[t],n=l[t+1];s[i]=e*d+n*u+h,s[i+1]=e*f+n*m+c}return}let c=0,d=0;for(let t=0;t<e;t+=2){const t=h[c];c+=t+1,d+=t}const u=i.bones;if(0==o.length)for(let t=a,e=3*d;t<n;t+=r){let n=0,a=0,r=h[c++];for(r+=c;c<r;c++,e+=3){const t=u[h[c]].matrix,s=l[e],r=l[e+1],i=l[e+2];n+=(s*t.a+r*t.c+t.tx)*i,a+=(s*t.b+r*t.d+t.ty)*i}s[t]=n,s[t+1]=a}else{const t=o;for(let e=a,i=3*d,o=d<<1;e<n;e+=r){let n=0,a=0,r=h[c++];for(r+=c;c<r;c++,i+=3,o+=2){const e=u[h[c]].matrix,s=l[i]+t[o],r=l[i+1]+t[o+1],d=l[i+2];n+=(s*e.a+r*e.c+e.tx)*d,a+=(s*e.b+r*e.d+e.ty)*d}s[e]=n,s[e+1]=a}}}copyTo(t){null!=this.bones?(t.bones=new Array(this.bones.length),s.cQ.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,null!=this.vertices?(t.vertices=s.cQ.newFloatArray(this.vertices.length),s.cQ.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment}};let i=r;i.nextID=0;class o extends i{constructor(t){super(t),this.type=s.sf.BoundingBox,this.color=new s.Il(1,1,1,1)}copy(){const t=new o(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}class l extends i{constructor(t){super(t),this.type=s.sf.Clipping,this.color=new s.Il(.2275,.2275,.8078,1)}copy(){const t=new l(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}class h extends i{constructor(t){super(t),this.type=s.sf.Mesh,this.color=new s.Il(1,1,1,1),this.tempColor=new s.Il(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(null!=this.parentMesh)return this.newLinkedMesh();const t=new h(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),s.cQ.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),s.cQ.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,null!=this.edges&&(t.edges=new Array(this.edges.length),s.cQ.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new h(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(null!=this.parentMesh?this.parentMesh:this),t}}class c extends i{constructor(t){super(t),this.type=s.sf.Path,this.closed=!1,this.constantSpeed=!1,this.color=new s.Il(1,1,1,1)}copy(){const t=new c(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),s.cQ.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class d extends i{constructor(t){super(t),this.type=s.sf.Point,this.color=new s.Il(.38,.94,0,1)}computeWorldPosition(t,e){const n=t.matrix;return e.x=this.x*n.a+this.y*n.c+t.worldX,e.y=this.x*n.b+this.y*n.d+t.worldY,e}computeWorldRotation(t){const e=t.matrix,n=s.M8.cosDeg(this.rotation),a=s.M8.sinDeg(this.rotation),r=n*e.a+a*e.c,i=n*e.b+a*e.d;return Math.atan2(i,r)*s.M8.radDeg}copy(){const t=new d(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}class u{constructor(t,e){if(this.deform=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new s.Il,this.darkColor=null==t.darkColor?null:new s.Il,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const f=class extends a{constructor(t){super(t),this.type=s.sf.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new s.Il(1,1,1,1),this.offset=s.cQ.newFloatArray(8),this.uvs=s.cQ.newFloatArray(8),this.tempColor=new s.Il(1,1,1,1)}updateOffset(){const t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*t,s=-this.height/2*this.scaleY+this.region.offsetY*e,a=n+this.region.width*t,r=s+this.region.height*e,i=this.rotation*Math.PI/180,o=Math.cos(i),l=Math.sin(i),h=n*o+this.x,c=n*l,d=s*o+this.y,u=s*l,m=a*o+this.x,g=a*l,p=r*o+this.y,E=r*l,x=this.offset;x[f.OX1]=h-u,x[f.OY1]=d+c,x[f.OX2]=h-E,x[f.OY2]=p+c,x[f.OX3]=m-E,x[f.OY3]=p+g,x[f.OX4]=m-u,x[f.OY4]=d+g}setRegion(t){this.region=t;const e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,n,s){const a=this.offset,r=t instanceof u?t.bone.matrix:t.matrix,i=r.tx,o=r.ty,l=r.a,h=r.c,c=r.b,d=r.d;let m=0,g=0;m=a[f.OX1],g=a[f.OY1],e[n]=m*l+g*h+i,e[n+1]=m*c+g*d+o,n+=s,m=a[f.OX2],g=a[f.OY2],e[n]=m*l+g*h+i,e[n+1]=m*c+g*d+o,n+=s,m=a[f.OX3],g=a[f.OY3],e[n]=m*l+g*h+i,e[n+1]=m*c+g*d+o,n+=s,m=a[f.OX4],g=a[f.OY4],e[n]=m*l+g*h+i,e[n+1]=m*c+g*d+o}copy(){const t=new f(this.name);return t.region=this.region,t.rendererObject=this.rendererObject,t.path=this.path,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,s.cQ.arrayCopy(this.uvs,0,t.uvs,0,8),s.cQ.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t}};let m=f;m.OX1=0,m.OY1=1,m.OX2=2,m.OY2=3,m.OX3=4,m.OY3=5,m.OX4=6,m.OY4=7,m.X1=0,m.Y1=1,m.C1R=2,m.C1G=3,m.C1B=4,m.C1A=5,m.U1=6,m.V1=7,m.X2=8,m.Y2=9,m.C2R=10,m.C2G=11,m.C2B=12,m.C2A=13,m.U2=14,m.V2=15,m.X3=16,m.Y3=17,m.C3R=18,m.C3G=19,m.C3B=20,m.C3A=21,m.U3=22,m.V3=23,m.X4=24,m.Y4=25,m.C4R=26,m.C4G=27,m.C4B=28,m.C4A=29,m.U4=30,m.V4=31;class g{constructor(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}begin(t){}transform(t,e,n,a){t.x+=s.M8.randomTriangular(-this.jitterX,this.jitterY),t.y+=s.M8.randomTriangular(-this.jitterX,this.jitterY)}end(){}}const p=class{constructor(t){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t}begin(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY}transform(t,e,n,a){const r=this.angle*s.M8.degreesToRadians,i=t.x-this.worldX,o=t.y-this.worldY,l=Math.sqrt(i*i+o*o);if(l<this.radius){const e=p.interpolation.apply(0,r,(this.radius-l)/this.radius),n=Math.cos(e),s=Math.sin(e);t.x=n*i-s*o+this.worldX,t.y=s*i+n*o+this.worldY}}end(){}};let E=p;E.interpolation=new s.RN(2);class x{constructor(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let t=0;t<e.length;t++)this.timelineIds[e[t].getPropertyId()]=!0;this.duration=n}hasTimeline(t){return 1==this.timelineIds[t]}apply(t,e,n,s,a,r,i,o){if(null==t)throw new Error("skeleton cannot be null.");s&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));const l=this.timelines;for(let s=0,h=l.length;s<h;s++)l[s].apply(t,e,n,a,r,i,o)}static binarySearch(t,e,n=1){let s=0,a=t.length/n-2;if(0==a)return n;let r=a>>>1;for(;;){if(t[(r+1)*n]<=e?s=r+1:a=r,s==a)return(s+1)*n;r=s+a>>>1}}static linearSearch(t,e,n){for(let s=0,a=t.length-n;s<=a;s+=n)if(t[s]>e)return s;return-1}}var b=(t=>(t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor",t))(b||{});const w=class{constructor(t){if(t<=0)throw new Error(`frameCount must be > 0: ${t}`);this.curves=s.cQ.newFloatArray((t-1)*w.BEZIER_SIZE)}getFrameCount(){return this.curves.length/w.BEZIER_SIZE+1}setLinear(t){this.curves[t*w.BEZIER_SIZE]=w.LINEAR}setStepped(t){this.curves[t*w.BEZIER_SIZE]=w.STEPPED}getCurveType(t){const e=t*w.BEZIER_SIZE;if(e==this.curves.length)return w.LINEAR;const n=this.curves[e];return n==w.LINEAR?w.LINEAR:n==w.STEPPED?w.STEPPED:w.BEZIER}setCurve(t,e,n,s,a){const r=.03*(2*-e+s),i=.03*(2*-n+a),o=.006*(3*(e-s)+1),l=.006*(3*(n-a)+1);let h=2*r+o,c=2*i+l,d=.3*e+r+.16666667*o,u=.3*n+i+.16666667*l,f=t*w.BEZIER_SIZE;const m=this.curves;m[f++]=w.BEZIER;let g=d,p=u;for(let t=f+w.BEZIER_SIZE-1;f<t;f+=2)m[f]=g,m[f+1]=p,d+=h,u+=c,h+=o,c+=l,g+=d,p+=u}getCurvePercent(t,e){e=s.M8.clamp(e,0,1);const n=this.curves;let a=t*w.BEZIER_SIZE;const r=n[a];if(r==w.LINEAR)return e;if(r==w.STEPPED)return 0;a++;let i=0;for(let t=a,s=a+w.BEZIER_SIZE-1;a<s;a+=2)if(i=n[a],i>=e){let s,r;return a==t?(s=0,r=0):(s=n[a-2],r=n[a-1]),r+(n[a+1]-r)*(e-s)/(i-s)}const o=n[a-1];return o+(1-o)*(e-i)/(1-i)}};let M=w;M.LINEAR=0,M.STEPPED=1,M.BEZIER=2,M.BEZIER_SIZE=19;const S=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+S.ROTATION]=n}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return void(h.rotation=h.data.rotation);case s.bq.first:const t=h.data.rotation-h.rotation;h.rotation+=(t-360*(16384-(16384.499999999996-t/360|0)))*r}return}if(n>=l[l.length-S.ENTRIES]){let t=l[l.length+S.PREV_ROTATION];switch(i){case s.bq.setup:h.rotation=h.data.rotation+t*r;break;case s.bq.first:case s.bq.replace:t+=h.data.rotation-h.rotation,t-=360*(16384-(16384.499999999996-t/360|0));case s.bq.add:h.rotation+=t*r}return}const c=x.binarySearch(l,n,S.ENTRIES),d=l[c+S.PREV_ROTATION],u=l[c],f=this.getCurvePercent((c>>1)-1,1-(n-u)/(l[c+S.PREV_TIME]-u));let m=l[c+S.ROTATION]-d;switch(m=d+(m-360*(16384-(16384.499999999996-m/360|0)))*f,i){case s.bq.setup:h.rotation=h.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*r;break;case s.bq.first:case s.bq.replace:m+=h.data.rotation-h.rotation;case s.bq.add:h.rotation+=(m-360*(16384-(16384.499999999996-m/360|0)))*r}}};let I=S;I.ENTRIES=2,I.PREV_TIME=-2,I.PREV_ROTATION=-1,I.ROTATION=1;const T=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*T.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(t,e,n,s){t*=T.ENTRIES,this.frames[t]=e,this.frames[t+T.X]=n,this.frames[t+T.Y]=s}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return h.x=h.data.x,void(h.y=h.data.y);case s.bq.first:h.x+=(h.data.x-h.x)*r,h.y+=(h.data.y-h.y)*r}return}let c=0,d=0;if(n>=l[l.length-T.ENTRIES])c=l[l.length+T.PREV_X],d=l[l.length+T.PREV_Y];else{const t=x.binarySearch(l,n,T.ENTRIES);c=l[t+T.PREV_X],d=l[t+T.PREV_Y];const e=l[t],s=this.getCurvePercent(t/T.ENTRIES-1,1-(n-e)/(l[t+T.PREV_TIME]-e));c+=(l[t+T.X]-c)*s,d+=(l[t+T.Y]-d)*s}switch(i){case s.bq.setup:h.x=h.data.x+c*r,h.y=h.data.y+d*r;break;case s.bq.first:case s.bq.replace:h.x+=(h.data.x+c-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case s.bq.add:h.x+=c*r,h.y+=d*r}}};let A=T;A.ENTRIES=3,A.PREV_TIME=-3,A.PREV_X=-2,A.PREV_Y=-1,A.X=1,A.Y=2;class R extends A{constructor(t){super(t)}getPropertyId(){return(2<<24)+this.boneIndex}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return h.scaleX=h.data.scaleX,void(h.scaleY=h.data.scaleY);case s.bq.first:h.scaleX+=(h.data.scaleX-h.scaleX)*r,h.scaleY+=(h.data.scaleY-h.scaleY)*r}return}let c=0,d=0;if(n>=l[l.length-R.ENTRIES])c=l[l.length+R.PREV_X]*h.data.scaleX,d=l[l.length+R.PREV_Y]*h.data.scaleY;else{const t=x.binarySearch(l,n,R.ENTRIES);c=l[t+R.PREV_X],d=l[t+R.PREV_Y];const e=l[t],s=this.getCurvePercent(t/R.ENTRIES-1,1-(n-e)/(l[t+R.PREV_TIME]-e));c=(c+(l[t+R.X]-c)*s)*h.data.scaleX,d=(d+(l[t+R.Y]-d)*s)*h.data.scaleY}if(1==r)i==s.bq.add?(h.scaleX+=c-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=c,h.scaleY=d);else{let t=0,e=0;if(o==s.mJ.mixOut)switch(i){case s.bq.setup:t=h.data.scaleX,e=h.data.scaleY,h.scaleX=t+(Math.abs(c)*s.M8.signum(t)-t)*r,h.scaleY=e+(Math.abs(d)*s.M8.signum(e)-e)*r;break;case s.bq.first:case s.bq.replace:t=h.scaleX,e=h.scaleY,h.scaleX=t+(Math.abs(c)*s.M8.signum(t)-t)*r,h.scaleY=e+(Math.abs(d)*s.M8.signum(e)-e)*r;break;case s.bq.add:t=h.scaleX,e=h.scaleY,h.scaleX=t+(Math.abs(c)*s.M8.signum(t)-h.data.scaleX)*r,h.scaleY=e+(Math.abs(d)*s.M8.signum(e)-h.data.scaleY)*r}else switch(i){case s.bq.setup:t=Math.abs(h.data.scaleX)*s.M8.signum(c),e=Math.abs(h.data.scaleY)*s.M8.signum(d),h.scaleX=t+(c-t)*r,h.scaleY=e+(d-e)*r;break;case s.bq.first:case s.bq.replace:t=Math.abs(h.scaleX)*s.M8.signum(c),e=Math.abs(h.scaleY)*s.M8.signum(d),h.scaleX=t+(c-t)*r,h.scaleY=e+(d-e)*r;break;case s.bq.add:t=s.M8.signum(c),e=s.M8.signum(d),h.scaleX=Math.abs(h.scaleX)*t+(c-Math.abs(h.data.scaleX)*t)*r,h.scaleY=Math.abs(h.scaleY)*e+(d-Math.abs(h.data.scaleY)*e)*r}}}}class y extends A{constructor(t){super(t)}getPropertyId(){return(3<<24)+this.boneIndex}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return h.shearX=h.data.shearX,void(h.shearY=h.data.shearY);case s.bq.first:h.shearX+=(h.data.shearX-h.shearX)*r,h.shearY+=(h.data.shearY-h.shearY)*r}return}let c=0,d=0;if(n>=l[l.length-y.ENTRIES])c=l[l.length+y.PREV_X],d=l[l.length+y.PREV_Y];else{const t=x.binarySearch(l,n,y.ENTRIES);c=l[t+y.PREV_X],d=l[t+y.PREV_Y];const e=l[t],s=this.getCurvePercent(t/y.ENTRIES-1,1-(n-e)/(l[t+y.PREV_TIME]-e));c+=(l[t+y.X]-c)*s,d+=(l[t+y.Y]-d)*s}switch(i){case s.bq.setup:h.shearX=h.data.shearX+c*r,h.shearY=h.data.shearY+d*r;break;case s.bq.first:case s.bq.replace:h.shearX+=(h.data.shearX+c-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case s.bq.add:h.shearX+=c*r,h.shearY+=d*r}}}const k=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*k.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(t,e,n,s,a,r){t*=k.ENTRIES,this.frames[t]=e,this.frames[t+k.R]=n,this.frames[t+k.G]=s,this.frames[t+k.B]=a,this.frames[t+k.A]=r}apply(t,e,n,a,r,i,o){const l=t.slots[this.slotIndex];if(!l.bone.active)return;const h=this.frames;if(n<h[0]){switch(i){case s.bq.setup:return void l.color.setFromColor(l.data.color);case s.bq.first:const t=l.color,e=l.data.color;t.add((e.r-t.r)*r,(e.g-t.g)*r,(e.b-t.b)*r,(e.a-t.a)*r)}return}let c=0,d=0,u=0,f=0;if(n>=h[h.length-k.ENTRIES]){const t=h.length;c=h[t+k.PREV_R],d=h[t+k.PREV_G],u=h[t+k.PREV_B],f=h[t+k.PREV_A]}else{const t=x.binarySearch(h,n,k.ENTRIES);c=h[t+k.PREV_R],d=h[t+k.PREV_G],u=h[t+k.PREV_B],f=h[t+k.PREV_A];const e=h[t],s=this.getCurvePercent(t/k.ENTRIES-1,1-(n-e)/(h[t+k.PREV_TIME]-e));c+=(h[t+k.R]-c)*s,d+=(h[t+k.G]-d)*s,u+=(h[t+k.B]-u)*s,f+=(h[t+k.A]-f)*s}if(1==r)l.color.set(c,d,u,f);else{const t=l.color;i==s.bq.setup&&t.setFromColor(l.data.color),t.add((c-t.r)*r,(d-t.g)*r,(u-t.b)*r,(f-t.a)*r)}}};let C=k;C.ENTRIES=5,C.PREV_TIME=-5,C.PREV_R=-4,C.PREV_G=-3,C.PREV_B=-2,C.PREV_A=-1,C.R=1,C.G=2,C.B=3,C.A=4;const V=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*V.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(t,e,n,s,a,r,i,o,l){t*=V.ENTRIES,this.frames[t]=e,this.frames[t+V.R]=n,this.frames[t+V.G]=s,this.frames[t+V.B]=a,this.frames[t+V.A]=r,this.frames[t+V.R2]=i,this.frames[t+V.G2]=o,this.frames[t+V.B2]=l}apply(t,e,n,a,r,i,o){const l=t.slots[this.slotIndex];if(!l.bone.active)return;const h=this.frames;if(n<h[0]){switch(i){case s.bq.setup:return l.color.setFromColor(l.data.color),void l.darkColor.setFromColor(l.data.darkColor);case s.bq.first:const t=l.color,e=l.darkColor,n=l.data.color,a=l.data.darkColor;t.add((n.r-t.r)*r,(n.g-t.g)*r,(n.b-t.b)*r,(n.a-t.a)*r),e.add((a.r-e.r)*r,(a.g-e.g)*r,(a.b-e.b)*r,0)}return}let c=0,d=0,u=0,f=0,m=0,g=0,p=0;if(n>=h[h.length-V.ENTRIES]){const t=h.length;c=h[t+V.PREV_R],d=h[t+V.PREV_G],u=h[t+V.PREV_B],f=h[t+V.PREV_A],m=h[t+V.PREV_R2],g=h[t+V.PREV_G2],p=h[t+V.PREV_B2]}else{const t=x.binarySearch(h,n,V.ENTRIES);c=h[t+V.PREV_R],d=h[t+V.PREV_G],u=h[t+V.PREV_B],f=h[t+V.PREV_A],m=h[t+V.PREV_R2],g=h[t+V.PREV_G2],p=h[t+V.PREV_B2];const e=h[t],s=this.getCurvePercent(t/V.ENTRIES-1,1-(n-e)/(h[t+V.PREV_TIME]-e));c+=(h[t+V.R]-c)*s,d+=(h[t+V.G]-d)*s,u+=(h[t+V.B]-u)*s,f+=(h[t+V.A]-f)*s,m+=(h[t+V.R2]-m)*s,g+=(h[t+V.G2]-g)*s,p+=(h[t+V.B2]-p)*s}if(1==r)l.color.set(c,d,u,f),l.darkColor.set(m,g,p,1);else{const t=l.color,e=l.darkColor;i==s.bq.setup&&(t.setFromColor(l.data.color),e.setFromColor(l.data.darkColor)),t.add((c-t.r)*r,(d-t.g)*r,(u-t.b)*r,(f-t.a)*r),e.add((m-e.r)*r,(g-e.g)*r,(p-e.b)*r,0)}}};let P=V;P.ENTRIES=8,P.PREV_TIME=-8,P.PREV_R=-7,P.PREV_G=-6,P.PREV_B=-5,P.PREV_A=-4,P.PREV_R2=-3,P.PREV_G2=-2,P.PREV_B2=-1,P.R=1,P.G=2,P.B=3,P.A=4,P.R2=5,P.G2=6,P.B2=7;class F{constructor(t){this.frames=s.cQ.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n}apply(t,e,n,a,r,i,o){const l=t.slots[this.slotIndex];if(!l.bone.active)return;if(o==s.mJ.mixOut)return void(i==s.bq.setup&&this.setAttachment(t,l,l.data.attachmentName));const h=this.frames;if(n<h[0])return void(i!=s.bq.setup&&i!=s.bq.first||this.setAttachment(t,l,l.data.attachmentName));let c=0;c=n>=h[h.length-1]?h.length-1:x.binarySearch(h,n,1)-1;const d=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}setAttachment(t,e,n){e.setAttachment(null==n?null:t.getAttachment(this.slotIndex,n))}}let v=null;class N extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t),this.frameVertices=new Array(t),null==v&&(v=s.cQ.newFloatArray(64))}getPropertyId(){return(6<<27)+Number(this.attachment.id)+this.slotIndex}setFrame(t,e,n){this.frames[t]=e,this.frameVertices[t]=n}apply(t,e,n,a,r,o,l){const h=t.slots[this.slotIndex];if(!h.bone.active)return;const c=h.getAttachment();if(!(c instanceof i)||c.deformAttachment!=this.attachment)return;const d=h.deform;0==d.length&&(o=s.bq.setup);const u=this.frameVertices,f=u[0].length,m=this.frames;if(n<m[0]){const t=c;switch(o){case s.bq.setup:return void(d.length=0);case s.bq.first:if(1==r){d.length=0;break}const e=s.cQ.setArraySize(d,f);if(null==t.bones){const n=t.vertices;for(let t=0;t<f;t++)e[t]+=(n[t]-e[t])*r}else{r=1-r;for(let t=0;t<f;t++)e[t]*=r}}return}const g=s.cQ.setArraySize(d,f);if(n>=m[m.length-1]){const t=u[m.length-1];if(1==r)if(o==s.bq.add){const e=c;if(null==e.bones){const n=e.vertices;for(let e=0;e<f;e++)g[e]+=t[e]-n[e]}else for(let e=0;e<f;e++)g[e]+=t[e]}else s.cQ.arrayCopy(t,0,g,0,f);else switch(o){case s.bq.setup:{const e=c;if(null==e.bones){const n=e.vertices;for(let e=0;e<f;e++){const s=n[e];g[e]=s+(t[e]-s)*r}}else for(let e=0;e<f;e++)g[e]=t[e]*r;break}case s.bq.first:case s.bq.replace:for(let e=0;e<f;e++)g[e]+=(t[e]-g[e])*r;break;case s.bq.add:const e=c;if(null==e.bones){const n=e.vertices;for(let e=0;e<f;e++)g[e]+=(t[e]-n[e])*r}else for(let e=0;e<f;e++)g[e]+=t[e]*r}return}const p=x.binarySearch(m,n),E=u[p-1],b=u[p],w=m[p],M=this.getCurvePercent(p-1,1-(n-w)/(m[p-1]-w));if(1==r)if(o==s.bq.add){const t=c;if(null==t.bones){const e=t.vertices;for(let t=0;t<f;t++){const n=E[t];g[t]+=n+(b[t]-n)*M-e[t]}}else for(let t=0;t<f;t++){const e=E[t];g[t]+=e+(b[t]-e)*M}}else for(let t=0;t<f;t++){const e=E[t];g[t]=e+(b[t]-e)*M}else switch(o){case s.bq.setup:{const t=c;if(null==t.bones){const e=t.vertices;for(let t=0;t<f;t++){const n=E[t],s=e[t];g[t]=s+(n+(b[t]-n)*M-s)*r}}else for(let t=0;t<f;t++){const e=E[t];g[t]=(e+(b[t]-e)*M)*r}break}case s.bq.first:case s.bq.replace:for(let t=0;t<f;t++){const e=E[t];g[t]+=(e+(b[t]-e)*M-g[t])*r}break;case s.bq.add:const t=c;if(null==t.bones){const e=t.vertices;for(let t=0;t<f;t++){const n=E[t];g[t]+=(n+(b[t]-n)*M-e[t])*r}}else for(let t=0;t<f;t++){const e=E[t];g[t]+=(e+(b[t]-e)*M)*r}}}}class _{constructor(t){this.frames=s.cQ.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,n,s,a,r,i){if(null==s)return;const o=this.frames,l=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,s,a,r,i),e=-1;else if(e>=o[l-1])return;if(n<o[0])return;let h=0;if(e<o[0])h=0;else{h=x.binarySearch(o,e);const t=o[h];for(;h>0&&o[h-1]==t;)h--}for(;h<l&&n>=o[h];h++)s.push(this.events[h])}}class Y{constructor(t){this.frames=s.cQ.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}apply(t,e,n,a,r,i,o){const l=t.drawOrder,h=t.slots;if(o==s.mJ.mixOut&&i==s.bq.setup)return void s.cQ.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);const c=this.frames;if(n<c[0])return void(i!=s.bq.setup&&i!=s.bq.first||s.cQ.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let d=0;d=n>=c[c.length-1]?c.length-1:x.binarySearch(c,n)-1;const u=this.drawOrders[d];if(null==u)s.cQ.arrayCopy(h,0,l,0,h.length);else for(let t=0,e=u.length;t<e;t++)l[t]=h[u[t]]}}const X=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*X.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(t,e,n,s,a,r,i){t*=X.ENTRIES,this.frames[t]=e,this.frames[t+X.MIX]=n,this.frames[t+X.SOFTNESS]=s,this.frames[t+X.BEND_DIRECTION]=a,this.frames[t+X.COMPRESS]=r?1:0,this.frames[t+X.STRETCH]=i?1:0}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,void(h.stretch=h.data.stretch);case s.bq.first:h.mix+=(h.data.mix-h.mix)*r,h.softness+=(h.data.softness-h.softness)*r,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(n>=l[l.length-X.ENTRIES])return void(i==s.bq.setup?(h.mix=h.data.mix+(l[l.length+X.PREV_MIX]-h.data.mix)*r,h.softness=h.data.softness+(l[l.length+X.PREV_SOFTNESS]-h.data.softness)*r,o==s.mJ.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=l[l.length+X.PREV_BEND_DIRECTION],h.compress=0!=l[l.length+X.PREV_COMPRESS],h.stretch=0!=l[l.length+X.PREV_STRETCH])):(h.mix+=(l[l.length+X.PREV_MIX]-h.mix)*r,h.softness+=(l[l.length+X.PREV_SOFTNESS]-h.softness)*r,o==s.mJ.mixIn&&(h.bendDirection=l[l.length+X.PREV_BEND_DIRECTION],h.compress=0!=l[l.length+X.PREV_COMPRESS],h.stretch=0!=l[l.length+X.PREV_STRETCH])));const c=x.binarySearch(l,n,X.ENTRIES),d=l[c+X.PREV_MIX],u=l[c+X.PREV_SOFTNESS],f=l[c],m=this.getCurvePercent(c/X.ENTRIES-1,1-(n-f)/(l[c+X.PREV_TIME]-f));i==s.bq.setup?(h.mix=h.data.mix+(d+(l[c+X.MIX]-d)*m-h.data.mix)*r,h.softness=h.data.softness+(u+(l[c+X.SOFTNESS]-u)*m-h.data.softness)*r,o==s.mJ.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=l[c+X.PREV_BEND_DIRECTION],h.compress=0!=l[c+X.PREV_COMPRESS],h.stretch=0!=l[c+X.PREV_STRETCH])):(h.mix+=(d+(l[c+X.MIX]-d)*m-h.mix)*r,h.softness+=(u+(l[c+X.SOFTNESS]-u)*m-h.softness)*r,o==s.mJ.mixIn&&(h.bendDirection=l[c+X.PREV_BEND_DIRECTION],h.compress=0!=l[c+X.PREV_COMPRESS],h.stretch=0!=l[c+X.PREV_STRETCH]))}};let D=X;D.ENTRIES=6,D.PREV_TIME=-6,D.PREV_MIX=-5,D.PREV_SOFTNESS=-4,D.PREV_BEND_DIRECTION=-3,D.PREV_COMPRESS=-2,D.PREV_STRETCH=-1,D.MIX=1,D.SOFTNESS=2,D.BEND_DIRECTION=3,D.COMPRESS=4,D.STRETCH=5;const O=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*O.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(t,e,n,s,a,r){t*=O.ENTRIES,this.frames[t]=e,this.frames[t+O.ROTATE]=n,this.frames[t+O.TRANSLATE]=s,this.frames[t+O.SCALE]=a,this.frames[t+O.SHEAR]=r}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(n<l[0]){const t=h.data;switch(i){case s.bq.setup:return h.rotateMix=t.rotateMix,h.translateMix=t.translateMix,h.scaleMix=t.scaleMix,void(h.shearMix=t.shearMix);case s.bq.first:h.rotateMix+=(t.rotateMix-h.rotateMix)*r,h.translateMix+=(t.translateMix-h.translateMix)*r,h.scaleMix+=(t.scaleMix-h.scaleMix)*r,h.shearMix+=(t.shearMix-h.shearMix)*r}return}let c=0,d=0,u=0,f=0;if(n>=l[l.length-O.ENTRIES]){const t=l.length;c=l[t+O.PREV_ROTATE],d=l[t+O.PREV_TRANSLATE],u=l[t+O.PREV_SCALE],f=l[t+O.PREV_SHEAR]}else{const t=x.binarySearch(l,n,O.ENTRIES);c=l[t+O.PREV_ROTATE],d=l[t+O.PREV_TRANSLATE],u=l[t+O.PREV_SCALE],f=l[t+O.PREV_SHEAR];const e=l[t],s=this.getCurvePercent(t/O.ENTRIES-1,1-(n-e)/(l[t+O.PREV_TIME]-e));c+=(l[t+O.ROTATE]-c)*s,d+=(l[t+O.TRANSLATE]-d)*s,u+=(l[t+O.SCALE]-u)*s,f+=(l[t+O.SHEAR]-f)*s}if(i==s.bq.setup){const t=h.data;h.rotateMix=t.rotateMix+(c-t.rotateMix)*r,h.translateMix=t.translateMix+(d-t.translateMix)*r,h.scaleMix=t.scaleMix+(u-t.scaleMix)*r,h.shearMix=t.shearMix+(f-t.shearMix)*r}else h.rotateMix+=(c-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r,h.scaleMix+=(u-h.scaleMix)*r,h.shearMix+=(f-h.shearMix)*r}};let q=O;q.ENTRIES=5,q.PREV_TIME=-5,q.PREV_ROTATE=-4,q.PREV_TRANSLATE=-3,q.PREV_SCALE=-2,q.PREV_SHEAR=-1,q.ROTATE=1,q.TRANSLATE=2,q.SCALE=3,q.SHEAR=4;const B=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*B.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(t,e,n){t*=B.ENTRIES,this.frames[t]=e,this.frames[t+B.VALUE]=n}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return void(h.position=h.data.position);case s.bq.first:h.position+=(h.data.position-h.position)*r}return}let c=0;if(n>=l[l.length-B.ENTRIES])c=l[l.length+B.PREV_VALUE];else{const t=x.binarySearch(l,n,B.ENTRIES);c=l[t+B.PREV_VALUE];const e=l[t],s=this.getCurvePercent(t/B.ENTRIES-1,1-(n-e)/(l[t+B.PREV_TIME]-e));c+=(l[t+B.VALUE]-c)*s}i==s.bq.setup?h.position=h.data.position+(c-h.data.position)*r:h.position+=(c-h.position)*r}};let L=B;L.ENTRIES=2,L.PREV_TIME=-2,L.PREV_VALUE=-1,L.VALUE=1;class W extends L{constructor(t){super(t)}getPropertyId(){return(12<<24)+this.pathConstraintIndex}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return void(h.spacing=h.data.spacing);case s.bq.first:h.spacing+=(h.data.spacing-h.spacing)*r}return}let c=0;if(n>=l[l.length-W.ENTRIES])c=l[l.length+W.PREV_VALUE];else{const t=x.binarySearch(l,n,W.ENTRIES);c=l[t+W.PREV_VALUE];const e=l[t],s=this.getCurvePercent(t/W.ENTRIES-1,1-(n-e)/(l[t+W.PREV_TIME]-e));c+=(l[t+W.VALUE]-c)*s}i==s.bq.setup?h.spacing=h.data.spacing+(c-h.data.spacing)*r:h.spacing+=(c-h.spacing)*r}}const Q=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*Q.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(t,e,n,s){t*=Q.ENTRIES,this.frames[t]=e,this.frames[t+Q.ROTATE]=n,this.frames[t+Q.TRANSLATE]=s}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(n<l[0]){switch(i){case s.bq.setup:return h.rotateMix=h.data.rotateMix,void(h.translateMix=h.data.translateMix);case s.bq.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*r,h.translateMix+=(h.data.translateMix-h.translateMix)*r}return}let c=0,d=0;if(n>=l[l.length-Q.ENTRIES])c=l[l.length+Q.PREV_ROTATE],d=l[l.length+Q.PREV_TRANSLATE];else{const t=x.binarySearch(l,n,Q.ENTRIES);c=l[t+Q.PREV_ROTATE],d=l[t+Q.PREV_TRANSLATE];const e=l[t],s=this.getCurvePercent(t/Q.ENTRIES-1,1-(n-e)/(l[t+Q.PREV_TIME]-e));c+=(l[t+Q.ROTATE]-c)*s,d+=(l[t+Q.TRANSLATE]-d)*s}i==s.bq.setup?(h.rotateMix=h.data.rotateMix+(c-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(c-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}};let $=Q;$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2;const U=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new z(this),this.propertyIDs=new s.JS,this.animationsChanged=!1,this.trackEntryPool=new s.Kg((()=>new j)),this.data=t}update(t){t*=this.timeScale;const e=this.tracks;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(null==s)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let a=t*s.timeScale;if(s.delay>0){if(s.delay-=a,s.delay>0)continue;a=-s.delay,s.delay=0}let r=s.next;if(null!=r){const e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=a,this.setCurrent(n,r,!0);null!=r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&null==s.mixingFrom){e[n]=null,this.queue.end(s),this.disposeNext(s);continue}if(null!=s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,null!=t&&(t.mixingTo=null);null!=t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){const n=t.mixingFrom;if(null==n)return!0;const s=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),s):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}apply(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const e=this.events,n=this.tracks;let a=!1;for(let r=0,i=n.length;r<i;r++){const i=n[r];if(null==i||i.delay>0)continue;a=!0;const o=0==r?s.bq.first:i.mixBlend;let l=i.alpha;null!=i.mixingFrom?l*=this.applyMixingFrom(i,t,o):i.trackTime>=i.trackEnd&&null==i.next&&(l=0);const h=i.animationLast,c=i.getAnimationTime(),d=i.animation.timelines.length,u=i.animation.timelines;if(0==r&&1==l||o==s.bq.add)for(let n=0;n<d;n++){s.cQ.webkit602BugfixHelper(l,o);const a=u[n];a instanceof F?this.applyAttachmentTimeline(a,t,c,o,!0):a.apply(t,h,c,e,l,o,s.mJ.mixIn)}else{const n=i.timelineMode,a=0==i.timelinesRotation.length;a&&s.cQ.setArraySize(i.timelinesRotation,d<<1,null);const r=i.timelinesRotation;for(let i=0;i<d;i++){const d=u[i],f=n[i]==U.SUBSEQUENT?o:s.bq.setup;d instanceof I?this.applyRotateTimeline(d,t,c,l,f,r,i<<1,a):d instanceof F?this.applyAttachmentTimeline(d,t,c,o,!0):(s.cQ.webkit602BugfixHelper(l,o),d.apply(t,h,c,e,l,f,s.mJ.mixIn))}}this.queueEvents(i,c),e.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime}const r=this.unkeyedState+U.SETUP,i=t.slots;for(let e=0,n=t.slots.length;e<n;e++){const n=i[e];if(n.attachmentState==r){const e=n.data.attachmentName;n.setAttachment(null==e?null:t.getAttachment(n.data.index,e))}}return this.unkeyedState+=2,this.queue.drain(),a}applyMixingFrom(t,e,n){const a=t.mixingFrom;null!=a.mixingFrom&&this.applyMixingFrom(a,e,n);let r=0;0==t.mixDuration?(r=1,n==s.bq.first&&(n=s.bq.setup)):(r=t.mixTime/t.mixDuration,r>1&&(r=1),n!=s.bq.first&&(n=a.mixBlend));const i=r<a.eventThreshold?this.events:null,o=r<a.attachmentThreshold,l=r<a.drawOrderThreshold,h=a.animationLast,c=a.getAnimationTime(),d=a.animation.timelines.length,u=a.animation.timelines,f=a.alpha*t.interruptAlpha,m=f*(1-r);if(n==s.bq.add)for(let t=0;t<d;t++)u[t].apply(e,h,c,i,m,n,s.mJ.mixOut);else{const t=a.timelineMode,r=a.timelineHoldMix,g=0==a.timelinesRotation.length;g&&s.cQ.setArraySize(a.timelinesRotation,d<<1,null);const p=a.timelinesRotation;a.totalAlpha=0;for(let E=0;E<d;E++){const d=u[E];let x,b=s.mJ.mixOut,w=0;switch(t[E]){case U.SUBSEQUENT:if(!l&&d instanceof Y)continue;x=n,w=m;break;case U.FIRST:x=s.bq.setup,w=m;break;case U.HOLD_SUBSEQUENT:x=n,w=f;break;case U.HOLD_FIRST:x=s.bq.setup,w=f;break;default:x=s.bq.setup;const t=r[E];w=f*Math.max(0,1-t.mixTime/t.mixDuration)}a.totalAlpha+=w,d instanceof I?this.applyRotateTimeline(d,e,c,w,x,p,E<<1,g):d instanceof F?this.applyAttachmentTimeline(d,e,c,x,o):(s.cQ.webkit602BugfixHelper(w,n),l&&d instanceof Y&&x==s.bq.setup&&(b=s.mJ.mixIn),d.apply(e,h,c,i,w,x,b))}}return t.mixDuration>0&&this.queueEvents(a,c),this.events.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(t,e,n,a,r){const i=e.slots[t.slotIndex];if(!i.bone.active)return;const o=t.frames;if(n<o[0])a!=s.bq.setup&&a!=s.bq.first||this.setAttachment(e,i,i.data.attachmentName,r);else{let s;s=n>=o[o.length-1]?o.length-1:x.binarySearch(o,n)-1,this.setAttachment(e,i,t.attachmentNames[s],r)}i.attachmentState<=this.unkeyedState&&(i.attachmentState=this.unkeyedState+U.SETUP)}setAttachment(t,e,n,s){e.setAttachment(null==n?null:t.getAttachment(e.data.index,n)),s&&(e.attachmentState=this.unkeyedState+U.CURRENT)}applyRotateTimeline(t,e,n,a,r,i,o,l){if(l&&(i[o]=0),1==a)return void t.apply(e,0,n,null,1,r,s.mJ.mixIn);const h=t,c=h.frames,d=e.bones[h.boneIndex];if(!d.active)return;let u=0,f=0;if(n<c[0])switch(r){case s.bq.setup:d.rotation=d.data.rotation;default:return;case s.bq.first:u=d.rotation,f=d.data.rotation}else if(u=r==s.bq.setup?d.data.rotation:d.rotation,n>=c[c.length-I.ENTRIES])f=d.data.rotation+c[c.length+I.PREV_ROTATION];else{const t=x.binarySearch(c,n,I.ENTRIES),e=c[t+I.PREV_ROTATION],s=c[t],a=h.getCurvePercent((t>>1)-1,1-(n-s)/(c[t+I.PREV_TIME]-s));f=c[t+I.ROTATION]-e,f-=360*(16384-(16384.499999999996-f/360|0)),f=e+f*a+d.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}let m=0,g=f-u;if(g-=360*(16384-(16384.499999999996-g/360|0)),0==g)m=i[o];else{let t=0,e=0;l?(t=0,e=g):(t=i[o],e=i[o+1]);const n=g>0;let a=t>=0;s.M8.signum(e)!=s.M8.signum(g)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*s.M8.signum(t)),a=n),m=g+t-t%360,a!=n&&(m+=360*s.M8.signum(t)),i[o]=m}i[o+1]=g,u+=m*a,d.rotation=u-360*(16384-(16384.499999999996-u/360|0))}queueEvents(t,e){const n=t.animationStart,s=t.animationEnd,a=s-n,r=t.trackLast%a,i=this.events;let o=0;const l=i.length;for(;o<l;o++){const e=i[o];if(e.time<r)break;e.time>s||this.queue.event(t,e)}let h=!1;for(h=t.loop?0==a||r>t.trackTime%a:e>=s&&t.animationLast<s,h&&this.queue.complete(t);o<l;o++)i[o].time<n||this.queue.event(t,i[o])}clearTracks(){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;const e=this.tracks[t];if(null==e)return;this.queue.end(e),this.disposeNext(e);let n=e;for(;;){const t=n.mixingFrom;if(null==t)break;this.queue.end(t),n.mixingFrom=null,n.mixingTo=null,n=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,n){const s=this.expandToIndex(t);this.tracks[t]=e,null!=s&&(n&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,null!=s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,n){const s=this.data.skeletonData.findAnimation(e);if(null==s)throw new Error(`Animation not found: ${e}`);return this.setAnimationWith(t,s,n)}setAnimationWith(t,e,n){if(null==e)throw new Error("animation cannot be null.");let s=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,s=!1):this.disposeNext(a));const r=this.trackEntry(t,e,n,a);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,n,s){const a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error(`Animation not found: ${e}`);return this.addAnimationWith(t,a,n,s)}addAnimationWith(t,e,n,s){if(null==e)throw new Error("animation cannot be null.");let a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;const r=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,r,!0),this.queue.drain();else if(a.next=r,s<=0){const t=a.animationEnd-a.animationStart;0!=t?(a.loop?s+=t*(1+(a.trackTime/t|0)):s+=Math.max(t,a.trackTime),s-=this.data.getMix(a.animation,e)):s=a.trackTime}return r.delay=s,r}setEmptyAnimation(t,e){const n=this.setAnimationWith(t,U.emptyAnimation,!1);return n.mixDuration=e,n.trackEnd=e,n}addEmptyAnimation(t,e,n){n<=0&&(n-=e);const s=this.addAnimationWith(t,U.emptyAnimation,!1,n);return s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t){const e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,n=this.tracks.length;e<n;e++){const n=this.tracks[e];null!=n&&this.setEmptyAnimation(n.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(s.cQ.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,n,a){const r=this.trackEntryPool.obtain();return r.trackIndex=t,r.animation=e,r.loop=n,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=e.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=null==a?0:this.data.getMix(a.animation,e),r.mixBlend=s.bq.replace,r}disposeNext(t){let e=t.next;for(;null!=e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let t=0,e=this.tracks.length;t<e;t++){let e=this.tracks[t];if(null!=e){for(;null!=e.mixingFrom;)e=e.mixingFrom;do{null!=e.mixingFrom&&e.mixBlend==s.bq.add||this.computeHold(e),e=e.mixingTo}while(null!=e)}}}computeHold(t){const e=t.mixingTo,n=t.animation.timelines,a=t.animation.timelines.length,r=s.cQ.setArraySize(t.timelineMode,a);t.timelineHoldMix.length=0;const i=s.cQ.setArraySize(t.timelineHoldMix,a),o=this.propertyIDs;if(null!=e&&e.holdPrevious)for(let t=0;t<a;t++)r[t]=o.add(n[t].getPropertyId())?U.HOLD_FIRST:U.HOLD_SUBSEQUENT;else t:for(let s=0;s<a;s++){const a=n[s],l=a.getPropertyId();if(o.add(l))if(null==e||a instanceof F||a instanceof Y||a instanceof _||!e.animation.hasTimeline(l))r[s]=U.FIRST;else{for(let n=e.mixingTo;null!=n;n=n.mixingTo)if(!n.animation.hasTimeline(l)){if(t.mixDuration>0){r[s]=U.HOLD_MIX,i[s]=n;continue t}break}r[s]=U.HOLD_FIRST}else r[s]=U.SUBSEQUENT}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(t,e,n){U.deprecatedWarning1||(U.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(t,e,n)}addAnimationByName(t,e,n,s){U.deprecatedWarning2||(U.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(t,e,n,s)}hasAnimation(t){return null!==this.data.skeletonData.findAnimation(t)}hasAnimationByName(t){return U.deprecatedWarning3||(U.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(t)}};let H=U;H.emptyAnimation=new x("<empty>",[],0),H.SUBSEQUENT=0,H.FIRST=1,H.HOLD_SUBSEQUENT=2,H.HOLD_FIRST=3,H.HOLD_MIX=4,H.SETUP=1,H.CURRENT=2,H.deprecatedWarning1=!1,H.deprecatedWarning2=!1,H.deprecatedWarning3=!1;const G=class{constructor(){this.mixBlend=s.bq.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){const t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return G.deprecatedWarning1||(G.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(t){G.deprecatedWarning1||(G.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=t}get endTime(){return G.deprecatedWarning2||(G.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(t){G.deprecatedWarning2||(G.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=t}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let j=G;j.deprecatedWarning1=!1,j.deprecatedWarning2=!1;const Z=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(J.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(J.interrupt),this.objects.push(t)}end(t){this.objects.push(J.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(J.dispose),this.objects.push(t)}complete(t){this.objects.push(J.complete),this.objects.push(t)}event(t,e){this.objects.push(J.event),this.objects.push(t),this.objects.push(e)}deprecateStuff(){return Z.deprecatedWarning1||(Z.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const t=this.objects,e=this.animState.listeners;for(let n=0;n<t.length;n+=2){const a=t[n],r=t[n+1];switch(a){case J.start:null!=r.listener&&r.listener.start&&r.listener.start(r);for(let t=0;t<e.length;t++)e[t].start&&e[t].start(r);r.onStart&&this.deprecateStuff()&&r.onStart(r.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(r.trackIndex);break;case J.interrupt:null!=r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let t=0;t<e.length;t++)e[t].interrupt&&e[t].interrupt(r);break;case J.end:null!=r.listener&&r.listener.end&&r.listener.end(r);for(let t=0;t<e.length;t++)e[t].end&&e[t].end(r);r.onEnd&&this.deprecateStuff()&&r.onEnd(r.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(r.trackIndex);case J.dispose:null!=r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let t=0;t<e.length;t++)e[t].dispose&&e[t].dispose(r);this.animState.trackEntryPool.free(r);break;case J.complete:null!=r.listener&&r.listener.complete&&r.listener.complete(r);for(let t=0;t<e.length;t++)e[t].complete&&e[t].complete(r);const a=s.M8.toInt(r.loopsCount());r.onComplete&&this.deprecateStuff()&&r.onComplete(r.trackIndex,a),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(r.trackIndex,a);break;case J.event:const i=t[2+n++];null!=r.listener&&r.listener.event&&r.listener.event(r,i);for(let t=0;t<e.length;t++)e[t].event&&e[t].event(r,i);r.onEvent&&this.deprecateStuff()&&r.onEvent(r.trackIndex,i),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(r.trackIndex,i)}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let z=Z;z.deprecatedWarning1=!1;var J=(t=>(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(J||{});class K{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}}const tt=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){const s=this.skeletonData.findAnimation(t);if(null==s)throw new Error(`Animation not found: ${t}`);const a=this.skeletonData.findAnimation(e);if(null==a)throw new Error(`Animation not found: ${e}`);this.setMixWith(s,a,n)}setMixByName(t,e,n){tt.deprecatedWarning1||(tt.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(t,e,n)}setMixWith(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return void 0===s?this.defaultMix:s}};let et=tt;et.deprecatedWarning1=!1;class nt{constructor(t){this.atlas=t}newRegionAttachment(t,e,n){const s=this.atlas.findRegion(n);if(null==s)throw new Error(`Region not found in atlas: ${n} (region attachment: ${e})`);const a=new m(e);return a.region=s,a}newMeshAttachment(t,e,n){const s=this.atlas.findRegion(n);if(null==s)throw new Error(`Region not found in atlas: ${n} (mesh attachment: ${e})`);const a=new h(e);return a.region=s,a}newBoundingBoxAttachment(t,e){return new o(e)}newPathAttachment(t,e){return new c(e)}newPointAttachment(t,e){return new d(e)}newClippingAttachment(t,e){return new l(e)}}var st=n(6951);class at{constructor(t,e,n){if(this.matrix=new st.y3,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.appliedValid=!1,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,n,a,r,i,o){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=a,this.ascaleY=r,this.ashearX=i,this.ashearY=o,this.appliedValid=!0;const l=this.parent,h=this.matrix,c=this.skeleton.scaleX,d=s.Xd.yDown?-this.skeleton.scaleY:this.skeleton.scaleY;if(null==l){const l=this.skeleton,u=n+90+o;return h.a=s.M8.cosDeg(n+i)*a*c,h.c=s.M8.cosDeg(u)*r*c,h.b=s.M8.sinDeg(n+i)*a*d,h.d=s.M8.sinDeg(u)*r*d,h.tx=t*c+l.x,void(h.ty=e*d+l.y)}let u=l.matrix.a,f=l.matrix.c,m=l.matrix.b,g=l.matrix.d;switch(h.tx=u*t+f*e+l.matrix.tx,h.ty=m*t+g*e+l.matrix.ty,this.data.transformMode){case s.Qe.Normal:{const t=n+90+o,e=s.M8.cosDeg(n+i)*a,l=s.M8.cosDeg(t)*r,c=s.M8.sinDeg(n+i)*a,d=s.M8.sinDeg(t)*r;return h.a=u*e+f*c,h.c=u*l+f*d,h.b=m*e+g*c,void(h.d=m*l+g*d)}case s.Qe.OnlyTranslation:{const t=n+90+o;h.a=s.M8.cosDeg(n+i)*a,h.c=s.M8.cosDeg(t)*r,h.b=s.M8.sinDeg(n+i)*a,h.d=s.M8.sinDeg(t)*r;break}case s.Qe.NoRotationOrReflection:{let t=u*u+m*m,e=0;t>1e-4?(t=Math.abs(u*g-f*m)/t,u/=this.skeleton.scaleX,m/=this.skeleton.scaleY,f=m*t,g=u*t,e=Math.atan2(m,u)*s.M8.radDeg):(u=0,m=0,e=90-Math.atan2(g,f)*s.M8.radDeg);const l=n+i-e,c=n+o-e+90,d=s.M8.cosDeg(l)*a,p=s.M8.cosDeg(c)*r,E=s.M8.sinDeg(l)*a,x=s.M8.sinDeg(c)*r;h.a=u*d-f*E,h.c=u*p-f*x,h.b=m*d+g*E,h.d=m*p+g*x;break}case s.Qe.NoScale:case s.Qe.NoScaleOrReflection:{const t=s.M8.cosDeg(n),e=s.M8.sinDeg(n);let l=(u*t+f*e)/c,p=(m*t+g*e)/d,E=Math.sqrt(l*l+p*p);E>1e-5&&(E=1/E),l*=E,p*=E,E=Math.sqrt(l*l+p*p),this.data.transformMode==s.Qe.NoScale&&u*g-f*m<0!=(s.Xd.yDown?this.skeleton.scaleX<0!=this.skeleton.scaleY>0:this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(E=-E);const x=Math.PI/2+Math.atan2(p,l),b=Math.cos(x)*E,w=Math.sin(x)*E,M=s.M8.cosDeg(i)*a,S=s.M8.cosDeg(90+o)*r,I=s.M8.sinDeg(i)*a,T=s.M8.sinDeg(90+o)*r;h.a=l*M+b*I,h.c=l*S+b*T,h.b=p*M+w*I,h.d=p*S+w*T;break}}h.a*=c,h.c*=c,h.b*=d,h.d*=d}setToSetupPose(){const t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*s.M8.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*s.M8.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(null==t)return this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*s.M8.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,void(this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*s.M8.radDeg);const n=t.matrix,a=1/(n.a*n.d-n.b*n.c),r=e.tx-n.tx,i=e.ty-n.ty;this.ax=r*n.d*a-i*n.c*a,this.ay=i*n.a*a-r*n.b*a;const o=a*n.d,l=a*n.a,h=a*n.c,c=a*n.b,d=o*e.a-h*e.b,u=o*e.c-h*e.d,f=l*e.b-c*e.a,m=l*e.d-c*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){const t=d*m-u*f;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(d*u+f*m,t)*s.M8.radDeg,this.arotation=Math.atan2(f,d)*s.M8.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,u)*s.M8.radDeg}worldToLocal(t){const e=this.matrix,n=e.a,s=e.c,a=e.b,r=e.d,i=1/(n*r-s*a),o=t.x-e.tx,l=t.y-e.ty;return t.x=o*r*i-l*s*i,t.y=l*n*i-o*a*i,t}localToWorld(t){const e=this.matrix,n=t.x,s=t.y;return t.x=n*e.a+s*e.c+e.tx,t.y=n*e.b+s*e.d+e.ty,t}worldToLocalRotation(t){const e=s.M8.sinDeg(t),n=s.M8.cosDeg(t),a=this.matrix;return Math.atan2(a.a*e-a.b*n,a.d*n-a.c*e)*s.M8.radDeg}localToWorldRotation(t){const e=s.M8.sinDeg(t),n=s.M8.cosDeg(t),a=this.matrix;return Math.atan2(n*a.b+e*a.d,n*a.a+e*a.c)*s.M8.radDeg}rotateWorld(t){const e=this.matrix,n=e.a,a=e.c,r=e.b,i=e.d,o=s.M8.cosDeg(t),l=s.M8.sinDeg(t);e.a=o*n-l*r,e.c=o*a-l*i,e.b=l*n+o*r,e.d=l*a+o*i,this.appliedValid=!1}}class rt{constructor(t,e,n){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=s.Qe.Normal,this.skinRequired=!1,this.color=new s.Il,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}}class it{constructor(t,e,n){this.name=t,this.order=e,this.skinRequired=n}}class ot{constructor(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}}class lt{constructor(t){this.name=t}}class ht{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let n=0;n<t.bones.length;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}}apply1(t,e,n,a,r,i,o){t.appliedValid||t.updateAppliedTransform();const l=t.parent.matrix,h=l.a;let c=l.c;const d=l.b;let u=l.d,f=-t.ashearX-t.arotation,m=0,g=0;switch(t.data.transformMode){case s.Qe.OnlyTranslation:m=e-t.worldX,g=n-t.worldY;break;case s.Qe.NoRotationOrReflection:const a=Math.abs(h*u-c*d)/(h*h+d*d),r=h/t.skeleton.scaleX,i=d/t.skeleton.scaleY;c=-i*a*t.skeleton.scaleX,u=r*a*t.skeleton.scaleY,f+=Math.atan2(i,r)*s.M8.radDeg;default:const o=e-l.tx,p=n-l.ty,E=h*u-c*d;m=(o*u-p*c)/E-t.ax,g=(p*h-o*d)/E-t.ay}f+=Math.atan2(g,m)*s.M8.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let p=t.ascaleX,E=t.ascaleY;if(a||r){switch(t.data.transformMode){case s.Qe.NoScale:case s.Qe.NoScaleOrReflection:m=e-t.worldX,g=n-t.worldY}const l=t.data.length*p,h=Math.sqrt(m*m+g*g);if(a&&h<l||r&&h>l&&l>1e-4){const t=(h/l-1)*o+1;p*=t,i&&(E*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,p,E,t.ashearX,t.ashearY)}apply2(t,e,n,a,r,i,o,l){if(0==l)return void e.updateWorldTransform();t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const h=t.ax,c=t.ay;let d=t.ascaleX,u=d,f=t.ascaleY,m=e.ascaleX;const g=t.matrix;let p=0,E=0,x=0;d<0?(d=-d,p=180,x=-1):(p=0,x=1),f<0&&(f=-f,x=-x),m<0?(m=-m,E=180):E=0;const b=e.ax;let w=0,M=0,S=0,I=g.a,T=g.c,A=g.b,R=g.d;const y=Math.abs(d-f)<=1e-4;y?(w=e.ay,M=I*b+T*w+g.tx,S=A*b+R*w+g.ty):(w=0,M=I*b+g.tx,S=A*b+g.ty);const k=t.parent.matrix;I=k.a,T=k.c,A=k.b,R=k.d;const C=1/(I*R-T*A);let V=M-k.tx,P=S-k.ty;const F=(V*R-P*T)*C-h,v=(P*I-V*A)*C-c,N=Math.sqrt(F*F+v*v);let _,Y,X=e.data.length*m;if(N<1e-4)return this.apply1(t,n,a,!1,i,!1,l),void e.updateWorldTransformWith(b,w,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);V=n-k.tx,P=a-k.ty;let D=(V*R-P*T)*C-h,O=(P*I-V*A)*C-c,q=D*D+O*O;if(0!=o){o*=d*(m+1)/2;const t=Math.sqrt(q),e=t-N-X*d+o;if(e>0){let n=Math.min(1,e/(2*o))-1;n=(e-o*(1-n*n))/t,D-=n*D,O-=n*O,q=D*D+O*O}}t:if(y){X*=d;let t=(q-N*N-X*X)/(2*N*X);t<-1?t=-1:t>1&&(t=1,i&&(u*=(Math.sqrt(q)/(N+X)-1)*l+1)),Y=Math.acos(t)*r,I=N+X*t,T=X*Math.sin(Y),_=Math.atan2(O*I-D*T,D*I+O*T)}else{I=d*X,T=f*X;const t=I*I,e=T*T,n=Math.atan2(O,D);A=e*N*N+t*q-t*e;const a=-2*e*N,i=e-t;if(R=a*a-4*i*A,R>=0){let t=Math.sqrt(R);a<0&&(t=-t),t=-(a+t)/2;const e=t/i,s=A/t,o=Math.abs(e)<Math.abs(s)?e:s;if(o*o<=q){P=Math.sqrt(q-o*o)*r,_=n-Math.atan2(P,o),Y=Math.atan2(P/f,(o-N)/d);break t}}let o=s.M8.PI,l=N-I,h=l*l,c=0,u=0,m=N+I,g=m*m,p=0;A=-I*N/(t-e),A>=-1&&A<=1&&(A=Math.acos(A),V=I*Math.cos(A)+N,P=T*Math.sin(A),R=V*V+P*P,R<h&&(o=A,h=R,l=V,c=P),R>g&&(u=A,g=R,m=V,p=P)),q<=(h+g)/2?(_=n-Math.atan2(c*r,l),Y=o*r):(_=n-Math.atan2(p*r,m),Y=u*r)}const B=Math.atan2(w,b)*x;let L=t.arotation;_=(_-B)*s.M8.radDeg+p-L,_>180?_-=360:_<-180&&(_+=360),t.updateWorldTransformWith(h,c,L+_*l,u,t.ascaleY,0,0),L=e.arotation,Y=((Y+B)*s.M8.radDeg-e.ashearX)*x+E-L,Y>180?Y-=360:Y<-180&&(Y+=360),e.updateWorldTransformWith(b,w,L+Y*l,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}class ct extends it{constructor(t){super(t,0,!1),this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}}class dt extends it{constructor(t){super(t,0,!1),this.bones=new Array}}var ut=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t))(ut||{});const ft=class{constructor(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=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,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let n=0,s=t.bones.length;n<s;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}isActive(){return this.active}apply(){this.update()}update(){const t=this.target.getAttachment();if(!(t instanceof c))return;const e=this.rotateMix,n=this.translateMix,a=e>0;if(!(n>0||a))return;const r=this.data,i=r.spacingMode,o=i==ut.Length,l=r.rotateMode,h=l==s.YK.Tangent,d=l==s.YK.ChainScale,u=this.bones.length,f=h?u:u+1,m=this.bones,g=s.cQ.setArraySize(this.spaces,f);let p=null;const E=this.spacing;if(d||o){d&&(p=s.cQ.setArraySize(this.lengths,u));for(let t=0,e=f-1;t<e;){const e=m[t],n=e.data.length;if(n<ft.epsilon)d&&(p[t]=0),g[++t]=0;else{const s=n*e.matrix.a,a=n*e.matrix.b,r=Math.sqrt(s*s+a*a);d&&(p[t]=r),g[++t]=(o?n+E:E)*r/n}}}else for(let t=1;t<f;t++)g[t]=E;const x=this.computeWorldPositions(t,f,h,r.positionMode==s.T.Percent,i==ut.Percent);let b=x[0],w=x[1],M=r.offsetRotation,S=!1;if(0==M)S=l==s.YK.Chain;else{S=!1;const t=this.target.bone.matrix;M*=t.a*t.d-t.b*t.c>0?s.M8.degRad:-s.M8.degRad}for(let t=0,r=3;t<u;t++,r+=3){const i=m[t],o=i.matrix;o.tx+=(b-o.tx)*n,o.ty+=(w-o.ty)*n;const l=x[r],c=x[r+1],u=l-b,f=c-w;if(d){const n=p[t];if(0!=n){const t=(Math.sqrt(u*u+f*f)/n-1)*e+1;o.a*=t,o.b*=t}}if(b=l,w=c,a){const n=o.a,a=o.c,l=o.b,c=o.d;let d=0,m=0,p=0;if(h&&(d=h?x[r-1]:0==g[t+1]?x[r+2]:Math.atan2(f,u)),d-=Math.atan2(l,n),S){m=Math.cos(d),p=Math.sin(d);const t=i.data.length;b+=(t*(m*n-p*l)-u)*e,w+=(t*(p*n+m*l)-f)*e}else d+=M;d>s.M8.PI?d-=s.M8.PI2:d<-s.M8.PI&&(d+=s.M8.PI2),d*=e,m=Math.cos(d),p=Math.sin(d),o.a=m*n-p*l,o.c=m*a-p*c,o.b=p*n+m*l,o.d=p*a+m*c}i.appliedValid=!1}}computeWorldPositions(t,e,n,a,r){const i=this.target;let o=this.position;const l=this.spaces,h=s.cQ.setArraySize(this.positions,3*e+2);let c=null;const d=t.closed;let u=t.worldVerticesLength,f=u/6,m=ft.NONE;if(!t.constantSpeed){const g=t.lengths;f-=d?1:2;const p=g[f];if(a&&(o*=p),r)for(let t=0;t<e;t++)l[t]*=p;c=s.cQ.setArraySize(this.world,8);for(let s=0,a=0,r=0;s<e;s++,a+=3){const e=l[s];o+=e;let E=o;if(d)E%=p,E<0&&(E+=p),r=0;else{if(E<0){m!=ft.BEFORE&&(m=ft.BEFORE,t.computeWorldVertices(i,2,4,c,0,2)),this.addBeforePosition(E,c,0,h,a);continue}if(E>p){m!=ft.AFTER&&(m=ft.AFTER,t.computeWorldVertices(i,u-6,4,c,0,2)),this.addAfterPosition(E-p,c,0,h,a);continue}}for(;;r++){const t=g[r];if(!(E>t)){if(0==r)E/=t;else{const e=g[r-1];E=(E-e)/(t-e)}break}}r!=m&&(m=r,d&&r==f?(t.computeWorldVertices(i,u-4,4,c,0,2),t.computeWorldVertices(i,0,4,c,4,2)):t.computeWorldVertices(i,6*r+2,8,c,0,2)),this.addCurvePosition(E,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],h,a,n||s>0&&0==e)}return h}d?(u+=2,c=s.cQ.setArraySize(this.world,u),t.computeWorldVertices(i,2,u-4,c,0,2),t.computeWorldVertices(i,0,2,c,u-4,2),c[u-2]=c[0],c[u-1]=c[1]):(f--,u-=4,c=s.cQ.setArraySize(this.world,u),t.computeWorldVertices(i,2,u,c,0,2));const g=s.cQ.setArraySize(this.curves,f);let p=0,E=c[0],x=c[1],b=0,w=0,M=0,S=0,I=0,T=0,A=0,R=0,y=0,k=0,C=0,V=0,P=0,F=0;for(let t=0,e=2;t<f;t++,e+=6)b=c[e],w=c[e+1],M=c[e+2],S=c[e+3],I=c[e+4],T=c[e+5],A=.1875*(E-2*b+M),R=.1875*(x-2*w+S),y=.09375*(3*(b-M)-E+I),k=.09375*(3*(w-S)-x+T),C=2*A+y,V=2*R+k,P=.75*(b-E)+A+.16666667*y,F=.75*(w-x)+R+.16666667*k,p+=Math.sqrt(P*P+F*F),P+=C,F+=V,C+=y,V+=k,p+=Math.sqrt(P*P+F*F),P+=C,F+=V,p+=Math.sqrt(P*P+F*F),P+=C+y,F+=V+k,p+=Math.sqrt(P*P+F*F),g[t]=p,E=I,x=T;if(a&&(o*=p),r)for(let t=0;t<e;t++)l[t]*=p;const v=this.segments;let N=0;for(let t=0,s=0,a=0,r=0;t<e;t++,s+=3){const e=l[t];o+=e;let i=o;if(d)i%=p,i<0&&(i+=p),a=0;else{if(i<0){this.addBeforePosition(i,c,0,h,s);continue}if(i>p){this.addAfterPosition(i-p,c,u-4,h,s);continue}}for(;;a++){const t=g[a];if(!(i>t)){if(0==a)i/=t;else{const e=g[a-1];i=(i-e)/(t-e)}break}}if(a!=m){m=a;let t=6*a;for(E=c[t],x=c[t+1],b=c[t+2],w=c[t+3],M=c[t+4],S=c[t+5],I=c[t+6],T=c[t+7],A=.03*(E-2*b+M),R=.03*(x-2*w+S),y=.006*(3*(b-M)-E+I),k=.006*(3*(w-S)-x+T),C=2*A+y,V=2*R+k,P=.3*(b-E)+A+.16666667*y,F=.3*(w-x)+R+.16666667*k,N=Math.sqrt(P*P+F*F),v[0]=N,t=1;t<8;t++)P+=C,F+=V,C+=y,V+=k,N+=Math.sqrt(P*P+F*F),v[t]=N;P+=C,F+=V,N+=Math.sqrt(P*P+F*F),v[8]=N,P+=C+y,F+=V+k,N+=Math.sqrt(P*P+F*F),v[9]=N,r=0}for(i*=N;;r++){const t=v[r];if(!(i>t)){if(0==r)i/=t;else{const e=v[r-1];i=r+(i-e)/(t-e)}break}}this.addCurvePosition(.1*i,E,x,b,w,M,S,I,T,h,s,n||t>0&&0==e)}return h}addBeforePosition(t,e,n,s,a){const r=e[n],i=e[n+1],o=e[n+2]-r,l=e[n+3]-i,h=Math.atan2(l,o);s[a]=r+t*Math.cos(h),s[a+1]=i+t*Math.sin(h),s[a+2]=h}addAfterPosition(t,e,n,s,a){const r=e[n+2],i=e[n+3],o=r-e[n],l=i-e[n+1],h=Math.atan2(l,o);s[a]=r+t*Math.cos(h),s[a+1]=i+t*Math.sin(h),s[a+2]=h}addCurvePosition(t,e,n,s,a,r,i,o,l,h,c,d){(0==t||isNaN(t))&&(t=1e-4);const u=t*t,f=u*t,m=1-t,g=m*m,p=g*m,E=m*t,x=3*E,b=m*x,w=x*t,M=e*p+s*b+r*w+o*f,S=n*p+a*b+i*w+l*f;h[c]=M,h[c+1]=S,d&&(h[c+2]=Math.atan2(S-(n*g+a*E*2+i*u),M-(e*g+s*E*2+r*u)))}};let mt=ft;mt.NONE=-1,mt.BEFORE=-2,mt.AFTER=-3,mt.epsilon=1e-5;class gt{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new s.FM,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let n=0;n<t.bones.length;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.matrix,o=i.a,l=i.c,h=i.b,c=i.d,d=o*c-l*h>0?s.M8.degRad:-s.M8.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,m=this.bones;for(let i=0,d=m.length;i<d;i++){const d=m[i];let g=!1;const p=d.matrix;if(0!=t){const e=p.a,n=p.c,a=p.b,r=p.d;let i=Math.atan2(h,o)-Math.atan2(a,e)+u;i>s.M8.PI?i-=s.M8.PI2:i<-s.M8.PI&&(i+=s.M8.PI2),i*=t;const l=Math.cos(i),c=Math.sin(i);p.a=l*e-c*a,p.c=l*n-c*r,p.b=c*e+l*a,p.d=c*n+l*r,g=!0}if(0!=e){const t=this.temp;r.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),p.tx+=(t.x-p.tx)*e,p.ty+=(t.y-p.ty)*e,g=!0}if(n>0){let t=Math.sqrt(p.a*p.a+p.b*p.b),e=Math.sqrt(o*o+h*h);t>1e-5&&(t=(t+(e-t+this.data.offsetScaleX)*n)/t),p.a*=t,p.b*=t,t=Math.sqrt(p.c*p.c+p.d*p.d),e=Math.sqrt(l*l+c*c),t>1e-5&&(t=(t+(e-t+this.data.offsetScaleY)*n)/t),p.c*=t,p.d*=t,g=!0}if(a>0){const t=p.c,e=p.d,n=Math.atan2(e,t);let r=Math.atan2(c,l)-Math.atan2(h,o)-(n-Math.atan2(p.b,p.a));r>s.M8.PI?r-=s.M8.PI2:r<-s.M8.PI&&(r+=s.M8.PI2),r=n+(r+f)*a;const i=Math.sqrt(t*t+e*e);p.c=Math.cos(r)*i,p.d=Math.sin(r)*i,g=!0}g&&(d.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.matrix,o=i.a,l=i.c,h=i.b,c=i.d,d=o*c-l*h>0?s.M8.degRad:-s.M8.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,m=this.bones;for(let i=0,d=m.length;i<d;i++){const d=m[i];let g=!1;const p=d.matrix;if(0!=t){const e=p.a,n=p.c,a=p.b,r=p.d;let i=Math.atan2(h,o)+u;i>s.M8.PI?i-=s.M8.PI2:i<-s.M8.PI&&(i+=s.M8.PI2),i*=t;const l=Math.cos(i),c=Math.sin(i);p.a=l*e-c*a,p.c=l*n-c*r,p.b=c*e+l*a,p.d=c*n+l*r,g=!0}if(0!=e){const t=this.temp;r.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),p.tx+=t.x*e,p.ty+=t.y*e,g=!0}if(n>0){let t=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*n+1;p.a*=t,p.b*=t,t=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleY)*n+1,p.c*=t,p.d*=t,g=!0}if(a>0){let t=Math.atan2(c,l)-Math.atan2(h,o);t>s.M8.PI?t-=s.M8.PI2:t<-s.M8.PI&&(t+=s.M8.PI2);const e=p.c,n=p.d;t=Math.atan2(n,e)+(t-s.M8.PI/2+f)*a;const r=Math.sqrt(e*e+n*n);p.c=Math.cos(t)*r,p.d=Math.sin(t)*r,g=!0}g&&(d.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,s=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();const r=this.bones;for(let i=0,o=r.length;i<o;i++){const o=r[i];o.appliedValid||o.updateAppliedTransform();let l=o.arotation;if(0!=t){let e=a.arotation-l+this.data.offsetRotation;e-=360*(16384-(16384.499999999996-e/360|0)),l+=e*t}let h=o.ax,c=o.ay;0!=e&&(h+=(a.ax-h+this.data.offsetX)*e,c+=(a.ay-c+this.data.offsetY)*e);let d=o.ascaleX,u=o.ascaleY;n>0&&(d>1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*n)/d),u>1e-5&&(u=(u+(a.ascaleY-u+this.data.offsetScaleY)*n)/u));const f=o.ashearY;if(s>0){let t=a.ashearY-f+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),o.shearY+=t*s}o.updateWorldTransformWith(h,c,l,d,u,o.ashearX,f)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,s=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();const r=this.bones;for(let i=0,o=r.length;i<o;i++){const o=r[i];o.appliedValid||o.updateAppliedTransform();let l=o.arotation;0!=t&&(l+=(a.arotation+this.data.offsetRotation)*t);let h=o.ax,c=o.ay;0!=e&&(h+=(a.ax+this.data.offsetX)*e,c+=(a.ay+this.data.offsetY)*e);let d=o.ascaleX,u=o.ascaleY;n>0&&(d>1e-5&&(d*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),u>1e-5&&(u*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));let f=o.ashearY;s>0&&(f+=(a.ashearY+this.data.offsetShearY)*s),o.updateWorldTransformWith(h,c,l,d,u,o.ashearX,f)}}}const pt=class{constructor(t){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){const n=t.bones[e];let s;if(null==n.parent)s=new at(n,this,null);else{const t=this.bones[n.parent.index];s=new at(n,this,t),t.children.push(s)}this.bones.push(s)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){const n=t.slots[e],s=this.bones[n.boneData.index],a=new u(n,s);this.slots.push(a),this.drawOrder.push(a)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){const n=t.ikConstraints[e];this.ikConstraints.push(new ht(n,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){const n=t.transformConstraints[e];this.transformConstraints.push(new gt(n,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){const n=t.pathConstraints[e];this.pathConstraints.push(new mt(n,this))}this.color=new s.Il(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let e=0,n=t.length;e<n;e++){const n=t[e];n.sorted=n.data.skinRequired,n.active=!n.sorted}if(null!=this.skin){const t=this.skin.bones;for(let e=0,n=this.skin.bones.length;e<n;e++){let n=this.bones[t[e].index];do{n.sorted=!1,n.active=!0,n=n.parent}while(null!=n)}}const e=this.ikConstraints,n=this.transformConstraints,s=this.pathConstraints,a=e.length,r=n.length,i=s.length,o=a+r+i;t:for(let t=0;t<o;t++){for(let n=0;n<a;n++){const s=e[n];if(s.data.order==t){this.sortIkConstraint(s);continue t}}for(let e=0;e<r;e++){const s=n[e];if(s.data.order==t){this.sortTransformConstraint(s);continue t}}for(let e=0;e<i;e++){const n=s[e];if(n.data.order==t){this.sortPathConstraint(n);continue t}}}for(let e=0,n=t.length;e<n;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&s.cQ.contains(this.skin.constraints,t.data,!0)),!t.active)return;const e=t.target;this.sortBone(e);const n=t.bones,a=n[0];if(this.sortBone(a),n.length>1){const t=n[n.length-1];this._updateCache.indexOf(t)>-1||this.updateCacheReset.push(t)}this._updateCache.push(t),this.sortReset(a.children),n[n.length-1].sorted=!0}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||null!=this.skin&&s.cQ.contains(this.skin.constraints,t.data,!0)),!t.active)return;const e=t.target,n=e.data.index,a=e.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,a);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],n,a);const r=e.getAttachment();r instanceof c&&this.sortPathConstraintAttachmentWith(r,a);const i=t.bones,o=i.length;for(let t=0;t<o;t++)this.sortBone(i[t]);this._updateCache.push(t);for(let t=0;t<o;t++)this.sortReset(i[t].children);for(let t=0;t<o;t++)i[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&s.cQ.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);const e=t.bones,n=e.length;if(t.data.local)for(let t=0;t<n;t++){const n=e[t];this.sortBone(n.parent),this._updateCache.indexOf(n)>-1||this.updateCacheReset.push(n)}else for(let t=0;t<n;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<n;t++)this.sortReset(e[t].children);for(let t=0;t<n;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,n){const s=t.attachments[e];if(s)for(const t in s)this.sortPathConstraintAttachmentWith(s[t],n)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof c))return;const n=t.bones;if(null==n)this.sortBone(e);else{const t=this.bones;let e=0;for(;e<n.length;){const s=n[e++];for(let a=e+s;e<a;e++){const s=n[e];this.sortBone(t[s])}}}}sortBone(t){if(t.sorted)return;const e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,n=t.length;e<n;e++){const n=t[e];n.active&&(n.sorted&&this.sortReset(n.children),n.sorted=!1)}}updateWorldTransform(){const t=this.updateCacheReset;for(let e=0,n=t.length;e<n;e++){const n=t[e];n.ax=n.x,n.ay=n.y,n.arotation=n.rotation,n.ascaleX=n.scaleX,n.ascaleY=n.scaleY,n.ashearX=n.shearX,n.ashearY=n.shearY,n.appliedValid=!0}const e=this._updateCache;for(let t=0,n=e.length;t<n;t++)e[t].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const t=this.bones;for(let e=0,n=t.length;e<n;e++)t[e].setToSetupPose();const e=this.ikConstraints;for(let t=0,n=e.length;t<n;t++){const n=e[t];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}const n=this.transformConstraints;for(let t=0,e=n.length;t<e;t++){const e=n[t],s=e.data;e.rotateMix=s.rotateMix,e.translateMix=s.translateMix,e.scaleMix=s.scaleMix,e.shearMix=s.shearMix}const s=this.pathConstraints;for(let t=0,e=s.length;t<e;t++){const e=s[t],n=e.data;e.position=n.position,e.spacing=n.spacing,e.rotateMix=n.rotateMix,e.translateMix=n.translateMix}}setSlotsToSetupPose(){const t=this.slots;s.cQ.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,n=t.length;e<n;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(null==t)throw new Error("boneName cannot be null.");const e=this.bones;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.data.name==t)return s}return null}findBoneIndex(t){if(null==t)throw new Error("boneName cannot be null.");const e=this.bones;for(let n=0,s=e.length;n<s;n++)if(e[n].data.name==t)return n;return-1}findSlot(t){if(null==t)throw new Error("slotName cannot be null.");const e=this.slots;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.data.name==t)return s}return null}findSlotIndex(t){if(null==t)throw new Error("slotName cannot be null.");const e=this.slots;for(let n=0,s=e.length;n<s;n++)if(e[n].data.name==t)return n;return-1}setSkinByName(t){const e=this.data.findSkin(t);if(null==e)throw new Error(`Skin not found: ${t}`);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else{const e=this.slots;for(let n=0,s=e.length;n<s;n++){const s=e[n],a=s.data.attachmentName;if(null!=a){const e=t.getAttachment(n,a);null!=e&&s.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)}getAttachment(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){const n=this.skin.getAttachment(t,e);if(null!=n)return n}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(null==t)throw new Error("slotName cannot be null.");const n=this.slots;for(let s=0,a=n.length;s<a;s++){const a=n[s];if(a.data.name==t){let n=null;if(null!=e&&(n=this.getAttachment(s,e),null==n))throw new Error(`Attachment not found: ${e}, for slot: ${t}`);return void a.setAttachment(n)}}throw new Error(`Slot not found: ${t}`)}findIkConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.data.name==t)return s}return null}findTransformConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.data.name==t)return s}return null}findPathConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.data.name==t)return s}return null}getBounds(t,e,n=new Array(2)){if(null==t)throw new Error("offset cannot be null.");if(null==e)throw new Error("size cannot be null.");const a=this.drawOrder;let r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let t=0,e=a.length;t<e;t++){const e=a[t];if(!e.bone.active)continue;let c=0,d=null;const u=e.getAttachment();if(u instanceof m)c=8,d=s.cQ.setArraySize(n,c,0),u.computeWorldVertices(e.bone,d,0,2);else if(u instanceof h){const t=u;c=t.worldVerticesLength,d=s.cQ.setArraySize(n,c,0),t.computeWorldVertices(e,0,c,d,0,2)}if(null!=d)for(let t=0,e=d.length;t<e;t+=2){const e=d[t],n=d[t+1];r=Math.min(r,e),i=Math.min(i,n),o=Math.max(o,e),l=Math.max(l,n)}}t.set(r,i),e.set(o-r,l-i)}update(t){this.time+=t}get flipX(){return-1==this.scaleX}set flipX(t){pt.deprecatedWarning1||(pt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=t?1:-1}get flipY(){return-1==this.scaleY}set flipY(t){pt.deprecatedWarning1||(pt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=t?1:-1}};let Et=pt;Et.deprecatedWarning1=!1;class xt{constructor(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}findBone(t){if(null==t)throw new Error("boneName cannot be null.");const e=this.bones;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findBoneIndex(t){if(null==t)throw new Error("boneName cannot be null.");const e=this.bones;for(let n=0,s=e.length;n<s;n++)if(e[n].name==t)return n;return-1}findSlot(t){if(null==t)throw new Error("slotName cannot be null.");const e=this.slots;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findSlotIndex(t){if(null==t)throw new Error("slotName cannot be null.");const e=this.slots;for(let n=0,s=e.length;n<s;n++)if(e[n].name==t)return n;return-1}findSkin(t){if(null==t)throw new Error("skinName cannot be null.");const e=this.skins;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findEvent(t){if(null==t)throw new Error("eventDataName cannot be null.");const e=this.events;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findAnimation(t){if(null==t)throw new Error("animationName cannot be null.");const e=this.animations;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findIkConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findTransformConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findPathConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let n=0,s=e.length;n<s;n++){const s=e[n];if(s.name==t)return s}return null}findPathConstraintIndex(t){if(null==t)throw new Error("pathConstraintName cannot be null.");const e=this.pathConstraints;for(let n=0,s=e.length;n<s;n++)if(e[n].name==t)return n;return-1}}class bt{constructor(t,e,n){if(this.color=new s.Il(1,1,1,1),t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}}class wt extends it{constructor(t){super(t,0,!1),this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=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}}class Mt{constructor(t,e,n){this.slotIndex=t,this.name=e,this.attachment=n}}class St{constructor(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,null==t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,n){if(null==n)throw new Error("attachment cannot be null.");const s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=n}addSkin(t){for(let e=0;e<t.bones.length;e++){const n=t.bones[e];let s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==n){s=!0;break}s||this.bones.push(n)}for(let e=0;e<t.constraints.length;e++){const n=t.constraints[e];let s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==n){s=!0;break}s||this.constraints.push(n)}const e=t.getAttachments();for(let t=0;t<e.length;t++){const n=e[t];this.setAttachment(n.slotIndex,n.name,n.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){const n=t.bones[e];let s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==n){s=!0;break}s||this.bones.push(n)}for(let e=0;e<t.constraints.length;e++){const n=t.constraints[e];let s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==n){s=!0;break}s||this.constraints.push(n)}const e=t.getAttachments();for(let t=0;t<e.length;t++){const n=e[t];null!=n.attachment&&(n.attachment instanceof h?(n.attachment=n.attachment.newLinkedMesh(),this.setAttachment(n.slotIndex,n.name,n.attachment)):(n.attachment=n.attachment.copy(),this.setAttachment(n.slotIndex,n.name,n.attachment)))}}getAttachment(t,e){const n=this.attachments[t];return n?n[e]:null}removeAttachment(t,e){const n=this.attachments[t];n&&(n[e]=null)}getAttachments(){const t=new Array;for(let e=0;e<this.attachments.length;e++){const n=this.attachments[e];if(n)for(const s in n){const a=n[s];a&&t.push(new Mt(e,s,a))}}return t}getAttachmentsForSlot(t,e){const n=this.attachments[t];if(n)for(const s in n){const a=n[s];a&&e.push(new Mt(t,s,a))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let n=0;for(let s=0;s<t.slots.length;s++){const a=t.slots[s],r=a.getAttachment();if(r&&n<e.attachments.length){const t=e.attachments[n];for(const e in t)if(r==t[e]){const t=this.getAttachment(n,e);null!=t&&a.setAttachment(t);break}}n++}}}const It=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){const e=this.scale,n=new xt;n.name="";const a=new s.YT(t);if(n.hash=a.readString(),n.version=a.readString(),"3.8.75"===n.version){const t="Unsupported skeleton data, 3.8.75 is deprecated, please export with a newer version of Spine.";console.error(t)}n.x=a.readFloat(),n.y=a.readFloat(),n.width=a.readFloat(),n.height=a.readFloat();const r=a.readBoolean();r&&(n.fps=a.readFloat(),n.imagesPath=a.readString(),n.audioPath=a.readString());let i=0;i=a.readInt(!0);for(let t=0;t<i;t++)a.strings.push(a.readString());i=a.readInt(!0);for(let t=0;t<i;t++){const i=a.readString(),o=0==t?null:n.bones[a.readInt(!0)],l=new rt(t,i,o);l.rotation=a.readFloat(),l.x=a.readFloat()*e,l.y=a.readFloat()*e,l.scaleX=a.readFloat(),l.scaleY=a.readFloat(),l.shearX=a.readFloat(),l.shearY=a.readFloat(),l.length=a.readFloat()*e,l.transformMode=It.TransformModeValues[a.readInt(!0)],l.skinRequired=a.readBoolean(),r&&s.Il.rgba8888ToColor(l.color,a.readInt32()),n.bones.push(l)}i=a.readInt(!0);for(let t=0;t<i;t++){const e=a.readString(),r=n.bones[a.readInt(!0)],i=new bt(t,e,r);s.Il.rgba8888ToColor(i.color,a.readInt32());const o=a.readInt32();-1!=o&&s.Il.rgb888ToColor(i.darkColor=new s.Il,o),i.attachmentName=a.readStringRef(),i.blendMode=It.BlendModeValues[a.readInt(!0)],n.slots.push(i)}i=a.readInt(!0);for(let t,s=0;s<i;s++){const s=new ct(a.readString());s.order=a.readInt(!0),s.skinRequired=a.readBoolean(),t=a.readInt(!0);for(let e=0;e<t;e++)s.bones.push(n.bones[a.readInt(!0)]);s.target=n.bones[a.readInt(!0)],s.mix=a.readFloat(),s.softness=a.readFloat()*e,s.bendDirection=a.readByte(),s.compress=a.readBoolean(),s.stretch=a.readBoolean(),s.uniform=a.readBoolean(),n.ikConstraints.push(s)}i=a.readInt(!0);for(let t,s=0;s<i;s++){const s=new wt(a.readString());s.order=a.readInt(!0),s.skinRequired=a.readBoolean(),t=a.readInt(!0);for(let e=0;e<t;e++)s.bones.push(n.bones[a.readInt(!0)]);s.target=n.bones[a.readInt(!0)],s.local=a.readBoolean(),s.relative=a.readBoolean(),s.offsetRotation=a.readFloat(),s.offsetX=a.readFloat()*e,s.offsetY=a.readFloat()*e,s.offsetScaleX=a.readFloat(),s.offsetScaleY=a.readFloat(),s.offsetShearY=a.readFloat(),s.rotateMix=a.readFloat(),s.translateMix=a.readFloat(),s.scaleMix=a.readFloat(),s.shearMix=a.readFloat(),n.transformConstraints.push(s)}i=a.readInt(!0);for(let t,r=0;r<i;r++){const r=new dt(a.readString());r.order=a.readInt(!0),r.skinRequired=a.readBoolean(),t=a.readInt(!0);for(let e=0;e<t;e++)r.bones.push(n.bones[a.readInt(!0)]);r.target=n.slots[a.readInt(!0)],r.positionMode=It.PositionModeValues[a.readInt(!0)],r.spacingMode=It.SpacingModeValues[a.readInt(!0)],r.rotateMode=It.RotateModeValues[a.readInt(!0)],r.offsetRotation=a.readFloat(),r.position=a.readFloat(),r.positionMode==s.T.Fixed&&(r.position*=e),r.spacing=a.readFloat(),r.spacingMode!=ut.Length&&r.spacingMode!=ut.Fixed||(r.spacing*=e),r.rotateMix=a.readFloat(),r.translateMix=a.readFloat(),n.pathConstraints.push(r)}const o=this.readSkin(a,n,!0,r);null!=o&&(n.defaultSkin=o,n.skins.push(o));{let t=n.skins.length;for(s.cQ.setArraySize(n.skins,i=t+a.readInt(!0));t<i;t++)n.skins[t]=this.readSkin(a,n,!1,r)}i=this.linkedMeshes.length;for(let t=0;t<i;t++){const e=this.linkedMeshes[t],s=null==e.skin?n.defaultSkin:n.findSkin(e.skin);if(null==s)throw new Error(`Skin not found: ${e.skin}`);const a=s.getAttachment(e.slotIndex,e.parent);if(null==a)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.deformAttachment=e.inheritDeform?a:e.mesh,e.mesh.setParentMesh(a)}this.linkedMeshes.length=0,i=a.readInt(!0);for(let t=0;t<i;t++){const t=new lt(a.readStringRef());t.intValue=a.readInt(!1),t.floatValue=a.readFloat(),t.stringValue=a.readString(),t.audioPath=a.readString(),null!=t.audioPath&&(t.volume=a.readFloat(),t.balance=a.readFloat()),n.events.push(t)}i=a.readInt(!0);for(let t=0;t<i;t++)n.animations.push(this.readAnimation(a,a.readString(),n));return n}readSkin(t,e,n,s){let a=null,r=0;if(n){if(r=t.readInt(!0),0==r)return null;a=new St("default")}else{a=new St(t.readStringRef()),a.bones.length=t.readInt(!0);for(let n=0,s=a.bones.length;n<s;n++)a.bones[n]=e.bones[t.readInt(!0)];for(let n=0,s=t.readInt(!0);n<s;n++)a.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let n=0,s=t.readInt(!0);n<s;n++)a.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let n=0,s=t.readInt(!0);n<s;n++)a.constraints.push(e.pathConstraints[t.readInt(!0)]);r=t.readInt(!0)}for(let n=0;n<r;n++){const n=t.readInt(!0);for(let r=0,i=t.readInt(!0);r<i;r++){const r=t.readStringRef(),i=this.readAttachment(t,e,a,n,r,s);null!=i&&a.setAttachment(n,r,i)}}return a}readAttachment(t,e,n,a,r,i){const o=this.scale;let l=t.readStringRef();null==l&&(l=r);const h=t.readByte();switch(It.AttachmentTypeValues[h]){case s.sf.Region:{let e=t.readStringRef();const a=t.readFloat(),r=t.readFloat(),i=t.readFloat(),h=t.readFloat(),c=t.readFloat(),d=t.readFloat(),u=t.readFloat(),f=t.readInt32();null==e&&(e=l);const m=this.attachmentLoader.newRegionAttachment(n,l,e);return null==m?null:(m.path=e,m.x=r*o,m.y=i*o,m.scaleX=h,m.scaleY=c,m.rotation=a,m.width=d*o,m.height=u*o,s.Il.rgba8888ToColor(m.color,f),m)}case s.sf.BoundingBox:{const e=t.readInt(!0),a=this.readVertices(t,e),r=i?t.readInt32():0,o=this.attachmentLoader.newBoundingBoxAttachment(n,l);return null==o?null:(o.worldVerticesLength=e<<1,o.vertices=a.vertices,o.bones=a.bones,i&&s.Il.rgba8888ToColor(o.color,r),o)}case s.sf.Mesh:{let e=t.readStringRef();const a=t.readInt32(),r=t.readInt(!0),h=this.readFloatArray(t,r<<1,1),c=this.readShortArray(t),d=this.readVertices(t,r),u=t.readInt(!0);let f=null,m=0,g=0;i&&(f=this.readShortArray(t),m=t.readFloat(),g=t.readFloat()),null==e&&(e=l);const p=this.attachmentLoader.newMeshAttachment(n,l,e);return null==p?null:(p.path=e,s.Il.rgba8888ToColor(p.color,a),p.bones=d.bones,p.vertices=d.vertices,p.worldVerticesLength=r<<1,p.triangles=c,p.regionUVs=new Float32Array(h),p.hullLength=u<<1,i&&(p.edges=f,p.width=m*o,p.height=g*o),p)}case s.sf.LinkedMesh:{let e=t.readStringRef();const r=t.readInt32(),h=t.readStringRef(),c=t.readStringRef(),d=t.readBoolean();let u=0,f=0;i&&(u=t.readFloat(),f=t.readFloat()),null==e&&(e=l);const m=this.attachmentLoader.newMeshAttachment(n,l,e);return null==m?null:(m.path=e,s.Il.rgba8888ToColor(m.color,r),i&&(m.width=u*o,m.height=f*o),this.linkedMeshes.push(new At(m,h,a,c,d)),m)}case s.sf.Path:{const e=t.readBoolean(),a=t.readBoolean(),r=t.readInt(!0),h=this.readVertices(t,r),c=s.cQ.newArray(r/3,0);for(let e=0,n=c.length;e<n;e++)c[e]=t.readFloat()*o;const d=i?t.readInt32():0,u=this.attachmentLoader.newPathAttachment(n,l);return null==u?null:(u.closed=e,u.constantSpeed=a,u.worldVerticesLength=r<<1,u.vertices=h.vertices,u.bones=h.bones,u.lengths=c,i&&s.Il.rgba8888ToColor(u.color,d),u)}case s.sf.Point:{const e=t.readFloat(),a=t.readFloat(),r=t.readFloat(),h=i?t.readInt32():0,c=this.attachmentLoader.newPointAttachment(n,l);return null==c?null:(c.x=a*o,c.y=r*o,c.rotation=e,i&&s.Il.rgba8888ToColor(c.color,h),c)}case s.sf.Clipping:{const a=t.readInt(!0),r=t.readInt(!0),o=this.readVertices(t,r),h=i?t.readInt32():0,c=this.attachmentLoader.newClippingAttachment(n,l);return null==c?null:(c.endSlot=e.slots[a],c.worldVerticesLength=r<<1,c.vertices=o.vertices,c.bones=o.bones,i&&s.Il.rgba8888ToColor(c.color,h),c)}}return null}readVertices(t,e){const n=e<<1,a=new Rt,r=this.scale;if(!t.readBoolean())return a.vertices=this.readFloatArray(t,n,r),a;const i=new Array,o=new Array;for(let n=0;n<e;n++){const e=t.readInt(!0);o.push(e);for(let n=0;n<e;n++)o.push(t.readInt(!0)),i.push(t.readFloat()*r),i.push(t.readFloat()*r),i.push(t.readFloat())}return a.vertices=s.cQ.toFloatArray(i),a.bones=o,a}readFloatArray(t,e,n){const s=new Array(e);if(1==n)for(let n=0;n<e;n++)s[n]=t.readFloat();else for(let a=0;a<e;a++)s[a]=t.readFloat()*n;return s}readShortArray(t){const e=t.readInt(!0),n=new Array(e);for(let s=0;s<e;s++)n[s]=t.readShort();return n}readAnimation(t,e,n){const a=new Array,r=this.scale;let i=0;const o=new s.Il,l=new s.Il;for(let e=0,n=t.readInt(!0);e<n;e++){const e=t.readInt(!0);for(let n=0,r=t.readInt(!0);n<r;n++){const n=t.readByte(),r=t.readInt(!0);switch(n){case It.SLOT_ATTACHMENT:{const n=new F(r);n.slotIndex=e;for(let e=0;e<r;e++)n.setFrame(e,t.readFloat(),t.readStringRef());a.push(n),i=Math.max(i,n.frames[r-1]);break}case It.SLOT_COLOR:{const n=new C(r);n.slotIndex=e;for(let e=0;e<r;e++){const a=t.readFloat();s.Il.rgba8888ToColor(o,t.readInt32()),n.setFrame(e,a,o.r,o.g,o.b,o.a),e<r-1&&this.readCurve(t,e,n)}a.push(n),i=Math.max(i,n.frames[(r-1)*C.ENTRIES]);break}case It.SLOT_TWO_COLOR:{const n=new P(r);n.slotIndex=e;for(let e=0;e<r;e++){const a=t.readFloat();s.Il.rgba8888ToColor(o,t.readInt32()),s.Il.rgb888ToColor(l,t.readInt32()),n.setFrame(e,a,o.r,o.g,o.b,o.a,l.r,l.g,l.b),e<r-1&&this.readCurve(t,e,n)}a.push(n),i=Math.max(i,n.frames[(r-1)*P.ENTRIES]);break}}}}for(let e=0,n=t.readInt(!0);e<n;e++){const e=t.readInt(!0);for(let n=0,s=t.readInt(!0);n<s;n++){const n=t.readByte(),s=t.readInt(!0);switch(n){case It.BONE_ROTATE:{const n=new I(s);n.boneIndex=e;for(let e=0;e<s;e++)n.setFrame(e,t.readFloat(),t.readFloat()),e<s-1&&this.readCurve(t,e,n);a.push(n),i=Math.max(i,n.frames[(s-1)*I.ENTRIES]);break}case It.BONE_TRANSLATE:case It.BONE_SCALE:case It.BONE_SHEAR:{let o,l=1;n==It.BONE_SCALE?o=new R(s):n==It.BONE_SHEAR?o=new y(s):(o=new A(s),l=r),o.boneIndex=e;for(let e=0;e<s;e++)o.setFrame(e,t.readFloat(),t.readFloat()*l,t.readFloat()*l),e<s-1&&this.readCurve(t,e,o);a.push(o),i=Math.max(i,o.frames[(s-1)*A.ENTRIES]);break}}}}for(let e=0,n=t.readInt(!0);e<n;e++){const e=t.readInt(!0),n=t.readInt(!0),s=new D(n);s.ikConstraintIndex=e;for(let e=0;e<n;e++)s.setFrame(e,t.readFloat(),t.readFloat(),t.readFloat()*r,t.readByte(),t.readBoolean(),t.readBoolean()),e<n-1&&this.readCurve(t,e,s);a.push(s),i=Math.max(i,s.frames[(n-1)*D.ENTRIES])}for(let e=0,n=t.readInt(!0);e<n;e++){const e=t.readInt(!0),n=t.readInt(!0),s=new q(n);s.transformConstraintIndex=e;for(let e=0;e<n;e++)s.setFrame(e,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat()),e<n-1&&this.readCurve(t,e,s);a.push(s),i=Math.max(i,s.frames[(n-1)*q.ENTRIES])}for(let e=0,o=t.readInt(!0);e<o;e++){const e=t.readInt(!0),o=n.pathConstraints[e];for(let n=0,l=t.readInt(!0);n<l;n++){const n=t.readByte(),l=t.readInt(!0);switch(n){case It.PATH_POSITION:case It.PATH_SPACING:{let h,c=1;n==It.PATH_SPACING?(h=new W(l),o.spacingMode!=ut.Length&&o.spacingMode!=ut.Fixed||(c=r)):(h=new L(l),o.positionMode==s.T.Fixed&&(c=r)),h.pathConstraintIndex=e;for(let e=0;e<l;e++)h.setFrame(e,t.readFloat(),t.readFloat()*c),e<l-1&&this.readCurve(t,e,h);a.push(h),i=Math.max(i,h.frames[(l-1)*L.ENTRIES]);break}case It.PATH_MIX:{const n=new $(l);n.pathConstraintIndex=e;for(let e=0;e<l;e++)n.setFrame(e,t.readFloat(),t.readFloat(),t.readFloat()),e<l-1&&this.readCurve(t,e,n);a.push(n),i=Math.max(i,n.frames[(l-1)*$.ENTRIES]);break}}}}for(let e=0,o=t.readInt(!0);e<o;e++){const e=n.skins[t.readInt(!0)];for(let n=0,o=t.readInt(!0);n<o;n++){const n=t.readInt(!0);for(let o=0,l=t.readInt(!0);o<l;o++){const o=e.getAttachment(n,t.readStringRef()),l=null!=o.bones,h=o.vertices,c=l?h.length/3*2:h.length,d=t.readInt(!0),u=new N(d);u.slotIndex=n,u.attachment=o;for(let e=0;e<d;e++){const n=t.readFloat();let a,i=t.readInt(!0);if(0==i)a=l?s.cQ.newFloatArray(c):h;else{a=s.cQ.newFloatArray(c);const e=t.readInt(!0);if(i+=e,1==r)for(let n=e;n<i;n++)a[n]=t.readFloat();else for(let n=e;n<i;n++)a[n]=t.readFloat()*r;if(!l)for(let t=0,e=a.length;t<e;t++)a[t]+=h[t]}u.setFrame(e,n,a),e<d-1&&this.readCurve(t,e,u)}a.push(u),i=Math.max(i,u.frames[d-1])}}}const h=t.readInt(!0);if(h>0){const e=new Y(h),r=n.slots.length;for(let n=0;n<h;n++){const a=t.readFloat(),i=t.readInt(!0),o=s.cQ.newArray(r,0);for(let t=r-1;t>=0;t--)o[t]=-1;const l=s.cQ.newArray(r-i,0);let h=0,c=0;for(let e=0;e<i;e++){const e=t.readInt(!0);for(;h!=e;)l[c++]=h++;o[h+t.readInt(!0)]=h++}for(;h<r;)l[c++]=h++;for(let t=r-1;t>=0;t--)-1==o[t]&&(o[t]=l[--c]);e.setFrame(n,a,o)}a.push(e),i=Math.max(i,e.frames[h-1])}const c=t.readInt(!0);if(c>0){const e=new _(c);for(let s=0;s<c;s++){const a=t.readFloat(),r=n.events[t.readInt(!0)],i=new ot(a,r);i.intValue=t.readInt(!1),i.floatValue=t.readFloat(),i.stringValue=t.readBoolean()?t.readString():r.stringValue,null!=i.data.audioPath&&(i.volume=t.readFloat(),i.balance=t.readFloat()),e.setFrame(s,i)}a.push(e),i=Math.max(i,e.frames[c-1])}return new x(e,a,i)}readCurve(t,e,n){switch(t.readByte()){case It.CURVE_STEPPED:n.setStepped(e);break;case It.CURVE_BEZIER:this.setCurve(n,e,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat())}}setCurve(t,e,n,s,a,r){t.setCurve(e,n,s,a,r)}};let Tt=It;Tt.AttachmentTypeValues=[0,1,2,3,4,5,6],Tt.TransformModeValues=[s.Qe.Normal,s.Qe.OnlyTranslation,s.Qe.NoRotationOrReflection,s.Qe.NoScale,s.Qe.NoScaleOrReflection],Tt.PositionModeValues=[s.T.Fixed,s.T.Percent],Tt.SpacingModeValues=[ut.Length,ut.Fixed,ut.Percent],Tt.RotateModeValues=[s.YK.Tangent,s.YK.Chain,s.YK.ChainScale],Tt.BlendModeValues=[st.T$.NORMAL,st.T$.ADD,st.T$.MULTIPLY,st.T$.SCREEN],Tt.BONE_ROTATE=0,Tt.BONE_TRANSLATE=1,Tt.BONE_SCALE=2,Tt.BONE_SHEAR=3,Tt.SLOT_ATTACHMENT=0,Tt.SLOT_COLOR=1,Tt.SLOT_TWO_COLOR=2,Tt.PATH_POSITION=0,Tt.PATH_SPACING=1,Tt.PATH_MIX=2,Tt.CURVE_LINEAR=0,Tt.CURVE_STEPPED=1,Tt.CURVE_BEZIER=2;class At{constructor(t,e,n,s,a){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=s,this.inheritDeform=a}}class Rt{constructor(t=null,e=null){this.bones=t,this.vertices=e}}class yt extends s.o${}class kt{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){const e=this.scale,n=new xt,a="string"==typeof t?JSON.parse(t):t,r=a.skeleton;if(null!=r){if(n.hash=r.hash,n.version=r.spine,"3.8"!==n.version.substr(0,3)){const t=`Spine 3.8 loader cant load version ${r.spine}. Please configure your pixi-spine bundle`;console.error(t)}if("3.8.75"===n.version){const t="Unsupported skeleton data, 3.8.75 is deprecated, please export with a newer version of Spine.";console.error(t)}n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height,n.fps=r.fps,n.imagesPath=r.images}if(a.bones)for(let t=0;t<a.bones.length;t++){const s=a.bones[t];let r=null;const i=this.getValue(s,"parent",null);if(null!=i&&(r=n.findBone(i),null==r))throw new Error(`Parent bone not found: ${i}`);const o=new rt(n.bones.length,s.name,r);o.length=this.getValue(s,"length",0)*e,o.x=this.getValue(s,"x",0)*e,o.y=this.getValue(s,"y",0)*e,o.rotation=this.getValue(s,"rotation",0),o.scaleX=this.getValue(s,"scaleX",1),o.scaleY=this.getValue(s,"scaleY",1),o.shearX=this.getValue(s,"shearX",0),o.shearY=this.getValue(s,"shearY",0),o.transformMode=kt.transformModeFromString(this.getValue(s,"transform","normal")),o.skinRequired=this.getValue(s,"skin",!1),n.bones.push(o)}if(a.slots)for(let t=0;t<a.slots.length;t++){const e=a.slots[t],r=e.name,i=e.bone,o=n.findBone(i);if(null==o)throw new Error(`Slot bone not found: ${i}`);const l=new bt(n.slots.length,r,o),h=this.getValue(e,"color",null);null!=h&&l.color.setFromString(h);const c=this.getValue(e,"dark",null);null!=c&&(l.darkColor=new s.Il(1,1,1,1),l.darkColor.setFromString(c)),l.attachmentName=this.getValue(e,"attachment",null),l.blendMode=kt.blendModeFromString(this.getValue(e,"blend","normal")),n.slots.push(l)}if(a.ik)for(let t=0;t<a.ik.length;t++){const s=a.ik[t],r=new ct(s.name);r.order=this.getValue(s,"order",0),r.skinRequired=this.getValue(s,"skin",!1);for(let t=0;t<s.bones.length;t++){const e=s.bones[t],a=n.findBone(e);if(null==a)throw new Error(`IK bone not found: ${e}`);r.bones.push(a)}const i=s.target;if(r.target=n.findBone(i),null==r.target)throw new Error(`IK target bone not found: ${i}`);r.mix=this.getValue(s,"mix",1),r.softness=this.getValue(s,"softness",0)*e,r.bendDirection=this.getValue(s,"bendPositive",!0)?1:-1,r.compress=this.getValue(s,"compress",!1),r.stretch=this.getValue(s,"stretch",!1),r.uniform=this.getValue(s,"uniform",!1),n.ikConstraints.push(r)}if(a.transform)for(let t=0;t<a.transform.length;t++){const s=a.transform[t],r=new wt(s.name);r.order=this.getValue(s,"order",0),r.skinRequired=this.getValue(s,"skin",!1);for(let t=0;t<s.bones.length;t++){const e=s.bones[t],a=n.findBone(e);if(null==a)throw new Error(`Transform constraint bone not found: ${e}`);r.bones.push(a)}const i=s.target;if(r.target=n.findBone(i),null==r.target)throw new Error(`Transform constraint target bone not found: ${i}`);r.local=this.getValue(s,"local",!1),r.relative=this.getValue(s,"relative",!1),r.offsetRotation=this.getValue(s,"rotation",0),r.offsetX=this.getValue(s,"x",0)*e,r.offsetY=this.getValue(s,"y",0)*e,r.offsetScaleX=this.getValue(s,"scaleX",0),r.offsetScaleY=this.getValue(s,"scaleY",0),r.offsetShearY=this.getValue(s,"shearY",0),r.rotateMix=this.getValue(s,"rotateMix",1),r.translateMix=this.getValue(s,"translateMix",1),r.scaleMix=this.getValue(s,"scaleMix",1),r.shearMix=this.getValue(s,"shearMix",1),n.transformConstraints.push(r)}if(a.path)for(let t=0;t<a.path.length;t++){const r=a.path[t],i=new dt(r.name);i.order=this.getValue(r,"order",0),i.skinRequired=this.getValue(r,"skin",!1);for(let t=0;t<r.bones.length;t++){const e=r.bones[t],s=n.findBone(e);if(null==s)throw new Error(`Transform constraint bone not found: ${e}`);i.bones.push(s)}const o=r.target;if(i.target=n.findSlot(o),null==i.target)throw new Error(`Path target slot not found: ${o}`);i.positionMode=kt.positionModeFromString(this.getValue(r,"positionMode","percent")),i.spacingMode=kt.spacingModeFromString(this.getValue(r,"spacingMode","length")),i.rotateMode=kt.rotateModeFromString(this.getValue(r,"rotateMode","tangent")),i.offsetRotation=this.getValue(r,"rotation",0),i.position=this.getValue(r,"position",0),i.positionMode==s.T.Fixed&&(i.position*=e),i.spacing=this.getValue(r,"spacing",0),i.spacingMode!=ut.Length&&i.spacingMode!=ut.Fixed||(i.spacing*=e),i.rotateMix=this.getValue(r,"rotateMix",1),i.translateMix=this.getValue(r,"translateMix",1),n.pathConstraints.push(i)}if(a.skins)for(let t=0;t<a.skins.length;t++){const e=a.skins[t],s=new St(e.name);if(e.bones)for(let a=0;a<e.bones.length;a++){const r=n.findBone(e.bones[a]);if(null==r)throw new Error(`Skin bone not found: ${e.bones[t]}`);s.bones.push(r)}if(e.ik)for(let a=0;a<e.ik.length;a++){const r=n.findIkConstraint(e.ik[a]);if(null==r)throw new Error(`Skin IK constraint not found: ${e.ik[t]}`);s.constraints.push(r)}if(e.transform)for(let a=0;a<e.transform.length;a++){const r=n.findTransformConstraint(e.transform[a]);if(null==r)throw new Error(`Skin transform constraint not found: ${e.transform[t]}`);s.constraints.push(r)}if(e.path)for(let a=0;a<e.path.length;a++){const r=n.findPathConstraint(e.path[a]);if(null==r)throw new Error(`Skin path constraint not found: ${e.path[t]}`);s.constraints.push(r)}for(const t in e.attachments){const a=n.findSlot(t);if(null==a)throw new Error(`Slot not found: ${t}`);const r=e.attachments[t];for(const t in r){const e=this.readAttachment(r[t],s,a.index,t,n);null!=e&&s.setAttachment(a.index,t,e)}}n.skins.push(s),"default"==s.name&&(n.defaultSkin=s)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){const e=this.linkedMeshes[t],s=null==e.skin?n.defaultSkin:n.findSkin(e.skin);if(null==s)throw new Error(`Skin not found: ${e.skin}`);const a=s.getAttachment(e.slotIndex,e.parent);if(null==a)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.deformAttachment=e.inheritDeform?a:e.mesh,e.mesh.setParentMesh(a)}if(this.linkedMeshes.length=0,a.events)for(const t in a.events){const e=a.events[t],s=new lt(t);s.intValue=this.getValue(e,"int",0),s.floatValue=this.getValue(e,"float",0),s.stringValue=this.getValue(e,"string",""),s.audioPath=this.getValue(e,"audio",null),null!=s.audioPath&&(s.volume=this.getValue(e,"volume",1),s.balance=this.getValue(e,"balance",0)),n.events.push(s)}if(a.animations)for(const t in a.animations){const e=a.animations[t];this.readAnimation(e,t,n)}return n}readAttachment(t,e,n,a,r){const i=this.scale;switch(a=this.getValue(t,"name",a),this.getValue(t,"type","region")){case"region":{const n=this.getValue(t,"path",a),s=this.attachmentLoader.newRegionAttachment(e,a,n);if(null==s)return null;s.path=n,s.x=this.getValue(t,"x",0)*i,s.y=this.getValue(t,"y",0)*i,s.scaleX=this.getValue(t,"scaleX",1),s.scaleY=this.getValue(t,"scaleY",1),s.rotation=this.getValue(t,"rotation",0),s.width=t.width*i,s.height=t.height*i;const r=this.getValue(t,"color",null);return null!=r&&s.color.setFromString(r),s}case"boundingbox":{const n=this.attachmentLoader.newBoundingBoxAttachment(e,a);if(null==n)return null;this.readVertices(t,n,t.vertexCount<<1);const s=this.getValue(t,"color",null);return null!=s&&n.color.setFromString(s),n}case"mesh":case"linkedmesh":{const s=this.getValue(t,"path",a),r=this.attachmentLoader.newMeshAttachment(e,a,s);if(null==r)return null;r.path=s;const o=this.getValue(t,"color",null);null!=o&&r.color.setFromString(o),r.width=this.getValue(t,"width",0)*i,r.height=this.getValue(t,"height",0)*i;const l=this.getValue(t,"parent",null);if(null!=l)return this.linkedMeshes.push(new Ct(r,this.getValue(t,"skin",null),n,l,this.getValue(t,"deform",!0))),r;const h=t.uvs;return this.readVertices(t,r,h.length),r.triangles=t.triangles,r.regionUVs=new Float32Array(h),r.edges=this.getValue(t,"edges",null),r.hullLength=2*this.getValue(t,"hull",0),r}case"path":{const n=this.attachmentLoader.newPathAttachment(e,a);if(null==n)return null;n.closed=this.getValue(t,"closed",!1),n.constantSpeed=this.getValue(t,"constantSpeed",!0);const r=t.vertexCount;this.readVertices(t,n,r<<1);const o=s.cQ.newArray(r/3,0);for(let e=0;e<t.lengths.length;e++)o[e]=t.lengths[e]*i;n.lengths=o;const l=this.getValue(t,"color",null);return null!=l&&n.color.setFromString(l),n}case"point":{const n=this.attachmentLoader.newPointAttachment(e,a);if(null==n)return null;n.x=this.getValue(t,"x",0)*i,n.y=this.getValue(t,"y",0)*i,n.rotation=this.getValue(t,"rotation",0);const s=this.getValue(t,"color",null);return null!=s&&n.color.setFromString(s),n}case"clipping":{const n=this.attachmentLoader.newClippingAttachment(e,a);if(null==n)return null;const s=this.getValue(t,"end",null);if(null!=s){const t=r.findSlot(s);if(null==t)throw new Error(`Clipping end slot not found: ${s}`);n.endSlot=t}const i=t.vertexCount;this.readVertices(t,n,i<<1);const o=this.getValue(t,"color",null);return null!=o&&n.color.setFromString(o),n}}return null}readVertices(t,e,n){const a=this.scale;e.worldVerticesLength=n;const r=t.vertices;if(n==r.length){const t=s.cQ.toFloatArray(r);if(1!=a)for(let e=0,n=r.length;e<n;e++)t[e]*=a;return void(e.vertices=t)}const i=new Array,o=new Array;for(let t=0,e=r.length;t<e;){const e=r[t++];o.push(e);for(let n=t+4*e;t<n;t+=4)o.push(r[t]),i.push(r[t+1]*a),i.push(r[t+2]*a),i.push(r[t+3])}e.bones=o,e.vertices=s.cQ.toFloatArray(i)}readAnimation(t,e,n){const a=this.scale,r=new Array;let i=0;if(t.slots)for(const e in t.slots){const a=t.slots[e],o=n.findSlotIndex(e);if(-1==o)throw new Error(`Slot not found: ${e}`);for(const t in a){const n=a[t];if("attachment"==t){const t=new F(n.length);t.slotIndex=o;let e=0;for(let s=0;s<n.length;s++){const a=n[s];t.setFrame(e++,this.getValue(a,"time",0),a.name)}r.push(t),i=Math.max(i,t.frames[t.getFrameCount()-1])}else if("color"==t){const t=new C(n.length);t.slotIndex=o;let e=0;for(let a=0;a<n.length;a++){const r=n[a],i=new s.Il;i.setFromString(r.color||"ffffffff"),t.setFrame(e,this.getValue(r,"time",0),i.r,i.g,i.b,i.a),this.readCurve(r,t,e),e++}r.push(t),i=Math.max(i,t.frames[(t.getFrameCount()-1)*C.ENTRIES])}else{if("twoColor"!=t)throw new Error(`Invalid timeline type for a slot: ${t} (${e})`);{const t=new P(n.length);t.slotIndex=o;let e=0;for(let a=0;a<n.length;a++){const r=n[a],i=new s.Il,o=new s.Il;i.setFromString(r.light),o.setFromString(r.dark),t.setFrame(e,this.getValue(r,"time",0),i.r,i.g,i.b,i.a,o.r,o.g,o.b),this.readCurve(r,t,e),e++}r.push(t),i=Math.max(i,t.frames[(t.getFrameCount()-1)*P.ENTRIES])}}}}if(t.bones)for(const e in t.bones){const s=t.bones[e],o=n.findBoneIndex(e);if(-1==o)throw new Error(`Bone not found: ${e}`);for(const t in s){const n=s[t];if("rotate"===t){const t=new I(n.length);t.boneIndex=o;let e=0;for(let s=0;s<n.length;s++){const a=n[s];t.setFrame(e,this.getValue(a,"time",0),this.getValue(a,"angle",0)),this.readCurve(a,t,e),e++}r.push(t),i=Math.max(i,t.frames[(t.getFrameCount()-1)*I.ENTRIES])}else{if("translate"!==t&&"scale"!==t&&"shear"!==t)throw new Error(`Invalid timeline type for a bone: ${t} (${e})`);{let e=null,s=1,l=0;"scale"===t?(e=new R(n.length),l=1):"shear"===t?e=new y(n.length):(e=new A(n.length),s=a),e.boneIndex=o;let h=0;for(let t=0;t<n.length;t++){const a=n[t],r=this.getValue(a,"x",l),i=this.getValue(a,"y",l);e.setFrame(h,this.getValue(a,"time",0),r*s,i*s),this.readCurve(a,e,h),h++}r.push(e),i=Math.max(i,e.frames[(e.getFrameCount()-1)*A.ENTRIES])}}}}if(t.ik)for(const e in t.ik){const s=t.ik[e],o=n.findIkConstraint(e),l=new D(s.length);l.ikConstraintIndex=n.ikConstraints.indexOf(o);let h=0;for(let t=0;t<s.length;t++){const e=s[t];l.setFrame(h,this.getValue(e,"time",0),this.getValue(e,"mix",1),this.getValue(e,"softness",0)*a,this.getValue(e,"bendPositive",!0)?1:-1,this.getValue(e,"compress",!1),this.getValue(e,"stretch",!1)),this.readCurve(e,l,h),h++}r.push(l),i=Math.max(i,l.frames[(l.getFrameCount()-1)*D.ENTRIES])}if(t.transform)for(const e in t.transform){const s=t.transform[e],a=n.findTransformConstraint(e),o=new q(s.length);o.transformConstraintIndex=n.transformConstraints.indexOf(a);let l=0;for(let t=0;t<s.length;t++){const e=s[t];o.setFrame(l,this.getValue(e,"time",0),this.getValue(e,"rotateMix",1),this.getValue(e,"translateMix",1),this.getValue(e,"scaleMix",1),this.getValue(e,"shearMix",1)),this.readCurve(e,o,l),l++}r.push(o),i=Math.max(i,o.frames[(o.getFrameCount()-1)*q.ENTRIES])}if(t.path)for(const e in t.path){const o=t.path[e],l=n.findPathConstraintIndex(e);if(-1==l)throw new Error(`Path constraint not found: ${e}`);const h=n.pathConstraints[l];for(const t in o){const e=o[t];if("position"===t||"spacing"===t){let n=null,o=1;"spacing"===t?(n=new W(e.length),h.spacingMode!=ut.Length&&h.spacingMode!=ut.Fixed||(o=a)):(n=new L(e.length),h.positionMode==s.T.Fixed&&(o=a)),n.pathConstraintIndex=l;let c=0;for(let s=0;s<e.length;s++){const a=e[s];n.setFrame(c,this.getValue(a,"time",0),this.getValue(a,t,0)*o),this.readCurve(a,n,c),c++}r.push(n),i=Math.max(i,n.frames[(n.getFrameCount()-1)*L.ENTRIES])}else if("mix"===t){const t=new $(e.length);t.pathConstraintIndex=l;let n=0;for(let s=0;s<e.length;s++){const a=e[s];t.setFrame(n,this.getValue(a,"time",0),this.getValue(a,"rotateMix",1),this.getValue(a,"translateMix",1)),this.readCurve(a,t,n),n++}r.push(t),i=Math.max(i,t.frames[(t.getFrameCount()-1)*$.ENTRIES])}}}if(t.deform)for(const e in t.deform){const o=t.deform[e],l=n.findSkin(e);if(null!=l)for(const t in o){const e=o[t],h=n.findSlotIndex(t);if(-1==h)throw new Error(`Slot not found: ${e.name}`);for(const t in e){const n=e[t],o=l.getAttachment(h,t);if(null==o)throw new Error(`Deform attachment not found: ${n.name}`);const c=null!=o.bones,d=o.vertices,u=c?d.length/3*2:d.length,f=new N(n.length);f.slotIndex=h,f.attachment=o;let m=0;for(let t=0;t<n.length;t++){const e=n[t];let r;const i=this.getValue(e,"vertices",null);if(null==i)r=c?s.cQ.newFloatArray(u):d;else{r=s.cQ.newFloatArray(u);const t=this.getValue(e,"offset",0);if(s.cQ.arrayCopy(i,0,r,t,i.length),1!=a)for(let e=t,n=e+i.length;e<n;e++)r[e]*=a;if(!c)for(let t=0;t<u;t++)r[t]+=d[t]}f.setFrame(m,this.getValue(e,"time",0),r),this.readCurve(e,f,m),m++}r.push(f),i=Math.max(i,f.frames[f.getFrameCount()-1])}}else if(s.Xd.FAIL_ON_NON_EXISTING_SKIN)throw new Error(`Skin not found: ${e}`)}let o=t.drawOrder;if(null==o&&(o=t.draworder),null!=o){const t=new Y(o.length),e=n.slots.length;let a=0;for(let r=0;r<o.length;r++){const i=o[r];let l=null;const h=this.getValue(i,"offsets",null);if(null!=h){l=s.cQ.newArray(e,-1);const t=s.cQ.newArray(e-h.length,0);let a=0,r=0;for(let e=0;e<h.length;e++){const s=h[e],i=n.findSlotIndex(s.slot);if(-1==i)throw new Error(`Slot not found: ${s.slot}`);for(;a!=i;)t[r++]=a++;l[a+s.offset]=a++}for(;a<e;)t[r++]=a++;for(let n=e-1;n>=0;n--)-1==l[n]&&(l[n]=t[--r])}t.setFrame(a++,this.getValue(i,"time",0),l)}r.push(t),i=Math.max(i,t.frames[t.getFrameCount()-1])}if(t.events){const e=new _(t.events.length);let a=0;for(let r=0;r<t.events.length;r++){const i=t.events[r],o=n.findEvent(i.name);if(null==o)throw new Error(`Event not found: ${i.name}`);const l=new ot(s.cQ.toSinglePrecision(this.getValue(i,"time",0)),o);l.intValue=this.getValue(i,"int",o.intValue),l.floatValue=this.getValue(i,"float",o.floatValue),l.stringValue=this.getValue(i,"string",o.stringValue),null!=l.data.audioPath&&(l.volume=this.getValue(i,"volume",1),l.balance=this.getValue(i,"balance",0)),e.setFrame(a++,l)}r.push(e),i=Math.max(i,e.frames[e.getFrameCount()-1])}if(isNaN(i))throw new Error("Error while parsing animation, duration is NaN");n.animations.push(new x(e,r,i))}readCurve(t,e,n){if(t.hasOwnProperty("curve"))if("stepped"===t.curve)e.setStepped(n);else{const s=t.curve;e.setCurve(n,s,this.getValue(t,"c2",0),this.getValue(t,"c3",1),this.getValue(t,"c4",1))}}getValue(t,e,n){return void 0!==t[e]?t[e]:n}static blendModeFromString(t){if("normal"==(t=t.toLowerCase()))return st.T$.NORMAL;if("additive"==t)return st.T$.ADD;if("multiply"==t)return st.T$.MULTIPLY;if("screen"==t)return st.T$.SCREEN;throw new Error(`Unknown blend mode: ${t}`)}static positionModeFromString(t){if("fixed"==(t=t.toLowerCase()))return s.T.Fixed;if("percent"==t)return s.T.Percent;throw new Error(`Unknown position mode: ${t}`)}static spacingModeFromString(t){if("length"==(t=t.toLowerCase()))return ut.Length;if("fixed"==t)return ut.Fixed;if("percent"==t)return ut.Percent;throw new Error(`Unknown position mode: ${t}`)}static rotateModeFromString(t){if("tangent"==(t=t.toLowerCase()))return s.YK.Tangent;if("chain"==t)return s.YK.Chain;if("chainscale"==t)return s.YK.ChainScale;throw new Error(`Unknown rotate mode: ${t}`)}static transformModeFromString(t){if("normal"==(t=t.toLowerCase()))return s.Qe.Normal;if("onlytranslation"==t)return s.Qe.OnlyTranslation;if("norotationorreflection"==t)return s.Qe.NoRotationOrReflection;if("noscale"==t)return s.Qe.NoScale;if("noscaleorreflection"==t)return s.Qe.NoScaleOrReflection;throw new Error(`Unknown transform mode: ${t}`)}}class Ct{constructor(t,e,n,s,a){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=s,this.inheritDeform=a}}class Vt extends s.Ww{createSkeleton(t){this.skeleton=new Et(t),this.skeleton.updateWorldTransform(),this.stateData=new et(t),this.state=new H(this.stateData)}}}}]);