1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5639],{417:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(2513);class r extends i.q{bones=[];_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(t){super(t,0,!1)}}},2513:(t,e,s)=>{s.d(e,{q:()=>i});class i{name;order;skinRequired;constructor(t,e,s){this.name=t,this.order=e,this.skinRequired=s}}},13001:(t,e,s)=>{s.d(e,{Y:()=>i});class i{name=null;bones=[];slots=[];skins=[];defaultSkin=null;events=[];animations=[];ikConstraints=[];transformConstraints=[];pathConstraints=[];physicsConstraints=[];x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(t){if(!t)throw Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findSlot(t){if(!t)throw Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findSkin(t){if(!t)throw Error("skinName cannot be null.");let e=this.skins;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findEvent(t){if(!t)throw Error("eventDataName cannot be null.");let e=this.events;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findAnimation(t){if(!t)throw Error("animationName cannot be null.");let e=this.animations;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findIkConstraint(t){if(!t)throw Error("constraintName cannot be null.");let e=this.ikConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findTransformConstraint(t){if(!t)throw Error("constraintName cannot be null.");let e=this.transformConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findPathConstraint(t){if(!t)throw Error("constraintName cannot be null.");let e=this.pathConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findPhysicsConstraint(t){if(!t)throw Error("constraintName cannot be null.");let e=this.physicsConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}}},16139:(t,e,s)=>{s.d(e,{Aq:()=>n,I9:()=>o,Q1:()=>r,bC:()=>h,cj:()=>a,eE:()=>i,oM:()=>l});class i{entries={};size=0;add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,i=t.length;s<i;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}class r{r;g;b;a;static WHITE=new r(1,1,1,1);static RED=new r(1,0,0,1);static GREEN=new r(0,1,0,1);static BLUE=new r(0,0,1,1);static MAGENTA=new r(1,0,1,1);constructor(t=0,e=0,s=0,i=0){this.r=t,this.g=e,this.b=s,this.a=i}set(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,i){return this.r+=t,this.g+=e,this.b+=s,this.a+=i,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((0xff000000&e)>>>24)/255,t.g=((0xff0000&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((0xff0000&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}toRgb888(){let t=t=>("0"+(255*t).toString(16)).slice(-2);return Number("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new r){return e.setFromString(t)}}class a{static PI=3.1415927;static PI2=2*a.PI;static invPI2=1/a.PI2;static radiansToDegrees=180/a.PI;static radDeg=a.radiansToDegrees;static degreesToRadians=a.PI/180;static degRad=a.degreesToRadians;static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*a.degRad)}static sinDeg(t){return Math.sin(t*a.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*a.degRad}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return a.randomTriangularWith(t,e,(t+e)*.5)}
1static randomTriangularWith(t,e,s){let i=Math.random(),r=e-t;return i<=(s-t)/r?t+Math.sqrt(i*r*(s-t)):e-Math.sqrt((1-i)*r*(e-s))}static isPowerOfTwo(t){return t&&(t&t-1)==0}}class n{static SUPPORTS_TYPED_ARRAYS="u">typeof Float32Array;static arrayCopy(t,e,s,i,r){for(let a=e,n=i;a<e+r;a++,n++)s[n]=t[a]}static arrayFill(t,e,s,i){for(let r=e;r<s;r++)t[r]=i}static setArraySize(t,e,s=0){let i=t.length;if(i==e)return t;if(t.length=e,i<e)for(let r=i;r<e;r++)t[r]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:n.setArraySize(t,e,s)}static newArray(t,e){let s=Array(t);for(let i=0;i<t;i++)s[i]=e;return s}static newFloatArray(t){if(n.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(n.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return n.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return n.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}class h{items=[];instantiator;constructor(t){this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class o{x;y;constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}class l{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}},28054:(t,e,s)=>{s.d(e,{Dr:()=>o,pw:()=>n,r9:()=>h,rX:()=>c});var i,r,a,n,h,o,l=s(2513);class c extends l.q{bones=[];_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw Error("SlotData not set.")}positionMode=n.Fixed;spacingMode=h.Fixed;rotateMode=o.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(t){super(t,0,!1)}}(i=n||(n={}))[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent",(r=h||(h={}))[r.Length=0]="Length",r[r.Fixed=1]="Fixed",r[r.Percent=2]="Percent",r[r.Proportional=3]="Proportional",(a=o||(o={}))[a.Tangent=0]="Tangent",a[a.Chain=1]="Chain",a[a.ChainScale=2]="ChainScale"},31612:(t,e,s)=>{s.d(e,{gd:()=>n,l8:()=>h,zu:()=>r});var i,r,a=s(16139);class n{static _nextID=0;id=n.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=Array(t)}copy(){let t=new n(this.regions.length);return a.Aq.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let s=t.sequenceIndex;-1==s&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let i=this.regions[s];e.region!=i&&(e.region=i,e.updateRegion())}getPath(t,e){let s=t,i=(this.start+e).toString();for(let t=this.digits-i.length;t>0;t--)s+="0";return s+i}static nextID(){return n._nextID++}}(i=r||(r={}))[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse";let h=[r.hold,r.once,r.loop,r.pingpong,r.onceReverse,r.loopReverse,r.pingpongReverse]},39681:(t,e,s)=>{s.d(e,{f:()=>n});var i=s(96680),r=s(16139),a=s(95904);class n extends a.e{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new r.Q1(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new r.Q1(0,0,0,0);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=r.Aq.newFloatArray(t.length));let e=this.uvs,s=this.uvs.length,a=this.region.u,n=this.region.v,h=0,o=0;if(this.region instanceof i.TE){let i=this.region,r=i.page,l=r.width,c=r.height;switch(i.degrees){case 90:a-=(i.originalHeight-i.offsetY-i.height)/l,n-=(i.originalWidth-i.offsetX-i.width)/c,h=i.originalHeight/l,o=i.originalWidth/c;for(let i=0;i<s;i+=2)e[i]=a+t[i+1]*h,e[i+1]=n+(1-t[i])*o;return;case 180:a-=(i.originalWidth-i.offsetX-i.width)/l,n-=i.offsetY/c,h=i.originalWidth/l,o=i.originalHeight/c;for(let i=0;i<s;i+=2)e[i]=a+(1-t[i])*h,e[i+1]=n+(1-t[i+1])*o;return;case 270:a-=i.offsetY/l,n-=i.offsetX/c,h=i.originalHeight/l,o=i.originalWidth/c;for(let i=0;i<s;i+=2)e[i]=a+(1-t[i+1])*h,e[i+1]=n+t[i]*o;return}a-=i.offsetX/l,n-=(i.originalHeight-i.offsetY-i.height)/c,h=i.originalWidth/l,o=i.originalHeight/c}else this.region?(h=this.region.u2-a,o=this.region.v2-n):(a=n=0,h=o=1);for(let i=0;i<s;i+=2)e[i]=a+t[i]*h,e[i+1]=n+t[i+1]*o}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new n(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=Array(this.regionUVs.length),r.Aq.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=this.uvs instanceof Float32Array?r.Aq.newFloatArray(this.uvs.length):Array(this.uvs.length),r.Aq.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=Array(this.triangles.length),r.Aq.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=Array(this.edges.length),r.Aq.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,s,i,r,a){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,s,i,r,a)}newLinkedMesh(){let t=new n(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.regi
1on&&t.updateRegion(),t}}},44460:(t,e,s)=>{s.d(e,{h:()=>n,u:()=>r});var i,r,a=s(16139);class n{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=r.Normal;skinRequired=!1;color=new a.Q1;icon;visible=!1;constructor(t,e,s){if(t<0)throw Error("index must be >= 0.");if(!e)throw Error("name cannot be null.");this.index=t,this.name=e,this.parent=s}}(i=r||(r={}))[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"},44468:(t,e,s)=>{s.d(e,{P:()=>r});var i=s(2513);class r extends i.q{_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw 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(t){super(t,0,!1)}}},48317:(t,e,s)=>{s.d(e,{_:()=>r});var i=s(2513);class r extends i.q{bones=[];_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw 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(t){super(t,0,!1)}}},49481:(t,e,s)=>{s.d(e,{oA:()=>h.oA,Qq:()=>o,f:()=>y,qd:()=>x,Nx:()=>V.N,K$:()=>u,Q1:()=>l.Q1,_7:()=>M,cj:()=>l.cj,fj:()=>g.f,qU:()=>n.qU,mj:()=>n.mj,He:()=>f,AQ:()=>a,Qb:()=>m,EA:()=>L,t7:()=>P.t,VT:()=>X,qy:()=>O,mI:()=>k.m,gP:()=>D.gP,O$:()=>D.O$,oM:()=>l.oM,Aq:()=>l.Aq,I9:()=>l.I9});var i,r,a,n=s(67236),h=s(4581);class o{skeletonData;animationToMixTime={};defaultMix=0;constructor(t){if(!t)throw Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let i=this.skeletonData.findAnimation(t);if(!i)throw Error("Animation not found: "+t);let r=this.skeletonData.findAnimation(e);if(!r)throw Error("Animation not found: "+e);this.setMixWith(i,r,s)}setMixWith(t,e,s){if(!t)throw Error("from cannot be null.");if(!e)throw Error("to cannot be null.");let i=t.name+"."+e.name;this.animationToMixTime[i]=s}getMix(t,e){let s=t.name+"."+e.name,i=this.animationToMixTime[s];return void 0===i?this.defaultMix:i}}var l=s(16139),c=s(95904);class d extends c.e{color=new l.Q1(1,1,1,1);constructor(t){super(t)}copy(){let t=new d(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}class u extends c.e{endSlot=null;color=new l.Q1(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new u(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}var g=s(39681);class f extends c.e{lengths=[];closed=!1;constantSpeed=!1;color=new l.Q1(1,1,1,1);constructor(t){super(t)}copy(){let t=new f(this.name);return this.copyTo(t),t.lengths=Array(this.lengths.length),l.Aq.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class p extends c.e{x=0;y=0;rotation=0;color=new l.Q1(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){let e=this.rotation*l.cj.degRad,s=Math.cos(e),i=Math.sin(e),r=s*t.a+i*t.b,a=s*t.c+i*t.d;return l.cj.atan2Deg(a,r)}copy(){let t=new p(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}class m extends c.o{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new l.Q1(1,1,1,1);path;region=null;sequence=null;offset=l.Aq.newFloatArray(8);uvs=l.Aq.newFloatArray(8);tempColor=new l.Q1(1,1,1,1);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw Error("Region not set.");let t=this.region,e=this.uvs;if(null==t){e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,e[7]=0;return}let s=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*s,a=-this.height/2*this.scaleY+this.region.offsetY*i,n=r+this.region.width*s,h=a+this.region.height*i,o=this.rotation*l.cj.degRad,c=Math.cos(o),d=Math.sin(o),u=this.x,g=this.y,f=r*c+u,p=r*d,m=a*c+g,x=a*d,b=n*c+u,w=n*d,v=h*c+g,y=h*d,A=this.offset;A[0]=f-x,A[1]=m+p,A[2]=f-y,A[3]=v+p,A[4]=b-y,A[5]=v+w,A[6]=b-x,A[7]=m+w,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,s,i){null!=this.sequence&&this.sequence.apply(t,this);let r=t.bone,a=this.offset,n=r.worldX,h=r.worldY,o=r.a,l=r.b,c=r.c,d=r.d,u=0,g=0;u=a[0],g=a[1],e[s]=u*o+g*l+n,e[s+1]=u*c+g*d+h,s+=i,u=a[2],g=a[3],e[s]=u*o+g*l+n,e[s+1]=u*c+g*d+h,s+=i,u=a[4],g=a[5],e[s]=u*o+g*l+n,e[s+1]=u*c+g*d+h,s+=i,u=a[6],g=a[7],e[s]=u*o+g*l+n,e[s+1]=u*c+g*d+h}copy(){let t=new m(this.name,this.path);return t.region=this.region,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,l.Aq.arrayCopy(this.uvs,0,t.uvs,0,8),l.Aq.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31}class x{atlas;constructor(t){this.atlas=t}loadSequence(t,e,s){let i=s.regions;for(let r=0,a=i.length;r<a;r++){let a=s.getPath(e,r),n=this.atlas.findRegion(a);if(null==n)throw Error("Region not found in atlas: "+a+" (sequence: "+t+")");i[r]=n}}newRegionAttachment(t,e,s,i){let r=new m(e,s);if(null!=i)this.loadSequence(e,s,i);else{let t=this.atlas.findRegion(s);if(!t)throw Error("Region not found in atlas: "+s+" (region attachment: "+e+")");r.region=t}return r}newMeshAttachment(t,e,s,i){let r=new g.f(e,s);if(null!=i)this.loadSequence(e,s,i);else{let t=this.atlas.findRegion(s);if(!t)throw Error("Region not found in atlas: "+s+" (mesh attachment: "+e+")");r.region=t}return r}newBoundingBoxAttachment(t,e){return new d(e)}newPathAttachment(t,e){return new f(e)}newPointAttachment(t,e){return new p(e)}newClippingAttachment(t,e){return new u(e)}}var b=s(44460);class w{data;skeleton;parent=null;children=[];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;
1inherit=b.u.Normal;sorted=!1;active=!1;constructor(t,e,s){if(!t)throw Error("data cannot be null.");if(!e)throw Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,s,i,r,a,n){this.ax=t,this.ay=e,this.arotation=s,this.ascaleX=i,this.ascaleY=r,this.ashearX=a,this.ashearY=n;let h=this.parent;if(!h){let h=this.skeleton,o=h.scaleX,c=h.scaleY,d=(s+a)*l.cj.degRad,u=(s+90+n)*l.cj.degRad;this.a=Math.cos(d)*i*o,this.b=Math.cos(u)*r*o,this.c=Math.sin(d)*i*c,this.d=Math.sin(u)*r*c,this.worldX=t*o+h.x,this.worldY=e*c+h.y;return}let o=h.a,c=h.b,d=h.c,u=h.d;switch(this.worldX=o*t+c*e+h.worldX,this.worldY=d*t+u*e+h.worldY,this.inherit){case b.u.Normal:{let t=(s+a)*l.cj.degRad,e=(s+90+n)*l.cj.degRad,h=Math.cos(t)*i,g=Math.cos(e)*r,f=Math.sin(t)*i,p=Math.sin(e)*r;this.a=o*h+c*f,this.b=o*g+c*p,this.c=d*h+u*f,this.d=d*g+u*p;return}case b.u.OnlyTranslation:{let t=(s+a)*l.cj.degRad,e=(s+90+n)*l.cj.degRad;this.a=Math.cos(t)*i,this.b=Math.cos(e)*r,this.c=Math.sin(t)*i,this.d=Math.sin(e)*r;break}case b.u.NoRotationOrReflection:{let t=1/this.skeleton.scaleX,e=1/this.skeleton.scaleY,h=(o*=t)*o+(d*=e)*d,g=0;h>1e-4?(h=Math.abs(o*u*e-c*t*d)/h,c=d*h,u=o*h,g=Math.atan2(d,o)*l.cj.radDeg):(o=0,d=0,g=90-Math.atan2(u,c)*l.cj.radDeg);let f=(s+a-g)*l.cj.degRad,p=(s+n-g+90)*l.cj.degRad,m=Math.cos(f)*i,x=Math.cos(p)*r,b=Math.sin(f)*i,w=Math.sin(p)*r;this.a=o*m-c*b,this.b=o*x-c*w,this.c=d*m+u*b,this.d=d*x+u*w;break}case b.u.NoScale:case b.u.NoScaleOrReflection:{let t=Math.cos(s*=l.cj.degRad),e=Math.sin(s),h=(o*t+c*e)/this.skeleton.scaleX,g=(d*t+u*e)/this.skeleton.scaleY,f=Math.sqrt(h*h+g*g);f>1e-5&&(f=1/f),h*=f,g*=f,f=Math.sqrt(h*h+g*g),this.inherit==b.u.NoScale&&o*u-c*d<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(f=-f);let p=Math.cos(s=Math.PI/2+Math.atan2(g,h))*f,m=Math.sin(s)*f;a*=l.cj.degRad,n=(90+n)*l.cj.degRad;let x=Math.cos(a)*i,w=Math.cos(n)*r,v=Math.sin(a)*i,y=Math.sin(n)*r;this.a=h*x+p*v,this.b=h*w+p*y,this.c=g*x+m*v,this.d=g*w+m*y}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let t,e,s,i,r=this.parent;if(!r){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*l.cj.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)*l.cj.radDeg;return}let a=r.a,n=r.b,h=r.c,o=r.d,c=1/(a*o-n*h),d=o*c,u=n*c,g=h*c,f=a*c,p=this.worldX-r.worldX,m=this.worldY-r.worldY;if(this.ax=p*d-m*u,this.ay=m*f-p*g,this.inherit==b.u.OnlyTranslation)t=this.a,e=this.b,s=this.c,i=this.d;else{switch(this.inherit){case b.u.NoRotationOrReflection:{let t=Math.abs(a*o-n*h)/(a*a+h*h);n=-h*this.skeleton.scaleX*t/this.skeleton.scaleY,o=a*this.skeleton.scaleY*t/this.skeleton.scaleX,c=1/(a*o-n*h),d=o*c,u=n*c;break}case b.u.NoScale:case b.u.NoScaleOrReflection:let r=l.cj.cosDeg(this.rotation),p=l.cj.sinDeg(this.rotation),m=Math.sqrt((a=(a*r+n*p)/this.skeleton.scaleX)*a+(h=(h*r+o*p)/this.skeleton.scaleY)*h);m>1e-5&&(m=1/m),a*=m,h*=m,m=Math.sqrt(a*a+h*h),this.inherit==b.u.NoScale&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(m=-m);let x=l.cj.PI/2+Math.atan2(h,a);n=Math.cos(x)*m,c=1/(a*(o=Math.sin(x)*m)-n*h),d=o*c,u=n*c,g=h*c,f=a*c}t=d*this.a-u*this.c,e=d*this.b-u*this.d,s=f*this.c-g*this.a,i=f*this.d-g*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(t*t+s*s),this.ascaleX>1e-4){let r=t*i-e*s;this.ascaleY=r/this.ascaleX,this.ashearY=-Math.atan2(t*e+s*i,r)*l.cj.radDeg,this.arotation=Math.atan2(s,t)*l.cj.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(e*e+i*i),this.ashearY=0,this.arotation=90-Math.atan2(i,e)*l.cj.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*l.cj.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*l.cj.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(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,i=t.y-this.worldY;return t.x=s*this.d*e-i*this.b*e,t.y=i*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(null==t)throw Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)}parentToWorld(t){if(null==t)throw Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)}worldToLocalRotation(t){let e=l.cj.sinDeg(t),s=l.cj.cosDeg(t);return Math.atan2(this.a*e-this.c*s,this.d*s-this.b*e)*l.cj.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=l.cj.sinDeg(t),s=l.cj.cosDeg(t);return Math.atan2(s*this.c+e*this.d,s*this.a+e*this.b)*l.cj.radDeg}rotateWorld(t){let e=Math.sin(t*=l.cj.degRad),s=Math.cos(t),i=this.a,r=this.b;this.a=s*i-e*this.c,this.b=s*r-e*this.d,this.c=e*i+s*this.c,this.d=e*r+s*this.d}}var v=s(96680);class y{pathPrefix="";textureLoader;downloader;cache;errors={};toLoad=0;loaded=0;constructor(t,e="",s=new M,i=new A){this.textureLoader=t,this.pathPrefix=e,this.downloader=s,this.cache=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,s){this.toLoad--,this.loaded++,this.cache.assets[e]=s,this.cache.assets
1RefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,s)}error(t,e,s){this.toLoad--,this.loaded++,this.errors[e]=s,t&&t(e,s)}loadAll(){return new Promise((t,e)=>{let s=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},s=()=>{}){t=this.start(t),this.reuseAssets(t,e,s)||(this.cache.assetsLoaded[t]=new Promise((i,r)=>{this.downloader.downloadBinary(t,s=>{this.success(e,t,s),i(s)},(e,i)=>{let a=`Couldn't load binary ${t}: status ${e}, ${i}`;this.error(s,t,a),r(a)})}))}loadText(t,e=()=>{},s=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(e,i)=>{this.error(s,t,`Couldn't load text ${t}: status ${e}, ${i}`)})}loadJson(t,e=()=>{},s=()=>{}){t=this.start(t),this.reuseAssets(t,e,s)||(this.cache.assetsLoaded[t]=new Promise((i,r)=>{this.downloader.downloadJson(t,s=>{this.success(e,t,s),i(s)},(e,i)=>{let a=`Couldn't load JSON ${t}: status ${e}, ${i}`;this.error(s,t,a),r(a)})}))}reuseAssets(t,e=()=>{},s=()=>{}){let i=this.cache.assetsLoaded[t],r=void 0!==i;return r&&(this.cache.assetsLoaded[t]=i.then(s=>(s=s instanceof Image||s instanceof ImageBitmap?this.textureLoader(s):s,this.success(e,t,s),s)).catch(e=>this.error(s,t,e))),r}loadTexture(t,e=()=>{},s=()=>{}){t=this.start(t),this.reuseAssets(t,e,s)||(this.cache.assetsLoaded[t]=new Promise((i,r)=>{if("u">typeof window&&"u">typeof navigator&&window.document){let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{let s=this.textureLoader(a);this.success(e,t,s),i(s)},a.onerror=()=>{let e=`Couldn't load image: ${t}`;this.error(s,t,e),r(e)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),a.src=t}else fetch(t,{mode:"cors"}).then(e=>{if(e.ok)return e.blob();let i=`Couldn't load image: ${t}`;this.error(s,t,`Couldn't load image: ${t}`),r(i)}).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(s=>{if(s){let r=this.textureLoader(s);this.success(e,t,r),i(r)}})}))}loadTextureAtlas(t,e=()=>{},s=()=>{},i){let r=t.lastIndexOf("/"),a=r>=0?t.substring(0,r+1):"";t=this.start(t),this.reuseAssets(t,e,s)||(this.cache.assetsLoaded[t]=new Promise((r,n)=>{this.downloader.downloadText(t,h=>{try{let o=new v.Lw(h),l=o.pages.length,c=!1;for(let h of o.pages)this.loadTexture(i?i[h.name]:a+h.name,(s,i)=>{c||(h.setTexture(i),0==--l&&(this.success(e,t,o),r(o)))},(e,i)=>{if(!c){let i=`Couldn't load texture ${t} page image: ${e}`;this.error(s,t,i),n(i)}c=!0})}catch(i){let e=`Couldn't parse texture atlas ${t}: ${i.message}`;this.error(s,t,e),n(e)}},(e,i)=>{let r=`Couldn't load texture atlas ${t}: status ${e}, ${i}`;this.error(s,t,r),n(r)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},s=()=>{},i){t=this.start(t),this.reuseAssets(t,e,s)||(this.cache.assetsLoaded[t]=new Promise((i,r)=>{this.downloader.downloadText(t,a=>{try{let s=new v.Lw(a);this.success(e,t,s),i(s)}catch(i){let e=`Couldn't parse texture atlas ${t}: ${i.message}`;this.error(s,t,e),r(e)}},(e,i)=>{let a=`Couldn't load texture atlas ${t}: status ${e}, ${i}`;this.error(s,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,s)=>{this.loadBinary(t,(t,s)=>e(s),(t,e)=>s(e))})}async loadJsonAsync(t){return new Promise((e,s)=>{this.loadJson(t,(t,s)=>e(s),(t,e)=>s(e))})}async loadTextureAsync(t){return new Promise((e,s)=>{this.loadTexture(t,(t,s)=>e(s),(t,e)=>s(e))})}async loadTextureAtlasAsync(t){return new Promise((e,s)=>{this.loadTextureAtlas(t,(t,s)=>e(s),(t,e)=>s(e))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,s)=>{this.loadTextureAtlasButNoTextures(t,(t,s)=>e(s),(t,e)=>s(e))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.cache.assets[t];if(e)return e;let s=this.errors[t];throw Error("Asset not found: "+t+(s?"\n"+s:""))}remove(t){t=this.pathPrefix+t;let e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(let t in this.cache.assets){let e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={}
1,this.cache.assetsRefCount={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){0==--this.cache.assetsRefCount[t]&&this.remove(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}}class A{assets={};assetsRefCount={};assetsLoaded={};static AVAILABLE_CACHES=new Map;static getCache(t){let e=A.AVAILABLE_CACHES.get(t);if(e)return e;let s=new A;return A.AVAILABLE_CACHES.set(t,s),s}async addAsset(t,e){this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=await e}}class M{callbacks={};rawDataUris={};dataUriToString(t){if(!t.startsWith("data:"))throw Error("Not a data URI.");let e=t.indexOf("base64,");return -1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),s=e.length,i=new Uint8Array(s),r=0;r<s;r++)i[r]=e.charCodeAt(r);return i}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw Error("Not a data URI.");let e=t.indexOf("base64,");if(-1==e)throw Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,s){if(this.start(t,e,s))return;let i=this.rawDataUris[t];if(i&&!i.includes(".")){try{this.finish(t,200,this.dataUriToString(i))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.open("GET",i||t,!0);let a=()=>{this.finish(t,r.status,r.responseText)};r.onload=a,r.onerror=a,r.send()}downloadJson(t,e,s){this.downloadText(t,t=>{e(JSON.parse(t))},s)}downloadBinary(t,e,s){if(this.start(t,e,s))return;let i=this.rawDataUris[t];if(i&&!i.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(i))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let r=new XMLHttpRequest;r.open("GET",i||t,!0),r.responseType="arraybuffer";let a=()=>{this.finish(t,r.status,r.response)};r.onload=()=>{200==r.status||0==r.status?this.finish(t,200,new Uint8Array(r.response)):a()},r.onerror=a,r.send()}start(t,e,s){let i=this.callbacks[t];try{if(i)return!0;this.callbacks[t]=i=[]}finally{i.push(e,s)}}finish(t,e,s){let i=this.callbacks[t];delete this.callbacks[t];let r=200==e||0==e?[s]:[e,s];for(let t=r.length-1,e=i.length;t<e;t+=2)i[t].apply(null,r)}}class C{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(t,e){if(!t)throw Error("data cannot be null.");if(!e)throw Error("skeleton cannot be null.");this.data=t,this.bones=[];for(let s=0;s<t.bones.length;s++){let i=e.findBone(t.bones[s].name);if(!i)throw Error(`Couldn't find bone ${t.bones[s].name}`);this.bones.push(i)}let s=e.findBone(t.target.name);if(!s)throw Error(`Couldn't find bone ${t.target.name}`);this.target=s,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){let t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(0==this.mix)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}apply1(t,e,s,i,r,a,n){let h=t.parent;if(!h)throw Error("IK bone must have parent.");let o=h.a,c=h.b,d=h.c,u=h.d,g=-t.ashearX-t.arotation,f=0,p=0;switch(t.inherit){case b.u.OnlyTranslation:f=(e-t.worldX)*l.cj.signum(t.skeleton.scaleX),p=(s-t.worldY)*l.cj.signum(t.skeleton.scaleY);break;case b.u.NoRotationOrReflection:let m=Math.abs(o*u-c*d)/Math.max(1e-4,o*o+d*d),x=o/t.skeleton.scaleX,w=d/t.skeleton.scaleY;c=-w*m*t.skeleton.scaleX,u=x*m*t.skeleton.scaleY,g+=Math.atan2(w,x)*l.cj.radDeg;default:let v=e-h.worldX,y=s-h.worldY,A=o*u-c*d;1e-4>=Math.abs(A)?(f=0,p=0):(f=(v*u-y*c)/A-t.ax,p=(y*o-v*d)/A-t.ay)}g+=Math.atan2(p,f)*l.cj.radDeg,t.ascaleX<0&&(g+=180),g>180?g-=360:g<-180&&(g+=360);let M=t.ascaleX,C=t.ascaleY;if(i||r){switch(t.inherit){case b.u.NoScale:case b.u.NoScaleOrReflection:f=e-t.worldX,p=s-t.worldY}let h=t.data.length*M;if(h>1e-4){let t=f*f+p*p;if(i&&t<h*h||r&&t>h*h){let e=(Math.sqrt(t)/h-1)*n+1;M*=e,a&&(C*=e)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+g*n,M,C,t.ashearX,t.ashearY)}apply2(t,e,s,i,r,a,n,h,o){if(t.inherit!=b.u.Normal||e.inherit!=b.u.Normal)return;let c=t.ax,d=t.ay,u=t.ascaleX,g=t.ascaleY,f=u,p=g,m=e.ascaleX,x=0,w=0,v=0;u<0?(u=-u,x=180,v=-1):(x=0,v=1),g<0&&(g=-g,v=-v),m<0?(m=-m,w=180):w=0;let y=e.ax,A=0,M=0,C=0,R=t.a,T=t.b,E=t.c,S=t.d,Y=1e-4>=Math.abs(u-g);
1!Y||a?(A=0,M=R*y+t.worldX,C=E*y+t.worldY):(M=R*y+T*(A=e.ay)+t.worldX,C=E*y+S*A+t.worldY);let L=t.parent;if(!L)throw Error("IK parent must itself have a parent.");R=L.a,T=L.b,E=L.c;let P=R*(S=L.d)-T*E,X=M-L.worldX,I=C-L.worldY,O=(X*S-I*T)*(P=1e-4>=Math.abs(P)?0:1/P)-c,k=(I*R-X*E)*P-d,V=Math.sqrt(O*O+k*k),D=e.data.length*m,F,N;if(V<1e-4){this.apply1(t,s,i,!1,a,!1,o),e.updateWorldTransformWith(y,A,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}let B=((X=s-L.worldX)*S-(I=i-L.worldY)*T)*P-c,U=(I*R-X*E)*P-d,q=B*B+U*U;if(0!=h){h*=u*(m+1)*.5;let t=Math.sqrt(q),e=t-V-D*u+h;if(e>0){let s=Math.min(1,e/(2*h))-1;s=(e-h*(1-s*s))/t,B-=s*B,U-=s*U,q=B*B+U*U}}t:if(Y){let t=(q-V*V-(D*=u)*D)/(2*V*D);t<-1?(t=-1,N=Math.PI*r):t>1?(t=1,N=0,a&&(f*=R=(Math.sqrt(q)/(V+D)-1)*o+1,n&&(p*=R))):N=Math.acos(t)*r,F=Math.atan2(U*(R=V+D*t)-B*(T=D*Math.sin(N)),B*R+U*T)}else{let t=(R=u*D)*R,e=(T=g*D)*T,s=Math.atan2(U,B);E=e*V*V+t*q-t*e;let i=-2*e*V,a=e-t;if((S=i*i-4*a*E)>=0){let t=Math.sqrt(S);i<0&&(t=-t);let e=(t=-(.5*(i+t)))/a,n=E/t,h=Math.abs(e)<Math.abs(n)?e:n;if((e=q-h*h)>=0){F=s-Math.atan2(I=Math.sqrt(e)*r,h),N=Math.atan2(I/g,(h-V)/u);break t}}let n=l.cj.PI,h=V-R,o=h*h,c=0,d=0,f=V+R,p=f*f,m=0;(E=-R*V/(t-e))>=-1&&E<=1&&((S=(X=R*Math.cos(E=Math.acos(E))+V)*X+(I=T*Math.sin(E))*I)<o&&(n=E,o=S,h=X,c=I),S>p&&(d=E,p=S,f=X,m=I)),q<=(o+p)*.5?(F=s-Math.atan2(c*r,h),N=n*r):(F=s-Math.atan2(m*r,f),N=d*r)}let W=Math.atan2(A,y)*v,j=t.arotation;(F=(F-W)*l.cj.radDeg+x-j)>180?F-=360:F<-180&&(F+=360),t.updateWorldTransformWith(c,d,j+F*o,f,p,0,0),j=e.arotation,(N=((N+W)*l.cj.radDeg-e.ashearX)*v+w-j)>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(y,A,j+N*o,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}s(417);var R=s(28054);class T{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=[];positions=[];world=[];curves=[];lengths=[];segments=[];active=!1;constructor(t,e){if(!t)throw Error("data cannot be null.");if(!e)throw Error("skeleton cannot be null.");this.data=t,this.bones=[];for(let s=0,i=t.bones.length;s<i;s++){let i=e.findBone(t.bones[s].name);if(!i)throw Error(`Couldn't find bone ${t.bones[s].name}.`);this.bones.push(i)}let s=e.findSlot(t.target.name);if(!s)throw Error(`Couldn't find target bone ${t.target.name}`);this.target=s,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){let t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let e=this.target.getAttachment();if(!(e instanceof f))return;let s=this.mixRotate,i=this.mixX,r=this.mixY;if(0==s&&0==i&&0==r)return;let a=this.data,n=a.rotateMode==R.Dr.Tangent,h=a.rotateMode==R.Dr.ChainScale,o=this.bones,c=o.length,d=n?c:c+1,u=l.Aq.setArraySize(this.spaces,d),g=h?this.lengths=l.Aq.setArraySize(this.lengths,c):[],p=this.spacing;switch(a.spacingMode){case R.r9.Percent:if(h)for(let t=0,e=d-1;t<e;t++){let e=o[t],s=e.data.length,i=s*e.a,r=s*e.c;g[t]=Math.sqrt(i*i+r*r)}l.Aq.arrayFill(u,1,d,p);break;case R.r9.Proportional:let m=0;for(let t=0,e=d-1;t<e;){let e=o[t],s=e.data.length;if(s<T.epsilon)h&&(g[t]=0),u[++t]=p;else{let i=s*e.a,r=s*e.c,a=Math.sqrt(i*i+r*r);h&&(g[t]=a),u[++t]=a,m+=a}}if(m>0){m=d/m*p;for(let t=1;t<d;t++)u[t]*=m}break;default:let x=a.spacingMode==R.r9.Length;for(let t=0,e=d-1;t<e;){let e=o[t],s=e.data.length;if(s<T.epsilon)h&&(g[t]=0),u[++t]=p;else{let i=s*e.a,r=s*e.c,a=Math.sqrt(i*i+r*r);h&&(g[t]=a),u[++t]=(x?s+p:p)*a/s}}}let b=this.computeWorldPositions(e,d,n),w=b[0],v=b[1],y=a.offsetRotation,A=!1;if(0==y)A=a.rotateMode==R.Dr.Chain;else{A=!1;let t=this.target.bone;y*=t.a*t.d-t.b*t.c>0?l.cj.degRad:-l.cj.degRad}for(let t=0,e=3;t<c;t++,e+=3){let a=o[t];a.worldX+=(w-a.worldX)*i,a.worldY+=(v-a.worldY)*r;let c=b[e],d=b[e+1],f=c-w,p=d-v;if(h){let e=g[t];if(0!=e){let t=(Math.sqrt(f*f+p*p)/e-1)*s+1;a.a*=t,a.c*=t}}if(w=c,v=d,s>0){let i=a.a,r=a.b,h=a.c,o=a.d,c=0,d=0,g=0;if(c=(n?b[e-1]:0==u[t+1]?b[e+2]:Math.atan2(p,f))-Math.atan2(h,i),A){d=Math.cos(c),g=Math.sin(c);let t=a.data.length;w+=(t*(d*i-g*h)-f)*s,v+=(t*(g*i+d*h)-p)*s}else c+=y;c>l.cj.PI?c-=l.cj.PI2:c<-l.cj.PI&&(c+=l.cj.PI2),c*=s,a.a=(d=Math.cos(c))*i-(g=Math.sin(c))*h,a.b=d*r-g*o,a.c=g*i+d*h,a.d=g*r+d*o}a.updateAppliedTransform()}}computeWorldPositions(t,e,s){let i,r=this.target,a=this.position,n=this.spaces,h=l.Aq.setArraySize(this.positions,3*e+2),o=this.world,c=t.closed,d=t.worldVerticesLength,u=d/6,g=T.NONE;if(!t.constantSpeed){let i,f=t.lengths,p=f[u-=c?1:2];switch(this.data.positionMode==R.pw.Percent&&(a*=p),this.data.spacingMode){case R.r9.Percent:i=p;break;case R.r9.Proportional:i=p/e;break;default:i=1}o=l.Aq.setArraySize(this.world,8);for(let l=0,m=0,x=0;l<e;l++,m+=3){let e=n[l]*i,b=a+=e;if(c)(b%=p)<0&&(b+=p),x=0;else if(b<0){g!=T.BEFORE&&(g=T.BEFORE,t.computeWorldVertices(r,2,4,o,0,2)),this.addBeforePosition(b,o,0,h,m);continue}else if(b>p){g!=T.AFTER&&(g=T.AFTER,t.computeWorldVertices(r,d-6,4,o,0,2)),this.addAfterPosition(b-p,o,0,h,m);continue}for(;;x++){let t=f[x];if(!(b>t)){if(0==x)b/=t;else{let e=f[x-1];b=(b-e)/(t-e)}break}}x!=g&&(g=x,c&&x==u?(t.computeWorldVertices(r,d-4,4,o,0,2),t.computeWorldVertices(r,0,4,o,4,2)):t.computeWorldVertices(r,6*x+2,8,o,0,2)),this.addCurvePosition(b,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],h,m,s||l>0&&0==e)}return h}c?(d+=2,o=l.Aq.setArraySize(this.world,d),t.computeWorldVertices(r,2,d-4,o,0,2),t.computeWorldVertices(r,0,2,o,d-4,2),o[d-2]=o[0],o[d-1]=o[1]):(u--,d-=4,o=l.Aq.setArraySize(this.world,d),t.computeWorldVertices(r,2,d,o,0,2));let f=l.Aq.setArraySize(this.curves,u),p=0,m=o[0],x=o[1],b=0,w=0,v=0,y=0,A=0,M=0,C=0,E=0,S=0,Y=0,L=0,P=0,X=0,I=0;for(let t=0,e=2;t<u;t++,e+=6)b=o[e],w=o[e+1],v=o[e+2],y=o[e+3],A=o[e+4],M=o[e+5],C=(m-2*b+v)*.1875,E=(x-2*w+y)*.1875,S=((b-v)*3-m+A)*.09375,Y=((w-y)*3-x+M)*.09375,L=2*C+S,P=2*E+Y,p+=Math.sqrt((X=(b-m)*.75+C+.16666667*S)*X+(I=(w-x)*.75+E+.16666667*Y)*I),X+=L,I+=P,
1L+=S,P+=Y,p+=Math.sqrt(X*X+I*I),X+=L,I+=P,p+=Math.sqrt(X*X+I*I),X+=L+S,I+=P+Y,p+=Math.sqrt(X*X+I*I),f[t]=p,m=A,x=M;switch(this.data.positionMode==R.pw.Percent&&(a*=p),this.data.spacingMode){case R.r9.Percent:i=p;break;case R.r9.Proportional:i=p/e;break;default:i=1}let O=this.segments,k=0;for(let t=0,r=0,l=0,u=0;t<e;t++,r+=3){let e=n[t]*i,R=a+=e;if(c)(R%=p)<0&&(R+=p),l=0;else if(R<0){this.addBeforePosition(R,o,0,h,r);continue}else if(R>p){this.addAfterPosition(R-p,o,d-4,h,r);continue}for(;;l++){let t=f[l];if(!(R>t)){if(0==l)R/=t;else{let e=f[l-1];R=(R-e)/(t-e)}break}}if(l!=g){g=l;let t=6*l;for(m=o[t],x=o[t+1],b=o[t+2],w=o[t+3],v=o[t+4],y=o[t+5],A=o[t+6],M=o[t+7],C=(m-2*b+v)*.03,E=(x-2*w+y)*.03,S=((b-v)*3-m+A)*.006,Y=((w-y)*3-x+M)*.006,L=2*C+S,P=2*E+Y,k=Math.sqrt((X=(b-m)*.3+C+.16666667*S)*X+(I=(w-x)*.3+E+.16666667*Y)*I),O[0]=k,t=1;t<8;t++)X+=L,I+=P,L+=S,P+=Y,k+=Math.sqrt(X*X+I*I),O[t]=k;X+=L,I+=P,k+=Math.sqrt(X*X+I*I),O[8]=k,X+=L+S,I+=P+Y,k+=Math.sqrt(X*X+I*I),O[9]=k,u=0}for(R*=k;;u++){let t=O[u];if(!(R>t)){if(0==u)R/=t;else{let e=O[u-1];R=u+(R-e)/(t-e)}break}}this.addCurvePosition(.1*R,m,x,b,w,v,y,A,M,h,r,s||t>0&&0==e)}return h}addBeforePosition(t,e,s,i,r){let a=e[s],n=e[s+1],h=e[s+2]-a,o=Math.atan2(e[s+3]-n,h);i[r]=a+t*Math.cos(o),i[r+1]=n+t*Math.sin(o),i[r+2]=o}addAfterPosition(t,e,s,i,r){let a=e[s+2],n=e[s+3],h=a-e[s],o=Math.atan2(n-e[s+1],h);i[r]=a+t*Math.cos(o),i[r+1]=n+t*Math.sin(o),i[r+2]=o}addCurvePosition(t,e,s,i,r,a,n,h,o,l,c,d){if(0==t||isNaN(t)){l[c]=e,l[c+1]=s,l[c+2]=Math.atan2(r-s,i-e);return}let u=t*t,g=u*t,f=1-t,p=f*f,m=p*f,x=f*t,b=3*x,w=f*b,v=b*t,y=e*m+i*w+a*v+h*g,A=s*m+r*w+n*v+o*g;l[c]=y,l[c+1]=A,d&&(t<.001?l[c+2]=Math.atan2(r-s,i-e):l[c+2]=Math.atan2(A-(s*p+r*x*2+n*u),y-(e*p+i*x*2+a*u)))}}class E{data;_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw 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(t,e){this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.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(){let t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(t){let e=this.mix;if(0==e)return;let s=this.data.x>0,i=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,n=this.data.scaleX>0,h=this.bone,o=h.data.length;switch(t){case a.none:return;case a.reset:this.reset();case a.update:let c=this.skeleton,d=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=d,this.lastTime=c.time;let u=h.worldX,g=h.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=g;else{let t=this.remaining,a=this.inertia,f=this.data.step,p=this.skeleton.data.referenceScale,m=-1,x=this.data.limit*d,b=x*Math.abs(c.scaleY);if(x*=Math.abs(c.scaleX),s||i){if(s){let t=(this.ux-u)*a;this.xOffset+=t>x?x:t<-x?-x:t,this.ux=u}if(i){let t=(this.uy-g)*a;this.yOffset+=t>b?b:t<-b?-b:t,this.uy=g}if(t>=f){m=Math.pow(this.damping,60*f);let e=this.massInverse*f,r=this.strength,a=this.wind*p*c.scaleX,n=this.gravity*p*c.scaleY;do s&&(this.xVelocity+=(a-this.xOffset*r)*e,this.xOffset+=this.xVelocity*f,this.xVelocity*=m),i&&(this.yVelocity-=(n+this.yOffset*r)*e,this.yOffset+=this.yVelocity*f,this.yVelocity*=m),t-=f;while(t>=f)}s&&(h.worldX+=this.xOffset*e*this.data.x),i&&(h.worldY+=this.yOffset*e*this.data.y)}if(r||n){let s=Math.atan2(h.c,h.a),i=0,c=0,d=0,u=this.cx-h.worldX,g=this.cy-h.worldY;if(u>x?u=x:u<-x&&(u=-x),g>b?g=b:g<-b&&(g=-b),r){d=(this.data.rotate+this.data.shearX)*e;
1let t=Math.atan2(g+this.ty,u+this.tx)-s-this.rotateOffset*d;this.rotateOffset+=(t-Math.ceil(t*l.cj.invPI2-.5)*l.cj.PI2)*a,i=Math.cos(t=this.rotateOffset*d+s),c=Math.sin(t),n&&(t=o*h.getWorldScaleX())>0&&(this.scaleOffset+=(u*i+g*c)*a/t)}else{i=Math.cos(s),c=Math.sin(s);let t=o*h.getWorldScaleX();t>0&&(this.scaleOffset+=(u*i+g*c)*a/t)}if((t=this.remaining)>=f){-1==m&&(m=Math.pow(this.damping,60*f));let e=this.massInverse*f,a=this.strength,h=this.wind,l=L.yDown?-this.gravity:this.gravity,u=o/p;for(;;)if(t-=f,n&&(this.scaleVelocity+=(h*i-l*c-this.scaleOffset*a)*e,this.scaleOffset+=this.scaleVelocity*f,this.scaleVelocity*=m),r){if(this.rotateVelocity-=((h*c+l*i)*u+this.rotateOffset*a)*e,this.rotateOffset+=this.rotateVelocity*f,this.rotateVelocity*=m,t<f)break;let r=this.rotateOffset*d+s;i=Math.cos(r),c=Math.sin(r)}else if(t<f)break}}this.remaining=t}this.cx=h.worldX,this.cy=h.worldY;break;case a.pose:s&&(h.worldX+=this.xOffset*e*this.data.x),i&&(h.worldY+=this.yOffset*e*this.data.y)}if(r){let t=this.rotateOffset*e,s=0,i=0,r=0;if(this.data.shearX>0){let e=0;this.data.rotate>0&&(s=Math.sin(e=t*this.data.rotate),i=Math.cos(e),r=h.b,h.b=i*r-s*h.d,h.d=s*r+i*h.d),e+=t*this.data.shearX,s=Math.sin(e),i=Math.cos(e),r=h.a,h.a=i*r-s*h.c,h.c=s*r+i*h.c}else t*=this.data.rotate,s=Math.sin(t),i=Math.cos(t),r=h.a,h.a=i*r-s*h.c,h.c=s*r+i*h.c,r=h.b,h.b=i*r-s*h.d,h.d=s*r+i*h.d}if(n){let t=1+this.scaleOffset*e*this.data.scaleX;h.a*=t,h.c*=t}t!=a.pose&&(this.tx=o*h.a,this.ty=o*h.c),h.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(t,e,s){let i=s*l.cj.degRad,r=Math.cos(i),a=Math.sin(i),n=this.cx-t,h=this.cy-e;this.translate(n*r-h*a-n,n*a+h*r-h)}}class S{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=[];constructor(t,e){if(!t)throw Error("data cannot be null.");if(!e)throw Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new l.Q1,this.darkColor=t.darkColor?new l.Q1:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof c.e&&this.attachment instanceof c.e&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,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}}class Y{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new l.I9;active=!1;constructor(t,e){if(!t)throw Error("data cannot be null.");if(!e)throw Error("skeleton cannot be null.");this.data=t,this.bones=[];for(let s=0;s<t.bones.length;s++){let i=e.findBone(t.bones[s].name);if(!i)throw Error(`Couldn't find bone ${t.bones[s].name}.`);this.bones.push(i)}let s=e.findBone(t.target.name);if(!s)throw Error(`Couldn't find target bone ${t.target.name}.`);this.target=s,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}isActive(){return this.active}setToSetupPose(){let t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}update(t){(0!=this.mixRotate||0!=this.mixX||0!=this.mixY||0!=this.mixScaleX||0!=this.mixScaleY||0!=this.mixShearY)&&(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,n=0!=e||0!=s,h=this.target,o=h.a,c=h.b,d=h.c,u=h.d,g=o*u-c*d>0?l.cj.degRad:-l.cj.degRad,f=this.data.offsetRotation*g,p=this.data.offsetShearY*g,m=this.bones;for(let g=0,x=m.length;g<x;g++){let x=m[g];if(0!=t){let e=x.a,s=x.b,i=x.c,r=x.d,a=Math.atan2(d,o)-Math.atan2(i,e)+f;a>l.cj.PI?a-=l.cj.PI2:a<-l.cj.PI&&(a+=l.cj.PI2);let n=Math.cos(a*=t),h=Math.sin(a);x.a=n*e-h*i,x.b=n*s-h*r,x.c=h*e+n*i,x.d=h*s+n*r}if(n){let t=this.temp;h.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*s}if(0!=i){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(o*o+d*d)-t+this.data.offsetScaleX)*i)/t),x.a*=t,x.c*=t}if(0!=r){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(c*c+u*u)-t+this.data.offsetScaleY)*r)/t),x.b*=t,x.d*=t}if(a>0){let t=x.b,e=x.d,s=Math.atan2(e,t),i=Math.atan2(u,c)-Math.atan2(d,o)-(s-Math.atan2(x.c,x.a));i>l.cj.PI?i-=l.cj.PI2:i<-l.cj.PI&&(i+=l.cj.PI2);let r=Math.sqrt(t*t+e*e);x.b=Math.cos(i=s+(i+p)*a)*r,x.d=Math.sin(i)*r}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,n=0!=e||0!=s,h=this.target,o=h.a,c=h.b,d=h.c,u=h.d,g=o*u-c*d>0?l.cj.degRad:-l.cj.degRad,f=this.data.offsetRotation*g,p=this.data.offsetShearY*g,m=this.bones;for(let g=0,x=m.length;g<x;g++){let x=m[g];if(0!=t){let e=x.a,s=x.b,i=x.c,r=x.d,a=Math.atan2(d,o)+f;a>l.cj.PI?a-=l.cj.PI2:a<-l.cj.PI&&(a+=l.cj.PI2);let n=Math.cos(a*=t),h=Math.sin(a);x.a=n*e-h*i,x.b=n*s-h*r,x.c=h*e+n*i,x.d=h*s+n*r}if(n){let t=this.temp;h.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*s}if(0!=i){let t=(Math.sqrt(o*o+d*d)-1+this.data.offsetScaleX)*i+1;x.a*=t,x.c*=t}if(0!=r){let t=(Math.sqrt(c*c+u*u)-1+this.data.offsetScaleY)*r+1;x.b*=t,x.d*=t}if(a>0){let t=Math.atan2(u,c)-Math.atan2(d,o);t>l.cj.PI?t-=l.cj.PI2:t<-l.cj.PI&&(t+=l.cj.PI2);let e=x.b,s=x.d;t=Math.atan2(s,e)+(t-l.cj.PI/2+p)*a;let i=Math.sqrt(e*e+s*s);x.b=Math.cos(t)*i,x.d=Math.sin(t)*i}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,n=this.target,h=this.bones;for(let o=0,l=h.length;o<l;o++){let l=h[o],c=l.arotation;0!=t&&(c+=(n.arotation-c+this.data.offsetRotation)*t);let d=l.ax,u=l.ay;d+=(n.ax-d+this.data.offsetX)*e,u+=(n.ay-u+this.data.offsetY)*s;let g=l.ascaleX,f=l.ascaleY;0!=i&&0!=g&&(g=(g+(n.ascaleX-g+this.data.offsetScaleX)*i)/g),0!=r&&0!=f&&(f=(f+(n.ascaleY-f+this.data.offsetScaleY)*r)/f);let p=l.ashearY;0!=a&&(p+=(n.ashearY-p+this.data.offsetShearY)*a),l.updateWorldTransformWith(d,u,c,g,f,l.ashearX,p)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,n=this.target,h=this.bones;for(let o=0,l=h.length;o<l;o++){let l=h[o],c=l.arotation+(n.arotation+this.data.offsetRotation)*t,d=l.ax+(n.ax+this.data.offsetX)*e,u=l.ay+(n.ay+this.data.offsetY)*s,g=l.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*i+1),f=l.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*r+1),p=l.ashearY+(n.ashearY+this.data.offsetShearY)*a;l.updateWorldTransformWith(d,u,c,g,f,l.ashearX,p)}}}class L{static quadTriangles=[0,1,2,2,3,0];static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=[];skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return L.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;time=0;constructor(t){if(!t)throw Error("data cannot be null.");this.data=t,this.bones=[];for(let e=0;e<t.bones.length;e++){let s,i=t.bones[e];if(i.parent){let t=this.bones[i.parent.index];s=new w(i,this,t),t.children.push(s)}else s=new w(i,this,null);this.bones.push(s)}this.slots=[],this.drawOrder=[];for(let e=0;e<t.slots.length;e++){let s=t.slots[e],i=this.bones[s.boneData.index],r=new S(s,i);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=[];for(let e=0;e<t.ikConstraints.length;e++){let s=t.ikConstraints[e];this.ikConstraints.push(new C(s,this))}this.transformConstraints=[];for(let e=0;e<t.transformConstraints.length;e++){let s=t.transformConstraints[e];this.transformConstraints.push(new Y(s,this))}this.pathConstraints=[];for(let e=0;e<t.pathConstraints.length;e++){let s=t.pathConstraints[e];this.pathConstraints.push(new T(s,this))}this.physicsConstraints=[];for(let e=0;e<t.physicsConstraints.length;e++){let s=t.physicsConstraints[e];this.physicsConstraints.push(new E(s,this))}this.color=new l.Q1(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,s=t.length;e<s;e++){let s=t[e];s.sorted=s.data.skinRequired,s.active=!s.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,s=this.skin.bones.length;e<s;e++){let s=this.bones[t[e].index];do s.sorted=!1,s.active=!0,s=s.parent;while(s)}}let e=this.ikConstraints,s=this.transformConstraints,i=this.pathConstraints,r=this.physicsConstraints,a=e.length,n=s.length,h=i.length,o=this.physicsConstraints.length,l=a+n+h+o;t:for(let t=0;t<l;t++){for(let s=0;s<a;s++){let i=e[s];if(i.data.order==t){this.sortIkConstraint(i);continue t}}for(let e=0;e<n;e++){let i=s[e];if(i.data.order==t){this.sortTransformConstraint(i);continue t}}for(let e=0;e<h;e++){let s=i[e];if(s.data.order==t){this.sortPathConstraint(s);continue t}}for(let e=0;e<o;e++){let s=r[e];if(s.data.order==t){this.sortPhysicsConstraint(s);continue t}}}for(let e=0,s=t.length;e<s;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&l.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let s=t.bones,i=s[0];if(this.sortBone(i),1==s.length)this._updateCache.push(t),this.sortReset(i.children);else{let e=s[s.length-1];this.sortBone(e),this._updateCache.push(t),this.sortReset(i.children),e.sorted=!0}
1}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&l.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,s=e.data.index,i=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,i);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],s,i);let r=e.getAttachment();r instanceof f&&this.sortPathConstraintAttachmentWith(r,i);let a=t.bones,n=a.length;for(let t=0;t<n;t++)this.sortBone(a[t]);this._updateCache.push(t);for(let t=0;t<n;t++)this.sortReset(a[t].children);for(let t=0;t<n;t++)a[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&l.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,s=e.length;if(t.data.local)for(let t=0;t<s;t++){let s=e[t];this.sortBone(s.parent),this.sortBone(s)}else for(let t=0;t<s;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<s;t++)this.sortReset(e[t].children);for(let t=0;t<s;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,s){let i=t.attachments[e];if(i)for(let t in i)this.sortPathConstraintAttachmentWith(i[t],s)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof f))return;let s=t.bones;if(s){let t=this.bones;for(let e=0,i=s.length;e<i;){let i=s[e++];for(i+=e;e<i;)this.sortBone(t[s[e++]])}}else this.sortBone(e)}sortPhysicsConstraint(t){let e=t.bone;t.active=e.active&&(!t.data.skinRequired||null!=this.skin&&l.Aq.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)}sortBone(t){if(!t||t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,s=t.length;e<s;e++){let s=t[e];s.active&&(s.sorted&&this.sortReset(s.children),s.sorted=!1)}}updateWorldTransform(t){if(null==t)throw Error("physics is undefined");let e=this.bones;for(let t=0,s=e.length;t<s;t++){let s=e[t];s.ax=s.x,s.ay=s.y,s.arotation=s.rotation,s.ascaleX=s.scaleX,s.ascaleY=s.scaleY,s.ashearX=s.shearX,s.ashearY=s.shearY}let s=this._updateCache;for(let e=0,i=s.length;e<i;e++)s[e].update(t)}updateWorldTransformWith(t,e){if(!e)throw Error("parent cannot be null.");let s=this.bones;for(let t=1,e=s.length;t<e;t++){let e=s[t];e.ax=e.x,e.ay=e.y,e.arotation=e.rotation,e.ascaleX=e.scaleX,e.ascaleY=e.scaleY,e.ashearX=e.shearX,e.ashearY=e.shearY}let i=this.getRootBone();if(!i)throw Error("Root bone must not be null.");let r=e.a,a=e.b,n=e.c,h=e.d;i.worldX=r*this.x+a*this.y+e.worldX,i.worldY=n*this.x+h*this.y+e.worldY;let o=(i.rotation+i.shearX)*l.cj.degRad,c=(i.rotation+90+i.shearY)*l.cj.degRad,d=Math.cos(o)*i.scaleX,u=Math.cos(c)*i.scaleY,g=Math.sin(o)*i.scaleX,f=Math.sin(c)*i.scaleY;i.a=(r*d+a*g)*this.scaleX,i.b=(r*u+a*f)*this.scaleX,i.c=(n*d+h*g)*this.scaleY,i.d=(n*u+h*f)*this.scaleY;let p=this._updateCache;for(let e=0,s=p.length;e<s;e++){let s=p[e];s!=i&&s.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(let t of this.bones)t.setToSetupPose();for(let t of this.ikConstraints)t.setToSetupPose();for(let t of this.transformConstraints)t.setToSetupPose();for(let t of this.pathConstraints)t.setToSetupPose();for(let t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;l.Aq.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,s=t.length;e<s;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}findSlot(t){if(!t)throw Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s],r=i.data.attachmentName;if(r){let e=t.getAttachment(s,r);e&&i.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let s=this.data.findSlot(t);if(!s)throw Error(`Can't find slot with name ${t}`);return this.getAttachment(s.index,e)}getAttachment(t,e){if(!e)throw Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw Error("slotName cannot be null.");let s=this.slots;for(let i=0,r=s.length;i<r;i++){let r=s[i];if(r.data.name==t){let s=null;if(e&&!(s=this.getAttachment(i,e)))throw Error("Attachment not found: "+e+", for slot: "+t);r.setAttachment(s);return}}throw Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw Error("constraintName cannot be null.");return this.ikConstraints.find(e=>e.data.name==t)??null}findTransformConstraint(t){if(!t)throw Error("constraintName cannot be null.");return this.transformConstraints.find(e=>e.data.name==t)??null}findPathConstraint(t){if(!t)throw Error("constraintName cannot be null.");return this.pathConstraints.find(e=>e.data.name==t)??null}findPhysicsConstraint(t){if(null==t)throw Error("constraintName cannot be null.");return this.physicsConstraints.find(e=>e.data.name==t)??null}getBoundsRect(t){let e=new l.I9,s=new l.I9;return this.getBounds(e,s,void 0,t),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(t,e,s=[,,],i=null){if(!t)throw Error("offset cannot be null.");if(!e)throw Error("size cannot be null.");let r=this.drawOrder,a=1/0,n=1/0,h=-1/0,o=-1/0;for(let t=0,e=r.length;t<e;t++){let e=r[t];if(!e.bone.active)continue;let c=0,d=null,f=null,p=e.getAttachment();if(p instanceof m)c=8,d=l.Aq.setArraySize(s,c,0),p.computeWorldVertices(e,d,0,2),f=L.quadTriangles;else if(p instanceof g.f)c=p.worldVerticesLength,d=l.Aq.setArraySize(s,c,0),p.computeWorldVertices(e,0,c,d,0,2),f=p.triangles;else if(p instanceof u&&null!=i){i.clipStart(e,p);continue}if(d&&f){null!=i&&i.isClipping()&&(i.clipTriangles(d,f,f.length),d=i.clippedVertices,c=i.clippedVertices.length);for(let t=0,e=d.length;t<e;t+=2){let e=d[t],s=d[t+1];a=Math.min(a,e),n=Math.min(n,s),h=Math.max(h,e),o=Math.max(o,s)}}null!=i&&i.clipEndWithSlot(e)}null!=i&&i.clipEnd(),t.set(a,n),e.set(h-a,o-n)}update(t){this.time+=t}physicsTranslate(t,e){let s=this.physicsConstraints;for(let i=0,r=s.length;i<r;i++)s[i].translate(t,e)}physicsRotate(t,e,s){let i=this.physicsConstraints;for(let r=0,a=i.length;r<a;r++)i[r].rotate(t,e,s)}}(i=a||(a={}))[i.none=0]="none",i[i.reset=1]="reset",i[i.update=2]="update",i[i.pose=3]="pose";var P=s(69728);class X{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=[];polygons=[];polygonPool=new l.bC(()=>l.Aq.newFloatArray(16));update(t,e){if(!t)throw Error("skeleton cannot be null.");let s=this.boundingBoxes,i=this.polygons,r=this.polygonPool,a=t.slots,n=a.length;s.length=0,r.freeAll(i),i.length=0;for(let t=0;t<n;t++){let e=a[t];
1if(!e.bone.active)continue;let n=e.getAttachment();if(n instanceof d){s.push(n);let t=r.obtain();t.length!=n.worldVerticesLength&&(t=l.Aq.newFloatArray(n.worldVerticesLength)),i.push(t),n.computeWorldVertices(e,0,n.worldVerticesLength,t,0,2)}}e?this.aabbCompute():(this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0)}aabbCompute(){let t=1/0,e=1/0,s=-1/0,i=-1/0,r=this.polygons;for(let a=0,n=r.length;a<n;a++){let n=r[a];for(let r=0,a=n.length;r<a;r+=2){let a=n[r],h=n[r+1];t=Math.min(t,a),e=Math.min(e,h),s=Math.max(s,a),i=Math.max(i,h)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,i){let r=this.minX,a=this.minY,n=this.maxX,h=this.maxY;if(t<=r&&s<=r||e<=a&&i<=a||t>=n&&s>=n||e>=h&&i>=h)return!1;let o=(i-e)/(s-t),l=o*(r-t)+e;if(l>a&&l<h||(l=o*(n-t)+e)>a&&l<h)return!0;let c=(a-e)/o+t;return!!(c>r)&&!!(c<n)||!!((c=(h-e)/o+t)>r)&&!!(c<n)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let s=this.polygons;for(let i=0,r=s.length;i<r;i++)if(this.containsPointPolygon(s[i],t,e))return this.boundingBoxes[i];return null}containsPointPolygon(t,e,s){let i=t.length,r=i-2,a=!1;for(let n=0;n<i;n+=2){let i=t[n+1],h=t[r+1];if(i<s&&h>=s||h<s&&i>=s){let o=t[n];o+(s-i)/(h-i)*(t[r]-o)<e&&(a=!a)}r=n}return a}intersectsSegment(t,e,s,i){let r=this.polygons;for(let a=0,n=r.length;a<n;a++)if(this.intersectsSegmentPolygon(r[a],t,e,s,i))return this.boundingBoxes[a];return null}intersectsSegmentPolygon(t,e,s,i,r){let a=t.length,n=e-i,h=s-r,o=e*r-s*i,l=t[a-2],c=t[a-1];for(let d=0;d<a;d+=2){let a=t[d],u=t[d+1],g=l*u-c*a,f=l-a,p=c-u,m=n*p-h*f,x=(o*f-n*g)/m;if((x>=l&&x<=a||x>=a&&x<=l)&&(x>=e&&x<=i||x>=i&&x<=e)){let t=(o*p-h*g)/m;if((t>=c&&t<=u||t>=u&&t<=c)&&(t>=s&&t<=r||t>=r&&t<=s))return!0}l=a,c=u}return!1}getPolygon(t){if(!t)throw Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return -1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class I{convexPolygons=[];convexPolygonsIndices=[];indicesArray=[];isConcaveArray=[];triangles=[];polygonPool=new l.bC(()=>[]);polygonIndicesPool=new l.bC(()=>[]);triangulate(t){let e=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t<e;t++)s[t]=t;let i=this.isConcaveArray;i.length=0;for(let r=0,a=e;r<a;++r)i[r]=I.isConcave(r,e,t,s);let r=this.triangles;for(r.length=0;e>3;){let a=e-1,n=0,h=1;for(;;){t:if(!i[n]){let r=s[a]<<1,o=s[n]<<1,l=s[h]<<1,c=t[r],d=t[r+1],u=t[o],g=t[o+1],f=t[l],p=t[l+1];for(let r=(h+1)%e;r!=a;r=(r+1)%e){if(!i[r])continue;let e=s[r]<<1,a=t[e],n=t[e+1];if(I.positiveArea(f,p,c,d,a,n)&&I.positiveArea(c,d,u,g,a,n)&&I.positiveArea(u,g,f,p,a,n))break t}break}if(0==h){do{if(!i[n])break;n--}while(n>0);break}a=n,n=h,h=(h+1)%e}r.push(s[(e+n-1)%e]),r.push(s[n]),r.push(s[(n+1)%e]),s.splice(n,1),i.splice(n,1);let o=(--e+n-1)%e,l=n==e?0:n;i[o]=I.isConcave(o,e,t,s),i[l]=I.isConcave(l,e,t,s)}return 3==e&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let n=-1,h=0;for(let o=0,l=e.length;o<l;o+=3){let l=e[o]<<1,c=e[o+1]<<1,d=e[o+2]<<1,u=t[l],g=t[l+1],f=t[c],p=t[c+1],m=t[d],x=t[d+1],b=!1;if(n==l){let t=a.length-4,e=I.winding(a[t],a[t+1],a[t+2],a[t+3],m,x),s=I.winding(m,x,a[0],a[1],a[2],a[3]);e==h&&s==h&&(a.push(m),a.push(x),r.push(d),b=!0)}b||(a.length>0?(s.push(a),i.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),(a=this.polygonPool.obtain()).length=0,a.push(u),a.push(g),a.push(f),a.push(p),a.push(m),a.push(x),(r=this.polygonIndicesPool.obtain()).length=0,r.push(l),r.push(c),r.push(d),h=I.winding(u,g,f,p,m,x),n=l)}a.length>0&&(s.push(a),i.push(r));for(let t=0,e=s.length;t<e;t++){if(0==(r=i[t]).length)continue;let n=r[0],h=r[r.length-1],o=(a=s[t]).length-4,l=a[o],c=a[o+1],d=a[o+2],u=a[o+3],g=a[0],f=a[1],p=a[2],m=a[3],x=I.winding(l,c,d,u,g,f);for(let o=0;o<e;o++){if(o==t)continue;let e=i[o];if(3!=e.length)continue;let b=e[0],w=e[1],v=e[2],y=s[o],A=y[y.length-2],M=y[y.length-1];if(b!=n||w!=h)continue;let C=I.winding(l,c,d,u,A,M),R=I.winding(A,M,g,f,p,m);C==x&&R==x&&(y.length=0,e.length=0,a.push(A),a.push(M),r.push(v),l=d,c=u,d=A,u=M,o=0)}}for(let t=s.length-1;t>=0;t--)0==(a=s[t]).length&&(s.splice(t,1),this.polygonPool.free(a),r=i[t],i.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,s,i){let r=i[(e+t-1)%e]<<1,a=i[t]<<1,n=i[(t+1)%e]<<1;return!this.positiveArea(s[r],s[r+1],s[a],s[a+1],s[n],s[n+1])}static positiveArea(t,e,s,i,r,a){return t*(a-i)+s*(e-a)+r*(i-e)>=0}static winding(t,e,s,i,r,a){let n=s-t,h=i-e;return r*h-a*n+n*e-t*h>=0?1:-1}}class O{triangulator=new I;clippingPolygon=[];clipOutput=[];clippedVertices=[];clippedUVs=[];clippedTriangles=[];
1scratch=[];clipAttachment=null;clippingPolygons=null;clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let s=e.worldVerticesLength,i=l.Aq.setArraySize(this.clippingPolygon,s);e.computeWorldVertices(t,0,s,i,0,2);let r=this.clippingPolygon;O.makeClockwise(r);let a=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let t=0,e=a.length;t<e;t++){let e=a[t];O.makeClockwise(e),e.push(e[0]),e.push(e[1])}return a.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return null!=this.clipAttachment}clipTriangles(t,e,s,i,r,a,n,h){let o,l,c,d,u,g;"number"==typeof e?(o=s,l=i,c=r,d=a,u=n,g=h):(o=e,l=s,c=i,d=r,u=a,g=n),c&&d&&u&&"boolean"==typeof g?this.clipTrianglesRender(t,o,l,c,d,u,g):this.clipTrianglesNoRender(t,o,l)}clipTrianglesNoRender(t,e,s){let i=this.clipOutput,r=this.clippedVertices,a=this.clippedTriangles,n=this.clippingPolygons,h=n.length,o=0;r.length=0,a.length=0;for(let c=0;c<s;c+=3){let s=e[c]<<1,d=t[s],u=t[s+1],g=t[s=e[c+1]<<1],f=t[s+1],p=t[s=e[c+2]<<1],m=t[s+1];for(let t=0;t<h;t++){let e=r.length;if(this.clip(d,u,g,f,p,m,n[t],i)){let t=i.length;if(0==t)continue;let s=t>>1,n=this.clipOutput,h=l.Aq.setArraySize(r,e+2*s);for(let s=0;s<t;s+=2,e+=2){let t=n[s],i=n[s+1];h[e]=t,h[e+1]=i}e=a.length;let c=l.Aq.setArraySize(a,e+3*(s-2));s--;for(let t=1;t<s;t++,e+=3)c[e]=o,c[e+1]=o+t,c[e+2]=o+t+1;o+=s+1}else{let t=l.Aq.setArraySize(r,e+6);t[e]=d,t[e+1]=u,t[e+2]=g,t[e+3]=f,t[e+4]=p,t[e+5]=m,e=a.length;let s=l.Aq.setArraySize(a,e+3);s[e]=o,s[e+1]=o+1,s[e+2]=o+2,o+=3;break}}}}clipTrianglesRender(t,e,s,i,r,a,n){let h=this.clipOutput,o=this.clippedVertices,c=this.clippedTriangles,d=this.clippingPolygons,u=d.length,g=n?12:8,f=0;o.length=0,c.length=0;for(let p=0;p<s;p+=3){let s=e[p]<<1,m=t[s],x=t[s+1],b=i[s],w=i[s+1],v=t[s=e[p+1]<<1],y=t[s+1],A=i[s],M=i[s+1],C=t[s=e[p+2]<<1],R=t[s+1],T=i[s],E=i[s+1];for(let t=0;t<u;t++){let e=o.length;if(this.clip(m,x,v,y,C,R,d[t],h)){let t=h.length;if(0==t)continue;let s=y-R,i=C-v,d=m-C,u=R-x,p=1/(s*d+i*(x-R)),S=t>>1,Y=this.clipOutput,L=l.Aq.setArraySize(o,e+S*g);for(let h=0;h<t;h+=2,e+=g){let t=Y[h],o=Y[h+1];L[e]=t,L[e+1]=o,L[e+2]=r.r,L[e+3]=r.g,L[e+4]=r.b,L[e+5]=r.a;let l=t-C,c=o-R,g=(s*l+i*c)*p,f=(u*l+d*c)*p,m=1-g-f;L[e+6]=b*g+A*f+T*m,L[e+7]=w*g+M*f+E*m,n&&(L[e+8]=a.r,L[e+9]=a.g,L[e+10]=a.b,L[e+11]=a.a)}e=c.length;let P=l.Aq.setArraySize(c,e+3*(S-2));S--;for(let t=1;t<S;t++,e+=3)P[e]=f,P[e+1]=f+t,P[e+2]=f+t+1;f+=S+1}else{let t=l.Aq.setArraySize(o,e+3*g);t[e]=m,t[e+1]=x,t[e+2]=r.r,t[e+3]=r.g,t[e+4]=r.b,t[e+5]=r.a,n?(t[e+6]=b,t[e+7]=w,t[e+8]=a.r,t[e+9]=a.g,t[e+10]=a.b,t[e+11]=a.a,t[e+12]=v,t[e+13]=y,t[e+14]=r.r,t[e+15]=r.g,t[e+16]=r.b,t[e+17]=r.a,t[e+18]=A,t[e+19]=M,t[e+20]=a.r,t[e+21]=a.g,t[e+22]=a.b,t[e+23]=a.a,t[e+24]=C,t[e+25]=R,t[e+26]=r.r,t[e+27]=r.g,t[e+28]=r.b,t[e+29]=r.a,t[e+30]=T,t[e+31]=E,t[e+32]=a.r,t[e+33]=a.g,t[e+34]=a.b,t[e+35]=a.a):(t[e+6]=b,t[e+7]=w,t[e+8]=v,t[e+9]=y,t[e+10]=r.r,t[e+11]=r.g,t[e+12]=r.b,t[e+13]=r.a,t[e+14]=A,t[e+15]=M,t[e+16]=C,t[e+17]=R,t[e+18]=r.r,t[e+19]=r.g,t[e+20]=r.b,t[e+21]=r.a,t[e+22]=T,t[e+23]=E),e=c.length;let s=l.Aq.setArraySize(c,e+3);s[e]=f,s[e+1]=f+1,s[e+2]=f+2,f+=3;break}}}}clipTrianglesUnpacked(t,e,s,i){let r=this.clipOutput,a=this.clippedVertices,n=this.clippedUVs,h=this.clippedTriangles,o=this.clippingPolygons,c=o.length,d=0;a.length=0,n.length=0,h.length=0;for(let u=0;u<s;u+=3){let s=e[u]<<1,g=t[s],f=t[s+1],p=i[s],m=i[s+1],x=t[s=e[u+1]<<1],b=t[s+1],w=i[s],v=i[s+1],y=t[s=e[u+2]<<1],A=t[s+1],M=i[s],C=i[s+1];for(let t=0;t<c;t++){let e=a.length;if(this.clip(g,f,x,b,y,A,o[t],r)){let t=r.length;if(0==t)continue;let s=b-A,i=y-x,o=g-y,c=A-f,u=1/(s*o+i*(f-A)),R=t>>1,T=this.clipOutput,E=l.Aq.setArraySize(a,e+2*R),S=l.Aq.setArraySize(n,e+2*R);for(let r=0;r<t;r+=2,e+=2){let t=T[r],a=T[r+1];E[e]=t,E[e+1]=a;let n=t-y,h=a-A,l=(s*n+i*h)*u,d=(c*n+o*h)*u,g=1-l-d;S[e]=p*l+w*d+M*g,S[e+1]=m*l+v*d+C*g}e=h.length;let Y=l.Aq.setArraySize(h,e+3*(R-2));R--;for(let t=1;t<R;t++,e+=3)Y[e]=d,Y[e+1]=d+t,Y[e+2]=d+t+1;d+=R+1}else{let t=l.Aq.setArraySize(a,e+6);t[e]=g,t[e+1]=f,t[e+2]=x,t[e+3]=b,t[e+4]=y,t[e+5]=A;let s=l.Aq.setArraySize(n,e+6);s[e]=p,s[e+1]=m,s[e+2]=w,s[e+3]=v,s[e+4]=M,s[e+5]=C,e=h.length;let i=l.Aq.setArraySize(h,e+3);i[e]=d,i[e+1]=d+1,i[e+2]=d+2,d+=3;break}}}}clip(t,e,s,i,r,a,n,h){let o,l=h,c=!1;n.length%4>=2?(o=h,h=this.scratch):o=this.scratch,o.length=0,o.push(t),o.push(e),o.push(s),o.push(i),o.push(r),o.push(a),o.push(t),o.push(e),h.length=0;let d=n.length-4;for(let t=0;;t+=2){let e=n[t],s=n[t+1],i=e-n[t+2],r=s-n[t+3],a=h.length,u=o;for(let t=0,a=o.length-2;t<a;){let a=u[t],n=u[t+1],o=u[t+=2],l=u[t+1],d=r*(e-o)>i*(s-l),g=r*(e-a)-i*(s-n);if(g>0){if(d){h.push(o),h.push(l);continue}let t=o-a,e=l-n,s=g/(t*r-e*i);if(s>=0&&s<=1)h.push(a+t*s),h.push(n+e*s);else{h.push(o),h.push(l);continue}}
1else if(d){let t=o-a,e=l-n,s=g/(t*r-e*i);if(s>=0&&s<=1)h.push(a+t*s),h.push(n+e*s),h.push(o),h.push(l);else{h.push(o),h.push(l);continue}}c=!0}if(a==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),t==d)break;let g=h;(h=o).length=0,o=g}if(l!=h){l.length=0;for(let t=0,e=h.length-2;t<e;t++)l[t]=h[t]}else l.length=l.length-2;return c}static makeClockwise(t){let e=t.length,s=t[e-2]*t[1]-t[0]*t[e-1],i=0,r=0,a=0;for(let n=0,h=e-3;n<h;n+=2)i=t[n],r=t[n+1],a=t[n+2],s+=i*t[n+3]-a*r;if(!(s<0))for(let s=0,i=e-2,r=e>>1;s<r;s+=2){let e=t[s],r=t[s+1],a=i-s;t[s]=t[a],t[s+1]=t[a+1],t[a]=e,t[a+1]=r}}}var k=s(45219);s(58199);var V=s(84734),D=s(63501);s(48317),void 0===Math.fround&&(Math.fround=(r=new Float32Array(1),function(t){return r[0]=t,r[0]}))},54406:(t,e,s)=>{s.d(e,{dK:()=>i.d});var i=s(40859);s(49481),s(86041)},58199:(t,e,s)=>{s.d(e,{M:()=>n});var i=s(39681),r=s(16139);class a{slotIndex;name;attachment;constructor(t=0,e,s){this.slotIndex=t,this.name=e,this.attachment=s}}class n{name;attachments=[];bones=[];constraints=[];color=new r.Q1(.99607843,.61960787,.30980393,1);constructor(t){if(!t)throw Error("name cannot be null.");this.name=t}setAttachment(t,e,s){if(!s)throw Error("attachment cannot be null.");let i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=s}addSkin(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e],i=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){i=!0;break}i||this.bones.push(s)}for(let e=0;e<t.constraints.length;e++){let s=t.constraints[e],i=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){i=!0;break}i||this.constraints.push(s)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var s=e[t];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e],i=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){i=!0;break}i||this.bones.push(s)}for(let e=0;e<t.constraints.length;e++){let s=t.constraints[e],i=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){i=!0;break}i||this.constraints.push(s)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var s=e[t];s.attachment&&(s.attachment instanceof i.f?s.attachment=s.attachment.newLinkedMesh():s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment))}}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){let s=this.attachments[t];s&&delete s[e]}getAttachments(){let t=[];for(var e=0;e<this.attachments.length;e++){let s=this.attachments[e];if(s)for(let i in s){let r=s[i];r&&t.push(new a(e,i,r))}}return t}getAttachmentsForSlot(t,e){let s=this.attachments[t];if(s)for(let i in s){let r=s[i];r&&e.push(new a(t,i,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let i=0;i<t.slots.length;i++){let r=t.slots[i],a=r.getAttachment();if(a&&s<e.attachments.length){let t=e.attachments[s];for(let e in t)if(a==t[e]){let t=this.getAttachment(s,e);t&&r.setAttachment(t);break}}s++}}}},60930:(t,e,s)=>{s.d(e,{J:()=>i});class i{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(t,e){if(!e)throw Error("data cannot be null.");this.time=t,this.data=e}}},62570:(t,e,s)=>{s.d(e,{R:()=>i});class i{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(t){this.name=t}}},63501:(t,e,s)=>{var i,r,a,n;s.d(e,{O$:()=>i,QL:()=>o,gP:()=>h,w3:()=>r});class h{_image;constructor(t){this._image=t}getImage(){return this._image}}(a=i||(i={}))[a.Nearest=9728]="Nearest",a[a.Linear=9729]="Linear",a[a.MipMap=9987]="MipMap",a[a.MipMapNearestNearest=9984]="MipMapNearestNearest",a[a.MipMapLinearNearest=9985]="MipMapLinearNearest",a[a.MipMapNearestLinear=9986]="MipMapNearestLinear",a[a.MipMapLinearLinear=9987]="MipMapLinearLinear",(n=r||(r={}))[n.MirroredRepeat=33648]="MirroredRepeat",n[n.ClampToEdge=33071]="ClampToEdge",n[n.Repeat=10497]="Repeat";class o{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0}},84734:(t,e,s)=>{s.d(e,{N:()=>r,P:()=>n});var i,r,a=s(16139);class n{index=0;name;boneData;color=new a.Q1(1,1,1,1);darkColor=null;attachmentName=null;blendMode=r.Normal;visible=!0;constructor(t,e,s){if(t<0)throw Error("index must be >= 0.");if(!e)throw Error("name cannot be null.");if(!s)throw Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=s}}(i=r||(r={}))[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"},86041:(t,e,s)=>{let i,r;s.d(e,{E:()=>f,pd:()=>O,xx:()=>$,Om:()=>u,OJ:()=>c,Mv:()=>K,Pq:()=>p});var a,n,h,o,l,c,d=s(49481);class u{canvas;gl;restorables=[];constructor(t,e={alpha:"true"}){t instanceof WebGLRenderingContext||"u">typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?(this.gl=t,this.canvas=this.gl.canvas):(this.gl=t.getContext("webgl2",e)||t.getContext("webgl",e),this.canvas=t,t.addEventListener("webglcontextlost",this.contextLostHandler),t.addEventListener("webglcontextrestored",this.contextRestoredHandler))}contextLostHandler(t){t&&t.preventDefault()}contextRestoredHandler(t){for(let t=0,e=this.restorables.length;t<e;
1t++)this.restorables[t].restore()}dispose(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler)}addRestorable(t){this.restorables.push(t)}removeRestorable(t){let e=this.restorables.indexOf(t);e>-1&&this.restorables.splice(e,1)}}class g extends d.gP{context;texture=null;boundUnit=0;useMipMaps=!1;static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;constructor(t,e,s=!1){super(e),this.context=t instanceof u?t:new u(t),this.useMipMaps=s,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let s=this.context.gl;this.bind(),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,g.validateMagFilter(e)),this.useMipMaps=g.usesMipMaps(t),this.useMipMaps&&s.generateMipmap(s.TEXTURE_2D)}static validateMagFilter(t){switch(t){case d.O$.MipMapLinearLinear:case d.O$.MipMapLinearNearest:case d.O$.MipMapNearestLinear:case d.O$.MipMapNearestNearest:return d.O$.Linear;default:return t}}static usesMipMaps(t){switch(t){case d.O$.MipMapLinearLinear:case d.O$.MipMapLinearNearest:case d.O$.MipMapNearestLinear:case d.O$.MipMapNearestNearest:return!0;default:return!1}}setWraps(t,e){let s=this.context.gl;this.bind(),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),g.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}}class f extends d.f{constructor(t,e="",s=new d._7){super(e=>new g(t,e),e,s)}}class p{x=0;y=0;z=0;constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.z=s}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,s){return this.x=t,this.y=e,this.z=s,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[m]+this.y*e[x]+this.z*e[b]+e[w],this.x*e[v]+this.y*e[y]+this.z*e[A]+e[M],this.x*e[C]+this.y*e[R]+this.z*e[T]+e[E])}project(t){let e=t.values,s=1/(this.x*e[S]+this.y*e[Y]+this.z*e[L]+e[P]);return this.set((this.x*e[m]+this.y*e[x]+this.z*e[b]+e[w])*s,(this.x*e[v]+this.y*e[y]+this.z*e[A]+e[M])*s,(this.x*e[C]+this.y*e[R]+this.z*e[T]+e[E])*s)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}}let m=0,x=4,b=8,w=12,v=1,y=5,A=9,M=13,C=2,R=6,T=10,E=14,S=3,Y=7,L=11,P=15;class X{temp=new Float32Array(16);values=new Float32Array(16);static xAxis=new p;static yAxis=new p;static zAxis=new p;static tmpMatrix=new X;constructor(){let t=this.values;t[m]=1,t[y]=1,t[T]=1,t[P]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[m]=e[m],t[x]=e[v],t[b]=e[C],t[w]=e[S],t[v]=e[x],t[y]=e[y],t[A]=e[R],t[M]=e[Y],t[C]=e[b],t[R]=e[A],t[T]=e[T],t[E]=e[L],t[S]=e[w],t[Y]=e[M],t[L]=e[E],t[P]=e[P],this.set(t)}identity(){let t=this.values;return t[m]=1,t[x]=0,t[b]=0,t[w]=0,t[v]=0,t[y]=1,t[A]=0,t[M]=0,t[C]=0,t[R]=0,t[T]=1,t[E]=0,t[S]=0,t[Y]=0,t[L]=0,t[P]=1,this}invert(){let t=this.values,e=this.temp,s=t[S]*t[R]*t[A]*t[w]-t[C]*t[Y]*t[A]*t[w]-t[S]*t[y]*t[T]*t[w]+t[v]*t[Y]*t[T]*t[w]+t[C]*t[y]*t[L]*t[w]-t[v]*t[R]*t[L]*t[w]-t[S]*t[R]*t[b]*t[M]+t[C]*t[Y]*t[b]*t[M]+t[S]*t[x]*t[T]*t[M]-t[m]*t[Y]*t[T]*t[M]-t[C]*t[x]*t[L]*t[M]+t[m]*t[R]*t[L]*t[M]+t[S]*t[y]*t[b]*t[E]-t[v]*t[Y]*t[b]*t[E]-t[S]*t[x]*t[A]*t[E]+t[m]*t[Y]*t[A]*t[E]+t[v]*t[x]*t[L]*t[E]-t[m]*t[y]*t[L]*t[E]-t[C]*t[y]*t[b]*t[P]+t[v]*t[R]*t[b]*t[P]+t[C]*t[x]*t[A]*t[P]-t[m]*t[R]*t[A]*t[P]-t[v]*t[x]*t[T]*t[P]+t[m]*t[y]*t[T]*t[P];if(0==s)throw Error("non-invertible matrix");let i=1/s;return e[m]=t[A]*t[E]*t[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[x]*t[L]*t[E]-t[m]*t[y]*t[L]*t[E]-t[C]*t[y]*t[b]*t[P]+t[v]*t[R]*t[b]*t[P]+t[C]*t[x]*t[A]*t[P]-t[m]*t[R]*t[A]*t[P]-t[v]*t[x]*t[T]*t[P]+t[m]*t[y]*t[T]*t[P]}translate(t,e,s){let i=this.values;return i[w]+=t,i[M]+=e,i[E]+=s,this}copy(){return new X().set(this.values)}projection(t,e,s,i){this.identity();let r=1/Math.tan(Math.PI/180*s/2),a=this.values;return a[m]=r/i,a[v]=0,a[C]=0,a[S]=0,a[x]=0,a[y]=r,a[R]=0,a[Y]=0,a[b]=0,a[A]=0,a[T]=(e+t)/(t-e),a[L]=-1,a[w]=0,a[M]=0,a[E]=2*e*t/(t-e),a[P]=0,this}ortho2d(t,e,s,i){return this.ortho(t,t+s,e,e+i,0,1)}ortho(t,e,s,i,r,a){this.identity();let n=this.values;return n[m]=2/(e-t),n[v]=0,n[C]=0,n[S]=0,n[x]=0,n[y]=2/(i-s),n[R]=0,n[Y]=0,n[b]=0,n[A]=0,n[T]=-2/(a-r),n[L]=0,n[w]=-(e+t)/(e-t),n[M]=-(i+s)/(i-s),n[E]=-(a+r)/(a-r),n[P]=1,this}multiply(t){let e=this.temp,s=this.values,i=t.values;return e[m]=s[m]*i[m]+s[x]*i[v]+s[b]*i[C]+s[w]*i[S],e[x]=s[m]*i[x]+s[x]*i[y]+s[b]*i[R]+s[w]*i[Y],e[b]=s[m]*i[b]+s[x]*i[A]+s[b]*i[T]+s[w]*i[L],e[w]=s[m]*i[w]+s[x]*i[M]+s[b]*i[E]+s[w]*i[P],e[v]=s[v]*i[m]+s[y]*i[v]+s[A]*i[C]+s[M]*i[S],e[y]=s[v]*i[x]+s[y]*i[y]+s[A]*i[R]+s[M]*i[Y],e[A]=s[v]*i[b]+s[y]*i[A]+s[A]*i[T]+s[M]*i[L],e[M]=s[v]*i[w]+s[y]*i[M]+s[A]*i[E]+s[M]*i[P],e[C]=s[C]*i[m]+s[R]*i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[A]+i[L]*s[T]+i[P]*s[L],e[P]=i[S]*s[w]+i[Y]*s[M]+i[L]*s[E]+i[P]*s[P],this.set(this.temp)}lookAt(t,e,s){let i=X.xAxis,r=X.yAxis,a=X.zAxis;a.setFrom(e).normalize(),i.setFrom(e).normalize(),i.cross(s).normalize(),r.setFrom(i).cross(a).normalize(),this.identity();let n=this.values;return n[m]=i.x,n[x]=i.y,n[b]=i.z,n[v]=r.x,n[y]=r.y,n[A]=r.z,n[C]=-a.x,n[R]=-a.y,n[T]=-a.z,X.tmpMatrix.identity(),X.tmpMatrix.values[w]=-t.x,X.tmpMatrix.values[M]=-t.y,X.tmpMatrix.values[E]=-t.z,this.multiply(X.tmpMatrix),this}}class I{position=new p(0,0,0);direction=new p(0,0,-1);up=new p(0,1,0);near=0;far=100;zoom=1;viewportWidth=0;
1viewportHeight=0;projectionView=new X;inverseProjectionView=new X;projection=new X;view=new X;constructor(t,e){this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,s=this.projectionView,i=this.inverseProjectionView,r=this.zoom,a=this.viewportWidth,n=this.viewportHeight;t.ortho(-a/2*r,a/2*r,-n/2*r,n/2*r,this.near,this.far),e.lookAt(this.position,this.direction,this.up),s.set(t.values),s.multiply(e),i.set(s.values).invert()}screenToWorld(t,e,s){let i=t.x,r=s-t.y-1;return t.x=2*i/e-1,t.y=2*r/s-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,s){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=s*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}}class O{element;mouseX=0;mouseY=0;buttonDown=!1;touch0=null;touch1=null;initialPinchDistance=0;listeners=[];autoPreventDefault;isTouch=!1;callbacks;constructor(t,e=!0){this.element=t,this.autoPreventDefault=e,this.callbacks=this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent&&!this.isTouch){let s=t.getBoundingClientRect();this.mouseX=e.clientX-s.left,this.mouseY=e.clientY-s.top,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.mouseX,this.mouseY,e)})}},s=e=>{if(e instanceof MouseEvent&&!this.isTouch){let s=t.getBoundingClientRect();this.mouseX=e.clientX-s.left,this.mouseY=e.clientY-s.top,this.listeners.map(t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY,e):t.moved&&t.moved(this.mouseX,this.mouseY,e)})}},i=e=>{if(e instanceof MouseEvent&&!this.isTouch){let s=t.getBoundingClientRect();this.mouseX=e.clientX-s.left,this.mouseY=e.clientY-s.top,this.buttonDown=!1,this.listeners.map(t=>{t.up&&t.up(this.mouseX,this.mouseY,e)})}},r=t=>{this.autoPreventDefault&&t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map(e=>{e.wheel&&e.wheel(t.deltaY,t)})},a=e=>{if(this.isTouch=!0,!this.touch0||!this.touch1){let s=e.changedTouches.item(0);if(!s)return;let i=t.getBoundingClientRect(),r=s.clientX-i.left,a=s.clientY-i.top,n=new k(s.identifier,r,a);if(this.mouseX=r,this.mouseY=a,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=n;let t=this.touch1.x-this.touch0.x,s=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+s*s),this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance,e)})}}else this.touch0=n,this.listeners.map(t=>{t.down&&t.down(n.x,n.y,e)})}this.autoPreventDefault&&e.preventDefault()},n=e=>{if(this.isTouch=!0,this.touch0){var s=e.changedTouches;let a=t.getBoundingClientRect();for(var i=0;i<s.length;i++){var r=s[i];let t=r.clientX-a.left,n=r.clientY-a.top;this.touch0.identifier===r.identifier&&(this.touch0.x=this.mouseX=t,this.touch0.y=this.mouseY=n,this.listeners.map(s=>{s.dragged&&s.dragged(t,n,e)})),this.touch1&&this.touch1.identifier===r.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=n)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,s=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+s*s);this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,i,e)})}}this.autoPreventDefault&&e.preventDefault()},h=e=>{if(this.isTouch=!0,this.touch0){var s=e.changedTouches;let a=t.getBoundingClientRect();for(var i=0;i<s.length;i++){var r=s[i];let t=r.clientX-a.left,n=r.clientY-a.top;if(this.touch0.identifier===r.identifier)if(this.touch0=null,this.mouseX=t,this.mouseY=n,this.listeners.map(s=>{s.up&&s.up(t,n,e)}),this.touch1)this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.touch0.x,this.touch0.y,e)});else{this.buttonDown=!1;break}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}this.autoPreventDefault&&e.preventDefault()};return t.addEventListener("mousedown",e,!0),t.addEventListener("mousemove",s,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",r,!0),t.addEventListener("touchstart",a,{passive:!1,capture:!1}),t.addEventListener("touchmove",n,{passive:!1,capture:!1}),t.addEventListener("touchend",h,{passive:!1,capture:!1}),t.addEventListener("touchcancel",h),{mouseDown:e,mouseMove:s,mou
1seUp:i,mouseWheel:r,touchStart:a,touchMove:n,touchEnd:h}}dispose(){let t=this.element;t.removeEventListener("mousedown",this.callbacks.mouseDown,!0),t.removeEventListener("mousemove",this.callbacks.mouseMove,!0),t.removeEventListener("mouseup",this.callbacks.mouseUp,!0),t.removeEventListener("wheel",this.callbacks.mouseWheel,!0),t.removeEventListener("touchstart",this.callbacks.touchStart,{capture:!1}),t.removeEventListener("touchmove",this.callbacks.touchMove,{capture:!1}),t.removeEventListener("touchend",this.callbacks.touchEnd,{capture:!1}),t.removeEventListener("touchcancel",this.callbacks.touchEnd),this.listeners.length=0}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}}class k{identifier;x;y;constructor(t,e,s){this.identifier=t,this.x=e,this.y=s}}class V{vertexShader;fragmentShader;static MVP_MATRIX="u_projTrans";static POSITION="a_position";static COLOR="a_color";static COLOR2="a_color2";static TEXCOORDS="a_texCoords";static SAMPLER="u_texture";context;vs=null;vsSource;fs=null;fsSource;program=null;tmp2x2=new Float32Array(4);tmp3x3=new Float32Array(9);tmp4x4=new Float32Array(16);getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}constructor(t,e,s){this.vertexShader=e,this.fragmentShader=s,this.vsSource=e,this.fsSource=s,this.context=t instanceof u?t:new u(t),this.context.addRestorable(this),this.compile()}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let s=this.context.gl,i=s.createShader(t);if(!i)throw Error("Couldn't create shader.");if(s.shaderSource(i,e),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS)){let t="Couldn't compile shader: "+s.getShaderInfoLog(i);if(s.deleteShader(i),!s.isContextLost())throw Error(t)}return i}compileProgram(t,e){let s=this.context.gl,i=s.createProgram();if(!i)throw Error("Couldn't compile program.");if(s.attachShader(i,t),s.attachShader(i,e),s.linkProgram(i),!s.getProgramParameter(i,s.LINK_STATUS)){let t="Couldn't compile shader program: "+s.getProgramInfoLog(i);if(s.deleteProgram(i),!s.isContextLost())throw Error(t)}return i}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,s){this.context.gl.uniform2f(this.getUniformLocation(t),e,s)}setUniform3f(t,e,s,i){this.context.gl.uniform3f(this.getUniformLocation(t),e,s,i)}setUniform4f(t,e,s,i,r){this.context.gl.uniform4f(this.getUniformLocation(t),e,s,i,r)}setUniform2x2f(t,e){let s=this.context.gl;this.tmp2x2.set(e),s.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let s=this.context.gl;this.tmp3x3.set(e),s.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let s=this.context.gl;this.tmp4x4.set(e),s.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw Error("Shader not compiled.");let s=e.getUniformLocation(this.program,t);if(!s&&!e.isContextLost())throw Error(`Couldn't find location for uniform ${t}`);return s}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw Error("Shader not compiled.");let s=e.getAttribLocation(this.program,t);if(-1==s&&!e.isContextLost())throw Error(`Couldn't find location for attribute ${t}`);return s}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=` 2attribute vec4 ${V.POSITION}; 3attribute vec4 ${V.COLOR}; 4attribute vec2 ${V.TEXCOORDS}; 5uniform mat4 ${V.MVP_MATRIX}; 6varying vec4 v_color; 7varying vec2 v_texCoords; 8 9void main () { 10 v_color = ${V.COLOR}; 11 v_texCoords = ${V.TEXCOORDS}; 12 gl_Position = ${V.MVP_MATRIX} * ${V.POSITION}; 13} 14`;return new V(t,e,` 15#ifdef GL_ES 16 #define LOWP lowp 17 precision mediump float; 18#else 19 #define LOWP 20#endif 21varying LOWP vec4 v_color; 22varying vec2 v_texCoords; 23uniform sampler2D u_texture; 24 25void main () { 26 gl_FragColor = v_color * texture2D(u_texture, v_texCoords); 27} 28`)}static newTwoColoredTextured(t){let e=` 29attribute vec4 ${V.POSITION}; 30attribute vec4 ${V.COLOR}; 31attribute vec4 ${V.COLOR2}; 32attribute vec2 ${V.TEXCOORDS}; 33uniform mat4 ${V.MVP_MATRIX}; 34varying vec4 v_light; 35varying vec4 v_dark; 36varying vec2 v_texCoords; 37 38void main () { 39 v_light = ${V.COLOR}; 40 v_dark = ${V.COLOR2}; 41 v_texCoords = ${V.TEXCOORDS}; 42 gl_Position = ${V.MVP_MATRIX} * ${V.POSITION}; 43} 44`;return new V(t,e,` 45#ifdef GL_ES 46 #define LOWP lowp 47 precision mediump float; 48#else 49 #define LOWP 50#endif 51varying LOWP vec4 v_light; 52varying LOWP vec4 v_dark; 53varying vec2 v_texCoords; 54uniform sampler2D u_texture; 55 56void main () { 57 vec4 texColor = texture2D(u_texture, v_texCoords); 58 gl_FragColor.a = texColor.a * v_light.a; 59 gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; 60} 61`)}static newColored(t){let e=` 62attribute vec4 ${V.POSITION}; 63attribute vec4 ${V.COLOR}; 64uniform mat4 ${V.MVP_MATRIX}; 65varying vec4 v_color; 66 67void main () { 68 v_color = ${V.COLOR}; 69 gl_Position = ${V.MVP_MATRIX} * ${V.POSITION}; 70} 71`;return new V(t,e,` 72#ifdef GL_ES 73 #define LOWP lowp 74 precision mediump float; 75#else 76 #define LOWP 77#endif 78varying LOWP vec4 v_color; 79 80void main () { 81 gl_FragColor = v_color; 82} 83`)}}class D{attributes;context;vertices;verticesBuffer=null;verticesLength=0;dirtyVertices=!1;indices;indicesBuffer=null;indicesLength=0;dirtyIndices=!1;elementsPerVertex=0;getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(t){this.dirtyVertices=!0,this.verticesLength=t}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(t){this.dirtyIndices=!0,this.indicesLength=t}getIndices(){return this.indices}getVertexSizeInFloats(){let t=0;for(var e=0;e<this.attributes.length;e++)t+=this.attributes[e].numElements;return t}constructor(t,e,s,i){this.attributes=e,this.context=t instanceof u?t:new u(t),this.elementsPerVertex=0;for(let t=0;t<e.length;t++)this.elementsPerVertex+=e[t].numElements;this.vertices=new Float32Array(s*this.elementsPerVertex),this.indices=new Uint16Array(i),this.context.addRestorable(this)}setVertices(t){if(this.dirtyVertices=!0,t.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,s,i){let r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,i,r.UNSIGNED_SHORT,2*s):r.drawArrays(e,s,i),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let s=0;for(let i=0;i<this.attributes.length;i++){let r=this.attributes[i],a=t.getAttributeLocation(r.name);e.enableVertexAttribArray(a),e.vertexAttribPointer(a,r.numElements,e.FLOAT,!1,4*this.elementsPerVertex,4*s),s+=r.numElements}this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let s=0;s<this.attributes.length;s++){let i=this.attributes[s],r=t.getAttributeLocation(i.name);e.disableVertexAttribArray(r)}e.bindBuffer(e.ARRAY_BUFFER,null),this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}}class F{name;type;numElements;constructor(t,e,s){this.name=t,this.type=e,this.numElements=s}}class N extends F{constructor(){super(V.POSITION,o.Float,2)}}class B extends F{constructor(t=0){super(V.TEXCOORDS+(0==t?"":t),o.Float,2)}}class U extends F{constructor(){super(V.COLOR,o.Float,4)}}class q extends F{constructor(){super(V.COLOR2,o.Float,4)}}(a=o||(o={}))[a.Float=0]="Float";
83class W{static disableCulling=!1;context;drawCalls=0;static globalDrawCalls=0;isDrawing=!1;mesh;shader=null;lastTexture=null;verticesLength=0;indicesLength=0;srcColorBlend;srcAlphaBlend;dstBlend;cullWasEnabled=!1;constructor(t,e=!0,s=10920){if(s>10920)throw Error("Can't have more than 10920 triangles per batch: "+s);this.context=t instanceof u?t:new u(t);let i=e?[new N,new U,new B,new q]:[new N,new U,new B];this.mesh=new D(t,i,s,3*s);let r=this.context.gl;this.srcColorBlend=r.SRC_ALPHA,this.srcAlphaBlend=r.ONE,this.dstBlend=r.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),W.disableCulling&&(this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE))}static blendModesGL=[{srcRgb:770,srcRgbPma:1,dstRgb:771,srcAlpha:1},{srcRgb:770,srcRgbPma:1,dstRgb:1,srcAlpha:1},{srcRgb:774,srcRgbPma:774,dstRgb:771,srcAlpha:1},{srcRgb:1,srcRgbPma:1,dstRgb:769,srcAlpha:1}];setBlendMode(t,e){let s=W.blendModesGL[t],i=e?s.srcRgbPma:s.srcRgb,r=s.srcAlpha,a=s.dstRgb;this.srcColorBlend==i&&this.srcAlphaBlend==r&&this.dstBlend==a||(this.srcColorBlend=i,this.srcAlphaBlend=r,this.dstBlend=a,this.isDrawing&&this.flush(),this.context.gl.blendFuncSeparate(i,a,r,a))}draw(t,e,s){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+s.length>this.mesh.getIndices().length)&&this.flush();let i=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let r=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e<s.length;t++,e++)r[t]=s[e]+i;this.indicesLength+=s.length,this.mesh.setIndicesLength(this.indicesLength)}flush(){if(0!=this.verticesLength){if(!this.lastTexture)throw Error("No texture set.");if(!this.shader)throw Error("No shader set.");this.lastTexture.bind(),this.mesh.draw(this.shader,this.context.gl.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++,W.globalDrawCalls++}}end(){if(!this.isDrawing)throw Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()");(this.verticesLength>0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),W.disableCulling&&this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=W.globalDrawCalls;return W.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}}class j{context;isDrawing=!1;mesh;shapeType=l.Filled;color=new d.Q1(1,1,1,1);shader=null;vertexIndex=0;tmp=new d.I9;srcColorBlend;srcAlphaBlend;dstBlend;constructor(t,e=10920){if(e>10920)throw Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof u?t:new u(t),this.mesh=new D(t,[new N,new U],e,0);let s=this.context.gl;this.srcColorBlend=s.SRC_ALPHA,this.srcAlphaBlend=s.ONE,this.dstBlend=s.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,s){this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=s,this.isDrawing&&(this.flush(),this.context.gl.blendFuncSeparate(t,s,e,s))}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,s,i){this.color.set(t,e,s,i)}point(t,e,s){this.check(l.Point,1),s||(s=this.color),this.vertex(t,e,s)}line(t,e,s,i,r){this.check(l.Line,2),this.mesh.getVertices(),this.vertexIndex,r||(r=this.color),this.vertex(t,e,r),this.vertex(s,i,r)}triangle(t,e,s,i,r,a,n,h,o,c){this.check(t?l.Filled:l.Line,3),this.mesh.getVertices(),this.vertexIndex,h||(h=this.color),o||(o=this.color),c||(c=this.color),t?(this.vertex(e,s,h),this.vertex(i,r,o),this.vertex(a,n,c)):(this.vertex(e,s,h),this.vertex(i,r,o),this.vertex(i,r,h),this.vertex(a,n,o),this.vertex(a,n,h),this.vertex(e,s,o))}quad(t,e,s,i,r,a,n,h,o,c,d,u,g){this.check(t?l.Filled:l.Line,3),this.mesh.getVertices(),this.vertexIndex,c||(c=this.color),d||(d=this.color),u||(u=this.color),g||(g=this.color),t?(this.vertex(e,s,c),this.vertex(i,r,d),this.vertex(a,n,u),this.vertex(a,n,u)):(this.vertex(e,s,c),this.vertex(i,r,d),this.vertex(i,r,d),this.vertex(a,n,u),this.vertex(a,n,u),this.vertex(h,o,g)),this.vertex(h,o,g),this.vertex(e,s,c)}rect(t,e,s,i,r,a){this.quad(t,e,s,e+i,s,e+i,s+r,e,s+r,a,a,a,a)}rectLine(t,e,s,i,r,a,n){this.check(t?l.Filled:l.Line,8),n||(n=this.color);let h=this.tmp.set(r-s,e-i);h.normalize(),a*=.5;let o=h.x*a,c=h.y*a;t?(this.vertex(e+o,s+c,n),this.vertex(e-o,s-c,n),this.vertex(i+o,r+c,n),this.vertex(i-o,r-c,n),this.vertex(i+o,r+c,n)):(this.vertex(e+o,s+c,n),this.vertex(e-o,s-c,n),this.vertex(i+o,r+c,n),this.vertex(i-o,r-c,n),this.vertex(i+o,r+c,n),this.vertex(e+o,s+c,n),this.vertex(i-o,r-c,n)),this.vertex(e-o,s-c,n)}x(t,e,s){this.line(t-s,e-s,t+s,e+s),this.line(t-s,e+s,t+s,e-s)}polygon(t,e,s,i){if(s<3)throw Error("Polygon must contain at least 3 vertices");this.check(l.Line,2*s),i||(i=this.color),this.mesh.getVertices(),this.vertexIndex,e<<=1,s<<=1;let r=t[e],a=t[e+1],n=e+s;for(let h=e,o=e+s-2;h<o;h+=2){let e=t[h],s=t[h+1],o=0,l=0;h+2>=n?(o=r,l=a):(o=t[h+2],l=t[h+3]),this.vertex(e,s,i),this.vertex(o,l,i)}}circle(t,e,s,i,r,a=0){if(0==a&&(a=Math.max(1,6*d.cj.cbrt(i)|0)),a<=0)throw Error("segments must be > 0.");r||(r=this.color);let n=2*d.cj.PI/a,h=Math.cos(n),o=Math.sin(n),c=i,u=0;if(t){this.check(l.Filled,3*a+3),a--;for(let t=0;t<a;t++){this.vertex(e,s,r),this.vertex(e+c,s+u,r);let t=c;c=h*c-o*u,u=o*t+h*u,this.vertex(e+c,s+u,r)}this.vertex(e,s,r),this.vertex(e+c,s+u,r)}else{this.check(l.Line,2*a+2);for(let t=0;t<a;t++){this.vertex(e+c,s+u,r);let t=c;c=h*c-o*u,u=o*t+h*u,this.vertex(e+c,s+u,r)}this.vertex(e+c,s+u,r)}c=i,u=0,this.vertex(e+c,s+u,r)}curve(t,e,s,i,r,a,n,h,o,c){this.check(l.Line,2*o+2),c||(c=this.color);let d=1/o,u=d*d,g=d*d*d,f=3*d,p=3*u,m=6*u,x=6*g,b=t-2*s+r,w=e-2*i+a,v=(s-r)*3-t+n,y=(i-a)*3-e+h,A=t,M=e,C=(s-t)*f+b*p+v*g,R=(i-e)*f+w*p+y*g,T=b*m+v*x,E=w*m+y*x,S=v*x,Y=y*x;for(;o-- >0;)this.vertex(A,M,c),A+=C,M+=R,C+=T,R+=E,T+=S,E+=Y,this.vertex(A,M,c);this.vertex(A,M,c),this.vertex(n,h,c)}vertex(t,e,s){let i=this.vertexIndex,r=this.mesh.getVertices();r[i++]=t,r[i++]=e,r[i++]=s.r,r[i++]=s.g,r[i++]=s.b,r[i++]=s.a,this.vertexIndex=i}end(){if(!this.isDrawing)throw Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw Error("ShapeRenderer.begin() has not been called");
83if(this.shapeType==t)if(!(this.mesh.maxVertices()-this.mesh.numVertices()<e))return;else this.flush();else this.flush(),this.shapeType=t}dispose(){this.mesh.dispose()}}(n=l||(l={}))[n.Point=0]="Point",n[n.Line=1]="Line",n[n.Filled=4]="Filled";class z{boneLineColor=new d.Q1(1,0,0,1);boneOriginColor=new d.Q1(0,1,0,1);attachmentLineColor=new d.Q1(0,0,1,.5);triangleLineColor=new d.Q1(1,.64,0,.5);pathColor=new d.Q1().setFromString("FF7F00");clipColor=new d.Q1(.8,0,0,2);aabbColor=new d.Q1(0,1,0,.5);drawBones=!0;drawRegionAttachments=!0;drawBoundingBoxes=!0;drawMeshHull=!0;drawMeshTriangles=!0;drawPaths=!0;drawSkeletonXY=!1;drawClipping=!0;premultipliedAlpha=!1;scale=1;boneWidth=2;context;bounds=new d.VT;temp=[];vertices=d.Aq.newFloatArray(2048);static LIGHT_GRAY=new d.Q1(192/255,192/255,192/255,1);static GREEN=new d.Q1(0,1,0,1);constructor(t){this.context=t instanceof u?t:new u(t)}draw(t,e,s){let i=e.x,r=e.y,a=this.context.gl,n=this.premultipliedAlpha?a.ONE:a.SRC_ALPHA;t.setBlendMode(n,a.ONE,a.ONE_MINUS_SRC_ALPHA);let h=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,i=h.length;e<i;e++){let i=h[e];if(s&&s.indexOf(i.data.name)>-1||!i.parent)continue;let r=i.data.length*i.a+i.worldX,a=i.data.length*i.c+i.worldY;t.rectLine(!0,i.worldX,i.worldY,r,a,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(i,r,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let s=e.slots;for(let e=0,i=s.length;e<i;e++){let i=s[e],r=i.getAttachment();if(r instanceof d.Qb){let e=this.vertices;r.computeWorldVertices(i,e,0,2),t.line(e[0],e[1],e[2],e[3]),t.line(e[2],e[3],e[4],e[5]),t.line(e[4],e[5],e[6],e[7]),t.line(e[6],e[7],e[0],e[1])}}}if(this.drawMeshHull||this.drawMeshTriangles){let s=e.slots;for(let e=0,i=s.length;e<i;e++){let i=s[e];if(!i.bone.active)continue;let r=i.getAttachment();if(!(r instanceof d.fj))continue;let a=this.vertices;r.computeWorldVertices(i,0,r.worldVerticesLength,a,0,2);let n=r.triangles,h=r.hullLength;if(this.drawMeshTriangles){t.setColor(this.triangleLineColor);for(let e=0,s=n.length;e<s;e+=3){let s=2*n[e],i=2*n[e+1],r=2*n[e+2];t.triangle(!1,a[s],a[s+1],a[i],a[i+1],a[r],a[r+1])}}if(this.drawMeshHull&&h>0){t.setColor(this.attachmentLineColor);let e=a[(h=(h>>1)*2)-2],s=a[h-1];for(let i=0,r=h;i<r;i+=2){let r=a[i],n=a[i+1];t.line(r,n,e,s),e=r,s=n}}}}if(this.drawBoundingBoxes){let s=this.bounds;s.update(e,!0),t.setColor(this.aabbColor),t.rect(!1,s.minX,s.minY,s.getWidth(),s.getHeight());let i=s.polygons,r=s.boundingBoxes;for(let e=0,s=i.length;e<s;e++){let s=i[e];t.setColor(r[e].color),t.polygon(s,0,s.length)}}if(this.drawPaths){let s=e.slots;for(let e=0,i=s.length;e<i;e++){let i=s[e];if(!i.bone.active)continue;let r=i.getAttachment();if(!(r instanceof d.He))continue;let a=r.worldVerticesLength,n=this.temp=d.Aq.setArraySize(this.temp,a,0);r.computeWorldVertices(i,0,a,n,0,2);let h=this.pathColor,o=n[2],l=n[3],c=0,u=0;if(r.closed){t.setColor(h);let e=n[0],s=n[1],i=n[a-2],r=n[a-1];c=n[a-4],u=n[a-3],t.curve(o,l,e,s,i,r,c,u,32),t.setColor(z.LIGHT_GRAY),t.line(o,l,e,s),t.line(c,u,i,r)}a-=4;for(let e=4;e<a;e+=6){let s=n[e],i=n[e+1],r=n[e+2],a=n[e+3];c=n[e+4],u=n[e+5],t.setColor(h),t.curve(o,l,s,i,r,a,c,u,32),t.setColor(z.LIGHT_GRAY),t.line(o,l,s,i),t.line(c,u,r,a),o=c,l=u}}}if(this.drawBones){t.setColor(this.boneOriginColor);for(let e=0,i=h.length;e<i;e++){let i=h[e];s&&s.indexOf(i.data.name)>-1||t.circle(!0,i.worldX,i.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let s=e.slots;t.setColor(this.clipColor);for(let e=0,i=s.length;e<i;e++){let i=s[e];if(!i.bone.active)continue;let r=i.getAttachment();if(!(r instanceof d.K$))continue;let a=r.worldVerticesLength,n=this.temp=d.Aq.setArraySize(this.temp,a,0);r.computeWorldVertices(i,0,a,n,0,2);for(let e=0,s=n.length;e<s;e+=2){let s=n[e],i=n[e+1],r=n[(e+2)%n.length],a=n[(e+3)%n.length];t.line(s,i,r,a)}}}}dispose(){}}class G{vertices;numVertices;numFloats;constructor(t,e,s){this.vertices=t,this.numVertices=e,this.numFloats=s}}class _{static QUAD_TRIANGLES=[0,1,2,2,3,0];premultipliedAlpha=!1;tempColor=new d.Q1;tempColor2=new d.Q1;vertices;vertexSize=8;twoColorTint=!1;renderable=new G([],0,0);clipper=new d.qy;temp=new d.I9;temp2=new d.I9;temp3=new d.Q1;temp4=new d.Q1;constructor(t,e=!0){this.twoColorTint=e,e&&(this.vertexSize+=4),this.vertices=d.Aq.newFloatArray(1024*this.vertexSize)}draw(t,e,s=-1,i=-1,r=null){let a,n,h,o=this.clipper,l=this.premultipliedAlpha,c=this.twoColorTint,u=null,g=this.renderable,f=e.drawOrder,p=e.color,m=c?12:8,x=!1;-1==s&&(x=!0);for(let e=0,b=f.length;e<b;e++){let b,w=o.isClipping()?2:m,v=f[e];if(!v.bone.active||(s>=0&&s==v.data.index&&(x=!0),!x)){o.clipEndWithSlot(v);continue}i>=0&&i==v.data.index&&(x=!1);let y=v.getAttachment();if(y instanceof d.Qb)g.vertices=this.vertices,g.numVertices=4,g.numFloats=w<<2,y.computeWorldVertices(v,g.vertices,0,w),n=_.QUAD_TRIANGLES,a=y.uvs,b=y.region.texture,h=y.color;else if(y instanceof d.fj)g.vertices=this.vertices,g.numVertices=y.worldVerticesLength>>1,g.numFloats=g.numVertices*w,g.numFloats>g.vertices.length&&(g.vertices=this.vertices=d.Aq.newFloatArray(g.numFloats)),y.computeWorldVertices(v,0,y.worldVerticesLength,g.vertices,0,w),n=y.triangles,b=y.region.texture,a=y.uvs,h=y.
83color;else if(y instanceof d.K$){o.clipStart(v,y);continue}else{o.clipEndWithSlot(v);continue}if(b){let e=v.color,s=this.tempColor;s.r=p.r*e.r*h.r,s.g=p.g*e.g*h.g,s.b=p.b*e.b*h.b,s.a=p.a*e.a*h.a,l&&(s.r*=s.a,s.g*=s.a,s.b*=s.a);let i=this.tempColor2;v.darkColor?(l?(i.r=v.darkColor.r*s.a,i.g=v.darkColor.g*s.a,i.b=v.darkColor.b*s.a):i.setFromColor(v.darkColor),i.a=+!!l):i.set(0,0,0,1);let d=v.data.blendMode;if(d!=u&&(u=d,t.setBlendMode(u,l)),o.isClipping()){o.clipTriangles(g.vertices,n,n.length,a,s,i,c);let e=new Float32Array(o.clippedVertices),h=o.clippedTriangles;r&&r(e,e.length,m),t.draw(b,e,h)}else{let e=g.vertices;if(c)for(let t=2,r=0,n=g.numFloats;t<n;t+=m,r+=2)e[t]=s.r,e[t+1]=s.g,e[t+2]=s.b,e[t+3]=s.a,e[t+4]=a[r],e[t+5]=a[r+1],e[t+6]=i.r,e[t+7]=i.g,e[t+8]=i.b,e[t+9]=i.a;else for(let t=2,i=0,r=g.numFloats;t<r;t+=m,i+=2)e[t]=s.r,e[t+1]=s.g,e[t+2]=s.b,e[t+3]=s.a,e[t+4]=a[i],e[t+5]=a[i+1];let h=g.vertices.subarray(0,g.numFloats);r&&r(g.vertices,g.numFloats,m),t.draw(b,h,n)}}o.clipEndWithSlot(v)}o.clipEnd()}getSkeletonClipping(){return this.clipper}}let H=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],Z=[0,1,2,2,3,0],Q=new d.Q1(1,1,1,1);class K{context;canvas;camera;batcher;twoColorTint=!1;batcherShader;shapes;shapesShader;activeRenderer=null;skeletonRenderer;skeletonDebugRenderer;constructor(t,e,s=!0){this.canvas=t,this.context=e instanceof u?e:new u(e),this.twoColorTint=s,this.camera=new I(t.width,t.height),this.batcherShader=s?V.newTwoColoredTextured(this.context):V.newColoredTextured(this.context),this.batcher=new W(this.context,s),this.shapesShader=V.newColored(this.context),this.shapes=new j(this.context),this.skeletonRenderer=new _(this.context,s),this.skeletonDebugRenderer=new z(this.context)}dispose(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()}begin(){this.camera.update(),this.enableRenderer(this.batcher)}drawSkeleton(t,e=!1,s=-1,i=-1,r=null){this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,s,i,r)}drawSkeletonDebug(t,e=!1,s){this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,s)}drawTexture(t,e,s,i,r,a){this.enableRenderer(this.batcher),a||(a=Q);var n=0;H[n++]=e,H[n++]=s,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=0,H[n++]=1,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n++]=0),H[n++]=e+i,H[n++]=s,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=1,H[n++]=1,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n++]=0),H[n++]=e+i,H[n++]=s+r,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=1,H[n++]=0,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n++]=0),H[n++]=e,H[n++]=s+r,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=0,H[n++]=0,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n]=0),this.batcher.draw(t,H,Z)}drawTextureUV(t,e,s,i,r,a,n,h,o,l){this.enableRenderer(this.batcher),l||(l=Q);var c=0;H[c++]=e,H[c++]=s,H[c++]=l.r,H[c++]=l.g,H[c++]=l.b,H[c++]=l.a,H[c++]=a,H[c++]=n,this.twoColorTint&&(H[c++]=0,H[c++]=0,H[c++]=0,H[c++]=0),H[c++]=e+i,H[c++]=s,H[c++]=l.r,H[c++]=l.g,H[c++]=l.b,H[c++]=l.a,H[c++]=h,H[c++]=n,this.twoColorTint&&(H[c++]=0,H[c++]=0,H[c++]=0,H[c++]=0),H[c++]=e+i,H[c++]=s+r,H[c++]=l.r,H[c++]=l.g,H[c++]=l.b,H[c++]=l.a,H[c++]=h,H[c++]=o,this.twoColorTint&&(H[c++]=0,H[c++]=0,H[c++]=0,H[c++]=0),H[c++]=e,H[c++]=s+r,H[c++]=l.r,H[c++]=l.g,H[c++]=l.b,H[c++]=l.a,H[c++]=a,H[c++]=o,this.twoColorTint&&(H[c++]=0,H[c++]=0,H[c++]=0,H[c]=0),this.batcher.draw(t,H,Z)}drawTextureRotated(t,e,s,i,r,a,n,h,o){this.enableRenderer(this.batcher),o||(o=Q);let l=e+a,c=s+n,u=-a,g=-n,f=i-a,p=r-n,m=0,x=0,b=0,w=0,v=0,y=0,A=0,M=0;if(0!=h){let t=d.cj.cosDeg(h),e=d.cj.sinDeg(h);m=t*u-e*g,x=e*u+t*g,A=t*u-e*p,M=e*u+t*p,v=t*f-e*p,y=e*f+t*p,b=v+(m-A),w=y+(x-M)}else m=u,x=g,A=u,M=p,v=f,y=p,b=f,w=g;m+=l,x+=c,b+=l,w+=c,v+=l,y+=c,A+=l,M+=c;var C=0;H[C++]=m,H[C++]=x,H[C++]=o.r,H[C++]=o.g,H[C++]=o.b,H[C++]=o.a,H[C++]=0,H[C++]=1,this.twoColorTint&&(H[C++]=0,H[C++]=0,H[C++]=0,H[C++]=0),H[C++]=b,H[C++]=w,H[C++]=o.r,H[C++]=o.g,H[C++]=o.b,H[C++]=o.a,H[C++]=1,H[C++]=1,this.twoColorTint&&(H[C++]=0,H[C++]=0,H[C++]=0,H[C++]=0),H[C++]=v,H[C++]=y,H[C++]=o.r,H[C++]=o.g,H[C++]=o.b,H[C++]=o.a,H[C++]=1,H[C++]=0,this.twoColorTint&&(H[C++]=0,H[C++]=0,H[C++]=0,H[C++]=0),H[C++]=A,H[C++]=M,H[C++]=o.r,H[C++]=o.g,H[C++]=o.b,H[C++]=o.a,H[C++]=0,H[C++]=0,this.twoColorTint&&(H[C++]=0,H[C++]=0,H[C++]=0,H[C]=0),this.batcher.draw(t,H,Z)}drawRegion(t,e,s,i,r,a){this.enableRenderer(this.batcher),a||(a=Q);var n=0;H[n++]=e,H[n++]=s,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=t.u,H[n++]=t.v2,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n++]=0),H[n++]=e+i,H[n++]=s,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=t.u2,H[n++]=t.v2,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n++]=0),H[n++]=e+i,H[n++]=s+r,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=t.u2,H[n++]=t.v,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n++]=0),H[n++]=e,H[n++]=s+r,H[n++]=a.r,H[n++]=a.g,H[n++]=a.b,H[n++]=a.a,H[n++]=t.u,H[n++]=t.v,this.twoColorTint&&(H[n++]=0,H[n++]=0,H[n++]=0,H[n]=0),this.batcher.draw(t.page.texture,H,Z)}line(t,e,s,i,r,a){this.enableRenderer(this.shapes),this.shapes.line(t,e,s,i,r)}triangle(t,e,s,i,r,a,n,h,o,l){this.enableRenderer(this.shapes),this.shapes.triangle(t,e,s,i,r,a,n,h,o,l)}quad(t,e,s,i,r,a,n,h,o,l,c,d,u){this.enableRenderer(this.shapes),this.shapes.quad(t,e,s,i,r,a,n,h,o,l,c,d,u)}rect(t,e,s,i,r,a){this.enableRenderer(this.shapes),this.shapes.rect(t,e,s,i,r,a)}rectLine(t,e,s,i,r,a,n){this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,s,i,r,a,n)}polygon(t,e,s,i){this.enableRenderer(this.shapes),this.shapes.polygon(t,e,s,i)}circle(t,e,s,i,r,a=0){this.enableRenderer(this.shapes),this.shapes.circle(t,e,s,i,r,a)}curve(t,e,s,i,r,a,n,h,o,l){this.enableRenderer(this.shapes),this.shapes.curve(t,e,s,i,r,a,n,h,o,l)}end(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null}resize(t){let e=this.canvas;var s=window.devicePixelRatio||1,i=Math.round(e.clientWidth*s),r=M
83ath.round(e.clientHeight*s);if((e.width!=i||e.height!=r)&&(e.width=i,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===c.Expand)this.camera.setViewport(i,r);else if(t===c.Fit){let t=e.width,s=e.height,i=this.camera.viewportWidth,r=this.camera.viewportHeight,a=r/i<s/t?i/t:r/s;this.camera.setViewport(t*a,s*a)}this.camera.update()}enableRenderer(t){this.activeRenderer!==t&&(this.end(),t instanceof W?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(V.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi("u_texture",0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):t instanceof j?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(V.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)}}(h=c||(c={}))[h.Stretch=0]="Stretch",h[h.Expand=1]="Expand",h[h.Fit=2]="Fit";let J=0;class ${renderer;logo=null;spinner=null;angle=0;fadeOut=0;fadeIn=0;timeKeeper=new d.oM;backgroundColor=new d.Q1(.135,.135,.135,1);tempColor=new d.Q1;constructor(t){if(this.renderer=t,this.timeKeeper.maxDelta=9,!r){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>J++;(r=new Image).src=te,t||(r.crossOrigin="anonymous"),r.onload=e,(i=new Image).src=tt,t||(i.crossOrigin="anonymous"),i.onload=e}}dispose(){this.logo?.dispose(),this.spinner?.dispose()}draw(t=!1){if(J<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let s=this.tempColor,a=this.renderer,n=a.canvas,h=a.context.gl;if(a.resize(c.Expand),a.camera.position.set(n.width/2,n.height/2,0),a.batcher.setBlendMode(d.Nx.Normal,!0),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;s.setFromColor(this.backgroundColor),e=1-((e=1-this.fadeOut/1)-1)*(e-1),s.a*=e,s.a>0&&(a.camera.zoom=1,a.begin(),a.quad(!0,0,0,n.width,0,n.width,n.height,0,n.height,s,s,s,s),a.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(h.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),h.clear(h.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),s.set(e,e,e,e),this.logo||(this.logo=new g(a.context,r),this.spinner=new g(a.context,i)),a.camera.zoom=Math.max(1,163/n.height),a.begin(),a.drawTexture(this.logo,(n.width-165)/2,(n.height-108)/2,165,108,s),this.spinner&&a.drawTextureRotated(this.spinner,(n.width-163)/2,(n.height-163)/2,163,163,81.5,81.5,this.angle,s),a.end()}drawInCoordinates(t,e){if(J<2)return;this.timeKeeper.update();let s=this.renderer;s.batcher.setBlendMode(d.Nx.Normal,!0),this.logo||(this.logo=new g(s.context,r),this.spinner=new g(s.context,i));let a=t-82.5,n=e-54;s.drawTexture(this.logo,a,n,165,108),this.angle-=500*this.timeKeeper.delta,this.spinner&&s.drawTextureRotated(this.spinner,a,n-25,163,163,81.5,81.5,this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EirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII="},95904:(t,e,s)=>{s.d(e,{e:()=>a,o:()=>r});var i=s(16139);class r{name;constructor(t){if(!t)throw Error("name cannot be null.");this.name=t}}class a extends r{static nextID=0;id=a.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,e,s,i,r,a){s=r+(s>>1)*a;let n=t.bone.skeleton,h=t.deform,o=this.vertices,l=this.bones;if(!l){h.length>0&&(o=h);let n=t.bone,l=n.worldX,c=n.worldY,d=n.a,u=n.b,g=n.c,f=n.d;for(let t=e,n=r;n<s;t+=2,n+=a){let e=o[t],s=o[t+1];i[n]=e*d+s*u+l,i[n+1]=e*g+s*f+c}return}let c=0,d=0;for(let t=0;t<e;t+=2){let t=l[c];c+=t+1,d+=t}let u=n.bones;if(0==h.length)for(let t=r,e=3*d;t<s;t+=a){let s=0,r=0,a=l[c++];for(a+=c;c<a;c++,e+=3){let t=u[l[c]],i=o[e],a=o[e+1],n=o[e+2];s+=(i*t.a+a*t.b+t.worldX)*n,r+=(i*t.c+a*t.d+t.worldY)*n}i[t]=s,i[t+1]=r}else for(let t=r,e=3*d,n=d<<1;t<s;t+=a){let s=0,r=0,a=l[c++];for(a+=c;c<a;c++,e+=3,n+=2){let t=u[l[c]],i=o[e]+h[n],a=o[e+1]+h[n+1],d=o[e+2];s+=(i*t.a+a*t.b+t.worldX)*d,r+=(i*t.c+a*t.d+t.worldY)*d}i[t]=s,i[t+1]=r}}copyTo(t){this.bones?(t.bones=Array(this.bones.length),i.Aq.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=i.Aq.newFloatArray(this.vertices.length),i.Aq.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}}},96680:(t,e,s)=>{s.d(e,{Lw:()=>a,TE:()=>o});var i=s(63501),r=s(16139);class a{pages=[];regions=[];constructor(t){let e=new n(t),s=[,,,,],a={};a.size=t=>{t.width=parseInt(s[1]),t.height=parseInt(s[2])},a.format=()=>{},a.filter=t=>{t.minFilter=r.Aq.enumValue(i.O$,s[1]),t.magFilter=r.Aq.enumValue(i.O$,s[2])},a.repeat=t=>{-1!=s[1].indexOf("x")&&(t.uWrap=i.w3.Repeat),-1!=s[1].indexOf("y")&&(t.vWrap=i.w3.Repeat)},a.pma=t=>{t.pma="true"==s[1]};var l={};l.xy=t=>{t.x=parseInt(s[1]),t.y=parseInt(s[2])},l.size=t=>{t.width=parseInt(s[1]),t.height=parseInt(s[2])},l.bounds=t=>{t.x=parseInt(s[1]),t.y=parseInt(s[2]),t.width=parseInt(s[3]),t.height=parseInt(s[4])},l.offset=t=>{t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2])},l.orig=t=>{t.originalWidth=parseInt(s[1]),t.originalHeight=parseInt(s[2])},l.offsets=t=>{t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2]),t.originalWidth=parseInt(s[3]),t.originalHeight=parseInt(s[4])},l.rotate=t=>{let e=s[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},l.index=t=>{t.index=parseInt(s[1])};let c=e.readLine();for(;c&&0==c.trim().length;)c=e.readLine();for(;c&&0!=c.trim().length&&0!=e.readEntry(s,c);)c=e.readLine();let d=null,u=null,g=null;for(;null!==c;)if(0==c.trim().length)d=null,c=e.readLine();else if(d){let t=new o(d,c);for(;;){let i=e.readEntry(s,c=e.readLine());if(0==i)break;let r=l[s[0]];if(r)r(t);else{u||(u=[]),g||(g=[]),u.push(s[0]);let t=[];for(let e=0;e<i;e++)t.push(parseInt(s[e+1]));g.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),u&&u.length>0&&g&&g.length>0&&(t.names=u,t.values=g,u=null,g=null),t.u=t.x/d.width,t.v=t.y/d.height,90==t.degrees?(t.u2=(t.x+t.height)/d.width,t.v2=(t.y+t.width)/d.height):(t.u2=(t.x+t.width)/d.width,t.v2=(t.y+t.height)/d.height),this.regions.push(t)}else{for(d=new h(c.trim());0!=e.readEntry(s,c=e.readLine());){let t=a[s[0]];t&&t(d)}this.pages.push(d)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture?.dispose()}}class n{lines;index=0;constructor(t){this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||0==(e=e.trim()).length)return 0;let s=e.indexOf(":");if(-1==s)return 0;t[0]=e.substr(0,s).trim();for(let i=1,r=s+1;;i++){let s=e.indexOf(",",r);if(-1==s)return t[i]=e.substr(r).trim(),i;
83if(t[i]=e.substr(r,s-r).trim(),r=s+1,4==i)return 4}}}class h{name;minFilter=i.O$.Nearest;magFilter=i.O$.Nearest;uWrap=i.w3.ClampToEdge;vWrap=i.w3.ClampToEdge;texture=null;width=0;height=0;pma=!1;regions=[];constructor(t){this.name=t}setTexture(t){for(let e of(this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap),this.regions))e.texture=t}}class o extends i.QL{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(t,e){super(),this.page=t,this.name=e,t.regions.push(this)}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.