lyb-pixi-js 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
|
-
import { LibPixiContainer } from
|
|
2
|
+
import { LibPixiContainer } from "../Base/LibPixiContainer";
|
|
3
3
|
export interface LibPixiScrollNumParams {
|
|
4
4
|
/** 滚动区域宽度 */
|
|
5
5
|
width: number;
|
|
@@ -53,10 +53,22 @@ export declare class LibPixiScrollNum extends LibPixiContainer {
|
|
|
53
53
|
* @param animate 是否需要过渡动画
|
|
54
54
|
*/
|
|
55
55
|
slideTo(index: number, animate?: boolean): void;
|
|
56
|
+
/** @description 设置滚动景深
|
|
57
|
+
* @param containerList 元素列表
|
|
58
|
+
* @param y 拖动Y坐标
|
|
59
|
+
* @param startY 内部将y - startY进行计算
|
|
60
|
+
*/
|
|
61
|
+
setDepth(containerList: Container[], y: number, startY?: number): void;
|
|
56
62
|
/** @description 开始拖动 */
|
|
57
63
|
private _onDragStart;
|
|
58
64
|
/** @description 拖动中 */
|
|
59
65
|
private _onDragMove;
|
|
60
66
|
/** @description 结束拖动 */
|
|
61
67
|
private _onDragEnd;
|
|
68
|
+
/** @description 线性插值
|
|
69
|
+
* @param a1 当 t = 0 时,返回 a1
|
|
70
|
+
* @param a2 当 t = 1 时,返回 a2
|
|
71
|
+
* @param t 插值比例,取值范围 0~1
|
|
72
|
+
*/
|
|
73
|
+
private lerp;
|
|
62
74
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Graphics } from "pixi.js";
|
|
2
2
|
import gsap from "gsap";
|
|
3
|
-
import { LibPixiContainer } from
|
|
3
|
+
import { LibPixiContainer } from "../Base/LibPixiContainer";
|
|
4
4
|
/** @description 通过鼠标或手指拖动数字列选择数字
|
|
5
5
|
* @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiScrollNum-数字滑动
|
|
6
6
|
*/
|
|
@@ -99,6 +99,35 @@ export class LibPixiScrollNum extends LibPixiContainer {
|
|
|
99
99
|
}
|
|
100
100
|
(_a = this._slideCallback) === null || _a === void 0 ? void 0 : _a.call(this, this._currentIndex);
|
|
101
101
|
}
|
|
102
|
+
/** @description 设置滚动景深
|
|
103
|
+
* @param containerList 元素列表
|
|
104
|
+
* @param y 拖动Y坐标
|
|
105
|
+
* @param startY 内部将y - startY进行计算
|
|
106
|
+
*/
|
|
107
|
+
setDepth(containerList, y, startY = 0) {
|
|
108
|
+
const Y = y - startY;
|
|
109
|
+
const idx = Math.floor(Math.abs(Y) / 70);
|
|
110
|
+
const t = (Math.abs(Y) % 70) / 70;
|
|
111
|
+
const prevIdx = idx - 1;
|
|
112
|
+
const nextIdx = idx + 1;
|
|
113
|
+
const nextIdx2 = idx + 2;
|
|
114
|
+
const curItem = containerList[idx];
|
|
115
|
+
curItem.alpha = this.lerp(0.5, 1, 1 - t);
|
|
116
|
+
curItem.scale.y = this.lerp(0.85, 1, 1 - t);
|
|
117
|
+
if (nextIdx < containerList.length) {
|
|
118
|
+
const nextItem = containerList[nextIdx];
|
|
119
|
+
nextItem.alpha = this.lerp(0.5, 1, t);
|
|
120
|
+
nextItem.scale.y = this.lerp(0.85, 1, t);
|
|
121
|
+
}
|
|
122
|
+
if (nextIdx2 < containerList.length) {
|
|
123
|
+
const nextItem = containerList[nextIdx2];
|
|
124
|
+
nextItem.alpha = this.lerp(0.1, 0.5, t);
|
|
125
|
+
}
|
|
126
|
+
if (prevIdx >= 0) {
|
|
127
|
+
const prevItem = containerList[prevIdx];
|
|
128
|
+
prevItem.alpha = this.lerp(0.1, 0.5, 1 - t);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
102
131
|
/** @description 开始拖动 */
|
|
103
132
|
_onDragStart(event) {
|
|
104
133
|
this._isDragging = true;
|
|
@@ -152,4 +181,12 @@ export class LibPixiScrollNum extends LibPixiContainer {
|
|
|
152
181
|
// 执行滑动到目标页码
|
|
153
182
|
this.slideTo(this._currentIndex);
|
|
154
183
|
}
|
|
184
|
+
/** @description 线性插值
|
|
185
|
+
* @param a1 当 t = 0 时,返回 a1
|
|
186
|
+
* @param a2 当 t = 1 时,返回 a2
|
|
187
|
+
* @param t 插值比例,取值范围 0~1
|
|
188
|
+
*/
|
|
189
|
+
lerp(a1, a2, t) {
|
|
190
|
+
return a1 * (1 - t) + a2 * t;
|
|
191
|
+
}
|
|
155
192
|
}
|
package/lyb-pixi.js
CHANGED
|
@@ -1166,7 +1166,7 @@ void main(void)\r
|
|
|
1166
1166
|
*
|
|
1167
1167
|
* @pixi/particle-emitter is licensed under the MIT License.
|
|
1168
1168
|
* http://www.opensource.org/licenses/mit-license
|
|
1169
|
-
*/class gi{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:zm(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let r;const{value:n,time:a}=i[0],o=r=new gi(typeof n=="string"?lo(n):n,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==n)for(let h=1;h<i.length;++h){const{value:u,time:d}=i[h];r.next=new gi(typeof u=="string"?lo(u):u,d),r=r.next}return o.isStepped=!!t.isStepped,o}const e=new gi(typeof t.start=="string"?lo(t.start):t.start,0);return t.end!==t.start&&(e.next=new gi(typeof t.end=="string"?lo(t.end):t.end,1)),e}}let wn=W.from;const yi=Math.PI/180;function Li(s,t){if(!s)return;const e=Math.sin(s),i=Math.cos(s),r=t.x*i-t.y*e,n=t.x*e+t.y*i;t.x=r,t.y=n}function ho(s,t,e){return s<<16|t<<8|e}function Wm(s){return Math.sqrt(s.x*s.x+s.y*s.y)}function Xw(s){const t=1/Wm(s);s.x*=t,s.y*=t}function $m(s,t){s.x*=t,s.y*=t}function lo(s,t){t||(t={}),s.charAt(0)==="#"?s=s.substr(1):s.indexOf("0x")===0&&(s=s.substr(2));let e;return s.length===8&&(e=s.substr(0,2),s=s.substr(2)),t.r=parseInt(s.substr(0,2),16),t.g=parseInt(s.substr(2,2),16),t.b=parseInt(s.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function zm(s){const t=s.length,e=1/t;return function(i){const r=t*i|0,n=(i-r*e)*t,a=s[r]||s[t-1];return a.s+n*(2*(1-n)*(a.cp-a.s)+n*(a.e-a.s))}}function Ww(s){return s?(s=s.toUpperCase().replace(/ /g,"_"),K[s]||K.NORMAL):K.NORMAL}class ou extends _e{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var xt;(function(s){s[s.Spawn=0]="Spawn",s[s.Normal=2]="Normal",s[s.Late=5]="Late"})(xt||(xt={}));const hu=ct.shared,Hs=Symbol("Position particle per emitter position");class dt{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new tt,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new tt,this._prevEmitterPos=new tt,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){dt.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:zm(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const r=dt.knownBehaviors[i.type];return r?new r(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Hs),e.sort((i,r)=>i===Hs?r.order===xt.Spawn?1:-1:r===Hs?i.order===xt.Spawn?-1:1:i.order-r.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Hs&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Hs&&i.recycleParticle)}getBehavior(t){return dt.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof dt.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new ou(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Li(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?hu.remove(this.update,this):!this._autoUpdate&&t&&hu.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=hu.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const r=this.ownerPos.x+this.spawnPos.x,n=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let a,o;if(this._prevPosIsValid&&this._posChanged){const d=1+this._spawnTimer/t;a=(r-e)*d+e,o=(n-i)*d+i}else a=r,o=n;let h=null,u=null;for(let d=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),l=0;l<d;++l){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let c;if(this.minLifetime===this.maxLifetime?c=this.minLifetime:c=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=c)continue;let f;this._poolFirst?(f=this._poolFirst,this._poolFirst=this._poolFirst.next,f.next=null):f=new ou(this),f.init(c),this.addAtBack?this._parent.addChildAt(f,0):this._parent.addChild(f),h?(u.next=f,f.prev=u,u=f):u=h=f,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=u):(this._activeParticlesFirst=h,this._activeParticlesLast=u);for(let d=0;d<this.initBehaviors.length;++d){const l=this.initBehaviors[d];if(l===Hs)for(let c=h,f;c;c=f){f=c.next,this.rotation!==0&&(Li(this.rotation,c.position),c.rotation+=this.rotation),c.position.x+=a,c.position.y+=o,c.age+=-this._spawnTimer;let p=c.age*c.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),c.agePercent=p}else l.initParticles(h)}for(let d=h,l;d;d=l){l=d.next;for(let c=0;c<this.updateBehaviors.length;++c)if(this.updateBehaviors[c].updateParticle(d,-this._spawnTimer)){this.recycle(d);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=r,this._prevEmitterPos.y=n,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,r=null;for(let n=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<n;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new ou(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(r.next=o,o.prev=r,r=o):r=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=r):(this._activeParticlesFirst=i,this._activeParticlesLast=r);for(let n=0;n<this.initBehaviors.length;++n){const a=this.initBehaviors[n];if(a===Hs)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Li(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}dt.knownBehaviors={};class lu{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}lu.type="rect",lu.editorConfig=null;class uo{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Li(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}uo.type="torus",uo.editorConfig=null;class uu{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let r=i[0];for(let n=1;n<i.length;++n){const a=i[n];this.segments.push({p1:r,p2:a,l:0}),r=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const r=t[i];this.segments.push({p1:e,p2:r,l:0}),e=r}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:r}=this.segments[e],n=Math.sqrt((r.x-i.x)*(r.x-i.x)+(r.y-i.y)*(r.y-i.y));this.segments[e].l=n,this.totalLength+=n,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,r;if(this.segments.length===1)i=this.segments[0],r=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],r=o===0?e:e-this.countingLengths[o-1];break}r/=i.l||1;const{p1:n,p2:a}=i;t.x=n.x+r*(a.x-n.x),t.y=n.y+r*(a.y-n.y)}}uu.type="polygonalChain",uu.editorConfig=null;class cu{constructor(t){var e;this.order=xt.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,r=i.x,n=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=Wm(i);a>this.maxSpeed&&$m(i,this.maxSpeed/a)}t.x+=(r+i.x)/2*e,t.y+=(n+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}cu.type="moveAcceleration",cu.editorConfig=null;function $w(s){return this.ease&&(s=this.ease(s)),(this.first.next.value-this.first.value)*s+this.first.value}function zw(s){this.ease&&(s=this.ease(s));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*s+t.r,r=(e.g-t.g)*s+t.g,n=(e.b-t.b)*s+t.b;return ho(i,r,n)}function Yw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;return s=(s-t.time)/(e.time-t.time),(e.value-t.value)*s+t.value}function jw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;s=(s-t.time)/(e.time-t.time);const i=t.value,r=e.value,n=(r.r-i.r)*s+i.r,a=(r.g-i.g)*s+i.g,o=(r.b-i.b)*s+i.b;return ho(n,a,o)}function qw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;return t.value}function Kw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;const e=t.value;return ho(e.r,e.g,e.b)}class En{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?zw:$w:t.isStepped?this.interpolate=this.isColor?Kw:qw:this.interpolate=this.isColor?jw:Yw,this.ease=this.first.ease}}class du{constructor(t){this.order=xt.Normal,this.list=new En(!1),this.list.reset(gi.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}du.type="alpha",du.editorConfig=null;class fu{constructor(t){this.order=xt.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}fu.type="alphaStatic",fu.editorConfig=null;function Ym(s){const t=[];for(let e=0;e<s.length;++e){let i=s[e];if(typeof i=="string")t.push(wn(i));else if(i instanceof W)t.push(i);else{let r=i.count||1;for(typeof i.texture=="string"?i=wn(i.texture):i=i.texture;r>0;--r)t.push(i)}}return t}class pu{constructor(t){this.order=xt.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],r=Ym(i.textures),n=i.framerate<0?-1:i.framerate>0?i.framerate:60,a={textures:r,duration:n>0?r.length/n:0,framerate:n,loop:n>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.anims.length),r=e.config.anim=this.anims[i];e.texture=r.textures[0],e.config.animElapsed=0,r.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=r.textures.length/e.maxLife):(e.config.animDuration=r.duration,e.config.animFramerate=r.framerate),e=e.next}}updateParticle(t,e){const i=t.config,r=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const n=i.animElapsed*i.animFramerate+1e-7|0;t.texture=r.textures[n]||r.textures[r.textures.length-1]||W.EMPTY}}pu.type="animatedRandom",pu.editorConfig=null;class mu{constructor(t){this.order=xt.Normal;const e=t.anim,i=Ym(e.textures),r=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:r>0?i.length/r:0,framerate:r,loop:r>0?!!e.loop:!1}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,e){const i=this.anim,r=t.config;r.animElapsed+=e,r.animElapsed>=r.animDuration&&(i.loop?r.animElapsed=r.animElapsed%r.animDuration:r.animElapsed=r.animDuration-1e-6);const n=r.animElapsed*r.animFramerate+1e-7|0;t.texture=i.textures[n]||i.textures[i.textures.length-1]||W.EMPTY}}mu.type="animatedSingle",mu.editorConfig=null;class _u{constructor(t){this.order=xt.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=Ww(this.value),e=e.next}}_u.type="blendMode",_u.editorConfig=null;class gu{constructor(t){this.order=xt.Spawn,this.spacing=t.spacing*yi,this.start=t.start*yi,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let r;this.spacing?r=this.start+this.spacing*e:r=Math.random()*Math.PI*2,i.rotation=r,this.distance&&(i.position.x=this.distance,Li(r,i.position)),i=i.next,++e}}}gu.type="spawnBurst",gu.editorConfig=null;class yu{constructor(t){this.order=xt.Normal,this.list=new En(!0),this.list.reset(gi.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,r=ho(i.r,i.g,i.b);for(;e;)e.tint=r,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}yu.type="color",yu.editorConfig=null;class xu{constructor(t){this.order=xt.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}xu.type="colorStatic",xu.editorConfig=null;class vu{constructor(t){this.order=xt.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?wn(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}vu.type="textureOrdered",vu.editorConfig=null;const Sr=new tt,jm=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],Zw=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(jm).join("|"),"g");function Qw(s){const t=s.match(Zw);for(let e=t.length-1;e>=0;--e)jm.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return s=t.join(""),new Function("x",`return ${s};`)}class bu{constructor(t){var e;if(this.order=xt.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=Qw(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new En(!1),this.list.reset(gi.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new tt(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,Sr.x=t.config.movement,Sr.y=this.path(Sr.x),Li(t.config.initRotation,Sr),t.position.x=t.config.initPosition.x+Sr.x,t.position.y=t.config.initPosition.y+Sr.y}}bu.type="movePath",bu.editorConfig=null;class Tu{constructor(){this.order=xt.Spawn}initParticles(t){}}Tu.type="spawnPoint",Tu.editorConfig=null;class wu{constructor(t){this.order=xt.Normal,this.textures=t.textures.map(e=>typeof e=="string"?wn(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}wu.type="textureRandom",wu.editorConfig=null;class Eu{constructor(t){this.order=xt.Normal,this.minStart=t.minStart*yi,this.maxStart=t.maxStart*yi,this.minSpeed=t.minSpeed*yi,this.maxSpeed=t.maxSpeed*yi,this.accel=t.accel*yi}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}Eu.type="rotation",Eu.editorConfig=null;class Au{constructor(t){this.order=xt.Normal,this.min=t.min*yi,this.max=t.max*yi}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}Au.type="rotationStatic",Au.editorConfig=null;class Su{constructor(t){this.order=xt.Late+1,this.rotation=(t.rotation||0)*yi}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}Su.type="noRotation",Su.editorConfig=null;class Cu{constructor(t){var e;this.order=xt.Normal,this.list=new En(!1),this.list.reset(gi.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}Cu.type="scale",Cu.editorConfig=null;class Pu{constructor(t){this.order=xt.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}Pu.type="scaleStatic",Pu.editorConfig=null;class ze{constructor(t){this.order=xt.Spawn;const e=ze.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){ze.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}ze.type="spawnShape",ze.editorConfig=null,ze.shapes={},ze.registerShape(uu),ze.registerShape(lu),ze.registerShape(uo),ze.registerShape(uo,"circle");class Iu{constructor(t){this.order=xt.Normal,this.texture=typeof t.texture=="string"?wn(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}Iu.type="textureSingle",Iu.editorConfig=null;class Ru{constructor(t){var e;this.order=xt.Late,this.list=new En(!1),this.list.reset(gi.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new tt(this.list.first.value*i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,r=t.config.velocity;Xw(r),$m(r,i),t.x+=r.x*e,t.y+=r.y*e}}Ru.type="moveSpeed",Ru.editorConfig=null;class Mu{constructor(t){this.order=xt.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}Mu.type="moveSpeedStatic",Mu.editorConfig=null,dt.registerBehavior(cu),dt.registerBehavior(du),dt.registerBehavior(fu),dt.registerBehavior(pu),dt.registerBehavior(mu),dt.registerBehavior(_u),dt.registerBehavior(gu),dt.registerBehavior(yu),dt.registerBehavior(xu),dt.registerBehavior(vu),dt.registerBehavior(bu),dt.registerBehavior(Tu),dt.registerBehavior(wu),dt.registerBehavior(Eu),dt.registerBehavior(Au),dt.registerBehavior(Su),dt.registerBehavior(Cu),dt.registerBehavior(Pu),dt.registerBehavior(ze),dt.registerBehavior(Iu),dt.registerBehavior(Ru),dt.registerBehavior(Mu);class Du extends Va{constructor(t){const{text:e,fontSize:i=36,fontColor:r=16777215,stroke:n,strokeColor:a,strokeThickness:o,fontFamily:h="Arial",fontWeight:u="normal",wordWrap:d=!1,wordWrapWidth:l=100,lineHeight:c=1.25,align:f="left",indent:p=0,shadow:m}=t,_=new Di({fontSize:i,wordWrap:d,wordWrapWidth:l,fontWeight:u,lineHeight:c*i,breakWords:d,fill:r,align:f,fontFamily:h,stroke:n?a:"transparent",strokeThickness:n?o:0,lineJoin:"round"});m&&(_.dropShadow=!0,_.dropShadowColor=m[0],_.dropShadowAngle=m[1]*(Math.PI/180),_.dropShadowBlur=m[2],_.dropShadowDistance=m[3]),super(e,_),this.position.x=p*i}}class Jw extends bt{constructor(t){super();const{start:e,control:i,end:r,json:n,duration:a,ease:o="power1.out",showControl:h=!1,loop:u=!1}=t;this._particleContainer=new Z1,this.addChild(this._particleContainer);const d=new dt(this._particleContainer,n),l=this._createBezierPoints([e,...i,r],100,h),c={pathThrough:0};ut.to(c,{duration:a,pathThrough:l.length-1,repeat:u?-1:0,ease:o,onStart:()=>{d.emit=!0},onUpdate:()=>{const p=Math.floor(c.pathThrough),m=l[p];d.updateOwnerPos(m.x,m.y)},onComplete:()=>{ut.to(this,{alpha:0,duration:.5,onComplete:()=>{d.emit=!1,f.destroy(),this.removeFromParent()}})}});const f=new ct;f.add(()=>{d.update(1/75)}),f.start()}_createBezierPoints(t,e,i){const r=[];i&&t.forEach((n,a)=>{const o=new Du({text:a+1,fontSize:16});o.position.set(n.x,n.y),this.addChild(o)});for(let n=0;n<e;n++){const a=this._multiPointBezier(t,n/e);r.push(a)}return r}_multiPointBezier(t,e){const i=t.length;let r=0,n=0;const a=[];for(let o=0;o<i;o++)a[o]=this._binomial(i-1,o);for(let o=0;o<i;o++){const h=t[o],u=a[o],d=Math.pow(e,o),l=Math.pow(1-e,i-1-o);r+=h.x*l*d*u,n+=h.y*l*d*u}return{x:r,y:n}}_binomial(t,e){if(e===0||e===t)return 1;let i=1;for(let r=1;r<=e;r++)i=i*(t-r+1)/r;return i}}var xi=(s=>(s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping",s))(xi||{}),j=(s=>(s[s.setup=0]="setup",s[s.first=1]="first",s[s.replace=2]="replace",s[s.add=3]="add",s))(j||{}),Te=(s=>(s[s.mixIn=0]="mixIn",s[s.mixOut=1]="mixOut",s))(Te||{}),co=(s=>(s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent",s))(co||{}),Vs=(s=>(s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale",s))(Vs||{}),se=(s=>(s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection",s))(se||{});class qm{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const t=this.texture;return t.trim?t.trim.width:t.orig.width}get height(){const t=this.texture;return t.trim?t.trim.height:t.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const t=this.texture;return t.trim?t.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const t=this.texture;return t.trim?t.trim.y:0}get spineOffsetY(){const t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return this.texture.rotate!==0}get degrees(){return(360-this.texture.rotate*45)%360}}class tE{constructor(){this.array=new Array}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}const Xs=class{constructor(s=0,t=0,e=0,i=0){this.r=s,this.g=t,this.b=e,this.a=i}set(s,t,e,i){return this.r=s,this.g=t,this.b=e,this.a=i,this.clamp()}setFromColor(s){return this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this}setFromString(s){return s=s.charAt(0)=="#"?s.substr(1):s,this.r=parseInt(s.substr(0,2),16)/255,this.g=parseInt(s.substr(2,2),16)/255,this.b=parseInt(s.substr(4,2),16)/255,this.a=s.length!=8?1:parseInt(s.substr(6,2),16)/255,this}add(s,t,e,i){return this.r+=s,this.g+=t,this.b+=e,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(s,t){s.r=((t&4278190080)>>>24)/255,s.g=((t&16711680)>>>16)/255,s.b=((t&65280)>>>8)/255,s.a=(t&255)/255}static rgb888ToColor(s,t){s.r=((t&16711680)>>>16)/255,s.g=((t&65280)>>>8)/255,s.b=(t&255)/255}static fromString(s){return new Xs().setFromString(s)}};let we=Xs;we.WHITE=new Xs(1,1,1,1),we.RED=new Xs(1,0,0,1),we.GREEN=new Xs(0,1,0,1),we.BLUE=new Xs(0,0,1,1),we.MAGENTA=new Xs(1,0,1,1);const Ni=class{static clamp(s,t,e){return s<t?t:s>e?e:s}static cosDeg(s){return Math.cos(s*Ni.degRad)}static sinDeg(s){return Math.sin(s*Ni.degRad)}static signum(s){return Math.sign(s)}static toInt(s){return s>0?Math.floor(s):Math.ceil(s)}static cbrt(s){const t=Math.pow(Math.abs(s),.3333333333333333);return s<0?-t:t}static randomTriangular(s,t){return Ni.randomTriangularWith(s,t,(s+t)*.5)}static randomTriangularWith(s,t,e){const i=Math.random(),r=t-s;return i<=(e-s)/r?s+Math.sqrt(i*r*(e-s)):t-Math.sqrt((1-i)*r*(t-e))}static isPowerOfTwo(s){return s&&(s&s-1)===0}};let L=Ni;L.PI=3.1415927,L.PI2=Ni.PI*2,L.radiansToDegrees=180/Ni.PI,L.radDeg=Ni.radiansToDegrees,L.degreesToRadians=Ni.PI/180,L.degRad=Ni.degreesToRadians;class eE{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class iE extends eE{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}}class sE extends iE{applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}const Cr=class{static arrayCopy(s,t,e,i,r){for(let n=t,a=i;n<t+r;n++,a++)e[a]=s[n]}static arrayFill(s,t,e,i){for(let r=t;r<e;r++)s[r]=i}static setArraySize(s,t,e=0){const i=s.length;if(i==t)return s;if(s.length=t,i<t)for(let r=i;r<t;r++)s[r]=e;return s}static ensureArrayCapacity(s,t,e=0){return s.length>=t?s:Cr.setArraySize(s,t,e)}static newArray(s,t){const e=new Array(s);for(let i=0;i<s;i++)e[i]=t;return e}static newFloatArray(s){if(Cr.SUPPORTS_TYPED_ARRAYS)return new Float32Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static newShortArray(s){if(Cr.SUPPORTS_TYPED_ARRAYS)return new Int16Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static toFloatArray(s){return Cr.SUPPORTS_TYPED_ARRAYS?new Float32Array(s):s}static toSinglePrecision(s){return Cr.SUPPORTS_TYPED_ARRAYS?Math.fround(s):s}static webkit602BugfixHelper(s,t){}static contains(s,t,e=!0){for(let i=0;i<s.length;i++)if(s[i]==t)return!0;return!1}static enumValue(s,t){return s[t[0].toUpperCase()+t.slice(1)]}};let Q=Cr;Q.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";class rE{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class nE{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){const t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}}const aE={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0},us=[0,0,0];class oE extends _e{constructor(){super(...arguments),this.region=null,this.attachment=null}}class hE extends K1{constructor(t,e,i,r,n){super(t,e,i,r,n),this.region=null,this.attachment=null}}const Km=class extends bt{constructor(s){if(super(),!s)throw new Error("The spineData param is required.");if(typeof s=="string")throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=s,this.createSkeleton(s),this.slotContainers=[],this.tempClipContainers=[];for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t],r=i.getAttachment(),n=this.newContainer();if(this.slotContainers.push(n),this.addChild(n),this.tempClipContainers.push(null),!!r)if(r.type===xi.Region){const a=r.name,o=this.createSprite(i,r,a);i.currentSprite=o,i.currentSpriteName=a,n.addChild(o)}else if(r.type===xi.Mesh){const a=this.createMesh(i,r);i.currentMesh=a,i.currentMeshId=r.id,i.currentMeshName=r.name,n.addChild(a)}else r.type===xi.Clipping&&(this.createGraphics(i,r),n.addChild(i.clippingContainer),n.addChild(i.currentGraphics))}this.tintRgb=new Float32Array([1,1,1]),this.autoUpdate=!0,this.visible=!0}get debug(){return this._debug}set debug(s){var t;s!=this._debug&&((t=this._debug)==null||t.unregisterSpine(this),s==null||s.registerSpine(this),this._debug=s)}get autoUpdate(){return this._autoUpdate}set autoUpdate(s){s!==this._autoUpdate&&(this._autoUpdate=s,this.updateTransform=s?Km.prototype.autoUpdateTransform:bt.prototype.updateTransform)}get tint(){return Qr(this.tintRgb)}set tint(s){this.tintRgb=Cd(s,this.tintRgb)}get delayLimit(){return(typeof this.localDelayLimit<"u"?this.localDelayLimit:aE.GLOBAL_DELAY_LIMIT)||Number.MAX_VALUE}update(s){var u;const t=this.delayLimit;if(s>t&&(s=t),this.state.update(s),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const e=this.skeleton.slots,i=this.color;let r=null,n=null;i?(r=i.light,n=i.dark):r=this.tintRgb;for(let d=0,l=e.length;d<l;d++){const c=e[d],f=c.getAttachment(),p=this.slotContainers[d];if(!f){p.visible=!1;continue}let m=null;f.sequence&&f.sequence.apply(c,f);let _=f.region;const g=f.color;switch(f!=null&&f.type){case xi.Region:if(p.transform.setFromMatrix(c.bone.matrix),_=f.region,c.currentMesh&&(c.currentMesh.visible=!1,c.currentMesh=null,c.currentMeshId=void 0,c.currentMeshName=void 0),!_){c.currentSprite&&(c.currentSprite.renderable=!1);break}if(!c.currentSpriteName||c.currentSpriteName!==f.name){const v=f.name;if(c.currentSprite&&(c.currentSprite.visible=!1),c.sprites=c.sprites||{},c.sprites[v]!==void 0)c.sprites[v].visible=!0;else{const b=this.createSprite(c,f,v);p.addChild(b)}c.currentSprite=c.sprites[v],c.currentSpriteName=v}c.currentSprite.renderable=!0,c.hackRegion||this.setSpriteRegion(f,c.currentSprite,_),c.currentSprite.color?m=c.currentSprite.color:(us[0]=r[0]*c.color.r*g.r,us[1]=r[1]*c.color.g*g.g,us[2]=r[2]*c.color.b*g.b,c.currentSprite.tint=Qr(us)),c.currentSprite.blendMode=c.blendMode;break;case xi.Mesh:if(c.currentSprite){c.currentSprite.visible=!1,c.currentSprite=null,c.currentSpriteName=void 0;const v=new ua;v._parentID=-1,v._worldID=p.transform._worldID,p.transform=v}if(!_){c.currentMesh&&(c.currentMesh.renderable=!1);break}const y=f.id;if(c.currentMeshId===void 0||c.currentMeshId!==y){const v=y;if(c.currentMesh&&(c.currentMesh.visible=!1),c.meshes=c.meshes||{},c.meshes[v]!==void 0)c.meshes[v].visible=!0;else{const b=this.createMesh(c,f);p.addChild(b)}c.currentMesh=c.meshes[v],c.currentMeshName=f.name,c.currentMeshId=v}c.currentMesh.renderable=!0,f.computeWorldVerticesOld(c,c.currentMesh.vertices),c.currentMesh.color?m=c.currentMesh.color:(us[0]=r[0]*c.color.r*g.r,us[1]=r[1]*c.color.g*g.g,us[2]=r[2]*c.color.b*g.b,c.currentMesh.tint=Qr(us)),c.currentMesh.blendMode=c.blendMode,c.hackRegion||this.setMeshRegion(f,c.currentMesh,_);break;case xi.Clipping:c.currentGraphics||(this.createGraphics(c,f),p.addChild(c.clippingContainer),p.addChild(c.currentGraphics)),this.updateGraphics(c,f),p.alpha=1,p.visible=!0;continue;default:p.visible=!1;continue}if(p.visible=!0,m){let x=c.color.r*g.r,y=c.color.g*g.g,v=c.color.b*g.b;m.setLight(r[0]*x+n[0]*(1-x),r[1]*y+n[1]*(1-y),r[2]*v+n[2]*(1-v)),c.darkColor?(x=c.darkColor.r,y=c.darkColor.g,v=c.darkColor.b):(x=0,y=0,v=0),m.setDark(r[0]*x+n[0]*(1-x),r[1]*y+n[1]*(1-y),r[2]*v+n[2]*(1-v))}p.alpha=c.color.a}const a=this.skeleton.drawOrder;let o=null,h=null;for(let d=0,l=a.length;d<l;d++){const c=e[a[d].data.index],f=this.slotContainers[a[d].data.index];if(h||f.parent!==null&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),c.currentGraphics&&c.getAttachment())h=c.clippingContainer,o=c.getAttachment(),h.children.length=0,this.children[d]=f,o.endSlot===c.data&&(o.endSlot=null);else if(h){let p=this.tempClipContainers[d];p||(p=this.tempClipContainers[d]=this.newContainer(),p.visible=!1),this.children[d]=p,f.parent=null,h.addChild(f),o.endSlot==c.data&&(h.renderable=!0,h=null,o=null)}else this.children[d]=f}(u=this._debug)==null||u.renderDebug(this)}setSpriteRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,t.rotation=s.rotation*L.degRad,t.position.x=s.x,t.position.y=s.y,t.alpha=s.color.a,e.size?(t.scale.x=e.size.width/e.originalWidth,t.scale.y=-e.size.height/e.originalHeight):(t.scale.x=s.scaleX*s.width/e.originalWidth,t.scale.y=-s.scaleY*s.height/e.originalHeight))}setMeshRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,e.texture.updateUvs(),t.uvBuffer.update(s.regionUVs))}autoUpdateTransform(){{this.lastTime=this.lastTime||Date.now();const s=(Date.now()-this.lastTime)*.001;this.lastTime=Date.now(),this.update(s)}bt.prototype.updateTransform.call(this)}createSprite(s,t,e){let i=t.region;s.hackAttachment===t&&(i=s.hackRegion);const r=i?i.texture:null,n=this.newSprite(r);return n.anchor.set(.5),i&&this.setSpriteRegion(t,n,t.region),s.sprites=s.sprites||{},s.sprites[e]=n,n}createMesh(s,t){let e=t.region;s.hackAttachment===t&&(e=s.hackRegion,s.hackAttachment=null,s.hackRegion=null);const i=this.newMesh(e?e.texture:null,new Float32Array(t.regionUVs.length),t.regionUVs,new Uint16Array(t.triangles),Ue.TRIANGLES);return typeof i._canvasPadding<"u"&&(i._canvasPadding=1.5),i.alpha=t.color.a,i.region=t.region,e&&this.setMeshRegion(t,i,e),s.meshes=s.meshes||{},s.meshes[t.id]=i,i}createGraphics(s,t){const e=this.newGraphics(),i=new Yi([]);return e.clear(),e.beginFill(16777215,1),e.drawPolygon(i),e.renderable=!1,s.currentGraphics=e,s.clippingContainer=this.newContainer(),s.clippingContainer.mask=s.currentGraphics,e}updateGraphics(s,t){const e=s.currentGraphics.geometry,i=e.graphicsData[0].shape.points,r=t.worldVerticesLength;i.length=r,t.computeWorldVertices(s,0,r,i,0,2),e.invalidate()}hackTextureBySlotIndex(s,t=null,e=null){const i=this.skeleton.slots[s];if(!i)return!1;const r=i.getAttachment();let n=r.region;return t?(n=new qm,n.texture=t,n.size=e,i.hackRegion=n,i.hackAttachment=r):(i.hackRegion=null,i.hackAttachment=null),i.currentSprite?this.setSpriteRegion(r,i.currentSprite,n):i.currentMesh&&this.setMeshRegion(r,i.currentMesh,n),!0}hackTextureBySlotName(s,t=null,e=null){const i=this.skeleton.findSlotIndex(s);return i==-1?!1:this.hackTextureBySlotIndex(i,t,e)}hackTextureAttachment(s,t,e,i=null){const r=this.skeleton.findSlotIndex(s),n=this.skeleton.getAttachmentByName(s,t);n.region.texture=e;const a=this.skeleton.slots[r];if(!a)return!1;const o=a.getAttachment();if(t===o.name){let h=n.region;return e?(h=new qm,h.texture=e,h.size=i,a.hackRegion=h,a.hackAttachment=o):(a.hackRegion=null,a.hackAttachment=null),a.currentSprite&&a.currentSprite.region!=h?(this.setSpriteRegion(o,a.currentSprite,h),a.currentSprite.region=h):a.currentMesh&&a.currentMesh.region!=h&&this.setMeshRegion(o,a.currentMesh,h),!0}return!1}newContainer(){return new bt}newSprite(s){return new oE(s)}newGraphics(){return new ui}newMesh(s,t,e,i,r){return new hE(s,t,e,i,r)}transformHack(){return 1}hackAttachmentGroups(s,t,e){if(!s)return;const i=[],r=[];for(let n=0,a=this.skeleton.slots.length;n<a;n++){const o=this.skeleton.slots[n],h=o.currentSpriteName||o.currentMeshName||"",u=o.currentSprite||o.currentMesh;h.endsWith(s)?(u.parentGroup=t,r.push(u)):e&&u&&(u.parentGroup=e,i.push(u))}return[i,r]}destroy(s){this.debug=null;for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t];for(const r in i.meshes)i.meshes[r].destroy(s);i.meshes=null;for(const r in i.sprites)i.sprites[r].destroy(s);i.sprites=null}for(let t=0,e=this.slotContainers.length;t<e;t++)this.slotContainers[t].destroy(s);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,super.destroy(s)}};let Bu=Km;Bu.clippingPolygon=[],Object.defineProperty(Bu.prototype,"visible",{get(){return this._visible},set(s){s!==this._visible&&(this._visible=s,s&&(this.lastTime=0))}});class Zm{constructor(t){if(t==null)throw new Error("name cannot be null.");this.name=t}}const Qm=class extends Zm{constructor(s){super(s),this.id=(Qm.nextID++&65535)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(s,t){this.computeWorldVertices(s,0,this.worldVerticesLength,t,0,2)}computeWorldVertices(s,t,e,i,r,n){e=r+(e>>1)*n;const a=s.bone.skeleton,o=s.deform;let h=this.vertices;const u=this.bones;if(u==null){o.length>0&&(h=o);const f=s.bone.matrix,p=f.tx,m=f.ty,_=f.a,g=f.c,x=f.b,y=f.d;for(let v=t,b=r;b<e;v+=2,b+=n){const E=h[v],w=h[v+1];i[b]=E*_+w*g+p,i[b+1]=E*x+w*y+m}return}let d=0,l=0;for(let f=0;f<t;f+=2){const p=u[d];d+=p+1,l+=p}const c=a.bones;if(o.length==0)for(let f=r,p=l*3;f<e;f+=n){let m=0,_=0,g=u[d++];for(g+=d;d<g;d++,p+=3){const x=c[u[d]].matrix,y=h[p],v=h[p+1],b=h[p+2];m+=(y*x.a+v*x.c+x.tx)*b,_+=(y*x.b+v*x.d+x.ty)*b}i[f]=m,i[f+1]=_}else{const f=o;for(let p=r,m=l*3,_=l<<1;p<e;p+=n){let g=0,x=0,y=u[d++];for(y+=d;d<y;d++,m+=3,_+=2){const v=c[u[d]].matrix,b=h[m]+f[_],E=h[m+1]+f[_+1],w=h[m+2];g+=(b*v.a+E*v.c+v.tx)*w,x+=(b*v.b+E*v.d+v.ty)*w}i[p]=g,i[p+1]=x}}}copyTo(s){this.bones!=null?(s.bones=new Array(this.bones.length),Q.arrayCopy(this.bones,0,s.bones,0,this.bones.length)):s.bones=null,this.vertices!=null?(s.vertices=Q.newFloatArray(this.vertices.length),Q.arrayCopy(this.vertices,0,s.vertices,0,this.vertices.length)):s.vertices=null,s.worldVerticesLength=this.worldVerticesLength,s.deformAttachment=this.deformAttachment}};let Ou=Qm;Ou.nextID=0;class fo extends Ou{constructor(t){super(t),this.type=xi.Mesh,this.color=new we(1,1,1,1),this.tempColor=new we(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t!=null&&(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!=null)return this.newLinkedMesh();const t=new fo(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),Q.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),Q.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=new Array(this.edges.length),Q.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new fo(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh!=null?this.parentMesh:this),t}}class An extends Ou{constructor(t){super(t),this.type=xi.Path,this.closed=!1,this.constantSpeed=!1,this.color=new we(1,1,1,1)}copy(){const t=new An(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),Q.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Jm{constructor(t,e){if(this.deform=new Array,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new we,this.darkColor=t.darkColor==null?null:new we,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const Kt=class extends Zm{constructor(s){super(s),this.type=xi.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new we(1,1,1,1),this.offset=Q.newFloatArray(8),this.uvs=Q.newFloatArray(8),this.tempColor=new we(1,1,1,1)}updateOffset(){const s=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,e=-this.width/2*this.scaleX+this.region.offsetX*s,i=-this.height/2*this.scaleY+this.region.offsetY*t,r=e+this.region.width*s,n=i+this.region.height*t,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),u=e*o+this.x,d=e*h,l=i*o+this.y,c=i*h,f=r*o+this.x,p=r*h,m=n*o+this.y,_=n*h,g=this.offset;g[Kt.OX1]=u-c,g[Kt.OY1]=l+d,g[Kt.OX2]=u-_,g[Kt.OY2]=m+d,g[Kt.OX3]=f-_,g[Kt.OY3]=m+p,g[Kt.OX4]=f-c,g[Kt.OY4]=l+p}setRegion(s){this.region=s;const t=this.uvs;s.rotate?(t[2]=s.u,t[3]=s.v2,t[4]=s.u,t[5]=s.v,t[6]=s.u2,t[7]=s.v,t[0]=s.u2,t[1]=s.v2):(t[0]=s.u,t[1]=s.v2,t[2]=s.u,t[3]=s.v,t[4]=s.u2,t[5]=s.v,t[6]=s.u2,t[7]=s.v2)}computeWorldVertices(s,t,e,i){const r=this.offset,n=s instanceof Jm?s.bone.matrix:s.matrix,a=n.tx,o=n.ty,h=n.a,u=n.c,d=n.b,l=n.d;let c=0,f=0;c=r[Kt.OX1],f=r[Kt.OY1],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o,e+=i,c=r[Kt.OX2],f=r[Kt.OY2],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o,e+=i,c=r[Kt.OX3],f=r[Kt.OY3],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o,e+=i,c=r[Kt.OX4],f=r[Kt.OY4],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o}copy(){const s=new Kt(this.name);return s.region=this.region,s.rendererObject=this.rendererObject,s.path=this.path,s.x=this.x,s.y=this.y,s.scaleX=this.scaleX,s.scaleY=this.scaleY,s.rotation=this.rotation,s.width=this.width,s.height=this.height,Q.arrayCopy(this.uvs,0,s.uvs,0,8),Q.arrayCopy(this.offset,0,s.offset,0,8),s.color.setFromColor(this.color),s}};let et=Kt;et.OX1=0,et.OY1=1,et.OX2=2,et.OY2=3,et.OX3=4,et.OY3=5,et.OX4=6,et.OY4=7,et.X1=0,et.Y1=1,et.C1R=2,et.C1G=3,et.C1B=4,et.C1A=5,et.U1=6,et.V1=7,et.X2=8,et.Y2=9,et.C2R=10,et.C2G=11,et.C2B=12,et.C2A=13,et.U2=14,et.V2=15,et.X3=16,et.Y3=17,et.C3R=18,et.C3G=19,et.C3B=20,et.C3A=21,et.U3=22,et.V3=23,et.X4=24,et.Y4=25,et.C4R=26,et.C4G=27,et.C4B=28,et.C4A=29,et.U4=30,et.V4=31,new sE(2);class pe{constructor(t,e,i){if(t==null)throw new Error("name cannot be null.");if(e==null)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let r=0;r<e.length;r++)this.timelineIds[e[r].getPropertyId()]=!0;this.duration=i}hasTimeline(t){return this.timelineIds[t]==!0}apply(t,e,i,r,n,a,o,h){if(t==null)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));const u=this.timelines;for(let d=0,l=u.length;d<l;d++)u[d].apply(t,e,i,n,a,o,h)}static binarySearch(t,e,i=1){let r=0,n=t.length/i-2;if(n==0)return i;let a=n>>>1;for(;;){if(t[(a+1)*i]<=e?r=a+1:n=a,r==n)return(r+1)*i;a=r+n>>>1}}static linearSearch(t,e,i){for(let r=0,n=t.length-i;r<=n;r+=i)if(t[r]>e)return r;return-1}}const Gt=class{constructor(s){if(s<=0)throw new Error(`frameCount must be > 0: ${s}`);this.curves=Q.newFloatArray((s-1)*Gt.BEZIER_SIZE)}getFrameCount(){return this.curves.length/Gt.BEZIER_SIZE+1}setLinear(s){this.curves[s*Gt.BEZIER_SIZE]=Gt.LINEAR}setStepped(s){this.curves[s*Gt.BEZIER_SIZE]=Gt.STEPPED}getCurveType(s){const t=s*Gt.BEZIER_SIZE;if(t==this.curves.length)return Gt.LINEAR;const e=this.curves[t];return e==Gt.LINEAR?Gt.LINEAR:e==Gt.STEPPED?Gt.STEPPED:Gt.BEZIER}setCurve(s,t,e,i,r){const n=(-t*2+i)*.03,a=(-e*2+r)*.03,o=((t-i)*3+1)*.006,h=((e-r)*3+1)*.006;let u=n*2+o,d=a*2+h,l=t*.3+n+o*.16666667,c=e*.3+a+h*.16666667,f=s*Gt.BEZIER_SIZE;const p=this.curves;p[f++]=Gt.BEZIER;let m=l,_=c;for(let g=f+Gt.BEZIER_SIZE-1;f<g;f+=2)p[f]=m,p[f+1]=_,l+=u,c+=d,u+=o,d+=h,m+=l,_+=c}getCurvePercent(s,t){t=L.clamp(t,0,1);const e=this.curves;let i=s*Gt.BEZIER_SIZE;const r=e[i];if(r==Gt.LINEAR)return t;if(r==Gt.STEPPED)return 0;i++;let n=0;for(let o=i,h=i+Gt.BEZIER_SIZE-1;i<h;i+=2)if(n=e[i],n>=t){let u,d;return i==o?(u=0,d=0):(u=e[i-2],d=e[i-1]),d+(e[i+1]-d)*(t-u)/(n-u)}const a=e[i-1];return a+(1-a)*(t-n)/(1-n)}};let Fe=Gt;Fe.LINEAR=0,Fe.STEPPED=1,Fe.BEZIER=2,Fe.BEZIER_SIZE=10*2-1;const cs=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(s,t,e){s<<=1,this.frames[s]=t,this.frames[s+cs.ROTATION]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotation=h.data.rotation;return;case j.first:const p=h.data.rotation-h.rotation;h.rotation+=(p-(16384-(16384.499999999996-p/360|0))*360)*r}return}if(e>=o[o.length-cs.ENTRIES]){let p=o[o.length+cs.PREV_ROTATION];switch(n){case j.setup:h.rotation=h.data.rotation+p*r;break;case j.first:case j.replace:p+=h.data.rotation-h.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case j.add:h.rotation+=p*r}return}const u=pe.binarySearch(o,e,cs.ENTRIES),d=o[u+cs.PREV_ROTATION],l=o[u],c=this.getCurvePercent((u>>1)-1,1-(e-l)/(o[u+cs.PREV_TIME]-l));let f=o[u+cs.ROTATION]-d;switch(f=d+(f-(16384-(16384.499999999996-f/360|0))*360)*c,n){case j.setup:h.rotation=h.data.rotation+(f-(16384-(16384.499999999996-f/360|0))*360)*r;break;case j.first:case j.replace:f+=h.data.rotation-h.rotation;case j.add:h.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*r}}};let ke=cs;ke.ENTRIES=2,ke.PREV_TIME=-2,ke.PREV_ROTATION=-1,ke.ROTATION=1;const ae=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ae.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(s,t,e,i){s*=ae.ENTRIES,this.frames[s]=t,this.frames[s+ae.X]=e,this.frames[s+ae.Y]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.x=h.data.x,h.y=h.data.y;return;case j.first:h.x+=(h.data.x-h.x)*r,h.y+=(h.data.y-h.y)*r}return}let u=0,d=0;if(e>=o[o.length-ae.ENTRIES])u=o[o.length+ae.PREV_X],d=o[o.length+ae.PREV_Y];else{const l=pe.binarySearch(o,e,ae.ENTRIES);u=o[l+ae.PREV_X],d=o[l+ae.PREV_Y];const c=o[l],f=this.getCurvePercent(l/ae.ENTRIES-1,1-(e-c)/(o[l+ae.PREV_TIME]-c));u+=(o[l+ae.X]-u)*f,d+=(o[l+ae.Y]-d)*f}switch(n){case j.setup:h.x=h.data.x+u*r,h.y=h.data.y+d*r;break;case j.first:case j.replace:h.x+=(h.data.x+u-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case j.add:h.x+=u*r,h.y+=d*r}}};let Pr=ae;Pr.ENTRIES=3,Pr.PREV_TIME=-3,Pr.PREV_X=-2,Pr.PREV_Y=-1,Pr.X=1,Pr.Y=2;const It=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*It.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(s,t,e,i,r,n){s*=It.ENTRIES,this.frames[s]=t,this.frames[s+It.R]=e,this.frames[s+It.G]=i,this.frames[s+It.B]=r,this.frames[s+It.A]=n}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color);return;case j.first:const f=o.color,p=o.data.color;f.add((p.r-f.r)*r,(p.g-f.g)*r,(p.b-f.b)*r,(p.a-f.a)*r)}return}let u=0,d=0,l=0,c=0;if(e>=h[h.length-It.ENTRIES]){const f=h.length;u=h[f+It.PREV_R],d=h[f+It.PREV_G],l=h[f+It.PREV_B],c=h[f+It.PREV_A]}else{const f=pe.binarySearch(h,e,It.ENTRIES);u=h[f+It.PREV_R],d=h[f+It.PREV_G],l=h[f+It.PREV_B],c=h[f+It.PREV_A];const p=h[f],m=this.getCurvePercent(f/It.ENTRIES-1,1-(e-p)/(h[f+It.PREV_TIME]-p));u+=(h[f+It.R]-u)*m,d+=(h[f+It.G]-d)*m,l+=(h[f+It.B]-l)*m,c+=(h[f+It.A]-c)*m}if(r==1)o.color.set(u,d,l,c);else{const f=o.color;n==j.setup&&f.setFromColor(o.data.color),f.add((u-f.r)*r,(d-f.g)*r,(l-f.b)*r,(c-f.a)*r)}}};let vi=It;vi.ENTRIES=5,vi.PREV_TIME=-5,vi.PREV_R=-4,vi.PREV_G=-3,vi.PREV_B=-2,vi.PREV_A=-1,vi.R=1,vi.G=2,vi.B=3,vi.A=4;const ot=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ot.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(s,t,e,i,r,n,a,o,h){s*=ot.ENTRIES,this.frames[s]=t,this.frames[s+ot.R]=e,this.frames[s+ot.G]=i,this.frames[s+ot.B]=r,this.frames[s+ot.A]=n,this.frames[s+ot.R2]=a,this.frames[s+ot.G2]=o,this.frames[s+ot.B2]=h}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color),o.darkColor.setFromColor(o.data.darkColor);return;case j.first:const _=o.color,g=o.darkColor,x=o.data.color,y=o.data.darkColor;_.add((x.r-_.r)*r,(x.g-_.g)*r,(x.b-_.b)*r,(x.a-_.a)*r),g.add((y.r-g.r)*r,(y.g-g.g)*r,(y.b-g.b)*r,0)}return}let u=0,d=0,l=0,c=0,f=0,p=0,m=0;if(e>=h[h.length-ot.ENTRIES]){const _=h.length;u=h[_+ot.PREV_R],d=h[_+ot.PREV_G],l=h[_+ot.PREV_B],c=h[_+ot.PREV_A],f=h[_+ot.PREV_R2],p=h[_+ot.PREV_G2],m=h[_+ot.PREV_B2]}else{const _=pe.binarySearch(h,e,ot.ENTRIES);u=h[_+ot.PREV_R],d=h[_+ot.PREV_G],l=h[_+ot.PREV_B],c=h[_+ot.PREV_A],f=h[_+ot.PREV_R2],p=h[_+ot.PREV_G2],m=h[_+ot.PREV_B2];const g=h[_],x=this.getCurvePercent(_/ot.ENTRIES-1,1-(e-g)/(h[_+ot.PREV_TIME]-g));u+=(h[_+ot.R]-u)*x,d+=(h[_+ot.G]-d)*x,l+=(h[_+ot.B]-l)*x,c+=(h[_+ot.A]-c)*x,f+=(h[_+ot.R2]-f)*x,p+=(h[_+ot.G2]-p)*x,m+=(h[_+ot.B2]-m)*x}if(r==1)o.color.set(u,d,l,c),o.darkColor.set(f,p,m,1);else{const _=o.color,g=o.darkColor;n==j.setup&&(_.setFromColor(o.data.color),g.setFromColor(o.data.darkColor)),_.add((u-_.r)*r,(d-_.g)*r,(l-_.b)*r,(c-_.a)*r),g.add((f-g.r)*r,(p-g.g)*r,(m-g.b)*r,0)}}};let re=ot;re.ENTRIES=8,re.PREV_TIME=-8,re.PREV_R=-7,re.PREV_G=-6,re.PREV_B=-5,re.PREV_A=-4,re.PREV_R2=-3,re.PREV_G2=-2,re.PREV_B2=-1,re.R=1,re.G=2,re.B=3,re.A=4,re.R2=5,re.G2=6,re.B2=7;class po{constructor(t){this.frames=Q.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,r,n,a,o){const h=t.slots[this.slotIndex];if(!h.bone.active)return;if(o==Te.mixOut){a==j.setup&&this.setAttachment(t,h,h.data.attachmentName);return}const u=this.frames;if(i<u[0]){(a==j.setup||a==j.first)&&this.setAttachment(t,h,h.data.attachmentName);return}let d=0;i>=u[u.length-1]?d=u.length-1:d=pe.binarySearch(u,i,1)-1;const l=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(l==null?null:t.getAttachment(this.slotIndex,l))}setAttachment(t,e,i){e.setAttachment(i==null?null:t.getAttachment(this.slotIndex,i))}}class lE{constructor(t){this.frames=Q.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,r,n,a,o){if(r==null)return;const h=this.frames,u=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,r,n,a,o),e=-1;else if(e>=h[u-1])return;if(i<h[0])return;let d=0;if(e<h[0])d=0;else{d=pe.binarySearch(h,e);const l=h[d];for(;d>0&&h[d-1]==l;)d--}for(;d<u&&i>=h[d];d++)r.push(this.events[d])}}class Fu{constructor(t){this.frames=Q.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,r,n,a,o){const h=t.drawOrder,u=t.slots;if(o==Te.mixOut&&a==j.setup){Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}const d=this.frames;if(i<d[0]){(a==j.setup||a==j.first)&&Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let l=0;i>=d[d.length-1]?l=d.length-1:l=pe.binarySearch(d,i)-1;const c=this.drawOrders[l];if(c==null)Q.arrayCopy(u,0,h,0,u.length);else for(let f=0,p=c.length;f<p;f++)h[f]=u[c[f]]}}const ht=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ht.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(s,t,e,i,r,n,a){s*=ht.ENTRIES,this.frames[s]=t,this.frames[s+ht.MIX]=e,this.frames[s+ht.SOFTNESS]=i,this.frames[s+ht.BEND_DIRECTION]=r,this.frames[s+ht.COMPRESS]=n?1:0,this.frames[s+ht.STRETCH]=a?1:0}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch;return;case j.first:h.mix+=(h.data.mix-h.mix)*r,h.softness+=(h.data.softness-h.softness)*r,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(e>=o[o.length-ht.ENTRIES]){n==j.setup?(h.mix=h.data.mix+(o[o.length+ht.PREV_MIX]-h.data.mix)*r,h.softness=h.data.softness+(o[o.length+ht.PREV_SOFTNESS]-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0)):(h.mix+=(o[o.length+ht.PREV_MIX]-h.mix)*r,h.softness+=(o[o.length+ht.PREV_SOFTNESS]-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0));return}const u=pe.binarySearch(o,e,ht.ENTRIES),d=o[u+ht.PREV_MIX],l=o[u+ht.PREV_SOFTNESS],c=o[u],f=this.getCurvePercent(u/ht.ENTRIES-1,1-(e-c)/(o[u+ht.PREV_TIME]-c));n==j.setup?(h.mix=h.data.mix+(d+(o[u+ht.MIX]-d)*f-h.data.mix)*r,h.softness=h.data.softness+(l+(o[u+ht.SOFTNESS]-l)*f-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[u+ht.PREV_BEND_DIRECTION],h.compress=o[u+ht.PREV_COMPRESS]!=0,h.stretch=o[u+ht.PREV_STRETCH]!=0)):(h.mix+=(d+(o[u+ht.MIX]-d)*f-h.mix)*r,h.softness+=(l+(o[u+ht.SOFTNESS]-l)*f-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[u+ht.PREV_BEND_DIRECTION],h.compress=o[u+ht.PREV_COMPRESS]!=0,h.stretch=o[u+ht.PREV_STRETCH]!=0))}};let Le=ht;Le.ENTRIES=6,Le.PREV_TIME=-6,Le.PREV_MIX=-5,Le.PREV_SOFTNESS=-4,Le.PREV_BEND_DIRECTION=-3,Le.PREV_COMPRESS=-2,Le.PREV_STRETCH=-1,Le.MIX=1,Le.SOFTNESS=2,Le.BEND_DIRECTION=3,Le.COMPRESS=4,Le.STRETCH=5;const Rt=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Rt.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(s,t,e,i,r,n){s*=Rt.ENTRIES,this.frames[s]=t,this.frames[s+Rt.ROTATE]=e,this.frames[s+Rt.TRANSLATE]=i,this.frames[s+Rt.SCALE]=r,this.frames[s+Rt.SHEAR]=n}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(e<o[0]){const f=h.data;switch(n){case j.setup:h.rotateMix=f.rotateMix,h.translateMix=f.translateMix,h.scaleMix=f.scaleMix,h.shearMix=f.shearMix;return;case j.first:h.rotateMix+=(f.rotateMix-h.rotateMix)*r,h.translateMix+=(f.translateMix-h.translateMix)*r,h.scaleMix+=(f.scaleMix-h.scaleMix)*r,h.shearMix+=(f.shearMix-h.shearMix)*r}return}let u=0,d=0,l=0,c=0;if(e>=o[o.length-Rt.ENTRIES]){const f=o.length;u=o[f+Rt.PREV_ROTATE],d=o[f+Rt.PREV_TRANSLATE],l=o[f+Rt.PREV_SCALE],c=o[f+Rt.PREV_SHEAR]}else{const f=pe.binarySearch(o,e,Rt.ENTRIES);u=o[f+Rt.PREV_ROTATE],d=o[f+Rt.PREV_TRANSLATE],l=o[f+Rt.PREV_SCALE],c=o[f+Rt.PREV_SHEAR];const p=o[f],m=this.getCurvePercent(f/Rt.ENTRIES-1,1-(e-p)/(o[f+Rt.PREV_TIME]-p));u+=(o[f+Rt.ROTATE]-u)*m,d+=(o[f+Rt.TRANSLATE]-d)*m,l+=(o[f+Rt.SCALE]-l)*m,c+=(o[f+Rt.SHEAR]-c)*m}if(n==j.setup){const f=h.data;h.rotateMix=f.rotateMix+(u-f.rotateMix)*r,h.translateMix=f.translateMix+(d-f.translateMix)*r,h.scaleMix=f.scaleMix+(l-f.scaleMix)*r,h.shearMix=f.shearMix+(c-f.shearMix)*r}else h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r,h.scaleMix+=(l-h.scaleMix)*r,h.shearMix+=(c-h.shearMix)*r}};let bi=Rt;bi.ENTRIES=5,bi.PREV_TIME=-5,bi.PREV_ROTATE=-4,bi.PREV_TRANSLATE=-3,bi.PREV_SCALE=-2,bi.PREV_SHEAR=-1,bi.ROTATE=1,bi.TRANSLATE=2,bi.SCALE=3,bi.SHEAR=4;const Ye=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Ye.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(s,t,e){s*=Ye.ENTRIES,this.frames[s]=t,this.frames[s+Ye.VALUE]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.position=h.data.position;return;case j.first:h.position+=(h.data.position-h.position)*r}return}let u=0;if(e>=o[o.length-Ye.ENTRIES])u=o[o.length+Ye.PREV_VALUE];else{const d=pe.binarySearch(o,e,Ye.ENTRIES);u=o[d+Ye.PREV_VALUE];const l=o[d],c=this.getCurvePercent(d/Ye.ENTRIES-1,1-(e-l)/(o[d+Ye.PREV_TIME]-l));u+=(o[d+Ye.VALUE]-u)*c}n==j.setup?h.position=h.data.position+(u-h.data.position)*r:h.position+=(u-h.position)*r}};let mo=Ye;mo.ENTRIES=2,mo.PREV_TIME=-2,mo.PREV_VALUE=-1,mo.VALUE=1;const oe=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*oe.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(s,t,e,i){s*=oe.ENTRIES,this.frames[s]=t,this.frames[s+oe.ROTATE]=e,this.frames[s+oe.TRANSLATE]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotateMix=h.data.rotateMix,h.translateMix=h.data.translateMix;return;case j.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*r,h.translateMix+=(h.data.translateMix-h.translateMix)*r}return}let u=0,d=0;if(e>=o[o.length-oe.ENTRIES])u=o[o.length+oe.PREV_ROTATE],d=o[o.length+oe.PREV_TRANSLATE];else{const l=pe.binarySearch(o,e,oe.ENTRIES);u=o[l+oe.PREV_ROTATE],d=o[l+oe.PREV_TRANSLATE];const c=o[l],f=this.getCurvePercent(l/oe.ENTRIES-1,1-(e-c)/(o[l+oe.PREV_TIME]-c));u+=(o[l+oe.ROTATE]-u)*f,d+=(o[l+oe.TRANSLATE]-d)*f}n==j.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}};let Ir=oe;Ir.ENTRIES=3,Ir.PREV_TIME=-3,Ir.PREV_ROTATE=-2,Ir.PREV_TRANSLATE=-1,Ir.ROTATE=1,Ir.TRANSLATE=2;const Mt=class{constructor(s){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new t_(this),this.propertyIDs=new tE,this.animationsChanged=!1,this.trackEntryPool=new rE(()=>new ku),this.data=s}update(s){s*=this.timeScale;const t=this.tracks;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r==null)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let n=s*r.timeScale;if(r.delay>0){if(r.delay-=n,r.delay>0)continue;n=-r.delay,r.delay=0}let a=r.next;if(a!=null){const o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(o/r.timeScale+s)*a.timeScale,r.trackTime+=n,this.setCurrent(e,a,!0);a.mixingFrom!=null;)a.mixTime+=s,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&r.mixingFrom==null){t[e]=null,this.queue.end(r),this.disposeNext(r);continue}if(r.mixingFrom!=null&&this.updateMixingFrom(r,s)){let o=r.mixingFrom;for(r.mixingFrom=null,o!=null&&(o.mixingTo=null);o!=null;)this.queue.end(o),o=o.mixingFrom}r.trackTime+=n}this.queue.drain()}updateMixingFrom(s,t){const e=s.mixingFrom;if(e==null)return!0;const i=this.updateMixingFrom(e,t);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,s.mixTime>0&&s.mixTime>=s.mixDuration?((e.totalAlpha==0||s.mixDuration==0)&&(s.mixingFrom=e.mixingFrom,e.mixingFrom!=null&&(e.mixingFrom.mixingTo=s),s.interruptAlpha=e.interruptAlpha,this.queue.end(e)),i):(e.trackTime+=t*e.timeScale,s.mixTime+=t,!1)}apply(s){if(s==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,e=this.tracks;let i=!1;for(let a=0,o=e.length;a<o;a++){const h=e[a];if(h==null||h.delay>0)continue;i=!0;const u=a==0?j.first:h.mixBlend;let d=h.alpha;h.mixingFrom!=null?d*=this.applyMixingFrom(h,s,u):h.trackTime>=h.trackEnd&&h.next==null&&(d=0);const l=h.animationLast,c=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(a==0&&d==1||u==j.add)for(let m=0;m<f;m++){const _=p[m];_ instanceof po?this.applyAttachmentTimeline(_,s,c,u,!0):_.apply(s,l,c,t,d,u,Te.mixIn)}else{const m=h.timelineMode,_=h.timelinesRotation.length==0;_&&Q.setArraySize(h.timelinesRotation,f<<1,null);const g=h.timelinesRotation;for(let x=0;x<f;x++){const y=p[x],v=m[x]==Mt.SUBSEQUENT?u:j.setup;y instanceof ke?this.applyRotateTimeline(y,s,c,d,v,g,x<<1,_):y instanceof po?this.applyAttachmentTimeline(y,s,c,u,!0):y.apply(s,l,c,t,d,v,Te.mixIn)}}this.queueEvents(h,c),t.length=0,h.nextAnimationLast=c,h.nextTrackLast=h.trackTime}const r=this.unkeyedState+Mt.SETUP,n=s.slots;for(let a=0,o=s.slots.length;a<o;a++){const h=n[a];if(h.attachmentState==r){const u=h.data.attachmentName;h.setAttachment(u==null?null:s.getAttachment(h.data.index,u))}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(s,t,e){const i=s.mixingFrom;i.mixingFrom!=null&&this.applyMixingFrom(i,t,e);let r=0;s.mixDuration==0?(r=1,e==j.first&&(e=j.setup)):(r=s.mixTime/s.mixDuration,r>1&&(r=1),e!=j.first&&(e=i.mixBlend));const n=r<i.eventThreshold?this.events:null,a=r<i.attachmentThreshold,o=r<i.drawOrderThreshold,h=i.animationLast,u=i.getAnimationTime(),d=i.animation.timelines.length,l=i.animation.timelines,c=i.alpha*s.interruptAlpha,f=c*(1-r);if(e==j.add)for(let p=0;p<d;p++)l[p].apply(t,h,u,n,f,e,Te.mixOut);else{const p=i.timelineMode,m=i.timelineHoldMix,_=i.timelinesRotation.length==0;_&&Q.setArraySize(i.timelinesRotation,d<<1,null);const g=i.timelinesRotation;i.totalAlpha=0;for(let x=0;x<d;x++){const y=l[x];let v=Te.mixOut,b,E=0;switch(p[x]){case Mt.SUBSEQUENT:if(!o&&y instanceof Fu)continue;b=e,E=f;break;case Mt.FIRST:b=j.setup,E=f;break;case Mt.HOLD_SUBSEQUENT:b=e,E=c;break;case Mt.HOLD_FIRST:b=j.setup,E=c;break;default:b=j.setup;const w=m[x];E=c*Math.max(0,1-w.mixTime/w.mixDuration);break}i.totalAlpha+=E,y instanceof ke?this.applyRotateTimeline(y,t,u,E,b,g,x<<1,_):y instanceof po?this.applyAttachmentTimeline(y,t,u,b,a):(o&&y instanceof Fu&&b==j.setup&&(v=Te.mixIn),y.apply(t,h,u,n,E,b,v))}}return s.mixDuration>0&&this.queueEvents(i,u),this.events.length=0,i.nextAnimationLast=u,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(s,t,e,i,r){const n=t.slots[s.slotIndex];if(!n.bone.active)return;const a=s.frames;if(e<a[0])(i==j.setup||i==j.first)&&this.setAttachment(t,n,n.data.attachmentName,r);else{let o;e>=a[a.length-1]?o=a.length-1:o=pe.binarySearch(a,e)-1,this.setAttachment(t,n,s.attachmentNames[o],r)}n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+Mt.SETUP)}setAttachment(s,t,e,i){t.setAttachment(e==null?null:s.getAttachment(t.data.index,e)),i&&(t.attachmentState=this.unkeyedState+Mt.CURRENT)}applyRotateTimeline(s,t,e,i,r,n,a,o){if(o&&(n[a]=0),i==1){s.apply(t,0,e,null,1,r,Te.mixIn);return}const h=s,u=h.frames,d=t.bones[h.boneIndex];if(!d.active)return;let l=0,c=0;if(e<u[0])switch(r){case j.setup:d.rotation=d.data.rotation;default:return;case j.first:l=d.rotation,c=d.data.rotation}else if(l=r==j.setup?d.data.rotation:d.rotation,e>=u[u.length-ke.ENTRIES])c=d.data.rotation+u[u.length+ke.PREV_ROTATION];else{const m=pe.binarySearch(u,e,ke.ENTRIES),_=u[m+ke.PREV_ROTATION],g=u[m],x=h.getCurvePercent((m>>1)-1,1-(e-g)/(u[m+ke.PREV_TIME]-g));c=u[m+ke.ROTATION]-_,c-=(16384-(16384.499999999996-c/360|0))*360,c=_+c*x+d.data.rotation,c-=(16384-(16384.499999999996-c/360|0))*360}let f=0,p=c-l;if(p-=(16384-(16384.499999999996-p/360|0))*360,p==0)f=n[a];else{let m=0,_=0;o?(m=0,_=p):(m=n[a],_=n[a+1]);const g=p>0;let x=m>=0;L.signum(_)!=L.signum(p)&&Math.abs(_)<=90&&(Math.abs(m)>180&&(m+=360*L.signum(m)),x=g),f=p+m-m%360,x!=g&&(f+=360*L.signum(m)),n[a]=f}n[a+1]=p,l+=f*i,d.rotation=l-(16384-(16384.499999999996-l/360|0))*360}queueEvents(s,t){const e=s.animationStart,i=s.animationEnd,r=i-e,n=s.trackLast%r,a=this.events;let o=0;const h=a.length;for(;o<h;o++){const d=a[o];if(d.time<n)break;d.time>i||this.queue.event(s,d)}let u=!1;for(s.loop?u=r==0||n>s.trackTime%r:u=t>=i&&s.animationLast<i,u&&this.queue.complete(s);o<h;o++)a[o].time<e||this.queue.event(s,a[o])}clearTracks(){const s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=s,this.queue.drain()}clearTrack(s){if(s>=this.tracks.length)return;const t=this.tracks[s];if(t==null)return;this.queue.end(t),this.disposeNext(t);let e=t;for(;;){const i=e.mixingFrom;if(i==null)break;this.queue.end(i),e.mixingFrom=null,e.mixingTo=null,e=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(s,t,e){const i=this.expandToIndex(s);this.tracks[s]=t,i!=null&&(e&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom!=null&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(s,t,e){const i=this.data.skeletonData.findAnimation(t);if(i==null)throw new Error(`Animation not found: ${t}`);return this.setAnimationWith(s,i,e)}setAnimationWith(s,t,e){if(t==null)throw new Error("animation cannot be null.");let i=!0,r=this.expandToIndex(s);r!=null&&(r.nextTrackLast==-1?(this.tracks[s]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,i=!1):this.disposeNext(r));const n=this.trackEntry(s,t,e,r);return this.setCurrent(s,n,i),this.queue.drain(),n}addAnimation(s,t,e,i){const r=this.data.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);return this.addAnimationWith(s,r,e,i)}addAnimationWith(s,t,e,i){if(t==null)throw new Error("animation cannot be null.");let r=this.expandToIndex(s);if(r!=null)for(;r.next!=null;)r=r.next;const n=this.trackEntry(s,t,e,r);if(r==null)this.setCurrent(s,n,!0),this.queue.drain();else if(r.next=n,i<=0){const a=r.animationEnd-r.animationStart;a!=0?(r.loop?i+=a*(1+(r.trackTime/a|0)):i+=Math.max(a,r.trackTime),i-=this.data.getMix(r.animation,t)):i=r.trackTime}return n.delay=i,n}setEmptyAnimation(s,t){const e=this.setAnimationWith(s,Mt.emptyAnimation,!1);return e.mixDuration=t,e.trackEnd=t,e}addEmptyAnimation(s,t,e){e<=0&&(e-=t);const i=this.addAnimationWith(s,Mt.emptyAnimation,!1,e);return i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(s){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){const r=this.tracks[e];r!=null&&this.setEmptyAnimation(r.trackIndex,s)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(s){return s<this.tracks.length?this.tracks[s]:(Q.ensureArrayCapacity(this.tracks,s+1,null),this.tracks.length=s+1,null)}trackEntry(s,t,e,i){const r=this.trackEntryPool.obtain();return r.trackIndex=s,r.animation=t,r.loop=e,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=t.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=i==null?0:this.data.getMix(i.animation,t),r.mixBlend=j.replace,r}disposeNext(s){let t=s.next;for(;t!=null;)this.queue.dispose(t),t=t.next;s.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let s=0,t=this.tracks.length;s<t;s++){let e=this.tracks[s];if(e!=null){for(;e.mixingFrom!=null;)e=e.mixingFrom;do(e.mixingFrom==null||e.mixBlend!=j.add)&&this.computeHold(e),e=e.mixingTo;while(e!=null)}}}computeHold(s){const t=s.mixingTo,e=s.animation.timelines,i=s.animation.timelines.length,r=Q.setArraySize(s.timelineMode,i);s.timelineHoldMix.length=0;const n=Q.setArraySize(s.timelineHoldMix,i),a=this.propertyIDs;if(t!=null&&t.holdPrevious){for(let o=0;o<i;o++)r[o]=a.add(e[o].getPropertyId())?Mt.HOLD_FIRST:Mt.HOLD_SUBSEQUENT;return}t:for(let o=0;o<i;o++){const h=e[o],u=h.getPropertyId();if(!a.add(u))r[o]=Mt.SUBSEQUENT;else if(t==null||h instanceof po||h instanceof Fu||h instanceof lE||!t.animation.hasTimeline(u))r[o]=Mt.FIRST;else{for(let d=t.mixingTo;d!=null;d=d.mixingTo)if(!d.animation.hasTimeline(u)){if(s.mixDuration>0){r[o]=Mt.HOLD_MIX,n[o]=d;continue t}break}r[o]=Mt.HOLD_FIRST}}}getCurrent(s){return s>=this.tracks.length?null:this.tracks[s]}addListener(s){if(s==null)throw new Error("listener cannot be null.");this.listeners.push(s)}removeListener(s){const t=this.listeners.indexOf(s);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(s,t,e){Mt.deprecatedWarning1||(Mt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(s,t,e)}addAnimationByName(s,t,e,i){Mt.deprecatedWarning2||(Mt.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(s,t,e,i)}hasAnimation(s){return this.data.skeletonData.findAnimation(s)!==null}hasAnimationByName(s){return Mt.deprecatedWarning3||(Mt.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(s)}};let Ne=Mt;Ne.emptyAnimation=new pe("<empty>",[],0),Ne.SUBSEQUENT=0,Ne.FIRST=1,Ne.HOLD_SUBSEQUENT=2,Ne.HOLD_FIRST=3,Ne.HOLD_MIX=4,Ne.SETUP=1,Ne.CURRENT=2,Ne.deprecatedWarning1=!1,Ne.deprecatedWarning2=!1,Ne.deprecatedWarning3=!1;const Ui=class{constructor(){this.mixBlend=j.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){const s=this.animationEnd-this.animationStart;return s==0?this.animationStart:this.trackTime%s+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(s){this.animationLast=s,this.nextAnimationLast=s}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return Ui.deprecatedWarning1||(Ui.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(s){Ui.deprecatedWarning1||(Ui.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=s}get endTime(){return Ui.deprecatedWarning2||(Ui.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(s){Ui.deprecatedWarning2||(Ui.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=s}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let ku=Ui;ku.deprecatedWarning1=!1,ku.deprecatedWarning2=!1;const Lu=class{constructor(s){this.objects=[],this.drainDisabled=!1,this.animState=s}start(s){this.objects.push(Ee.start),this.objects.push(s),this.animState.animationsChanged=!0}interrupt(s){this.objects.push(Ee.interrupt),this.objects.push(s)}end(s){this.objects.push(Ee.end),this.objects.push(s),this.animState.animationsChanged=!0}dispose(s){this.objects.push(Ee.dispose),this.objects.push(s)}complete(s){this.objects.push(Ee.complete),this.objects.push(s)}event(s,t){this.objects.push(Ee.event),this.objects.push(s),this.objects.push(t)}deprecateStuff(){return Lu.deprecatedWarning1||(Lu.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const s=this.objects,t=this.animState.listeners;for(let e=0;e<s.length;e+=2){const i=s[e],r=s[e+1];switch(i){case Ee.start:r.listener!=null&&r.listener.start&&r.listener.start(r);for(let o=0;o<t.length;o++)t[o].start&&t[o].start(r);r.onStart&&this.deprecateStuff()&&r.onStart(r.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(r.trackIndex);break;case Ee.interrupt:r.listener!=null&&r.listener.interrupt&&r.listener.interrupt(r);for(let o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(r);break;case Ee.end:r.listener!=null&&r.listener.end&&r.listener.end(r);for(let o=0;o<t.length;o++)t[o].end&&t[o].end(r);r.onEnd&&this.deprecateStuff()&&r.onEnd(r.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(r.trackIndex);case Ee.dispose:r.listener!=null&&r.listener.dispose&&r.listener.dispose(r);for(let o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(r);this.animState.trackEntryPool.free(r);break;case Ee.complete:r.listener!=null&&r.listener.complete&&r.listener.complete(r);for(let o=0;o<t.length;o++)t[o].complete&&t[o].complete(r);const n=L.toInt(r.loopsCount());r.onComplete&&this.deprecateStuff()&&r.onComplete(r.trackIndex,n),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(r.trackIndex,n);break;case Ee.event:const a=s[e+++2];r.listener!=null&&r.listener.event&&r.listener.event(r,a);for(let o=0;o<t.length;o++)t[o].event&&t[o].event(r,a);r.onEvent&&this.deprecateStuff()&&r.onEvent(r.trackIndex,a),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(r.trackIndex,a);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let t_=Lu;t_.deprecatedWarning1=!1;var Ee=(s=>(s[s.start=0]="start",s[s.interrupt=1]="interrupt",s[s.end=2]="end",s[s.dispose=3]="dispose",s[s.complete=4]="complete",s[s.event=5]="event",s))(Ee||{});const Nu=class{constructor(s){if(this.animationToMixTime={},this.defaultMix=0,s==null)throw new Error("skeletonData cannot be null.");this.skeletonData=s}setMix(s,t,e){const i=this.skeletonData.findAnimation(s);if(i==null)throw new Error(`Animation not found: ${s}`);const r=this.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);this.setMixWith(i,r,e)}setMixByName(s,t,e){Nu.deprecatedWarning1||(Nu.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(s,t,e)}setMixWith(s,t,e){if(s==null)throw new Error("from cannot be null.");if(t==null)throw new Error("to cannot be null.");const i=`${s.name}.${t.name}`;this.animationToMixTime[i]=e}getMix(s,t){const e=`${s.name}.${t.name}`,i=this.animationToMixTime[e];return i===void 0?this.defaultMix:i}};let e_=Nu;e_.deprecatedWarning1=!1;class i_{constructor(t,e,i){if(this.matrix=new gt,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,r,n,a,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=r,this.ascaleY=n,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;const h=this.parent,u=this.matrix,d=this.skeleton.scaleX,l=-this.skeleton.scaleY;if(h==null){const _=this.skeleton,g=i+90+o;u.a=L.cosDeg(i+a)*r*d,u.c=L.cosDeg(g)*n*d,u.b=L.sinDeg(i+a)*r*l,u.d=L.sinDeg(g)*n*l,u.tx=t*d+_.x,u.ty=e*l+_.y;return}let c=h.matrix.a,f=h.matrix.c,p=h.matrix.b,m=h.matrix.d;switch(u.tx=c*t+f*e+h.matrix.tx,u.ty=p*t+m*e+h.matrix.ty,this.data.transformMode){case se.Normal:{const _=i+90+o,g=L.cosDeg(i+a)*r,x=L.cosDeg(_)*n,y=L.sinDeg(i+a)*r,v=L.sinDeg(_)*n;u.a=c*g+f*y,u.c=c*x+f*v,u.b=p*g+m*y,u.d=p*x+m*v;return}case se.OnlyTranslation:{const _=i+90+o;u.a=L.cosDeg(i+a)*r,u.c=L.cosDeg(_)*n,u.b=L.sinDeg(i+a)*r,u.d=L.sinDeg(_)*n;break}case se.NoRotationOrReflection:{let _=c*c+p*p,g=0;_>1e-4?(_=Math.abs(c*m-f*p)/_,c/=this.skeleton.scaleX,p/=this.skeleton.scaleY,f=p*_,m=c*_,g=Math.atan2(p,c)*L.radDeg):(c=0,p=0,g=90-Math.atan2(m,f)*L.radDeg);const x=i+a-g,y=i+o-g+90,v=L.cosDeg(x)*r,b=L.cosDeg(y)*n,E=L.sinDeg(x)*r,w=L.sinDeg(y)*n;u.a=c*v-f*E,u.c=c*b-f*w,u.b=p*v+m*E,u.d=p*b+m*w;break}case se.NoScale:case se.NoScaleOrReflection:{const _=L.cosDeg(i),g=L.sinDeg(i);let x=(c*_+f*g)/d,y=(p*_+m*g)/l,v=Math.sqrt(x*x+y*y);v>1e-5&&(v=1/v),x*=v,y*=v,v=Math.sqrt(x*x+y*y),this.data.transformMode==se.NoScale&&c*m-f*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY>0)&&(v=-v);const b=Math.PI/2+Math.atan2(y,x),E=Math.cos(b)*v,w=Math.sin(b)*v,A=L.cosDeg(a)*r,T=L.cosDeg(90+o)*n,P=L.sinDeg(a)*r,k=L.sinDeg(90+o)*n;u.a=x*A+E*P,u.c=x*T+E*k,u.b=y*A+w*P,u.d=y*T+w*k;break}}u.a*=d,u.c*=d,u.b*=l,u.d*=l}setToSetupPose(){const t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*L.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*L.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(t==null){this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*L.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*L.radDeg;return}const i=t.matrix,r=1/(i.a*i.d-i.b*i.c),n=e.tx-i.tx,a=e.ty-i.ty;this.ax=n*i.d*r-a*i.c*r,this.ay=a*i.a*r-n*i.b*r;const o=r*i.d,h=r*i.a,u=r*i.c,d=r*i.b,l=o*e.a-u*e.b,c=o*e.c-u*e.d,f=h*e.b-d*e.a,p=h*e.d-d*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(l*l+f*f),this.ascaleX>1e-4){const m=l*p-c*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(l*c+f*p,m)*L.radDeg,this.arotation=Math.atan2(f,l)*L.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(c*c+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,c)*L.radDeg}worldToLocal(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=1/(i*a-r*n),h=t.x-e.tx,u=t.y-e.ty;return t.x=h*a*o-u*r*o,t.y=u*i*o-h*n*o,t}localToWorld(t){const e=this.matrix,i=t.x,r=t.y;return t.x=i*e.a+r*e.c+e.tx,t.y=i*e.b+r*e.d+e.ty,t}worldToLocalRotation(t){const e=L.sinDeg(t),i=L.cosDeg(t),r=this.matrix;return Math.atan2(r.a*e-r.b*i,r.d*i-r.c*e)*L.radDeg}localToWorldRotation(t){const e=L.sinDeg(t),i=L.cosDeg(t),r=this.matrix;return Math.atan2(i*r.b+e*r.d,i*r.a+e*r.c)*L.radDeg}rotateWorld(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=L.cosDeg(t),h=L.sinDeg(t);e.a=o*i-h*n,e.c=o*r-h*a,e.b=h*i+o*n,e.d=h*r+o*a,this.appliedValid=!1}}class uE{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix);break}}apply1(t,e,i,r,n,a,o){t.appliedValid||t.updateAppliedTransform();const h=t.parent.matrix,u=h.a;let d=h.c;const l=h.b;let c=h.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case se.OnlyTranslation:p=e-t.worldX,m=i-t.worldY;break;case se.NoRotationOrReflection:const x=Math.abs(u*c-d*l)/(u*u+l*l),y=u/t.skeleton.scaleX,v=l/t.skeleton.scaleY;d=-v*x*t.skeleton.scaleX,c=y*x*t.skeleton.scaleY,f+=Math.atan2(v,y)*L.radDeg;default:const b=e-h.tx,E=i-h.ty,w=u*c-d*l;p=(b*c-E*d)/w-t.ax,m=(E*u-b*l)/w-t.ay}f+=Math.atan2(m,p)*L.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let _=t.ascaleX,g=t.ascaleY;if(r||n){switch(t.data.transformMode){case se.NoScale:case se.NoScaleOrReflection:p=e-t.worldX,m=i-t.worldY}const x=t.data.length*_,y=Math.sqrt(p*p+m*m);if(r&&y<x||n&&y>x&&x>1e-4){const v=(y/x-1)*o+1;_*=v,a&&(g*=v)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,_,g,t.ashearX,t.ashearY)}apply2(t,e,i,r,n,a,o,h){if(h==0){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const u=t.ax,d=t.ay;let l=t.ascaleX,c=l,f=t.ascaleY,p=e.ascaleX;const m=t.matrix;let _=0,g=0,x=0;l<0?(l=-l,_=180,x=-1):(_=0,x=1),f<0&&(f=-f,x=-x),p<0?(p=-p,g=180):g=0;const y=e.ax;let v=0,b=0,E=0,w=m.a,A=m.c,T=m.b,P=m.d;const k=Math.abs(l-f)<=1e-4;k?(v=e.ay,b=w*y+A*v+m.tx,E=T*y+P*v+m.ty):(v=0,b=w*y+m.tx,E=T*y+m.ty);const R=t.parent.matrix;w=R.a,A=R.c,T=R.b,P=R.d;const S=1/(w*P-A*T);let C=b-R.tx,I=E-R.ty;const N=(C*P-I*A)*S-u,F=(I*w-C*T)*S-d,B=Math.sqrt(N*N+F*F);let X=e.data.length*p,M,D;if(B<1e-4){this.apply1(t,i,r,!1,a,!1,h),e.updateWorldTransformWith(y,v,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-R.tx,I=r-R.ty;let $=(C*P-I*A)*S-u,Y=(I*w-C*T)*S-d,U=$*$+Y*Y;if(o!=0){o*=l*(p+1)/2;const lt=Math.sqrt(U),vt=lt-B-X*l+o;if(vt>0){let Dt=Math.min(1,vt/(o*2))-1;Dt=(vt-o*(1-Dt*Dt))/lt,$-=Dt*$,Y-=Dt*Y,U=$*$+Y*Y}}t:if(k){X*=l;let lt=(U-B*B-X*X)/(2*B*X);lt<-1?lt=-1:lt>1&&(lt=1,a&&(c*=(Math.sqrt(U)/(B+X)-1)*h+1)),D=Math.acos(lt)*n,w=B+X*lt,A=X*Math.sin(D),M=Math.atan2(Y*w-$*A,$*w+Y*A)}else{w=l*X,A=f*X;const lt=w*w,vt=A*A,Dt=Math.atan2(Y,$);T=vt*B*B+lt*U-lt*vt;const Lt=-2*vt*B,_t=vt-lt;if(P=Lt*Lt-4*_t*T,P>=0){let Br=Math.sqrt(P);Lt<0&&(Br=-Br),Br=-(Lt+Br)/2;const y_=Br/_t,x_=T/Br,Or=Math.abs(y_)<Math.abs(x_)?y_:x_;if(Or*Or<=U){I=Math.sqrt(U-Or*Or)*n,M=Dt-Math.atan2(I,Or),D=Math.atan2(I/f,(Or-B)/l);break t}}let Bt=L.PI,wt=B-w,me=wt*wt,Ae=0,ds=0,Dr=B+w,fs=Dr*Dr,g_=0;T=-w*B/(lt-vt),T>=-1&&T<=1&&(T=Math.acos(T),C=w*Math.cos(T)+B,I=A*Math.sin(T),P=C*C+I*I,P<me&&(Bt=T,me=P,wt=C,Ae=I),P>fs&&(ds=T,fs=P,Dr=C,g_=I)),U<=(me+fs)/2?(M=Dt-Math.atan2(Ae*n,wt),D=Bt*n):(M=Dt-Math.atan2(g_*n,Dr),D=ds*n)}const rt=Math.atan2(v,y)*x;let ft=t.arotation;M=(M-rt)*L.radDeg+_-ft,M>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(u,d,ft+M*h,c,t.ascaleY,0,0),ft=e.arotation,D=((D+rt)*L.radDeg-e.ashearX)*x+g-ft,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(y,v,ft+D*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}var Rr=(s=>(s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s))(Rr||{});const Ws=class{constructor(s,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,s==null)throw new Error("data cannot be null.");if(t==null)throw new Error("skeleton cannot be null.");this.data=s,this.bones=new Array;for(let e=0,i=s.bones.length;e<i;e++)this.bones.push(t.findBone(s.bones[e].name));this.target=t.findSlot(s.target.name),this.position=s.position,this.spacing=s.spacing,this.rotateMix=s.rotateMix,this.translateMix=s.translateMix}isActive(){return this.active}apply(){this.update()}update(){const s=this.target.getAttachment();if(!(s instanceof An))return;const t=this.rotateMix,e=this.translateMix,i=e>0,r=t>0;if(!i&&!r)return;const n=this.data,a=n.spacingMode,o=a==Rr.Length,h=n.rotateMode,u=h==Vs.Tangent,d=h==Vs.ChainScale,l=this.bones.length,c=u?l:l+1,f=this.bones,p=Q.setArraySize(this.spaces,c);let m=null;const _=this.spacing;if(d||o){d&&(m=Q.setArraySize(this.lengths,l));for(let E=0,w=c-1;E<w;){const A=f[E],T=A.data.length;if(T<Ws.epsilon)d&&(m[E]=0),p[++E]=0;else{const P=T*A.matrix.a,k=T*A.matrix.b,R=Math.sqrt(P*P+k*k);d&&(m[E]=R),p[++E]=(o?T+_:_)*R/T}}}else for(let E=1;E<c;E++)p[E]=_;const g=this.computeWorldPositions(s,c,u,n.positionMode==co.Percent,a==Rr.Percent);let x=g[0],y=g[1],v=n.offsetRotation,b=!1;if(v==0)b=h==Vs.Chain;else{b=!1;const E=this.target.bone.matrix;v*=E.a*E.d-E.b*E.c>0?L.degRad:-L.degRad}for(let E=0,w=3;E<l;E++,w+=3){const A=f[E],T=A.matrix;T.tx+=(x-T.tx)*e,T.ty+=(y-T.ty)*e;const P=g[w],k=g[w+1],R=P-x,S=k-y;if(d){const C=m[E];if(C!=0){const I=(Math.sqrt(R*R+S*S)/C-1)*t+1;T.a*=I,T.b*=I}}if(x=P,y=k,r){const C=T.a,I=T.c,N=T.b,F=T.d;let B=0,X=0,M=0;if(u&&(u?B=g[w-1]:p[E+1]==0?B=g[w+2]:B=Math.atan2(S,R)),B-=Math.atan2(N,C),b){X=Math.cos(B),M=Math.sin(B);const D=A.data.length;x+=(D*(X*C-M*N)-R)*t,y+=(D*(M*C+X*N)-S)*t}else B+=v;B>L.PI?B-=L.PI2:B<-L.PI&&(B+=L.PI2),B*=t,X=Math.cos(B),M=Math.sin(B),T.a=X*C-M*N,T.c=X*I-M*F,T.b=M*C+X*N,T.d=M*I+X*F}A.appliedValid=!1}}computeWorldPositions(s,t,e,i,r){const n=this.target;let a=this.position;const o=this.spaces,h=Q.setArraySize(this.positions,t*3+2);let u=null;const d=s.closed;let l=s.worldVerticesLength,c=l/6,f=Ws.NONE;if(!s.constantSpeed){const B=s.lengths;c-=d?1:2;const X=B[c];if(i&&(a*=X),r)for(let M=0;M<t;M++)o[M]*=X;u=Q.setArraySize(this.world,8);for(let M=0,D=0,$=0;M<t;M++,D+=3){const Y=o[M];a+=Y;let U=a;if(d)U%=X,U<0&&(U+=X),$=0;else if(U<0){f!=Ws.BEFORE&&(f=Ws.BEFORE,s.computeWorldVertices(n,2,4,u,0,2)),this.addBeforePosition(U,u,0,h,D);continue}else if(U>X){f!=Ws.AFTER&&(f=Ws.AFTER,s.computeWorldVertices(n,l-6,4,u,0,2)),this.addAfterPosition(U-X,u,0,h,D);continue}for(;;$++){const rt=B[$];if(!(U>rt)){if($==0)U/=rt;else{const ft=B[$-1];U=(U-ft)/(rt-ft)}break}}$!=f&&(f=$,d&&$==c?(s.computeWorldVertices(n,l-4,4,u,0,2),s.computeWorldVertices(n,0,4,u,4,2)):s.computeWorldVertices(n,$*6+2,8,u,0,2)),this.addCurvePosition(U,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],h,D,e||M>0&&Y==0)}return h}d?(l+=2,u=Q.setArraySize(this.world,l),s.computeWorldVertices(n,2,l-4,u,0,2),s.computeWorldVertices(n,0,2,u,l-4,2),u[l-2]=u[0],u[l-1]=u[1]):(c--,l-=4,u=Q.setArraySize(this.world,l),s.computeWorldVertices(n,2,l,u,0,2));const p=Q.setArraySize(this.curves,c);let m=0,_=u[0],g=u[1],x=0,y=0,v=0,b=0,E=0,w=0,A=0,T=0,P=0,k=0,R=0,S=0,C=0,I=0;for(let B=0,X=2;B<c;B++,X+=6)x=u[X],y=u[X+1],v=u[X+2],b=u[X+3],E=u[X+4],w=u[X+5],A=(_-x*2+v)*.1875,T=(g-y*2+b)*.1875,P=((x-v)*3-_+E)*.09375,k=((y-b)*3-g+w)*.09375,R=A*2+P,S=T*2+k,C=(x-_)*.75+A+P*.16666667,I=(y-g)*.75+T+k*.16666667,m+=Math.sqrt(C*C+I*I),C+=R,I+=S,R+=P,S+=k,m+=Math.sqrt(C*C+I*I),C+=R,I+=S,m+=Math.sqrt(C*C+I*I),C+=R+P,I+=S+k,m+=Math.sqrt(C*C+I*I),p[B]=m,_=E,g=w;if(i&&(a*=m),r)for(let B=0;B<t;B++)o[B]*=m;const N=this.segments;let F=0;for(let B=0,X=0,M=0,D=0;B<t;B++,X+=3){const $=o[B];a+=$;let Y=a;if(d)Y%=m,Y<0&&(Y+=m),M=0;else if(Y<0){this.addBeforePosition(Y,u,0,h,X);continue}else if(Y>m){this.addAfterPosition(Y-m,u,l-4,h,X);continue}for(;;M++){const U=p[M];if(!(Y>U)){if(M==0)Y/=U;else{const rt=p[M-1];Y=(Y-rt)/(U-rt)}break}}if(M!=f){f=M;let U=M*6;for(_=u[U],g=u[U+1],x=u[U+2],y=u[U+3],v=u[U+4],b=u[U+5],E=u[U+6],w=u[U+7],A=(_-x*2+v)*.03,T=(g-y*2+b)*.03,P=((x-v)*3-_+E)*.006,k=((y-b)*3-g+w)*.006,R=A*2+P,S=T*2+k,C=(x-_)*.3+A+P*.16666667,I=(y-g)*.3+T+k*.16666667,F=Math.sqrt(C*C+I*I),N[0]=F,U=1;U<8;U++)C+=R,I+=S,R+=P,S+=k,F+=Math.sqrt(C*C+I*I),N[U]=F;C+=R,I+=S,F+=Math.sqrt(C*C+I*I),N[8]=F,C+=R+P,I+=S+k,F+=Math.sqrt(C*C+I*I),N[9]=F,D=0}for(Y*=F;;D++){const U=N[D];if(!(Y>U)){if(D==0)Y/=U;else{const rt=N[D-1];Y=D+(Y-rt)/(U-rt)}break}}this.addCurvePosition(Y*.1,_,g,x,y,v,b,E,w,h,X,e||B>0&&$==0)}return h}addBeforePosition(s,t,e,i,r){const n=t[e],a=t[e+1],o=t[e+2]-n,h=t[e+3]-a,u=Math.atan2(h,o);i[r]=n+s*Math.cos(u),i[r+1]=a+s*Math.sin(u),i[r+2]=u}addAfterPosition(s,t,e,i,r){const n=t[e+2],a=t[e+3],o=n-t[e],h=a-t[e+1],u=Math.atan2(h,o);i[r]=n+s*Math.cos(u),i[r+1]=a+s*Math.sin(u),i[r+2]=u}addCurvePosition(s,t,e,i,r,n,a,o,h,u,d,l){(s==0||isNaN(s))&&(s=1e-4);const c=s*s,f=c*s,p=1-s,m=p*p,_=m*p,g=p*s,x=g*3,y=p*x,v=x*s,b=t*_+i*y+n*v+o*f,E=e*_+r*y+a*v+h*f;u[d]=b,u[d+1]=E,l&&(u[d+2]=Math.atan2(E-(e*m+r*g*2+a*c),b-(t*m+i*g*2+n*c)))}};let Sn=Ws;Sn.NONE=-1,Sn.BEFORE=-2,Sn.AFTER=-3,Sn.epsilon=1e-5;class cE{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new nE,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,u=a.b,d=a.d,l=o*d-h*u>0?L.degRad:-L.degRad,c=this.data.offsetRotation*l,f=this.data.offsetShearY*l,p=this.bones;for(let m=0,_=p.length;m<_;m++){const g=p[m];let x=!1;const y=g.matrix;if(t!=0){const v=y.a,b=y.c,E=y.b,w=y.d;let A=Math.atan2(u,o)-Math.atan2(E,v)+c;A>L.PI?A-=L.PI2:A<-L.PI&&(A+=L.PI2),A*=t;const T=Math.cos(A),P=Math.sin(A);y.a=T*v-P*E,y.c=T*b-P*w,y.b=P*v+T*E,y.d=P*b+T*w,x=!0}if(e!=0){const v=this.temp;n.localToWorld(v.set(this.data.offsetX,this.data.offsetY)),y.tx+=(v.x-y.tx)*e,y.ty+=(v.y-y.ty)*e,x=!0}if(i>0){let v=Math.sqrt(y.a*y.a+y.b*y.b),b=Math.sqrt(o*o+u*u);v>1e-5&&(v=(v+(b-v+this.data.offsetScaleX)*i)/v),y.a*=v,y.b*=v,v=Math.sqrt(y.c*y.c+y.d*y.d),b=Math.sqrt(h*h+d*d),v>1e-5&&(v=(v+(b-v+this.data.offsetScaleY)*i)/v),y.c*=v,y.d*=v,x=!0}if(r>0){const v=y.c,b=y.d,E=Math.atan2(b,v);let w=Math.atan2(d,h)-Math.atan2(u,o)-(E-Math.atan2(y.b,y.a));w>L.PI?w-=L.PI2:w<-L.PI&&(w+=L.PI2),w=E+(w+f)*r;const A=Math.sqrt(v*v+b*b);y.c=Math.cos(w)*A,y.d=Math.sin(w)*A,x=!0}x&&(g.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,u=a.b,d=a.d,l=o*d-h*u>0?L.degRad:-L.degRad,c=this.data.offsetRotation*l,f=this.data.offsetShearY*l,p=this.bones;for(let m=0,_=p.length;m<_;m++){const g=p[m];let x=!1;const y=g.matrix;if(t!=0){const v=y.a,b=y.c,E=y.b,w=y.d;let A=Math.atan2(u,o)+c;A>L.PI?A-=L.PI2:A<-L.PI&&(A+=L.PI2),A*=t;const T=Math.cos(A),P=Math.sin(A);y.a=T*v-P*E,y.c=T*b-P*w,y.b=P*v+T*E,y.d=P*b+T*w,x=!0}if(e!=0){const v=this.temp;n.localToWorld(v.set(this.data.offsetX,this.data.offsetY)),y.tx+=v.x*e,y.ty+=v.y*e,x=!0}if(i>0){let v=(Math.sqrt(o*o+u*u)-1+this.data.offsetScaleX)*i+1;y.a*=v,y.b*=v,v=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*i+1,y.c*=v,y.d*=v,x=!0}if(r>0){let v=Math.atan2(d,h)-Math.atan2(u,o);v>L.PI?v-=L.PI2:v<-L.PI&&(v+=L.PI2);const b=y.c,E=y.d;v=Math.atan2(E,b)+(v-L.PI/2+f)*r;const w=Math.sqrt(b*b+E*E);y.c=Math.cos(v)*w,y.d=Math.sin(v)*w,x=!0}x&&(g.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const u=a[o];u.appliedValid||u.updateAppliedTransform();let d=u.arotation;if(t!=0){let _=n.arotation-d+this.data.offsetRotation;_-=(16384-(16384.499999999996-_/360|0))*360,d+=_*t}let l=u.ax,c=u.ay;e!=0&&(l+=(n.ax-l+this.data.offsetX)*e,c+=(n.ay-c+this.data.offsetY)*e);let f=u.ascaleX,p=u.ascaleY;i>0&&(f>1e-5&&(f=(f+(n.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(n.ascaleY-p+this.data.offsetScaleY)*i)/p));const m=u.ashearY;if(r>0){let _=n.ashearY-m+this.data.offsetShearY;_-=(16384-(16384.499999999996-_/360|0))*360,u.shearY+=_*r}u.updateWorldTransformWith(l,c,d,f,p,u.ashearX,m)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const u=a[o];u.appliedValid||u.updateAppliedTransform();let d=u.arotation;t!=0&&(d+=(n.arotation+this.data.offsetRotation)*t);let l=u.ax,c=u.ay;e!=0&&(l+=(n.ax+this.data.offsetX)*e,c+=(n.ay+this.data.offsetY)*e);let f=u.ascaleX,p=u.ascaleY;i>0&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*i+1),p>1e-5&&(p*=(n.ascaleY-1+this.data.offsetScaleY)*i+1));let m=u.ashearY;r>0&&(m+=(n.ashearY+this.data.offsetShearY)*r),u.updateWorldTransformWith(l,c,d,f,p,u.ashearX,m)}}}const Cn=class{constructor(s){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,s==null)throw new Error("data cannot be null.");this.data=s,this.bones=new Array;for(let t=0;t<s.bones.length;t++){const e=s.bones[t];let i;if(e.parent==null)i=new i_(e,this,null);else{const r=this.bones[e.parent.index];i=new i_(e,this,r),r.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<s.slots.length;t++){const e=s.slots[t],i=this.bones[e.boneData.index],r=new Jm(e,i);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let t=0;t<s.ikConstraints.length;t++){const e=s.ikConstraints[t];this.ikConstraints.push(new uE(e,this))}this.transformConstraints=new Array;for(let t=0;t<s.transformConstraints.length;t++){const e=s.transformConstraints[t];this.transformConstraints.push(new cE(e,this))}this.pathConstraints=new Array;for(let t=0;t<s.pathConstraints.length;t++){const e=s.pathConstraints[t];this.pathConstraints.push(new Sn(e,this))}this.color=new we(1,1,1,1),this.updateCache()}updateCache(){const s=this._updateCache;s.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let u=0,d=t.length;u<d;u++){const l=t[u];l.sorted=l.data.skinRequired,l.active=!l.sorted}if(this.skin!=null){const u=this.skin.bones;for(let d=0,l=this.skin.bones.length;d<l;d++){let c=this.bones[u[d].index];do c.sorted=!1,c.active=!0,c=c.parent;while(c!=null)}}const e=this.ikConstraints,i=this.transformConstraints,r=this.pathConstraints,n=e.length,a=i.length,o=r.length,h=n+a+o;t:for(let u=0;u<h;u++){for(let d=0;d<n;d++){const l=e[d];if(l.data.order==u){this.sortIkConstraint(l);continue t}}for(let d=0;d<a;d++){const l=i[d];if(l.data.order==u){this.sortTransformConstraint(l);continue t}}for(let d=0;d<o;d++){const l=r[d];if(l.data.order==u){this.sortPathConstraint(l);continue t}}}for(let u=0,d=t.length;u<d;u++)this.sortBone(t[u])}sortIkConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target;this.sortBone(t);const e=s.bones,i=e[0];if(this.sortBone(i),e.length>1){const r=e[e.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(s),this.sortReset(i.children),e[e.length-1].sorted=!0}sortPathConstraint(s){if(s.active=s.target.bone.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target,e=t.data.index,i=t.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,e,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,i);for(let o=0,h=this.data.skins.length;o<h;o++)this.sortPathConstraintAttachment(this.data.skins[o],e,i);const r=t.getAttachment();r instanceof An&&this.sortPathConstraintAttachmentWith(r,i);const n=s.bones,a=n.length;for(let o=0;o<a;o++)this.sortBone(n[o]);this._updateCache.push(s);for(let o=0;o<a;o++)this.sortReset(n[o].children);for(let o=0;o<a;o++)n[o].sorted=!0}sortTransformConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;this.sortBone(s.target);const t=s.bones,e=t.length;if(s.data.local)for(let i=0;i<e;i++){const r=t[i];this.sortBone(r.parent),this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}else for(let i=0;i<e;i++)this.sortBone(t[i]);this._updateCache.push(s);for(let i=0;i<e;i++)this.sortReset(t[i].children);for(let i=0;i<e;i++)t[i].sorted=!0}sortPathConstraintAttachment(s,t,e){const i=s.attachments[t];if(i)for(const r in i)this.sortPathConstraintAttachmentWith(i[r],e)}sortPathConstraintAttachmentWith(s,t){if(!(s instanceof An))return;const e=s.bones;if(e==null)this.sortBone(t);else{const i=this.bones;let r=0;for(;r<e.length;){const n=e[r++];for(let a=r+n;r<a;r++){const o=e[r];this.sortBone(i[o])}}}}sortBone(s){if(s.sorted)return;const t=s.parent;t!=null&&this.sortBone(t),s.sorted=!0,this._updateCache.push(s)}sortReset(s){for(let t=0,e=s.length;t<e;t++){const i=s[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){const s=this.updateCacheReset;for(let e=0,i=s.length;e<i;e++){const r=s[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}const t=this._updateCache;for(let e=0,i=t.length;e<i;e++)t[e].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const s=this.bones;for(let r=0,n=s.length;r<n;r++)s[r].setToSetupPose();const t=this.ikConstraints;for(let r=0,n=t.length;r<n;r++){const a=t[r];a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}const e=this.transformConstraints;for(let r=0,n=e.length;r<n;r++){const a=e[r],o=a.data;a.rotateMix=o.rotateMix,a.translateMix=o.translateMix,a.scaleMix=o.scaleMix,a.shearMix=o.shearMix}const i=this.pathConstraints;for(let r=0,n=i.length;r<n;r++){const a=i[r],o=a.data;a.position=o.position,a.spacing=o.spacing,a.rotateMix=o.rotateMix,a.translateMix=o.translateMix}}setSlotsToSetupPose(){const s=this.slots;Q.arrayCopy(s,0,this.drawOrder,0,s.length);for(let t=0,e=s.length;t<e;t++)s[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findBoneIndex(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}findSlot(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findSlotIndex(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}setSkinByName(s){const t=this.data.findSkin(s);if(t==null)throw new Error(`Skin not found: ${s}`);this.setSkin(t)}setSkin(s){if(s!=this.skin){if(s!=null)if(this.skin!=null)s.attachAll(this,this.skin);else{const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e],n=r.data.attachmentName;if(n!=null){const a=s.getAttachment(e,n);a!=null&&r.setAttachment(a)}}}this.skin=s,this.updateCache()}}getAttachmentByName(s,t){return this.getAttachment(this.data.findSlotIndex(s),t)}getAttachment(s,t){if(t==null)throw new Error("attachmentName cannot be null.");if(this.skin!=null){const e=this.skin.getAttachment(s,t);if(e!=null)return e}return this.data.defaultSkin!=null?this.data.defaultSkin.getAttachment(s,t):null}setAttachment(s,t){if(s==null)throw new Error("slotName cannot be null.");const e=this.slots;for(let i=0,r=e.length;i<r;i++){const n=e[i];if(n.data.name==s){let a=null;if(t!=null&&(a=this.getAttachment(i,t),a==null))throw new Error(`Attachment not found: ${t}, for slot: ${s}`);n.setAttachment(a);return}}throw new Error(`Slot not found: ${s}`)}findIkConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findTransformConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findPathConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}getBounds(s,t,e=new Array(2)){if(s==null)throw new Error("offset cannot be null.");if(t==null)throw new Error("size cannot be null.");const i=this.drawOrder;let r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let h=0,u=i.length;h<u;h++){const d=i[h];if(!d.bone.active)continue;let l=0,c=null;const f=d.getAttachment();if(f instanceof et)l=8,c=Q.setArraySize(e,l,0),f.computeWorldVertices(d.bone,c,0,2);else if(f instanceof fo){const p=f;l=p.worldVerticesLength,c=Q.setArraySize(e,l,0),p.computeWorldVertices(d,0,l,c,0,2)}if(c!=null)for(let p=0,m=c.length;p<m;p+=2){const _=c[p],g=c[p+1];r=Math.min(r,_),n=Math.min(n,g),a=Math.max(a,_),o=Math.max(o,g)}}s.set(r,n),t.set(a-r,o-n)}update(s){this.time+=s}get flipX(){return this.scaleX==-1}set flipX(s){Cn.deprecatedWarning1||(Cn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=s?1:-1}get flipY(){return this.scaleY==-1}set flipY(s){Cn.deprecatedWarning1||(Cn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=s?1:-1}};let s_=Cn;s_.deprecatedWarning1=!1,se.Normal,se.OnlyTranslation,se.NoRotationOrReflection,se.NoScale,se.NoScaleOrReflection,co.Fixed,co.Percent,Rr.Length,Rr.Fixed,Rr.Percent,Vs.Tangent,Vs.Chain,Vs.ChainScale,K.NORMAL,K.ADD,K.MULTIPLY,K.SCREEN;class dE extends Bu{createSkeleton(t){this.skeleton=new s_(t),this.skeleton.updateWorldTransform(),this.stateData=new e_(t),this.state=new Ne(this.stateData)}}class fE extends dE{constructor(t,e){const{followPointList:i,visible:r=!1}=e||{};let n;typeof t=="string"?n=Zi.get(t).spineData:n=t.spineData,super(n),this._followDots=[],this._isStart=!1,this.visible=r,this.autoUpdate=!1,i!=null&&i.length&&(i==null||i.forEach(a=>{a.follow.alpha=0,this._followDots.push({point:this.skeleton.findBone(a.boneName),follow:a.follow,onUpdate:a.onUpdate,angleFollow:a.angleFollow||!1,scaleFollow:a.scaleFollow||!0})})),this._loopFn=this._loop.bind(this),ct.system.add(this._loopFn)}setAnimation(t="animation",e=!1){return new Promise(i=>{this.visible=!0,this.state.setAnimation(0,t,e).listener={complete:()=>{i()}}})}addAnimation(t="animation",e=!1,i=0){return new Promise(r=>{this.visible=!0,this.state.addAnimation(0,t,e,i).listener={complete:()=>{r()}}})}setSkin(t){this.skeleton.setSkinByName(t)}destroyAll(){ct.system.remove(this._loopFn),this.destroy({children:!0})}_loop(){if(this.destroyed){ct.system.remove(this._loopFn);return}this.update(ct.system.deltaMS/1e3),this._updateFollowPoint()}_updateFollowPoint(){this._followDots.length!==0&&(this._followDots.forEach(t=>{const{worldX:e,worldY:i}=t.point,r=t.point.getWorldRotationX()*(Math.PI/180),n=t.point.getWorldScaleX(),a=t.point.getWorldScaleY();t.onUpdate?t.onUpdate({x:e,y:i,rotate:r,scaleX:n,scaleY:a}):(t.angleFollow&&(t.follow.rotation=r),t.scaleFollow&&t.follow.scale.set(n,a),t.follow.position.set(e+1920/2-t.follow.width/2,i+1080/2-t.follow.height/2))}),this._isStart||(this._isStart=!0,this._followDots.forEach(t=>{ut.to(t.follow,{alpha:1,duration:.25,delay:.15})})))}}const Gi=(s,t,e,i=!1)=>{s.cursor="pointer",s.eventMode="static";const r=n=>{n.button!==2&&e(n)};i?s.once(t,r):s.on(t,r)};class pE extends bt{constructor(t){super(),this.disabled=!1;const{texture:e,hoverTexture:i,tintColor:r,hoverTintColor:n="#fff",disabledColor:a="#999"}=t;this._texture=e,this._hoverTexture=i,this._tintColor=r,this._disabledColor=a,this._btn=new _e(e),this.addChild(this._btn),this._btn.anchor.set(.5),r&&(this._btn.tint=r),Gi(this._btn,"pointerenter",()=>{this.disabled||(this._btn.tint=n,this._hoverTexture&&(this._btn._texture=this._hoverTexture))}),Gi(this._btn,"pointerleave",()=>{this.disabled||(this._btn._texture=this._texture,r&&(this._btn.tint=r))})}toggleTexture(t,e){this._texture=t,this._hoverTexture=e,this._btn._texture=e}setDisabled(t){this.disabled=t,this._btn.tint=t?this._disabledColor:this._tintColor||"#fff",this._btn.texture=this._texture}}class mE extends Tn{constructor(t){const{sprite:e,onClick:i}=t;super(e.width,e.height),this.addChild(e),e.anchor.set(.5),e.x=e.width/2,e.y=e.height/2,Gi(this,"pointerenter",()=>{ut.to(e,{duration:.25,rotation:180*(Math.PI/180)})}),Gi(this,"pointerleave",()=>{e.alpha=1,ut.to(e,{duration:.25,rotation:0})}),Gi(this,"pointerdown",()=>{e.alpha=.5}),Gi(this,"pointerup",()=>{i()})}}class _E extends bt{constructor(t){super(),this._maskUI=new au({bgColor:"#000",width:1080,height:1920}),this.addChild(this._maskUI),this._maskUI.alpha=0,this._maskUI.eventMode="static",this._drawerContainer=t,this.addChild(this._drawerContainer),this._drawerContainer.y=this._maskUI.height,ut.to(this._maskUI,{duration:.25,alpha:.5}),ut.to(this._drawerContainer,{duration:.25,ease:"power1.out",y:this._maskUI.height-this._drawerContainer.height})}async close(){ut.to(this._drawerContainer,{duration:.25,y:this._maskUI.height}),await ut.to(this._maskUI,{duration:.25,delay:.125,alpha:0})}}class gE extends bt{constructor(t){super(),this.COLLECT_TIME=5*1e3,this._nowTime=0,this._lastTime=0,this._drawCount=0,this._maxDrawCount=0,this._tempMaxDrawCount=0,this._lastCollectTime=0,this._paramTxts=[];for(let e=0;e<3;e++){const i=new Du({text:"",fontWeight:"bold",fontSize:36,shadow:["#000",45,3,5],fontColor:"#fff"});this._paramTxts[e]=i,i.x=0,i.y=i.height*e,this.addChild(i),i.alpha=.75}this._renderer=t.renderer,this._drawElements=this._renderer.gl.drawElements,this.init()}init(){this._renderer.gl.drawElements=(...t)=>{this._drawElements.call(this._renderer.gl,...t),this._drawCount++},ct.shared.add(()=>{const t=ct.system.FPS;this._nowTime=performance.now(),this._nowTime-this._lastTime>=100&&(this._setTxtInfo(0,Math.floor(t).toFixed(0)),this._lastTime=this._nowTime),this._nowTime-this._lastCollectTime<this.COLLECT_TIME?this._tempMaxDrawCount<this._drawCount&&(this._tempMaxDrawCount=this._drawCount):(this._maxDrawCount=this._tempMaxDrawCount,this._tempMaxDrawCount=0,this._lastCollectTime=this._nowTime),this._setTxtInfo(1,this._drawCount),this._setTxtInfo(2,this._maxDrawCount),this._drawCount=0},ji.UTILITY)}_setTxtInfo(t,e){const i=a=>{this._paramTxts[t].style.fill="#fff",a<=30&&(this._paramTxts[t].style.fill="yellow"),a<=20&&(this._paramTxts[t].style.fill="red")},r=a=>{this._paramTxts[t].style.fill="#fff",a>=75&&(this._paramTxts[t].style.fill="yellow"),a>=100&&(this._paramTxts[t].style.fill="red")},n=[()=>(i(e),`Fps:${e}`),()=>(r(e),`Draw Call:${e}`),()=>(r(e),`Max Draw Call:${e}`)];this._paramTxts[t].text=n[t]()}}class yE extends bt{constructor(t){super();const{bgWidth:e,bgHeight:i,barWidth:r,barHeight:n,bgTexture:a,barTexture:o}=t,h=new _e(a);this.addChild(h),this._progressBar=new _e(o),this.addChild(this._progressBar),this._progressBar.x=(e-r)/2,this._progressBar.y=(i-n)/2;const u=new ui;u.beginFill(16777215),u.drawRect(0,0,0,this._progressBar.height),u.endFill(),this._progressBar.addChild(u),this._progressBar.mask=u,this._maskGraphics=u}setProgress(t){const e=Math.max(0,Math.min(1,t));this._maskGraphics.clear(),this._maskGraphics.beginFill(16777215),this._maskGraphics.drawRect(0,0,this._progressBar.width*e,this._progressBar.height),this._maskGraphics.endFill()}}class xE extends Tn{constructor(t){const{width:e,height:i,scrollContent:r,bottomMargin:n=50}=t;if(super(e,i),this._startY=0,this._velocity=0,this._startTime=0,this._startPosition=0,this._scrollSpeed=200,this._isDragging=!1,this._scrollContent=r,this._content=new bt,this.addChild(this._content),this._content.addChild(this._scrollContent),n>0){const a=new _e;this._content.addChild(a),a.y=this._content.height+n}this._maskGraphics=new ui,this.addChild(this._maskGraphics),this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,e,i),this._maskGraphics.endFill(),this.mask=this._maskGraphics,this.eventMode="static",this.on("pointerdown",this._onDragStart,this),this.on("pointermove",this._onDragMove,this),this.on("pointerup",this._onDragEnd,this),this.on("pointerupoutside",this._onDragEnd,this),this.on("wheel",this._onWheelScroll,this)}setDimensions(t,e){this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,t,e),this._maskGraphics.endFill(),this.setSize(t,e)}scrollToTop(){ut.killTweensOf(this._content),this._content.y=0}addContent(t){this._scrollContent.addChild(t)}_onDragStart(t){if(this._content.height<=this._maskGraphics.height)return;const e=t.getLocalPosition(this);this._startY=e.y-this._content.y,this._isDragging=!0,this._velocity=0,this._startTime=Date.now(),this._startPosition=this._content.y,ut.killTweensOf(this._content)}_onDragMove(t){if(this._isDragging){const i=t.getLocalPosition(this).y-this._startY;this._content.y=i}}_onDragEnd(){this._isDragging=!1;const e=Date.now()-this._startTime;e<250?(this._velocity=(this._content.y-this._startPosition)/e,this._applyInertia()):this._velocity=0,this._limitScrollRange()}_onWheelScroll(t){if(this._content.height<=this._maskGraphics.height)return;let e=this._content.y-t.deltaY*(this._scrollSpeed/100);e>0?e=0:Math.abs(e)>=this._content.height-this._maskGraphics.height&&(e=-(this._content.height-this._maskGraphics.height)),ut.to(this._content,{duration:.25,ease:"power1.out",y:e})}_applyInertia(){ut.to(this._content,{y:this._content.y+this._velocity*250,duration:.5,ease:"power1.out",onUpdate:this._limitScrollRange.bind(this)})}_limitScrollRange(){if(this._content.y>0)ut.to(this._content,{duration:.75,y:0,ease:"elastic.out"});else if(Math.abs(this._content.y)>=this._content.height-this._maskGraphics.height)if(this._content.height>this._maskGraphics.height){const t=-(this._content.height-this._maskGraphics.height);ut.to(this._content,{duration:.75,y:t,ease:"elastic.out"})}else ut.to(this._content,{duration:.25,y:0})}}class vE extends Tn{constructor(t){const{width:e,height:i,content:r,slideCallback:n,scrollCallback:a,pageNum:o,pageHeight:h}=t;super(e,i),this._currentIndex=0,this._scrollHeight=0,this._slideHeight=0,this._startY=0,this._offsetY=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1;const u=new ui;u.beginFill(16777215),u.drawRect(0,0,this.width,this.height),u.endFill(),this.addChild(u),this.mask=u,this._scrollHeight=i,this._slideHeight=h,this._slideArea=r,this._slideCallback=n,this._scrollCallback=a,this._pageNum=o-1,this.addChild(this._slideArea),this._slideArea.x=e/2,this._slideArea.y=this._scrollHeight/2,this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}updatePosition(t,e){this._slideArea.y=t,this._currentIndex=e}slideTo(t,e=!0){var i;t<0?(ut.to(this._slideArea,{y:this._scrollHeight/2,duration:.25,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=0):t>this._pageNum?(ut.to(this._slideArea,{y:-this._pageNum*this._slideHeight+this._scrollHeight/2,duration:.5,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=this._pageNum):(this._currentIndex=t,ut.to(this._slideArea,{y:-this._currentIndex*this._slideHeight+this._scrollHeight/2,duration:e?.25:.01,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}})),(i=this._slideCallback)==null||i.call(this,this._currentIndex)}_onDragStart(t){this._isDragging=!0,this._startY=t.data.global.y,this._offsetY=this._slideArea.y,ut.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){var a;if(!this._isDragging)return;const e=t.pageY-this._startY;let i=this._offsetY+e;const r=this._scrollHeight/2,n=-this._pageNum*this._slideHeight+this._scrollHeight/2;i>r&&(i=r),i<n&&(i=n),this._slideArea.y=i,(a=this._scrollCallback)==null||a.call(this,this._slideArea.y,this._currentIndex)}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startY-t.pageY,r=Math.abs(i)/e,n=.275,a=this._slideHeight/2,o=Math.round(i/this._slideHeight);(Math.abs(i)>a||r>n)&&(this._currentIndex+=o),this._currentIndex<0?this._currentIndex=0:this._currentIndex>this._pageNum&&(this._currentIndex=this._pageNum),this.slideTo(this._currentIndex)}}const r_=s=>{const t=new ui;return t.beginFill(16777215),t.drawRect(0,0,s.width,s.height),t.endFill(),s.addChild(t),s.mask=t,t};class bE extends Tn{constructor(t,e,i,r){super(t,e),this._currentIndex=0,this._slideWidth=0,this._startX=0,this._offsetX=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1,r_(this),this._slideWidth=t,this._slideArea=i,this.slideCallback=r,this._pageNum=Math.floor(i.width/this._slideWidth)-1,this.addChild(i),this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}prev(){this._slideTo(this._currentIndex-1)}next(){this._slideTo(this._currentIndex+1)}_slideTo(t){t<0?(ut.to(this._slideArea,{x:0,duration:.25}),this._currentIndex=0):t>this._pageNum?(ut.to(this._slideArea,{x:-this._pageNum*this._slideWidth,duration:.5}),this._currentIndex=this._pageNum):(this._currentIndex=t,ut.to(this._slideArea,{x:-this._currentIndex*this._slideWidth,duration:.25})),this.slideCallback(this._currentIndex,this._pageNum)}_onDragStart(t){this._isDragging=!0,this._startX=t.global.x,this._offsetX=this._slideArea.x,ut.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){if(!this._isDragging)return;const e=t.pageX-this._startX;this._slideArea.x=this._offsetX+e}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startX-t.pageX,r=Math.abs(i)/e,n=this._slideWidth/2,a=.275;(Math.abs(i)>n||r>a)&&(i>0?this._currentIndex++:this._currentIndex--),this._slideTo(this._currentIndex)}}class TE{constructor(t,e){this._currentIndex=0,this._numsLength=0,this._isDown=!1,this._onChange=e,this._numsLength=t,window.addEventListener("pointerup",()=>{this._isDown&&this._up()})}down(t){this._isDown=!0,this._handleChange(t),this._timerId=setTimeout(()=>{this._isDown&&(this._intervalId=setInterval(()=>{this._handleChange(t)},100))},100)}updateIndex(t){this._currentIndex=t}_up(){this._isDown=!1,clearTimeout(this._timerId),clearInterval(this._intervalId)}_handleChange(t){t==="add"?this._currentIndex<this._numsLength-1&&(this._currentIndex++,this._onChange(this._currentIndex)):t==="sub"&&this._currentIndex>0&&(this._currentIndex--,this._onChange(this._currentIndex))}}class wE{constructor(t){this._betAmountListLength=0;const{initialBetIndex:e,betAmountListLength:i,onAmountIndex:r,onDisabled:n}=t;this._onAmountIndex=r,this._onDisabled=n,this._betAmountListLength=i,this._baseNumSteper=new TE(i,a=>{this._onAmountIndex(a),this.minMaxUpdateIndex(a)}),this.minMaxUpdateIndex(e),this._baseNumSteper.updateIndex(e)}min(){this.minMaxUpdateIndex(0),this._onAmountIndex(0)}max(){const t=this._betAmountListLength-1;this.minMaxUpdateIndex(t),this._onAmountIndex(t)}sub(){this._baseNumSteper.down("sub")}add(){this._baseNumSteper.down("add")}minMaxUpdateIndex(t){t===0?this._onDisabled("min"):t===this._betAmountListLength-1?this._onDisabled("max"):this._onDisabled(),this._baseNumSteper.updateIndex(t)}}const n_=(s,t,e)=>{const i=t/s.width*s.scale.x,r=e?e/s.height*s.scale.y:i,n=Math.min(i,r);s.scale.set(n>1?1:n)};class EE extends bt{constructor(t){super();const{data:e,cellWidth:i=130,cellHeight:r=100,fontColor:n="#B4B4B8",fontSize:a=24,lineWidth:o=3,lineColor:h="#B4B4B8"}=t;this._data=e,this._rows=e.length,this._cols=e[0].length,this._cellWidth=i,this._cellHeight=r,this._fontColor=n,this._fontSize=a,this._lineWidth=o,this._lineColor=h,this._drawTable(),this.fillNumbers()}_drawTable(){const t=this._cellWidth*this._cols,e=this._cellHeight*this._rows,i=new ui;i.lineStyle(this._lineWidth,this._lineColor),i.drawRect(0,0,t,e);for(let r=1;r<this._rows;r++)i.moveTo(0,r*this._cellHeight),i.lineTo(t,r*this._cellHeight);for(let r=1;r<this._cols;r++)i.moveTo(r*this._cellWidth,0),i.lineTo(r*this._cellWidth,e);this.addChild(i)}fillNumbers(){for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const i=this._data[t][e];this._createNumberText(i,e,t)}}_createNumberText(t,e,i){const r=new Va(t.toString(),{_fontSize:this._fontSize,fill:this._fontColor}),n=e*this._cellWidth+this._cellWidth/2,a=i*this._cellHeight+this._cellHeight/2;this.addChild(r),r.anchor.set(.5),r.position.set(n,a),n_(r,this._cellWidth*.9)}}var Uu={};/*!
|
|
1169
|
+
*/class gi{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:zm(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let r;const{value:n,time:a}=i[0],o=r=new gi(typeof n=="string"?lo(n):n,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==n)for(let h=1;h<i.length;++h){const{value:u,time:d}=i[h];r.next=new gi(typeof u=="string"?lo(u):u,d),r=r.next}return o.isStepped=!!t.isStepped,o}const e=new gi(typeof t.start=="string"?lo(t.start):t.start,0);return t.end!==t.start&&(e.next=new gi(typeof t.end=="string"?lo(t.end):t.end,1)),e}}let wn=W.from;const yi=Math.PI/180;function Li(s,t){if(!s)return;const e=Math.sin(s),i=Math.cos(s),r=t.x*i-t.y*e,n=t.x*e+t.y*i;t.x=r,t.y=n}function ho(s,t,e){return s<<16|t<<8|e}function Wm(s){return Math.sqrt(s.x*s.x+s.y*s.y)}function Xw(s){const t=1/Wm(s);s.x*=t,s.y*=t}function $m(s,t){s.x*=t,s.y*=t}function lo(s,t){t||(t={}),s.charAt(0)==="#"?s=s.substr(1):s.indexOf("0x")===0&&(s=s.substr(2));let e;return s.length===8&&(e=s.substr(0,2),s=s.substr(2)),t.r=parseInt(s.substr(0,2),16),t.g=parseInt(s.substr(2,2),16),t.b=parseInt(s.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function zm(s){const t=s.length,e=1/t;return function(i){const r=t*i|0,n=(i-r*e)*t,a=s[r]||s[t-1];return a.s+n*(2*(1-n)*(a.cp-a.s)+n*(a.e-a.s))}}function Ww(s){return s?(s=s.toUpperCase().replace(/ /g,"_"),K[s]||K.NORMAL):K.NORMAL}class ou extends _e{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var xt;(function(s){s[s.Spawn=0]="Spawn",s[s.Normal=2]="Normal",s[s.Late=5]="Late"})(xt||(xt={}));const hu=ct.shared,Hs=Symbol("Position particle per emitter position");class dt{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new tt,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new tt,this._prevEmitterPos=new tt,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){dt.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:zm(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const r=dt.knownBehaviors[i.type];return r?new r(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Hs),e.sort((i,r)=>i===Hs?r.order===xt.Spawn?1:-1:r===Hs?i.order===xt.Spawn?-1:1:i.order-r.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Hs&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Hs&&i.recycleParticle)}getBehavior(t){return dt.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof dt.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new ou(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Li(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?hu.remove(this.update,this):!this._autoUpdate&&t&&hu.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=hu.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const r=this.ownerPos.x+this.spawnPos.x,n=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let a,o;if(this._prevPosIsValid&&this._posChanged){const d=1+this._spawnTimer/t;a=(r-e)*d+e,o=(n-i)*d+i}else a=r,o=n;let h=null,u=null;for(let d=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),l=0;l<d;++l){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let c;if(this.minLifetime===this.maxLifetime?c=this.minLifetime:c=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=c)continue;let f;this._poolFirst?(f=this._poolFirst,this._poolFirst=this._poolFirst.next,f.next=null):f=new ou(this),f.init(c),this.addAtBack?this._parent.addChildAt(f,0):this._parent.addChild(f),h?(u.next=f,f.prev=u,u=f):u=h=f,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=u):(this._activeParticlesFirst=h,this._activeParticlesLast=u);for(let d=0;d<this.initBehaviors.length;++d){const l=this.initBehaviors[d];if(l===Hs)for(let c=h,f;c;c=f){f=c.next,this.rotation!==0&&(Li(this.rotation,c.position),c.rotation+=this.rotation),c.position.x+=a,c.position.y+=o,c.age+=-this._spawnTimer;let p=c.age*c.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),c.agePercent=p}else l.initParticles(h)}for(let d=h,l;d;d=l){l=d.next;for(let c=0;c<this.updateBehaviors.length;++c)if(this.updateBehaviors[c].updateParticle(d,-this._spawnTimer)){this.recycle(d);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=r,this._prevEmitterPos.y=n,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,r=null;for(let n=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<n;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new ou(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(r.next=o,o.prev=r,r=o):r=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=r):(this._activeParticlesFirst=i,this._activeParticlesLast=r);for(let n=0;n<this.initBehaviors.length;++n){const a=this.initBehaviors[n];if(a===Hs)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Li(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}dt.knownBehaviors={};class lu{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}lu.type="rect",lu.editorConfig=null;class uo{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Li(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}uo.type="torus",uo.editorConfig=null;class uu{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let r=i[0];for(let n=1;n<i.length;++n){const a=i[n];this.segments.push({p1:r,p2:a,l:0}),r=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const r=t[i];this.segments.push({p1:e,p2:r,l:0}),e=r}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:r}=this.segments[e],n=Math.sqrt((r.x-i.x)*(r.x-i.x)+(r.y-i.y)*(r.y-i.y));this.segments[e].l=n,this.totalLength+=n,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,r;if(this.segments.length===1)i=this.segments[0],r=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],r=o===0?e:e-this.countingLengths[o-1];break}r/=i.l||1;const{p1:n,p2:a}=i;t.x=n.x+r*(a.x-n.x),t.y=n.y+r*(a.y-n.y)}}uu.type="polygonalChain",uu.editorConfig=null;class cu{constructor(t){var e;this.order=xt.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,r=i.x,n=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=Wm(i);a>this.maxSpeed&&$m(i,this.maxSpeed/a)}t.x+=(r+i.x)/2*e,t.y+=(n+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}cu.type="moveAcceleration",cu.editorConfig=null;function $w(s){return this.ease&&(s=this.ease(s)),(this.first.next.value-this.first.value)*s+this.first.value}function zw(s){this.ease&&(s=this.ease(s));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*s+t.r,r=(e.g-t.g)*s+t.g,n=(e.b-t.b)*s+t.b;return ho(i,r,n)}function Yw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;return s=(s-t.time)/(e.time-t.time),(e.value-t.value)*s+t.value}function jw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;s=(s-t.time)/(e.time-t.time);const i=t.value,r=e.value,n=(r.r-i.r)*s+i.r,a=(r.g-i.g)*s+i.g,o=(r.b-i.b)*s+i.b;return ho(n,a,o)}function qw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;return t.value}function Kw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;const e=t.value;return ho(e.r,e.g,e.b)}class En{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?zw:$w:t.isStepped?this.interpolate=this.isColor?Kw:qw:this.interpolate=this.isColor?jw:Yw,this.ease=this.first.ease}}class du{constructor(t){this.order=xt.Normal,this.list=new En(!1),this.list.reset(gi.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}du.type="alpha",du.editorConfig=null;class fu{constructor(t){this.order=xt.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}fu.type="alphaStatic",fu.editorConfig=null;function Ym(s){const t=[];for(let e=0;e<s.length;++e){let i=s[e];if(typeof i=="string")t.push(wn(i));else if(i instanceof W)t.push(i);else{let r=i.count||1;for(typeof i.texture=="string"?i=wn(i.texture):i=i.texture;r>0;--r)t.push(i)}}return t}class pu{constructor(t){this.order=xt.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],r=Ym(i.textures),n=i.framerate<0?-1:i.framerate>0?i.framerate:60,a={textures:r,duration:n>0?r.length/n:0,framerate:n,loop:n>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.anims.length),r=e.config.anim=this.anims[i];e.texture=r.textures[0],e.config.animElapsed=0,r.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=r.textures.length/e.maxLife):(e.config.animDuration=r.duration,e.config.animFramerate=r.framerate),e=e.next}}updateParticle(t,e){const i=t.config,r=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const n=i.animElapsed*i.animFramerate+1e-7|0;t.texture=r.textures[n]||r.textures[r.textures.length-1]||W.EMPTY}}pu.type="animatedRandom",pu.editorConfig=null;class mu{constructor(t){this.order=xt.Normal;const e=t.anim,i=Ym(e.textures),r=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:r>0?i.length/r:0,framerate:r,loop:r>0?!!e.loop:!1}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,e){const i=this.anim,r=t.config;r.animElapsed+=e,r.animElapsed>=r.animDuration&&(i.loop?r.animElapsed=r.animElapsed%r.animDuration:r.animElapsed=r.animDuration-1e-6);const n=r.animElapsed*r.animFramerate+1e-7|0;t.texture=i.textures[n]||i.textures[i.textures.length-1]||W.EMPTY}}mu.type="animatedSingle",mu.editorConfig=null;class _u{constructor(t){this.order=xt.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=Ww(this.value),e=e.next}}_u.type="blendMode",_u.editorConfig=null;class gu{constructor(t){this.order=xt.Spawn,this.spacing=t.spacing*yi,this.start=t.start*yi,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let r;this.spacing?r=this.start+this.spacing*e:r=Math.random()*Math.PI*2,i.rotation=r,this.distance&&(i.position.x=this.distance,Li(r,i.position)),i=i.next,++e}}}gu.type="spawnBurst",gu.editorConfig=null;class yu{constructor(t){this.order=xt.Normal,this.list=new En(!0),this.list.reset(gi.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,r=ho(i.r,i.g,i.b);for(;e;)e.tint=r,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}yu.type="color",yu.editorConfig=null;class xu{constructor(t){this.order=xt.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}xu.type="colorStatic",xu.editorConfig=null;class vu{constructor(t){this.order=xt.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?wn(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}vu.type="textureOrdered",vu.editorConfig=null;const Sr=new tt,jm=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],Zw=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(jm).join("|"),"g");function Qw(s){const t=s.match(Zw);for(let e=t.length-1;e>=0;--e)jm.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return s=t.join(""),new Function("x",`return ${s};`)}class bu{constructor(t){var e;if(this.order=xt.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=Qw(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new En(!1),this.list.reset(gi.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new tt(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,Sr.x=t.config.movement,Sr.y=this.path(Sr.x),Li(t.config.initRotation,Sr),t.position.x=t.config.initPosition.x+Sr.x,t.position.y=t.config.initPosition.y+Sr.y}}bu.type="movePath",bu.editorConfig=null;class Tu{constructor(){this.order=xt.Spawn}initParticles(t){}}Tu.type="spawnPoint",Tu.editorConfig=null;class wu{constructor(t){this.order=xt.Normal,this.textures=t.textures.map(e=>typeof e=="string"?wn(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}wu.type="textureRandom",wu.editorConfig=null;class Eu{constructor(t){this.order=xt.Normal,this.minStart=t.minStart*yi,this.maxStart=t.maxStart*yi,this.minSpeed=t.minSpeed*yi,this.maxSpeed=t.maxSpeed*yi,this.accel=t.accel*yi}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}Eu.type="rotation",Eu.editorConfig=null;class Au{constructor(t){this.order=xt.Normal,this.min=t.min*yi,this.max=t.max*yi}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}Au.type="rotationStatic",Au.editorConfig=null;class Su{constructor(t){this.order=xt.Late+1,this.rotation=(t.rotation||0)*yi}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}Su.type="noRotation",Su.editorConfig=null;class Cu{constructor(t){var e;this.order=xt.Normal,this.list=new En(!1),this.list.reset(gi.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}Cu.type="scale",Cu.editorConfig=null;class Pu{constructor(t){this.order=xt.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}Pu.type="scaleStatic",Pu.editorConfig=null;class ze{constructor(t){this.order=xt.Spawn;const e=ze.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){ze.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}ze.type="spawnShape",ze.editorConfig=null,ze.shapes={},ze.registerShape(uu),ze.registerShape(lu),ze.registerShape(uo),ze.registerShape(uo,"circle");class Iu{constructor(t){this.order=xt.Normal,this.texture=typeof t.texture=="string"?wn(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}Iu.type="textureSingle",Iu.editorConfig=null;class Ru{constructor(t){var e;this.order=xt.Late,this.list=new En(!1),this.list.reset(gi.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new tt(this.list.first.value*i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,r=t.config.velocity;Xw(r),$m(r,i),t.x+=r.x*e,t.y+=r.y*e}}Ru.type="moveSpeed",Ru.editorConfig=null;class Mu{constructor(t){this.order=xt.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}Mu.type="moveSpeedStatic",Mu.editorConfig=null,dt.registerBehavior(cu),dt.registerBehavior(du),dt.registerBehavior(fu),dt.registerBehavior(pu),dt.registerBehavior(mu),dt.registerBehavior(_u),dt.registerBehavior(gu),dt.registerBehavior(yu),dt.registerBehavior(xu),dt.registerBehavior(vu),dt.registerBehavior(bu),dt.registerBehavior(Tu),dt.registerBehavior(wu),dt.registerBehavior(Eu),dt.registerBehavior(Au),dt.registerBehavior(Su),dt.registerBehavior(Cu),dt.registerBehavior(Pu),dt.registerBehavior(ze),dt.registerBehavior(Iu),dt.registerBehavior(Ru),dt.registerBehavior(Mu);class Du extends Va{constructor(t){const{text:e,fontSize:i=36,fontColor:r=16777215,stroke:n,strokeColor:a,strokeThickness:o,fontFamily:h="Arial",fontWeight:u="normal",wordWrap:d=!1,wordWrapWidth:l=100,lineHeight:c=1.25,align:f="left",indent:p=0,shadow:m}=t,_=new Di({fontSize:i,wordWrap:d,wordWrapWidth:l,fontWeight:u,lineHeight:c*i,breakWords:d,fill:r,align:f,fontFamily:h,stroke:n?a:"transparent",strokeThickness:n?o:0,lineJoin:"round"});m&&(_.dropShadow=!0,_.dropShadowColor=m[0],_.dropShadowAngle=m[1]*(Math.PI/180),_.dropShadowBlur=m[2],_.dropShadowDistance=m[3]),super(e,_),this.position.x=p*i}}class Jw extends bt{constructor(t){super();const{start:e,control:i,end:r,json:n,duration:a,ease:o="power1.out",showControl:h=!1,loop:u=!1}=t;this._particleContainer=new Z1,this.addChild(this._particleContainer);const d=new dt(this._particleContainer,n),l=this._createBezierPoints([e,...i,r],100,h),c={pathThrough:0};ut.to(c,{duration:a,pathThrough:l.length-1,repeat:u?-1:0,ease:o,onStart:()=>{d.emit=!0},onUpdate:()=>{const p=Math.floor(c.pathThrough),m=l[p];d.updateOwnerPos(m.x,m.y)},onComplete:()=>{ut.to(this,{alpha:0,duration:.5,onComplete:()=>{d.emit=!1,f.destroy(),this.removeFromParent()}})}});const f=new ct;f.add(()=>{d.update(1/75)}),f.start()}_createBezierPoints(t,e,i){const r=[];i&&t.forEach((n,a)=>{const o=new Du({text:a+1,fontSize:16});o.position.set(n.x,n.y),this.addChild(o)});for(let n=0;n<e;n++){const a=this._multiPointBezier(t,n/e);r.push(a)}return r}_multiPointBezier(t,e){const i=t.length;let r=0,n=0;const a=[];for(let o=0;o<i;o++)a[o]=this._binomial(i-1,o);for(let o=0;o<i;o++){const h=t[o],u=a[o],d=Math.pow(e,o),l=Math.pow(1-e,i-1-o);r+=h.x*l*d*u,n+=h.y*l*d*u}return{x:r,y:n}}_binomial(t,e){if(e===0||e===t)return 1;let i=1;for(let r=1;r<=e;r++)i=i*(t-r+1)/r;return i}}var xi=(s=>(s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping",s))(xi||{}),j=(s=>(s[s.setup=0]="setup",s[s.first=1]="first",s[s.replace=2]="replace",s[s.add=3]="add",s))(j||{}),Te=(s=>(s[s.mixIn=0]="mixIn",s[s.mixOut=1]="mixOut",s))(Te||{}),co=(s=>(s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent",s))(co||{}),Vs=(s=>(s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale",s))(Vs||{}),se=(s=>(s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection",s))(se||{});class qm{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const t=this.texture;return t.trim?t.trim.width:t.orig.width}get height(){const t=this.texture;return t.trim?t.trim.height:t.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const t=this.texture;return t.trim?t.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const t=this.texture;return t.trim?t.trim.y:0}get spineOffsetY(){const t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return this.texture.rotate!==0}get degrees(){return(360-this.texture.rotate*45)%360}}class tE{constructor(){this.array=new Array}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}const Xs=class{constructor(s=0,t=0,e=0,i=0){this.r=s,this.g=t,this.b=e,this.a=i}set(s,t,e,i){return this.r=s,this.g=t,this.b=e,this.a=i,this.clamp()}setFromColor(s){return this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this}setFromString(s){return s=s.charAt(0)=="#"?s.substr(1):s,this.r=parseInt(s.substr(0,2),16)/255,this.g=parseInt(s.substr(2,2),16)/255,this.b=parseInt(s.substr(4,2),16)/255,this.a=s.length!=8?1:parseInt(s.substr(6,2),16)/255,this}add(s,t,e,i){return this.r+=s,this.g+=t,this.b+=e,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(s,t){s.r=((t&4278190080)>>>24)/255,s.g=((t&16711680)>>>16)/255,s.b=((t&65280)>>>8)/255,s.a=(t&255)/255}static rgb888ToColor(s,t){s.r=((t&16711680)>>>16)/255,s.g=((t&65280)>>>8)/255,s.b=(t&255)/255}static fromString(s){return new Xs().setFromString(s)}};let we=Xs;we.WHITE=new Xs(1,1,1,1),we.RED=new Xs(1,0,0,1),we.GREEN=new Xs(0,1,0,1),we.BLUE=new Xs(0,0,1,1),we.MAGENTA=new Xs(1,0,1,1);const Ni=class{static clamp(s,t,e){return s<t?t:s>e?e:s}static cosDeg(s){return Math.cos(s*Ni.degRad)}static sinDeg(s){return Math.sin(s*Ni.degRad)}static signum(s){return Math.sign(s)}static toInt(s){return s>0?Math.floor(s):Math.ceil(s)}static cbrt(s){const t=Math.pow(Math.abs(s),.3333333333333333);return s<0?-t:t}static randomTriangular(s,t){return Ni.randomTriangularWith(s,t,(s+t)*.5)}static randomTriangularWith(s,t,e){const i=Math.random(),r=t-s;return i<=(e-s)/r?s+Math.sqrt(i*r*(e-s)):t-Math.sqrt((1-i)*r*(t-e))}static isPowerOfTwo(s){return s&&(s&s-1)===0}};let L=Ni;L.PI=3.1415927,L.PI2=Ni.PI*2,L.radiansToDegrees=180/Ni.PI,L.radDeg=Ni.radiansToDegrees,L.degreesToRadians=Ni.PI/180,L.degRad=Ni.degreesToRadians;class eE{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class iE extends eE{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}}class sE extends iE{applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}const Cr=class{static arrayCopy(s,t,e,i,r){for(let n=t,a=i;n<t+r;n++,a++)e[a]=s[n]}static arrayFill(s,t,e,i){for(let r=t;r<e;r++)s[r]=i}static setArraySize(s,t,e=0){const i=s.length;if(i==t)return s;if(s.length=t,i<t)for(let r=i;r<t;r++)s[r]=e;return s}static ensureArrayCapacity(s,t,e=0){return s.length>=t?s:Cr.setArraySize(s,t,e)}static newArray(s,t){const e=new Array(s);for(let i=0;i<s;i++)e[i]=t;return e}static newFloatArray(s){if(Cr.SUPPORTS_TYPED_ARRAYS)return new Float32Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static newShortArray(s){if(Cr.SUPPORTS_TYPED_ARRAYS)return new Int16Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static toFloatArray(s){return Cr.SUPPORTS_TYPED_ARRAYS?new Float32Array(s):s}static toSinglePrecision(s){return Cr.SUPPORTS_TYPED_ARRAYS?Math.fround(s):s}static webkit602BugfixHelper(s,t){}static contains(s,t,e=!0){for(let i=0;i<s.length;i++)if(s[i]==t)return!0;return!1}static enumValue(s,t){return s[t[0].toUpperCase()+t.slice(1)]}};let Q=Cr;Q.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";class rE{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class nE{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){const t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}}const aE={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0},us=[0,0,0];class oE extends _e{constructor(){super(...arguments),this.region=null,this.attachment=null}}class hE extends K1{constructor(t,e,i,r,n){super(t,e,i,r,n),this.region=null,this.attachment=null}}const Km=class extends bt{constructor(s){if(super(),!s)throw new Error("The spineData param is required.");if(typeof s=="string")throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=s,this.createSkeleton(s),this.slotContainers=[],this.tempClipContainers=[];for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t],r=i.getAttachment(),n=this.newContainer();if(this.slotContainers.push(n),this.addChild(n),this.tempClipContainers.push(null),!!r)if(r.type===xi.Region){const a=r.name,o=this.createSprite(i,r,a);i.currentSprite=o,i.currentSpriteName=a,n.addChild(o)}else if(r.type===xi.Mesh){const a=this.createMesh(i,r);i.currentMesh=a,i.currentMeshId=r.id,i.currentMeshName=r.name,n.addChild(a)}else r.type===xi.Clipping&&(this.createGraphics(i,r),n.addChild(i.clippingContainer),n.addChild(i.currentGraphics))}this.tintRgb=new Float32Array([1,1,1]),this.autoUpdate=!0,this.visible=!0}get debug(){return this._debug}set debug(s){var t;s!=this._debug&&((t=this._debug)==null||t.unregisterSpine(this),s==null||s.registerSpine(this),this._debug=s)}get autoUpdate(){return this._autoUpdate}set autoUpdate(s){s!==this._autoUpdate&&(this._autoUpdate=s,this.updateTransform=s?Km.prototype.autoUpdateTransform:bt.prototype.updateTransform)}get tint(){return Qr(this.tintRgb)}set tint(s){this.tintRgb=Cd(s,this.tintRgb)}get delayLimit(){return(typeof this.localDelayLimit<"u"?this.localDelayLimit:aE.GLOBAL_DELAY_LIMIT)||Number.MAX_VALUE}update(s){var u;const t=this.delayLimit;if(s>t&&(s=t),this.state.update(s),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const e=this.skeleton.slots,i=this.color;let r=null,n=null;i?(r=i.light,n=i.dark):r=this.tintRgb;for(let d=0,l=e.length;d<l;d++){const c=e[d],f=c.getAttachment(),p=this.slotContainers[d];if(!f){p.visible=!1;continue}let m=null;f.sequence&&f.sequence.apply(c,f);let _=f.region;const g=f.color;switch(f!=null&&f.type){case xi.Region:if(p.transform.setFromMatrix(c.bone.matrix),_=f.region,c.currentMesh&&(c.currentMesh.visible=!1,c.currentMesh=null,c.currentMeshId=void 0,c.currentMeshName=void 0),!_){c.currentSprite&&(c.currentSprite.renderable=!1);break}if(!c.currentSpriteName||c.currentSpriteName!==f.name){const v=f.name;if(c.currentSprite&&(c.currentSprite.visible=!1),c.sprites=c.sprites||{},c.sprites[v]!==void 0)c.sprites[v].visible=!0;else{const b=this.createSprite(c,f,v);p.addChild(b)}c.currentSprite=c.sprites[v],c.currentSpriteName=v}c.currentSprite.renderable=!0,c.hackRegion||this.setSpriteRegion(f,c.currentSprite,_),c.currentSprite.color?m=c.currentSprite.color:(us[0]=r[0]*c.color.r*g.r,us[1]=r[1]*c.color.g*g.g,us[2]=r[2]*c.color.b*g.b,c.currentSprite.tint=Qr(us)),c.currentSprite.blendMode=c.blendMode;break;case xi.Mesh:if(c.currentSprite){c.currentSprite.visible=!1,c.currentSprite=null,c.currentSpriteName=void 0;const v=new ua;v._parentID=-1,v._worldID=p.transform._worldID,p.transform=v}if(!_){c.currentMesh&&(c.currentMesh.renderable=!1);break}const y=f.id;if(c.currentMeshId===void 0||c.currentMeshId!==y){const v=y;if(c.currentMesh&&(c.currentMesh.visible=!1),c.meshes=c.meshes||{},c.meshes[v]!==void 0)c.meshes[v].visible=!0;else{const b=this.createMesh(c,f);p.addChild(b)}c.currentMesh=c.meshes[v],c.currentMeshName=f.name,c.currentMeshId=v}c.currentMesh.renderable=!0,f.computeWorldVerticesOld(c,c.currentMesh.vertices),c.currentMesh.color?m=c.currentMesh.color:(us[0]=r[0]*c.color.r*g.r,us[1]=r[1]*c.color.g*g.g,us[2]=r[2]*c.color.b*g.b,c.currentMesh.tint=Qr(us)),c.currentMesh.blendMode=c.blendMode,c.hackRegion||this.setMeshRegion(f,c.currentMesh,_);break;case xi.Clipping:c.currentGraphics||(this.createGraphics(c,f),p.addChild(c.clippingContainer),p.addChild(c.currentGraphics)),this.updateGraphics(c,f),p.alpha=1,p.visible=!0;continue;default:p.visible=!1;continue}if(p.visible=!0,m){let x=c.color.r*g.r,y=c.color.g*g.g,v=c.color.b*g.b;m.setLight(r[0]*x+n[0]*(1-x),r[1]*y+n[1]*(1-y),r[2]*v+n[2]*(1-v)),c.darkColor?(x=c.darkColor.r,y=c.darkColor.g,v=c.darkColor.b):(x=0,y=0,v=0),m.setDark(r[0]*x+n[0]*(1-x),r[1]*y+n[1]*(1-y),r[2]*v+n[2]*(1-v))}p.alpha=c.color.a}const a=this.skeleton.drawOrder;let o=null,h=null;for(let d=0,l=a.length;d<l;d++){const c=e[a[d].data.index],f=this.slotContainers[a[d].data.index];if(h||f.parent!==null&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),c.currentGraphics&&c.getAttachment())h=c.clippingContainer,o=c.getAttachment(),h.children.length=0,this.children[d]=f,o.endSlot===c.data&&(o.endSlot=null);else if(h){let p=this.tempClipContainers[d];p||(p=this.tempClipContainers[d]=this.newContainer(),p.visible=!1),this.children[d]=p,f.parent=null,h.addChild(f),o.endSlot==c.data&&(h.renderable=!0,h=null,o=null)}else this.children[d]=f}(u=this._debug)==null||u.renderDebug(this)}setSpriteRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,t.rotation=s.rotation*L.degRad,t.position.x=s.x,t.position.y=s.y,t.alpha=s.color.a,e.size?(t.scale.x=e.size.width/e.originalWidth,t.scale.y=-e.size.height/e.originalHeight):(t.scale.x=s.scaleX*s.width/e.originalWidth,t.scale.y=-s.scaleY*s.height/e.originalHeight))}setMeshRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,e.texture.updateUvs(),t.uvBuffer.update(s.regionUVs))}autoUpdateTransform(){{this.lastTime=this.lastTime||Date.now();const s=(Date.now()-this.lastTime)*.001;this.lastTime=Date.now(),this.update(s)}bt.prototype.updateTransform.call(this)}createSprite(s,t,e){let i=t.region;s.hackAttachment===t&&(i=s.hackRegion);const r=i?i.texture:null,n=this.newSprite(r);return n.anchor.set(.5),i&&this.setSpriteRegion(t,n,t.region),s.sprites=s.sprites||{},s.sprites[e]=n,n}createMesh(s,t){let e=t.region;s.hackAttachment===t&&(e=s.hackRegion,s.hackAttachment=null,s.hackRegion=null);const i=this.newMesh(e?e.texture:null,new Float32Array(t.regionUVs.length),t.regionUVs,new Uint16Array(t.triangles),Ue.TRIANGLES);return typeof i._canvasPadding<"u"&&(i._canvasPadding=1.5),i.alpha=t.color.a,i.region=t.region,e&&this.setMeshRegion(t,i,e),s.meshes=s.meshes||{},s.meshes[t.id]=i,i}createGraphics(s,t){const e=this.newGraphics(),i=new Yi([]);return e.clear(),e.beginFill(16777215,1),e.drawPolygon(i),e.renderable=!1,s.currentGraphics=e,s.clippingContainer=this.newContainer(),s.clippingContainer.mask=s.currentGraphics,e}updateGraphics(s,t){const e=s.currentGraphics.geometry,i=e.graphicsData[0].shape.points,r=t.worldVerticesLength;i.length=r,t.computeWorldVertices(s,0,r,i,0,2),e.invalidate()}hackTextureBySlotIndex(s,t=null,e=null){const i=this.skeleton.slots[s];if(!i)return!1;const r=i.getAttachment();let n=r.region;return t?(n=new qm,n.texture=t,n.size=e,i.hackRegion=n,i.hackAttachment=r):(i.hackRegion=null,i.hackAttachment=null),i.currentSprite?this.setSpriteRegion(r,i.currentSprite,n):i.currentMesh&&this.setMeshRegion(r,i.currentMesh,n),!0}hackTextureBySlotName(s,t=null,e=null){const i=this.skeleton.findSlotIndex(s);return i==-1?!1:this.hackTextureBySlotIndex(i,t,e)}hackTextureAttachment(s,t,e,i=null){const r=this.skeleton.findSlotIndex(s),n=this.skeleton.getAttachmentByName(s,t);n.region.texture=e;const a=this.skeleton.slots[r];if(!a)return!1;const o=a.getAttachment();if(t===o.name){let h=n.region;return e?(h=new qm,h.texture=e,h.size=i,a.hackRegion=h,a.hackAttachment=o):(a.hackRegion=null,a.hackAttachment=null),a.currentSprite&&a.currentSprite.region!=h?(this.setSpriteRegion(o,a.currentSprite,h),a.currentSprite.region=h):a.currentMesh&&a.currentMesh.region!=h&&this.setMeshRegion(o,a.currentMesh,h),!0}return!1}newContainer(){return new bt}newSprite(s){return new oE(s)}newGraphics(){return new ui}newMesh(s,t,e,i,r){return new hE(s,t,e,i,r)}transformHack(){return 1}hackAttachmentGroups(s,t,e){if(!s)return;const i=[],r=[];for(let n=0,a=this.skeleton.slots.length;n<a;n++){const o=this.skeleton.slots[n],h=o.currentSpriteName||o.currentMeshName||"",u=o.currentSprite||o.currentMesh;h.endsWith(s)?(u.parentGroup=t,r.push(u)):e&&u&&(u.parentGroup=e,i.push(u))}return[i,r]}destroy(s){this.debug=null;for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t];for(const r in i.meshes)i.meshes[r].destroy(s);i.meshes=null;for(const r in i.sprites)i.sprites[r].destroy(s);i.sprites=null}for(let t=0,e=this.slotContainers.length;t<e;t++)this.slotContainers[t].destroy(s);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,super.destroy(s)}};let Bu=Km;Bu.clippingPolygon=[],Object.defineProperty(Bu.prototype,"visible",{get(){return this._visible},set(s){s!==this._visible&&(this._visible=s,s&&(this.lastTime=0))}});class Zm{constructor(t){if(t==null)throw new Error("name cannot be null.");this.name=t}}const Qm=class extends Zm{constructor(s){super(s),this.id=(Qm.nextID++&65535)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(s,t){this.computeWorldVertices(s,0,this.worldVerticesLength,t,0,2)}computeWorldVertices(s,t,e,i,r,n){e=r+(e>>1)*n;const a=s.bone.skeleton,o=s.deform;let h=this.vertices;const u=this.bones;if(u==null){o.length>0&&(h=o);const f=s.bone.matrix,p=f.tx,m=f.ty,_=f.a,g=f.c,x=f.b,y=f.d;for(let v=t,b=r;b<e;v+=2,b+=n){const E=h[v],w=h[v+1];i[b]=E*_+w*g+p,i[b+1]=E*x+w*y+m}return}let d=0,l=0;for(let f=0;f<t;f+=2){const p=u[d];d+=p+1,l+=p}const c=a.bones;if(o.length==0)for(let f=r,p=l*3;f<e;f+=n){let m=0,_=0,g=u[d++];for(g+=d;d<g;d++,p+=3){const x=c[u[d]].matrix,y=h[p],v=h[p+1],b=h[p+2];m+=(y*x.a+v*x.c+x.tx)*b,_+=(y*x.b+v*x.d+x.ty)*b}i[f]=m,i[f+1]=_}else{const f=o;for(let p=r,m=l*3,_=l<<1;p<e;p+=n){let g=0,x=0,y=u[d++];for(y+=d;d<y;d++,m+=3,_+=2){const v=c[u[d]].matrix,b=h[m]+f[_],E=h[m+1]+f[_+1],w=h[m+2];g+=(b*v.a+E*v.c+v.tx)*w,x+=(b*v.b+E*v.d+v.ty)*w}i[p]=g,i[p+1]=x}}}copyTo(s){this.bones!=null?(s.bones=new Array(this.bones.length),Q.arrayCopy(this.bones,0,s.bones,0,this.bones.length)):s.bones=null,this.vertices!=null?(s.vertices=Q.newFloatArray(this.vertices.length),Q.arrayCopy(this.vertices,0,s.vertices,0,this.vertices.length)):s.vertices=null,s.worldVerticesLength=this.worldVerticesLength,s.deformAttachment=this.deformAttachment}};let Ou=Qm;Ou.nextID=0;class fo extends Ou{constructor(t){super(t),this.type=xi.Mesh,this.color=new we(1,1,1,1),this.tempColor=new we(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t!=null&&(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!=null)return this.newLinkedMesh();const t=new fo(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),Q.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),Q.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=new Array(this.edges.length),Q.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new fo(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh!=null?this.parentMesh:this),t}}class An extends Ou{constructor(t){super(t),this.type=xi.Path,this.closed=!1,this.constantSpeed=!1,this.color=new we(1,1,1,1)}copy(){const t=new An(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),Q.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Jm{constructor(t,e){if(this.deform=new Array,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new we,this.darkColor=t.darkColor==null?null:new we,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const Kt=class extends Zm{constructor(s){super(s),this.type=xi.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new we(1,1,1,1),this.offset=Q.newFloatArray(8),this.uvs=Q.newFloatArray(8),this.tempColor=new we(1,1,1,1)}updateOffset(){const s=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,e=-this.width/2*this.scaleX+this.region.offsetX*s,i=-this.height/2*this.scaleY+this.region.offsetY*t,r=e+this.region.width*s,n=i+this.region.height*t,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),u=e*o+this.x,d=e*h,l=i*o+this.y,c=i*h,f=r*o+this.x,p=r*h,m=n*o+this.y,_=n*h,g=this.offset;g[Kt.OX1]=u-c,g[Kt.OY1]=l+d,g[Kt.OX2]=u-_,g[Kt.OY2]=m+d,g[Kt.OX3]=f-_,g[Kt.OY3]=m+p,g[Kt.OX4]=f-c,g[Kt.OY4]=l+p}setRegion(s){this.region=s;const t=this.uvs;s.rotate?(t[2]=s.u,t[3]=s.v2,t[4]=s.u,t[5]=s.v,t[6]=s.u2,t[7]=s.v,t[0]=s.u2,t[1]=s.v2):(t[0]=s.u,t[1]=s.v2,t[2]=s.u,t[3]=s.v,t[4]=s.u2,t[5]=s.v,t[6]=s.u2,t[7]=s.v2)}computeWorldVertices(s,t,e,i){const r=this.offset,n=s instanceof Jm?s.bone.matrix:s.matrix,a=n.tx,o=n.ty,h=n.a,u=n.c,d=n.b,l=n.d;let c=0,f=0;c=r[Kt.OX1],f=r[Kt.OY1],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o,e+=i,c=r[Kt.OX2],f=r[Kt.OY2],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o,e+=i,c=r[Kt.OX3],f=r[Kt.OY3],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o,e+=i,c=r[Kt.OX4],f=r[Kt.OY4],t[e]=c*h+f*u+a,t[e+1]=c*d+f*l+o}copy(){const s=new Kt(this.name);return s.region=this.region,s.rendererObject=this.rendererObject,s.path=this.path,s.x=this.x,s.y=this.y,s.scaleX=this.scaleX,s.scaleY=this.scaleY,s.rotation=this.rotation,s.width=this.width,s.height=this.height,Q.arrayCopy(this.uvs,0,s.uvs,0,8),Q.arrayCopy(this.offset,0,s.offset,0,8),s.color.setFromColor(this.color),s}};let et=Kt;et.OX1=0,et.OY1=1,et.OX2=2,et.OY2=3,et.OX3=4,et.OY3=5,et.OX4=6,et.OY4=7,et.X1=0,et.Y1=1,et.C1R=2,et.C1G=3,et.C1B=4,et.C1A=5,et.U1=6,et.V1=7,et.X2=8,et.Y2=9,et.C2R=10,et.C2G=11,et.C2B=12,et.C2A=13,et.U2=14,et.V2=15,et.X3=16,et.Y3=17,et.C3R=18,et.C3G=19,et.C3B=20,et.C3A=21,et.U3=22,et.V3=23,et.X4=24,et.Y4=25,et.C4R=26,et.C4G=27,et.C4B=28,et.C4A=29,et.U4=30,et.V4=31,new sE(2);class pe{constructor(t,e,i){if(t==null)throw new Error("name cannot be null.");if(e==null)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let r=0;r<e.length;r++)this.timelineIds[e[r].getPropertyId()]=!0;this.duration=i}hasTimeline(t){return this.timelineIds[t]==!0}apply(t,e,i,r,n,a,o,h){if(t==null)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));const u=this.timelines;for(let d=0,l=u.length;d<l;d++)u[d].apply(t,e,i,n,a,o,h)}static binarySearch(t,e,i=1){let r=0,n=t.length/i-2;if(n==0)return i;let a=n>>>1;for(;;){if(t[(a+1)*i]<=e?r=a+1:n=a,r==n)return(r+1)*i;a=r+n>>>1}}static linearSearch(t,e,i){for(let r=0,n=t.length-i;r<=n;r+=i)if(t[r]>e)return r;return-1}}const Gt=class{constructor(s){if(s<=0)throw new Error(`frameCount must be > 0: ${s}`);this.curves=Q.newFloatArray((s-1)*Gt.BEZIER_SIZE)}getFrameCount(){return this.curves.length/Gt.BEZIER_SIZE+1}setLinear(s){this.curves[s*Gt.BEZIER_SIZE]=Gt.LINEAR}setStepped(s){this.curves[s*Gt.BEZIER_SIZE]=Gt.STEPPED}getCurveType(s){const t=s*Gt.BEZIER_SIZE;if(t==this.curves.length)return Gt.LINEAR;const e=this.curves[t];return e==Gt.LINEAR?Gt.LINEAR:e==Gt.STEPPED?Gt.STEPPED:Gt.BEZIER}setCurve(s,t,e,i,r){const n=(-t*2+i)*.03,a=(-e*2+r)*.03,o=((t-i)*3+1)*.006,h=((e-r)*3+1)*.006;let u=n*2+o,d=a*2+h,l=t*.3+n+o*.16666667,c=e*.3+a+h*.16666667,f=s*Gt.BEZIER_SIZE;const p=this.curves;p[f++]=Gt.BEZIER;let m=l,_=c;for(let g=f+Gt.BEZIER_SIZE-1;f<g;f+=2)p[f]=m,p[f+1]=_,l+=u,c+=d,u+=o,d+=h,m+=l,_+=c}getCurvePercent(s,t){t=L.clamp(t,0,1);const e=this.curves;let i=s*Gt.BEZIER_SIZE;const r=e[i];if(r==Gt.LINEAR)return t;if(r==Gt.STEPPED)return 0;i++;let n=0;for(let o=i,h=i+Gt.BEZIER_SIZE-1;i<h;i+=2)if(n=e[i],n>=t){let u,d;return i==o?(u=0,d=0):(u=e[i-2],d=e[i-1]),d+(e[i+1]-d)*(t-u)/(n-u)}const a=e[i-1];return a+(1-a)*(t-n)/(1-n)}};let Fe=Gt;Fe.LINEAR=0,Fe.STEPPED=1,Fe.BEZIER=2,Fe.BEZIER_SIZE=10*2-1;const cs=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(s,t,e){s<<=1,this.frames[s]=t,this.frames[s+cs.ROTATION]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotation=h.data.rotation;return;case j.first:const p=h.data.rotation-h.rotation;h.rotation+=(p-(16384-(16384.499999999996-p/360|0))*360)*r}return}if(e>=o[o.length-cs.ENTRIES]){let p=o[o.length+cs.PREV_ROTATION];switch(n){case j.setup:h.rotation=h.data.rotation+p*r;break;case j.first:case j.replace:p+=h.data.rotation-h.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case j.add:h.rotation+=p*r}return}const u=pe.binarySearch(o,e,cs.ENTRIES),d=o[u+cs.PREV_ROTATION],l=o[u],c=this.getCurvePercent((u>>1)-1,1-(e-l)/(o[u+cs.PREV_TIME]-l));let f=o[u+cs.ROTATION]-d;switch(f=d+(f-(16384-(16384.499999999996-f/360|0))*360)*c,n){case j.setup:h.rotation=h.data.rotation+(f-(16384-(16384.499999999996-f/360|0))*360)*r;break;case j.first:case j.replace:f+=h.data.rotation-h.rotation;case j.add:h.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*r}}};let ke=cs;ke.ENTRIES=2,ke.PREV_TIME=-2,ke.PREV_ROTATION=-1,ke.ROTATION=1;const ae=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ae.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(s,t,e,i){s*=ae.ENTRIES,this.frames[s]=t,this.frames[s+ae.X]=e,this.frames[s+ae.Y]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.x=h.data.x,h.y=h.data.y;return;case j.first:h.x+=(h.data.x-h.x)*r,h.y+=(h.data.y-h.y)*r}return}let u=0,d=0;if(e>=o[o.length-ae.ENTRIES])u=o[o.length+ae.PREV_X],d=o[o.length+ae.PREV_Y];else{const l=pe.binarySearch(o,e,ae.ENTRIES);u=o[l+ae.PREV_X],d=o[l+ae.PREV_Y];const c=o[l],f=this.getCurvePercent(l/ae.ENTRIES-1,1-(e-c)/(o[l+ae.PREV_TIME]-c));u+=(o[l+ae.X]-u)*f,d+=(o[l+ae.Y]-d)*f}switch(n){case j.setup:h.x=h.data.x+u*r,h.y=h.data.y+d*r;break;case j.first:case j.replace:h.x+=(h.data.x+u-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case j.add:h.x+=u*r,h.y+=d*r}}};let Pr=ae;Pr.ENTRIES=3,Pr.PREV_TIME=-3,Pr.PREV_X=-2,Pr.PREV_Y=-1,Pr.X=1,Pr.Y=2;const It=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*It.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(s,t,e,i,r,n){s*=It.ENTRIES,this.frames[s]=t,this.frames[s+It.R]=e,this.frames[s+It.G]=i,this.frames[s+It.B]=r,this.frames[s+It.A]=n}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color);return;case j.first:const f=o.color,p=o.data.color;f.add((p.r-f.r)*r,(p.g-f.g)*r,(p.b-f.b)*r,(p.a-f.a)*r)}return}let u=0,d=0,l=0,c=0;if(e>=h[h.length-It.ENTRIES]){const f=h.length;u=h[f+It.PREV_R],d=h[f+It.PREV_G],l=h[f+It.PREV_B],c=h[f+It.PREV_A]}else{const f=pe.binarySearch(h,e,It.ENTRIES);u=h[f+It.PREV_R],d=h[f+It.PREV_G],l=h[f+It.PREV_B],c=h[f+It.PREV_A];const p=h[f],m=this.getCurvePercent(f/It.ENTRIES-1,1-(e-p)/(h[f+It.PREV_TIME]-p));u+=(h[f+It.R]-u)*m,d+=(h[f+It.G]-d)*m,l+=(h[f+It.B]-l)*m,c+=(h[f+It.A]-c)*m}if(r==1)o.color.set(u,d,l,c);else{const f=o.color;n==j.setup&&f.setFromColor(o.data.color),f.add((u-f.r)*r,(d-f.g)*r,(l-f.b)*r,(c-f.a)*r)}}};let vi=It;vi.ENTRIES=5,vi.PREV_TIME=-5,vi.PREV_R=-4,vi.PREV_G=-3,vi.PREV_B=-2,vi.PREV_A=-1,vi.R=1,vi.G=2,vi.B=3,vi.A=4;const ot=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ot.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(s,t,e,i,r,n,a,o,h){s*=ot.ENTRIES,this.frames[s]=t,this.frames[s+ot.R]=e,this.frames[s+ot.G]=i,this.frames[s+ot.B]=r,this.frames[s+ot.A]=n,this.frames[s+ot.R2]=a,this.frames[s+ot.G2]=o,this.frames[s+ot.B2]=h}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color),o.darkColor.setFromColor(o.data.darkColor);return;case j.first:const _=o.color,g=o.darkColor,x=o.data.color,y=o.data.darkColor;_.add((x.r-_.r)*r,(x.g-_.g)*r,(x.b-_.b)*r,(x.a-_.a)*r),g.add((y.r-g.r)*r,(y.g-g.g)*r,(y.b-g.b)*r,0)}return}let u=0,d=0,l=0,c=0,f=0,p=0,m=0;if(e>=h[h.length-ot.ENTRIES]){const _=h.length;u=h[_+ot.PREV_R],d=h[_+ot.PREV_G],l=h[_+ot.PREV_B],c=h[_+ot.PREV_A],f=h[_+ot.PREV_R2],p=h[_+ot.PREV_G2],m=h[_+ot.PREV_B2]}else{const _=pe.binarySearch(h,e,ot.ENTRIES);u=h[_+ot.PREV_R],d=h[_+ot.PREV_G],l=h[_+ot.PREV_B],c=h[_+ot.PREV_A],f=h[_+ot.PREV_R2],p=h[_+ot.PREV_G2],m=h[_+ot.PREV_B2];const g=h[_],x=this.getCurvePercent(_/ot.ENTRIES-1,1-(e-g)/(h[_+ot.PREV_TIME]-g));u+=(h[_+ot.R]-u)*x,d+=(h[_+ot.G]-d)*x,l+=(h[_+ot.B]-l)*x,c+=(h[_+ot.A]-c)*x,f+=(h[_+ot.R2]-f)*x,p+=(h[_+ot.G2]-p)*x,m+=(h[_+ot.B2]-m)*x}if(r==1)o.color.set(u,d,l,c),o.darkColor.set(f,p,m,1);else{const _=o.color,g=o.darkColor;n==j.setup&&(_.setFromColor(o.data.color),g.setFromColor(o.data.darkColor)),_.add((u-_.r)*r,(d-_.g)*r,(l-_.b)*r,(c-_.a)*r),g.add((f-g.r)*r,(p-g.g)*r,(m-g.b)*r,0)}}};let re=ot;re.ENTRIES=8,re.PREV_TIME=-8,re.PREV_R=-7,re.PREV_G=-6,re.PREV_B=-5,re.PREV_A=-4,re.PREV_R2=-3,re.PREV_G2=-2,re.PREV_B2=-1,re.R=1,re.G=2,re.B=3,re.A=4,re.R2=5,re.G2=6,re.B2=7;class po{constructor(t){this.frames=Q.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,r,n,a,o){const h=t.slots[this.slotIndex];if(!h.bone.active)return;if(o==Te.mixOut){a==j.setup&&this.setAttachment(t,h,h.data.attachmentName);return}const u=this.frames;if(i<u[0]){(a==j.setup||a==j.first)&&this.setAttachment(t,h,h.data.attachmentName);return}let d=0;i>=u[u.length-1]?d=u.length-1:d=pe.binarySearch(u,i,1)-1;const l=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(l==null?null:t.getAttachment(this.slotIndex,l))}setAttachment(t,e,i){e.setAttachment(i==null?null:t.getAttachment(this.slotIndex,i))}}class lE{constructor(t){this.frames=Q.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,r,n,a,o){if(r==null)return;const h=this.frames,u=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,r,n,a,o),e=-1;else if(e>=h[u-1])return;if(i<h[0])return;let d=0;if(e<h[0])d=0;else{d=pe.binarySearch(h,e);const l=h[d];for(;d>0&&h[d-1]==l;)d--}for(;d<u&&i>=h[d];d++)r.push(this.events[d])}}class Fu{constructor(t){this.frames=Q.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,r,n,a,o){const h=t.drawOrder,u=t.slots;if(o==Te.mixOut&&a==j.setup){Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}const d=this.frames;if(i<d[0]){(a==j.setup||a==j.first)&&Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let l=0;i>=d[d.length-1]?l=d.length-1:l=pe.binarySearch(d,i)-1;const c=this.drawOrders[l];if(c==null)Q.arrayCopy(u,0,h,0,u.length);else for(let f=0,p=c.length;f<p;f++)h[f]=u[c[f]]}}const ht=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ht.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(s,t,e,i,r,n,a){s*=ht.ENTRIES,this.frames[s]=t,this.frames[s+ht.MIX]=e,this.frames[s+ht.SOFTNESS]=i,this.frames[s+ht.BEND_DIRECTION]=r,this.frames[s+ht.COMPRESS]=n?1:0,this.frames[s+ht.STRETCH]=a?1:0}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch;return;case j.first:h.mix+=(h.data.mix-h.mix)*r,h.softness+=(h.data.softness-h.softness)*r,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(e>=o[o.length-ht.ENTRIES]){n==j.setup?(h.mix=h.data.mix+(o[o.length+ht.PREV_MIX]-h.data.mix)*r,h.softness=h.data.softness+(o[o.length+ht.PREV_SOFTNESS]-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0)):(h.mix+=(o[o.length+ht.PREV_MIX]-h.mix)*r,h.softness+=(o[o.length+ht.PREV_SOFTNESS]-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0));return}const u=pe.binarySearch(o,e,ht.ENTRIES),d=o[u+ht.PREV_MIX],l=o[u+ht.PREV_SOFTNESS],c=o[u],f=this.getCurvePercent(u/ht.ENTRIES-1,1-(e-c)/(o[u+ht.PREV_TIME]-c));n==j.setup?(h.mix=h.data.mix+(d+(o[u+ht.MIX]-d)*f-h.data.mix)*r,h.softness=h.data.softness+(l+(o[u+ht.SOFTNESS]-l)*f-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[u+ht.PREV_BEND_DIRECTION],h.compress=o[u+ht.PREV_COMPRESS]!=0,h.stretch=o[u+ht.PREV_STRETCH]!=0)):(h.mix+=(d+(o[u+ht.MIX]-d)*f-h.mix)*r,h.softness+=(l+(o[u+ht.SOFTNESS]-l)*f-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[u+ht.PREV_BEND_DIRECTION],h.compress=o[u+ht.PREV_COMPRESS]!=0,h.stretch=o[u+ht.PREV_STRETCH]!=0))}};let Le=ht;Le.ENTRIES=6,Le.PREV_TIME=-6,Le.PREV_MIX=-5,Le.PREV_SOFTNESS=-4,Le.PREV_BEND_DIRECTION=-3,Le.PREV_COMPRESS=-2,Le.PREV_STRETCH=-1,Le.MIX=1,Le.SOFTNESS=2,Le.BEND_DIRECTION=3,Le.COMPRESS=4,Le.STRETCH=5;const Rt=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Rt.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(s,t,e,i,r,n){s*=Rt.ENTRIES,this.frames[s]=t,this.frames[s+Rt.ROTATE]=e,this.frames[s+Rt.TRANSLATE]=i,this.frames[s+Rt.SCALE]=r,this.frames[s+Rt.SHEAR]=n}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(e<o[0]){const f=h.data;switch(n){case j.setup:h.rotateMix=f.rotateMix,h.translateMix=f.translateMix,h.scaleMix=f.scaleMix,h.shearMix=f.shearMix;return;case j.first:h.rotateMix+=(f.rotateMix-h.rotateMix)*r,h.translateMix+=(f.translateMix-h.translateMix)*r,h.scaleMix+=(f.scaleMix-h.scaleMix)*r,h.shearMix+=(f.shearMix-h.shearMix)*r}return}let u=0,d=0,l=0,c=0;if(e>=o[o.length-Rt.ENTRIES]){const f=o.length;u=o[f+Rt.PREV_ROTATE],d=o[f+Rt.PREV_TRANSLATE],l=o[f+Rt.PREV_SCALE],c=o[f+Rt.PREV_SHEAR]}else{const f=pe.binarySearch(o,e,Rt.ENTRIES);u=o[f+Rt.PREV_ROTATE],d=o[f+Rt.PREV_TRANSLATE],l=o[f+Rt.PREV_SCALE],c=o[f+Rt.PREV_SHEAR];const p=o[f],m=this.getCurvePercent(f/Rt.ENTRIES-1,1-(e-p)/(o[f+Rt.PREV_TIME]-p));u+=(o[f+Rt.ROTATE]-u)*m,d+=(o[f+Rt.TRANSLATE]-d)*m,l+=(o[f+Rt.SCALE]-l)*m,c+=(o[f+Rt.SHEAR]-c)*m}if(n==j.setup){const f=h.data;h.rotateMix=f.rotateMix+(u-f.rotateMix)*r,h.translateMix=f.translateMix+(d-f.translateMix)*r,h.scaleMix=f.scaleMix+(l-f.scaleMix)*r,h.shearMix=f.shearMix+(c-f.shearMix)*r}else h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r,h.scaleMix+=(l-h.scaleMix)*r,h.shearMix+=(c-h.shearMix)*r}};let bi=Rt;bi.ENTRIES=5,bi.PREV_TIME=-5,bi.PREV_ROTATE=-4,bi.PREV_TRANSLATE=-3,bi.PREV_SCALE=-2,bi.PREV_SHEAR=-1,bi.ROTATE=1,bi.TRANSLATE=2,bi.SCALE=3,bi.SHEAR=4;const Ye=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Ye.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(s,t,e){s*=Ye.ENTRIES,this.frames[s]=t,this.frames[s+Ye.VALUE]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.position=h.data.position;return;case j.first:h.position+=(h.data.position-h.position)*r}return}let u=0;if(e>=o[o.length-Ye.ENTRIES])u=o[o.length+Ye.PREV_VALUE];else{const d=pe.binarySearch(o,e,Ye.ENTRIES);u=o[d+Ye.PREV_VALUE];const l=o[d],c=this.getCurvePercent(d/Ye.ENTRIES-1,1-(e-l)/(o[d+Ye.PREV_TIME]-l));u+=(o[d+Ye.VALUE]-u)*c}n==j.setup?h.position=h.data.position+(u-h.data.position)*r:h.position+=(u-h.position)*r}};let mo=Ye;mo.ENTRIES=2,mo.PREV_TIME=-2,mo.PREV_VALUE=-1,mo.VALUE=1;const oe=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*oe.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(s,t,e,i){s*=oe.ENTRIES,this.frames[s]=t,this.frames[s+oe.ROTATE]=e,this.frames[s+oe.TRANSLATE]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotateMix=h.data.rotateMix,h.translateMix=h.data.translateMix;return;case j.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*r,h.translateMix+=(h.data.translateMix-h.translateMix)*r}return}let u=0,d=0;if(e>=o[o.length-oe.ENTRIES])u=o[o.length+oe.PREV_ROTATE],d=o[o.length+oe.PREV_TRANSLATE];else{const l=pe.binarySearch(o,e,oe.ENTRIES);u=o[l+oe.PREV_ROTATE],d=o[l+oe.PREV_TRANSLATE];const c=o[l],f=this.getCurvePercent(l/oe.ENTRIES-1,1-(e-c)/(o[l+oe.PREV_TIME]-c));u+=(o[l+oe.ROTATE]-u)*f,d+=(o[l+oe.TRANSLATE]-d)*f}n==j.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}};let Ir=oe;Ir.ENTRIES=3,Ir.PREV_TIME=-3,Ir.PREV_ROTATE=-2,Ir.PREV_TRANSLATE=-1,Ir.ROTATE=1,Ir.TRANSLATE=2;const Mt=class{constructor(s){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new t_(this),this.propertyIDs=new tE,this.animationsChanged=!1,this.trackEntryPool=new rE(()=>new ku),this.data=s}update(s){s*=this.timeScale;const t=this.tracks;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r==null)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let n=s*r.timeScale;if(r.delay>0){if(r.delay-=n,r.delay>0)continue;n=-r.delay,r.delay=0}let a=r.next;if(a!=null){const o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(o/r.timeScale+s)*a.timeScale,r.trackTime+=n,this.setCurrent(e,a,!0);a.mixingFrom!=null;)a.mixTime+=s,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&r.mixingFrom==null){t[e]=null,this.queue.end(r),this.disposeNext(r);continue}if(r.mixingFrom!=null&&this.updateMixingFrom(r,s)){let o=r.mixingFrom;for(r.mixingFrom=null,o!=null&&(o.mixingTo=null);o!=null;)this.queue.end(o),o=o.mixingFrom}r.trackTime+=n}this.queue.drain()}updateMixingFrom(s,t){const e=s.mixingFrom;if(e==null)return!0;const i=this.updateMixingFrom(e,t);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,s.mixTime>0&&s.mixTime>=s.mixDuration?((e.totalAlpha==0||s.mixDuration==0)&&(s.mixingFrom=e.mixingFrom,e.mixingFrom!=null&&(e.mixingFrom.mixingTo=s),s.interruptAlpha=e.interruptAlpha,this.queue.end(e)),i):(e.trackTime+=t*e.timeScale,s.mixTime+=t,!1)}apply(s){if(s==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,e=this.tracks;let i=!1;for(let a=0,o=e.length;a<o;a++){const h=e[a];if(h==null||h.delay>0)continue;i=!0;const u=a==0?j.first:h.mixBlend;let d=h.alpha;h.mixingFrom!=null?d*=this.applyMixingFrom(h,s,u):h.trackTime>=h.trackEnd&&h.next==null&&(d=0);const l=h.animationLast,c=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(a==0&&d==1||u==j.add)for(let m=0;m<f;m++){const _=p[m];_ instanceof po?this.applyAttachmentTimeline(_,s,c,u,!0):_.apply(s,l,c,t,d,u,Te.mixIn)}else{const m=h.timelineMode,_=h.timelinesRotation.length==0;_&&Q.setArraySize(h.timelinesRotation,f<<1,null);const g=h.timelinesRotation;for(let x=0;x<f;x++){const y=p[x],v=m[x]==Mt.SUBSEQUENT?u:j.setup;y instanceof ke?this.applyRotateTimeline(y,s,c,d,v,g,x<<1,_):y instanceof po?this.applyAttachmentTimeline(y,s,c,u,!0):y.apply(s,l,c,t,d,v,Te.mixIn)}}this.queueEvents(h,c),t.length=0,h.nextAnimationLast=c,h.nextTrackLast=h.trackTime}const r=this.unkeyedState+Mt.SETUP,n=s.slots;for(let a=0,o=s.slots.length;a<o;a++){const h=n[a];if(h.attachmentState==r){const u=h.data.attachmentName;h.setAttachment(u==null?null:s.getAttachment(h.data.index,u))}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(s,t,e){const i=s.mixingFrom;i.mixingFrom!=null&&this.applyMixingFrom(i,t,e);let r=0;s.mixDuration==0?(r=1,e==j.first&&(e=j.setup)):(r=s.mixTime/s.mixDuration,r>1&&(r=1),e!=j.first&&(e=i.mixBlend));const n=r<i.eventThreshold?this.events:null,a=r<i.attachmentThreshold,o=r<i.drawOrderThreshold,h=i.animationLast,u=i.getAnimationTime(),d=i.animation.timelines.length,l=i.animation.timelines,c=i.alpha*s.interruptAlpha,f=c*(1-r);if(e==j.add)for(let p=0;p<d;p++)l[p].apply(t,h,u,n,f,e,Te.mixOut);else{const p=i.timelineMode,m=i.timelineHoldMix,_=i.timelinesRotation.length==0;_&&Q.setArraySize(i.timelinesRotation,d<<1,null);const g=i.timelinesRotation;i.totalAlpha=0;for(let x=0;x<d;x++){const y=l[x];let v=Te.mixOut,b,E=0;switch(p[x]){case Mt.SUBSEQUENT:if(!o&&y instanceof Fu)continue;b=e,E=f;break;case Mt.FIRST:b=j.setup,E=f;break;case Mt.HOLD_SUBSEQUENT:b=e,E=c;break;case Mt.HOLD_FIRST:b=j.setup,E=c;break;default:b=j.setup;const w=m[x];E=c*Math.max(0,1-w.mixTime/w.mixDuration);break}i.totalAlpha+=E,y instanceof ke?this.applyRotateTimeline(y,t,u,E,b,g,x<<1,_):y instanceof po?this.applyAttachmentTimeline(y,t,u,b,a):(o&&y instanceof Fu&&b==j.setup&&(v=Te.mixIn),y.apply(t,h,u,n,E,b,v))}}return s.mixDuration>0&&this.queueEvents(i,u),this.events.length=0,i.nextAnimationLast=u,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(s,t,e,i,r){const n=t.slots[s.slotIndex];if(!n.bone.active)return;const a=s.frames;if(e<a[0])(i==j.setup||i==j.first)&&this.setAttachment(t,n,n.data.attachmentName,r);else{let o;e>=a[a.length-1]?o=a.length-1:o=pe.binarySearch(a,e)-1,this.setAttachment(t,n,s.attachmentNames[o],r)}n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+Mt.SETUP)}setAttachment(s,t,e,i){t.setAttachment(e==null?null:s.getAttachment(t.data.index,e)),i&&(t.attachmentState=this.unkeyedState+Mt.CURRENT)}applyRotateTimeline(s,t,e,i,r,n,a,o){if(o&&(n[a]=0),i==1){s.apply(t,0,e,null,1,r,Te.mixIn);return}const h=s,u=h.frames,d=t.bones[h.boneIndex];if(!d.active)return;let l=0,c=0;if(e<u[0])switch(r){case j.setup:d.rotation=d.data.rotation;default:return;case j.first:l=d.rotation,c=d.data.rotation}else if(l=r==j.setup?d.data.rotation:d.rotation,e>=u[u.length-ke.ENTRIES])c=d.data.rotation+u[u.length+ke.PREV_ROTATION];else{const m=pe.binarySearch(u,e,ke.ENTRIES),_=u[m+ke.PREV_ROTATION],g=u[m],x=h.getCurvePercent((m>>1)-1,1-(e-g)/(u[m+ke.PREV_TIME]-g));c=u[m+ke.ROTATION]-_,c-=(16384-(16384.499999999996-c/360|0))*360,c=_+c*x+d.data.rotation,c-=(16384-(16384.499999999996-c/360|0))*360}let f=0,p=c-l;if(p-=(16384-(16384.499999999996-p/360|0))*360,p==0)f=n[a];else{let m=0,_=0;o?(m=0,_=p):(m=n[a],_=n[a+1]);const g=p>0;let x=m>=0;L.signum(_)!=L.signum(p)&&Math.abs(_)<=90&&(Math.abs(m)>180&&(m+=360*L.signum(m)),x=g),f=p+m-m%360,x!=g&&(f+=360*L.signum(m)),n[a]=f}n[a+1]=p,l+=f*i,d.rotation=l-(16384-(16384.499999999996-l/360|0))*360}queueEvents(s,t){const e=s.animationStart,i=s.animationEnd,r=i-e,n=s.trackLast%r,a=this.events;let o=0;const h=a.length;for(;o<h;o++){const d=a[o];if(d.time<n)break;d.time>i||this.queue.event(s,d)}let u=!1;for(s.loop?u=r==0||n>s.trackTime%r:u=t>=i&&s.animationLast<i,u&&this.queue.complete(s);o<h;o++)a[o].time<e||this.queue.event(s,a[o])}clearTracks(){const s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=s,this.queue.drain()}clearTrack(s){if(s>=this.tracks.length)return;const t=this.tracks[s];if(t==null)return;this.queue.end(t),this.disposeNext(t);let e=t;for(;;){const i=e.mixingFrom;if(i==null)break;this.queue.end(i),e.mixingFrom=null,e.mixingTo=null,e=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(s,t,e){const i=this.expandToIndex(s);this.tracks[s]=t,i!=null&&(e&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom!=null&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(s,t,e){const i=this.data.skeletonData.findAnimation(t);if(i==null)throw new Error(`Animation not found: ${t}`);return this.setAnimationWith(s,i,e)}setAnimationWith(s,t,e){if(t==null)throw new Error("animation cannot be null.");let i=!0,r=this.expandToIndex(s);r!=null&&(r.nextTrackLast==-1?(this.tracks[s]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,i=!1):this.disposeNext(r));const n=this.trackEntry(s,t,e,r);return this.setCurrent(s,n,i),this.queue.drain(),n}addAnimation(s,t,e,i){const r=this.data.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);return this.addAnimationWith(s,r,e,i)}addAnimationWith(s,t,e,i){if(t==null)throw new Error("animation cannot be null.");let r=this.expandToIndex(s);if(r!=null)for(;r.next!=null;)r=r.next;const n=this.trackEntry(s,t,e,r);if(r==null)this.setCurrent(s,n,!0),this.queue.drain();else if(r.next=n,i<=0){const a=r.animationEnd-r.animationStart;a!=0?(r.loop?i+=a*(1+(r.trackTime/a|0)):i+=Math.max(a,r.trackTime),i-=this.data.getMix(r.animation,t)):i=r.trackTime}return n.delay=i,n}setEmptyAnimation(s,t){const e=this.setAnimationWith(s,Mt.emptyAnimation,!1);return e.mixDuration=t,e.trackEnd=t,e}addEmptyAnimation(s,t,e){e<=0&&(e-=t);const i=this.addAnimationWith(s,Mt.emptyAnimation,!1,e);return i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(s){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){const r=this.tracks[e];r!=null&&this.setEmptyAnimation(r.trackIndex,s)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(s){return s<this.tracks.length?this.tracks[s]:(Q.ensureArrayCapacity(this.tracks,s+1,null),this.tracks.length=s+1,null)}trackEntry(s,t,e,i){const r=this.trackEntryPool.obtain();return r.trackIndex=s,r.animation=t,r.loop=e,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=t.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=i==null?0:this.data.getMix(i.animation,t),r.mixBlend=j.replace,r}disposeNext(s){let t=s.next;for(;t!=null;)this.queue.dispose(t),t=t.next;s.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let s=0,t=this.tracks.length;s<t;s++){let e=this.tracks[s];if(e!=null){for(;e.mixingFrom!=null;)e=e.mixingFrom;do(e.mixingFrom==null||e.mixBlend!=j.add)&&this.computeHold(e),e=e.mixingTo;while(e!=null)}}}computeHold(s){const t=s.mixingTo,e=s.animation.timelines,i=s.animation.timelines.length,r=Q.setArraySize(s.timelineMode,i);s.timelineHoldMix.length=0;const n=Q.setArraySize(s.timelineHoldMix,i),a=this.propertyIDs;if(t!=null&&t.holdPrevious){for(let o=0;o<i;o++)r[o]=a.add(e[o].getPropertyId())?Mt.HOLD_FIRST:Mt.HOLD_SUBSEQUENT;return}t:for(let o=0;o<i;o++){const h=e[o],u=h.getPropertyId();if(!a.add(u))r[o]=Mt.SUBSEQUENT;else if(t==null||h instanceof po||h instanceof Fu||h instanceof lE||!t.animation.hasTimeline(u))r[o]=Mt.FIRST;else{for(let d=t.mixingTo;d!=null;d=d.mixingTo)if(!d.animation.hasTimeline(u)){if(s.mixDuration>0){r[o]=Mt.HOLD_MIX,n[o]=d;continue t}break}r[o]=Mt.HOLD_FIRST}}}getCurrent(s){return s>=this.tracks.length?null:this.tracks[s]}addListener(s){if(s==null)throw new Error("listener cannot be null.");this.listeners.push(s)}removeListener(s){const t=this.listeners.indexOf(s);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(s,t,e){Mt.deprecatedWarning1||(Mt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(s,t,e)}addAnimationByName(s,t,e,i){Mt.deprecatedWarning2||(Mt.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(s,t,e,i)}hasAnimation(s){return this.data.skeletonData.findAnimation(s)!==null}hasAnimationByName(s){return Mt.deprecatedWarning3||(Mt.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(s)}};let Ne=Mt;Ne.emptyAnimation=new pe("<empty>",[],0),Ne.SUBSEQUENT=0,Ne.FIRST=1,Ne.HOLD_SUBSEQUENT=2,Ne.HOLD_FIRST=3,Ne.HOLD_MIX=4,Ne.SETUP=1,Ne.CURRENT=2,Ne.deprecatedWarning1=!1,Ne.deprecatedWarning2=!1,Ne.deprecatedWarning3=!1;const Ui=class{constructor(){this.mixBlend=j.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){const s=this.animationEnd-this.animationStart;return s==0?this.animationStart:this.trackTime%s+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(s){this.animationLast=s,this.nextAnimationLast=s}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return Ui.deprecatedWarning1||(Ui.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(s){Ui.deprecatedWarning1||(Ui.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=s}get endTime(){return Ui.deprecatedWarning2||(Ui.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(s){Ui.deprecatedWarning2||(Ui.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=s}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let ku=Ui;ku.deprecatedWarning1=!1,ku.deprecatedWarning2=!1;const Lu=class{constructor(s){this.objects=[],this.drainDisabled=!1,this.animState=s}start(s){this.objects.push(Ee.start),this.objects.push(s),this.animState.animationsChanged=!0}interrupt(s){this.objects.push(Ee.interrupt),this.objects.push(s)}end(s){this.objects.push(Ee.end),this.objects.push(s),this.animState.animationsChanged=!0}dispose(s){this.objects.push(Ee.dispose),this.objects.push(s)}complete(s){this.objects.push(Ee.complete),this.objects.push(s)}event(s,t){this.objects.push(Ee.event),this.objects.push(s),this.objects.push(t)}deprecateStuff(){return Lu.deprecatedWarning1||(Lu.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const s=this.objects,t=this.animState.listeners;for(let e=0;e<s.length;e+=2){const i=s[e],r=s[e+1];switch(i){case Ee.start:r.listener!=null&&r.listener.start&&r.listener.start(r);for(let o=0;o<t.length;o++)t[o].start&&t[o].start(r);r.onStart&&this.deprecateStuff()&&r.onStart(r.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(r.trackIndex);break;case Ee.interrupt:r.listener!=null&&r.listener.interrupt&&r.listener.interrupt(r);for(let o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(r);break;case Ee.end:r.listener!=null&&r.listener.end&&r.listener.end(r);for(let o=0;o<t.length;o++)t[o].end&&t[o].end(r);r.onEnd&&this.deprecateStuff()&&r.onEnd(r.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(r.trackIndex);case Ee.dispose:r.listener!=null&&r.listener.dispose&&r.listener.dispose(r);for(let o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(r);this.animState.trackEntryPool.free(r);break;case Ee.complete:r.listener!=null&&r.listener.complete&&r.listener.complete(r);for(let o=0;o<t.length;o++)t[o].complete&&t[o].complete(r);const n=L.toInt(r.loopsCount());r.onComplete&&this.deprecateStuff()&&r.onComplete(r.trackIndex,n),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(r.trackIndex,n);break;case Ee.event:const a=s[e+++2];r.listener!=null&&r.listener.event&&r.listener.event(r,a);for(let o=0;o<t.length;o++)t[o].event&&t[o].event(r,a);r.onEvent&&this.deprecateStuff()&&r.onEvent(r.trackIndex,a),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(r.trackIndex,a);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let t_=Lu;t_.deprecatedWarning1=!1;var Ee=(s=>(s[s.start=0]="start",s[s.interrupt=1]="interrupt",s[s.end=2]="end",s[s.dispose=3]="dispose",s[s.complete=4]="complete",s[s.event=5]="event",s))(Ee||{});const Nu=class{constructor(s){if(this.animationToMixTime={},this.defaultMix=0,s==null)throw new Error("skeletonData cannot be null.");this.skeletonData=s}setMix(s,t,e){const i=this.skeletonData.findAnimation(s);if(i==null)throw new Error(`Animation not found: ${s}`);const r=this.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);this.setMixWith(i,r,e)}setMixByName(s,t,e){Nu.deprecatedWarning1||(Nu.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(s,t,e)}setMixWith(s,t,e){if(s==null)throw new Error("from cannot be null.");if(t==null)throw new Error("to cannot be null.");const i=`${s.name}.${t.name}`;this.animationToMixTime[i]=e}getMix(s,t){const e=`${s.name}.${t.name}`,i=this.animationToMixTime[e];return i===void 0?this.defaultMix:i}};let e_=Nu;e_.deprecatedWarning1=!1;class i_{constructor(t,e,i){if(this.matrix=new gt,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,r,n,a,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=r,this.ascaleY=n,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;const h=this.parent,u=this.matrix,d=this.skeleton.scaleX,l=-this.skeleton.scaleY;if(h==null){const _=this.skeleton,g=i+90+o;u.a=L.cosDeg(i+a)*r*d,u.c=L.cosDeg(g)*n*d,u.b=L.sinDeg(i+a)*r*l,u.d=L.sinDeg(g)*n*l,u.tx=t*d+_.x,u.ty=e*l+_.y;return}let c=h.matrix.a,f=h.matrix.c,p=h.matrix.b,m=h.matrix.d;switch(u.tx=c*t+f*e+h.matrix.tx,u.ty=p*t+m*e+h.matrix.ty,this.data.transformMode){case se.Normal:{const _=i+90+o,g=L.cosDeg(i+a)*r,x=L.cosDeg(_)*n,y=L.sinDeg(i+a)*r,v=L.sinDeg(_)*n;u.a=c*g+f*y,u.c=c*x+f*v,u.b=p*g+m*y,u.d=p*x+m*v;return}case se.OnlyTranslation:{const _=i+90+o;u.a=L.cosDeg(i+a)*r,u.c=L.cosDeg(_)*n,u.b=L.sinDeg(i+a)*r,u.d=L.sinDeg(_)*n;break}case se.NoRotationOrReflection:{let _=c*c+p*p,g=0;_>1e-4?(_=Math.abs(c*m-f*p)/_,c/=this.skeleton.scaleX,p/=this.skeleton.scaleY,f=p*_,m=c*_,g=Math.atan2(p,c)*L.radDeg):(c=0,p=0,g=90-Math.atan2(m,f)*L.radDeg);const x=i+a-g,y=i+o-g+90,v=L.cosDeg(x)*r,b=L.cosDeg(y)*n,E=L.sinDeg(x)*r,w=L.sinDeg(y)*n;u.a=c*v-f*E,u.c=c*b-f*w,u.b=p*v+m*E,u.d=p*b+m*w;break}case se.NoScale:case se.NoScaleOrReflection:{const _=L.cosDeg(i),g=L.sinDeg(i);let x=(c*_+f*g)/d,y=(p*_+m*g)/l,v=Math.sqrt(x*x+y*y);v>1e-5&&(v=1/v),x*=v,y*=v,v=Math.sqrt(x*x+y*y),this.data.transformMode==se.NoScale&&c*m-f*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY>0)&&(v=-v);const b=Math.PI/2+Math.atan2(y,x),E=Math.cos(b)*v,w=Math.sin(b)*v,A=L.cosDeg(a)*r,T=L.cosDeg(90+o)*n,P=L.sinDeg(a)*r,k=L.sinDeg(90+o)*n;u.a=x*A+E*P,u.c=x*T+E*k,u.b=y*A+w*P,u.d=y*T+w*k;break}}u.a*=d,u.c*=d,u.b*=l,u.d*=l}setToSetupPose(){const t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*L.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*L.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(t==null){this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*L.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*L.radDeg;return}const i=t.matrix,r=1/(i.a*i.d-i.b*i.c),n=e.tx-i.tx,a=e.ty-i.ty;this.ax=n*i.d*r-a*i.c*r,this.ay=a*i.a*r-n*i.b*r;const o=r*i.d,h=r*i.a,u=r*i.c,d=r*i.b,l=o*e.a-u*e.b,c=o*e.c-u*e.d,f=h*e.b-d*e.a,p=h*e.d-d*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(l*l+f*f),this.ascaleX>1e-4){const m=l*p-c*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(l*c+f*p,m)*L.radDeg,this.arotation=Math.atan2(f,l)*L.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(c*c+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,c)*L.radDeg}worldToLocal(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=1/(i*a-r*n),h=t.x-e.tx,u=t.y-e.ty;return t.x=h*a*o-u*r*o,t.y=u*i*o-h*n*o,t}localToWorld(t){const e=this.matrix,i=t.x,r=t.y;return t.x=i*e.a+r*e.c+e.tx,t.y=i*e.b+r*e.d+e.ty,t}worldToLocalRotation(t){const e=L.sinDeg(t),i=L.cosDeg(t),r=this.matrix;return Math.atan2(r.a*e-r.b*i,r.d*i-r.c*e)*L.radDeg}localToWorldRotation(t){const e=L.sinDeg(t),i=L.cosDeg(t),r=this.matrix;return Math.atan2(i*r.b+e*r.d,i*r.a+e*r.c)*L.radDeg}rotateWorld(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=L.cosDeg(t),h=L.sinDeg(t);e.a=o*i-h*n,e.c=o*r-h*a,e.b=h*i+o*n,e.d=h*r+o*a,this.appliedValid=!1}}class uE{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix);break}}apply1(t,e,i,r,n,a,o){t.appliedValid||t.updateAppliedTransform();const h=t.parent.matrix,u=h.a;let d=h.c;const l=h.b;let c=h.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case se.OnlyTranslation:p=e-t.worldX,m=i-t.worldY;break;case se.NoRotationOrReflection:const x=Math.abs(u*c-d*l)/(u*u+l*l),y=u/t.skeleton.scaleX,v=l/t.skeleton.scaleY;d=-v*x*t.skeleton.scaleX,c=y*x*t.skeleton.scaleY,f+=Math.atan2(v,y)*L.radDeg;default:const b=e-h.tx,E=i-h.ty,w=u*c-d*l;p=(b*c-E*d)/w-t.ax,m=(E*u-b*l)/w-t.ay}f+=Math.atan2(m,p)*L.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let _=t.ascaleX,g=t.ascaleY;if(r||n){switch(t.data.transformMode){case se.NoScale:case se.NoScaleOrReflection:p=e-t.worldX,m=i-t.worldY}const x=t.data.length*_,y=Math.sqrt(p*p+m*m);if(r&&y<x||n&&y>x&&x>1e-4){const v=(y/x-1)*o+1;_*=v,a&&(g*=v)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,_,g,t.ashearX,t.ashearY)}apply2(t,e,i,r,n,a,o,h){if(h==0){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const u=t.ax,d=t.ay;let l=t.ascaleX,c=l,f=t.ascaleY,p=e.ascaleX;const m=t.matrix;let _=0,g=0,x=0;l<0?(l=-l,_=180,x=-1):(_=0,x=1),f<0&&(f=-f,x=-x),p<0?(p=-p,g=180):g=0;const y=e.ax;let v=0,b=0,E=0,w=m.a,A=m.c,T=m.b,P=m.d;const k=Math.abs(l-f)<=1e-4;k?(v=e.ay,b=w*y+A*v+m.tx,E=T*y+P*v+m.ty):(v=0,b=w*y+m.tx,E=T*y+m.ty);const R=t.parent.matrix;w=R.a,A=R.c,T=R.b,P=R.d;const S=1/(w*P-A*T);let C=b-R.tx,I=E-R.ty;const N=(C*P-I*A)*S-u,F=(I*w-C*T)*S-d,B=Math.sqrt(N*N+F*F);let X=e.data.length*p,M,D;if(B<1e-4){this.apply1(t,i,r,!1,a,!1,h),e.updateWorldTransformWith(y,v,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-R.tx,I=r-R.ty;let $=(C*P-I*A)*S-u,Y=(I*w-C*T)*S-d,U=$*$+Y*Y;if(o!=0){o*=l*(p+1)/2;const lt=Math.sqrt(U),vt=lt-B-X*l+o;if(vt>0){let Dt=Math.min(1,vt/(o*2))-1;Dt=(vt-o*(1-Dt*Dt))/lt,$-=Dt*$,Y-=Dt*Y,U=$*$+Y*Y}}t:if(k){X*=l;let lt=(U-B*B-X*X)/(2*B*X);lt<-1?lt=-1:lt>1&&(lt=1,a&&(c*=(Math.sqrt(U)/(B+X)-1)*h+1)),D=Math.acos(lt)*n,w=B+X*lt,A=X*Math.sin(D),M=Math.atan2(Y*w-$*A,$*w+Y*A)}else{w=l*X,A=f*X;const lt=w*w,vt=A*A,Dt=Math.atan2(Y,$);T=vt*B*B+lt*U-lt*vt;const Lt=-2*vt*B,_t=vt-lt;if(P=Lt*Lt-4*_t*T,P>=0){let Br=Math.sqrt(P);Lt<0&&(Br=-Br),Br=-(Lt+Br)/2;const y_=Br/_t,x_=T/Br,Or=Math.abs(y_)<Math.abs(x_)?y_:x_;if(Or*Or<=U){I=Math.sqrt(U-Or*Or)*n,M=Dt-Math.atan2(I,Or),D=Math.atan2(I/f,(Or-B)/l);break t}}let Bt=L.PI,wt=B-w,me=wt*wt,Ae=0,ds=0,Dr=B+w,fs=Dr*Dr,g_=0;T=-w*B/(lt-vt),T>=-1&&T<=1&&(T=Math.acos(T),C=w*Math.cos(T)+B,I=A*Math.sin(T),P=C*C+I*I,P<me&&(Bt=T,me=P,wt=C,Ae=I),P>fs&&(ds=T,fs=P,Dr=C,g_=I)),U<=(me+fs)/2?(M=Dt-Math.atan2(Ae*n,wt),D=Bt*n):(M=Dt-Math.atan2(g_*n,Dr),D=ds*n)}const rt=Math.atan2(v,y)*x;let ft=t.arotation;M=(M-rt)*L.radDeg+_-ft,M>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(u,d,ft+M*h,c,t.ascaleY,0,0),ft=e.arotation,D=((D+rt)*L.radDeg-e.ashearX)*x+g-ft,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(y,v,ft+D*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}var Rr=(s=>(s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s))(Rr||{});const Ws=class{constructor(s,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,s==null)throw new Error("data cannot be null.");if(t==null)throw new Error("skeleton cannot be null.");this.data=s,this.bones=new Array;for(let e=0,i=s.bones.length;e<i;e++)this.bones.push(t.findBone(s.bones[e].name));this.target=t.findSlot(s.target.name),this.position=s.position,this.spacing=s.spacing,this.rotateMix=s.rotateMix,this.translateMix=s.translateMix}isActive(){return this.active}apply(){this.update()}update(){const s=this.target.getAttachment();if(!(s instanceof An))return;const t=this.rotateMix,e=this.translateMix,i=e>0,r=t>0;if(!i&&!r)return;const n=this.data,a=n.spacingMode,o=a==Rr.Length,h=n.rotateMode,u=h==Vs.Tangent,d=h==Vs.ChainScale,l=this.bones.length,c=u?l:l+1,f=this.bones,p=Q.setArraySize(this.spaces,c);let m=null;const _=this.spacing;if(d||o){d&&(m=Q.setArraySize(this.lengths,l));for(let E=0,w=c-1;E<w;){const A=f[E],T=A.data.length;if(T<Ws.epsilon)d&&(m[E]=0),p[++E]=0;else{const P=T*A.matrix.a,k=T*A.matrix.b,R=Math.sqrt(P*P+k*k);d&&(m[E]=R),p[++E]=(o?T+_:_)*R/T}}}else for(let E=1;E<c;E++)p[E]=_;const g=this.computeWorldPositions(s,c,u,n.positionMode==co.Percent,a==Rr.Percent);let x=g[0],y=g[1],v=n.offsetRotation,b=!1;if(v==0)b=h==Vs.Chain;else{b=!1;const E=this.target.bone.matrix;v*=E.a*E.d-E.b*E.c>0?L.degRad:-L.degRad}for(let E=0,w=3;E<l;E++,w+=3){const A=f[E],T=A.matrix;T.tx+=(x-T.tx)*e,T.ty+=(y-T.ty)*e;const P=g[w],k=g[w+1],R=P-x,S=k-y;if(d){const C=m[E];if(C!=0){const I=(Math.sqrt(R*R+S*S)/C-1)*t+1;T.a*=I,T.b*=I}}if(x=P,y=k,r){const C=T.a,I=T.c,N=T.b,F=T.d;let B=0,X=0,M=0;if(u&&(u?B=g[w-1]:p[E+1]==0?B=g[w+2]:B=Math.atan2(S,R)),B-=Math.atan2(N,C),b){X=Math.cos(B),M=Math.sin(B);const D=A.data.length;x+=(D*(X*C-M*N)-R)*t,y+=(D*(M*C+X*N)-S)*t}else B+=v;B>L.PI?B-=L.PI2:B<-L.PI&&(B+=L.PI2),B*=t,X=Math.cos(B),M=Math.sin(B),T.a=X*C-M*N,T.c=X*I-M*F,T.b=M*C+X*N,T.d=M*I+X*F}A.appliedValid=!1}}computeWorldPositions(s,t,e,i,r){const n=this.target;let a=this.position;const o=this.spaces,h=Q.setArraySize(this.positions,t*3+2);let u=null;const d=s.closed;let l=s.worldVerticesLength,c=l/6,f=Ws.NONE;if(!s.constantSpeed){const B=s.lengths;c-=d?1:2;const X=B[c];if(i&&(a*=X),r)for(let M=0;M<t;M++)o[M]*=X;u=Q.setArraySize(this.world,8);for(let M=0,D=0,$=0;M<t;M++,D+=3){const Y=o[M];a+=Y;let U=a;if(d)U%=X,U<0&&(U+=X),$=0;else if(U<0){f!=Ws.BEFORE&&(f=Ws.BEFORE,s.computeWorldVertices(n,2,4,u,0,2)),this.addBeforePosition(U,u,0,h,D);continue}else if(U>X){f!=Ws.AFTER&&(f=Ws.AFTER,s.computeWorldVertices(n,l-6,4,u,0,2)),this.addAfterPosition(U-X,u,0,h,D);continue}for(;;$++){const rt=B[$];if(!(U>rt)){if($==0)U/=rt;else{const ft=B[$-1];U=(U-ft)/(rt-ft)}break}}$!=f&&(f=$,d&&$==c?(s.computeWorldVertices(n,l-4,4,u,0,2),s.computeWorldVertices(n,0,4,u,4,2)):s.computeWorldVertices(n,$*6+2,8,u,0,2)),this.addCurvePosition(U,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],h,D,e||M>0&&Y==0)}return h}d?(l+=2,u=Q.setArraySize(this.world,l),s.computeWorldVertices(n,2,l-4,u,0,2),s.computeWorldVertices(n,0,2,u,l-4,2),u[l-2]=u[0],u[l-1]=u[1]):(c--,l-=4,u=Q.setArraySize(this.world,l),s.computeWorldVertices(n,2,l,u,0,2));const p=Q.setArraySize(this.curves,c);let m=0,_=u[0],g=u[1],x=0,y=0,v=0,b=0,E=0,w=0,A=0,T=0,P=0,k=0,R=0,S=0,C=0,I=0;for(let B=0,X=2;B<c;B++,X+=6)x=u[X],y=u[X+1],v=u[X+2],b=u[X+3],E=u[X+4],w=u[X+5],A=(_-x*2+v)*.1875,T=(g-y*2+b)*.1875,P=((x-v)*3-_+E)*.09375,k=((y-b)*3-g+w)*.09375,R=A*2+P,S=T*2+k,C=(x-_)*.75+A+P*.16666667,I=(y-g)*.75+T+k*.16666667,m+=Math.sqrt(C*C+I*I),C+=R,I+=S,R+=P,S+=k,m+=Math.sqrt(C*C+I*I),C+=R,I+=S,m+=Math.sqrt(C*C+I*I),C+=R+P,I+=S+k,m+=Math.sqrt(C*C+I*I),p[B]=m,_=E,g=w;if(i&&(a*=m),r)for(let B=0;B<t;B++)o[B]*=m;const N=this.segments;let F=0;for(let B=0,X=0,M=0,D=0;B<t;B++,X+=3){const $=o[B];a+=$;let Y=a;if(d)Y%=m,Y<0&&(Y+=m),M=0;else if(Y<0){this.addBeforePosition(Y,u,0,h,X);continue}else if(Y>m){this.addAfterPosition(Y-m,u,l-4,h,X);continue}for(;;M++){const U=p[M];if(!(Y>U)){if(M==0)Y/=U;else{const rt=p[M-1];Y=(Y-rt)/(U-rt)}break}}if(M!=f){f=M;let U=M*6;for(_=u[U],g=u[U+1],x=u[U+2],y=u[U+3],v=u[U+4],b=u[U+5],E=u[U+6],w=u[U+7],A=(_-x*2+v)*.03,T=(g-y*2+b)*.03,P=((x-v)*3-_+E)*.006,k=((y-b)*3-g+w)*.006,R=A*2+P,S=T*2+k,C=(x-_)*.3+A+P*.16666667,I=(y-g)*.3+T+k*.16666667,F=Math.sqrt(C*C+I*I),N[0]=F,U=1;U<8;U++)C+=R,I+=S,R+=P,S+=k,F+=Math.sqrt(C*C+I*I),N[U]=F;C+=R,I+=S,F+=Math.sqrt(C*C+I*I),N[8]=F,C+=R+P,I+=S+k,F+=Math.sqrt(C*C+I*I),N[9]=F,D=0}for(Y*=F;;D++){const U=N[D];if(!(Y>U)){if(D==0)Y/=U;else{const rt=N[D-1];Y=D+(Y-rt)/(U-rt)}break}}this.addCurvePosition(Y*.1,_,g,x,y,v,b,E,w,h,X,e||B>0&&$==0)}return h}addBeforePosition(s,t,e,i,r){const n=t[e],a=t[e+1],o=t[e+2]-n,h=t[e+3]-a,u=Math.atan2(h,o);i[r]=n+s*Math.cos(u),i[r+1]=a+s*Math.sin(u),i[r+2]=u}addAfterPosition(s,t,e,i,r){const n=t[e+2],a=t[e+3],o=n-t[e],h=a-t[e+1],u=Math.atan2(h,o);i[r]=n+s*Math.cos(u),i[r+1]=a+s*Math.sin(u),i[r+2]=u}addCurvePosition(s,t,e,i,r,n,a,o,h,u,d,l){(s==0||isNaN(s))&&(s=1e-4);const c=s*s,f=c*s,p=1-s,m=p*p,_=m*p,g=p*s,x=g*3,y=p*x,v=x*s,b=t*_+i*y+n*v+o*f,E=e*_+r*y+a*v+h*f;u[d]=b,u[d+1]=E,l&&(u[d+2]=Math.atan2(E-(e*m+r*g*2+a*c),b-(t*m+i*g*2+n*c)))}};let Sn=Ws;Sn.NONE=-1,Sn.BEFORE=-2,Sn.AFTER=-3,Sn.epsilon=1e-5;class cE{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new nE,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,u=a.b,d=a.d,l=o*d-h*u>0?L.degRad:-L.degRad,c=this.data.offsetRotation*l,f=this.data.offsetShearY*l,p=this.bones;for(let m=0,_=p.length;m<_;m++){const g=p[m];let x=!1;const y=g.matrix;if(t!=0){const v=y.a,b=y.c,E=y.b,w=y.d;let A=Math.atan2(u,o)-Math.atan2(E,v)+c;A>L.PI?A-=L.PI2:A<-L.PI&&(A+=L.PI2),A*=t;const T=Math.cos(A),P=Math.sin(A);y.a=T*v-P*E,y.c=T*b-P*w,y.b=P*v+T*E,y.d=P*b+T*w,x=!0}if(e!=0){const v=this.temp;n.localToWorld(v.set(this.data.offsetX,this.data.offsetY)),y.tx+=(v.x-y.tx)*e,y.ty+=(v.y-y.ty)*e,x=!0}if(i>0){let v=Math.sqrt(y.a*y.a+y.b*y.b),b=Math.sqrt(o*o+u*u);v>1e-5&&(v=(v+(b-v+this.data.offsetScaleX)*i)/v),y.a*=v,y.b*=v,v=Math.sqrt(y.c*y.c+y.d*y.d),b=Math.sqrt(h*h+d*d),v>1e-5&&(v=(v+(b-v+this.data.offsetScaleY)*i)/v),y.c*=v,y.d*=v,x=!0}if(r>0){const v=y.c,b=y.d,E=Math.atan2(b,v);let w=Math.atan2(d,h)-Math.atan2(u,o)-(E-Math.atan2(y.b,y.a));w>L.PI?w-=L.PI2:w<-L.PI&&(w+=L.PI2),w=E+(w+f)*r;const A=Math.sqrt(v*v+b*b);y.c=Math.cos(w)*A,y.d=Math.sin(w)*A,x=!0}x&&(g.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,u=a.b,d=a.d,l=o*d-h*u>0?L.degRad:-L.degRad,c=this.data.offsetRotation*l,f=this.data.offsetShearY*l,p=this.bones;for(let m=0,_=p.length;m<_;m++){const g=p[m];let x=!1;const y=g.matrix;if(t!=0){const v=y.a,b=y.c,E=y.b,w=y.d;let A=Math.atan2(u,o)+c;A>L.PI?A-=L.PI2:A<-L.PI&&(A+=L.PI2),A*=t;const T=Math.cos(A),P=Math.sin(A);y.a=T*v-P*E,y.c=T*b-P*w,y.b=P*v+T*E,y.d=P*b+T*w,x=!0}if(e!=0){const v=this.temp;n.localToWorld(v.set(this.data.offsetX,this.data.offsetY)),y.tx+=v.x*e,y.ty+=v.y*e,x=!0}if(i>0){let v=(Math.sqrt(o*o+u*u)-1+this.data.offsetScaleX)*i+1;y.a*=v,y.b*=v,v=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*i+1,y.c*=v,y.d*=v,x=!0}if(r>0){let v=Math.atan2(d,h)-Math.atan2(u,o);v>L.PI?v-=L.PI2:v<-L.PI&&(v+=L.PI2);const b=y.c,E=y.d;v=Math.atan2(E,b)+(v-L.PI/2+f)*r;const w=Math.sqrt(b*b+E*E);y.c=Math.cos(v)*w,y.d=Math.sin(v)*w,x=!0}x&&(g.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const u=a[o];u.appliedValid||u.updateAppliedTransform();let d=u.arotation;if(t!=0){let _=n.arotation-d+this.data.offsetRotation;_-=(16384-(16384.499999999996-_/360|0))*360,d+=_*t}let l=u.ax,c=u.ay;e!=0&&(l+=(n.ax-l+this.data.offsetX)*e,c+=(n.ay-c+this.data.offsetY)*e);let f=u.ascaleX,p=u.ascaleY;i>0&&(f>1e-5&&(f=(f+(n.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(n.ascaleY-p+this.data.offsetScaleY)*i)/p));const m=u.ashearY;if(r>0){let _=n.ashearY-m+this.data.offsetShearY;_-=(16384-(16384.499999999996-_/360|0))*360,u.shearY+=_*r}u.updateWorldTransformWith(l,c,d,f,p,u.ashearX,m)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const u=a[o];u.appliedValid||u.updateAppliedTransform();let d=u.arotation;t!=0&&(d+=(n.arotation+this.data.offsetRotation)*t);let l=u.ax,c=u.ay;e!=0&&(l+=(n.ax+this.data.offsetX)*e,c+=(n.ay+this.data.offsetY)*e);let f=u.ascaleX,p=u.ascaleY;i>0&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*i+1),p>1e-5&&(p*=(n.ascaleY-1+this.data.offsetScaleY)*i+1));let m=u.ashearY;r>0&&(m+=(n.ashearY+this.data.offsetShearY)*r),u.updateWorldTransformWith(l,c,d,f,p,u.ashearX,m)}}}const Cn=class{constructor(s){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,s==null)throw new Error("data cannot be null.");this.data=s,this.bones=new Array;for(let t=0;t<s.bones.length;t++){const e=s.bones[t];let i;if(e.parent==null)i=new i_(e,this,null);else{const r=this.bones[e.parent.index];i=new i_(e,this,r),r.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<s.slots.length;t++){const e=s.slots[t],i=this.bones[e.boneData.index],r=new Jm(e,i);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let t=0;t<s.ikConstraints.length;t++){const e=s.ikConstraints[t];this.ikConstraints.push(new uE(e,this))}this.transformConstraints=new Array;for(let t=0;t<s.transformConstraints.length;t++){const e=s.transformConstraints[t];this.transformConstraints.push(new cE(e,this))}this.pathConstraints=new Array;for(let t=0;t<s.pathConstraints.length;t++){const e=s.pathConstraints[t];this.pathConstraints.push(new Sn(e,this))}this.color=new we(1,1,1,1),this.updateCache()}updateCache(){const s=this._updateCache;s.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let u=0,d=t.length;u<d;u++){const l=t[u];l.sorted=l.data.skinRequired,l.active=!l.sorted}if(this.skin!=null){const u=this.skin.bones;for(let d=0,l=this.skin.bones.length;d<l;d++){let c=this.bones[u[d].index];do c.sorted=!1,c.active=!0,c=c.parent;while(c!=null)}}const e=this.ikConstraints,i=this.transformConstraints,r=this.pathConstraints,n=e.length,a=i.length,o=r.length,h=n+a+o;t:for(let u=0;u<h;u++){for(let d=0;d<n;d++){const l=e[d];if(l.data.order==u){this.sortIkConstraint(l);continue t}}for(let d=0;d<a;d++){const l=i[d];if(l.data.order==u){this.sortTransformConstraint(l);continue t}}for(let d=0;d<o;d++){const l=r[d];if(l.data.order==u){this.sortPathConstraint(l);continue t}}}for(let u=0,d=t.length;u<d;u++)this.sortBone(t[u])}sortIkConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target;this.sortBone(t);const e=s.bones,i=e[0];if(this.sortBone(i),e.length>1){const r=e[e.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(s),this.sortReset(i.children),e[e.length-1].sorted=!0}sortPathConstraint(s){if(s.active=s.target.bone.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target,e=t.data.index,i=t.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,e,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,i);for(let o=0,h=this.data.skins.length;o<h;o++)this.sortPathConstraintAttachment(this.data.skins[o],e,i);const r=t.getAttachment();r instanceof An&&this.sortPathConstraintAttachmentWith(r,i);const n=s.bones,a=n.length;for(let o=0;o<a;o++)this.sortBone(n[o]);this._updateCache.push(s);for(let o=0;o<a;o++)this.sortReset(n[o].children);for(let o=0;o<a;o++)n[o].sorted=!0}sortTransformConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;this.sortBone(s.target);const t=s.bones,e=t.length;if(s.data.local)for(let i=0;i<e;i++){const r=t[i];this.sortBone(r.parent),this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}else for(let i=0;i<e;i++)this.sortBone(t[i]);this._updateCache.push(s);for(let i=0;i<e;i++)this.sortReset(t[i].children);for(let i=0;i<e;i++)t[i].sorted=!0}sortPathConstraintAttachment(s,t,e){const i=s.attachments[t];if(i)for(const r in i)this.sortPathConstraintAttachmentWith(i[r],e)}sortPathConstraintAttachmentWith(s,t){if(!(s instanceof An))return;const e=s.bones;if(e==null)this.sortBone(t);else{const i=this.bones;let r=0;for(;r<e.length;){const n=e[r++];for(let a=r+n;r<a;r++){const o=e[r];this.sortBone(i[o])}}}}sortBone(s){if(s.sorted)return;const t=s.parent;t!=null&&this.sortBone(t),s.sorted=!0,this._updateCache.push(s)}sortReset(s){for(let t=0,e=s.length;t<e;t++){const i=s[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){const s=this.updateCacheReset;for(let e=0,i=s.length;e<i;e++){const r=s[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}const t=this._updateCache;for(let e=0,i=t.length;e<i;e++)t[e].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const s=this.bones;for(let r=0,n=s.length;r<n;r++)s[r].setToSetupPose();const t=this.ikConstraints;for(let r=0,n=t.length;r<n;r++){const a=t[r];a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}const e=this.transformConstraints;for(let r=0,n=e.length;r<n;r++){const a=e[r],o=a.data;a.rotateMix=o.rotateMix,a.translateMix=o.translateMix,a.scaleMix=o.scaleMix,a.shearMix=o.shearMix}const i=this.pathConstraints;for(let r=0,n=i.length;r<n;r++){const a=i[r],o=a.data;a.position=o.position,a.spacing=o.spacing,a.rotateMix=o.rotateMix,a.translateMix=o.translateMix}}setSlotsToSetupPose(){const s=this.slots;Q.arrayCopy(s,0,this.drawOrder,0,s.length);for(let t=0,e=s.length;t<e;t++)s[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findBoneIndex(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}findSlot(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findSlotIndex(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}setSkinByName(s){const t=this.data.findSkin(s);if(t==null)throw new Error(`Skin not found: ${s}`);this.setSkin(t)}setSkin(s){if(s!=this.skin){if(s!=null)if(this.skin!=null)s.attachAll(this,this.skin);else{const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e],n=r.data.attachmentName;if(n!=null){const a=s.getAttachment(e,n);a!=null&&r.setAttachment(a)}}}this.skin=s,this.updateCache()}}getAttachmentByName(s,t){return this.getAttachment(this.data.findSlotIndex(s),t)}getAttachment(s,t){if(t==null)throw new Error("attachmentName cannot be null.");if(this.skin!=null){const e=this.skin.getAttachment(s,t);if(e!=null)return e}return this.data.defaultSkin!=null?this.data.defaultSkin.getAttachment(s,t):null}setAttachment(s,t){if(s==null)throw new Error("slotName cannot be null.");const e=this.slots;for(let i=0,r=e.length;i<r;i++){const n=e[i];if(n.data.name==s){let a=null;if(t!=null&&(a=this.getAttachment(i,t),a==null))throw new Error(`Attachment not found: ${t}, for slot: ${s}`);n.setAttachment(a);return}}throw new Error(`Slot not found: ${s}`)}findIkConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findTransformConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findPathConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}getBounds(s,t,e=new Array(2)){if(s==null)throw new Error("offset cannot be null.");if(t==null)throw new Error("size cannot be null.");const i=this.drawOrder;let r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let h=0,u=i.length;h<u;h++){const d=i[h];if(!d.bone.active)continue;let l=0,c=null;const f=d.getAttachment();if(f instanceof et)l=8,c=Q.setArraySize(e,l,0),f.computeWorldVertices(d.bone,c,0,2);else if(f instanceof fo){const p=f;l=p.worldVerticesLength,c=Q.setArraySize(e,l,0),p.computeWorldVertices(d,0,l,c,0,2)}if(c!=null)for(let p=0,m=c.length;p<m;p+=2){const _=c[p],g=c[p+1];r=Math.min(r,_),n=Math.min(n,g),a=Math.max(a,_),o=Math.max(o,g)}}s.set(r,n),t.set(a-r,o-n)}update(s){this.time+=s}get flipX(){return this.scaleX==-1}set flipX(s){Cn.deprecatedWarning1||(Cn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=s?1:-1}get flipY(){return this.scaleY==-1}set flipY(s){Cn.deprecatedWarning1||(Cn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=s?1:-1}};let s_=Cn;s_.deprecatedWarning1=!1,se.Normal,se.OnlyTranslation,se.NoRotationOrReflection,se.NoScale,se.NoScaleOrReflection,co.Fixed,co.Percent,Rr.Length,Rr.Fixed,Rr.Percent,Vs.Tangent,Vs.Chain,Vs.ChainScale,K.NORMAL,K.ADD,K.MULTIPLY,K.SCREEN;class dE extends Bu{createSkeleton(t){this.skeleton=new s_(t),this.skeleton.updateWorldTransform(),this.stateData=new e_(t),this.state=new Ne(this.stateData)}}class fE extends dE{constructor(t,e){const{followPointList:i,visible:r=!1}=e||{};let n;typeof t=="string"?n=Zi.get(t).spineData:n=t.spineData,super(n),this._followDots=[],this._isStart=!1,this.visible=r,this.autoUpdate=!1,i!=null&&i.length&&(i==null||i.forEach(a=>{a.follow.alpha=0,this._followDots.push({point:this.skeleton.findBone(a.boneName),follow:a.follow,onUpdate:a.onUpdate,angleFollow:a.angleFollow||!1,scaleFollow:a.scaleFollow||!0})})),this._loopFn=this._loop.bind(this),ct.system.add(this._loopFn)}setAnimation(t="animation",e=!1){return new Promise(i=>{this.visible=!0,this.state.setAnimation(0,t,e).listener={complete:()=>{i()}}})}addAnimation(t="animation",e=!1,i=0){return new Promise(r=>{this.visible=!0,this.state.addAnimation(0,t,e,i).listener={complete:()=>{r()}}})}setSkin(t){this.skeleton.setSkinByName(t)}destroyAll(){ct.system.remove(this._loopFn),this.destroy({children:!0})}_loop(){if(this.destroyed){ct.system.remove(this._loopFn);return}this.update(ct.system.deltaMS/1e3),this._updateFollowPoint()}_updateFollowPoint(){this._followDots.length!==0&&(this._followDots.forEach(t=>{const{worldX:e,worldY:i}=t.point,r=t.point.getWorldRotationX()*(Math.PI/180),n=t.point.getWorldScaleX(),a=t.point.getWorldScaleY();t.onUpdate?t.onUpdate({x:e,y:i,rotate:r,scaleX:n,scaleY:a}):(t.angleFollow&&(t.follow.rotation=r),t.scaleFollow&&t.follow.scale.set(n,a),t.follow.position.set(e+1920/2-t.follow.width/2,i+1080/2-t.follow.height/2))}),this._isStart||(this._isStart=!0,this._followDots.forEach(t=>{ut.to(t.follow,{alpha:1,duration:.25,delay:.15})})))}}const Gi=(s,t,e,i=!1)=>{s.cursor="pointer",s.eventMode="static";const r=n=>{n.button!==2&&e(n)};i?s.once(t,r):s.on(t,r)};class pE extends bt{constructor(t){super(),this.disabled=!1;const{texture:e,hoverTexture:i,tintColor:r,hoverTintColor:n="#fff",disabledColor:a="#999"}=t;this._texture=e,this._hoverTexture=i,this._tintColor=r,this._disabledColor=a,this._btn=new _e(e),this.addChild(this._btn),this._btn.anchor.set(.5),r&&(this._btn.tint=r),Gi(this._btn,"pointerenter",()=>{this.disabled||(this._btn.tint=n,this._hoverTexture&&(this._btn._texture=this._hoverTexture))}),Gi(this._btn,"pointerleave",()=>{this.disabled||(this._btn._texture=this._texture,r&&(this._btn.tint=r))})}toggleTexture(t,e){this._texture=t,this._hoverTexture=e,this._btn._texture=e}setDisabled(t){this.disabled=t,this._btn.tint=t?this._disabledColor:this._tintColor||"#fff",this._btn.texture=this._texture}}class mE extends Tn{constructor(t){const{sprite:e,onClick:i}=t;super(e.width,e.height),this.addChild(e),e.anchor.set(.5),e.x=e.width/2,e.y=e.height/2,Gi(this,"pointerenter",()=>{ut.to(e,{duration:.25,rotation:180*(Math.PI/180)})}),Gi(this,"pointerleave",()=>{e.alpha=1,ut.to(e,{duration:.25,rotation:0})}),Gi(this,"pointerdown",()=>{e.alpha=.5}),Gi(this,"pointerup",()=>{i()})}}class _E extends bt{constructor(t){super(),this._maskUI=new au({bgColor:"#000",width:1080,height:1920}),this.addChild(this._maskUI),this._maskUI.alpha=0,this._maskUI.eventMode="static",this._drawerContainer=t,this.addChild(this._drawerContainer),this._drawerContainer.y=this._maskUI.height,ut.to(this._maskUI,{duration:.25,alpha:.5}),ut.to(this._drawerContainer,{duration:.25,ease:"power1.out",y:this._maskUI.height-this._drawerContainer.height})}async close(){ut.to(this._drawerContainer,{duration:.25,y:this._maskUI.height}),await ut.to(this._maskUI,{duration:.25,delay:.125,alpha:0})}}class gE extends bt{constructor(t){super(),this.COLLECT_TIME=5*1e3,this._nowTime=0,this._lastTime=0,this._drawCount=0,this._maxDrawCount=0,this._tempMaxDrawCount=0,this._lastCollectTime=0,this._paramTxts=[];for(let e=0;e<3;e++){const i=new Du({text:"",fontWeight:"bold",fontSize:36,shadow:["#000",45,3,5],fontColor:"#fff"});this._paramTxts[e]=i,i.x=0,i.y=i.height*e,this.addChild(i),i.alpha=.75}this._renderer=t.renderer,this._drawElements=this._renderer.gl.drawElements,this.init()}init(){this._renderer.gl.drawElements=(...t)=>{this._drawElements.call(this._renderer.gl,...t),this._drawCount++},ct.shared.add(()=>{const t=ct.system.FPS;this._nowTime=performance.now(),this._nowTime-this._lastTime>=100&&(this._setTxtInfo(0,Math.floor(t).toFixed(0)),this._lastTime=this._nowTime),this._nowTime-this._lastCollectTime<this.COLLECT_TIME?this._tempMaxDrawCount<this._drawCount&&(this._tempMaxDrawCount=this._drawCount):(this._maxDrawCount=this._tempMaxDrawCount,this._tempMaxDrawCount=0,this._lastCollectTime=this._nowTime),this._setTxtInfo(1,this._drawCount),this._setTxtInfo(2,this._maxDrawCount),this._drawCount=0},ji.UTILITY)}_setTxtInfo(t,e){const i=a=>{this._paramTxts[t].style.fill="#fff",a<=30&&(this._paramTxts[t].style.fill="yellow"),a<=20&&(this._paramTxts[t].style.fill="red")},r=a=>{this._paramTxts[t].style.fill="#fff",a>=75&&(this._paramTxts[t].style.fill="yellow"),a>=100&&(this._paramTxts[t].style.fill="red")},n=[()=>(i(e),`Fps:${e}`),()=>(r(e),`Draw Call:${e}`),()=>(r(e),`Max Draw Call:${e}`)];this._paramTxts[t].text=n[t]()}}class yE extends bt{constructor(t){super();const{bgWidth:e,bgHeight:i,barWidth:r,barHeight:n,bgTexture:a,barTexture:o}=t,h=new _e(a);this.addChild(h),this._progressBar=new _e(o),this.addChild(this._progressBar),this._progressBar.x=(e-r)/2,this._progressBar.y=(i-n)/2;const u=new ui;u.beginFill(16777215),u.drawRect(0,0,0,this._progressBar.height),u.endFill(),this._progressBar.addChild(u),this._progressBar.mask=u,this._maskGraphics=u}setProgress(t){const e=Math.max(0,Math.min(1,t));this._maskGraphics.clear(),this._maskGraphics.beginFill(16777215),this._maskGraphics.drawRect(0,0,this._progressBar.width*e,this._progressBar.height),this._maskGraphics.endFill()}}class xE extends Tn{constructor(t){const{width:e,height:i,scrollContent:r,bottomMargin:n=50}=t;if(super(e,i),this._startY=0,this._velocity=0,this._startTime=0,this._startPosition=0,this._scrollSpeed=200,this._isDragging=!1,this._scrollContent=r,this._content=new bt,this.addChild(this._content),this._content.addChild(this._scrollContent),n>0){const a=new _e;this._content.addChild(a),a.y=this._content.height+n}this._maskGraphics=new ui,this.addChild(this._maskGraphics),this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,e,i),this._maskGraphics.endFill(),this.mask=this._maskGraphics,this.eventMode="static",this.on("pointerdown",this._onDragStart,this),this.on("pointermove",this._onDragMove,this),this.on("pointerup",this._onDragEnd,this),this.on("pointerupoutside",this._onDragEnd,this),this.on("wheel",this._onWheelScroll,this)}setDimensions(t,e){this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,t,e),this._maskGraphics.endFill(),this.setSize(t,e)}scrollToTop(){ut.killTweensOf(this._content),this._content.y=0}addContent(t){this._scrollContent.addChild(t)}_onDragStart(t){if(this._content.height<=this._maskGraphics.height)return;const e=t.getLocalPosition(this);this._startY=e.y-this._content.y,this._isDragging=!0,this._velocity=0,this._startTime=Date.now(),this._startPosition=this._content.y,ut.killTweensOf(this._content)}_onDragMove(t){if(this._isDragging){const i=t.getLocalPosition(this).y-this._startY;this._content.y=i}}_onDragEnd(){this._isDragging=!1;const e=Date.now()-this._startTime;e<250?(this._velocity=(this._content.y-this._startPosition)/e,this._applyInertia()):this._velocity=0,this._limitScrollRange()}_onWheelScroll(t){if(this._content.height<=this._maskGraphics.height)return;let e=this._content.y-t.deltaY*(this._scrollSpeed/100);e>0?e=0:Math.abs(e)>=this._content.height-this._maskGraphics.height&&(e=-(this._content.height-this._maskGraphics.height)),ut.to(this._content,{duration:.25,ease:"power1.out",y:e})}_applyInertia(){ut.to(this._content,{y:this._content.y+this._velocity*250,duration:.5,ease:"power1.out",onUpdate:this._limitScrollRange.bind(this)})}_limitScrollRange(){if(this._content.y>0)ut.to(this._content,{duration:.75,y:0,ease:"elastic.out"});else if(Math.abs(this._content.y)>=this._content.height-this._maskGraphics.height)if(this._content.height>this._maskGraphics.height){const t=-(this._content.height-this._maskGraphics.height);ut.to(this._content,{duration:.75,y:t,ease:"elastic.out"})}else ut.to(this._content,{duration:.25,y:0})}}class vE extends Tn{constructor(t){const{width:e,height:i,content:r,slideCallback:n,scrollCallback:a,pageNum:o,pageHeight:h}=t;super(e,i),this._currentIndex=0,this._scrollHeight=0,this._slideHeight=0,this._startY=0,this._offsetY=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1;const u=new ui;u.beginFill(16777215),u.drawRect(0,0,this.width,this.height),u.endFill(),this.addChild(u),this.mask=u,this._scrollHeight=i,this._slideHeight=h,this._slideArea=r,this._slideCallback=n,this._scrollCallback=a,this._pageNum=o-1,this.addChild(this._slideArea),this._slideArea.x=e/2,this._slideArea.y=this._scrollHeight/2,this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}updatePosition(t,e){this._slideArea.y=t,this._currentIndex=e}slideTo(t,e=!0){var i;t<0?(ut.to(this._slideArea,{y:this._scrollHeight/2,duration:.25,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=0):t>this._pageNum?(ut.to(this._slideArea,{y:-this._pageNum*this._slideHeight+this._scrollHeight/2,duration:.5,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=this._pageNum):(this._currentIndex=t,ut.to(this._slideArea,{y:-this._currentIndex*this._slideHeight+this._scrollHeight/2,duration:e?.25:.01,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}})),(i=this._slideCallback)==null||i.call(this,this._currentIndex)}setDepth(t,e,i=0){const r=e-i,n=Math.floor(Math.abs(r)/70),a=Math.abs(r)%70/70,o=n-1,h=n+1,u=n+2,d=t[n];if(d.alpha=this.lerp(.5,1,1-a),d.scale.y=this.lerp(.85,1,1-a),h<t.length){const l=t[h];l.alpha=this.lerp(.5,1,a),l.scale.y=this.lerp(.85,1,a)}if(u<t.length){const l=t[u];l.alpha=this.lerp(.1,.5,a)}if(o>=0){const l=t[o];l.alpha=this.lerp(.1,.5,1-a)}}_onDragStart(t){this._isDragging=!0,this._startY=t.data.global.y,this._offsetY=this._slideArea.y,ut.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){var a;if(!this._isDragging)return;const e=t.pageY-this._startY;let i=this._offsetY+e;const r=this._scrollHeight/2,n=-this._pageNum*this._slideHeight+this._scrollHeight/2;i>r&&(i=r),i<n&&(i=n),this._slideArea.y=i,(a=this._scrollCallback)==null||a.call(this,this._slideArea.y,this._currentIndex)}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startY-t.pageY,r=Math.abs(i)/e,n=.275,a=this._slideHeight/2,o=Math.round(i/this._slideHeight);(Math.abs(i)>a||r>n)&&(this._currentIndex+=o),this._currentIndex<0?this._currentIndex=0:this._currentIndex>this._pageNum&&(this._currentIndex=this._pageNum),this.slideTo(this._currentIndex)}lerp(t,e,i){return t*(1-i)+e*i}}const r_=s=>{const t=new ui;return t.beginFill(16777215),t.drawRect(0,0,s.width,s.height),t.endFill(),s.addChild(t),s.mask=t,t};class bE extends Tn{constructor(t,e,i,r){super(t,e),this._currentIndex=0,this._slideWidth=0,this._startX=0,this._offsetX=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1,r_(this),this._slideWidth=t,this._slideArea=i,this.slideCallback=r,this._pageNum=Math.floor(i.width/this._slideWidth)-1,this.addChild(i),this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}prev(){this._slideTo(this._currentIndex-1)}next(){this._slideTo(this._currentIndex+1)}_slideTo(t){t<0?(ut.to(this._slideArea,{x:0,duration:.25}),this._currentIndex=0):t>this._pageNum?(ut.to(this._slideArea,{x:-this._pageNum*this._slideWidth,duration:.5}),this._currentIndex=this._pageNum):(this._currentIndex=t,ut.to(this._slideArea,{x:-this._currentIndex*this._slideWidth,duration:.25})),this.slideCallback(this._currentIndex,this._pageNum)}_onDragStart(t){this._isDragging=!0,this._startX=t.global.x,this._offsetX=this._slideArea.x,ut.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){if(!this._isDragging)return;const e=t.pageX-this._startX;this._slideArea.x=this._offsetX+e}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startX-t.pageX,r=Math.abs(i)/e,n=this._slideWidth/2,a=.275;(Math.abs(i)>n||r>a)&&(i>0?this._currentIndex++:this._currentIndex--),this._slideTo(this._currentIndex)}}class TE{constructor(t,e){this._currentIndex=0,this._numsLength=0,this._isDown=!1,this._onChange=e,this._numsLength=t,window.addEventListener("pointerup",()=>{this._isDown&&this._up()})}down(t){this._isDown=!0,this._handleChange(t),this._timerId=setTimeout(()=>{this._isDown&&(this._intervalId=setInterval(()=>{this._handleChange(t)},100))},100)}updateIndex(t){this._currentIndex=t}_up(){this._isDown=!1,clearTimeout(this._timerId),clearInterval(this._intervalId)}_handleChange(t){t==="add"?this._currentIndex<this._numsLength-1&&(this._currentIndex++,this._onChange(this._currentIndex)):t==="sub"&&this._currentIndex>0&&(this._currentIndex--,this._onChange(this._currentIndex))}}class wE{constructor(t){this._betAmountListLength=0;const{initialBetIndex:e,betAmountListLength:i,onAmountIndex:r,onDisabled:n}=t;this._onAmountIndex=r,this._onDisabled=n,this._betAmountListLength=i,this._baseNumSteper=new TE(i,a=>{this._onAmountIndex(a),this.minMaxUpdateIndex(a)}),this.minMaxUpdateIndex(e),this._baseNumSteper.updateIndex(e)}min(){this.minMaxUpdateIndex(0),this._onAmountIndex(0)}max(){const t=this._betAmountListLength-1;this.minMaxUpdateIndex(t),this._onAmountIndex(t)}sub(){this._baseNumSteper.down("sub")}add(){this._baseNumSteper.down("add")}minMaxUpdateIndex(t){t===0?this._onDisabled("min"):t===this._betAmountListLength-1?this._onDisabled("max"):this._onDisabled(),this._baseNumSteper.updateIndex(t)}}const n_=(s,t,e)=>{const i=t/s.width*s.scale.x,r=e?e/s.height*s.scale.y:i,n=Math.min(i,r);s.scale.set(n>1?1:n)};class EE extends bt{constructor(t){super();const{data:e,cellWidth:i=130,cellHeight:r=100,fontColor:n="#B4B4B8",fontSize:a=24,lineWidth:o=3,lineColor:h="#B4B4B8"}=t;this._data=e,this._rows=e.length,this._cols=e[0].length,this._cellWidth=i,this._cellHeight=r,this._fontColor=n,this._fontSize=a,this._lineWidth=o,this._lineColor=h,this._drawTable(),this.fillNumbers()}_drawTable(){const t=this._cellWidth*this._cols,e=this._cellHeight*this._rows,i=new ui;i.lineStyle(this._lineWidth,this._lineColor),i.drawRect(0,0,t,e);for(let r=1;r<this._rows;r++)i.moveTo(0,r*this._cellHeight),i.lineTo(t,r*this._cellHeight);for(let r=1;r<this._cols;r++)i.moveTo(r*this._cellWidth,0),i.lineTo(r*this._cellWidth,e);this.addChild(i)}fillNumbers(){for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const i=this._data[t][e];this._createNumberText(i,e,t)}}_createNumberText(t,e,i){const r=new Va(t.toString(),{_fontSize:this._fontSize,fill:this._fontColor}),n=e*this._cellWidth+this._cellWidth/2,a=i*this._cellHeight+this._cellHeight/2;this.addChild(r),r.anchor.set(.5),r.position.set(n,a),n_(r,this._cellWidth*.9)}}var Uu={};/*!
|
|
1170
1170
|
* howler.js v2.2.4
|
|
1171
1171
|
* howlerjs.com
|
|
1172
1172
|
*
|