@esotericsoftware/spine-pixi-v8 4.2.63
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.
- package/README.md +3 -0
- package/dist/BatchableSpineSlot.d.ts +58 -0
- package/dist/BatchableSpineSlot.js +103 -0
- package/dist/Spine.d.ts +243 -0
- package/dist/Spine.js +629 -0
- package/dist/SpineDebugRenderer.d.ts +108 -0
- package/dist/SpineDebugRenderer.js +473 -0
- package/dist/SpinePipe.d.ts +45 -0
- package/dist/SpinePipe.js +136 -0
- package/dist/SpineTexture.d.ts +44 -0
- package/dist/SpineTexture.js +116 -0
- package/dist/assets/atlasLoader.d.ts +33 -0
- package/dist/assets/atlasLoader.js +112 -0
- package/dist/assets/skeletonLoader.d.ts +29 -0
- package/dist/assets/skeletonLoader.js +60 -0
- package/dist/darktint/DarkTintBatchGeometry.d.ts +4 -0
- package/dist/darktint/DarkTintBatchGeometry.js +57 -0
- package/dist/darktint/DarkTintBatcher.d.ts +21 -0
- package/dist/darktint/DarkTintBatcher.js +101 -0
- package/dist/darktint/DarkTintShader.d.ts +4 -0
- package/dist/darktint/DarkTintShader.js +32 -0
- package/dist/darktint/darkTintBit.d.ts +22 -0
- package/dist/darktint/darkTintBit.js +49 -0
- package/dist/iife/spine-pixi-v8.js +13425 -0
- package/dist/iife/spine-pixi-v8.js.map +7 -0
- package/dist/iife/spine-pixi-v8.min.js +27 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +42 -0
- package/dist/require-shim.d.ts +33 -0
- package/dist/require-shim.js +39 -0
- package/package.json +39 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";var spine=(()=>{var He=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,ir=Object.prototype.hasOwnProperty,nr=(e,t,s)=>t in e?He(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,xe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ar=(e,t)=>{for(var s in t)He(e,s,{get:t[s],enumerable:!0})},or=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rr(t))!ir.call(e,n)&&n!==s&&He(e,n,{get:()=>t[n],enumerable:!(r=sr(t,n))||r.enumerable});return e},lr=e=>or(He({},"__esModule",{value:!0}),e),R=(e,t,s)=>(nr(e,typeof t!="symbol"?t+"":t,s),s),xs={};if(ar(xs,{AlphaTimeline:()=>Ft,Animation:()=>je,AnimationState:()=>Gt,AnimationStateAdapter:()=>gr,AnimationStateData:()=>Ps,AssetManagerBase:()=>br,AtlasAttachmentLoader:()=>Ls,Attachment:()=>pt,AttachmentTimeline:()=>Ie,BinaryInput:()=>zs,BlendMode:()=>ot,Bone:()=>ts,BoneData:()=>es,BoundingBoxAttachment:()=>tt,CURRENT:()=>Xs,ClippingAttachment:()=>ve,Color:()=>_,ConstraintData:()=>Ue,CurveTimeline:()=>fe,CurveTimeline1:()=>oe,CurveTimeline2:()=>Je,DebugUtils:()=>fr,DeformTimeline:()=>Bt,Downloader:()=>_s,DrawOrderTimeline:()=>Me,Event:()=>ss,EventData:()=>rs,EventQueue:()=>Ys,EventTimeline:()=>Oe,EventType:()=>ie,FIRST:()=>Ht,FakeTexture:()=>pr,HOLD_FIRST:()=>et,HOLD_MIX:()=>Fs,HOLD_SUBSEQUENT:()=>$t,IkConstraint:()=>Vs,IkConstraintData:()=>is,IkConstraintTimeline:()=>Et,Inherit:()=>Ne,InheritTimeline:()=>It,IntSet:()=>cr,Interpolation:()=>bs,MathUtils:()=>P,MeshAttachment:()=>le,MixBlend:()=>Ss,MixDirection:()=>ks,PathAttachment:()=>Ye,PathConstraint:()=>Re,PathConstraintData:()=>ns,PathConstraintMixTimeline:()=>_t,PathConstraintPositionTimeline:()=>Dt,PathConstraintSpacingTimeline:()=>Lt,Physics:()=>Us,PhysicsConstraintDampingTimeline:()=>Nt,PhysicsConstraintGravityTimeline:()=>Wt,PhysicsConstraintInertiaTimeline:()=>Vt,PhysicsConstraintMassTimeline:()=>Ut,PhysicsConstraintMixTimeline:()=>zt,PhysicsConstraintResetTimeline:()=>Ke,PhysicsConstraintStrengthTimeline:()=>Ot,PhysicsConstraintTimeline:()=>we,PhysicsConstraintWindTimeline:()=>qt,PointAttachment:()=>Zt,Pool:()=>Be,PositionMode:()=>rt,Pow:()=>ws,PowOut:()=>dr,RGB2Timeline:()=>Pt,RGBA2Timeline:()=>Xt,RGBATimeline:()=>Mt,RGBTimeline:()=>Yt,RegionAttachment:()=>O,RotateMode:()=>nt,RotateTimeline:()=>Ve,SETUP:()=>jt,SUBSEQUENT:()=>Ze,ScaleTimeline:()=>vt,ScaleXTimeline:()=>Ct,ScaleYTimeline:()=>St,SequenceTimeline:()=>Ee,ShearTimeline:()=>kt,ShearXTimeline:()=>At,ShearYTimeline:()=>Tt,Skeleton:()=>Fe,SkeletonBinary:()=>Ws,SkeletonBounds:()=>ds,SkeletonClipping:()=>lt,SkeletonData:()=>qe,SkeletonJson:()=>Gs,Skin:()=>at,SkinEntry:()=>os,Slot:()=>Os,SlotData:()=>ls,SpacingMode:()=>it,Spine:()=>ms,SpineDebugRenderer:()=>di,SpinePipe:()=>us,SpineTexture:()=>ht,StringSet:()=>gt,Texture:()=>Jt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Rs,TextureAtlasRegion:()=>Qt,TextureFilter:()=>st,TextureRegion:()=>Es,TextureWrap:()=>Bs,TimeKeeper:()=>ur,Timeline:()=>J,TrackEntry:()=>Ms,TransformConstraint:()=>Ns,TransformConstraintData:()=>hs,TransformConstraintTimeline:()=>Rt,TranslateTimeline:()=>bt,TranslateXTimeline:()=>wt,TranslateYTimeline:()=>yt,Triangulator:()=>ne,Utils:()=>B,Vector2:()=>_e,VertexAttachment:()=>de,WindowedMean:()=>mr}),typeof window<"u"&&window.PIXI){const e=window.require;window.require=t=>{if(e)return e(t);if(t.startsWith("@pixi/")||t.startsWith("pixi.js"))return window.PIXI}}var te=xe("pixi.js"),hr=xe("pixi.js"),cr=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},gt=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,r=e.length;s<r;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},Te=class{constructor(e=0,t=0,s=0,r=0){this.r=e,this.g=t,this.b=s,this.a=r}set(e,t,s,r){return this.r=e,this.g=t,this.b=s,this.a=r,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,t,s,r){return this.r+=e,this.g+=t,this.b+=s,this.a+=r,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return Number("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e){return new Te().setFromString(e)}},_=Te;R(_,"WHITE",new Te(1,1,1,1)),R(_,"RED",new Te(1,0,0,1)),R(_,"GREEN",new Te(0,1,0,1)),R(_,"BLUE",new Te(0,0,1,1)),R(_,"MAGENTA",new Te(1,0,1,1));var ce=class{static clamp(e,t,s){return e<t?t:e>s?s:e}static cosDeg(e){return Math.cos(e*ce.degRad)}static sinDeg(e){return Math.sin(e*ce.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ce.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ce.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let r=Math.random(),n=t-e;return r<=(s-e)/n?e+Math.sqrt(r*n*(s-e)):t-Math.sqrt((1-r)*n*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},P=ce;R(P,"PI",3.1415927),R(P,"PI2",ce.PI*2),R(P,"invPI2",1/ce.PI2),R(P,"radiansToDegrees",180/ce.PI),R(P,"radDeg",ce.radiansToDegrees),R(P,"degreesToRadians",ce.PI/180),R(P,"degRad",ce.degreesToRadians);var bs=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},ws=class extends bs{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},dr=class extends ws{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},Pe=class{static arrayCopy(e,t,s,r,n){for(let h=t,o=r;h<t+n;h++,o++)s[o]=e[h]}static arrayFill(e,t,s,r){for(let n=t;n<s;n++)e[n]=r}static setArraySize(e,t,s=0){let r=e.length;if(r==t)return e;if(e.length=t,r<t)for(let n=r;n<t;n++)e[n]=s;return e}static ensureArrayCapacity(e,t,s=0){return e.length>=t?e:Pe.setArraySize(e,t,s)}static newArray(e,t){let s=new Array(e);for(let r=0;r<e;r++)s[r]=t;return s}static newFloatArray(e){if(Pe.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let t=new Array(e);for(let s=0;s<t.length;s++)t[s]=0;return t}}static newShortArray(e){if(Pe.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let t=new Array(e);for(let s=0;s<t.length;s++)t[s]=0;return t}}static toFloatArray(e){return Pe.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return Pe.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,t){}static contains(e,t,s=!0){for(var r=0;r<e.length;r++)if(e[r]==t)return!0;return!1}static enumValue(e,t){return e[t[0].toUpperCase()+t.slice(1)]}},B=Pe;R(B,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u");var fr=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}},Be=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},_e=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},ur=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},mr=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},pt=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},ys=class extends pt{id=ys.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(e){super(e)}computeWorldVertices(e,t,s,r,n,h){s=n+(s>>1)*h;let o=e.bone.skeleton,i=e.deform,l=this.vertices,a=this.bones;if(!a){i.length>0&&(l=i);let u=e.bone,m=u.worldX,p=u.worldY,w=u.a,b=u.b,g=u.c,x=u.d;for(let v=t,y=n;y<s;v+=2,y+=h){let C=l[v],S=l[v+1];r[y]=C*w+S*b+m,r[y+1]=C*g+S*x+p}return}let c=0,d=0;for(let u=0;u<t;u+=2){let m=a[c];c+=m+1,d+=m}let f=o.bones;if(i.length==0)for(let u=n,m=d*3;u<s;u+=h){let p=0,w=0,b=a[c++];for(b+=c;c<b;c++,m+=3){let g=f[a[c]],x=l[m],v=l[m+1],y=l[m+2];p+=(x*g.a+v*g.b+g.worldX)*y,w+=(x*g.c+v*g.d+g.worldY)*y}r[u]=p,r[u+1]=w}else{let u=i;for(let m=n,p=d*3,w=d<<1;m<s;m+=h){let b=0,g=0,x=a[c++];for(x+=c;c<x;c++,p+=3,w+=2){let v=f[a[c]],y=l[p]+u[w],C=l[p+1]+u[w+1],S=l[p+2];b+=(y*v.a+C*v.b+v.worldX)*S,g+=(y*v.c+C*v.d+v.worldY)*S}r[m]=b,r[m+1]=g}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),B.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=B.newFloatArray(this.vertices.length),B.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment}},de=ys;R(de,"nextID",0);var $e=class{id=$e.nextID();regions;start=0;digits=0;setupIndex=0;constructor(e){this.regions=new Array(e)}copy(){let e=new $e(this.regions.length);return B.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,t){let s=e.sequenceIndex;s==-1&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let r=this.regions[s];t.region!=r&&(t.region=r,t.updateRegion())}getPath(e,t){let s=e,r=(this.start+t).toString();for(let n=this.digits-r.length;n>0;n--)s+="0";return s+=r,s}static nextID(){return $e._nextID++}},xt=$e;R(xt,"_nextID",0);var vs=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(vs||{}),Cs=[0,1,2,3,4,5,6],je=class{name;timelines=[];timelineIds=new gt;duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,s,r,n,h,o,i){if(!e)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let l=this.timelines;for(let a=0,c=l.length;a<c;a++)l[a].apply(e,t,s,n,h,o,i)}},Ss=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(Ss||{}),ks=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(ks||{}),N={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},J=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=B.newFloatArray(e*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(e,t){let s=e.length;for(let r=1;r<s;r++)if(e[r]>t)return r-1;return s-1}static search(e,t,s){let r=e.length;for(let n=s;n<r;n+=s)if(e[n]>t)return n-s;return r-s}},fe=class extends J{curves;constructor(e,t,s){super(e,s),this.curves=B.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let s=B.newFloatArray(t);B.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,r,n,h,o,i,l,a,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let u=(r-h*2+i)*.03,m=(n-o*2+l)*.03,p=((h-i)*3-r+a)*.006,w=((o-l)*3-n+c)*.006,b=u*2+p,g=m*2+w,x=(h-r)*.3+u+p*.16666667,v=(o-n)*.3+m+w*.16666667,y=r+x,C=n+v;for(let S=f+18;f<S;f+=2)d[f]=y,d[f+1]=C,x+=b,v+=g,b+=p,g+=w,y+=x,C+=v}getBezierValue(e,t,s,r){let n=this.curves;if(n[r]>e){let l=this.frames[t],a=this.frames[t+s];return a+(e-l)/(n[r]-l)*(n[r+1]-a)}let h=r+18;for(r+=2;r<h;r+=2)if(n[r]>=e){let l=n[r-2],a=n[r-1];return a+(e-l)/(n[r]-l)*(n[r+1]-a)}t+=this.getFrameEntries();let o=n[h-2],i=n[h-1];return i+(e-o)/(this.frames[t]-o)*(this.frames[t+s]-i)}},oe=class extends fe{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let n=2;n<=s;n+=2)if(t[n]>e){s=n-2;break}let r=this.curves[s>>1];switch(r){case 0:let n=t[s],h=t[s+1];return h+(e-n)/(t[s+2]-n)*(t[s+2+1]-h);case 1:return t[s+1]}return this.getBezierValue(e,s,1,r-2)}getRelativeValue(e,t,s,r,n){if(e<this.frames[0]){switch(s){case 0:return n;case 1:return r+(n-r)*t}return r}let h=this.getCurveValue(e);switch(s){case 0:return n+h*t;case 1:case 2:h+=n-r}return r+h*t}getAbsoluteValue(e,t,s,r,n){if(e<this.frames[0]){switch(s){case 0:return n;case 1:return r+(n-r)*t}return r}let h=this.getCurveValue(e);return s==0?n+(h-n)*t:r+(h-r)*t}getAbsoluteValue2(e,t,s,r,n,h){if(e<this.frames[0]){switch(s){case 0:return n;case 1:return r+(n-r)*t}return r}return s==0?n+(h-n)*t:r+(h-r)*t}getScaleValue(e,t,s,r,n,h){const o=this.frames;if(e<o[0]){switch(s){case 0:return h;case 1:return n+(h-n)*t}return n}let i=this.getCurveValue(e)*h;if(t==1)return s==3?n+i-h:i;if(r==1)switch(s){case 0:return h+(Math.abs(i)*P.signum(h)-h)*t;case 1:case 2:return n+(Math.abs(i)*P.signum(n)-n)*t}else{let l=0;switch(s){case 0:return l=Math.abs(h)*P.signum(i),l+(i-l)*t;case 1:case 2:return l=Math.abs(n)*P.signum(i),l+(i-l)*t}}return n+(i-h)*t}},Je=class extends fe{constructor(e,t,s,r){super(e,t,[s,r])}getFrameEntries(){return 3}setFrame(e,t,s,r){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r}},Ve=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.rotation=this.getRelativeValue(s,n,h,i.rotation,i.data.rotation))}},bt=class extends Je{boneIndex=0;constructor(e,t,s){super(e,t,N.x+"|"+s,N.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.x=i.data.x,i.y=i.data.y;return;case 1:i.x+=(i.data.x-i.x)*n,i.y+=(i.data.y-i.y)*n}return}let a=0,c=0,d=J.search(l,s,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];a=l[d+1],c=l[d+2];let m=(s-u)/(l[d+3]-u);a+=(l[d+3+1]-a)*m,c+=(l[d+3+2]-c)*m;break;case 1:a=l[d+1],c=l[d+2];break;default:a=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:i.x=i.data.x+a*n,i.y=i.data.y+c*n;break;case 1:case 2:i.x+=(i.data.x+a-i.x)*n,i.y+=(i.data.y+c-i.y)*n;break;case 3:i.x+=a*n,i.y+=c*n}}},wt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.x+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.x=this.getRelativeValue(s,n,h,i.x,i.data.x))}},yt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.y=this.getRelativeValue(s,n,h,i.y,i.data.y))}},vt=class extends Je{boneIndex=0;constructor(e,t,s){super(e,t,N.scaleX+"|"+s,N.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.scaleX=i.data.scaleX,i.scaleY=i.data.scaleY;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*n,i.scaleY+=(i.data.scaleY-i.scaleY)*n}return}let a,c,d=J.search(l,s,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];a=l[d+1],c=l[d+2];let m=(s-u)/(l[d+3]-u);a+=(l[d+3+1]-a)*m,c+=(l[d+3+2]-c)*m;break;case 1:a=l[d+1],c=l[d+2];break;default:a=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}if(a*=i.data.scaleX,c*=i.data.scaleY,n==1)h==3?(i.scaleX+=a-i.data.scaleX,i.scaleY+=c-i.data.scaleY):(i.scaleX=a,i.scaleY=c);else{let u=0,m=0;if(o==1)switch(h){case 0:u=i.data.scaleX,m=i.data.scaleY,i.scaleX=u+(Math.abs(a)*P.signum(u)-u)*n,i.scaleY=m+(Math.abs(c)*P.signum(m)-m)*n;break;case 1:case 2:u=i.scaleX,m=i.scaleY,i.scaleX=u+(Math.abs(a)*P.signum(u)-u)*n,i.scaleY=m+(Math.abs(c)*P.signum(m)-m)*n;break;case 3:i.scaleX+=(a-i.data.scaleX)*n,i.scaleY+=(c-i.data.scaleY)*n}else switch(h){case 0:u=Math.abs(i.data.scaleX)*P.signum(a),m=Math.abs(i.data.scaleY)*P.signum(c),i.scaleX=u+(a-u)*n,i.scaleY=m+(c-m)*n;break;case 1:case 2:u=Math.abs(i.scaleX)*P.signum(a),m=Math.abs(i.scaleY)*P.signum(c),i.scaleX=u+(a-u)*n,i.scaleY=m+(c-m)*n;break;case 3:i.scaleX+=(a-i.data.scaleX)*n,i.scaleY+=(c-i.data.scaleY)*n}}}},Ct=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.scaleX=this.getScaleValue(s,n,h,o,i.scaleX,i.data.scaleX))}},St=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.scaleY=this.getScaleValue(s,n,h,o,i.scaleY,i.data.scaleY))}},kt=class extends Je{boneIndex=0;constructor(e,t,s){super(e,t,N.shearX+"|"+s,N.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.shearX=i.data.shearX,i.shearY=i.data.shearY;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*n,i.shearY+=(i.data.shearY-i.shearY)*n}return}let a=0,c=0,d=J.search(l,s,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];a=l[d+1],c=l[d+2];let m=(s-u)/(l[d+3]-u);a+=(l[d+3+1]-a)*m,c+=(l[d+3+2]-c)*m;break;case 1:a=l[d+1],c=l[d+2];break;default:a=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:i.shearX=i.data.shearX+a*n,i.shearY=i.data.shearY+c*n;break;case 1:case 2:i.shearX+=(i.data.shearX+a-i.shearX)*n,i.shearY+=(i.data.shearY+c-i.shearY)*n;break;case 3:i.shearX+=a*n,i.shearY+=c*n}}},At=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.shearX=this.getRelativeValue(s,n,h,i.shearX,i.data.shearX))}},Tt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,N.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];i.active&&(i.shearY=this.getRelativeValue(s,n,h,i.shearY,i.data.shearY))}},It=class extends J{boneIndex=0;constructor(e,t){super(e,[N.inherit+"|"+t]),this.boneIndex=t}getFrameEntries(){return 2}setFrame(e,t,s){e*=2,this.frames[e]=t,this.frames[e+1]=s}apply(e,t,s,r,n,h,o){let i=e.bones[this.boneIndex];if(!i.active)return;if(o==1){h==0&&(i.inherit=i.data.inherit);return}let l=this.frames;if(s<l[0]){(h==0||h==1)&&(i.inherit=i.data.inherit);return}i.inherit=this.frames[J.search(l,s,2)+1]}},Mt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s,N.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(e,t,s,r,n,h){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,a=i.color;if(s<l[0]){let w=i.data.color;switch(h){case 0:a.setFromColor(w);return;case 1:a.add((w.r-a.r)*n,(w.g-a.g)*n,(w.b-a.b)*n,(w.a-a.a)*n)}return}let c=0,d=0,f=0,u=0,m=J.search(l,s,5),p=this.curves[m/5];switch(p){case 0:let w=l[m];c=l[m+1],d=l[m+2],f=l[m+3],u=l[m+4];let b=(s-w)/(l[m+5]-w);c+=(l[m+5+1]-c)*b,d+=(l[m+5+2]-d)*b,f+=(l[m+5+3]-f)*b,u+=(l[m+5+4]-u)*b;break;case 1:c=l[m+1],d=l[m+2],f=l[m+3],u=l[m+4];break;default:c=this.getBezierValue(s,m,1,p-2),d=this.getBezierValue(s,m,2,p+18-2),f=this.getBezierValue(s,m,3,p+18*2-2),u=this.getBezierValue(s,m,4,p+18*3-2)}n==1?a.set(c,d,f,u):(h==0&&a.setFromColor(i.data.color),a.add((c-a.r)*n,(d-a.g)*n,(f-a.b)*n,(u-a.a)*n))}},Yt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,n){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,a=i.color;if(s<l[0]){let p=i.data.color;switch(h){case 0:a.r=p.r,a.g=p.g,a.b=p.b;return;case 1:a.r+=(p.r-a.r)*n,a.g+=(p.g-a.g)*n,a.b+=(p.b-a.b)*n}return}let c=0,d=0,f=0,u=J.search(l,s,4),m=this.curves[u>>2];switch(m){case 0:let p=l[u];c=l[u+1],d=l[u+2],f=l[u+3];let w=(s-p)/(l[u+4]-p);c+=(l[u+4+1]-c)*w,d+=(l[u+4+2]-d)*w,f+=(l[u+4+3]-f)*w;break;case 1:c=l[u+1],d=l[u+2],f=l[u+3];break;default:c=this.getBezierValue(s,u,1,m-2),d=this.getBezierValue(s,u,2,m+18-2),f=this.getBezierValue(s,u,3,m+18*2-2)}if(n==1)a.r=c,a.g=d,a.b=f;else{if(h==0){let p=i.data.color;a.r=p.r,a.g=p.g,a.b=p.b}a.r+=(c-a.r)*n,a.g+=(d-a.g)*n,a.b+=(f-a.b)*n}}},Ft=class extends oe{slotIndex=0;constructor(e,t,s){super(e,t,N.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.color;if(s<this.frames[0]){let c=i.data.color;switch(h){case 0:l.a=c.a;return;case 1:l.a+=(c.a-l.a)*n}return}let a=this.getCurveValue(s);n==1?l.a=a:(h==0&&(l.a=i.data.color.a),l.a+=(a-l.a)*n)}},Xt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s,N.alpha+"|"+s,N.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,r,n,h,o,i,l){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=i,this.frames[e+7]=l}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,a=i.color,c=i.darkColor;if(s<l[0]){let v=i.data.color,y=i.data.darkColor;switch(h){case 0:a.setFromColor(v),c.r=y.r,c.g=y.g,c.b=y.b;return;case 1:a.add((v.r-a.r)*n,(v.g-a.g)*n,(v.b-a.b)*n,(v.a-a.a)*n),c.r+=(y.r-c.r)*n,c.g+=(y.g-c.g)*n,c.b+=(y.b-c.b)*n}return}let d=0,f=0,u=0,m=0,p=0,w=0,b=0,g=J.search(l,s,8),x=this.curves[g>>3];switch(x){case 0:let v=l[g];d=l[g+1],f=l[g+2],u=l[g+3],m=l[g+4],p=l[g+5],w=l[g+6],b=l[g+7];let y=(s-v)/(l[g+8]-v);d+=(l[g+8+1]-d)*y,f+=(l[g+8+2]-f)*y,u+=(l[g+8+3]-u)*y,m+=(l[g+8+4]-m)*y,p+=(l[g+8+5]-p)*y,w+=(l[g+8+6]-w)*y,b+=(l[g+8+7]-b)*y;break;case 1:d=l[g+1],f=l[g+2],u=l[g+3],m=l[g+4],p=l[g+5],w=l[g+6],b=l[g+7];break;default:d=this.getBezierValue(s,g,1,x-2),f=this.getBezierValue(s,g,2,x+18-2),u=this.getBezierValue(s,g,3,x+18*2-2),m=this.getBezierValue(s,g,4,x+18*3-2),p=this.getBezierValue(s,g,5,x+18*4-2),w=this.getBezierValue(s,g,6,x+18*5-2),b=this.getBezierValue(s,g,7,x+18*6-2)}if(n==1)a.set(d,f,u,m),c.r=p,c.g=w,c.b=b;else{if(h==0){a.setFromColor(i.data.color);let v=i.data.darkColor;c.r=v.r,c.g=v.g,c.b=v.b}a.add((d-a.r)*n,(f-a.g)*n,(u-a.b)*n,(m-a.a)*n),c.r+=(p-c.r)*n,c.g+=(w-c.g)*n,c.b+=(b-c.b)*n}}},Pt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s,N.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,n,h,o,i){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=i}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,a=i.color,c=i.darkColor;if(s<l[0]){let v=i.data.color,y=i.data.darkColor;switch(h){case 0:a.r=v.r,a.g=v.g,a.b=v.b,c.r=y.r,c.g=y.g,c.b=y.b;return;case 1:a.r+=(v.r-a.r)*n,a.g+=(v.g-a.g)*n,a.b+=(v.b-a.b)*n,c.r+=(y.r-c.r)*n,c.g+=(y.g-c.g)*n,c.b+=(y.b-c.b)*n}return}let d=0,f=0,u=0,m=0,p=0,w=0,b=0,g=J.search(l,s,7),x=this.curves[g/7];switch(x){case 0:let v=l[g];d=l[g+1],f=l[g+2],u=l[g+3],p=l[g+4],w=l[g+5],b=l[g+6];let y=(s-v)/(l[g+7]-v);d+=(l[g+7+1]-d)*y,f+=(l[g+7+2]-f)*y,u+=(l[g+7+3]-u)*y,p+=(l[g+7+4]-p)*y,w+=(l[g+7+5]-w)*y,b+=(l[g+7+6]-b)*y;break;case 1:d=l[g+1],f=l[g+2],u=l[g+3],p=l[g+4],w=l[g+5],b=l[g+6];break;default:d=this.getBezierValue(s,g,1,x-2),f=this.getBezierValue(s,g,2,x+18-2),u=this.getBezierValue(s,g,3,x+18*2-2),p=this.getBezierValue(s,g,4,x+18*3-2),w=this.getBezierValue(s,g,5,x+18*4-2),b=this.getBezierValue(s,g,6,x+18*5-2)}if(n==1)a.r=d,a.g=f,a.b=u,c.r=p,c.g=w,c.b=b;else{if(h==0){let v=i.data.color,y=i.data.darkColor;a.r=v.r,a.g=v.g,a.b=v.b,c.r=y.r,c.g=y.g,c.b=y.b}a.r+=(d-a.r)*n,a.g+=(f-a.g)*n,a.b+=(u-a.b)*n,c.r+=(p-c.r)*n,c.g+=(w-c.g)*n,c.b+=(b-c.b)*n}}},Ie=class extends J{slotIndex=0;attachmentNames;constructor(e,t){super(e,[N.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(i.bone.active){if(o==1){h==0&&this.setAttachment(e,i,i.data.attachmentName);return}if(s<this.frames[0]){(h==0||h==1)&&this.setAttachment(e,i,i.data.attachmentName);return}this.setAttachment(e,i,this.attachmentNames[J.search1(this.frames,s)])}}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},Bt=class extends fe{slotIndex=0;attachment;vertices;constructor(e,t,s,r){super(e,t,[N.deform+"|"+s+"|"+r.id]),this.slotIndex=s,this.attachment=r,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,r,n,h,o,i,l,a,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let u=(r-h*2+i)*.03,m=l*.03-o*.06,p=((h-i)*3-r+a)*.006,w=(o-l+.33333333)*.018,b=u*2+p,g=m*2+w,x=(h-r)*.3+u+p*.16666667,v=o*.3+m+w*.16666667,y=r+x,C=v;for(let S=f+18;f<S;f+=2)d[f]=y,d[f+1]=C,x+=b,v+=g,b+=p,g+=w,y+=x,C+=v}getCurvePercent(e,t){let s=this.curves,r=s[t];switch(r){case 0:let i=this.frames[t];return(e-i)/(this.frames[t+this.getFrameEntries()]-i);case 1:return 0}if(r-=2,s[r]>e){let i=this.frames[t];return s[r+1]*(e-i)/(s[r]-i)}let n=r+18;for(r+=2;r<n;r+=2)if(s[r]>=e){let i=s[r-2],l=s[r-1];return l+(e-i)/(s[r]-i)*(s[r+1]-l)}let h=s[n-2],o=s[n-1];return o+(1-o)*(e-h)/(this.frames[t+this.getFrameEntries()]-h)}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.getAttachment();if(!l||!(l instanceof de)||l.timelineAttachment!=this.attachment)return;let a=i.deform;a.length==0&&(h=0);let c=this.vertices,d=c[0].length,f=this.frames;if(s<f[0]){switch(h){case 0:a.length=0;return;case 1:if(n==1){a.length=0;return}a.length=d;let g=l;if(g.bones){n=1-n;for(var u=0;u<d;u++)a[u]*=n}else{let x=g.vertices;for(var u=0;u<d;u++)a[u]+=(x[u]-a[u])*n}}return}if(a.length=d,s>=f[f.length-1]){let g=c[f.length-1];if(n==1)if(h==3){let x=l;if(x.bones)for(let v=0;v<d;v++)a[v]+=g[v];else{let v=x.vertices;for(let y=0;y<d;y++)a[y]+=g[y]-v[y]}}else B.arrayCopy(g,0,a,0,d);else switch(h){case 0:{let v=l;if(v.bones)for(let y=0;y<d;y++)a[y]=g[y]*n;else{let y=v.vertices;for(let C=0;C<d;C++){let S=y[C];a[C]=S+(g[C]-S)*n}}break}case 1:case 2:for(let v=0;v<d;v++)a[v]+=(g[v]-a[v])*n;break;case 3:let x=l;if(x.bones)for(let v=0;v<d;v++)a[v]+=g[v]*n;else{let v=x.vertices;for(let y=0;y<d;y++)a[y]+=(g[y]-v[y])*n}}return}let m=J.search1(f,s),p=this.getCurvePercent(s,m),w=c[m],b=c[m+1];if(n==1)if(h==3){let g=l;if(g.bones)for(let x=0;x<d;x++){let v=w[x];a[x]+=v+(b[x]-v)*p}else{let x=g.vertices;for(let v=0;v<d;v++){let y=w[v];a[v]+=y+(b[v]-y)*p-x[v]}}}else for(let g=0;g<d;g++){let x=w[g];a[g]=x+(b[g]-x)*p}else switch(h){case 0:{let x=l;if(x.bones)for(let v=0;v<d;v++){let y=w[v];a[v]=(y+(b[v]-y)*p)*n}else{let v=x.vertices;for(let y=0;y<d;y++){let C=w[y],S=v[y];a[y]=S+(C+(b[y]-C)*p-S)*n}}break}case 1:case 2:for(let x=0;x<d;x++){let v=w[x];a[x]+=(v+(b[x]-v)*p-a[x])*n}break;case 3:let g=l;if(g.bones)for(let x=0;x<d;x++){let v=w[x];a[x]+=(v+(b[x]-v)*p)*n}else{let x=g.vertices;for(let v=0;v<d;v++){let y=w[v];a[v]+=(y+(b[v]-y)*p-x[v])*n}}}}},As=class extends J{events;constructor(e){super(e,As.propertyIds),this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t.time,this.events[e]=t}apply(e,t,s,r,n,h,o){if(!r)return;let i=this.frames,l=this.frames.length;if(t>s)this.apply(e,t,Number.MAX_VALUE,r,n,h,o),t=-1;else if(t>=i[l-1])return;if(s<i[0])return;let a=0;if(t<i[0])a=0;else{a=J.search1(i,t)+1;let c=i[a];for(;a>0&&i[a-1]==c;)a--}for(;a<l&&s>=i[a];a++)r.push(this.events[a])}},Oe=As;R(Oe,"propertyIds",[""+N.event]);var Ts=class extends J{drawOrders;constructor(e){super(e,Ts.propertyIds),this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.drawOrders[e]=s}apply(e,t,s,r,n,h,o){if(o==1){h==0&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(s<this.frames[0]){(h==0||h==1)&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let i=J.search1(this.frames,s),l=this.drawOrders[i];if(!l)B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let a=e.drawOrder,c=e.slots;for(let d=0,f=l.length;d<f;d++)a[d]=c[l[d]]}}},Me=Ts;R(Me,"propertyIds",[""+N.drawOrder]);var Et=class extends fe{constraintIndex=0;constructor(e,t,s){super(e,t,[N.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,r,n,h,o){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h?1:0,this.frames[e+5]=o?1:0}apply(e,t,s,r,n,h,o){let i=e.ikConstraints[this.constraintIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch;return;case 1:i.mix+=(i.data.mix-i.mix)*n,i.softness+=(i.data.softness-i.softness)*n,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}return}let a=0,c=0,d=J.search(l,s,6),f=this.curves[d/6];switch(f){case 0:let u=l[d];a=l[d+1],c=l[d+2];let m=(s-u)/(l[d+6]-u);a+=(l[d+6+1]-a)*m,c+=(l[d+6+2]-c)*m;break;case 1:a=l[d+1],c=l[d+2];break;default:a=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}h==0?(i.mix=i.data.mix+(a-i.data.mix)*n,i.softness=i.data.softness+(c-i.data.softness)*n,o==1?(i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch):(i.bendDirection=l[d+3],i.compress=l[d+4]!=0,i.stretch=l[d+5]!=0)):(i.mix+=(a-i.mix)*n,i.softness+=(c-i.softness)*n,o==0&&(i.bendDirection=l[d+3],i.compress=l[d+4]!=0,i.stretch=l[d+5]!=0))}},Rt=class extends fe{constraintIndex=0;constructor(e,t,s){super(e,t,[N.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,n,h,o,i){let l=this.frames;e*=7,l[e]=t,l[e+1]=s,l[e+2]=r,l[e+3]=n,l[e+4]=h,l[e+5]=o,l[e+6]=i}apply(e,t,s,r,n,h,o){let i=e.transformConstraints[this.constraintIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){let b=i.data;switch(h){case 0:i.mixRotate=b.mixRotate,i.mixX=b.mixX,i.mixY=b.mixY,i.mixScaleX=b.mixScaleX,i.mixScaleY=b.mixScaleY,i.mixShearY=b.mixShearY;return;case 1:i.mixRotate+=(b.mixRotate-i.mixRotate)*n,i.mixX+=(b.mixX-i.mixX)*n,i.mixY+=(b.mixY-i.mixY)*n,i.mixScaleX+=(b.mixScaleX-i.mixScaleX)*n,i.mixScaleY+=(b.mixScaleY-i.mixScaleY)*n,i.mixShearY+=(b.mixShearY-i.mixShearY)*n}return}let a,c,d,f,u,m,p=J.search(l,s,7),w=this.curves[p/7];switch(w){case 0:let b=l[p];a=l[p+1],c=l[p+2],d=l[p+3],f=l[p+4],u=l[p+5],m=l[p+6];let g=(s-b)/(l[p+7]-b);a+=(l[p+7+1]-a)*g,c+=(l[p+7+2]-c)*g,d+=(l[p+7+3]-d)*g,f+=(l[p+7+4]-f)*g,u+=(l[p+7+5]-u)*g,m+=(l[p+7+6]-m)*g;break;case 1:a=l[p+1],c=l[p+2],d=l[p+3],f=l[p+4],u=l[p+5],m=l[p+6];break;default:a=this.getBezierValue(s,p,1,w-2),c=this.getBezierValue(s,p,2,w+18-2),d=this.getBezierValue(s,p,3,w+18*2-2),f=this.getBezierValue(s,p,4,w+18*3-2),u=this.getBezierValue(s,p,5,w+18*4-2),m=this.getBezierValue(s,p,6,w+18*5-2)}if(h==0){let b=i.data;i.mixRotate=b.mixRotate+(a-b.mixRotate)*n,i.mixX=b.mixX+(c-b.mixX)*n,i.mixY=b.mixY+(d-b.mixY)*n,i.mixScaleX=b.mixScaleX+(f-b.mixScaleX)*n,i.mixScaleY=b.mixScaleY+(u-b.mixScaleY)*n,i.mixShearY=b.mixShearY+(m-b.mixShearY)*n}else i.mixRotate+=(a-i.mixRotate)*n,i.mixX+=(c-i.mixX)*n,i.mixY+=(d-i.mixY)*n,i.mixScaleX+=(f-i.mixScaleX)*n,i.mixScaleY+=(u-i.mixScaleY)*n,i.mixShearY+=(m-i.mixShearY)*n}},Dt=class extends oe{constraintIndex=0;constructor(e,t,s){super(e,t,N.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,r,n,h,o){let i=e.pathConstraints[this.constraintIndex];i.active&&(i.position=this.getAbsoluteValue(s,n,h,i.position,i.data.position))}},Lt=class extends oe{constraintIndex=0;constructor(e,t,s){super(e,t,N.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,r,n,h,o){let i=e.pathConstraints[this.constraintIndex];i.active&&(i.spacing=this.getAbsoluteValue(s,n,h,i.spacing,i.data.spacing))}},_t=class extends fe{constraintIndex=0;constructor(e,t,s){super(e,t,[N.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,n){let h=this.frames;e<<=2,h[e]=t,h[e+1]=s,h[e+2]=r,h[e+3]=n}apply(e,t,s,r,n,h,o){let i=e.pathConstraints[this.constraintIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.mixRotate=i.data.mixRotate,i.mixX=i.data.mixX,i.mixY=i.data.mixY;return;case 1:i.mixRotate+=(i.data.mixRotate-i.mixRotate)*n,i.mixX+=(i.data.mixX-i.mixX)*n,i.mixY+=(i.data.mixY-i.mixY)*n}return}let a,c,d,f=J.search(l,s,4),u=this.curves[f>>2];switch(u){case 0:let m=l[f];a=l[f+1],c=l[f+2],d=l[f+3];let p=(s-m)/(l[f+4]-m);a+=(l[f+4+1]-a)*p,c+=(l[f+4+2]-c)*p,d+=(l[f+4+3]-d)*p;break;case 1:a=l[f+1],c=l[f+2],d=l[f+3];break;default:a=this.getBezierValue(s,f,1,u-2),c=this.getBezierValue(s,f,2,u+18-2),d=this.getBezierValue(s,f,3,u+18*2-2)}if(h==0){let m=i.data;i.mixRotate=m.mixRotate+(a-m.mixRotate)*n,i.mixX=m.mixX+(c-m.mixX)*n,i.mixY=m.mixY+(d-m.mixY)*n}else i.mixRotate+=(a-i.mixRotate)*n,i.mixX+=(c-i.mixX)*n,i.mixY+=(d-i.mixY)*n}},we=class extends oe{constraintIndex=0;constructor(e,t,s,r){super(e,t,r+"|"+s),this.constraintIndex=s}apply(e,t,s,r,n,h,o){let i;if(this.constraintIndex==-1){const l=s>=this.frames[0]?this.getCurveValue(s):0;for(const a of e.physicsConstraints)a.active&&this.global(a.data)&&this.set(a,this.getAbsoluteValue2(s,n,h,this.get(a),this.setup(a),l))}else i=e.physicsConstraints[this.constraintIndex],i.active&&this.set(i,this.getAbsoluteValue(s,n,h,this.get(i),this.setup(i)))}},Vt=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Ot=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},Nt=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},Ut=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},qt=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},Wt=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},zt=class extends we{constructor(e,t,s){super(e,t,s,N.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},Is=class extends J{constraintIndex;constructor(e,t){super(e,Is.propertyIds),this.constraintIndex=t}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t}apply(e,t,s,r,n,h,o){let i;if(this.constraintIndex!=-1&&(i=e.physicsConstraints[this.constraintIndex],!i.active))return;const l=this.frames;if(t>s)this.apply(e,t,Number.MAX_VALUE,[],n,h,o),t=-1;else if(t>=l[l.length-1])return;if(!(s<l[0])&&(t<l[0]||s>=l[J.search1(l,t)+1]))if(i!=null)i.reset();else for(const a of e.physicsConstraints)a.active&&a.reset()}},Ke=Is;R(Ke,"propertyIds",[N.physicsConstraintReset.toString()]);var ye=class extends J{slotIndex;attachment;constructor(e,t,s){super(e,[N.sequence+"|"+t+"|"+s.sequence.id]),this.slotIndex=t,this.attachment=s}getFrameEntries(){return ye.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,t,s,r,n){let h=this.frames;e*=ye.ENTRIES,h[e]=t,h[e+ye.MODE]=s|r<<4,h[e+ye.DELAY]=n}apply(e,t,s,r,n,h,o){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.attachment,a=this.attachment;if(l!=a&&(!(l instanceof de)||l.timelineAttachment!=a))return;let c=this.frames;if(s<c[0]){(h==0||h==1)&&(i.sequenceIndex=-1);return}let d=J.search(c,s,ye.ENTRIES),f=c[d],u=c[d+ye.MODE],m=c[d+ye.DELAY];if(!this.attachment.sequence)return;let p=u>>4,w=this.attachment.sequence.regions.length,b=Cs[u&15];if(b!=0)switch(p+=(s-f)/m+1e-5|0,b){case 1:p=Math.min(w-1,p);break;case 2:p%=w;break;case 3:{let g=(w<<1)-2;p=g==0?0:p%g,p>=w&&(p=g-p);break}case 4:p=Math.max(w-1-p,0);break;case 5:p=w-1-p%w;break;case 6:{let g=(w<<1)-2;p=g==0?0:(p+w-1)%g,p>=w&&(p=g-p)}}i.sequenceIndex=p}},Ee=ye;R(Ee,"ENTRIES",3),R(Ee,"MODE",1),R(Ee,"DELAY",2);var Qe=class{static emptyAnimation(){return Qe._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new Ys(this);propertyIDs=new gt;animationsChanged=!1;trackEntryPool=new Be(()=>new Ms);constructor(e){this.data=e}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(!n)continue;n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;let h=e*n.timeScale;if(n.delay>0){if(n.delay-=h,n.delay>0)continue;h=-n.delay,n.delay=0}let o=n.next;if(o){let i=n.trackLast-o.delay;if(i>=0){for(o.delay=0,o.trackTime+=n.timeScale==0?0:(i/n.timeScale+e)*o.timeScale,n.trackTime+=h,this.setCurrent(s,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){t[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,e)){let i=n.mixingFrom;for(n.mixingFrom=null,i&&(i.mixingTo=null);i;)this.queue.end(i),i=i.mixingFrom}n.trackTime+=h}this.queue.drain()}updateMixingFrom(e,t){let s=e.mixingFrom;if(!s)return!0;let r=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),r):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,r=!1;for(let d=0,f=s.length;d<f;d++){let u=s[d];if(!u||u.delay>0)continue;r=!0;let m=d==0?1:u.mixBlend,p=u.alpha;u.mixingFrom?p*=this.applyMixingFrom(u,e,m):u.trackTime>=u.trackEnd&&!u.next&&(p=0);let w=p>=u.alphaAttachmentThreshold,b=u.animationLast,g=u.getAnimationTime(),x=g,v=t;u.reverse&&(x=u.animation.duration-x,v=null);let y=u.animation.timelines,C=y.length;if(d==0&&p==1||m==3){d==0&&(w=!0);for(let S=0;S<C;S++){B.webkit602BugfixHelper(p,m);var n=y[S];n instanceof Ie?this.applyAttachmentTimeline(n,e,x,m,w):n.apply(e,b,x,v,p,m,0)}}else{let S=u.timelineMode,A=u.shortestRotation,M=!A&&u.timelinesRotation.length!=C<<1;M&&(u.timelinesRotation.length=C<<1);for(let T=0;T<C;T++){let X=y[T],F=S[T]==Ze?m:0;!A&&X instanceof Ve?this.applyRotateTimeline(X,e,x,p,F,u.timelinesRotation,T<<1,M):X instanceof Ie?this.applyAttachmentTimeline(X,e,x,m,w):(B.webkit602BugfixHelper(p,m),X.apply(e,b,x,v,p,F,0))}}this.queueEvents(u,g),t.length=0,u.nextAnimationLast=g,u.nextTrackLast=u.trackTime}for(var h=this.unkeyedState+jt,o=e.slots,i=0,l=e.slots.length;i<l;i++){var a=o[i];if(a.attachmentState==h){var c=a.data.attachmentName;a.setAttachment(c?e.getAttachment(a.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),r}applyMixingFrom(e,t,s){let r=e.mixingFrom;r.mixingFrom&&this.applyMixingFrom(r,t,s);let n=0;e.mixDuration==0?(n=1,s==1&&(s=0)):(n=e.mixTime/e.mixDuration,n>1&&(n=1),s!=1&&(s=r.mixBlend));let h=n<r.mixAttachmentThreshold,o=n<r.mixDrawOrderThreshold,i=r.animation.timelines,l=i.length,a=r.alpha*e.interruptAlpha,c=a*(1-n),d=r.animationLast,f=r.getAnimationTime(),u=f,m=null;if(r.reverse?u=r.animation.duration-u:n<r.eventThreshold&&(m=this.events),s==3)for(let p=0;p<l;p++)i[p].apply(t,d,u,m,c,s,1);else{let p=r.timelineMode,w=r.timelineHoldMix,b=r.shortestRotation,g=!b&&r.timelinesRotation.length!=l<<1;g&&(r.timelinesRotation.length=l<<1),r.totalAlpha=0;for(let x=0;x<l;x++){let v=i[x],y=1,C,S=0;switch(p[x]){case Ze:if(!o&&v instanceof Me)continue;C=s,S=c;break;case Ht:C=0,S=c;break;case $t:C=s,S=a;break;case et:C=0,S=a;break;default:C=0;let A=w[x];S=a*Math.max(0,1-A.mixTime/A.mixDuration);break}r.totalAlpha+=S,!b&&v instanceof Ve?this.applyRotateTimeline(v,t,u,S,C,r.timelinesRotation,x<<1,g):v instanceof Ie?this.applyAttachmentTimeline(v,t,u,C,h&&S>=r.alphaAttachmentThreshold):(B.webkit602BugfixHelper(S,s),o&&v instanceof Me&&C==0&&(y=0),v.apply(t,d,u,m,S,C,y))}}return e.mixDuration>0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,n}applyAttachmentTimeline(e,t,s,r,n){var h=t.slots[e.slotIndex];h.bone.active&&(s<e.frames[0]?(r==0||r==1)&&this.setAttachment(t,h,h.data.attachmentName,n):this.setAttachment(t,h,e.attachmentNames[J.search1(e.frames,s)],n),h.attachmentState<=this.unkeyedState&&(h.attachmentState=this.unkeyedState+jt))}setAttachment(e,t,s,r){t.setAttachment(s?e.getAttachment(t.data.index,s):null),r&&(t.attachmentState=this.unkeyedState+Xs)}applyRotateTimeline(e,t,s,r,n,h,o,i){if(i&&(h[o]=0),r==1){e.apply(t,0,s,null,1,n,0);return}let l=t.bones[e.boneIndex];if(!l.active)return;let a=e.frames,c=0,d=0;if(s<a[0])switch(n){case 0:l.rotation=l.data.rotation;default:return;case 1:c=l.rotation,d=l.data.rotation}else c=n==0?l.data.rotation:l.rotation,d=l.data.rotation+e.getCurveValue(s);let f=0,u=d-c;if(u-=Math.ceil(u/360-.5)*360,u==0)f=h[o];else{let m=0,p=0;i?(m=0,p=u):(m=h[o],p=h[o+1]);let w=m-m%360;f=u+w;let b=u>=0,g=m>=0;Math.abs(p)<=90&&P.signum(p)!=P.signum(u)&&(Math.abs(m-w)>180?(f+=360*P.signum(m),g=b):w!=0?f-=360*P.signum(m):g=b),g!=b&&(f+=360*P.signum(m)),h[o]=f}h[o+1]=u,l.rotation=c+f*r}queueEvents(e,t){let s=e.animationStart,r=e.animationEnd,n=r-s,h=e.trackLast%n,o=this.events,i=0,l=o.length;for(;i<l;i++){let c=o[i];if(c.time<h)break;c.time>r||this.queue.event(e,c)}let a=!1;if(e.loop)if(n==0)a=!0;else{const c=Math.floor(e.trackTime/n);a=c>0&&c>Math.floor(e.trackLast/n)}else a=t>=r&&e.animationLast<r;for(a&&this.queue.complete(e);i<l;i++){let c=o[i];c.time<s||this.queue.event(e,c)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,s=this.tracks.length;t<s;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){let r=s.mixingFrom;if(!r)break;this.queue.end(r),s.mixingFrom=null,s.mixingTo=null,s=r}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let r=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,r&&(s&&this.queue.interrupt(r),t.mixingFrom=r,r.mixingTo=t,t.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(t.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,r,s)}setAnimationWith(e,t,s=!1){if(!t)throw new Error("animation cannot be null.");let r=!0,n=this.expandToIndex(e);n&&(n.nextTrackLast==-1?(this.tracks[e]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,r=!1):this.clearNext(n));let h=this.trackEntry(e,t,s,n);return this.setCurrent(e,h,r),this.queue.drain(),h}addAnimation(e,t,s=!1,r=0){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,n,s,r)}addAnimationWith(e,t,s=!1,r=0){if(!t)throw new Error("animation cannot be null.");let n=this.expandToIndex(e);if(n)for(;n.next;)n=n.next;let h=this.trackEntry(e,t,s,n);return n?(n.next=h,h.previous=n,r<=0&&(r+=n.getTrackComplete()-h.mixDuration)):(this.setCurrent(e,h,!0),this.queue.drain()),h.delay=r,h}setEmptyAnimation(e,t=0){let s=this.setAnimationWith(e,Qe.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let r=this.addAnimationWith(e,Qe.emptyAnimation(),!1,s);return s<=0&&(r.delay+=r.mixDuration-t),r.mixDuration=t,r.trackEnd=t,r}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++){let n=this.tracks[s];n&&this.setEmptyAnimation(n.trackIndex,e)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(B.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,t,s,r){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=e,n.animation=t,n.loop=s,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=t.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=r?this.data.getMix(r.animation,t):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=2,n}clearNext(e){let t=e.next;for(;t;)this.queue.dispose(t),t=t.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let t=0,s=e.length;t<s;t++){let r=e[t];if(r){for(;r.mixingFrom;)r=r.mixingFrom;do(!r.mixingTo||r.mixBlend!=3)&&this.computeHold(r),r=r.mixingTo;while(r)}}}computeHold(e){let t=e.mixingTo,s=e.animation.timelines,r=e.animation.timelines.length,n=e.timelineMode;n.length=r;let h=e.timelineHoldMix;h.length=0;let o=this.propertyIDs;if(t&&t.holdPrevious){for(let i=0;i<r;i++)n[i]=o.addAll(s[i].getPropertyIds())?et:$t;return}e:for(let i=0;i<r;i++){let l=s[i],a=l.getPropertyIds();if(!o.addAll(a))n[i]=Ze;else if(!t||l instanceof Ie||l instanceof Me||l instanceof Oe||!t.animation.hasTimeline(a))n[i]=Ht;else{for(let c=t.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(a)){if(e.mixDuration>0){n[i]=Fs,h[i]=c;continue e}break}n[i]=et}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Gt=Qe;R(Gt,"_emptyAnimation",new je("<empty>",[],0));var Ms=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,this.previous!=null&&t<=0&&(t+=this.previous.getTrackComplete()-e),this.delay=t}mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}},Ys=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(ie.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ie.interrupt),this.objects.push(e)}end(e){this.objects.push(ie.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ie.dispose),this.objects.push(e)}complete(e){this.objects.push(ie.complete),this.objects.push(e)}event(e,t){this.objects.push(ie.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let s=0;s<e.length;s+=2){let r=e[s],n=e[s+1];switch(r){case ie.start:n.listener&&n.listener.start&&n.listener.start(n);for(let o=0;o<t.length;o++){let i=t[o];i.start&&i.start(n)}break;case ie.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let o=0;o<t.length;o++){let i=t[o];i.interrupt&&i.interrupt(n)}break;case ie.end:n.listener&&n.listener.end&&n.listener.end(n);for(let o=0;o<t.length;o++){let i=t[o];i.end&&i.end(n)}case ie.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let o=0;o<t.length;o++){let i=t[o];i.dispose&&i.dispose(n)}this.animState.trackEntryPool.free(n);break;case ie.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let o=0;o<t.length;o++){let i=t[o];i.complete&&i.complete(n)}break;case ie.event:let h=e[s+++2];n.listener&&n.listener.event&&n.listener.event(n,h);for(let o=0;o<t.length;o++){let i=t[o];i.event&&i.event(n,h)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},ie=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(ie||{}),gr=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},Ze=0,Ht=1,$t=2,et=3,Fs=4,jt=1,Xs=2,Ps=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,s){let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);let n=this.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);this.setMixWith(r,n,s)}setMixWith(e,t,s){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let r=e.name+"."+t.name;this.animationToMixTime[r]=s}getMix(e,t){let s=e.name+"."+t.name,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}},tt=class extends de{color=new _(1,1,1,1);constructor(e){super(e)}copy(){let e=new tt(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},ve=class extends de{endSlot=null;color=new _(.2275,.2275,.8078,1);constructor(e){super(e)}copy(){let e=new ve(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},Jt=class{_image;constructor(e){this._image=e}getImage(){return this._image}},st=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(st||{}),Bs=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(Bs||{}),Es=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},pr=class extends Jt{setFilters(e,t){}setWraps(e,t){}dispose(){}},Kt=class{pages=new Array;regions=new Array;constructor(e){let t=new xr(e),s=new Array(4),r={};r.size=a=>{a.width=parseInt(s[1]),a.height=parseInt(s[2])},r.format=()=>{},r.filter=a=>{a.minFilter=B.enumValue(st,s[1]),a.magFilter=B.enumValue(st,s[2])},r.repeat=a=>{s[1].indexOf("x")!=-1&&(a.uWrap=10497),s[1].indexOf("y")!=-1&&(a.vWrap=10497)},r.pma=a=>{a.pma=s[1]=="true"};var n={};n.xy=a=>{a.x=parseInt(s[1]),a.y=parseInt(s[2])},n.size=a=>{a.width=parseInt(s[1]),a.height=parseInt(s[2])},n.bounds=a=>{a.x=parseInt(s[1]),a.y=parseInt(s[2]),a.width=parseInt(s[3]),a.height=parseInt(s[4])},n.offset=a=>{a.offsetX=parseInt(s[1]),a.offsetY=parseInt(s[2])},n.orig=a=>{a.originalWidth=parseInt(s[1]),a.originalHeight=parseInt(s[2])},n.offsets=a=>{a.offsetX=parseInt(s[1]),a.offsetY=parseInt(s[2]),a.originalWidth=parseInt(s[3]),a.originalHeight=parseInt(s[4])},n.rotate=a=>{let c=s[1];c=="true"?a.degrees=90:c!="false"&&(a.degrees=parseInt(c))},n.index=a=>{a.index=parseInt(s[1])};let h=t.readLine();for(;h&&h.trim().length==0;)h=t.readLine();for(;!(!h||h.trim().length==0||t.readEntry(s,h)==0);)h=t.readLine();let o=null,i=null,l=null;for(;h!==null;)if(h.trim().length==0)o=null,h=t.readLine();else if(o){let a=new Qt(o,h);for(;;){let c=t.readEntry(s,h=t.readLine());if(c==0)break;let d=n[s[0]];if(d)d(a);else{i||(i=[]),l||(l=[]),i.push(s[0]);let f=[];for(let u=0;u<c;u++)f.push(parseInt(s[u+1]));l.push(f)}}a.originalWidth==0&&a.originalHeight==0&&(a.originalWidth=a.width,a.originalHeight=a.height),i&&i.length>0&&l&&l.length>0&&(a.names=i,a.values=l,i=null,l=null),a.u=a.x/o.width,a.v=a.y/o.height,a.degrees==90?(a.u2=(a.x+a.height)/o.width,a.v2=(a.y+a.width)/o.height):(a.u2=(a.x+a.width)/o.width,a.v2=(a.y+a.height)/o.height),this.regions.push(a)}else{for(o=new Rs(h.trim());t.readEntry(s,h=t.readLine())!=0;){let a=r[s[0]];a&&a(o)}this.pages.push(o)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let s of this.pages)s.setTexture(e.get(t+s.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},xr=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let r=1,n=s+1;;r++){let h=t.indexOf(",",n);if(h==-1)return e[r]=t.substr(n).trim(),r;if(e[r]=t.substr(n,h-n).trim(),n=h+1,r==4)return 4}}},Rs=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Qt=class extends Es{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},le=class extends de{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new _(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new _(0,0,0,0);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=B.newFloatArray(e.length));let t=this.uvs,s=this.uvs.length,r=this.region.u,n=this.region.v,h=0,o=0;if(this.region instanceof Qt){let i=this.region,l=i.page,a=l.width,c=l.height;switch(i.degrees){case 90:r-=(i.originalHeight-i.offsetY-i.height)/a,n-=(i.originalWidth-i.offsetX-i.width)/c,h=i.originalHeight/a,o=i.originalWidth/c;for(let d=0;d<s;d+=2)t[d]=r+e[d+1]*h,t[d+1]=n+(1-e[d])*o;return;case 180:r-=(i.originalWidth-i.offsetX-i.width)/a,n-=i.offsetY/c,h=i.originalWidth/a,o=i.originalHeight/c;for(let d=0;d<s;d+=2)t[d]=r+(1-e[d])*h,t[d+1]=n+(1-e[d+1])*o;return;case 270:r-=i.offsetY/a,n-=i.offsetX/c,h=i.originalHeight/a,o=i.originalWidth/c;for(let d=0;d<s;d+=2)t[d]=r+(1-e[d+1])*h,t[d+1]=n+e[d]*o;return}r-=i.offsetX/a,n-=(i.originalHeight-i.offsetY-i.height)/c,h=i.originalWidth/a,o=i.originalHeight/c}else this.region?(h=this.region.u2-r,o=this.region.v2-n):(r=n=0,h=o=1);for(let i=0;i<s;i+=2)t[i]=r+e[i]*h,t[i+1]=n+e[i+1]*o}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new le(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),B.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),B.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),B.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),B.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,t,s,r,n,h){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,t,s,r,n,h)}newLinkedMesh(){let e=new le(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),e.timelineAttachment=this.timelineAttachment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},Ye=class extends de{lengths=[];closed=!1;constantSpeed=!1;color=new _(1,1,1,1);constructor(e){super(e)}copy(){let e=new Ye(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),B.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},Zt=class extends de{x=0;y=0;rotation=0;color=new _(.38,.94,0,1);constructor(e){super(e)}computeWorldPosition(e,t){return t.x=this.x*e.a+this.y*e.b+e.worldX,t.y=this.x*e.c+this.y*e.d+e.worldY,t}computeWorldRotation(e){const t=this.rotation*P.degRad,s=Math.cos(t),r=Math.sin(t),n=s*e.a+r*e.b,h=s*e.c+r*e.d;return P.atan2Deg(h,n)}copy(){let e=new Zt(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},Ds=class extends pt{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new _(1,1,1,1);path;region=null;sequence=null;offset=B.newFloatArray(8);uvs=B.newFloatArray(8);tempColor=new _(1,1,1,1);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.region,t=this.uvs;if(e==null){t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=1,t[5]=1,t[6]=1,t[7]=0;return}let s=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*s,h=-this.height/2*this.scaleY+this.region.offsetY*r,o=n+this.region.width*s,i=h+this.region.height*r,l=this.rotation*P.degRad,a=Math.cos(l),c=Math.sin(l),d=this.x,f=this.y,u=n*a+d,m=n*c,p=h*a+f,w=h*c,b=o*a+d,g=o*c,x=i*a+f,v=i*c,y=this.offset;y[0]=u-w,y[1]=p+m,y[2]=u-v,y[3]=x+m,y[4]=b-v,y[5]=x+g,y[6]=b-w,y[7]=p+g,e.degrees==90?(t[0]=e.u2,t[1]=e.v2,t[2]=e.u,t[3]=e.v2,t[4]=e.u,t[5]=e.v,t[6]=e.u2,t[7]=e.v):(t[0]=e.u,t[1]=e.v2,t[2]=e.u,t[3]=e.v,t[4]=e.u2,t[5]=e.v,t[6]=e.u2,t[7]=e.v2)}computeWorldVertices(e,t,s,r){this.sequence!=null&&this.sequence.apply(e,this);let n=e.bone,h=this.offset,o=n.worldX,i=n.worldY,l=n.a,a=n.b,c=n.c,d=n.d,f=0,u=0;f=h[0],u=h[1],t[s]=f*l+u*a+o,t[s+1]=f*c+u*d+i,s+=r,f=h[2],u=h[3],t[s]=f*l+u*a+o,t[s+1]=f*c+u*d+i,s+=r,f=h[4],u=h[5],t[s]=f*l+u*a+o,t[s+1]=f*c+u*d+i,s+=r,f=h[6],u=h[7],t[s]=f*l+u*a+o,t[s+1]=f*c+u*d+i}copy(){let e=new Ds(this.name,this.path);return e.region=this.region,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,B.arrayCopy(this.uvs,0,e.uvs,0,8),B.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},O=Ds;R(O,"X1",0),R(O,"Y1",1),R(O,"C1R",2),R(O,"C1G",3),R(O,"C1B",4),R(O,"C1A",5),R(O,"U1",6),R(O,"V1",7),R(O,"X2",8),R(O,"Y2",9),R(O,"C2R",10),R(O,"C2G",11),R(O,"C2B",12),R(O,"C2A",13),R(O,"U2",14),R(O,"V2",15),R(O,"X3",16),R(O,"Y3",17),R(O,"C3R",18),R(O,"C3G",19),R(O,"C3B",20),R(O,"C3A",21),R(O,"U3",22),R(O,"V3",23),R(O,"X4",24),R(O,"Y4",25),R(O,"C4R",26),R(O,"C4G",27),R(O,"C4B",28),R(O,"C4A",29),R(O,"U4",30),R(O,"V4",31);var Ls=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,s){let r=s.regions;for(let n=0,h=r.length;n<h;n++){let o=s.getPath(t,n),i=this.atlas.findRegion(o);if(i==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+e+")");r[n]=i}}newRegionAttachment(e,t,s,r){let n=new O(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (region attachment: "+t+")");n.region=h}return n}newMeshAttachment(e,t,s,r){let n=new le(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+t+")");n.region=h}return n}newBoundingBoxAttachment(e,t){return new tt(t)}newPathAttachment(e,t){return new Ye(t)}newPointAttachment(e,t){return new Zt(t)}newClippingAttachment(e,t){return new ve(t)}},es=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=Ne.Normal;skinRequired=!1;color=new _;icon;visible=!1;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}},Ne=(e=>(e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection",e))(Ne||{}),ts=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=0;sorted=!1;active=!1;constructor(e,t,s){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,r,n,h,o){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=r,this.ascaleY=n,this.ashearX=h,this.ashearY=o;let i=this.parent;if(!i){let f=this.skeleton;const u=f.scaleX,m=f.scaleY,p=(s+h)*P.degRad,w=(s+90+o)*P.degRad;this.a=Math.cos(p)*r*u,this.b=Math.cos(w)*n*u,this.c=Math.sin(p)*r*m,this.d=Math.sin(w)*n*m,this.worldX=e*u+f.x,this.worldY=t*m+f.y;return}let l=i.a,a=i.b,c=i.c,d=i.d;switch(this.worldX=l*e+a*t+i.worldX,this.worldY=c*e+d*t+i.worldY,this.inherit){case 0:{const f=(s+h)*P.degRad,u=(s+90+o)*P.degRad,m=Math.cos(f)*r,p=Math.cos(u)*n,w=Math.sin(f)*r,b=Math.sin(u)*n;this.a=l*m+a*w,this.b=l*p+a*b,this.c=c*m+d*w,this.d=c*p+d*b;return}case 1:{const f=(s+h)*P.degRad,u=(s+90+o)*P.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(u)*n,this.c=Math.sin(f)*r,this.d=Math.sin(u)*n;break}case 2:{let f=1/this.skeleton.scaleX,u=1/this.skeleton.scaleY;l*=f,c*=u;let m=l*l+c*c,p=0;m>1e-4?(m=Math.abs(l*d*u-a*f*c)/m,a=c*m,d=l*m,p=Math.atan2(c,l)*P.radDeg):(l=0,c=0,p=90-Math.atan2(d,a)*P.radDeg);const w=(s+h-p)*P.degRad,b=(s+o-p+90)*P.degRad,g=Math.cos(w)*r,x=Math.cos(b)*n,v=Math.sin(w)*r,y=Math.sin(b)*n;this.a=l*g-a*v,this.b=l*x-a*y,this.c=c*g+d*v,this.d=c*x+d*y;break}case 3:case 4:{s*=P.degRad;const f=Math.cos(s),u=Math.sin(s);let m=(l*f+a*u)/this.skeleton.scaleX,p=(c*f+d*u)/this.skeleton.scaleY,w=Math.sqrt(m*m+p*p);w>1e-5&&(w=1/w),m*=w,p*=w,w=Math.sqrt(m*m+p*p),this.inherit==3&&l*d-a*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w),s=Math.PI/2+Math.atan2(p,m);const b=Math.cos(s)*w,g=Math.sin(s)*w;h*=P.degRad,o=(90+o)*P.degRad;const x=Math.cos(h)*r,v=Math.cos(o)*n,y=Math.sin(h)*r,C=Math.sin(o)*n;this.a=m*x+b*y,this.b=m*v+b*C,this.c=p*x+g*y,this.d=p*v+g*C;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*P.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)*P.radDeg;return}let t=e.a,s=e.b,r=e.c,n=e.d,h=1/(t*n-s*r),o=n*h,i=s*h,l=r*h,a=t*h,c=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=c*o-d*i,this.ay=d*a-c*l;let f,u,m,p;if(this.inherit==1)f=this.a,u=this.b,m=this.c,p=this.d;else{switch(this.inherit){case 2:{let v=Math.abs(t*n-s*r)/(t*t+r*r);s=-r*this.skeleton.scaleX*v/this.skeleton.scaleY,n=t*this.skeleton.scaleY*v/this.skeleton.scaleX,h=1/(t*n-s*r),o=n*h,i=s*h;break}case 3:case 4:let w=P.cosDeg(this.rotation),b=P.sinDeg(this.rotation);t=(t*w+s*b)/this.skeleton.scaleX,r=(r*w+n*b)/this.skeleton.scaleY;let g=Math.sqrt(t*t+r*r);g>1e-5&&(g=1/g),t*=g,r*=g,g=Math.sqrt(t*t+r*r),this.inherit==3&&h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(g=-g);let x=P.PI/2+Math.atan2(r,t);s=Math.cos(x)*g,n=Math.sin(x)*g,h=1/(t*n-s*r),o=n*h,i=s*h,l=r*h,a=t*h}f=o*this.a-i*this.c,u=o*this.b-i*this.d,m=a*this.c-l*this.a,p=a*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let w=f*p-u*m;this.ascaleY=w/this.ascaleX,this.ashearY=-Math.atan2(f*u+m*p,w)*P.radDeg,this.arotation=Math.atan2(m,f)*P.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,u)*P.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*P.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*P.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,r=e.y-this.worldY;return e.x=s*this.d*t-r*this.b*t,e.y=r*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=P.sinDeg(e),s=P.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*P.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=P.sinDeg(e),s=P.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*P.radDeg}rotateWorld(e){e*=P.degRad;const t=Math.sin(e),s=Math.cos(e),r=this.a,n=this.b;this.a=s*r-t*this.c,this.b=s*n-t*this.d,this.c=t*r+s*this.c,this.d=t*n+s*this.d}},Ue=class{constructor(e,t,s){this.name=e,this.order=t,this.skinRequired=s}},br=class{pathPrefix="";textureLoader;downloader;assets={};errors={};toLoad=0;loaded=0;constructor(e,t="",s=new _s){this.textureLoader=e,this.pathPrefix=t,this.downloader=s}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,s){this.toLoad--,this.loaded++,this.assets[t]=s,e&&e(t,s)}error(e,t,s){this.toLoad--,this.loaded++,this.errors[t]=s,e&&e(t,s)}loadAll(){return new Promise((t,s)=>{let r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):t(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadBinary(e,r=>{this.success(t,e,r)},(r,n)=>{this.error(s,e,`Couldn't load binary ${e}: status ${r}, ${n}`)})}loadText(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadText(e,r=>{this.success(t,e,r)},(r,n)=>{this.error(s,e,`Couldn't load text ${e}: status ${r}, ${n}`)})}loadJson(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadJson(e,r=>{this.success(t,e,r)},(r,n)=>{this.error(s,e,`Couldn't load JSON ${e}: status ${r}, ${n}`)})}loadTexture(e,t=()=>{},s=()=>{}){if(e=this.start(e),!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(h=>h.ok?h.blob():(this.error(s,e,`Couldn't load image: ${e}`),null)).then(h=>h?createImageBitmap(h,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(h=>{h&&this.success(t,e,this.textureLoader(h))});else{let h=new Image;h.crossOrigin="anonymous",h.onload=()=>{this.success(t,e,this.textureLoader(h))},h.onerror=()=>{this.error(s,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),h.src=e}}loadTextureAtlas(e,t=()=>{},s=()=>{},r){let n=e.lastIndexOf("/"),h=n>=0?e.substring(0,n+1):"";e=this.start(e),this.downloader.downloadText(e,o=>{try{let i=new Kt(o),l=i.pages.length,a=!1;for(let c of i.pages)this.loadTexture(r?r[c.name]:h+c.name,(d,f)=>{a||(c.setTexture(f),--l==0&&this.success(t,e,i))},(d,f)=>{a||this.error(s,e,`Couldn't load texture atlas ${e} page image: ${d}`),a=!0})}catch(i){this.error(s,e,`Couldn't parse texture atlas ${e}: ${i.message}`)}},(o,i)=>{this.error(s,e,`Couldn't load texture atlas ${e}: status ${o}, ${i}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.assets[e];if(t)return t;let s=this.errors[e];throw Error("Asset not found: "+e+(s?`
|
|
2
|
+
`+s:""))}remove(e){e=this.pathPrefix+e;let t=this.assets[e];return t.dispose&&t.dispose(),delete this.assets[e],t}removeAll(){for(let e in this.assets){let t=this.assets[e];t.dispose&&t.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}},_s=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),s=t.length,r=new Uint8Array(s),n=0;n<s;n++)r[n]=t.charCodeAt(n);return r}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;if(this.rawDataUris[e]){try{let h=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(h))}catch(h){this.finish(e,400,JSON.stringify(h))}return}let r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.open("GET",e,!0);let n=()=>{this.finish(e,r.status,r.responseText)};r.onload=n,r.onerror=n,r.send()}downloadJson(e,t,s){this.downloadText(e,r=>{t(JSON.parse(r))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;if(this.rawDataUris[e]){try{let h=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(h))}catch(h){this.finish(e,400,JSON.stringify(h))}return}let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer";let n=()=>{this.finish(e,r.status,r.response)};r.onload=()=>{r.status==200||r.status==0?this.finish(e,200,new Uint8Array(r.response)):n()},r.onerror=n,r.send()}start(e,t,s){let r=this.callbacks[e];try{if(r)return!0;this.callbacks[e]=r=[]}finally{r.push(t,s)}}finish(e,t,s){let r=this.callbacks[e];delete this.callbacks[e];let n=t==200||t==0?[s]:[t,s];for(let h=n.length-1,o=r.length;h<o;h+=2)r[h].apply(null,n)}},ss=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},rs=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},Vs=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let n=t.findBone(e.bones[r].name);if(!n)throw new Error(`Couldn't find bone ${e.bones[r].name}`);this.bones.push(n)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=s,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}update(e){if(this.mix==0)return;let t=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,s,r,n,h,o){let i=e.parent;if(!i)throw new Error("IK bone must have parent.");let l=i.a,a=i.b,c=i.c,d=i.d,f=-e.ashearX-e.arotation,u=0,m=0;switch(e.inherit){case 1:u=(t-e.worldX)*P.signum(e.skeleton.scaleX),m=(s-e.worldY)*P.signum(e.skeleton.scaleY);break;case 2:let b=Math.abs(l*d-a*c)/Math.max(1e-4,l*l+c*c),g=l/e.skeleton.scaleX,x=c/e.skeleton.scaleY;a=-x*b*e.skeleton.scaleX,d=g*b*e.skeleton.scaleY,f+=Math.atan2(x,g)*P.radDeg;default:let v=t-i.worldX,y=s-i.worldY,C=l*d-a*c;Math.abs(C)<=1e-4?(u=0,m=0):(u=(v*d-y*a)/C-e.ax,m=(y*l-v*c)/C-e.ay)}f+=Math.atan2(m,u)*P.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let p=e.ascaleX,w=e.ascaleY;if(r||n){switch(e.inherit){case 3:case 4:u=t-e.worldX,m=s-e.worldY}const b=e.data.length*p;if(b>1e-4){const g=u*u+m*m;if(r&&g<b*b||n&&g>b*b){const x=(Math.sqrt(g)/b-1)*o+1;p*=x,h&&(w*=x)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,p,w,e.ashearX,e.ashearY)}apply2(e,t,s,r,n,h,o,i,l){if(e.inherit!=0||t.inherit!=0)return;let a=e.ax,c=e.ay,d=e.ascaleX,f=e.ascaleY,u=d,m=f,p=t.ascaleX,w=0,b=0,g=0;d<0?(d=-d,w=180,g=-1):(w=0,g=1),f<0&&(f=-f,g=-g),p<0?(p=-p,b=180):b=0;let x=t.ax,v=0,y=0,C=0,S=e.a,A=e.b,M=e.c,T=e.d,X=Math.abs(d-f)<=1e-4;!X||h?(v=0,y=S*x+e.worldX,C=M*x+e.worldY):(v=t.ay,y=S*x+A*v+e.worldX,C=M*x+T*v+e.worldY);let F=e.parent;if(!F)throw new Error("IK parent must itself have a parent.");S=F.a,A=F.b,M=F.c,T=F.d;let I=S*T-A*M,Y=y-F.worldX,E=C-F.worldY;I=Math.abs(I)<=1e-4?0:1/I;let V=(Y*T-E*A)*I-a,U=(E*S-Y*M)*I-c,L=Math.sqrt(V*V+U*U),H=t.data.length*p,$,j;if(L<1e-4){this.apply1(e,s,r,!1,h,!1,l),t.updateWorldTransformWith(x,v,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}Y=s-F.worldX,E=r-F.worldY;let D=(Y*T-E*A)*I-a,q=(E*S-Y*M)*I-c,W=D*D+q*q;if(i!=0){i*=d*(p+1)*.5;let K=Math.sqrt(W),Z=K-L-H*d+i;if(Z>0){let ee=Math.min(1,Z/(i*2))-1;ee=(Z-i*(1-ee*ee))/K,D-=ee*D,q-=ee*q,W=D*D+q*q}}e:if(X){H*=d;let K=(W-L*L-H*H)/(2*L*H);K<-1?(K=-1,j=Math.PI*n):K>1?(K=1,j=0,h&&(S=(Math.sqrt(W)/(L+H)-1)*l+1,u*=S,o&&(m*=S))):j=Math.acos(K)*n,S=L+H*K,A=H*Math.sin(j),$=Math.atan2(q*S-D*A,D*S+q*A)}else{S=d*H,A=f*H;let K=S*S,Z=A*A,ee=Math.atan2(q,D);M=Z*L*L+K*W-K*Z;let Ae=-2*Z*L,ze=Z-K;if(T=Ae*Ae-4*ze*M,T>=0){let Le=Math.sqrt(T);Ae<0&&(Le=-Le),Le=-(Ae+Le)*.5;let Ge=Le/ze,tr=M/Le,mt=Math.abs(Ge)<Math.abs(tr)?Ge:tr;if(Ge=W-mt*mt,Ge>=0){E=Math.sqrt(Ge)*n,$=ee-Math.atan2(E,mt),j=Math.atan2(E/f,(mt-L)/d);break e}}let Ks=P.PI,ft=L-S,gs=ft*ft,Qs=0,Zs=0,ut=L+S,ps=ut*ut,er=0;M=-S*L/(K-Z),M>=-1&&M<=1&&(M=Math.acos(M),Y=S*Math.cos(M)+L,E=A*Math.sin(M),T=Y*Y+E*E,T<gs&&(Ks=M,gs=T,ft=Y,Qs=E),T>ps&&(Zs=M,ps=T,ut=Y,er=E)),W<=(gs+ps)*.5?($=ee-Math.atan2(Qs*n,ft),j=Ks*n):($=ee-Math.atan2(er*n,ut),j=Zs*n)}let he=Math.atan2(v,x)*g,ae=e.arotation;$=($-he)*P.radDeg+w-ae,$>180?$-=360:$<-180&&($+=360),e.updateWorldTransformWith(a,c,ae+$*l,u,m,0,0),ae=t.arotation,j=((j+he)*P.radDeg-t.ashearX)*g+b-ae,j>180?j-=360:j<-180&&(j+=360),t.updateWorldTransformWith(x,v,ae+j*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},is=class extends Ue{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(e){super(e,0,!1)}},ns=class extends Ue{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=rt.Fixed;spacingMode=it.Fixed;rotateMode=nt.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(e){super(e,0,!1)}},rt=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(rt||{}),it=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(it||{}),nt=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(nt||{}),Ce=class{data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0,n=e.bones.length;r<n;r++){let h=t.findBone(e.bones[r].name);if(!h)throw new Error(`Couldn't find bone ${e.bones[r].name}.`);this.bones.push(h)}let s=t.findSlot(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}`);this.target=s,this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}update(e){let t=this.target.getAttachment();if(!(t instanceof Ye))return;let s=this.mixRotate,r=this.mixX,n=this.mixY;if(s==0&&r==0&&n==0)return;let h=this.data,o=h.rotateMode==0,i=h.rotateMode==2,l=this.bones,a=l.length,c=o?a:a+1,d=B.setArraySize(this.spaces,c),f=i?this.lengths=B.setArraySize(this.lengths,a):[],u=this.spacing;switch(h.spacingMode){case 2:if(i)for(let y=0,C=c-1;y<C;y++){let S=l[y],A=S.data.length,M=A*S.a,T=A*S.c;f[y]=Math.sqrt(M*M+T*T)}B.arrayFill(d,1,c,u);break;case 3:let x=0;for(let y=0,C=c-1;y<C;){let S=l[y],A=S.data.length;if(A<Ce.epsilon)i&&(f[y]=0),d[++y]=u;else{let M=A*S.a,T=A*S.c,X=Math.sqrt(M*M+T*T);i&&(f[y]=X),d[++y]=X,x+=X}}if(x>0){x=c/x*u;for(let y=1;y<c;y++)d[y]*=x}break;default:let v=h.spacingMode==0;for(let y=0,C=c-1;y<C;){let S=l[y],A=S.data.length;if(A<Ce.epsilon)i&&(f[y]=0),d[++y]=u;else{let M=A*S.a,T=A*S.c,X=Math.sqrt(M*M+T*T);i&&(f[y]=X),d[++y]=(v?A+u:u)*X/A}}}let m=this.computeWorldPositions(t,c,o),p=m[0],w=m[1],b=h.offsetRotation,g=!1;if(b==0)g=h.rotateMode==1;else{g=!1;let x=this.target.bone;b*=x.a*x.d-x.b*x.c>0?P.degRad:-P.degRad}for(let x=0,v=3;x<a;x++,v+=3){let y=l[x];y.worldX+=(p-y.worldX)*r,y.worldY+=(w-y.worldY)*n;let C=m[v],S=m[v+1],A=C-p,M=S-w;if(i){let T=f[x];if(T!=0){let X=(Math.sqrt(A*A+M*M)/T-1)*s+1;y.a*=X,y.c*=X}}if(p=C,w=S,s>0){let T=y.a,X=y.b,F=y.c,I=y.d,Y=0,E=0,V=0;if(o?Y=m[v-1]:d[x+1]==0?Y=m[v+2]:Y=Math.atan2(M,A),Y-=Math.atan2(F,T),g){E=Math.cos(Y),V=Math.sin(Y);let U=y.data.length;p+=(U*(E*T-V*F)-A)*s,w+=(U*(V*T+E*F)-M)*s}else Y+=b;Y>P.PI?Y-=P.PI2:Y<-P.PI&&(Y+=P.PI2),Y*=s,E=Math.cos(Y),V=Math.sin(Y),y.a=E*T-V*F,y.b=E*X-V*I,y.c=V*T+E*F,y.d=V*X+E*I}y.updateAppliedTransform()}}computeWorldPositions(e,t,s){let r=this.target,n=this.position,h=this.spaces,o=B.setArraySize(this.positions,t*3+2),i=this.world,l=e.closed,a=e.worldVerticesLength,c=a/6,d=Ce.NONE;if(!e.constantSpeed){let U=e.lengths;c-=l?1:2;let L=U[c];this.data.positionMode==1&&(n*=L);let H;switch(this.data.spacingMode){case 2:H=L;break;case 3:H=L/t;break;default:H=1}i=B.setArraySize(this.world,8);for(let $=0,j=0,D=0;$<t;$++,j+=3){let q=h[$]*H;n+=q;let W=n;if(l)W%=L,W<0&&(W+=L),D=0;else if(W<0){d!=Ce.BEFORE&&(d=Ce.BEFORE,e.computeWorldVertices(r,2,4,i,0,2)),this.addBeforePosition(W,i,0,o,j);continue}else if(W>L){d!=Ce.AFTER&&(d=Ce.AFTER,e.computeWorldVertices(r,a-6,4,i,0,2)),this.addAfterPosition(W-L,i,0,o,j);continue}for(;;D++){let he=U[D];if(!(W>he)){if(D==0)W/=he;else{let ae=U[D-1];W=(W-ae)/(he-ae)}break}}D!=d&&(d=D,l&&D==c?(e.computeWorldVertices(r,a-4,4,i,0,2),e.computeWorldVertices(r,0,4,i,4,2)):e.computeWorldVertices(r,D*6+2,8,i,0,2)),this.addCurvePosition(W,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],o,j,s||$>0&&q==0)}return o}l?(a+=2,i=B.setArraySize(this.world,a),e.computeWorldVertices(r,2,a-4,i,0,2),e.computeWorldVertices(r,0,2,i,a-4,2),i[a-2]=i[0],i[a-1]=i[1]):(c--,a-=4,i=B.setArraySize(this.world,a),e.computeWorldVertices(r,2,a,i,0,2));let f=B.setArraySize(this.curves,c),u=0,m=i[0],p=i[1],w=0,b=0,g=0,x=0,v=0,y=0,C=0,S=0,A=0,M=0,T=0,X=0,F=0,I=0;for(let U=0,L=2;U<c;U++,L+=6)w=i[L],b=i[L+1],g=i[L+2],x=i[L+3],v=i[L+4],y=i[L+5],C=(m-w*2+g)*.1875,S=(p-b*2+x)*.1875,A=((w-g)*3-m+v)*.09375,M=((b-x)*3-p+y)*.09375,T=C*2+A,X=S*2+M,F=(w-m)*.75+C+A*.16666667,I=(b-p)*.75+S+M*.16666667,u+=Math.sqrt(F*F+I*I),F+=T,I+=X,T+=A,X+=M,u+=Math.sqrt(F*F+I*I),F+=T,I+=X,u+=Math.sqrt(F*F+I*I),F+=T+A,I+=X+M,u+=Math.sqrt(F*F+I*I),f[U]=u,m=v,p=y;this.data.positionMode==1&&(n*=u);let Y;switch(this.data.spacingMode){case 2:Y=u;break;case 3:Y=u/t;break;default:Y=1}let E=this.segments,V=0;for(let U=0,L=0,H=0,$=0;U<t;U++,L+=3){let j=h[U]*Y;n+=j;let D=n;if(l)D%=u,D<0&&(D+=u),H=0;else if(D<0){this.addBeforePosition(D,i,0,o,L);continue}else if(D>u){this.addAfterPosition(D-u,i,a-4,o,L);continue}for(;;H++){let q=f[H];if(!(D>q)){if(H==0)D/=q;else{let W=f[H-1];D=(D-W)/(q-W)}break}}if(H!=d){d=H;let q=H*6;for(m=i[q],p=i[q+1],w=i[q+2],b=i[q+3],g=i[q+4],x=i[q+5],v=i[q+6],y=i[q+7],C=(m-w*2+g)*.03,S=(p-b*2+x)*.03,A=((w-g)*3-m+v)*.006,M=((b-x)*3-p+y)*.006,T=C*2+A,X=S*2+M,F=(w-m)*.3+C+A*.16666667,I=(b-p)*.3+S+M*.16666667,V=Math.sqrt(F*F+I*I),E[0]=V,q=1;q<8;q++)F+=T,I+=X,T+=A,X+=M,V+=Math.sqrt(F*F+I*I),E[q]=V;F+=T,I+=X,V+=Math.sqrt(F*F+I*I),E[8]=V,F+=T+A,I+=X+M,V+=Math.sqrt(F*F+I*I),E[9]=V,$=0}for(D*=V;;$++){let q=E[$];if(!(D>q)){if($==0)D/=q;else{let W=E[$-1];D=$+(D-W)/(q-W)}break}}this.addCurvePosition(D*.1,m,p,w,b,g,x,v,y,o,L,s||U>0&&j==0)}return o}addBeforePosition(e,t,s,r,n){let h=t[s],o=t[s+1],i=t[s+2]-h,l=t[s+3]-o,a=Math.atan2(l,i);r[n]=h+e*Math.cos(a),r[n+1]=o+e*Math.sin(a),r[n+2]=a}addAfterPosition(e,t,s,r,n){let h=t[s+2],o=t[s+3],i=h-t[s],l=o-t[s+1],a=Math.atan2(l,i);r[n]=h+e*Math.cos(a),r[n+1]=o+e*Math.sin(a),r[n+2]=a}addCurvePosition(e,t,s,r,n,h,o,i,l,a,c,d){if(e==0||isNaN(e)){a[c]=t,a[c+1]=s,a[c+2]=Math.atan2(n-s,r-t);return}let f=e*e,u=f*e,m=1-e,p=m*m,w=p*m,b=m*e,g=b*3,x=m*g,v=g*e,y=t*w+r*x+h*v+i*u,C=s*w+n*x+o*v+l*u;a[c]=y,a[c+1]=C,d&&(e<.001?a[c+2]=Math.atan2(n-s,r-t):a[c+2]=Math.atan2(C-(s*p+n*b*2+o*f),y-(t*p+r*b*2+h*f)))}},Re=Ce;R(Re,"NONE",-1),R(Re,"BEFORE",-2),R(Re,"AFTER",-3),R(Re,"epsilon",1e-5);var wr=class{data;_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(e,t){this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,r=this.data.y>0,n=this.data.rotate>0||this.data.shearX>0,h=this.data.scaleX>0,o=this.bone,i=o.data.length;switch(e){case 0:return;case 1:this.reset();case 2:const l=this.skeleton,a=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=a,this.lastTime=l.time;const c=o.worldX,d=o.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=d;else{let f=this.remaining,u=this.inertia,m=this.data.step,p=this.skeleton.data.referenceScale,w=-1,b=this.data.limit*a,g=b*Math.abs(l.scaleY);if(b*=Math.abs(l.scaleX),s||r){if(s){const x=(this.ux-c)*u;this.xOffset+=x>b?b:x<-b?-b:x,this.ux=c}if(r){const x=(this.uy-d)*u;this.yOffset+=x>g?g:x<-g?-g:x,this.uy=d}if(f>=m){w=Math.pow(this.damping,60*m);const x=this.massInverse*m,v=this.strength,y=this.wind*p,C=(Fe.yDown?-this.gravity:this.gravity)*p;do s&&(this.xVelocity+=(y-this.xOffset*v)*x,this.xOffset+=this.xVelocity*m,this.xVelocity*=w),r&&(this.yVelocity-=(C+this.yOffset*v)*x,this.yOffset+=this.yVelocity*m,this.yVelocity*=w),f-=m;while(f>=m)}s&&(o.worldX+=this.xOffset*t*this.data.x),r&&(o.worldY+=this.yOffset*t*this.data.y)}if(n||h){let x=Math.atan2(o.c,o.a),v=0,y=0,C=0,S=this.cx-o.worldX,A=this.cy-o.worldY;if(S>b?S=b:S<-b&&(S=-b),A>g?A=g:A<-g&&(A=-g),n){C=(this.data.rotate+this.data.shearX)*t;let M=Math.atan2(A+this.ty,S+this.tx)-x-this.rotateOffset*C;this.rotateOffset+=(M-Math.ceil(M*P.invPI2-.5)*P.PI2)*u,M=this.rotateOffset*C+x,v=Math.cos(M),y=Math.sin(M),h&&(M=i*o.getWorldScaleX(),M>0&&(this.scaleOffset+=(S*v+A*y)*u/M))}else{v=Math.cos(x),y=Math.sin(x);const M=i*o.getWorldScaleX();M>0&&(this.scaleOffset+=(S*v+A*y)*u/M)}if(f=this.remaining,f>=m){w==-1&&(w=Math.pow(this.damping,60*m));const M=this.massInverse*m,T=this.strength,X=this.wind,F=Fe.yDown?-this.gravity:this.gravity,I=i/p;for(;;)if(f-=m,h&&(this.scaleVelocity+=(X*v-F*y-this.scaleOffset*T)*M,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=w),n){if(this.rotateVelocity-=((X*y+F*v)*I+this.rotateOffset*T)*M,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=w,f<m)break;const Y=this.rotateOffset*C+x;v=Math.cos(Y),y=Math.sin(Y)}else if(f<m)break}}this.remaining=f}this.cx=o.worldX,this.cy=o.worldY;break;case 3:s&&(o.worldX+=this.xOffset*t*this.data.x),r&&(o.worldY+=this.yOffset*t*this.data.y)}if(n){let l=this.rotateOffset*t,a=0,c=0,d=0;if(this.data.shearX>0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,a=Math.sin(f),c=Math.cos(f),d=o.b,o.b=c*d-a*o.d,o.d=a*d+c*o.d),f+=l*this.data.shearX,a=Math.sin(f),c=Math.cos(f),d=o.a,o.a=c*d-a*o.c,o.c=a*d+c*o.c}else l*=this.data.rotate,a=Math.sin(l),c=Math.cos(l),d=o.a,o.a=c*d-a*o.c,o.c=a*d+c*o.c,d=o.b,o.b=c*d-a*o.d,o.d=a*d+c*o.d}if(h){const l=1+this.scaleOffset*t*this.data.scaleX;o.a*=l,o.c*=l}e!=3&&(this.tx=i*o.a,this.ty=i*o.c),o.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const r=s*P.degRad,n=Math.cos(r),h=Math.sin(r),o=this.cx-e,i=this.cy-t;this.translate(o*n-i*h-o,o*h+i*n-i)}},Os=class{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new _,this.darkColor=e.darkColor?new _:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof de)||!(this.attachment instanceof de)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Ns=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new _e;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let n=t.findBone(e.bones[r].name);if(!n)throw new Error(`Couldn't find bone ${e.bones[r].name}.`);this.bones.push(n)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=s,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}update(e){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,o=t!=0||s!=0,i=this.target,l=i.a,a=i.b,c=i.c,d=i.d,f=l*d-a*c>0?P.degRad:-P.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,p=this.bones;for(let w=0,b=p.length;w<b;w++){let g=p[w];if(e!=0){let x=g.a,v=g.b,y=g.c,C=g.d,S=Math.atan2(c,l)-Math.atan2(y,x)+u;S>P.PI?S-=P.PI2:S<-P.PI&&(S+=P.PI2),S*=e;let A=Math.cos(S),M=Math.sin(S);g.a=A*x-M*y,g.b=A*v-M*C,g.c=M*x+A*y,g.d=M*v+A*C}if(o){let x=this.temp;i.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(x.x-g.worldX)*t,g.worldY+=(x.y-g.worldY)*s}if(r!=0){let x=Math.sqrt(g.a*g.a+g.c*g.c);x!=0&&(x=(x+(Math.sqrt(l*l+c*c)-x+this.data.offsetScaleX)*r)/x),g.a*=x,g.c*=x}if(n!=0){let x=Math.sqrt(g.b*g.b+g.d*g.d);x!=0&&(x=(x+(Math.sqrt(a*a+d*d)-x+this.data.offsetScaleY)*n)/x),g.b*=x,g.d*=x}if(h>0){let x=g.b,v=g.d,y=Math.atan2(v,x),C=Math.atan2(d,a)-Math.atan2(c,l)-(y-Math.atan2(g.c,g.a));C>P.PI?C-=P.PI2:C<-P.PI&&(C+=P.PI2),C=y+(C+m)*h;let S=Math.sqrt(x*x+v*v);g.b=Math.cos(C)*S,g.d=Math.sin(C)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,o=t!=0||s!=0,i=this.target,l=i.a,a=i.b,c=i.c,d=i.d,f=l*d-a*c>0?P.degRad:-P.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,p=this.bones;for(let w=0,b=p.length;w<b;w++){let g=p[w];if(e!=0){let x=g.a,v=g.b,y=g.c,C=g.d,S=Math.atan2(c,l)+u;S>P.PI?S-=P.PI2:S<-P.PI&&(S+=P.PI2),S*=e;let A=Math.cos(S),M=Math.sin(S);g.a=A*x-M*y,g.b=A*v-M*C,g.c=M*x+A*y,g.d=M*v+A*C}if(o){let x=this.temp;i.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.worldX+=x.x*t,g.worldY+=x.y*s}if(r!=0){let x=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleX)*r+1;g.a*=x,g.c*=x}if(n!=0){let x=(Math.sqrt(a*a+d*d)-1+this.data.offsetScaleY)*n+1;g.b*=x,g.d*=x}if(h>0){let x=Math.atan2(d,a)-Math.atan2(c,l);x>P.PI?x-=P.PI2:x<-P.PI&&(x+=P.PI2);let v=g.b,y=g.d;x=Math.atan2(y,v)+(x-P.PI/2+m)*h;let C=Math.sqrt(v*v+y*y);g.b=Math.cos(x)*C,g.d=Math.sin(x)*C}g.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,o=this.target,i=this.bones;for(let l=0,a=i.length;l<a;l++){let c=i[l],d=c.arotation;e!=0&&(d+=(o.arotation-d+this.data.offsetRotation)*e);let f=c.ax,u=c.ay;f+=(o.ax-f+this.data.offsetX)*t,u+=(o.ay-u+this.data.offsetY)*s;let m=c.ascaleX,p=c.ascaleY;r!=0&&m!=0&&(m=(m+(o.ascaleX-m+this.data.offsetScaleX)*r)/m),n!=0&&p!=0&&(p=(p+(o.ascaleY-p+this.data.offsetScaleY)*n)/p);let w=c.ashearY;h!=0&&(w+=(o.ashearY-w+this.data.offsetShearY)*h),c.updateWorldTransformWith(f,u,d,m,p,c.ashearX,w)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,o=this.target,i=this.bones;for(let l=0,a=i.length;l<a;l++){let c=i[l],d=c.arotation+(o.arotation+this.data.offsetRotation)*e,f=c.ax+(o.ax+this.data.offsetX)*t,u=c.ay+(o.ay+this.data.offsetY)*s,m=c.ascaleX*((o.ascaleX-1+this.data.offsetScaleX)*r+1),p=c.ascaleY*((o.ascaleY-1+this.data.offsetScaleY)*n+1),w=c.ashearY+(o.ashearY+this.data.offsetShearY)*h;c.updateWorldTransformWith(f,u,d,m,p,c.ashearX,w)}}},as=class{data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return as.yDown?-this._scaleY:this._scaleY}set scaleY(e){this._scaleY=e}x=0;y=0;time=0;constructor(e){if(!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let t=0;t<e.bones.length;t++){let s=e.bones[t],r;if(!s.parent)r=new ts(s,this,null);else{let n=this.bones[s.parent.index];r=new ts(s,this,n),n.children.push(r)}this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<e.slots.length;t++){let s=e.slots[t],r=this.bones[s.boneData.index],n=new Os(s,r);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let t=0;t<e.ikConstraints.length;t++){let s=e.ikConstraints[t];this.ikConstraints.push(new Vs(s,this))}this.transformConstraints=new Array;for(let t=0;t<e.transformConstraints.length;t++){let s=e.transformConstraints[t];this.transformConstraints.push(new Ns(s,this))}this.pathConstraints=new Array;for(let t=0;t<e.pathConstraints.length;t++){let s=e.pathConstraints[t];this.pathConstraints.push(new Re(s,this))}this.physicsConstraints=new Array;for(let t=0;t<e.physicsConstraints.length;t++){let s=e.physicsConstraints[t];this.physicsConstraints.push(new wr(s,this))}this.color=new _(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let t=this.bones;for(let d=0,f=t.length;d<f;d++){let u=t[d];u.sorted=u.data.skinRequired,u.active=!u.sorted}if(this.skin){let d=this.skin.bones;for(let f=0,u=this.skin.bones.length;f<u;f++){let m=this.bones[d[f].index];do m.sorted=!1,m.active=!0,m=m.parent;while(m)}}let s=this.ikConstraints,r=this.transformConstraints,n=this.pathConstraints,h=this.physicsConstraints,o=s.length,i=r.length,l=n.length,a=this.physicsConstraints.length,c=o+i+l+a;e:for(let d=0;d<c;d++){for(let f=0;f<o;f++){let u=s[f];if(u.data.order==d){this.sortIkConstraint(u);continue e}}for(let f=0;f<i;f++){let u=r[f];if(u.data.order==d){this.sortTransformConstraint(u);continue e}}for(let f=0;f<l;f++){let u=n[f];if(u.data.order==d){this.sortPathConstraint(u);continue e}}for(let f=0;f<a;f++){const u=h[f];if(u.data.order==d){this.sortPhysicsConstraint(u);continue e}}}for(let d=0,f=t.length;d<f;d++)this.sortBone(t[d])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target;this.sortBone(t);let s=e.bones,r=s[0];if(this.sortBone(r),s.length==1)this._updateCache.push(e),this.sortReset(r.children);else{let n=s[s.length-1];this.sortBone(n),this._updateCache.push(e),this.sortReset(r.children),n.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target,s=t.data.index,r=t.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,r),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,r);for(let i=0,l=this.data.skins.length;i<l;i++)this.sortPathConstraintAttachment(this.data.skins[i],s,r);let n=t.getAttachment();n instanceof Ye&&this.sortPathConstraintAttachmentWith(n,r);let h=e.bones,o=h.length;for(let i=0;i<o;i++)this.sortBone(h[i]);this._updateCache.push(e);for(let i=0;i<o;i++)this.sortReset(h[i].children);for(let i=0;i<o;i++)h[i].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let t=e.bones,s=t.length;if(e.data.local)for(let r=0;r<s;r++){let n=t[r];this.sortBone(n.parent),this.sortBone(n)}else for(let r=0;r<s;r++)this.sortBone(t[r]);this._updateCache.push(e);for(let r=0;r<s;r++)this.sortReset(t[r].children);for(let r=0;r<s;r++)t[r].sorted=!0}sortPathConstraintAttachment(e,t,s){let r=e.attachments[t];if(r)for(let n in r)this.sortPathConstraintAttachmentWith(r[n],s)}sortPathConstraintAttachmentWith(e,t){if(!(e instanceof Ye))return;let s=e.bones;if(!s)this.sortBone(t);else{let r=this.bones;for(let n=0,h=s.length;n<h;){let o=s[n++];for(o+=n;n<o;)this.sortBone(r[s[n++]])}}}sortPhysicsConstraint(e){const t=e.bone;e.active=t.active&&(!e.data.skinRequired||this.skin!=null&&B.contains(this.skin.constraints,e.data,!0)),e.active&&(this.sortBone(t),this._updateCache.push(e),this.sortReset(t.children),t.sorted=!0)}sortBone(e){if(!e||e.sorted)return;let t=e.parent;t&&this.sortBone(t),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let t=0,s=e.length;t<s;t++){let r=e[t];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}}updateWorldTransform(e){if(e==null)throw new Error("physics is undefined");let t=this.bones;for(let r=0,n=t.length;r<n;r++){let h=t[r];h.ax=h.x,h.ay=h.y,h.arotation=h.rotation,h.ascaleX=h.scaleX,h.ascaleY=h.scaleY,h.ashearX=h.shearX,h.ashearY=h.shearY}let s=this._updateCache;for(let r=0,n=s.length;r<n;r++)s[r].update(e)}updateWorldTransformWith(e,t){let s=this.getRootBone();if(!s)throw new Error("Root bone must not be null.");let r=t.a,n=t.b,h=t.c,o=t.d;s.worldX=r*this.x+n*this.y+t.worldX,s.worldY=h*this.x+o*this.y+t.worldY;const i=(s.rotation+s.shearX)*P.degRad,l=(s.rotation+90+s.shearY)*P.degRad,a=Math.cos(i)*s.scaleX,c=Math.cos(l)*s.scaleY,d=Math.sin(i)*s.scaleX,f=Math.sin(l)*s.scaleY;s.a=(r*a+n*d)*this.scaleX,s.b=(r*c+n*f)*this.scaleX,s.c=(h*a+o*d)*this.scaleY,s.d=(h*c+o*f)*this.scaleY;let u=this._updateCache;for(let m=0,p=u.length;m<p;m++){let w=u[m];w!=s&&w.update(e)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const e of this.bones)e.setToSetupPose();for(const e of this.ikConstraints)e.setToSetupPose();for(const e of this.transformConstraints)e.setToSetupPose();for(const e of this.pathConstraints)e.setToSetupPose();for(const e of this.physicsConstraints)e.setToSetupPose()}setSlotsToSetupPose(){let e=this.slots;B.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,s=e.length;t<s;t++)e[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.data.name==e)return n}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.data.name==e)return n}return null}setSkinByName(e){let t=this.data.findSkin(e);if(!t)throw new Error("Skin not found: "+e);this.setSkin(t)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let t=this.slots;for(let s=0,r=t.length;s<r;s++){let n=t[s],h=n.data.attachmentName;if(h){let o=e.getAttachment(s,h);o&&n.setAttachment(o)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,t){let s=this.data.findSlot(e);if(!s)throw new Error(`Can't find slot with name ${e}`);return this.getAttachment(s.index,t)}getAttachment(e,t){if(!t)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(e,t);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,t):null}setAttachment(e,t){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let r=0,n=s.length;r<n;r++){let h=s[r];if(h.data.name==e){let o=null;if(t&&(o=this.getAttachment(r,t),!o))throw new Error("Attachment not found: "+t+", for slot: "+e);h.setAttachment(o);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(t=>t.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(){let e=new _e,t=new _e;return this.getBounds(e,t),{x:e.x,y:e.y,width:t.x,height:t.y}}getBounds(e,t,s=new Array(2),r=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let n=this.drawOrder,h=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let a=0,c=n.length;a<c;a++){let d=n[a];if(!d.bone.active)continue;let f=0,u=null,m=null,p=d.getAttachment();if(p instanceof O)f=8,u=B.setArraySize(s,f,0),p.computeWorldVertices(d,u,0,2),m=as.quadTriangles;else if(p instanceof le){let w=p;f=w.worldVerticesLength,u=B.setArraySize(s,f,0),w.computeWorldVertices(d,0,f,u,0,2),m=w.triangles}else if(p instanceof ve&&r!=null){r.clipStart(d,p);continue}if(u&&m){r!=null&&r.isClipping()&&(r.clipTriangles(u,m,m.length),u=r.clippedVertices,f=r.clippedVertices.length);for(let w=0,b=u.length;w<b;w+=2){let g=u[w],x=u[w+1];h=Math.min(h,g),o=Math.min(o,x),i=Math.max(i,g),l=Math.max(l,x)}}r?.clipEndWithSlot(d)}r?.clipEnd(),e.set(h,o),t.set(i-h,l-o)}update(e){this.time+=e}physicsTranslate(e,t){const s=this.physicsConstraints;for(let r=0,n=s.length;r<n;r++)s[r].translate(e,t)}physicsRotate(e,t,s){const r=this.physicsConstraints;for(let n=0,h=r.length;n<h;n++)r[n].rotate(e,t,s)}},Fe=as;R(Fe,"quadTriangles",[0,1,2,2,3,0]),R(Fe,"yDown",!1);var Us=(e=>(e[e.none=0]="none",e[e.reset=1]="reset",e[e.update=2]="update",e[e.pose=3]="pose",e))(Us||{}),qs=class extends Ue{_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(e){super(e,0,!1)}},qe=class{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}findPhysicsConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.physicsConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}},os=class{constructor(e=0,t,s){this.slotIndex=e,this.name=t,this.attachment=s}},at=class{name;attachments=new Array;bones=Array();constraints=new Array;color=new _(.99607843,.61960787,.30980393,1);constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,s){if(!s)throw new Error("attachment cannot be null.");let r=this.attachments;e>=r.length&&(r.length=e+1),r[e]||(r[e]={}),r[e][t]=s}addSkin(e){for(let r=0;r<e.bones.length;r++){let n=e.bones[r],h=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==n){h=!0;break}h||this.bones.push(n)}for(let r=0;r<e.constraints.length;r++){let n=e.constraints[r],h=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==n){h=!0;break}h||this.constraints.push(n)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let r=0;r<e.bones.length;r++){let n=e.bones[r],h=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==n){h=!0;break}h||this.bones.push(n)}for(let r=0;r<e.constraints.length;r++){let n=e.constraints[r],h=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==n){h=!0;break}h||this.constraints.push(n)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];s.attachment&&(s.attachment instanceof le?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(e,t){let s=this.attachments[e];return s?s[t]:null}removeAttachment(e,t){let s=this.attachments[e];s&&delete s[t]}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let s=this.attachments[t];if(s)for(let r in s){let n=s[r];n&&e.push(new os(t,r,n))}}return e}getAttachmentsForSlot(e,t){let s=this.attachments[e];if(s)for(let r in s){let n=s[r];n&&t.push(new os(e,r,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let s=0;for(let r=0;r<e.slots.length;r++){let n=e.slots[r],h=n.getAttachment();if(h&&s<t.attachments.length){let o=t.attachments[s];for(let i in o){let l=o[i];if(h==l){let a=this.getAttachment(s,i);a&&n.setAttachment(a);break}}}s++}}},ls=class{index=0;name;boneData;color=new _(1,1,1,1);darkColor=null;attachmentName=null;blendMode=ot.Normal;visible=!0;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}},ot=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(ot||{}),hs=class extends Ue{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(e){super(e,0,!1)}},Ws=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new qe;s.name="";let r=new zs(e),n=r.readInt32(),h=r.readInt32();s.hash=h==0&&n==0?null:h.toString(16)+n.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*t;let o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let i=0;i=r.readInt(!0);for(let a=0;a<i;a++){let c=r.readString();if(!c)throw new Error("String in string table must not be null.");r.strings.push(c)}i=r.readInt(!0);for(let a=0;a<i;a++){let c=r.readString();if(!c)throw new Error("Bone name must not be null.");let d=a==0?null:s.bones[r.readInt(!0)],f=new es(a,c,d);f.rotation=r.readFloat(),f.x=r.readFloat()*t,f.y=r.readFloat()*t,f.scaleX=r.readFloat(),f.scaleY=r.readFloat(),f.shearX=r.readFloat(),f.shearY=r.readFloat(),f.length=r.readFloat()*t,f.inherit=r.readByte(),f.skinRequired=r.readBoolean(),o&&(_.rgba8888ToColor(f.color,r.readInt32()),f.icon=r.readString()??void 0,f.visible=r.readBoolean()),s.bones.push(f)}i=r.readInt(!0);for(let a=0;a<i;a++){let c=r.readString();if(!c)throw new Error("Slot name must not be null.");let d=s.bones[r.readInt(!0)],f=new ls(a,c,d);_.rgba8888ToColor(f.color,r.readInt32());let u=r.readInt32();u!=-1&&_.rgb888ToColor(f.darkColor=new _,u),f.attachmentName=r.readStringRef(),f.blendMode=r.readInt(!0),o&&(f.visible=r.readBoolean()),s.slots.push(f)}i=r.readInt(!0);for(let a=0,c;a<i;a++){let d=r.readString();if(!d)throw new Error("IK constraint data name must not be null.");let f=new is(d);f.order=r.readInt(!0),c=r.readInt(!0);for(let m=0;m<c;m++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let u=r.readByte();f.skinRequired=(u&1)!=0,f.bendDirection=u&2?1:-1,f.compress=(u&4)!=0,f.stretch=(u&8)!=0,f.uniform=(u&16)!=0,u&32&&(f.mix=u&64?r.readFloat():1),u&128&&(f.softness=r.readFloat()*t),s.ikConstraints.push(f)}i=r.readInt(!0);for(let a=0,c;a<i;a++){let d=r.readString();if(!d)throw new Error("Transform constraint data name must not be null.");let f=new hs(d);f.order=r.readInt(!0),c=r.readInt(!0);for(let m=0;m<c;m++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let u=r.readByte();f.skinRequired=(u&1)!=0,f.local=(u&2)!=0,f.relative=(u&4)!=0,u&8&&(f.offsetRotation=r.readFloat()),u&16&&(f.offsetX=r.readFloat()*t),u&32&&(f.offsetY=r.readFloat()*t),u&64&&(f.offsetScaleX=r.readFloat()),u&128&&(f.offsetScaleY=r.readFloat()),u=r.readByte(),u&1&&(f.offsetShearY=r.readFloat()),u&2&&(f.mixRotate=r.readFloat()),u&4&&(f.mixX=r.readFloat()),u&8&&(f.mixY=r.readFloat()),u&16&&(f.mixScaleX=r.readFloat()),u&32&&(f.mixScaleY=r.readFloat()),u&64&&(f.mixShearY=r.readFloat()),s.transformConstraints.push(f)}i=r.readInt(!0);for(let a=0,c;a<i;a++){let d=r.readString();if(!d)throw new Error("Path constraint data name must not be null.");let f=new ns(d);f.order=r.readInt(!0),f.skinRequired=r.readBoolean(),c=r.readInt(!0);for(let m=0;m<c;m++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.slots[r.readInt(!0)];const u=r.readByte();f.positionMode=u&1,f.spacingMode=u>>1&3,f.rotateMode=u>>3&3,u&128&&(f.offsetRotation=r.readFloat()),f.position=r.readFloat(),f.positionMode==0&&(f.position*=t),f.spacing=r.readFloat(),(f.spacingMode==0||f.spacingMode==1)&&(f.spacing*=t),f.mixRotate=r.readFloat(),f.mixX=r.readFloat(),f.mixY=r.readFloat(),s.pathConstraints.push(f)}i=r.readInt(!0);for(let a=0,c;a<i;a++){const d=r.readString();if(!d)throw new Error("Physics constraint data name must not be null.");const f=new qs(d);f.order=r.readInt(!0),f.bone=s.bones[r.readInt(!0)];let u=r.readByte();f.skinRequired=(u&1)!=0,u&2&&(f.x=r.readFloat()),u&4&&(f.y=r.readFloat()),u&8&&(f.rotate=r.readFloat()),u&16&&(f.scaleX=r.readFloat()),u&32&&(f.shearX=r.readFloat()),f.limit=(u&64?r.readFloat():5e3)*t,f.step=1/r.readUnsignedByte(),f.inertia=r.readFloat(),f.strength=r.readFloat(),f.damping=r.readFloat(),f.massInverse=u&128?r.readFloat():1,f.wind=r.readFloat(),f.gravity=r.readFloat(),u=r.readByte(),u&1&&(f.inertiaGlobal=!0),u&2&&(f.strengthGlobal=!0),u&4&&(f.dampingGlobal=!0),u&8&&(f.massGlobal=!0),u&16&&(f.windGlobal=!0),u&32&&(f.gravityGlobal=!0),u&64&&(f.mixGlobal=!0),f.mix=u&128?r.readFloat():1,s.physicsConstraints.push(f)}let l=this.readSkin(r,s,!0,o);l&&(s.defaultSkin=l,s.skins.push(l));{let a=s.skins.length;for(B.setArraySize(s.skins,i=a+r.readInt(!0));a<i;a++){let c=this.readSkin(r,s,!1,o);if(!c)throw new Error("readSkin() should not have returned null.");s.skins[a]=c}}i=this.linkedMeshes.length;for(let a=0;a<i;a++){let c=this.linkedMeshes[a];const d=s.skins[c.skinIndex];if(!c.parent)throw new Error("Linked mesh parent must not be null");let f=d.getAttachment(c.slotIndex,c.parent);if(!f)throw new Error(`Parent mesh not found: ${c.parent}`);c.mesh.timelineAttachment=c.inheritTimeline?f:c.mesh,c.mesh.setParentMesh(f),c.mesh.region!=null&&c.mesh.updateRegion()}this.linkedMeshes.length=0,i=r.readInt(!0);for(let a=0;a<i;a++){let c=r.readString();if(!c)throw new Error("Event data name must not be null");let d=new rs(c);d.intValue=r.readInt(!1),d.floatValue=r.readFloat(),d.stringValue=r.readString(),d.audioPath=r.readString(),d.audioPath&&(d.volume=r.readFloat(),d.balance=r.readFloat()),s.events.push(d)}i=r.readInt(!0);for(let a=0;a<i;a++){let c=r.readString();if(!c)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(r,c,s))}return s}readSkin(e,t,s,r){let n=null,h=0;if(s){if(h=e.readInt(!0),h==0)return null;n=new at("default")}else{let o=e.readString();if(!o)throw new Error("Skin name must not be null.");n=new at(o),r&&_.rgba8888ToColor(n.color,e.readInt32()),n.bones.length=e.readInt(!0);for(let i=0,l=n.bones.length;i<l;i++)n.bones[i]=t.bones[e.readInt(!0)];for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.pathConstraints[e.readInt(!0)]);for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.physicsConstraints[e.readInt(!0)]);h=e.readInt(!0)}for(let o=0;o<h;o++){let i=e.readInt(!0);for(let l=0,a=e.readInt(!0);l<a;l++){let c=e.readStringRef();if(!c)throw new Error("Attachment name must not be null");let d=this.readAttachment(e,t,n,i,c,r);d&&n.setAttachment(i,c,d)}}return n}readAttachment(e,t,s,r,n,h){let o=this.scale,i=e.readByte();const l=i&8?e.readStringRef():n;if(!l)throw new Error("Attachment name must not be null");switch(i&7){case Se.Region:{let a=i&16?e.readStringRef():null;const c=i&32?e.readInt32():4294967295,d=i&64?this.readSequence(e):null;let f=i&128?e.readFloat():0,u=e.readFloat(),m=e.readFloat(),p=e.readFloat(),w=e.readFloat(),b=e.readFloat(),g=e.readFloat();a||(a=l);let x=this.attachmentLoader.newRegionAttachment(s,l,a,d);return x?(x.path=a,x.x=u*o,x.y=m*o,x.scaleX=p,x.scaleY=w,x.rotation=f,x.width=b*o,x.height=g*o,_.rgba8888ToColor(x.color,c),x.sequence=d,d==null&&x.updateRegion(),x):null}case Se.BoundingBox:{let a=this.readVertices(e,(i&16)!=0),c=h?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(s,l);return d?(d.worldVerticesLength=a.length,d.vertices=a.vertices,d.bones=a.bones,h&&_.rgba8888ToColor(d.color,c),d):null}case Se.Mesh:{let a=i&16?e.readStringRef():l;const c=i&32?e.readInt32():4294967295,d=i&64?this.readSequence(e):null,f=e.readInt(!0),u=this.readVertices(e,(i&128)!=0),m=this.readFloatArray(e,u.length,1),p=this.readShortArray(e,(u.length-f-2)*3);let w=[],b=0,g=0;h&&(w=this.readShortArray(e,e.readInt(!0)),b=e.readFloat(),g=e.readFloat()),a||(a=l);let x=this.attachmentLoader.newMeshAttachment(s,l,a,d);return x?(x.path=a,_.rgba8888ToColor(x.color,c),x.bones=u.bones,x.vertices=u.vertices,x.worldVerticesLength=u.length,x.triangles=p,x.regionUVs=m,d==null&&x.updateRegion(),x.hullLength=f<<1,x.sequence=d,h&&(x.edges=w,x.width=b*o,x.height=g*o),x):null}case Se.LinkedMesh:{const a=i&16?e.readStringRef():l;if(a==null)throw new Error("Path of linked mesh must not be null");const c=i&32?e.readInt32():4294967295,d=i&64?this.readSequence(e):null,f=(i&128)!=0,u=e.readInt(!0),m=e.readStringRef();let p=0,w=0;h&&(p=e.readFloat(),w=e.readFloat());let b=this.attachmentLoader.newMeshAttachment(s,l,a,d);return b?(b.path=a,_.rgba8888ToColor(b.color,c),b.sequence=d,h&&(b.width=p*o,b.height=w*o),this.linkedMeshes.push(new yr(b,u,r,m,f)),b):null}case Se.Path:{const a=(i&16)!=0,c=(i&32)!=0,d=this.readVertices(e,(i&64)!=0),f=B.newArray(d.length/6,0);for(let p=0,w=f.length;p<w;p++)f[p]=e.readFloat()*o;const u=h?e.readInt32():0,m=this.attachmentLoader.newPathAttachment(s,l);return m?(m.closed=a,m.constantSpeed=c,m.worldVerticesLength=d.length,m.vertices=d.vertices,m.bones=d.bones,m.lengths=f,h&&_.rgba8888ToColor(m.color,u),m):null}case Se.Point:{const a=e.readFloat(),c=e.readFloat(),d=e.readFloat(),f=h?e.readInt32():0,u=this.attachmentLoader.newPointAttachment(s,l);return u?(u.x=c*o,u.y=d*o,u.rotation=a,h&&_.rgba8888ToColor(u.color,f),u):null}case Se.Clipping:{const a=e.readInt(!0),c=this.readVertices(e,(i&16)!=0);let d=h?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(s,l);return f?(f.endSlot=t.slots[a],f.worldVerticesLength=c.length,f.vertices=c.vertices,f.bones=c.bones,h&&_.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){let t=new xt(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){const s=this.scale,r=e.readInt(!0),n=new vr;if(n.length=r<<1,!t)return n.vertices=this.readFloatArray(e,n.length,s),n;let h=new Array,o=new Array;for(let i=0;i<r;i++){let l=e.readInt(!0);o.push(l);for(let a=0;a<l;a++)o.push(e.readInt(!0)),h.push(e.readFloat()*s),h.push(e.readFloat()*s),h.push(e.readFloat())}return n.vertices=B.toFloatArray(h),n.bones=o,n}readFloatArray(e,t,s){let r=new Array(t);if(s==1)for(let n=0;n<t;n++)r[n]=e.readFloat();else for(let n=0;n<t;n++)r[n]=e.readFloat()*s;return r}readShortArray(e,t){let s=new Array(t);for(let r=0;r<t;r++)s[r]=e.readInt(!0);return s}readAnimation(e,t,s){e.readInt(!0);let r=new Array,n=this.scale;for(let l=0,a=e.readInt(!0);l<a;l++){let c=e.readInt(!0);for(let d=0,f=e.readInt(!0);d<f;d++){let u=e.readByte(),m=e.readInt(!0),p=m-1;switch(u){case Br:{let w=new Ie(m,c);for(let b=0;b<m;b++)w.setFrame(b,e.readFloat(),e.readStringRef());r.push(w);break}case Er:{let w=e.readInt(!0),b=new Mt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255;for(let S=0,A=0;b.setFrame(S,g,x,v,y,C),S!=p;S++){let M=e.readFloat(),T=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(S);break;case ge:z(e,b,A++,S,0,g,M,x,T,1),z(e,b,A++,S,1,g,M,v,X,1),z(e,b,A++,S,2,g,M,y,F,1),z(e,b,A++,S,3,g,M,C,I,1)}g=M,x=T,v=X,y=F,C=I}r.push(b);break}case Rr:{let w=e.readInt(!0),b=new Yt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255;for(let C=0,S=0;b.setFrame(C,g,x,v,y),C!=p;C++){let A=e.readFloat(),M=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(C);break;case ge:z(e,b,S++,C,0,g,A,x,M,1),z(e,b,S++,C,1,g,A,v,T,1),z(e,b,S++,C,2,g,A,y,X,1)}g=A,x=M,v=T,y=X}r.push(b);break}case Dr:{let w=e.readInt(!0),b=new Xt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let T=0,X=0;b.setFrame(T,g,x,v,y,C,S,A,M),T!=p;T++){let F=e.readFloat(),I=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,V=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,H=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(T);break;case ge:z(e,b,X++,T,0,g,F,x,I,1),z(e,b,X++,T,1,g,F,v,Y,1),z(e,b,X++,T,2,g,F,y,E,1),z(e,b,X++,T,3,g,F,C,V,1),z(e,b,X++,T,4,g,F,S,U,1),z(e,b,X++,T,5,g,F,A,L,1),z(e,b,X++,T,6,g,F,M,H,1)}g=F,x=I,v=Y,y=E,C=V,S=U,A=L,M=H}r.push(b);break}case Lr:{let w=e.readInt(!0),b=new Pt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;for(let M=0,T=0;b.setFrame(M,g,x,v,y,C,S,A),M!=p;M++){let X=e.readFloat(),F=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,V=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(M);break;case ge:z(e,b,T++,M,0,g,X,x,F,1),z(e,b,T++,M,1,g,X,v,I,1),z(e,b,T++,M,2,g,X,y,Y,1),z(e,b,T++,M,3,g,X,C,E,1),z(e,b,T++,M,4,g,X,S,V,1),z(e,b,T++,M,5,g,X,A,U,1)}g=X,x=F,v=I,y=Y,C=E,S=V,A=U}r.push(b);break}case _r:{let w=new Ft(m,e.readInt(!0),c),b=e.readFloat(),g=e.readUnsignedByte()/255;for(let x=0,v=0;w.setFrame(x,b,g),x!=p;x++){let y=e.readFloat(),C=e.readUnsignedByte()/255;switch(e.readByte()){case me:w.setStepped(x);break;case ge:z(e,w,v++,x,0,b,y,g,C,1)}b=y,g=C}r.push(w)}}}}for(let l=0,a=e.readInt(!0);l<a;l++){let c=e.readInt(!0);for(let d=0,f=e.readInt(!0);d<f;d++){let u=e.readByte(),m=e.readInt(!0);if(u==Pr){let w=new It(m,c);for(let b=0;b<m;b++)w.setFrame(b,e.readFloat(),e.readByte());r.push(w);continue}let p=e.readInt(!0);switch(u){case Cr:r.push(Q(e,new Ve(m,p,c),1));break;case Sr:r.push(cs(e,new bt(m,p,c),n));break;case kr:r.push(Q(e,new wt(m,p,c),n));break;case Ar:r.push(Q(e,new yt(m,p,c),n));break;case Tr:r.push(cs(e,new vt(m,p,c),1));break;case Ir:r.push(Q(e,new Ct(m,p,c),1));break;case Mr:r.push(Q(e,new St(m,p,c),1));break;case Yr:r.push(cs(e,new kt(m,p,c),1));break;case Fr:r.push(Q(e,new At(m,p,c),1));break;case Xr:r.push(Q(e,new Tt(m,p,c),1))}}}for(let l=0,a=e.readInt(!0);l<a;l++){let c=e.readInt(!0),d=e.readInt(!0),f=d-1,u=new Et(d,e.readInt(!0),c),m=e.readByte(),p=e.readFloat(),w=m&1?m&2?e.readFloat():1:0,b=m&4?e.readFloat()*n:0;for(let g=0,x=0;u.setFrame(g,p,w,b,m&8?1:-1,(m&16)!=0,(m&32)!=0),g!=f;g++){m=e.readByte();const v=e.readFloat(),y=m&1?m&2?e.readFloat():1:0,C=m&4?e.readFloat()*n:0;m&64?u.setStepped(g):m&128&&(z(e,u,x++,g,0,p,v,w,y,1),z(e,u,x++,g,1,p,v,b,C,n)),p=v,w=y,b=C}r.push(u)}for(let l=0,a=e.readInt(!0);l<a;l++){let c=e.readInt(!0),d=e.readInt(!0),f=d-1,u=new Rt(d,e.readInt(!0),c),m=e.readFloat(),p=e.readFloat(),w=e.readFloat(),b=e.readFloat(),g=e.readFloat(),x=e.readFloat(),v=e.readFloat();for(let y=0,C=0;u.setFrame(y,m,p,w,b,g,x,v),y!=f;y++){let S=e.readFloat(),A=e.readFloat(),M=e.readFloat(),T=e.readFloat(),X=e.readFloat(),F=e.readFloat(),I=e.readFloat();switch(e.readByte()){case me:u.setStepped(y);break;case ge:z(e,u,C++,y,0,m,S,p,A,1),z(e,u,C++,y,1,m,S,w,M,1),z(e,u,C++,y,2,m,S,b,T,1),z(e,u,C++,y,3,m,S,g,X,1),z(e,u,C++,y,4,m,S,x,F,1),z(e,u,C++,y,5,m,S,v,I,1)}m=S,p=A,w=M,b=T,g=X,x=F,v=I}r.push(u)}for(let l=0,a=e.readInt(!0);l<a;l++){let c=e.readInt(!0),d=s.pathConstraints[c];for(let f=0,u=e.readInt(!0);f<u;f++){const m=e.readByte(),p=e.readInt(!0),w=e.readInt(!0);switch(m){case Nr:r.push(Q(e,new Dt(p,w,c),d.positionMode==0?n:1));break;case Ur:r.push(Q(e,new Lt(p,w,c),d.spacingMode==0||d.spacingMode==1?n:1));break;case qr:let b=new _t(p,w,c),g=e.readFloat(),x=e.readFloat(),v=e.readFloat(),y=e.readFloat();for(let C=0,S=0,A=b.getFrameCount()-1;b.setFrame(C,g,x,v,y),C!=A;C++){let M=e.readFloat(),T=e.readFloat(),X=e.readFloat(),F=e.readFloat();switch(e.readByte()){case me:b.setStepped(C);break;case ge:z(e,b,S++,C,0,g,M,x,T,1),z(e,b,S++,C,1,g,M,v,X,1),z(e,b,S++,C,2,g,M,y,F,1)}g=M,x=T,v=X,y=F}r.push(b)}}}for(let l=0,a=e.readInt(!0);l<a;l++){const c=e.readInt(!0)-1;for(let d=0,f=e.readInt(!0);d<f;d++){const u=e.readByte(),m=e.readInt(!0);if(u==Kr){const w=new Ke(m,c);for(let b=0;b<m;b++)w.setFrame(b,e.readFloat());r.push(w);continue}const p=e.readInt(!0);switch(u){case Wr:r.push(Q(e,new Vt(m,p,c),1));break;case zr:r.push(Q(e,new Ot(m,p,c),1));break;case Gr:r.push(Q(e,new Nt(m,p,c),1));break;case Hr:r.push(Q(e,new Ut(m,p,c),1));break;case $r:r.push(Q(e,new qt(m,p,c),1));break;case jr:r.push(Q(e,new Wt(m,p,c),1));break;case Jr:r.push(Q(e,new zt(m,p,c),1))}}}for(let l=0,a=e.readInt(!0);l<a;l++){let c=s.skins[e.readInt(!0)];for(let d=0,f=e.readInt(!0);d<f;d++){let u=e.readInt(!0);for(let m=0,p=e.readInt(!0);m<p;m++){let w=e.readStringRef();if(!w)throw new Error("attachmentName must not be null.");let b=c.getAttachment(u,w),g=e.readByte(),x=e.readInt(!0),v=x-1;switch(g){case Vr:{let y=b,C=y.bones,S=y.vertices,A=C?S.length/3*2:S.length,M=e.readInt(!0),T=new Bt(x,M,u,y),X=e.readFloat();for(let F=0,I=0;;F++){let Y,E=e.readInt(!0);if(E==0)Y=C?B.newFloatArray(A):S;else{Y=B.newFloatArray(A);let U=e.readInt(!0);if(E+=U,n==1)for(let L=U;L<E;L++)Y[L]=e.readFloat();else for(let L=U;L<E;L++)Y[L]=e.readFloat()*n;if(!C)for(let L=0,H=Y.length;L<H;L++)Y[L]+=S[L]}if(T.setFrame(F,X,Y),F==v)break;let V=e.readFloat();switch(e.readByte()){case me:T.setStepped(F);break;case ge:z(e,T,I++,F,0,X,V,0,1,1)}X=V}r.push(T);break}case Or:{let y=new Ee(x,u,b);for(let C=0;C<x;C++){let S=e.readFloat(),A=e.readInt32();y.setFrame(C,S,Cs[A&15],A>>4,e.readFloat())}r.push(y);break}}}}}let h=e.readInt(!0);if(h>0){let l=new Me(h),a=s.slots.length;for(let c=0;c<h;c++){let d=e.readFloat(),f=e.readInt(!0),u=B.newArray(a,0);for(let b=a-1;b>=0;b--)u[b]=-1;let m=B.newArray(a-f,0),p=0,w=0;for(let b=0;b<f;b++){let g=e.readInt(!0);for(;p!=g;)m[w++]=p++;u[p+e.readInt(!0)]=p++}for(;p<a;)m[w++]=p++;for(let b=a-1;b>=0;b--)u[b]==-1&&(u[b]=m[--w]);l.setFrame(c,d,u)}r.push(l)}let o=e.readInt(!0);if(o>0){let l=new Oe(o);for(let a=0;a<o;a++){let c=e.readFloat(),d=s.events[e.readInt(!0)],f=new ss(c,d);f.intValue=e.readInt(!1),f.floatValue=e.readFloat(),f.stringValue=e.readString(),f.stringValue==null&&(f.stringValue=d.stringValue),f.data.audioPath&&(f.volume=e.readFloat(),f.balance=e.readFloat()),l.setFrame(a,f)}r.push(l)}let i=0;for(let l=0,a=r.length;l<a;l++)i=Math.max(i,r[l].getDuration());return new je(t,r,i)}},zs=class{constructor(e,t=new Array,s=0,r=new DataView(e instanceof ArrayBuffer?e:e.buffer)){this.strings=t,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),s=t&127;return t&128&&(t=this.readByte(),s|=(t&127)<<7,t&128&&(t=this.readByte(),s|=(t&127)<<14,t&128&&(t=this.readByte(),s|=(t&127)<<21,t&128&&(t=this.readByte(),s|=(t&127)<<28)))),e?s:s>>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",s=0;for(let r=0;r<e;){let n=this.readUnsignedByte();switch(n>>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),r+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),r+=3;break;default:t+=String.fromCharCode(n),r++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},yr=class{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,n){this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}},vr=class{constructor(e=null,t=null,s=0){this.bones=e,this.vertices=t,this.length=s}},Se=(e=>(e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping",e))(Se||{});function Q(e,t,s){let r=e.readFloat(),n=e.readFloat()*s;for(let h=0,o=0,i=t.getFrameCount()-1;t.setFrame(h,r,n),h!=i;h++){let l=e.readFloat(),a=e.readFloat()*s;switch(e.readByte()){case me:t.setStepped(h);break;case ge:z(e,t,o++,h,0,r,l,n,a,s)}r=l,n=a}return t}function cs(e,t,s){let r=e.readFloat(),n=e.readFloat()*s,h=e.readFloat()*s;for(let o=0,i=0,l=t.getFrameCount()-1;t.setFrame(o,r,n,h),o!=l;o++){let a=e.readFloat(),c=e.readFloat()*s,d=e.readFloat()*s;switch(e.readByte()){case me:t.setStepped(o);break;case ge:z(e,t,i++,o,0,r,a,n,c,s),z(e,t,i++,o,1,r,a,h,d,s)}r=a,n=c,h=d}return t}function z(e,t,s,r,n,h,o,i,l,a){t.setBezier(s,r,n,h,i,e.readFloat(),e.readFloat()*a,e.readFloat(),e.readFloat()*a,o,l)}var Cr=0,Sr=1,kr=2,Ar=3,Tr=4,Ir=5,Mr=6,Yr=7,Fr=8,Xr=9,Pr=10,Br=0,Er=1,Rr=2,Dr=3,Lr=4,_r=5,Vr=0,Or=1,Nr=0,Ur=1,qr=2,Wr=0,zr=1,Gr=2,Hr=4,$r=5,jr=6,Jr=7,Kr=8,me=1,ge=2,ds=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Be(()=>B.newFloatArray(16));update(e,t){if(!e)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,r=this.polygons,n=this.polygonPool,h=e.slots,o=h.length;s.length=0,n.freeAll(r),r.length=0;for(let i=0;i<o;i++){let l=h[i];if(!l.bone.active)continue;let a=l.getAttachment();if(a instanceof tt){let c=a;s.push(c);let d=n.obtain();d.length!=c.worldVerticesLength&&(d=B.newFloatArray(c.worldVerticesLength)),r.push(d),c.computeWorldVertices(l,0,c.worldVerticesLength,d,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,n=this.polygons;for(let h=0,o=n.length;h<o;h++){let i=n[h],l=i;for(let a=0,c=i.length;a<c;a+=2){let d=l[a],f=l[a+1];e=Math.min(e,d),t=Math.min(t,f),s=Math.max(s,d),r=Math.max(r,f)}}this.minX=e,this.minY=t,this.maxX=s,this.maxY=r}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,s,r){let n=this.minX,h=this.minY,o=this.maxX,i=this.maxY;if(e<=n&&s<=n||t<=h&&r<=h||e>=o&&s>=o||t>=i&&r>=i)return!1;let l=(r-t)/(s-e),a=l*(n-e)+t;if(a>h&&a<i||(a=l*(o-e)+t,a>h&&a<i))return!0;let c=(h-t)/l+e;return c>n&&c<o||(c=(i-t)/l+e,c>n&&c<o)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let s=this.polygons;for(let r=0,n=s.length;r<n;r++)if(this.containsPointPolygon(s[r],e,t))return this.boundingBoxes[r];return null}containsPointPolygon(e,t,s){let r=e,n=e.length,h=n-2,o=!1;for(let i=0;i<n;i+=2){let l=r[i+1],a=r[h+1];if(l<s&&a>=s||a<s&&l>=s){let c=r[i];c+(s-l)/(a-l)*(r[h]-c)<t&&(o=!o)}h=i}return o}intersectsSegment(e,t,s,r){let n=this.polygons;for(let h=0,o=n.length;h<o;h++)if(this.intersectsSegmentPolygon(n[h],e,t,s,r))return this.boundingBoxes[h];return null}intersectsSegmentPolygon(e,t,s,r,n){let h=e,o=e.length,i=t-r,l=s-n,a=t*n-s*r,c=h[o-2],d=h[o-1];for(let f=0;f<o;f+=2){let u=h[f],m=h[f+1],p=c*m-d*u,w=c-u,b=d-m,g=i*b-l*w,x=(a*w-i*p)/g;if((x>=c&&x<=u||x>=u&&x<=c)&&(x>=t&&x<=r||x>=r&&x<=t)){let v=(a*b-l*p)/g;if((v>=d&&v<=m||v>=m&&v<=d)&&(v>=s&&v<=n||v>=n&&v<=s))return!0}c=u,d=m}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ne=class{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Be(()=>new Array);polygonIndicesPool=new Be(()=>new Array);triangulate(e){let t=e,s=e.length>>1,r=this.indicesArray;r.length=0;for(let o=0;o<s;o++)r[o]=o;let n=this.isConcaveArray;n.length=0;for(let o=0,i=s;o<i;++o)n[o]=ne.isConcave(o,s,t,r);let h=this.triangles;for(h.length=0;s>3;){let o=s-1,i=0,l=1;for(;;){e:if(!n[i]){let d=r[o]<<1,f=r[i]<<1,u=r[l]<<1,m=t[d],p=t[d+1],w=t[f],b=t[f+1],g=t[u],x=t[u+1];for(let v=(l+1)%s;v!=o;v=(v+1)%s){if(!n[v])continue;let y=r[v]<<1,C=t[y],S=t[y+1];if(ne.positiveArea(g,x,m,p,C,S)&&ne.positiveArea(m,p,w,b,C,S)&&ne.positiveArea(w,b,g,x,C,S))break e}break}if(l==0){do{if(!n[i])break;i--}while(i>0);break}o=i,i=l,l=(l+1)%s}h.push(r[(s+i-1)%s]),h.push(r[i]),h.push(r[(i+1)%s]),r.splice(i,1),n.splice(i,1),s--;let a=(s+i-1)%s,c=i==s?0:i;n[a]=ne.isConcave(a,s,t,r),n[c]=ne.isConcave(c,s,t,r)}return s==3&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h}decompose(e,t){let s=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let h=this.polygonIndicesPool.obtain();h.length=0;let o=this.polygonPool.obtain();o.length=0;let i=-1,l=0;for(let a=0,c=t.length;a<c;a+=3){let d=t[a]<<1,f=t[a+1]<<1,u=t[a+2]<<1,m=s[d],p=s[d+1],w=s[f],b=s[f+1],g=s[u],x=s[u+1],v=!1;if(i==d){let y=o.length-4,C=ne.winding(o[y],o[y+1],o[y+2],o[y+3],g,x),S=ne.winding(g,x,o[0],o[1],o[2],o[3]);C==l&&S==l&&(o.push(g),o.push(x),h.push(u),v=!0)}v||(o.length>0?(r.push(o),n.push(h)):(this.polygonPool.free(o),this.polygonIndicesPool.free(h)),o=this.polygonPool.obtain(),o.length=0,o.push(m),o.push(p),o.push(w),o.push(b),o.push(g),o.push(x),h=this.polygonIndicesPool.obtain(),h.length=0,h.push(d),h.push(f),h.push(u),l=ne.winding(m,p,w,b,g,x),i=d)}o.length>0&&(r.push(o),n.push(h));for(let a=0,c=r.length;a<c;a++){if(h=n[a],h.length==0)continue;let d=h[0],f=h[h.length-1];o=r[a];let u=o.length-4,m=o[u],p=o[u+1],w=o[u+2],b=o[u+3],g=o[0],x=o[1],v=o[2],y=o[3],C=ne.winding(m,p,w,b,g,x);for(let S=0;S<c;S++){if(S==a)continue;let A=n[S];if(A.length!=3)continue;let M=A[0],T=A[1],X=A[2],F=r[S],I=F[F.length-2],Y=F[F.length-1];if(M!=d||T!=f)continue;let E=ne.winding(m,p,w,b,I,Y),V=ne.winding(I,Y,g,x,v,y);E==C&&V==C&&(F.length=0,A.length=0,o.push(I),o.push(Y),h.push(X),m=w,p=b,w=I,b=Y,S=0)}}for(let a=r.length-1;a>=0;a--)o=r[a],o.length==0&&(r.splice(a,1),this.polygonPool.free(o),h=n[a],n.splice(a,1),this.polygonIndicesPool.free(h));return r}static isConcave(e,t,s,r){let n=r[(t+e-1)%t]<<1,h=r[e]<<1,o=r[(e+1)%t]<<1;return!this.positiveArea(s[n],s[n+1],s[h],s[h+1],s[o],s[o+1])}static positiveArea(e,t,s,r,n,h){return e*(h-r)+s*(t-h)+n*(r-t)>=0}static winding(e,t,s,r,n,h){let o=s-e,i=r-t;return n*i-h*o+o*t-e*i>=0?1:-1}},lt=class{triangulator=new ne;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,r=B.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,r,0,2);let n=this.clippingPolygon;lt.makeClockwise(n);let h=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let o=0,i=h.length;o<i;o++){let l=h[o];lt.makeClockwise(l),l.push(l[0]),l.push(l[1])}return h.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(e,t,s,r,n,h,o,i){let l,a,c,d,f,u;typeof t=="number"?(l=s,a=r,c=n,d=h,f=o,u=i):(l=t,a=s,c=r,d=n,f=h,u=o),c&&d&&f&&typeof u=="boolean"?this.clipTrianglesRender(e,l,a,c,d,f,u):this.clipTrianglesNoRender(e,l,a)}clipTrianglesNoRender(e,t,s){let r=this.clipOutput,n=this.clippedVertices,h=this.clippedTriangles,o=this.clippingPolygons,i=o.length,l=0;n.length=0,h.length=0;for(let a=0;a<s;a+=3){let c=t[a]<<1,d=e[c],f=e[c+1];c=t[a+1]<<1;let u=e[c],m=e[c+1];c=t[a+2]<<1;let p=e[c],w=e[c+1];for(let b=0;b<i;b++){let g=n.length;if(this.clip(d,f,u,m,p,w,o[b],r)){let x=r.length;if(x==0)continue;let v=x>>1,y=this.clipOutput,C=B.setArraySize(n,g+v*2);for(let A=0;A<x;A+=2,g+=2){let M=y[A],T=y[A+1];C[g]=M,C[g+1]=T}g=h.length;let S=B.setArraySize(h,g+3*(v-2));v--;for(let A=1;A<v;A++,g+=3)S[g]=l,S[g+1]=l+A,S[g+2]=l+A+1;l+=v+1}else{let x=B.setArraySize(n,g+6);x[g]=d,x[g+1]=f,x[g+2]=u,x[g+3]=m,x[g+4]=p,x[g+5]=w,g=h.length;let v=B.setArraySize(h,g+3);v[g]=l,v[g+1]=l+1,v[g+2]=l+2,l+=3;break}}}}clipTrianglesRender(e,t,s,r,n,h,o){let i=this.clipOutput,l=this.clippedVertices,a=this.clippedTriangles,c=this.clippingPolygons,d=c.length,f=o?12:8,u=0;l.length=0,a.length=0;for(let m=0;m<s;m+=3){let p=t[m]<<1,w=e[p],b=e[p+1],g=r[p],x=r[p+1];p=t[m+1]<<1;let v=e[p],y=e[p+1],C=r[p],S=r[p+1];p=t[m+2]<<1;let A=e[p],M=e[p+1],T=r[p],X=r[p+1];for(let F=0;F<d;F++){let I=l.length;if(this.clip(w,b,v,y,A,M,c[F],i)){let Y=i.length;if(Y==0)continue;let E=y-M,V=A-v,U=w-A,L=M-b,H=1/(E*U+V*(b-M)),$=Y>>1,j=this.clipOutput,D=B.setArraySize(l,I+$*f);for(let W=0;W<Y;W+=2,I+=f){let he=j[W],ae=j[W+1];D[I]=he,D[I+1]=ae,D[I+2]=n.r,D[I+3]=n.g,D[I+4]=n.b,D[I+5]=n.a;let K=he-A,Z=ae-M,ee=(E*K+V*Z)*H,Ae=(L*K+U*Z)*H,ze=1-ee-Ae;D[I+6]=g*ee+C*Ae+T*ze,D[I+7]=x*ee+S*Ae+X*ze,o&&(D[I+8]=h.r,D[I+9]=h.g,D[I+10]=h.b,D[I+11]=h.a)}I=a.length;let q=B.setArraySize(a,I+3*($-2));$--;for(let W=1;W<$;W++,I+=3)q[I]=u,q[I+1]=u+W,q[I+2]=u+W+1;u+=$+1}else{let Y=B.setArraySize(l,I+3*f);Y[I]=w,Y[I+1]=b,Y[I+2]=n.r,Y[I+3]=n.g,Y[I+4]=n.b,Y[I+5]=n.a,o?(Y[I+6]=g,Y[I+7]=x,Y[I+8]=h.r,Y[I+9]=h.g,Y[I+10]=h.b,Y[I+11]=h.a,Y[I+12]=v,Y[I+13]=y,Y[I+14]=n.r,Y[I+15]=n.g,Y[I+16]=n.b,Y[I+17]=n.a,Y[I+18]=C,Y[I+19]=S,Y[I+20]=h.r,Y[I+21]=h.g,Y[I+22]=h.b,Y[I+23]=h.a,Y[I+24]=A,Y[I+25]=M,Y[I+26]=n.r,Y[I+27]=n.g,Y[I+28]=n.b,Y[I+29]=n.a,Y[I+30]=T,Y[I+31]=X,Y[I+32]=h.r,Y[I+33]=h.g,Y[I+34]=h.b,Y[I+35]=h.a):(Y[I+6]=g,Y[I+7]=x,Y[I+8]=v,Y[I+9]=y,Y[I+10]=n.r,Y[I+11]=n.g,Y[I+12]=n.b,Y[I+13]=n.a,Y[I+14]=C,Y[I+15]=S,Y[I+16]=A,Y[I+17]=M,Y[I+18]=n.r,Y[I+19]=n.g,Y[I+20]=n.b,Y[I+21]=n.a,Y[I+22]=T,Y[I+23]=X),I=a.length;let E=B.setArraySize(a,I+3);E[I]=u,E[I+1]=u+1,E[I+2]=u+2,u+=3;break}}}}clipTrianglesUnpacked(e,t,s,r){let n=this.clipOutput,h=this.clippedVertices,o=this.clippedUVs,i=this.clippedTriangles,l=this.clippingPolygons,a=l.length,c=0;h.length=0,o.length=0,i.length=0;for(let d=0;d<s;d+=3){let f=t[d]<<1,u=e[f],m=e[f+1],p=r[f],w=r[f+1];f=t[d+1]<<1;let b=e[f],g=e[f+1],x=r[f],v=r[f+1];f=t[d+2]<<1;let y=e[f],C=e[f+1],S=r[f],A=r[f+1];for(let M=0;M<a;M++){let T=h.length;if(this.clip(u,m,b,g,y,C,l[M],n)){let X=n.length;if(X==0)continue;let F=g-C,I=y-b,Y=u-y,E=C-m,V=1/(F*Y+I*(m-C)),U=X>>1,L=this.clipOutput,H=B.setArraySize(h,T+U*2),$=B.setArraySize(o,T+U*2);for(let D=0;D<X;D+=2,T+=2){let q=L[D],W=L[D+1];H[T]=q,H[T+1]=W;let he=q-y,ae=W-C,K=(F*he+I*ae)*V,Z=(E*he+Y*ae)*V,ee=1-K-Z;$[T]=p*K+x*Z+S*ee,$[T+1]=w*K+v*Z+A*ee}T=i.length;let j=B.setArraySize(i,T+3*(U-2));U--;for(let D=1;D<U;D++,T+=3)j[T]=c,j[T+1]=c+D,j[T+2]=c+D+1;c+=U+1}else{let X=B.setArraySize(h,T+6);X[T]=u,X[T+1]=m,X[T+2]=b,X[T+3]=g,X[T+4]=y,X[T+5]=C;let F=B.setArraySize(o,T+3*2);F[T]=p,F[T+1]=w,F[T+2]=x,F[T+3]=v,F[T+4]=S,F[T+5]=A,T=i.length;let I=B.setArraySize(i,T+3);I[T]=c,I[T+1]=c+1,I[T+2]=c+2,c+=3;break}}}}clip(e,t,s,r,n,h,o,i){let l=i,a=!1,c;o.length%4>=2?(c=i,i=this.scratch):c=this.scratch,c.length=0,c.push(e),c.push(t),c.push(s),c.push(r),c.push(n),c.push(h),c.push(e),c.push(t),i.length=0;let d=o.length-4,f=o;for(let u=0;;u+=2){let m=f[u],p=f[u+1],w=m-f[u+2],b=p-f[u+3],g=i.length,x=c;for(let y=0,C=c.length-2;y<C;){let S=x[y],A=x[y+1];y+=2;let M=x[y],T=x[y+1],X=b*(m-M)>w*(p-T),F=b*(m-S)-w*(p-A);if(F>0){if(X){i.push(M),i.push(T);continue}let I=M-S,Y=T-A,E=F/(I*b-Y*w);if(E>=0&&E<=1)i.push(S+I*E),i.push(A+Y*E);else{i.push(M),i.push(T);continue}}else if(X){let I=M-S,Y=T-A,E=F/(I*b-Y*w);if(E>=0&&E<=1)i.push(S+I*E),i.push(A+Y*E),i.push(M),i.push(T);else{i.push(M),i.push(T);continue}}a=!0}if(g==i.length)return l.length=0,!0;if(i.push(i[0]),i.push(i[1]),u==d)break;let v=i;i=c,i.length=0,c=v}if(l!=i){l.length=0;for(let u=0,m=i.length-2;u<m;u++)l[u]=i[u]}else l.length=l.length-2;return a}static makeClockwise(e){let t=e,s=e.length,r=t[s-2]*t[1]-t[0]*t[s-1],n=0,h=0,o=0,i=0;for(let l=0,a=s-3;l<a;l+=2)n=t[l],h=t[l+1],o=t[l+2],i=t[l+3],r+=n*i-o*h;if(!(r<0))for(let l=0,a=s-2,c=s>>1;l<c;l+=2){let d=t[l],f=t[l+1],u=a-l;t[l]=t[u],t[l+1]=t[u+1],t[u]=d,t[u+1]=f}}},Gs=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new qe,r=typeof e=="string"?JSON.parse(e):e,n=r.skeleton;if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=k(n,"referenceScale",100)*t,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),r.bones)for(let h=0;h<r.bones.length;h++){let o=r.bones[h],i=null,l=k(o,"parent",null);l&&(i=s.findBone(l));let a=new es(s.bones.length,o.name,i);a.length=k(o,"length",0)*t,a.x=k(o,"x",0)*t,a.y=k(o,"y",0)*t,a.rotation=k(o,"rotation",0),a.scaleX=k(o,"scaleX",1),a.scaleY=k(o,"scaleY",1),a.shearX=k(o,"shearX",0),a.shearY=k(o,"shearY",0),a.inherit=B.enumValue(Ne,k(o,"inherit","Normal")),a.skinRequired=k(o,"skin",!1);let c=k(o,"color",null);c&&a.color.setFromString(c),s.bones.push(a)}if(r.slots)for(let h=0;h<r.slots.length;h++){let o=r.slots[h],i=o.name,l=s.findBone(o.bone);if(!l)throw new Error(`Couldn't find bone ${o.bone} for slot ${i}`);let a=new ls(s.slots.length,i,l),c=k(o,"color",null);c&&a.color.setFromString(c);let d=k(o,"dark",null);d&&(a.darkColor=_.fromString(d)),a.attachmentName=k(o,"attachment",null),a.blendMode=B.enumValue(ot,k(o,"blend","normal")),a.visible=k(o,"visible",!0),s.slots.push(a)}if(r.ik)for(let h=0;h<r.ik.length;h++){let o=r.ik[h],i=new is(o.name);i.order=k(o,"order",0),i.skinRequired=k(o,"skin",!1);for(let a=0;a<o.bones.length;a++){let c=s.findBone(o.bones[a]);if(!c)throw new Error(`Couldn't find bone ${o.bones[a]} for IK constraint ${o.name}.`);i.bones.push(c)}let l=s.findBone(o.target);if(!l)throw new Error(`Couldn't find target bone ${o.target} for IK constraint ${o.name}.`);i.target=l,i.mix=k(o,"mix",1),i.softness=k(o,"softness",0)*t,i.bendDirection=k(o,"bendPositive",!0)?1:-1,i.compress=k(o,"compress",!1),i.stretch=k(o,"stretch",!1),i.uniform=k(o,"uniform",!1),s.ikConstraints.push(i)}if(r.transform)for(let h=0;h<r.transform.length;h++){let o=r.transform[h],i=new hs(o.name);i.order=k(o,"order",0),i.skinRequired=k(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let d=o.bones[c],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for transform constraint ${o.name}.`);i.bones.push(f)}let l=o.target,a=s.findBone(l);if(!a)throw new Error(`Couldn't find target bone ${l} for transform constraint ${o.name}.`);i.target=a,i.local=k(o,"local",!1),i.relative=k(o,"relative",!1),i.offsetRotation=k(o,"rotation",0),i.offsetX=k(o,"x",0)*t,i.offsetY=k(o,"y",0)*t,i.offsetScaleX=k(o,"scaleX",0),i.offsetScaleY=k(o,"scaleY",0),i.offsetShearY=k(o,"shearY",0),i.mixRotate=k(o,"mixRotate",1),i.mixX=k(o,"mixX",1),i.mixY=k(o,"mixY",i.mixX),i.mixScaleX=k(o,"mixScaleX",1),i.mixScaleY=k(o,"mixScaleY",i.mixScaleX),i.mixShearY=k(o,"mixShearY",1),s.transformConstraints.push(i)}if(r.path)for(let h=0;h<r.path.length;h++){let o=r.path[h],i=new ns(o.name);i.order=k(o,"order",0),i.skinRequired=k(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let d=o.bones[c],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for path constraint ${o.name}.`);i.bones.push(f)}let l=o.target,a=s.findSlot(l);if(!a)throw new Error(`Couldn't find target slot ${l} for path constraint ${o.name}.`);i.target=a,i.positionMode=B.enumValue(rt,k(o,"positionMode","Percent")),i.spacingMode=B.enumValue(it,k(o,"spacingMode","Length")),i.rotateMode=B.enumValue(nt,k(o,"rotateMode","Tangent")),i.offsetRotation=k(o,"rotation",0),i.position=k(o,"position",0),i.positionMode==0&&(i.position*=t),i.spacing=k(o,"spacing",0),(i.spacingMode==0||i.spacingMode==1)&&(i.spacing*=t),i.mixRotate=k(o,"mixRotate",1),i.mixX=k(o,"mixX",1),i.mixY=k(o,"mixY",i.mixX),s.pathConstraints.push(i)}if(r.physics)for(let h=0;h<r.physics.length;h++){const o=r.physics[h],i=new qs(o.name);i.order=k(o,"order",0),i.skinRequired=k(o,"skin",!1);const l=o.bone,a=s.findBone(l);if(a==null)throw new Error("Physics bone not found: "+l);i.bone=a,i.x=k(o,"x",0),i.y=k(o,"y",0),i.rotate=k(o,"rotate",0),i.scaleX=k(o,"scaleX",0),i.shearX=k(o,"shearX",0),i.limit=k(o,"limit",5e3)*t,i.step=1/k(o,"fps",60),i.inertia=k(o,"inertia",1),i.strength=k(o,"strength",100),i.damping=k(o,"damping",1),i.massInverse=1/k(o,"mass",1),i.wind=k(o,"wind",0),i.gravity=k(o,"gravity",0),i.mix=k(o,"mix",1),i.inertiaGlobal=k(o,"inertiaGlobal",!1),i.strengthGlobal=k(o,"strengthGlobal",!1),i.dampingGlobal=k(o,"dampingGlobal",!1),i.massGlobal=k(o,"massGlobal",!1),i.windGlobal=k(o,"windGlobal",!1),i.gravityGlobal=k(o,"gravityGlobal",!1),i.mixGlobal=k(o,"mixGlobal",!1),s.physicsConstraints.push(i)}if(r.skins)for(let h=0;h<r.skins.length;h++){let o=r.skins[h],i=new at(o.name);if(o.bones)for(let l=0;l<o.bones.length;l++){let a=o.bones[l],c=s.findBone(a);if(!c)throw new Error(`Couldn't find bone ${a} for skin ${o.name}.`);i.bones.push(c)}if(o.ik)for(let l=0;l<o.ik.length;l++){let a=o.ik[l],c=s.findIkConstraint(a);if(!c)throw new Error(`Couldn't find IK constraint ${a} for skin ${o.name}.`);i.constraints.push(c)}if(o.transform)for(let l=0;l<o.transform.length;l++){let a=o.transform[l],c=s.findTransformConstraint(a);if(!c)throw new Error(`Couldn't find transform constraint ${a} for skin ${o.name}.`);i.constraints.push(c)}if(o.path)for(let l=0;l<o.path.length;l++){let a=o.path[l],c=s.findPathConstraint(a);if(!c)throw new Error(`Couldn't find path constraint ${a} for skin ${o.name}.`);i.constraints.push(c)}if(o.physics)for(let l=0;l<o.physics.length;l++){let a=o.physics[l],c=s.findPhysicsConstraint(a);if(!c)throw new Error(`Couldn't find physics constraint ${a} for skin ${o.name}.`);i.constraints.push(c)}for(let l in o.attachments){let a=s.findSlot(l);if(!a)throw new Error(`Couldn't find slot ${l} for skin ${o.name}.`);let c=o.attachments[l];for(let d in c){let f=this.readAttachment(c[d],i,a.index,d,s);f&&i.setAttachment(a.index,d,f)}}s.skins.push(i),i.name=="default"&&(s.defaultSkin=i)}for(let h=0,o=this.linkedMeshes.length;h<o;h++){let i=this.linkedMeshes[h],l=i.skin?s.findSkin(i.skin):s.defaultSkin;if(!l)throw new Error(`Skin not found: ${i.skin}`);let a=l.getAttachment(i.slotIndex,i.parent);if(!a)throw new Error(`Parent mesh not found: ${i.parent}`);i.mesh.timelineAttachment=i.inheritTimeline?a:i.mesh,i.mesh.setParentMesh(a),i.mesh.region!=null&&i.mesh.updateRegion()}if(this.linkedMeshes.length=0,r.events)for(let h in r.events){let o=r.events[h],i=new rs(h);i.intValue=k(o,"int",0),i.floatValue=k(o,"float",0),i.stringValue=k(o,"string",""),i.audioPath=k(o,"audio",null),i.audioPath&&(i.volume=k(o,"volume",1),i.balance=k(o,"balance",0)),s.events.push(i)}if(r.animations)for(let h in r.animations){let o=r.animations[h];this.readAnimation(o,h,s)}return s}readAttachment(e,t,s,r,n){let h=this.scale;switch(r=k(e,"name",r),k(e,"type","region")){case"region":{let o=k(e,"path",r),i=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(t,r,o,i);if(!l)return null;l.path=o,l.x=k(e,"x",0)*h,l.y=k(e,"y",0)*h,l.scaleX=k(e,"scaleX",1),l.scaleY=k(e,"scaleY",1),l.rotation=k(e,"rotation",0),l.width=e.width*h,l.height=e.height*h,l.sequence=i;let a=k(e,"color",null);return a&&l.color.setFromString(a),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let o=this.attachmentLoader.newBoundingBoxAttachment(t,r);if(!o)return null;this.readVertices(e,o,e.vertexCount<<1);let i=k(e,"color",null);return i&&o.color.setFromString(i),o}case"mesh":case"linkedmesh":{let o=k(e,"path",r),i=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(t,r,o,i);if(!l)return null;l.path=o;let a=k(e,"color",null);a&&l.color.setFromString(a),l.width=k(e,"width",0)*h,l.height=k(e,"height",0)*h,l.sequence=i;let c=k(e,"parent",null);if(c)return this.linkedMeshes.push(new Qr(l,k(e,"skin",null),s,c,k(e,"timelines",!0))),l;let d=e.uvs;return this.readVertices(e,l,d.length),l.triangles=e.triangles,l.regionUVs=d,l.region!=null&&l.updateRegion(),l.edges=k(e,"edges",null),l.hullLength=k(e,"hull",0)*2,l}case"path":{let o=this.attachmentLoader.newPathAttachment(t,r);if(!o)return null;o.closed=k(e,"closed",!1),o.constantSpeed=k(e,"constantSpeed",!0);let i=e.vertexCount;this.readVertices(e,o,i<<1);let l=B.newArray(i/3,0);for(let c=0;c<e.lengths.length;c++)l[c]=e.lengths[c]*h;o.lengths=l;let a=k(e,"color",null);return a&&o.color.setFromString(a),o}case"point":{let o=this.attachmentLoader.newPointAttachment(t,r);if(!o)return null;o.x=k(e,"x",0)*h,o.y=k(e,"y",0)*h,o.rotation=k(e,"rotation",0);let i=k(e,"color",null);return i&&o.color.setFromString(i),o}case"clipping":{let o=this.attachmentLoader.newClippingAttachment(t,r);if(!o)return null;let i=k(e,"end",null);i&&(o.endSlot=n.findSlot(i));let l=e.vertexCount;this.readVertices(e,o,l<<1);let a=k(e,"color",null);return a&&o.color.setFromString(a),o}}return null}readSequence(e){if(e==null)return null;let t=new xt(k(e,"count",0));return t.start=k(e,"start",1),t.digits=k(e,"digits",0),t.setupIndex=k(e,"setup",0),t}readVertices(e,t,s){let r=this.scale;t.worldVerticesLength=s;let n=e.vertices;if(s==n.length){let i=B.toFloatArray(n);if(r!=1)for(let l=0,a=n.length;l<a;l++)i[l]*=r;t.vertices=i;return}let h=new Array,o=new Array;for(let i=0,l=n.length;i<l;){let a=n[i++];o.push(a);for(let c=i+a*4;i<c;i+=4)o.push(n[i]),h.push(n[i+1]*r),h.push(n[i+2]*r),h.push(n[i+3])}t.bones=o,t.vertices=B.toFloatArray(h)}readAnimation(e,t,s){let r=this.scale,n=new Array;if(e.slots)for(let o in e.slots){let i=e.slots[o],l=s.findSlot(o);if(!l)throw new Error("Slot not found: "+o);let a=l.index;for(let c in i){let d=i[c];if(!d)continue;let f=d.length;if(c=="attachment"){let u=new Ie(f,a);for(let m=0;m<f;m++){let p=d[m];u.setFrame(m,k(p,"time",0),k(p,"name",null))}n.push(u)}else if(c=="rgba"){let u=new Mt(f,f<<2,a),m=d[0],p=k(m,"time",0),w=_.fromString(m.color);for(let b=0,g=0;;b++){u.setFrame(b,p,w.r,w.g,w.b,w.a);let x=d[b+1];if(!x){u.shrink(g);break}let v=k(x,"time",0),y=_.fromString(x.color),C=m.curve;C&&(g=G(C,u,g,b,0,p,v,w.r,y.r,1),g=G(C,u,g,b,1,p,v,w.g,y.g,1),g=G(C,u,g,b,2,p,v,w.b,y.b,1),g=G(C,u,g,b,3,p,v,w.a,y.a,1)),p=v,w=y,m=x}n.push(u)}else if(c=="rgb"){let u=new Yt(f,f*3,a),m=d[0],p=k(m,"time",0),w=_.fromString(m.color);for(let b=0,g=0;;b++){u.setFrame(b,p,w.r,w.g,w.b);let x=d[b+1];if(!x){u.shrink(g);break}let v=k(x,"time",0),y=_.fromString(x.color),C=m.curve;C&&(g=G(C,u,g,b,0,p,v,w.r,y.r,1),g=G(C,u,g,b,1,p,v,w.g,y.g,1),g=G(C,u,g,b,2,p,v,w.b,y.b,1)),p=v,w=y,m=x}n.push(u)}else if(c=="alpha")n.push(ue(d,new Ft(f,f,a),0,1));else if(c=="rgba2"){let u=new Xt(f,f*7,a),m=d[0],p=k(m,"time",0),w=_.fromString(m.light),b=_.fromString(m.dark);for(let g=0,x=0;;g++){u.setFrame(g,p,w.r,w.g,w.b,w.a,b.r,b.g,b.b);let v=d[g+1];if(!v){u.shrink(x);break}let y=k(v,"time",0),C=_.fromString(v.light),S=_.fromString(v.dark),A=m.curve;A&&(x=G(A,u,x,g,0,p,y,w.r,C.r,1),x=G(A,u,x,g,1,p,y,w.g,C.g,1),x=G(A,u,x,g,2,p,y,w.b,C.b,1),x=G(A,u,x,g,3,p,y,w.a,C.a,1),x=G(A,u,x,g,4,p,y,b.r,S.r,1),x=G(A,u,x,g,5,p,y,b.g,S.g,1),x=G(A,u,x,g,6,p,y,b.b,S.b,1)),p=y,w=C,b=S,m=v}n.push(u)}else if(c=="rgb2"){let u=new Pt(f,f*6,a),m=d[0],p=k(m,"time",0),w=_.fromString(m.light),b=_.fromString(m.dark);for(let g=0,x=0;;g++){u.setFrame(g,p,w.r,w.g,w.b,b.r,b.g,b.b);let v=d[g+1];if(!v){u.shrink(x);break}let y=k(v,"time",0),C=_.fromString(v.light),S=_.fromString(v.dark),A=m.curve;A&&(x=G(A,u,x,g,0,p,y,w.r,C.r,1),x=G(A,u,x,g,1,p,y,w.g,C.g,1),x=G(A,u,x,g,2,p,y,w.b,C.b,1),x=G(A,u,x,g,3,p,y,b.r,S.r,1),x=G(A,u,x,g,4,p,y,b.g,S.g,1),x=G(A,u,x,g,5,p,y,b.b,S.b,1)),p=y,w=C,b=S,m=v}n.push(u)}}}if(e.bones)for(let o in e.bones){let i=e.bones[o],l=s.findBone(o);if(!l)throw new Error("Bone not found: "+o);let a=l.index;for(let c in i){let d=i[c],f=d.length;if(f!=0){if(c==="rotate")n.push(ue(d,new Ve(f,f,a),0,1));else if(c==="translate"){let u=new bt(f,f<<1,a);n.push(fs(d,u,"x","y",0,r))}else if(c==="translatex"){let u=new wt(f,f,a);n.push(ue(d,u,0,r))}else if(c==="translatey"){let u=new yt(f,f,a);n.push(ue(d,u,0,r))}else if(c==="scale"){let u=new vt(f,f<<1,a);n.push(fs(d,u,"x","y",1,1))}else if(c==="scalex"){let u=new Ct(f,f,a);n.push(ue(d,u,1,1))}else if(c==="scaley"){let u=new St(f,f,a);n.push(ue(d,u,1,1))}else if(c==="shear"){let u=new kt(f,f<<1,a);n.push(fs(d,u,"x","y",0,1))}else if(c==="shearx"){let u=new At(f,f,a);n.push(ue(d,u,0,1))}else if(c==="sheary"){let u=new Tt(f,f,a);n.push(ue(d,u,0,1))}else if(c==="inherit"){let u=new It(f,l.index);for(let m=0;m<d.length;m++){let p=d[m];u.setFrame(m,k(p,"time",0),B.enumValue(Ne,k(p,"inherit","Normal")))}n.push(u)}}}}if(e.ik)for(let o in e.ik){let i=e.ik[o],l=i[0];if(!l)continue;let a=s.findIkConstraint(o);if(!a)throw new Error("IK Constraint not found: "+o);let c=s.ikConstraints.indexOf(a),d=new Et(i.length,i.length<<1,c),f=k(l,"time",0),u=k(l,"mix",1),m=k(l,"softness",0)*r;for(let p=0,w=0;;p++){d.setFrame(p,f,u,m,k(l,"bendPositive",!0)?1:-1,k(l,"compress",!1),k(l,"stretch",!1));let b=i[p+1];if(!b){d.shrink(w);break}let g=k(b,"time",0),x=k(b,"mix",1),v=k(b,"softness",0)*r,y=l.curve;y&&(w=G(y,d,w,p,0,f,g,u,x,1),w=G(y,d,w,p,1,f,g,m,v,r)),f=g,u=x,m=v,l=b}n.push(d)}if(e.transform)for(let o in e.transform){let i=e.transform[o],l=i[0];if(!l)continue;let a=s.findTransformConstraint(o);if(!a)throw new Error("Transform constraint not found: "+o);let c=s.transformConstraints.indexOf(a),d=new Rt(i.length,i.length*6,c),f=k(l,"time",0),u=k(l,"mixRotate",1),m=k(l,"mixX",1),p=k(l,"mixY",m),w=k(l,"mixScaleX",1),b=k(l,"mixScaleY",w),g=k(l,"mixShearY",1);for(let x=0,v=0;;x++){d.setFrame(x,f,u,m,p,w,b,g);let y=i[x+1];if(!y){d.shrink(v);break}let C=k(y,"time",0),S=k(y,"mixRotate",1),A=k(y,"mixX",1),M=k(y,"mixY",A),T=k(y,"mixScaleX",1),X=k(y,"mixScaleY",T),F=k(y,"mixShearY",1),I=l.curve;I&&(v=G(I,d,v,x,0,f,C,u,S,1),v=G(I,d,v,x,1,f,C,m,A,1),v=G(I,d,v,x,2,f,C,p,M,1),v=G(I,d,v,x,3,f,C,w,T,1),v=G(I,d,v,x,4,f,C,b,X,1),v=G(I,d,v,x,5,f,C,g,F,1)),f=C,u=S,m=A,p=M,w=T,b=X,w=T,l=y}n.push(d)}if(e.path)for(let o in e.path){let i=e.path[o],l=s.findPathConstraint(o);if(!l)throw new Error("Path constraint not found: "+o);let a=s.pathConstraints.indexOf(l);for(let c in i){let d=i[c],f=d[0];if(!f)continue;let u=d.length;if(c==="position"){let m=new Dt(u,u,a);n.push(ue(d,m,0,l.positionMode==0?r:1))}else if(c==="spacing"){let m=new Lt(u,u,a);n.push(ue(d,m,0,l.spacingMode==0||l.spacingMode==1?r:1))}else if(c==="mix"){let m=new _t(u,u*3,a),p=k(f,"time",0),w=k(f,"mixRotate",1),b=k(f,"mixX",1),g=k(f,"mixY",b);for(let x=0,v=0;;x++){m.setFrame(x,p,w,b,g);let y=d[x+1];if(!y){m.shrink(v);break}let C=k(y,"time",0),S=k(y,"mixRotate",1),A=k(y,"mixX",1),M=k(y,"mixY",A),T=f.curve;T&&(v=G(T,m,v,x,0,p,C,w,S,1),v=G(T,m,v,x,1,p,C,b,A,1),v=G(T,m,v,x,2,p,C,g,M,1)),p=C,w=S,b=A,g=M,f=y}n.push(m)}}}if(e.physics)for(let o in e.physics){let i=e.physics[o],l=-1;if(o.length>0){let a=s.findPhysicsConstraint(o);if(!a)throw new Error("Physics constraint not found: "+o);l=s.physicsConstraints.indexOf(a)}for(let a in i){let c=i[a],d=c[0];if(!d)continue;let f=c.length;if(a=="reset"){const m=new Ke(f,l);for(let p=0;d!=null;d=c[p+1],p++)m.setFrame(p,k(d,"time",0));n.push(m);continue}let u;if(a=="inertia")u=new Vt(f,f,l);else if(a=="strength")u=new Ot(f,f,l);else if(a=="damping")u=new Nt(f,f,l);else if(a=="mass")u=new Ut(f,f,l);else if(a=="wind")u=new qt(f,f,l);else if(a=="gravity")u=new Wt(f,f,l);else if(a=="mix")u=new zt(f,f,l);else continue;n.push(ue(c,u,0,1))}}if(e.attachments)for(let o in e.attachments){let i=e.attachments[o],l=s.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let a in i){let c=i[a],d=s.findSlot(a);if(!d)throw new Error("Slot not found: "+a);let f=d.index;for(let u in c){let m=c[u],p=l.getAttachment(f,u);for(let w in m){let b=m[w],g=b[0];if(g){if(w=="deform"){let x=p.bones,v=p.vertices,y=x?v.length/3*2:v.length,C=new Bt(b.length,b.length,f,p),S=k(g,"time",0);for(let A=0,M=0;;A++){let T,X=k(g,"vertices",null);if(!X)T=x?B.newFloatArray(y):v;else{T=B.newFloatArray(y);let E=k(g,"offset",0);if(B.arrayCopy(X,0,T,E,X.length),r!=1)for(let V=E,U=V+X.length;V<U;V++)T[V]*=r;if(!x)for(let V=0;V<y;V++)T[V]+=v[V]}C.setFrame(A,S,T);let F=b[A+1];if(!F){C.shrink(M);break}let I=k(F,"time",0),Y=g.curve;Y&&(M=G(Y,C,M,A,0,S,I,0,1,1)),S=I,g=F}n.push(C)}else if(w=="sequence"){let x=new Ee(b.length,f,p),v=0;for(let y=0;y<b.length;y++){let C=k(g,"delay",v),S=k(g,"time",0),A=vs[k(g,"mode","hold")],M=k(g,"index",0);x.setFrame(y,S,A,M,C),v=C,g=b[y+1]}n.push(x)}}}}}}if(e.drawOrder){let o=new Me(e.drawOrder.length),i=s.slots.length,l=0;for(let a=0;a<e.drawOrder.length;a++,l++){let c=e.drawOrder[a],d=null,f=k(c,"offsets",null);if(f){d=B.newArray(i,-1);let u=B.newArray(i-f.length,0),m=0,p=0;for(let w=0;w<f.length;w++){let b=f[w],g=s.findSlot(b.slot);if(!g)throw new Error("Slot not found: "+g);let x=g.index;for(;m!=x;)u[p++]=m++;d[m+b.offset]=m++}for(;m<i;)u[p++]=m++;for(let w=i-1;w>=0;w--)d[w]==-1&&(d[w]=u[--p])}o.setFrame(l,k(c,"time",0),d)}n.push(o)}if(e.events){let o=new Oe(e.events.length),i=0;for(let l=0;l<e.events.length;l++,i++){let a=e.events[l],c=s.findEvent(a.name);if(!c)throw new Error("Event not found: "+a.name);let d=new ss(B.toSinglePrecision(k(a,"time",0)),c);d.intValue=k(a,"int",c.intValue),d.floatValue=k(a,"float",c.floatValue),d.stringValue=k(a,"string",c.stringValue),d.data.audioPath&&(d.volume=k(a,"volume",1),d.balance=k(a,"balance",0)),o.setFrame(i,d)}n.push(o)}let h=0;for(let o=0,i=n.length;o<i;o++)h=Math.max(h,n[o].getDuration());s.animations.push(new je(t,n,h))}},Qr=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,n){this.mesh=e,this.skin=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}};function ue(e,t,s,r){let n=e[0],h=k(n,"time",0),o=k(n,"value",s)*r,i=0;for(let l=0;;l++){t.setFrame(l,h,o);let a=e[l+1];if(!a)return t.shrink(i),t;let c=k(a,"time",0),d=k(a,"value",s)*r;n.curve&&(i=G(n.curve,t,i,l,0,h,c,o,d,r)),h=c,o=d,n=a}}function fs(e,t,s,r,n,h){let o=e[0],i=k(o,"time",0),l=k(o,s,n)*h,a=k(o,r,n)*h,c=0;for(let d=0;;d++){t.setFrame(d,i,l,a);let f=e[d+1];if(!f)return t.shrink(c),t;let u=k(f,"time",0),m=k(f,s,n)*h,p=k(f,r,n)*h,w=o.curve;w&&(c=G(w,t,c,d,0,i,u,l,m,h),c=G(w,t,c,d,1,i,u,a,p,h)),i=u,l=m,a=p,o=f}}function G(e,t,s,r,n,h,o,i,l,a){if(e=="stepped")return t.setStepped(r),s;let c=n<<2,d=e[c],f=e[c+1]*a,u=e[c+2],m=e[c+3]*a;return t.setBezier(s,r,n,h,i,d,f,u,m,o,l),s+1}function k(e,t,s){return e[t]!==void 0?e[t]:s}typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)));var be=class extends Jt{static from(e){return be.textureMap.has(e)?be.textureMap.get(e):new be(e)}texture;constructor(e){super(e.resource),this.texture=hr.Texture.from(e)}setFilters(e,t){const s=this.texture.source.style;s.minFilter=be.toPixiTextureFilter(e),s.magFilter=be.toPixiTextureFilter(t),this.texture.source.autoGenerateMipmaps=be.toPixiMipMap(e),this.texture.source.updateMipmaps()}setWraps(e,t){const s=this.texture.source.style;s.addressModeU=be.toPixiTextureWrap(e),s.addressModeV=be.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiMipMap(e){switch(e){case 9728:case 9729:return!1;case 9986:case 9984:case 9987:case 9985:return!0;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureFilter(e){switch(e){case 9728:case 9986:case 9984:return"nearest";case 9729:case 9987:case 9985:return"linear";default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case 33071:return"clamp-to-edge";case 33648:return"mirror-repeat";case 10497:return"repeat";default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case 0:return"normal";case 1:return"add";case 2:return"multiply";case 3:return"screen";default:throw new Error(`Unknown blendMode: ${String(e)}`)}}},ht=be;R(ht,"textureMap",new Map);var Zr={extension:te.ExtensionType.Asset,resolver:{test:e=>(0,te.checkExtension)(e,".atlas"),parse:e=>{const t=e.split(".");return{resolution:parseFloat(te.Resolver.RETINA_PREFIX?.exec(e)?.[1]??"1"),format:t[t.length-2],src:e}}},loader:{extension:{type:te.ExtensionType.LoadParser,priority:te.LoaderParserPriority.Normal,name:"spineTextureAtlasLoader"},test(e){return(0,te.checkExtension)(e,".atlas")},async load(e){return await(await te.DOMAdapter.get().fetch(e)).text()},testParse(e,t){const s=(0,te.checkExtension)(t.src,".atlas"),r=typeof e=="string";return Promise.resolve(s&&r)},unload(e){e.dispose()},async parse(e,t,s){const r=t.data||{};let n=te.path.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const h=new Kt(e);if(r.images instanceof te.TextureSource||typeof r.images=="string"){const i=r.images;r.images={},r.images[h.pages[0].name]=i}const o=[];for(const i of h.pages){const l=i.name,a=r?.images?r.images[l]:void 0;if(a instanceof te.TextureSource)i.setTexture(ht.from(a));else{const d={src:a??te.path.normalize([...n.split(te.path.sep),l].join(te.path.sep)),data:{...r.imageMetadata,alphaMode:i.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"}},f=s.load(d).then(u=>{i.setTexture(ht.from(u.source))});o.push(f)}}return await Promise.all(o),h}}};te.extensions.add(Zr);var ke=xe("pixi.js");function ei(e){return Object.prototype.hasOwnProperty.call(e,"bones")}function ti(e){return e instanceof Uint8Array}var si={extension:ke.ExtensionType.Asset,loader:{extension:{type:ke.ExtensionType.LoadParser,priority:ke.LoaderParserPriority.Normal,name:"spineSkeletonLoader"},test(e){return(0,ke.checkExtension)(e,".skel")},async load(e){const t=await ke.DOMAdapter.get().fetch(e);return new Uint8Array(await t.arrayBuffer())},testParse(e,t){const s=(0,ke.checkExtension)(t.src,".json")&&ei(e),r=(0,ke.checkExtension)(t.src,".skel")&&ti(e);return Promise.resolve(s||r)}}};ke.extensions.add(si);var ct=xe("pixi.js"),Xe=xe("pixi.js"),ri=new Float32Array(1),ii=new Uint32Array(1),ni=class extends Xe.Geometry{constructor(){const t=new Xe.Buffer({data:ri,label:"attribute-batch-buffer",usage:Xe.BufferUsage.VERTEX|Xe.BufferUsage.COPY_DST,shrinkToFit:!1}),s=new Xe.Buffer({data:ii,label:"index-batch-buffer",usage:Xe.BufferUsage.INDEX|Xe.BufferUsage.COPY_DST,shrinkToFit:!1}),r=7*4;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:r,offset:0},aUV:{buffer:t,format:"float32x2",stride:r,offset:2*4},aColor:{buffer:t,format:"unorm8x4",stride:r,offset:4*4},aDarkColor:{buffer:t,format:"unorm8x4",stride:r,offset:5*4},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:r,offset:6*4}},indexBuffer:s})}},pe=xe("pixi.js"),ai={name:"color-bit",vertex:{header:`
|
|
3
|
+
@in aDarkColor: vec4<f32>;
|
|
4
|
+
@out vDarkColor: vec4<f32>;
|
|
5
|
+
`,main:`
|
|
6
|
+
vDarkColor = aDarkColor;
|
|
7
|
+
`},fragment:{header:`
|
|
8
|
+
@in vDarkColor: vec4<f32>;
|
|
9
|
+
`,end:`
|
|
10
|
+
|
|
11
|
+
let alpha = outColor.a * vColor.a;
|
|
12
|
+
let rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;
|
|
13
|
+
|
|
14
|
+
finalColor = vec4<f32>(rgb, alpha);
|
|
15
|
+
|
|
16
|
+
`}},oi={name:"color-bit",vertex:{header:`
|
|
17
|
+
in vec4 aDarkColor;
|
|
18
|
+
out vec4 vDarkColor;
|
|
19
|
+
`,main:`
|
|
20
|
+
vDarkColor = aDarkColor;
|
|
21
|
+
`},fragment:{header:`
|
|
22
|
+
in vec4 vDarkColor;
|
|
23
|
+
`,end:`
|
|
24
|
+
|
|
25
|
+
finalColor.a = outColor.a * vColor.a;
|
|
26
|
+
finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;
|
|
27
|
+
`}},li=class extends pe.Shader{constructor(e){const t=(0,pe.compileHighShaderGlProgram)({name:"dark-tint-batch",bits:[pe.colorBitGl,oi,(0,pe.generateTextureBatchBitGl)(e),pe.roundPixelsBitGl]}),s=(0,pe.compileHighShaderGpuProgram)({name:"dark-tint-batch",bits:[pe.colorBit,ai,(0,pe.generateTextureBatchBit)(e),pe.roundPixelsBit]});super({glProgram:t,gpuProgram:s,resources:{batchSamplers:(0,pe.getBatchSamplersUniformGroup)(e)}})}},Hs=null,$s=class extends ct.Batcher{geometry=new ni;shader=Hs||(Hs=new li(this.maxTextures));name=$s.extension.name;vertexSize=7;packAttributes(e,t,s,r,n){const h=n<<16|e.roundPixels&65535,o=e.transform,i=o.a,l=o.b,a=o.c,c=o.d,d=o.tx,f=o.ty,{positions:u,uvs:m}=e,p=e.color,w=(p>>24&255)/255,b=ct.Color.shared.setValue(e.darkColor).premultiply(w,!0).toPremultiplied(1,!1),g=e.attributeOffset,x=g+e.attributeSize;for(let v=g;v<x;v++){const y=v*2,C=u[y],S=u[y+1];t[r++]=i*C+a*S+d,t[r++]=c*S+l*C+f,t[r++]=m[y],t[r++]=m[y+1],s[r++]=p,s[r++]=b,s[r++]=h}}packQuadAttributes(e,t,s,r,n){const h=e.texture,o=e.transform,i=o.a,l=o.b,a=o.c,c=o.d,d=o.tx,f=o.ty,u=e.bounds,m=u.maxX,p=u.minX,w=u.maxY,b=u.minY,g=h.uvs,x=e.color,v=e.darkColor,y=n<<16|e.roundPixels&65535;t[r+0]=i*p+a*b+d,t[r+1]=c*b+l*p+f,t[r+2]=g.x0,t[r+3]=g.y0,s[r+4]=x,s[r+5]=v,s[r+6]=y,t[r+7]=i*m+a*b+d,t[r+8]=c*b+l*m+f,t[r+9]=g.x1,t[r+10]=g.y1,s[r+11]=x,s[r+12]=v,s[r+13]=y,t[r+14]=i*m+a*w+d,t[r+15]=c*w+l*m+f,t[r+16]=g.x2,t[r+17]=g.y2,s[r+18]=x,s[r+19]=v,s[r+20]=y,t[r+21]=i*p+a*w+d,t[r+22]=c*w+l*p+f,t[r+23]=g.x3,t[r+24]=g.y3,s[r+25]=x,s[r+26]=v,s[r+27]=y}},js=$s;R(js,"extension",{type:[ct.ExtensionType.Batcher],name:"darkTint"}),ct.extensions.add(js);var We=xe("pixi.js"),hi=class{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const e=this.data.color,t=this.renderable.groupColor,s=this.renderable.groupAlpha;let r;const n=e.a*s*255;if(t!==16777215){const h=t>>16&255,o=t>>8&255,i=t&255,l=e.r*i,a=e.g*o,c=e.b*h;r=n<<24|c<<16|a<<8|l}else r=n<<24|e.b*255<<16|e.g*255<<8|e.r*255;return r}get darkColor(){const e=this.data.darkColor;return e.b*255<<16|e.g*255<<8|e.r*255}get groupTransform(){return this.renderable.groupTransform}setData(e,t,s,r){if(this.renderable=e,this.transform=e.groupTransform,this.data=t,t.clipped){const n=t.clippedData;this.indexSize=n.indicesCount,this.attributeSize=n.vertexCount,this.positions=n.vertices,this.indices=n.indices,this.uvs=n.uvs}else this.indexSize=t.indices.length,this.attributeSize=t.vertices.length/2,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs;this.texture=t.texture,this.roundPixels=r,this.blendMode=s,this.batcherName=t.darkTint?"darkTint":"default"}},ci={0:"normal",1:"add",2:"multiply",3:"screen"},us=class{renderer;gpuSpineData={};constructor(e){this.renderer=e}validateRenderable(e){if(e._applyState(),e.spineAttachmentsDirty)return!0;if(e.spineTexturesDirty){const t=e.skeleton.drawOrder,s=this.gpuSpineData[e.uid];for(let r=0,n=t.length;r<n;r++){const h=t[r],o=h.getAttachment();if(o instanceof O||o instanceof le){const i=e._getCachedData(h,o),l=s.slotBatches[i.id],a=i.texture;if(a!==l.texture&&!l._batcher.checkAndUpdateTexture(l,a))return!0}}}return!1}addRenderable(e,t){const s=this.gpuSpineData[e.uid]||={slotBatches:{}},r=this.renderer.renderPipes.batch,n=e.skeleton.drawOrder,h=this.renderer._roundPixels|e._roundPixels;e._applyState();for(let o=0,i=n.length;o<i;o++){const l=n[o],a=l.getAttachment(),c=ci[l.data.blendMode];if(a instanceof O||a instanceof le){const f=e._getCachedData(l,a),u=s.slotBatches[f.id]||=new hi;u.setData(e,f,c,h),f.skipRender||r.addToBatch(u,t)}const d=e._slotsObject[l.data.name];if(d){const f=d.container;f.includeInBuild=!0,(0,We.collectAllRenderables)(f,t,this.renderer),f.includeInBuild=!1}}}updateRenderable(e){const t=this.gpuSpineData[e.uid];e._applyState();const s=e.skeleton.drawOrder;for(let r=0,n=s.length;r<n;r++){const h=s[r],o=h.getAttachment();if((o instanceof O||o instanceof le)&&!e._getCachedData(h,o).skipRender){const l=t.slotBatches[e._getCachedData(h,o).id];l._batcher?.updateElement(l)}}}destroyRenderable(e){this.gpuSpineData[e.uid]=null}destroy(){this.gpuSpineData=null,this.renderer=null}};R(us,"extension",{type:[We.ExtensionType.WebGLPipes,We.ExtensionType.WebGPUPipes,We.ExtensionType.CanvasPipes],name:"spine"}),We.extensions.add(us);var se=xe("pixi.js"),dt=new _e;Fe.yDown=!0;var De=new lt,Js=new Be(()=>new se.Graphics),ms=class extends se.ViewContainer{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(e){let t;if(typeof e=="number"?t=this.skeleton.slots[e]:typeof e=="string"?t=this.skeleton.findSlot(e):t=e,!t)throw new Error(`No slot found with the given slot reference: ${e}`);return t}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}autoUpdateWarned=!1;_autoUpdate=!0;get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e?(se.Ticker.shared.add(this.internalUpdate,this),this.autoUpdateWarned=!1):se.Ticker.shared.remove(this.internalUpdate,this),this._autoUpdate=e}constructor(e){e instanceof qe&&(e={skeletonData:e}),super();const t=e instanceof qe?e:e.skeletonData;this.skeleton=new Fe(t),this.state=new Gt(new Ps(t)),this.autoUpdate=e?.autoUpdate??!0,this.darkTint=e?.darkTint===void 0?this.skeleton.slots.some(r=>!!r.data.darkColor):e?.darkTint;const s=this.skeleton.slots;for(let r=0;r<s.length;r++)this.attachmentCacheData[r]=Object.create(null);this._updateState(0)}update(e){this.autoUpdate&&!this.autoUpdateWarned&&(console.warn("You are calling update on a Spine instance that has autoUpdate set to true. This is probably not what you want."),this.autoUpdateWarned=!0),this.internalUpdate(0,e)}internalUpdate(e,t){this._updateState(t??se.Ticker.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(e,t){const s=e;if(typeof e=="string"&&(e=this.skeleton.findBone(e)),!e)throw Error(`Cant set bone position, bone ${String(s)} not found`);if(dt.set(t.x,t.y),e.parent){const r=e.parent.worldToLocal(dt);e.x=r.x,e.y=-r.y}else e.x=dt.x,e.y=dt.y}getBonePosition(e,t){const s=e;return typeof e=="string"&&(e=this.skeleton.findBone(e)),e?(t||(t={x:0,y:0}),t.x=e.worldX,t.y=e.worldY,t):(console.error(`Cant set bone position! Bone ${String(s)} not found`),t)}_updateState(e){this.state.update(e),this.skeleton.update(e),this._stateChanged=!0,this._boundsDirty=!0,this.onViewUpdate()}_applyState(){if(!this._stateChanged)return;this._stateChanged=!1;const{skeleton:e}=this;this.state.apply(e),this.beforeUpdateWorldTransforms(this),e.updateWorldTransform(2),this.afterUpdateWorldTransforms(this),this.validateAttachments(),this.transformAttachments(),this.updateSlotObjects()}validateAttachments(){const e=this.skeleton.drawOrder,t=this._lastAttachments;let s=0,r=!1;for(let n=0;n<e.length;n++){const o=e[n].getAttachment();o&&(o!==t[s]&&(r=!0,t[s]=o),s++)}s!==t.length&&(r=!0,t.length=s),this.spineAttachmentsDirty=r}updateAndSetPixiMask(e,t){const s=e.attachment;if(s&&s instanceof ve){const h=this.clippingSlotToPixiMasks[e.data.name]||={slot:e,vertices:new Array};h.maskComputed=!1,this.currentClippingSlot=this.clippingSlotToPixiMasks[e.data.name];return}let r=this.currentClippingSlot,n=this._slotsObject[e.data.name];if(r&&n){let h=r.slot,o=h.attachment,i=r.mask;if(i||(i=Js.obtain(),r.mask=i,this.addChild(i)),!r.maskComputed){r.maskComputed=!0;const l=o.worldVerticesLength,a=r.vertices;o.computeWorldVertices(h,0,l,a,0,2),i.clear().poly(a).stroke({width:0}).fill({alpha:.25})}n.container.mask=i}else n?.container.mask&&(n.container.mask=null);if(r&&r.slot.attachment.endSlot==e.data&&(this.currentClippingSlot=void 0),t)for(const h in this.clippingSlotToPixiMasks){const o=this.clippingSlotToPixiMasks[h];(!(o.slot.attachment instanceof ve)||!o.maskComputed)&&o.mask&&(this.removeChild(o.mask),Js.free(o.mask),o.mask=void 0)}}currentClippingSlot;transformAttachments(){const e=this.skeleton.drawOrder;for(let t=0;t<e.length;t++){const s=e[t];this.updateAndSetPixiMask(s,t===e.length-1);const r=s.getAttachment();if(r){if(r instanceof le||r instanceof O){const n=this._getCachedData(s,r);r instanceof O?r.computeWorldVertices(s,n.vertices,0,2):r.computeWorldVertices(s,0,r.worldVerticesLength,n.vertices,0,2),(0,se.fastCopy)(r.uvs.buffer,n.uvs.buffer);const o=s.bone.skeleton.color,i=s.color,l=r.color;n.color.set(o.r*i.r*l.r,o.g*i.g*l.g,o.b*i.b*l.b,o.a*i.a*l.a),s.darkColor&&n.darkColor.setFromColor(s.darkColor),n.skipRender=n.clipped=!1;const a=r.region?.texture.texture||se.Texture.EMPTY;n.texture!==a&&(n.texture=a,this.spineTexturesDirty=!0),De.isClipping()&&this.updateClippingData(n)}else if(r instanceof ve){De.clipStart(s,r);continue}}De.clipEndWithSlot(s)}De.clipEnd()}updateClippingData(e){e.clipped=!0,De.clipTrianglesUnpacked(e.vertices,e.indices,e.indices.length,e.uvs);const{clippedVertices:t,clippedUVs:s,clippedTriangles:r}=De,n=t.length/2,h=r.length;e.clippedData||(e.clippedData={vertices:new Float32Array(n*2),uvs:new Float32Array(n*2),vertexCount:n,indices:new Uint16Array(h),indicesCount:h},this.spineAttachmentsDirty=!0);const o=e.clippedData,i=o.vertexCount!==n||h!==o.indicesCount;e.skipRender=n===0,i&&(this.spineAttachmentsDirty=!0,o.vertexCount<n&&(o.vertices=new Float32Array(n*2),o.uvs=new Float32Array(n*2)),o.indices.length<h&&(o.indices=new Uint16Array(h)));const{vertices:l,uvs:a,indices:c}=o;for(let d=0;d<n;d++)l[d*2]=t[d*2],l[d*2+1]=t[d*2+1],a[d*2]=s[d*2],a[d*2+1]=s[d*2+1];o.vertexCount=n;for(let d=0;d<h;d++)c[d]!==r[d]&&(this.spineAttachmentsDirty=!0,c[d]=r[d]);o.indicesCount=h}updateSlotObjects(){for(const e in this._slotsObject){const t=this._slotsObject[e];t&&this.updateSlotObject(t)}}updateSlotObject(e){const{slot:t,container:s}=e;if(s.visible=this.skeleton.drawOrder.includes(t),s.visible){const r=t.bone;s.position.set(r.worldX,r.worldY),s.scale.x=r.getWorldScaleX(),s.scale.y=r.getWorldScaleY(),s.rotation=r.getWorldRotationX()*se.DEG_TO_RAD,s.alpha=this.skeleton.color.a*t.color.a}}_getCachedData(e,t){return this.attachmentCacheData[e.data.index][t.name]||this.initCachedData(e,t)}initCachedData(e,t){let s;return t instanceof O?(s=new Float32Array(8),this.attachmentCacheData[e.data.index][t.name]={id:`${e.data.index}-${t.name}`,vertices:s,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(t.uvs.length),color:new _(1,1,1,1),darkColor:new _(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:t.region?.texture.texture}):(s=new Float32Array(t.worldVerticesLength),this.attachmentCacheData[e.data.index][t.name]={id:`${e.data.index}-${t.name}`,vertices:s,clipped:!1,indices:t.triangles,uvs:new Float32Array(t.uvs.length),color:new _(1,1,1,1),darkColor:new _(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:t.region?.texture.texture}),this.attachmentCacheData[e.data.index][t.name]}onViewUpdate(){if(this._didChangeId+=1<<12,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(e,t){e=this.getSlotFromRef(e);for(const r in this._slotsObject)this._slotsObject[r]?.container===t&&this.removeSlotObject(this._slotsObject[r].slot);this.removeSlotObject(e),t.includeInBuild=!1,this.addChild(t);const s={container:t,slot:e};this._slotsObject[e.data.name]=s,this.updateSlotObject(s)}removeSlotObject(e){let t;if(e instanceof se.Container){for(const s in this._slotsObject)if(this._slotsObject[s]?.container===e){this._slotsObject[s]=null,t=e;break}}else{const s=this.getSlotFromRef(e);t=this._slotsObject[s.data.name]?.container,this._slotsObject[s.data.name]=null}t&&(this.removeChild(t),t.includeInBuild=!0)}getSlotObject(e){return e=this.getSlotFromRef(e),this._slotsObject[e.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new ds;const e=this.skeletonBounds;if(e.update(this.skeleton,!0),e.minX===1/0){this._applyState();const t=this.skeleton.drawOrder,s=this._bounds;s.clear();for(let r=0;r<t.length;r++){const n=t[r],h=n.getAttachment();if(h&&(h instanceof O||h instanceof le)){const o=this._getCachedData(n,h);s.addVertexData(o.vertices,0,o.vertices.length)}}}else this._bounds.minX=e.minX,this._bounds.minY=e.minY,this._bounds.maxX=e.maxX,this._bounds.maxY=e.maxY}addBounds(e){e.addBounds(this.bounds)}destroy(e=!1){super.destroy(e),se.Ticker.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(e){this.worldTransform.apply(e,e)}pixiWorldCoordinatesToSkeleton(e){this.worldTransform.applyInverse(e,e)}pixiWorldCoordinatesToBone(e,t){this.pixiWorldCoordinatesToSkeleton(e),t.parent?t.parent.worldToLocal(e):t.worldToLocal(e)}static from({skeleton:e,atlas:t,scale:s=1,darkTint:r,autoUpdate:n=!0}){const h=`${e}-${t}-${s}`;if(se.Cache.has(h))return new ms(se.Cache.get(h));const o=se.Assets.get(e),i=se.Assets.get(t),l=new Ls(i),a=o instanceof Uint8Array?new Ws(l):new Gs(l);a.scale=s;const c=a.readSkeletonData(o);return se.Cache.set(h,c),new ms({skeletonData:c,darkTint:r,autoUpdate:n})}},re=xe("pixi.js"),di=class{registeredSpines=new Map;drawMeshHull=!0;drawMeshTriangles=!0;drawBones=!0;drawPaths=!0;drawBoundingBoxes=!0;drawClipping=!0;drawRegionAttachments=!0;drawEvents=!0;lineWidth=1;regionAttachmentsColor=30975;meshHullColor=30975;meshTrianglesColor=16763904;clippingPolygonColor=16711935;boundingBoxesRectColor=65280;boundingBoxesPolygonColor=65280;boundingBoxesCircleColor=65280;pathsCurveColor=16711680;pathsLineColor=16711935;skeletonXYColor=16711680;bonesColor=61132;eventFontSize=24;eventFontColor=0;registerSpine(e){if(this.registeredSpines.has(e)){console.warn("SpineDebugRenderer.registerSpine() - this spine is already registered!",e);return}const t={parentDebugContainer:new re.Container,bones:new re.Container,skeletonXY:new re.Graphics,regionAttachmentsShape:new re.Graphics,meshTrianglesLine:new re.Graphics,meshHullLine:new re.Graphics,clippingPolygon:new re.Graphics,boundingBoxesRect:new re.Graphics,boundingBoxesCircle:new re.Graphics,boundingBoxesPolygon:new re.Graphics,pathsCurve:new re.Graphics,pathsLine:new re.Graphics,eventText:new re.Container,eventCallback:{event:(s,r)=>{if(this.drawEvents){const n=Math.abs(e.scale.x||e.scale.y||1),h=new re.Text({text:r.data.name,style:{fontSize:this.eventFontSize/n,fill:this.eventFontColor,fontFamily:"monospace"}});h.scale.x=Math.sign(e.scale.x),h.anchor.set(.5),t.eventText.addChild(h),setTimeout(()=>{h.destroyed||h.destroy()},250)}}}};t.parentDebugContainer.addChild(t.bones),t.parentDebugContainer.addChild(t.skeletonXY),t.parentDebugContainer.addChild(t.regionAttachmentsShape),t.parentDebugContainer.addChild(t.meshTrianglesLine),t.parentDebugContainer.addChild(t.meshHullLine),t.parentDebugContainer.addChild(t.clippingPolygon),t.parentDebugContainer.addChild(t.boundingBoxesRect),t.parentDebugContainer.addChild(t.boundingBoxesCircle),t.parentDebugContainer.addChild(t.boundingBoxesPolygon),t.parentDebugContainer.addChild(t.pathsCurve),t.parentDebugContainer.addChild(t.pathsLine),t.parentDebugContainer.addChild(t.eventText),t.parentDebugContainer.zIndex=9999999,t.parentDebugContainer.accessibleChildren=!1,t.parentDebugContainer.eventMode="none",t.parentDebugContainer.interactiveChildren=!1,e.addChild(t.parentDebugContainer),e.state.addListener(t.eventCallback),this.registeredSpines.set(e,t)}renderDebug(e){this.registeredSpines.has(e)||this.registerSpine(e);const t=this.registeredSpines.get(e);if(!t)return;e.addChild(t.parentDebugContainer),t.skeletonXY.clear(),t.regionAttachmentsShape.clear(),t.meshTrianglesLine.clear(),t.meshHullLine.clear(),t.clippingPolygon.clear(),t.boundingBoxesRect.clear(),t.boundingBoxesCircle.clear(),t.boundingBoxesPolygon.clear(),t.pathsCurve.clear(),t.pathsLine.clear();for(let n=t.bones.children.length;n>0;n--)t.bones.children[n-1].destroy({children:!0,texture:!0,textureSource:!0});const s=Math.abs(e.scale.x||e.scale.y||1),r=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(e,t,r,s),this.drawPaths&&this.drawPathsFunc(e,t,r),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(e,t,r),this.drawClipping&&this.drawClippingFunc(e,t,r),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(e,t,r),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(e,t,r),this.drawEvents)for(const n of t.eventText.children)n.alpha-=.05,n.y-=2}drawBonesFunc(e,t,s,r){const n=e.skeleton,h=n.x,o=n.y,i=n.bones;t.skeletonXY.strokeStyle={width:s,color:this.skeletonXYColor};for(let a=0,c=i.length;a<c;a++){const d=i[a],f=d.data.length,u=h+d.worldX,m=o+d.worldY,p=h+f*d.a+d.worldX,w=o+f*d.b+d.worldY;if(d.data.name==="root"||d.data.parent===null)continue;const b=Math.abs(u-p),g=Math.abs(m-w),x=Math.pow(b,2),v=g,y=Math.pow(g,2),C=Math.sqrt(x+y),S=Math.pow(C,2),A=Math.PI/180,M=Math.acos((S+y-x)/(2*v*C))||0;if(C===0)continue;const T=new re.Graphics;t.bones.addChild(T);const X=C/50/r;T.context.poly([0,0,0-X,C-X*3,0,C-X,0+X,C-X*3]).fill(this.bonesColor),T.x=u,T.y=m,T.pivot.y=C;let F=0;u<p&&m<w?F=-M+180*A:u>p&&m<w?F=180*A+M:u>p&&m>w?F=-M:u<p&&m>w?F=M:m===w&&u<p?F=90*A:m===w&&u>p?F=-90*A:u===p&&m<w?F=180*A:u===p&&m>w&&(F=0),T.rotation=F,T.circle(0,C,X*1.2).fill({color:0,alpha:.6}).stroke({width:s+X/2.4,color:this.bonesColor})}const l=s*3;t.skeletonXY.context.moveTo(h-l,o-l).lineTo(h+l,o+l).moveTo(h+l,o-l).lineTo(h-l,o+l).stroke()}drawRegionAttachmentsFunc(e,t,s){const n=e.skeleton.slots;for(let h=0,o=n.length;h<o;h++){const i=n[h],l=i.getAttachment();if(l===null||!(l instanceof O))continue;const a=l,c=new Float32Array(8);a.computeWorldVertices(i,c,0,2),t.regionAttachmentsShape.poly(Array.from(c.slice(0,8)))}t.regionAttachmentsShape.stroke({color:this.regionAttachmentsColor,width:s})}drawMeshHullAndMeshTriangles(e,t,s){const n=e.skeleton.slots;for(let h=0,o=n.length;h<o;h++){const i=n[h];if(!i.bone.active)continue;const l=i.getAttachment();if(l===null||!(l instanceof le))continue;const a=l,c=new Float32Array(a.worldVerticesLength),d=a.triangles;let f=a.hullLength;if(a.computeWorldVertices(i,0,a.worldVerticesLength,c,0,2),this.drawMeshTriangles)for(let u=0,m=d.length;u<m;u+=3){const p=d[u]*2,w=d[u+1]*2,b=d[u+2]*2;t.meshTrianglesLine.context.moveTo(c[p],c[p+1]).lineTo(c[w],c[w+1]).lineTo(c[b],c[b+1])}if(this.drawMeshHull&&f>0){f=(f>>1)*2;let u=c[f-2],m=c[f-1];for(let p=0,w=f;p<w;p+=2){const b=c[p],g=c[p+1];t.meshHullLine.context.moveTo(b,g).lineTo(u,m),u=b,m=g}}}t.meshHullLine.stroke({width:s,color:this.meshHullColor}),t.meshTrianglesLine.stroke({width:s,color:this.meshTrianglesColor})}drawClippingFunc(e,t,s){const n=e.skeleton.slots;for(let h=0,o=n.length;h<o;h++){const i=n[h];if(!i.bone.active)continue;const l=i.getAttachment();if(l===null||!(l instanceof ve))continue;const a=l,c=a.worldVerticesLength,d=new Float32Array(c);a.computeWorldVertices(i,0,c,d,0,2),t.clippingPolygon.poly(Array.from(d))}t.clippingPolygon.stroke({width:s,color:this.clippingPolygonColor,alpha:1})}drawBoundingBoxesFunc(e,t,s){const r=new ds;r.update(e.skeleton,!0),r.minX!==1/0&&t.boundingBoxesRect.rect(r.minX,r.minY,r.getWidth(),r.getHeight()).stroke({width:s,color:this.boundingBoxesRectColor});const n=r.polygons,h=(o,i,l)=>{if(l<3)throw new Error("Polygon must contain at least 3 vertices");const a=[],c=s*2;for(let d=0,f=o.length;d<f;d+=2){const u=o[d],m=o[d+1];t.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor),t.boundingBoxesCircle.drawCircle(u,m,c),t.boundingBoxesCircle.fill(0),t.boundingBoxesCircle.circle(u,m,c).fill({color:this.boundingBoxesCircleColor}),a.push(u,m)}t.boundingBoxesPolygon.poly(a).fill({color:this.boundingBoxesPolygonColor,alpha:.1}).stroke({width:s,color:this.boundingBoxesPolygonColor})};for(let o=0,i=n.length;o<i;o++){const l=n[o];h(l,0,l.length)}}drawPathsFunc(e,t,s){const n=e.skeleton.slots;for(let h=0,o=n.length;h<o;h++){const i=n[h];if(!i.bone.active)continue;const l=i.getAttachment();if(l===null||!(l instanceof Ye))continue;const a=l;let c=a.worldVerticesLength;const d=new Float32Array(c);a.computeWorldVertices(i,0,c,d,0,2);let f=d[2],u=d[3],m=0,p=0;if(a.closed){const w=d[0],b=d[1],g=d[c-2],x=d[c-1];m=d[c-4],p=d[c-3],t.pathsCurve.moveTo(f,u),t.pathsCurve.bezierCurveTo(w,b,g,x,m,p),t.pathsLine.moveTo(f,u),t.pathsLine.lineTo(w,b),t.pathsLine.moveTo(m,p),t.pathsLine.lineTo(g,x)}c-=4;for(let w=4;w<c;w+=6){const b=d[w],g=d[w+1],x=d[w+2],v=d[w+3];m=d[w+4],p=d[w+5],t.pathsCurve.moveTo(f,u),t.pathsCurve.bezierCurveTo(b,g,x,v,m,p),t.pathsLine.moveTo(f,u),t.pathsLine.lineTo(b,g),t.pathsLine.moveTo(m,p),t.pathsLine.lineTo(x,v),f=m,u=p}}t.pathsCurve.stroke({width:s,color:this.pathsCurveColor}),t.pathsLine.stroke({width:s,color:this.pathsLineColor})}unregisterSpine(e){this.registeredSpines.has(e)||console.warn("SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!",e);const t=this.registeredSpines.get(e);t&&(e.state.removeListener(t.eventCallback),t.parentDebugContainer.destroy({textureSource:!0,children:!0,texture:!0}),this.registeredSpines.delete(e))}};return lr(xs)})();
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** ****************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated September 24, 2021. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2021, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
+
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
+
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
import './require-shim.js';
|
|
30
|
+
import './assets/atlasLoader.js';
|
|
31
|
+
import './assets/skeletonLoader.js';
|
|
32
|
+
import './darktint/DarkTintBatcher.js';
|
|
33
|
+
import './SpinePipe.js';
|
|
34
|
+
export * from './assets/atlasLoader.js';
|
|
35
|
+
export * from './assets/skeletonLoader.js';
|
|
36
|
+
export * from './require-shim.js';
|
|
37
|
+
export * from './Spine.js';
|
|
38
|
+
export * from './SpineDebugRenderer.js';
|
|
39
|
+
export * from './SpinePipe.js';
|
|
40
|
+
export * from './SpineTexture.js';
|
|
41
|
+
export * from '@esotericsoftware/spine-core';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** ****************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated September 24, 2021. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2021, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
+
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
+
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
import './require-shim.js'; // Side effects add require pixi.js to global scope
|
|
30
|
+
import './assets/atlasLoader.js'; // Side effects install the loaders into pixi
|
|
31
|
+
import './assets/skeletonLoader.js'; // Side effects install the loaders into pixi
|
|
32
|
+
import './darktint/DarkTintBatcher.js'; // Side effects install the batcher into pixi
|
|
33
|
+
import './SpinePipe.js';
|
|
34
|
+
export * from './assets/atlasLoader.js';
|
|
35
|
+
export * from './assets/skeletonLoader.js';
|
|
36
|
+
export * from './require-shim.js';
|
|
37
|
+
export * from './Spine.js';
|
|
38
|
+
export * from './SpineDebugRenderer.js';
|
|
39
|
+
export * from './SpinePipe.js';
|
|
40
|
+
export * from './SpineTexture.js';
|
|
41
|
+
export * from '@esotericsoftware/spine-core';
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsrRUEyQitFO0FBRS9FLE9BQU8sbUJBQW1CLENBQUMsQ0FBQyxtREFBbUQ7QUFDL0UsT0FBTyx5QkFBeUIsQ0FBQyxDQUFDLDZDQUE2QztBQUMvRSxPQUFPLDRCQUE0QixDQUFDLENBQUMsNkNBQTZDO0FBQ2xGLE9BQU8sK0JBQStCLENBQUMsQ0FBQyw2Q0FBNkM7QUFDckYsT0FBTyxnQkFBZ0IsQ0FBQztBQUV4QixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLDhCQUE4QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiAqIFNwaW5lIFJ1bnRpbWVzIExpY2Vuc2UgQWdyZWVtZW50XG4gKiBMYXN0IHVwZGF0ZWQgU2VwdGVtYmVyIDI0LCAyMDIxLiBSZXBsYWNlcyBhbGwgcHJpb3IgdmVyc2lvbnMuXG4gKlxuICogQ29weXJpZ2h0IChjKSAyMDEzLTIwMjEsIEVzb3RlcmljIFNvZnR3YXJlIExMQ1xuICpcbiAqIEludGVncmF0aW9uIG9mIHRoZSBTcGluZSBSdW50aW1lcyBpbnRvIHNvZnR3YXJlIG9yIG90aGVyd2lzZSBjcmVhdGluZ1xuICogZGVyaXZhdGl2ZSB3b3JrcyBvZiB0aGUgU3BpbmUgUnVudGltZXMgaXMgcGVybWl0dGVkIHVuZGVyIHRoZSB0ZXJtcyBhbmRcbiAqIGNvbmRpdGlvbnMgb2YgU2VjdGlvbiAyIG9mIHRoZSBTcGluZSBFZGl0b3IgTGljZW5zZSBBZ3JlZW1lbnQ6XG4gKiBodHRwOi8vZXNvdGVyaWNzb2Z0d2FyZS5jb20vc3BpbmUtZWRpdG9yLWxpY2Vuc2VcbiAqXG4gKiBPdGhlcndpc2UsIGl0IGlzIHBlcm1pdHRlZCB0byBpbnRlZ3JhdGUgdGhlIFNwaW5lIFJ1bnRpbWVzIGludG8gc29mdHdhcmVcbiAqIG9yIG90aGVyd2lzZSBjcmVhdGUgZGVyaXZhdGl2ZSB3b3JrcyBvZiB0aGUgU3BpbmUgUnVudGltZXMgKGNvbGxlY3RpdmVseSxcbiAqIFwiUHJvZHVjdHNcIiksIHByb3ZpZGVkIHRoYXQgZWFjaCB1c2VyIG9mIHRoZSBQcm9kdWN0cyBtdXN0IG9idGFpbiB0aGVpciBvd25cbiAqIFNwaW5lIEVkaXRvciBsaWNlbnNlIGFuZCByZWRpc3RyaWJ1dGlvbiBvZiB0aGUgUHJvZHVjdHMgaW4gYW55IGZvcm0gbXVzdFxuICogaW5jbHVkZSB0aGlzIGxpY2Vuc2UgYW5kIGNvcHlyaWdodCBub3RpY2UuXG4gKlxuICogVEhFIFNQSU5FIFJVTlRJTUVTIEFSRSBQUk9WSURFRCBCWSBFU09URVJJQyBTT0ZUV0FSRSBMTEMgXCJBUyBJU1wiIEFORCBBTllcbiAqIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFIElNUExJRURcbiAqIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSBBUkVcbiAqIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIEVTT1RFUklDIFNPRlRXQVJFIExMQyBCRSBMSUFCTEUgRk9SIEFOWVxuICogRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAqIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUyxcbiAqIEJVU0lORVNTIElOVEVSUlVQVElPTiwgT1IgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFMpIEhPV0VWRVIgQ0FVU0VEIEFORFxuICogT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAqIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICogVEhFIFNQSU5FIFJVTlRJTUVTLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL1xuXG5pbXBvcnQgJy4vcmVxdWlyZS1zaGltLmpzJzsgLy8gU2lkZSBlZmZlY3RzIGFkZCByZXF1aXJlIHBpeGkuanMgdG8gZ2xvYmFsIHNjb3BlXG5pbXBvcnQgJy4vYXNzZXRzL2F0bGFzTG9hZGVyLmpzJzsgLy8gU2lkZSBlZmZlY3RzIGluc3RhbGwgdGhlIGxvYWRlcnMgaW50byBwaXhpXG5pbXBvcnQgJy4vYXNzZXRzL3NrZWxldG9uTG9hZGVyLmpzJzsgLy8gU2lkZSBlZmZlY3RzIGluc3RhbGwgdGhlIGxvYWRlcnMgaW50byBwaXhpXG5pbXBvcnQgJy4vZGFya3RpbnQvRGFya1RpbnRCYXRjaGVyLmpzJzsgLy8gU2lkZSBlZmZlY3RzIGluc3RhbGwgdGhlIGJhdGNoZXIgaW50byBwaXhpXG5pbXBvcnQgJy4vU3BpbmVQaXBlLmpzJztcblxuZXhwb3J0ICogZnJvbSAnLi9hc3NldHMvYXRsYXNMb2FkZXIuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9hc3NldHMvc2tlbGV0b25Mb2FkZXIuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9yZXF1aXJlLXNoaW0uanMnO1xuZXhwb3J0ICogZnJvbSAnLi9TcGluZS5qcyc7XG5leHBvcnQgKiBmcm9tICcuL1NwaW5lRGVidWdSZW5kZXJlci5qcyc7XG5leHBvcnQgKiBmcm9tICcuL1NwaW5lUGlwZS5qcyc7XG5leHBvcnQgKiBmcm9tICcuL1NwaW5lVGV4dHVyZS5qcyc7XG5leHBvcnQgKiBmcm9tICdAZXNvdGVyaWNzb2Z0d2FyZS9zcGluZS1jb3JlJztcbiJdfQ==
|