@esotericsoftware/spine-core 4.0.21 → 4.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var spine=(()=>{var Le=Object.defineProperty,us=t=>Le(t,"__esModule",{value:!0}),ms=(t,i)=>{us(t);for(var e in i)Le(t,e,{get:i[e],enumerable:!0})},De={};ms(De,{AlphaTimeline:()=>ae,Animation:()=>Vt,AnimationState:()=>me,AnimationStateAdapter:()=>ps,AnimationStateData:()=>ys,AssetManagerBase:()=>ks,AtlasAttachmentLoader:()=>As,Attachment:()=>jt,AttachmentTimeline:()=>yt,BinaryInput:()=>as,BlendMode:()=>zt,Bone:()=>Ae,BoneData:()=>Se,BoundingBoxAttachment:()=>Ot,CURRENT:()=>$e,ClippingAttachment:()=>pe,Color:()=>L,ConstraintData:()=>Ut,CurveTimeline:()=>at,CurveTimeline1:()=>nt,CurveTimeline2:()=>Lt,DebugUtils:()=>xs,DeformTimeline:()=>oe,Downloader:()=>es,DrawOrderTimeline:()=>vt,Event:()=>ke,EventData:()=>Ye,EventQueue:()=>je,EventTimeline:()=>Pt,EventType:()=>tt,FIRST:()=>ge,FakeTexture:()=>vs,HOLD_FIRST:()=>Nt,HOLD_MIX:()=>Ge,HOLD_SUBSEQUENT:()=>xe,IkConstraint:()=>ss,IkConstraintData:()=>Ce,IkConstraintTimeline:()=>he,IntSet:()=>gs,Interpolation:()=>Ne,JitterEffect:()=>Qs,MathUtils:()=>X,MeshAttachment:()=>Ct,MixBlend:()=>$,MixDirection:()=>mt,PathAttachment:()=>It,PathConstraint:()=>Tt,PathConstraintData:()=>Ie,PathConstraintMixTimeline:()=>ue,PathConstraintPositionTimeline:()=>de,PathConstraintSpacingTimeline:()=>fe,PointAttachment:()=>ve,Pool:()=>Bt,PositionMode:()=>dt,Pow:()=>Oe,PowOut:()=>Ue,RGB2Timeline:()=>le,RGBA2Timeline:()=>ne,RGBATimeline:()=>ie,RGBTimeline:()=>re,RegionAttachment:()=>U,RotateMode:()=>kt,RotateTimeline:()=>Rt,SETUP:()=>be,SUBSEQUENT:()=>Dt,ScaleTimeline:()=>Qt,ScaleXTimeline:()=>Kt,ScaleYTimeline:()=>Zt,ShearTimeline:()=>te,ShearXTimeline:()=>ee,ShearYTimeline:()=>se,Skeleton:()=>Ys,SkeletonBinary:()=>Cs,SkeletonBounds:()=>Gs,SkeletonClipping:()=>Re,SkeletonData:()=>Te,SkeletonJson:()=>$s,Skin:()=>Wt,SkinEntry:()=>Xe,Slot:()=>is,SlotData:()=>Me,SpacingMode:()=>Q,StringSet:()=>Ht,SwirlEffect:()=>ls,Texture:()=>Je,TextureAtlas:()=>Ke,TextureAtlasPage:()=>Ze,TextureAtlasRegion:()=>ye,TextureFilter:()=>St,TextureRegion:()=>Qe,TextureWrap:()=>At,TimeKeeper:()=>bs,Timeline:()=>J,TrackEntry:()=>He,TransformConstraint:()=>rs,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>ce,TransformMode:()=>et,TranslateTimeline:()=>Gt,TranslateXTimeline:()=>$t,TranslateYTimeline:()=>Jt,Triangulator:()=>st,Utils:()=>R,Vector2:()=>We,VertexAttachment:()=>ct,WindowedMean:()=>ws});var gs=class{constructor(){this.array=new Array}add(t){let i=this.contains(t);return this.array[t|0]=t|0,!i}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}},Ht=class{constructor(){this.entries={},this.size=0}add(t){let i=this.entries[t];return this.entries[t]=!0,i?!1:(this.size++,!0)}addAll(t){let i=this.size;for(var e=0,a=t.length;e<a;e++)this.add(t[e]);return i!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}},pt=class{constructor(t=0,i=0,e=0,a=0){this.r=t,this.g=i,this.b=e,this.a=a}set(t,i,e,a){return this.r=t,this.g=i,this.b=e,this.a=a,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,i,e,a){return this.r+=t,this.g+=i,this.b+=e,this.a+=a,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,i){t.r=((i&4278190080)>>>24)/255,t.g=((i&16711680)>>>16)/255,t.b=((i&65280)>>>8)/255,t.a=(i&255)/255}static rgb888ToColor(t,i){t.r=((i&16711680)>>>16)/255,t.g=((i&65280)>>>8)/255,t.b=(i&255)/255}static fromString(t){return new pt().setFromString(t)}},L=pt;L.WHITE=new pt(1,1,1,1),L.RED=new pt(1,0,0,1),L.GREEN=new pt(0,1,0,1),L.BLUE=new pt(0,0,1,1),L.MAGENTA=new pt(1,0,1,1);var ut=class{static clamp(t,i,e){return t<i?i:t>e?e:t}static cosDeg(t){return Math.cos(t*ut.degRad)}static sinDeg(t){return Math.sin(t*ut.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let i=Math.pow(Math.abs(t),1/3);return t<0?-i:i}static randomTriangular(t,i){return ut.randomTriangularWith(t,i,(t+i)*.5)}static randomTriangularWith(t,i,e){let a=Math.random(),r=i-t;return a<=(e-t)/r?t+Math.sqrt(a*r*(e-t)):i-Math.sqrt((1-a)*r*(i-e))}static isPowerOfTwo(t){return t&&(t&t-1)==0}},X=ut;X.PI=3.1415927,X.PI2=ut.PI*2,X.radiansToDegrees=180/ut.PI,X.radDeg=ut.radiansToDegrees,X.degreesToRadians=ut.PI/180,X.degRad=ut.degreesToRadians;var Ne=class{apply(t,i,e){return t+(i-t)*this.applyInternal(e)}},Oe=class extends Ne{constructor(t){super();this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Ue=class extends Oe{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},Yt=class{static arrayCopy(t,i,e,a,r){for(let c=i,n=a;c<i+r;c++,n++)e[n]=t[c]}static arrayFill(t,i,e,a){for(let r=i;r<e;r++)t[r]=a}static setArraySize(t,i,e=0){let a=t.length;if(a==i)return t;if(t.length=i,a<i)for(let r=a;r<i;r++)t[r]=e;return t}static ensureArrayCapacity(t,i,e=0){return t.length>=i?t:Yt.setArraySize(t,i,e)}static newArray(t,i){let e=new Array(t);for(let a=0;a<t;a++)e[a]=i;return e}static newFloatArray(t){if(Yt.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let i=new Array(t);for(let e=0;e<i.length;e++)i[e]=0;return i}}static newShortArray(t){if(Yt.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let i=new Array(t);for(let e=0;e<i.length;e++)i[e]=0;return i}}static toFloatArray(t){return Yt.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return Yt.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,i){}static contains(t,i,e=!0){for(var a=0;a<t.length;a++)if(t[a]==i)return!0;return!1}static enumValue(t,i){return t[i[0].toUpperCase()+i.slice(1)]}},R=Yt;R.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var xs=class{static logBones(t){for(let i=0;i<t.bones.length;i++){let e=t.bones[i];console.log(e.data.name+", "+e.a+", "+e.b+", "+e.c+", "+e.d+", "+e.worldX+", "+e.worldY)}}},Bt=class{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let i=0;i<t.length;i++)this.free(t[i])}clear(){this.items.length=0}},We=class{constructor(t=0,i=0){this.x=t,this.y=i}set(t,i){return this.x=t,this.y=i,this}length(){let t=this.x,i=this.y;return Math.sqrt(t*t+i*i)}normalize(){let t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}},bs=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},ws=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let i=0;i<this.values.length;i++)t+=this.values[i];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}},jt=class{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}},ze=class extends jt{constructor(t){super(t);this.id=ze.nextID++,this.bones=null,this.vertices=null,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVertices(t,i,e,a,r,c){e=r+(e>>1)*c;let n=t.bone.skeleton,s=t.deform,o=this.vertices,l=this.bones;if(!l){s.length>0&&(o=s);let u=t.bone,m=u.worldX,b=u.worldY,p=u.a,y=u.b,g=u.c,w=u.d;for(let x=i,v=r;v<e;x+=2,v+=c){let A=o[x],S=o[x+1];a[v]=A*p+S*y+m,a[v+1]=A*g+S*w+b}return}let h=0,d=0;for(let u=0;u<i;u+=2){let m=l[h];h+=m+1,d+=m}let f=n.bones;if(s.length==0)for(let u=r,m=d*3;u<e;u+=c){let b=0,p=0,y=l[h++];for(y+=h;h<y;h++,m+=3){let g=f[l[h]],w=o[m],x=o[m+1],v=o[m+2];b+=(w*g.a+x*g.b+g.worldX)*v,p+=(w*g.c+x*g.d+g.worldY)*v}a[u]=b,a[u+1]=p}else{let u=s;for(let m=r,b=d*3,p=d<<1;m<e;m+=c){let y=0,g=0,w=l[h++];for(w+=h;h<w;h++,b+=3,p+=2){let x=f[l[h]],v=o[b]+u[p],A=o[b+1]+u[p+1],S=o[b+2];y+=(v*x.a+A*x.b+x.worldX)*S,g+=(v*x.c+A*x.d+x.worldY)*S}a[m]=y,a[m+1]=g}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),R.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices?(t.vertices=R.newFloatArray(this.vertices.length),R.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment}},ct=ze;ct.nextID=0;var Vt=class{constructor(t,i,e){if(this.timelines=null,this.timelineIds=null,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(i),this.duration=e}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds=new Ht;for(var i=0;i<t.length;i++)this.timelineIds.addAll(t[i].getPropertyIds())}hasTimeline(t){for(let i=0;i<t.length;i++)if(this.timelineIds.contains(t[i]))return!0;return!1}apply(t,i,e,a,r,c,n,s){if(!t)throw new Error("skeleton cannot be null.");a&&this.duration!=0&&(e%=this.duration,i>0&&(i%=this.duration));let o=this.timelines;for(let l=0,h=o.length;l<h;l++)o[l].apply(t,i,e,r,c,n,s)}},$;(function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"})($||($={}));var mt;(function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"})(mt||(mt={}));var _={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18},J=class{constructor(t,i){this.propertyIds=null,this.frames=null,this.propertyIds=i,this.frames=R.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,i){let e=t.length;for(let a=1;a<e;a++)if(t[a]>i)return a-1;return e-1}static search(t,i,e){let a=t.length;for(let r=e;r<a;r+=e)if(t[r]>i)return r-e;return a-e}},at=class extends J{constructor(t,i,e){super(t,e);this.curves=null,this.curves=R.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let e=R.newFloatArray(i);R.arrayCopy(this.curves,0,e,0,i),this.curves=e}}setBezier(t,i,e,a,r,c,n,s,o,l,h){let d=this.curves,f=this.getFrameCount()+t*18;e==0&&(d[i]=2+f);let u=(a-c*2+s)*.03,m=(r-n*2+o)*.03,b=((c-s)*3-a+l)*.006,p=((n-o)*3-r+h)*.006,y=u*2+b,g=m*2+p,w=(c-a)*.3+u+b*.16666667,x=(n-r)*.3+m+p*.16666667,v=a+w,A=r+x;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,x+=g,y+=b,g+=p,v+=w,A+=x}getBezierValue(t,i,e,a){let r=this.curves;if(r[a]>t){let o=this.frames[i],l=this.frames[i+e];return l+(t-o)/(r[a]-o)*(r[a+1]-l)}let c=a+18;for(a+=2;a<c;a+=2)if(r[a]>=t){let o=r[a-2],l=r[a-1];return l+(t-o)/(r[a]-o)*(r[a+1]-l)}i+=this.getFrameEntries();let n=r[c-2],s=r[c-1];return s+(t-n)/(this.frames[i]-n)*(this.frames[i+e]-s)}},nt=class extends at{constructor(t,i,e){super(t,i,[e])}getFrameEntries(){return 2}setFrame(t,i,e){t<<=1,this.frames[t]=i,this.frames[t+1]=e}getCurveValue(t){let i=this.frames,e=i.length-2;for(let r=2;r<=e;r+=2)if(i[r]>t){e=r-2;break}let a=this.curves[e>>1];switch(a){case 0:let r=i[e],c=i[e+1];return c+(t-r)/(i[e+2]-r)*(i[e+2+1]-c);case 1:return i[e+1]}return this.getBezierValue(t,e,1,a-2)}},Lt=class extends at{constructor(t,i,e,a){super(t,i,[e,a])}getFrameEntries(){return 3}setFrame(t,i,e,a){t*=3,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a}},Rt=class extends nt{constructor(t,i,e){super(t,i,_.rotate+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.rotation=s.data.rotation;return;case 1:s.rotation+=(s.data.rotation-s.rotation)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.rotation=s.data.rotation+l*r;break;case 1:case 2:l+=s.data.rotation-s.rotation;case 3:s.rotation+=l*r}}},Gt=class extends Lt{constructor(t,i,e){super(t,i,_.x+"|"+e,_.y+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.x=s.data.x,s.y=s.data.y;return;case 1:s.x+=(s.data.x-s.x)*r,s.y+=(s.data.y-s.y)*r}return}let l=0,h=0,d=J.search(o,e,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+3]-u);l+=(o[d+3+1]-l)*m,h+=(o[d+3+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}switch(c){case 0:s.x=s.data.x+l*r,s.y=s.data.y+h*r;break;case 1:case 2:s.x+=(s.data.x+l-s.x)*r,s.y+=(s.data.y+h-s.y)*r;break;case 3:s.x+=l*r,s.y+=h*r}}},$t=class extends nt{constructor(t,i,e){super(t,i,_.x+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.x=s.data.x;return;case 1:s.x+=(s.data.x-s.x)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.x=s.data.x+l*r;break;case 1:case 2:s.x+=(s.data.x+l-s.x)*r;break;case 3:s.x+=l*r}}},Jt=class extends nt{constructor(t,i,e){super(t,i,_.y+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.y=s.data.y;return;case 1:s.y+=(s.data.y-s.y)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.y=s.data.y+l*r;break;case 1:case 2:s.y+=(s.data.y+l-s.y)*r;break;case 3:s.y+=l*r}}},Qt=class extends Lt{constructor(t,i,e){super(t,i,_.scaleX+"|"+e,_.scaleY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.scaleX=s.data.scaleX,s.scaleY=s.data.scaleY;return;case 1:s.scaleX+=(s.data.scaleX-s.scaleX)*r,s.scaleY+=(s.data.scaleY-s.scaleY)*r}return}let l,h,d=J.search(o,e,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+3]-u);l+=(o[d+3+1]-l)*m,h+=(o[d+3+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}if(l*=s.data.scaleX,h*=s.data.scaleY,r==1)c==3?(s.scaleX+=l-s.data.scaleX,s.scaleY+=h-s.data.scaleY):(s.scaleX=l,s.scaleY=h);else{let u=0,m=0;if(n==1)switch(c){case 0:u=s.data.scaleX,m=s.data.scaleY,s.scaleX=u+(Math.abs(l)*X.signum(u)-u)*r,s.scaleY=m+(Math.abs(h)*X.signum(m)-m)*r;break;case 1:case 2:u=s.scaleX,m=s.scaleY,s.scaleX=u+(Math.abs(l)*X.signum(u)-u)*r,s.scaleY=m+(Math.abs(h)*X.signum(m)-m)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r,s.scaleY+=(h-s.data.scaleY)*r}else switch(c){case 0:u=Math.abs(s.data.scaleX)*X.signum(l),m=Math.abs(s.data.scaleY)*X.signum(h),s.scaleX=u+(l-u)*r,s.scaleY=m+(h-m)*r;break;case 1:case 2:u=Math.abs(s.scaleX)*X.signum(l),m=Math.abs(s.scaleY)*X.signum(h),s.scaleX=u+(l-u)*r,s.scaleY=m+(h-m)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r,s.scaleY+=(h-s.data.scaleY)*r}}}},Kt=class extends nt{constructor(t,i,e){super(t,i,_.scaleX+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.scaleX=s.data.scaleX;return;case 1:s.scaleX+=(s.data.scaleX-s.scaleX)*r}return}let l=this.getCurveValue(e)*s.data.scaleX;if(r==1)c==3?s.scaleX+=l-s.data.scaleX:s.scaleX=l;else{let h=0;if(n==1)switch(c){case 0:h=s.data.scaleX,s.scaleX=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 1:case 2:h=s.scaleX,s.scaleX=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r}else switch(c){case 0:h=Math.abs(s.data.scaleX)*X.signum(l),s.scaleX=h+(l-h)*r;break;case 1:case 2:h=Math.abs(s.scaleX)*X.signum(l),s.scaleX=h+(l-h)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r}}}},Zt=class extends nt{constructor(t,i,e){super(t,i,_.scaleY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.scaleY=s.data.scaleY;return;case 1:s.scaleY+=(s.data.scaleY-s.scaleY)*r}return}let l=this.getCurveValue(e)*s.data.scaleY;if(r==1)c==3?s.scaleY+=l-s.data.scaleY:s.scaleY=l;else{let h=0;if(n==1)switch(c){case 0:h=s.data.scaleY,s.scaleY=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 1:case 2:h=s.scaleY,s.scaleY=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 3:s.scaleY+=(l-s.data.scaleY)*r}else switch(c){case 0:h=Math.abs(s.data.scaleY)*X.signum(l),s.scaleY=h+(l-h)*r;break;case 1:case 2:h=Math.abs(s.scaleY)*X.signum(l),s.scaleY=h+(l-h)*r;break;case 3:s.scaleY+=(l-s.data.scaleY)*r}}}},te=class extends Lt{constructor(t,i,e){super(t,i,_.shearX+"|"+e,_.shearY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.shearX=s.data.shearX,s.shearY=s.data.shearY;return;case 1:s.shearX+=(s.data.shearX-s.shearX)*r,s.shearY+=(s.data.shearY-s.shearY)*r}return}let l=0,h=0,d=J.search(o,e,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+3]-u);l+=(o[d+3+1]-l)*m,h+=(o[d+3+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}switch(c){case 0:s.shearX=s.data.shearX+l*r,s.shearY=s.data.shearY+h*r;break;case 1:case 2:s.shearX+=(s.data.shearX+l-s.shearX)*r,s.shearY+=(s.data.shearY+h-s.shearY)*r;break;case 3:s.shearX+=l*r,s.shearY+=h*r}}},ee=class extends nt{constructor(t,i,e){super(t,i,_.shearX+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.shearX=s.data.shearX;return;case 1:s.shearX+=(s.data.shearX-s.shearX)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.shearX=s.data.shearX+l*r;break;case 1:case 2:s.shearX+=(s.data.shearX+l-s.shearX)*r;break;case 3:s.shearX+=l*r}}},se=class extends nt{constructor(t,i,e){super(t,i,_.shearY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.shearY=s.data.shearY;return;case 1:s.shearY+=(s.data.shearY-s.shearY)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.shearY=s.data.shearY+l*r;break;case 1:case 2:s.shearY+=(s.data.shearY+l-s.shearY)*r;break;case 3:s.shearY+=l*r}}},ie=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e,_.alpha+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 5}setFrame(t,i,e,a,r,c){t*=5,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color;if(e<o[0]){let p=s.data.color;switch(c){case 0:l.setFromColor(p);return;case 1:l.add((p.r-l.r)*r,(p.g-l.g)*r,(p.b-l.b)*r,(p.a-l.a)*r)}return}let h=0,d=0,f=0,u=0,m=J.search(o,e,5),b=this.curves[m/5];switch(b){case 0:let p=o[m];h=o[m+1],d=o[m+2],f=o[m+3],u=o[m+4];let y=(e-p)/(o[m+5]-p);h+=(o[m+5+1]-h)*y,d+=(o[m+5+2]-d)*y,f+=(o[m+5+3]-f)*y,u+=(o[m+5+4]-u)*y;break;case 1:h=o[m+1],d=o[m+2],f=o[m+3],u=o[m+4];break;default:h=this.getBezierValue(e,m,1,b-2),d=this.getBezierValue(e,m,2,b+18-2),f=this.getBezierValue(e,m,3,b+18*2-2),u=this.getBezierValue(e,m,4,b+18*3-2)}r==1?l.set(h,d,f,u):(c==0&&l.setFromColor(s.data.color),l.add((h-l.r)*r,(d-l.g)*r,(f-l.b)*r,(u-l.a)*r))}},re=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 4}setFrame(t,i,e,a,r){t<<=2,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color;if(e<o[0]){let b=s.data.color;switch(c){case 0:l.r=b.r,l.g=b.g,l.b=b.b;return;case 1:l.r+=(b.r-l.r)*r,l.g+=(b.g-l.g)*r,l.b+=(b.b-l.b)*r}return}let h=0,d=0,f=0,u=J.search(o,e,4),m=this.curves[u>>2];switch(m){case 0:let b=o[u];h=o[u+1],d=o[u+2],f=o[u+3];let p=(e-b)/(o[u+4]-b);h+=(o[u+4+1]-h)*p,d+=(o[u+4+2]-d)*p,f+=(o[u+4+3]-f)*p;break;case 1:h=o[u+1],d=o[u+2],f=o[u+3];break;default:h=this.getBezierValue(e,u,1,m-2),d=this.getBezierValue(e,u,2,m+18-2),f=this.getBezierValue(e,u,3,m+18*2-2)}if(r==1)l.r=h,l.g=d,l.b=f;else{if(c==0){let b=s.data.color;l.r=b.r,l.g=b.g,l.b=b.b}l.r+=(h-l.r)*r,l.g+=(d-l.g)*r,l.b+=(f-l.b)*r}}},ae=class extends nt{constructor(t,i,e){super(t,i,_.alpha+"|"+e);this.slotIndex=0,this.slotIndex=e}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=s.color;if(e<this.frames[0]){let h=s.data.color;switch(c){case 0:o.a=h.a;return;case 1:o.a+=(h.a-o.a)*r}return}let l=this.getCurveValue(e);r==1?o.a=l:(c==0&&(o.a=s.data.color.a),o.a+=(l-o.a)*r)}},ne=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e,_.alpha+"|"+e,_.rgb2+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 8}setFrame(t,i,e,a,r,c,n,s,o){t<<=3,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c,this.frames[t+5]=n,this.frames[t+6]=s,this.frames[t+7]=o}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color,h=s.darkColor;if(e<o[0]){let x=s.data.color,v=s.data.darkColor;switch(c){case 0:l.setFromColor(x),h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:l.add((x.r-l.r)*r,(x.g-l.g)*r,(x.b-l.b)*r,(x.a-l.a)*r),h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,m=0,b=0,p=0,y=0,g=J.search(o,e,8),w=this.curves[g>>3];switch(w){case 0:let x=o[g];d=o[g+1],f=o[g+2],u=o[g+3],m=o[g+4],b=o[g+5],p=o[g+6],y=o[g+7];let v=(e-x)/(o[g+8]-x);d+=(o[g+8+1]-d)*v,f+=(o[g+8+2]-f)*v,u+=(o[g+8+3]-u)*v,m+=(o[g+8+4]-m)*v,b+=(o[g+8+5]-b)*v,p+=(o[g+8+6]-p)*v,y+=(o[g+8+7]-y)*v;break;case 1:d=o[g+1],f=o[g+2],u=o[g+3],m=o[g+4],b=o[g+5],p=o[g+6],y=o[g+7];break;default:d=this.getBezierValue(e,g,1,w-2),f=this.getBezierValue(e,g,2,w+18-2),u=this.getBezierValue(e,g,3,w+18*2-2),m=this.getBezierValue(e,g,4,w+18*3-2),b=this.getBezierValue(e,g,5,w+18*4-2),p=this.getBezierValue(e,g,6,w+18*5-2),y=this.getBezierValue(e,g,7,w+18*6-2)}if(r==1)l.set(d,f,u,m),h.r=b,h.g=p,h.b=y;else{if(c==0){l.setFromColor(s.data.color);let x=s.data.darkColor;h.r=x.r,h.g=x.g,h.b=x.b}l.add((d-l.r)*r,(f-l.g)*r,(u-l.b)*r,(m-l.a)*r),h.r+=(b-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},le=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e,_.rgb2+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 7}setFrame(t,i,e,a,r,c,n,s){t*=7,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c,this.frames[t+5]=n,this.frames[t+6]=s}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color,h=s.darkColor;if(e<o[0]){let x=s.data.color,v=s.data.darkColor;switch(c){case 0:l.r=x.r,l.g=x.g,l.b=x.b,h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:l.r+=(x.r-l.r)*r,l.g+=(x.g-l.g)*r,l.b+=(x.b-l.b)*r,h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,m=0,b=0,p=0,y=0,g=J.search(o,e,7),w=this.curves[g/7];switch(w){case 0:let x=o[g];d=o[g+1],f=o[g+2],u=o[g+3],b=o[g+4],p=o[g+5],y=o[g+6];let v=(e-x)/(o[g+7]-x);d+=(o[g+7+1]-d)*v,f+=(o[g+7+2]-f)*v,u+=(o[g+7+3]-u)*v,b+=(o[g+7+4]-b)*v,p+=(o[g+7+5]-p)*v,y+=(o[g+7+6]-y)*v;break;case 1:d=o[g+1],f=o[g+2],u=o[g+3],b=o[g+4],p=o[g+5],y=o[g+6];break;default:d=this.getBezierValue(e,g,1,w-2),f=this.getBezierValue(e,g,2,w+18-2),u=this.getBezierValue(e,g,3,w+18*2-2),b=this.getBezierValue(e,g,4,w+18*3-2),p=this.getBezierValue(e,g,5,w+18*4-2),y=this.getBezierValue(e,g,6,w+18*5-2)}if(r==1)l.r=d,l.g=f,l.b=u,h.r=b,h.g=p,h.b=y;else{if(c==0){let x=s.data.color,v=s.data.darkColor;l.r=x.r,l.g=x.g,l.b=x.b,h.r=v.r,h.g=v.g,h.b=v.b}l.r+=(d-l.r)*r,l.g+=(f-l.g)*r,l.b+=(u-l.b)*r,h.r+=(b-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},yt=class extends J{constructor(t,i){super(t,[_.attachment+"|"+i]);this.slotIndex=0,this.slotIndex=i,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,e){this.frames[t]=i,this.attachmentNames[t]=e}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!!s.bone.active){if(n==1){c==0&&this.setAttachment(t,s,s.data.attachmentName);return}if(e<this.frames[0]){(c==0||c==1)&&this.setAttachment(t,s,s.data.attachmentName);return}this.setAttachment(t,s,this.attachmentNames[J.search1(this.frames,e)])}}setAttachment(t,i,e){i.setAttachment(e?t.getAttachment(this.slotIndex,e):null)}},oe=class extends at{constructor(t,i,e,a){super(t,i,[_.deform+"|"+e+"|"+a.id]);this.slotIndex=0,this.attachment=null,this.vertices=null,this.slotIndex=e,this.attachment=a,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,e){this.frames[t]=i,this.vertices[t]=e}setBezier(t,i,e,a,r,c,n,s,o,l,h){let d=this.curves,f=this.getFrameCount()+t*18;e==0&&(d[i]=2+f);let u=(a-c*2+s)*.03,m=o*.03-n*.06,b=((c-s)*3-a+l)*.006,p=(n-o+.33333333)*.018,y=u*2+b,g=m*2+p,w=(c-a)*.3+u+b*.16666667,x=n*.3+m+p*.16666667,v=a+w,A=x;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,x+=g,y+=b,g+=p,v+=w,A+=x}getCurvePercent(t,i){let e=this.curves,a=e[i];switch(a){case 0:let s=this.frames[i];return(t-s)/(this.frames[i+this.getFrameEntries()]-s);case 1:return 0}if(a-=2,e[a]>t){let s=this.frames[i];return e[a+1]*(t-s)/(e[a]-s)}let r=a+18;for(a+=2;a<r;a+=2)if(e[a]>=t){let s=e[a-2],o=e[a-1];return o+(t-s)/(e[a]-s)*(e[a+1]-o)}let c=e[r-2],n=e[r-1];return n+(1-n)*(t-c)/(this.frames[i+this.getFrameEntries()]-c)}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=s.getAttachment();if(!(o instanceof ct)||o.deformAttachment!=this.attachment)return;let l=s.deform;l.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(e<f[0]){let g=o;switch(c){case 0:l.length=0;return;case 1:if(r==1){l.length=0;return}if(l.length=d,g.bones){r=1-r;for(var u=0;u<d;u++)l[u]*=r}else{let w=g.vertices;for(var u=0;u<d;u++)l[u]+=(w[u]-l[u])*r}}return}if(l.length=d,e>=f[f.length-1]){let g=h[f.length-1];if(r==1)if(c==3){let w=o;if(w.bones)for(let x=0;x<d;x++)l[x]+=g[x];else{let x=w.vertices;for(let v=0;v<d;v++)l[v]+=g[v]-x[v]}}else R.arrayCopy(g,0,l,0,d);else switch(c){case 0:{let x=o;if(x.bones)for(let v=0;v<d;v++)l[v]=g[v]*r;else{let v=x.vertices;for(let A=0;A<d;A++){let S=v[A];l[A]=S+(g[A]-S)*r}}break}case 1:case 2:for(let x=0;x<d;x++)l[x]+=(g[x]-l[x])*r;break;case 3:let w=o;if(w.bones)for(let x=0;x<d;x++)l[x]+=g[x]*r;else{let x=w.vertices;for(let v=0;v<d;v++)l[v]+=(g[v]-x[v])*r}}return}let m=J.search1(f,e),b=this.getCurvePercent(e,m),p=h[m],y=h[m+1];if(r==1)if(c==3){let g=o;if(g.bones)for(let w=0;w<d;w++){let x=p[w];l[w]+=x+(y[w]-x)*b}else{let w=g.vertices;for(let x=0;x<d;x++){let v=p[x];l[x]+=v+(y[x]-v)*b-w[x]}}}else for(let g=0;g<d;g++){let w=p[g];l[g]=w+(y[g]-w)*b}else switch(c){case 0:{let w=o;if(w.bones)for(let x=0;x<d;x++){let v=p[x];l[x]=(v+(y[x]-v)*b)*r}else{let x=w.vertices;for(let v=0;v<d;v++){let A=p[v],S=x[v];l[v]=S+(A+(y[v]-A)*b-S)*r}}break}case 1:case 2:for(let w=0;w<d;w++){let x=p[w];l[w]+=(x+(y[w]-x)*b-l[w])*r}break;case 3:let g=o;if(g.bones)for(let w=0;w<d;w++){let x=p[w];l[w]+=(x+(y[w]-x)*b)*r}else{let w=g.vertices;for(let x=0;x<d;x++){let v=p[x];l[x]+=(v+(y[x]-v)*b-w[x])*r}}}}},qe=class extends J{constructor(t){super(t,qe.propertyIds);this.events=null,this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,e,a,r,c,n){if(!a)return;let s=this.frames,o=this.frames.length;if(i>e)this.apply(t,i,Number.MAX_VALUE,a,r,c,n),i=-1;else if(i>=s[o-1])return;if(e<s[0])return;let l=0;if(i<s[0])l=0;else{l=J.search1(s,i)+1;let h=s[l];for(;l>0&&s[l-1]==h;)l--}for(;l<o&&e>=s[l];l++)a.push(this.events[l])}},Pt=qe;Pt.propertyIds=[""+_.event];var _e=class extends J{constructor(t){super(t,_e.propertyIds);this.drawOrders=null,this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,e){this.frames[t]=i,this.drawOrders[t]=e}apply(t,i,e,a,r,c,n){if(n==1){c==0&&R.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(e<this.frames[0]){(c==0||c==1)&&R.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let s=this.drawOrders[J.search1(this.frames,e)];if(!s)R.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let o=t.drawOrder,l=t.slots;for(let h=0,d=s.length;h<d;h++)o[h]=l[s[h]]}}},vt=_e;vt.propertyIds=[""+_.drawOrder];var he=class extends at{constructor(t,i,e){super(t,i,[_.ikConstraint+"|"+e]);this.ikConstraintIndex=0,this.ikConstraintIndex=e}getFrameEntries(){return 6}setFrame(t,i,e,a,r,c,n){t*=6,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c?1:0,this.frames[t+5]=n?1:0}apply(t,i,e,a,r,c,n){let s=t.ikConstraints[this.ikConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.mix=s.data.mix,s.softness=s.data.softness,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch;return;case 1:s.mix+=(s.data.mix-s.mix)*r,s.softness+=(s.data.softness-s.softness)*r,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch}return}let l=0,h=0,d=J.search(o,e,6),f=this.curves[d/6];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+6]-u);l+=(o[d+6+1]-l)*m,h+=(o[d+6+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}c==0?(s.mix=s.data.mix+(l-s.data.mix)*r,s.softness=s.data.softness+(h-s.data.softness)*r,n==1?(s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch):(s.bendDirection=o[d+3],s.compress=o[d+4]!=0,s.stretch=o[d+5]!=0)):(s.mix+=(l-s.mix)*r,s.softness+=(h-s.softness)*r,n==0&&(s.bendDirection=o[d+3],s.compress=o[d+4]!=0,s.stretch=o[d+5]!=0))}},ce=class extends at{constructor(t,i,e){super(t,i,[_.transformConstraint+"|"+e]);this.transformConstraintIndex=0,this.transformConstraintIndex=e}getFrameEntries(){return 7}setFrame(t,i,e,a,r,c,n,s){let o=this.frames;t*=7,o[t]=i,o[t+1]=e,o[t+2]=a,o[t+3]=r,o[t+4]=c,o[t+5]=n,o[t+6]=s}apply(t,i,e,a,r,c,n){let s=t.transformConstraints[this.transformConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){let y=s.data;switch(c){case 0:s.mixRotate=y.mixRotate,s.mixX=y.mixX,s.mixY=y.mixY,s.mixScaleX=y.mixScaleX,s.mixScaleY=y.mixScaleY,s.mixShearY=y.mixShearY;return;case 1:s.mixRotate+=(y.mixRotate-s.mixRotate)*r,s.mixX+=(y.mixX-s.mixX)*r,s.mixY+=(y.mixY-s.mixY)*r,s.mixScaleX+=(y.mixScaleX-s.mixScaleX)*r,s.mixScaleY+=(y.mixScaleY-s.mixScaleY)*r,s.mixShearY+=(y.mixShearY-s.mixShearY)*r}return}let l,h,d,f,u,m,b=J.search(o,e,7),p=this.curves[b/7];switch(p){case 0:let y=o[b];l=o[b+1],h=o[b+2],d=o[b+3],f=o[b+4],u=o[b+5],m=o[b+6];let g=(e-y)/(o[b+7]-y);l+=(o[b+7+1]-l)*g,h+=(o[b+7+2]-h)*g,d+=(o[b+7+3]-d)*g,f+=(o[b+7+4]-f)*g,u+=(o[b+7+5]-u)*g,m+=(o[b+7+6]-m)*g;break;case 1:l=o[b+1],h=o[b+2],d=o[b+3],f=o[b+4],u=o[b+5],m=o[b+6];break;default:l=this.getBezierValue(e,b,1,p-2),h=this.getBezierValue(e,b,2,p+18-2),d=this.getBezierValue(e,b,3,p+18*2-2),f=this.getBezierValue(e,b,4,p+18*3-2),u=this.getBezierValue(e,b,5,p+18*4-2),m=this.getBezierValue(e,b,6,p+18*5-2)}if(c==0){let y=s.data;s.mixRotate=y.mixRotate+(l-y.mixRotate)*r,s.mixX=y.mixX+(h-y.mixX)*r,s.mixY=y.mixY+(d-y.mixY)*r,s.mixScaleX=y.mixScaleX+(f-y.mixScaleX)*r,s.mixScaleY=y.mixScaleY+(u-y.mixScaleY)*r,s.mixShearY=y.mixShearY+(m-y.mixShearY)*r}else s.mixRotate+=(l-s.mixRotate)*r,s.mixX+=(h-s.mixX)*r,s.mixY+=(d-s.mixY)*r,s.mixScaleX+=(f-s.mixScaleX)*r,s.mixScaleY+=(u-s.mixScaleY)*r,s.mixShearY+=(m-s.mixShearY)*r}},de=class extends nt{constructor(t,i,e){super(t,i,_.pathConstraintPosition+"|"+e);this.pathConstraintIndex=0,this.pathConstraintIndex=e}apply(t,i,e,a,r,c,n){let s=t.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.position=s.data.position;return;case 1:s.position+=(s.data.position-s.position)*r}return}let l=this.getCurveValue(e);c==0?s.position=s.data.position+(l-s.data.position)*r:s.position+=(l-s.position)*r}},fe=class extends nt{constructor(t,i,e){super(t,i,_.pathConstraintSpacing+"|"+e);this.pathConstraintIndex=0,this.pathConstraintIndex=e}apply(t,i,e,a,r,c,n){let s=t.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.spacing=s.data.spacing;return;case 1:s.spacing+=(s.data.spacing-s.spacing)*r}return}let l=this.getCurveValue(e);c==0?s.spacing=s.data.spacing+(l-s.data.spacing)*r:s.spacing+=(l-s.spacing)*r}},ue=class extends at{constructor(t,i,e){super(t,i,[_.pathConstraintMix+"|"+e]);this.pathConstraintIndex=0,this.pathConstraintIndex=e}getFrameEntries(){return 4}setFrame(t,i,e,a,r){let c=this.frames;t<<=2,c[t]=i,c[t+1]=e,c[t+2]=a,c[t+3]=r}apply(t,i,e,a,r,c,n){let s=t.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.mixRotate=s.data.mixRotate,s.mixX=s.data.mixX,s.mixY=s.data.mixY;return;case 1:s.mixRotate+=(s.data.mixRotate-s.mixRotate)*r,s.mixX+=(s.data.mixX-s.mixX)*r,s.mixY+=(s.data.mixY-s.mixY)*r}return}let l,h,d,f=J.search(o,e,4),u=this.curves[f>>2];switch(u){case 0:let m=o[f];l=o[f+1],h=o[f+2],d=o[f+3];let b=(e-m)/(o[f+4]-m);l+=(o[f+4+1]-l)*b,h+=(o[f+4+2]-h)*b,d+=(o[f+4+3]-d)*b;break;case 1:l=o[f+1],h=o[f+2],d=o[f+3];break;default:l=this.getBezierValue(e,f,1,u-2),h=this.getBezierValue(e,f,2,u+18-2),d=this.getBezierValue(e,f,3,u+18*2-2)}if(c==0){let m=s.data;s.mixRotate=m.mixRotate+(l-m.mixRotate)*r,s.mixX=m.mixX+(h-m.mixX)*r,s.mixY=m.mixY+(d-m.mixY)*r}else s.mixRotate+=(l-s.mixRotate)*r,s.mixX+=(h-s.mixX)*r,s.mixY+=(d-s.mixY)*r}},me=class{constructor(t){this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new je(this),this.propertyIDs=new Ht,this.animationsChanged=!1,this.trackEntryPool=new Bt(()=>new He),this.data=t}static emptyAnimation(){return we||(we=new Vt("<empty>",[],0)),we}update(t){t*=this.timeScale;let i=this.tracks;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let c=t*r.timeScale;if(r.delay>0){if(r.delay-=c,r.delay>0)continue;c=-r.delay,r.delay=0}let n=r.next;if(n){let s=r.trackLast-n.delay;if(s>=0){for(n.delay=0,n.trackTime+=r.timeScale==0?0:(s/r.timeScale+t)*n.timeScale,r.trackTime+=c,this.setCurrent(e,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){i[e]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){let s=r.mixingFrom;for(r.mixingFrom=null,s&&(s.mixingTo=null);s;)this.queue.end(s),s=s.mixingFrom}r.trackTime+=c}this.queue.drain()}updateMixingFrom(t,i){let e=t.mixingFrom;if(!e)return!0;let a=this.updateMixingFrom(e,i);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?((e.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=e.mixingFrom,e.mixingFrom&&(e.mixingFrom.mixingTo=t),t.interruptAlpha=e.interruptAlpha,this.queue.end(e)),a):(e.trackTime+=i*e.timeScale,t.mixTime+=i,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let i=this.events,e=this.tracks,a=!1;for(let d=0,f=e.length;d<f;d++){let u=e[d];if(!u||u.delay>0)continue;a=!0;let m=d==0?$.first:u.mixBlend,b=u.alpha;u.mixingFrom?b*=this.applyMixingFrom(u,t,m):u.trackTime>=u.trackEnd&&!u.next&&(b=0);let p=u.animationLast,y=u.getAnimationTime(),g=y,w=i;u.reverse&&(g=u.animation.duration-g,w=null);let x=u.animation.timelines,v=x.length;if(d==0&&b==1||m==$.add)for(let A=0;A<v;A++){R.webkit602BugfixHelper(b,m);var r=x[A];r instanceof yt?this.applyAttachmentTimeline(r,t,g,m,!0):r.apply(t,p,g,w,b,m,mt.mixIn)}else{let A=u.timelineMode,S=u.timelinesRotation.length!=v<<1;S&&(u.timelinesRotation.length=v<<1);for(let I=0;I<v;I++){let C=x[I],F=A[I]==Dt?m:$.setup;C instanceof Rt?this.applyRotateTimeline(C,t,g,b,F,u.timelinesRotation,I<<1,S):C instanceof yt?this.applyAttachmentTimeline(C,t,g,m,!0):(R.webkit602BugfixHelper(b,m),C.apply(t,p,g,w,b,F,mt.mixIn))}}this.queueEvents(u,y),i.length=0,u.nextAnimationLast=y,u.nextTrackLast=u.trackTime}for(var c=this.unkeyedState+be,n=t.slots,s=0,o=t.slots.length;s<o;s++){var l=n[s];if(l.attachmentState==c){var h=l.data.attachmentName;l.setAttachment(h?t.getAttachment(l.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),a}applyMixingFrom(t,i,e){let a=t.mixingFrom;a.mixingFrom&&this.applyMixingFrom(a,i,e);let r=0;t.mixDuration==0?(r=1,e==$.first&&(e=$.setup)):(r=t.mixTime/t.mixDuration,r>1&&(r=1),e!=$.first&&(e=a.mixBlend));let c=r<a.attachmentThreshold,n=r<a.drawOrderThreshold,s=a.animation.timelines,o=s.length,l=a.alpha*t.interruptAlpha,h=l*(1-r),d=a.animationLast,f=a.getAnimationTime(),u=f,m=null;if(a.reverse?u=a.animation.duration-u:r<a.eventThreshold&&(m=this.events),e==$.add)for(let b=0;b<o;b++)s[b].apply(i,d,u,m,h,e,mt.mixOut);else{let b=a.timelineMode,p=a.timelineHoldMix,y=a.timelinesRotation.length!=o<<1;y&&(a.timelinesRotation.length=o<<1),a.totalAlpha=0;for(let g=0;g<o;g++){let w=s[g],x=mt.mixOut,v,A=0;switch(b[g]){case Dt:if(!n&&w instanceof vt)continue;v=e,A=h;break;case ge:v=$.setup,A=h;break;case xe:v=e,A=l;break;case Nt:v=$.setup,A=l;break;default:v=$.setup;let S=p[g];A=l*Math.max(0,1-S.mixTime/S.mixDuration);break}a.totalAlpha+=A,w instanceof Rt?this.applyRotateTimeline(w,i,u,A,v,a.timelinesRotation,g<<1,y):w instanceof yt?this.applyAttachmentTimeline(w,i,u,v,c):(R.webkit602BugfixHelper(A,e),n&&w instanceof vt&&v==$.setup&&(x=mt.mixIn),w.apply(i,d,u,m,A,v,x))}}return t.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(t,i,e,a,r){var c=i.slots[t.slotIndex];!c.bone.active||(e<t.frames[0]?(a==$.setup||a==$.first)&&this.setAttachment(i,c,c.data.attachmentName,r):this.setAttachment(i,c,t.attachmentNames[J.search1(t.frames,e)],r),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+be))}setAttachment(t,i,e,a){i.setAttachment(e?t.getAttachment(i.data.index,e):null),a&&(i.attachmentState=this.unkeyedState+$e)}applyRotateTimeline(t,i,e,a,r,c,n,s){if(s&&(c[n]=0),a==1){t.apply(i,0,e,null,1,r,mt.mixIn);return}let o=i.bones[t.boneIndex];if(!o.active)return;let l=t.frames,h=0,d=0;if(e<l[0])switch(r){case $.setup:o.rotation=o.data.rotation;default:return;case $.first:h=o.rotation,d=o.data.rotation}else h=r==$.setup?o.data.rotation:o.rotation,d=o.data.rotation+t.getCurveValue(e);let f=0,u=d-h;if(u-=(16384-(16384.499999999996-u/360|0))*360,u==0)f=c[n];else{let m=0,b=0;s?(m=0,b=u):(m=c[n],b=c[n+1]);let p=u>0,y=m>=0;X.signum(b)!=X.signum(u)&&Math.abs(b)<=90&&(Math.abs(m)>180&&(m+=360*X.signum(m)),y=p),f=u+m-m%360,y!=p&&(f+=360*X.signum(m)),c[n]=f}c[n+1]=u,o.rotation=h+f*a}queueEvents(t,i){let e=t.animationStart,a=t.animationEnd,r=a-e,c=t.trackLast%r,n=this.events,s=0,o=n.length;for(;s<o;s++){let h=n[s];if(h.time<c)break;h.time>a||this.queue.event(t,h)}let l=!1;for(t.loop?l=r==0||c>t.trackTime%r:l=i>=a&&t.animationLast<a,l&&this.queue.complete(t);s<o;s++){let h=n[s];h.time<e||this.queue.event(t,h)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,e=this.tracks.length;i<e;i++)this.clearTrack(i);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let i=this.tracks[t];if(!i)return;this.queue.end(i),this.clearNext(i);let e=i;for(;;){let a=e.mixingFrom;if(!a)break;this.queue.end(a),e.mixingFrom=null,e.mixingTo=null,e=a}this.tracks[i.trackIndex]=null,this.queue.drain()}setCurrent(t,i,e){let a=this.expandToIndex(t);this.tracks[t]=i,i.previous=null,a&&(e&&this.queue.interrupt(a),i.mixingFrom=a,a.mixingTo=i,i.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(i.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(i)}setAnimation(t,i,e=!1){let a=this.data.skeletonData.findAnimation(i);if(!a)throw new Error("Animation not found: "+i);return this.setAnimationWith(t,a,e)}setAnimationWith(t,i,e=!1){if(!i)throw new Error("animation cannot be null.");let a=!0,r=this.expandToIndex(t);r&&(r.nextTrackLast==-1?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));let c=this.trackEntry(t,i,e,r);return this.setCurrent(t,c,a),this.queue.drain(),c}addAnimation(t,i,e=!1,a=0){let r=this.data.skeletonData.findAnimation(i);if(!r)throw new Error("Animation not found: "+i);return this.addAnimationWith(t,r,e,a)}addAnimationWith(t,i,e=!1,a=0){if(!i)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let c=this.trackEntry(t,i,e,r);return r?(r.next=c,c.previous=r,a<=0&&(a+=r.getTrackComplete()-c.mixDuration)):(this.setCurrent(t,c,!0),this.queue.drain()),c.delay=a,c}setEmptyAnimation(t,i=0){let e=this.setAnimationWith(t,me.emptyAnimation(),!1);return e.mixDuration=i,e.trackEnd=i,e}addEmptyAnimation(t,i=0,e=0){let a=this.addAnimationWith(t,me.emptyAnimation(),!1,e);return e<=0&&(a.delay+=a.mixDuration-i),a.mixDuration=i,a.trackEnd=i,a}setEmptyAnimations(t=0){let i=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,a=this.tracks.length;e<a;e++){let r=this.tracks[e];r&&this.setEmptyAnimation(r.trackIndex,t)}this.queue.drainDisabled=i,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(R.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,i,e,a){let r=this.trackEntryPool.obtain();return r.reset(),r.trackIndex=t,r.animation=i,r.loop=e,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=i.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=a?this.data.getMix(a.animation,i):0,r.mixBlend=$.replace,r}clearNext(t){let i=t.next;for(;i;)this.queue.dispose(i),i=i.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let i=0,e=t.length;i<e;i++){let a=t[i];if(!!a){for(;a.mixingFrom;)a=a.mixingFrom;do(!a.mixingTo||a.mixBlend!=$.add)&&this.computeHold(a),a=a.mixingTo;while(a)}}}computeHold(t){let i=t.mixingTo,e=t.animation.timelines,a=t.animation.timelines.length,r=t.timelineMode;r.length=a;let c=t.timelineHoldMix;c.length=0;let n=this.propertyIDs;if(i&&i.holdPrevious){for(let s=0;s<a;s++)r[s]=n.addAll(e[s].getPropertyIds())?Nt:xe;return}t:for(let s=0;s<a;s++){let o=e[s],l=o.getPropertyIds();if(!n.addAll(l))r[s]=Dt;else if(!i||o instanceof yt||o instanceof vt||o instanceof Pt||!i.animation.hasTimeline(l))r[s]=ge;else{for(let h=i.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(l)){if(t.mixDuration>0){r[s]=Ge,c[s]=h;continue t}break}r[s]=Nt}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let i=this.listeners.indexOf(t);i>=0&&this.listeners.splice(i,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},He=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=$.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return t==0?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(t!=0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}},je=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=null,this.animState=t}start(t){this.objects.push(tt.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(tt.interrupt),this.objects.push(t)}end(t){this.objects.push(tt.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(tt.dispose),this.objects.push(t)}complete(t){this.objects.push(tt.complete),this.objects.push(t)}event(t,i){this.objects.push(tt.event),this.objects.push(t),this.objects.push(i)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,i=this.animState.listeners;for(let e=0;e<t.length;e+=2){let a=t[e],r=t[e+1];switch(a){case tt.start:r.listener&&r.listener.start&&r.listener.start(r);for(let n=0;n<i.length;n++)i[n].start&&i[n].start(r);break;case tt.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let n=0;n<i.length;n++)i[n].interrupt&&i[n].interrupt(r);break;case tt.end:r.listener&&r.listener.end&&r.listener.end(r);for(let n=0;n<i.length;n++)i[n].end&&i[n].end(r);case tt.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let n=0;n<i.length;n++)i[n].dispose&&i[n].dispose(r);this.animState.trackEntryPool.free(r);break;case tt.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let n=0;n<i.length;n++)i[n].complete&&i[n].complete(r);break;case tt.event:let c=t[e+++2];r.listener&&r.listener.event&&r.listener.event(r,c);for(let n=0;n<i.length;n++)i[n].event&&i[n].event(r,c);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},tt;(function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"})(tt||(tt={}));var ps=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,i){}},Dt=0,ge=1,xe=2,Nt=3,Ge=4,be=1,$e=2,we=null,ys=class{constructor(t){if(this.skeletonData=null,this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,i,e){let a=this.skeletonData.findAnimation(t);if(!a)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(i);if(!r)throw new Error("Animation not found: "+i);this.setMixWith(a,r,e)}setMixWith(t,i,e){if(!t)throw new Error("from cannot be null.");if(!i)throw new Error("to cannot be null.");let a=t.name+"."+i.name;this.animationToMixTime[a]=e}getMix(t,i){let e=t.name+"."+i.name,a=this.animationToMixTime[e];return a===void 0?this.defaultMix:a}},Ot=class extends ct{constructor(t){super(t);this.color=new L(1,1,1,1)}copy(){let t=new Ot(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},pe=class extends ct{constructor(t){super(t);this.endSlot=null,this.color=new L(.2275,.2275,.8078,1)}copy(){let t=new pe(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},Je=class{constructor(t){this._image=t}getImage(){return this._image}},St;(function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"})(St||(St={}));var At;(function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"})(At||(At={}));var Qe=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},vs=class extends Je{setFilters(t,i){}setWraps(t,i){}dispose(){}},Ke=class{constructor(t){this.pages=new Array,this.regions=new Array;let i=new Ss(t),e=new Array(4),a=null,r=null,c={};c.size=()=>{a.width=parseInt(e[1]),a.height=parseInt(e[2])},c.format=()=>{},c.filter=()=>{a.minFilter=R.enumValue(St,e[1]),a.magFilter=R.enumValue(St,e[2])},c.repeat=()=>{e[1].indexOf("x")!=-1&&(a.uWrap=At.Repeat),e[1].indexOf("y")!=-1&&(a.vWrap=At.Repeat)},c.pma=()=>{a.pma=e[1]=="true"};var n={};n.xy=()=>{r.x=parseInt(e[1]),r.y=parseInt(e[2])},n.size=()=>{r.width=parseInt(e[1]),r.height=parseInt(e[2])},n.bounds=()=>{r.x=parseInt(e[1]),r.y=parseInt(e[2]),r.width=parseInt(e[3]),r.height=parseInt(e[4])},n.offset=()=>{r.offsetX=parseInt(e[1]),r.offsetY=parseInt(e[2])},n.orig=()=>{r.originalWidth=parseInt(e[1]),r.originalHeight=parseInt(e[2])},n.offsets=()=>{r.offsetX=parseInt(e[1]),r.offsetY=parseInt(e[2]),r.originalWidth=parseInt(e[3]),r.originalHeight=parseInt(e[4])},n.rotate=()=>{let h=e[1];h=="true"?r.degrees=90:h!="false"&&(r.degrees=parseInt(h))},n.index=()=>{r.index=parseInt(e[1])};let s=i.readLine();for(;s&&s.trim().length==0;)s=i.readLine();for(;!(!s||s.trim().length==0||i.readEntry(e,s)==0);)s=i.readLine();let o=null,l=null;for(;s!==null;)if(s.trim().length==0)a=null,s=i.readLine();else if(a){for(r=new ye,r.page=a,r.name=s;;){let h=i.readEntry(e,s=i.readLine());if(h==0)break;let d=n[e[0]];if(d)d();else{o||(o=[],l=[]),o.push(e[0]);let f=[];for(let u=0;u<h;u++)f.push(parseInt(e[u+1]));l.push(f)}}r.originalWidth==0&&r.originalHeight==0&&(r.originalWidth=r.width,r.originalHeight=r.height),o&&o.length>0&&(r.names=o,r.values=l,o=null,l=null),r.u=r.x/a.width,r.v=r.y/a.height,r.degrees==90?(r.u2=(r.x+r.height)/a.width,r.v2=(r.y+r.width)/a.height):(r.u2=(r.x+r.width)/a.width,r.v2=(r.y+r.height)/a.height),this.regions.push(r)}else{for(a=new Ze,a.name=s.trim();i.readEntry(e,s=i.readLine())!=0;){let h=c[e[0]];h&&h()}this.pages.push(a)}}findRegion(t){for(let i=0;i<this.regions.length;i++)if(this.regions[i].name==t)return this.regions[i];return null}setTextures(t,i=""){for(let e of this.pages)e.setTexture(t.get(i+e.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()}},Ss=class{constructor(t){this.lines=null,this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,i){if(!i||(i=i.trim(),i.length==0))return 0;let e=i.indexOf(":");if(e==-1)return 0;t[0]=i.substr(0,e).trim();for(let a=1,r=e+1;;a++){let c=i.indexOf(",",r);if(c==-1)return t[a]=i.substr(r).trim(),a;if(t[a]=i.substr(r,c-r).trim(),r=c+1,a==4)return 4}}},Ze=class{constructor(){this.name=null,this.minFilter=St.Nearest,this.magFilter=St.Nearest,this.uWrap=At.ClampToEdge,this.vWrap=At.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},ye=class extends Qe{constructor(){super(...arguments);this.page=null,this.name=null,this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null}},Ct=class extends ct{constructor(t){super(t);this.region=null,this.path=null,this.regionUVs=null,this.uvs=null,this.triangles=null,this.color=new L(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=null,this.parentMesh=null,this.tempColor=new L(0,0,0,0)}updateUVs(){let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=R.newFloatArray(t.length));let i=this.uvs,e=this.uvs.length,a=this.region.u,r=this.region.v,c=0,n=0;if(this.region instanceof ye){let s=this.region,o=s.page.texture.getImage(),l=o.width,h=o.height;switch(s.degrees){case 90:a-=(s.originalHeight-s.offsetY-s.height)/l,r-=(s.originalWidth-s.offsetX-s.width)/h,c=s.originalHeight/l,n=s.originalWidth/h;for(let d=0;d<e;d+=2)i[d]=a+t[d+1]*c,i[d+1]=r+(1-t[d])*n;return;case 180:a-=(s.originalWidth-s.offsetX-s.width)/l,r-=s.offsetY/h,c=s.originalWidth/l,n=s.originalHeight/h;for(let d=0;d<e;d+=2)i[d]=a+(1-t[d])*c,i[d+1]=r+(1-t[d+1])*n;return;case 270:a-=s.offsetY/l,r-=s.offsetX/h,c=s.originalHeight/l,n=s.originalWidth/h;for(let d=0;d<e;d+=2)i[d]=a+(1-t[d+1])*c,i[d+1]=r+t[d]*n;return}a-=s.offsetX/l,r-=(s.originalHeight-s.offsetY-s.height)/h,c=s.originalWidth/l,n=s.originalHeight/h}else this.region?(c=this.region.u2-a,n=this.region.v2-r):(a=r=0,c=n=1);for(let s=0;s<e;s+=2)i[s]=a+t[s]*c,i[s+1]=r+t[s+1]*n}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new Ct(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),R.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),R.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),R.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges&&(t.edges=new Array(this.edges.length),R.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){let t=new Ct(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.updateUVs(),t}},It=class extends ct{constructor(t){super(t);this.lengths=null,this.closed=!1,this.constantSpeed=!1,this.color=new L(1,1,1,1)}copy(){let t=new It(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),R.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},ve=class extends ct{constructor(t){super(t);this.x=0,this.y=0,this.rotation=0,this.color=new L(.38,.94,0,1)}computeWorldPosition(t,i){return i.x=this.x*t.a+this.y*t.b+t.worldX,i.y=this.x*t.c+this.y*t.d+t.worldY,i}computeWorldRotation(t){let i=X.cosDeg(this.rotation),e=X.sinDeg(this.rotation),a=i*t.a+e*t.b,r=i*t.c+e*t.d;return Math.atan2(r,a)*X.radDeg}copy(){let t=new ve(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},ts=class extends jt{constructor(t){super(t);this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new L(1,1,1,1),this.path=null,this.rendererObject=null,this.region=null,this.offset=R.newFloatArray(8),this.uvs=R.newFloatArray(8),this.tempColor=new L(1,1,1,1)}updateOffset(){let t=this.region,i=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*i,r=-this.height/2*this.scaleY+this.region.offsetY*e,c=a+this.region.width*i,n=r+this.region.height*e,s=this.rotation*Math.PI/180,o=Math.cos(s),l=Math.sin(s),h=this.x,d=this.y,f=a*o+h,u=a*l,m=r*o+d,b=r*l,p=c*o+h,y=c*l,g=n*o+d,w=n*l,x=this.offset;x[0]=f-b,x[1]=m+u,x[2]=f-w,x[3]=g+u,x[4]=p-w,x[5]=g+y,x[6]=p-b,x[7]=m+y}setRegion(t){this.region=t;let i=this.uvs;t.degrees==90?(i[2]=t.u,i[3]=t.v2,i[4]=t.u,i[5]=t.v,i[6]=t.u2,i[7]=t.v,i[0]=t.u2,i[1]=t.v2):(i[0]=t.u,i[1]=t.v2,i[2]=t.u,i[3]=t.v,i[4]=t.u2,i[5]=t.v,i[6]=t.u2,i[7]=t.v2)}computeWorldVertices(t,i,e,a){let r=this.offset,c=t.worldX,n=t.worldY,s=t.a,o=t.b,l=t.c,h=t.d,d=0,f=0;d=r[0],f=r[1],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n,e+=a,d=r[2],f=r[3],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n,e+=a,d=r[4],f=r[5],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n,e+=a,d=r[6],f=r[7],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n}copy(){let t=new ts(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,R.arrayCopy(this.uvs,0,t.uvs,0,8),R.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t}},U=ts;U.X1=0,U.Y1=1,U.C1R=2,U.C1G=3,U.C1B=4,U.C1A=5,U.U1=6,U.V1=7,U.X2=8,U.Y2=9,U.C2R=10,U.C2G=11,U.C2B=12,U.C2A=13,U.U2=14,U.V2=15,U.X3=16,U.Y3=17,U.C3R=18,U.C3G=19,U.C3B=20,U.C3A=21,U.U3=22,U.V3=23,U.X4=24,U.Y4=25,U.C4R=26,U.C4G=27,U.C4B=28,U.C4A=29,U.U4=30,U.V4=31;var As=class{constructor(t){this.atlas=null,this.atlas=t}newRegionAttachment(t,i,e){let a=this.atlas.findRegion(e);if(!a)throw new Error("Region not found in atlas: "+e+" (region attachment: "+i+")");a.renderObject=a;let r=new U(i);return r.setRegion(a),r}newMeshAttachment(t,i,e){let a=this.atlas.findRegion(e);if(!a)throw new Error("Region not found in atlas: "+e+" (mesh attachment: "+i+")");a.renderObject=a;let r=new Ct(i);return r.region=a,r}newBoundingBoxAttachment(t,i){return new Ot(i)}newPathAttachment(t,i){return new It(i)}newPointAttachment(t,i){return new ve(i)}newClippingAttachment(t,i){return new pe(i)}},Se=class{constructor(t,i,e){if(this.index=0,this.name=null,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=et.Normal,this.skinRequired=!1,this.color=new L,t<0)throw new Error("index must be >= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.name=i,this.parent=e}},et;(function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"})(et||(et={}));var Ae=class{constructor(t,i,e){if(this.data=null,this.skeleton=null,this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=i,this.parent=e,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,i,e,a,r,c,n){this.ax=t,this.ay=i,this.arotation=e,this.ascaleX=a,this.ascaleY=r,this.ashearX=c,this.ashearY=n;let s=this.parent;if(!s){let f=this.skeleton,u=e+90+n,m=f.scaleX,b=f.scaleY;this.a=X.cosDeg(e+c)*a*m,this.b=X.cosDeg(u)*r*m,this.c=X.sinDeg(e+c)*a*b,this.d=X.sinDeg(u)*r*b,this.worldX=t*m+f.x,this.worldY=i*b+f.y;return}let o=s.a,l=s.b,h=s.c,d=s.d;switch(this.worldX=o*t+l*i+s.worldX,this.worldY=h*t+d*i+s.worldY,this.data.transformMode){case et.Normal:{let f=e+90+n,u=X.cosDeg(e+c)*a,m=X.cosDeg(f)*r,b=X.sinDeg(e+c)*a,p=X.sinDeg(f)*r;this.a=o*u+l*b,this.b=o*m+l*p,this.c=h*u+d*b,this.d=h*m+d*p;return}case et.OnlyTranslation:{let f=e+90+n;this.a=X.cosDeg(e+c)*a,this.b=X.cosDeg(f)*r,this.c=X.sinDeg(e+c)*a,this.d=X.sinDeg(f)*r;break}case et.NoRotationOrReflection:{let f=o*o+h*h,u=0;f>1e-4?(f=Math.abs(o*d-l*h)/f,o/=this.skeleton.scaleX,h/=this.skeleton.scaleY,l=h*f,d=o*f,u=Math.atan2(h,o)*X.radDeg):(o=0,h=0,u=90-Math.atan2(d,l)*X.radDeg);let m=e+c-u,b=e+n-u+90,p=X.cosDeg(m)*a,y=X.cosDeg(b)*r,g=X.sinDeg(m)*a,w=X.sinDeg(b)*r;this.a=o*p-l*g,this.b=o*y-l*w,this.c=h*p+d*g,this.d=h*y+d*w;break}case et.NoScale:case et.NoScaleOrReflection:{let f=X.cosDeg(e),u=X.sinDeg(e),m=(o*f+l*u)/this.skeleton.scaleX,b=(h*f+d*u)/this.skeleton.scaleY,p=Math.sqrt(m*m+b*b);p>1e-5&&(p=1/p),m*=p,b*=p,p=Math.sqrt(m*m+b*b),this.data.transformMode==et.NoScale&&o*d-l*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let y=Math.PI/2+Math.atan2(b,m),g=Math.cos(y)*p,w=Math.sin(y)*p,x=X.cosDeg(c)*a,v=X.cosDeg(90+n)*r,A=X.sinDeg(c)*a,S=X.sinDeg(90+n)*r;this.a=m*x+g*A,this.b=m*v+g*S,this.c=b*x+w*A,this.d=b*v+w*S;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let 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.c,this.a)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*X.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*X.radDeg;return}let i=t.a,e=t.b,a=t.c,r=t.d,c=1/(i*r-e*a),n=this.worldX-t.worldX,s=this.worldY-t.worldY;this.ax=n*r*c-s*e*c,this.ay=s*i*c-n*a*c;let o=c*r,l=c*i,h=c*e,d=c*a,f=o*this.a-h*this.c,u=o*this.b-h*this.d,m=l*this.c-d*this.a,b=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let p=f*b-u*m;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*u+m*b,p)*X.radDeg,this.arotation=Math.atan2(m,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+b*b),this.ashearY=0,this.arotation=90-Math.atan2(b,u)*X.radDeg}worldToLocal(t){let i=1/(this.a*this.d-this.b*this.c),e=t.x-this.worldX,a=t.y-this.worldY;return t.x=e*this.d*i-a*this.b*i,t.y=a*this.a*i-e*this.c*i,t}localToWorld(t){let i=t.x,e=t.y;return t.x=i*this.a+e*this.b+this.worldX,t.y=i*this.c+e*this.d+this.worldY,t}worldToLocalRotation(t){let i=X.sinDeg(t),e=X.cosDeg(t);return Math.atan2(this.a*i-this.c*e,this.d*e-this.b*i)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let i=X.sinDeg(t),e=X.cosDeg(t);return Math.atan2(e*this.c+i*this.d,e*this.a+i*this.b)*X.radDeg}rotateWorld(t){let i=this.a,e=this.b,a=this.c,r=this.d,c=X.cosDeg(t),n=X.sinDeg(t);this.a=c*i-n*a,this.b=c*e-n*r,this.c=n*i+c*a,this.d=n*e+c*r}},Ut=class{constructor(t,i,e){this.name=t,this.order=i,this.skinRequired=e}},ks=class{constructor(t,i="",e=null){this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=i,this.downloader=e||new es}start(t){return this.toLoad++,this.pathPrefix+t}success(t,i,e){this.toLoad--,this.loaded++,this.assets[i]=e,t&&t(i,e)}error(t,i,e){this.toLoad--,this.loaded++,this.errors[i]=e,t&&t(i,e)}setRawDataURI(t,i){this.downloader.rawDataUris[this.pathPrefix+t]=i}loadBinary(t,i=null,e=null){t=this.start(t),this.downloader.downloadBinary(t,a=>{this.success(i,t,a)},(a,r)=>{this.error(e,t,`Couldn't load binary ${t}: status ${a}, ${r}`)})}loadText(t,i=null,e=null){t=this.start(t),this.downloader.downloadText(t,a=>{this.success(i,t,a)},(a,r)=>{this.error(e,t,`Couldn't load text ${t}: status ${a}, ${r}`)})}loadJson(t,i=null,e=null){t=this.start(t),this.downloader.downloadJson(t,a=>{this.success(i,t,a)},(a,r)=>{this.error(e,t,`Couldn't load JSON ${t}: status ${a}, ${r}`)})}loadTexture(t,i=null,e=null){if(t=this.start(t),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(t,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(e,t,`Couldn't load image: ${t}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(i,t,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(i,t,this.textureLoader(c))},c.onerror=()=>{this.error(e,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}}loadTextureAtlas(t,i=null,e=null,a=null){let r=t.lastIndexOf("/"),c=r>=0?t.substring(0,r+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let s=new Ke(n),o=s.pages.length,l=!1;for(let h of s.pages)this.loadTexture(a==null?c+h.name:a[h.name],(d,f)=>{l||(h.setTexture(f),--o==0&&this.success(i,t,s))},(d,f)=>{l||this.error(e,t,`Couldn't load texture atlas ${t} page image: ${d}`),l=!0})}catch(s){this.error(e,t,`Couldn't parse texture atlas ${t}: ${s.message}`)}},(n,s)=>{this.error(e,t,`Couldn't load texture atlas ${t}: status ${n}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let i=this.assets[t];if(i)return i;let e=this.errors[t];throw Error("Asset not found: "+t+(e?`
|
|
2
|
-
`+e:""))}remove(t){t=this.pathPrefix+t;let i=this.assets[t];return i.dispose&&i.dispose(),delete this.assets[t],i}removeAll(){for(let t in this.assets){let i=this.assets[t];i.dispose&&i.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},es=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let i=t.indexOf("base64,");return i!=-1?(i+="base64,".length,atob(t.substr(i))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var i=window.atob(t),e=i.length,a=new Uint8Array(e),r=0;r<e;r++)a[r]=i.charCodeAt(r);return a}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let i=t.indexOf("base64,");if(i==-1)throw new Error("Not a binary data URI.");return i+="base64,".length,this.base64ToUint8Array(t.substr(i))}downloadText(t,i,e){if(this.start(t,i,e))return;if(this.rawDataUris[t]){try{let c=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(c))}catch(c){this.finish(t,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",t,!0);let r=()=>{this.finish(t,a.status,a.responseText)};a.onload=r,a.onerror=r,a.send()}downloadJson(t,i,e){this.downloadText(t,a=>{i(JSON.parse(a))},e)}downloadBinary(t,i,e){if(this.start(t,i,e))return;if(this.rawDataUris[t]){try{let c=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(c))}catch(c){this.finish(t,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType="arraybuffer";let r=()=>{this.finish(t,a.status,a.response)};a.onload=()=>{a.status==200||a.status==0?this.finish(t,200,new Uint8Array(a.response)):r()},a.onerror=r,a.send()}start(t,i,e){let a=this.callbacks[t];try{if(a)return!0;this.callbacks[t]=a=[]}finally{a.push(i,e)}}finish(t,i,e){let a=this.callbacks[t];delete this.callbacks[t];let r=i==200||i==0?[e]:[i,e];for(let c=r.length-1,n=a.length;c<n;c+=2)a[c].apply(null,r)}},ke=class{constructor(t,i){if(this.data=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!i)throw new Error("data cannot be null.");this.time=t,this.data=i}},Ye=class{constructor(t){this.name=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t}},ss=class{constructor(t,i){if(this.data=null,this.bones=null,this.target=null,this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)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 e=0;e<t.bones.length;e++)this.bones.push(i.findBone(t.bones[e].name));this.target=i.findBone(t.target.name)}isActive(){return this.active}update(){if(this.mix==0)return;let t=this.target,i=this.bones;switch(i.length){case 1:this.apply1(i[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(i[0],i[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(t,i,e,a,r,c,n){let s=t.parent,o=s.a,l=s.b,h=s.c,d=s.d,f=-t.ashearX-t.arotation,u=0,m=0;switch(t.data.transformMode){case et.OnlyTranslation:u=i-t.worldX,m=e-t.worldY;break;case et.NoRotationOrReflection:let y=Math.abs(o*d-l*h)/(o*o+h*h),g=o/t.skeleton.scaleX,w=h/t.skeleton.scaleY;l=-w*y*t.skeleton.scaleX,d=g*y*t.skeleton.scaleY,f+=Math.atan2(w,g)*X.radDeg;default:let x=i-s.worldX,v=e-s.worldY,A=o*d-l*h;u=(x*d-v*l)/A-t.ax,m=(v*o-x*h)/A-t.ay}f+=Math.atan2(m,u)*X.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let b=t.ascaleX,p=t.ascaleY;if(a||r){switch(t.data.transformMode){case et.NoScale:case et.NoScaleOrReflection:u=i-t.worldX,m=e-t.worldY}let y=t.data.length*b,g=Math.sqrt(u*u+m*m);if(a&&g<y||r&&g>y&&y>1e-4){let w=(g/y-1)*n+1;b*=w,c&&(p*=w)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*n,b,p,t.ashearX,t.ashearY)}apply2(t,i,e,a,r,c,n,s,o){let l=t.ax,h=t.ay,d=t.ascaleX,f=t.ascaleY,u=d,m=f,b=i.ascaleX,p=0,y=0,g=0;d<0?(d=-d,p=180,g=-1):(p=0,g=1),f<0&&(f=-f,g=-g),b<0?(b=-b,y=180):y=0;let w=i.ax,x=0,v=0,A=0,S=t.a,I=t.b,C=t.c,F=t.d,P=Math.abs(d-f)<=1e-4;!P||c?(x=0,v=S*w+t.worldX,A=C*w+t.worldY):(x=i.ay,v=S*w+I*x+t.worldX,A=C*w+F*x+t.worldY);let B=t.parent;S=B.a,I=B.b,C=B.c,F=B.d;let M=1/(S*F-I*C),Y=v-B.worldX,T=A-B.worldY,N=(Y*F-T*I)*M-l,z=(T*S-Y*C)*M-h,E=Math.sqrt(N*N+z*z),q=i.data.length*b,G,H;if(E<1e-4){this.apply1(t,e,a,!1,c,!1,o),i.updateWorldTransformWith(w,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);return}Y=e-B.worldX,T=a-B.worldY;let D=(Y*F-T*I)*M-l,V=(T*S-Y*C)*M-h,j=D*D+V*V;if(s!=0){s*=d*(b+1)*.5;let K=Math.sqrt(j),it=K-E-q*d+s;if(it>0){let rt=Math.min(1,it/(s*2))-1;rt=(it-s*(1-rt*rt))/K,D-=rt*D,V-=rt*V,j=D*D+V*V}}t:if(P){q*=d;let K=(j-E*E-q*q)/(2*E*q);K<-1?(K=-1,H=Math.PI*r):K>1?(K=1,H=0,c&&(S=(Math.sqrt(j)/(E+q)-1)*o+1,u*=S,n&&(m*=S))):H=Math.acos(K)*r,S=E+q*K,I=q*Math.sin(H),G=Math.atan2(V*S-D*I,D*S+V*I)}else{S=d*q,I=f*q;let K=S*S,it=I*I,rt=Math.atan2(V,D);C=it*E*E+K*j-K*it;let wt=-2*it*E,Xt=it-K;if(F=wt*wt-4*Xt*C,F>=0){let Mt=Math.sqrt(F);wt<0&&(Mt=-Mt),Mt=-(wt+Mt)*.5;let ds=Mt/Xt,fs=C/Mt,Ft=Math.abs(ds)<Math.abs(fs)?ds:fs;if(Ft*Ft<=j){T=Math.sqrt(j-Ft*Ft)*r,G=rt-Math.atan2(T,Ft),H=Math.atan2(T/f,(Ft-E)/d);break t}}let Et=X.PI,qt=E-S,Ee=qt*qt,os=0,hs=0,_t=E+S,Ve=_t*_t,cs=0;C=-S*E/(K-it),C>=-1&&C<=1&&(C=Math.acos(C),Y=S*Math.cos(C)+E,T=I*Math.sin(C),F=Y*Y+T*T,F<Ee&&(Et=C,Ee=F,qt=Y,os=T),F>Ve&&(hs=C,Ve=F,_t=Y,cs=T)),j<=(Ee+Ve)*.5?(G=rt-Math.atan2(os*r,qt),H=Et*r):(G=rt-Math.atan2(cs*r,_t),H=hs*r)}let Z=Math.atan2(x,w)*g,ht=t.arotation;G=(G-Z)*X.radDeg+p-ht,G>180?G-=360:G<-180&&(G+=360),t.updateWorldTransformWith(l,h,ht+G*o,u,m,0,0),ht=i.arotation,H=((H+Z)*X.radDeg-i.ashearX)*g+y-ht,H>180?H-=360:H<-180&&(H+=360),i.updateWorldTransformWith(w,x,ht+H*o,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}},Ce=class extends Ut{constructor(t){super(t,0,!1);this.bones=new Array,this.target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}},Ie=class extends Ut{constructor(t){super(t,0,!1);this.bones=new Array,this.target=null,this.positionMode=null,this.spacingMode=null,this.rotateMode=null,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}},dt;(function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"})(dt||(dt={}));var Q;(function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"})(Q||(Q={}));var kt;(function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"})(kt||(kt={}));var gt=class{constructor(t,i){if(this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let e=0,a=t.bones.length;e<a;e++)this.bones.push(i.findBone(t.bones[e].name));this.target=i.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}update(){let t=this.target.getAttachment();if(!(t instanceof It))return;let i=this.mixRotate,e=this.mixX,a=this.mixY;if(i==0&&e==0&&a==0)return;let r=this.data,c=r.rotateMode==kt.Tangent,n=r.rotateMode==kt.ChainScale,s=this.bones,o=s.length,l=c?o:o+1,h=R.setArraySize(this.spaces,l),d=n?this.lengths=R.setArraySize(this.lengths,o):null,f=this.spacing;switch(r.spacingMode){case Q.Percent:if(n)for(let x=0,v=l-1;x<v;x++){let A=s[x],S=A.data.length;if(S<gt.epsilon)d[x]=0;else{let I=S*A.a,C=S*A.c;d[x]=Math.sqrt(I*I+C*C)}}R.arrayFill(h,1,l,f);break;case Q.Proportional:let g=0;for(let x=0,v=l-1;x<v;){let A=s[x],S=A.data.length;if(S<gt.epsilon)n&&(d[x]=0),h[++x]=f;else{let I=S*A.a,C=S*A.c,F=Math.sqrt(I*I+C*C);n&&(d[x]=F),h[++x]=F,g+=F}}if(g>0){g=l/g*f;for(let x=1;x<l;x++)h[x]*=g}break;default:let w=r.spacingMode==Q.Length;for(let x=0,v=l-1;x<v;){let A=s[x],S=A.data.length;if(S<gt.epsilon)n&&(d[x]=0),h[++x]=f;else{let I=S*A.a,C=S*A.c,F=Math.sqrt(I*I+C*C);n&&(d[x]=F),h[++x]=(w?S+f:f)*F/S}}}let u=this.computeWorldPositions(t,l,c),m=u[0],b=u[1],p=r.offsetRotation,y=!1;if(p==0)y=r.rotateMode==kt.Chain;else{y=!1;let g=this.target.bone;p*=g.a*g.d-g.b*g.c>0?X.degRad:-X.degRad}for(let g=0,w=3;g<o;g++,w+=3){let x=s[g];x.worldX+=(m-x.worldX)*e,x.worldY+=(b-x.worldY)*a;let v=u[w],A=u[w+1],S=v-m,I=A-b;if(n){let C=d[g];if(C!=0){let F=(Math.sqrt(S*S+I*I)/C-1)*i+1;x.a*=F,x.c*=F}}if(m=v,b=A,i>0){let C=x.a,F=x.b,P=x.c,B=x.d,M=0,Y=0,T=0;if(c?M=u[w-1]:h[g+1]==0?M=u[w+2]:M=Math.atan2(I,S),M-=Math.atan2(P,C),y){Y=Math.cos(M),T=Math.sin(M);let N=x.data.length;m+=(N*(Y*C-T*P)-S)*i,b+=(N*(T*C+Y*P)-I)*i}else M+=p;M>X.PI?M-=X.PI2:M<-X.PI&&(M+=X.PI2),M*=i,Y=Math.cos(M),T=Math.sin(M),x.a=Y*C-T*P,x.b=Y*F-T*B,x.c=T*C+Y*P,x.d=T*F+Y*B}x.updateAppliedTransform()}}computeWorldPositions(t,i,e){let a=this.target,r=this.position,c=this.spaces,n=R.setArraySize(this.positions,i*3+2),s=null,o=t.closed,l=t.worldVerticesLength,h=l/6,d=gt.NONE;if(!t.constantSpeed){let z=t.lengths;h-=o?1:2;let E=z[h];this.data.positionMode==dt.Percent&&(r*=E);let q;switch(this.data.spacingMode){case Q.Percent:q=E;break;case Q.Proportional:q=E/i;break;default:q=1}s=R.setArraySize(this.world,8);for(let G=0,H=0,D=0;G<i;G++,H+=3){let V=c[G]*q;r+=V;let j=r;if(o)j%=E,j<0&&(j+=E),D=0;else if(j<0){d!=gt.BEFORE&&(d=gt.BEFORE,t.computeWorldVertices(a,2,4,s,0,2)),this.addBeforePosition(j,s,0,n,H);continue}else if(j>E){d!=gt.AFTER&&(d=gt.AFTER,t.computeWorldVertices(a,l-6,4,s,0,2)),this.addAfterPosition(j-E,s,0,n,H);continue}for(;;D++){let Z=z[D];if(!(j>Z)){if(D==0)j/=Z;else{let ht=z[D-1];j=(j-ht)/(Z-ht)}break}}D!=d&&(d=D,o&&D==h?(t.computeWorldVertices(a,l-4,4,s,0,2),t.computeWorldVertices(a,0,4,s,4,2)):t.computeWorldVertices(a,D*6+2,8,s,0,2)),this.addCurvePosition(j,s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],n,H,e||G>0&&V==0)}return n}o?(l+=2,s=R.setArraySize(this.world,l),t.computeWorldVertices(a,2,l-4,s,0,2),t.computeWorldVertices(a,0,2,s,l-4,2),s[l-2]=s[0],s[l-1]=s[1]):(h--,l-=4,s=R.setArraySize(this.world,l),t.computeWorldVertices(a,2,l,s,0,2));let f=R.setArraySize(this.curves,h),u=0,m=s[0],b=s[1],p=0,y=0,g=0,w=0,x=0,v=0,A=0,S=0,I=0,C=0,F=0,P=0,B=0,M=0;for(let z=0,E=2;z<h;z++,E+=6)p=s[E],y=s[E+1],g=s[E+2],w=s[E+3],x=s[E+4],v=s[E+5],A=(m-p*2+g)*.1875,S=(b-y*2+w)*.1875,I=((p-g)*3-m+x)*.09375,C=((y-w)*3-b+v)*.09375,F=A*2+I,P=S*2+C,B=(p-m)*.75+A+I*.16666667,M=(y-b)*.75+S+C*.16666667,u+=Math.sqrt(B*B+M*M),B+=F,M+=P,F+=I,P+=C,u+=Math.sqrt(B*B+M*M),B+=F,M+=P,u+=Math.sqrt(B*B+M*M),B+=F+I,M+=P+C,u+=Math.sqrt(B*B+M*M),f[z]=u,m=x,b=v;this.data.positionMode==dt.Percent&&(r*=u);let Y;switch(this.data.spacingMode){case Q.Percent:Y=u;break;case Q.Proportional:Y=u/i;break;default:Y=1}let T=this.segments,N=0;for(let z=0,E=0,q=0,G=0;z<i;z++,E+=3){let H=c[z]*Y;r+=H;let D=r;if(o)D%=u,D<0&&(D+=u),q=0;else if(D<0){this.addBeforePosition(D,s,0,n,E);continue}else if(D>u){this.addAfterPosition(D-u,s,l-4,n,E);continue}for(;;q++){let V=f[q];if(!(D>V)){if(q==0)D/=V;else{let j=f[q-1];D=(D-j)/(V-j)}break}}if(q!=d){d=q;let V=q*6;for(m=s[V],b=s[V+1],p=s[V+2],y=s[V+3],g=s[V+4],w=s[V+5],x=s[V+6],v=s[V+7],A=(m-p*2+g)*.03,S=(b-y*2+w)*.03,I=((p-g)*3-m+x)*.006,C=((y-w)*3-b+v)*.006,F=A*2+I,P=S*2+C,B=(p-m)*.3+A+I*.16666667,M=(y-b)*.3+S+C*.16666667,N=Math.sqrt(B*B+M*M),T[0]=N,V=1;V<8;V++)B+=F,M+=P,F+=I,P+=C,N+=Math.sqrt(B*B+M*M),T[V]=N;B+=F,M+=P,N+=Math.sqrt(B*B+M*M),T[8]=N,B+=F+I,M+=P+C,N+=Math.sqrt(B*B+M*M),T[9]=N,G=0}for(D*=N;;G++){let V=T[G];if(!(D>V)){if(G==0)D/=V;else{let j=T[G-1];D=G+(D-j)/(V-j)}break}}this.addCurvePosition(D*.1,m,b,p,y,g,w,x,v,n,E,e||z>0&&H==0)}return n}addBeforePosition(t,i,e,a,r){let c=i[e],n=i[e+1],s=i[e+2]-c,o=i[e+3]-n,l=Math.atan2(o,s);a[r]=c+t*Math.cos(l),a[r+1]=n+t*Math.sin(l),a[r+2]=l}addAfterPosition(t,i,e,a,r){let c=i[e+2],n=i[e+3],s=c-i[e],o=n-i[e+1],l=Math.atan2(o,s);a[r]=c+t*Math.cos(l),a[r+1]=n+t*Math.sin(l),a[r+2]=l}addCurvePosition(t,i,e,a,r,c,n,s,o,l,h,d){if(t==0||isNaN(t)){l[h]=i,l[h+1]=e,l[h+2]=Math.atan2(r-e,a-i);return}let f=t*t,u=f*t,m=1-t,b=m*m,p=b*m,y=m*t,g=y*3,w=m*g,x=g*t,v=i*p+a*w+c*x+s*u,A=e*p+r*w+n*x+o*u;l[h]=v,l[h+1]=A,d&&(t<.001?l[h+2]=Math.atan2(r-e,a-i):l[h+2]=Math.atan2(A-(e*b+r*y*2+n*f),v-(i*b+a*y*2+c*f)))}},Tt=gt;Tt.NONE=-1,Tt.BEFORE=-2,Tt.AFTER=-3,Tt.epsilon=1e-5;var is=class{constructor(t,i){if(this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentTime=0,this.attachmentState=0,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!i)throw new Error("bone cannot be null.");this.data=t,this.bone=i,this.color=new L,this.darkColor=t.darkColor?new L:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&((!(t instanceof ct)||!(this.attachment instanceof ct)||t.deformAttachment!=this.attachment.deformAttachment)&&(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},rs=class{constructor(t,i){if(this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new We,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let e=0;e<t.bones.length;e++)this.bones.push(i.findBone(t.bones[e].name));this.target=i.findBone(t.target.name)}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleX==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=i!=0||e!=0,s=this.target,o=s.a,l=s.b,h=s.c,d=s.d,f=o*d-l*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,b=this.bones;for(let p=0,y=b.length;p<y;p++){let g=b[p];if(t!=0){let w=g.a,x=g.b,v=g.c,A=g.d,S=Math.atan2(h,o)-Math.atan2(v,w)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=t;let I=Math.cos(S),C=Math.sin(S);g.a=I*w-C*v,g.b=I*x-C*A,g.c=C*w+I*v,g.d=C*x+I*A}if(n){let w=this.temp;s.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(w.x-g.worldX)*i,g.worldY+=(w.y-g.worldY)*e}if(a!=0){let w=Math.sqrt(g.a*g.a+g.c*g.c);w!=0&&(w=(w+(Math.sqrt(o*o+h*h)-w+this.data.offsetScaleX)*a)/w),g.a*=w,g.c*=w}if(r!=0){let w=Math.sqrt(g.b*g.b+g.d*g.d);w!=0&&(w=(w+(Math.sqrt(l*l+d*d)-w+this.data.offsetScaleY)*r)/w),g.b*=w,g.d*=w}if(c>0){let w=g.b,x=g.d,v=Math.atan2(x,w),A=Math.atan2(d,l)-Math.atan2(h,o)-(v-Math.atan2(g.c,g.a));A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A=v+(A+m)*c;let S=Math.sqrt(w*w+x*x);g.b=Math.cos(A)*S,g.d=Math.sin(A)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=i!=0||e!=0,s=this.target,o=s.a,l=s.b,h=s.c,d=s.d,f=o*d-l*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,b=this.bones;for(let p=0,y=b.length;p<y;p++){let g=b[p];if(t!=0){let w=g.a,x=g.b,v=g.c,A=g.d,S=Math.atan2(h,o)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=t;let I=Math.cos(S),C=Math.sin(S);g.a=I*w-C*v,g.b=I*x-C*A,g.c=C*w+I*v,g.d=C*x+I*A}if(n){let w=this.temp;s.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=w.x*i,g.worldY+=w.y*e}if(a!=0){let w=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*a+1;g.a*=w,g.c*=w}if(r!=0){let w=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*r+1;g.b*=w,g.d*=w}if(c>0){let w=Math.atan2(d,l)-Math.atan2(h,o);w>X.PI?w-=X.PI2:w<-X.PI&&(w+=X.PI2);let x=g.b,v=g.d;w=Math.atan2(v,x)+(w-X.PI/2+m)*c;let A=Math.sqrt(x*x+v*v);g.b=Math.cos(w)*A,g.d=Math.sin(w)*A}g.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,s=this.bones;for(let o=0,l=s.length;o<l;o++){let h=s[o],d=h.arotation;if(t!=0){let y=n.arotation-d+this.data.offsetRotation;y-=(16384-(16384.499999999996-y/360|0))*360,d+=y*t}let f=h.ax,u=h.ay;f+=(n.ax-f+this.data.offsetX)*i,u+=(n.ay-u+this.data.offsetY)*e;let m=h.ascaleX,b=h.ascaleY;a!=0&&m!=0&&(m=(m+(n.ascaleX-m+this.data.offsetScaleX)*a)/m),r!=0&&b!=0&&(b=(b+(n.ascaleY-b+this.data.offsetScaleY)*r)/b);let p=h.ashearY;if(c!=0){let y=n.ashearY-p+this.data.offsetShearY;y-=(16384-(16384.499999999996-y/360|0))*360,p+=y*c}h.updateWorldTransformWith(f,u,d,m,b,h.ashearX,p)}}applyRelativeLocal(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,s=this.bones;for(let o=0,l=s.length;o<l;o++){let h=s[o],d=h.arotation+(n.arotation+this.data.offsetRotation)*t,f=h.ax+(n.ax+this.data.offsetX)*i,u=h.ay+(n.ay+this.data.offsetY)*e,m=h.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*a+1),b=h.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*r+1),p=h.ashearY+(n.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,u,d,m,b,h.ashearX,p)}}},Ys=class{constructor(t){if(this.data=null,this.bones=null,this.slots=null,this.drawOrder=null,this.ikConstraints=null,this.transformConstraints=null,this.pathConstraints=null,this._updateCache=new Array,this.skin=null,this.color=null,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let e=t.bones[i],a;if(!e.parent)a=new Ae(e,this,null);else{let r=this.bones[e.parent.index];a=new Ae(e,this,r),r.children.push(a)}this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let i=0;i<t.slots.length;i++){let e=t.slots[i],a=this.bones[e.boneData.index],r=new is(e,a);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let i=0;i<t.ikConstraints.length;i++){let e=t.ikConstraints[i];this.ikConstraints.push(new ss(e,this))}this.transformConstraints=new Array;for(let i=0;i<t.transformConstraints.length;i++){let e=t.transformConstraints[i];this.transformConstraints.push(new rs(e,this))}this.pathConstraints=new Array;for(let i=0;i<t.pathConstraints.length;i++){let e=t.pathConstraints[i];this.pathConstraints.push(new Tt(e,this))}this.color=new L(1,1,1,1),this.updateCache()}updateCache(){let t=this._updateCache;t.length=0;let i=this.bones;for(let l=0,h=i.length;l<h;l++){let d=i[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let l=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let f=this.bones[l[h].index];do f.sorted=!1,f.active=!0,f=f.parent;while(f)}}let e=this.ikConstraints,a=this.transformConstraints,r=this.pathConstraints,c=e.length,n=a.length,s=r.length,o=c+n+s;t:for(let l=0;l<o;l++){for(let h=0;h<c;h++){let d=e[h];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let h=0;h<n;h++){let d=a[h];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let h=0;h<s;h++){let d=r[h];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,h=i.length;l<h;l++)this.sortBone(i[l])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&R.contains(this.skin.constraints,t.data,!0)),!t.active)return;let i=t.target;this.sortBone(i);let e=t.bones,a=e[0];if(this.sortBone(a),e.length==1)this._updateCache.push(t),this.sortReset(a.children);else{let r=e[e.length-1];this.sortBone(r),this._updateCache.push(t),this.sortReset(a.children),r.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&R.contains(this.skin.constraints,t.data,!0)),!t.active)return;let i=t.target,e=i.data.index,a=i.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,e,a),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,a);for(let s=0,o=this.data.skins.length;s<o;s++)this.sortPathConstraintAttachment(this.data.skins[s],e,a);let r=i.getAttachment();r instanceof It&&this.sortPathConstraintAttachmentWith(r,a);let c=t.bones,n=c.length;for(let s=0;s<n;s++)this.sortBone(c[s]);this._updateCache.push(t);for(let s=0;s<n;s++)this.sortReset(c[s].children);for(let s=0;s<n;s++)c[s].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&R.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let i=t.bones,e=i.length;if(t.data.local)for(let a=0;a<e;a++){let r=i[a];this.sortBone(r.parent),this.sortBone(r)}else for(let a=0;a<e;a++)this.sortBone(i[a]);this._updateCache.push(t);for(let a=0;a<e;a++)this.sortReset(i[a].children);for(let a=0;a<e;a++)i[a].sorted=!0}sortPathConstraintAttachment(t,i,e){let a=t.attachments[i];if(!!a)for(let r in a)this.sortPathConstraintAttachmentWith(a[r],e)}sortPathConstraintAttachmentWith(t,i){if(!(t instanceof It))return;let e=t.bones;if(!e)this.sortBone(i);else{let a=this.bones;for(let r=0,c=e.length;r<c;){let n=e[r++];for(n+=r;r<n;)this.sortBone(a[e[r++]])}}}sortBone(t){if(t.sorted)return;let i=t.parent;i&&this.sortBone(i),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let i=0,e=t.length;i<e;i++){let a=t[i];!a.active||(a.sorted&&this.sortReset(a.children),a.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let e=0,a=t.length;e<a;e++){let r=t[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let i=this._updateCache;for(let e=0,a=i.length;e<a;e++)i[e].update()}updateWorldTransformWith(t){let i=this.getRootBone(),e=t.a,a=t.b,r=t.c,c=t.d;i.worldX=e*this.x+a*this.y+t.worldX,i.worldY=r*this.x+c*this.y+t.worldY;let n=i.rotation+90+i.shearY,s=X.cosDeg(i.rotation+i.shearX)*i.scaleX,o=X.cosDeg(n)*i.scaleY,l=X.sinDeg(i.rotation+i.shearX)*i.scaleX,h=X.sinDeg(n)*i.scaleY;i.a=(e*s+a*l)*this.scaleX,i.b=(e*o+a*h)*this.scaleX,i.c=(r*s+c*l)*this.scaleY,i.d=(r*o+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,u=d.length;f<u;f++){let m=d[f];m!=i&&m.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let r=0,c=t.length;r<c;r++)t[r].setToSetupPose();let i=this.ikConstraints;for(let r=0,c=i.length;r<c;r++){let n=i[r];n.mix=n.data.mix,n.softness=n.data.softness,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch}let e=this.transformConstraints;for(let r=0,c=e.length;r<c;r++){let n=e[r],s=n.data;n.mixRotate=s.mixRotate,n.mixX=s.mixX,n.mixY=s.mixY,n.mixScaleX=s.mixScaleX,n.mixScaleY=s.mixScaleY,n.mixShearY=s.mixShearY}let a=this.pathConstraints;for(let r=0,c=a.length;r<c;r++){let n=a[r],s=n.data;n.position=s.position,n.spacing=s.spacing,n.mixRotate=s.mixRotate,n.mixX=s.mixX,n.mixY=s.mixY}}setSlotsToSetupPose(){let t=this.slots;R.arrayCopy(t,0,this.drawOrder,0,t.length);for(let i=0,e=t.length;i<e;i++)t[i].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let i=this.bones;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}setSkinByName(t){let i=this.data.findSkin(t);if(!i)throw new Error("Skin not found: "+t);this.setSkin(i)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let i=this.slots;for(let e=0,a=i.length;e<a;e++){let r=i[e],c=r.data.attachmentName;if(c){let n=t.getAttachment(e,c);n&&r.setAttachment(n)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,i){return this.getAttachment(this.data.findSlot(t).index,i)}getAttachment(t,i){if(!i)throw new Error("attachmentName cannot be null.");if(this.skin){let e=this.skin.getAttachment(t,i);if(e)return e}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,i):null}setAttachment(t,i){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let a=0,r=e.length;a<r;a++){let c=e[a];if(c.data.name==t){let n=null;if(i&&(n=this.getAttachment(a,i),!n))throw new Error("Attachment not found: "+i+", for slot: "+t);c.setAttachment(n);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.ikConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.transformConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.pathConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}getBounds(t,i,e=new Array(2)){if(!t)throw new Error("offset cannot be null.");if(!i)throw new Error("size cannot be null.");let a=this.drawOrder,r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let o=0,l=a.length;o<l;o++){let h=a[o];if(!h.bone.active)continue;let d=0,f=null,u=h.getAttachment();if(u instanceof U)d=8,f=R.setArraySize(e,d,0),u.computeWorldVertices(h.bone,f,0,2);else if(u instanceof Ct){let m=u;d=m.worldVerticesLength,f=R.setArraySize(e,d,0),m.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let m=0,b=f.length;m<b;m+=2){let p=f[m],y=f[m+1];r=Math.min(r,p),c=Math.min(c,y),n=Math.max(n,p),s=Math.max(s,y)}}t.set(r,c),i.set(n-r,s-c)}update(t){this.time+=t}},Te=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(t){if(!t)throw new Error("boneName cannot be null.");let i=this.bones;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let i=this.skins;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let i=this.events;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let i=this.animations;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.ikConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.transformConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.pathConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}},Xe=class{constructor(t=0,i=null,e=null){this.slotIndex=t,this.name=i,this.attachment=e}},Wt=class{constructor(t){if(this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,i,e){if(!e)throw new Error("attachment cannot be null.");let a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][i]=e}addSkin(t){for(let a=0;a<t.bones.length;a++){let r=t.bones[a],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<t.constraints.length;a++){let r=t.constraints[a],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let i=t.getAttachments();for(let a=0;a<i.length;a++){var e=i[a];this.setAttachment(e.slotIndex,e.name,e.attachment)}}copySkin(t){for(let a=0;a<t.bones.length;a++){let r=t.bones[a],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<t.constraints.length;a++){let r=t.constraints[a],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let i=t.getAttachments();for(let a=0;a<i.length;a++){var e=i[a];!e.attachment||(e.attachment instanceof Ct?(e.attachment=e.attachment.newLinkedMesh(),this.setAttachment(e.slotIndex,e.name,e.attachment)):(e.attachment=e.attachment.copy(),this.setAttachment(e.slotIndex,e.name,e.attachment)))}}getAttachment(t,i){let e=this.attachments[t];return e?e[i]:null}removeAttachment(t,i){let e=this.attachments[t];e&&(e[i]=null)}getAttachments(){let t=new Array;for(var i=0;i<this.attachments.length;i++){let e=this.attachments[i];if(e)for(let a in e){let r=e[a];r&&t.push(new Xe(i,a,r))}}return t}getAttachmentsForSlot(t,i){let e=this.attachments[t];if(e)for(let a in e){let r=e[a];r&&i.push(new Xe(t,a,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,i){let e=0;for(let a=0;a<t.slots.length;a++){let r=t.slots[a],c=r.getAttachment();if(c&&e<i.attachments.length){let n=i.attachments[e];for(let s in n){let o=n[s];if(c==o){let l=this.getAttachment(e,s);l&&r.setAttachment(l);break}}}e++}}},Me=class{constructor(t,i,e){if(this.index=0,this.name=null,this.boneData=null,this.color=new L(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=null,t<0)throw new Error("index must be >= 0.");if(!i)throw new Error("name cannot be null.");if(!e)throw new Error("boneData cannot be null.");this.index=t,this.name=i,this.boneData=e}},zt;(function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"})(zt||(zt={}));var Fe=class extends Ut{constructor(t){super(t,0,!1);this.bones=new Array,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}},Cs=class{constructor(t){this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let i=this.scale,e=new Te;e.name="";let a=new as(t),r=a.readInt32(),c=a.readInt32();e.hash=c==0&&r==0?null:c.toString(16)+r.toString(16),e.version=a.readString(),e.x=a.readFloat(),e.y=a.readFloat(),e.width=a.readFloat(),e.height=a.readFloat();let n=a.readBoolean();n&&(e.fps=a.readFloat(),e.imagesPath=a.readString(),e.audioPath=a.readString());let s=0;s=a.readInt(!0);for(let l=0;l<s;l++)a.strings.push(a.readString());s=a.readInt(!0);for(let l=0;l<s;l++){let h=a.readString(),d=l==0?null:e.bones[a.readInt(!0)],f=new Se(l,h,d);f.rotation=a.readFloat(),f.x=a.readFloat()*i,f.y=a.readFloat()*i,f.scaleX=a.readFloat(),f.scaleY=a.readFloat(),f.shearX=a.readFloat(),f.shearY=a.readFloat(),f.length=a.readFloat()*i,f.transformMode=a.readInt(!0),f.skinRequired=a.readBoolean(),n&&L.rgba8888ToColor(f.color,a.readInt32()),e.bones.push(f)}s=a.readInt(!0);for(let l=0;l<s;l++){let h=a.readString(),d=e.bones[a.readInt(!0)],f=new Me(l,h,d);L.rgba8888ToColor(f.color,a.readInt32());let u=a.readInt32();u!=-1&&L.rgb888ToColor(f.darkColor=new L,u),f.attachmentName=a.readStringRef(),f.blendMode=a.readInt(!0),e.slots.push(f)}s=a.readInt(!0);for(let l=0,h;l<s;l++){let d=new Ce(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(e.bones[a.readInt(!0)]);d.target=e.bones[a.readInt(!0)],d.mix=a.readFloat(),d.softness=a.readFloat()*i,d.bendDirection=a.readByte(),d.compress=a.readBoolean(),d.stretch=a.readBoolean(),d.uniform=a.readBoolean(),e.ikConstraints.push(d)}s=a.readInt(!0);for(let l=0,h;l<s;l++){let d=new Fe(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(e.bones[a.readInt(!0)]);d.target=e.bones[a.readInt(!0)],d.local=a.readBoolean(),d.relative=a.readBoolean(),d.offsetRotation=a.readFloat(),d.offsetX=a.readFloat()*i,d.offsetY=a.readFloat()*i,d.offsetScaleX=a.readFloat(),d.offsetScaleY=a.readFloat(),d.offsetShearY=a.readFloat(),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),d.mixScaleX=a.readFloat(),d.mixScaleY=a.readFloat(),d.mixShearY=a.readFloat(),e.transformConstraints.push(d)}s=a.readInt(!0);for(let l=0,h;l<s;l++){let d=new Ie(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(e.bones[a.readInt(!0)]);d.target=e.slots[a.readInt(!0)],d.positionMode=a.readInt(!0),d.spacingMode=a.readInt(!0),d.rotateMode=a.readInt(!0),d.offsetRotation=a.readFloat(),d.position=a.readFloat(),d.positionMode==dt.Fixed&&(d.position*=i),d.spacing=a.readFloat(),(d.spacingMode==Q.Length||d.spacingMode==Q.Fixed)&&(d.spacing*=i),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),e.pathConstraints.push(d)}let o=this.readSkin(a,e,!0,n);o&&(e.defaultSkin=o,e.skins.push(o));{let l=e.skins.length;for(R.setArraySize(e.skins,s=l+a.readInt(!0));l<s;l++)e.skins[l]=this.readSkin(a,e,!1,n)}s=this.linkedMeshes.length;for(let l=0;l<s;l++){let h=this.linkedMeshes[l],f=(h.skin?e.findSkin(h.skin):e.defaultSkin).getAttachment(h.slotIndex,h.parent);h.mesh.deformAttachment=h.inheritDeform?f:h.mesh,h.mesh.setParentMesh(f),h.mesh.updateUVs()}this.linkedMeshes.length=0,s=a.readInt(!0);for(let l=0;l<s;l++){let h=new Ye(a.readStringRef());h.intValue=a.readInt(!1),h.floatValue=a.readFloat(),h.stringValue=a.readString(),h.audioPath=a.readString(),h.audioPath&&(h.volume=a.readFloat(),h.balance=a.readFloat()),e.events.push(h)}s=a.readInt(!0);for(let l=0;l<s;l++)e.animations.push(this.readAnimation(a,a.readString(),e));return e}readSkin(t,i,e,a){let r=null,c=0;if(e){if(c=t.readInt(!0),c==0)return null;r=new Wt("default")}else{r=new Wt(t.readStringRef()),r.bones.length=t.readInt(!0);for(let n=0,s=r.bones.length;n<s;n++)r.bones[n]=i.bones[t.readInt(!0)];for(let n=0,s=t.readInt(!0);n<s;n++)r.constraints.push(i.ikConstraints[t.readInt(!0)]);for(let n=0,s=t.readInt(!0);n<s;n++)r.constraints.push(i.transformConstraints[t.readInt(!0)]);for(let n=0,s=t.readInt(!0);n<s;n++)r.constraints.push(i.pathConstraints[t.readInt(!0)]);c=t.readInt(!0)}for(let n=0;n<c;n++){let s=t.readInt(!0);for(let o=0,l=t.readInt(!0);o<l;o++){let h=t.readStringRef(),d=this.readAttachment(t,i,r,s,h,a);d&&r.setAttachment(s,h,d)}}return r}readAttachment(t,i,e,a,r,c){let n=this.scale,s=t.readStringRef();switch(s||(s=r),t.readByte()){case xt.Region:{let o=t.readStringRef(),l=t.readFloat(),h=t.readFloat(),d=t.readFloat(),f=t.readFloat(),u=t.readFloat(),m=t.readFloat(),b=t.readFloat(),p=t.readInt32();o||(o=s);let y=this.attachmentLoader.newRegionAttachment(e,s,o);return y?(y.path=o,y.x=h*n,y.y=d*n,y.scaleX=f,y.scaleY=u,y.rotation=l,y.width=m*n,y.height=b*n,L.rgba8888ToColor(y.color,p),y.updateOffset(),y):null}case xt.BoundingBox:{let o=t.readInt(!0),l=this.readVertices(t,o),h=c?t.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(e,s);return d?(d.worldVerticesLength=o<<1,d.vertices=l.vertices,d.bones=l.bones,c&&L.rgba8888ToColor(d.color,h),d):null}case xt.Mesh:{let o=t.readStringRef(),l=t.readInt32(),h=t.readInt(!0),d=this.readFloatArray(t,h<<1,1),f=this.readShortArray(t),u=this.readVertices(t,h),m=t.readInt(!0),b=null,p=0,y=0;c&&(b=this.readShortArray(t),p=t.readFloat(),y=t.readFloat()),o||(o=s);let g=this.attachmentLoader.newMeshAttachment(e,s,o);return g?(g.path=o,L.rgba8888ToColor(g.color,l),g.bones=u.bones,g.vertices=u.vertices,g.worldVerticesLength=h<<1,g.triangles=f,g.regionUVs=d,g.updateUVs(),g.hullLength=m<<1,c&&(g.edges=b,g.width=p*n,g.height=y*n),g):null}case xt.LinkedMesh:{let o=t.readStringRef(),l=t.readInt32(),h=t.readStringRef(),d=t.readStringRef(),f=t.readBoolean(),u=0,m=0;c&&(u=t.readFloat(),m=t.readFloat()),o||(o=s);let b=this.attachmentLoader.newMeshAttachment(e,s,o);return b?(b.path=o,L.rgba8888ToColor(b.color,l),c&&(b.width=u*n,b.height=m*n),this.linkedMeshes.push(new Is(b,h,a,d,f)),b):null}case xt.Path:{let o=t.readBoolean(),l=t.readBoolean(),h=t.readInt(!0),d=this.readVertices(t,h),f=R.newArray(h/3,0);for(let b=0,p=f.length;b<p;b++)f[b]=t.readFloat()*n;let u=c?t.readInt32():0,m=this.attachmentLoader.newPathAttachment(e,s);return m?(m.closed=o,m.constantSpeed=l,m.worldVerticesLength=h<<1,m.vertices=d.vertices,m.bones=d.bones,m.lengths=f,c&&L.rgba8888ToColor(m.color,u),m):null}case xt.Point:{let o=t.readFloat(),l=t.readFloat(),h=t.readFloat(),d=c?t.readInt32():0,f=this.attachmentLoader.newPointAttachment(e,s);return f?(f.x=l*n,f.y=h*n,f.rotation=o,c&&L.rgba8888ToColor(f.color,d),f):null}case xt.Clipping:{let o=t.readInt(!0),l=t.readInt(!0),h=this.readVertices(t,l),d=c?t.readInt32():0,f=this.attachmentLoader.newClippingAttachment(e,s);return f?(f.endSlot=i.slots[o],f.worldVerticesLength=l<<1,f.vertices=h.vertices,f.bones=h.bones,c&&L.rgba8888ToColor(f.color,d),f):null}}return null}readVertices(t,i){let e=this.scale,a=i<<1,r=new Ts;if(!t.readBoolean())return r.vertices=this.readFloatArray(t,a,e),r;let c=new Array,n=new Array;for(let s=0;s<i;s++){let o=t.readInt(!0);n.push(o);for(let l=0;l<o;l++)n.push(t.readInt(!0)),c.push(t.readFloat()*e),c.push(t.readFloat()*e),c.push(t.readFloat())}return r.vertices=R.toFloatArray(c),r.bones=n,r}readFloatArray(t,i,e){let a=new Array(i);if(e==1)for(let r=0;r<i;r++)a[r]=t.readFloat();else for(let r=0;r<i;r++)a[r]=t.readFloat()*e;return a}readShortArray(t){let i=t.readInt(!0),e=new Array(i);for(let a=0;a<i;a++)e[a]=t.readShort();return e}readAnimation(t,i,e){t.readInt(!0);let a=new Array,r=this.scale,c=new L,n=new L;for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0);for(let u=0,m=t.readInt(!0);u<m;u++){let b=t.readByte(),p=t.readInt(!0),y=p-1;switch(b){case Ns:{let g=new yt(p,f);for(let w=0;w<p;w++)g.setFrame(w,t.readFloat(),t.readStringRef());a.push(g);break}case Os:{let g=t.readInt(!0),w=new ie(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255;for(let C=0,F=0;w.setFrame(C,x,v,A,S,I),C!=y;C++){let P=t.readFloat(),B=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,Y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(C);break;case ot:O(t,w,F++,C,0,x,P,v,B,1),O(t,w,F++,C,1,x,P,A,M,1),O(t,w,F++,C,2,x,P,S,Y,1),O(t,w,F++,C,3,x,P,I,T,1)}x=P,v=B,A=M,S=Y,I=T}a.push(w);break}case Us:{let g=t.readInt(!0),w=new re(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255;for(let I=0,C=0;w.setFrame(I,x,v,A,S),I!=y;I++){let F=t.readFloat(),P=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(I);break;case ot:O(t,w,C++,I,0,x,F,v,P,1),O(t,w,C++,I,1,x,F,A,B,1),O(t,w,C++,I,2,x,F,S,M,1)}x=F,v=P,A=B,S=M}a.push(w);break}case Ws:{let g=t.readInt(!0),w=new ne(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255;for(let B=0,M=0;w.setFrame(B,x,v,A,S,I,C,F,P),B!=y;B++){let Y=t.readFloat(),T=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,z=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,q=t.readUnsignedByte()/255,G=t.readUnsignedByte()/255,H=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(B);break;case ot:O(t,w,M++,B,0,x,Y,v,T,1),O(t,w,M++,B,1,x,Y,A,N,1),O(t,w,M++,B,2,x,Y,S,z,1),O(t,w,M++,B,3,x,Y,I,E,1),O(t,w,M++,B,4,x,Y,C,q,1),O(t,w,M++,B,5,x,Y,F,G,1),O(t,w,M++,B,6,x,Y,P,H,1)}x=Y,v=T,A=N,S=z,I=E,C=q,F=G,P=H}a.push(w);break}case zs:{let g=t.readInt(!0),w=new le(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255;for(let P=0,B=0;w.setFrame(P,x,v,A,S,I,C,F),P!=y;P++){let M=t.readFloat(),Y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,z=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,q=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(P);break;case ot:O(t,w,B++,P,0,x,M,v,Y,1),O(t,w,B++,P,1,x,M,A,T,1),O(t,w,B++,P,2,x,M,S,N,1),O(t,w,B++,P,3,x,M,I,z,1),O(t,w,B++,P,4,x,M,C,E,1),O(t,w,B++,P,5,x,M,F,q,1)}x=M,v=Y,A=T,S=N,I=z,C=E,F=q}a.push(w);break}case qs:{let g=new ae(p,t.readInt(!0),f),w=t.readFloat(),x=t.readUnsignedByte()/255;for(let v=0,A=0;g.setFrame(v,w,x),v!=y;v++){let S=t.readFloat(),I=t.readUnsignedByte()/255;switch(t.readByte()){case lt:g.setStepped(v);break;case ot:O(t,g,A++,v,0,w,S,x,I,1)}w=S,x=I}a.push(g);break}}}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0);for(let u=0,m=t.readInt(!0);u<m;u++){let b=t.readByte(),p=t.readInt(!0),y=t.readInt(!0);switch(b){case Xs:a.push(bt(t,new Rt(p,y,f),1));break;case Ms:a.push(Be(t,new Gt(p,y,f),r));break;case Fs:a.push(bt(t,new $t(p,y,f),r));break;case Bs:a.push(bt(t,new Jt(p,y,f),r));break;case Rs:a.push(Be(t,new Qt(p,y,f),1));break;case Ps:a.push(bt(t,new Kt(p,y,f),1));break;case Es:a.push(bt(t,new Zt(p,y,f),1));break;case Vs:a.push(Be(t,new te(p,y,f),1));break;case Ls:a.push(bt(t,new ee(p,y,f),1));break;case Ds:a.push(bt(t,new se(p,y,f),1))}}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),u=t.readInt(!0),m=u-1,b=new he(u,t.readInt(!0),f),p=t.readFloat(),y=t.readFloat(),g=t.readFloat()*r;for(let w=0,x=0;b.setFrame(w,p,y,g,t.readByte(),t.readBoolean(),t.readBoolean()),w!=m;w++){let v=t.readFloat(),A=t.readFloat(),S=t.readFloat()*r;switch(t.readByte()){case lt:b.setStepped(w);break;case ot:O(t,b,x++,w,0,p,v,y,A,1),O(t,b,x++,w,1,p,v,g,S,r)}p=v,y=A,g=S}a.push(b)}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),u=t.readInt(!0),m=u-1,b=new ce(u,t.readInt(!0),f),p=t.readFloat(),y=t.readFloat(),g=t.readFloat(),w=t.readFloat(),x=t.readFloat(),v=t.readFloat(),A=t.readFloat();for(let S=0,I=0;b.setFrame(S,p,y,g,w,x,v,A),S!=m;S++){let C=t.readFloat(),F=t.readFloat(),P=t.readFloat(),B=t.readFloat(),M=t.readFloat(),Y=t.readFloat(),T=t.readFloat();switch(t.readByte()){case lt:b.setStepped(S);break;case ot:O(t,b,I++,S,0,p,C,y,F,1),O(t,b,I++,S,1,p,C,g,P,1),O(t,b,I++,S,2,p,C,w,B,1),O(t,b,I++,S,3,p,C,x,M,1),O(t,b,I++,S,4,p,C,v,Y,1),O(t,b,I++,S,5,p,C,A,T,1)}p=C,y=F,g=P,w=B,x=M,v=Y,A=T}a.push(b)}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),u=e.pathConstraints[f];for(let m=0,b=t.readInt(!0);m<b;m++)switch(t.readByte()){case _s:a.push(bt(t,new de(t.readInt(!0),t.readInt(!0),f),u.positionMode==dt.Fixed?r:1));break;case Hs:a.push(bt(t,new fe(t.readInt(!0),t.readInt(!0),f),u.spacingMode==Q.Length||u.spacingMode==Q.Fixed?r:1));break;case js:let p=new ue(t.readInt(!0),t.readInt(!0),f),y=t.readFloat(),g=t.readFloat(),w=t.readFloat(),x=t.readFloat();for(let v=0,A=0,S=p.getFrameCount()-1;p.setFrame(v,y,g,w,x),v!=S;v++){let I=t.readFloat(),C=t.readFloat(),F=t.readFloat(),P=t.readFloat();switch(t.readByte()){case lt:p.setStepped(v);break;case ot:O(t,p,A++,v,0,y,I,g,C,1),O(t,p,A++,v,1,y,I,w,F,1),O(t,p,A++,v,2,y,I,x,P,1)}y=I,g=C,w=F,x=P}a.push(p)}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=e.skins[t.readInt(!0)];for(let u=0,m=t.readInt(!0);u<m;u++){let b=t.readInt(!0);for(let p=0,y=t.readInt(!0);p<y;p++){let g=t.readStringRef(),w=f.getAttachment(b,g),x=w.bones,v=w.vertices,A=x?v.length/3*2:v.length,S=t.readInt(!0),I=S-1,C=t.readInt(!0),F=new oe(S,C,b,w),P=t.readFloat();for(let B=0,M=0;;B++){let Y,T=t.readInt(!0);if(T==0)Y=x?R.newFloatArray(A):v;else{Y=R.newFloatArray(A);let z=t.readInt(!0);if(T+=z,r==1)for(let E=z;E<T;E++)Y[E]=t.readFloat();else for(let E=z;E<T;E++)Y[E]=t.readFloat()*r;if(!x)for(let E=0,q=Y.length;E<q;E++)Y[E]+=v[E]}if(F.setFrame(B,P,Y),B==I)break;let N=t.readFloat();switch(t.readByte()){case lt:F.setStepped(B);break;case ot:O(t,F,M++,B,0,P,N,0,1,1)}P=N}a.push(F)}}}let s=t.readInt(!0);if(s>0){let h=new vt(s),d=e.slots.length;for(let f=0;f<s;f++){let u=t.readFloat(),m=t.readInt(!0),b=R.newArray(d,0);for(let w=d-1;w>=0;w--)b[w]=-1;let p=R.newArray(d-m,0),y=0,g=0;for(let w=0;w<m;w++){let x=t.readInt(!0);for(;y!=x;)p[g++]=y++;b[y+t.readInt(!0)]=y++}for(;y<d;)p[g++]=y++;for(let w=d-1;w>=0;w--)b[w]==-1&&(b[w]=p[--g]);h.setFrame(f,u,b)}a.push(h)}let o=t.readInt(!0);if(o>0){let h=new Pt(o);for(let d=0;d<o;d++){let f=t.readFloat(),u=e.events[t.readInt(!0)],m=new ke(f,u);m.intValue=t.readInt(!1),m.floatValue=t.readFloat(),m.stringValue=t.readBoolean()?t.readString():u.stringValue,m.data.audioPath&&(m.volume=t.readFloat(),m.balance=t.readFloat()),h.setFrame(d,m)}a.push(h)}let l=0;for(let h=0,d=a.length;h<d;h++)l=Math.max(l,a[h].getDuration());return new Vt(i,a,l)}},as=class{constructor(t,i=new Array,e=0,a=new DataView(t.buffer)){this.strings=i,this.index=e,this.buffer=a}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let i=this.readByte(),e=i&127;return(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<7,(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<14,(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<21,(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<28)))),t?e:e>>>1^-(e&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let i="",e=0;for(let a=0;a<t;){let r=this.readByte();switch(r>>4){case 12:case 13:i+=String.fromCharCode((r&31)<<6|this.readByte()&63),a+=2;break;case 14:i+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),a+=3;break;default:i+=String.fromCharCode(r),a++}}return i}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}},Is=class{constructor(t,i,e,a,r){this.mesh=t,this.skin=i,this.slotIndex=e,this.parent=a,this.inheritDeform=r}},Ts=class{constructor(t=null,i=null){this.bones=t,this.vertices=i}},xt;(function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"})(xt||(xt={}));function bt(t,i,e){let a=t.readFloat(),r=t.readFloat()*e;for(let c=0,n=0,s=i.getFrameCount()-1;i.setFrame(c,a,r),c!=s;c++){let o=t.readFloat(),l=t.readFloat()*e;switch(t.readByte()){case lt:i.setStepped(c);break;case ot:O(t,i,n++,c,0,a,o,r,l,e)}a=o,r=l}return i}function Be(t,i,e){let a=t.readFloat(),r=t.readFloat()*e,c=t.readFloat()*e;for(let n=0,s=0,o=i.getFrameCount()-1;i.setFrame(n,a,r,c),n!=o;n++){let l=t.readFloat(),h=t.readFloat()*e,d=t.readFloat()*e;switch(t.readByte()){case lt:i.setStepped(n);break;case ot:O(t,i,s++,n,0,a,l,r,h,e),O(t,i,s++,n,1,a,l,c,d,e)}a=l,r=h,c=d}return i}function O(t,i,e,a,r,c,n,s,o,l){i.setBezier(e,a,r,c,s,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,n,o)}var Xs=0,Ms=1,Fs=2,Bs=3,Rs=4,Ps=5,Es=6,Vs=7,Ls=8,Ds=9,Ns=0,Os=1,Us=2,Ws=3,zs=4,qs=5,_s=0,Hs=1,js=2,lt=1,ot=2,Gs=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new Bt(()=>R.newFloatArray(16))}update(t,i){if(!t)throw new Error("skeleton cannot be null.");let e=this.boundingBoxes,a=this.polygons,r=this.polygonPool,c=t.slots,n=c.length;e.length=0,r.freeAll(a),a.length=0;for(let s=0;s<n;s++){let o=c[s];if(!o.bone.active)continue;let l=o.getAttachment();if(l instanceof Ot){let h=l;e.push(h);let d=r.obtain();d.length!=h.worldVerticesLength&&(d=R.newFloatArray(h.worldVerticesLength)),a.push(d),h.computeWorldVertices(o,0,h.worldVerticesLength,d,0,2)}}i?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,r=this.polygons;for(let c=0,n=r.length;c<n;c++){let s=r[c],o=s;for(let l=0,h=s.length;l<h;l+=2){let d=o[l],f=o[l+1];t=Math.min(t,d),i=Math.min(i,f),e=Math.max(e,d),a=Math.max(a,f)}}this.minX=t,this.minY=i,this.maxX=e,this.maxY=a}aabbContainsPoint(t,i){return t>=this.minX&&t<=this.maxX&&i>=this.minY&&i<=this.maxY}aabbIntersectsSegment(t,i,e,a){let r=this.minX,c=this.minY,n=this.maxX,s=this.maxY;if(t<=r&&e<=r||i<=c&&a<=c||t>=n&&e>=n||i>=s&&a>=s)return!1;let o=(a-i)/(e-t),l=o*(r-t)+i;if(l>c&&l<s||(l=o*(n-t)+i,l>c&&l<s))return!0;let h=(c-i)/o+t;return!!(h>r&&h<n||(h=(s-i)/o+t,h>r&&h<n))}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,i){let e=this.polygons;for(let a=0,r=e.length;a<r;a++)if(this.containsPointPolygon(e[a],t,i))return this.boundingBoxes[a];return null}containsPointPolygon(t,i,e){let a=t,r=t.length,c=r-2,n=!1;for(let s=0;s<r;s+=2){let o=a[s+1],l=a[c+1];if(o<e&&l>=e||l<e&&o>=e){let h=a[s];h+(e-o)/(l-o)*(a[c]-h)<i&&(n=!n)}c=s}return n}intersectsSegment(t,i,e,a){let r=this.polygons;for(let c=0,n=r.length;c<n;c++)if(this.intersectsSegmentPolygon(r[c],t,i,e,a))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(t,i,e,a,r){let c=t,n=t.length,s=i-a,o=e-r,l=i*r-e*a,h=c[n-2],d=c[n-1];for(let f=0;f<n;f+=2){let u=c[f],m=c[f+1],b=h*m-d*u,p=h-u,y=d-m,g=s*y-o*p,w=(l*p-s*b)/g;if((w>=h&&w<=u||w>=u&&w<=h)&&(w>=i&&w<=a||w>=a&&w<=i)){let x=(l*y-o*b)/g;if((x>=d&&x<=m||x>=m&&x<=d)&&(x>=e&&x<=r||x>=r&&x<=e))return!0}h=u,d=m}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let i=this.boundingBoxes.indexOf(t);return i==-1?null:this.polygons[i]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},st=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new Bt(()=>new Array),this.polygonIndicesPool=new Bt(()=>new Array)}triangulate(t){let i=t,e=t.length>>1,a=this.indicesArray;a.length=0;for(let n=0;n<e;n++)a[n]=n;let r=this.isConcaveArray;r.length=0;for(let n=0,s=e;n<s;++n)r[n]=st.isConcave(n,e,i,a);let c=this.triangles;for(c.length=0;e>3;){let n=e-1,s=0,o=1;for(;;){t:if(!r[s]){let d=a[n]<<1,f=a[s]<<1,u=a[o]<<1,m=i[d],b=i[d+1],p=i[f],y=i[f+1],g=i[u],w=i[u+1];for(let x=(o+1)%e;x!=n;x=(x+1)%e){if(!r[x])continue;let v=a[x]<<1,A=i[v],S=i[v+1];if(st.positiveArea(g,w,m,b,A,S)&&st.positiveArea(m,b,p,y,A,S)&&st.positiveArea(p,y,g,w,A,S))break t}break}if(o==0){do{if(!r[s])break;s--}while(s>0);break}n=s,s=o,o=(o+1)%e}c.push(a[(e+s-1)%e]),c.push(a[s]),c.push(a[(s+1)%e]),a.splice(s,1),r.splice(s,1),e--;let l=(e+s-1)%e,h=s==e?0:s;r[l]=st.isConcave(l,e,i,a),r[h]=st.isConcave(h,e,i,a)}return e==3&&(c.push(a[2]),c.push(a[0]),c.push(a[1])),c}decompose(t,i){let e=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let n=this.polygonPool.obtain();n.length=0;let s=-1,o=0;for(let l=0,h=i.length;l<h;l+=3){let d=i[l]<<1,f=i[l+1]<<1,u=i[l+2]<<1,m=e[d],b=e[d+1],p=e[f],y=e[f+1],g=e[u],w=e[u+1],x=!1;if(s==d){let v=n.length-4,A=st.winding(n[v],n[v+1],n[v+2],n[v+3],g,w),S=st.winding(g,w,n[0],n[1],n[2],n[3]);A==o&&S==o&&(n.push(g),n.push(w),c.push(u),x=!0)}x||(n.length>0?(a.push(n),r.push(c)):(this.polygonPool.free(n),this.polygonIndicesPool.free(c)),n=this.polygonPool.obtain(),n.length=0,n.push(m),n.push(b),n.push(p),n.push(y),n.push(g),n.push(w),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(u),o=st.winding(m,b,p,y,g,w),s=d)}n.length>0&&(a.push(n),r.push(c));for(let l=0,h=a.length;l<h;l++){if(c=r[l],c.length==0)continue;let d=c[0],f=c[c.length-1];n=a[l];let u=n.length-4,m=n[u],b=n[u+1],p=n[u+2],y=n[u+3],g=n[0],w=n[1],x=n[2],v=n[3],A=st.winding(m,b,p,y,g,w);for(let S=0;S<h;S++){if(S==l)continue;let I=r[S];if(I.length!=3)continue;let C=I[0],F=I[1],P=I[2],B=a[S],M=B[B.length-2],Y=B[B.length-1];if(C!=d||F!=f)continue;let T=st.winding(m,b,p,y,M,Y),N=st.winding(M,Y,g,w,x,v);T==A&&N==A&&(B.length=0,I.length=0,n.push(M),n.push(Y),c.push(P),m=p,b=y,p=M,y=Y,S=0)}}for(let l=a.length-1;l>=0;l--)n=a[l],n.length==0&&(a.splice(l,1),this.polygonPool.free(n),c=r[l],r.splice(l,1),this.polygonIndicesPool.free(c));return a}static isConcave(t,i,e,a){let r=a[(i+t-1)%i]<<1,c=a[t]<<1,n=a[(t+1)%i]<<1;return!this.positiveArea(e[r],e[r+1],e[c],e[c+1],e[n],e[n+1])}static positiveArea(t,i,e,a,r,c){return t*(c-a)+e*(i-c)+r*(a-i)>=0}static winding(t,i,e,a,r,c){let n=e-t,s=a-i;return r*s-c*n+n*i-t*s>=0?1:-1}},Re=class{constructor(){this.triangulator=new st,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(t,i){if(this.clipAttachment)return 0;this.clipAttachment=i;let e=i.worldVerticesLength,a=R.setArraySize(this.clippingPolygon,e);i.computeWorldVertices(t,0,e,a,0,2);let r=this.clippingPolygon;Re.makeClockwise(r);let c=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let n=0,s=c.length;n<s;n++){let o=c[n];Re.makeClockwise(o),o.push(o[0]),o.push(o[1])}return c.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){!this.clipAttachment||(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,i,e,a,r,c,n,s){let o=this.clipOutput,l=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=this.clippingPolygons.length,u=s?12:8,m=0;l.length=0,h.length=0;t:for(let b=0;b<a;b+=3){let p=e[b]<<1,y=t[p],g=t[p+1],w=r[p],x=r[p+1];p=e[b+1]<<1;let v=t[p],A=t[p+1],S=r[p],I=r[p+1];p=e[b+2]<<1;let C=t[p],F=t[p+1],P=r[p],B=r[p+1];for(let M=0;M<f;M++){let Y=l.length;if(this.clip(y,g,v,A,C,F,d[M],o)){let T=o.length;if(T==0)continue;let N=A-F,z=C-v,E=y-C,q=F-g,G=1/(N*E+z*(g-F)),H=T>>1,D=this.clipOutput,V=R.setArraySize(l,Y+H*u);for(let Z=0;Z<T;Z+=2){let ht=D[Z],K=D[Z+1];V[Y]=ht,V[Y+1]=K,V[Y+2]=c.r,V[Y+3]=c.g,V[Y+4]=c.b,V[Y+5]=c.a;let it=ht-C,rt=K-F,wt=(N*it+z*rt)*G,Xt=(q*it+E*rt)*G,Et=1-wt-Xt;V[Y+6]=w*wt+S*Xt+P*Et,V[Y+7]=x*wt+I*Xt+B*Et,s&&(V[Y+8]=n.r,V[Y+9]=n.g,V[Y+10]=n.b,V[Y+11]=n.a),Y+=u}Y=h.length;let j=R.setArraySize(h,Y+3*(H-2));H--;for(let Z=1;Z<H;Z++)j[Y]=m,j[Y+1]=m+Z,j[Y+2]=m+Z+1,Y+=3;m+=H+1}else{let T=R.setArraySize(l,Y+3*u);T[Y]=y,T[Y+1]=g,T[Y+2]=c.r,T[Y+3]=c.g,T[Y+4]=c.b,T[Y+5]=c.a,s?(T[Y+6]=w,T[Y+7]=x,T[Y+8]=n.r,T[Y+9]=n.g,T[Y+10]=n.b,T[Y+11]=n.a,T[Y+12]=v,T[Y+13]=A,T[Y+14]=c.r,T[Y+15]=c.g,T[Y+16]=c.b,T[Y+17]=c.a,T[Y+18]=S,T[Y+19]=I,T[Y+20]=n.r,T[Y+21]=n.g,T[Y+22]=n.b,T[Y+23]=n.a,T[Y+24]=C,T[Y+25]=F,T[Y+26]=c.r,T[Y+27]=c.g,T[Y+28]=c.b,T[Y+29]=c.a,T[Y+30]=P,T[Y+31]=B,T[Y+32]=n.r,T[Y+33]=n.g,T[Y+34]=n.b,T[Y+35]=n.a):(T[Y+6]=w,T[Y+7]=x,T[Y+8]=v,T[Y+9]=A,T[Y+10]=c.r,T[Y+11]=c.g,T[Y+12]=c.b,T[Y+13]=c.a,T[Y+14]=S,T[Y+15]=I,T[Y+16]=C,T[Y+17]=F,T[Y+18]=c.r,T[Y+19]=c.g,T[Y+20]=c.b,T[Y+21]=c.a,T[Y+22]=P,T[Y+23]=B),Y=h.length;let N=R.setArraySize(h,Y+3);N[Y]=m,N[Y+1]=m+1,N[Y+2]=m+2,m+=3;continue t}}}}clip(t,i,e,a,r,c,n,s){let o=s,l=!1,h=null;n.length%4>=2?(h=s,s=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(i),h.push(e),h.push(a),h.push(r),h.push(c),h.push(t),h.push(i),s.length=0;let d=n,f=n.length-4;for(let u=0;;u+=2){let m=d[u],b=d[u+1],p=d[u+2],y=d[u+3],g=m-p,w=b-y,x=h,v=h.length-2,A=s.length;for(let I=0;I<v;I+=2){let C=x[I],F=x[I+1],P=x[I+2],B=x[I+3],M=g*(B-y)-w*(P-p)>0;if(g*(F-y)-w*(C-p)>0){if(M){s.push(P),s.push(B);continue}let Y=B-F,T=P-C,N=Y*(p-m)-T*(y-b);if(Math.abs(N)>1e-6){let z=(T*(b-F)-Y*(m-C))/N;s.push(m+(p-m)*z),s.push(b+(y-b)*z)}else s.push(m),s.push(b)}else if(M){let Y=B-F,T=P-C,N=Y*(p-m)-T*(y-b);if(Math.abs(N)>1e-6){let z=(T*(b-F)-Y*(m-C))/N;s.push(m+(p-m)*z),s.push(b+(y-b)*z)}else s.push(m),s.push(b);s.push(P),s.push(B)}l=!0}if(A==s.length)return o.length=0,!0;if(s.push(s[0]),s.push(s[1]),u==f)break;let S=s;s=h,s.length=0,h=S}if(o!=s){o.length=0;for(let u=0,m=s.length-2;u<m;u++)o[u]=s[u]}else o.length=o.length-2;return l}static makeClockwise(t){let i=t,e=t.length,a=i[e-2]*i[1]-i[0]*i[e-1],r=0,c=0,n=0,s=0;for(let o=0,l=e-3;o<l;o+=2)r=i[o],c=i[o+1],n=i[o+2],s=i[o+3],a+=r*s-n*c;if(!(a<0))for(let o=0,l=e-2,h=e>>1;o<h;o+=2){let d=i[o],f=i[o+1],u=l-o;i[o]=i[u],i[o+1]=i[u+1],i[u]=d,i[u+1]=f}}},$s=class{constructor(t){this.attachmentLoader=null,this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let i=this.scale,e=new Te,a=typeof t=="string"?JSON.parse(t):t,r=a.skeleton;if(r&&(e.hash=r.hash,e.version=r.spine,e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height,e.fps=r.fps,e.imagesPath=r.images),a.bones)for(let c=0;c<a.bones.length;c++){let n=a.bones[c],s=null,o=k(n,"parent",null);o&&(s=e.findBone(o));let l=new Se(e.bones.length,n.name,s);l.length=k(n,"length",0)*i,l.x=k(n,"x",0)*i,l.y=k(n,"y",0)*i,l.rotation=k(n,"rotation",0),l.scaleX=k(n,"scaleX",1),l.scaleY=k(n,"scaleY",1),l.shearX=k(n,"shearX",0),l.shearY=k(n,"shearY",0),l.transformMode=R.enumValue(et,k(n,"transform","Normal")),l.skinRequired=k(n,"skin",!1);let h=k(n,"color",null);h&&l.color.setFromString(h),e.bones.push(l)}if(a.slots)for(let c=0;c<a.slots.length;c++){let n=a.slots[c],s=e.findBone(n.bone),o=new Me(e.slots.length,n.name,s),l=k(n,"color",null);l&&o.color.setFromString(l);let h=k(n,"dark",null);h&&(o.darkColor=L.fromString(h)),o.attachmentName=k(n,"attachment",null),o.blendMode=R.enumValue(zt,k(n,"blend","normal")),e.slots.push(o)}if(a.ik)for(let c=0;c<a.ik.length;c++){let n=a.ik[c],s=new Ce(n.name);s.order=k(n,"order",0),s.skinRequired=k(n,"skin",!1);for(let o=0;o<n.bones.length;o++)s.bones.push(e.findBone(n.bones[o]));s.target=e.findBone(n.target),s.mix=k(n,"mix",1),s.softness=k(n,"softness",0)*i,s.bendDirection=k(n,"bendPositive",!0)?1:-1,s.compress=k(n,"compress",!1),s.stretch=k(n,"stretch",!1),s.uniform=k(n,"uniform",!1),e.ikConstraints.push(s)}if(a.transform)for(let c=0;c<a.transform.length;c++){let n=a.transform[c],s=new Fe(n.name);s.order=k(n,"order",0),s.skinRequired=k(n,"skin",!1);for(let l=0;l<n.bones.length;l++)s.bones.push(e.findBone(n.bones[l]));let o=n.target;s.target=e.findBone(o),s.local=k(n,"local",!1),s.relative=k(n,"relative",!1),s.offsetRotation=k(n,"rotation",0),s.offsetX=k(n,"x",0)*i,s.offsetY=k(n,"y",0)*i,s.offsetScaleX=k(n,"scaleX",0),s.offsetScaleY=k(n,"scaleY",0),s.offsetShearY=k(n,"shearY",0),s.mixRotate=k(n,"mixRotate",1),s.mixX=k(n,"mixX",1),s.mixY=k(n,"mixY",s.mixX),s.mixScaleX=k(n,"mixScaleX",1),s.mixScaleY=k(n,"mixScaleY",s.mixScaleX),s.mixShearY=k(n,"mixShearY",1),e.transformConstraints.push(s)}if(a.path)for(let c=0;c<a.path.length;c++){let n=a.path[c],s=new Ie(n.name);s.order=k(n,"order",0),s.skinRequired=k(n,"skin",!1);for(let l=0;l<n.bones.length;l++)s.bones.push(e.findBone(n.bones[l]));let o=n.target;s.target=e.findSlot(o),s.positionMode=R.enumValue(dt,k(n,"positionMode","Percent")),s.spacingMode=R.enumValue(Q,k(n,"spacingMode","Length")),s.rotateMode=R.enumValue(kt,k(n,"rotateMode","Tangent")),s.offsetRotation=k(n,"rotation",0),s.position=k(n,"position",0),s.positionMode==dt.Fixed&&(s.position*=i),s.spacing=k(n,"spacing",0),(s.spacingMode==Q.Length||s.spacingMode==Q.Fixed)&&(s.spacing*=i),s.mixRotate=k(n,"mixRotate",1),s.mixX=k(n,"mixX",1),s.mixY=k(n,"mixY",s.mixX),e.pathConstraints.push(s)}if(a.skins)for(let c=0;c<a.skins.length;c++){let n=a.skins[c],s=new Wt(n.name);if(n.bones)for(let o=0;o<n.bones.length;o++)s.bones.push(e.findBone(n.bones[o]));if(n.ik)for(let o=0;o<n.ik.length;o++)s.constraints.push(e.findIkConstraint(n.ik[o]));if(n.transform)for(let o=0;o<n.transform.length;o++)s.constraints.push(e.findTransformConstraint(n.transform[o]));if(n.path)for(let o=0;o<n.path.length;o++)s.constraints.push(e.findPathConstraint(n.path[o]));for(let o in n.attachments){let l=e.findSlot(o),h=n.attachments[o];for(let d in h){let f=this.readAttachment(h[d],s,l.index,d,e);f&&s.setAttachment(l.index,d,f)}}e.skins.push(s),s.name=="default"&&(e.defaultSkin=s)}for(let c=0,n=this.linkedMeshes.length;c<n;c++){let s=this.linkedMeshes[c],l=(s.skin?e.findSkin(s.skin):e.defaultSkin).getAttachment(s.slotIndex,s.parent);s.mesh.deformAttachment=s.inheritDeform?l:s.mesh,s.mesh.setParentMesh(l),s.mesh.updateUVs()}if(this.linkedMeshes.length=0,a.events)for(let c in a.events){let n=a.events[c],s=new Ye(c);s.intValue=k(n,"int",0),s.floatValue=k(n,"float",0),s.stringValue=k(n,"string",""),s.audioPath=k(n,"audio",null),s.audioPath&&(s.volume=k(n,"volume",1),s.balance=k(n,"balance",0)),e.events.push(s)}if(a.animations)for(let c in a.animations){let n=a.animations[c];this.readAnimation(n,c,e)}return e}readAttachment(t,i,e,a,r){let c=this.scale;switch(a=k(t,"name",a),k(t,"type","region")){case"region":{let n=k(t,"path",a),s=this.attachmentLoader.newRegionAttachment(i,a,n);if(!s)return null;s.path=n,s.x=k(t,"x",0)*c,s.y=k(t,"y",0)*c,s.scaleX=k(t,"scaleX",1),s.scaleY=k(t,"scaleY",1),s.rotation=k(t,"rotation",0),s.width=t.width*c,s.height=t.height*c;let o=k(t,"color",null);return o&&s.color.setFromString(o),s.updateOffset(),s}case"boundingbox":{let n=this.attachmentLoader.newBoundingBoxAttachment(i,a);if(!n)return null;this.readVertices(t,n,t.vertexCount<<1);let s=k(t,"color",null);return s&&n.color.setFromString(s),n}case"mesh":case"linkedmesh":{let n=k(t,"path",a),s=this.attachmentLoader.newMeshAttachment(i,a,n);if(!s)return null;s.path=n;let o=k(t,"color",null);o&&s.color.setFromString(o),s.width=k(t,"width",0)*c,s.height=k(t,"height",0)*c;let l=k(t,"parent",null);if(l)return this.linkedMeshes.push(new Js(s,k(t,"skin",null),e,l,k(t,"deform",!0))),s;let h=t.uvs;return this.readVertices(t,s,h.length),s.triangles=t.triangles,s.regionUVs=h,s.updateUVs(),s.edges=k(t,"edges",null),s.hullLength=k(t,"hull",0)*2,s}case"path":{let n=this.attachmentLoader.newPathAttachment(i,a);if(!n)return null;n.closed=k(t,"closed",!1),n.constantSpeed=k(t,"constantSpeed",!0);let s=t.vertexCount;this.readVertices(t,n,s<<1);let o=R.newArray(s/3,0);for(let h=0;h<t.lengths.length;h++)o[h]=t.lengths[h]*c;n.lengths=o;let l=k(t,"color",null);return l&&n.color.setFromString(l),n}case"point":{let n=this.attachmentLoader.newPointAttachment(i,a);if(!n)return null;n.x=k(t,"x",0)*c,n.y=k(t,"y",0)*c,n.rotation=k(t,"rotation",0);let s=k(t,"color",null);return s&&n.color.setFromString(s),n}case"clipping":{let n=this.attachmentLoader.newClippingAttachment(i,a);if(!n)return null;let s=k(t,"end",null);s&&(n.endSlot=r.findSlot(s));let o=t.vertexCount;this.readVertices(t,n,o<<1);let l=k(t,"color",null);return l&&n.color.setFromString(l),n}}return null}readVertices(t,i,e){let a=this.scale;i.worldVerticesLength=e;let r=t.vertices;if(e==r.length){let s=R.toFloatArray(r);if(a!=1)for(let o=0,l=r.length;o<l;o++)s[o]*=a;i.vertices=s;return}let c=new Array,n=new Array;for(let s=0,o=r.length;s<o;){let l=r[s++];n.push(l);for(let h=s+l*4;s<h;s+=4)n.push(r[s]),c.push(r[s+1]*a),c.push(r[s+2]*a),c.push(r[s+3])}i.bones=n,i.vertices=R.toFloatArray(c)}readAnimation(t,i,e){let a=this.scale,r=new Array;if(t.slots)for(let n in t.slots){let s=t.slots[n],o=e.findSlot(n).index;for(let l in s){let h=s[l];if(!h)continue;let d=h.length;if(l=="attachment"){let f=new yt(d,o);for(let u=0;u<d;u++){let m=h[u];f.setFrame(u,k(m,"time",0),m.name)}r.push(f)}else if(l=="rgba"){let f=new ie(d,d<<2,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,m,b.r,b.g,b.b,b.a);let g=h[p+1];if(!g){f.shrink(y);break}let w=k(g,"time",0),x=L.fromString(g.color),v=u.curve;v&&(y=W(v,f,y,p,0,m,w,b.r,x.r,1),y=W(v,f,y,p,1,m,w,b.g,x.g,1),y=W(v,f,y,p,2,m,w,b.b,x.b,1),y=W(v,f,y,p,3,m,w,b.a,x.a,1)),m=w,b=x,u=g}r.push(f)}else if(l=="rgb"){let f=new re(d,d*3,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,m,b.r,b.g,b.b);let g=h[p+1];if(!g){f.shrink(y);break}let w=k(g,"time",0),x=L.fromString(g.color),v=u.curve;v&&(y=W(v,f,y,p,0,m,w,b.r,x.r,1),y=W(v,f,y,p,1,m,w,b.g,x.g,1),y=W(v,f,y,p,2,m,w,b.b,x.b,1)),m=w,b=x,u=g}r.push(f)}else if(l=="alpha")r.push(ft(h,new ae(d,d,o),0,1));else if(l=="rgba2"){let f=new ne(d,d*7,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.light),p=L.fromString(u.dark);for(let y=0,g=0;;y++){f.setFrame(y,m,b.r,b.g,b.b,b.a,p.r,p.g,p.b);let w=h[y+1];if(!w){f.shrink(g);break}let x=k(w,"time",0),v=L.fromString(w.light),A=L.fromString(w.dark),S=u.curve;S&&(g=W(S,f,g,y,0,m,x,b.r,v.r,1),g=W(S,f,g,y,1,m,x,b.g,v.g,1),g=W(S,f,g,y,2,m,x,b.b,v.b,1),g=W(S,f,g,y,3,m,x,b.a,v.a,1),g=W(S,f,g,y,4,m,x,p.r,A.r,1),g=W(S,f,g,y,5,m,x,p.g,A.g,1),g=W(S,f,g,y,6,m,x,p.b,A.b,1)),m=x,b=v,p=A,u=w}r.push(f)}else if(l=="rgb2"){let f=new le(d,d*6,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.light),p=L.fromString(u.dark);for(let y=0,g=0;;y++){f.setFrame(y,m,b.r,b.g,b.b,p.r,p.g,p.b);let w=h[y+1];if(!w){f.shrink(g);break}let x=k(w,"time",0),v=L.fromString(w.light),A=L.fromString(w.dark),S=u.curve;S&&(g=W(S,f,g,y,0,m,x,b.r,v.r,1),g=W(S,f,g,y,1,m,x,b.g,v.g,1),g=W(S,f,g,y,2,m,x,b.b,v.b,1),g=W(S,f,g,y,3,m,x,p.r,A.r,1),g=W(S,f,g,y,4,m,x,p.g,A.g,1),g=W(S,f,g,y,5,m,x,p.b,A.b,1)),m=x,b=v,p=A,u=w}r.push(f)}}}if(t.bones)for(let n in t.bones){let s=t.bones[n],o=e.findBone(n).index;for(let l in s){let h=s[l],d=h.length;if(d!=0){if(l==="rotate")r.push(ft(h,new Rt(d,d,o),0,1));else if(l==="translate"){let f=new Gt(d,d<<1,o);r.push(Pe(h,f,"x","y",0,a))}else if(l==="translatex"){let f=new $t(d,d,o);r.push(ft(h,f,0,a))}else if(l==="translatey"){let f=new Jt(d,d,o);r.push(ft(h,f,0,a))}else if(l==="scale"){let f=new Qt(d,d<<1,o);r.push(Pe(h,f,"x","y",1,1))}else if(l==="scalex"){let f=new Kt(d,d,o);r.push(ft(h,f,1,1))}else if(l==="scaley"){let f=new Zt(d,d,o);r.push(ft(h,f,1,1))}else if(l==="shear"){let f=new te(d,d<<1,o);r.push(Pe(h,f,"x","y",0,1))}else if(l==="shearx"){let f=new ee(d,d,o);r.push(ft(h,f,0,1))}else if(l==="sheary"){let f=new se(d,d,o);r.push(ft(h,f,0,1))}}}}if(t.ik)for(let n in t.ik){let s=t.ik[n],o=s[0];if(!o)continue;let l=e.findIkConstraint(n),h=e.ikConstraints.indexOf(l),d=new he(s.length,s.length<<1,h),f=k(o,"time",0),u=k(o,"mix",1),m=k(o,"softness",0)*a;for(let b=0,p=0;;b++){d.setFrame(b,f,u,m,k(o,"bendPositive",!0)?1:-1,k(o,"compress",!1),k(o,"stretch",!1));let y=s[b+1];if(!y){d.shrink(p);break}let g=k(y,"time",0),w=k(y,"mix",1),x=k(y,"softness",0)*a,v=o.curve;v&&(p=W(v,d,p,b,0,f,g,u,w,1),p=W(v,d,p,b,1,f,g,m,x,a)),f=g,u=w,m=x,o=y}r.push(d)}if(t.transform)for(let n in t.transform){let s=t.transform[n],o=s[0];if(!o)continue;let l=e.findTransformConstraint(n),h=e.transformConstraints.indexOf(l),d=new ce(s.length,s.length*6,h),f=k(o,"time",0),u=k(o,"mixRotate",1),m=k(o,"mixX",1),b=k(o,"mixY",m),p=k(o,"mixScaleX",1),y=k(o,"mixScaleY",p),g=k(o,"mixShearY",1);for(let w=0,x=0;;w++){d.setFrame(w,f,u,m,b,p,y,g);let v=s[w+1];if(!v){d.shrink(x);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),I=k(v,"mixX",1),C=k(v,"mixY",I),F=k(v,"mixScaleX",1),P=k(v,"mixScaleY",F),B=k(v,"mixShearY",1),M=o.curve;M&&(x=W(M,d,x,w,0,f,A,u,S,1),x=W(M,d,x,w,1,f,A,m,I,1),x=W(M,d,x,w,2,f,A,b,C,1),x=W(M,d,x,w,3,f,A,p,F,1),x=W(M,d,x,w,4,f,A,y,P,1),x=W(M,d,x,w,5,f,A,g,B,1)),f=A,u=S,m=I,b=C,p=F,y=P,p=F,o=v}r.push(d)}if(t.path)for(let n in t.path){let s=t.path[n],o=e.findPathConstraint(n),l=e.pathConstraints.indexOf(o);for(let h in s){let d=s[h],f=d[0];if(!f)continue;let u=d.length;if(h==="position"){let m=new de(u,u,l);r.push(ft(d,m,0,o.positionMode==dt.Fixed?a:1))}else if(h==="spacing"){let m=new fe(u,u,l);r.push(ft(d,m,0,o.spacingMode==Q.Length||o.spacingMode==Q.Fixed?a:1))}else if(h==="mix"){let m=new ue(u,u*3,l),b=k(f,"time",0),p=k(f,"mixRotate",1),y=k(f,"mixX",1),g=k(f,"mixY",y);for(let w=0,x=0;;w++){m.setFrame(w,b,p,y,g);let v=d[w+1];if(!v){m.shrink(x);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),I=k(v,"mixX",1),C=k(v,"mixY",I),F=f.curve;F&&(x=W(F,m,x,w,0,b,A,p,S,1),x=W(F,m,x,w,1,b,A,y,I,1),x=W(F,m,x,w,2,b,A,g,C,1)),b=A,p=S,y=I,g=C,f=v}r.push(m)}}}if(t.deform)for(let n in t.deform){let s=t.deform[n],o=e.findSkin(n);for(let l in s){let h=s[l],d=e.findSlot(l).index;for(let f in h){let u=h[f],m=u[0];if(!m)continue;let b=o.getAttachment(d,f),p=b.bones,y=b.vertices,g=p?y.length/3*2:y.length,w=new oe(u.length,u.length,d,b),x=k(m,"time",0);for(let v=0,A=0;;v++){let S,I=k(m,"vertices",null);if(!I)S=p?R.newFloatArray(g):y;else{S=R.newFloatArray(g);let B=k(m,"offset",0);if(R.arrayCopy(I,0,S,B,I.length),a!=1)for(let M=B,Y=M+I.length;M<Y;M++)S[M]*=a;if(!p)for(let M=0;M<g;M++)S[M]+=y[M]}w.setFrame(v,x,S);let C=u[v+1];if(!C){w.shrink(A);break}let F=k(C,"time",0),P=m.curve;P&&(A=W(P,w,A,v,0,x,F,0,1,1)),x=F,m=C}r.push(w)}}}if(t.drawOrder){let n=new vt(t.drawOrder.length),s=e.slots.length,o=0;for(let l=0;l<t.drawOrder.length;l++,o++){let h=t.drawOrder[l],d=null,f=k(h,"offsets",null);if(f){d=R.newArray(s,-1);let u=R.newArray(s-f.length,0),m=0,b=0;for(let p=0;p<f.length;p++){let y=f[p],g=e.findSlot(y.slot).index;for(;m!=g;)u[b++]=m++;d[m+y.offset]=m++}for(;m<s;)u[b++]=m++;for(let p=s-1;p>=0;p--)d[p]==-1&&(d[p]=u[--b])}n.setFrame(o,k(h,"time",0),d)}r.push(n)}if(t.events){let n=new Pt(t.events.length),s=0;for(let o=0;o<t.events.length;o++,s++){let l=t.events[o],h=e.findEvent(l.name),d=new ke(R.toSinglePrecision(k(l,"time",0)),h);d.intValue=k(l,"int",h.intValue),d.floatValue=k(l,"float",h.floatValue),d.stringValue=k(l,"string",h.stringValue),d.data.audioPath&&(d.volume=k(l,"volume",1),d.balance=k(l,"balance",0)),n.setFrame(s,d)}r.push(n)}let c=0;for(let n=0,s=r.length;n<s;n++)c=Math.max(c,r[n].getDuration());e.animations.push(new Vt(i,r,c))}},Js=class{constructor(t,i,e,a,r){this.mesh=t,this.skin=i,this.slotIndex=e,this.parent=a,this.inheritDeform=r}};function ft(t,i,e,a){let r=t[0],c=k(r,"time",0),n=k(r,"value",e)*a,s=0;for(let o=0;;o++){i.setFrame(o,c,n);let l=t[o+1];if(!l)return i.shrink(s),i;let h=k(l,"time",0),d=k(l,"value",e)*a;r.curve&&(s=W(r.curve,i,s,o,0,c,h,n,d,a)),c=h,n=d,r=l}}function Pe(t,i,e,a,r,c){let n=t[0],s=k(n,"time",0),o=k(n,e,r)*c,l=k(n,a,r)*c,h=0;for(let d=0;;d++){i.setFrame(d,s,o,l);let f=t[d+1];if(!f)return i.shrink(h),i;let u=k(f,"time",0),m=k(f,e,r)*c,b=k(f,a,r)*c,p=n.curve;p&&(h=W(p,i,h,d,0,s,u,o,m,c),h=W(p,i,h,d,1,s,u,l,b,c)),s=u,o=m,l=b,n=f}}function W(t,i,e,a,r,c,n,s,o,l){if(t=="stepped")return i.setStepped(a),e;let h=r<<2,d=t[h],f=t[h+1]*l,u=t[h+2],m=t[h+3]*l;return i.setBezier(e,a,r,c,s,d,f,u,m,n,o),e+1}function k(t,i,e){return t[i]!==void 0?t[i]:e}(()=>{typeof Math.fround=="undefined"&&(Math.fround=function(t){return function(i){return t[0]=i,t[0]}}(new Float32Array(1)))})();var Qs=class{constructor(t,i){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=i}begin(t){}transform(t,i,e,a){t.x+=X.randomTriangular(-this.jitterX,this.jitterY),t.y+=X.randomTriangular(-this.jitterX,this.jitterY)}end(){}},ns=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,i,e,a){let r=this.angle*X.degreesToRadians,c=t.x-this.worldX,n=t.y-this.worldY,s=Math.sqrt(c*c+n*n);if(s<this.radius){let o=ns.interpolation.apply(0,r,(this.radius-s)/this.radius),l=Math.cos(o),h=Math.sin(o);t.x=l*c-h*n+this.worldX,t.y=h*c+l*n+this.worldY}}end(){}},ls=ns;return ls.interpolation=new Ue(2),De})();
|
|
1
|
+
var spine=(()=>{var De=Object.defineProperty,us=t=>De(t,"__esModule",{value:!0}),ms=(t,i)=>{us(t);for(var e in i)De(t,e,{get:i[e],enumerable:!0})},Ne={};ms(Ne,{AlphaTimeline:()=>ne,Animation:()=>Lt,AnimationState:()=>ge,AnimationStateAdapter:()=>ps,AnimationStateData:()=>ys,AssetManagerBase:()=>ks,AtlasAttachmentLoader:()=>As,Attachment:()=>Gt,AttachmentTimeline:()=>yt,BinaryInput:()=>as,BlendMode:()=>qt,Bone:()=>ke,BoneData:()=>Ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>$e,ClippingAttachment:()=>ye,Color:()=>L,ConstraintData:()=>Wt,CurveTimeline:()=>at,CurveTimeline1:()=>nt,CurveTimeline2:()=>Dt,DebugUtils:()=>xs,DeformTimeline:()=>he,Downloader:()=>es,DrawOrderTimeline:()=>vt,Event:()=>Ye,EventData:()=>Ce,EventQueue:()=>je,EventTimeline:()=>Pt,EventType:()=>tt,FIRST:()=>xe,FakeTexture:()=>vs,HOLD_FIRST:()=>Ot,HOLD_MIX:()=>Ge,HOLD_SUBSEQUENT:()=>be,IkConstraint:()=>ss,IkConstraintData:()=>Ie,IkConstraintTimeline:()=>ce,IntSet:()=>gs,Interpolation:()=>Oe,JitterEffect:()=>Qs,MathUtils:()=>X,MeshAttachment:()=>Ct,MixBlend:()=>$,MixDirection:()=>mt,PathAttachment:()=>It,PathConstraint:()=>Tt,PathConstraintData:()=>Te,PathConstraintMixTimeline:()=>me,PathConstraintPositionTimeline:()=>fe,PathConstraintSpacingTimeline:()=>ue,PointAttachment:()=>Se,Pool:()=>Bt,PositionMode:()=>dt,Pow:()=>Ue,PowOut:()=>We,RGB2Timeline:()=>oe,RGBA2Timeline:()=>le,RGBATimeline:()=>re,RGBTimeline:()=>ae,RegionAttachment:()=>U,RotateMode:()=>kt,RotateTimeline:()=>Rt,SETUP:()=>we,SUBSEQUENT:()=>Nt,ScaleTimeline:()=>Kt,ScaleXTimeline:()=>Zt,ScaleYTimeline:()=>te,ShearTimeline:()=>ee,ShearXTimeline:()=>se,ShearYTimeline:()=>ie,Skeleton:()=>Ys,SkeletonBinary:()=>Cs,SkeletonBounds:()=>Gs,SkeletonClipping:()=>Pe,SkeletonData:()=>Xe,SkeletonJson:()=>$s,Skin:()=>zt,SkinEntry:()=>Me,Slot:()=>is,SlotData:()=>Fe,SpacingMode:()=>Q,StringSet:()=>jt,SwirlEffect:()=>ls,Texture:()=>Je,TextureAtlas:()=>Ke,TextureAtlasPage:()=>Ze,TextureAtlasRegion:()=>ve,TextureFilter:()=>St,TextureRegion:()=>Qe,TextureWrap:()=>At,TimeKeeper:()=>bs,Timeline:()=>J,TrackEntry:()=>He,TransformConstraint:()=>rs,TransformConstraintData:()=>Be,TransformConstraintTimeline:()=>de,TransformMode:()=>et,TranslateTimeline:()=>$t,TranslateXTimeline:()=>Jt,TranslateYTimeline:()=>Qt,Triangulator:()=>st,Utils:()=>R,Vector2:()=>Vt,VertexAttachment:()=>ct,WindowedMean:()=>ws});var gs=class{constructor(){this.array=new Array}add(t){let i=this.contains(t);return this.array[t|0]=t|0,!i}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}},jt=class{constructor(){this.entries={},this.size=0}add(t){let i=this.entries[t];return this.entries[t]=!0,i?!1:(this.size++,!0)}addAll(t){let i=this.size;for(var e=0,a=t.length;e<a;e++)this.add(t[e]);return i!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}},pt=class{constructor(t=0,i=0,e=0,a=0){this.r=t,this.g=i,this.b=e,this.a=a}set(t,i,e,a){return this.r=t,this.g=i,this.b=e,this.a=a,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,i,e,a){return this.r+=t,this.g+=i,this.b+=e,this.a+=a,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,i){t.r=((i&4278190080)>>>24)/255,t.g=((i&16711680)>>>16)/255,t.b=((i&65280)>>>8)/255,t.a=(i&255)/255}static rgb888ToColor(t,i){t.r=((i&16711680)>>>16)/255,t.g=((i&65280)>>>8)/255,t.b=(i&255)/255}static fromString(t){return new pt().setFromString(t)}},L=pt;L.WHITE=new pt(1,1,1,1),L.RED=new pt(1,0,0,1),L.GREEN=new pt(0,1,0,1),L.BLUE=new pt(0,0,1,1),L.MAGENTA=new pt(1,0,1,1);var ut=class{static clamp(t,i,e){return t<i?i:t>e?e:t}static cosDeg(t){return Math.cos(t*ut.degRad)}static sinDeg(t){return Math.sin(t*ut.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let i=Math.pow(Math.abs(t),1/3);return t<0?-i:i}static randomTriangular(t,i){return ut.randomTriangularWith(t,i,(t+i)*.5)}static randomTriangularWith(t,i,e){let a=Math.random(),r=i-t;return a<=(e-t)/r?t+Math.sqrt(a*r*(e-t)):i-Math.sqrt((1-a)*r*(i-e))}static isPowerOfTwo(t){return t&&(t&t-1)==0}},X=ut;X.PI=3.1415927,X.PI2=ut.PI*2,X.radiansToDegrees=180/ut.PI,X.radDeg=ut.radiansToDegrees,X.degreesToRadians=ut.PI/180,X.degRad=ut.degreesToRadians;var Oe=class{apply(t,i,e){return t+(i-t)*this.applyInternal(e)}},Ue=class extends Oe{constructor(t){super();this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}},We=class extends Ue{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},Yt=class{static arrayCopy(t,i,e,a,r){for(let c=i,n=a;c<i+r;c++,n++)e[n]=t[c]}static arrayFill(t,i,e,a){for(let r=i;r<e;r++)t[r]=a}static setArraySize(t,i,e=0){let a=t.length;if(a==i)return t;if(t.length=i,a<i)for(let r=a;r<i;r++)t[r]=e;return t}static ensureArrayCapacity(t,i,e=0){return t.length>=i?t:Yt.setArraySize(t,i,e)}static newArray(t,i){let e=new Array(t);for(let a=0;a<t;a++)e[a]=i;return e}static newFloatArray(t){if(Yt.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let i=new Array(t);for(let e=0;e<i.length;e++)i[e]=0;return i}}static newShortArray(t){if(Yt.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let i=new Array(t);for(let e=0;e<i.length;e++)i[e]=0;return i}}static toFloatArray(t){return Yt.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return Yt.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,i){}static contains(t,i,e=!0){for(var a=0;a<t.length;a++)if(t[a]==i)return!0;return!1}static enumValue(t,i){return t[i[0].toUpperCase()+i.slice(1)]}},R=Yt;R.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var xs=class{static logBones(t){for(let i=0;i<t.bones.length;i++){let e=t.bones[i];console.log(e.data.name+", "+e.a+", "+e.b+", "+e.c+", "+e.d+", "+e.worldX+", "+e.worldY)}}},Bt=class{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let i=0;i<t.length;i++)this.free(t[i])}clear(){this.items.length=0}},Vt=class{constructor(t=0,i=0){this.x=t,this.y=i}set(t,i){return this.x=t,this.y=i,this}length(){let t=this.x,i=this.y;return Math.sqrt(t*t+i*i)}normalize(){let t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}},bs=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},ws=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let i=0;i<this.values.length;i++)t+=this.values[i];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}},Gt=class{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}},ze=class extends Gt{constructor(t){super(t);this.id=ze.nextID++,this.bones=null,this.vertices=null,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVertices(t,i,e,a,r,c){e=r+(e>>1)*c;let n=t.bone.skeleton,s=t.deform,o=this.vertices,l=this.bones;if(!l){s.length>0&&(o=s);let u=t.bone,m=u.worldX,b=u.worldY,p=u.a,y=u.b,g=u.c,w=u.d;for(let x=i,v=r;v<e;x+=2,v+=c){let A=o[x],S=o[x+1];a[v]=A*p+S*y+m,a[v+1]=A*g+S*w+b}return}let h=0,d=0;for(let u=0;u<i;u+=2){let m=l[h];h+=m+1,d+=m}let f=n.bones;if(s.length==0)for(let u=r,m=d*3;u<e;u+=c){let b=0,p=0,y=l[h++];for(y+=h;h<y;h++,m+=3){let g=f[l[h]],w=o[m],x=o[m+1],v=o[m+2];b+=(w*g.a+x*g.b+g.worldX)*v,p+=(w*g.c+x*g.d+g.worldY)*v}a[u]=b,a[u+1]=p}else{let u=s;for(let m=r,b=d*3,p=d<<1;m<e;m+=c){let y=0,g=0,w=l[h++];for(w+=h;h<w;h++,b+=3,p+=2){let x=f[l[h]],v=o[b]+u[p],A=o[b+1]+u[p+1],S=o[b+2];y+=(v*x.a+A*x.b+x.worldX)*S,g+=(v*x.c+A*x.d+x.worldY)*S}a[m]=y,a[m+1]=g}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),R.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices?(t.vertices=R.newFloatArray(this.vertices.length),R.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment}},ct=ze;ct.nextID=0;var Lt=class{constructor(t,i,e){if(this.timelines=null,this.timelineIds=null,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(i),this.duration=e}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds=new jt;for(var i=0;i<t.length;i++)this.timelineIds.addAll(t[i].getPropertyIds())}hasTimeline(t){for(let i=0;i<t.length;i++)if(this.timelineIds.contains(t[i]))return!0;return!1}apply(t,i,e,a,r,c,n,s){if(!t)throw new Error("skeleton cannot be null.");a&&this.duration!=0&&(e%=this.duration,i>0&&(i%=this.duration));let o=this.timelines;for(let l=0,h=o.length;l<h;l++)o[l].apply(t,i,e,r,c,n,s)}},$;(function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"})($||($={}));var mt;(function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"})(mt||(mt={}));var _={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18},J=class{constructor(t,i){this.propertyIds=null,this.frames=null,this.propertyIds=i,this.frames=R.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,i){let e=t.length;for(let a=1;a<e;a++)if(t[a]>i)return a-1;return e-1}static search(t,i,e){let a=t.length;for(let r=e;r<a;r+=e)if(t[r]>i)return r-e;return a-e}},at=class extends J{constructor(t,i,e){super(t,e);this.curves=null,this.curves=R.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let e=R.newFloatArray(i);R.arrayCopy(this.curves,0,e,0,i),this.curves=e}}setBezier(t,i,e,a,r,c,n,s,o,l,h){let d=this.curves,f=this.getFrameCount()+t*18;e==0&&(d[i]=2+f);let u=(a-c*2+s)*.03,m=(r-n*2+o)*.03,b=((c-s)*3-a+l)*.006,p=((n-o)*3-r+h)*.006,y=u*2+b,g=m*2+p,w=(c-a)*.3+u+b*.16666667,x=(n-r)*.3+m+p*.16666667,v=a+w,A=r+x;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,x+=g,y+=b,g+=p,v+=w,A+=x}getBezierValue(t,i,e,a){let r=this.curves;if(r[a]>t){let o=this.frames[i],l=this.frames[i+e];return l+(t-o)/(r[a]-o)*(r[a+1]-l)}let c=a+18;for(a+=2;a<c;a+=2)if(r[a]>=t){let o=r[a-2],l=r[a-1];return l+(t-o)/(r[a]-o)*(r[a+1]-l)}i+=this.getFrameEntries();let n=r[c-2],s=r[c-1];return s+(t-n)/(this.frames[i]-n)*(this.frames[i+e]-s)}},nt=class extends at{constructor(t,i,e){super(t,i,[e])}getFrameEntries(){return 2}setFrame(t,i,e){t<<=1,this.frames[t]=i,this.frames[t+1]=e}getCurveValue(t){let i=this.frames,e=i.length-2;for(let r=2;r<=e;r+=2)if(i[r]>t){e=r-2;break}let a=this.curves[e>>1];switch(a){case 0:let r=i[e],c=i[e+1];return c+(t-r)/(i[e+2]-r)*(i[e+2+1]-c);case 1:return i[e+1]}return this.getBezierValue(t,e,1,a-2)}},Dt=class extends at{constructor(t,i,e,a){super(t,i,[e,a])}getFrameEntries(){return 3}setFrame(t,i,e,a){t*=3,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a}},Rt=class extends nt{constructor(t,i,e){super(t,i,_.rotate+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.rotation=s.data.rotation;return;case 1:s.rotation+=(s.data.rotation-s.rotation)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.rotation=s.data.rotation+l*r;break;case 1:case 2:l+=s.data.rotation-s.rotation;case 3:s.rotation+=l*r}}},$t=class extends Dt{constructor(t,i,e){super(t,i,_.x+"|"+e,_.y+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.x=s.data.x,s.y=s.data.y;return;case 1:s.x+=(s.data.x-s.x)*r,s.y+=(s.data.y-s.y)*r}return}let l=0,h=0,d=J.search(o,e,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+3]-u);l+=(o[d+3+1]-l)*m,h+=(o[d+3+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}switch(c){case 0:s.x=s.data.x+l*r,s.y=s.data.y+h*r;break;case 1:case 2:s.x+=(s.data.x+l-s.x)*r,s.y+=(s.data.y+h-s.y)*r;break;case 3:s.x+=l*r,s.y+=h*r}}},Jt=class extends nt{constructor(t,i,e){super(t,i,_.x+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.x=s.data.x;return;case 1:s.x+=(s.data.x-s.x)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.x=s.data.x+l*r;break;case 1:case 2:s.x+=(s.data.x+l-s.x)*r;break;case 3:s.x+=l*r}}},Qt=class extends nt{constructor(t,i,e){super(t,i,_.y+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.y=s.data.y;return;case 1:s.y+=(s.data.y-s.y)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.y=s.data.y+l*r;break;case 1:case 2:s.y+=(s.data.y+l-s.y)*r;break;case 3:s.y+=l*r}}},Kt=class extends Dt{constructor(t,i,e){super(t,i,_.scaleX+"|"+e,_.scaleY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.scaleX=s.data.scaleX,s.scaleY=s.data.scaleY;return;case 1:s.scaleX+=(s.data.scaleX-s.scaleX)*r,s.scaleY+=(s.data.scaleY-s.scaleY)*r}return}let l,h,d=J.search(o,e,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+3]-u);l+=(o[d+3+1]-l)*m,h+=(o[d+3+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}if(l*=s.data.scaleX,h*=s.data.scaleY,r==1)c==3?(s.scaleX+=l-s.data.scaleX,s.scaleY+=h-s.data.scaleY):(s.scaleX=l,s.scaleY=h);else{let u=0,m=0;if(n==1)switch(c){case 0:u=s.data.scaleX,m=s.data.scaleY,s.scaleX=u+(Math.abs(l)*X.signum(u)-u)*r,s.scaleY=m+(Math.abs(h)*X.signum(m)-m)*r;break;case 1:case 2:u=s.scaleX,m=s.scaleY,s.scaleX=u+(Math.abs(l)*X.signum(u)-u)*r,s.scaleY=m+(Math.abs(h)*X.signum(m)-m)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r,s.scaleY+=(h-s.data.scaleY)*r}else switch(c){case 0:u=Math.abs(s.data.scaleX)*X.signum(l),m=Math.abs(s.data.scaleY)*X.signum(h),s.scaleX=u+(l-u)*r,s.scaleY=m+(h-m)*r;break;case 1:case 2:u=Math.abs(s.scaleX)*X.signum(l),m=Math.abs(s.scaleY)*X.signum(h),s.scaleX=u+(l-u)*r,s.scaleY=m+(h-m)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r,s.scaleY+=(h-s.data.scaleY)*r}}}},Zt=class extends nt{constructor(t,i,e){super(t,i,_.scaleX+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.scaleX=s.data.scaleX;return;case 1:s.scaleX+=(s.data.scaleX-s.scaleX)*r}return}let l=this.getCurveValue(e)*s.data.scaleX;if(r==1)c==3?s.scaleX+=l-s.data.scaleX:s.scaleX=l;else{let h=0;if(n==1)switch(c){case 0:h=s.data.scaleX,s.scaleX=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 1:case 2:h=s.scaleX,s.scaleX=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r}else switch(c){case 0:h=Math.abs(s.data.scaleX)*X.signum(l),s.scaleX=h+(l-h)*r;break;case 1:case 2:h=Math.abs(s.scaleX)*X.signum(l),s.scaleX=h+(l-h)*r;break;case 3:s.scaleX+=(l-s.data.scaleX)*r}}}},te=class extends nt{constructor(t,i,e){super(t,i,_.scaleY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.scaleY=s.data.scaleY;return;case 1:s.scaleY+=(s.data.scaleY-s.scaleY)*r}return}let l=this.getCurveValue(e)*s.data.scaleY;if(r==1)c==3?s.scaleY+=l-s.data.scaleY:s.scaleY=l;else{let h=0;if(n==1)switch(c){case 0:h=s.data.scaleY,s.scaleY=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 1:case 2:h=s.scaleY,s.scaleY=h+(Math.abs(l)*X.signum(h)-h)*r;break;case 3:s.scaleY+=(l-s.data.scaleY)*r}else switch(c){case 0:h=Math.abs(s.data.scaleY)*X.signum(l),s.scaleY=h+(l-h)*r;break;case 1:case 2:h=Math.abs(s.scaleY)*X.signum(l),s.scaleY=h+(l-h)*r;break;case 3:s.scaleY+=(l-s.data.scaleY)*r}}}},ee=class extends Dt{constructor(t,i,e){super(t,i,_.shearX+"|"+e,_.shearY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.shearX=s.data.shearX,s.shearY=s.data.shearY;return;case 1:s.shearX+=(s.data.shearX-s.shearX)*r,s.shearY+=(s.data.shearY-s.shearY)*r}return}let l=0,h=0,d=J.search(o,e,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+3]-u);l+=(o[d+3+1]-l)*m,h+=(o[d+3+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}switch(c){case 0:s.shearX=s.data.shearX+l*r,s.shearY=s.data.shearY+h*r;break;case 1:case 2:s.shearX+=(s.data.shearX+l-s.shearX)*r,s.shearY+=(s.data.shearY+h-s.shearY)*r;break;case 3:s.shearX+=l*r,s.shearY+=h*r}}},se=class extends nt{constructor(t,i,e){super(t,i,_.shearX+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.shearX=s.data.shearX;return;case 1:s.shearX+=(s.data.shearX-s.shearX)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.shearX=s.data.shearX+l*r;break;case 1:case 2:s.shearX+=(s.data.shearX+l-s.shearX)*r;break;case 3:s.shearX+=l*r}}},ie=class extends nt{constructor(t,i,e){super(t,i,_.shearY+"|"+e);this.boneIndex=0,this.boneIndex=e}apply(t,i,e,a,r,c,n){let s=t.bones[this.boneIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.shearY=s.data.shearY;return;case 1:s.shearY+=(s.data.shearY-s.shearY)*r}return}let l=this.getCurveValue(e);switch(c){case 0:s.shearY=s.data.shearY+l*r;break;case 1:case 2:s.shearY+=(s.data.shearY+l-s.shearY)*r;break;case 3:s.shearY+=l*r}}},re=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e,_.alpha+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 5}setFrame(t,i,e,a,r,c){t*=5,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color;if(e<o[0]){let p=s.data.color;switch(c){case 0:l.setFromColor(p);return;case 1:l.add((p.r-l.r)*r,(p.g-l.g)*r,(p.b-l.b)*r,(p.a-l.a)*r)}return}let h=0,d=0,f=0,u=0,m=J.search(o,e,5),b=this.curves[m/5];switch(b){case 0:let p=o[m];h=o[m+1],d=o[m+2],f=o[m+3],u=o[m+4];let y=(e-p)/(o[m+5]-p);h+=(o[m+5+1]-h)*y,d+=(o[m+5+2]-d)*y,f+=(o[m+5+3]-f)*y,u+=(o[m+5+4]-u)*y;break;case 1:h=o[m+1],d=o[m+2],f=o[m+3],u=o[m+4];break;default:h=this.getBezierValue(e,m,1,b-2),d=this.getBezierValue(e,m,2,b+18-2),f=this.getBezierValue(e,m,3,b+18*2-2),u=this.getBezierValue(e,m,4,b+18*3-2)}r==1?l.set(h,d,f,u):(c==0&&l.setFromColor(s.data.color),l.add((h-l.r)*r,(d-l.g)*r,(f-l.b)*r,(u-l.a)*r))}},ae=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 4}setFrame(t,i,e,a,r){t<<=2,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color;if(e<o[0]){let b=s.data.color;switch(c){case 0:l.r=b.r,l.g=b.g,l.b=b.b;return;case 1:l.r+=(b.r-l.r)*r,l.g+=(b.g-l.g)*r,l.b+=(b.b-l.b)*r}return}let h=0,d=0,f=0,u=J.search(o,e,4),m=this.curves[u>>2];switch(m){case 0:let b=o[u];h=o[u+1],d=o[u+2],f=o[u+3];let p=(e-b)/(o[u+4]-b);h+=(o[u+4+1]-h)*p,d+=(o[u+4+2]-d)*p,f+=(o[u+4+3]-f)*p;break;case 1:h=o[u+1],d=o[u+2],f=o[u+3];break;default:h=this.getBezierValue(e,u,1,m-2),d=this.getBezierValue(e,u,2,m+18-2),f=this.getBezierValue(e,u,3,m+18*2-2)}if(r==1)l.r=h,l.g=d,l.b=f;else{if(c==0){let b=s.data.color;l.r=b.r,l.g=b.g,l.b=b.b}l.r+=(h-l.r)*r,l.g+=(d-l.g)*r,l.b+=(f-l.b)*r}}},ne=class extends nt{constructor(t,i,e){super(t,i,_.alpha+"|"+e);this.slotIndex=0,this.slotIndex=e}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=s.color;if(e<this.frames[0]){let h=s.data.color;switch(c){case 0:o.a=h.a;return;case 1:o.a+=(h.a-o.a)*r}return}let l=this.getCurveValue(e);r==1?o.a=l:(c==0&&(o.a=s.data.color.a),o.a+=(l-o.a)*r)}},le=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e,_.alpha+"|"+e,_.rgb2+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 8}setFrame(t,i,e,a,r,c,n,s,o){t<<=3,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c,this.frames[t+5]=n,this.frames[t+6]=s,this.frames[t+7]=o}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color,h=s.darkColor;if(e<o[0]){let x=s.data.color,v=s.data.darkColor;switch(c){case 0:l.setFromColor(x),h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:l.add((x.r-l.r)*r,(x.g-l.g)*r,(x.b-l.b)*r,(x.a-l.a)*r),h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,m=0,b=0,p=0,y=0,g=J.search(o,e,8),w=this.curves[g>>3];switch(w){case 0:let x=o[g];d=o[g+1],f=o[g+2],u=o[g+3],m=o[g+4],b=o[g+5],p=o[g+6],y=o[g+7];let v=(e-x)/(o[g+8]-x);d+=(o[g+8+1]-d)*v,f+=(o[g+8+2]-f)*v,u+=(o[g+8+3]-u)*v,m+=(o[g+8+4]-m)*v,b+=(o[g+8+5]-b)*v,p+=(o[g+8+6]-p)*v,y+=(o[g+8+7]-y)*v;break;case 1:d=o[g+1],f=o[g+2],u=o[g+3],m=o[g+4],b=o[g+5],p=o[g+6],y=o[g+7];break;default:d=this.getBezierValue(e,g,1,w-2),f=this.getBezierValue(e,g,2,w+18-2),u=this.getBezierValue(e,g,3,w+18*2-2),m=this.getBezierValue(e,g,4,w+18*3-2),b=this.getBezierValue(e,g,5,w+18*4-2),p=this.getBezierValue(e,g,6,w+18*5-2),y=this.getBezierValue(e,g,7,w+18*6-2)}if(r==1)l.set(d,f,u,m),h.r=b,h.g=p,h.b=y;else{if(c==0){l.setFromColor(s.data.color);let x=s.data.darkColor;h.r=x.r,h.g=x.g,h.b=x.b}l.add((d-l.r)*r,(f-l.g)*r,(u-l.b)*r,(m-l.a)*r),h.r+=(b-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},oe=class extends at{constructor(t,i,e){super(t,i,[_.rgb+"|"+e,_.rgb2+"|"+e]);this.slotIndex=0,this.slotIndex=e}getFrameEntries(){return 7}setFrame(t,i,e,a,r,c,n,s){t*=7,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c,this.frames[t+5]=n,this.frames[t+6]=s}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=this.frames,l=s.color,h=s.darkColor;if(e<o[0]){let x=s.data.color,v=s.data.darkColor;switch(c){case 0:l.r=x.r,l.g=x.g,l.b=x.b,h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:l.r+=(x.r-l.r)*r,l.g+=(x.g-l.g)*r,l.b+=(x.b-l.b)*r,h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,m=0,b=0,p=0,y=0,g=J.search(o,e,7),w=this.curves[g/7];switch(w){case 0:let x=o[g];d=o[g+1],f=o[g+2],u=o[g+3],b=o[g+4],p=o[g+5],y=o[g+6];let v=(e-x)/(o[g+7]-x);d+=(o[g+7+1]-d)*v,f+=(o[g+7+2]-f)*v,u+=(o[g+7+3]-u)*v,b+=(o[g+7+4]-b)*v,p+=(o[g+7+5]-p)*v,y+=(o[g+7+6]-y)*v;break;case 1:d=o[g+1],f=o[g+2],u=o[g+3],b=o[g+4],p=o[g+5],y=o[g+6];break;default:d=this.getBezierValue(e,g,1,w-2),f=this.getBezierValue(e,g,2,w+18-2),u=this.getBezierValue(e,g,3,w+18*2-2),b=this.getBezierValue(e,g,4,w+18*3-2),p=this.getBezierValue(e,g,5,w+18*4-2),y=this.getBezierValue(e,g,6,w+18*5-2)}if(r==1)l.r=d,l.g=f,l.b=u,h.r=b,h.g=p,h.b=y;else{if(c==0){let x=s.data.color,v=s.data.darkColor;l.r=x.r,l.g=x.g,l.b=x.b,h.r=v.r,h.g=v.g,h.b=v.b}l.r+=(d-l.r)*r,l.g+=(f-l.g)*r,l.b+=(u-l.b)*r,h.r+=(b-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},yt=class extends J{constructor(t,i){super(t,[_.attachment+"|"+i]);this.slotIndex=0,this.slotIndex=i,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,e){this.frames[t]=i,this.attachmentNames[t]=e}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!!s.bone.active){if(n==1){c==0&&this.setAttachment(t,s,s.data.attachmentName);return}if(e<this.frames[0]){(c==0||c==1)&&this.setAttachment(t,s,s.data.attachmentName);return}this.setAttachment(t,s,this.attachmentNames[J.search1(this.frames,e)])}}setAttachment(t,i,e){i.setAttachment(e?t.getAttachment(this.slotIndex,e):null)}},he=class extends at{constructor(t,i,e,a){super(t,i,[_.deform+"|"+e+"|"+a.id]);this.slotIndex=0,this.attachment=null,this.vertices=null,this.slotIndex=e,this.attachment=a,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,e){this.frames[t]=i,this.vertices[t]=e}setBezier(t,i,e,a,r,c,n,s,o,l,h){let d=this.curves,f=this.getFrameCount()+t*18;e==0&&(d[i]=2+f);let u=(a-c*2+s)*.03,m=o*.03-n*.06,b=((c-s)*3-a+l)*.006,p=(n-o+.33333333)*.018,y=u*2+b,g=m*2+p,w=(c-a)*.3+u+b*.16666667,x=n*.3+m+p*.16666667,v=a+w,A=x;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,x+=g,y+=b,g+=p,v+=w,A+=x}getCurvePercent(t,i){let e=this.curves,a=e[i];switch(a){case 0:let s=this.frames[i];return(t-s)/(this.frames[i+this.getFrameEntries()]-s);case 1:return 0}if(a-=2,e[a]>t){let s=this.frames[i];return e[a+1]*(t-s)/(e[a]-s)}let r=a+18;for(a+=2;a<r;a+=2)if(e[a]>=t){let s=e[a-2],o=e[a-1];return o+(t-s)/(e[a]-s)*(e[a+1]-o)}let c=e[r-2],n=e[r-1];return n+(1-n)*(t-c)/(this.frames[i+this.getFrameEntries()]-c)}apply(t,i,e,a,r,c,n){let s=t.slots[this.slotIndex];if(!s.bone.active)return;let o=s.getAttachment();if(!(o instanceof ct)||o.deformAttachment!=this.attachment)return;let l=s.deform;l.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(e<f[0]){let g=o;switch(c){case 0:l.length=0;return;case 1:if(r==1){l.length=0;return}if(l.length=d,g.bones){r=1-r;for(var u=0;u<d;u++)l[u]*=r}else{let w=g.vertices;for(var u=0;u<d;u++)l[u]+=(w[u]-l[u])*r}}return}if(l.length=d,e>=f[f.length-1]){let g=h[f.length-1];if(r==1)if(c==3){let w=o;if(w.bones)for(let x=0;x<d;x++)l[x]+=g[x];else{let x=w.vertices;for(let v=0;v<d;v++)l[v]+=g[v]-x[v]}}else R.arrayCopy(g,0,l,0,d);else switch(c){case 0:{let x=o;if(x.bones)for(let v=0;v<d;v++)l[v]=g[v]*r;else{let v=x.vertices;for(let A=0;A<d;A++){let S=v[A];l[A]=S+(g[A]-S)*r}}break}case 1:case 2:for(let x=0;x<d;x++)l[x]+=(g[x]-l[x])*r;break;case 3:let w=o;if(w.bones)for(let x=0;x<d;x++)l[x]+=g[x]*r;else{let x=w.vertices;for(let v=0;v<d;v++)l[v]+=(g[v]-x[v])*r}}return}let m=J.search1(f,e),b=this.getCurvePercent(e,m),p=h[m],y=h[m+1];if(r==1)if(c==3){let g=o;if(g.bones)for(let w=0;w<d;w++){let x=p[w];l[w]+=x+(y[w]-x)*b}else{let w=g.vertices;for(let x=0;x<d;x++){let v=p[x];l[x]+=v+(y[x]-v)*b-w[x]}}}else for(let g=0;g<d;g++){let w=p[g];l[g]=w+(y[g]-w)*b}else switch(c){case 0:{let w=o;if(w.bones)for(let x=0;x<d;x++){let v=p[x];l[x]=(v+(y[x]-v)*b)*r}else{let x=w.vertices;for(let v=0;v<d;v++){let A=p[v],S=x[v];l[v]=S+(A+(y[v]-A)*b-S)*r}}break}case 1:case 2:for(let w=0;w<d;w++){let x=p[w];l[w]+=(x+(y[w]-x)*b-l[w])*r}break;case 3:let g=o;if(g.bones)for(let w=0;w<d;w++){let x=p[w];l[w]+=(x+(y[w]-x)*b)*r}else{let w=g.vertices;for(let x=0;x<d;x++){let v=p[x];l[x]+=(v+(y[x]-v)*b-w[x])*r}}}}},qe=class extends J{constructor(t){super(t,qe.propertyIds);this.events=null,this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,e,a,r,c,n){if(!a)return;let s=this.frames,o=this.frames.length;if(i>e)this.apply(t,i,Number.MAX_VALUE,a,r,c,n),i=-1;else if(i>=s[o-1])return;if(e<s[0])return;let l=0;if(i<s[0])l=0;else{l=J.search1(s,i)+1;let h=s[l];for(;l>0&&s[l-1]==h;)l--}for(;l<o&&e>=s[l];l++)a.push(this.events[l])}},Pt=qe;Pt.propertyIds=[""+_.event];var _e=class extends J{constructor(t){super(t,_e.propertyIds);this.drawOrders=null,this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,e){this.frames[t]=i,this.drawOrders[t]=e}apply(t,i,e,a,r,c,n){if(n==1){c==0&&R.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(e<this.frames[0]){(c==0||c==1)&&R.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let s=this.drawOrders[J.search1(this.frames,e)];if(!s)R.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let o=t.drawOrder,l=t.slots;for(let h=0,d=s.length;h<d;h++)o[h]=l[s[h]]}}},vt=_e;vt.propertyIds=[""+_.drawOrder];var ce=class extends at{constructor(t,i,e){super(t,i,[_.ikConstraint+"|"+e]);this.ikConstraintIndex=0,this.ikConstraintIndex=e}getFrameEntries(){return 6}setFrame(t,i,e,a,r,c,n){t*=6,this.frames[t]=i,this.frames[t+1]=e,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=c?1:0,this.frames[t+5]=n?1:0}apply(t,i,e,a,r,c,n){let s=t.ikConstraints[this.ikConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.mix=s.data.mix,s.softness=s.data.softness,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch;return;case 1:s.mix+=(s.data.mix-s.mix)*r,s.softness+=(s.data.softness-s.softness)*r,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch}return}let l=0,h=0,d=J.search(o,e,6),f=this.curves[d/6];switch(f){case 0:let u=o[d];l=o[d+1],h=o[d+2];let m=(e-u)/(o[d+6]-u);l+=(o[d+6+1]-l)*m,h+=(o[d+6+2]-h)*m;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(e,d,1,f-2),h=this.getBezierValue(e,d,2,f+18-2)}c==0?(s.mix=s.data.mix+(l-s.data.mix)*r,s.softness=s.data.softness+(h-s.data.softness)*r,n==1?(s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch):(s.bendDirection=o[d+3],s.compress=o[d+4]!=0,s.stretch=o[d+5]!=0)):(s.mix+=(l-s.mix)*r,s.softness+=(h-s.softness)*r,n==0&&(s.bendDirection=o[d+3],s.compress=o[d+4]!=0,s.stretch=o[d+5]!=0))}},de=class extends at{constructor(t,i,e){super(t,i,[_.transformConstraint+"|"+e]);this.transformConstraintIndex=0,this.transformConstraintIndex=e}getFrameEntries(){return 7}setFrame(t,i,e,a,r,c,n,s){let o=this.frames;t*=7,o[t]=i,o[t+1]=e,o[t+2]=a,o[t+3]=r,o[t+4]=c,o[t+5]=n,o[t+6]=s}apply(t,i,e,a,r,c,n){let s=t.transformConstraints[this.transformConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){let y=s.data;switch(c){case 0:s.mixRotate=y.mixRotate,s.mixX=y.mixX,s.mixY=y.mixY,s.mixScaleX=y.mixScaleX,s.mixScaleY=y.mixScaleY,s.mixShearY=y.mixShearY;return;case 1:s.mixRotate+=(y.mixRotate-s.mixRotate)*r,s.mixX+=(y.mixX-s.mixX)*r,s.mixY+=(y.mixY-s.mixY)*r,s.mixScaleX+=(y.mixScaleX-s.mixScaleX)*r,s.mixScaleY+=(y.mixScaleY-s.mixScaleY)*r,s.mixShearY+=(y.mixShearY-s.mixShearY)*r}return}let l,h,d,f,u,m,b=J.search(o,e,7),p=this.curves[b/7];switch(p){case 0:let y=o[b];l=o[b+1],h=o[b+2],d=o[b+3],f=o[b+4],u=o[b+5],m=o[b+6];let g=(e-y)/(o[b+7]-y);l+=(o[b+7+1]-l)*g,h+=(o[b+7+2]-h)*g,d+=(o[b+7+3]-d)*g,f+=(o[b+7+4]-f)*g,u+=(o[b+7+5]-u)*g,m+=(o[b+7+6]-m)*g;break;case 1:l=o[b+1],h=o[b+2],d=o[b+3],f=o[b+4],u=o[b+5],m=o[b+6];break;default:l=this.getBezierValue(e,b,1,p-2),h=this.getBezierValue(e,b,2,p+18-2),d=this.getBezierValue(e,b,3,p+18*2-2),f=this.getBezierValue(e,b,4,p+18*3-2),u=this.getBezierValue(e,b,5,p+18*4-2),m=this.getBezierValue(e,b,6,p+18*5-2)}if(c==0){let y=s.data;s.mixRotate=y.mixRotate+(l-y.mixRotate)*r,s.mixX=y.mixX+(h-y.mixX)*r,s.mixY=y.mixY+(d-y.mixY)*r,s.mixScaleX=y.mixScaleX+(f-y.mixScaleX)*r,s.mixScaleY=y.mixScaleY+(u-y.mixScaleY)*r,s.mixShearY=y.mixShearY+(m-y.mixShearY)*r}else s.mixRotate+=(l-s.mixRotate)*r,s.mixX+=(h-s.mixX)*r,s.mixY+=(d-s.mixY)*r,s.mixScaleX+=(f-s.mixScaleX)*r,s.mixScaleY+=(u-s.mixScaleY)*r,s.mixShearY+=(m-s.mixShearY)*r}},fe=class extends nt{constructor(t,i,e){super(t,i,_.pathConstraintPosition+"|"+e);this.pathConstraintIndex=0,this.pathConstraintIndex=e}apply(t,i,e,a,r,c,n){let s=t.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.position=s.data.position;return;case 1:s.position+=(s.data.position-s.position)*r}return}let l=this.getCurveValue(e);c==0?s.position=s.data.position+(l-s.data.position)*r:s.position+=(l-s.position)*r}},ue=class extends nt{constructor(t,i,e){super(t,i,_.pathConstraintSpacing+"|"+e);this.pathConstraintIndex=0,this.pathConstraintIndex=e}apply(t,i,e,a,r,c,n){let s=t.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.spacing=s.data.spacing;return;case 1:s.spacing+=(s.data.spacing-s.spacing)*r}return}let l=this.getCurveValue(e);c==0?s.spacing=s.data.spacing+(l-s.data.spacing)*r:s.spacing+=(l-s.spacing)*r}},me=class extends at{constructor(t,i,e){super(t,i,[_.pathConstraintMix+"|"+e]);this.pathConstraintIndex=0,this.pathConstraintIndex=e}getFrameEntries(){return 4}setFrame(t,i,e,a,r){let c=this.frames;t<<=2,c[t]=i,c[t+1]=e,c[t+2]=a,c[t+3]=r}apply(t,i,e,a,r,c,n){let s=t.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let o=this.frames;if(e<o[0]){switch(c){case 0:s.mixRotate=s.data.mixRotate,s.mixX=s.data.mixX,s.mixY=s.data.mixY;return;case 1:s.mixRotate+=(s.data.mixRotate-s.mixRotate)*r,s.mixX+=(s.data.mixX-s.mixX)*r,s.mixY+=(s.data.mixY-s.mixY)*r}return}let l,h,d,f=J.search(o,e,4),u=this.curves[f>>2];switch(u){case 0:let m=o[f];l=o[f+1],h=o[f+2],d=o[f+3];let b=(e-m)/(o[f+4]-m);l+=(o[f+4+1]-l)*b,h+=(o[f+4+2]-h)*b,d+=(o[f+4+3]-d)*b;break;case 1:l=o[f+1],h=o[f+2],d=o[f+3];break;default:l=this.getBezierValue(e,f,1,u-2),h=this.getBezierValue(e,f,2,u+18-2),d=this.getBezierValue(e,f,3,u+18*2-2)}if(c==0){let m=s.data;s.mixRotate=m.mixRotate+(l-m.mixRotate)*r,s.mixX=m.mixX+(h-m.mixX)*r,s.mixY=m.mixY+(d-m.mixY)*r}else s.mixRotate+=(l-s.mixRotate)*r,s.mixX+=(h-s.mixX)*r,s.mixY+=(d-s.mixY)*r}},ge=class{constructor(t){this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new je(this),this.propertyIDs=new jt,this.animationsChanged=!1,this.trackEntryPool=new Bt(()=>new He),this.data=t}static emptyAnimation(){return pe||(pe=new Lt("<empty>",[],0)),pe}update(t){t*=this.timeScale;let i=this.tracks;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let c=t*r.timeScale;if(r.delay>0){if(r.delay-=c,r.delay>0)continue;c=-r.delay,r.delay=0}let n=r.next;if(n){let s=r.trackLast-n.delay;if(s>=0){for(n.delay=0,n.trackTime+=r.timeScale==0?0:(s/r.timeScale+t)*n.timeScale,r.trackTime+=c,this.setCurrent(e,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){i[e]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){let s=r.mixingFrom;for(r.mixingFrom=null,s&&(s.mixingTo=null);s;)this.queue.end(s),s=s.mixingFrom}r.trackTime+=c}this.queue.drain()}updateMixingFrom(t,i){let e=t.mixingFrom;if(!e)return!0;let a=this.updateMixingFrom(e,i);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?((e.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=e.mixingFrom,e.mixingFrom&&(e.mixingFrom.mixingTo=t),t.interruptAlpha=e.interruptAlpha,this.queue.end(e)),a):(e.trackTime+=i*e.timeScale,t.mixTime+=i,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let i=this.events,e=this.tracks,a=!1;for(let d=0,f=e.length;d<f;d++){let u=e[d];if(!u||u.delay>0)continue;a=!0;let m=d==0?$.first:u.mixBlend,b=u.alpha;u.mixingFrom?b*=this.applyMixingFrom(u,t,m):u.trackTime>=u.trackEnd&&!u.next&&(b=0);let p=u.animationLast,y=u.getAnimationTime(),g=y,w=i;u.reverse&&(g=u.animation.duration-g,w=null);let x=u.animation.timelines,v=x.length;if(d==0&&b==1||m==$.add)for(let A=0;A<v;A++){R.webkit602BugfixHelper(b,m);var r=x[A];r instanceof yt?this.applyAttachmentTimeline(r,t,g,m,!0):r.apply(t,p,g,w,b,m,mt.mixIn)}else{let A=u.timelineMode,S=u.timelinesRotation.length!=v<<1;S&&(u.timelinesRotation.length=v<<1);for(let I=0;I<v;I++){let C=x[I],F=A[I]==Nt?m:$.setup;C instanceof Rt?this.applyRotateTimeline(C,t,g,b,F,u.timelinesRotation,I<<1,S):C instanceof yt?this.applyAttachmentTimeline(C,t,g,m,!0):(R.webkit602BugfixHelper(b,m),C.apply(t,p,g,w,b,F,mt.mixIn))}}this.queueEvents(u,y),i.length=0,u.nextAnimationLast=y,u.nextTrackLast=u.trackTime}for(var c=this.unkeyedState+we,n=t.slots,s=0,o=t.slots.length;s<o;s++){var l=n[s];if(l.attachmentState==c){var h=l.data.attachmentName;l.setAttachment(h?t.getAttachment(l.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),a}applyMixingFrom(t,i,e){let a=t.mixingFrom;a.mixingFrom&&this.applyMixingFrom(a,i,e);let r=0;t.mixDuration==0?(r=1,e==$.first&&(e=$.setup)):(r=t.mixTime/t.mixDuration,r>1&&(r=1),e!=$.first&&(e=a.mixBlend));let c=r<a.attachmentThreshold,n=r<a.drawOrderThreshold,s=a.animation.timelines,o=s.length,l=a.alpha*t.interruptAlpha,h=l*(1-r),d=a.animationLast,f=a.getAnimationTime(),u=f,m=null;if(a.reverse?u=a.animation.duration-u:r<a.eventThreshold&&(m=this.events),e==$.add)for(let b=0;b<o;b++)s[b].apply(i,d,u,m,h,e,mt.mixOut);else{let b=a.timelineMode,p=a.timelineHoldMix,y=a.timelinesRotation.length!=o<<1;y&&(a.timelinesRotation.length=o<<1),a.totalAlpha=0;for(let g=0;g<o;g++){let w=s[g],x=mt.mixOut,v,A=0;switch(b[g]){case Nt:if(!n&&w instanceof vt)continue;v=e,A=h;break;case xe:v=$.setup,A=h;break;case be:v=e,A=l;break;case Ot:v=$.setup,A=l;break;default:v=$.setup;let S=p[g];A=l*Math.max(0,1-S.mixTime/S.mixDuration);break}a.totalAlpha+=A,w instanceof Rt?this.applyRotateTimeline(w,i,u,A,v,a.timelinesRotation,g<<1,y):w instanceof yt?this.applyAttachmentTimeline(w,i,u,v,c):(R.webkit602BugfixHelper(A,e),n&&w instanceof vt&&v==$.setup&&(x=mt.mixIn),w.apply(i,d,u,m,A,v,x))}}return t.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(t,i,e,a,r){var c=i.slots[t.slotIndex];!c.bone.active||(e<t.frames[0]?(a==$.setup||a==$.first)&&this.setAttachment(i,c,c.data.attachmentName,r):this.setAttachment(i,c,t.attachmentNames[J.search1(t.frames,e)],r),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+we))}setAttachment(t,i,e,a){i.setAttachment(e?t.getAttachment(i.data.index,e):null),a&&(i.attachmentState=this.unkeyedState+$e)}applyRotateTimeline(t,i,e,a,r,c,n,s){if(s&&(c[n]=0),a==1){t.apply(i,0,e,null,1,r,mt.mixIn);return}let o=i.bones[t.boneIndex];if(!o.active)return;let l=t.frames,h=0,d=0;if(e<l[0])switch(r){case $.setup:o.rotation=o.data.rotation;default:return;case $.first:h=o.rotation,d=o.data.rotation}else h=r==$.setup?o.data.rotation:o.rotation,d=o.data.rotation+t.getCurveValue(e);let f=0,u=d-h;if(u-=(16384-(16384.499999999996-u/360|0))*360,u==0)f=c[n];else{let m=0,b=0;s?(m=0,b=u):(m=c[n],b=c[n+1]);let p=u>0,y=m>=0;X.signum(b)!=X.signum(u)&&Math.abs(b)<=90&&(Math.abs(m)>180&&(m+=360*X.signum(m)),y=p),f=u+m-m%360,y!=p&&(f+=360*X.signum(m)),c[n]=f}c[n+1]=u,o.rotation=h+f*a}queueEvents(t,i){let e=t.animationStart,a=t.animationEnd,r=a-e,c=t.trackLast%r,n=this.events,s=0,o=n.length;for(;s<o;s++){let h=n[s];if(h.time<c)break;h.time>a||this.queue.event(t,h)}let l=!1;for(t.loop?l=r==0||c>t.trackTime%r:l=i>=a&&t.animationLast<a,l&&this.queue.complete(t);s<o;s++){let h=n[s];h.time<e||this.queue.event(t,h)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,e=this.tracks.length;i<e;i++)this.clearTrack(i);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let i=this.tracks[t];if(!i)return;this.queue.end(i),this.clearNext(i);let e=i;for(;;){let a=e.mixingFrom;if(!a)break;this.queue.end(a),e.mixingFrom=null,e.mixingTo=null,e=a}this.tracks[i.trackIndex]=null,this.queue.drain()}setCurrent(t,i,e){let a=this.expandToIndex(t);this.tracks[t]=i,i.previous=null,a&&(e&&this.queue.interrupt(a),i.mixingFrom=a,a.mixingTo=i,i.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(i.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(i)}setAnimation(t,i,e=!1){let a=this.data.skeletonData.findAnimation(i);if(!a)throw new Error("Animation not found: "+i);return this.setAnimationWith(t,a,e)}setAnimationWith(t,i,e=!1){if(!i)throw new Error("animation cannot be null.");let a=!0,r=this.expandToIndex(t);r&&(r.nextTrackLast==-1?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));let c=this.trackEntry(t,i,e,r);return this.setCurrent(t,c,a),this.queue.drain(),c}addAnimation(t,i,e=!1,a=0){let r=this.data.skeletonData.findAnimation(i);if(!r)throw new Error("Animation not found: "+i);return this.addAnimationWith(t,r,e,a)}addAnimationWith(t,i,e=!1,a=0){if(!i)throw new Error("animation cannot be null.");let r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;let c=this.trackEntry(t,i,e,r);return r?(r.next=c,c.previous=r,a<=0&&(a+=r.getTrackComplete()-c.mixDuration)):(this.setCurrent(t,c,!0),this.queue.drain()),c.delay=a,c}setEmptyAnimation(t,i=0){let e=this.setAnimationWith(t,ge.emptyAnimation(),!1);return e.mixDuration=i,e.trackEnd=i,e}addEmptyAnimation(t,i=0,e=0){let a=this.addAnimationWith(t,ge.emptyAnimation(),!1,e);return e<=0&&(a.delay+=a.mixDuration-i),a.mixDuration=i,a.trackEnd=i,a}setEmptyAnimations(t=0){let i=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,a=this.tracks.length;e<a;e++){let r=this.tracks[e];r&&this.setEmptyAnimation(r.trackIndex,t)}this.queue.drainDisabled=i,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(R.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,i,e,a){let r=this.trackEntryPool.obtain();return r.reset(),r.trackIndex=t,r.animation=i,r.loop=e,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=i.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=a?this.data.getMix(a.animation,i):0,r.mixBlend=$.replace,r}clearNext(t){let i=t.next;for(;i;)this.queue.dispose(i),i=i.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let i=0,e=t.length;i<e;i++){let a=t[i];if(!!a){for(;a.mixingFrom;)a=a.mixingFrom;do(!a.mixingTo||a.mixBlend!=$.add)&&this.computeHold(a),a=a.mixingTo;while(a)}}}computeHold(t){let i=t.mixingTo,e=t.animation.timelines,a=t.animation.timelines.length,r=t.timelineMode;r.length=a;let c=t.timelineHoldMix;c.length=0;let n=this.propertyIDs;if(i&&i.holdPrevious){for(let s=0;s<a;s++)r[s]=n.addAll(e[s].getPropertyIds())?Ot:be;return}t:for(let s=0;s<a;s++){let o=e[s],l=o.getPropertyIds();if(!n.addAll(l))r[s]=Nt;else if(!i||o instanceof yt||o instanceof vt||o instanceof Pt||!i.animation.hasTimeline(l))r[s]=xe;else{for(let h=i.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(l)){if(t.mixDuration>0){r[s]=Ge,c[s]=h;continue t}break}r[s]=Ot}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let i=this.listeners.indexOf(t);i>=0&&this.listeners.splice(i,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},He=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=$.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return t==0?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(t!=0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}},je=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=null,this.animState=t}start(t){this.objects.push(tt.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(tt.interrupt),this.objects.push(t)}end(t){this.objects.push(tt.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(tt.dispose),this.objects.push(t)}complete(t){this.objects.push(tt.complete),this.objects.push(t)}event(t,i){this.objects.push(tt.event),this.objects.push(t),this.objects.push(i)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,i=this.animState.listeners;for(let e=0;e<t.length;e+=2){let a=t[e],r=t[e+1];switch(a){case tt.start:r.listener&&r.listener.start&&r.listener.start(r);for(let n=0;n<i.length;n++)i[n].start&&i[n].start(r);break;case tt.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let n=0;n<i.length;n++)i[n].interrupt&&i[n].interrupt(r);break;case tt.end:r.listener&&r.listener.end&&r.listener.end(r);for(let n=0;n<i.length;n++)i[n].end&&i[n].end(r);case tt.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let n=0;n<i.length;n++)i[n].dispose&&i[n].dispose(r);this.animState.trackEntryPool.free(r);break;case tt.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let n=0;n<i.length;n++)i[n].complete&&i[n].complete(r);break;case tt.event:let c=t[e+++2];r.listener&&r.listener.event&&r.listener.event(r,c);for(let n=0;n<i.length;n++)i[n].event&&i[n].event(r,c);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},tt;(function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"})(tt||(tt={}));var ps=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,i){}},Nt=0,xe=1,be=2,Ot=3,Ge=4,we=1,$e=2,pe=null,ys=class{constructor(t){if(this.skeletonData=null,this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,i,e){let a=this.skeletonData.findAnimation(t);if(!a)throw new Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(i);if(!r)throw new Error("Animation not found: "+i);this.setMixWith(a,r,e)}setMixWith(t,i,e){if(!t)throw new Error("from cannot be null.");if(!i)throw new Error("to cannot be null.");let a=t.name+"."+i.name;this.animationToMixTime[a]=e}getMix(t,i){let e=t.name+"."+i.name,a=this.animationToMixTime[e];return a===void 0?this.defaultMix:a}},Ut=class extends ct{constructor(t){super(t);this.color=new L(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},ye=class extends ct{constructor(t){super(t);this.endSlot=null,this.color=new L(.2275,.2275,.8078,1)}copy(){let t=new ye(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},Je=class{constructor(t){this._image=t}getImage(){return this._image}},St;(function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"})(St||(St={}));var At;(function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"})(At||(At={}));var Qe=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},vs=class extends Je{setFilters(t,i){}setWraps(t,i){}dispose(){}},Ke=class{constructor(t){this.pages=new Array,this.regions=new Array;let i=new Ss(t),e=new Array(4),a=null,r=null,c={};c.size=()=>{a.width=parseInt(e[1]),a.height=parseInt(e[2])},c.format=()=>{},c.filter=()=>{a.minFilter=R.enumValue(St,e[1]),a.magFilter=R.enumValue(St,e[2])},c.repeat=()=>{e[1].indexOf("x")!=-1&&(a.uWrap=At.Repeat),e[1].indexOf("y")!=-1&&(a.vWrap=At.Repeat)},c.pma=()=>{a.pma=e[1]=="true"};var n={};n.xy=()=>{r.x=parseInt(e[1]),r.y=parseInt(e[2])},n.size=()=>{r.width=parseInt(e[1]),r.height=parseInt(e[2])},n.bounds=()=>{r.x=parseInt(e[1]),r.y=parseInt(e[2]),r.width=parseInt(e[3]),r.height=parseInt(e[4])},n.offset=()=>{r.offsetX=parseInt(e[1]),r.offsetY=parseInt(e[2])},n.orig=()=>{r.originalWidth=parseInt(e[1]),r.originalHeight=parseInt(e[2])},n.offsets=()=>{r.offsetX=parseInt(e[1]),r.offsetY=parseInt(e[2]),r.originalWidth=parseInt(e[3]),r.originalHeight=parseInt(e[4])},n.rotate=()=>{let h=e[1];h=="true"?r.degrees=90:h!="false"&&(r.degrees=parseInt(h))},n.index=()=>{r.index=parseInt(e[1])};let s=i.readLine();for(;s&&s.trim().length==0;)s=i.readLine();for(;!(!s||s.trim().length==0||i.readEntry(e,s)==0);)s=i.readLine();let o=null,l=null;for(;s!==null;)if(s.trim().length==0)a=null,s=i.readLine();else if(a){for(r=new ve,r.page=a,r.name=s;;){let h=i.readEntry(e,s=i.readLine());if(h==0)break;let d=n[e[0]];if(d)d();else{o||(o=[],l=[]),o.push(e[0]);let f=[];for(let u=0;u<h;u++)f.push(parseInt(e[u+1]));l.push(f)}}r.originalWidth==0&&r.originalHeight==0&&(r.originalWidth=r.width,r.originalHeight=r.height),o&&o.length>0&&(r.names=o,r.values=l,o=null,l=null),r.u=r.x/a.width,r.v=r.y/a.height,r.degrees==90?(r.u2=(r.x+r.height)/a.width,r.v2=(r.y+r.width)/a.height):(r.u2=(r.x+r.width)/a.width,r.v2=(r.y+r.height)/a.height),this.regions.push(r)}else{for(a=new Ze,a.name=s.trim();i.readEntry(e,s=i.readLine())!=0;){let h=c[e[0]];h&&h()}this.pages.push(a)}}findRegion(t){for(let i=0;i<this.regions.length;i++)if(this.regions[i].name==t)return this.regions[i];return null}setTextures(t,i=""){for(let e of this.pages)e.setTexture(t.get(i+e.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()}},Ss=class{constructor(t){this.lines=null,this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,i){if(!i||(i=i.trim(),i.length==0))return 0;let e=i.indexOf(":");if(e==-1)return 0;t[0]=i.substr(0,e).trim();for(let a=1,r=e+1;;a++){let c=i.indexOf(",",r);if(c==-1)return t[a]=i.substr(r).trim(),a;if(t[a]=i.substr(r,c-r).trim(),r=c+1,a==4)return 4}}},Ze=class{constructor(){this.name=null,this.minFilter=St.Nearest,this.magFilter=St.Nearest,this.uWrap=At.ClampToEdge,this.vWrap=At.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},ve=class extends Qe{constructor(){super(...arguments);this.page=null,this.name=null,this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null}},Ct=class extends ct{constructor(t){super(t);this.region=null,this.path=null,this.regionUVs=null,this.uvs=null,this.triangles=null,this.color=new L(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=null,this.parentMesh=null,this.tempColor=new L(0,0,0,0)}updateUVs(){let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=R.newFloatArray(t.length));let i=this.uvs,e=this.uvs.length,a=this.region.u,r=this.region.v,c=0,n=0;if(this.region instanceof ve){let s=this.region,o=s.page.texture.getImage(),l=o.width,h=o.height;switch(s.degrees){case 90:a-=(s.originalHeight-s.offsetY-s.height)/l,r-=(s.originalWidth-s.offsetX-s.width)/h,c=s.originalHeight/l,n=s.originalWidth/h;for(let d=0;d<e;d+=2)i[d]=a+t[d+1]*c,i[d+1]=r+(1-t[d])*n;return;case 180:a-=(s.originalWidth-s.offsetX-s.width)/l,r-=s.offsetY/h,c=s.originalWidth/l,n=s.originalHeight/h;for(let d=0;d<e;d+=2)i[d]=a+(1-t[d])*c,i[d+1]=r+(1-t[d+1])*n;return;case 270:a-=s.offsetY/l,r-=s.offsetX/h,c=s.originalHeight/l,n=s.originalWidth/h;for(let d=0;d<e;d+=2)i[d]=a+(1-t[d+1])*c,i[d+1]=r+t[d]*n;return}a-=s.offsetX/l,r-=(s.originalHeight-s.offsetY-s.height)/h,c=s.originalWidth/l,n=s.originalHeight/h}else this.region?(c=this.region.u2-a,n=this.region.v2-r):(a=r=0,c=n=1);for(let s=0;s<e;s+=2)i[s]=a+t[s]*c,i[s+1]=r+t[s+1]*n}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new Ct(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),R.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),R.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),R.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges&&(t.edges=new Array(this.edges.length),R.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){let t=new Ct(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.updateUVs(),t}},It=class extends ct{constructor(t){super(t);this.lengths=null,this.closed=!1,this.constantSpeed=!1,this.color=new L(1,1,1,1)}copy(){let t=new It(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),R.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},Se=class extends ct{constructor(t){super(t);this.x=0,this.y=0,this.rotation=0,this.color=new L(.38,.94,0,1)}computeWorldPosition(t,i){return i.x=this.x*t.a+this.y*t.b+t.worldX,i.y=this.x*t.c+this.y*t.d+t.worldY,i}computeWorldRotation(t){let i=X.cosDeg(this.rotation),e=X.sinDeg(this.rotation),a=i*t.a+e*t.b,r=i*t.c+e*t.d;return Math.atan2(r,a)*X.radDeg}copy(){let t=new Se(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},ts=class extends Gt{constructor(t){super(t);this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new L(1,1,1,1),this.path=null,this.rendererObject=null,this.region=null,this.offset=R.newFloatArray(8),this.uvs=R.newFloatArray(8),this.tempColor=new L(1,1,1,1)}updateOffset(){let t=this.region,i=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*i,r=-this.height/2*this.scaleY+this.region.offsetY*e,c=a+this.region.width*i,n=r+this.region.height*e,s=this.rotation*Math.PI/180,o=Math.cos(s),l=Math.sin(s),h=this.x,d=this.y,f=a*o+h,u=a*l,m=r*o+d,b=r*l,p=c*o+h,y=c*l,g=n*o+d,w=n*l,x=this.offset;x[0]=f-b,x[1]=m+u,x[2]=f-w,x[3]=g+u,x[4]=p-w,x[5]=g+y,x[6]=p-b,x[7]=m+y}setRegion(t){this.region=t;let i=this.uvs;t.degrees==90?(i[2]=t.u,i[3]=t.v2,i[4]=t.u,i[5]=t.v,i[6]=t.u2,i[7]=t.v,i[0]=t.u2,i[1]=t.v2):(i[0]=t.u,i[1]=t.v2,i[2]=t.u,i[3]=t.v,i[4]=t.u2,i[5]=t.v,i[6]=t.u2,i[7]=t.v2)}computeWorldVertices(t,i,e,a){let r=this.offset,c=t.worldX,n=t.worldY,s=t.a,o=t.b,l=t.c,h=t.d,d=0,f=0;d=r[0],f=r[1],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n,e+=a,d=r[2],f=r[3],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n,e+=a,d=r[4],f=r[5],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n,e+=a,d=r[6],f=r[7],i[e]=d*s+f*o+c,i[e+1]=d*l+f*h+n}copy(){let t=new ts(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,R.arrayCopy(this.uvs,0,t.uvs,0,8),R.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t}},U=ts;U.X1=0,U.Y1=1,U.C1R=2,U.C1G=3,U.C1B=4,U.C1A=5,U.U1=6,U.V1=7,U.X2=8,U.Y2=9,U.C2R=10,U.C2G=11,U.C2B=12,U.C2A=13,U.U2=14,U.V2=15,U.X3=16,U.Y3=17,U.C3R=18,U.C3G=19,U.C3B=20,U.C3A=21,U.U3=22,U.V3=23,U.X4=24,U.Y4=25,U.C4R=26,U.C4G=27,U.C4B=28,U.C4A=29,U.U4=30,U.V4=31;var As=class{constructor(t){this.atlas=null,this.atlas=t}newRegionAttachment(t,i,e){let a=this.atlas.findRegion(e);if(!a)throw new Error("Region not found in atlas: "+e+" (region attachment: "+i+")");a.renderObject=a;let r=new U(i);return r.setRegion(a),r}newMeshAttachment(t,i,e){let a=this.atlas.findRegion(e);if(!a)throw new Error("Region not found in atlas: "+e+" (mesh attachment: "+i+")");a.renderObject=a;let r=new Ct(i);return r.region=a,r}newBoundingBoxAttachment(t,i){return new Ut(i)}newPathAttachment(t,i){return new It(i)}newPointAttachment(t,i){return new Se(i)}newClippingAttachment(t,i){return new ye(i)}},Ae=class{constructor(t,i,e){if(this.index=0,this.name=null,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=et.Normal,this.skinRequired=!1,this.color=new L,t<0)throw new Error("index must be >= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.name=i,this.parent=e}},et;(function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"})(et||(et={}));var ke=class{constructor(t,i,e){if(this.data=null,this.skeleton=null,this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=i,this.parent=e,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,i,e,a,r,c,n){this.ax=t,this.ay=i,this.arotation=e,this.ascaleX=a,this.ascaleY=r,this.ashearX=c,this.ashearY=n;let s=this.parent;if(!s){let f=this.skeleton,u=e+90+n,m=f.scaleX,b=f.scaleY;this.a=X.cosDeg(e+c)*a*m,this.b=X.cosDeg(u)*r*m,this.c=X.sinDeg(e+c)*a*b,this.d=X.sinDeg(u)*r*b,this.worldX=t*m+f.x,this.worldY=i*b+f.y;return}let o=s.a,l=s.b,h=s.c,d=s.d;switch(this.worldX=o*t+l*i+s.worldX,this.worldY=h*t+d*i+s.worldY,this.data.transformMode){case et.Normal:{let f=e+90+n,u=X.cosDeg(e+c)*a,m=X.cosDeg(f)*r,b=X.sinDeg(e+c)*a,p=X.sinDeg(f)*r;this.a=o*u+l*b,this.b=o*m+l*p,this.c=h*u+d*b,this.d=h*m+d*p;return}case et.OnlyTranslation:{let f=e+90+n;this.a=X.cosDeg(e+c)*a,this.b=X.cosDeg(f)*r,this.c=X.sinDeg(e+c)*a,this.d=X.sinDeg(f)*r;break}case et.NoRotationOrReflection:{let f=o*o+h*h,u=0;f>1e-4?(f=Math.abs(o*d-l*h)/f,o/=this.skeleton.scaleX,h/=this.skeleton.scaleY,l=h*f,d=o*f,u=Math.atan2(h,o)*X.radDeg):(o=0,h=0,u=90-Math.atan2(d,l)*X.radDeg);let m=e+c-u,b=e+n-u+90,p=X.cosDeg(m)*a,y=X.cosDeg(b)*r,g=X.sinDeg(m)*a,w=X.sinDeg(b)*r;this.a=o*p-l*g,this.b=o*y-l*w,this.c=h*p+d*g,this.d=h*y+d*w;break}case et.NoScale:case et.NoScaleOrReflection:{let f=X.cosDeg(e),u=X.sinDeg(e),m=(o*f+l*u)/this.skeleton.scaleX,b=(h*f+d*u)/this.skeleton.scaleY,p=Math.sqrt(m*m+b*b);p>1e-5&&(p=1/p),m*=p,b*=p,p=Math.sqrt(m*m+b*b),this.data.transformMode==et.NoScale&&o*d-l*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let y=Math.PI/2+Math.atan2(b,m),g=Math.cos(y)*p,w=Math.sin(y)*p,x=X.cosDeg(c)*a,v=X.cosDeg(90+n)*r,A=X.sinDeg(c)*a,S=X.sinDeg(90+n)*r;this.a=m*x+g*A,this.b=m*v+g*S,this.c=b*x+w*A,this.d=b*v+w*S;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let 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.c,this.a)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*X.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*X.radDeg;return}let i=t.a,e=t.b,a=t.c,r=t.d,c=1/(i*r-e*a),n=this.worldX-t.worldX,s=this.worldY-t.worldY;this.ax=n*r*c-s*e*c,this.ay=s*i*c-n*a*c;let o=c*r,l=c*i,h=c*e,d=c*a,f=o*this.a-h*this.c,u=o*this.b-h*this.d,m=l*this.c-d*this.a,b=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let p=f*b-u*m;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*u+m*b,p)*X.radDeg,this.arotation=Math.atan2(m,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+b*b),this.ashearY=0,this.arotation=90-Math.atan2(b,u)*X.radDeg}worldToLocal(t){let i=1/(this.a*this.d-this.b*this.c),e=t.x-this.worldX,a=t.y-this.worldY;return t.x=e*this.d*i-a*this.b*i,t.y=a*this.a*i-e*this.c*i,t}localToWorld(t){let i=t.x,e=t.y;return t.x=i*this.a+e*this.b+this.worldX,t.y=i*this.c+e*this.d+this.worldY,t}worldToLocalRotation(t){let i=X.sinDeg(t),e=X.cosDeg(t);return Math.atan2(this.a*i-this.c*e,this.d*e-this.b*i)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let i=X.sinDeg(t),e=X.cosDeg(t);return Math.atan2(e*this.c+i*this.d,e*this.a+i*this.b)*X.radDeg}rotateWorld(t){let i=this.a,e=this.b,a=this.c,r=this.d,c=X.cosDeg(t),n=X.sinDeg(t);this.a=c*i-n*a,this.b=c*e-n*r,this.c=n*i+c*a,this.d=n*e+c*r}},Wt=class{constructor(t,i,e){this.name=t,this.order=i,this.skinRequired=e}},ks=class{constructor(t,i="",e=null){this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=i,this.downloader=e||new es}start(t){return this.toLoad++,this.pathPrefix+t}success(t,i,e){this.toLoad--,this.loaded++,this.assets[i]=e,t&&t(i,e)}error(t,i,e){this.toLoad--,this.loaded++,this.errors[i]=e,t&&t(i,e)}loadAll(){return new Promise((i,e)=>{let a=()=>{if(this.isLoadingComplete()){this.hasErrors()?e(this.errors):i(this);return}requestAnimationFrame(a)};requestAnimationFrame(a)})}setRawDataURI(t,i){this.downloader.rawDataUris[this.pathPrefix+t]=i}loadBinary(t,i=null,e=null){t=this.start(t),this.downloader.downloadBinary(t,a=>{this.success(i,t,a)},(a,r)=>{this.error(e,t,`Couldn't load binary ${t}: status ${a}, ${r}`)})}loadText(t,i=null,e=null){t=this.start(t),this.downloader.downloadText(t,a=>{this.success(i,t,a)},(a,r)=>{this.error(e,t,`Couldn't load text ${t}: status ${a}, ${r}`)})}loadJson(t,i=null,e=null){t=this.start(t),this.downloader.downloadJson(t,a=>{this.success(i,t,a)},(a,r)=>{this.error(e,t,`Couldn't load JSON ${t}: status ${a}, ${r}`)})}loadTexture(t,i=null,e=null){if(t=this.start(t),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(t,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(e,t,`Couldn't load image: ${t}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(i,t,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(i,t,this.textureLoader(c))},c.onerror=()=>{this.error(e,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}}loadTextureAtlas(t,i=null,e=null,a=null){let r=t.lastIndexOf("/"),c=r>=0?t.substring(0,r+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let s=new Ke(n),o=s.pages.length,l=!1;for(let h of s.pages)this.loadTexture(a==null?c+h.name:a[h.name],(d,f)=>{l||(h.setTexture(f),--o==0&&this.success(i,t,s))},(d,f)=>{l||this.error(e,t,`Couldn't load texture atlas ${t} page image: ${d}`),l=!0})}catch(s){this.error(e,t,`Couldn't parse texture atlas ${t}: ${s.message}`)}},(n,s)=>{this.error(e,t,`Couldn't load texture atlas ${t}: status ${n}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let i=this.assets[t];if(i)return i;let e=this.errors[t];throw Error("Asset not found: "+t+(e?`
|
|
2
|
+
`+e:""))}remove(t){t=this.pathPrefix+t;let i=this.assets[t];return i.dispose&&i.dispose(),delete this.assets[t],i}removeAll(){for(let t in this.assets){let i=this.assets[t];i.dispose&&i.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},es=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let i=t.indexOf("base64,");return i!=-1?(i+="base64,".length,atob(t.substr(i))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var i=window.atob(t),e=i.length,a=new Uint8Array(e),r=0;r<e;r++)a[r]=i.charCodeAt(r);return a}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let i=t.indexOf("base64,");if(i==-1)throw new Error("Not a binary data URI.");return i+="base64,".length,this.base64ToUint8Array(t.substr(i))}downloadText(t,i,e){if(this.start(t,i,e))return;if(this.rawDataUris[t]){try{let c=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(c))}catch(c){this.finish(t,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",t,!0);let r=()=>{this.finish(t,a.status,a.responseText)};a.onload=r,a.onerror=r,a.send()}downloadJson(t,i,e){this.downloadText(t,a=>{i(JSON.parse(a))},e)}downloadBinary(t,i,e){if(this.start(t,i,e))return;if(this.rawDataUris[t]){try{let c=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(c))}catch(c){this.finish(t,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType="arraybuffer";let r=()=>{this.finish(t,a.status,a.response)};a.onload=()=>{a.status==200||a.status==0?this.finish(t,200,new Uint8Array(a.response)):r()},a.onerror=r,a.send()}start(t,i,e){let a=this.callbacks[t];try{if(a)return!0;this.callbacks[t]=a=[]}finally{a.push(i,e)}}finish(t,i,e){let a=this.callbacks[t];delete this.callbacks[t];let r=i==200||i==0?[e]:[i,e];for(let c=r.length-1,n=a.length;c<n;c+=2)a[c].apply(null,r)}},Ye=class{constructor(t,i){if(this.data=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!i)throw new Error("data cannot be null.");this.time=t,this.data=i}},Ce=class{constructor(t){this.name=null,this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t}},ss=class{constructor(t,i){if(this.data=null,this.bones=null,this.target=null,this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)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 e=0;e<t.bones.length;e++)this.bones.push(i.findBone(t.bones[e].name));this.target=i.findBone(t.target.name)}isActive(){return this.active}update(){if(this.mix==0)return;let t=this.target,i=this.bones;switch(i.length){case 1:this.apply1(i[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(i[0],i[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(t,i,e,a,r,c,n){let s=t.parent,o=s.a,l=s.b,h=s.c,d=s.d,f=-t.ashearX-t.arotation,u=0,m=0;switch(t.data.transformMode){case et.OnlyTranslation:u=i-t.worldX,m=e-t.worldY;break;case et.NoRotationOrReflection:let y=Math.abs(o*d-l*h)/(o*o+h*h),g=o/t.skeleton.scaleX,w=h/t.skeleton.scaleY;l=-w*y*t.skeleton.scaleX,d=g*y*t.skeleton.scaleY,f+=Math.atan2(w,g)*X.radDeg;default:let x=i-s.worldX,v=e-s.worldY,A=o*d-l*h;u=(x*d-v*l)/A-t.ax,m=(v*o-x*h)/A-t.ay}f+=Math.atan2(m,u)*X.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let b=t.ascaleX,p=t.ascaleY;if(a||r){switch(t.data.transformMode){case et.NoScale:case et.NoScaleOrReflection:u=i-t.worldX,m=e-t.worldY}let y=t.data.length*b,g=Math.sqrt(u*u+m*m);if(a&&g<y||r&&g>y&&y>1e-4){let w=(g/y-1)*n+1;b*=w,c&&(p*=w)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*n,b,p,t.ashearX,t.ashearY)}apply2(t,i,e,a,r,c,n,s,o){let l=t.ax,h=t.ay,d=t.ascaleX,f=t.ascaleY,u=d,m=f,b=i.ascaleX,p=0,y=0,g=0;d<0?(d=-d,p=180,g=-1):(p=0,g=1),f<0&&(f=-f,g=-g),b<0?(b=-b,y=180):y=0;let w=i.ax,x=0,v=0,A=0,S=t.a,I=t.b,C=t.c,F=t.d,P=Math.abs(d-f)<=1e-4;!P||c?(x=0,v=S*w+t.worldX,A=C*w+t.worldY):(x=i.ay,v=S*w+I*x+t.worldX,A=C*w+F*x+t.worldY);let B=t.parent;S=B.a,I=B.b,C=B.c,F=B.d;let M=1/(S*F-I*C),Y=v-B.worldX,T=A-B.worldY,N=(Y*F-T*I)*M-l,z=(T*S-Y*C)*M-h,E=Math.sqrt(N*N+z*z),q=i.data.length*b,G,H;if(E<1e-4){this.apply1(t,e,a,!1,c,!1,o),i.updateWorldTransformWith(w,x,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY);return}Y=e-B.worldX,T=a-B.worldY;let D=(Y*F-T*I)*M-l,V=(T*S-Y*C)*M-h,j=D*D+V*V;if(s!=0){s*=d*(b+1)*.5;let K=Math.sqrt(j),it=K-E-q*d+s;if(it>0){let rt=Math.min(1,it/(s*2))-1;rt=(it-s*(1-rt*rt))/K,D-=rt*D,V-=rt*V,j=D*D+V*V}}t:if(P){q*=d;let K=(j-E*E-q*q)/(2*E*q);K<-1?(K=-1,H=Math.PI*r):K>1?(K=1,H=0,c&&(S=(Math.sqrt(j)/(E+q)-1)*o+1,u*=S,n&&(m*=S))):H=Math.acos(K)*r,S=E+q*K,I=q*Math.sin(H),G=Math.atan2(V*S-D*I,D*S+V*I)}else{S=d*q,I=f*q;let K=S*S,it=I*I,rt=Math.atan2(V,D);C=it*E*E+K*j-K*it;let wt=-2*it*E,Xt=it-K;if(F=wt*wt-4*Xt*C,F>=0){let Mt=Math.sqrt(F);wt<0&&(Mt=-Mt),Mt=-(wt+Mt)*.5;let ds=Mt/Xt,fs=C/Mt,Ft=Math.abs(ds)<Math.abs(fs)?ds:fs;if(Ft*Ft<=j){T=Math.sqrt(j-Ft*Ft)*r,G=rt-Math.atan2(T,Ft),H=Math.atan2(T/f,(Ft-E)/d);break t}}let Et=X.PI,_t=E-S,Ve=_t*_t,os=0,hs=0,Ht=E+S,Le=Ht*Ht,cs=0;C=-S*E/(K-it),C>=-1&&C<=1&&(C=Math.acos(C),Y=S*Math.cos(C)+E,T=I*Math.sin(C),F=Y*Y+T*T,F<Ve&&(Et=C,Ve=F,_t=Y,os=T),F>Le&&(hs=C,Le=F,Ht=Y,cs=T)),j<=(Ve+Le)*.5?(G=rt-Math.atan2(os*r,_t),H=Et*r):(G=rt-Math.atan2(cs*r,Ht),H=hs*r)}let Z=Math.atan2(x,w)*g,ht=t.arotation;G=(G-Z)*X.radDeg+p-ht,G>180?G-=360:G<-180&&(G+=360),t.updateWorldTransformWith(l,h,ht+G*o,u,m,0,0),ht=i.arotation,H=((H+Z)*X.radDeg-i.ashearX)*g+y-ht,H>180?H-=360:H<-180&&(H+=360),i.updateWorldTransformWith(w,x,ht+H*o,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)}},Ie=class extends Wt{constructor(t){super(t,0,!1);this.bones=new Array,this.target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}},Te=class extends Wt{constructor(t){super(t,0,!1);this.bones=new Array,this.target=null,this.positionMode=null,this.spacingMode=null,this.rotateMode=null,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}},dt;(function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"})(dt||(dt={}));var Q;(function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"})(Q||(Q={}));var kt;(function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"})(kt||(kt={}));var gt=class{constructor(t,i){if(this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let e=0,a=t.bones.length;e<a;e++)this.bones.push(i.findBone(t.bones[e].name));this.target=i.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}update(){let t=this.target.getAttachment();if(!(t instanceof It))return;let i=this.mixRotate,e=this.mixX,a=this.mixY;if(i==0&&e==0&&a==0)return;let r=this.data,c=r.rotateMode==kt.Tangent,n=r.rotateMode==kt.ChainScale,s=this.bones,o=s.length,l=c?o:o+1,h=R.setArraySize(this.spaces,l),d=n?this.lengths=R.setArraySize(this.lengths,o):null,f=this.spacing;switch(r.spacingMode){case Q.Percent:if(n)for(let x=0,v=l-1;x<v;x++){let A=s[x],S=A.data.length;if(S<gt.epsilon)d[x]=0;else{let I=S*A.a,C=S*A.c;d[x]=Math.sqrt(I*I+C*C)}}R.arrayFill(h,1,l,f);break;case Q.Proportional:let g=0;for(let x=0,v=l-1;x<v;){let A=s[x],S=A.data.length;if(S<gt.epsilon)n&&(d[x]=0),h[++x]=f;else{let I=S*A.a,C=S*A.c,F=Math.sqrt(I*I+C*C);n&&(d[x]=F),h[++x]=F,g+=F}}if(g>0){g=l/g*f;for(let x=1;x<l;x++)h[x]*=g}break;default:let w=r.spacingMode==Q.Length;for(let x=0,v=l-1;x<v;){let A=s[x],S=A.data.length;if(S<gt.epsilon)n&&(d[x]=0),h[++x]=f;else{let I=S*A.a,C=S*A.c,F=Math.sqrt(I*I+C*C);n&&(d[x]=F),h[++x]=(w?S+f:f)*F/S}}}let u=this.computeWorldPositions(t,l,c),m=u[0],b=u[1],p=r.offsetRotation,y=!1;if(p==0)y=r.rotateMode==kt.Chain;else{y=!1;let g=this.target.bone;p*=g.a*g.d-g.b*g.c>0?X.degRad:-X.degRad}for(let g=0,w=3;g<o;g++,w+=3){let x=s[g];x.worldX+=(m-x.worldX)*e,x.worldY+=(b-x.worldY)*a;let v=u[w],A=u[w+1],S=v-m,I=A-b;if(n){let C=d[g];if(C!=0){let F=(Math.sqrt(S*S+I*I)/C-1)*i+1;x.a*=F,x.c*=F}}if(m=v,b=A,i>0){let C=x.a,F=x.b,P=x.c,B=x.d,M=0,Y=0,T=0;if(c?M=u[w-1]:h[g+1]==0?M=u[w+2]:M=Math.atan2(I,S),M-=Math.atan2(P,C),y){Y=Math.cos(M),T=Math.sin(M);let N=x.data.length;m+=(N*(Y*C-T*P)-S)*i,b+=(N*(T*C+Y*P)-I)*i}else M+=p;M>X.PI?M-=X.PI2:M<-X.PI&&(M+=X.PI2),M*=i,Y=Math.cos(M),T=Math.sin(M),x.a=Y*C-T*P,x.b=Y*F-T*B,x.c=T*C+Y*P,x.d=T*F+Y*B}x.updateAppliedTransform()}}computeWorldPositions(t,i,e){let a=this.target,r=this.position,c=this.spaces,n=R.setArraySize(this.positions,i*3+2),s=null,o=t.closed,l=t.worldVerticesLength,h=l/6,d=gt.NONE;if(!t.constantSpeed){let z=t.lengths;h-=o?1:2;let E=z[h];this.data.positionMode==dt.Percent&&(r*=E);let q;switch(this.data.spacingMode){case Q.Percent:q=E;break;case Q.Proportional:q=E/i;break;default:q=1}s=R.setArraySize(this.world,8);for(let G=0,H=0,D=0;G<i;G++,H+=3){let V=c[G]*q;r+=V;let j=r;if(o)j%=E,j<0&&(j+=E),D=0;else if(j<0){d!=gt.BEFORE&&(d=gt.BEFORE,t.computeWorldVertices(a,2,4,s,0,2)),this.addBeforePosition(j,s,0,n,H);continue}else if(j>E){d!=gt.AFTER&&(d=gt.AFTER,t.computeWorldVertices(a,l-6,4,s,0,2)),this.addAfterPosition(j-E,s,0,n,H);continue}for(;;D++){let Z=z[D];if(!(j>Z)){if(D==0)j/=Z;else{let ht=z[D-1];j=(j-ht)/(Z-ht)}break}}D!=d&&(d=D,o&&D==h?(t.computeWorldVertices(a,l-4,4,s,0,2),t.computeWorldVertices(a,0,4,s,4,2)):t.computeWorldVertices(a,D*6+2,8,s,0,2)),this.addCurvePosition(j,s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],n,H,e||G>0&&V==0)}return n}o?(l+=2,s=R.setArraySize(this.world,l),t.computeWorldVertices(a,2,l-4,s,0,2),t.computeWorldVertices(a,0,2,s,l-4,2),s[l-2]=s[0],s[l-1]=s[1]):(h--,l-=4,s=R.setArraySize(this.world,l),t.computeWorldVertices(a,2,l,s,0,2));let f=R.setArraySize(this.curves,h),u=0,m=s[0],b=s[1],p=0,y=0,g=0,w=0,x=0,v=0,A=0,S=0,I=0,C=0,F=0,P=0,B=0,M=0;for(let z=0,E=2;z<h;z++,E+=6)p=s[E],y=s[E+1],g=s[E+2],w=s[E+3],x=s[E+4],v=s[E+5],A=(m-p*2+g)*.1875,S=(b-y*2+w)*.1875,I=((p-g)*3-m+x)*.09375,C=((y-w)*3-b+v)*.09375,F=A*2+I,P=S*2+C,B=(p-m)*.75+A+I*.16666667,M=(y-b)*.75+S+C*.16666667,u+=Math.sqrt(B*B+M*M),B+=F,M+=P,F+=I,P+=C,u+=Math.sqrt(B*B+M*M),B+=F,M+=P,u+=Math.sqrt(B*B+M*M),B+=F+I,M+=P+C,u+=Math.sqrt(B*B+M*M),f[z]=u,m=x,b=v;this.data.positionMode==dt.Percent&&(r*=u);let Y;switch(this.data.spacingMode){case Q.Percent:Y=u;break;case Q.Proportional:Y=u/i;break;default:Y=1}let T=this.segments,N=0;for(let z=0,E=0,q=0,G=0;z<i;z++,E+=3){let H=c[z]*Y;r+=H;let D=r;if(o)D%=u,D<0&&(D+=u),q=0;else if(D<0){this.addBeforePosition(D,s,0,n,E);continue}else if(D>u){this.addAfterPosition(D-u,s,l-4,n,E);continue}for(;;q++){let V=f[q];if(!(D>V)){if(q==0)D/=V;else{let j=f[q-1];D=(D-j)/(V-j)}break}}if(q!=d){d=q;let V=q*6;for(m=s[V],b=s[V+1],p=s[V+2],y=s[V+3],g=s[V+4],w=s[V+5],x=s[V+6],v=s[V+7],A=(m-p*2+g)*.03,S=(b-y*2+w)*.03,I=((p-g)*3-m+x)*.006,C=((y-w)*3-b+v)*.006,F=A*2+I,P=S*2+C,B=(p-m)*.3+A+I*.16666667,M=(y-b)*.3+S+C*.16666667,N=Math.sqrt(B*B+M*M),T[0]=N,V=1;V<8;V++)B+=F,M+=P,F+=I,P+=C,N+=Math.sqrt(B*B+M*M),T[V]=N;B+=F,M+=P,N+=Math.sqrt(B*B+M*M),T[8]=N,B+=F+I,M+=P+C,N+=Math.sqrt(B*B+M*M),T[9]=N,G=0}for(D*=N;;G++){let V=T[G];if(!(D>V)){if(G==0)D/=V;else{let j=T[G-1];D=G+(D-j)/(V-j)}break}}this.addCurvePosition(D*.1,m,b,p,y,g,w,x,v,n,E,e||z>0&&H==0)}return n}addBeforePosition(t,i,e,a,r){let c=i[e],n=i[e+1],s=i[e+2]-c,o=i[e+3]-n,l=Math.atan2(o,s);a[r]=c+t*Math.cos(l),a[r+1]=n+t*Math.sin(l),a[r+2]=l}addAfterPosition(t,i,e,a,r){let c=i[e+2],n=i[e+3],s=c-i[e],o=n-i[e+1],l=Math.atan2(o,s);a[r]=c+t*Math.cos(l),a[r+1]=n+t*Math.sin(l),a[r+2]=l}addCurvePosition(t,i,e,a,r,c,n,s,o,l,h,d){if(t==0||isNaN(t)){l[h]=i,l[h+1]=e,l[h+2]=Math.atan2(r-e,a-i);return}let f=t*t,u=f*t,m=1-t,b=m*m,p=b*m,y=m*t,g=y*3,w=m*g,x=g*t,v=i*p+a*w+c*x+s*u,A=e*p+r*w+n*x+o*u;l[h]=v,l[h+1]=A,d&&(t<.001?l[h+2]=Math.atan2(r-e,a-i):l[h+2]=Math.atan2(A-(e*b+r*y*2+n*f),v-(i*b+a*y*2+c*f)))}},Tt=gt;Tt.NONE=-1,Tt.BEFORE=-2,Tt.AFTER=-3,Tt.epsilon=1e-5;var is=class{constructor(t,i){if(this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentTime=0,this.attachmentState=0,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!i)throw new Error("bone cannot be null.");this.data=t,this.bone=i,this.color=new L,this.darkColor=t.darkColor?new L:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&((!(t instanceof ct)||!(this.attachment instanceof ct)||t.deformAttachment!=this.attachment.deformAttachment)&&(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},rs=class{constructor(t,i){if(this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new Vt,this.active=!1,!t)throw new Error("data cannot be null.");if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let e=0;e<t.bones.length;e++)this.bones.push(i.findBone(t.bones[e].name));this.target=i.findBone(t.target.name)}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleX==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=i!=0||e!=0,s=this.target,o=s.a,l=s.b,h=s.c,d=s.d,f=o*d-l*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,b=this.bones;for(let p=0,y=b.length;p<y;p++){let g=b[p];if(t!=0){let w=g.a,x=g.b,v=g.c,A=g.d,S=Math.atan2(h,o)-Math.atan2(v,w)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=t;let I=Math.cos(S),C=Math.sin(S);g.a=I*w-C*v,g.b=I*x-C*A,g.c=C*w+I*v,g.d=C*x+I*A}if(n){let w=this.temp;s.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(w.x-g.worldX)*i,g.worldY+=(w.y-g.worldY)*e}if(a!=0){let w=Math.sqrt(g.a*g.a+g.c*g.c);w!=0&&(w=(w+(Math.sqrt(o*o+h*h)-w+this.data.offsetScaleX)*a)/w),g.a*=w,g.c*=w}if(r!=0){let w=Math.sqrt(g.b*g.b+g.d*g.d);w!=0&&(w=(w+(Math.sqrt(l*l+d*d)-w+this.data.offsetScaleY)*r)/w),g.b*=w,g.d*=w}if(c>0){let w=g.b,x=g.d,v=Math.atan2(x,w),A=Math.atan2(d,l)-Math.atan2(h,o)-(v-Math.atan2(g.c,g.a));A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A=v+(A+m)*c;let S=Math.sqrt(w*w+x*x);g.b=Math.cos(A)*S,g.d=Math.sin(A)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=i!=0||e!=0,s=this.target,o=s.a,l=s.b,h=s.c,d=s.d,f=o*d-l*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,b=this.bones;for(let p=0,y=b.length;p<y;p++){let g=b[p];if(t!=0){let w=g.a,x=g.b,v=g.c,A=g.d,S=Math.atan2(h,o)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=t;let I=Math.cos(S),C=Math.sin(S);g.a=I*w-C*v,g.b=I*x-C*A,g.c=C*w+I*v,g.d=C*x+I*A}if(n){let w=this.temp;s.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=w.x*i,g.worldY+=w.y*e}if(a!=0){let w=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*a+1;g.a*=w,g.c*=w}if(r!=0){let w=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*r+1;g.b*=w,g.d*=w}if(c>0){let w=Math.atan2(d,l)-Math.atan2(h,o);w>X.PI?w-=X.PI2:w<-X.PI&&(w+=X.PI2);let x=g.b,v=g.d;w=Math.atan2(v,x)+(w-X.PI/2+m)*c;let A=Math.sqrt(x*x+v*v);g.b=Math.cos(w)*A,g.d=Math.sin(w)*A}g.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,s=this.bones;for(let o=0,l=s.length;o<l;o++){let h=s[o],d=h.arotation;if(t!=0){let y=n.arotation-d+this.data.offsetRotation;y-=(16384-(16384.499999999996-y/360|0))*360,d+=y*t}let f=h.ax,u=h.ay;f+=(n.ax-f+this.data.offsetX)*i,u+=(n.ay-u+this.data.offsetY)*e;let m=h.ascaleX,b=h.ascaleY;a!=0&&m!=0&&(m=(m+(n.ascaleX-m+this.data.offsetScaleX)*a)/m),r!=0&&b!=0&&(b=(b+(n.ascaleY-b+this.data.offsetScaleY)*r)/b);let p=h.ashearY;if(c!=0){let y=n.ashearY-p+this.data.offsetShearY;y-=(16384-(16384.499999999996-y/360|0))*360,p+=y*c}h.updateWorldTransformWith(f,u,d,m,b,h.ashearX,p)}}applyRelativeLocal(){let t=this.mixRotate,i=this.mixX,e=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,s=this.bones;for(let o=0,l=s.length;o<l;o++){let h=s[o],d=h.arotation+(n.arotation+this.data.offsetRotation)*t,f=h.ax+(n.ax+this.data.offsetX)*i,u=h.ay+(n.ay+this.data.offsetY)*e,m=h.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*a+1),b=h.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*r+1),p=h.ashearY+(n.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,u,d,m,b,h.ashearX,p)}}},Ys=class{constructor(t){if(this.data=null,this.bones=null,this.slots=null,this.drawOrder=null,this.ikConstraints=null,this.transformConstraints=null,this.pathConstraints=null,this._updateCache=new Array,this.skin=null,this.color=null,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let e=t.bones[i],a;if(!e.parent)a=new ke(e,this,null);else{let r=this.bones[e.parent.index];a=new ke(e,this,r),r.children.push(a)}this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let i=0;i<t.slots.length;i++){let e=t.slots[i],a=this.bones[e.boneData.index],r=new is(e,a);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let i=0;i<t.ikConstraints.length;i++){let e=t.ikConstraints[i];this.ikConstraints.push(new ss(e,this))}this.transformConstraints=new Array;for(let i=0;i<t.transformConstraints.length;i++){let e=t.transformConstraints[i];this.transformConstraints.push(new rs(e,this))}this.pathConstraints=new Array;for(let i=0;i<t.pathConstraints.length;i++){let e=t.pathConstraints[i];this.pathConstraints.push(new Tt(e,this))}this.color=new L(1,1,1,1),this.updateCache()}updateCache(){let t=this._updateCache;t.length=0;let i=this.bones;for(let l=0,h=i.length;l<h;l++){let d=i[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let l=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let f=this.bones[l[h].index];do f.sorted=!1,f.active=!0,f=f.parent;while(f)}}let e=this.ikConstraints,a=this.transformConstraints,r=this.pathConstraints,c=e.length,n=a.length,s=r.length,o=c+n+s;t:for(let l=0;l<o;l++){for(let h=0;h<c;h++){let d=e[h];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let h=0;h<n;h++){let d=a[h];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let h=0;h<s;h++){let d=r[h];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,h=i.length;l<h;l++)this.sortBone(i[l])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&R.contains(this.skin.constraints,t.data,!0)),!t.active)return;let i=t.target;this.sortBone(i);let e=t.bones,a=e[0];if(this.sortBone(a),e.length==1)this._updateCache.push(t),this.sortReset(a.children);else{let r=e[e.length-1];this.sortBone(r),this._updateCache.push(t),this.sortReset(a.children),r.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&R.contains(this.skin.constraints,t.data,!0)),!t.active)return;let i=t.target,e=i.data.index,a=i.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,e,a),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,a);for(let s=0,o=this.data.skins.length;s<o;s++)this.sortPathConstraintAttachment(this.data.skins[s],e,a);let r=i.getAttachment();r instanceof It&&this.sortPathConstraintAttachmentWith(r,a);let c=t.bones,n=c.length;for(let s=0;s<n;s++)this.sortBone(c[s]);this._updateCache.push(t);for(let s=0;s<n;s++)this.sortReset(c[s].children);for(let s=0;s<n;s++)c[s].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&R.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let i=t.bones,e=i.length;if(t.data.local)for(let a=0;a<e;a++){let r=i[a];this.sortBone(r.parent),this.sortBone(r)}else for(let a=0;a<e;a++)this.sortBone(i[a]);this._updateCache.push(t);for(let a=0;a<e;a++)this.sortReset(i[a].children);for(let a=0;a<e;a++)i[a].sorted=!0}sortPathConstraintAttachment(t,i,e){let a=t.attachments[i];if(!!a)for(let r in a)this.sortPathConstraintAttachmentWith(a[r],e)}sortPathConstraintAttachmentWith(t,i){if(!(t instanceof It))return;let e=t.bones;if(!e)this.sortBone(i);else{let a=this.bones;for(let r=0,c=e.length;r<c;){let n=e[r++];for(n+=r;r<n;)this.sortBone(a[e[r++]])}}}sortBone(t){if(t.sorted)return;let i=t.parent;i&&this.sortBone(i),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let i=0,e=t.length;i<e;i++){let a=t[i];!a.active||(a.sorted&&this.sortReset(a.children),a.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let e=0,a=t.length;e<a;e++){let r=t[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let i=this._updateCache;for(let e=0,a=i.length;e<a;e++)i[e].update()}updateWorldTransformWith(t){let i=this.getRootBone(),e=t.a,a=t.b,r=t.c,c=t.d;i.worldX=e*this.x+a*this.y+t.worldX,i.worldY=r*this.x+c*this.y+t.worldY;let n=i.rotation+90+i.shearY,s=X.cosDeg(i.rotation+i.shearX)*i.scaleX,o=X.cosDeg(n)*i.scaleY,l=X.sinDeg(i.rotation+i.shearX)*i.scaleX,h=X.sinDeg(n)*i.scaleY;i.a=(e*s+a*l)*this.scaleX,i.b=(e*o+a*h)*this.scaleX,i.c=(r*s+c*l)*this.scaleY,i.d=(r*o+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,u=d.length;f<u;f++){let m=d[f];m!=i&&m.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let r=0,c=t.length;r<c;r++)t[r].setToSetupPose();let i=this.ikConstraints;for(let r=0,c=i.length;r<c;r++){let n=i[r];n.mix=n.data.mix,n.softness=n.data.softness,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch}let e=this.transformConstraints;for(let r=0,c=e.length;r<c;r++){let n=e[r],s=n.data;n.mixRotate=s.mixRotate,n.mixX=s.mixX,n.mixY=s.mixY,n.mixScaleX=s.mixScaleX,n.mixScaleY=s.mixScaleY,n.mixShearY=s.mixShearY}let a=this.pathConstraints;for(let r=0,c=a.length;r<c;r++){let n=a[r],s=n.data;n.position=s.position,n.spacing=s.spacing,n.mixRotate=s.mixRotate,n.mixX=s.mixX,n.mixY=s.mixY}}setSlotsToSetupPose(){let t=this.slots;R.arrayCopy(t,0,this.drawOrder,0,t.length);for(let i=0,e=t.length;i<e;i++)t[i].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let i=this.bones;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}setSkinByName(t){let i=this.data.findSkin(t);if(!i)throw new Error("Skin not found: "+t);this.setSkin(i)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let i=this.slots;for(let e=0,a=i.length;e<a;e++){let r=i[e],c=r.data.attachmentName;if(c){let n=t.getAttachment(e,c);n&&r.setAttachment(n)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,i){return this.getAttachment(this.data.findSlot(t).index,i)}getAttachment(t,i){if(!i)throw new Error("attachmentName cannot be null.");if(this.skin){let e=this.skin.getAttachment(t,i);if(e)return e}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,i):null}setAttachment(t,i){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let a=0,r=e.length;a<r;a++){let c=e[a];if(c.data.name==t){let n=null;if(i&&(n=this.getAttachment(a,i),!n))throw new Error("Attachment not found: "+i+", for slot: "+t);c.setAttachment(n);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.ikConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.transformConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.pathConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.data.name==t)return r}return null}getBoundsRect(){let t=new Vt,i=new Vt;return this.getBounds(t,i),{x:t.x,y:t.y,width:i.x,height:i.y}}getBounds(t,i,e=new Array(2)){if(!t)throw new Error("offset cannot be null.");if(!i)throw new Error("size cannot be null.");let a=this.drawOrder,r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let o=0,l=a.length;o<l;o++){let h=a[o];if(!h.bone.active)continue;let d=0,f=null,u=h.getAttachment();if(u instanceof U)d=8,f=R.setArraySize(e,d,0),u.computeWorldVertices(h.bone,f,0,2);else if(u instanceof Ct){let m=u;d=m.worldVerticesLength,f=R.setArraySize(e,d,0),m.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let m=0,b=f.length;m<b;m+=2){let p=f[m],y=f[m+1];r=Math.min(r,p),c=Math.min(c,y),n=Math.max(n,p),s=Math.max(s,y)}}t.set(r,c),i.set(n-r,s-c)}update(t){this.time+=t}},Xe=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(t){if(!t)throw new Error("boneName cannot be null.");let i=this.bones;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let i=this.skins;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let i=this.events;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let i=this.animations;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.ikConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.transformConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let i=this.pathConstraints;for(let e=0,a=i.length;e<a;e++){let r=i[e];if(r.name==t)return r}return null}},Me=class{constructor(t=0,i=null,e=null){this.slotIndex=t,this.name=i,this.attachment=e}},zt=class{constructor(t){if(this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,i,e){if(!e)throw new Error("attachment cannot be null.");let a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][i]=e}addSkin(t){for(let a=0;a<t.bones.length;a++){let r=t.bones[a],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<t.constraints.length;a++){let r=t.constraints[a],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let i=t.getAttachments();for(let a=0;a<i.length;a++){var e=i[a];this.setAttachment(e.slotIndex,e.name,e.attachment)}}copySkin(t){for(let a=0;a<t.bones.length;a++){let r=t.bones[a],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<t.constraints.length;a++){let r=t.constraints[a],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let i=t.getAttachments();for(let a=0;a<i.length;a++){var e=i[a];!e.attachment||(e.attachment instanceof Ct?(e.attachment=e.attachment.newLinkedMesh(),this.setAttachment(e.slotIndex,e.name,e.attachment)):(e.attachment=e.attachment.copy(),this.setAttachment(e.slotIndex,e.name,e.attachment)))}}getAttachment(t,i){let e=this.attachments[t];return e?e[i]:null}removeAttachment(t,i){let e=this.attachments[t];e&&(e[i]=null)}getAttachments(){let t=new Array;for(var i=0;i<this.attachments.length;i++){let e=this.attachments[i];if(e)for(let a in e){let r=e[a];r&&t.push(new Me(i,a,r))}}return t}getAttachmentsForSlot(t,i){let e=this.attachments[t];if(e)for(let a in e){let r=e[a];r&&i.push(new Me(t,a,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,i){let e=0;for(let a=0;a<t.slots.length;a++){let r=t.slots[a],c=r.getAttachment();if(c&&e<i.attachments.length){let n=i.attachments[e];for(let s in n){let o=n[s];if(c==o){let l=this.getAttachment(e,s);l&&r.setAttachment(l);break}}}e++}}},Fe=class{constructor(t,i,e){if(this.index=0,this.name=null,this.boneData=null,this.color=new L(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=null,t<0)throw new Error("index must be >= 0.");if(!i)throw new Error("name cannot be null.");if(!e)throw new Error("boneData cannot be null.");this.index=t,this.name=i,this.boneData=e}},qt;(function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"})(qt||(qt={}));var Be=class extends Wt{constructor(t){super(t,0,!1);this.bones=new Array,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}},Cs=class{constructor(t){this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let i=this.scale,e=new Xe;e.name="";let a=new as(t),r=a.readInt32(),c=a.readInt32();e.hash=c==0&&r==0?null:c.toString(16)+r.toString(16),e.version=a.readString(),e.x=a.readFloat(),e.y=a.readFloat(),e.width=a.readFloat(),e.height=a.readFloat();let n=a.readBoolean();n&&(e.fps=a.readFloat(),e.imagesPath=a.readString(),e.audioPath=a.readString());let s=0;s=a.readInt(!0);for(let l=0;l<s;l++)a.strings.push(a.readString());s=a.readInt(!0);for(let l=0;l<s;l++){let h=a.readString(),d=l==0?null:e.bones[a.readInt(!0)],f=new Ae(l,h,d);f.rotation=a.readFloat(),f.x=a.readFloat()*i,f.y=a.readFloat()*i,f.scaleX=a.readFloat(),f.scaleY=a.readFloat(),f.shearX=a.readFloat(),f.shearY=a.readFloat(),f.length=a.readFloat()*i,f.transformMode=a.readInt(!0),f.skinRequired=a.readBoolean(),n&&L.rgba8888ToColor(f.color,a.readInt32()),e.bones.push(f)}s=a.readInt(!0);for(let l=0;l<s;l++){let h=a.readString(),d=e.bones[a.readInt(!0)],f=new Fe(l,h,d);L.rgba8888ToColor(f.color,a.readInt32());let u=a.readInt32();u!=-1&&L.rgb888ToColor(f.darkColor=new L,u),f.attachmentName=a.readStringRef(),f.blendMode=a.readInt(!0),e.slots.push(f)}s=a.readInt(!0);for(let l=0,h;l<s;l++){let d=new Ie(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(e.bones[a.readInt(!0)]);d.target=e.bones[a.readInt(!0)],d.mix=a.readFloat(),d.softness=a.readFloat()*i,d.bendDirection=a.readByte(),d.compress=a.readBoolean(),d.stretch=a.readBoolean(),d.uniform=a.readBoolean(),e.ikConstraints.push(d)}s=a.readInt(!0);for(let l=0,h;l<s;l++){let d=new Be(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(e.bones[a.readInt(!0)]);d.target=e.bones[a.readInt(!0)],d.local=a.readBoolean(),d.relative=a.readBoolean(),d.offsetRotation=a.readFloat(),d.offsetX=a.readFloat()*i,d.offsetY=a.readFloat()*i,d.offsetScaleX=a.readFloat(),d.offsetScaleY=a.readFloat(),d.offsetShearY=a.readFloat(),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),d.mixScaleX=a.readFloat(),d.mixScaleY=a.readFloat(),d.mixShearY=a.readFloat(),e.transformConstraints.push(d)}s=a.readInt(!0);for(let l=0,h;l<s;l++){let d=new Te(a.readString());d.order=a.readInt(!0),d.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let f=0;f<h;f++)d.bones.push(e.bones[a.readInt(!0)]);d.target=e.slots[a.readInt(!0)],d.positionMode=a.readInt(!0),d.spacingMode=a.readInt(!0),d.rotateMode=a.readInt(!0),d.offsetRotation=a.readFloat(),d.position=a.readFloat(),d.positionMode==dt.Fixed&&(d.position*=i),d.spacing=a.readFloat(),(d.spacingMode==Q.Length||d.spacingMode==Q.Fixed)&&(d.spacing*=i),d.mixRotate=a.readFloat(),d.mixX=a.readFloat(),d.mixY=a.readFloat(),e.pathConstraints.push(d)}let o=this.readSkin(a,e,!0,n);o&&(e.defaultSkin=o,e.skins.push(o));{let l=e.skins.length;for(R.setArraySize(e.skins,s=l+a.readInt(!0));l<s;l++)e.skins[l]=this.readSkin(a,e,!1,n)}s=this.linkedMeshes.length;for(let l=0;l<s;l++){let h=this.linkedMeshes[l],f=(h.skin?e.findSkin(h.skin):e.defaultSkin).getAttachment(h.slotIndex,h.parent);h.mesh.deformAttachment=h.inheritDeform?f:h.mesh,h.mesh.setParentMesh(f),h.mesh.updateUVs()}this.linkedMeshes.length=0,s=a.readInt(!0);for(let l=0;l<s;l++){let h=new Ce(a.readStringRef());h.intValue=a.readInt(!1),h.floatValue=a.readFloat(),h.stringValue=a.readString(),h.audioPath=a.readString(),h.audioPath&&(h.volume=a.readFloat(),h.balance=a.readFloat()),e.events.push(h)}s=a.readInt(!0);for(let l=0;l<s;l++)e.animations.push(this.readAnimation(a,a.readString(),e));return e}readSkin(t,i,e,a){let r=null,c=0;if(e){if(c=t.readInt(!0),c==0)return null;r=new zt("default")}else{r=new zt(t.readStringRef()),r.bones.length=t.readInt(!0);for(let n=0,s=r.bones.length;n<s;n++)r.bones[n]=i.bones[t.readInt(!0)];for(let n=0,s=t.readInt(!0);n<s;n++)r.constraints.push(i.ikConstraints[t.readInt(!0)]);for(let n=0,s=t.readInt(!0);n<s;n++)r.constraints.push(i.transformConstraints[t.readInt(!0)]);for(let n=0,s=t.readInt(!0);n<s;n++)r.constraints.push(i.pathConstraints[t.readInt(!0)]);c=t.readInt(!0)}for(let n=0;n<c;n++){let s=t.readInt(!0);for(let o=0,l=t.readInt(!0);o<l;o++){let h=t.readStringRef(),d=this.readAttachment(t,i,r,s,h,a);d&&r.setAttachment(s,h,d)}}return r}readAttachment(t,i,e,a,r,c){let n=this.scale,s=t.readStringRef();switch(s||(s=r),t.readByte()){case xt.Region:{let o=t.readStringRef(),l=t.readFloat(),h=t.readFloat(),d=t.readFloat(),f=t.readFloat(),u=t.readFloat(),m=t.readFloat(),b=t.readFloat(),p=t.readInt32();o||(o=s);let y=this.attachmentLoader.newRegionAttachment(e,s,o);return y?(y.path=o,y.x=h*n,y.y=d*n,y.scaleX=f,y.scaleY=u,y.rotation=l,y.width=m*n,y.height=b*n,L.rgba8888ToColor(y.color,p),y.updateOffset(),y):null}case xt.BoundingBox:{let o=t.readInt(!0),l=this.readVertices(t,o),h=c?t.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(e,s);return d?(d.worldVerticesLength=o<<1,d.vertices=l.vertices,d.bones=l.bones,c&&L.rgba8888ToColor(d.color,h),d):null}case xt.Mesh:{let o=t.readStringRef(),l=t.readInt32(),h=t.readInt(!0),d=this.readFloatArray(t,h<<1,1),f=this.readShortArray(t),u=this.readVertices(t,h),m=t.readInt(!0),b=null,p=0,y=0;c&&(b=this.readShortArray(t),p=t.readFloat(),y=t.readFloat()),o||(o=s);let g=this.attachmentLoader.newMeshAttachment(e,s,o);return g?(g.path=o,L.rgba8888ToColor(g.color,l),g.bones=u.bones,g.vertices=u.vertices,g.worldVerticesLength=h<<1,g.triangles=f,g.regionUVs=d,g.updateUVs(),g.hullLength=m<<1,c&&(g.edges=b,g.width=p*n,g.height=y*n),g):null}case xt.LinkedMesh:{let o=t.readStringRef(),l=t.readInt32(),h=t.readStringRef(),d=t.readStringRef(),f=t.readBoolean(),u=0,m=0;c&&(u=t.readFloat(),m=t.readFloat()),o||(o=s);let b=this.attachmentLoader.newMeshAttachment(e,s,o);return b?(b.path=o,L.rgba8888ToColor(b.color,l),c&&(b.width=u*n,b.height=m*n),this.linkedMeshes.push(new Is(b,h,a,d,f)),b):null}case xt.Path:{let o=t.readBoolean(),l=t.readBoolean(),h=t.readInt(!0),d=this.readVertices(t,h),f=R.newArray(h/3,0);for(let b=0,p=f.length;b<p;b++)f[b]=t.readFloat()*n;let u=c?t.readInt32():0,m=this.attachmentLoader.newPathAttachment(e,s);return m?(m.closed=o,m.constantSpeed=l,m.worldVerticesLength=h<<1,m.vertices=d.vertices,m.bones=d.bones,m.lengths=f,c&&L.rgba8888ToColor(m.color,u),m):null}case xt.Point:{let o=t.readFloat(),l=t.readFloat(),h=t.readFloat(),d=c?t.readInt32():0,f=this.attachmentLoader.newPointAttachment(e,s);return f?(f.x=l*n,f.y=h*n,f.rotation=o,c&&L.rgba8888ToColor(f.color,d),f):null}case xt.Clipping:{let o=t.readInt(!0),l=t.readInt(!0),h=this.readVertices(t,l),d=c?t.readInt32():0,f=this.attachmentLoader.newClippingAttachment(e,s);return f?(f.endSlot=i.slots[o],f.worldVerticesLength=l<<1,f.vertices=h.vertices,f.bones=h.bones,c&&L.rgba8888ToColor(f.color,d),f):null}}return null}readVertices(t,i){let e=this.scale,a=i<<1,r=new Ts;if(!t.readBoolean())return r.vertices=this.readFloatArray(t,a,e),r;let c=new Array,n=new Array;for(let s=0;s<i;s++){let o=t.readInt(!0);n.push(o);for(let l=0;l<o;l++)n.push(t.readInt(!0)),c.push(t.readFloat()*e),c.push(t.readFloat()*e),c.push(t.readFloat())}return r.vertices=R.toFloatArray(c),r.bones=n,r}readFloatArray(t,i,e){let a=new Array(i);if(e==1)for(let r=0;r<i;r++)a[r]=t.readFloat();else for(let r=0;r<i;r++)a[r]=t.readFloat()*e;return a}readShortArray(t){let i=t.readInt(!0),e=new Array(i);for(let a=0;a<i;a++)e[a]=t.readShort();return e}readAnimation(t,i,e){t.readInt(!0);let a=new Array,r=this.scale,c=new L,n=new L;for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0);for(let u=0,m=t.readInt(!0);u<m;u++){let b=t.readByte(),p=t.readInt(!0),y=p-1;switch(b){case Ns:{let g=new yt(p,f);for(let w=0;w<p;w++)g.setFrame(w,t.readFloat(),t.readStringRef());a.push(g);break}case Os:{let g=t.readInt(!0),w=new re(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255;for(let C=0,F=0;w.setFrame(C,x,v,A,S,I),C!=y;C++){let P=t.readFloat(),B=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,Y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(C);break;case ot:O(t,w,F++,C,0,x,P,v,B,1),O(t,w,F++,C,1,x,P,A,M,1),O(t,w,F++,C,2,x,P,S,Y,1),O(t,w,F++,C,3,x,P,I,T,1)}x=P,v=B,A=M,S=Y,I=T}a.push(w);break}case Us:{let g=t.readInt(!0),w=new ae(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255;for(let I=0,C=0;w.setFrame(I,x,v,A,S),I!=y;I++){let F=t.readFloat(),P=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(I);break;case ot:O(t,w,C++,I,0,x,F,v,P,1),O(t,w,C++,I,1,x,F,A,B,1),O(t,w,C++,I,2,x,F,S,M,1)}x=F,v=P,A=B,S=M}a.push(w);break}case Ws:{let g=t.readInt(!0),w=new le(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255;for(let B=0,M=0;w.setFrame(B,x,v,A,S,I,C,F,P),B!=y;B++){let Y=t.readFloat(),T=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,z=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,q=t.readUnsignedByte()/255,G=t.readUnsignedByte()/255,H=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(B);break;case ot:O(t,w,M++,B,0,x,Y,v,T,1),O(t,w,M++,B,1,x,Y,A,N,1),O(t,w,M++,B,2,x,Y,S,z,1),O(t,w,M++,B,3,x,Y,I,E,1),O(t,w,M++,B,4,x,Y,C,q,1),O(t,w,M++,B,5,x,Y,F,G,1),O(t,w,M++,B,6,x,Y,P,H,1)}x=Y,v=T,A=N,S=z,I=E,C=q,F=G,P=H}a.push(w);break}case zs:{let g=t.readInt(!0),w=new oe(p,g,f),x=t.readFloat(),v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255;for(let P=0,B=0;w.setFrame(P,x,v,A,S,I,C,F),P!=y;P++){let M=t.readFloat(),Y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,z=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,q=t.readUnsignedByte()/255;switch(t.readByte()){case lt:w.setStepped(P);break;case ot:O(t,w,B++,P,0,x,M,v,Y,1),O(t,w,B++,P,1,x,M,A,T,1),O(t,w,B++,P,2,x,M,S,N,1),O(t,w,B++,P,3,x,M,I,z,1),O(t,w,B++,P,4,x,M,C,E,1),O(t,w,B++,P,5,x,M,F,q,1)}x=M,v=Y,A=T,S=N,I=z,C=E,F=q}a.push(w);break}case qs:{let g=new ne(p,t.readInt(!0),f),w=t.readFloat(),x=t.readUnsignedByte()/255;for(let v=0,A=0;g.setFrame(v,w,x),v!=y;v++){let S=t.readFloat(),I=t.readUnsignedByte()/255;switch(t.readByte()){case lt:g.setStepped(v);break;case ot:O(t,g,A++,v,0,w,S,x,I,1)}w=S,x=I}a.push(g);break}}}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0);for(let u=0,m=t.readInt(!0);u<m;u++){let b=t.readByte(),p=t.readInt(!0),y=t.readInt(!0);switch(b){case Xs:a.push(bt(t,new Rt(p,y,f),1));break;case Ms:a.push(Re(t,new $t(p,y,f),r));break;case Fs:a.push(bt(t,new Jt(p,y,f),r));break;case Bs:a.push(bt(t,new Qt(p,y,f),r));break;case Rs:a.push(Re(t,new Kt(p,y,f),1));break;case Ps:a.push(bt(t,new Zt(p,y,f),1));break;case Es:a.push(bt(t,new te(p,y,f),1));break;case Vs:a.push(Re(t,new ee(p,y,f),1));break;case Ls:a.push(bt(t,new se(p,y,f),1));break;case Ds:a.push(bt(t,new ie(p,y,f),1))}}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),u=t.readInt(!0),m=u-1,b=new ce(u,t.readInt(!0),f),p=t.readFloat(),y=t.readFloat(),g=t.readFloat()*r;for(let w=0,x=0;b.setFrame(w,p,y,g,t.readByte(),t.readBoolean(),t.readBoolean()),w!=m;w++){let v=t.readFloat(),A=t.readFloat(),S=t.readFloat()*r;switch(t.readByte()){case lt:b.setStepped(w);break;case ot:O(t,b,x++,w,0,p,v,y,A,1),O(t,b,x++,w,1,p,v,g,S,r)}p=v,y=A,g=S}a.push(b)}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),u=t.readInt(!0),m=u-1,b=new de(u,t.readInt(!0),f),p=t.readFloat(),y=t.readFloat(),g=t.readFloat(),w=t.readFloat(),x=t.readFloat(),v=t.readFloat(),A=t.readFloat();for(let S=0,I=0;b.setFrame(S,p,y,g,w,x,v,A),S!=m;S++){let C=t.readFloat(),F=t.readFloat(),P=t.readFloat(),B=t.readFloat(),M=t.readFloat(),Y=t.readFloat(),T=t.readFloat();switch(t.readByte()){case lt:b.setStepped(S);break;case ot:O(t,b,I++,S,0,p,C,y,F,1),O(t,b,I++,S,1,p,C,g,P,1),O(t,b,I++,S,2,p,C,w,B,1),O(t,b,I++,S,3,p,C,x,M,1),O(t,b,I++,S,4,p,C,v,Y,1),O(t,b,I++,S,5,p,C,A,T,1)}p=C,y=F,g=P,w=B,x=M,v=Y,A=T}a.push(b)}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),u=e.pathConstraints[f];for(let m=0,b=t.readInt(!0);m<b;m++)switch(t.readByte()){case _s:a.push(bt(t,new fe(t.readInt(!0),t.readInt(!0),f),u.positionMode==dt.Fixed?r:1));break;case Hs:a.push(bt(t,new ue(t.readInt(!0),t.readInt(!0),f),u.spacingMode==Q.Length||u.spacingMode==Q.Fixed?r:1));break;case js:let p=new me(t.readInt(!0),t.readInt(!0),f),y=t.readFloat(),g=t.readFloat(),w=t.readFloat(),x=t.readFloat();for(let v=0,A=0,S=p.getFrameCount()-1;p.setFrame(v,y,g,w,x),v!=S;v++){let I=t.readFloat(),C=t.readFloat(),F=t.readFloat(),P=t.readFloat();switch(t.readByte()){case lt:p.setStepped(v);break;case ot:O(t,p,A++,v,0,y,I,g,C,1),O(t,p,A++,v,1,y,I,w,F,1),O(t,p,A++,v,2,y,I,x,P,1)}y=I,g=C,w=F,x=P}a.push(p)}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=e.skins[t.readInt(!0)];for(let u=0,m=t.readInt(!0);u<m;u++){let b=t.readInt(!0);for(let p=0,y=t.readInt(!0);p<y;p++){let g=t.readStringRef(),w=f.getAttachment(b,g),x=w.bones,v=w.vertices,A=x?v.length/3*2:v.length,S=t.readInt(!0),I=S-1,C=t.readInt(!0),F=new he(S,C,b,w),P=t.readFloat();for(let B=0,M=0;;B++){let Y,T=t.readInt(!0);if(T==0)Y=x?R.newFloatArray(A):v;else{Y=R.newFloatArray(A);let z=t.readInt(!0);if(T+=z,r==1)for(let E=z;E<T;E++)Y[E]=t.readFloat();else for(let E=z;E<T;E++)Y[E]=t.readFloat()*r;if(!x)for(let E=0,q=Y.length;E<q;E++)Y[E]+=v[E]}if(F.setFrame(B,P,Y),B==I)break;let N=t.readFloat();switch(t.readByte()){case lt:F.setStepped(B);break;case ot:O(t,F,M++,B,0,P,N,0,1,1)}P=N}a.push(F)}}}let s=t.readInt(!0);if(s>0){let h=new vt(s),d=e.slots.length;for(let f=0;f<s;f++){let u=t.readFloat(),m=t.readInt(!0),b=R.newArray(d,0);for(let w=d-1;w>=0;w--)b[w]=-1;let p=R.newArray(d-m,0),y=0,g=0;for(let w=0;w<m;w++){let x=t.readInt(!0);for(;y!=x;)p[g++]=y++;b[y+t.readInt(!0)]=y++}for(;y<d;)p[g++]=y++;for(let w=d-1;w>=0;w--)b[w]==-1&&(b[w]=p[--g]);h.setFrame(f,u,b)}a.push(h)}let o=t.readInt(!0);if(o>0){let h=new Pt(o);for(let d=0;d<o;d++){let f=t.readFloat(),u=e.events[t.readInt(!0)],m=new Ye(f,u);m.intValue=t.readInt(!1),m.floatValue=t.readFloat(),m.stringValue=t.readBoolean()?t.readString():u.stringValue,m.data.audioPath&&(m.volume=t.readFloat(),m.balance=t.readFloat()),h.setFrame(d,m)}a.push(h)}let l=0;for(let h=0,d=a.length;h<d;h++)l=Math.max(l,a[h].getDuration());return new Lt(i,a,l)}},as=class{constructor(t,i=new Array,e=0,a=new DataView(t.buffer)){this.strings=i,this.index=e,this.buffer=a}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let i=this.readByte(),e=i&127;return(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<7,(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<14,(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<21,(i&128)!=0&&(i=this.readByte(),e|=(i&127)<<28)))),t?e:e>>>1^-(e&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let i="",e=0;for(let a=0;a<t;){let r=this.readByte();switch(r>>4){case 12:case 13:i+=String.fromCharCode((r&31)<<6|this.readByte()&63),a+=2;break;case 14:i+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),a+=3;break;default:i+=String.fromCharCode(r),a++}}return i}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}},Is=class{constructor(t,i,e,a,r){this.mesh=t,this.skin=i,this.slotIndex=e,this.parent=a,this.inheritDeform=r}},Ts=class{constructor(t=null,i=null){this.bones=t,this.vertices=i}},xt;(function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"})(xt||(xt={}));function bt(t,i,e){let a=t.readFloat(),r=t.readFloat()*e;for(let c=0,n=0,s=i.getFrameCount()-1;i.setFrame(c,a,r),c!=s;c++){let o=t.readFloat(),l=t.readFloat()*e;switch(t.readByte()){case lt:i.setStepped(c);break;case ot:O(t,i,n++,c,0,a,o,r,l,e)}a=o,r=l}return i}function Re(t,i,e){let a=t.readFloat(),r=t.readFloat()*e,c=t.readFloat()*e;for(let n=0,s=0,o=i.getFrameCount()-1;i.setFrame(n,a,r,c),n!=o;n++){let l=t.readFloat(),h=t.readFloat()*e,d=t.readFloat()*e;switch(t.readByte()){case lt:i.setStepped(n);break;case ot:O(t,i,s++,n,0,a,l,r,h,e),O(t,i,s++,n,1,a,l,c,d,e)}a=l,r=h,c=d}return i}function O(t,i,e,a,r,c,n,s,o,l){i.setBezier(e,a,r,c,s,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,n,o)}var Xs=0,Ms=1,Fs=2,Bs=3,Rs=4,Ps=5,Es=6,Vs=7,Ls=8,Ds=9,Ns=0,Os=1,Us=2,Ws=3,zs=4,qs=5,_s=0,Hs=1,js=2,lt=1,ot=2,Gs=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new Bt(()=>R.newFloatArray(16))}update(t,i){if(!t)throw new Error("skeleton cannot be null.");let e=this.boundingBoxes,a=this.polygons,r=this.polygonPool,c=t.slots,n=c.length;e.length=0,r.freeAll(a),a.length=0;for(let s=0;s<n;s++){let o=c[s];if(!o.bone.active)continue;let l=o.getAttachment();if(l instanceof Ut){let h=l;e.push(h);let d=r.obtain();d.length!=h.worldVerticesLength&&(d=R.newFloatArray(h.worldVerticesLength)),a.push(d),h.computeWorldVertices(o,0,h.worldVerticesLength,d,0,2)}}i?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,r=this.polygons;for(let c=0,n=r.length;c<n;c++){let s=r[c],o=s;for(let l=0,h=s.length;l<h;l+=2){let d=o[l],f=o[l+1];t=Math.min(t,d),i=Math.min(i,f),e=Math.max(e,d),a=Math.max(a,f)}}this.minX=t,this.minY=i,this.maxX=e,this.maxY=a}aabbContainsPoint(t,i){return t>=this.minX&&t<=this.maxX&&i>=this.minY&&i<=this.maxY}aabbIntersectsSegment(t,i,e,a){let r=this.minX,c=this.minY,n=this.maxX,s=this.maxY;if(t<=r&&e<=r||i<=c&&a<=c||t>=n&&e>=n||i>=s&&a>=s)return!1;let o=(a-i)/(e-t),l=o*(r-t)+i;if(l>c&&l<s||(l=o*(n-t)+i,l>c&&l<s))return!0;let h=(c-i)/o+t;return!!(h>r&&h<n||(h=(s-i)/o+t,h>r&&h<n))}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,i){let e=this.polygons;for(let a=0,r=e.length;a<r;a++)if(this.containsPointPolygon(e[a],t,i))return this.boundingBoxes[a];return null}containsPointPolygon(t,i,e){let a=t,r=t.length,c=r-2,n=!1;for(let s=0;s<r;s+=2){let o=a[s+1],l=a[c+1];if(o<e&&l>=e||l<e&&o>=e){let h=a[s];h+(e-o)/(l-o)*(a[c]-h)<i&&(n=!n)}c=s}return n}intersectsSegment(t,i,e,a){let r=this.polygons;for(let c=0,n=r.length;c<n;c++)if(this.intersectsSegmentPolygon(r[c],t,i,e,a))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(t,i,e,a,r){let c=t,n=t.length,s=i-a,o=e-r,l=i*r-e*a,h=c[n-2],d=c[n-1];for(let f=0;f<n;f+=2){let u=c[f],m=c[f+1],b=h*m-d*u,p=h-u,y=d-m,g=s*y-o*p,w=(l*p-s*b)/g;if((w>=h&&w<=u||w>=u&&w<=h)&&(w>=i&&w<=a||w>=a&&w<=i)){let x=(l*y-o*b)/g;if((x>=d&&x<=m||x>=m&&x<=d)&&(x>=e&&x<=r||x>=r&&x<=e))return!0}h=u,d=m}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let i=this.boundingBoxes.indexOf(t);return i==-1?null:this.polygons[i]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},st=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new Bt(()=>new Array),this.polygonIndicesPool=new Bt(()=>new Array)}triangulate(t){let i=t,e=t.length>>1,a=this.indicesArray;a.length=0;for(let n=0;n<e;n++)a[n]=n;let r=this.isConcaveArray;r.length=0;for(let n=0,s=e;n<s;++n)r[n]=st.isConcave(n,e,i,a);let c=this.triangles;for(c.length=0;e>3;){let n=e-1,s=0,o=1;for(;;){t:if(!r[s]){let d=a[n]<<1,f=a[s]<<1,u=a[o]<<1,m=i[d],b=i[d+1],p=i[f],y=i[f+1],g=i[u],w=i[u+1];for(let x=(o+1)%e;x!=n;x=(x+1)%e){if(!r[x])continue;let v=a[x]<<1,A=i[v],S=i[v+1];if(st.positiveArea(g,w,m,b,A,S)&&st.positiveArea(m,b,p,y,A,S)&&st.positiveArea(p,y,g,w,A,S))break t}break}if(o==0){do{if(!r[s])break;s--}while(s>0);break}n=s,s=o,o=(o+1)%e}c.push(a[(e+s-1)%e]),c.push(a[s]),c.push(a[(s+1)%e]),a.splice(s,1),r.splice(s,1),e--;let l=(e+s-1)%e,h=s==e?0:s;r[l]=st.isConcave(l,e,i,a),r[h]=st.isConcave(h,e,i,a)}return e==3&&(c.push(a[2]),c.push(a[0]),c.push(a[1])),c}decompose(t,i){let e=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let n=this.polygonPool.obtain();n.length=0;let s=-1,o=0;for(let l=0,h=i.length;l<h;l+=3){let d=i[l]<<1,f=i[l+1]<<1,u=i[l+2]<<1,m=e[d],b=e[d+1],p=e[f],y=e[f+1],g=e[u],w=e[u+1],x=!1;if(s==d){let v=n.length-4,A=st.winding(n[v],n[v+1],n[v+2],n[v+3],g,w),S=st.winding(g,w,n[0],n[1],n[2],n[3]);A==o&&S==o&&(n.push(g),n.push(w),c.push(u),x=!0)}x||(n.length>0?(a.push(n),r.push(c)):(this.polygonPool.free(n),this.polygonIndicesPool.free(c)),n=this.polygonPool.obtain(),n.length=0,n.push(m),n.push(b),n.push(p),n.push(y),n.push(g),n.push(w),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(u),o=st.winding(m,b,p,y,g,w),s=d)}n.length>0&&(a.push(n),r.push(c));for(let l=0,h=a.length;l<h;l++){if(c=r[l],c.length==0)continue;let d=c[0],f=c[c.length-1];n=a[l];let u=n.length-4,m=n[u],b=n[u+1],p=n[u+2],y=n[u+3],g=n[0],w=n[1],x=n[2],v=n[3],A=st.winding(m,b,p,y,g,w);for(let S=0;S<h;S++){if(S==l)continue;let I=r[S];if(I.length!=3)continue;let C=I[0],F=I[1],P=I[2],B=a[S],M=B[B.length-2],Y=B[B.length-1];if(C!=d||F!=f)continue;let T=st.winding(m,b,p,y,M,Y),N=st.winding(M,Y,g,w,x,v);T==A&&N==A&&(B.length=0,I.length=0,n.push(M),n.push(Y),c.push(P),m=p,b=y,p=M,y=Y,S=0)}}for(let l=a.length-1;l>=0;l--)n=a[l],n.length==0&&(a.splice(l,1),this.polygonPool.free(n),c=r[l],r.splice(l,1),this.polygonIndicesPool.free(c));return a}static isConcave(t,i,e,a){let r=a[(i+t-1)%i]<<1,c=a[t]<<1,n=a[(t+1)%i]<<1;return!this.positiveArea(e[r],e[r+1],e[c],e[c+1],e[n],e[n+1])}static positiveArea(t,i,e,a,r,c){return t*(c-a)+e*(i-c)+r*(a-i)>=0}static winding(t,i,e,a,r,c){let n=e-t,s=a-i;return r*s-c*n+n*i-t*s>=0?1:-1}},Pe=class{constructor(){this.triangulator=new st,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(t,i){if(this.clipAttachment)return 0;this.clipAttachment=i;let e=i.worldVerticesLength,a=R.setArraySize(this.clippingPolygon,e);i.computeWorldVertices(t,0,e,a,0,2);let r=this.clippingPolygon;Pe.makeClockwise(r);let c=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let n=0,s=c.length;n<s;n++){let o=c[n];Pe.makeClockwise(o),o.push(o[0]),o.push(o[1])}return c.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){!this.clipAttachment||(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,i,e,a,r,c,n,s){let o=this.clipOutput,l=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=this.clippingPolygons.length,u=s?12:8,m=0;l.length=0,h.length=0;t:for(let b=0;b<a;b+=3){let p=e[b]<<1,y=t[p],g=t[p+1],w=r[p],x=r[p+1];p=e[b+1]<<1;let v=t[p],A=t[p+1],S=r[p],I=r[p+1];p=e[b+2]<<1;let C=t[p],F=t[p+1],P=r[p],B=r[p+1];for(let M=0;M<f;M++){let Y=l.length;if(this.clip(y,g,v,A,C,F,d[M],o)){let T=o.length;if(T==0)continue;let N=A-F,z=C-v,E=y-C,q=F-g,G=1/(N*E+z*(g-F)),H=T>>1,D=this.clipOutput,V=R.setArraySize(l,Y+H*u);for(let Z=0;Z<T;Z+=2){let ht=D[Z],K=D[Z+1];V[Y]=ht,V[Y+1]=K,V[Y+2]=c.r,V[Y+3]=c.g,V[Y+4]=c.b,V[Y+5]=c.a;let it=ht-C,rt=K-F,wt=(N*it+z*rt)*G,Xt=(q*it+E*rt)*G,Et=1-wt-Xt;V[Y+6]=w*wt+S*Xt+P*Et,V[Y+7]=x*wt+I*Xt+B*Et,s&&(V[Y+8]=n.r,V[Y+9]=n.g,V[Y+10]=n.b,V[Y+11]=n.a),Y+=u}Y=h.length;let j=R.setArraySize(h,Y+3*(H-2));H--;for(let Z=1;Z<H;Z++)j[Y]=m,j[Y+1]=m+Z,j[Y+2]=m+Z+1,Y+=3;m+=H+1}else{let T=R.setArraySize(l,Y+3*u);T[Y]=y,T[Y+1]=g,T[Y+2]=c.r,T[Y+3]=c.g,T[Y+4]=c.b,T[Y+5]=c.a,s?(T[Y+6]=w,T[Y+7]=x,T[Y+8]=n.r,T[Y+9]=n.g,T[Y+10]=n.b,T[Y+11]=n.a,T[Y+12]=v,T[Y+13]=A,T[Y+14]=c.r,T[Y+15]=c.g,T[Y+16]=c.b,T[Y+17]=c.a,T[Y+18]=S,T[Y+19]=I,T[Y+20]=n.r,T[Y+21]=n.g,T[Y+22]=n.b,T[Y+23]=n.a,T[Y+24]=C,T[Y+25]=F,T[Y+26]=c.r,T[Y+27]=c.g,T[Y+28]=c.b,T[Y+29]=c.a,T[Y+30]=P,T[Y+31]=B,T[Y+32]=n.r,T[Y+33]=n.g,T[Y+34]=n.b,T[Y+35]=n.a):(T[Y+6]=w,T[Y+7]=x,T[Y+8]=v,T[Y+9]=A,T[Y+10]=c.r,T[Y+11]=c.g,T[Y+12]=c.b,T[Y+13]=c.a,T[Y+14]=S,T[Y+15]=I,T[Y+16]=C,T[Y+17]=F,T[Y+18]=c.r,T[Y+19]=c.g,T[Y+20]=c.b,T[Y+21]=c.a,T[Y+22]=P,T[Y+23]=B),Y=h.length;let N=R.setArraySize(h,Y+3);N[Y]=m,N[Y+1]=m+1,N[Y+2]=m+2,m+=3;continue t}}}}clip(t,i,e,a,r,c,n,s){let o=s,l=!1,h=null;n.length%4>=2?(h=s,s=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(i),h.push(e),h.push(a),h.push(r),h.push(c),h.push(t),h.push(i),s.length=0;let d=n,f=n.length-4;for(let u=0;;u+=2){let m=d[u],b=d[u+1],p=d[u+2],y=d[u+3],g=m-p,w=b-y,x=h,v=h.length-2,A=s.length;for(let I=0;I<v;I+=2){let C=x[I],F=x[I+1],P=x[I+2],B=x[I+3],M=g*(B-y)-w*(P-p)>0;if(g*(F-y)-w*(C-p)>0){if(M){s.push(P),s.push(B);continue}let Y=B-F,T=P-C,N=Y*(p-m)-T*(y-b);if(Math.abs(N)>1e-6){let z=(T*(b-F)-Y*(m-C))/N;s.push(m+(p-m)*z),s.push(b+(y-b)*z)}else s.push(m),s.push(b)}else if(M){let Y=B-F,T=P-C,N=Y*(p-m)-T*(y-b);if(Math.abs(N)>1e-6){let z=(T*(b-F)-Y*(m-C))/N;s.push(m+(p-m)*z),s.push(b+(y-b)*z)}else s.push(m),s.push(b);s.push(P),s.push(B)}l=!0}if(A==s.length)return o.length=0,!0;if(s.push(s[0]),s.push(s[1]),u==f)break;let S=s;s=h,s.length=0,h=S}if(o!=s){o.length=0;for(let u=0,m=s.length-2;u<m;u++)o[u]=s[u]}else o.length=o.length-2;return l}static makeClockwise(t){let i=t,e=t.length,a=i[e-2]*i[1]-i[0]*i[e-1],r=0,c=0,n=0,s=0;for(let o=0,l=e-3;o<l;o+=2)r=i[o],c=i[o+1],n=i[o+2],s=i[o+3],a+=r*s-n*c;if(!(a<0))for(let o=0,l=e-2,h=e>>1;o<h;o+=2){let d=i[o],f=i[o+1],u=l-o;i[o]=i[u],i[o+1]=i[u+1],i[u]=d,i[u+1]=f}}},$s=class{constructor(t){this.attachmentLoader=null,this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let i=this.scale,e=new Xe,a=typeof t=="string"?JSON.parse(t):t,r=a.skeleton;if(r&&(e.hash=r.hash,e.version=r.spine,e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height,e.fps=r.fps,e.imagesPath=r.images),a.bones)for(let c=0;c<a.bones.length;c++){let n=a.bones[c],s=null,o=k(n,"parent",null);o&&(s=e.findBone(o));let l=new Ae(e.bones.length,n.name,s);l.length=k(n,"length",0)*i,l.x=k(n,"x",0)*i,l.y=k(n,"y",0)*i,l.rotation=k(n,"rotation",0),l.scaleX=k(n,"scaleX",1),l.scaleY=k(n,"scaleY",1),l.shearX=k(n,"shearX",0),l.shearY=k(n,"shearY",0),l.transformMode=R.enumValue(et,k(n,"transform","Normal")),l.skinRequired=k(n,"skin",!1);let h=k(n,"color",null);h&&l.color.setFromString(h),e.bones.push(l)}if(a.slots)for(let c=0;c<a.slots.length;c++){let n=a.slots[c],s=e.findBone(n.bone),o=new Fe(e.slots.length,n.name,s),l=k(n,"color",null);l&&o.color.setFromString(l);let h=k(n,"dark",null);h&&(o.darkColor=L.fromString(h)),o.attachmentName=k(n,"attachment",null),o.blendMode=R.enumValue(qt,k(n,"blend","normal")),e.slots.push(o)}if(a.ik)for(let c=0;c<a.ik.length;c++){let n=a.ik[c],s=new Ie(n.name);s.order=k(n,"order",0),s.skinRequired=k(n,"skin",!1);for(let o=0;o<n.bones.length;o++)s.bones.push(e.findBone(n.bones[o]));s.target=e.findBone(n.target),s.mix=k(n,"mix",1),s.softness=k(n,"softness",0)*i,s.bendDirection=k(n,"bendPositive",!0)?1:-1,s.compress=k(n,"compress",!1),s.stretch=k(n,"stretch",!1),s.uniform=k(n,"uniform",!1),e.ikConstraints.push(s)}if(a.transform)for(let c=0;c<a.transform.length;c++){let n=a.transform[c],s=new Be(n.name);s.order=k(n,"order",0),s.skinRequired=k(n,"skin",!1);for(let l=0;l<n.bones.length;l++)s.bones.push(e.findBone(n.bones[l]));let o=n.target;s.target=e.findBone(o),s.local=k(n,"local",!1),s.relative=k(n,"relative",!1),s.offsetRotation=k(n,"rotation",0),s.offsetX=k(n,"x",0)*i,s.offsetY=k(n,"y",0)*i,s.offsetScaleX=k(n,"scaleX",0),s.offsetScaleY=k(n,"scaleY",0),s.offsetShearY=k(n,"shearY",0),s.mixRotate=k(n,"mixRotate",1),s.mixX=k(n,"mixX",1),s.mixY=k(n,"mixY",s.mixX),s.mixScaleX=k(n,"mixScaleX",1),s.mixScaleY=k(n,"mixScaleY",s.mixScaleX),s.mixShearY=k(n,"mixShearY",1),e.transformConstraints.push(s)}if(a.path)for(let c=0;c<a.path.length;c++){let n=a.path[c],s=new Te(n.name);s.order=k(n,"order",0),s.skinRequired=k(n,"skin",!1);for(let l=0;l<n.bones.length;l++)s.bones.push(e.findBone(n.bones[l]));let o=n.target;s.target=e.findSlot(o),s.positionMode=R.enumValue(dt,k(n,"positionMode","Percent")),s.spacingMode=R.enumValue(Q,k(n,"spacingMode","Length")),s.rotateMode=R.enumValue(kt,k(n,"rotateMode","Tangent")),s.offsetRotation=k(n,"rotation",0),s.position=k(n,"position",0),s.positionMode==dt.Fixed&&(s.position*=i),s.spacing=k(n,"spacing",0),(s.spacingMode==Q.Length||s.spacingMode==Q.Fixed)&&(s.spacing*=i),s.mixRotate=k(n,"mixRotate",1),s.mixX=k(n,"mixX",1),s.mixY=k(n,"mixY",s.mixX),e.pathConstraints.push(s)}if(a.skins)for(let c=0;c<a.skins.length;c++){let n=a.skins[c],s=new zt(n.name);if(n.bones)for(let o=0;o<n.bones.length;o++)s.bones.push(e.findBone(n.bones[o]));if(n.ik)for(let o=0;o<n.ik.length;o++)s.constraints.push(e.findIkConstraint(n.ik[o]));if(n.transform)for(let o=0;o<n.transform.length;o++)s.constraints.push(e.findTransformConstraint(n.transform[o]));if(n.path)for(let o=0;o<n.path.length;o++)s.constraints.push(e.findPathConstraint(n.path[o]));for(let o in n.attachments){let l=e.findSlot(o),h=n.attachments[o];for(let d in h){let f=this.readAttachment(h[d],s,l.index,d,e);f&&s.setAttachment(l.index,d,f)}}e.skins.push(s),s.name=="default"&&(e.defaultSkin=s)}for(let c=0,n=this.linkedMeshes.length;c<n;c++){let s=this.linkedMeshes[c],l=(s.skin?e.findSkin(s.skin):e.defaultSkin).getAttachment(s.slotIndex,s.parent);s.mesh.deformAttachment=s.inheritDeform?l:s.mesh,s.mesh.setParentMesh(l),s.mesh.updateUVs()}if(this.linkedMeshes.length=0,a.events)for(let c in a.events){let n=a.events[c],s=new Ce(c);s.intValue=k(n,"int",0),s.floatValue=k(n,"float",0),s.stringValue=k(n,"string",""),s.audioPath=k(n,"audio",null),s.audioPath&&(s.volume=k(n,"volume",1),s.balance=k(n,"balance",0)),e.events.push(s)}if(a.animations)for(let c in a.animations){let n=a.animations[c];this.readAnimation(n,c,e)}return e}readAttachment(t,i,e,a,r){let c=this.scale;switch(a=k(t,"name",a),k(t,"type","region")){case"region":{let n=k(t,"path",a),s=this.attachmentLoader.newRegionAttachment(i,a,n);if(!s)return null;s.path=n,s.x=k(t,"x",0)*c,s.y=k(t,"y",0)*c,s.scaleX=k(t,"scaleX",1),s.scaleY=k(t,"scaleY",1),s.rotation=k(t,"rotation",0),s.width=t.width*c,s.height=t.height*c;let o=k(t,"color",null);return o&&s.color.setFromString(o),s.updateOffset(),s}case"boundingbox":{let n=this.attachmentLoader.newBoundingBoxAttachment(i,a);if(!n)return null;this.readVertices(t,n,t.vertexCount<<1);let s=k(t,"color",null);return s&&n.color.setFromString(s),n}case"mesh":case"linkedmesh":{let n=k(t,"path",a),s=this.attachmentLoader.newMeshAttachment(i,a,n);if(!s)return null;s.path=n;let o=k(t,"color",null);o&&s.color.setFromString(o),s.width=k(t,"width",0)*c,s.height=k(t,"height",0)*c;let l=k(t,"parent",null);if(l)return this.linkedMeshes.push(new Js(s,k(t,"skin",null),e,l,k(t,"deform",!0))),s;let h=t.uvs;return this.readVertices(t,s,h.length),s.triangles=t.triangles,s.regionUVs=h,s.updateUVs(),s.edges=k(t,"edges",null),s.hullLength=k(t,"hull",0)*2,s}case"path":{let n=this.attachmentLoader.newPathAttachment(i,a);if(!n)return null;n.closed=k(t,"closed",!1),n.constantSpeed=k(t,"constantSpeed",!0);let s=t.vertexCount;this.readVertices(t,n,s<<1);let o=R.newArray(s/3,0);for(let h=0;h<t.lengths.length;h++)o[h]=t.lengths[h]*c;n.lengths=o;let l=k(t,"color",null);return l&&n.color.setFromString(l),n}case"point":{let n=this.attachmentLoader.newPointAttachment(i,a);if(!n)return null;n.x=k(t,"x",0)*c,n.y=k(t,"y",0)*c,n.rotation=k(t,"rotation",0);let s=k(t,"color",null);return s&&n.color.setFromString(s),n}case"clipping":{let n=this.attachmentLoader.newClippingAttachment(i,a);if(!n)return null;let s=k(t,"end",null);s&&(n.endSlot=r.findSlot(s));let o=t.vertexCount;this.readVertices(t,n,o<<1);let l=k(t,"color",null);return l&&n.color.setFromString(l),n}}return null}readVertices(t,i,e){let a=this.scale;i.worldVerticesLength=e;let r=t.vertices;if(e==r.length){let s=R.toFloatArray(r);if(a!=1)for(let o=0,l=r.length;o<l;o++)s[o]*=a;i.vertices=s;return}let c=new Array,n=new Array;for(let s=0,o=r.length;s<o;){let l=r[s++];n.push(l);for(let h=s+l*4;s<h;s+=4)n.push(r[s]),c.push(r[s+1]*a),c.push(r[s+2]*a),c.push(r[s+3])}i.bones=n,i.vertices=R.toFloatArray(c)}readAnimation(t,i,e){let a=this.scale,r=new Array;if(t.slots)for(let n in t.slots){let s=t.slots[n],o=e.findSlot(n).index;for(let l in s){let h=s[l];if(!h)continue;let d=h.length;if(l=="attachment"){let f=new yt(d,o);for(let u=0;u<d;u++){let m=h[u];f.setFrame(u,k(m,"time",0),m.name)}r.push(f)}else if(l=="rgba"){let f=new re(d,d<<2,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,m,b.r,b.g,b.b,b.a);let g=h[p+1];if(!g){f.shrink(y);break}let w=k(g,"time",0),x=L.fromString(g.color),v=u.curve;v&&(y=W(v,f,y,p,0,m,w,b.r,x.r,1),y=W(v,f,y,p,1,m,w,b.g,x.g,1),y=W(v,f,y,p,2,m,w,b.b,x.b,1),y=W(v,f,y,p,3,m,w,b.a,x.a,1)),m=w,b=x,u=g}r.push(f)}else if(l=="rgb"){let f=new ae(d,d*3,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.color);for(let p=0,y=0;;p++){f.setFrame(p,m,b.r,b.g,b.b);let g=h[p+1];if(!g){f.shrink(y);break}let w=k(g,"time",0),x=L.fromString(g.color),v=u.curve;v&&(y=W(v,f,y,p,0,m,w,b.r,x.r,1),y=W(v,f,y,p,1,m,w,b.g,x.g,1),y=W(v,f,y,p,2,m,w,b.b,x.b,1)),m=w,b=x,u=g}r.push(f)}else if(l=="alpha")r.push(ft(h,new ne(d,d,o),0,1));else if(l=="rgba2"){let f=new le(d,d*7,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.light),p=L.fromString(u.dark);for(let y=0,g=0;;y++){f.setFrame(y,m,b.r,b.g,b.b,b.a,p.r,p.g,p.b);let w=h[y+1];if(!w){f.shrink(g);break}let x=k(w,"time",0),v=L.fromString(w.light),A=L.fromString(w.dark),S=u.curve;S&&(g=W(S,f,g,y,0,m,x,b.r,v.r,1),g=W(S,f,g,y,1,m,x,b.g,v.g,1),g=W(S,f,g,y,2,m,x,b.b,v.b,1),g=W(S,f,g,y,3,m,x,b.a,v.a,1),g=W(S,f,g,y,4,m,x,p.r,A.r,1),g=W(S,f,g,y,5,m,x,p.g,A.g,1),g=W(S,f,g,y,6,m,x,p.b,A.b,1)),m=x,b=v,p=A,u=w}r.push(f)}else if(l=="rgb2"){let f=new oe(d,d*6,o),u=h[0],m=k(u,"time",0),b=L.fromString(u.light),p=L.fromString(u.dark);for(let y=0,g=0;;y++){f.setFrame(y,m,b.r,b.g,b.b,p.r,p.g,p.b);let w=h[y+1];if(!w){f.shrink(g);break}let x=k(w,"time",0),v=L.fromString(w.light),A=L.fromString(w.dark),S=u.curve;S&&(g=W(S,f,g,y,0,m,x,b.r,v.r,1),g=W(S,f,g,y,1,m,x,b.g,v.g,1),g=W(S,f,g,y,2,m,x,b.b,v.b,1),g=W(S,f,g,y,3,m,x,p.r,A.r,1),g=W(S,f,g,y,4,m,x,p.g,A.g,1),g=W(S,f,g,y,5,m,x,p.b,A.b,1)),m=x,b=v,p=A,u=w}r.push(f)}}}if(t.bones)for(let n in t.bones){let s=t.bones[n],o=e.findBone(n).index;for(let l in s){let h=s[l],d=h.length;if(d!=0){if(l==="rotate")r.push(ft(h,new Rt(d,d,o),0,1));else if(l==="translate"){let f=new $t(d,d<<1,o);r.push(Ee(h,f,"x","y",0,a))}else if(l==="translatex"){let f=new Jt(d,d,o);r.push(ft(h,f,0,a))}else if(l==="translatey"){let f=new Qt(d,d,o);r.push(ft(h,f,0,a))}else if(l==="scale"){let f=new Kt(d,d<<1,o);r.push(Ee(h,f,"x","y",1,1))}else if(l==="scalex"){let f=new Zt(d,d,o);r.push(ft(h,f,1,1))}else if(l==="scaley"){let f=new te(d,d,o);r.push(ft(h,f,1,1))}else if(l==="shear"){let f=new ee(d,d<<1,o);r.push(Ee(h,f,"x","y",0,1))}else if(l==="shearx"){let f=new se(d,d,o);r.push(ft(h,f,0,1))}else if(l==="sheary"){let f=new ie(d,d,o);r.push(ft(h,f,0,1))}}}}if(t.ik)for(let n in t.ik){let s=t.ik[n],o=s[0];if(!o)continue;let l=e.findIkConstraint(n),h=e.ikConstraints.indexOf(l),d=new ce(s.length,s.length<<1,h),f=k(o,"time",0),u=k(o,"mix",1),m=k(o,"softness",0)*a;for(let b=0,p=0;;b++){d.setFrame(b,f,u,m,k(o,"bendPositive",!0)?1:-1,k(o,"compress",!1),k(o,"stretch",!1));let y=s[b+1];if(!y){d.shrink(p);break}let g=k(y,"time",0),w=k(y,"mix",1),x=k(y,"softness",0)*a,v=o.curve;v&&(p=W(v,d,p,b,0,f,g,u,w,1),p=W(v,d,p,b,1,f,g,m,x,a)),f=g,u=w,m=x,o=y}r.push(d)}if(t.transform)for(let n in t.transform){let s=t.transform[n],o=s[0];if(!o)continue;let l=e.findTransformConstraint(n),h=e.transformConstraints.indexOf(l),d=new de(s.length,s.length*6,h),f=k(o,"time",0),u=k(o,"mixRotate",1),m=k(o,"mixX",1),b=k(o,"mixY",m),p=k(o,"mixScaleX",1),y=k(o,"mixScaleY",p),g=k(o,"mixShearY",1);for(let w=0,x=0;;w++){d.setFrame(w,f,u,m,b,p,y,g);let v=s[w+1];if(!v){d.shrink(x);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),I=k(v,"mixX",1),C=k(v,"mixY",I),F=k(v,"mixScaleX",1),P=k(v,"mixScaleY",F),B=k(v,"mixShearY",1),M=o.curve;M&&(x=W(M,d,x,w,0,f,A,u,S,1),x=W(M,d,x,w,1,f,A,m,I,1),x=W(M,d,x,w,2,f,A,b,C,1),x=W(M,d,x,w,3,f,A,p,F,1),x=W(M,d,x,w,4,f,A,y,P,1),x=W(M,d,x,w,5,f,A,g,B,1)),f=A,u=S,m=I,b=C,p=F,y=P,p=F,o=v}r.push(d)}if(t.path)for(let n in t.path){let s=t.path[n],o=e.findPathConstraint(n),l=e.pathConstraints.indexOf(o);for(let h in s){let d=s[h],f=d[0];if(!f)continue;let u=d.length;if(h==="position"){let m=new fe(u,u,l);r.push(ft(d,m,0,o.positionMode==dt.Fixed?a:1))}else if(h==="spacing"){let m=new ue(u,u,l);r.push(ft(d,m,0,o.spacingMode==Q.Length||o.spacingMode==Q.Fixed?a:1))}else if(h==="mix"){let m=new me(u,u*3,l),b=k(f,"time",0),p=k(f,"mixRotate",1),y=k(f,"mixX",1),g=k(f,"mixY",y);for(let w=0,x=0;;w++){m.setFrame(w,b,p,y,g);let v=d[w+1];if(!v){m.shrink(x);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),I=k(v,"mixX",1),C=k(v,"mixY",I),F=f.curve;F&&(x=W(F,m,x,w,0,b,A,p,S,1),x=W(F,m,x,w,1,b,A,y,I,1),x=W(F,m,x,w,2,b,A,g,C,1)),b=A,p=S,y=I,g=C,f=v}r.push(m)}}}if(t.deform)for(let n in t.deform){let s=t.deform[n],o=e.findSkin(n);for(let l in s){let h=s[l],d=e.findSlot(l).index;for(let f in h){let u=h[f],m=u[0];if(!m)continue;let b=o.getAttachment(d,f),p=b.bones,y=b.vertices,g=p?y.length/3*2:y.length,w=new he(u.length,u.length,d,b),x=k(m,"time",0);for(let v=0,A=0;;v++){let S,I=k(m,"vertices",null);if(!I)S=p?R.newFloatArray(g):y;else{S=R.newFloatArray(g);let B=k(m,"offset",0);if(R.arrayCopy(I,0,S,B,I.length),a!=1)for(let M=B,Y=M+I.length;M<Y;M++)S[M]*=a;if(!p)for(let M=0;M<g;M++)S[M]+=y[M]}w.setFrame(v,x,S);let C=u[v+1];if(!C){w.shrink(A);break}let F=k(C,"time",0),P=m.curve;P&&(A=W(P,w,A,v,0,x,F,0,1,1)),x=F,m=C}r.push(w)}}}if(t.drawOrder){let n=new vt(t.drawOrder.length),s=e.slots.length,o=0;for(let l=0;l<t.drawOrder.length;l++,o++){let h=t.drawOrder[l],d=null,f=k(h,"offsets",null);if(f){d=R.newArray(s,-1);let u=R.newArray(s-f.length,0),m=0,b=0;for(let p=0;p<f.length;p++){let y=f[p],g=e.findSlot(y.slot).index;for(;m!=g;)u[b++]=m++;d[m+y.offset]=m++}for(;m<s;)u[b++]=m++;for(let p=s-1;p>=0;p--)d[p]==-1&&(d[p]=u[--b])}n.setFrame(o,k(h,"time",0),d)}r.push(n)}if(t.events){let n=new Pt(t.events.length),s=0;for(let o=0;o<t.events.length;o++,s++){let l=t.events[o],h=e.findEvent(l.name),d=new Ye(R.toSinglePrecision(k(l,"time",0)),h);d.intValue=k(l,"int",h.intValue),d.floatValue=k(l,"float",h.floatValue),d.stringValue=k(l,"string",h.stringValue),d.data.audioPath&&(d.volume=k(l,"volume",1),d.balance=k(l,"balance",0)),n.setFrame(s,d)}r.push(n)}let c=0;for(let n=0,s=r.length;n<s;n++)c=Math.max(c,r[n].getDuration());e.animations.push(new Lt(i,r,c))}},Js=class{constructor(t,i,e,a,r){this.mesh=t,this.skin=i,this.slotIndex=e,this.parent=a,this.inheritDeform=r}};function ft(t,i,e,a){let r=t[0],c=k(r,"time",0),n=k(r,"value",e)*a,s=0;for(let o=0;;o++){i.setFrame(o,c,n);let l=t[o+1];if(!l)return i.shrink(s),i;let h=k(l,"time",0),d=k(l,"value",e)*a;r.curve&&(s=W(r.curve,i,s,o,0,c,h,n,d,a)),c=h,n=d,r=l}}function Ee(t,i,e,a,r,c){let n=t[0],s=k(n,"time",0),o=k(n,e,r)*c,l=k(n,a,r)*c,h=0;for(let d=0;;d++){i.setFrame(d,s,o,l);let f=t[d+1];if(!f)return i.shrink(h),i;let u=k(f,"time",0),m=k(f,e,r)*c,b=k(f,a,r)*c,p=n.curve;p&&(h=W(p,i,h,d,0,s,u,o,m,c),h=W(p,i,h,d,1,s,u,l,b,c)),s=u,o=m,l=b,n=f}}function W(t,i,e,a,r,c,n,s,o,l){if(t=="stepped")return i.setStepped(a),e;let h=r<<2,d=t[h],f=t[h+1]*l,u=t[h+2],m=t[h+3]*l;return i.setBezier(e,a,r,c,s,d,f,u,m,n,o),e+1}function k(t,i,e){return t[i]!==void 0?t[i]:e}(()=>{typeof Math.fround=="undefined"&&(Math.fround=function(t){return function(i){return t[0]=i,t[0]}}(new Float32Array(1)))})();var Qs=class{constructor(t,i){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=i}begin(t){}transform(t,i,e,a){t.x+=X.randomTriangular(-this.jitterX,this.jitterY),t.y+=X.randomTriangular(-this.jitterX,this.jitterY)}end(){}},ns=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,i,e,a){let r=this.angle*X.degreesToRadians,c=t.x-this.worldX,n=t.y-this.worldY,s=Math.sqrt(c*c+n*n);if(s<this.radius){let o=ns.interpolation.apply(0,r,(this.radius-s)/this.radius),l=Math.cos(o),h=Math.sin(o);t.x=l*c-h*n+this.worldX,t.y=h*c+l*n+this.worldY}}end(){}},ls=ns;return ls.interpolation=new We(2),Ne})();
|