var Yw=Object.defineProperty;var Gw=(i,t,e)=>t in i?Yw(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var x=(i,t,e)=>Gw(i,typeof t!="symbol"?t+"":t,e);/** * @vue/shared v3.5.41 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function Qm(i){const t=Object.create(null);for(const e of i.split(","))t[e]=1;return e=>e in t}const ue={},Sa=[],Gr=()=>{},ob=()=>!1,wc=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Tc=i=>i.startsWith("onUpdate:"),We=Object.assign,tp=(i,t)=>{const e=i.indexOf(t);e>-1&&i.splice(e,1)},$w=Object.prototype.hasOwnProperty,oe=(i,t)=>$w.call(i,t),Mt=Array.isArray,Ea=i=>wl(i)==="[object Map]",Za=i=>wl(i)==="[object Set]",Eg=i=>wl(i)==="[object Date]",Ot=i=>typeof i=="function",Te=i=>typeof i=="string",Xs=i=>typeof i=="symbol",le=i=>i!==null&&typeof i=="object",lb=i=>(le(i)||Ot(i))&&Ot(i.then)&&Ot(i.catch),hb=Object.prototype.toString,wl=i=>hb.call(i),Hw=i=>wl(i).slice(8,-1),cb=i=>wl(i)==="[object Object]",Sc=i=>Te(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,Io=Qm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ec=i=>{const t=Object.create(null);return(e=>t[e]||(t[e]=i(e)))},Ww=/-\w/g,mr=Ec(i=>i.replace(Ww,t=>t.slice(1).toUpperCase())),zw=/\B([A-Z])/g,ln=Ec(i=>i.replace(zw,"-$1").toLowerCase()),ub=Ec(i=>i.charAt(0).toUpperCase()+i.slice(1)),Zu=Ec(i=>i?`on${ub(i)}`:""),Xr=(i,t)=>!Object.is(i,t),yh=(i,...t)=>{for(let e=0;e{Object.defineProperty(i,t,{configurable:!0,enumerable:!1,writable:s,value:e})},Ac=i=>{const t=parseFloat(i);return isNaN(t)?i:t},jw=i=>{const t=Te(i)?Number(i):NaN;return isNaN(t)?i:t};let Ag;const Cc=()=>Ag||(Ag=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ep(i){if(Mt(i)){const t={};for(let e=0;e{if(e){const s=e.split(Kw);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function sp(i){let t="";if(Te(i))t=i;else if(Mt(i))for(let e=0;eJa(e,t))}const mb=i=>!!(i&&i.__v_isRef===!0),sT=i=>Te(i)?i:i==null?"":Mt(i)||le(i)&&(i.toString===hb||!Ot(i.toString))?mb(i)?sT(i.value):JSON.stringify(i,pb,2):String(i),pb=(i,t)=>mb(t)?pb(i,t.value):Ea(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[s,r],n)=>(e[Ju(s,n)+" =>"]=r,e),{})}:Za(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ju(e))}:Xs(t)?Ju(t):le(t)&&!Mt(t)&&!cb(t)?String(t):t,Ju=(i,t="")=>{var e;return Xs(i)?`Symbol(${(e=i.description)!=null?e:t})`:i};/** * @vue/reactivity v3.5.41 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let Ge;class gb{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ge&&(Ge.active?(this.parent=Ge,this.index=(Ge.scopes||(Ge.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,e;if(this.scopes){const s=this.scopes.slice();for(t=0,e=s.length;t0&&--this._on===0){if(Ge===this)Ge=this.prevScope;else{let t=Ge;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let e,s;for(e=0,s=this.effects.length;e0)return;if(Mo){let t=Mo;for(Mo=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let i;for(;Po;){let t=Po;for(Po=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){i||(i=s)}t=e}}if(i)throw i}function _b(i){for(let t=i.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function wb(i){let t,e=i.depsTail,s=e;for(;s;){const r=s.prevDep;s.version===-1?(s===e&&(e=r),lp(s),rT(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}i.deps=t,i.depsTail=e}function Yf(i){for(let t=i.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Tb(t.dep.computed)||t.dep.version!==t.version))return!0;return!!i._dirty}function Tb(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===Uo)||(i.globalVersion=Uo,!i.isSSR&&i.flags&128&&(!i.deps&&!i._dirty||!Yf(i))))return;i.flags|=2;const t=i.dep,e=ge,s=pr;ge=i,pr=!0;try{_b(i);const r=i.fn(i._value);(t.version===0||Xr(r,i._value))&&(i.flags|=128,i._value=r,t.version++)}catch(r){throw t.version++,r}finally{ge=e,pr=s,wb(i),i.flags&=-3}}function lp(i,t=!1){const{dep:e,prevSub:s,nextSub:r}=i;if(s&&(s.nextSub=r,i.prevSub=void 0),r&&(r.prevSub=s,i.nextSub=void 0),e.subs===i&&(e.subs=s,!s&&e.computed)){e.computed.flags&=-5;for(let n=e.computed.deps;n;n=n.nextDep)lp(n,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function rT(i){const{prevDep:t,nextDep:e}=i;t&&(t.nextDep=e,i.prevDep=void 0),e&&(e.prevDep=t,i.nextDep=void 0)}let pr=!0;const Sb=[];function Si(){Sb.push(pr),pr=!1}function Ei(){const i=Sb.pop();pr=i===void 0?!0:i}function Cg(i){const{cleanup:t}=i;if(i.cleanup=void 0,t){const e=ge;ge=void 0;try{t()}finally{ge=e}}}let Uo=0;class iT{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hp{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ge||!pr||ge===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==ge)e=this.activeLink=new iT(ge,this),ge.deps?(e.prevDep=ge.depsTail,ge.depsTail.nextDep=e,ge.depsTail=e):ge.deps=ge.depsTail=e,Eb(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const s=e.nextDep;s.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=s),e.prevDep=ge.depsTail,e.nextDep=void 0,ge.depsTail.nextDep=e,ge.depsTail=e,ge.deps===e&&(ge.deps=s)}return e}trigger(t){this.version++,Uo++,this.notify(t)}notify(t){ap();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{op()}}}function Eb(i){if(i.dep.sc++,i.sub.flags&4){const t=i.dep.computed;if(t&&!i.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Eb(s)}const e=i.dep.subs;e!==i&&(i.prevSub=e,e&&(e.nextSub=i)),i.dep.subs=i}}const Ph=new WeakMap,Dn=Symbol(""),Gf=Symbol(""),Xo=Symbol("");function ls(i,t,e){if(pr&&ge){let s=Ph.get(i);s||Ph.set(i,s=new Map);let r=s.get(e);r||(s.set(e,r=new hp),r.map=s,r.key=e),r.track()}}function hi(i,t,e,s,r,n){const a=Ph.get(i);if(!a){Uo++;return}const o=h=>{h&&h.trigger()};if(ap(),t==="clear")a.forEach(o);else{const h=Mt(i),l=h&&Sc(e);if(h&&e==="length"){const c=Number(s);a.forEach((u,d)=>{(d==="length"||d===Xo||!Xs(d)&&d>=c)&&o(u)})}else switch((e!==void 0||a.has(void 0))&&o(a.get(e)),l&&o(a.get(Xo)),t){case"add":h?l&&o(a.get("length")):(o(a.get(Dn)),Ea(i)&&o(a.get(Gf)));break;case"delete":h||(o(a.get(Dn)),Ea(i)&&o(a.get(Gf)));break;case"set":Ea(i)&&o(a.get(Dn));break}}op()}function nT(i,t){const e=Ph.get(i);return e&&e.get(t)}function ia(i){const t=re(i);return t===i?t:(ls(t,"iterate",Xo),Us(i)?t:t.map(br))}function Ic(i){return ls(i=re(i),"iterate",Xo),i}function Or(i,t){return Ai(i)?Na(vi(i)?br(t):t):br(t)}const aT={__proto__:null,[Symbol.iterator](){return td(this,Symbol.iterator,i=>Or(this,i))},concat(...i){return ia(this).concat(...i.map(t=>Mt(t)?ia(t):t))},entries(){return td(this,"entries",i=>(i[1]=Or(this,i[1]),i))},every(i,t){return Zr(this,"every",i,t,void 0,arguments)},filter(i,t){return Zr(this,"filter",i,t,e=>e.map(s=>Or(this,s)),arguments)},find(i,t){return Zr(this,"find",i,t,e=>Or(this,e),arguments)},findIndex(i,t){return Zr(this,"findIndex",i,t,void 0,arguments)},findLast(i,t){return Zr(this,"findLast",i,t,e=>Or(this,e),arguments)},findLastIndex(i,t){return Zr(this,"findLastIndex",i,t,void 0,arguments)},forEach(i,t){return Zr(this,"forEach",i,t,void 0,arguments)},includes(...i){return ed(this,"includes",i)},indexOf(...i){return ed(this,"indexOf",i)},join(i){return ia(this).join(i)},lastIndexOf(...i){return ed(this,"lastIndexOf",i)},map(i,t){return Zr(this,"map",i,t,void 0,arguments)},pop(){return lo(this,"pop")},push(...i){return lo(this,"push",i)},reduce(i,...t){return Ig(this,"reduce",i,t)},reduceRight(i,...t){return Ig(this,"reduceRight",i,t)},shift(){return lo(this,"shift")},some(i,t){return Zr(this,"some",i,t,void 0,arguments)},splice(...i){return lo(this,"splice",i)},toReversed(){return ia(this).toReversed()},toSorted(i){return ia(this).toSorted(i)},toSpliced(...i){return ia(this).toSpliced(...i)},unshift(...i){return lo(this,"unshift",i)},values(){return td(this,"values",i=>Or(this,i))}};function td(i,t,e){const s=Ic(i),r=s[t]();return s!==i&&!Us(i)&&(r._next=r.next,r.next=()=>{const n=r._next();return n.done||(n.value=e(n.value)),n}),r}const oT=Array.prototype;function Zr(i,t,e,s,r,n){const a=Ic(i),o=a!==i&&!Us(i),h=a[t];if(h!==oT[t]){const u=h.apply(i,n);return o?br(u):u}let l=e;a!==i&&(o?l=function(u,d){return e.call(this,Or(i,u),d,i)}:e.length>2&&(l=function(u,d){return e.call(this,u,d,i)}));const c=h.call(a,l,s);return o&&r?r(c):c}function Ig(i,t,e,s){const r=Ic(i),n=r!==i&&!Us(i);let a=e,o=!1;r!==i&&(n?(o=s.length===0,a=function(l,c,u){return o&&(o=!1,l=Or(i,l)),e.call(this,l,Or(i,c),u,i)}):e.length>3&&(a=function(l,c,u){return e.call(this,l,c,u,i)}));const h=r[t](a,...s);return o?Or(i,h):h}function ed(i,t,e){const s=re(i);ls(s,"iterate",Xo);const r=s[t](...e);return(r===-1||r===!1)&&Mc(e[0])?(e[0]=re(e[0]),s[t](...e)):r}function lo(i,t,e=[]){Si(),ap();const s=re(i)[t].apply(i,e);return op(),Ei(),s}const lT=Qm("__proto__,__v_isRef,__isVue"),Ab=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Xs));function hT(i){Xs(i)||(i=String(i));const t=re(this);return ls(t,"has",i),t.hasOwnProperty(i)}class Cb{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){if(e==="__v_skip")return t.__v_skip;const r=this._isReadonly,n=this._isShallow;if(e==="__v_isReactive")return!r;if(e==="__v_isReadonly")return r;if(e==="__v_isShallow")return n;if(e==="__v_raw")return s===(r?n?bT:Rb:n?Mb:Pb).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=Mt(t);if(!r){let h;if(a&&(h=aT[e]))return h;if(e==="hasOwnProperty")return hT}const o=Reflect.get(t,e,Ce(t)?t:s);if((Xs(e)?Ab.has(e):lT(e))||(r||ls(t,"get",e),n))return o;if(Ce(o)){const h=a&&Sc(e)?o:o.value;return r&&le(h)?Hf(h):h}return le(o)?r?Hf(o):Pc(o):o}}class Ib extends Cb{constructor(t=!1){super(!1,t)}set(t,e,s,r){let n=t[e];const a=Mt(t)&&Sc(e);if(!this._isShallow){const l=Ai(n);if(!Us(s)&&!Ai(s)&&(n=re(n),s=re(s)),!a&&Ce(n)&&!Ce(s))return l||(n.value=s),!0}const o=a?Number(e)i,Ul=i=>Reflect.getPrototypeOf(i);function mT(i,t,e){return function(...s){const r=this.__v_raw,n=re(r),a=Ea(n),o=i==="entries"||i===Symbol.iterator&&a,h=i==="keys"&&a,l=r[i](...s),c=e?$f:t?Na:br;return!t&&ls(n,"iterate",h?Gf:Dn),We(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:o?[c(u[0]),c(u[1])]:c(u),done:d}}})}}function Xl(i){return function(...t){return i==="delete"?!1:i==="clear"?void 0:this}}function pT(i,t){const e={get(r){const n=this.__v_raw,a=re(n),o=re(r);i||(Xr(r,o)&&ls(a,"get",r),ls(a,"get",o));const{has:h}=Ul(a),l=t?$f:i?Na:br;if(h.call(a,r))return l(n.get(r));if(h.call(a,o))return l(n.get(o));n!==a&&n.get(r)},get size(){const r=this.__v_raw;return!i&&ls(re(r),"iterate",Dn),r.size},has(r){const n=this.__v_raw,a=re(n),o=re(r);return i||(Xr(r,o)&&ls(a,"has",r),ls(a,"has",o)),r===o?n.has(r):n.has(r)||n.has(o)},forEach(r,n){const a=this,o=a.__v_raw,h=re(o),l=t?$f:i?Na:br;return!i&&ls(h,"iterate",Dn),o.forEach((c,u)=>r.call(n,l(c),l(u),a))}};return We(e,i?{add:Xl("add"),set:Xl("set"),delete:Xl("delete"),clear:Xl("clear")}:{add(r){const n=re(this),a=Ul(n),o=re(r),h=!t&&!Us(r)&&!Ai(r)?o:r;return a.has.call(n,h)||Xr(r,h)&&a.has.call(n,r)||Xr(o,h)&&a.has.call(n,o)||(n.add(h),hi(n,"add",h,h)),this},set(r,n){!t&&!Us(n)&&!Ai(n)&&(n=re(n));const a=re(this),{has:o,get:h}=Ul(a);let l=o.call(a,r);l||(r=re(r),l=o.call(a,r));const c=h.call(a,r);return a.set(r,n),l?Xr(n,c)&&hi(a,"set",r,n):hi(a,"add",r,n),this},delete(r){const n=re(this),{has:a,get:o}=Ul(n);let h=a.call(n,r);h||(r=re(r),h=a.call(n,r)),o&&o.call(n,r);const l=n.delete(r);return h&&hi(n,"delete",r,void 0),l},clear(){const r=re(this),n=r.size!==0,a=r.clear();return n&&hi(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{e[r]=mT(r,i,t)}),e}function cp(i,t){const e=pT(i,t);return(s,r,n)=>r==="__v_isReactive"?!i:r==="__v_isReadonly"?i:r==="__v_raw"?s:Reflect.get(oe(e,r)&&r in s?e:s,r,n)}const gT={get:cp(!1,!1)},yT={get:cp(!1,!0)},xT={get:cp(!0,!1)};const Pb=new WeakMap,Mb=new WeakMap,Rb=new WeakMap,bT=new WeakMap;function vT(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Pc(i){return Ai(i)?i:up(i,!1,uT,gT,Pb)}function _T(i){return up(i,!1,fT,yT,Mb)}function Hf(i){return up(i,!0,dT,xT,Rb)}function up(i,t,e,s,r){if(!le(i)||i.__v_raw&&!(t&&i.__v_isReactive)||i.__v_skip||!Object.isExtensible(i))return i;const n=r.get(i);if(n)return n;const a=vT(Hw(i));if(a===0)return i;const o=new Proxy(i,a===2?s:e);return r.set(i,o),o}function vi(i){return Ai(i)?vi(i.__v_raw):!!(i&&i.__v_isReactive)}function Ai(i){return!!(i&&i.__v_isReadonly)}function Us(i){return!!(i&&i.__v_isShallow)}function Mc(i){return i?!!i.__v_raw:!1}function re(i){const t=i&&i.__v_raw;return t?re(t):i}function dp(i){return!oe(i,"__v_skip")&&Object.isExtensible(i)&&db(i,"__v_skip",!0),i}const br=i=>le(i)?Pc(i):i,Na=i=>le(i)?Hf(i):i;function Ce(i){return i?i.__v_isRef===!0:!1}function Fb(i){return kb(i,!1)}function wT(i){return kb(i,!0)}function kb(i,t){return Ce(i)?i:new TT(i,t)}class TT{constructor(t,e){this.dep=new hp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:re(t),this._value=e?t:br(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Us(t)||Ai(t);t=s?t:re(t),Xr(t,e)&&(this._rawValue=t,this._value=s?t:br(t),this.dep.trigger())}}function Lb(i){return Ce(i)?i.value:i}const ST={get:(i,t,e)=>t==="__v_raw"?i:Lb(Reflect.get(i,t,e)),set:(i,t,e,s)=>{const r=i[t];return Ce(r)&&!Ce(e)?(r.value=e,!0):Reflect.set(i,t,e,s)}};function Bb(i){return vi(i)?i:new Proxy(i,ST)}function ET(i){const t=Mt(i)?new Array(i.length):{};for(const e in i)t[e]=CT(i,e);return t}class AT{constructor(t,e,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Xs(e)?e:String(e),this._raw=re(t);let r=!0,n=t;if(!Mt(t)||Xs(this._key)||!Sc(this._key))do r=!Mc(n)||Us(n);while(r&&(n=n.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=Lb(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ce(this._raw[this._key])){const e=this._object[this._key];if(Ce(e)){e.value=t;return}}this._object[this._key]=t}get dep(){return nT(this._raw,this._key)}}function CT(i,t,e){return new AT(i,t,e)}class IT{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new hp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Uo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return vb(this,!0),!0}get value(){const t=this.dep.track();return Tb(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function PT(i,t,e=!1){let s,r;return Ot(i)?s=i:(s=i.get,r=i.set),new IT(s,r,e)}const Vl={},Mh=new WeakMap;let wn;function MT(i,t=!1,e=wn){if(e){let s=Mh.get(e);s||Mh.set(e,s=[]),s.push(i)}}function RT(i,t,e=ue){const{immediate:s,deep:r,once:n,scheduler:a,augmentJob:o,call:h}=e,l=b=>r?b:Us(b)||r===!1||r===0?ci(b,1):ci(b);let c,u,d,f,m=!1,p=!1;if(Ce(i)?(u=()=>i.value,m=Us(i)):vi(i)?(u=()=>l(i),m=!0):Mt(i)?(p=!0,m=i.some(b=>vi(b)||Us(b)),u=()=>i.map(b=>{if(Ce(b))return b.value;if(vi(b))return l(b);if(Ot(b))return h?h(b,2):b()})):Ot(i)?t?u=h?()=>h(i,2):i:u=()=>{if(d){Si();try{d()}finally{Ei()}}const b=wn;wn=c;try{return h?h(i,3,[f]):i(f)}finally{wn=b}}:u=Gr,t&&r){const b=u,T=r===!0?1/0:r;u=()=>ci(b(),T)}const g=np(),y=()=>{c.stop(),g&&g.active&&tp(g.effects,c)};if(n&&t){const b=t;t=(...T)=>{const S=b(...T);return y(),S}}let _=p?new Array(i.length).fill(Vl):Vl;const v=b=>{if(!(!(c.flags&1)||!c.dirty&&!b))if(t){const T=c.run();if(b||r||m||(p?T.some((S,w)=>Xr(S,_[w])):Xr(T,_))){d&&d();const S=wn;wn=c;try{const w=[T,_===Vl?void 0:p&&_[0]===Vl?[]:_,f];_=T,h?h(t,3,w):t(...w)}finally{wn=S}}}else c.run()};return o&&o(v),c=new xb(u),c.scheduler=a?()=>a(v,!1):v,f=b=>MT(b,!1,c),d=c.onStop=()=>{const b=Mh.get(c);if(b){if(h)h(b,4);else for(const T of b)T();Mh.delete(c)}},t?s?v(!0):_=c.run():a?a(v.bind(null,!0),!0):c.run(),y.pause=c.pause.bind(c),y.resume=c.resume.bind(c),y.stop=y,y}function ci(i,t=1/0,e){if(t<=0||!le(i)||i.__v_skip||(e=e||new Map,(e.get(i)||0)>=t))return i;if(e.set(i,t),t--,Ce(i))ci(i.value,t,e);else if(Mt(i))for(let s=0;s{ci(s,t,e)});else if(cb(i)){for(const s in i)ci(i[s],t,e);for(const s of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,s)&&ci(i[s],t,e)}return i}/** * @vue/runtime-core v3.5.41 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function Tl(i,t,e,s){try{return s?i(...s):i()}catch(r){Rc(r,t,e)}}function tr(i,t,e,s){if(Ot(i)){const r=Tl(i,t,e,s);return r&&lb(r)&&r.catch(n=>{Rc(n,t,e)}),r}if(Mt(i)){const r=[];for(let n=0;n>>1,r=xs[s],n=Vo(r);n=Vo(e)?xs.push(i):xs.splice(kT(t),0,i),i.flags|=1,Db()}}function Db(){Rh||(Rh=Ob.then(Ub))}function LT(i){if(!Mt(i))Gi&&i.id===-1?Gi.splice(ha+1,0,i):i.flags&1||(Aa.push(i),i.flags|=1);else for(let t=0;tVo(e)-Vo(s));if(Aa.length=0,Gi){for(let e=0;ei.id==null?i.flags&2?-1:1/0:i.id;function Ub(i){try{for(Rr=0;Rr{s._d&&Oh(-1);const n=Fh(t),a=_i.length;let o;try{o=i(...r)}finally{for(let h=_i.length;h>a;h--)wp();Fh(n),s._d&&Oh(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function bL(i,t){if(us===null)return i;const e=Dc(us),s=i.dirs||(i.dirs=[]);for(let r=0;r1)return e&&Ot(t)?t.call(s&&s.proxy):t}}function DT(){return!!(Oc()||Nn)}const NT=Symbol.for("v-scx"),UT=()=>Ca(NT);function vL(i,t){return pp(i,null,t)}function tn(i,t,e){return pp(i,t,e)}function pp(i,t,e=ue){const{immediate:s,deep:r,flush:n,once:a}=e,o=We({},e),h=t&&s||!t&&n!=="post";let l;if(Wo){if(n==="sync"){const f=UT();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!h){const f=()=>{};return f.stop=Gr,f.resume=Gr,f.pause=Gr,f}}const c=vs;o.call=(f,m,p)=>tr(f,c,m,p);let u=!1;n==="post"?o.scheduler=f=>{ps(f,c&&c.suspense)}:n!=="sync"&&(u=!0,o.scheduler=(f,m)=>{m?f():mp(f)}),o.augmentJob=f=>{t&&(f.flags|=4),u&&(f.flags|=2,c&&(f.id=c.uid,f.i=c))};const d=RT(i,t,o);return Wo&&(l?l.push(d):h&&d()),d}function XT(i,t,e){const s=this.proxy,r=Te(i)?i.includes(".")?Vb(s,i):()=>s[i]:i.bind(s,s);let n;Ot(t)?n=t:(n=t.handler,e=t);const a=El(this),o=pp(r,n.bind(s),e);return a(),o}function Vb(i,t){const e=t.split(".");return()=>{let s=i;for(let r=0;ri.__isTeleport,In=i=>i&&(i.disabled||i.disabled===""),VT=i=>i&&(i.defer||i.defer===""),Mg=i=>typeof SVGElement<"u"&&i instanceof SVGElement,Rg=i=>typeof MathMLElement=="function"&&i instanceof MathMLElement,Wf=(i,t)=>{const e=i&&i.to;return Te(e)?t?t(e):null:e},YT={name:"Teleport",__isTeleport:!0,process(i,t,e,s,r,n,a,o,h,l){const{mc:c,pc:u,pbc:d,o:{insert:f,querySelector:m,createText:p,createComment:g,parentNode:y}}=l,_=In(t.props);let{dynamicChildren:v}=t;const b=(w,E,A)=>{w.shapeFlag&16&&c(w.children,E,A,r,n,a,o,h)},T=(w=t)=>{const E=In(w.props),A=w.target=Wf(w.props,m),P=zf(A,w,p,f);A&&(a!=="svg"&&Mg(A)?a="svg":a!=="mathml"&&Rg(A)&&(a="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(A),E||(b(w,A,P),yo(w,!1)))},S=w=>{const E=()=>{if(Ui.get(w)===E){if(Ui.delete(w),In(w.props)){const A=y(w.el)||e;b(w,A,w.anchor),yo(w,!0)}T(w)}};Ui.set(w,E),ps(E,n)};if(i==null){const w=t.el=p(""),E=t.anchor=p("");if(f(w,e,s),f(E,e,s),VT(t.props)||n&&n.pendingBranch){S(t);return}_&&(b(t,e,E),yo(t,!0)),T()}else{t.el=i.el;const w=t.anchor=i.anchor,E=Ui.get(i);if(E){E.flags|=8,Ui.delete(i),S(t);return}t.targetStart=i.targetStart;const A=t.target=i.target,P=t.targetAnchor=i.targetAnchor,I=In(i.props),C=I?e:A,R=I?w:P;if(a==="svg"||Mg(A)?a="svg":(a==="mathml"||Rg(A))&&(a="mathml"),v?(d(i.dynamicChildren,v,C,r,n,a,o),_p(i,t,!0)):h||u(i,t,C,R,r,n,a,o,!1),_)I?t.props&&i.props&&t.props.to!==i.props.to&&(t.props.to=i.props.to):Yl(t,e,w,l,1);else if((t.props&&t.props.to)!==(i.props&&i.props.to)){const F=Wf(t.props,m);F&&(t.target=F,Yl(t,F,null,l,0))}else I&&Yl(t,A,P,l,1);yo(t,_)}},remove(i,t,e,{um:s,o:{remove:r}},n){const{shapeFlag:a,children:o,anchor:h,targetStart:l,targetAnchor:c,target:u,props:d}=i,f=In(d),m=n||!f,p=Ui.get(i);if(p&&(p.flags|=8,Ui.delete(i)),u&&(r(l),r(c)),n&&r(h),!p&&(f||u)&&a&16)for(let g=0;g{i.isMounted=!0}),Kb(()=>{i.isUnmounting=!0}),i}const Ys=[Function,Array],Gb={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ys,onEnter:Ys,onAfterEnter:Ys,onEnterCancelled:Ys,onBeforeLeave:Ys,onLeave:Ys,onAfterLeave:Ys,onLeaveCancelled:Ys,onBeforeAppear:Ys,onAppear:Ys,onAfterAppear:Ys,onAppearCancelled:Ys},$b=i=>{const t=i.subTree;return t.component?$b(t.component):t},HT={name:"BaseTransition",props:Gb,setup(i,{slots:t}){const e=Oc(),s=$T();return()=>{const r=t.default&&zb(t.default(),!0),n=r&&r.length?Hb(r):e.subTree?kS():void 0;if(!n)return;const a=re(i),{mode:o}=a;if(s.isLeaving)return sd(n);const h=kh(n);if(!h)return sd(n);let l=jf(h,a,s,e,u=>l=u);h.type!==cs&&Yo(h,l);let c=e.subTree&&kh(e.subTree);if(c&&c.type!==cs&&!Pn(c,h)&&$b(e).type!==cs){let u=jf(c,a,s,e);if(Yo(c,u),o==="out-in"&&h.type!==cs)return s.isLeaving=!0,u.afterLeave=()=>{s.isLeaving=!1,e.job.flags&8||e.update(),delete u.afterLeave,c=void 0},sd(n);o==="in-out"&&h.type!==cs?u.delayLeave=(d,f,m)=>{const p=Wb(s,c);p[String(c.key)]=c,d[Ws]=()=>{f(),d[Ws]=void 0,delete l.delayedLeave,c=void 0},l.delayedLeave=()=>{m(),delete l.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return n}}};function Hb(i){let t=i[0];if(i.length>1){for(const e of i)if(e.type!==cs){t=e;break}}return t}const WT=HT;function Wb(i,t){const{leavingVNodes:e}=i;let s=e.get(t.type);return s||(s=Object.create(null),e.set(t.type,s)),s}function jf(i,t,e,s,r){const{appear:n,mode:a,persisted:o=!1,onBeforeEnter:h,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:m,onLeaveCancelled:p,onBeforeAppear:g,onAppear:y,onAfterAppear:_,onAppearCancelled:v}=t,b=String(i.key),T=Wb(e,i),S=(A,P)=>{A&&tr(A,s,9,P)},w=(A,P)=>{const I=P[1];S(A,P),Mt(A)?A.every(C=>C.length<=1)&&I():A.length<=1&&I()},E={mode:a,persisted:o,beforeEnter(A){let P=h;if(!e.isMounted)if(n)P=g||h;else return;A[Ws]&&A[Ws](!0);const I=T[b];I&&Pn(i,I)&&I.el[Ws]&&I.el[Ws](),S(P,[A])},enter(A){if(T[b]===i)return;let P=l,I=c,C=u;if(!e.isMounted)if(n)P=y||l,I=_||c,C=v||u;else return;let R=!1;A[ho]=D=>{R||(R=!0,D?S(C,[A]):S(I,[A]),E.delayedLeave&&E.delayedLeave(),A[ho]=void 0)};const F=A[ho].bind(null,!1);P?w(P,[A,F]):F()},leave(A,P){const I=String(i.key);if(A[ho]&&A[ho](!0),e.isUnmounting)return P();S(d,[A]);let C=!1;A[Ws]=F=>{C||(C=!0,P(),F?S(p,[A]):S(m,[A]),A[Ws]=void 0,T[I]===i&&delete T[I])};const R=A[Ws].bind(null,!1);T[I]=i,f?w(f,[A,R]):R()},clone(A){const P=jf(A,t,e,s,r);return r&&r(P),P}};return E}function sd(i){if(kc(i))return i=sn(i),i.children=null,i}function kh(i){if(!kc(i))return Fc(i.type)&&i.children?Hb(i.children):i;if(i.component)return i.component.subTree;const{shapeFlag:t,children:e}=i;if(e){if(t&16)return e[0];if(t&32&&Ot(e.default))return e.default()}}function Yo(i,t){if(i.shapeFlag&6&&i.component){i.transition=t;const e=i.component.subTree;Yo(Fc(e.type)&&kh(e)||e,t)}else i.shapeFlag&128?(i.ssContent.transition=t.clone(i.ssContent),i.ssFallback.transition=t.clone(i.ssFallback)):i.transition=t}function zb(i,t=!1,e){let s=[],r=0;for(let n=0;n1)for(let n=0;nRo(p,t&&(Mt(t)?t[g]:t),e,s,r));return}if(Ia(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ro(i,t,e,s.component.subTree);return}const n=s.shapeFlag&4?Dc(s.component):s.el,a=r?null:n,{i:o,r:h}=i,l=t&&t.r,c=o.refs===ue?o.refs={}:o.refs,u=o.setupState,d=re(u),f=u===ue?ob:p=>Fg(c,p)?!1:oe(d,p),m=(p,g)=>!(g&&Fg(c,g));if(l!=null&&l!==h){if(kg(t),Te(l))c[l]=null,f(l)&&(u[l]=null);else if(Ce(l)){const p=t;m(l,p.k)&&(l.value=null),p.k&&(c[p.k]=null)}}if(Ot(h))Tl(h,o,12,[a,c]);else{const p=Te(h),g=Ce(h);if(p||g){const y=()=>{if(i.f){const _=p?f(h)?u[h]:c[h]:m()||!i.k?h.value:c[i.k];if(r)Mt(_)&&tp(_,n);else if(Mt(_))_.includes(n)||_.push(n);else if(p)c[h]=[n],f(h)&&(u[h]=c[h]);else{const v=[n];m(h,i.k)&&(h.value=v),i.k&&(c[i.k]=v)}}else p?(c[h]=a,f(h)&&(u[h]=a)):g&&(m(h,i.k)&&(h.value=a),i.k&&(c[i.k]=a))};if(a){const _=()=>{y(),Lh.delete(i)};_.id=-1,Lh.set(i,_),ps(_,e)}else kg(i),y()}}}function kg(i){const t=Lh.get(i);t&&(t.flags|=8,Lh.delete(i))}Cc().requestIdleCallback;Cc().cancelIdleCallback;const Ia=i=>!!i.type.__asyncLoader,kc=i=>i.type.__isKeepAlive;function zT(i,t){qb(i,"a",t)}function jT(i,t){qb(i,"da",t)}function qb(i,t,e=vs){const s=i.__wdc||(i.__wdc=()=>{let r=e;for(;r;){if(r.isDeactivated)return;r=r.parent}return i()});if(Lc(t,s,e),e){let r=e.parent;for(;r&&r.parent;)kc(r.parent.vnode)&&qT(s,t,e,r),r=r.parent}}function qT(i,t,e,s){const r=Lc(t,i,s,!0);xp(()=>{tp(s[t],r)},e)}function Lc(i,t,e=vs,s=!1){if(e){const r=e[i]||(e[i]=[]),n=t.__weh||(t.__weh=(...a)=>{Si();const o=El(e),h=tr(t,e,i,a);return o(),Ei(),h});return s?r.unshift(n):r.push(n),n}}const Ri=i=>(t,e=vs)=>{(!Wo||i==="sp")&&Lc(i,(...s)=>t(...s),e)},KT=Ri("bm"),yp=Ri("m"),ZT=Ri("bu"),JT=Ri("u"),Kb=Ri("bum"),xp=Ri("um"),QT=Ri("sp"),tS=Ri("rtg"),eS=Ri("rtc");function sS(i,t=vs){Lc("ec",i,t)}const rS=Symbol.for("v-ndc");function wL(i,t,e,s){let r;const n=e,a=Mt(i);if(a||Te(i)){const o=a&&vi(i);let h=!1,l=!1;o&&(h=!Us(i),l=Ai(i),i=Ic(i)),r=new Array(i.length);for(let c=0,u=i.length;ct(o,h,void 0,n));else{const o=Object.keys(i);r=new Array(o.length);for(let h=0,l=o.length;h0;return Qf(),tm(bs,null,[ds("slot",l,s)],c?-2:64)}let a=i[t];a&&a._c&&(a._d=!1);const o=_i.length;Qf();let h;try{const l=a&&Zb(a(e)),c=e.key||n||l&&l.key;h=tm(bs,{key:(c&&!Xs(c)?c:`_${t}`)+(!l&&s?"_fb":"")},l||(s?s():[]),l&&i._===1?64:-2)}catch(l){for(let c=_i.length;c>o;c--)wp();throw l}finally{a&&a._c&&(a._d=!0)}return h}function Zb(i){return i.some(t=>$o(t)?!(t.type===cs||t.type===bs&&!Zb(t.children)):!0)?i:null}const qf=i=>i?yv(i)?Dc(i):qf(i.parent):null,Fo=We(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>qf(i.parent),$root:i=>qf(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>Qb(i),$forceUpdate:i=>i.f||(i.f=()=>{mp(i.update)}),$nextTick:i=>i.n||(i.n=fp.bind(i.proxy)),$watch:i=>XT.bind(i)}),rd=(i,t)=>i!==ue&&!i.__isScriptSetup&&oe(i,t),iS={get({_:i},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:s,data:r,props:n,accessCache:a,type:o,appContext:h}=i;if(t[0]!=="$"){const d=a[t];if(d!==void 0)switch(d){case 1:return s[t];case 2:return r[t];case 4:return e[t];case 3:return n[t]}else{if(rd(s,t))return a[t]=1,s[t];if(r!==ue&&oe(r,t))return a[t]=2,r[t];if(oe(n,t))return a[t]=3,n[t];if(e!==ue&&oe(e,t))return a[t]=4,e[t];Kf&&(a[t]=0)}}const l=Fo[t];let c,u;if(l)return t==="$attrs"&&ls(i.attrs,"get",""),l(i);if((c=o.__cssModules)&&(c=c[t]))return c;if(e!==ue&&oe(e,t))return a[t]=4,e[t];if(u=h.config.globalProperties,oe(u,t))return u[t]},set({_:i},t,e){const{data:s,setupState:r,ctx:n}=i;return rd(r,t)?(r[t]=e,!0):s!==ue&&oe(s,t)?(s[t]=e,!0):oe(i.props,t)||t[0]==="$"&&t.slice(1)in i?!1:(n[t]=e,!0)},has({_:{data:i,setupState:t,accessCache:e,ctx:s,appContext:r,props:n,type:a}},o){let h;return!!(e[o]||i!==ue&&o[0]!=="$"&&oe(i,o)||rd(t,o)||oe(n,o)||oe(s,o)||oe(Fo,o)||oe(r.config.globalProperties,o)||(h=a.__cssModules)&&h[o])},defineProperty(i,t,e){return e.get!=null?i._.accessCache[t]=0:oe(e,"value")&&this.set(i,t,e.value,null),Reflect.defineProperty(i,t,e)}};function Lg(i){return Mt(i)?i.reduce((t,e)=>(t[e]=null,t),{}):i}let Kf=!0;function nS(i){const t=Qb(i),e=i.proxy,s=i.ctx;Kf=!1,t.beforeCreate&&Bg(t.beforeCreate,i,"bc");const{data:r,computed:n,methods:a,watch:o,provide:h,inject:l,created:c,beforeMount:u,mounted:d,beforeUpdate:f,updated:m,activated:p,deactivated:g,beforeDestroy:y,beforeUnmount:_,destroyed:v,unmounted:b,render:T,renderTracked:S,renderTriggered:w,errorCaptured:E,serverPrefetch:A,expose:P,inheritAttrs:I,components:C,directives:R,filters:F}=t;if(l&&aS(l,s,null),a)for(const O in a){const k=a[O];Ot(k)&&(s[O]=k.bind(e))}if(r){const O=r.call(e,e);le(O)&&(i.data=Pc(O))}if(Kf=!0,n)for(const O in n){const k=n[O],N=Ot(k)?k.bind(e,e):Ot(k.get)?k.get.bind(e,e):Gr,B=!Ot(k)&&Ot(k.set)?k.set.bind(e):Gr,L=Mn({get:N,set:B});Object.defineProperty(s,O,{enumerable:!0,configurable:!0,get:()=>L.value,set:G=>L.value=G})}if(o)for(const O in o)Jb(o[O],s,e,O);if(h){const O=Ot(h)?h.call(e):h;Reflect.ownKeys(O).forEach(k=>{OT(k,O[k])})}c&&Bg(c,i,"c");function M(O,k){Mt(k)?k.forEach(N=>O(N.bind(e))):k&&O(k.bind(e))}if(M(KT,u),M(yp,d),M(ZT,f),M(JT,m),M(zT,p),M(jT,g),M(sS,E),M(eS,S),M(tS,w),M(Kb,_),M(xp,b),M(QT,A),Mt(P))if(P.length){const O=i.exposed||(i.exposed={});P.forEach(k=>{Object.defineProperty(O,k,{get:()=>e[k],set:N=>e[k]=N,enumerable:!0})})}else i.exposed||(i.exposed={});T&&i.render===Gr&&(i.render=T),I!=null&&(i.inheritAttrs=I),C&&(i.components=C),R&&(i.directives=R),A&&jb(i)}function aS(i,t,e=Gr){Mt(i)&&(i=Zf(i));for(const s in i){const r=i[s];let n;le(r)?"default"in r?n=Ca(r.from||s,r.default,!0):n=Ca(r.from||s):n=Ca(r),Ce(n)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>n.value,set:a=>n.value=a}):t[s]=n}}function Bg(i,t,e){tr(Mt(i)?i.map(s=>s.bind(t.proxy)):i.bind(t.proxy),t,e)}function Jb(i,t,e,s){let r=s.includes(".")?Vb(e,s):()=>e[s];if(Te(i)){const n=t[i];Ot(n)&&tn(r,n)}else if(Ot(i))tn(r,i.bind(e));else if(le(i))if(Mt(i))i.forEach(n=>Jb(n,t,e,s));else{const n=Ot(i.handler)?i.handler.bind(e):t[i.handler];Ot(n)&&tn(r,n,i)}}function Qb(i){const t=i.type,{mixins:e,extends:s}=t,{mixins:r,optionsCache:n,config:{optionMergeStrategies:a}}=i.appContext,o=n.get(t);let h;return o?h=o:!r.length&&!e&&!s?h=t:(h={},r.length&&r.forEach(l=>Bh(h,l,a,!0)),Bh(h,t,a)),le(t)&&n.set(t,h),h}function Bh(i,t,e,s=!1){const{mixins:r,extends:n}=t;n&&Bh(i,n,e,!0),r&&r.forEach(a=>Bh(i,a,e,!0));for(const a in t)if(!(s&&a==="expose")){const o=oS[a]||e&&e[a];i[a]=o?o(i[a],t[a]):t[a]}return i}const oS={data:Og,props:Dg,emits:Dg,methods:xo,computed:xo,beforeCreate:ms,created:ms,beforeMount:ms,mounted:ms,beforeUpdate:ms,updated:ms,beforeDestroy:ms,beforeUnmount:ms,destroyed:ms,unmounted:ms,activated:ms,deactivated:ms,errorCaptured:ms,serverPrefetch:ms,components:xo,directives:xo,watch:hS,provide:Og,inject:lS};function Og(i,t){return t?i?function(){return We(Ot(i)?i.call(this,this):i,Ot(t)?t.call(this,this):t)}:t:i}function lS(i,t){return xo(Zf(i),Zf(t))}function Zf(i){if(Mt(i)){const t={};for(let e=0;et==="modelValue"||t==="model-value"?i.modelModifiers:i[`${t}Modifiers`]||i[`${mr(t)}Modifiers`]||i[`${ln(t)}Modifiers`];function fS(i,t,...e){if(i.isUnmounted)return;const s=i.vnode.props||ue;let r=e;const n=t.startsWith("update:"),a=n&&dS(s,t.slice(7));a&&(a.trim&&(r=e.map(c=>Te(c)?c.trim():c)),a.number&&(r=e.map(Ac)));let o,h=s[o=Zu(t)]||s[o=Zu(mr(t))];!h&&n&&(h=s[o=Zu(ln(t))]),h&&tr(h,i,6,r);const l=s[o+"Once"];if(l){if(!i.emitted)i.emitted={};else if(i.emitted[o])return;i.emitted[o]=!0,tr(l,i,6,r)}}const mS=new WeakMap;function ev(i,t,e=!1){const s=e?mS:t.emitsCache,r=s.get(i);if(r!==void 0)return r;const n=i.emits;let a={},o=!1;if(!Ot(i)){const h=l=>{const c=ev(l,t,!0);c&&(o=!0,We(a,c))};!e&&t.mixins.length&&t.mixins.forEach(h),i.extends&&h(i.extends),i.mixins&&i.mixins.forEach(h)}return!n&&!o?(le(i)&&s.set(i,null),null):(Mt(n)?n.forEach(h=>a[h]=null):We(a,n),le(i)&&s.set(i,a),a)}function Bc(i,t){return!i||!wc(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),oe(i,t[0].toLowerCase()+t.slice(1))||oe(i,ln(t))||oe(i,t))}function Ng(i){const{type:t,vnode:e,proxy:s,withProxy:r,propsOptions:[n],slots:a,attrs:o,emit:h,render:l,renderCache:c,props:u,data:d,setupState:f,ctx:m,inheritAttrs:p}=i,g=Fh(i);let y,_;try{if(e.shapeFlag&4){const b=r||s,T=b;y=Dr(l.call(T,b,c,u,f,d,m)),_=o}else{const b=t;y=Dr(b.length>1?b(u,{attrs:o,slots:a,emit:h}):b(u,null)),_=t.props?o:pS(o)}}catch(b){_i.length=0,Rc(b,i,1),y=ds(cs)}let v=y;if(_&&p!==!1){const b=Object.keys(_),{shapeFlag:T}=v;b.length&&T&7&&(n&&b.some(Tc)&&(_=gS(_,n)),v=sn(v,_,!1,!0))}if(e.dirs&&(v=sn(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(e.dirs):e.dirs),e.transition){const b=Fc(v.type)&&kh(v)||v;Yo(b,e.transition)}return y=v,Fh(g),y}const pS=i=>{let t;for(const e in i)(e==="class"||e==="style"||wc(e))&&((t||(t={}))[e]=i[e]);return t},gS=(i,t)=>{const e={};for(const s in i)(!Tc(s)||!(s.slice(9)in t))&&(e[s]=i[s]);return e};function yS(i,t,e){const{props:s,children:r,component:n}=i,{props:a,children:o,patchFlag:h}=t,l=n.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&h>=0){if(h&1024)return!0;if(h&16)return s?Ug(s,a,l):!!a;if(h&8){const c=t.dynamicProps;for(let u=0;uObject.create(rv),nv=i=>Object.getPrototypeOf(i)===rv;function bS(i,t,e,s=!1){const r={},n=iv();i.propsDefaults=Object.create(null),av(i,t,r,n);for(const a in i.propsOptions[0])a in r||(r[a]=void 0);e?i.props=s?r:_T(r):i.type.props?i.props=r:i.props=n,i.attrs=n}function vS(i,t,e,s){const{props:r,attrs:n,vnode:{patchFlag:a}}=i,o=re(r),[h]=i.propsOptions;let l=!1;if((s||a>0)&&!(a&16)){if(a&8){const c=i.vnode.dynamicProps;for(let u=0;u{h=!0;const[d,f]=ov(u,t,!0);We(a,d),f&&o.push(...f)};!e&&t.mixins.length&&t.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}if(!n&&!h)return le(i)&&s.set(i,Sa),Sa;if(Mt(n))for(let c=0;ci==="_"||i==="_ctx"||i==="$stable",vp=i=>Mt(i)?i.map(Dr):[Dr(i)],wS=(i,t,e)=>{if(t._n)return t;const s=BT((...r)=>vp(t(...r)),e);return s._c=!1,s},lv=(i,t,e)=>{const s=i._ctx;for(const r in i){if(bp(r))continue;const n=i[r];if(Ot(n))t[r]=wS(r,n,s);else if(n!=null){const a=vp(n);t[r]=()=>a}}},hv=(i,t)=>{const e=vp(t);i.slots.default=()=>e},cv=(i,t,e)=>{for(const s in t)(e||!bp(s))&&(i[s]=t[s])},TS=(i,t,e)=>{const s=i.slots=iv();if(i.vnode.shapeFlag&32){const r=t._;r?(cv(s,t,e),e&&db(s,"_",r,!0)):lv(t,s)}else t&&hv(i,t)},SS=(i,t,e)=>{const{vnode:s,slots:r}=i;let n=!0,a=ue;if(s.shapeFlag&32){const o=t._;o?e&&o===1?n=!1:cv(r,t,e):(n=!t.$stable,lv(t,r)),a=t}else t&&(hv(i,t),a={default:1});if(n)for(const o in r)!bp(o)&&a[o]==null&&delete r[o]},ps=PS;function ES(i){return AS(i)}function AS(i,t){const e=Cc();e.__VUE__=!0;const{insert:s,remove:r,patchProp:n,createElement:a,createText:o,createComment:h,setText:l,setElementText:c,parentNode:u,nextSibling:d,setScopeId:f=Gr,insertStaticContent:m}=i,p=(X,$,K,J=null,Q=null,it=null,U=void 0,Y=null,W=!!$.dynamicChildren)=>{if(X===$)return;X&&!Pn(X,$)&&(J=et(X),G(X,Q,it,!0),X=null),$.patchFlag===-2&&(W=!1,$.dynamicChildren=null);const{type:j,ref:mt,shapeFlag:ut}=$;switch(j){case Sl:g(X,$,K,J);break;case cs:y(X,$,K,J);break;case xh:X==null&&_($,K,J,U);break;case bs:C(X,$,K,J,Q,it,U,Y,W);break;default:ut&1?T(X,$,K,J,Q,it,U,Y,W):ut&6?R(X,$,K,J,Q,it,U,Y,W):(ut&64||ut&128)&&j.process(X,$,K,J,Q,it,U,Y,W,rt)}mt!=null&&Q?Ro(mt,X&&X.ref,it,$||X,!$):mt==null&&X&&X.ref!=null&&Ro(X.ref,null,it,X,!0)},g=(X,$,K,J)=>{if(X==null)s($.el=o($.children),K,J);else{const Q=$.el=X.el;$.children!==X.children&&l(Q,$.children)}},y=(X,$,K,J)=>{X==null?s($.el=h($.children||""),K,J):$.el=X.el},_=(X,$,K,J)=>{[X.el,X.anchor]=m(X.children,$,K,J,X.el,X.anchor)},v=({el:X,anchor:$},K,J)=>{let Q;for(;X&&X!==$;)Q=d(X),s(X,K,J),X=Q;s($,K,J)},b=({el:X,anchor:$})=>{let K;for(;X&&X!==$;)K=d(X),r(X),X=K;r($)},T=(X,$,K,J,Q,it,U,Y,W)=>{if($.type==="svg"?U="svg":$.type==="math"&&(U="mathml"),X==null)S($,K,J,Q,it,U,Y,W);else{const j=X.el&&X.el._isVueCE?X.el:null;try{j&&j._beginPatch(),A(X,$,Q,it,U,Y,W)}finally{j&&j._endPatch()}}},S=(X,$,K,J,Q,it,U,Y)=>{let W,j;const{props:mt,shapeFlag:ut,transition:vt,dirs:Rt}=X;if(W=X.el=a(X.type,it,mt&&mt.is,mt),ut&8?c(W,X.children):ut&16&&E(X.children,W,null,J,Q,id(X,it),U,Y),Rt&&pn(X,null,J,"created"),w(W,X,X.scopeId,U,J),mt){for(const st in mt)st!=="value"&&!Io(st)&&n(W,st,null,mt[st],it,J);"value"in mt&&n(W,"value",null,mt.value,it),(j=mt.onVnodeBeforeMount)&&Tr(j,J,X)}Rt&&pn(X,null,J,"beforeMount");const Pt=CS(Q,vt);Pt&&vt.beforeEnter(W),s(W,$,K),((j=mt&&mt.onVnodeMounted)||Pt||Rt)&&ps(()=>{try{j&&Tr(j,J,X),Pt&&vt.enter(W),Rt&&pn(X,null,J,"mounted")}finally{}},Q)},w=(X,$,K,J,Q)=>{if(K&&f(X,K),J)for(let it=0;it{for(let j=W;j{const Y=$.el=X.el;let{patchFlag:W,dynamicChildren:j,dirs:mt}=$;W|=X.patchFlag&16;const ut=X.props||ue,vt=$.props||ue;let Rt;if(K&&gn(K,!1),(Rt=vt.onVnodeBeforeUpdate)&&Tr(Rt,K,$,X),mt&&pn($,X,K,"beforeUpdate"),K&&gn(K,!0),j&&(!X.dynamicChildren||X.dynamicChildren.length!==j.length)&&(W=0,U=!1,j=null),(ut.innerHTML&&vt.innerHTML==null||ut.textContent&&vt.textContent==null)&&c(Y,""),j?P(X.dynamicChildren,j,Y,K,J,id($,Q),it):U||k(X,$,Y,null,K,J,id($,Q),it,!1),W>0){if(W&16)I(Y,ut,vt,K,Q);else if(W&2&&ut.class!==vt.class&&n(Y,"class",null,vt.class,Q),W&4&&n(Y,"style",ut.style,vt.style,Q),W&8){const Pt=$.dynamicProps;for(let st=0;st{Rt&&Tr(Rt,K,$,X),mt&&pn($,X,K,"updated")},J)},P=(X,$,K,J,Q,it,U)=>{for(let Y=0;Y<$.length;Y++){const W=X[Y],j=$[Y],mt=W.el&&(W.type===bs||!Pn(W,j)||W.shapeFlag&198)?u(W.el):K;p(W,j,mt,null,J,Q,it,U,!0)}},I=(X,$,K,J,Q)=>{if($!==K){if($!==ue)for(const it in $)!Io(it)&&!(it in K)&&n(X,it,$[it],null,Q,J);for(const it in K){if(Io(it))continue;const U=K[it],Y=$[it];U!==Y&&it!=="value"&&n(X,it,Y,U,Q,J)}"value"in K&&n(X,"value",$.value,K.value,Q)}},C=(X,$,K,J,Q,it,U,Y,W)=>{const j=$.el=X?X.el:o(""),mt=$.anchor=X?X.anchor:o("");let{patchFlag:ut,dynamicChildren:vt,slotScopeIds:Rt}=$;Rt&&(Y=Y?Y.concat(Rt):Rt),X==null?(s(j,K,J),s(mt,K,J),E($.children||[],K,mt,Q,it,U,Y,W)):ut>0&&ut&64&&vt&&X.dynamicChildren&&X.dynamicChildren.length===vt.length?(P(X.dynamicChildren,vt,K,Q,it,U,Y),($.key!=null||Q&&$===Q.subTree)&&_p(X,$,!0)):k(X,$,K,mt,Q,it,U,Y,W)},R=(X,$,K,J,Q,it,U,Y,W)=>{$.slotScopeIds=Y,X==null?$.shapeFlag&512?Q.ctx.activate($,K,J,U,W):F($,K,J,Q,it,U,W):D(X,$,W)},F=(X,$,K,J,Q,it,U)=>{const Y=X.component=DS(X,J,Q);if(kc(X)&&(Y.ctx.renderer=rt),NS(Y,!1,U),Y.asyncDep){if(Q&&Q.registerDep(Y,M,U),!X.el){const W=Y.subTree=ds(cs);y(null,W,$,K),X.placeholder=W.el}}else M(Y,X,$,K,Q,it,U)},D=(X,$,K)=>{const J=$.component=X.component;if(yS(X,$,K))if(J.asyncDep&&!J.asyncResolved){O(J,$,K);return}else J.next=$,J.update();else $.el=X.el,J.vnode=$},M=(X,$,K,J,Q,it,U)=>{const Y=()=>{if(X.isMounted){let{next:ut,bu:vt,u:Rt,parent:Pt,vnode:st}=X;{const Ss=uv(X);if(Ss){ut&&(ut.el=st.el,O(X,ut,U)),Ss.asyncDep.then(()=>{ps(()=>{X.isUnmounted||j()},Q)});return}}let lt=ut,kt;gn(X,!1),ut?(ut.el=st.el,O(X,ut,U)):ut=st,vt&&yh(vt),(kt=ut.props&&ut.props.onVnodeBeforeUpdate)&&Tr(kt,Pt,ut,st),gn(X,!0);const Xt=Ng(X),Pe=X.subTree;X.subTree=Xt,p(Pe,Xt,u(Pe.el),et(Pe),X,Q,it),ut.el=Xt.el,lt===null&&xS(X,Xt.el),Rt&&ps(Rt,Q),(kt=ut.props&&ut.props.onVnodeUpdated)&&ps(()=>Tr(kt,Pt,ut,st),Q)}else{let ut;const{el:vt,props:Rt}=$,{bm:Pt,m:st,parent:lt,root:kt,type:Xt}=X,Pe=Ia($);gn(X,!1),Pt&&yh(Pt),!Pe&&(ut=Rt&&Rt.onVnodeBeforeMount)&&Tr(ut,lt,$),gn(X,!0);{kt.ce&&kt.ce._hasShadowRoot()&&kt.ce._injectChildStyle(Xt,X.parent?X.parent.type:void 0);const Ss=X.subTree=Ng(X);p(null,Ss,K,J,X,Q,it),$.el=Ss.el}if(st&&ps(st,Q),!Pe&&(ut=Rt&&Rt.onVnodeMounted)){const Ss=$;ps(()=>Tr(ut,lt,Ss),Q)}($.shapeFlag&256||lt&&Ia(lt.vnode)&<.vnode.shapeFlag&256)&&X.a&&ps(X.a,Q),X.isMounted=!0,$=K=J=null}};X.scope.on();const W=X.effect=new xb(Y);X.scope.off();const j=X.update=W.run.bind(W),mt=X.job=W.runIfDirty.bind(W);mt.i=X,mt.id=X.uid,W.scheduler=()=>mp(mt),gn(X,!0),j()},O=(X,$,K)=>{$.component=X;const J=X.vnode.props;X.vnode=$,X.next=null,vS(X,$.props,J,K),SS(X,$.children,K),Si(),Pg(X),Ei()},k=(X,$,K,J,Q,it,U,Y,W=!1)=>{const j=X&&X.children,mt=X?X.shapeFlag:0,ut=$.children,{patchFlag:vt,shapeFlag:Rt}=$;if(vt>0){if(vt&128){B(j,ut,K,J,Q,it,U,Y,W);return}else if(vt&256){N(j,ut,K,J,Q,it,U,Y,W);return}}Rt&8?(mt&16&&at(j,Q,it),ut!==j&&c(K,ut)):mt&16?Rt&16?B(j,ut,K,J,Q,it,U,Y,W):at(j,Q,it,!0):(mt&8&&c(K,""),Rt&16&&E(ut,K,J,Q,it,U,Y,W))},N=(X,$,K,J,Q,it,U,Y,W)=>{X=X||Sa,$=$||Sa;const j=X.length,mt=$.length,ut=Math.min(j,mt);let vt;for(vt=0;vtmt?at(X,Q,it,!0,!1,ut):E($,K,J,Q,it,U,Y,W,ut)},B=(X,$,K,J,Q,it,U,Y,W)=>{let j=0;const mt=$.length;let ut=X.length-1,vt=mt-1;for(;j<=ut&&j<=vt;){const Rt=X[j],Pt=$[j]=W?oi($[j]):Dr($[j]);if(Pn(Rt,Pt))p(Rt,Pt,K,null,Q,it,U,Y,W);else break;j++}for(;j<=ut&&j<=vt;){const Rt=X[ut],Pt=$[vt]=W?oi($[vt]):Dr($[vt]);if(Pn(Rt,Pt))p(Rt,Pt,K,null,Q,it,U,Y,W);else break;ut--,vt--}if(j>ut){if(j<=vt){const Rt=vt+1,Pt=Rtvt)for(;j<=ut;)G(X[j],Q,it,!0),j++;else{const Rt=j,Pt=j,st=new Map;for(j=Pt;j<=vt;j++){const Xe=$[j]=W?oi($[j]):Dr($[j]);Xe.key!=null&&st.set(Xe.key,j)}let lt,kt=0;const Xt=vt-Pt+1;let Pe=!1,Ss=0;const Es=new Array(Xt);for(j=0;j=Xt){G(Xe,Q,it,!0);continue}let tt;if(Xe.key!=null)tt=st.get(Xe.key);else for(lt=Pt;lt<=vt;lt++)if(Es[lt-Pt]===0&&Pn(Xe,$[lt])){tt=lt;break}tt===void 0?G(Xe,Q,it,!0):(Es[tt-Pt]=j+1,tt>=Ss?Ss=tt:Pe=!0,p(Xe,$[tt],K,null,Q,it,U,Y,W),kt++)}const Li=Pe?IS(Es):Sa;for(lt=Li.length-1,j=Xt-1;j>=0;j--){const Xe=Pt+j,tt=$[Xe],nt=$[Xe+1],ee=Xe+1{const{el:it,type:U,transition:Y,children:W,shapeFlag:j}=X;if(j&6){L(X.component.subTree,$,K,J);return}if(j&128){X.suspense.move($,K,J);return}if(j&64){U.move(X,$,K,rt);return}if(U===bs){s(it,$,K);for(let ut=0;utY.enter(it),Q));else{const{leave:ut,delayLeave:vt,afterLeave:Rt}=Y,Pt=()=>{X.ctx.isUnmounted?r(it):s(it,$,K)},st=()=>{const lt=it._isLeaving||!!it[Ws];it._isLeaving&&it[Ws](!0),Y.persisted&&!lt?Pt():ut(it,()=>{Pt(),Rt&&Rt()})};vt?vt(it,Pt,st):st()}else s(it,$,K)},G=(X,$,K,J=!1,Q=!1)=>{const{type:it,props:U,ref:Y,children:W,dynamicChildren:j,shapeFlag:mt,patchFlag:ut,dirs:vt,cacheIndex:Rt,memo:Pt}=X;if(ut===-2&&(Q=!1),Y!=null&&(Si(),Ro(Y,null,K,X,!0),Ei()),Rt!=null&&($.renderCache[Rt]=void 0),mt&256){$.ctx.deactivate(X);return}const st=mt&1&&vt,lt=!Ia(X);let kt;if(lt&&(kt=U&&U.onVnodeBeforeUnmount)&&Tr(kt,$,X),mt&6)H(X.component,K,J);else{if(mt&128){X.suspense.unmount(K,J);return}st&&pn(X,null,$,"beforeUnmount"),mt&64?X.type.remove(X,$,K,rt,J):j&&!j.hasOnce&&(it!==bs||ut>0&&ut&64)?at(j,$,K,!1,!0):(it===bs&&ut&384||!Q&&mt&16)&&at(W,$,K),J&&V(X)}const Xt=Pt!=null&&Rt==null;(lt&&(kt=U&&U.onVnodeUnmounted)||st||Xt)&&ps(()=>{kt&&Tr(kt,$,X),st&&pn(X,null,$,"unmounted"),Xt&&(X.el=null)},K)},V=X=>{const{type:$,el:K,anchor:J,transition:Q}=X;if($===bs){q(K,J);return}if($===xh){b(X);return}const it=()=>{r(K),Q&&!Q.persisted&&Q.afterLeave&&Q.afterLeave()};if(X.shapeFlag&1&&Q&&!Q.persisted){const{leave:U,delayLeave:Y}=Q,W=()=>U(K,it);Y?Y(X.el,it,W):W()}else it()},q=(X,$)=>{let K;for(;X!==$;)K=d(X),r(X),X=K;r($)},H=(X,$,K)=>{const{bum:J,scope:Q,job:it,subTree:U,um:Y,m:W,a:j}=X;Vg(W),Vg(j),J&&yh(J),Q.stop(),it&&(it.flags|=8,G(U,X,$,K)),Y&&ps(Y,$),ps(()=>{X.isUnmounted=!0},$)},at=(X,$,K,J=!1,Q=!1,it=0)=>{for(let U=it;U{if(X.shapeFlag&6)return et(X.component.subTree);if(X.shapeFlag&128)return X.suspense.next();const $=d(X.anchor||X.el),K=$&&$[Yb];return K?d(K):$};let ot=!1;const ct=(X,$,K)=>{let J;X==null?$._vnode&&(G($._vnode,null,null,!0),J=$._vnode.component):p($._vnode||null,X,$,null,null,null,K),$._vnode=X,ot||(ot=!0,Pg(J),Nb(),ot=!1)},rt={p,um:G,m:L,r:V,mt:F,mc:E,pc:k,pbc:P,n:et,o:i};return{render:ct,hydrate:void 0,createApp:uS(ct)}}function id({type:i,props:t},e){return e==="svg"&&i==="foreignObject"||e==="mathml"&&i==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function gn({effect:i,job:t},e){e?(i.flags|=32,t.flags|=4):(i.flags&=-33,t.flags&=-5)}function CS(i,t){return(!i||i&&!i.pendingBranch)&&t&&!t.persisted}function _p(i,t,e=!1){const s=i.children,r=t.children;if(Mt(s)&&Mt(r))for(let n=0;n>1,i[e[o]]0&&(t[s]=e[n-1]),e[n]=s)}}for(n=e.length,a=e[n-1];n-- >0;)e[n]=a,a=t[a];return e}function uv(i){const t=i.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:uv(t)}function Vg(i){if(i)for(let t=0;ti.__isSuspense;function PS(i,t){t&&t.pendingBranch?Mt(i)?t.effects.push(...i):t.effects.push(i):LT(i)}const bs=Symbol.for("v-fgt"),Sl=Symbol.for("v-txt"),cs=Symbol.for("v-cmt"),xh=Symbol.for("v-stc"),_i=[];let Ds=null;function Qf(i=!1){_i.push(Ds=i?null:[])}function wp(){_i.pop(),Ds=_i[_i.length-1]||null}let Go=1;function Oh(i,t=!1){Go+=i,i<0&&Ds&&t&&(Ds.hasOnce=!0)}function mv(i){return i.dynamicChildren=Go>0?Ds||Sa:null,wp(),Go>0&&Ds&&Ds.push(i),i}function SL(i,t,e,s,r,n){return mv(gv(i,t,e,s,r,n,!0))}function tm(i,t,e,s,r){return mv(ds(i,t,e,s,r,!0))}function $o(i){return i?i.__v_isVNode===!0:!1}function Pn(i,t){return i.type===t.type&&i.key===t.key}const pv=({key:i})=>i??null,bh=({ref:i,ref_key:t,ref_for:e})=>(typeof i=="number"&&(i=""+i),i!=null?Te(i)||Ce(i)||Ot(i)?{i:us,r:i,k:t,f:!!e}:i:null);function gv(i,t=null,e=null,s=0,r=null,n=i===bs?0:1,a=!1,o=!1){const h={__v_isVNode:!0,__v_skip:!0,type:i,props:t,key:t&&pv(t),ref:t&&bh(t),scopeId:Xb,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:n,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:us};return o?(Dh(h,e),n&128&&i.normalize(h)):e&&(h.shapeFlag|=Te(e)?8:16),Go>0&&!a&&Ds&&(h.patchFlag>0||n&6)&&h.patchFlag!==32&&Ds.push(h),h}const ds=MS;function MS(i,t=null,e=null,s=0,r=null,n=!1){if((!i||i===rS)&&(i=cs),$o(i)){const o=sn(i,t,!0);return e&&Dh(o,e),Go>0&&!n&&Ds&&(o.shapeFlag&6?Ds[Ds.indexOf(i)]=o:Ds.push(o)),o.patchFlag=-2,o}if(YS(i)&&(i=i.__vccOpts),t){t=RS(t);let{class:o,style:h}=t;o&&!Te(o)&&(t.class=sp(o)),le(h)&&(Mc(h)&&!Mt(h)&&(h=We({},h)),t.style=ep(h))}const a=Te(i)?1:fv(i)?128:Fc(i)?64:le(i)?4:Ot(i)?2:0;return gv(i,t,e,s,r,a,n,!0)}function RS(i){return i?Mc(i)||nv(i)?We({},i):i:null}function sn(i,t,e=!1,s=!1){const{props:r,ref:n,patchFlag:a,children:o,transition:h}=i,l=t?LS(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:i.type,props:l,key:l&&pv(l),ref:t&&t.ref?e&&n?Mt(n)?n.concat(bh(t)):[n,bh(t)]:bh(t):n,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:o,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:t&&i.type!==bs?a===-1?16:a|16:a,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:h,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&sn(i.ssContent),ssFallback:i.ssFallback&&sn(i.ssFallback),placeholder:i.placeholder,el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return h&&s&&Yo(c,h.clone(c)),c}function FS(i=" ",t=0){return ds(Sl,null,i,t)}function EL(i,t){const e=ds(xh,null,i);return e.staticCount=t,e}function kS(i="",t=!1){return t?(Qf(),tm(cs,null,i)):ds(cs,null,i)}function Dr(i){return i==null||typeof i=="boolean"?ds(cs):Mt(i)?ds(bs,null,i.slice()):$o(i)?oi(i):ds(Sl,null,String(i))}function oi(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:sn(i)}function Dh(i,t){let e=0;const{shapeFlag:s}=i;if(t==null)t=null;else if(Mt(t))e=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Dh(i,r()),r._c&&(r._d=!0));return}else{e=32;const r=t._;!r&&!nv(t)?t._ctx=us:r===3&&us&&(us.slots._===1?t._=1:(t._=2,i.patchFlag|=1024))}else if(Ot(t)){if(s&65){Dh(i,{default:t});return}t={default:t,_ctx:us},e=32}else t=String(t),s&64?(e=16,t=[FS(t)]):e=8;i.children=t,i.shapeFlag|=e}function LS(...i){const t={};for(let e=0;evs||us;let Nh,Ho;{const i=Cc(),t=(e,s)=>{let r;return(r=i[e])||(r=i[e]=[]),r.push(s),n=>{r.length>1?r.forEach(a=>a(n)):r[0](n)}};Nh=t("__VUE_INSTANCE_SETTERS__",e=>vs=e),Ho=t("__VUE_SSR_SETTERS__",e=>Wo=e)}const El=i=>{const t=vs;return Nh(i),i.scope.on(),()=>{i.scope.off(),Nh(t)}},Yg=()=>{vs&&vs.scope.off(),Nh(null)};function yv(i){return i.vnode.shapeFlag&4}let Wo=!1;function NS(i,t=!1,e=!1){t&&Ho(t);const{props:s,children:r}=i.vnode,n=yv(i);bS(i,s,n,t),TS(i,r,e||t);const a=n?US(i,t):void 0;return t&&Ho(!1),a}function US(i,t){const e=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,iS);const{setup:s}=e;if(s){Si();const r=i.setupContext=s.length>1?VS(i):null,n=El(i),a=Tl(s,i,0,[i.props,r]),o=lb(a);if(Ei(),n(),(o||i.sp)&&!Ia(i)&&jb(i),o){if(a.then(Yg,Yg),t)return a.then(h=>{Ho(!0);try{Gg(i,h,t)}finally{Ho(!1)}}).catch(h=>{Rc(h,i,0)});i.asyncDep=a}else Gg(i,a)}else xv(i)}function Gg(i,t,e){Ot(t)?i.type.__ssrInlineRender?i.ssrRender=t:i.render=t:le(t)&&(i.setupState=Bb(t)),xv(i)}function xv(i,t,e){const s=i.type;i.render||(i.render=s.render||Gr);{const r=El(i);Si();try{nS(i)}finally{Ei(),r()}}}const XS={get(i,t){return ls(i,"get",""),i[t]}};function VS(i){const t=e=>{i.exposed=e||{}};return{attrs:new Proxy(i.attrs,XS),slots:i.slots,emit:i.emit,expose:t}}function Dc(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(Bb(dp(i.exposed)),{get(t,e){if(e in t)return t[e];if(e in Fo)return Fo[e](i)},has(t,e){return e in t||e in Fo}})):i.proxy}function YS(i){return Ot(i)&&"__vccOpts"in i}const Mn=(i,t)=>PT(i,t,Wo);function zo(i,t,e){try{Oh(-1);const s=arguments.length;return s===2?le(t)&&!Mt(t)?$o(t)?ds(i,null,[t]):ds(i,t):ds(i,null,t):(s>3?e=Array.prototype.slice.call(arguments,2):s===3&&$o(e)&&(e=[e]),ds(i,t,e))}finally{Oh(1)}}const GS="3.5.41";/** * @vue/runtime-dom v3.5.41 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let em;const $g=typeof window<"u"&&window.trustedTypes;if($g)try{em=$g.createPolicy("vue",{createHTML:i=>i})}catch{}const bv=em?i=>em.createHTML(i):i=>i,$S="http://www.w3.org/2000/svg",HS="http://www.w3.org/1998/Math/MathML",si=typeof document<"u"?document:null,Hg=si&&si.createElement("template"),WS={insert:(i,t,e)=>{t.insertBefore(i,e||null)},remove:i=>{const t=i.parentNode;t&&t.removeChild(i)},createElement:(i,t,e,s)=>{const r=t==="svg"?si.createElementNS($S,i):t==="mathml"?si.createElementNS(HS,i):e?si.createElement(i,{is:e}):si.createElement(i);return i==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:i=>si.createTextNode(i),createComment:i=>si.createComment(i),setText:(i,t)=>{i.nodeValue=t},setElementText:(i,t)=>{i.textContent=t},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>si.querySelector(i),setScopeId(i,t){i.setAttribute(t,"")},insertStaticContent(i,t,e,s,r,n){const a=e?e.previousSibling:t.lastChild;if(r&&(r===n||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),e),!(r===n||!(r=r.nextSibling)););else{Hg.innerHTML=bv(s==="svg"?`${i}`:s==="mathml"?`${i}`:i);const o=Hg.content;if(s==="svg"||s==="mathml"){const h=o.firstChild;for(;h.firstChild;)o.appendChild(h.firstChild);o.removeChild(h)}t.insertBefore(o,e)}return[a?a.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},Di="transition",co="animation",jo=Symbol("_vtc"),vv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},zS=We({},Gb,vv),jS=i=>(i.displayName="Transition",i.props=zS,i),AL=jS((i,{slots:t})=>zo(WT,qS(i),t)),yn=(i,t=[])=>{Mt(i)?i.forEach(e=>e(...t)):i&&i(...t)},Wg=i=>i?Mt(i)?i.some(t=>t.length>1):i.length>1:!1;function qS(i){const t={};for(const C in i)C in vv||(t[C]=i[C]);if(i.css===!1)return t;const{name:e="v",type:s,duration:r,enterFromClass:n=`${e}-enter-from`,enterActiveClass:a=`${e}-enter-active`,enterToClass:o=`${e}-enter-to`,appearFromClass:h=n,appearActiveClass:l=a,appearToClass:c=o,leaveFromClass:u=`${e}-leave-from`,leaveActiveClass:d=`${e}-leave-active`,leaveToClass:f=`${e}-leave-to`}=i,m=KS(r),p=m&&m[0],g=m&&m[1],{onBeforeEnter:y,onEnter:_,onEnterCancelled:v,onLeave:b,onLeaveCancelled:T,onBeforeAppear:S=y,onAppear:w=_,onAppearCancelled:E=v}=t,A=(C,R,F,D)=>{C._enterCancelled=D,xn(C,R?c:o),xn(C,R?l:a),F&&F()},P=(C,R)=>{C._isLeaving=!1,xn(C,u),xn(C,f),xn(C,d),R&&R()},I=C=>(R,F)=>{const D=C?w:_,M=()=>A(R,C,F);yn(D,[R,M]),zg(()=>{xn(R,C?h:n),Jr(R,C?c:o),Wg(D)||jg(R,s,p,M)})};return We(t,{onBeforeEnter(C){yn(y,[C]),Jr(C,n),Jr(C,a)},onBeforeAppear(C){yn(S,[C]),Jr(C,h),Jr(C,l)},onEnter:I(!1),onAppear:I(!0),onLeave(C,R){C._isLeaving=!0;const F=()=>P(C,R);Jr(C,u),C._enterCancelled?(Jr(C,d),Zg(C)):(Zg(C),Jr(C,d)),zg(()=>{C._isLeaving&&(xn(C,u),Jr(C,f),Wg(b)||jg(C,s,g,F))}),yn(b,[C,F])},onEnterCancelled(C){A(C,!1,void 0,!0),yn(v,[C])},onAppearCancelled(C){A(C,!0,void 0,!0),yn(E,[C])},onLeaveCancelled(C){P(C),yn(T,[C])}})}function KS(i){if(i==null)return null;if(le(i))return[nd(i.enter),nd(i.leave)];{const t=nd(i);return[t,t]}}function nd(i){return jw(i)}function Jr(i,t){t.split(/\s+/).forEach(e=>e&&i.classList.add(e)),(i[jo]||(i[jo]=new Set)).add(t)}function xn(i,t){t.split(/\s+/).forEach(s=>s&&i.classList.remove(s));const e=i[jo];e&&(e.delete(t),e.size||(i[jo]=void 0))}function zg(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let ZS=0;function jg(i,t,e,s){const r=i._endId=++ZS,n=()=>{r===i._endId&&s()};if(e!=null)return setTimeout(n,e);const{type:a,timeout:o,propCount:h}=JS(i,t);if(!a)return s();const l=a+"end";let c=0;const u=()=>{i.removeEventListener(l,d),n()},d=f=>{f.target===i&&++c>=h&&u()};setTimeout(()=>{c(e[m]||"").split(", "),r=s(`${Di}Delay`),n=s(`${Di}Duration`),a=qg(r,n),o=s(`${co}Delay`),h=s(`${co}Duration`),l=qg(o,h);let c=null,u=0,d=0;t===Di?a>0&&(c=Di,u=a,d=n.length):t===co?l>0&&(c=co,u=l,d=h.length):(u=Math.max(a,l),c=u>0?a>l?Di:co:null,d=c?c===Di?n.length:h.length:0);const f=c===Di&&/\b(?:transform|all)(?:,|$)/.test(s(`${Di}Property`).toString());return{type:c,timeout:u,propCount:d,hasTransform:f}}function qg(i,t){for(;i.lengthKg(e)+Kg(i[s])))}function Kg(i){return i==="auto"?0:Number(i.slice(0,-1).replace(",","."))*1e3}function Zg(i){return(i?i.ownerDocument:document).body.offsetHeight}function QS(i,t,e){const s=i[jo];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?i.removeAttribute("class"):e?i.setAttribute("class",t):i.className=t}const Uh=Symbol("_vod"),_v=Symbol("_vsh"),CL={name:"show",beforeMount(i,{value:t},{transition:e}){i[Uh]=i.style.display==="none"?"":i.style.display,e&&t?e.beforeEnter(i):uo(i,t)},mounted(i,{value:t},{transition:e}){e&&t&&e.enter(i)},updated(i,{value:t,oldValue:e},{transition:s}){!t!=!e&&(s?t?(s.beforeEnter(i),uo(i,!0),s.enter(i)):s.leave(i,()=>{uo(i,!1)}):uo(i,t))},beforeUnmount(i,{value:t}){uo(i,t)}};function uo(i,t){i.style.display=t?i[Uh]:"none",i[_v]=!t}const tE=Symbol(""),eE=/(?:^|;)\s*display\s*:/;function sE(i,t,e){const s=i.style,r=Te(e);let n=!1;if(e&&!r){if(t)if(Te(t))for(const a of t.split(";")){const o=a.slice(0,a.indexOf(":")).trim();e[o]==null&&bo(s,o,"")}else for(const a in t)e[a]==null&&bo(s,a,"");for(const a in e){a==="display"&&(n=!0);const o=e[a];o!=null?iE(i,a,!Te(t)&&t?t[a]:void 0,o)||bo(s,a,o):bo(s,a,"")}}else if(r){if(t!==e){const a=s[tE];a&&(e+=";"+a),s.cssText=e,n=eE.test(e)}}else t&&i.removeAttribute("style");Uh in i&&(i[Uh]=n?s.display:"",i[_v]&&(s.display="none"))}const Jg=/\s*!important$/;function bo(i,t,e){if(Mt(e))e.forEach(s=>bo(i,t,s));else if(e==null&&(e=""),t.startsWith("--"))i.setProperty(t,e);else{const s=rE(i,t);Jg.test(e)?i.setProperty(ln(s),e.replace(Jg,""),"important"):i[s]=e}}const Qg=["Webkit","Moz","ms"],ad={};function rE(i,t){const e=ad[t];if(e)return e;let s=mr(t);if(s!=="filter"&&s in i)return ad[t]=s;s=ub(s);for(let r=0;rod||(cE.then(()=>od=0),od=Date.now());function dE(i,t){const e=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=e.attached)return;const r=e.value;if(Mt(r)){const n=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{n.call(s),s._stopped=!0};const a=r.slice(),o=[s];for(let h=0;hi.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,fE=(i,t,e,s,r,n)=>{const a=r==="svg";t==="class"?QS(i,s,a):t==="style"?sE(i,e,s):wc(t)?Tc(t)||aE(i,t,e,s,n):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):mE(i,t,s,a))?(s0(i,t,s),!i.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&e0(i,t,s,a,n,t!=="value")):i._isVueCE&&(pE(i,t)||i._def.__asyncLoader&&(/[A-Z]/.test(t)||!Te(s)))?s0(i,mr(t),s,n,t):(t==="true-value"?i._trueValue=s:t==="false-value"&&(i._falseValue=s),e0(i,t,s,a))};function mE(i,t,e,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in i&&i0(t)&&Ot(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&i.tagName==="IFRAME"||t==="form"||t==="list"&&i.tagName==="INPUT"||t==="type"&&i.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=i.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return i0(t)&&Te(e)?!1:t in i}function pE(i,t){const e=i._def.props;if(!e)return!1;const s=mr(t);return Array.isArray(e)?e.some(r=>mr(r)===s):Object.keys(e).some(r=>mr(r)===s)}const Ua=i=>{const t=i.props["onUpdate:modelValue"]||!1;return Mt(t)?e=>yh(t,e):t};function gE(i){i.target.composing=!0}function n0(i){const t=i.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Vr=Symbol("_assign"),Gl=Symbol("_initialValue");function ld(i,t,e){return t&&(i=i.trim()),e&&(i=Ac(i)),i}const IL={created(i,{modifiers:{lazy:t,trim:e,number:s}},r){i.parentNode&&(i.type==="text"?i[Gl]=i.defaultValue.replace(/[\r\n]/g,""):i.type==="textarea"&&(i[Gl]=i.defaultValue.replace(/\r\n?/g,` `))),i[Vr]=Ua(r);const n=s||r.props&&r.props.type==="number";zi(i,t?"change":"input",a=>{a.target.composing||i[Vr](ld(i.value,e,n))}),(e||n)&&zi(i,"change",()=>{i.value=ld(i.value,e,n)}),t||(zi(i,"compositionstart",gE),zi(i,"compositionend",n0),zi(i,"change",n0))},mounted(i,{value:t,modifiers:{trim:e,number:s}}){const r=t??"",n=i[Gl];delete i[Gl],n!==void 0&&(i.type==="text"||i.type==="textarea")&&i.value!==n?i[Vr](ld(i.value,e,s)):i.value=r},beforeUpdate(i,{value:t,oldValue:e,modifiers:{lazy:s,trim:r,number:n}},a){if(i[Vr]=Ua(a),i.composing)return;const o=(n||i.type==="number")&&!/^0\d/.test(i.value)?Ac(i.value):i.value,h=t??"";if(o===h)return;const l=i.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===i&&i.type!=="range"&&(s&&t===e||r&&i.value.trim()===h)||(i.value=h)}},PL={deep:!0,created(i,t,e){i[Vr]=Ua(e),zi(i,"change",()=>{const s=i._modelValue,r=qo(i),n=i.checked,a=i[Vr];if(Mt(s)){const o=rp(s,r),h=o!==-1;if(n&&!h)a(s.concat(r));else if(!n&&h){const l=[...s];l.splice(o,1),a(l)}}else if(Za(s)){const o=new Set(s);n?o.add(r):o.delete(r),a(o)}else a(wv(i,n))})},mounted:a0,beforeUpdate(i,t,e){i[Vr]=Ua(e),a0(i,t,e)}};function a0(i,{value:t,oldValue:e},s){i._modelValue=t;let r;if(Mt(t))r=rp(t,s.props.value)>-1;else if(Za(t))r=t.has(s.props.value);else{if(t===e)return;r=Ja(t,wv(i,!0))}i.checked!==r&&(i.checked=r)}const ML={deep:!0,created(i,{value:t,modifiers:{number:e}},s){i._modelValue=t,zi(i,"change",()=>{const r=Array.prototype.filter.call(i.options,n=>n.selected).map(n=>e?Ac(qo(n)):qo(n));i[Vr](i.multiple?Za(i._modelValue)?new Set(r):r:r[0]),i._assigning=!0,fp(()=>{i._assigning=!1})}),i[Vr]=Ua(s)},mounted(i,{value:t}){o0(i,t)},beforeUpdate(i,{value:t},e){i._modelValue=t,i[Vr]=Ua(e)},updated(i,{value:t}){i._assigning||o0(i,t)}};function o0(i,t){const e=i.multiple,s=Mt(t);if(!(e&&!s&&!Za(t))){for(let r=0,n=i.options.length;rString(l)===String(o)):a.selected=rp(t,o)>-1}else a.selected=t.has(o);else if(Ja(qo(a),t)){i.selectedIndex!==r&&(i.selectedIndex=r);return}}!e&&i.selectedIndex!==-1&&(i.selectedIndex=-1)}}function qo(i){return"_value"in i?i._value:i.value}function wv(i,t){const e=t?"_trueValue":"_falseValue";return e in i?i[e]:t}const yE=["ctrl","shift","alt","meta"],xE={stop:i=>i.stopPropagation(),prevent:i=>i.preventDefault(),self:i=>i.target!==i.currentTarget,ctrl:i=>!i.ctrlKey,shift:i=>!i.shiftKey,alt:i=>!i.altKey,meta:i=>!i.metaKey,left:i=>"button"in i&&i.button!==0,middle:i=>"button"in i&&i.button!==1,right:i=>"button"in i&&i.button!==2,exact:(i,t)=>yE.some(e=>i[`${e}Key`]&&!t.includes(e))},RL=(i,t)=>{if(!i)return i;const e=i._withMods||(i._withMods={}),s=t.join(".");return e[s]||(e[s]=((r,...n)=>{for(let a=0;a{const e=i._withKeys||(i._withKeys={}),s=t.join(".");return e[s]||(e[s]=(r=>{if(!("key"in r))return;const n=ln(r.key);if(t.some(a=>a===n||bE[a]===n))return i(r)}))},vE=We({patchProp:fE},WS);let l0;function _E(){return l0||(l0=ES(vE))}const kL=((...i)=>{const t=_E().createApp(...i),{mount:e}=t;return t.mount=s=>{const r=TE(s);if(!r)return;const n=t._component;!Ot(n)&&!n.render&&!n.template&&(n.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=e(r,!1,wE(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t});function wE(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function TE(i){return Te(i)?document.querySelector(i):i}/*! * pinia v4.0.3 * (c) 2026 Eduardo San Martin Morote * @license MIT */let Tv;const Nc=i=>Tv=i,Sv=Symbol();function h0(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}function LL(){const i=ip(!0),t=i.run(()=>Fb({}));let e=[],s=[];const r=dp({install(n){Nc(r),r._a=n,n.provide(Sv,r),n.config.globalProperties.$pinia=r,s.forEach(a=>e.push(a)),s=[]},use(n){return this._a?e.push(n):s.push(n),this},_p:e,_a:null,_e:i,_s:new Map,state:t});return r}const sm=()=>{};function c0(i,t,e,s=sm){i.add(t);const r=()=>{i.delete(t)&&s()};return!e&&np()&&yb(r),r}function na(i,...t){i.forEach(e=>{e(...t)})}const SE=i=>i(),u0=Symbol(),hd=Symbol();function rm(i,t){i instanceof Map&&t instanceof Map?t.forEach((e,s)=>i.set(s,e)):i instanceof Set&&t instanceof Set&&t.forEach(i.add,i);for(const e in t){if(!Object.hasOwn(t,e))continue;const s=t[e],r=i[e];h0(r)&&h0(s)&&Object.hasOwn(i,e)&&!Ce(s)&&!vi(s)?i[e]=rm(r,s):i[e]=s}return i}const EE=Symbol();function AE(i){return!i||typeof i!="object"||!Object.hasOwn(i,EE)}const{assign:Xi}=Object;function CE(i){return!!(Ce(i)&&i.effect)}function IE(i,t,e,s){const{state:r,actions:n,getters:a}=t,o=e.state.value[i];let h;function l(){o||(e.state.value[i]=r?r():{});const c=ET(e.state.value[i]);return Xi(c,n,Object.keys(a||{}).reduce((u,d)=>(u[d]=dp(Mn(()=>{Nc(e);const f=e._s.get(i);return a[d].call(f,f)})),u),{}))}return h=Ev(i,l,t,e,s,!0),h}function Ev(i,t,e={},s,r,n){let a;const o=Xi({actions:{}},e),h={deep:!0};let l,c,u=new Set,d=new Set,f;const m=s.state.value[i];!n&&!m&&(s.state.value[i]={});let p;function g(w){let E;l=c=!1,typeof w=="function"?(w(s.state.value[i]),E={type:"patch function",storeId:i,events:f}):(rm(s.state.value[i],w),E={type:"patch object",payload:w,storeId:i,events:f});const A=p=Symbol();fp().then(()=>{p===A&&(l=!0)}),c=!0,na(u,E,s.state.value[i])}const y=n?function(){const{state:E}=e,A=E?E():{};this.$patch(P=>{Xi(P,A)})}:sm;function _(){a.stop(),u.clear(),d.clear(),s._s.delete(i)}const v=(w,E="")=>{if(u0 in w)return w[hd]=E,w;const A=function(){Nc(s);const P=Array.from(arguments),I=new Set,C=new Set;function R(M){I.add(M)}function F(M){C.add(M)}na(d,{args:P,name:A[hd],store:T,after:R,onError:F});let D;try{D=w.apply(this&&this.$id===i?this:T,P)}catch(M){throw na(C,M),M}return D instanceof Promise?D.then(M=>(na(I,M),M)).catch(M=>(na(C,M),Promise.reject(M))):(na(I,D),D)};return A[u0]=!0,A[hd]=E,A},b={_p:s,$id:i,$onAction:c0.bind(null,d),$patch:g,$reset:y,$subscribe(w,E={}){if(u.has(w))return sm;const A=c0(u,w,E.detached,()=>P()),P=a.run(()=>tn(()=>s.state.value[i],I=>{(E.flush==="sync"?c:l)&&w({storeId:i,type:"direct",events:f},I)},Xi({},h,E)));return A},$dispose:_},T=Pc(b);s._s.set(i,T);const S=(s._a&&s._a.runWithContext||SE)(()=>s._e.run(()=>(a=ip()).run(()=>t({action:v}))));for(const w in S){const E=S[w];Ce(E)&&!CE(E)||vi(E)?n||(m&&AE(E)&&(Ce(E)?E.value=m[w]:((E instanceof Set||E instanceof Map)&&E.clear(),rm(E,m[w]))),s.state.value[i][w]=E):typeof E=="function"&&(S[w]=v(E,w),o.actions[w]=E)}return Xi(T,S),Xi(re(T),S),Object.defineProperty(T,"$state",{get:()=>s.state.value[i],set:w=>{g(E=>{Xi(E,w)})}}),s._p.forEach(w=>{const E=a.run(()=>w({store:T,app:s._a,pinia:s,options:o}));Xi(T,E)}),m&&n&&e.hydrate&&e.hydrate(T.$state,m),l=!0,c=!0,T}/*! #__NO_SIDE_EFFECTS__ */function BL(i,t,e){let s;const r=typeof t=="function";s=r?e:t;function n(a,o){const h=DT();return a=a||(h?Ca(Sv,null):null),a&&Nc(a),a=Tv,a._s.has(i)||(r?Ev(i,t,s,a):IE(i,s,a)),a._s.get(i)}return n.$id=i,n}/*! * shared v11.4.16 * (c) 2026 kazuya kawaguchi * Released under the MIT License. */const Xh=typeof window<"u",hn=(i,t=!1)=>t?Symbol.for(i):Symbol(i),PE=(i,t,e)=>ME({l:i,k:t,s:e}),ME=i=>JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ne=i=>typeof i=="number"&&isFinite(i),Av=i=>Sp(i)==="[object Date]",Xa=i=>Sp(i)==="[object RegExp]",Tp=i=>de(i)&&Object.keys(i).length===0,Le=Object.assign,RE=Object.create,he=(i=null)=>RE(i);let d0;const Ki=()=>d0||(d0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:he()),FE=Object.prototype.hasOwnProperty;function qs(i,t){return FE.call(i,t)}function qe(i,t){const e=i[t];return qs(i,t)?e:void 0}function Cv(i){return qs(Object.prototype,i)}const _e=Array.isArray,ve=i=>typeof i=="function",Et=i=>typeof i=="string",ie=i=>typeof i=="boolean",se=i=>i!==null&&typeof i=="object",kE=i=>se(i)&&ve(i.then)&&ve(i.catch),Iv=Object.prototype.toString,Sp=i=>Iv.call(i),de=i=>Sp(i)==="[object Object]",LE=i=>i==null?"":_e(i)||de(i)&&i.toString===Iv?JSON.stringify(i,null,2):String(i);function Ep(i,t=""){return i.reduce((e,s,r)=>r===0?e+s:e+t+s,"")}function BE(i,t){typeof console<"u"&&(console.warn("[intlify] "+i),t&&console.warn(t.stack))}function f0(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function OE(i){return i.replace(/&(?![a-z0-9#]{2,6};)/gi,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const DE=/^javascript:/i,NE=/^(?:href|src|action|formaction)$/i,UE=/&#(?:x([0-9a-f]+)|(\d+));?/gi,XE=/&(?:Tab|NewLine);/g,VE=/:?/gi,YE=/[\u0000-\u0020\u007f-\u009f]/g,GE=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,$E=/(^|[\s"'<>/])on(\w+\s*=)/gi,HE=/(?:^|[\s"'<>/])srcdoc\s*=/i,WE=/(^|[\s"'<>/])s(rcdoc\s*=)/gi,zE=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function jE(i,t,e){const s=t||e;if(!s)return i;const r=Number.parseInt(s,t?16:10);return r<=127?String.fromCharCode(r):i}function Ap(i){const t=i.replace(UE,jE).replace(XE,"").replace(VE,":").replace(YE,"");return DE.test(t)}function qE(i){const t=/url\s*\(/gi;let e="",s=0,r;for(;(r=t.exec(i))!==null;){const n=r.index,a=t.lastIndex-1;let o=a+1,h=1,l=null;for(;o`${e}="${m0(e,s)}"`),i=i.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(t,e,s)=>`${e}='${m0(e,s)}'`),GE.test(i)&&(i=i.replace($E,"$1on$2")),HE.test(i)&&(i=i.replace(WE,"$1s$2")),i=i.replace(zE,(t,e,s,r)=>Ap(r)?`${e}${s}about:blank`:t),i}const p0=i=>!se(i)||_e(i);function vh(i,t){if(p0(i)||p0(t)||t===Object.prototype)throw new Error("Invalid value");const e=[{src:i,des:t}];for(;e.length;){const{src:s,des:r}=e.pop();Object.keys(s).forEach(n=>{if(n==="__proto__")return;const a=s[n];if(_e(a)){const o=[];o.length=a.length,r[n]=o,e.push({src:a,des:o})}else se(a)?((!se(r[n])||_e(r[n]))&&(r[n]=he()),e.push({src:a,des:r[n]})):r[n]=a})}}/*! * message-compiler v11.4.16 * (c) 2026 kazuya kawaguchi * Released under the MIT License. */function ZE(i,t,e){return{line:i,column:t,offset:e}}function im(i,t,e){return{start:i,end:t}}const ae={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},JE=17;function Uc(i,t,e={}){const{domain:s,messages:r,args:n}=e,a=i,o=new SyntaxError(String(a));return o.code=i,t&&(o.location=t),o.domain=s,o}function QE(i){throw i}const Sr=" ",tA="\r",is=` `,eA="\u2028",sA="\u2029";function rA(i){const t=i;let e=0,s=1,r=1,n=0;const a=w=>t[w]===tA&&t[w+1]===is,o=w=>t[w]===is,h=w=>t[w]===sA,l=w=>t[w]===eA,c=w=>a(w)||o(w)||h(w)||l(w),u=()=>e,d=()=>s,f=()=>r,m=()=>n,p=w=>a(w)||h(w)||l(w)?is:t[w],g=()=>p(e),y=()=>p(e+n);function _(){return n=0,c(e)&&(s++,r=0),a(e)&&e++,e++,r++,t[e]}function v(){return a(e+n)&&n++,n++,t[e+n]}function b(){e=0,s=1,r=1,n=0}function T(w=0){n=w}function S(){const w=e+n;for(;w!==e;)_();n=0}return{index:u,line:d,column:f,peekOffset:m,charAt:p,currentChar:g,currentPeek:y,next:_,peek:v,reset:b,resetPeek:T,skipToPeek:S}}const Qr=void 0,iA=".",g0="'",nA="tokenizer";function aA(i,t={}){const e=t.location!==!1,s=rA(i),r=()=>s.index(),n=()=>ZE(s.line(),s.column(),s.index()),a=n(),o=r(),h={currentType:13,offset:o,startLoc:a,endLoc:a,lastType:13,lastOffset:o,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>h,{onError:c}=t;function u(U,Y,W,...j){const mt=l();if(Y.column+=W,Y.offset+=W,c){const ut=e?im(mt.startLoc,Y):null,vt=Uc(U,ut,{domain:nA,args:j});c(vt)}}function d(U,Y,W){U.endLoc=n(),U.currentType=Y;const j={type:Y};return e&&(j.loc=im(U.startLoc,U.endLoc)),W!=null&&(j.value=W),j}const f=U=>d(U,13);function m(U,Y){return U.currentChar()===Y?(U.next(),Y):(u(ae.EXPECTED_TOKEN,n(),0,Y),"")}function p(U){let Y="";for(;U.currentPeek()===Sr||U.currentPeek()===is;)Y+=U.currentPeek(),U.peek();return Y}function g(U){const Y=p(U);return U.skipToPeek(),Y}function y(U){if(U===Qr)return!1;const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function _(U){if(U===Qr)return!1;const Y=U.charCodeAt(0);return Y>=48&&Y<=57}function v(U,Y){const{currentType:W}=Y;if(W!==2)return!1;p(U);const j=y(U.currentPeek());return U.resetPeek(),j}function b(U,Y){const{currentType:W}=Y;if(W!==2)return!1;p(U);const j=U.currentPeek()==="-"?U.peek():U.currentPeek(),mt=_(j);return U.resetPeek(),mt}function T(U,Y){const{currentType:W}=Y;if(W!==2)return!1;p(U);const j=U.currentPeek()===g0;return U.resetPeek(),j}function S(U,Y){const{currentType:W}=Y;if(W!==7)return!1;p(U);const j=U.currentPeek()===".";return U.resetPeek(),j}function w(U,Y){const{currentType:W}=Y;if(W!==8)return!1;p(U);const j=y(U.currentPeek());return U.resetPeek(),j}function E(U,Y){const{currentType:W}=Y;if(!(W===7||W===11))return!1;p(U);const j=U.currentPeek()===":";return U.resetPeek(),j}function A(U,Y){const{currentType:W}=Y;if(W!==9)return!1;const j=()=>{const ut=U.currentPeek();return ut==="{"?y(U.peek()):ut==="@"||ut==="|"||ut===":"||ut==="."||ut===Sr||!ut?!1:ut===is?(U.peek(),j()):I(U,!1)},mt=j();return U.resetPeek(),mt}function P(U){p(U);const Y=U.currentPeek()==="|";return U.resetPeek(),Y}function I(U,Y=!0){const W=(mt=!1,ut="")=>{const vt=U.currentPeek();return vt==="{"||vt==="@"||!vt?mt:vt==="|"?!(ut===Sr||ut===is):vt===Sr?(U.peek(),W(!0,Sr)):vt===is?(U.peek(),W(!0,is)):!0},j=W();return Y&&U.resetPeek(),j}function C(U,Y){const W=U.currentChar();return W===Qr?Qr:Y(W)?(U.next(),W):null}function R(U){const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function F(U){return C(U,R)}function D(U){const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function M(U){return C(U,D)}function O(U){const Y=U.charCodeAt(0);return Y>=48&&Y<=57}function k(U){return C(U,O)}function N(U){const Y=U.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function B(U){return C(U,N)}function L(U){let Y="",W="";for(;Y=k(U);)W+=Y;return W}function G(U){let Y="";for(;;){const W=U.currentChar();if(W==="\\"){const j=U.peek();j==="{"||j==="}"||j==="@"||j==="|"||j==="\\"?(Y+=W+j,U.next(),U.next()):(U.resetPeek(),Y+=W,U.next())}else{if(W==="{"||W==="}"||W==="@"||W==="|"||!W)break;if(W===Sr||W===is)if(I(U))Y+=W,U.next();else{if(P(U))break;Y+=W,U.next()}else Y+=W,U.next()}}return Y}function V(U){g(U);let Y="",W="";for(;Y=M(U);)W+=Y;const j=U.currentChar();if(j&&j!=="}"&&j!==Qr&&j!==Sr&&j!==is&&j!==" "){const mt=rt(U);return u(ae.INVALID_TOKEN_IN_PLACEHOLDER,n(),0,W+mt),W+mt}return U.currentChar()===Qr&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),W}function q(U){g(U);let Y="";return U.currentChar()==="-"?(U.next(),Y+=`-${L(U)}`):Y+=L(U),U.currentChar()===Qr&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),Y}function H(U){return U!==g0&&U!==is}function at(U){g(U),m(U,"'");let Y="",W="";for(;Y=C(U,H);)Y==="\\"?W+=et(U):W+=Y;const j=U.currentChar();return j===is||j===Qr?(u(ae.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,n(),0),j===is&&(U.next(),m(U,"'")),W):(m(U,"'"),W)}function et(U){const Y=U.currentChar();switch(Y){case"\\":case"'":return U.next(),`\\${Y}`;case"u":return ot(U,Y,4);case"U":return ot(U,Y,6);default:return u(ae.UNKNOWN_ESCAPE_SEQUENCE,n(),0,Y),""}}function ot(U,Y,W){m(U,Y);let j="";for(let mt=0;mt{const j=U.currentChar();return j==="{"||j==="@"||j==="|"||j==="("||j===")"||!j||j===Sr?W:(W+=j,U.next(),Y(W))};return Y("")}function $(U){g(U);const Y=m(U,"|");return g(U),Y}function K(U,Y){let W=null;switch(U.currentChar()){case"{":return Y.braceNest>=1&&u(ae.NOT_ALLOW_NEST_PLACEHOLDER,n(),0),U.next(),W=d(Y,2,"{"),g(U),Y.braceNest++,W;case"}":return Y.braceNest>0&&Y.currentType===2&&u(ae.EMPTY_PLACEHOLDER,n(),0),U.next(),W=d(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&g(U),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),W;case"@":return Y.braceNest>0&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),W=J(U,Y)||f(Y),Y.braceNest=0,W;default:{let mt=!0,ut=!0,vt=!0;if(P(U))return Y.braceNest>0&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),W=d(Y,1,$(U)),Y.braceNest=0,Y.inLinked=!1,W;if(Y.braceNest>0&&(Y.currentType===4||Y.currentType===5||Y.currentType===6))return u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),Y.braceNest=0,Q(U,Y);if(mt=v(U,Y))return W=d(Y,4,V(U)),g(U),W;if(ut=b(U,Y))return W=d(Y,5,q(U)),g(U),W;if(vt=T(U,Y))return W=d(Y,6,at(U)),g(U),W;if(!mt&&!ut&&!vt)return W=d(Y,12,rt(U)),u(ae.INVALID_TOKEN_IN_PLACEHOLDER,n(),0,W.value),g(U),W;break}}return W}function J(U,Y){const{currentType:W}=Y;let j=null;const mt=U.currentChar();switch((W===7||W===8||W===11||W===9)&&(mt===is||mt===Sr)&&u(ae.INVALID_LINKED_FORMAT,n(),0),mt){case"@":return U.next(),j=d(Y,7,"@"),Y.inLinked=!0,j;case".":return g(U),U.next(),d(Y,8,".");case":":return g(U),U.next(),d(Y,9,":");default:return P(U)?(j=d(Y,1,$(U)),Y.braceNest=0,Y.inLinked=!1,j):S(U,Y)||E(U,Y)?(g(U),J(U,Y)):w(U,Y)?(g(U),d(Y,11,dt(U))):A(U,Y)?(g(U),mt==="{"?K(U,Y)||j:d(Y,10,X(U))):(W===7&&u(ae.INVALID_LINKED_FORMAT,n(),0),Y.braceNest=0,Y.inLinked=!1,Q(U,Y))}}function Q(U,Y){let W={type:13};if(Y.braceNest>0)return K(U,Y)||f(Y);if(Y.inLinked)return J(U,Y)||f(Y);switch(U.currentChar()){case"{":return K(U,Y)||f(Y);case"}":return u(ae.UNBALANCED_CLOSING_BRACE,n(),0),U.next(),d(Y,3,"}");case"@":return J(U,Y)||f(Y);default:{if(P(U))return W=d(Y,1,$(U)),Y.braceNest=0,Y.inLinked=!1,W;if(I(U))return d(Y,0,G(U));break}}return W}function it(){const{currentType:U,offset:Y,startLoc:W,endLoc:j}=h;return h.lastType=U,h.lastOffset=Y,h.lastStartLoc=W,h.lastEndLoc=j,h.offset=r(),h.startLoc=n(),s.currentChar()===Qr?d(h,13):Q(s,h)}return{nextToken:it,currentOffset:r,currentPosition:n,context:l}}const oA="parser",lA=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,hA=/\\([\\@{}|])/g;function cA(i,t){return t}function uA(i,t,e){switch(i){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||e,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function dA(i={}){const t=i.location!==!1,{onError:e}=i;function s(y,_,v,b,...T){const S=y.currentPosition();if(S.offset+=b,S.column+=b,e){const w=t?im(v,S):null,E=Uc(_,w,{domain:oA,args:T});e(E)}}function r(y,_,v){const b={type:y};return t&&(b.start=_,b.end=_,b.loc={start:v,end:v}),b}function n(y,_,v,b){t&&(y.end=_,y.loc&&(y.loc.end=v))}function a(y,_){const v=y.context(),b=r(3,v.offset,v.startLoc);return b.value=_.replace(hA,cA),n(b,y.currentOffset(),y.currentPosition()),b}function o(y,_){const v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(5,b,T);return S.index=parseInt(_,10),y.nextToken(),n(S,y.currentOffset(),y.currentPosition()),S}function h(y,_){const v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(4,b,T);return S.key=_,y.nextToken(),n(S,y.currentOffset(),y.currentPosition()),S}function l(y,_){const v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(9,b,T);return S.value=_.replace(lA,uA),y.nextToken(),n(S,y.currentOffset(),y.currentPosition()),S}function c(y){const _=y.nextToken(),v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(8,b,T);return _.type!==11?(s(y,ae.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),S.value="",n(S,b,T),{nextConsumeToken:_,node:S}):(_.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Er(_)),S.value=_.value||"",n(S,y.currentOffset(),y.currentPosition()),{node:S})}function u(y,_){const v=y.context(),b=r(7,v.offset,v.startLoc);return b.value=_,n(b,y.currentOffset(),y.currentPosition()),b}function d(y){const _=y.context(),v=r(6,_.offset,_.startLoc);let b=y.nextToken();if(b.type===8){const T=c(y);v.modifier=T.node,b=T.nextConsumeToken||y.nextToken()}switch(b.type!==9&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),b=y.nextToken(),b.type===2&&(b=y.nextToken()),b.type){case 10:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=u(y,b.value||"");break;case 4:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=h(y,b.value||"");break;case 5:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=o(y,b.value||"");break;case 6:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=l(y,b.value||"");break;default:{s(y,ae.UNEXPECTED_EMPTY_LINKED_KEY,_.lastStartLoc,0);const T=y.context(),S=r(7,T.offset,T.startLoc);return S.value="",n(S,T.offset,T.startLoc),v.key=S,n(v,T.offset,T.startLoc),{nextConsumeToken:b,node:v}}}return n(v,y.currentOffset(),y.currentPosition()),{node:v}}function f(y){const _=y.context(),v=_.currentType===1?y.currentOffset():_.offset,b=_.currentType===1?_.endLoc:_.startLoc,T=r(2,v,b);T.items=[];let S=null;do{const A=S||y.nextToken();switch(S=null,A.type){case 0:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(a(y,A.value||""));break;case 5:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(o(y,A.value||""));break;case 4:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(h(y,A.value||""));break;case 6:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(l(y,A.value||""));break;case 7:{const P=d(y);T.items.push(P.node),S=P.nextConsumeToken||null;break}}}while(_.currentType!==13&&_.currentType!==1);const w=_.currentType===1?_.lastOffset:y.currentOffset(),E=_.currentType===1?_.lastEndLoc:y.currentPosition();return n(T,w,E),T}function m(y,_,v,b){const T=y.context();let S=b.items.length===0;const w=r(1,_,v);w.cases=[],w.cases.push(b);do{const E=f(y);S||(S=E.items.length===0),w.cases.push(E)}while(T.currentType!==13);return S&&s(y,ae.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),n(w,y.currentOffset(),y.currentPosition()),w}function p(y){const _=y.context(),{offset:v,startLoc:b}=_,T=f(y);return _.currentType===13?T:m(y,v,b,T)}function g(y){const _=aA(y,Le({},i)),v=_.context(),b=r(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=y),b.body=p(_),i.onCacheKey&&(b.cacheKey=i.onCacheKey(y)),v.currentType!==13&&s(_,ae.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,y[v.offset]||""),n(b,_.currentOffset(),_.currentPosition()),b}return{parse:g}}function Er(i){if(i.type===13)return"EOF";const t=(i.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function fA(i,t={}){const e={ast:i,helpers:new Set};return{context:()=>e,helper:n=>(e.helpers.add(n),n)}}function y0(i,t){for(let e=0;ex0(e)),i}function x0(i){if(i.items.length===1){const t=i.items[0];(t.type===3||t.type===9)&&(i.static=t.value,delete t.value)}else{const t=[];for(let e=0;ea;function h(p,g){a.code+=p}function l(p,g=!0){const y=g?s:"";h(r?y+" ".repeat(p):y)}function c(p=!0){const g=++a.indentLevel;p&&l(g)}function u(p=!0){const g=--a.indentLevel;p&&l(g)}function d(){l(a.indentLevel)}return{context:o,push:h,indent:c,deindent:u,newline:d,helper:p=>`_${p}`,needIndent:()=>a.needIndent}}function yA(i,t){const{helper:e}=i;i.push(`${e("linked")}(`),Va(i,t.key),t.modifier?(i.push(", "),Va(i,t.modifier),i.push(", _type")):i.push(", undefined, _type"),i.push(")")}function xA(i,t){const{helper:e,needIndent:s}=i;i.push(`${e("normalize")}([`),i.indent(s());const r=t.items.length;for(let n=0;n1){i.push(`${e("plural")}([`),i.indent(s());const r=t.cases.length;for(let n=0;n{const e=Et(t.mode)?t.mode:"normal",s=Et(t.filename)?t.filename:"message.intl";t.sourceMap;const r=t.breakLineCode!=null?t.breakLineCode:e==="arrow"?";":` `,n=t.needIndent?t.needIndent:e!=="arrow",a=i.helpers||[],o=gA(i,{filename:s,breakLineCode:r,needIndent:n});o.push(e==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),o.indent(n),a.length>0&&(o.push(`const { ${Ep(a.map(c=>`${c}: _${c}`),", ")} } = ctx`),o.newline()),o.push("return "),Va(o,i),o.deindent(n),o.push("}"),delete i.helpers;const{code:h,map:l}=o.context();return{ast:i,code:h,map:l?l.toJSON():void 0}};function wA(i,t={}){const e=Le({},t),s=!!e.jit,r=!!e.minify,n=e.optimize==null?!0:e.optimize,o=dA(e).parse(i);return s?(n&&pA(o),r&&ca(o),{ast:o,code:""}):(mA(o,e),_A(o,e))}/*! * core-base v11.4.16 * (c) 2026 kazuya kawaguchi * Released under the MIT License. */function TA(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ki().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ki().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function $n(i){return se(i)&&Ip(i)===0&&(qs(i,"b")||qs(i,"body"))}const Pv=["b","body"];function SA(i){return cn(i,Pv)}const Mv=["c","cases"];function EA(i){return cn(i,Mv,[])}const Rv=["s","static"];function AA(i){return cn(i,Rv)}const Fv=["i","items"];function CA(i){return cn(i,Fv,[])}const kv=["t","type"];function Ip(i){return cn(i,kv)}const Lv=["v","value"];function $l(i,t){const e=cn(i,Lv);if(e!=null)return e;throw Ko(t)}const Bv=["m","modifier"];function IA(i){return cn(i,Bv)}const Ov=["k","key"];function PA(i){const t=cn(i,Ov);if(t)return t;throw Ko(6)}function cn(i,t,e){for(let s=0;sMA(e,i)}function MA(i,t){const e=SA(t);if(e==null)throw Ko(0);if(Ip(e)===1){const n=EA(e);return i.plural(n.reduce((a,o)=>[...a,b0(i,o)],[]))}else return b0(i,e)}function b0(i,t){const e=AA(t);if(e!=null)return i.type==="text"?e:i.normalize([e]);{const s=CA(t).reduce((r,n)=>[...r,nm(i,n)],[]);return i.normalize(s)}}function nm(i,t){const e=Ip(t);switch(e){case 3:return $l(t,e);case 9:return $l(t,e);case 4:{const s=t;if(qs(s,"k")&&s.k)return i.interpolate(i.named(s.k));if(qs(s,"key")&&s.key)return i.interpolate(i.named(s.key));throw Ko(e)}case 5:{const s=t;if(qs(s,"i")&&Ne(s.i))return i.interpolate(i.list(s.i));if(qs(s,"index")&&Ne(s.index))return i.interpolate(i.list(s.index));throw Ko(e)}case 6:{const s=t,r=IA(s),n=PA(s);return i.linked(nm(i,n),r?nm(i,r):void 0,i.type)}case 7:return $l(t,e);case 8:return $l(t,e);default:throw new Error(`unhandled node on format message part: ${e}`)}}const RA=i=>i;let Hl=he();function FA(i,t={}){let e=!1;const s=t.onError||QE;return t.onError=r=>{e=!0,s(r)},{...wA(i,t),detectError:e}}function kA(i,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Et(i)){ie(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||RA)(i),r=Hl[s];if(r)return r;const{ast:n,detectError:a}=FA(i,{...t,location:!1,jit:!0}),o=cd(n);return a?o:Hl[s]=o}else{if(!$n(i))return(()=>i);const e=i.cacheKey;if(e){const s=Hl[e];return s||(Hl[e]=cd(i))}else return cd(i)}}let Zo=null;function LA(i){Zo=i}function BA(i,t,e){Zo&&Zo.emit("i18n:init",{timestamp:Date.now(),i18n:i,version:t,meta:e})}const OA=DA("function:translate");function DA(i){return t=>Zo&&Zo.emit(i,t)}const di={INVALID_ARGUMENT:JE,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},NA=24;function fi(i){return Uc(i,null,void 0)}function Pp(i,t){return t.locale!=null?v0(t.locale):v0(i.locale)}let ud;function v0(i){if(Et(i))return i;if(ve(i)){if(i.resolvedOnce&&ud!=null)return ud;if(i.constructor.name==="Function"){const t=i();if(kE(t))throw fi(di.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ud=t}else throw fi(di.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw fi(di.NOT_SUPPORT_LOCALE_TYPE)}function UA(i,t,e){return[...new Set([e,..._e(t)?t:se(t)?Object.keys(t).filter(s=>s!=="default"):Et(t)?[t]:[e]])]}function XA(i,t,e){const s=Et(e)?e:Jo,r=i;let n;se(t)?(r.__localeChainObjectCache||(r.__localeChainObjectCache=new WeakMap),n=r.__localeChainObjectCache.get(t),n||(n=new Map,r.__localeChainObjectCache.set(t,n))):(r.__localeChainCache||(r.__localeChainCache=new Map),n=r.__localeChainCache.get(t),n||(n=new Map,r.__localeChainCache.set(t,n)));const a=n.get(s);if(a)return a;const o=[];let h=[e];for(;_e(h);)h=_0(o,h,t);const l=_e(t)||!de(t)?t:t.default?t.default:null;return h=Et(l)?[l]:l,_e(h)&&_0(o,h,!1),n.set(s,o),o}function _0(i,t,e){let s=!0;for(let r=0;r{a===void 0?a=o:a+=o},d[1]=()=>{a!==void 0&&(t.push(a),a=void 0)},d[2]=()=>{d[0](),r++},d[3]=()=>{if(r>0)r--,s=4,d[0]();else{if(r=0,a===void 0||(a=zA(a),a===!1))return!1;d[1]()}};function f(){const m=i[e+1];if(s===5&&m==="'"||s===6&&m==='"')return e++,o="\\"+m,d[0](),!0}for(;s!==null;)if(e++,n=i[e],!(n==="\\"&&f())){if(h=WA(n),u=un[s],l=u[h]||u.l||8,l===8||(s=l[0],l[1]!==void 0&&(c=d[l[1]],c&&(o=n,c()===!1))))return;if(s===7)return t}}const w0=new Map;function qA(i,t){return se(i)?qe(i,t):null}function KA(i,t){if(!se(i))return null;let e=w0.get(t);if(e||(e=jA(t),e&&w0.set(t,e)),!e)return null;const s=e.length;let r=i,n=0;for(;n`${i.charAt(0).toLocaleUpperCase()}${i.substr(1)}`;function JA(){return{upper:(i,t)=>t==="text"&&Et(i)?i.toUpperCase():t==="vnode"&&se(i)&&"__v_isVNode"in i?i.children.toUpperCase():i,lower:(i,t)=>t==="text"&&Et(i)?i.toLowerCase():t==="vnode"&&se(i)&&"__v_isVNode"in i?i.children.toLowerCase():i,capitalize:(i,t)=>t==="text"&&Et(i)?T0(i):t==="vnode"&&se(i)&&"__v_isVNode"in i?T0(i.children):i}}let Nv;function QA(i){Nv=i}let Uv;function tC(i){Uv=i}let Xv;function eC(i){Xv=i}let Vv=null;const sC=i=>{Vv=i},rC=()=>Vv;let Yv=null;const S0=i=>{Yv=i},iC=()=>Yv;let E0=0;function nC(i={}){const t=ve(i.onWarn)?i.onWarn:BE,e=Et(i.version)?i.version:ZA,s=Et(i.locale)||ve(i.locale)?i.locale:Jo,r=ve(s)?Jo:s,n=_e(i.fallbackLocale)||de(i.fallbackLocale)||Et(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:r,a=de(i.messages)?i.messages:dd(r),o=de(i.datetimeFormats)?i.datetimeFormats:dd(r),h=de(i.numberFormats)?i.numberFormats:dd(r),l=Le(he(),i.modifiers,JA()),c=i.pluralRules||he(),u=ve(i.missing)?i.missing:null,d=ie(i.missingWarn)||Xa(i.missingWarn)?i.missingWarn:!0,f=ie(i.fallbackWarn)||Xa(i.fallbackWarn)?i.fallbackWarn:!0,m=!!i.fallbackFormat,p=!!i.unresolving,g=ve(i.postTranslation)?i.postTranslation:null,y=de(i.processor)?i.processor:null,_=ie(i.warnHtmlMessage)?i.warnHtmlMessage:!0,v=!!i.escapeParameter,b=ve(i.messageCompiler)?i.messageCompiler:Nv,T=ve(i.messageResolver)?i.messageResolver:Uv||qA,S=ve(i.localeFallbacker)?i.localeFallbacker:Xv||UA,w=se(i.fallbackContext)?i.fallbackContext:void 0,E=i,A=se(E.__datetimeFormatters)?E.__datetimeFormatters:new Map,P=se(E.__numberFormatters)?E.__numberFormatters:new Map,I=se(E.__meta)?E.__meta:{};E0++;const C={version:e,cid:E0,locale:s,fallbackLocale:n,messages:a,modifiers:l,pluralRules:c,missing:u,missingWarn:d,fallbackWarn:f,fallbackFormat:m,unresolving:p,postTranslation:g,processor:y,warnHtmlMessage:_,escapeParameter:v,messageCompiler:b,messageResolver:T,localeFallbacker:S,fallbackContext:w,onWarn:t,__meta:I};return C.datetimeFormats=o,C.numberFormats=h,C.__datetimeFormatters=A,C.__numberFormatters=P,__INTLIFY_PROD_DEVTOOLS__&&BA(C,e,I),C}const dd=i=>({[i]:he()});function Gv(i,t,e,s,r){const{missing:n,onWarn:a}=i;if(n!==null){const o=n(i,e,t,r);return Et(o)?o:t}else return t}function A0(i,t){var s,r;const e=i;se(t)?(s=e.__localeChainObjectCache)==null||s.delete(t):(r=e.__localeChainCache)==null||r.delete(t)}function Wl(i,t,e){A0(i,e),i.fallbackContext&&A0(i.fallbackContext,e),i.localeFallbacker(i,e,t)}function aC(i,t){return i===t?!1:i.split("-")[0]===t.split("-")[0]}function oC(i,t){const e=t.indexOf(i);if(e===-1)return!1;for(let s=e+1;s{s.includes(h)?o[h]=r[h]:t[h]=r[h]}),Et(n)?t.locale=n:de(n)&&(o=n),de(a)&&(o=a),o}function C0(i,...t){const{datetimeFormats:e,unresolving:s,onWarn:r}=i,{__datetimeFormatters:n}=i;if(!Et(t[0])&&!Av(t[0])&&!Ne(t[0]))return Vh;const[a,o,h,l]=am(...t),c=ie(h.missingWarn)?h.missingWarn:i.missingWarn,u=ie(h.fallbackWarn)?h.fallbackWarn:i.fallbackWarn,d=!!h.part,f=Pp(i,h);if(!Et(a)||a===""){const _=new Intl.DateTimeFormat(f.replace(/!/g,""),l);return d?_.formatToParts(o):_.format(o)}const m=$v(i,a,f,e,c,u,"datetime format");if(!Et(m))return s?Xc:a;const p=e[m][a],g=Hv(m,a,l);let y=n.get(g);return y||(y=new Intl.DateTimeFormat(m,Le({},p,l)),n.set(g,y)),d?y.formatToParts(o):y.format(o)}const jv=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function am(...i){const[t]=i,e=he(),s=he();let r;if(Et(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw fi(di.INVALID_ISO_DATE_ARGUMENT);const o=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();r=new Date(o);try{r.toISOString()}catch{throw fi(di.INVALID_ISO_DATE_ARGUMENT)}}else if(Av(t)){if(isNaN(t.getTime()))throw fi(di.INVALID_DATE_ARGUMENT);r=t}else if(Ne(t))r=t;else throw fi(di.INVALID_ARGUMENT);const n=zv(i,e,s,jv);return[e.key||"",r,e,n]}function I0(i,t,e){Wv(i.__datetimeFormatters,t,e)}function P0(i,...t){const{numberFormats:e,unresolving:s,onWarn:r}=i,{__numberFormatters:n}=i;if(!Ne(t[0]))return Vh;const[a,o,h,l]=om(...t),c=ie(h.missingWarn)?h.missingWarn:i.missingWarn,u=ie(h.fallbackWarn)?h.fallbackWarn:i.fallbackWarn,d=!!h.part,f=Pp(i,h);if(!Et(a)||a===""){const _=new Intl.NumberFormat(f.replace(/!/g,""),l);return d?_.formatToParts(o):_.format(o)}const m=$v(i,a,f,e,c,u,"number format");if(!Et(m))return s?Xc:a;const p=e[m][a],g=Hv(m,a,l);let y=n.get(g);return y||(y=new Intl.NumberFormat(m,Le({},p,l)),n.set(g,y)),d?y.formatToParts(o):y.format(o)}const qv=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function om(...i){const[t]=i,e=he(),s=he();if(!Ne(t))throw fi(di.INVALID_ARGUMENT);const r=t,n=zv(i,e,s,qv);return[e.key||"",r,e,n]}function M0(i,t,e){Wv(i.__numberFormatters,t,e)}const lC=i=>i,hC=i=>"",cC="text",uC=i=>i.length===0?"":Ep(i),dC=LE;function fd(i,t){return i=Math.abs(i),t===2?i===1?0:1:Math.min(i,2)}function fC(i){var e,s;const t=Ne(i.pluralIndex)?i.pluralIndex:-1;return Ne((e=i.named)==null?void 0:e.count)?i.named.count:Ne((s=i.named)==null?void 0:s.n)?i.named.n:t}function mC(i={}){var _,v,b;const t=i.locale,e=fC(i),s=Et(t)&&i.pluralRules&&ve(qe(i.pluralRules,t))?i.pluralRules[t]:fd,r=s===fd?void 0:fd,n=T=>T[s(e,T.length,r)],a=i.list||[],o=T=>a[T],h=i.named||he(),l=Ne(i.pluralIndex),c=T=>{const S=Cv(T)?qe(h,T):h[T];return l&&!S&&(T==="count"||T==="n")?i.pluralIndex:S};function u(T,S){const w=ve(i.messages)?i.messages(T,!!S):se(i.messages)?i.messages[T]:!1;return w||(i.parent?i.parent.message(T):hC)}const d=T=>i.modifiers?qe(i.modifiers,T):lC,f=ve((_=i.processor)==null?void 0:_.normalize)?i.processor.normalize:uC,m=ve((v=i.processor)==null?void 0:v.interpolate)?i.processor.interpolate:dC,p=Et((b=i.processor)==null?void 0:b.type)?i.processor.type:cC,y={list:o,named:c,plural:n,linked:(T,...S)=>{const[w,E]=S;let A="text",P="";S.length===1?se(w)?(P=w.modifier||P,A=w.type||A):Et(w)&&(P=w||P):S.length===2&&(Et(w)&&(P=w||P),Et(E)&&(A=E||A));const I=u(T,!0)(y),C=I===""||I===void 0?T:I,R=A==="vnode"&&_e(C)&&P?C[0]:C;if(!P)return R;const F=d(P);return ve(F)?F(R,A):R},message:u,type:p,interpolate:m,normalize:f,values:Le(he(),a,h,l?{count:c("count"),n:c("n")}:{})};return y}const R0=()=>"",mi=i=>ve(i),Yh=i=>Et(i)||$n(i)||mi(i);function F0(i,...t){const{fallbackFormat:e,postTranslation:s,unresolving:r,messageCompiler:n,fallbackLocale:a,messages:o}=i,[h,l]=lm(...t),c=ie(l.missingWarn)?l.missingWarn:i.missingWarn,u=ie(l.fallbackWarn)?l.fallbackWarn:i.fallbackWarn,d=ie(l.escapeParameter)?l.escapeParameter:i.escapeParameter,f=!!l.resolvedMessage,m=Et(l.default)||ie(l.default)?ie(l.default)?n?h:()=>h:l.default:e?n?h:()=>h:null,p=e||m!=null&&(Et(m)||ve(m)),g=Pp(i,l);d&&pC(l);let[y,_,v]=f?[h,g,qe(o,g)||he()]:Kv(i,h,g,a,u,c),b=y,T=h;if(!f&&!Yh(b)&&p&&(b=m,T=b),!f&&(!Yh(b)||!Et(_)))return r?Xc:h;let S=!1;const w=()=>{S=!0},E=mi(b)?b:Zv(i,h,_,b,T,w);if(S)return b;const A=xC(i,_,v,l),P=mC(A),I=gC(i,E,P);let C=s?s(I,h):I;if(d&&Et(C)&&(C=KE(C)),__INTLIFY_PROD_DEVTOOLS__){const R={timestamp:Date.now(),key:Et(h)?h:mi(b)?b.key:"",locale:_||(mi(b)?b.locale:""),format:Et(b)?b:mi(b)?b.source:"",message:C};R.meta=Le({},i.__meta,rC()||{}),OA(R)}return C}function pC(i){if(_e(i.list)&&(i.list=i.list.map(t=>Et(t)?f0(t):t)),se(i.named)){const t=i.named,e=he();for(const s of Object.keys(t)){const r=t[s];e[s]=Et(r)?f0(r):r}i.named=e}}function Kv(i,t,e,s,r,n){const{messages:a,onWarn:o,messageResolver:h,localeFallbacker:l}=i,c=l(i,s,e);let u=he(),d,f=null;const m="translate";for(let p=0;ps);return l.locale=e,l.key=t,l}const h=a(s,yC(i,e,r,s,o,n));return h.locale=e,h.key=t,h.source=s,h}function gC(i,t,e){return t(e)}function lm(...i){const[t,e,s]=i,r=he();if(!Et(t)&&!Ne(t)&&!mi(t)&&!$n(t))throw fi(di.INVALID_ARGUMENT);const n=Ne(t)?String(t):(mi(t),t);return Ne(e)?r.plural=e:Et(e)?r.default=e:de(e)&&!Tp(e)?r.named=e:_e(e)&&(r.list=e),Ne(s)?r.plural=s:Et(s)?r.default=s:de(s)&&Le(r,s),[n,r]}function yC(i,t,e,s,r,n){return{locale:t,key:e,warnHtmlMessage:r,onError:a=>{throw n&&n(a),a},onCacheKey:a=>PE(t,e,a)}}function xC(i,t,e,s){const{modifiers:r,pluralRules:n,messageResolver:a,fallbackLocale:o,fallbackWarn:h,missingWarn:l,fallbackContext:c}=i,d={locale:t,modifiers:r,pluralRules:n,messages:(f,m)=>{let p=a(e,f);if(p==null&&(c||m)){const[g,,y]=Kv(c||i,f,t,o,h,l);p=g??a(y,f)}if(Et(p)||$n(p)){let g=!1;const _=Zv(i,f,t,p,f,()=>{g=!0});return g?R0:_}else return mi(p)?p:R0}};return i.processor&&(d.processor=i.processor),s.list&&(d.list=s.list),s.named&&(d.named=s.named),Ne(s.plural)&&(d.pluralIndex=s.plural),d}TA();/*! * vue-i18n v11.4.16 * (c) 2026 kazuya kawaguchi * Released under the MIT License. */const bC="11.4.16";function vC(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ki().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ki().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ki().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ki().__INTLIFY_PROD_DEVTOOLS__=!1)}const ws={UNEXPECTED_RETURN_TYPE:NA,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Is(i,...t){return Uc(i,null,void 0)}const hm=hn("__translateVNode"),cm=hn("__datetimeParts"),um=hn("__numberParts"),Jv=hn("__setPluralRules"),Qv=hn("__injectWithOption"),ya=hn("__dispose");let t_=null;{const i=Ki().__VUE_INSTANCE_SETTERS__;_e(i)&&i.push(t=>{t_=t})}function $i(i){return!!Cv(i)}function Qo(i){if(!se(i)||$n(i))return i;for(const t in i)if(qs(i,t))if(!t.includes("."))se(i[t])&&Qo(i[t]);else{const e=t.split("."),s=e.length-1;let r=i,n=!1;for(let o=0;o{if("locale"in o&&"resource"in o){const{locale:h,resource:l}=o;if(h){if($i(h))return;a[h]=qe(a,h)||he(),vh(l,a[h])}else vh(l,a)}else Et(o)&&vh(JSON.parse(o),a)}),r==null&&n)for(const o in a)qs(a,o)&&Qo(a[o]);return a}function e_(i){return i.type}function s_(i,t,e){let s=se(t.messages)?t.messages:he();"__i18nGlobal"in e&&(s=Mp(i.locale.value,{messages:s,__i18n:e.__i18nGlobal}));const r=Object.keys(s);r.length&&r.forEach(n=>{i.mergeLocaleMessage(n,s[n])});{if(se(t.datetimeFormats)){const n=Object.keys(t.datetimeFormats);n.length&&n.forEach(a=>{i.mergeDateTimeFormat(a,t.datetimeFormats[a])})}if(se(t.numberFormats)){const n=Object.keys(t.numberFormats);n.length&&n.forEach(a=>{i.mergeNumberFormat(a,t.numberFormats[a])})}}}function k0(i){return ds(Sl,null,i,0)}function tl(){return t_??Oc()}const L0="__INTLIFY_META__",B0=()=>[],_C=()=>!1;let O0=0;function D0(i){return((t,e,s,r)=>i(e,s,tl()||void 0,r))}const wC=()=>{const i=tl();let t=null;return i&&(t=e_(i)[L0])?{[L0]:t}:null};function Gh(i={}){const{__root:t,__injectWithOption:e}=i,s=t===void 0,r=i.flatJson,n=Xh?Fb:wT;let a=ie(i.inheritLocale)?i.inheritLocale:!0;const o=n(t&&a?t.locale.value:Et(i.locale)?i.locale:Jo),h=n(t&&a?t.fallbackLocale.value:Et(i.fallbackLocale)||_e(i.fallbackLocale)||de(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:o.value),l=n(Mp(o.value,i)),c=n(de(i.datetimeFormats)?i.datetimeFormats:{[o.value]:{}}),u=n(de(i.numberFormats)?i.numberFormats:{[o.value]:{}});let d=t?t.missingWarn:ie(i.missingWarn)||Xa(i.missingWarn)?i.missingWarn:!0,f=t?t.fallbackWarn:ie(i.fallbackWarn)||Xa(i.fallbackWarn)?i.fallbackWarn:!0,m=t?t.fallbackRoot:ie(i.fallbackRoot)?i.fallbackRoot:!0,p=!!i.fallbackFormat,g=ve(i.missing)?i.missing:null,y=ve(i.missing)?D0(i.missing):null,_=ve(i.postTranslation)?i.postTranslation:null,v=t?t.warnHtmlMessage:ie(i.warnHtmlMessage)?i.warnHtmlMessage:!0,b=!!i.escapeParameter;const T=t?t.modifiers:de(i.modifiers)?i.modifiers:{};let S=i.pluralRules||t&&t.pluralRules,w;w=(()=>{s&&S0(null);const st={version:bC,locale:o.value,fallbackLocale:h.value,messages:l.value,modifiers:T,pluralRules:S,missing:y===null?void 0:y,missingWarn:d,fallbackWarn:f,fallbackFormat:p,unresolving:!0,postTranslation:_===null?void 0:_,warnHtmlMessage:v,escapeParameter:b,messageResolver:i.messageResolver,messageCompiler:i.messageCompiler,__meta:{framework:"vue"}};st.datetimeFormats=c.value,st.numberFormats=u.value;const lt=nC(st);return s&&S0(lt),lt})(),Wl(w,o.value,h.value);function A(){return[o.value,h.value,l.value,c.value,u.value]}const P=Mn({get:()=>o.value,set:st=>{w.locale=st,o.value=st}});function I(st){s||(w.fallbackContext=iC());try{return st()}finally{s||(w.fallbackContext=void 0)}}function C(st){I(()=>Wl(w,o.value,st))}const R=Mn({get:()=>h.value,set:st=>{h.value=st,w.fallbackLocale=h.value,C(h.value)}}),F=Mn(()=>l.value),D=Mn(()=>c.value),M=Mn(()=>u.value);function O(){return ve(_)?_:null}function k(st){_=st,w.postTranslation=st}function N(){return g}function B(st){st!==null&&(y=D0(st)),g=st,w.missing=y}const L=(st,lt,kt,Xt,Pe,Ss)=>{A();let Es;try{__INTLIFY_PROD_DEVTOOLS__,Es=I(()=>st(w))}finally{__INTLIFY_PROD_DEVTOOLS__}if(kt!=="translate exists"&&Ne(Es)&&Es===Xc||kt==="translate exists"&&!Es){const[Li,Xe]=lt();return t&&m?Xt(t):Pe(Li)}else{if(Ss(Es))return Es;throw Is(ws.UNEXPECTED_RETURN_TYPE)}};function G(...st){return L(lt=>Reflect.apply(F0,null,[lt,...st]),()=>lm(...st),"translate",lt=>Reflect.apply(lt.t,lt,[...st]),lt=>lt,lt=>Et(lt))}function V(...st){const[lt,kt,Xt]=st;if(Xt&&!se(Xt))throw Is(ws.INVALID_ARGUMENT);return G(lt,kt,Le({resolvedMessage:!0},Xt||{}))}function q(...st){return L(lt=>Reflect.apply(C0,null,[lt,...st]),()=>am(...st),"datetime format",lt=>Reflect.apply(lt.d,lt,[...st]),()=>Vh,lt=>Et(lt)||_e(lt))}function H(...st){return L(lt=>Reflect.apply(P0,null,[lt,...st]),()=>om(...st),"number format",lt=>Reflect.apply(lt.n,lt,[...st]),()=>Vh,lt=>Et(lt)||_e(lt))}function at(st){return st.map(lt=>Et(lt)||Ne(lt)||ie(lt)?k0(String(lt)):lt)}const ot={normalize:at,interpolate:st=>st,type:"vnode"};function ct(...st){return L(lt=>{let kt;const Xt=lt;try{Xt.processor=ot,kt=Reflect.apply(F0,null,[Xt,...st])}finally{Xt.processor=null}return kt},()=>lm(...st),"translate",lt=>lt[hm](...st),lt=>[k0(lt)],lt=>_e(lt))}function rt(...st){return L(lt=>Reflect.apply(P0,null,[lt,...st]),()=>om(...st),"number format",lt=>lt[um](...st),B0,lt=>Et(lt)||_e(lt))}function dt(...st){return L(lt=>Reflect.apply(C0,null,[lt,...st]),()=>am(...st),"datetime format",lt=>lt[cm](...st),B0,lt=>Et(lt)||_e(lt))}function X(st){S=st,w.pluralRules=S}function $(st,lt){const kt=it(st),Xt=w.messageResolver(kt,lt);return Xt===null?qe(kt,lt):Xt}function K(st,lt){return L(()=>{if(!st)return!1;const kt=Et(lt)?lt:o.value,Xt=Et(lt)?[kt]:w.localeFallbacker(w,h.value,kt);for(let Pe=0;Pe[st],"translate exists",kt=>Reflect.apply(kt.te,kt,[st,lt]),_C,kt=>ie(kt))}function J(st){let lt=null;const kt=w.localeFallbacker(w,h.value,o.value);for(let Xt=0;XtC(h.value),{deep:!0,flush:"sync"}),t&&Xh&&(tn(t.locale,st=>{a&&(o.value=st,w.locale=st,Wl(w,o.value,h.value))}),tn(t.fallbackLocale,st=>{a&&(h.value=st,w.fallbackLocale=h.value,Wl(w,o.value,h.value))}));const Pt={id:O0,locale:P,fallbackLocale:R,get inheritLocale(){return a},set inheritLocale(st){a=st,st&&t&&(P.value=t.locale.value,R.value=t.fallbackLocale.value)},get availableLocales(){return Object.keys(l.value).sort()},messages:F,get modifiers(){return T},get pluralRules(){return S||{}},get isGlobal(){return s},get missingWarn(){return d},set missingWarn(st){d=st,w.missingWarn=d},get fallbackWarn(){return f},set fallbackWarn(st){f=st,w.fallbackWarn=f},get fallbackRoot(){return m},set fallbackRoot(st){m=st},get fallbackFormat(){return p},set fallbackFormat(st){p=st,w.fallbackFormat=p},get warnHtmlMessage(){return v},set warnHtmlMessage(st){v=st,w.warnHtmlMessage=st},get escapeParameter(){return b},set escapeParameter(st){b=st,w.escapeParameter=st},t:G,getLocaleMessage:it,setLocaleMessage:U,mergeLocaleMessage:Y,getPostTranslationHandler:O,setPostTranslationHandler:k,getMissingHandler:N,setMissingHandler:B,[Jv]:X};return Pt.datetimeFormats=D,Pt.numberFormats=M,Pt.rt=V,Pt.te=K,Pt.tm=Q,Pt.d=q,Pt.n=H,Pt.getDateTimeFormat=W,Pt.setDateTimeFormat=j,Pt.mergeDateTimeFormat=mt,Pt.getNumberFormat=ut,Pt.setNumberFormat=vt,Pt.mergeNumberFormat=Rt,Pt[Qv]=e,Pt[hm]=ct,Pt[cm]=dt,Pt[um]=rt,Pt}function TC(i){const t=Et(i.locale)?i.locale:Jo,e=Et(i.fallbackLocale)||_e(i.fallbackLocale)||de(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:t,s=ve(i.missing)?i.missing:void 0,r=ie(i.silentTranslationWarn)||Xa(i.silentTranslationWarn)?!i.silentTranslationWarn:!0,n=ie(i.silentFallbackWarn)||Xa(i.silentFallbackWarn)?!i.silentFallbackWarn:!0,a=ie(i.fallbackRoot)?i.fallbackRoot:!0,o=!!i.formatFallbackMessages,h=de(i.modifiers)?i.modifiers:{},l=i.pluralizationRules,c=ve(i.postTranslation)?i.postTranslation:void 0,u=Et(i.warnHtmlInMessage)?i.warnHtmlInMessage!=="off":!0,d=!!i.escapeParameterHtml,f=ie(i.sync)?i.sync:!0;let m=i.messages;if(de(i.sharedMessages)){const T=i.sharedMessages;m=Object.keys(T).reduce((w,E)=>{if($i(E))return w;const A=qe(w,E)||(w[E]={});return Le(A,T[E]),w},m||{})}const{__i18n:p,__root:g,__injectWithOption:y}=i,_=i.datetimeFormats,v=i.numberFormats,b=i.flatJson;return{locale:t,fallbackLocale:e,messages:m,flatJson:b,datetimeFormats:_,numberFormats:v,missing:s,missingWarn:r,fallbackWarn:n,fallbackRoot:a,fallbackFormat:o,modifiers:h,pluralRules:l,postTranslation:c,warnHtmlMessage:u,escapeParameter:d,messageResolver:i.messageResolver,inheritLocale:f,__i18n:p,__root:g,__injectWithOption:y}}function dm(i={}){const t=Gh(TC(i)),{__extender:e}=i,s={id:t.id,get locale(){return t.locale.value},set locale(r){t.locale.value=r},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(r){t.fallbackLocale.value=r},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(r){t.setMissingHandler(r)},get silentTranslationWarn(){return ie(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(r){t.missingWarn=ie(r)?!r:r},get silentFallbackWarn(){return ie(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(r){t.fallbackWarn=ie(r)?!r:r},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(r){t.fallbackFormat=r},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(r){t.setPostTranslationHandler(r)},get sync(){return t.inheritLocale},set sync(r){t.inheritLocale=r},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){t.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(r){t.escapeParameter=r},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...r){return Reflect.apply(t.t,t,[...r])},rt(...r){return Reflect.apply(t.rt,t,[...r])},te(r,n){return t.te(r,n)},tm(r){return t.tm(r)},getLocaleMessage(r){return t.getLocaleMessage(r)},setLocaleMessage(r,n){t.setLocaleMessage(r,n)},mergeLocaleMessage(r,n){t.mergeLocaleMessage(r,n)},d(...r){return Reflect.apply(t.d,t,[...r])},getDateTimeFormat(r){return t.getDateTimeFormat(r)},setDateTimeFormat(r,n){t.setDateTimeFormat(r,n)},mergeDateTimeFormat(r,n){t.mergeDateTimeFormat(r,n)},n(...r){return Reflect.apply(t.n,t,[...r])},getNumberFormat(r){return t.getNumberFormat(r)},setNumberFormat(r,n){t.setNumberFormat(r,n)},mergeNumberFormat(r,n){t.mergeNumberFormat(r,n)}};return s.__extender=e,s}function SC(i,t,e){return{beforeCreate(){const s=tl();if(!s)throw Is(ws.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const n=Le({},r.i18n);if(r.__i18n&&(n.__i18n=r.__i18n),n.__root=t,this===this.$root)this.$i18n=N0(i,n);else{n.__injectWithOption=!0,n.__extender=e.__vueI18nExtend,this.$i18n=dm(n);const a=this.$i18n;a.__extender&&(a.__disposer=a.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=N0(i,r);else{this.$i18n=dm({__i18n:r.__i18n,__injectWithOption:!0,__extender:e.__vueI18nExtend,__root:t});const n=this.$i18n;n.__extender&&(n.__disposer=n.__extender(this.$i18n))}else this.$i18n=i;r.__i18nGlobal&&s_(t,r,r),this.$t=(...n)=>this.$i18n.t(...n),this.$rt=(...n)=>this.$i18n.rt(...n),this.$te=(n,a)=>this.$i18n.te(n,a),this.$d=(...n)=>this.$i18n.d(...n),this.$n=(...n)=>this.$i18n.n(...n),this.$tm=n=>this.$i18n.tm(n),e.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=tl();if(!s)throw Is(ws.UNEXPECTED_ERROR);const r=this.$i18n;r&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r!=null&&r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),e.__deleteInstance(s),delete this.$i18n)}}}function N0(i,t){i.locale=t.locale||i.locale,i.fallbackLocale=t.fallbackLocale||i.fallbackLocale,i.missing=t.missing||i.missing,i.silentTranslationWarn=t.silentTranslationWarn||i.silentFallbackWarn,i.silentFallbackWarn=t.silentFallbackWarn||i.silentFallbackWarn,i.formatFallbackMessages=t.formatFallbackMessages||i.formatFallbackMessages,i.postTranslation=t.postTranslation||i.postTranslation,i.warnHtmlInMessage=t.warnHtmlInMessage||i.warnHtmlInMessage,i.escapeParameterHtml=t.escapeParameterHtml||i.escapeParameterHtml,i.sync=t.sync||i.sync,i.__composer[Jv](t.pluralizationRules||i.pluralizationRules);const e=Mp(i.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(e).forEach(s=>i.mergeLocaleMessage(s,e[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>i.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>i.mergeNumberFormat(s,t.numberFormats[s])),i}const Rp={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:i=>i==="parent"||i==="global",default:"parent"},i18n:{type:Object}};function EC({slots:i},t){return t.length===1&&t[0]==="default"?(i.default?i.default():[]).reduce((s,r)=>[...s,...r.type===bs?r.children:[r]],[]):t.reduce((e,s)=>{const r=i[s];return r&&(e[s]=r()),e},he())}function r_(){return bs}const AC=gp({name:"i18n-t",props:Le({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:i=>Ne(i)||!isNaN(i)}},Rp),setup(i,t){const{slots:e,attrs:s}=t,r=i.i18n||Fp({useScope:i.scope,__useComponent:!0});return()=>{const n=()=>{const h=Object.keys(e).filter(u=>u[0]!=="_"),l=he();i.locale&&(l.locale=i.locale),i.plural!==void 0&&(l.plural=Et(i.plural)?+i.plural:i.plural);const c=EC(t,h);return r[hm](i.keypath,c,l)},a=Le(he(),s),o=Et(i.tag)||se(i.tag)?i.tag:r_();return se(o)?zo(o,a,{default:n}):zo(o,a,n())}}}),U0=AC;function CC(i){return _e(i)&&!Et(i[0])}function i_(i,t,e,s){const{slots:r,attrs:n}=t;return()=>{const a=()=>{const l={part:!0};let c=he();i.locale&&(l.locale=i.locale),Et(i.format)?l.key=i.format:se(i.format)&&(Et(i.format.key)&&(l.key=i.format.key),c=Object.keys(i.format).reduce((f,m)=>e.includes(m)?Le(he(),f,{[m]:i.format[m]}):f,he()));const u=s(i.value,l,c);let d=[l.key];return _e(u)?d=u.map((f,m)=>{const p=r[f.type],g=p?p({[f.type]:f.value,index:m,parts:u}):[f.value];return CC(g)&&(g[0].key=`${f.type}-${m}`),g}):Et(u)&&(d=[u]),d},o=Le(he(),n),h=Et(i.tag)||se(i.tag)?i.tag:r_();return se(h)?zo(h,o,{default:a}):zo(h,o,a())}}const IC=gp({name:"i18n-n",props:Le({value:{type:Number,required:!0},format:{type:[String,Object]}},Rp),setup(i,t){const e=i.i18n||Fp({useScope:i.scope,__useComponent:!0});return i_(i,t,qv,(...s)=>e[um](...s))}}),X0=IC;function PC(i,t){const e=i;if(i.mode==="composition")return e.__getInstance(t)||i.global;{const s=e.__getInstance(t);return s!=null?s.__composer:i.global.__composer}}function MC(i){const t=a=>{const{instance:o,value:h}=a;if(!o||!o.$)throw Is(ws.UNEXPECTED_ERROR);const l=PC(i,o.$),c=V0(h);return[Reflect.apply(l.t,l,[...Y0(c)]),l]};return{created:(a,o)=>{const[h,l]=t(o);Xh&&(a.__i18nWatcher=tn(l.locale,()=>{o.instance&&o.instance.$forceUpdate()})),a.__composer=l,a.textContent=h},unmounted:a=>{Xh&&a.__i18nWatcher&&(a.__i18nWatcher(),a.__i18nWatcher=void 0,delete a.__i18nWatcher),a.__composer&&(a.__composer=void 0,delete a.__composer)},beforeUpdate:(a,{value:o})=>{if(a.__composer){const h=a.__composer,l=V0(o);a.textContent=Reflect.apply(h.t,h,[...Y0(l)])}},getSSRProps:a=>{const[o]=t(a);return{textContent:o}}}}function V0(i){if(Et(i))return{path:i};if(de(i)){if(!("path"in i))throw Is(ws.REQUIRED_VALUE,"path");return i}else throw Is(ws.INVALID_VALUE)}function Y0(i){const{path:t,locale:e,args:s,choice:r,plural:n}=i,a={},o=s||{};return Et(e)&&(a.locale=e),Ne(r)&&(a.plural=r),Ne(n)&&(a.plural=n),[t,o,a]}function RC(i,t,...e){const s=de(e[0])?e[0]:{};(ie(s.globalInstall)?s.globalInstall:!0)&&([U0.name,"I18nT"].forEach(n=>i.component(n,U0)),[X0.name,"I18nN"].forEach(n=>i.component(n,X0)),[H0.name,"I18nD"].forEach(n=>i.component(n,H0))),i.directive("t",MC(t))}const FC=hn("global-vue-i18n");function OL(i={}){const t=__VUE_I18N_LEGACY_API__&&ie(i.legacy)?i.legacy:__VUE_I18N_LEGACY_API__,e=ie(i.globalInjection)?i.globalInjection:!0,s=new Map,[r,n]=kC(i,t),a=hn("");function o(u){return s.get(u)||null}function h(u,d){s.set(u,d)}function l(u){s.delete(u)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(u,...d){if(u.__VUE_I18N_SYMBOL__=a,u.provide(u.__VUE_I18N_SYMBOL__,c),de(d[0])){const p=d[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let f=null;!t&&e&&(f=XC(u,c.global)),__VUE_I18N_FULL_INSTALL__&&RC(u,c,...d),__VUE_I18N_LEGACY_API__&&t&&u.mixin(SC(n,n.__composer,c));const m=u.unmount;u.unmount=()=>{f&&f(),c.dispose(),m()}},get global(){return n},dispose(){r.stop()},__instances:s,__getInstance:o,__setInstance:h,__deleteInstance:l};return c}function Fp(i={}){const t=tl();if(t==null)throw Is(ws.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Is(ws.NOT_INSTALLED);const e=LC(t),s=OC(e),r=e_(t),n=BC(i,r);if(n==="global")return s_(s,i,r),s;if(n==="parent"){let h=G0(e,t,i.__useComponent);return h==null&&(h=s),h}if(n==="isolated"){if(e.mode!=="composition")throw Is(ws.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const h=e,l=Le({},i),c=G0(e,t);l.__root=c||s;const u=Gh(l);return h.__composerExtend&&(u[ya]=h.__composerExtend(u)),np()&&yb(()=>{const f=u[ya];f&&(f(),delete u[ya])}),u}const a=e;let o=a.__getInstance(t);if(o==null){const h=Le({},i);"__i18n"in r&&(h.__i18n=r.__i18n),s&&(h.__root=s),o=Gh(h),a.__composerExtend&&(o[ya]=a.__composerExtend(o)),NC(a,t,o),a.__setInstance(t,o)}return o}function kC(i,t){const e=ip(),s=__VUE_I18N_LEGACY_API__&&t?e.run(()=>dm(i)):e.run(()=>Gh(i));if(s==null)throw Is(ws.UNEXPECTED_ERROR);return[e,s]}function LC(i){const t=Ca(i.isCE?FC:i.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Is(i.isCE?ws.NOT_INSTALLED_WITH_PROVIDE:ws.UNEXPECTED_ERROR);return t}function BC(i,t){return Tp(i)?"__i18n"in t?"local":"global":i.useScope?i.useScope:"local"}function OC(i){return i.mode==="composition"?i.global:i.global.__composer}function G0(i,t,e=!1){let s=null;const r=t.root;let n=DC(t,e);for(;n!=null;){const a=i;if(i.mode==="composition")s=a.__getInstance(n);else if(__VUE_I18N_LEGACY_API__){const o=a.__getInstance(n);o!=null&&(s=o.__composer,e&&s&&!s[Qv]&&(s=null))}if(s!=null||r===n)break;n=n.parent}return s}function DC(i,t=!1){return i==null?null:t&&i.vnode.ctx||i.parent}function NC(i,t,e){yp(()=>{},t),xp(()=>{const s=e;i.__deleteInstance(t);const r=s[ya];r&&(r(),delete s[ya])},t)}const UC=["locale","fallbackLocale","availableLocales"],$0=["t","rt","d","n","tm","te"];function XC(i,t){const e=Object.create(null);return UC.forEach(r=>{const n=Object.getOwnPropertyDescriptor(t,r);if(!n)throw Is(ws.UNEXPECTED_ERROR);const a=Ce(n.value)?{get(){return n.value.value},set(o){n.value.value=o}}:{get(){return n.get&&n.get()}};Object.defineProperty(e,r,a)}),i.config.globalProperties.$i18n=e,$0.forEach(r=>{const n=Object.getOwnPropertyDescriptor(t,r);if(!n||!n.value)throw Is(ws.UNEXPECTED_ERROR);Object.defineProperty(i.config.globalProperties,`$${r}`,n)}),()=>{delete i.config.globalProperties.$i18n,$0.forEach(r=>{delete i.config.globalProperties[`$${r}`]})}}const VC=gp({name:"i18n-d",props:Le({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rp),setup(i,t){const e=i.i18n||Fp({useScope:i.scope,__useComponent:!0});return i_(i,t,jv,(...s)=>e[cm](...s))}}),H0=VC;vC();QA(kA);tC(KA);eC(XA);if(__INTLIFY_PROD_DEVTOOLS__){const i=Ki();i.__INTLIFY__=!0,LA(i.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}var Kn=(i=>(i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2",i))(Kn||{}),n_=(i=>(i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS",i))(n_||{}),fm=(i=>(i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL",i))(fm||{}),It=(i=>(i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR",i))(It||{}),Yr=(i=>(i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i))(Yr||{}),ft=(i=>(i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i))(ft||{}),Pa=(i=>(i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i))(Pa||{}),wt=(i=>(i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT",i))(wt||{}),Tt=(i=>(i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT",i))(Tt||{}),Ns=(i=>(i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR",i))(Ns||{}),Ps=(i=>(i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i))(Ps||{}),Ms=(i=>(i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL",i))(Ms||{}),Ke=(i=>(i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",i))(Ke||{}),Nr=(i=>(i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT",i))(Nr||{}),kp=(i=>(i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL",i))(kp||{}),Ks=(i=>(i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp",i))(Ks||{}),Ye=(i=>(i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE",i[i.COLOR=4]="COLOR",i))(Ye||{}),De=(i=>(i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH",i))(De||{}),$r=(i=>(i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i))($r||{});const YC={createCanvas:(i,t)=>{const e=document.createElement("canvas");return e.width=i,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,t)=>fetch(i,t),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")},_t={ADAPTER:YC,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var md=/iPhone/i,W0=/iPod/i,z0=/iPad/i,j0=/\biOS-universal(?:.+)Mac\b/i,pd=/\bAndroid(?:.+)Mobile\b/i,q0=/Android/i,aa=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,zl=/Silk/i,ti=/Windows Phone/i,K0=/\bWindows(?:.+)ARM\b/i,Z0=/BlackBerry/i,J0=/BB10/i,Q0=/Opera Mini/i,ty=/\b(CriOS|Chrome)(?:.+)Mobile/i,ey=/Mobile(?:.+)Firefox\b/i,sy=function(i){return typeof i<"u"&&i.platform==="MacIntel"&&typeof i.maxTouchPoints=="number"&&i.maxTouchPoints>1&&typeof MSStream>"u"};function GC(i){return function(t){return t.test(i)}}function ry(i){var t={userAgent:"",platform:"",maxTouchPoints:0};!i&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof i=="string"?t.userAgent=i:i&&i.userAgent&&(t={userAgent:i.userAgent,platform:i.platform,maxTouchPoints:i.maxTouchPoints||0});var e=t.userAgent,s=e.split("[FBAN");typeof s[1]<"u"&&(e=s[0]),s=e.split("Twitter"),typeof s[1]<"u"&&(e=s[0]);var r=GC(e),n={apple:{phone:r(md)&&!r(ti),ipod:r(W0),tablet:!r(md)&&(r(z0)||sy(t))&&!r(ti),universal:r(j0),device:(r(md)||r(W0)||r(z0)||r(j0)||sy(t))&&!r(ti)},amazon:{phone:r(aa),tablet:!r(aa)&&r(zl),device:r(aa)||r(zl)},android:{phone:!r(ti)&&r(aa)||!r(ti)&&r(pd),tablet:!r(ti)&&!r(aa)&&!r(pd)&&(r(zl)||r(q0)),device:!r(ti)&&(r(aa)||r(zl)||r(pd)||r(q0))||r(/\bokhttp\b/i)},windows:{phone:r(ti),tablet:r(K0),device:r(ti)||r(K0)},other:{blackberry:r(Z0),blackberry10:r(J0),opera:r(Q0),firefox:r(ey),chrome:r(ty),device:r(Z0)||r(J0)||r(Q0)||r(ey)||r(ty)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const $C=ry.default??ry,pi=$C(globalThis.navigator);_t.RETINA_PREFIX=/@([0-9\.]+)x/;_t.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var $h=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function a_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function HC(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var t=i.default;if(typeof t=="function"){var e=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),e}var gd={exports:{}},iy;function WC(){return iy||(iy=1,(function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,u||h,d),m=e?e+l:l;return h._events[m]?h._events[m].fn?h._events[m]=[h._events[m],f]:h._events[m].push(f):(h._events[m]=f,h._eventsCount++),h}function a(h,l){--h._eventsCount===0?h._events=new s:delete h._events[l]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,m=new Array(f);d80*k){V=H=M[0],q=at=M[1];for(var rt=k;rtH&&(H=et),ot>at&&(at=ot);ct=Math.max(H-V,at-q),ct=ct!==0?32767/ct:0}return s(L,G,k,V,q,ct,0),G}function t(M,O,k,N,B){var L,G;if(B===D(M,O,k,N)>0)for(L=O;L=O;L-=N)G=C(L,M[L],M[L+1],G);return G&&b(G,G.next)&&(R(G),G=G.next),G}function e(M,O){if(!M)return M;O||(O=M);var k=M,N;do if(N=!1,!k.steiner&&(b(k,k.next)||v(k.prev,k,k.next)===0)){if(R(k),k=O=k.prev,k===k.next)break;N=!0}else k=k.next;while(N||k!==O);return O}function s(M,O,k,N,B,L,G){if(M){!G&&L&&f(M,N,B,L);for(var V=M,q,H;M.prev!==M.next;){if(q=M.prev,H=M.next,L?n(M,N,B,L):r(M)){O.push(q.i/k|0),O.push(M.i/k|0),O.push(H.i/k|0),R(M),M=H.next,V=H.next;continue}if(M=H,M===V){G?G===1?(M=a(e(M),O,k),s(M,O,k,N,B,L,2)):G===2&&o(M,O,k,N,B,L):s(e(M),O,k,N,B,L,1);break}}}}function r(M){var O=M.prev,k=M,N=M.next;if(v(O,k,N)>=0)return!1;for(var B=O.x,L=k.x,G=N.x,V=O.y,q=k.y,H=N.y,at=BL?B>G?B:G:L>G?L:G,ct=V>q?V>H?V:H:q>H?q:H,rt=N.next;rt!==O;){if(rt.x>=at&&rt.x<=ot&&rt.y>=et&&rt.y<=ct&&y(B,V,L,q,G,H,rt.x,rt.y)&&v(rt.prev,rt,rt.next)>=0)return!1;rt=rt.next}return!0}function n(M,O,k,N){var B=M.prev,L=M,G=M.next;if(v(B,L,G)>=0)return!1;for(var V=B.x,q=L.x,H=G.x,at=B.y,et=L.y,ot=G.y,ct=Vq?V>H?V:H:q>H?q:H,X=at>et?at>ot?at:ot:et>ot?et:ot,$=p(ct,rt,O,k,N),K=p(dt,X,O,k,N),J=M.prevZ,Q=M.nextZ;J&&J.z>=$&&Q&&Q.z<=K;){if(J.x>=ct&&J.x<=dt&&J.y>=rt&&J.y<=X&&J!==B&&J!==G&&y(V,at,q,et,H,ot,J.x,J.y)&&v(J.prev,J,J.next)>=0||(J=J.prevZ,Q.x>=ct&&Q.x<=dt&&Q.y>=rt&&Q.y<=X&&Q!==B&&Q!==G&&y(V,at,q,et,H,ot,Q.x,Q.y)&&v(Q.prev,Q,Q.next)>=0))return!1;Q=Q.nextZ}for(;J&&J.z>=$;){if(J.x>=ct&&J.x<=dt&&J.y>=rt&&J.y<=X&&J!==B&&J!==G&&y(V,at,q,et,H,ot,J.x,J.y)&&v(J.prev,J,J.next)>=0)return!1;J=J.prevZ}for(;Q&&Q.z<=K;){if(Q.x>=ct&&Q.x<=dt&&Q.y>=rt&&Q.y<=X&&Q!==B&&Q!==G&&y(V,at,q,et,H,ot,Q.x,Q.y)&&v(Q.prev,Q,Q.next)>=0)return!1;Q=Q.nextZ}return!0}function a(M,O,k){var N=M;do{var B=N.prev,L=N.next.next;!b(B,L)&&T(B,N,N.next,L)&&A(B,L)&&A(L,B)&&(O.push(B.i/k|0),O.push(N.i/k|0),O.push(L.i/k|0),R(N),R(N.next),N=M=L),N=N.next}while(N!==M);return e(N)}function o(M,O,k,N,B,L){var G=M;do{for(var V=G.next.next;V!==G.prev;){if(G.i!==V.i&&_(G,V)){var q=I(G,V);G=e(G,G.next),q=e(q,q.next),s(G,O,k,N,B,L,0),s(q,O,k,N,B,L,0);return}V=V.next}G=G.next}while(G!==M)}function h(M,O,k,N){var B=[],L,G,V,q,H;for(L=0,G=O.length;L=k.next.y&&k.next.y!==k.y){var V=k.x+(B-k.y)*(k.next.x-k.x)/(k.next.y-k.y);if(V<=N&&V>L&&(L=V,G=k.x=k.x&&k.x>=H&&N!==k.x&&y(BG.x||k.x===G.x&&d(G,k)))&&(G=k,et=ot)),k=k.next;while(k!==q);return G}function d(M,O){return v(M.prev,M,O.prev)<0&&v(O.next,M,M.next)<0}function f(M,O,k,N){var B=M;do B.z===0&&(B.z=p(B.x,B.y,O,k,N)),B.prevZ=B.prev,B.nextZ=B.next,B=B.next;while(B!==M);B.prevZ.nextZ=null,B.prevZ=null,m(B)}function m(M){var O,k,N,B,L,G,V,q,H=1;do{for(k=M,M=null,L=null,G=0;k;){for(G++,N=k,V=0,O=0;O0||q>0&&N;)V!==0&&(q===0||!N||k.z<=N.z)?(B=k,k=k.nextZ,V--):(B=N,N=N.nextZ,q--),L?L.nextZ=B:M=B,B.prevZ=L,L=B;k=N}L.nextZ=null,H*=2}while(G>1);return M}function p(M,O,k,N,B){return M=(M-k)*B|0,O=(O-N)*B|0,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,M|O<<1}function g(M){var O=M,k=M;do(O.x=(M-G)*(L-V)&&(M-G)*(N-V)>=(k-G)*(O-V)&&(k-G)*(L-V)>=(B-G)*(N-V)}function _(M,O){return M.next.i!==O.i&&M.prev.i!==O.i&&!E(M,O)&&(A(M,O)&&A(O,M)&&P(M,O)&&(v(M.prev,M,O.prev)||v(M,O.prev,O))||b(M,O)&&v(M.prev,M,M.next)>0&&v(O.prev,O,O.next)>0)}function v(M,O,k){return(O.y-M.y)*(k.x-O.x)-(O.x-M.x)*(k.y-O.y)}function b(M,O){return M.x===O.x&&M.y===O.y}function T(M,O,k,N){var B=w(v(M,O,k)),L=w(v(M,O,N)),G=w(v(k,N,M)),V=w(v(k,N,O));return!!(B!==L&&G!==V||B===0&&S(M,k,O)||L===0&&S(M,N,O)||G===0&&S(k,M,N)||V===0&&S(k,O,N))}function S(M,O,k){return O.x<=Math.max(M.x,k.x)&&O.x>=Math.min(M.x,k.x)&&O.y<=Math.max(M.y,k.y)&&O.y>=Math.min(M.y,k.y)}function w(M){return M>0?1:M<0?-1:0}function E(M,O){var k=M;do{if(k.i!==M.i&&k.next.i!==M.i&&k.i!==O.i&&k.next.i!==O.i&&T(k,k.next,M,O))return!0;k=k.next}while(k!==M);return!1}function A(M,O){return v(M.prev,M,M.next)<0?v(M,O,M.next)>=0&&v(M,M.prev,O)>=0:v(M,O,M.prev)<0||v(M,M.next,O)<0}function P(M,O){var k=M,N=!1,B=(M.x+O.x)/2,L=(M.y+O.y)/2;do k.y>L!=k.next.y>L&&k.next.y!==k.y&&B<(k.next.x-k.x)*(L-k.y)/(k.next.y-k.y)+k.x&&(N=!N),k=k.next;while(k!==M);return N}function I(M,O){var k=new F(M.i,M.x,M.y),N=new F(O.i,O.x,O.y),B=M.next,L=O.prev;return M.next=O,O.prev=M,k.next=B,B.prev=k,N.next=k,k.prev=N,L.next=N,N.prev=L,N}function C(M,O,k,N){var B=new F(M,O,k);return N?(B.next=N.next,B.prev=N,N.next.prev=B,N.next=B):(B.prev=B,B.next=B),B}function R(M){M.next.prev=M.prev,M.prev.next=M.next,M.prevZ&&(M.prevZ.nextZ=M.nextZ),M.nextZ&&(M.nextZ.prevZ=M.prevZ)}function F(M,O,k){this.i=M,this.x=O,this.y=k,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}i.deviation=function(M,O,k,N){var B=O&&O.length,L=B?O[0]*k:M.length,G=Math.abs(D(M,0,L,k));if(B)for(var V=0,q=O.length;V0&&(N+=M[B-1].length,k.holes.push(N))}return k},jl.exports}var qC=jC();const KC=a_(qC);var bn={},vo={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var ZC=vo.exports,ay;function JC(){return ay||(ay=1,(function(i,t){(function(e){var s=t&&!t.nodeType&&t,r=i&&!i.nodeType&&i,n=typeof $h=="object"&&$h;(n.global===n||n.window===n||n.self===n)&&(e=n);var a,o=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,m=128,p="-",g=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-l,T=Math.floor,S=String.fromCharCode,w;function E(B){throw new RangeError(v[B])}function A(B,L){for(var G=B.length,V=[];G--;)V[G]=L(B[G]);return V}function P(B,L){var G=B.split("@"),V="";G.length>1&&(V=G[0]+"@",B=G[1]),B=B.replace(_,".");var q=B.split("."),H=A(q,L).join(".");return V+H}function I(B){for(var L=[],G=0,V=B.length,q,H;G=55296&&q<=56319&&G65535&&(L-=65536,G+=S(L>>>10&1023|55296),L=56320|L&1023),G+=S(L),G}).join("")}function R(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:h}function F(B,L){return B+22+75*(B<26)-((L!=0)<<5)}function D(B,L,G){var V=0;for(B=G?T(B/d):B>>1,B+=T(B/L);B>b*c>>1;V+=h)B=T(B/b);return T(V+(b+1)*B/(B+u))}function M(B){var L=[],G=B.length,V,q=0,H=m,at=f,et,ot,ct,rt,dt,X,$,K,J;for(et=B.lastIndexOf(p),et<0&&(et=0),ot=0;ot=128&&E("not-basic"),L.push(B.charCodeAt(ot));for(ct=et>0?et+1:0;ct=G&&E("invalid-input"),$=R(B.charCodeAt(ct++)),($>=h||$>T((o-q)/dt))&&E("overflow"),q+=$*dt,K=X<=at?l:X>=at+c?c:X-at,!($T(o/J)&&E("overflow"),dt*=J;V=L.length+1,at=D(q-rt,V,rt==0),T(q/V)>o-H&&E("overflow"),H+=T(q/V),q%=V,L.splice(q++,0,H)}return C(L)}function O(B){var L,G,V,q,H,at,et,ot,ct,rt,dt,X=[],$,K,J,Q;for(B=I(B),$=B.length,L=m,G=0,H=f,at=0;at<$;++at)dt=B[at],dt<128&&X.push(S(dt));for(V=q=X.length,q&&X.push(p);V<$;){for(et=o,at=0;at<$;++at)dt=B[at],dt>=L&&dtT((o-G)/K)&&E("overflow"),G+=(et-L)*K,L=et,at=0;at<$;++at)if(dt=B[at],dto&&E("overflow"),dt==L){for(ot=G,ct=h;rt=ct<=H?l:ct>=H+c?c:ct-H,!(ot-1e3&&tt<1e3||S.call(/e/,nt))return nt;var ee=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof tt=="number"){var me=tt<0?-P(-tt):P(tt);if(me!==tt){var xe=String(me),Yt=_.call(nt,xe.length+1);return v.call(xe,ee,"$&_")+"."+v.call(v.call(Yt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(nt,ee,"$&_")}var N=eI,B=N.custom,L=K(B)?B:null,G={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};xd=function tt(nt,ee,me,xe){var Yt=ee||{};if(it(Yt,"quoteStyle")&&!it(G,Yt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(it(Yt,"maxStringLength")&&(typeof Yt.maxStringLength=="number"?Yt.maxStringLength<0&&Yt.maxStringLength!==1/0:Yt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Bi=it(Yt,"customInspect")?Yt.customInspect:!0;if(typeof Bi!="boolean"&&Bi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(it(Yt,"indent")&&Yt.indent!==null&&Yt.indent!==" "&&!(parseInt(Yt.indent,10)===Yt.indent&&Yt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(it(Yt,"numericSeparator")&&typeof Yt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var mn=Yt.numericSeparator;if(typeof nt>"u")return"undefined";if(nt===null)return"null";if(typeof nt=="boolean")return nt?"true":"false";if(typeof nt=="string")return st(nt,Yt);if(typeof nt=="number"){if(nt===0)return 1/0/nt>0?"0":"-0";var Rs=String(nt);return mn?k(nt,Rs):Rs}if(typeof nt=="bigint"){var Oi=String(nt)+"n";return mn?k(nt,Oi):Oi}var $u=typeof Yt.depth>"u"?5:Yt.depth;if(typeof me>"u"&&(me=0),me>=$u&&$u>0&&typeof nt=="object")return et(nt)?"[Array]":"[Object]";var sa=Es(Yt,me);if(typeof xe>"u")xe=[];else if(W(xe,nt)>=0)return"[Circular]";function sr(ra,Nl,Vw){if(Nl&&(xe=A.call(xe),xe.push(Nl)),Vw){var Sg={depth:Yt.depth};return it(Yt,"quoteStyle")&&(Sg.quoteStyle=Yt.quoteStyle),tt(ra,Sg,me+1,xe)}return tt(ra,Yt,me+1,xe)}if(typeof nt=="function"&&!ct(nt)){var yg=Y(nt),xg=Xe(nt,sr);return"[Function"+(yg?": "+yg:" (anonymous)")+"]"+(xg.length>0?" { "+E.call(xg,", ")+" }":"")}if(K(nt)){var bg=F?v.call(String(nt),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(nt);return typeof nt=="object"&&!F?kt(bg):bg}if(Pt(nt)){for(var oo="<"+T.call(String(nt.nodeName)),Hu=nt.attributes||[],Dl=0;Dl",oo}if(et(nt)){if(nt.length===0)return"[]";var Wu=Xe(nt,sr);return sa&&!Ss(Wu)?"["+Li(Wu,sa)+"]":"[ "+E.call(Wu,", ")+" ]"}if(rt(nt)){var zu=Xe(nt,sr);return!("cause"in Error.prototype)&&"cause"in nt&&!M.call(nt,"cause")?"{ ["+String(nt)+"] "+E.call(w.call("[cause]: "+sr(nt.cause),zu),", ")+" }":zu.length===0?"["+String(nt)+"]":"{ ["+String(nt)+"] "+E.call(zu,", ")+" }"}if(typeof nt=="object"&&Bi){if(L&&typeof nt[L]=="function"&&N)return N(nt,{depth:$u-me});if(Bi!=="symbol"&&typeof nt.inspect=="function")return nt.inspect()}if(j(nt)){var vg=[];return s&&s.call(nt,function(ra,Nl){vg.push(sr(Nl,nt,!0)+" => "+sr(ra,nt))}),Pe("Map",e.call(nt),vg,sa)}if(vt(nt)){var _g=[];return o&&o.call(nt,function(ra){_g.push(sr(ra,nt))}),Pe("Set",a.call(nt),_g,sa)}if(mt(nt))return Xt("WeakMap");if(Rt(nt))return Xt("WeakSet");if(ut(nt))return Xt("WeakRef");if(X(nt))return kt(sr(Number(nt)));if(J(nt))return kt(sr(I.call(nt)));if($(nt))return kt(m.call(nt));if(dt(nt))return kt(sr(String(nt)));if(typeof window<"u"&&nt===window)return"{ [object Window] }";if(typeof globalThis<"u"&&nt===globalThis||typeof $h<"u"&&nt===$h)return"{ [object globalThis] }";if(!ot(nt)&&!ct(nt)){var ju=Xe(nt,sr),wg=O?O(nt)===Object.prototype:nt instanceof Object||nt.constructor===Object,qu=nt instanceof Object?"":"null prototype",Tg=!wg&&D&&Object(nt)===nt&&D in nt?_.call(U(nt),8,-1):qu?"Object":"",Xw=wg||typeof nt.constructor!="function"?"":nt.constructor.name?nt.constructor.name+" ":"",Ku=Xw+(Tg||qu?"["+E.call(w.call([],Tg||[],qu||[]),": ")+"] ":"");return ju.length===0?Ku+"{}":sa?Ku+"{"+Li(ju,sa)+"}":Ku+"{ "+E.call(ju,", ")+" }"}return String(nt)};function q(tt,nt,ee){var me=ee.quoteStyle||nt,xe=G[me];return xe+tt+xe}function H(tt){return v.call(String(tt),/"/g,""")}function at(tt){return!D||!(typeof tt=="object"&&(D in tt||typeof tt[D]<"u"))}function et(tt){return U(tt)==="[object Array]"&&at(tt)}function ot(tt){return U(tt)==="[object Date]"&&at(tt)}function ct(tt){return U(tt)==="[object RegExp]"&&at(tt)}function rt(tt){return U(tt)==="[object Error]"&&at(tt)}function dt(tt){return U(tt)==="[object String]"&&at(tt)}function X(tt){return U(tt)==="[object Number]"&&at(tt)}function $(tt){return U(tt)==="[object Boolean]"&&at(tt)}function K(tt){if(F)return tt&&typeof tt=="object"&&tt instanceof Symbol;if(typeof tt=="symbol")return!0;if(!tt||typeof tt!="object"||!R)return!1;try{return R.call(tt),!0}catch{}return!1}function J(tt){if(!tt||typeof tt!="object"||!I)return!1;try{return I.call(tt),!0}catch{}return!1}var Q=Object.prototype.hasOwnProperty||function(tt){return tt in this};function it(tt,nt){return Q.call(tt,nt)}function U(tt){return p.call(tt)}function Y(tt){if(tt.name)return tt.name;var nt=y.call(g.call(tt),/^function\s*([\w$]+)/);return nt?nt[1]:null}function W(tt,nt){if(tt.indexOf)return tt.indexOf(nt);for(var ee=0,me=tt.length;eent.maxStringLength){var ee=tt.length-nt.maxStringLength,me="... "+ee+" more character"+(ee>1?"s":"");return st(_.call(tt,0,nt.maxStringLength),nt)+me}var xe=V[nt.quoteStyle||"single"];xe.lastIndex=0;var Yt=v.call(v.call(tt,xe,"\\$1"),/[\x00-\x1f]/g,lt);return q(Yt,"single",nt)}function lt(tt){var nt=tt.charCodeAt(0),ee={8:"b",9:"t",10:"n",12:"f",13:"r"}[nt];return ee?"\\"+ee:"\\x"+(nt<16?"0":"")+b.call(nt.toString(16))}function kt(tt){return"Object("+tt+")"}function Xt(tt){return tt+" { ? }"}function Pe(tt,nt,ee,me){var xe=me?Li(ee,me):E.call(ee,", ");return tt+" ("+nt+") {"+xe+"}"}function Ss(tt){for(var nt=0;nt=0)return!1;return!0}function Es(tt,nt){var ee;if(tt.indent===" ")ee=" ";else if(typeof tt.indent=="number"&&tt.indent>0)ee=E.call(Array(tt.indent+1)," ");else return null;return{base:ee,prev:E.call(Array(nt+1),ee)}}function Li(tt,nt){if(tt.length===0)return"";var ee=` `+nt.prev+nt.base;return ee+E.call(tt,","+ee)+` `+nt.prev}function Xe(tt,nt){var ee=et(tt),me=[];if(ee){me.length=tt.length;for(var xe=0;xe"u"||!w?i:w(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":S&&w?w([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":s,"%Float16Array%":typeof Float16Array>"u"?i:Float16Array,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&w?w(w([][Symbol.iterator]())):i,"%JSON%":typeof JSON=="object"?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!w?i:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!w?i:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&w?w(""[Symbol.iterator]()):i,"%Symbol%":S?Symbol:i,"%SyntaxError%":a,"%ThrowTypeError%":T,"%TypedArray%":R,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":P,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":E,"%Math.abs%":l,"%Math.floor%":c,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":m,"%Math.sign%":p,"%Reflect.getPrototypeOf%":A};if(w)try{null.error}catch(ct){var D=w(w(ct));F["%Error.prototype%"]=D}var M=function ct(rt){var dt;if(rt==="%AsyncFunction%")dt=y("async function () {}");else if(rt==="%GeneratorFunction%")dt=y("function* () {}");else if(rt==="%AsyncGeneratorFunction%")dt=y("async function* () {}");else if(rt==="%AsyncGenerator%"){var X=ct("%AsyncGeneratorFunction%");X&&(dt=X.prototype)}else if(rt==="%AsyncIteratorPrototype%"){var $=ct("%AsyncGenerator%");$&&w&&(dt=w($.prototype))}return F[rt]=dt,dt},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=Yc(),N=EI(),B=k.call(I,Array.prototype.concat),L=k.call(P,Array.prototype.splice),G=k.call(I,String.prototype.replace),V=k.call(I,String.prototype.slice),q=k.call(I,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,at=/\\(\\)?/g,et=function(rt){var dt=V(rt,0,1),X=V(rt,-1);if(dt==="%"&&X!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&dt!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var $=[];return G(rt,H,function(K,J,Q,it){$[$.length]=Q?G(it,at,"$1"):J||K}),$},ot=function(rt,dt){var X=rt,$;if(N(O,X)&&($=O[X],X="%"+$[0]+"%"),N(F,X)){var K=F[X];if(K===C&&(K=M(X)),typeof K>"u"&&!dt)throw new o("intrinsic "+rt+" exists, but is not available. Please file an issue!");return{alias:$,name:X,value:K}}throw new a("intrinsic "+rt+" does not exist!")};return Jd=function(rt,dt){if(typeof rt!="string"||rt.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof dt!="boolean")throw new o('"allowMissing" argument must be a boolean');if(q(/^%?[^%]*%?$/,rt)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=et(rt),$=X.length>0?X[0]:"",K=ot("%"+$+"%",dt),J=K.name,Q=K.value,it=!1,U=K.alias;U&&($=U[0],L(X,B([0,1],U)));for(var Y=1,W=!0;Y=X.length){var vt=_(Q,j);W=!!vt,W&&"get"in vt&&!("originalValue"in vt.get)?Q=vt.get:Q=Q[j]}else W=N(Q,j),Q=Q[j];W&&!it&&(F[J]=Q)}}return Q},Jd}var Qd,Gy;function m_(){if(Gy)return Qd;Gy=1;var i=Bp(),t=f_(),e=t([i("%String.prototype.indexOf%")]);return Qd=function(r,n){var a=i(r,!!n);return typeof a=="function"&&e(r,".prototype.")>-1?t([a]):a},Qd}var tf,$y;function p_(){if($y)return tf;$y=1;var i=Bp(),t=m_(),e=Vc(),s=Qa(),r=i("%Map%",!0),n=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),o=t("Map.prototype.has",!0),h=t("Map.prototype.delete",!0),l=t("Map.prototype.size",!0);return tf=!!r&&function(){var u,d={assert:function(f){if(!d.has(f))throw new s("Side channel does not contain "+e(f))},delete:function(f){if(u){var m=h(u,f);return l(u)===0&&(u=void 0),m}return!1},get:function(f){if(u)return n(u,f)},has:function(f){return u?o(u,f):!1},set:function(f,m){u||(u=new r),a(u,f,m)}};return d},tf}var ef,Hy;function AI(){if(Hy)return ef;Hy=1;var i=Bp(),t=m_(),e=Vc(),s=p_(),r=Qa(),n=i("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),o=t("WeakMap.prototype.set",!0),h=t("WeakMap.prototype.has",!0),l=t("WeakMap.prototype.delete",!0);return ef=n?function(){var u,d,f={assert:function(m){if(!f.has(m))throw new r("Side channel does not contain "+e(m))},delete:function(m){if(n&&m&&(typeof m=="object"||typeof m=="function")){if(u)return l(u,m)}else if(s&&d)return d.delete(m);return!1},get:function(m){return n&&m&&(typeof m=="object"||typeof m=="function")&&u?a(u,m):d&&d.get(m)},has:function(m){return n&&m&&(typeof m=="object"||typeof m=="function")&&u?h(u,m):!!d&&d.has(m)},set:function(m,p){n&&m&&(typeof m=="object"||typeof m=="function")?(u||(u=new n),o(u,m,p)):s&&(d||(d=s()),d.set(m,p))}};return f}:s,ef}var sf,Wy;function g_(){if(Wy)return sf;Wy=1;var i=Qa(),t=Vc(),e=sI(),s=p_(),r=AI(),n=r||s||e;return sf=function(){var o,h={assert:function(l){if(!h.has(l)){var c=l&&Object(l)===l?"the given object key":t(l);throw new i("Side channel does not contain "+c)}},delete:function(l){return!!o&&o.delete(l)},get:function(l){return o&&o.get(l)},has:function(l){return!!o&&o.has(l)},set:function(l,c){o||(o=n()),o.set(l,c)}};return h},sf}var rf,zy;function Op(){if(zy)return rf;zy=1;var i=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return rf={default:e.RFC3986,formatters:{RFC1738:function(s){return i.call(s,t,"+")},RFC3986:function(s){return String(s)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},rf}var nf,jy;function y_(){if(jy)return nf;jy=1;var i=Op(),t=g_(),e=h_(),s=Object.prototype.hasOwnProperty,r=Array.isArray,n=t(),a=function(A,P){return n.set(A,P),A},o=function(A){return n.has(A)},h=function(A){return n.get(A)},l=function(A,P){n.set(A,P)},c=(function(){for(var E=[],A=0;A<256;++A)E[E.length]="%"+((A<16?"0":"")+A.toString(16)).toUpperCase();return E})(),u=function(A){for(;A.length>1;){var P=A.pop(),I=P.obj[P.prop];if(r(I)){for(var C=[],R=0;R=I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(A.concat(P),I),C)}A[C]=P}else if(A&&typeof A=="object")if(o(A)){var R=h(A)+1;A[R]=P,l(A,R)}else{if(I&&I.strictMerge)return[A,P];(I&&(I.plainObjects||I.allowPrototypes)||!s.call(Object.prototype,P))&&(A[P]=!0)}else return[A,P];return A}if(!A||typeof A!="object"){if(o(P)){for(var F=Object.keys(P),D=I&&I.plainObjects?{__proto__:null,0:A}:{0:A},M=0;MI.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(k,I),k.length-1)}return k}var N=A;if(r(A)&&!r(P)&&(N=d(A,I)),r(A)&&r(P)){if(P.forEach(function(B,L){if(s.call(A,L)){var G=A[L];G&&typeof G=="object"&&B&&typeof B=="object"?A[L]=E(G,B,I):A[A.length]=B}else A[L]=B}),I&&typeof I.arrayLimit=="number"&&A.length>I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(A,I),A.length-1)}return A}return Object.keys(P).reduce(function(B,L){var G=P[L];if(s.call(B,L)?f(B,L,E(B[L],G,I)):f(B,L,G),o(P)&&!o(B)&&a(B,h(P)),o(B)){var V=parseInt(L,10);String(V)===L&&V>=0&&V>h(B)&&l(B,V)}return B},N)},p=function(A,P){return Object.keys(P).reduce(function(I,C){return f(I,C,P[C]),I},A)},g=function(E,A,P){var I=E.replace(/\+/g," ");if(P==="iso-8859-1")return I.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(I)}catch{return I}},y=1024,_=function(A,P,I,C,R){if(A.length===0)return A;var F=A;if(typeof A=="symbol"?F=Symbol.prototype.toString.call(A):typeof A!="string"&&(F=String(A)),I==="iso-8859-1")return escape(F).replace(/%u[0-9a-f]{4}/gi,function(G){return"%26%23"+parseInt(G.slice(2),16)+"%3B"});for(var D="",M=0;M=y?F.slice(M,M+y):F;if(M+y=55296&&k<=56319&&(O=O.slice(0,-1),M-=1)}for(var N=[],B=0;B=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||R===i.RFC1738&&(L===40||L===41)){N[N.length]=O.charAt(B);continue}if(L<128){N[N.length]=c[L];continue}if(L<2048){N[N.length]=c[192|L>>6]+c[128|L&63];continue}if(L<55296||L>=57344){N[N.length]=c[224|L>>12]+c[128|L>>6&63]+c[128|L&63];continue}B+=1,L=65536+((L&1023)<<10|O.charCodeAt(B)&1023),N[N.length]=c[240|L>>18]+c[128|L>>12&63]+c[128|L>>6&63]+c[128|L&63]}D+=N.join("")}return D},v=function(A){for(var P=[{obj:{o:A},prop:"o"}],I=t(),C=0;CI){if(R)throw new RangeError("Array limit exceeded. Only "+I+" element"+(I===1?"":"s")+" allowed in an array.");return a(d(D,{plainObjects:C}),D.length-1)}return D},w=function(A,P){if(r(A)){for(var I=[],C=0;C"u"&&(B=0)}if(typeof A=="function"?k=A(y,k):k instanceof Date?k=C(k):_==="comma"&&n(k)&&(k=t.maybeMap(k,function(J){return J instanceof Date?C(J):J})),k===null){if(T)return F(E&&!D?E(y,c.encoder,M,"key",R):y);k=""}if(u(k)||t.isBuffer(k)){if(E){var V=D?y:E(y,c.encoder,M,"key",R);return[F(V)+"="+F(E(k,c.encoder,M,"value",R))]}return[F(y)+"="+F(String(k))]}var q=[];if(typeof k>"u")return q;var H;if(_==="comma"&&n(k))D&&E&&(k=t.maybeMap(k,function(J){return J==null?J:E(J)})),H=[{value:k.length>0?k.join(",")||null:void 0}];else if(n(A))H=A;else{var at=Object.keys(k);H=P?at.sort(P):at}var et=w?String(y).replace(/\./g,"%2E"):String(y),ot=v&&n(k)&&k.length===1?et+"[]":et;if(b&&n(k)&&k.length===0)return ot+"[]";for(var ct=0;ct"u"?g.encodeDotInKeys===!0?!0:c.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:c.addQueryPrefix,allowDots:S,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:T,charset:y,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?c.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:c.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:c.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:c.encodeValuesOnly,filter:b,format:_,formatter:v,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:c.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:c.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:c.strictNullHandling}};return af=function(p,g){var y=p,_=m(g),v,b;typeof _.filter=="function"?(b=_.filter,y=b("",y)):n(_.filter)&&(b=_.filter,v=b);var T=[];if(typeof y!="object"||y===null)return"";var S=r[_.arrayFormat],w=S==="comma"&&_.commaRoundTrip;v||(v=Object.keys(y)),_.sort&&v.sort(_.sort);for(var E=i(),A=0;A"u"||P===null)){var I=y[P];_.skipNulls&&I===null||o(T,f(I,P,S,w,_.allowEmptyArrays,_.strictNullHandling,_.skipNulls,_.encodeDotInKeys,_.encode?_.encoder:null,_.filter,_.sort,_.allowDots,_.serializeDate,_.format,_.formatter,_.encodeValuesOnly,_.charset,E))}}var C=T.join(_.delimiter),R=_.addQueryPrefix===!0?"?":"";return _.charsetSentinel&&(_.charset==="iso-8859-1"?R+="utf8=%26%2310003%3B"+_.delimiter:R+="utf8=%E2%9C%93"+_.delimiter),C.length>0?R+C:""},af}var of,Ky;function II(){if(Ky)return of;Ky=1;var i=y_(),t=Object.prototype.hasOwnProperty,e=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},r=function(f){return f.replace(/&#(\d+);/g,function(m,p){return String.fromCharCode(parseInt(p,10))})},n=function(f,m,p,g){if(f&&typeof f=="string"&&m.comma&&f.indexOf(",")>-1){if(g&&m.throwOnLimitExceeded)for(var y=0,_=f.indexOf(",");_>-1;){if(y+=1,y>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");_=f.indexOf(",",_+1)}return f.split(",")}if(m.throwOnLimitExceeded&&p>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return f},a="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",h=function(m,p){var g={__proto__:null},y=p.ignoreQueryPrefix?m.replace(/^\?/,""):m;y=y.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=p.parameterLimit===1/0?void 0:p.parameterLimit,v=y.split(p.delimiter,p.throwOnLimitExceeded&&typeof _<"u"?_+1:_);if(p.throwOnLimitExceeded&&typeof _<"u"&&v.length>_)throw new RangeError("Parameter limit exceeded. Only "+_+" parameter"+(_===1?"":"s")+" allowed.");var b=-1,T,S=p.charset;if(p.charsetSentinel)for(T=0;T-1&&(I=e(I)?[I]:I),p.comma&&e(I)&&I.length>p.arrayLimit&&(I=i.combine([],I,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded)),P!==null){var C=t.call(g,P);C&&(p.duplicates==="combine"||w.indexOf("[]=")>-1)?g[P]=i.combine(g[P],I,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded):(!C||p.duplicates==="last")&&(g[P]=I)}}return g},l=function(f,m,p,g){var y=0;if(f.length>0&&f[f.length-1]==="[]"){var _=f.slice(0,-1).join("");y=Array.isArray(m)&&m[_]?m[_].length:0}for(var v=g?m:n(m,p,y),b=f.length-1;b>=0;--b){var T,S=f[b];if(S==="[]"&&p.parseArrays)i.isOverflow(v)?T=v:T=p.allowEmptyArrays&&(v===""||p.strictNullHandling&&v===null)?[]:i.combine([],v,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded);else{T=p.plainObjects?{__proto__:null}:{};var w=S.charAt(0)==="["&&S.charAt(S.length-1)==="]"?S.slice(1,-1):S,E=p.decodeDotInKeys?w.replace(/%2E/g,"."):w,A=parseInt(E,10),P=!isNaN(A)&&S!==E&&String(A)===E&&A>=0&&p.parseArrays;if(!p.parseArrays&&E==="")T={0:v};else if(P&&A=0?g.slice(0,_):g;if(v){if(!p.plainObjects&&t.call(Object.prototype,v)&&!p.allowPrototypes)return;y[y.length]=v}for(var b=g.length,T=_,S=0;T>=0&&S=0){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");y[y.length]="["+g.slice(T)+"]"}return y},u=function(m,p,g,y){if(m){var _=c(m,g);if(_)return l(_,p,g,y)}},d=function(m){if(!m)return s;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof m.throwOnLimitExceeded<"u"&&typeof m.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var p=typeof m.charset>"u"?s.charset:m.charset,g=typeof m.duplicates>"u"?s.duplicates:m.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var y=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:s.allowDots:!!m.allowDots;return{allowDots:y,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:s.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:s.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:s.arrayLimit,charset:p,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:s.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:s.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:s.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:s.decoder,delimiter:typeof m.delimiter=="string"||i.isRegExp(m.delimiter)?m.delimiter:s.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:s.depth,duplicates:g,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:s.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:s.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:s.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:s.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return of=function(f,m){var p=d(m);if(f===""||f===null||typeof f>"u")return p.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?h(f,p):f,y=p.plainObjects?{__proto__:null}:{},_=Object.keys(g),v=0;v<_.length;++v){var b=_[v],T=u(b,g[b],p,typeof f=="string");y=i.merge(y,T,p)}return p.allowSparse===!0?y:i.compact(y)},of}var lf,Zy;function PI(){if(Zy)return lf;Zy=1;var i=CI(),t=II(),e=Op();return lf={formats:e,parse:t,stringify:i},lf}var Jy;function MI(){if(Jy)return bn;Jy=1;var i=JC();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var e=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,r=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,n=["<",">",'"',"`"," ","\r",` `," "],a=["{","}","|","\\","^","`"].concat(n),o=["'"].concat(a),h=["%","/","?",";","#"].concat(o),l=["/","?","#"],c=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=PI();function y(T,S,w){if(T&&typeof T=="object"&&T instanceof t)return T;var E=new t;return E.parse(T,S,w),E}t.prototype.parse=function(T,S,w){if(typeof T!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var E=T.indexOf("?"),A=E!==-1&&E127?at+="x":at+=H[et];if(!at.match(u)){var ct=V.slice(0,k),rt=V.slice(k+1),dt=H.match(d);dt&&(ct.push(dt[1]),rt.unshift(dt[2])),rt.length&&(C="/"+rt.join(".")+C),this.hostname=ct.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),G||(this.hostname=i.toASCII(this.hostname));var X=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+X,this.href+=this.host,G&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!f[D])for(var k=0,q=o.length;k0?w.host.split("@"):!1;at&&(w.auth=at.shift(),w.hostname=at.shift(),w.host=w.hostname)}return w.search=T.search,w.query=T.query,(w.pathname!==null||w.search!==null)&&(w.path=(w.pathname?w.pathname:"")+(w.search?w.search:"")),w.href=w.format(),w}if(!V.length)return w.pathname=null,w.search?w.path="/"+w.search:w.path=null,w.href=w.format(),w;for(var et=V.slice(-1)[0],ot=(w.host||T.host||V.length>1)&&(et==="."||et==="..")||et==="",ct=0,rt=V.length;rt>=0;rt--)et=V[rt],et==="."?V.splice(rt,1):et===".."?(V.splice(rt,1),ct++):ct&&(V.splice(rt,1),ct--);if(!L&&!G)for(;ct--;ct)V.unshift("..");L&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),ot&&V.join("/").substr(-1)!=="/"&&V.push("");var dt=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(H){w.hostname=dt?"":V.length?V.shift():"",w.host=w.hostname;var at=w.host&&w.host.indexOf("@")>0?w.host.split("@"):!1;at&&(w.auth=at.shift(),w.hostname=at.shift(),w.host=w.hostname)}return L=L||w.host&&V.length,L&&!dt&&V.unshift(""),V.length>0?w.pathname=V.join("/"):(w.pathname=null,w.path=null),(w.pathname!==null||w.search!==null)&&(w.path=(w.pathname?w.pathname:"")+(w.search?w.search:"")),w.auth=T.auth||w.auth,w.slashes=w.slashes||T.slashes,w.href=w.format(),w},t.prototype.parseHost=function(){var T=this.host,S=s.exec(T);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),T=T.substr(0,T.length-S.length)),T&&(this.hostname=T)},bn.parse=y,bn.resolve=v,bn.resolveObject=b,bn.format=_,bn.Url=t,bn}MI();const Qy={};function Ht(i,t,e=3){if(Qy[t])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`):(s=s.split(` `).splice(e).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} Deprecated since v${i}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`),console.warn(s))),Qy[t]=!0}function rr(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function fo(i){return i.split("?")[0].split("#")[0]}function RI(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FI(i,t,e){return i.replace(new RegExp(RI(t),"g"),e)}function kI(i,t){let e="",s=0,r=-1,n=0,a=-1;for(let o=0;o<=i.length;++o){if(o2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",s=0):(e=e.slice(0,h),s=e.length-1-e.lastIndexOf("/")),r=o,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,r=o,n=0;continue}}}else e.length>0?e+=`/${i.slice(r+1,o)}`:e=i.slice(r+1,o),s=o-r-1;r=o,n=0}else a===46&&n!==-1?++n:n=-1}return e}const ye={toPosix(i){return FI(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){rr(i),i=this.toPosix(i);const t=/^file:\/\/\//.exec(i);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(i);return e?e[0]:""},toAbsolute(i,t,e){if(rr(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=fo(this.toPosix(t??_t.ADAPTER.getBaseUrl())),r=fo(this.toPosix(e??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?ye.join(r,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(rr(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let t="";const e=i.startsWith("/");this.hasProtocol(i)&&(t=this.rootname(i),i=i.slice(t.length));const s=i.endsWith("/");return i=kI(i),i.length>0&&s&&(i+="/"),e?`/${i}`:t+i},isAbsolute(i){return rr(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=s;else{const r=i[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(i){if(rr(i),i.length===0)return".";i=this.toPosix(i);let t=i.charCodeAt(0);const e=t===47;let s=-1,r=!0;const n=this.getProtocol(i),a=i;i=i.slice(n.length);for(let o=i.length-1;o>=1;--o)if(t=i.charCodeAt(o),t===47){if(!r){s=o;break}}else r=!1;return s===-1?e?"/":this.isUrl(a)?n+i:n:e&&s===1?"//":n+i.slice(0,s)},rootname(i){rr(i),i=this.toPosix(i);let t="";if(i.startsWith("/")?t="/":t=this.getProtocol(i),this.isUrl(i)){const e=i.indexOf("/",t.length);e!==-1?t=i.slice(0,e):t=i,t.endsWith("/")||(t+="/")}return t},basename(i,t){rr(i),t&&rr(t),i=fo(this.toPosix(i));let e=0,s=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=i.length){if(t.length===i.length&&t===i)return"";let a=t.length-1,o=-1;for(n=i.length-1;n>=0;--n){const h=i.charCodeAt(n);if(h===47){if(!r){e=n+1;break}}else o===-1&&(r=!1,o=n+1),a>=0&&(h===t.charCodeAt(a)?--a===-1&&(s=n):(a=-1,s=o))}return e===s?s=o:s===-1&&(s=i.length),i.slice(e,s)}for(n=i.length-1;n>=0;--n)if(i.charCodeAt(n)===47){if(!r){e=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":i.slice(e,s)},extname(i){rr(i),i=fo(this.toPosix(i));let t=-1,e=0,s=-1,r=!0,n=0;for(let a=i.length-1;a>=0;--a){const o=i.charCodeAt(a);if(o===47){if(!r){e=a+1;break}continue}s===-1&&(r=!1,s=a+1),o===46?t===-1?t=a:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":i.slice(t,s)},parse(i){rr(i);const t={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return t;i=fo(this.toPosix(i));let e=i.charCodeAt(0);const s=this.isAbsolute(i);let r;t.root=this.rootname(i),s||this.hasProtocol(i)?r=1:r=0;let n=-1,a=0,o=-1,h=!0,l=i.length-1,c=0;for(;l>=r;--l){if(e=i.charCodeAt(l),e===47){if(!h){a=l+1;break}continue}o===-1&&(h=!1,o=l+1),e===46?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1)}return n===-1||o===-1||c===0||c===1&&n===o-1&&n===a+1?o!==-1&&(a===0&&s?t.base=t.name=i.slice(1,o):t.base=t.name=i.slice(a,o)):(a===0&&s?(t.name=i.slice(1,n),t.base=i.slice(1,o)):(t.name=i.slice(a,n),t.base=i.slice(a,o)),t.ext=i.slice(n,o)),t.dir=this.dirname(i),t},sep:"/",delimiter:":",joinExtensions:[".html"]};let hf;async function LI(){return hf??(hf=(async()=>{var n;const i=document.createElement("canvas").getContext("webgl");if(!i)return Ke.UNPACK;const t=await new Promise(a=>{const o=document.createElement("video");o.onloadeddata=()=>a(o),o.onerror=()=>a(null),o.autoplay=!1,o.crossOrigin="anonymous",o.preload="auto",o.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",o.load()});if(!t)return Ke.UNPACK;const e=i.createTexture();i.bindTexture(i.TEXTURE_2D,e);const s=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,s),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t);const r=new Uint8Array(4);return i.readPixels(0,0,1,1,i.RGBA,i.UNSIGNED_BYTE,r),i.deleteFramebuffer(s),i.deleteTexture(e),(n=i.getExtension("WEBGL_lose_context"))==null||n.loseContext(),r[0]<=r[3]?Ke.PMA:Ke.UNPACK})()),hf}let cf;function BI(){return typeof cf>"u"&&(cf=(function(){var t;const i={stencil:!0,failIfMajorPerformanceCaveat:_t.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!_t.ADAPTER.getWebGLRenderingContext())return!1;const e=_t.ADAPTER.createCanvas();let s=e.getContext("webgl",i)||e.getContext("experimental-webgl",i);const r=!!((t=s==null?void 0:s.getContextAttributes())!=null&&t.stencil);if(s){const n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,r}catch{return!1}})()),cf}var OI={grad:.9,turn:360,rad:360/(2*Math.PI)},ei=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},je=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},Zs=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},x_=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},tx=function(i){return{r:Zs(i.r,0,255),g:Zs(i.g,0,255),b:Zs(i.b,0,255),a:Zs(i.a)}},uf=function(i){return{r:je(i.r),g:je(i.g),b:je(i.b),a:je(i.a,3)}},DI=/^#([0-9a-f]{3,8})$/i,ql=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},b_=function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=Math.max(t,e,s),a=n-Math.min(t,e,s),o=a?n===t?(e-s)/a:n===e?2+(s-t)/a:4+(t-e)/a:0;return{h:60*(o<0?o+6:o),s:n?a/n*100:0,v:n/255*100,a:r}},v_=function(i){var t=i.h,e=i.s,s=i.v,r=i.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),a=s*(1-e),o=s*(1-(t-n)*e),h=s*(1-(1-t+n)*e),l=n%6;return{r:255*[s,o,a,a,h,s][l],g:255*[h,s,s,o,a,a][l],b:255*[a,a,h,s,s,o][l],a:r}},ex=function(i){return{h:x_(i.h),s:Zs(i.s,0,100),l:Zs(i.l,0,100),a:Zs(i.a)}},sx=function(i){return{h:je(i.h),s:je(i.s),l:je(i.l),a:je(i.a,3)}},rx=function(i){return v_((e=(t=i).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},ko=function(i){return{h:(t=b_(i)).h,s:(r=(200-(e=t.s))*(s=t.v)/100)>0&&r<200?e*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,s,r},NI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,UI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,XI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,VI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mm={string:[[function(i){var t=DI.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?je(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?je(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=XI.exec(i)||VI.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:tx({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(i){var t=NI.exec(i)||UI.exec(i);if(!t)return null;var e,s,r=ex({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(OI[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return rx(r)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=r===void 0?1:r;return ei(t)&&ei(e)&&ei(s)?tx({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(i){var t=i.h,e=i.s,s=i.l,r=i.a,n=r===void 0?1:r;if(!ei(t)||!ei(e)||!ei(s))return null;var a=ex({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return rx(a)},"hsl"],[function(i){var t=i.h,e=i.s,s=i.v,r=i.a,n=r===void 0?1:r;if(!ei(t)||!ei(e)||!ei(s))return null;var a=(function(o){return{h:x_(o.h),s:Zs(o.s,0,100),v:Zs(o.v,0,100),a:Zs(o.a)}})({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return v_(a)},"hsv"]]},ix=function(i,t){for(var e=0;e=.5},i.prototype.toHex=function(){return t=uf(this.rgba),e=t.r,s=t.g,r=t.b,a=(n=t.a)<1?ql(je(255*n)):"","#"+ql(e)+ql(s)+ql(r)+a;var t,e,s,r,n,a},i.prototype.toRgb=function(){return uf(this.rgba)},i.prototype.toRgbString=function(){return t=uf(this.rgba),e=t.r,s=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+r+", "+n+")":"rgb("+e+", "+s+", "+r+")";var t,e,s,r,n},i.prototype.toHsl=function(){return sx(ko(this.rgba))},i.prototype.toHslString=function(){return t=sx(ko(this.rgba)),e=t.h,s=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+r+"%, "+n+")":"hsl("+e+", "+s+"%, "+r+"%)";var t,e,s,r,n},i.prototype.toHsv=function(){return t=b_(this.rgba),{h:je(t.h),s:je(t.s),v:je(t.v),a:je(t.a,3)};var t},i.prototype.invert=function(){return Ar({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},i.prototype.saturate=function(t){return t===void 0&&(t=.1),Ar(df(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),Ar(df(this.rgba,-t))},i.prototype.grayscale=function(){return Ar(df(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),Ar(nx(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),Ar(nx(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?Ar({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):je(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=ko(this.rgba);return typeof t=="number"?Ar({h:t,s:e.s,l:e.l,a:e.a}):je(e.h)},i.prototype.isEqual=function(t){return this.toHex()===Ar(t).toHex()},i})(),Ar=function(i){return i instanceof pm?i:new pm(i)},ax=[],GI=function(i){i.forEach(function(t){ax.indexOf(t)<0&&(t(pm,mm),ax.push(t))})};function $I(i,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in e)s[e[r]]=r;var n={};i.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,h,l=s[this.toHex()];if(l)return l;if(a!=null&&a.closest){var c=this.toRgb(),u=1/0,d="black";if(!n.length)for(var f in e)n[f]=new i(e[f]).toRgb();for(var m in e){var p=(o=c,h=n[m],Math.pow(o.r-h.r,2)+Math.pow(o.g-h.g,2)+Math.pow(o.b-h.b,2));pr===e[n]);if(t!==null&&e!==null){const r=Object.keys(t),n=Object.keys(e);return r.length!==n.length?!1:r.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,s,r]=this._components;return{r:t,g:e,b:s,a:r}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,r]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(r*255),t}toRgbArray(t){t=t??[];const[e,s,r]=this._components;return t[0]=e,t[1]=s,t[2]=r,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,s,r,n]=_h.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=r,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,s,r]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(s*t)/t,this._components[2]=Math.round(r*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,s,r,n]=this._components;return t[0]=e,t[1]=s,t[2]=r,t[3]=n,t}normalize(t){let e,s,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const a=t;e=(a>>16&255)/255,s=(a>>8&255)/255,r=(a&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,r,n=255]=t,e/=255,s/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const o=_h.HEX_PATTERN.exec(t);o&&(t=`#${o[2]}`)}const a=Ar(t);a.isValid()&&({r:e,g:s,b:r,a:n}=a.rgba,e/=255,s/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=r,this._components[3]=n,this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),s)}),t)}};ua.shared=new ua,ua.temp=new ua,ua.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Wt=ua;function HI(i){return Ht("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Wt.shared.setValue(i).toHex()}function WI(i){return Ht("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Wt.shared.setValue(i).toNumber()}function zI(){const i=[],t=[];for(let s=0;s<32;s++)i[s]=s,t[s]=s;i[It.NORMAL_NPM]=It.NORMAL,i[It.ADD_NPM]=It.ADD,i[It.SCREEN_NPM]=It.SCREEN,t[It.NORMAL]=It.NORMAL_NPM,t[It.ADD]=It.ADD_NPM,t[It.SCREEN]=It.SCREEN_NPM;const e=[];return e.push(t),e.push(i),e}const __=zI();function w_(i,t){return __[t?1:0][i]}function jI(i,t=null){const e=i*6;if(t=t||new Uint16Array(e),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let s=0,r=0;s>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function ox(i){return!(i&i-1)&&!!i}function lx(i){let t=(i>65535?1:0)<<4;i>>>=t;let e=(i>255?1:0)<<3;return i>>>=e,t|=e,e=(i>15?1:0)<<2,i>>>=e,t|=e,e=(i>3?1:0)<<1,i>>>=e,t|=e,t|i>>1}function Ma(i,t,e){const s=i.length;let r;if(t>=s||e===0)return;e=t+e>s?s-t:e;const n=s-e;for(r=t;r(i.Renderer="renderer",i.Application="application",i.RendererSystem="renderer-webgl-system",i.RendererPlugin="renderer-webgl-plugin",i.CanvasRendererSystem="renderer-canvas-system",i.CanvasRendererPlugin="renderer-canvas-plugin",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i))(gt||{});const ym=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},fx=(i,t)=>ym(i).priority??t,St={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(ym).forEach(t=>{t.type.forEach(e=>{var s,r;return(r=(s=this._removeHandlers)[e])==null?void 0:r.call(s,t)})}),this},add(...i){return i.map(ym).forEach(t=>{t.type.forEach(e=>{var n,a;const s=this._addHandlers,r=this._queue;s[e]?(n=s[e])==null||n.call(s,t):(r[e]=r[e]||[],(a=r[e])==null||a.push(t))})}),this},handle(i,t,e){var a;const s=this._addHandlers,r=this._removeHandlers;if(s[i]||r[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=t,r[i]=e;const n=this._queue;return n[i]&&((a=n[i])==null||a.forEach(o=>t(o)),delete n[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByList(i,t,e=-1){return this.handle(i,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,n)=>fx(n,e)-fx(r,e)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})}};class xm{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const tP=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` `);function eP(i){let t="";for(let e=0;e0&&(t+=` else `),e=0;--s){const r=bm[s];if(r.test&&r.test(i,e))return new r(i,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class gr{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,s,r,n,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(gr.prototype,{dispatch:{value:gr.prototype.emit},run:{value:gr.prototype.emit}});class el{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new gr("setRealSize"),this.onUpdate=new gr("update"),this.onError=new gr("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class Gc extends el{constructor(t,e){const{width:s,height:r}=e||{};if(!s||!r)throw new Error("BufferResource width or height invalid");super(s,r),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,s){const r=t.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,this.unpackAlignment),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Ke.UNPACK);const n=e.realWidth,a=e.realHeight;return s.width===n&&s.height===a?r.texSubImage2D(e.target,0,0,0,n,a,e.format,s.type,this.data):(s.width=n,s.height=a,r.texImage2D(e.target,0,s.internalFormat,n,a,0,e.format,s.type,this.data)),!0}dispose(){this.data=null}static test(t){return t===null||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const rP={scaleMode:Ns.NEAREST,alphaMode:Ke.NPM},vm=class da extends Al{constructor(t=null,e=null){super(),e=Object.assign({},da.defaultOptions,e);const{alphaMode:s,mipmap:r,anisotropicLevel:n,scaleMode:a,width:o,height:h,wrapMode:l,format:c,type:u,target:d,resolution:f,resourceOptions:m}=e;t&&!(t instanceof el)&&(t=S_(t,m),t.internal=!0),this.resolution=f||_t.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=r,this.anisotropicLevel=n,this._wrapMode=l,this._scaleMode=a,this.format=c,this.type=u,this.target=d,this.alphaMode=s,this.uid=Hn(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let s;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,s=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,s=!0),s&&this.dirtyStyleId++,this}setSize(t,e,s){return s=s||this.resolution,this.setRealSize(t*s,e*s,s)}setRealSize(t,e,s){return this.resolution=s||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=ox(this.realWidth)&&ox(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ni[this.cacheId],delete Cr[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),da.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,s=_t.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else{if(!t._pixiId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Hn()}`}n=t._pixiId}let a=Ni[n];if(r&&s&&!a)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return a||(a=new da(t,e),a.cacheId=n,da.addToCache(a,n)),a}static fromBuffer(t,e,s,r){t=t||new Float32Array(e*s*4);const n=new Gc(t,{width:e,height:s,...r==null?void 0:r.resourceOptions});let a,o;return t instanceof Float32Array?(a=ft.RGBA,o=wt.FLOAT):t instanceof Int32Array?(a=ft.RGBA_INTEGER,o=wt.INT):t instanceof Uint32Array?(a=ft.RGBA_INTEGER,o=wt.UNSIGNED_INT):t instanceof Int16Array?(a=ft.RGBA_INTEGER,o=wt.SHORT):t instanceof Uint16Array?(a=ft.RGBA_INTEGER,o=wt.UNSIGNED_SHORT):t instanceof Int8Array?(a=ft.RGBA,o=wt.BYTE):(a=ft.RGBA,o=wt.UNSIGNED_BYTE),n.internal=!0,new da(n,Object.assign({},rP,{type:o,format:a},r))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Ni[e]&&Ni[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Ni[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Ni[t];if(e){const s=e.textureCacheIds.indexOf(t);return s>-1&&e.textureCacheIds.splice(s,1),delete Ni[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e1){for(let u=0;u(i[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC",i))(ts||{});class Kt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Kt(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}Kt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Kl=[new Kt,new Kt,new Kt,new Kt];class Ut{constructor(t=0,e=0,s=0,r=0){this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(r),this.type=ts.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Ut(0,0,0,0)}clone(){return new Ut(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&et.right?t.right:this.right)<=E)return!1;const A=this.yt.bottom?t.bottom:this.bottom)>A}const s=this.left,r=this.right,n=this.top,a=this.bottom;if(r<=s||a<=n)return!1;const o=Kl[0].set(t.left,t.top),h=Kl[1].set(t.left,t.bottom),l=Kl[2].set(t.right,t.top),c=Kl[3].set(t.right,t.bottom);if(l.x<=o.x||h.y<=o.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(o,o),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(o.x,h.x,l.x,c.x)<=s||Math.min(o.x,h.x,l.x,c.x)>=r||Math.max(o.y,h.y,l.y,c.y)<=n||Math.min(o.y,h.y,l.y,c.y)>=a))return!1;const d=u*(h.y-o.y),f=u*(o.x-h.x),m=d*s+f*n,p=d*r+f*n,g=d*s+f*a,y=d*r+f*a;if(Math.max(m,p,g,y)<=d*o.x+f*o.y||Math.min(m,p,g,y)>=d*c.x+f*c.y)return!1;const _=u*(o.y-l.y),v=u*(l.x-o.x),b=_*s+v*n,T=_*r+v*n,S=_*s+v*a,w=_*r+v*a;return!(Math.max(b,T,S,w)<=_*o.x+v*o.y||Math.min(b,T,S,w)>=_*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=r,this.height=n-r,this}}Ut.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class $c{constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.radius=s,this.type=ts.CIRC}clone(){return new $c(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=s}getBounds(){return new Ut(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}$c.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Hc{constructor(t=0,e=0,s=0,r=0){this.x=t,this.y=e,this.width=s,this.height=r,this.type=ts.ELIP}clone(){return new Hc(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let s=(t-this.x)/this.width,r=(e-this.y)/this.height;return s*=s,r*=r,s+r<=1}getBounds(){return new Ut(this.x-this.width,this.y-this.height,this.width,this.height)}}Hc.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Un{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let r=0,n=e.length;re!=c>e&&t<(l-o)*((e-h)/(c-h))+o&&(s=!s)}return s}}Un.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((i,t)=>`${i}, ${t}`,"")}]`};class Wc{constructor(t=0,e=0,s=0,r=0,n=20){this.x=t,this.y=e,this.width=s,this.height=r,this.radius=n,this.type=ts.RREC}clone(){return new Wc(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),n=e-(this.y+s);const a=s*s;if(r*r+n*n<=a||(r=t-(this.x+this.width-s),r*r+n*n<=a)||(n=e-(this.y+this.height-s),r*r+n*n<=a)||(r=t-(this.x+s),r*r+n*n<=a))return!0}return!1}}Wc.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class fe{constructor(t=1,e=0,s=0,r=1,n=0,a=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=r,this.tx=n,this.ty=a}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,r,n,a){return this.a=t,this.b=e,this.c=s,this.d=r,this.tx=n,this.ty=a,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new Kt;const s=t.x,r=t.y;return e.x=this.a*s+this.c*r+this.tx,e.y=this.b*s+this.d*r+this.ty,e}applyInverse(t,e){e=e||new Kt;const s=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*s*r+-this.c*s*n+(this.ty*this.c-this.tx*this.d)*s,e.y=this.a*s*n+-this.b*s*r+(-this.ty*this.a+this.tx*this.b)*s,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),r=this.a,n=this.c,a=this.tx;return this.a=r*e-this.b*s,this.b=r*s+this.b*e,this.c=n*e-this.d*s,this.d=n*s+this.d*e,this.tx=a*e-this.ty*s,this.ty=a*s+this.ty*e,this}append(t){const e=this.a,s=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*s+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*s+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}setTransform(t,e,s,r,n,a,o,h,l){return this.a=Math.cos(o+l)*n,this.b=Math.sin(o+l)*n,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,this.tx=t-(s*this.a+r*this.c),this.ty=e-(s*this.b+r*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,r=this.c,n=this.d,a=t.pivot,o=-Math.atan2(-r,n),h=Math.atan2(s,e),l=Math.abs(o+h);return l<1e-5||Math.abs(zh-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=h),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(a.x*e+a.y*r),t.position.y=this.ty+(a.x*s+a.y*n),t}invert(){const t=this.a,e=this.b,s=this.c,r=this.d,n=this.tx,a=t*r-e*s;return this.a=r/a,this.b=-e/a,this.c=-s/a,this.d=t/a,this.tx=(s*this.ty-r*n)/a,this.ty=-(t*this.ty-e*n)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new fe;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new fe}static get TEMP_MATRIX(){return new fe}}fe.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const Tn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Sn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],En=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],An=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],wm=[],A_=[],Zl=Math.sign;function uP(){for(let i=0;i<16;i++){const t=[];wm.push(t);for(let e=0;e<16;e++){const s=Zl(Tn[i]*Tn[e]+En[i]*Sn[e]),r=Zl(Sn[i]*Tn[e]+An[i]*Sn[e]),n=Zl(Tn[i]*En[e]+En[i]*An[e]),a=Zl(Sn[i]*En[e]+An[i]*An[e]);for(let o=0;o<16;o++)if(Tn[o]===s&&Sn[o]===r&&En[o]===n&&An[o]===a){t.push(o);break}}}for(let i=0;i<16;i++){const t=new fe;t.set(Tn[i],Sn[i],En[i],An[i],0,0),A_.push(t)}}uP();const Ee={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>Tn[i],uY:i=>Sn[i],vX:i=>En[i],vY:i=>An[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>wm[i][t],sub:(i,t)=>wm[i][Ee.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?Ee.S:Ee.N:Math.abs(t)*2<=Math.abs(i)?i>0?Ee.E:Ee.W:t>0?i>0?Ee.SE:Ee.SW:i>0?Ee.NE:Ee.NW,matrixAppendRotationInv:(i,t,e=0,s=0)=>{const r=A_[Ee.inv(t)];r.tx=e,r.ty=s,i.append(r)}};class gi{constructor(t,e,s=0,r=0){this._x=s,this._y=r,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new gi(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}gi.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Tm=class{constructor(){this.worldTransform=new fe,this.localTransform=new fe,this.position=new gi(this.onChange,this,0,0),this.scale=new gi(this.onChange,this,1,1),this.pivot=new gi(this.onChange,this,0,0),this.skew=new gi(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const i=this.localTransform;this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(i){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==i._worldID){const e=i.worldTransform,s=this.worldTransform;s.a=t.a*e.a+t.b*e.c,s.b=t.a*e.b+t.b*e.d,s.c=t.c*e.a+t.d*e.c,s.d=t.c*e.b+t.d*e.d,s.tx=t.tx*e.a+t.ty*e.c+e.tx,s.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=i._worldID,this._worldID++}}setFromMatrix(i){i.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(i){this._rotation!==i&&(this._rotation=i,this.updateSkew())}};Tm.IDENTITY=new Tm;let Dp=Tm;Dp.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var dP=`varying vec2 vTextureCoord; uniform sampler2D uSampler; void main(void){ gl_FragColor *= texture2D(uSampler, vTextureCoord); }`,fP=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; varying vec2 vTextureCoord; void main(void){ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; } `;function px(i,t,e){const s=i.createShader(t);return i.shaderSource(s,e),i.compileShader(s),s}function vf(i){const t=new Array(i);for(let e=0;ei.type==="float"&&i.size===1&&!i.isArray,code:i=>` if(uv["${i}"] !== ud["${i}"].value) { ud["${i}"].value = uv["${i}"] gl.uniform1f(ud["${i}"].location, uv["${i}"]) } `},{test:(i,t)=>(i.type==="sampler2D"||i.type==="samplerCube"||i.type==="sampler2DArray")&&i.size===1&&!i.isArray&&(t==null||t.castToBaseTexture!==void 0),code:i=>`t = syncData.textureCount++; renderer.texture.bind(uv["${i}"], t); if(ud["${i}"].value !== t) { ud["${i}"].value = t; gl.uniform1i(ud["${i}"].location, t); ; // eslint-disable-line max-len }`},{test:(i,t)=>i.type==="mat3"&&i.size===1&&!i.isArray&&t.a!==void 0,code:i=>` gl.uniformMatrix3fv(ud["${i}"].location, false, uv["${i}"].toArray(true)); `,codeUbo:i=>` var ${i}_matrix = uv.${i}.toArray(true); data[offset] = ${i}_matrix[0]; data[offset+1] = ${i}_matrix[1]; data[offset+2] = ${i}_matrix[2]; data[offset + 4] = ${i}_matrix[3]; data[offset + 5] = ${i}_matrix[4]; data[offset + 6] = ${i}_matrix[5]; data[offset + 8] = ${i}_matrix[6]; data[offset + 9] = ${i}_matrix[7]; data[offset + 10] = ${i}_matrix[8]; `},{test:(i,t)=>i.type==="vec2"&&i.size===1&&!i.isArray&&t.x!==void 0,code:i=>` cv = ud["${i}"].value; v = uv["${i}"]; if(cv[0] !== v.x || cv[1] !== v.y) { cv[0] = v.x; cv[1] = v.y; gl.uniform2f(ud["${i}"].location, v.x, v.y); }`,codeUbo:i=>` v = uv.${i}; data[offset] = v.x; data[offset+1] = v.y; `},{test:i=>i.type==="vec2"&&i.size===1&&!i.isArray,code:i=>` cv = ud["${i}"].value; v = uv["${i}"]; if(cv[0] !== v[0] || cv[1] !== v[1]) { cv[0] = v[0]; cv[1] = v[1]; gl.uniform2f(ud["${i}"].location, v[0], v[1]); } `},{test:(i,t)=>i.type==="vec4"&&i.size===1&&!i.isArray&&t.width!==void 0,code:i=>` cv = ud["${i}"].value; v = uv["${i}"]; if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) { cv[0] = v.x; cv[1] = v.y; cv[2] = v.width; cv[3] = v.height; gl.uniform4f(ud["${i}"].location, v.x, v.y, v.width, v.height) }`,codeUbo:i=>` v = uv.${i}; data[offset] = v.x; data[offset+1] = v.y; data[offset+2] = v.width; data[offset+3] = v.height; `},{test:(i,t)=>i.type==="vec4"&&i.size===1&&!i.isArray&&t.red!==void 0,code:i=>` cv = ud["${i}"].value; v = uv["${i}"]; if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) { cv[0] = v.red; cv[1] = v.green; cv[2] = v.blue; cv[3] = v.alpha; gl.uniform4f(ud["${i}"].location, v.red, v.green, v.blue, v.alpha) }`,codeUbo:i=>` v = uv.${i}; data[offset] = v.red; data[offset+1] = v.green; data[offset+2] = v.blue; data[offset+3] = v.alpha; `},{test:(i,t)=>i.type==="vec3"&&i.size===1&&!i.isArray&&t.red!==void 0,code:i=>` cv = ud["${i}"].value; v = uv["${i}"]; if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) { cv[0] = v.red; cv[1] = v.green; cv[2] = v.blue; gl.uniform3f(ud["${i}"].location, v.red, v.green, v.blue) }`,codeUbo:i=>` v = uv.${i}; data[offset] = v.red; data[offset+1] = v.green; data[offset+2] = v.blue; `},{test:i=>i.type==="vec4"&&i.size===1&&!i.isArray,code:i=>` cv = ud["${i}"].value; v = uv["${i}"]; if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; cv[3] = v[3]; gl.uniform4f(ud["${i}"].location, v[0], v[1], v[2], v[3]) }`}],mP={float:` if (cv !== v) { cu.value = v; gl.uniform1f(location, v); }`,vec2:` if (cv[0] !== v[0] || cv[1] !== v[1]) { cv[0] = v[0]; cv[1] = v[1]; gl.uniform2f(location, v[0], v[1]) }`,vec3:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; gl.uniform3f(location, v[0], v[1], v[2]) }`,vec4:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; cv[3] = v[3]; gl.uniform4f(location, v[0], v[1], v[2], v[3]); }`,int:` if (cv !== v) { cu.value = v; gl.uniform1i(location, v); }`,ivec2:` if (cv[0] !== v[0] || cv[1] !== v[1]) { cv[0] = v[0]; cv[1] = v[1]; gl.uniform2i(location, v[0], v[1]); }`,ivec3:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; gl.uniform3i(location, v[0], v[1], v[2]); }`,ivec4:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; cv[3] = v[3]; gl.uniform4i(location, v[0], v[1], v[2], v[3]); }`,uint:` if (cv !== v) { cu.value = v; gl.uniform1ui(location, v); }`,uvec2:` if (cv[0] !== v[0] || cv[1] !== v[1]) { cv[0] = v[0]; cv[1] = v[1]; gl.uniform2ui(location, v[0], v[1]); }`,uvec3:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; gl.uniform3ui(location, v[0], v[1], v[2]); }`,uvec4:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; cv[3] = v[3]; gl.uniform4ui(location, v[0], v[1], v[2], v[3]); }`,bool:` if (cv !== v) { cu.value = v; gl.uniform1i(location, v); }`,bvec2:` if (cv[0] != v[0] || cv[1] != v[1]) { cv[0] = v[0]; cv[1] = v[1]; gl.uniform2i(location, v[0], v[1]); }`,bvec3:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; gl.uniform3i(location, v[0], v[1], v[2]); }`,bvec4:` if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { cv[0] = v[0]; cv[1] = v[1]; cv[2] = v[2]; cv[3] = v[3]; gl.uniform4i(location, v[0], v[1], v[2], v[3]); }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` if (cv !== v) { cu.value = v; gl.uniform1i(location, v); }`,samplerCube:` if (cv !== v) { cu.value = v; gl.uniform1i(location, v); }`,sampler2DArray:` if (cv !== v) { cu.value = v; gl.uniform1i(location, v); }`},pP={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function gP(i,t){var s;const e=[` var v = null; var cv = null; var cu = null; var t = 0; var gl = renderer.gl; `];for(const r in i.uniforms){const n=t[r];if(!n){((s=i.uniforms[r])==null?void 0:s.group)===!0&&(i.uniforms[r].ubo?e.push(` renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}'); `):e.push(` renderer.shader.syncUniformGroup(uv.${r}, syncData); `));continue}const a=i.uniforms[r];let o=!1;for(let h=0;h=Kn.WEBGL2&&(t=i.getContext("webgl2",{})),t||(t=i.getContext("webgl",{})||i.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),oa=t}return oa}let Jl;function xP(){if(!Jl){Jl=Ks.MEDIUM;const i=yP();if(i&&i.getShaderPrecisionFormat){const t=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);t&&(Jl=t.precision?Ks.HIGH:Ks.MEDIUM)}}return Jl}function gx(i,t){const e=i.getShaderSource(t).split(` `).map((l,c)=>`${c}: ${l}`),s=i.getShaderInfoLog(t),r=s.split(` `),n={},a=r.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!n[l]?(n[l]=!0,!0):!1),o=[""];a.forEach(l=>{e[l-1]=`%c${e[l-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=e.join(` `);o[0]=h,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function bP(i,t,e,s){i.getProgramParameter(t,i.LINK_STATUS)||(i.getShaderParameter(e,i.COMPILE_STATUS)||gx(i,e),i.getShaderParameter(s,i.COMPILE_STATUS)||gx(i,s),console.error("PixiJS Error: Could not initialize shader."),i.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",i.getProgramInfoLog(t)))}const vP={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function P_(i){return vP[i]}let Ql=null;const yx={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function M_(i,t){if(!Ql){const e=Object.keys(yx);Ql={};for(let s=0;s0&&(e+=` else `),sthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,s=ar._textureArrayPool,r=this.renderer.batch,n=this._tempBoundTextures,a=this.renderer.textureGC.count;let o=++Lt._globalBatch,h=0,l=s[0],c=0;r.copyBoundTextures(n,e);for(let u=0;u=e&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,c,u),c=u,l=s[++h],++o),d._batchEnabled=o,d.touched=a,l.elements[l.count++]=d)}l.count>0&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,c,this._bufferSize),++h,++o);for(let u=0;u0);for(let p=0;p=0;--r)t[r]=s[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,e,s,r){const{elements:n,ids:a,count:o}=t;let h=0;for(let l=0;l=0&&u=Kn.WEBGL2&&(s=t.getContext("webgl2",e)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=s||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}qh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},qh.extension={type:gt.RendererSystem,name:"context"};St.add(qh);class Cm{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new gr("disposeFramebuffer"),this.multisample=De.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new Lt(null,{scaleMode:Ns.NEAREST,resolution:1,mipmap:Ms.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new Lt(null,{scaleMode:Ns.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ms.OFF,format:ft.DEPTH_COMPONENT,type:wt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let s=0;s{const r=this.source;this.url=r.src;const n=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.update(),this._load=null,this.createBitmap?e(this.process()):e(this))};r.complete&&r.src?n():(r.onload=n,r.onerror=a=>{s(a),this.onError.emit(a)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,s=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:s?"cors":"no-cors"}).then(r=>r.blob()).then(r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ke.UNPACK?"premultiply":"none"})).then(r=>this.destroyed?Promise.reject():(this.bitmap=r,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,e,s){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,s,this.bitmap),!this.preserveBitmap){let r=!0;const n=e._glTextures;for(const a in n){const o=n[a];if(o!==s&&o.dirtyId!==e.dirtyId){r=!1;break}}r&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class Up{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,s){const r=e.width,n=e.height;if(s){const a=t.width/2/r,o=t.height/2/n,h=t.x/r+a,l=t.y/n+o;s=Ee.add(s,Ee.NW),this.x0=h+a*Ee.uX(s),this.y0=l+o*Ee.uY(s),s=Ee.add(s,2),this.x1=h+a*Ee.uX(s),this.y1=l+o*Ee.uY(s),s=Ee.add(s,2),this.x2=h+a*Ee.uX(s),this.y2=l+o*Ee.uY(s),s=Ee.add(s,2),this.x3=h+a*Ee.uX(s),this.y3=l+o*Ee.uY(s)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Up.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const vx=new Up;function eh(i){i.destroy=function(){},i.on=function(){},i.once=function(){},i.emit=function(){}}let Nt=class pe extends Al{constructor(t,e,s,r,n,a,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new Ut(0,0,1,1)),t instanceof pe&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=r,this.valid=!1,this.destroyed=!1,this._uvs=vx,this.uvMatrix=null,this.orig=s||e,this._rotate=Number(n||0),n===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new Kt(a.x,a.y):new Kt(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:e}=this.baseTexture;e!=null&&e.url&&Cr[e.url]&&pe.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,pe.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var r;const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),s=new pe(this.baseTexture,!this.noFrame&&t,e,(r=this.trim)==null?void 0:r.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(s._frame=t),s}updateUvs(){this._uvs===vx&&(this._uvs=new Up),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},s=_t.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else if(t instanceof Lt){if(!t.cacheId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Hn()}`,Lt.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Hn()}`}n=t._pixiId}let a=Cr[n];if(r&&s&&!a)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!a&&!(t instanceof Lt)?(e.resolution||(e.resolution=Ci(t)),a=new pe(new Lt(t,e)),a.baseTexture.cacheId=n,Lt.addToCache(a.baseTexture,n),pe.addToCache(a,n)):!a&&t instanceof Lt&&(a=new pe(t),pe.addToCache(a,n)),a}static fromURL(t,e){const s=Object.assign({autoLoad:!1},e==null?void 0:e.resourceOptions),r=pe.from(t,Object.assign({resourceOptions:s},e),!1),n=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):n.load().then(()=>Promise.resolve(r))}static fromBuffer(t,e,s,r){return new pe(Lt.fromBuffer(t,e,s,r))}static fromLoader(t,e,s,r){const n=new Lt(t,Object.assign({scaleMode:Lt.defaultOptions.scaleMode,resolution:Ci(e)},r)),{resource:a}=n;a instanceof k_&&(a.url=e);const o=new pe(n);return s||(s=e),Lt.addToCache(o.baseTexture,s),pe.addToCache(o,s),s!==e&&(Lt.addToCache(o.baseTexture,e),pe.addToCache(o,e)),o.baseTexture.valid?Promise.resolve(o):new Promise(h=>{o.baseTexture.once("loaded",()=>h(o))})}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Cr[e]&&Cr[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),Cr[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Cr[t];if(e){const s=e.textureCacheIds.indexOf(t);return s>-1&&e.textureCacheIds.splice(s,1),delete Cr[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;ethis.baseTexture.width,o=s+n>this.baseTexture.height;if(a||o){const h=a&&o?"and":"or",l=`X: ${e} + ${r} = ${e+r} > ${this.baseTexture.width}`,c=`Y: ${s} + ${n} = ${s+n} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}this.valid=r&&n&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return pe._EMPTY||(pe._EMPTY=new pe(new Lt),eh(pe._EMPTY),eh(pe._EMPTY.baseTexture)),pe._EMPTY}static get WHITE(){if(!pe._WHITE){const t=_t.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),pe._WHITE=new pe(Lt.from(t)),eh(pe._WHITE),eh(pe._WHITE.baseTexture)}return pe._WHITE}};class Zn extends Nt{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,s=!0){const r=this.baseTexture.resolution,n=Math.round(t*r)/r,a=Math.round(e*r)/r;this.valid=n>0&&a>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=a,s&&this.baseTexture.resize(n,a),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new Zn(new F_(t))}}class L_{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,s=De.NONE){const r=new F_(Object.assign({width:t,height:e,resolution:1,multisample:s},this.textureOptions));return new Zn(r)}getOptimalTexture(t,e,s=1,r=De.NONE){let n;t=Math.max(Math.ceil(t*s-1e-6),1),e=Math.max(Math.ceil(e*s-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=Hh(t),e=Hh(e),n=((t&65535)<<16|e&65535)>>>0,r>1&&(n+=r*4294967296)):n=r>1?-r:-1,this.texturePool[n]||(this.texturePool[n]=[]);let a=this.texturePool[n].pop();return a||(a=this.createTexture(t,e,r)),a.filterPoolKey=n,a.setResolution(s),a}getFilterTexture(t,e,s){const r=this.getOptimalTexture(t.width,t.height,e||t.resolution,s||De.NONE);return r.filterFrame=t.filterFrame,r}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const e in this.texturePool){const s=this.texturePool[e];if(s)for(let r=0;r0&&t.height>0;for(const e in this.texturePool){if(!(Number(e)<0))continue;const s=this.texturePool[e];if(s)for(let r=0;r1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),s[u].apply(this,l,c,Nr.CLEAR,e);const d=l;l=c,c=d}s[u].apply(this,l,h.renderTexture,Nr.BLEND,e),u>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=Nr.CLEAR){const{renderTexture:s,state:r}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t==null?void 0:t.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,s.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=r.stateId&1||this.forceClear;(e===Nr.CLEAR||e===Nr.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,s,r){const n=this.renderer;n.state.set(t.state),this.bindAndClear(s,r),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(Yr.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(Yr.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:s,destinationFrame:r}=this.activeState,{orig:n}=e._texture,a=t.set(r.width,0,0,r.height,s.x,s.y),o=e.worldTransform.copyTo(fe.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/n.width,1/n.height),a.translate(e.anchor.x,e.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,s=1,r=De.NONE){return this.texturePool.getOptimalTexture(t,e,s,r)}getFilterTexture(t,e,s){if(typeof t=="number"){const n=t;t=e,e=n}t=t||this.activeState.renderTexture;const r=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,s||De.NONE);return r.filterFrame=t.filterFrame,r}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const s=sh[0],r=sh[1],n=sh[2],a=sh[3];s.set(e.left,e.top),r.set(e.left,e.bottom),n.set(e.right,e.top),a.set(e.right,e.bottom),t.apply(s,s),t.apply(r,r),t.apply(n,n),t.apply(a,a);const o=Math.min(s.x,r.x,n.x,a.x),h=Math.min(s.y,r.y,n.y,a.y),l=Math.max(s.x,r.x,n.x,a.x),c=Math.max(s.y,r.y,n.y,a.y);e.x=o,e.y=h,e.width=l-o,e.height=c-h}roundFrame(t,e,s,r,n){if(!(t.width<=0||t.height<=0||s.width<=0||s.height<=0)){if(n){const{a,b:o,c:h,d:l}=n;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(l)>1e-4))return}n=n?_f.copyFrom(n):_f.identity(),n.translate(-s.x,-s.y).scale(r.width/s.width,r.height/s.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}}}O_.extension={type:gt.RendererSystem,name:"filter"};St.add(O_);class FP{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=De.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const kP=new Ut;class D_{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Cm(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ut,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;_t.PREFER_ENV===Kn.WEBGL_LEGACY&&(e=null,s=null),e?t.drawBuffers=r=>e.drawBuffersWEBGL(r):(this.hasMRT=!1,t.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,s=0){const{gl:r}=this;if(t){const n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==s&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=s),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,s)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let a=0;a>s,o=e.height>>s,h=a/e.width;this.setViewport(e.x*h,e.y*h,a,o)}else{const a=t.width>>s,o=t.height>>s;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,s,r){const n=this.viewport;t=Math.round(t),e=Math.round(e),s=Math.round(s),r=Math.round(r),(n.width!==s||n.height!==r||n.x!==t||n.y!==e)&&(n.x=t,n.y=e,n.width=s,n.height=r,this.gl.viewport(t,e,s,r))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,s,r,n=fm.COLOR|fm.DEPTH){const{gl:a}=this;a.clearColor(t,e,s,r),a.clear(n)}initFramebuffer(t){const{gl:e}=this,s=new FP(e.createFramebuffer());return s.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(t),t.disposeRunner.add(this),s}resizeFramebuffer(t){const{gl:e}=this,s=t.glFramebuffers[this.CONTEXT_UID];if(s.stencil){e.bindRenderbuffer(e.RENDERBUFFER,s.stencil);let a;this.renderer.context.webGLVersion===1?a=e.DEPTH_STENCIL:t.depth&&t.stencil?a=e.DEPTH24_STENCIL8:t.depth?a=e.DEPTH_COMPONENT24:a=e.STENCIL_INDEX8,s.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,s.multisample,a,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,a,t.width,t.height)}const r=t.colorTextures;let n=r.length;e.drawBuffers||(n=Math.min(n,1));for(let a=0;a1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||s.createRenderbuffer():r.msaaBuffer&&(s.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));const o=[];for(let h=0;h1&&s.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){r.stencil=r.stencil||s.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=s.DEPTH_STENCIL_ATTACHMENT,l=s.DEPTH_STENCIL):t.depth&&t.stencil?(h=s.DEPTH_STENCIL_ATTACHMENT,l=s.DEPTH24_STENCIL8):t.depth?(h=s.DEPTH_ATTACHMENT,l=s.DEPTH_COMPONENT24):(h=s.STENCIL_ATTACHMENT,l=s.STENCIL_INDEX8),s.bindRenderbuffer(s.RENDERBUFFER,r.stencil),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,l,t.width,t.height):s.renderbufferStorage(s.RENDERBUFFER,l,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,h,s.RENDERBUFFER,r.stencil)}else r.stencil&&(s.deleteRenderbuffer(r.stencil),r.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let s=De.NONE;if(t<=1||e===null)return s;for(let r=0;r=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&r.deleteRenderbuffer(s.msaaBuffer),s.stencil&&r.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;ss.createVertexArrayOES(),t.bindVertexArray=r=>s.bindVertexArrayOES(r),t.deleteVertexArray=r=>s.deleteVertexArrayOES(r)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const s=t.getExtension("ANGLE_instanced_arrays");s?(t.vertexAttribDivisor=(r,n)=>s.vertexAttribDivisorANGLE(r,n),t.drawElementsInstanced=(r,n,a,o,h)=>s.drawElementsInstancedANGLE(r,n,a,o,h),t.drawArraysInstanced=(r,n,a,o)=>s.drawArraysInstancedANGLE(r,n,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:s}=this;let r=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={},n=!0);const a=r[e.program.id]||this.initGeometryVao(t,e,n);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?s.bindVertexArray(a):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let s=0;s"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){e===void 0&&(e=t);const s=this.mapCoord;for(let r=0;r0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==e&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}destroy(){this.renderer=null}}U_.extension={type:gt.RendererSystem,name:"mask"};St.add(U_);class X_{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,s=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==s&&(r===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const wx=new fe,Tx=[],V_=class wh extends X_{constructor(t){super(t),this.glConst=_t.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:s}=t,{renderer:r}=this,n=r.renderTexture,a=s.getBounds(!0,Tx.pop()??new Ut);this.roundFrameToPixels(a,n.current?n.current.resolution:r.resolution,n.sourceFrame,n.destinationFrame,r.projection.transform),e&&a.fit(e),t._scissorRectLocal=a}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:s,c:r,d:n}=t;return(Math.abs(s)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||wh.isMatrixRotated(e.worldTransform)||wh.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const s=t._scissorRectLocal;return s.width>0&&s.height>0}roundFrameToPixels(t,e,s,r,n){wh.isMatrixRotated(n)||(n=n?wx.copyFrom(n):wx.identity(),n.translate(-s.x,-s.y).scale(r.width/s.width,r.height/s.height).translate(r.x,r.y),this.renderer.filter.transformAABB(n,t),t.fit(r),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Tx.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};V_.extension={type:gt.RendererSystem,name:"scissor"};let NP=V_;St.add(NP);class Y_ extends X_{constructor(t){super(t),this.glConst=_t.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:s}=this.renderer,r=t._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),t._stencilCounter++;const n=t._colorMask;n!==0&&(t._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,r,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(t._colorMask=n,s.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}pop(t){const e=this.renderer.gl;if(this.getStackLength()===0)e.disable(e.STENCIL_TEST);else{const s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,r=s?s._colorMask:15;r!==0&&(s._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(s._colorMask=r,e.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Y_.extension={type:gt.RendererSystem,name:"stencil"};St.add(Y_);class G_{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Ht("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return Ht("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return Ht("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}G_.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"_plugin"};St.add(G_);class $_{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new fe,this.transform=null}update(t,e,s,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,r),this.transform&&this.projectionMatrix.append(this.transform);const n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)}calculateProjection(t,e,s,r){const n=this.projectionMatrix,a=r?-1:1;n.identity(),n.a=1/e.width*2,n.d=a*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-a-e.y*n.d}setTransform(t){}destroy(){this.renderer=null}}$_.extension={type:gt.RendererSystem,name:"projection"};St.add($_);const UP=new Dp,Sx=new Ut;class H_{constructor(t){this.renderer=t,this._tempMatrix=new fe}generateTexture(t,e){const{region:s,...r}=e||{},n=(s==null?void 0:s.copyTo(Sx))||t.getLocalBounds(Sx,!0),a=r.resolution||this.renderer.resolution;n.width=Math.max(n.width,1/a),n.height=Math.max(n.height,1/a),r.width=n.width,r.height=n.height,r.resolution=a,r.multisample??(r.multisample=this.renderer.multisample);const o=Zn.create(r);this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const h=t.transform;return t.transform=UP,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=h,o}destroy(){}}H_.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"textureGenerator"};St.add(H_);const vn=new Ut,po=new Ut;class W_{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ut,this.destinationFrame=new Ut,this.viewportFrame=new Ut}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,s){const r=this.renderer;this.current=t;let n,a,o;t?(n=t.baseTexture,o=n.resolution,e||(vn.width=t.frame.width,vn.height=t.frame.height,e=vn),s||(po.x=t.frame.x,po.y=t.frame.y,po.width=e.width,po.height=e.height,s=po),a=n.framebuffer):(o=r.resolution,e||(vn.width=r._view.screen.width,vn.height=r._view.screen.height,e=vn),s||(s=vn,s.width=e.width,s.height=e.height));const h=this.viewportFrame;h.x=s.x*o,h.y=s.y*o,h.width=s.width*o,h.height=s.height*o,t||(h.y=r.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(s,e,o,!a),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(s)}clear(t,e){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=Wt.shared.setValue(t||s);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&r.premultiply(r.alpha);const n=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=n.width!==a.width||n.height!==a.height;if(o){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(r.red,r.green,r.blue,r.alpha,e),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}W_.extension={type:gt.RendererSystem,name:"renderTexture"};St.add(W_);class XP{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function VP(i,t){const e={},s=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES);for(let r=0;rl>c?1:-1);for(let l=0;l({data:n,offset:0,dataLen:0,dirty:0}));let e=0,s=0,r=0;for(let n=0;n1&&(e=Math.max(e,16)*a.data.size),a.dataLen=e,s%e!==0&&s<16){const o=s%e%16;s+=o,r+=o}s+e>16?(r=Math.ceil(r/16)*16,a.offset=r,r+=e,s=e):(a.offset=r,s+=e,r+=e)}return r=Math.ceil(r/16)*16,{uboElements:t,size:r}}function zP(i,t){const e=[];for(const s in i)t[s]&&e.push(t[s]);return e.sort((s,r)=>s.index-r.index),e}function jP(i,t){if(!i.autoManage)return{size:0,syncFunc:$P};const e=zP(i.uniforms,t),{uboElements:s,size:r}=WP(e),n=[` var v = null; var v2 = null; var cv = null; var t = 0; var gl = renderer.gl var index = 0; var data = buffer.data; `];for(let a=0;a1){const u=P_(o.data.type),d=Math.max(z_[o.data.type]/16,1),f=u/d,m=(4-f%4)%4;n.push(` cv = ud.${l}.value; v = uv.${l}; offset = ${o.offset/4}; t = 0; for(var i=0; i < ${o.data.size*d}; i++) { for(var j = 0; j < ${f}; j++) { data[offset++] = v[t++]; } offset += ${m}; } `)}else{const u=HP[o.data.type];n.push(` cv = ud.${l}.value; v = uv.${l}; offset = ${o.offset/4}; ${u}; `)}}return n.push(` renderer.buffer.update(buffer); `),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join(` `))}}let qP=0;const rh={textureCount:0,uboCount:0};class j_{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=qP++}systemCheck(){if(!_P())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const s=t.program,r=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==s&&(this.program=s,this.gl.useProgram(r.program)),e||(rh.textureCount=0,rh.uboCount=0,this.syncUniformGroup(t.uniformGroup,rh)),r}setUniforms(t){const e=this.shader.program,s=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(s.uniformData,t,this.renderer)}syncUniformGroup(t,e){const s=this.getGlProgram();(!t.static||t.dirtyId!==s.uniformDirtyGroups[t.id])&&(s.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,s,e))}syncUniforms(t,e,s){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,s)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=gP(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const s=this.getGlProgram();if(!t.static||t.dirtyId!==0||!s.uniformGroups[t.id]){t.dirtyId=0;const r=s.uniformGroups[t.id]||this.createSyncBufferGroup(t,s,e);t.buffer.update(),r(s.uniformData,t.uniforms,this.renderer,rh,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,s.uniformBufferBindings[e])}createSyncBufferGroup(t,e,s){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const n=this.gl.getUniformBlockIndex(e.program,s);e.uniformBufferBindings[s]=this.shader.uniformBindCount,r.uniformBlockBinding(e.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=jP(t,this.shader.program.uniformData)),t.autoManage){const h=new Float32Array(o.size/4);t.buffer.update(h)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,s){const r=t.uniforms,n=[`${s}-`];for(const a in r)n.push(a),e[a]&&n.push(e[a].type);return n.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,s=t.program,r=GP(e,s);return s.glPrograms[this.renderer.CONTEXT_UID]=r,r}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}j_.extension={type:gt.RendererSystem,name:"shader"};St.add(j_);class Kh{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.3 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}Kh.defaultOptions={hello:!1},Kh.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"startup"};St.add(Kh);function KP(i,t=[]){return t[It.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.ADD]=[i.ONE,i.ONE],t[It.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SCREEN]=[i.ONE,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.NONE]=[0,0],t[It.NORMAL_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.ADD_NPM]=[i.SRC_ALPHA,i.ONE,i.ONE,i.ONE],t[It.SCREEN_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SRC_IN]=[i.DST_ALPHA,i.ZERO],t[It.SRC_OUT]=[i.ONE_MINUS_DST_ALPHA,i.ZERO],t[It.SRC_ATOP]=[i.DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],t[It.DST_OVER]=[i.ONE_MINUS_DST_ALPHA,i.ONE],t[It.DST_IN]=[i.ZERO,i.SRC_ALPHA],t[It.DST_OUT]=[i.ZERO,i.ONE_MINUS_SRC_ALPHA],t[It.DST_ATOP]=[i.ONE_MINUS_DST_ALPHA,i.SRC_ALPHA],t[It.XOR]=[i.ONE_MINUS_DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],t[It.SUBTRACT]=[i.ONE,i.ONE,i.ONE,i.ONE,i.FUNC_REVERSE_SUBTRACT,i.FUNC_ADD],t}const ZP=0,JP=1,QP=2,tM=3,eM=4,sM=5,q_=class Im{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=It.NONE,this._blendEq=!1,this.map=[],this.map[ZP]=this.setBlend,this.map[JP]=this.setOffset,this.map[QP]=this.setCullFace,this.map[tM]=this.setDepthTest,this.map[eM]=this.setFrontFace,this.map[sM]=this.setDepthMask,this.checks=[],this.defaultState=new jr,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=KP(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<>1,s++;this.stateId=t.data}for(let e=0;et.systems[r]),s=[...e,...Object.keys(t.systems).filter(r=>!e.includes(r))];for(const r of s)this.addSystem(t.systems[r],r)}addRunners(...t){t.forEach(e=>{this.runners[e]=new gr(e)})}addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const r in this.runners)this.runners[r].add(s);return this}emitWithCustomOptions(t,e){const s=Object.keys(this._systemsHash);t.items.forEach(r=>{const n=s.find(a=>this._systemsHash[a]===r);r[t.name](e[n])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const To=class Th{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Th.defaultMaxIdle,this.checkCountMax=Th.defaultCheckCountMax,this.mode=Th.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==kp.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let s=!1;for(let r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,s=!0)}if(s){let r=0;for(let n=0;n=0;r--)this.unload(t.children[r])}destroy(){this.renderer=null}};To.defaultMode=kp.AUTO,To.defaultMaxIdle=3600,To.defaultCheckCountMax=600,To.extension={type:gt.RendererSystem,name:"textureGC"};let Cn=To;St.add(Cn);class Tf{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=wt.UNSIGNED_BYTE,this.internalFormat=ft.RGBA,this.samplerType=0}}function nM(i){let t;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?t={[i.RGB]:Tt.FLOAT,[i.RGBA]:Tt.FLOAT,[i.ALPHA]:Tt.FLOAT,[i.LUMINANCE]:Tt.FLOAT,[i.LUMINANCE_ALPHA]:Tt.FLOAT,[i.R8]:Tt.FLOAT,[i.R8_SNORM]:Tt.FLOAT,[i.RG8]:Tt.FLOAT,[i.RG8_SNORM]:Tt.FLOAT,[i.RGB8]:Tt.FLOAT,[i.RGB8_SNORM]:Tt.FLOAT,[i.RGB565]:Tt.FLOAT,[i.RGBA4]:Tt.FLOAT,[i.RGB5_A1]:Tt.FLOAT,[i.RGBA8]:Tt.FLOAT,[i.RGBA8_SNORM]:Tt.FLOAT,[i.RGB10_A2]:Tt.FLOAT,[i.RGB10_A2UI]:Tt.FLOAT,[i.SRGB8]:Tt.FLOAT,[i.SRGB8_ALPHA8]:Tt.FLOAT,[i.R16F]:Tt.FLOAT,[i.RG16F]:Tt.FLOAT,[i.RGB16F]:Tt.FLOAT,[i.RGBA16F]:Tt.FLOAT,[i.R32F]:Tt.FLOAT,[i.RG32F]:Tt.FLOAT,[i.RGB32F]:Tt.FLOAT,[i.RGBA32F]:Tt.FLOAT,[i.R11F_G11F_B10F]:Tt.FLOAT,[i.RGB9_E5]:Tt.FLOAT,[i.R8I]:Tt.INT,[i.R8UI]:Tt.UINT,[i.R16I]:Tt.INT,[i.R16UI]:Tt.UINT,[i.R32I]:Tt.INT,[i.R32UI]:Tt.UINT,[i.RG8I]:Tt.INT,[i.RG8UI]:Tt.UINT,[i.RG16I]:Tt.INT,[i.RG16UI]:Tt.UINT,[i.RG32I]:Tt.INT,[i.RG32UI]:Tt.UINT,[i.RGB8I]:Tt.INT,[i.RGB8UI]:Tt.UINT,[i.RGB16I]:Tt.INT,[i.RGB16UI]:Tt.UINT,[i.RGB32I]:Tt.INT,[i.RGB32UI]:Tt.UINT,[i.RGBA8I]:Tt.INT,[i.RGBA8UI]:Tt.UINT,[i.RGBA16I]:Tt.INT,[i.RGBA16UI]:Tt.UINT,[i.RGBA32I]:Tt.INT,[i.RGBA32UI]:Tt.UINT,[i.DEPTH_COMPONENT16]:Tt.FLOAT,[i.DEPTH_COMPONENT24]:Tt.FLOAT,[i.DEPTH_COMPONENT32F]:Tt.FLOAT,[i.DEPTH_STENCIL]:Tt.FLOAT,[i.DEPTH24_STENCIL8]:Tt.FLOAT,[i.DEPTH32F_STENCIL8]:Tt.FLOAT}:t={[i.RGB]:Tt.FLOAT,[i.RGBA]:Tt.FLOAT,[i.ALPHA]:Tt.FLOAT,[i.LUMINANCE]:Tt.FLOAT,[i.LUMINANCE_ALPHA]:Tt.FLOAT,[i.DEPTH_STENCIL]:Tt.FLOAT},t}function aM(i){let t;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?t={[wt.UNSIGNED_BYTE]:{[ft.RGBA]:i.RGBA8,[ft.RGB]:i.RGB8,[ft.RG]:i.RG8,[ft.RED]:i.R8,[ft.RGBA_INTEGER]:i.RGBA8UI,[ft.RGB_INTEGER]:i.RGB8UI,[ft.RG_INTEGER]:i.RG8UI,[ft.RED_INTEGER]:i.R8UI,[ft.ALPHA]:i.ALPHA,[ft.LUMINANCE]:i.LUMINANCE,[ft.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[wt.BYTE]:{[ft.RGBA]:i.RGBA8_SNORM,[ft.RGB]:i.RGB8_SNORM,[ft.RG]:i.RG8_SNORM,[ft.RED]:i.R8_SNORM,[ft.RGBA_INTEGER]:i.RGBA8I,[ft.RGB_INTEGER]:i.RGB8I,[ft.RG_INTEGER]:i.RG8I,[ft.RED_INTEGER]:i.R8I},[wt.UNSIGNED_SHORT]:{[ft.RGBA_INTEGER]:i.RGBA16UI,[ft.RGB_INTEGER]:i.RGB16UI,[ft.RG_INTEGER]:i.RG16UI,[ft.RED_INTEGER]:i.R16UI,[ft.DEPTH_COMPONENT]:i.DEPTH_COMPONENT16},[wt.SHORT]:{[ft.RGBA_INTEGER]:i.RGBA16I,[ft.RGB_INTEGER]:i.RGB16I,[ft.RG_INTEGER]:i.RG16I,[ft.RED_INTEGER]:i.R16I},[wt.UNSIGNED_INT]:{[ft.RGBA_INTEGER]:i.RGBA32UI,[ft.RGB_INTEGER]:i.RGB32UI,[ft.RG_INTEGER]:i.RG32UI,[ft.RED_INTEGER]:i.R32UI,[ft.DEPTH_COMPONENT]:i.DEPTH_COMPONENT24},[wt.INT]:{[ft.RGBA_INTEGER]:i.RGBA32I,[ft.RGB_INTEGER]:i.RGB32I,[ft.RG_INTEGER]:i.RG32I,[ft.RED_INTEGER]:i.R32I},[wt.FLOAT]:{[ft.RGBA]:i.RGBA32F,[ft.RGB]:i.RGB32F,[ft.RG]:i.RG32F,[ft.RED]:i.R32F,[ft.DEPTH_COMPONENT]:i.DEPTH_COMPONENT32F},[wt.HALF_FLOAT]:{[ft.RGBA]:i.RGBA16F,[ft.RGB]:i.RGB16F,[ft.RG]:i.RG16F,[ft.RED]:i.R16F},[wt.UNSIGNED_SHORT_5_6_5]:{[ft.RGB]:i.RGB565},[wt.UNSIGNED_SHORT_4_4_4_4]:{[ft.RGBA]:i.RGBA4},[wt.UNSIGNED_SHORT_5_5_5_1]:{[ft.RGBA]:i.RGB5_A1},[wt.UNSIGNED_INT_2_10_10_10_REV]:{[ft.RGBA]:i.RGB10_A2,[ft.RGBA_INTEGER]:i.RGB10_A2UI},[wt.UNSIGNED_INT_10F_11F_11F_REV]:{[ft.RGB]:i.R11F_G11F_B10F},[wt.UNSIGNED_INT_5_9_9_9_REV]:{[ft.RGB]:i.RGB9_E5},[wt.UNSIGNED_INT_24_8]:{[ft.DEPTH_STENCIL]:i.DEPTH24_STENCIL8},[wt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[ft.DEPTH_STENCIL]:i.DEPTH32F_STENCIL8}}:t={[wt.UNSIGNED_BYTE]:{[ft.RGBA]:i.RGBA,[ft.RGB]:i.RGB,[ft.ALPHA]:i.ALPHA,[ft.LUMINANCE]:i.LUMINANCE,[ft.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[wt.UNSIGNED_SHORT_5_6_5]:{[ft.RGB]:i.RGB},[wt.UNSIGNED_SHORT_4_4_4_4]:{[ft.RGBA]:i.RGBA},[wt.UNSIGNED_SHORT_5_5_5_1]:{[ft.RGBA]:i.RGBA}},t}class K_{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Lt,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=aM(t),this.samplerTypes=nM(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let r=0;r=0;--n){const a=e[n];a&&a._glTextures[r].samplerType!==Tt.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const e=new Tf(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){var s;e.internalFormat=((s=this.internalFormats[t.type])==null?void 0:s[t.format])??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??Tt.FLOAT,this.webGLVersion===2&&t.type===wt.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){var r;const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const s=this.renderer;if(this.initTextureType(t,e),(r=t.resource)==null?void 0:r.upload(s,t,e))e.samplerType!==Tt.FLOAT&&(this.hasIntegerTextures=!0);else{const n=t.realWidth,a=t.realHeight,o=s.gl;(e.width!==n||e.height!==a||e.dirtyId<0)&&(e.width=n,e.height=a,o.texImage2D(t.target,0,e.internalFormat,n,a,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:s}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),s.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const r=this.managedTextures.indexOf(t);r!==-1&&Ma(this.managedTextures,r,1)}}updateTextureStyle(t){var s;const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===Ms.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ps.CLAMP:e.wrapMode=t.wrapMode,(s=t.resource)!=null&&s.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const s=this.gl;if(e.mipmap&&t.mipmap!==Ms.ON_MANUAL&&s.generateMipmap(t.target),s.texParameteri(t.target,s.TEXTURE_WRAP_S,e.wrapMode),s.texParameteri(t.target,s.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===Ns.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===Ns.LINEAR){const n=Math.min(t.anisotropicLevel,s.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===Ns.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(t.target,s.TEXTURE_MAG_FILTER,t.scaleMode===Ns.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}K_.extension={type:gt.RendererSystem,name:"texture"};St.add(K_);class Z_{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:s}=this,r=t._glTransformFeedbacks[s]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,r)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:s,renderer:r}=this;e&&r.shader.bind(e),s.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:s,CONTEXT_UID:r}=this,n=e.createTransformFeedback();t._glTransformFeedbacks[r]=n,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,n);for(let a=0;a(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(Wn||{});class Sf{constructor(t,e=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=s,this.once=r}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const J_=class ks{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Sf(null,null,1/0),this.deltaMS=1/ks.targetFPMS,this.elapsedMS=1/ks.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=Wn.NORMAL){return this._addListener(new Sf(t,e,s))}addOnce(t,e,s=Wn.NORMAL){return this._addListener(new Sf(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ss.shared:new ss,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Q_.extension=gt.Application;St.add(Q_);const t1=[];St.handleByList(gt.Renderer,t1);function oM(i){for(const t of t1)if(t.test(i))return new t(i);throw new Error("Unable to auto-detect a suitable renderer.")}var lM=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; varying vec2 vTextureCoord; void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; }`,hM=`attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; varying vec2 vTextureCoord; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } vec2 filterTextureCoord( void ) { return aVertexPosition * (outputFrame.zw * inputSize.zw); } void main(void) { gl_Position = filterVertexPosition(); vTextureCoord = filterTextureCoord(); } `;const cM=lM,e1=hM;class s1{constructor(t){this.renderer=t}contextChange(t){let e;if(this.renderer.context.webGLVersion===1){const s=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,s)}else{const s=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,s)}e>=De.HIGH?this.multisample=De.HIGH:e>=De.MEDIUM?this.multisample=De.MEDIUM:e>=De.LOW?this.multisample=De.LOW:this.multisample=De.NONE}destroy(){}}s1.extension={type:gt.RendererSystem,name:"_multisample"};St.add(s1);class uM{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class r1{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);e.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:s,CONTEXT_UID:r}=this;if(this.boundBufferBases[e]!==t){const n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[e]=t,s.bindBufferBase(s.UNIFORM_BUFFER,e,n.buffer)}}bindBufferRange(t,e,s){const{gl:r,CONTEXT_UID:n}=this;s=s||0;const a=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,e||0,a.buffer,s*256,256)}update(t){const{gl:e,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);if(t._updateID!==r.updateID)if(r.updateID=t._updateID,e.bindBuffer(t.type,r.buffer),r.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;r.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const s=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),s&&(e||r.deleteBuffer(s.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let s=0;se.resource).filter(e=>e).map(e=>e.load());return this._load=Promise.all(t).then(()=>{const{realWidth:e,realHeight:s}=this.items[0];return this.resize(e,s),this.update(),Promise.resolve(this)}),this._load}}class dM extends n1{constructor(t,e){const{width:s,height:r}=e||{};let n,a;Array.isArray(t)?(n=t,a=t.length):a=t,super(a,{width:s,height:r}),n&&this.initFromArray(n,e)}addBaseTextureAt(t,e){if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Pa.TEXTURE_2D_ARRAY}upload(t,e,s){const{length:r,itemDirtyIds:n,items:a}=this,{gl:o}=t;s.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,r,0,e.format,s.type,null);for(let h=0;h0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=Pa.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,s){const r=this.itemDirtyIds;for(let n=0;n{if(this.url===null){t(this);return}try{const s=await _t.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await s.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ke.UNPACK?"premultiply":"none"});if(this.destroyed){n.close();return}this.source=n,this.update(),t(this)}catch(s){if(this.destroyed)return;e(s),this.onError.emit(s)}}),this._load)}upload(t,e,s){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,s)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return xa._EMPTY=xa._EMPTY??_t.ADAPTER.createCanvas(0,0),xa._EMPTY}}const Mm=class Eh extends Ii{constructor(t,e){e=e||{},super(_t.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.update(),t(this)},Eh.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;Ii.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,s=t.height;if(!e||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let r=e*this.scale,n=s*this.scale;(this._overrideWidth||this._overrideHeight)&&(r=this._overrideWidth||this._overrideHeight/s*e,n=this._overrideHeight||this._overrideWidth/e*s),r=Math.round(r),n=Math.round(n);const a=this.source;a.width=r,a.height=n,a._pixiId=`canvas_${Hn()}`,a.getContext("2d").drawImage(t,0,0,e,s,0,0,r,n),this._resolve(),this._resolve=null}}static getSize(t){const e=Eh.SVG_SIZE.exec(t),s={};return e&&(s[e[1]]=Math.round(parseFloat(e[3])),s[e[5]]=Math.round(parseFloat(e[7]))),s}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Eh.SVG_XML.test(t)}};Mm.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Rm=Mm;class pM extends Ii{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}}const Fm=class km extends Ii{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const s=document.createElement("video");e.autoLoad!==!1&&s.setAttribute("preload","auto"),e.playsinline!==!1&&(s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline","")),e.muted===!0&&(s.setAttribute("muted",""),s.muted=!0),e.loop===!0&&s.setAttribute("loop",""),e.autoPlay!==!1&&s.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const r=t[0].src||t[0];Ii.crossOrigin(s,r,e.crossorigin);for(let n=0;n{this.valid?e(this):(this._resolve=e,this._reject=s,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(ss.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ss.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ss.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||km.TYPES.includes(e)}};Fm.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Fm.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let o1=Fm;bm.push(xa,k_,fM,o1,pM,Rm,Gc,mM,dM);class Ya{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?Ut.EMPTY:(t=t||new Ut(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:s,b:r,c:n,d:a,tx:o,ty:h}=t,l=s*e.x+n*e.y+o,c=r*e.x+a*e.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let e=this.minX,s=this.minY,r=this.maxX,n=this.maxY,a=t[0],o=t[1];e=ar?a:r,n=o>n?o:n,a=t[2],o=t[3],e=ar?a:r,n=o>n?o:n,a=t[4],o=t[5],e=ar?a:r,n=o>n?o:n,a=t[6],o=t[7],e=ar?a:r,n=o>n?o:n,this.minX=e,this.minY=s,this.maxX=r,this.maxY=n}addFrame(t,e,s,r,n){this.addFrameMatrix(t.worldTransform,e,s,r,n)}addFrameMatrix(t,e,s,r,n){const a=t.a,o=t.b,h=t.c,l=t.d,c=t.tx,u=t.ty;let d=this.minX,f=this.minY,m=this.maxX,p=this.maxY,g=a*e+h*s+c,y=o*e+l*s+u;d=gm?g:m,p=y>p?y:p,g=a*r+h*s+c,y=o*r+l*s+u,d=gm?g:m,p=y>p?y:p,g=a*e+h*n+c,y=o*e+l*n+u,d=gm?g:m,p=y>p?y:p,g=a*r+h*n+c,y=o*r+l*n+u,d=gm?g:m,p=y>p?y:p,this.minX=d,this.minY=f,this.maxX=m,this.maxY=p}addVertexData(t,e,s){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;for(let h=e;ha?l:a,o=c>o?c:o}this.minX=r,this.minY=n,this.maxX=a,this.maxY=o}addVertices(t,e,s,r){this.addVerticesMatrix(t.worldTransform,e,s,r)}addVerticesMatrix(t,e,s,r,n=0,a=n){const o=t.a,h=t.b,l=t.c,c=t.d,u=t.tx,d=t.ty;let f=this.minX,m=this.minY,p=this.maxX,g=this.maxY;for(let y=s;yr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n}addBoundsMask(t,e){const s=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXl?n:l,this.maxY=a>c?a:c}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const s=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXl?n:l,this.maxY=a>c?a:c}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,s,r,n,a){t-=n,e-=a,s+=n,r+=a,this.minX=this.minXs?this.maxX:s,this.minY=this.minYr?this.maxY:r}}class Ie extends Al{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Dp,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ya,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let s=0;s1)for(let e=0;ethis.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const s=this.getChildIndex(t),r=this.getChildIndex(e);this.children[s]=e,this.children[r]=t,this.onChildrenChange(s=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const s=this.getChildIndex(t);Ma(this.children,s,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e0&&n<=r){a=this.children.splice(s,n);for(let o=0;o1&&this.children.sort(xM),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t0&&e.height>0))return;let s,r;this.cullArea?(s=this.cullArea,r=this.worldTransform):this._render!==Lm.prototype._render&&(s=this.getBounds(!0));const n=t.projection.transform;if(n&&(r?(r=yM.copyFrom(r),r.prepend(n)):r=n),s&&e.intersects(s,r))this._render(t);else if(this.cullArea)return;for(let a=0,o=this.children.length;a=r&&go.x=n&&go.y=e&&(a=i-o-1),h=h.replace("%value%",t[a].toString()),r+=h,r+=` `}return s=s.replace("%blur%",r),s=s.replace("%size%",i.toString()),s}const AM=` attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; uniform float strength; varying vec2 vBlurTexCoords[%size%]; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } vec2 filterTextureCoord( void ) { return aVertexPosition * (outputFrame.zw * inputSize.zw); } void main(void) { gl_Position = filterVertexPosition(); vec2 textureCoord = filterTextureCoord(); %blur% }`;function CM(i,t){const e=Math.ceil(i/2);let s=AM,r="",n;t?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let a=0;a 0.0) { c.rgb /= c.a; } vec4 result; result.r = (m[0] * c.r); result.r += (m[1] * c.g); result.r += (m[2] * c.b); result.r += (m[3] * c.a); result.r += m[4]; result.g = (m[5] * c.r); result.g += (m[6] * c.g); result.g += (m[7] * c.b); result.g += (m[8] * c.a); result.g += m[9]; result.b = (m[10] * c.r); result.b += (m[11] * c.g); result.b += (m[12] * c.b); result.b += (m[13] * c.a); result.b += m[14]; result.a = (m[15] * c.r); result.a += (m[16] * c.g); result.a += (m[17] * c.b); result.a += (m[18] * c.a); result.a += m[19]; vec3 rgb = mix(c.rgb, result.rgb, uAlpha); // Premultiply alpha again. rgb *= result.a; gl_FragColor = vec4(rgb, result.a); } `;class Om extends _s{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(e1,PM,t),this.alpha=1}_loadMatrix(t,e=!1){let s=t;e&&(this._multiply(s,this.uniforms.m,t),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(t,e,s){return t[0]=e[0]*s[0]+e[1]*s[5]+e[2]*s[10]+e[3]*s[15],t[1]=e[0]*s[1]+e[1]*s[6]+e[2]*s[11]+e[3]*s[16],t[2]=e[0]*s[2]+e[1]*s[7]+e[2]*s[12]+e[3]*s[17],t[3]=e[0]*s[3]+e[1]*s[8]+e[2]*s[13]+e[3]*s[18],t[4]=e[0]*s[4]+e[1]*s[9]+e[2]*s[14]+e[3]*s[19]+e[4],t[5]=e[5]*s[0]+e[6]*s[5]+e[7]*s[10]+e[8]*s[15],t[6]=e[5]*s[1]+e[6]*s[6]+e[7]*s[11]+e[8]*s[16],t[7]=e[5]*s[2]+e[6]*s[7]+e[7]*s[12]+e[8]*s[17],t[8]=e[5]*s[3]+e[6]*s[8]+e[7]*s[13]+e[8]*s[18],t[9]=e[5]*s[4]+e[6]*s[9]+e[7]*s[14]+e[8]*s[19]+e[9],t[10]=e[10]*s[0]+e[11]*s[5]+e[12]*s[10]+e[13]*s[15],t[11]=e[10]*s[1]+e[11]*s[6]+e[12]*s[11]+e[13]*s[16],t[12]=e[10]*s[2]+e[11]*s[7]+e[12]*s[12]+e[13]*s[17],t[13]=e[10]*s[3]+e[11]*s[8]+e[12]*s[13]+e[13]*s[18],t[14]=e[10]*s[4]+e[11]*s[9]+e[12]*s[14]+e[13]*s[19]+e[14],t[15]=e[15]*s[0]+e[16]*s[5]+e[17]*s[10]+e[18]*s[15],t[16]=e[15]*s[1]+e[16]*s[6]+e[17]*s[11]+e[18]*s[16],t[17]=e[15]*s[2]+e[16]*s[7]+e[17]*s[12]+e[18]*s[17],t[18]=e[15]*s[3]+e[16]*s[8]+e[17]*s[13]+e[18]*s[18],t[19]=e[15]*s[4]+e[16]*s[9]+e[17]*s[14]+e[18]*s[19]+e[19],t}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}tint(t,e){const[s,r,n]=Wt.shared.setValue(t).toArray(),a=[s,0,0,0,0,0,r,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(a,e)}greyscale(t,e){const s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}blackAndWhite(t){const e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)}hue(t,e){t=(t||0)/180*Math.PI;const s=Math.cos(t),r=Math.sin(t),n=Math.sqrt,a=1/3,o=n(a),h=s+(1-s)*a,l=a*(1-s)-o*r,c=a*(1-s)+o*r,u=a*(1-s)+o*r,d=s+a*(1-s),f=a*(1-s)-o*r,m=a*(1-s)-o*r,p=a*(1-s)+o*r,g=s+a*(1-s),y=[h,l,c,0,0,u,d,f,0,0,m,p,g,0,0,0,0,0,1,0];this._loadMatrix(y,e)}contrast(t,e){const s=(t||0)+1,r=-.5*(s-1),n=[s,0,0,0,r,0,s,0,0,r,0,0,s,0,r,0,0,0,1,0];this._loadMatrix(n,e)}saturate(t=0,e){const s=t*2/3+1,r=(s-1)*-.5,n=[s,r,r,0,0,r,s,r,0,0,r,r,s,0,0,0,0,0,1,0];this._loadMatrix(n,e)}desaturate(){this.saturate(-1)}negative(t){const e=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(e,t)}sepia(t){const e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)}technicolor(t){const e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)}polaroid(t){const e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)}toBGR(t){const e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)}kodachrome(t){const e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)}browni(t){const e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)}vintage(t){const e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)}colorTone(t,e,s,r,n){t=t||.2,e=e||.15,s=s||16770432,r=r||3375104;const a=Wt.shared,[o,h,l]=a.setValue(s).toArray(),[c,u,d]=a.setValue(r).toArray(),f=[.3,.59,.11,0,0,o,h,l,t,0,c,u,d,e,0,o-c,h-u,l-d,0,0];this._loadMatrix(f,n)}night(t,e){t=t||.1;const s=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(s,e)}predator(t,e){const s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(s,e)}lsd(t){const e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}Om.prototype.grayscale=Om.prototype.greyscale;var MM=`varying vec2 vFilterCoord; varying vec2 vTextureCoord; uniform vec2 scale; uniform mat2 rotation; uniform sampler2D uSampler; uniform sampler2D mapSampler; uniform highp vec4 inputSize; uniform vec4 inputClamp; void main(void) { vec4 map = texture2D(mapSampler, vFilterCoord); map -= 0.5; map.xy = scale * inputSize.zw * (rotation * map.xy); gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); } `,RM=`attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; uniform mat3 filterMatrix; varying vec2 vTextureCoord; varying vec2 vFilterCoord; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } vec2 filterTextureCoord( void ) { return aVertexPosition * (outputFrame.zw * inputSize.zw); } void main(void) { gl_Position = filterVertexPosition(); vTextureCoord = filterTextureCoord(); vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; } `;class FM extends _s{constructor(t,e){const s=new fe;t.renderable=!1,super(RM,MM,{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=s,e==null&&(e=20),this.scale=new Kt(e,e)}apply(t,e,s,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const n=this.maskSprite.worldTransform,a=Math.sqrt(n.a*n.a+n.b*n.b),o=Math.sqrt(n.c*n.c+n.d*n.d);a!==0&&o!==0&&(this.uniforms.rotation[0]=n.a/a,this.uniforms.rotation[1]=n.b/a,this.uniforms.rotation[2]=n.c/o,this.uniforms.rotation[3]=n.d/o),t.applyFilter(this,e,s,r)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}var kM=`varying vec2 v_rgbNW; varying vec2 v_rgbNE; varying vec2 v_rgbSW; varying vec2 v_rgbSE; varying vec2 v_rgbM; varying vec2 vFragCoord; uniform sampler2D uSampler; uniform highp vec4 inputSize; /** Basic FXAA implementation based on the code on geeks3d.com with the modification that the texture2DLod stuff was removed since it's unsupported by WebGL. -- From: https://github.com/mitsuhiko/webgl-meincraft Copyright (c) 2011 by Armin Ronacher. Some rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FXAA_REDUCE_MIN #define FXAA_REDUCE_MIN (1.0/ 128.0) #endif #ifndef FXAA_REDUCE_MUL #define FXAA_REDUCE_MUL (1.0 / 8.0) #endif #ifndef FXAA_SPAN_MAX #define FXAA_SPAN_MAX 8.0 #endif //optimized version for mobile, where dependent //texture reads can be a bottleneck vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, vec2 v_rgbNW, vec2 v_rgbNE, vec2 v_rgbSW, vec2 v_rgbSE, vec2 v_rgbM) { vec4 color; vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; vec4 texColor = texture2D(tex, v_rgbM); vec3 rgbM = texColor.xyz; vec3 luma = vec3(0.299, 0.587, 0.114); float lumaNW = dot(rgbNW, luma); float lumaNE = dot(rgbNE, luma); float lumaSW = dot(rgbSW, luma); float lumaSE = dot(rgbSE, luma); float lumaM = dot(rgbM, luma); float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); mediump vec2 dir; dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), dir * rcpDirMin)) * inverseVP; vec3 rgbA = 0.5 * ( texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); vec3 rgbB = rgbA * 0.5 + 0.25 * ( texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); float lumaB = dot(rgbB, luma); if ((lumaB < lumaMin) || (lumaB > lumaMax)) color = vec4(rgbA, texColor.a); else color = vec4(rgbB, texColor.a); return color; } void main() { vec4 color; color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); gl_FragColor = color; } `,LM=` attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; varying vec2 v_rgbNW; varying vec2 v_rgbNE; varying vec2 v_rgbSW; varying vec2 v_rgbSE; varying vec2 v_rgbM; varying vec2 vFragCoord; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } void texcoords(vec2 fragCoord, vec2 inverseVP, out vec2 v_rgbNW, out vec2 v_rgbNE, out vec2 v_rgbSW, out vec2 v_rgbSE, out vec2 v_rgbM) { v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; v_rgbM = vec2(fragCoord * inverseVP); } void main(void) { gl_Position = filterVertexPosition(); vFragCoord = aVertexPosition * outputFrame.zw; texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); } `;class BM extends _s{constructor(){super(LM,kM)}}var OM=`precision highp float; varying vec2 vTextureCoord; varying vec4 vColor; uniform float uNoise; uniform float uSeed; uniform sampler2D uSampler; float rand(vec2 co) { return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); } void main() { vec4 color = texture2D(uSampler, vTextureCoord); float randomValue = rand(gl_FragCoord.xy * uSeed); float diff = (randomValue - 0.5) * uNoise; // Un-premultiply alpha before applying the color matrix. See issue #3539. if (color.a > 0.0) { color.rgb /= color.a; } color.r += diff; color.g += diff; color.b += diff; // Premultiply alpha again. color.rgb *= color.a; gl_FragColor = color; } `;class DM extends _s{constructor(t=.5,e=Math.random()){super(e1,OM,{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const Ex={AlphaFilter:wM,BlurFilter:IM,BlurFilterPass:Bm,ColorMatrixFilter:Om,DisplacementFilter:FM,FXAAFilter:BM,NoiseFilter:DM};Object.entries(Ex).forEach(([i,t])=>{Object.defineProperty(Ex,i,{get(){return Ht("7.1.0",`filters.${i} has moved to ${i}`),t}})});class NM{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(ss.system.add(this.tickerUpdate,this,Wn.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(ss.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTimes.priority-r.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let s=0,r=e.length;s=0;r--)if(t.currentTarget=s[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,s=this._allInteractiveElements){if(s.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(e)?e:[e];for(let n=s.length-1;n>=0;n--)r.forEach(a=>{t.currentTarget=s[n],this.notifyTarget(t,a)})}propagationPath(t){const e=[t];for(let s=0;s=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(e)?e:d.eventMode,s,r,n,a||n(t,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const m=t.isInteractive();(f.length>0||m)&&(m&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),o=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return h&&l&&this._allInteractiveElements.push(t),a||this._hitElements.length>0?null:o?this._hitElements:h&&!n(t,s)&&r(t,s)?l?[t]:[]:null}hitTestRecursive(t,e,s,r,n){if(this._interactivePrune(t)||n(t,s))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ji.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(e)?e:c.eventMode,s,r,n);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();return(u.length>0||d)&&u.push(t),u}}}const a=this._isInteractive(e),o=t.isInteractive();return a&&r(t,s)?o?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,e){var s;if(t.hitArea&&(t.worldTransform.applyInverse(e,Ef),!t.hitArea.contains(Ef.x,Ef.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!((s=r.containsPoint)!=null&&s.call(r,e)))return!0}return!1}hitTestFn(t,e){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(e):!1}notifyTarget(t,e){var n,a;e=e??t.type;const s=`on${e}`;(a=(n=t.currentTarget)[s])==null||a.call(n,t);const r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),e.pointerType==="touch")this.dispatchEvent(e,"touchstart");else if(e.pointerType==="mouse"||e.pointerType==="pen"){const r=e.button===2;this.dispatchEvent(e,r?"rightdown":"mousedown")}const s=this.trackingData(t.pointerId);s.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var h,l;if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s=e.pointerType==="mouse"||e.pointerType==="pen",r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.overTargets);if(((h=r.overTargets)==null?void 0:h.length)>0&&n!==e.target){const c=t.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(t,c,n);if(this.dispatchEvent(u,"pointerout"),s&&this.dispatchEvent(u,"mouseout"),!e.composedPath().includes(n)){const d=this.createPointerEvent(t,"pointerleave",n);for(d.eventPhase=d.AT_TARGET;d.target&&!e.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),s&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(n!==e.target){const c=t.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(e,c);this.dispatchEvent(u,"pointerover"),s&&this.dispatchEvent(u,"mouseover");let d=n==null?void 0:n.parent;for(;d&&d!==this.rootTarget.parent&&d!==e.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(e,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==n&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),s&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push("pointermove"):this.dispatchEvent(e,"pointermove"),o&&a.push("globalpointermove"),e.pointerType==="touch"&&(this.moveOnAll?a.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),o&&a.push("globaltouchmove")),s&&(this.moveOnAll?a.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),o&&a.push("globalmousemove"),this.cursor=(l=e.target)==null?void 0:l.cursor),a.length>0&&this.all(e,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){var a;if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),s=this.createPointerEvent(t),r=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),r&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=(a=s.target)==null?void 0:a.cursor);const n=this.clonePointerEvent(s,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;e.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId);if(e.overTargets){const s=t.pointerType==="mouse"||t.pointerType==="pen",r=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout");const a=this.createPointerEvent(t,"pointerleave",r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),s&&this.notifyTarget(a,"mouseleave"),a.target=a.target.parent;e.overTargets=null,this.freeEvent(n),this.freeEvent(a)}this.cursor=null}mapPointerUp(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const o=s.button===2;this.dispatchEvent(s,o?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]);let a=n;if(n&&!s.composedPath().includes(n)){let o=n;for(;o&&!s.composedPath().includes(o);){if(s.currentTarget=o,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const h=s.button===2;this.notifyTarget(s,h?"rightupoutside":"mouseupoutside")}o=o.parent}delete r.pressTargetsByButton[t.button],a=o}if(a){const o=this.clonePointerEvent(s,"click");o.target=a,o.path=null,r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:o.target,timeStamp:e});const h=r.clicksByButton[t.button];if(h.target===o.target&&e-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=o.target,h.timeStamp=e,o.detail=h.clickCount,o.pointerType==="mouse"){const l=o.button===2;this.dispatchEvent(o,l?"rightclick":"click")}else o.pointerType==="touch"&&this.dispatchEvent(o,"tap");this.dispatchEvent(o,"pointertap"),this.freeEvent(o)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),s=this.findMountedTarget(e.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(s){let n=s;for(;n;)r.currentTarget=n,this.notifyTarget(r,"pointerupoutside"),r.pointerType==="touch"?this.notifyTarget(r,"touchendoutside"):(r.pointerType==="mouse"||r.pointerType==="pen")&&this.notifyTarget(r,r.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(r)}mapWheel(t){if(!(t instanceof Fa)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let s=1;s(s==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=r),e[s]=r,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){const{view:e,resolution:s}=this.renderer;this.setTargetElement(e),this.resolution=s,Nm._defaultEventMode=t.eventMode??"auto",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const s=this.cursorStyles[t];if(s)switch(typeof s){case"string":e&&(this.domElement.style.cursor=s);break;case"function":s(t);break;case"object":e&&Object.assign(this.domElement.style,s);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let s=0,r=e.length;s0&&(e=t.composedPath()[0]);const s=e!==this.domElement?"outside":"",r=this.normalizeToPointerData(t);for(let n=0,a=r.length;n"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){const s=t;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=YM),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=GM[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};Dm.extension={name:"events",type:[gt.RendererSystem,gt.CanvasRendererSystem]},Dm.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Um=Dm;St.add(Um);function Ax(i){return i==="dynamic"||i==="static"}const $M={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??Ax(Um.defaultEventMode)},set interactive(i){Ht("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=i,this.eventMode=i?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Um.defaultEventMode},set eventMode(i){this._internalInteractive=Ax(i),this._internalEventMode=i},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(i,t,e){const s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,r=typeof e=="object"?e.signal:void 0,n=typeof e=="object"?e.once===!0:!1,a=typeof t=="function"?void 0:t;i=s?`${i}capture`:i;const o=typeof t=="function"?t:t.handleEvent,h=this;r&&r.addEventListener("abort",()=>{h.off(i,o,a)}),n?h.once(i,o,a):h.on(i,o,a)},removeEventListener(i,t,e){const s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,r=typeof t=="function"?void 0:t;i=s?`${i}capture`:i,t=typeof t=="function"?t:t.handleEvent,this.off(i,t,r)},dispatchEvent(i){if(!(i instanceof Cl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return i.defaultPrevented=!1,i.path=null,i.target=this,i.manager.dispatchEvent(i),!i.defaultPrevented}};Ie.mixin($M);const HM={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Ie.mixin(HM);const WM=9,ih=100,zM=0,jM=0,Cx=2,Ix=1,qM=-1e3,KM=-1e3,ZM=2;class c1{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(pi.tablet||pi.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width=`${ih}px`,e.style.height=`${ih}px`,e.style.position="absolute",e.style.top=`${zM}px`,e.style.left=`${jM}px`,e.style.zIndex=Cx.toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width=`${Ix}px`,t.style.height=`${Ix}px`,t.style.position="absolute",t.style.top=`${qM}px`,t.style.left=`${KM}px`,t.style.zIndex=ZM.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)==null||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)==null||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let s=0;s title : ${t.title}
tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:s}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>s&&(t.height=s-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=`${ih}px`,e.style.height=`${ih}px`,e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=Cx.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?e.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:s}=t.target,r=this.renderer.events.rootBoundary,n=Object.assign(new Cl(r),{target:s});r.rootTarget=this.renderer.lastObjectRendered,e.forEach(a=>r.dispatchEvent(n,a))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode===WM&&this.activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}c1.extension={name:"accessibility",type:[gt.RendererPlugin,gt.CanvasRendererPlugin]};St.add(c1);const u1=class Xm{constructor(t){this.stage=new fs,t=Object.assign({forceCanvas:!1},t),this.renderer=oM(t),Xm._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render(this.stage)}get view(){var t;return(t=this.renderer)==null?void 0:t.view}get screen(){var t;return(t=this.renderer)==null?void 0:t.screen}destroy(t,e){const s=Xm._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};u1._plugins=[];let JM=u1;St.handleByList(gt.Application,JM._plugins);class d1{static init(t){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;e=r,s=n}this.renderer.resize(e,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}d1.extension=gt.Application;St.add(d1);const Px={loader:gt.LoadParser,resolver:gt.ResolveParser,cache:gt.CacheParser,detection:gt.DetectionParser};St.handle(gt.Asset,i=>{const t=i.ref;Object.entries(Px).filter(([e])=>!!t[e]).forEach(([e,s])=>St.add(Object.assign(t[e],{extension:t[e].extension??s})))},i=>{const t=i.ref;Object.keys(Px).filter(e=>!!t[e]).forEach(e=>St.remove(t[e]))});class QM{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s(Array.isArray(i)||(i=[i]),t?i.map(s=>typeof s=="string"||e?t(s):s):i),sl=(i,t)=>{const e=t.split("?")[1];return e&&(i+=`?${e}`),i};function f1(i,t,e,s,r){const n=t[e];for(let a=0;a{const a=n.substring(1,n.length-1).split(",");r.push(a)}),f1(i,r,0,e,s)}else s.push(i);return s}const Qh=i=>!Array.isArray(i);class eR{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=hr(t);let r;for(let o=0;o{r[o]=e}));const n=Object.keys(r),a={cacheKeys:n,keys:s};if(s.forEach(o=>{this._cacheMap.set(o,a)}),n.forEach(o=>{const h=r?r[o]:e;this._cache.has(o)&&this._cache.get(o)!==h&&console.warn("[Cache] already has key:",o),this._cache.set(o,r[o])}),e instanceof Nt){const o=e;s.forEach(h=>{o.baseTexture!==Nt.EMPTY.baseTexture&&Lt.addToCache(o.baseTexture,h),Nt.addToCache(o,h)})}}remove(t){if(!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(s=>{this._cache.delete(s)}),e.keys.forEach(s=>{this._cacheMap.delete(s)})}get parsers(){return this._parsers}}const Rn=new eR;class sR{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const s={promise:null,parser:null};return s.promise=(async()=>{var a,o;let r=null,n=null;if(e.loadParser&&(n=this._parserHash[e.loadParser],n||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!n){for(let h=0;h({alias:[l],src:l})),o=a.length,h=a.map(async l=>{const c=ye.toAbsolute(l.src);if(!r[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),r[l.src]=await this.promiseCache[c].promise,e&&e(++s/o)}catch(u){throw delete this.promiseCache[c],delete r[l.src],new Error(`[Loader.load] Failed to load ${c}. ${u}`)}});return await Promise.all(h),n?r[a[0].src]:r}async unload(t){const e=hr(t,s=>({alias:[s],src:s})).map(async s=>{var a,o;const r=ye.toAbsolute(s.src),n=this.promiseCache[r];if(n){const h=await n.promise;delete this.promiseCache[r],(o=(a=n.parser)==null?void 0:a.unload)==null||o.call(a,h,s,this)}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e}),{})}}var Ts=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(Ts||{});const rR=".json",iR="application/json",nR={extension:{type:gt.LoadParser,priority:Ts.Low},name:"loadJson",test(i){return eo(i,iR)||Ue(i,rR)},async load(i){return await(await _t.ADAPTER.fetch(i)).json()}};St.add(nR);const aR=".txt",oR="text/plain",lR={name:"loadTxt",extension:{type:gt.LoadParser,priority:Ts.Low},test(i){return eo(i,oR)||Ue(i,aR)},async load(i){return await(await _t.ADAPTER.fetch(i)).text()}};St.add(lR);const hR=["normal","bold","100","200","300","400","500","600","700","800","900"],cR=[".ttf",".otf",".woff",".woff2"],uR=["font/ttf","font/otf","font/woff","font/woff2"],dR=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function fR(i){const t=ye.extname(i),e=ye.basename(i,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1));let s=e.length>0;for(const n of e)if(!n.match(dR)){s=!1;break}let r=e.join(" ");return s||(r=`"${r.replace(/[\\"]/g,"\\$&")}"`),r}const mR=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function pR(i){return mR.test(i)?i:encodeURI(i)}const gR={extension:{type:gt.LoadParser,priority:Ts.Low},name:"loadWebFont",test(i){return eo(i,uR)||Ue(i,cR)},async load(i,t){var s,r,n;const e=_t.ADAPTER.getFontFaceSet();if(e){const a=[],o=((s=t.data)==null?void 0:s.family)??fR(i),h=((n=(r=t.data)==null?void 0:r.weights)==null?void 0:n.filter(c=>hR.includes(c)))??["normal"],l=t.data??{};for(let c=0;c_t.ADAPTER.getFontFaceSet().delete(t))}};St.add(gR);const yR=`(function() { "use strict"; const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; async function checkImageBitmap() { try { if (typeof createImageBitmap != "function") return !1; const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); return imageBitmap.width === 1 && imageBitmap.height === 1; } catch { return !1; } } checkImageBitmap().then((result) => { self.postMessage(result); }); })(); `;let ka=null,Vm=class{constructor(){ka||(ka=URL.createObjectURL(new Blob([yR],{type:"application/javascript"}))),this.worker=new Worker(ka)}};Vm.revokeObjectURL=function(){ka&&(URL.revokeObjectURL(ka),ka=null)};const xR=`(function() { "use strict"; async function loadImageBitmap(url) { const response = await fetch(url); if (!response.ok) throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); const imageBlob = await response.blob(); return await createImageBitmap(imageBlob); } self.onmessage = async (event) => { try { const imageBitmap = await loadImageBitmap(event.data.data[0]); self.postMessage({ data: imageBitmap, uuid: event.data.uuid, id: event.data.id }, [imageBitmap]); } catch (e) { self.postMessage({ error: e, uuid: event.data.uuid, id: event.data.id }); } }; })(); `;let La=null;class m1{constructor(){La||(La=URL.createObjectURL(new Blob([xR],{type:"application/javascript"}))),this.worker=new Worker(La)}}m1.revokeObjectURL=function(){La&&(URL.revokeObjectURL(La),La=null)};let Mx=0,Af;class bR{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{const{worker:e}=new Vm;e.addEventListener("message",s=>{e.terminate(),Vm.revokeObjectURL(),t(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Af===void 0&&(Af=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers{this.complete(e.data),this.returnWorker(e.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const s=new Promise((r,n)=>{this.queue.push({id:t,arguments:e,resolve:r,reject:n})});return this.next(),s}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),s=e.id;this.resolveHash[Mx]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Mx++,id:s})}}const Rx=new bR;function Il(i,t,e){i.resource.internal=!0;const s=new Nt(i),r=()=>{delete t.promiseCache[e],Rn.has(e)&&Rn.remove(e)};return s.baseTexture.once("destroyed",()=>{e in t.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),r())}),s.once("destroyed",()=>{i.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),r())}),s}const vR=[".jpeg",".jpg",".png",".webp",".avif"],_R=["image/jpeg","image/png","image/webp","image/avif"];async function wR(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${i}: ${t.status} ${t.statusText}`);const e=await t.blob();return await createImageBitmap(e)}const qc={name:"loadTextures",extension:{type:gt.LoadParser,priority:Ts.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(i){return eo(i,_R)||Ue(i,vR)},async load(i,t,e){var o;const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let r;s?this.config.preferWorkers&&await Rx.isImageBitmapSupported()?r=await Rx.loadImageBitmap(i):r=await wR(i):r=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=i,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const n={...t.data};n.resolution??(n.resolution=Ci(i)),s&&((o=n.resourceOptions)==null?void 0:o.ownsImageBitmap)===void 0&&(n.resourceOptions={...n.resourceOptions},n.resourceOptions.ownsImageBitmap=!0);const a=new Lt(r,n);return a.resource.src=i,Il(a,e,i)},unload(i){i.destroy(!0)}};St.add(qc);const TR=".svg",SR="image/svg+xml",ER={extension:{type:gt.LoadParser,priority:Ts.High},name:"loadSVG",test(i){return eo(i,SR)||Ue(i,TR)},async testParse(i){return Rm.test(i)},async parse(i,t,e){var n;const s=new Rm(i,(n=t==null?void 0:t.data)==null?void 0:n.resourceOptions);await s.load();const r=new Lt(s,{resolution:Ci(i),...t==null?void 0:t.data});return r.resource.src=t.src,Il(r,e,t.src)},async load(i,t){return(await _t.ADAPTER.fetch(i)).text()},unload:qc.unload};St.add(ER);const AR=[".mp4",".m4v",".webm",".ogv"],CR=["video/mp4","video/webm","video/ogg"],IR={name:"loadVideo",extension:{type:gt.LoadParser,priority:Ts.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(i){return eo(i,CR)||Ue(i,AR)},async load(i,t,e){var a;let s;const r=await(await _t.ADAPTER.fetch(i)).blob(),n=URL.createObjectURL(r);try{const o={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(a=t==null?void 0:t.data)==null?void 0:a.resourceOptions,autoLoad:!0},h=new o1(n,o);await h.load();const l=new Lt(h,{alphaMode:await LI(),resolution:Ci(i),...t==null?void 0:t.data});l.resource.src=i,s=Il(l,e,i),s.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(n)})}catch(o){throw URL.revokeObjectURL(n),o}return s},unload(i){i.destroy(!0)}};St.add(IR);class PR{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){const{alias:e,name:s,src:r,srcs:n}=t;return hr(e||s||r||n,a=>typeof a=="string"?a:Array.isArray(a)?a.map(o=>(o==null?void 0:o.src)??(o==null?void 0:o.srcs)??o):a!=null&&a.src||a!=null&&a.srcs?a.src??a.srcs:a,!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const s=[];Array.isArray(e)?e.forEach(r=>{const n=r.src??r.srcs,a=r.alias??r.name;let o;if(typeof a=="string"){const h=this._createBundleAssetId(t,a);s.push(h),o=[a,h]}else{const h=a.map(l=>this._createBundleAssetId(t,l));s.push(...h),o=[...a,...h]}this.add({...r,alias:o,src:n})}):Object.keys(e).forEach(r=>{const n=[r,this._createBundleAssetId(t,r)];if(typeof e[r]=="string")this.add({alias:n,src:e[r]});else if(Array.isArray(e[r]))this.add({alias:n,src:e[r]});else{const a=e[r],o=a.src??a.srcs;this.add({...a,alias:n,src:Array.isArray(o)?o:[o]})}s.push(...n)}),this._bundles[t]=s}add(t,e,s,r,n){const a=[];typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"?(Ht("7.2.0",`Assets.add now uses an object instead of individual parameters. Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:t,src:e,data:s,format:r,loadParser:n})):Array.isArray(t)?a.push(...t):a.push(t);let o;o=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},hr(a).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const m=hr(l||c).map(y=>typeof y=="string"?tR(y):Array.isArray(y)?y:[y]),p=this.getAlias(h);Array.isArray(p)?p.forEach(o):o(p);const g=[];m.forEach(y=>{y.forEach(_=>{let v={};if(typeof _!="object"){v.src=_;for(let b=0;b{this._assetMap[y]=g})})}resolveBundle(t){const e=Qh(t);t=hr(t);const s={};return t.forEach(r=>{const n=this._bundles[r];if(n){const a=this.resolve(n),o={};for(const h in a){const l=a[h];o[this._extractAssetIdFromBundle(r,h)]=l}s[r]=o}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const r in e)s[r]=e[r].src;return s}return e.src}resolve(t){const e=Qh(t);t=hr(t);const s={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const a=n[0],o=this._getPreferredOrder(n);o==null||o.priority.forEach(h=>{o.params[h].forEach(l=>{const c=n.filter(u=>u[h]?u[h]===l:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]??a}else this._resolverHash[r]=this.buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;en.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:s,data:r,loadParser:n,format:a}=e;return(this._basePath||this._rootPath)&&(t.src=ye.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=a??t.format??ye.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}class MR{constructor(){this._detections=[],this._initialized=!1,this.resolver=new PR,this.loader=new sR,this.cache=Rn,this._backgroundLoader=new QM(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var n,a;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let o=t.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}const e=((n=t.texturePreference)==null?void 0:n.resolution)??1,s=typeof e=="number"?[e]:e,r=await this._detectFormats({preferredFormats:(a=t.texturePreference)==null?void 0:a.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:r,resolution:s}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,s,r,n){this.resolver.add(t,e,s,r,n)}async load(t,e){this._initialized||await this.init();const s=Qh(t),r=hr(t).map(o=>{if(typeof o!="string"){const h=this.resolver.getAlias(o);return h.some(l=>!this.resolver.hasKey(l))&&this.add(o),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(o)||this.add({alias:o,src:o}),o}),n=this.resolver.resolve(r),a=await this._mapLoadToResolve(n,e);return s?a[r[0]]:a}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);const r=this.resolver.resolveBundle(t),n={},a=Object.keys(r);let o=0,h=0;const l=()=>{e==null||e(++o/h)},c=a.map(u=>{const d=r[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{n[u]=f})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return Rn.get(t);const e={};for(let s=0;s{const l=n[o.src],c=[o.src];o.alias&&c.push(...o.alias),a[r[h]]=l,Rn.set(c,l)}),a}async unload(t){this._initialized||await this.init();const e=hr(t).map(r=>typeof r!="string"?r.src:r),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=hr(t);const e=this.resolver.resolveBundle(t),s=Object.keys(e).map(r=>this._unloadFromResolved(e[r]));await Promise.all(s)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(s=>{Rn.remove(s.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const s of t.detections)t.skipDetections||await s.test()?e=await s.add(e):t.skipDetections||(e=await s.remove(e));return e=e.filter((s,r)=>e.indexOf(s)===r),e}get detections(){return this._detections}get preferWorkers(){return qc.config.preferWorkers}set preferWorkers(t){Ht("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(s=>s in t).forEach(s=>{e.config[s]=t[s]})})}}const Cs=new MR;St.handleByList(gt.LoadParser,Cs.loader.parsers).handleByList(gt.ResolveParser,Cs.resolver.parsers).handleByList(gt.CacheParser,Cs.cache.parsers).handleByList(gt.DetectionParser,Cs.detections);const RR={extension:gt.CacheParser,test:i=>Array.isArray(i)&&i.every(t=>t instanceof Nt),getCacheableAssets:(i,t)=>{const e={};return i.forEach(s=>{t.forEach((r,n)=>{e[s+(n===0?"":n+1)]=r})}),e}};St.add(RR);async function p1(i){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=i});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(i)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const FR={extension:{type:gt.DetectionParser,priority:1},test:async()=>p1("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async i=>[...i,"avif"],remove:async i=>i.filter(t=>t!=="avif")};St.add(FR);const kR={extension:{type:gt.DetectionParser,priority:0},test:async()=>p1("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async i=>[...i,"webp"],remove:async i=>i.filter(t=>t!=="webp")};St.add(kR);const Fx=["png","jpg","jpeg"],LR={extension:{type:gt.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async i=>[...i,...Fx],remove:async i=>i.filter(t=>!Fx.includes(t))};St.add(LR);const BR="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Vp(i){return BR?!1:document.createElement("video").canPlayType(i)!==""}const OR={extension:{type:gt.DetectionParser,priority:0},test:async()=>Vp("video/webm"),add:async i=>[...i,"webm"],remove:async i=>i.filter(t=>t!=="webm")};St.add(OR);const DR={extension:{type:gt.DetectionParser,priority:0},test:async()=>Vp("video/mp4"),add:async i=>[...i,"mp4","m4v"],remove:async i=>i.filter(t=>t!=="mp4"&&t!=="m4v")};St.add(DR);const NR={extension:{type:gt.DetectionParser,priority:0},test:async()=>Vp("video/ogg"),add:async i=>[...i,"ogv"],remove:async i=>i.filter(t=>t!=="ogv")};St.add(NR);const UR={extension:gt.ResolveParser,test:qc.test,parse:i=>{var t;return{resolution:parseFloat(((t=_t.RETINA_PREFIX.exec(i))==null?void 0:t[1])??"1"),format:ye.extname(i).slice(1),src:i}}};St.add(UR);var Ze=(i=>(i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i))(Ze||{});const tc={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Ir,ma;function kx(){ma={bptc:Ir.getExtension("EXT_texture_compression_bptc"),astc:Ir.getExtension("WEBGL_compressed_texture_astc"),etc:Ir.getExtension("WEBGL_compressed_texture_etc"),s3tc:Ir.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Ir.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Ir.getExtension("WEBGL_compressed_texture_pvrtc")||Ir.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Ir.getExtension("WEBGL_compressed_texture_etc1"),atc:Ir.getExtension("WEBGL_compressed_texture_atc")}}const XR={extension:{type:gt.DetectionParser,priority:2},test:async()=>{const i=_t.ADAPTER.createCanvas().getContext("webgl");return i?(Ir=i,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async i=>{ma||kx();const t=[];for(const e in ma)ma[e]&&t.push(e);return[...t,...i]},remove:async i=>(ma||kx(),i.filter(t=>!(t in ma)))};St.add(XR);class VR extends Gc{constructor(t,e={width:1,height:1,autoLoad:!0}){let s,r;typeof t=="string"?(s=t,r=new Uint8Array):(s=null,r=t),super(r,e),this.origin=s,this.buffer=r?new xm(r):null,this._load=null,this.loaded=!1,this.origin!==null&&e.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new xm(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class Xn extends VR{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=Xn._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||Xn._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,s){const r=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;r.pixelStorei(r.UNPACK_ALIGNMENT,4);for(let n=0,a=this.levels;n=33776&&t<=33779)return"s3tc";if(t>=35916&&t<=35919)return"s3tc_sRGB";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t===36196)return"etc1";if(t===35986||t===35987||t===34798)return"atc";if(t>=36492&&t<=36495)return"bptc";if(t===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${t}`)}static _createLevelBuffers(t,e,s,r,n,a,o){const h=new Array(s);let l=t.byteOffset,c=a,u=o,d=c+r-1&~(r-1),f=u+n-1&~(n-1),m=d*f*tc[e];for(let p=0;p1?c:d,levelHeight:s>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,m)},l+=m,c=c>>1||1,u=u>>1||1,d=c+r-1&~(r-1),f=u+n-1&~(n-1),m=d*f*tc[e];return h}}const Cf=4,nh=124,YR=32,Lx=20,GR=542327876,ah={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},$R={FOURCC:2},oh={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},HR=1,WR=2,zR=4,jR=64,qR=512,KR=131072,ZR=827611204,JR=861165636,QR=894720068,t2=808540228,e2=4,s2={[ZR]:Ze.COMPRESSED_RGBA_S3TC_DXT1_EXT,[JR]:Ze.COMPRESSED_RGBA_S3TC_DXT3_EXT,[QR]:Ze.COMPRESSED_RGBA_S3TC_DXT5_EXT},r2={70:Ze.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Ze.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Ze.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Ze.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Ze.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Ze.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Ze.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Ze.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Ze.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Ze.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Ze.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Ze.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Ze.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function i2(i){const t=new Uint32Array(i);if(t[0]!==GR)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(i,0,nh/Uint32Array.BYTES_PER_ELEMENT),s=e[ah.HEIGHT],r=e[ah.WIDTH],n=e[ah.MIPMAP_COUNT],a=new Uint32Array(i,ah.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,YR/Uint32Array.BYTES_PER_ELEMENT),o=a[HR];if(o&zR){const h=a[$R.FOURCC];if(h!==t2){const _=s2[h],v=Cf+nh,b=new Uint8Array(i,v);return[new Xn(b,{format:_,width:r,height:s,levels:n})]}const l=Cf+nh,c=new Uint32Array(t.buffer,l,Lx/Uint32Array.BYTES_PER_ELEMENT),u=c[oh.DXGI_FORMAT],d=c[oh.RESOURCE_DIMENSION],f=c[oh.MISC_FLAG],m=c[oh.ARRAY_SIZE],p=r2[u];if(p===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===e2)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,y=Cf+nh+Lx;if(m===1)g.push(new Uint8Array(i,y));else{const _=tc[p];let v=0,b=r,T=s;for(let w=0;w>>1,T=T>>>1}let S=y;for(let w=0;wnew Xn(_,{format:p,width:r,height:s,levels:n}))}throw o&jR?new Error("DDSParser does not support uncompressed texture data."):o&qR?new Error("DDSParser does not supported YUV uncompressed texture data."):o&KR?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&WR?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Bx=[171,75,84,88,32,49,49,187,13,10,26,10],n2=67305985,ir={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Ym=64,Ox={[wt.UNSIGNED_BYTE]:1,[wt.UNSIGNED_SHORT]:2,[wt.INT]:4,[wt.UNSIGNED_INT]:4,[wt.FLOAT]:4,[wt.HALF_FLOAT]:8},a2={[ft.RGBA]:4,[ft.RGB]:3,[ft.RG]:2,[ft.RED]:1,[ft.LUMINANCE]:1,[ft.LUMINANCE_ALPHA]:2,[ft.ALPHA]:1},o2={[wt.UNSIGNED_SHORT_4_4_4_4]:2,[wt.UNSIGNED_SHORT_5_5_5_1]:2,[wt.UNSIGNED_SHORT_5_6_5]:2};function l2(i,t,e=!1){const s=new DataView(t);if(!h2(i,s))return null;const r=s.getUint32(ir.ENDIANNESS,!0)===n2,n=s.getUint32(ir.GL_TYPE,r),a=s.getUint32(ir.GL_FORMAT,r),o=s.getUint32(ir.GL_INTERNAL_FORMAT,r),h=s.getUint32(ir.PIXEL_WIDTH,r),l=s.getUint32(ir.PIXEL_HEIGHT,r)||1,c=s.getUint32(ir.PIXEL_DEPTH,r)||1,u=s.getUint32(ir.NUMBER_OF_ARRAY_ELEMENTS,r)||1,d=s.getUint32(ir.NUMBER_OF_FACES,r),f=s.getUint32(ir.NUMBER_OF_MIPMAP_LEVELS,r),m=s.getUint32(ir.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const p=4,g=4,y=h+3&-4,_=l+3&-4,v=new Array(u);let b=h*l;n===0&&(b=y*_);let T;if(n!==0?Ox[n]?T=Ox[n]*a2[a]:T=o2[n]:T=tc[o],T===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const S=e?u2(s,m,r):null;let w=b*T,E=h,A=l,P=y,I=_,C=Ym+m;for(let R=0;R1||n!==0?E:P,levelHeight:f>1||n!==0?A:I,levelBuffer:new Uint8Array(t,D,w)},D+=w}C+=F+4,C=C%4!==0?C+4-C%4:C,E=E>>1||1,A=A>>1||1,P=E+p-1&-4,I=A+g-1&-4,w=P*I*T}return n!==0?{uncompressed:v.map(R=>{let F=R[0].levelBuffer,D=!1;return n===wt.FLOAT?F=new Float32Array(R[0].levelBuffer.buffer,R[0].levelBuffer.byteOffset,R[0].levelBuffer.byteLength/4):n===wt.UNSIGNED_INT?(D=!0,F=new Uint32Array(R[0].levelBuffer.buffer,R[0].levelBuffer.byteOffset,R[0].levelBuffer.byteLength/4)):n===wt.INT&&(D=!0,F=new Int32Array(R[0].levelBuffer.buffer,R[0].levelBuffer.byteOffset,R[0].levelBuffer.byteLength/4)),{resource:new Gc(F,{width:R[0].levelWidth,height:R[0].levelHeight}),type:n,format:D?c2(a):a}}),kvData:S}:{compressed:v.map(R=>new Xn(null,{format:o,width:h,height:l,levels:f,levelBuffers:R})),kvData:S}}function h2(i,t){for(let e=0;et-r){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const a=new Lt(n,{mipmap:Ms.OFF,alphaMode:Ke.NO_PREMULTIPLIED_ALPHA,resolution:Ci(i),...t.data});return Il(a,e,i)});return r.length===1?r[0]:r},unload(i){Array.isArray(i)?i.forEach(t=>t.destroy(!0)):i.destroy(!0)}};St.add(d2);const f2={extension:{type:gt.LoadParser,priority:Ts.High},name:"loadKTX",test(i){return Ue(i,".ktx")},async load(i,t,e){const s=await(await _t.ADAPTER.fetch(i)).arrayBuffer(),{compressed:r,uncompressed:n,kvData:a}=l2(i,s),o=r??n,h={mipmap:Ms.OFF,alphaMode:Ke.NO_PREMULTIPLIED_ALPHA,resolution:Ci(i),...t.data},l=o.map(c=>{o===n&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new Lt(u,h);return d.ktxKeyValueData=a,Il(d,e,i)});return l.length===1?l[0]:l},unload(i){Array.isArray(i)?i.forEach(t=>t.destroy(!0)):i.destroy(!0)}};St.add(f2);const m2=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],p2={extension:gt.ResolveParser,test:i=>{const t=ye.extname(i).slice(1);return["basis","ktx","dds"].includes(t)},parse:i=>{var s,r;const t=i.split("."),e=t.pop();if(["ktx","dds"].includes(e)){const n=t.pop();if(m2.includes(n))return{resolution:parseFloat(((s=_t.RETINA_PREFIX.exec(i))==null?void 0:s[1])??"1"),format:n,src:i}}return{resolution:parseFloat(((r=_t.RETINA_PREFIX.exec(i))==null?void 0:r[1])??"1"),format:e,src:i}}};St.add(p2);const lh=new Ut,g2=4,g1=class Eo{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,s,r){const n=new Image;return n.src=await this.base64(t,e,s,r),n}async base64(t,e,s,r){const n=this.canvas(t,r);if(n.toBlob!==void 0)return new Promise((a,o)=>{n.toBlob(h=>{if(!h){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>a(l.result),l.onerror=o,l.readAsDataURL(h)},e,s)});if(n.toDataURL!==void 0)return n.toDataURL(e,s);if(n.convertToBlob!==void 0){const a=await n.convertToBlob({type:e,quality:s});return new Promise((o,h)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=h,l.readAsDataURL(a)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:s,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);a&&Eo._flipY(s,r,n),o&&Eo._unpremultiplyAlpha(s);const h=new KI(r,n,1),l=new ImageData(new Uint8ClampedArray(s.buffer),r,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:s,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);return a&&Eo._flipY(s,r,n),o&&Eo._unpremultiplyAlpha(s),s}_rawPixels(t,e){const s=this.renderer;if(!s)throw new Error("The Extract has already been destroyed");let r,n=!1,a=!1,o,h=!1;t&&(t instanceof Zn?o=t:(o=s.generateTexture(t,{region:e,resolution:s.resolution,multisample:s.multisample}),h=!0,e&&(lh.width=e.width,lh.height=e.height,e=lh)));const l=s.gl;if(o){if(r=o.baseTexture.resolution,e=e??o.frame,n=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===ft.RGBA,!h){s.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[s.CONTEXT_UID];f.blitFramebuffer&&s.framebuffer.bind(f.blitFramebuffer)}}else r=s.resolution,e||(e=lh,e.width=s.width/r,e.height=s.height/r),n=!0,a=this._rendererPremultipliedAlpha,s.renderTexture.bind();const c=Math.max(Math.round(e.width*r),1),u=Math.max(Math.round(e.height*r),1),d=new Uint8Array(g2*c*u);return l.readPixels(Math.round(e.x*r),Math.round(e.y*r),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(o==null||o.destroy(!0)),{pixels:d,width:c,height:u,flipY:n,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,s){const r=e<<2,n=s>>1,a=new Uint8Array(r);for(let o=0;o=0&&o>=0&&r>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(a+o)),l=h*8+(r?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+r,t[1]=t[3]=s+n,t[2]=t[4]=e-r,t[5]=t[7]=s-n;return}let c=0,u=h*4+(r?2:0)+2,d=u,f=l;{const m=r+a,p=n,g=e+m,y=e-m,_=s+p;if(t[c++]=g,t[c++]=_,t[--u]=_,t[--u]=y,n){const v=s-p;t[d++]=y,t[d++]=v,t[--f]=v,t[--f]=g}}for(let m=1;m0||t&&s<=0){const r=e/2;for(let n=r+r%2;n=6){Dx(e,!1);const a=[];for(let l=0;l=0&&n>=0&&a.push(e,s,e+r,s,e+r,s+n,e,s+n)},triangulate(i,t){const e=i.points,s=t.points;if(e.length===0)return;const r=s.length/2;s.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},b2={build(i){ec.build(i)},triangulate(i,t){ec.triangulate(i,t)}};var Hs=(i=>(i.MITER="miter",i.BEVEL="bevel",i.ROUND="round",i))(Hs||{}),Ji=(i=>(i.BUTT="butt",i.ROUND="round",i.SQUARE="square",i))(Ji||{});const Ga={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(i,t=20){if(!this.adaptive||!i||isNaN(i))return t;let e=Math.ceil(i/this.maxLength);return ethis.maxSegments&&(e=this.maxSegments),e}};class Nx{static curveTo(t,e,s,r,n,a){const o=a[a.length-2],h=a[a.length-1]-e,l=o-t,c=r-e,u=s-t,d=Math.abs(h*u-l*c);if(d<1e-8||n===0)return(a[a.length-2]!==t||a[a.length-1]!==e)&&a.push(t,e),null;const f=h*h+l*l,m=c*c+u*u,p=h*c+l*u,g=n*Math.sqrt(f)/d,y=n*Math.sqrt(m)/d,_=g*p/f,v=y*p/m,b=g*u+y*l,T=g*c+y*h,S=l*(y+_),w=h*(y+_),E=u*(g+v),A=c*(g+v),P=Math.atan2(w-T,S-b),I=Math.atan2(A-T,E-b);return{cx:b+t,cy:T+e,radius:n,startAngle:P,endAngle:I,anticlockwise:l*c>u*h}}static arc(t,e,s,r,n,a,o,h,l){const c=o-a,u=Ga._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/zh)*40),d=c/(u*2),f=d*2,m=Math.cos(d),p=Math.sin(d),g=u-1,y=g%1/g;for(let _=0;_<=g;++_){const v=_+y*_,b=d+a+f*v,T=Math.cos(b),S=-Math.sin(b);l.push((m*T+p*S)*n+s,(m*-S+p*T)*n+r)}}}class v2{constructor(){this.reset()}begin(t,e,s){this.reset(),this.style=t,this.start=e,this.attribStart=s}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Yp{static curveLength(t,e,s,r,n,a,o,h){let l=0,c=0,u=0,d=0,f=0,m=0,p=0,g=0,y=0,_=0,v=0,b=t,T=e;for(let S=1;S<=10;++S)c=S/10,u=c*c,d=u*c,f=1-c,m=f*f,p=m*f,g=p*t+3*m*c*s+3*f*u*n+d*o,y=p*e+3*m*c*r+3*f*u*a+d*h,_=b-g,v=T-y,b=g,T=y,l+=Math.sqrt(_*_+v*v);return l}static curveTo(t,e,s,r,n,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const c=Ga._segmentsCount(Yp.curveLength(h,l,t,e,s,r,n,a));let u=0,d=0,f=0,m=0,p=0;o.push(h,l);for(let g=1,y=0;g<=c;++g)y=g/c,u=1-y,d=u*u,f=d*u,m=y*y,p=m*y,o.push(f*h+3*d*y*t+3*u*m*s+p*n,f*l+3*d*y*e+3*u*m*r+p*a)}}function Ux(i,t,e,s,r,n,a,o){const h=i-e*r,l=t-s*r,c=i+e*n,u=t+s*n;let d,f;a?(d=s,f=-e):(d=-s,f=e);const m=h+d,p=l+f,g=c+d,y=u+f;return o.push(m,p,g,y),2}function _n(i,t,e,s,r,n,a,o){const h=e-i,l=s-t;let c=Math.atan2(h,l),u=Math.atan2(r-i,n-t);o&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,m=Math.abs(f),p=Math.sqrt(h*h+l*l),g=(15*m*Math.sqrt(p)/Math.PI>>0)+1,y=f/g;if(d+=y,o){a.push(i,t,e,s);for(let _=1,v=d;_=0&&(n.join===Hs.ROUND?d+=_n(v,b,v-w*R,b-E*R,v-A*R,b-P*R,c,!1)+4:d+=2,c.push(v-A*F,b-P*F,v+A*R,b+P*R));continue}const H=(-w+y)*(-E+b)-(-w+v)*(-E+_),at=(-A+T)*(-P+b)-(-A+v)*(-P+S),et=(k*at-B*H)/V,ot=(L*H-N*at)/V,ct=(et-v)*(et-v)+(ot-b)*(ot-b),rt=v+(et-v)*R,dt=b+(ot-b)*R,X=v-(et-v)*F,$=b-(ot-b)*F,K=Math.min(k*k+N*N,B*B+L*L),J=q?R:F,Q=K+J*J*p,it=ct<=Q;let U=n.join;if(U===Hs.MITER&&ct/p>g&&(U=Hs.BEVEL),it)switch(U){case Hs.MITER:{c.push(rt,dt,X,$);break}case Hs.BEVEL:{q?c.push(rt,dt,v+w*F,b+E*F,rt,dt,v+A*F,b+P*F):c.push(v-w*R,b-E*R,X,$,v-A*R,b-P*R,X,$),d+=2;break}case Hs.ROUND:{q?(c.push(rt,dt,v+w*F,b+E*F),d+=_n(v,b,v+w*F,b+E*F,v+A*F,b+P*F,c,!0)+4,c.push(rt,dt,v+A*F,b+P*F)):(c.push(v-w*R,b-E*R,X,$),d+=_n(v,b,v-w*R,b-E*R,v-A*R,b-P*R,c,!1)+4,c.push(v-A*R,b-P*R,X,$));break}}else{switch(c.push(v-w*R,b-E*R,v+w*F,b+E*F),U){case Hs.MITER:{q?c.push(X,$,X,$):c.push(rt,dt,rt,dt),d+=2;break}case Hs.ROUND:{q?d+=_n(v,b,v+w*F,b+E*F,v+A*F,b+P*F,c,!0)+2:d+=_n(v,b,v-w*R,b-E*R,v-A*R,b-P*R,c,!1)+2;break}}c.push(v-A*R,b-P*R,v+A*F,b+P*F),d+=2}}y=s[(u-2)*2],_=s[(u-2)*2+1],v=s[(u-1)*2],b=s[(u-1)*2+1],w=-(_-b),E=y-v,I=Math.sqrt(w*w+E*E),w/=I,E/=I,w*=m,E*=m,c.push(v-w*R,b-E*R,v+w*F,b+E*F),h||(n.cap===Ji.ROUND?d+=_n(v-w*(R-F)*.5,b-E*(R-F)*.5,v-w*R,b-E*R,v+w*F,b+E*F,c,!1)+2:n.cap===Ji.SQUARE&&(d+=Ux(v,b,w,E,R,F,!1,c)));const D=t.indices,M=Ga.epsilon*Ga.epsilon;for(let O=f;O0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,s=null,r=null){const n=new sc(t,e,s,r);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const s=new sc(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=r.lineStyle,r.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let t=0;t0&&(s=this.batches[this.batches.length-1],r=s.style);for(let h=this.shapeIndex;h65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t65535*2)return!1;const t=this.batches;for(let e=0;e0&&(r=hh.pop(),r||(r=new _m,r.texArray=new Em),this.drawCalls.push(r)),r.start=c,r.size=0,r.texArray.count=0,r.type=l),p.touched=1,p._batchEnabled=t,p._batchLocation=n,p.wrapMode=Ps.REPEAT,r.texArray.elements[r.texArray.count++]=p,n++)),r.size+=d.size,c+=d.size,o=p._batchLocation,this.addColors(e,m.color,m.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,o,d.attribSize,d.attribStart)}Lt._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,s=this.colors,r=this.textureIds,n=new ArrayBuffer(t.length*3*4),a=new Float32Array(n),o=new Uint32Array(n);let h=0;for(let l=0;l0&&t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:s},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Un,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Un,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const s=this.currentPath.points,r=s[s.length-2],n=s[s.length-1];return(r!==t||n!==e)&&s.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,s,r){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),Gp.curveTo(t,e,s,r,n),this}bezierCurveTo(t,e,s,r,n,a){return this._initCurve(),Yp.curveTo(t,e,s,r,n,a,this.currentPath.points),this}arcTo(t,e,s,r,n){this._initCurve(t,e);const a=this.currentPath.points,o=Nx.curveTo(t,e,s,r,n,a);if(o){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=o;this.arc(h,l,c,u,d,f)}return this}arc(t,e,s,r,n,a=!1){if(r===n)return this;if(!a&&n<=r?n+=zh:a&&r<=n&&(r+=zh),n-r===0)return this;const o=t+Math.cos(r)*s,h=e+Math.sin(r)*s,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-o),d=Math.abs(c[c.length-1]-h);u0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:s},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,s,r){return this.drawShape(new Ut(t,e,s,r))}drawRoundedRect(t,e,s,r,n){return this.drawShape(new Wc(t,e,s,r,n))}drawCircle(t,e,s){return this.drawShape(new $c(t,e,s))}drawEllipse(t,e,s,r){return this.drawShape(new Hc(t,e,s,r))}drawPolygon(...t){let e,s=!0;const r=t[0];r.points?(s=r.closeStroke,e=r.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new Un(e);return n.closeStroke=s,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===ts.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,s=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(t.points);for(let r=0;rs&&!t.autoResize&&(a=s);let o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=w_(t.blendMode,l),n.state.set(this.state);const c=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Wt.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,m=0;fr&&(p=r),m>=o.length&&o.push(this._generateOneMoreBuffer(t));const g=o[m];g.uploadDynamic(e,f,p);const y=t._bufferUpdateIDs[m]||0;d=d||g._updateID0);r[a]=l,r[a+n]=l,r[a+n*2]=l,r[a+n*3]=l,a+=n*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}w1.extension={name:"particle",type:gt.RendererPlugin};St.add(w1);var Jc=(i=>(i[i.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",i[i.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",i))(Jc||{});const ch={willReadFrequently:!0},Pr=class Ct{static get experimentalLetterSpacingSupported(){let t=Ct._experimentalLetterSpacingSupported;if(t!==void 0){const e=_t.ADAPTER.getCanvasRenderingContext2D().prototype;t=Ct._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,s,r,n,a,o,h,l){this.text=t,this.style=e,this.width=s,this.height=r,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=l}static measureText(t,e,s,r=Ct._canvas){s=s??e.wordWrap;const n=e.toFontString(),a=Ct.measureFont(n);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);const o=r.getContext("2d",ch);o.font=n;const h=(s?Ct.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let m=0;m0&&(r?n-=e:n+=(Ct.graphemeSegmenter(t).length-1)*e),n}static wordWrap(t,e,s=Ct._canvas){const r=s.getContext("2d",ch);let n=0,a="",o="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,u=Ct.collapseSpaces(c),d=Ct.collapseNewlines(c);let f=!u;const m=e.wordWrapWidth+l,p=Ct.tokenize(t);for(let g=0;gm)if(a!==""&&(o+=Ct.addLine(a),a="",n=0),Ct.canBreakWords(y,e.breakWords)){const v=Ct.wordWrapSplit(y);for(let b=0;bm&&(o+=Ct.addLine(a),f=!1,a="",n=0),a+=T,n+=E}}else{a.length>0&&(o+=Ct.addLine(a),a="",n=0);const v=g===p.length-1;o+=Ct.addLine(y,!v),f=!1,a="",n=0}else _+n>m&&(f=!1,o+=Ct.addLine(a),a="",n=0),(a.length>0||!Ct.isBreakingSpace(y)||f)&&(a+=y,n+=_)}return o+=Ct.addLine(a,!1),o}static addLine(t,e=!0){return t=Ct.trimRight(t),t=e?`${t} `:t,t}static getFromCache(t,e,s,r){let n=s[t];return typeof n!="number"&&(n=Ct._measureText(t,e,r)+e,s[t]=n),n}static collapseSpaces(t){return t==="normal"||t==="pre-line"}static collapseNewlines(t){return t==="normal"}static trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const s=t[e];if(!Ct.isBreakingSpace(s))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:Ct._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:Ct._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let s="";if(typeof t!="string")return e;for(let r=0;ro;--d){for(let p=0;p{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const i=new Intl.Segmenter;return t=>[...i.segment(t)].map(e=>e.segment)}return i=>[...i]})(),Pr.experimentalLetterSpacing=!1,Pr._fonts={},Pr._newlines=[10,13],Pr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Hi=Pr;const P2=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],T1=class Ao{constructor(t){this.styleID=0,this.reset(),Ff(this,t,t)}clone(){const t={};return Ff(t,this,Ao.defaultStyle),new Ao(t)}reset(){Ff(this,Ao.defaultStyle,Ao.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Rf(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Rf(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){M2(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Rf(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let s=e.length-1;s>=0;s--){let r=e[s].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!P2.includes(r)&&(r=`"${r}"`),e[s]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};T1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Jc.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let rn=T1;function Rf(i){const t=Wt.shared,e=s=>{const r=t.setValue(s);return r.alpha===1?r.toHex():r.toRgbaString()};return Array.isArray(i)?i.map(e):e(i)}function M2(i,t){if(!Array.isArray(i)||!Array.isArray(t)||i.length!==t.length)return!1;for(let e=0;e0&&m>p&&(g=(p+m)/2);const y=p+d,_=s.lineHeight*(f+1);let v=y;f+10}}function k2(i,t){var s;let e=!1;if((s=i==null?void 0:i._textures)!=null&&s.length){for(let r=0;r{this.queue&&this.prepareItems()},this.registerFindHook(N2),this.registerFindHook(U2),this.registerFindHook(k2),this.registerFindHook(L2),this.registerFindHook(B2),this.registerUploadHook(O2),this.registerUploadHook(D2)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,ss.system.addOnce(this.tick,this,Wn.UTILITY))):e()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed){for(let s=0,r=this.uploadHooks.length;s=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&ss.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};E1.uploadsPerFrame=4;let Hm=E1;Object.defineProperties(_t,{UPLOADS_PER_FRAME:{get(){return Hm.uploadsPerFrame},set(i){Ht("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Hm.uploadsPerFrame=i}}});function C1(i,t){return t instanceof Lt?(t._glTextures[i.CONTEXT_UID]||i.texture.bind(t),!0):!1}function X2(i,t){if(!(t instanceof gs))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:s}=e;for(let r=0;r1?Js.from(G2,Y2,e):Js.from($x,$2,e)}render(t){const e=this.renderer,s=this.quad;let r=s.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;r=s.uvs,r[0]=r[6]=-n,r[1]=r[3]=-a,r[2]=r[4]=1-n,r[5]=r[7]=1-a,s.invalidate();const o=t._texture,h=o.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,u=t.uvMatrix;let d=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==Ps.CLAMP:h.wrapMode===Ps.CLAMP&&(h.wrapMode=Ps.REPEAT));const f=d?this.simpleShader:this.shader,m=o.width,p=o.height,g=t._width,y=t._height;uh.set(c.a*m/g,c.b*m/y,c.c*p/g,c.d*p/y,c.tx/g,c.ty/y),uh.invert(),d?uh.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=uh.toArray(!0),f.uniforms.uColor=Wt.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=o,e.shader.bind(f),e.geometry.bind(s),this.state.blendMode=w_(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}P1.extension={name:"tilingSprite",type:gt.RendererPlugin};St.add(P1);const M1=class Co{constructor(t,e,s){this.linkedSheets=[],(t instanceof Lt||t instanceof Nt)&&(t={texture:t,data:e,resolutionFilename:s});const{texture:r,data:n,resolutionFilename:a=null,cachePrefix:o=""}=t;this.cachePrefix=o,this._texture=r instanceof Nt?r:null,this.baseTexture=r instanceof Lt?r:this._texture.baseTexture,this.textures={},this.animations={},this.data=n;const h=this.baseTexture.resource;this.resolution=this._updateResolution(a||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let s=Ci(t,null);return s===null&&(s=typeof e=="number"?e:parseFloat(e??"1")),s!==1&&this.baseTexture.setResolution(s),s}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Co.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=Co.BATCH_SIZE;for(;e-t{this._batchIndex*Co.BATCH_SIZE{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[`${t.cachePrefix}${r}`]=t.textures[r]}),!e){const r=ye.dirname(i[0]);t.linkedSheets.forEach((n,a)=>{Object.assign(s,R1([`${r}/${t.data.meta.related_multi_packs[a]}`],n,!0))})}return s}const z2={extension:gt.Asset,cache:{test:i=>i instanceof Hx,getCacheableAssets:(i,t)=>R1(i,t,!1)},resolver:{test:i=>{const t=i.split("?")[0].split("."),e=t.pop(),s=t.pop();return e==="json"&&W2.includes(s)},parse:i=>{var e;const t=i.split(".");return{resolution:parseFloat(((e=_t.RETINA_PREFIX.exec(i))==null?void 0:e[1])??"1"),format:t[t.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:gt.LoadParser,priority:Ts.Normal},async testParse(i,t){return ye.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){var c,u;const{texture:s,imageFilename:r,cachePrefix:n}=(t==null?void 0:t.data)??{};let a=ye.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let o;if(s&&s.baseTexture)o=s;else{const d=sl(a+(r??i.meta.image),t.src);o=(await e.load([d]))[d]}const h=new Hx({texture:o.baseTexture,data:i,resolutionFilename:t.src,cachePrefix:n});await h.parse();const l=(c=i==null?void 0:i.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(l)){const d=[];for(const m of l){if(typeof m!="string")continue;let p=a+m;(u=t.data)!=null&&u.ignoreMultiPack||(p=sl(p,t.src),d.push(e.load({src:p,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);h.linkedSheets=f,f.forEach(m=>{m.linkedSheets=[h].concat(h.linkedSheets.filter(p=>p!==m))})}return h},unload(i){i.destroy(!0)}}};St.add(z2);class rc{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Ch{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const n in e){const a=e[n].match(/^[a-z]+/gm)[0],o=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in o){const c=o[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;h[u]=m}s[a].push(h)}const r=new rc;return s.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),s.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),s.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),s.char.forEach(n=>r.char.push({id:parseInt(n.id,10),page:parseInt(n.page,10),x:parseInt(n.x,10),y:parseInt(n.y,10),width:parseInt(n.width,10),height:parseInt(n.height,10),xoffset:parseInt(n.xoffset,10),yoffset:parseInt(n.yoffset,10),xadvance:parseInt(n.xadvance,10)})),s.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),s.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class Wm{static test(t){const e=t;return typeof t!="string"&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const e=new rc,s=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l")?Wm.test(_t.ADAPTER.parseXML(t)):!1}static parse(t){return Wm.parse(_t.ADAPTER.parseXML(t))}}const kf=[Ch,Wm,zm];function j2(i){for(let t=0;t=h-P*a){if(p===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${w}')`);--S,g=null,y=null,_=null,p=0,m=0,v=0;continue}if(v=Math.max(P+E.fontProperties.descent,v),I*a+m>=d){if(m===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${w}')`);--S,p+=v*a,p=Math.ceil(p),m=0,v=0;continue}K2(g,y,E,m,p,a,u);const C=Ih(E.text);f.char.push({id:C,page:b.length-1,x:m/a,y:p/a,width:I,height:P,xoffset:0,yoffset:0,xadvance:A-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),m+=(I+2*n)*a,m=Math.ceil(m)}if(!(s!=null&&s.skipKerning))for(let S=0,w=c.length;S 0.99) {\r alpha = 1.0;\r }\r \r // Gamma correction for coverage-like alpha\r float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r float gamma = mix(1.0, 1.0 / 2.2, luma);\r float coverage = pow(uColor.a * alpha, gamma); \r \r // NPM Textures, NPM outputs\r gl_FragColor = vec4(uColor.rgb, coverage);\r }\r `,Q2=`// Mesh material default fragment\r attribute vec2 aVertexPosition;\r attribute vec2 aTextureCoord;\r \r uniform mat3 projectionMatrix;\r uniform mat3 translationMatrix;\r uniform mat3 uTextureMatrix;\r \r varying vec2 vTextureCoord;\r \r void main(void)\r {\r gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r \r vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r }\r `;const Wx=[],zx=[],jx=[],tF=class k1 extends fs{constructor(t,e={}){super();const{align:s,tint:r,maxWidth:n,letterSpacing:a,fontName:o,fontSize:h}=Object.assign({},k1.styleDefaults,e);if(!Yi.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new Wt(r),this._font=void 0,this._fontName=o,this._fontSize=h,this.text=t,this._maxWidth=n,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new gi(()=>{this.dirty=!0},this,0,0),this._roundPixels=_t.ROUND_PIXELS,this.dirty=!0,this._resolution=_t.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const t=Yi.available[this._fontName],e=this.fontSize,s=e/t.size,r=new Kt,n=[],a=[],o=[],h=this._text.replace(/(?:\r\n|\r)/g,` `)||" ",l=F1(h),c=this._maxWidth*t.size/e,u=t.distanceFieldType==="none"?Wx:zx;let d=null,f=0,m=0,p=0,g=-1,y=0,_=0,v=0,b=0;for(let C=0;C0&&r.x>c&&(++_,Ma(n,1+g-_,1+C-g),C=g,g=-1,a.push(y),o.push(n.length>0?n[n.length-1].prevSpaces:0),m=Math.max(m,y),p++,r.x=0,r.y+=t.lineHeight,d=null,b=0)}const T=l[l.length-1];T!=="\r"&&T!==` `&&(/(?:\s)/.test(T)&&(f=y),a.push(f),m=Math.max(m,f),o.push(-1));const S=[];for(let C=0;C<=p;C++){let R=0;this._align==="right"?R=m-a[C]:this._align==="center"?R=(m-a[C])/2:this._align==="justify"&&(R=o[C]<0?0:(m-a[C])/o[C]),S.push(R)}const w=n.length,E={},A=[],P=this._activePagesMeshData;u.push(...P);for(let C=0;C6*F)||R.vertices.lengthe[r.mesh.texture.baseTexture.uid]).forEach(r=>{r.mesh.texture=Nt.EMPTY});for(const r in e)e[r].destroy(),delete e[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};tF.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const eF=[".xml",".fnt"],sF={extension:{type:gt.LoadParser,priority:Ts.Normal},name:"loadBitmapFont",test(i){return eF.includes(ye.extname(i).toLowerCase())},async testParse(i){return Ch.test(i)||zm.test(i)},async parse(i,t,e){const s=Ch.test(i)?Ch.parse(i):zm.parse(i),{src:r}=t,{page:n}=s,a=[];for(let l=0;lo[l]);return Yi.install(s,h,!0)},async load(i,t){return(await _t.ADAPTER.fetch(i)).text()},unload(i){i.destroy()}};St.add(sF);const jm=class pa extends rn{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new pa(Object.keys(pa.defaultOptions).reduce((e,s)=>({...e,[s]:t[s]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(t=>{URL.revokeObjectURL(t.src),t.refs--,t.refs===0&&(t.fontFace&&document.fonts.delete(t.fontFace),delete pa.availableFonts[t.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:s}=pa;if(s[t]){const r=s[t];return this._fonts.push(r),r.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return _t.ADAPTER.fetch(t).then(r=>r.blob()).then(async r=>new Promise((n,a)=>{const o=URL.createObjectURL(r),h=new FileReader;h.onload=()=>n([o,h.result]),h.onerror=a,h.readAsDataURL(r)})).then(async([r,n])=>{const a=Object.assign({family:ye.basename(t,ye.extname(t)),weight:"normal",style:"normal",display:"auto",src:r,dataSrc:n,refs:1,originalUrl:t,fontFace:null},e);s[t]=a,this._fonts.push(a),this.styleID++;const o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...t){const e=t.filter(s=>!this._overrides.includes(s));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(s=>this._overrides.includes(s));e.length>0&&(this._overrides=this._overrides.filter(s=>!e.includes(s)),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((t,e)=>`${t} @font-face { font-family: "${e.family}"; src: url('${e.dataSrc}'); font-weight: ${e.weight}; font-style: ${e.style}; font-display: ${e.display}; }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=WI(t)),typeof t=="number"?HI(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,s=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),r=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${s}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,pa.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=_t.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};jm.availableFonts={},jm.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Lf=jm;const dh=class ga extends to{constructor(t="",e={}){super(Nt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,r=Nt.from(s,{scaleMode:_t.SCALE_MODE,resourceOptions:{autoLoad:!1}});r.orig=new Ut,r.trim=new Ut,this.texture=r;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",o.appendChild(h),this.maxWidth=ga.defaultMaxWidth,this.maxHeight=ga.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=o,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=s,this._loadImage=new Image,this._autoResolution=ga.defaultAutoResolution,this._resolution=ga.defaultResolution??_t.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:s,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:s.toCSS(r)}),this._styleElement.textContent=s.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:a,height:o}=n;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(a)),l=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),s!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(r)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+s.padding*2,height:l+s.padding*2}}async updateText(t=!0){const{style:e,_image:s,_loadImage:r}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:a}=this.measureText();s.width=r.width=Math.ceil(Math.max(1,n)),s.height=r.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(h=>{r.onload=async()=>{if(o/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};dh.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},dh.defaultMaxWidth=2024,dh.defaultMaxHeight=2024,dh.defaultAutoResolution=!0;let L1=class{constructor(){x(this,"entries",{});x(this,"size",0)}add(t){let e=this.entries[t];return this.entries[t]=!0,e?!1:(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,r=t.length;s1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}toRgb888(){const t=e=>("0"+(e*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new as){return e.setFromString(t)}},x(as,"WHITE",new as(1,1,1,1)),x(as,"RED",new as(1,0,0,1)),x(as,"GREEN",new as(0,1,0,1)),x(as,"BLUE",new as(0,0,1,1)),x(as,"MAGENTA",new as(1,0,1,1)),as);var Re;let yt=(Re=class{static clamp(t,e,s){return ts?s:t}static cosDeg(t){return Math.cos(t*Re.degRad)}static sinDeg(t){return Math.sin(t*Re.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*Re.degRad}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),.3333333333333333);return t<0?-e:e}static randomTriangular(t,e){return Re.randomTriangularWith(t,e,(t+e)*.5)}static randomTriangularWith(t,e,s){let r=Math.random(),n=e-t;return r<=(s-t)/n?t+Math.sqrt(r*n*(s-t)):e-Math.sqrt((1-r)*n*(e-s))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},x(Re,"PI",3.1415927),x(Re,"PI2",Re.PI*2),x(Re,"invPI2",1/Re.PI2),x(Re,"radiansToDegrees",180/Re.PI),x(Re,"radDeg",Re.radiansToDegrees),x(Re,"degreesToRadians",Re.PI/180),x(Re,"degRad",Re.degreesToRadians),Re);var cr;let xt=(cr=class{static arrayCopy(t,e,s,r,n){for(let a=e,o=r;a=e?t:cr.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let r=0;r0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e>1)*o;let h=e.bone.skeleton,l=e.deform,c=this.vertices,u=this.bones;if(!u){l.length>0&&(c=l);let p=e.bone,g=p.worldX,y=p.worldY,_=p.a,v=p.b,b=p.c,T=p.d;for(let S=s,w=a;w=this.regions.length&&(s=this.regions.length-1);let r=this.regions[s];e.region!=r&&(e.region=r,e.updateRegion())}getPath(t,e){let s=t,r=(this.start+e).toString();for(let n=this.digits-r.length;n>0;n--)s+="0";return s+=r,s}static nextID(){return xi._nextID++}},x(xi,"_nextID",0),xi);var Qe;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Qe||(Qe={}));const D1=[Qe.hold,Qe.once,Qe.loop,Qe.pingpong,Qe.onceReverse,Qe.loopReverse,Qe.pingpongReverse];let Wp=class{constructor(t,e,s){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds",new L1);x(this,"duration");if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=s}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));let l=this.timelines;for(let c=0,u=l.length;ce)return r-1;return s-1}static search(t,e,s){let r=t.length;for(let n=s;ne)return n-s;return r-s}},qr=class extends we{constructor(e,s,r){super(e,r);x(this,"curves");this.curves=xt.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let s=this.getFrameCount()+e*18;if(this.curves.length>s){let r=xt.newFloatArray(s);xt.arrayCopy(this.curves,0,r,0,s),this.curves=r}}setBezier(e,s,r,n,a,o,h,l,c,u,d){let f=this.curves,m=this.getFrameCount()+e*18;r==0&&(f[s]=2+m);let p=(n-o*2+l)*.03,g=(a-h*2+c)*.03,y=((o-l)*3-n+u)*.006,_=((h-c)*3-a+d)*.006,v=p*2+y,b=g*2+_,T=(o-n)*.3+p+y*.16666667,S=(h-a)*.3+g+_*.16666667,w=n+T,E=a+S;for(let A=m+18;me){let c=this.frames[s],u=this.frames[s+r];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}let o=n+18;for(n+=2;n=e){let c=a[n-2],u=a[n-1];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}s+=this.getFrameEntries();let h=a[o-2],l=a[o-1];return l+(e-h)/(this.frames[s]-h)*(this.frames[s+r]-l)}},wr=class extends qr{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let n=2;n<=s;n+=2)if(e[n]>t){s=n-2;break}let r=this.curves[s>>1];switch(r){case 0:let n=e[s],a=e[s+1];return a+(t-n)/(e[s+2]-n)*(e[s+2+1]-a);case 1:return e[s+1]}return this.getBezierValue(t,s,1,r-2)}getRelativeValue(t,e,s,r,n){if(t>2];switch(g){case 0:let y=c[p];d=c[p+1],f=c[p+2],m=c[p+3];let _=(r-y)/(c[p+4]-y);d+=(c[p+4+1]-d)*_,f+=(c[p+4+2]-f)*_,m+=(c[p+4+3]-m)*_;break;case 1:d=c[p+1],f=c[p+2],m=c[p+3];break;default:d=this.getBezierValue(r,p,1,g-2),f=this.getBezierValue(r,p,2,g+18-2),m=this.getBezierValue(r,p,3,g+36-2)}if(a==1)u.r=d,u.g=f,u.b=m;else{if(o==ht.setup){let y=l.data.color;u.r=y.r,u.g=y.g,u.b=y.b}u.r+=(d-u.r)*a,u.g+=(f-u.g)*a,u.b+=(m-u.b)*a}}},K1=class extends wr{constructor(e,s,r){super(e,s,Vt.alpha+"|"+r);x(this,"slotIndex",0);this.slotIndex=r}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=l.color;if(r>3];switch(T){case 0:let S=c[b];f=c[b+1],m=c[b+2],p=c[b+3],g=c[b+4],y=c[b+5],_=c[b+6],v=c[b+7];let w=(r-S)/(c[b+8]-S);f+=(c[b+8+1]-f)*w,m+=(c[b+8+2]-m)*w,p+=(c[b+8+3]-p)*w,g+=(c[b+8+4]-g)*w,y+=(c[b+8+5]-y)*w,_+=(c[b+8+6]-_)*w,v+=(c[b+8+7]-v)*w;break;case 1:f=c[b+1],m=c[b+2],p=c[b+3],g=c[b+4],y=c[b+5],_=c[b+6],v=c[b+7];break;default:f=this.getBezierValue(r,b,1,T-2),m=this.getBezierValue(r,b,2,T+18-2),p=this.getBezierValue(r,b,3,T+36-2),g=this.getBezierValue(r,b,4,T+54-2),y=this.getBezierValue(r,b,5,T+72-2),_=this.getBezierValue(r,b,6,T+90-2),v=this.getBezierValue(r,b,7,T+108-2)}if(a==1)u.set(f,m,p,g),d.r=y,d.g=_,d.b=v;else{if(o==ht.setup){u.setFromColor(l.data.color);let S=l.data.darkColor;d.r=S.r,d.g=S.g,d.b=S.b}u.add((f-u.r)*a,(m-u.g)*a,(p-u.b)*a,(g-u.a)*a),d.r+=(y-d.r)*a,d.g+=(_-d.g)*a,d.b+=(v-d.b)*a}}},J1=class extends qr{constructor(e,s,r){super(e,s,[Vt.rgb+"|"+r,Vt.rgb2+"|"+r]);x(this,"slotIndex",0);this.slotIndex=r}getFrameEntries(){return 7}setFrame(e,s,r,n,a,o,h,l){e*=7,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a,this.frames[e+4]=o,this.frames[e+5]=h,this.frames[e+6]=l}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color,d=l.darkColor;if(re){let l=this.frames[s];return r[n+1]*(e-l)/(r[n]-l)}let a=n+18;for(n+=2;n=e){let l=r[n-2],c=r[n-1];return c+(e-l)/(r[n]-l)*(r[n+1]-c)}let o=r[a-2],h=r[a-1];return h+(1-h)*(e-o)/(this.frames[s+this.getFrameEntries()]-o)}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=l.getAttachment();if(!c||!(c instanceof Pi)||c.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(o=ht.setup);let d=this.vertices,f=d[0].length,m=this.frames;if(r=m[m.length-1]){let b=d[m.length-1];if(a==1)if(o==ht.add){let T=c;if(T.bones)for(let S=0;Sr)this.apply(e,s,Number.MAX_VALUE,n,a,o,h),s=-1;else if(s>=l[c-1])return;if(r0&&l[u-1]==d;)u--}for(;u=l[u];u++)n.push(this.events[u])}},x(Ln,"propertyIds",[""+Vt.event]),Ln);var Bn;let Lo=(Bn=class extends we{constructor(e){super(e,Bn.propertyIds);x(this,"drawOrders");this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.drawOrders[e]=r}apply(e,s,r,n,a,o,h){if(h==hs.mixOut){o==ht.setup&&xt.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(r>2];switch(p){case 0:let g=c[m];u=c[m+1],d=c[m+2],f=c[m+3];let y=(r-g)/(c[m+4]-g);u+=(c[m+4+1]-u)*y,d+=(c[m+4+2]-d)*y,f+=(c[m+4+3]-f)*y;break;case 1:u=c[m+1],d=c[m+2],f=c[m+3];break;default:u=this.getBezierValue(r,m,1,p-2),d=this.getBezierValue(r,m,2,p+18-2),f=this.getBezierValue(r,m,3,p+36-2)}if(o==ht.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*a,l.mixX=g.mixX+(d-g.mixX)*a,l.mixY=g.mixY+(f-g.mixY)*a}else l.mixRotate+=(u-l.mixRotate)*a,l.mixX+=(d-l.mixX)*a,l.mixY+=(f-l.mixY)*a}},Jn=class extends wr{constructor(e,s,r,n){super(e,s,n+"|"+r);x(this,"constraintIndex",0);this.constraintIndex=r}apply(e,s,r,n,a,o,h){let l;if(this.constraintIndex==-1){const c=r>=this.frames[0]?this.getCurveValue(r):0;for(const u of e.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(r,a,o,this.get(u),this.setup(u),c))}else l=e.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(r,a,o,this.get(l),this.setup(l)))}},nw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintInertia)}setup(t){return t.data.inertia}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}},aw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintStrength)}setup(t){return t.data.strength}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}},ow=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintDamping)}setup(t){return t.data.damping}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}},lw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintMass)}setup(t){return 1/t.data.massInverse}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}},hw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintWind)}setup(t){return t.data.wind}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}},cw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintGravity)}setup(t){return t.data.gravity}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}},uw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintMix)}setup(t){return t.data.mix}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}};var On;let dw=(On=class extends we{constructor(e,s){super(e,On.propertyIds);x(this,"constraintIndex");this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s}apply(e,s,r,n,a,o,h){let l;if(this.constraintIndex!=-1&&(l=e.physicsConstraints[this.constraintIndex],!l.active))return;const c=this.frames;if(s>r)this.apply(e,s,Number.MAX_VALUE,[],a,o,h),s=-1;else if(s>=c[c.length-1])return;if(!(r=c[we.search1(c,s)+1]))if(l!=null)l.reset();else for(const u of e.physicsConstraints)u.active&&u.reset()}},x(On,"propertyIds",[Vt.physicsConstraintReset.toString()]),On);var ys;let fw=(ys=class extends we{constructor(e,s,r){super(e,[Vt.sequence+"|"+s+"|"+r.sequence.id]);x(this,"slotIndex");x(this,"attachment");this.slotIndex=s,this.attachment=r}getFrameEntries(){return ys.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,s,r,n,a){let o=this.frames;e*=ys.ENTRIES,o[e]=s,o[e+ys.MODE]=r|n<<4,o[e+ys.DELAY]=a}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=l.attachment,u=this.attachment;if(c!=u&&(!(c instanceof Pi)||c.timelineAttachment!=u))return;if(h==hs.mixOut){o==ht.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(r>4,_=this.attachment.sequence.regions.length,v=D1[p&15];if(v!=Qe.hold)switch(y+=(r-m)/g+1e-5|0,v){case Qe.once:y=Math.min(_-1,y);break;case Qe.loop:y%=_;break;case Qe.pingpong:{let b=(_<<1)-2;y=b==0?0:y%b,y>=_&&(y=b-y);break}case Qe.onceReverse:y=Math.max(_-1-y,0);break;case Qe.loopReverse:y=_-1-y%_;break;case Qe.pingpongReverse:{let b=(_<<1)-2;y=b==0?0:(y+_-1)%b,y>=_&&(y=b-y)}}l.sequenceIndex=y}},x(ys,"ENTRIES",3),x(ys,"MODE",1),x(ys,"DELAY",2),ys);var bi;let rF=(bi=class{constructor(t){x(this,"data");x(this,"tracks",new Array);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",new Array);x(this,"listeners",new Array);x(this,"queue",new nF(this));x(this,"propertyIDs",new L1);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new ic(()=>new iF));this.data=t}static emptyAnimation(){return bi._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,r=e.length;s0){if(n.delay-=a,n.delay>0)continue;a=-n.delay,n.delay=0}let o=n.next;if(o){let h=n.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=n.timeScale==0?0:(h/n.timeScale+t)*o.timeScale,n.trackTime+=a,this.setCurrent(s,o,!0);o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){e[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,t)){let h=n.mixingFrom;for(n.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}n.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let r=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.nextTrackLast!=-1&&t.mixTime>=t.mixDuration?((s.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),r):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,s=this.tracks,r=!1;for(let d=0,f=s.length;d0)continue;r=!0;let p=d==0?ht.first:m.mixBlend,g=m.alpha;m.mixingFrom?g*=this.applyMixingFrom(m,t,p):m.trackTime>=m.trackEnd&&!m.next&&(g=0);let y=g>=m.alphaAttachmentThreshold,_=m.animationLast,v=m.getAnimationTime(),b=v,T=e;m.reverse&&(b=m.animation.duration-b,T=null);let S=m.animation.timelines,w=S.length;if(d==0&&g==1||p==ht.add){d==0&&(y=!0);for(let E=0;E1&&(n=1),s!=ht.first&&(s=r.mixBlend));let a=n=r.alphaAttachmentThreshold):(o&&T instanceof Lo&&w==ht.setup&&(S=hs.mixIn),T.apply(e,d,m,p,E,w,S))}}return t.mixDuration>0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,n}applyAttachmentTimeline(t,e,s,r,n){var a=e.slots[t.slotIndex];a.bone.active&&(s=0,v=p>=0;Math.abs(g)<=90&&yt.signum(g)!=yt.signum(m)&&(Math.abs(p-y)>180?(f+=360*yt.signum(p),v=_):y!=0?f-=360*yt.signum(p):v=_),v!=_&&(f+=360*yt.signum(p)),a[o]=f}a[o+1]=m,l.rotation=u+f*r}queueEvents(t,e){let s=t.animationStart,r=t.animationEnd,n=r-s,a=t.trackLast%n,o=this.events,h=0,l=o.length;for(;hr||this.queue.event(t,u)}let c=!1;if(t.loop)if(n==0)c=!0;else{const u=Math.floor(t.trackTime/n);c=u>0&&u>Math.floor(t.trackLast/n)}else c=e>=r&&t.animationLast=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){let r=s.mixingFrom;if(!r)break;this.queue.end(r),s.mixingFrom=null,s.mixingTo=null,s=r}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(s&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let r=!0,n=this.expandToIndex(t);n&&(n.nextTrackLast==-1?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,r=!1):this.clearNext(n));let a=this.trackEntry(t,e,s,n);return this.setCurrent(t,a,r),this.queue.drain(),a}addAnimation(t,e,s=!1,r=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,s,r)}addAnimationWith(t,e,s=!1,r=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let a=this.trackEntry(t,e,s,n);return n?(n.next=a,a.previous=n,r<=0&&(r=Math.max(r+n.getTrackComplete()-a.mixDuration,0))):(this.setCurrent(t,a,!0),this.queue.drain(),r<0&&(r=0)),a.delay=r,a}setEmptyAnimation(t,e=0){let s=this.setAnimationWith(t,bi.emptyAnimation(),!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){let r=this.addAnimationWith(t,bi.emptyAnimation(),!1,s);return s<=0&&(r.delay=Math.max(r.delay+r.mixDuration-e,0)),r.mixDuration=e,r.trackEnd=e,r}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s0){n[h]=aF,a[h]=u;continue t}break}n[h]=Of}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},x(bi,"_emptyAnimation",new Wp("",[],0)),bi),iF=class{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"holdPrevious",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"_mixDuration",0);x(this,"interruptAlpha",0);x(this,"totalAlpha",0);x(this,"mixBlend",ht.replace);x(this,"timelineMode",new Array);x(this,"timelineHoldMix",new Array);x(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(t){this._mixDuration=t}setMixDurationWithDelay(t,e){this._mixDuration=t,e<=0&&(this.previous!=null?e=Math.max(e+this.previous.getTrackComplete()-t,0):e=0),this.delay=e}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return t==0?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(t!=0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime=0}},nF=class{constructor(t){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=t}start(t){this.objects.push(As.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(As.interrupt),this.objects.push(t)}end(t){this.objects.push(As.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(As.dispose),this.objects.push(t)}complete(t){this.objects.push(As.complete),this.objects.push(t)}event(t,e){this.objects.push(As.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects;for(let e=0;e{c.width=parseInt(s[1]),c.height=parseInt(s[2])},r.format=()=>{},r.filter=c=>{c.minFilter=xt.enumValue(ze,s[1]),c.magFilter=xt.enumValue(ze,s[2])},r.repeat=c=>{s[1].indexOf("x")!=-1&&(c.uWrap=wi.Repeat),s[1].indexOf("y")!=-1&&(c.vWrap=wi.Repeat)},r.pma=c=>{c.pma=s[1]=="true"};var n={};n.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},n.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},n.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},n.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},n.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},n.rotate=c=>{let u=s[1];u=="true"?c.degrees=90:u!="false"&&(c.degrees=parseInt(u))},n.index=c=>{c.index=parseInt(s[1])};let a=e.readLine();for(;a&&a.trim().length==0;)a=e.readLine();for(;!(!a||a.trim().length==0||e.readEntry(s,a)==0);)a=e.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length==0)o=null,a=e.readLine();else if(o){let c=new gw(o,a);for(;;){let u=e.readEntry(s,a=e.readLine());if(u==0)break;let d=n[s[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(s[0]);let f=[];for(let m=0;m0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees==90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new mF(a.trim());e.readEntry(s,a=e.readLine())!=0;){let c=r[s[0]];c&&c(o)}this.pages.push(o)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||(e=e.trim(),e.length==0))return 0;let s=e.indexOf(":");if(s==-1)return 0;t[0]=e.substr(0,s).trim();for(let r=1,n=s+1;;r++){let a=e.indexOf(",",n);if(a==-1)return t[r]=e.substr(n).trim(),r;if(t[r]=e.substr(n,a-n).trim(),n=a+1,r==4)return 4}}},mF=class{constructor(t){x(this,"name");x(this,"minFilter",ze.Nearest);x(this,"magFilter",ze.Nearest);x(this,"uWrap",wi.ClampToEdge);x(this,"vWrap",wi.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(this,"regions",new Array);this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}},gw=class extends uF{constructor(e,s){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=e,this.name=s,e.regions.push(this)}},Qc=class qm extends Pi{constructor(e,s){super(e);x(this,"region",null);x(this,"path");x(this,"regionUVs",[]);x(this,"uvs",[]);x(this,"triangles",[]);x(this,"color",new Dt(1,1,1,1));x(this,"width",0);x(this,"height",0);x(this,"hullLength",0);x(this,"edges",[]);x(this,"parentMesh",null);x(this,"sequence",null);x(this,"tempColor",new Dt(0,0,0,0));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=xt.newFloatArray(e.length));let s=this.uvs,r=this.uvs.length,n=this.region.u,a=this.region.v,o=0,h=0;if(this.region instanceof gw){let l=this.region,c=l.page,u=c.width,d=c.height;switch(l.degrees){case 90:n-=(l.originalHeight-l.offsetY-l.height)/u,a-=(l.originalWidth-l.offsetX-l.width)/d,o=l.originalHeight/u,h=l.originalWidth/d;for(let f=0;f= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=s}};var Ae;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(Ae||(Ae={}));let Qx=class{constructor(t,e,s){x(this,"data");x(this,"skeleton");x(this,"parent",null);x(this,"children",new Array);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"ax",0);x(this,"ay",0);x(this,"arotation",0);x(this,"ascaleX",0);x(this,"ascaleY",0);x(this,"ashearX",0);x(this,"ashearY",0);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"inherit",Ae.Normal);x(this,"sorted",!1);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,s,r,n,a,o){this.ax=t,this.ay=e,this.arotation=s,this.ascaleX=r,this.ascaleY=n,this.ashearX=a,this.ashearY=o;let h=this.parent;if(!h){let f=this.skeleton;const m=f.scaleX,p=f.scaleY,g=(s+a)*yt.degRad,y=(s+90+o)*yt.degRad;this.a=Math.cos(g)*r*m,this.b=Math.cos(y)*n*m,this.c=Math.sin(g)*r*p,this.d=Math.sin(y)*n*p,this.worldX=t*m+f.x,this.worldY=e*p+f.y;return}let l=h.a,c=h.b,u=h.c,d=h.d;switch(this.worldX=l*t+c*e+h.worldX,this.worldY=u*t+d*e+h.worldY,this.inherit){case Ae.Normal:{const f=(s+a)*yt.degRad,m=(s+90+o)*yt.degRad,p=Math.cos(f)*r,g=Math.cos(m)*n,y=Math.sin(f)*r,_=Math.sin(m)*n;this.a=l*p+c*y,this.b=l*g+c*_,this.c=u*p+d*y,this.d=u*g+d*_;return}case Ae.OnlyTranslation:{const f=(s+a)*yt.degRad,m=(s+90+o)*yt.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(m)*n,this.c=Math.sin(f)*r,this.d=Math.sin(m)*n;break}case Ae.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;l*=f,u*=m;let p=l*l+u*u,g=0;p>1e-4?(p=Math.abs(l*d*m-c*f*u)/p,c=u*p,d=l*p,g=Math.atan2(u,l)*yt.radDeg):(l=0,u=0,g=90-Math.atan2(d,c)*yt.radDeg);const y=(s+a-g)*yt.degRad,_=(s+o-g+90)*yt.degRad,v=Math.cos(y)*r,b=Math.cos(_)*n,T=Math.sin(y)*r,S=Math.sin(_)*n;this.a=l*v-c*T,this.b=l*b-c*S,this.c=u*v+d*T,this.d=u*b+d*S;break}case Ae.NoScale:case Ae.NoScaleOrReflection:{s*=yt.degRad;const f=Math.cos(s),m=Math.sin(s);let p=(l*f+c*m)/this.skeleton.scaleX,g=(u*f+d*m)/this.skeleton.scaleY,y=Math.sqrt(p*p+g*g);y>1e-5&&(y=1/y),p*=y,g*=y,y=Math.sqrt(p*p+g*g),this.inherit==Ae.NoScale&&l*d-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y),s=Math.PI/2+Math.atan2(g,p);const _=Math.cos(s)*y,v=Math.sin(s)*y;a*=yt.degRad,o=(90+o)*yt.degRad;const b=Math.cos(a)*r,T=Math.cos(o)*n,S=Math.sin(a)*r,w=Math.sin(o)*n;this.a=p*b+_*S,this.b=p*T+_*w,this.c=g*b+v*S,this.d=g*T+v*w;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let t=this.parent;if(!t){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*yt.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*yt.radDeg;return}let e=t.a,s=t.b,r=t.c,n=t.d,a=1/(e*n-s*r),o=n*a,h=s*a,l=r*a,c=e*a,u=this.worldX-t.worldX,d=this.worldY-t.worldY;this.ax=u*o-d*h,this.ay=d*c-u*l;let f,m,p,g;if(this.inherit==Ae.OnlyTranslation)f=this.a,m=this.b,p=this.c,g=this.d;else{switch(this.inherit){case Ae.NoRotationOrReflection:{let T=Math.abs(e*n-s*r)/(e*e+r*r);s=-r*this.skeleton.scaleX*T/this.skeleton.scaleY,n=e*this.skeleton.scaleY*T/this.skeleton.scaleX,a=1/(e*n-s*r),o=n*a,h=s*a;break}case Ae.NoScale:case Ae.NoScaleOrReflection:let y=yt.cosDeg(this.rotation),_=yt.sinDeg(this.rotation);e=(e*y+s*_)/this.skeleton.scaleX,r=(r*y+n*_)/this.skeleton.scaleY;let v=Math.sqrt(e*e+r*r);v>1e-5&&(v=1/v),e*=v,r*=v,v=Math.sqrt(e*e+r*r),this.inherit==Ae.NoScale&&a<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v);let b=yt.PI/2+Math.atan2(r,e);s=Math.cos(b)*v,n=Math.sin(b)*v,a=1/(e*n-s*r),o=n*a,h=s*a,l=r*a,c=e*a}f=o*this.a-h*this.c,m=o*this.b-h*this.d,p=c*this.c-l*this.a,g=c*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+p*p),this.ascaleX>1e-4){let y=f*g-m*p;this.ascaleY=y/this.ascaleX,this.ashearY=-Math.atan2(f*m+p*g,y)*yt.radDeg,this.arotation=Math.atan2(p,f)*yt.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,m)*yt.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*yt.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*yt.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,r=t.y-this.worldY;return t.x=s*this.d*e-r*this.b*e,t.y=r*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(t==null)throw new Error("world cannot be null.");return this.parent==null?t:this.parent.worldToLocal(t)}parentToWorld(t){if(t==null)throw new Error("world cannot be null.");return this.parent==null?t:this.parent.localToWorld(t)}worldToLocalRotation(t){let e=yt.sinDeg(t),s=yt.cosDeg(t);return Math.atan2(this.a*e-this.c*s,this.d*s-this.b*e)*yt.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=yt.sinDeg(t),s=yt.cosDeg(t);return Math.atan2(s*this.c+e*this.d,s*this.a+e*this.b)*yt.radDeg}rotateWorld(t){t*=yt.degRad;const e=Math.sin(t),s=Math.cos(t),r=this.a,n=this.b;this.a=s*r-e*this.c,this.b=s*n-e*this.d,this.c=e*r+s*this.c,this.d=e*n+s*this.d}},tu=class{constructor(t,e,s){x(this,"name");x(this,"order");x(this,"skinRequired");this.name=t,this.order=e,this.skinRequired=s}},vw=class{constructor(t,e){x(this,"data");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"time",0);x(this,"volume",0);x(this,"balance",0);if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}},_w=class{constructor(t){x(this,"name");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"audioPath",null);x(this,"volume",0);x(this,"balance",0);this.name=t}},gF=class{constructor(t,e){x(this,"data");x(this,"bones");x(this,"target");x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"mix",1);x(this,"softness",0);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0;r180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,y=t.ascaleY;if(r||n){switch(t.inherit){case Ae.NoScale:case Ae.NoScaleOrReflection:m=e-t.worldX,p=s-t.worldY}const _=t.data.length*g;if(_>1e-4){const v=m*m+p*p;if(r&&v<_*_||n&&v>_*_){const b=(Math.sqrt(v)/_-1)*o+1;g*=b,a&&(y*=b)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,g,y,t.ashearX,t.ashearY)}apply2(t,e,s,r,n,a,o,h,l){if(t.inherit!=Ae.Normal||e.inherit!=Ae.Normal)return;let c=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,m=d,p=f,g=e.ascaleX,y=0,_=0,v=0;d<0?(d=-d,y=180,v=-1):(y=0,v=1),f<0&&(f=-f,v=-v),g<0?(g=-g,_=180):_=0;let b=e.ax,T=0,S=0,w=0,E=t.a,A=t.b,P=t.c,I=t.d,C=Math.abs(d-f)<=1e-4;!C||a?(T=0,S=E*b+t.worldX,w=P*b+t.worldY):(T=e.ay,S=E*b+A*T+t.worldX,w=P*b+I*T+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");E=R.a,A=R.b,P=R.c,I=R.d;let F=E*I-A*P,D=S-R.worldX,M=w-R.worldY;F=Math.abs(F)<=1e-4?0:1/F;let O=(D*I-M*A)*F-c,k=(M*E-D*P)*F-u,N=Math.sqrt(O*O+k*k),B=e.data.length*g,L,G;if(N<1e-4){this.apply1(t,s,r,!1,a,!1,l),e.updateWorldTransformWith(b,T,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}D=s-R.worldX,M=r-R.worldY;let V=(D*I-M*A)*F-c,q=(M*E-D*P)*F-u,H=V*V+q*q;if(h!=0){h*=d*(g+1)*.5;let ot=Math.sqrt(H),ct=ot-N-B*d+h;if(ct>0){let rt=Math.min(1,ct/(h*2))-1;rt=(ct-h*(1-rt*rt))/ot,V-=rt*V,q-=rt*q,H=V*V+q*q}}t:if(C){B*=d;let ot=(H-N*N-B*B)/(2*N*B);ot<-1?(ot=-1,G=Math.PI*n):ot>1?(ot=1,G=0,a&&(E=(Math.sqrt(H)/(N+B)-1)*l+1,m*=E,o&&(p*=E))):G=Math.acos(ot)*n,E=N+B*ot,A=B*Math.sin(G),L=Math.atan2(q*E-V*A,V*E+q*A)}else{E=d*B,A=f*B;let ot=E*E,ct=A*A,rt=Math.atan2(q,V);P=ct*N*N+ot*H-ot*ct;let dt=-2*ct*N,X=ct-ot;if(I=dt*dt-4*X*P,I>=0){let j=Math.sqrt(I);dt<0&&(j=-j),j=-(dt+j)*.5;let mt=j/X,ut=P/j,vt=Math.abs(mt)=0){M=Math.sqrt(mt)*n,L=rt-Math.atan2(M,vt),G=Math.atan2(M/f,(vt-N)/d);break t}}let $=yt.PI,K=N-E,J=K*K,Q=0,it=0,U=N+E,Y=U*U,W=0;P=-E*N/(ot-ct),P>=-1&&P<=1&&(P=Math.acos(P),D=E*Math.cos(P)+N,M=A*Math.sin(P),I=D*D+M*M,IY&&(it=P,Y=I,U=D,W=M)),H<=(J+Y)*.5?(L=rt-Math.atan2(Q*n,K),G=$*n):(L=rt-Math.atan2(W*n,U),G=it*n)}let at=Math.atan2(T,b)*v,et=t.arotation;L=(L-at)*yt.radDeg+y-et,L>180?L-=360:L<-180&&(L+=360),t.updateWorldTransformWith(c,u,et+L*l,m,p,0,0),et=e.arotation,G=((G+at)*yt.radDeg-e.ashearX)*v+_-et,G>180?G-=360:G<-180&&(G+=360),e.updateWorldTransformWith(b,T,et+G*l,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},ww=class extends tu{constructor(e){super(e,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"uniform",!1);x(this,"mix",0);x(this,"softness",0)}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Tw=class extends tu{constructor(e){super(e,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"positionMode",Hr.Fixed);x(this,"spacingMode",$e.Fixed);x(this,"rotateMode",Vn.Chain);x(this,"offsetRotation",0);x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0)}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var Hr;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Hr||(Hr={}));var $e;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})($e||($e={}));var Vn;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(Vn||(Vn={}));var os;let yF=(os=class{constructor(t,e){x(this,"data");x(this,"bones");x(this,"target");x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"spaces",new Array);x(this,"positions",new Array);x(this,"world",new Array);x(this,"curves",new Array);x(this,"lengths",new Array);x(this,"segments",new Array);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0,n=t.bones.length;r0){b=u/b*m;for(let S=1;S0?yt.degRad:-.01745329277777778}for(let b=0,T=3;b0){let I=S.a,C=S.b,R=S.c,F=S.d,D=0,M=0,O=0;if(o?D=p[T-1]:d[b+1]==0?D=p[T+2]:D=Math.atan2(P,A),D-=Math.atan2(R,I),v){M=Math.cos(D),O=Math.sin(D);let k=S.data.length;g+=(k*(M*I-O*R)-A)*s,y+=(k*(O*I+M*R)-P)*s}else D+=_;D>yt.PI?D-=yt.PI2:D<-3.1415927&&(D+=yt.PI2),D*=s,M=Math.cos(D),O=Math.sin(D),S.a=M*I-O*R,S.b=M*C-O*F,S.c=O*I+M*R,S.d=O*C+M*F}S.updateAppliedTransform()}}computeWorldPositions(t,e,s){let r=this.target,n=this.position,a=this.spaces,o=xt.setArraySize(this.positions,e*3+2),h=this.world,l=t.closed,c=t.worldVerticesLength,u=c/6,d=os.NONE;if(!t.constantSpeed){let k=t.lengths;u-=l?1:2;let N=k[u];this.data.positionMode==Hr.Percent&&(n*=N);let B;switch(this.data.spacingMode){case $e.Percent:B=N;break;case $e.Proportional:B=N/e;break;default:B=1}h=xt.setArraySize(this.world,8);for(let L=0,G=0,V=0;LN){d!=os.AFTER&&(d=os.AFTER,t.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(H-N,h,0,o,G);continue}for(;;V++){let at=k[V];if(!(H>at)){if(V==0)H/=at;else{let et=k[V-1];H=(H-et)/(at-et)}break}}V!=d&&(d=V,l&&V==u?(t.computeWorldVertices(r,c-4,4,h,0,2),t.computeWorldVertices(r,0,4,h,4,2)):t.computeWorldVertices(r,V*6+2,8,h,0,2)),this.addCurvePosition(H,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,G,s||L>0&&q==0)}return o}l?(c+=2,h=xt.setArraySize(this.world,c),t.computeWorldVertices(r,2,c-4,h,0,2),t.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=xt.setArraySize(this.world,c),t.computeWorldVertices(r,2,c,h,0,2));let f=xt.setArraySize(this.curves,u),m=0,p=h[0],g=h[1],y=0,_=0,v=0,b=0,T=0,S=0,w=0,E=0,A=0,P=0,I=0,C=0,R=0,F=0;for(let k=0,N=2;km){this.addAfterPosition(V-m,h,c-4,o,N);continue}for(;;B++){let q=f[B];if(!(V>q)){if(B==0)V/=q;else{let H=f[B-1];V=(V-H)/(q-H)}break}}if(B!=d){d=B;let q=B*6;for(p=h[q],g=h[q+1],y=h[q+2],_=h[q+3],v=h[q+4],b=h[q+5],T=h[q+6],S=h[q+7],w=(p-y*2+v)*.03,E=(g-_*2+b)*.03,A=((y-v)*3-p+T)*.006,P=((_-b)*3-g+S)*.006,I=w*2+A,C=E*2+P,R=(y-p)*.3+w+A*.16666667,F=(_-g)*.3+E+P*.16666667,O=Math.sqrt(R*R+F*F),M[0]=O,q=1;q<8;q++)R+=I,F+=C,I+=A,C+=P,O+=Math.sqrt(R*R+F*F),M[q]=O;R+=I,F+=C,O+=Math.sqrt(R*R+F*F),M[8]=O,R+=I+A,F+=C+P,O+=Math.sqrt(R*R+F*F),M[9]=O,L=0}for(V*=O;;L++){let q=M[L];if(!(V>q)){if(L==0)V/=q;else{let H=M[L-1];V=L+(V-H)/(q-H)}break}}this.addCurvePosition(V*.1,p,g,y,_,v,b,T,S,o,N,s||k>0&&G==0)}return o}addBeforePosition(t,e,s,r,n){let a=e[s],o=e[s+1],h=e[s+2]-a,l=e[s+3]-o,c=Math.atan2(l,h);r[n]=a+t*Math.cos(c),r[n+1]=o+t*Math.sin(c),r[n+2]=c}addAfterPosition(t,e,s,r,n){let a=e[s+2],o=e[s+3],h=a-e[s],l=o-e[s+1],c=Math.atan2(l,h);r[n]=a+t*Math.cos(c),r[n+1]=o+t*Math.sin(c),r[n+2]=c}addCurvePosition(t,e,s,r,n,a,o,h,l,c,u,d){if(t==0||isNaN(t)){c[u]=e,c[u+1]=s,c[u+2]=Math.atan2(n-s,r-e);return}let f=t*t,m=f*t,p=1-t,g=p*p,y=g*p,_=p*t,v=_*3,b=p*v,T=v*t,S=e*y+r*b+a*T+h*m,w=s*y+n*b+o*T+l*m;c[u]=S,c[u+1]=w,d&&(t<.001?c[u+2]=Math.atan2(n-s,r-e):c[u+2]=Math.atan2(w-(s*g+n*_*2+o*f),S-(e*g+r*_*2+a*f)))}},x(os,"NONE",-1),x(os,"BEFORE",-2),x(os,"AFTER",-3),x(os,"epsilon",1e-5),os),xF=class{constructor(t,e){x(this,"data");x(this,"_bone",null);x(this,"inertia",0);x(this,"strength",0);x(this,"damping",0);x(this,"massInverse",0);x(this,"wind",0);x(this,"gravity",0);x(this,"mix",0);x(this,"_reset",!0);x(this,"ux",0);x(this,"uy",0);x(this,"cx",0);x(this,"cy",0);x(this,"tx",0);x(this,"ty",0);x(this,"xOffset",0);x(this,"xVelocity",0);x(this,"yOffset",0);x(this,"yVelocity",0);x(this,"rotateOffset",0);x(this,"rotateVelocity",0);x(this,"scaleOffset",0);x(this,"scaleVelocity",0);x(this,"active",!1);x(this,"skeleton");x(this,"remaining",0);x(this,"lastTime",0);this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(t){const e=this.mix;if(e==0)return;const s=this.data.x>0,r=this.data.y>0,n=this.data.rotate>0||this.data.shearX>0,a=this.data.scaleX>0,o=this.bone,h=o.data.length;switch(t){case qi.none:return;case qi.reset:this.reset();case qi.update:const l=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=l.time;const u=o.worldX,d=o.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,m=this.inertia,p=this.data.step,g=this.skeleton.data.referenceScale,y=-1,_=this.data.limit*c,v=_*Math.abs(l.scaleY);if(_*=Math.abs(l.scaleX),s||r){if(s){const b=(this.ux-u)*m;this.xOffset+=b>_?_:b<-_?-_:b,this.ux=u}if(r){const b=(this.uy-d)*m;this.yOffset+=b>v?v:b<-v?-v:b,this.uy=d}if(f>=p){y=Math.pow(this.damping,60*p);const b=this.massInverse*p,T=this.strength,S=this.wind*g*l.scaleX,w=this.gravity*g*l.scaleY;do s&&(this.xVelocity+=(S-this.xOffset*T)*b,this.xOffset+=this.xVelocity*p,this.xVelocity*=y),r&&(this.yVelocity-=(w+this.yOffset*T)*b,this.yOffset+=this.yVelocity*p,this.yVelocity*=y),f-=p;while(f>=p)}s&&(o.worldX+=this.xOffset*e*this.data.x),r&&(o.worldY+=this.yOffset*e*this.data.y)}if(n||a){let b=Math.atan2(o.c,o.a),T=0,S=0,w=0,E=this.cx-o.worldX,A=this.cy-o.worldY;if(E>_?E=_:E<-_&&(E=-_),A>v?A=v:A<-v&&(A=-v),n){w=(this.data.rotate+this.data.shearX)*e;let P=Math.atan2(A+this.ty,E+this.tx)-b-this.rotateOffset*w;this.rotateOffset+=(P-Math.ceil(P*yt.invPI2-.5)*yt.PI2)*m,P=this.rotateOffset*w+b,T=Math.cos(P),S=Math.sin(P),a&&(P=h*o.getWorldScaleX(),P>0&&(this.scaleOffset+=(E*T+A*S)*m/P))}else{T=Math.cos(b),S=Math.sin(b);const P=h*o.getWorldScaleX();P>0&&(this.scaleOffset+=(E*T+A*S)*m/P)}if(f=this.remaining,f>=p){y==-1&&(y=Math.pow(this.damping,60*p));const P=this.massInverse*p,I=this.strength,C=this.wind,R=Kp.yDown?-this.gravity:this.gravity,F=h/g;for(;;)if(f-=p,a&&(this.scaleVelocity+=(C*T-R*S-this.scaleOffset*I)*P,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=y),n){if(this.rotateVelocity-=((C*S+R*T)*F+this.rotateOffset*I)*P,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=y,f0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,c=Math.sin(f),u=Math.cos(f),d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d),f+=l*this.data.shearX,c=Math.sin(f),u=Math.cos(f),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c}else l*=this.data.rotate,c=Math.sin(l),u=Math.cos(l),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c,d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d}if(a){const l=1+this.scaleOffset*e*this.data.scaleX;o.a*=l,o.c*=l}t!=qi.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(t,e,s){const r=s*yt.degRad,n=Math.cos(r),a=Math.sin(r),o=this.cx-t,h=this.cy-e;this.translate(o*n-h*a-o,o*a+h*n-h)}},bF=class{constructor(t,e){x(this,"data");x(this,"bone");x(this,"color");x(this,"darkColor",null);x(this,"attachment",null);x(this,"attachmentState",0);x(this,"sequenceIndex",-1);x(this,"deform",new Array);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new Dt,this.darkColor=t.darkColor?new Dt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&((!(t instanceof Pi)||!(this.attachment instanceof Pi)||t.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},vF=class{constructor(t,e){x(this,"data");x(this,"bones");x(this,"target");x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"temp",new nc);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0;r0?yt.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let y=0,_=g.length;y<_;y++){let v=g[y];if(t!=0){let b=v.a,T=v.b,S=v.c,w=v.d,E=Math.atan2(u,l)-Math.atan2(S,b)+m;E>yt.PI?E-=yt.PI2:E<-3.1415927&&(E+=yt.PI2),E*=t;let A=Math.cos(E),P=Math.sin(E);v.a=A*b-P*S,v.b=A*T-P*w,v.c=P*b+A*S,v.d=P*T+A*w}if(o){let b=this.temp;h.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(b.x-v.worldX)*e,v.worldY+=(b.y-v.worldY)*s}if(r!=0){let b=Math.sqrt(v.a*v.a+v.c*v.c);b!=0&&(b=(b+(Math.sqrt(l*l+u*u)-b+this.data.offsetScaleX)*r)/b),v.a*=b,v.c*=b}if(n!=0){let b=Math.sqrt(v.b*v.b+v.d*v.d);b!=0&&(b=(b+(Math.sqrt(c*c+d*d)-b+this.data.offsetScaleY)*n)/b),v.b*=b,v.d*=b}if(a>0){let b=v.b,T=v.d,S=Math.atan2(T,b),w=Math.atan2(d,c)-Math.atan2(u,l)-(S-Math.atan2(v.c,v.a));w>yt.PI?w-=yt.PI2:w<-3.1415927&&(w+=yt.PI2),w=S+(w+p)*a;let E=Math.sqrt(b*b+T*T);v.b=Math.cos(w)*E,v.d=Math.sin(w)*E}v.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=e!=0||s!=0,h=this.target,l=h.a,c=h.b,u=h.c,d=h.d,f=l*d-c*u>0?yt.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let y=0,_=g.length;y<_;y++){let v=g[y];if(t!=0){let b=v.a,T=v.b,S=v.c,w=v.d,E=Math.atan2(u,l)+m;E>yt.PI?E-=yt.PI2:E<-3.1415927&&(E+=yt.PI2),E*=t;let A=Math.cos(E),P=Math.sin(E);v.a=A*b-P*S,v.b=A*T-P*w,v.c=P*b+A*S,v.d=P*T+A*w}if(o){let b=this.temp;h.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),v.worldX+=b.x*e,v.worldY+=b.y*s}if(r!=0){let b=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*r+1;v.a*=b,v.c*=b}if(n!=0){let b=(Math.sqrt(c*c+d*d)-1+this.data.offsetScaleY)*n+1;v.b*=b,v.d*=b}if(a>0){let b=Math.atan2(d,c)-Math.atan2(u,l);b>yt.PI?b-=yt.PI2:b<-3.1415927&&(b+=yt.PI2);let T=v.b,S=v.d;b=Math.atan2(S,T)+(b-yt.PI/2+p)*a;let w=Math.sqrt(T*T+S*S);v.b=Math.cos(b)*w,v.d=Math.sin(b)*w}v.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=this.target,h=this.bones;for(let l=0,c=h.length;le.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(e=>e.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(e=>e.data.name==t)??null}findPhysicsConstraint(t){if(t==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(e=>e.data.name==t)??null}getBoundsRect(t){let e=new nc,s=new nc;return this.getBounds(e,s,void 0,t),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(t,e,s=new Array(2),r=null){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let n=this.drawOrder,a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,u=n.length;c=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=s}addSkin(t){for(let r=0;r= 0.");if(!e)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=s}};var Qi;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Qi||(Qi={}));let Aw=class extends tu{constructor(e){super(e,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"offsetRotation",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"offsetScaleX",0);x(this,"offsetScaleY",0);x(this,"offsetShearY",0);x(this,"relative",!1);x(this,"local",!1)}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},eb=class{constructor(t){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",new Array);this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new lc;s.name="";let r=new _F(t),n=r.readInt32(),a=r.readInt32();s.hash=a==0&&n==0?null:a.toString(16)+n.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*e;let o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let h=0;h=r.readInt(!0);for(let c=0;c>1&3,f.rotateMode=m>>3&3,(m&128)!=0&&(f.offsetRotation=r.readFloat()),f.position=r.readFloat(),f.positionMode==Hr.Fixed&&(f.position*=e),f.spacing=r.readFloat(),(f.spacingMode==$e.Length||f.spacingMode==$e.Fixed)&&(f.spacing*=e),f.mixRotate=r.readFloat(),f.mixX=r.readFloat(),f.mixY=r.readFloat(),s.pathConstraints.push(f)}h=r.readInt(!0);for(let c=0,u;c>4,t.readFloat())}r.push(S);break}}}}}let a=t.readInt(!0);if(a>0){let l=new Lo(a),c=s.slots.length;for(let u=0;u=0;_--)m[_]=-1;let p=xt.newArray(c-f,0),g=0,y=0;for(let _=0;_=0;_--)m[_]==-1&&(m[_]=p[--y]);l.setFrame(u,d,m)}r.push(l)}let o=t.readInt(!0);if(o>0){let l=new jp(o);for(let c=0;c>>1^-(s&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s>4){case 12:case 13:e+=String.fromCharCode((r&31)<<6|this.readByte()&63),s+=2;break;case 14:e+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:e+=String.fromCharCode(r),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}},wF=class{constructor(t,e,s,r,n){x(this,"parent");x(this,"skinIndex");x(this,"slotIndex");x(this,"mesh");x(this,"inheritTimeline");this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}},TF=class{constructor(t=null,e=null,s=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=t,this.vertices=e,this.length=s}};var ri;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(ri||(ri={}));function rs(i,t,e){let s=i.readFloat(),r=i.readFloat()*e;for(let n=0,a=0,o=t.getFrameCount()-1;t.setFrame(n,s,r),n!=o;n++){let h=i.readFloat(),l=i.readFloat()*e;switch(i.readByte()){case Fr:t.setStepped(n);break;case kr:zt(i,t,a++,n,0,s,h,r,l,e)}s=h,r=l}return t}function Df(i,t,e){let s=i.readFloat(),r=i.readFloat()*e,n=i.readFloat()*e;for(let a=0,o=0,h=t.getFrameCount()-1;t.setFrame(a,s,r,n),a!=h;a++){let l=i.readFloat(),c=i.readFloat()*e,u=i.readFloat()*e;switch(i.readByte()){case Fr:t.setStepped(a);break;case kr:zt(i,t,o++,a,0,s,l,r,c,e),zt(i,t,o++,a,1,s,l,n,u,e)}s=l,r=c,n=u}return t}function zt(i,t,e,s,r,n,a,o,h,l){t.setBezier(e,s,r,n,o,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,a,h)}const SF=0,EF=1,AF=2,CF=3,IF=4,PF=5,MF=6,RF=7,FF=8,kF=9,LF=10,BF=0,OF=1,DF=2,NF=3,UF=4,XF=5,VF=0,YF=1,GF=0,$F=1,HF=2,WF=0,zF=1,jF=2,qF=4,KF=5,ZF=6,JF=7,QF=8,Fr=1,kr=2;let tk=class Ls{constructor(){x(this,"convexPolygons",new Array);x(this,"convexPolygonsIndices",new Array);x(this,"indicesArray",new Array);x(this,"isConcaveArray",new Array);x(this,"triangles",new Array);x(this,"polygonPool",new ic(()=>new Array));x(this,"polygonIndicesPool",new ic(()=>new Array))}triangulate(t){let e=t,s=t.length>>1,r=this.indicesArray;r.length=0;for(let o=0;o3;){let o=s-1,h=0,l=1;for(;;){t:if(!n[h]){let d=r[o]<<1,f=r[h]<<1,m=r[l]<<1,p=e[d],g=e[d+1],y=e[f],_=e[f+1],v=e[m],b=e[m+1];for(let T=(l+1)%s;T!=o;T=(T+1)%s){if(!n[T])continue;let S=r[T]<<1,w=e[S],E=e[S+1];if(Ls.positiveArea(v,b,p,g,w,E)&&Ls.positiveArea(p,g,y,_,w,E)&&Ls.positiveArea(y,_,v,b,w,E))break t}break}if(l==0){do{if(!n[h])break;h--}while(h>0);break}o=h,h=l,l=(l+1)%s}a.push(r[(s+h-1)%s]),a.push(r[h]),a.push(r[(h+1)%s]),r.splice(h,1),n.splice(h,1),s--;let c=(s+h-1)%s,u=h==s?0:h;n[c]=Ls.isConcave(c,s,e,r),n[u]=Ls.isConcave(u,s,e,r)}return s==3&&(a.push(r[2]),a.push(r[0]),a.push(r[1])),a}decompose(t,e){let s=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let h=-1,l=0;for(let c=0,u=e.length;c0?(r.push(o),n.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),o=this.polygonPool.obtain(),o.length=0,o.push(p),o.push(g),o.push(y),o.push(_),o.push(v),o.push(b),a=this.polygonIndicesPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(m),l=Ls.winding(p,g,y,_,v,b),h=d)}o.length>0&&(r.push(o),n.push(a));for(let c=0,u=r.length;c=0;c--)o=r[c],o.length==0&&(r.splice(c,1),this.polygonPool.free(o),a=n[c],n.splice(c,1),this.polygonIndicesPool.free(a));return r}static isConcave(t,e,s,r){let n=r[(e+t-1)%e]<<1,a=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(s[n],s[n+1],s[a],s[a+1],s[o],s[o+1])}static positiveArea(t,e,s,r,n,a){return t*(a-r)+s*(e-a)+n*(r-e)>=0}static winding(t,e,s,r,n,a){let o=s-t,h=r-e;return n*h-a*o+o*e-t*h>=0?1:-1}},ek=class Zm{constructor(){x(this,"triangulator",new tk);x(this,"clippingPolygon",new Array);x(this,"clipOutput",new Array);x(this,"clippedVertices",new Array);x(this,"clippedUVs",new Array);x(this,"clippedTriangles",new Array);x(this,"scratch",new Array);x(this,"clipAttachment",null);x(this,"clippingPolygons",null)}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let s=e.worldVerticesLength,r=xt.setArraySize(this.clippingPolygon,s);e.computeWorldVertices(t,0,s,r,0,2);let n=this.clippingPolygon;Zm.makeClockwise(n);let a=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let o=0,h=a.length;o>1,S=this.clipOutput,w=xt.setArraySize(n,v+T*2);for(let A=0;A>1,G=this.clipOutput,V=xt.setArraySize(l,F+L*f);for(let H=0;H>1,N=this.clipOutput,B=xt.setArraySize(a,I+k*2),L=xt.setArraySize(o,I+k*2);for(let V=0;V=2?(u=h,h=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(s),u.push(r),u.push(n),u.push(a),u.push(t),u.push(e),h.length=0;let d=o.length-4,f=o;for(let m=0;;m+=2){let p=f[m],g=f[m+1],y=p-f[m+2],_=g-f[m+3],v=h.length,b=u;for(let S=0,w=u.length-2;Sy*(g-I),R=_*(p-E)-y*(g-A);if(R>0){if(C){h.push(P),h.push(I);continue}let F=P-E,D=I-A,M=R/(F*_-D*y);if(M>=0&&M<=1)h.push(E+F*M),h.push(A+D*M);else{h.push(P),h.push(I);continue}}else if(C){let F=P-E,D=I-A,M=R/(F*_-D*y);if(M>=0&&M<=1)h.push(E+F*M),h.push(A+D*M),h.push(P),h.push(I);else{h.push(P),h.push(I);continue}}c=!0}if(v==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),m==d)break;let T=h;h=u,h.length=0,u=T}if(l!=h){l.length=0;for(let m=0,p=h.length-2;m>1;l0){let c=s.findPhysicsConstraint(o);if(!c)throw new Error("Physics constraint not found: "+o);l=s.physicsConstraints.indexOf(c)}for(let c in h){let u=h[c],d=u[0];if(!d)continue;let f=u.length;if(c=="reset"){const p=new dw(f,l);for(let g=0;d!=null;d=u[g+1],g++)p.setFrame(g,Z(d,"time",0));n.push(p);continue}let m;if(c=="inertia")m=new nw(f,f,l);else if(c=="strength")m=new aw(f,f,l);else if(c=="damping")m=new ow(f,f,l);else if(c=="mass")m=new lw(f,f,l);else if(c=="wind")m=new hw(f,f,l);else if(c=="gravity")m=new cw(f,f,l);else if(c=="mix")m=new uw(f,f,l);else continue;n.push(nr(u,m,0,1))}}if(t.attachments)for(let o in t.attachments){let h=t.attachments[o],l=s.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let c in h){let u=h[c],d=s.findSlot(c);if(!d)throw new Error("Slot not found: "+c);let f=d.index;for(let m in u){let p=u[m],g=l.getAttachment(f,m);for(let y in p){let _=p[y],v=_[0];if(v){if(y=="deform"){let b=g.bones,T=g.vertices,S=b?T.length/3*2:T.length,w=new Q1(_.length,_.length,f,g),E=Z(v,"time",0);for(let A=0,P=0;;A++){let I,C=Z(v,"vertices",null);if(!C)I=b?xt.newFloatArray(S):T;else{I=xt.newFloatArray(S);let M=Z(v,"offset",0);if(xt.arrayCopy(C,0,I,M,C.length),r!=1)for(let O=M,k=O+C.length;O=0;y--)d[y]==-1&&(d[y]=m[--g])}o.setFrame(l,Z(u,"time",0),d)}n.push(o)}if(t.events){let o=new jp(t.events.length),h=0;for(let l=0;l"u"&&(Math.fround=(function(i){return function(t){return i[0]=t,i[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let i=window.require;window.require=t=>{if(i)return i(t);if(t.startsWith("@pixi/"))return window.PIXI}}var zs;let hc=(zs=class extends cF{constructor(e){super(e.resource.source);x(this,"texture");this.texture=Nt.from(e)}static from(e){return zs.textureMap.has(e)?zs.textureMap.get(e):new zs(e)}setFilters(e,s){this.texture.baseTexture.scaleMode=zs.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=zs.toPixiMipMap(e)}setWraps(e,s){this.texture.baseTexture.wrapMode=zs.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case ze.Nearest:case ze.MipMapNearestLinear:case ze.MipMapNearestNearest:return Ns.NEAREST;case ze.Linear:case ze.MipMapLinearLinear:case ze.MipMapLinearNearest:return Ns.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case ze.Nearest:case ze.Linear:return Ms.OFF;case ze.MipMapNearestLinear:case ze.MipMapNearestNearest:case ze.MipMapLinearLinear:case ze.MipMapLinearNearest:return Ms.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case wi.ClampToEdge:return Ps.CLAMP;case wi.MirroredRepeat:return Ps.MIRRORED_REPEAT;case wi.Repeat:return Ps.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case Qi.Normal:return It.NORMAL;case Qi.Additive:return It.ADD;case Qi.Multiply:return It.MULTIPLY;case Qi.Screen:return It.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}},x(zs,"textureMap",new Map),zs);var js;let rk=(js=class extends zn{constructor(){const e=new Zc;e.getBuffer("aVertexPosition").static=!1,e.getBuffer("aTextureCoord").static=!1;const s=new rl(Nt.EMPTY);super(e,s);x(this,"name","");x(this,"warnedTwoTint",!1)}updateFromSpineData(e,s,r,n,a,o,h,l){var y,_;this.texture=e.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((y=u.data)==null?void 0:y.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((_=d.data)==null?void 0:_.length)!==c&&(d.data=new Float32Array(c));let f=0,m=u.data,p=d.data;for(let v=0;vnew rk);x(this,"beforeUpdateWorldTransforms",()=>{});x(this,"afterUpdateWorldTransforms",()=>{});x(this,"_autoUpdate",!1);x(this,"_ticker",ss.shared);x(this,"meshesCache",new Map);x(this,"lightColor",new Dt);x(this,"darkColor",new Dt);x(this,"_boundsProvider");x(this,"_boundsPoint",new Kt);x(this,"_boundsSpineID",-1);x(this,"_boundsSpineDirty",!0);x(this,"slotsObject",new Map);x(this,"verticesCache",xt.newFloatArray(1024));x(this,"clippingSlotToPixiMasks",{});x(this,"currentClippingSlot");const r=e instanceof lc?e:e.skeletonData;this.skeleton=new Kp(r);const n=new lF(r);this.state=new rF(n),(e==null?void 0:e.darkTint)!==void 0||(s==null?void 0:s.slotMeshFactory)===void 0?(this.darkTint=(e==null?void 0:e.darkTint)===void 0?this.skeleton.slots.some(a=>!!a.data.darkColor):e==null?void 0:e.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new Uf)):this.initializeMeshFactory(s==null?void 0:s.slotMeshFactory),e!=null&&e.ticker&&(this._ticker=e.ticker),this.autoUpdate=(e==null?void 0:e.autoUpdate)??!0,this.boundsProvider=e.boundsProvider}get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!e&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=e}get ticker(){return this._ticker}set ticker(e){e=e??ss.shared,this._ticker!==e&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),e.add(this.internalUpdate,this)),this._ticker=e)}get boundsProvider(){return this._boundsProvider}set boundsProvider(e){this._boundsProvider=e,e?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(e){if(e){this.slotMeshFactory=e;const s=this.slotMeshFactory();s instanceof Uf&&(this.darkTint=!0),s.destroy()}else for(let s=0;snew Uf,this.darkTint=!0;break}}update(e){this.internalUpdate(0,e)}internalUpdate(e,s){this.hasNeverUpdated=!1;const r=s??this._ticker.deltaMS/1e3;this.state.update(r),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(r),this.skeleton.updateWorldTransform(qi.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var e;this.renderMeshes(),this.sortChildren(),(e=this.debug)==null||e.renderDebug(this),super.updateTransform()}destroy(e){var s;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,r]of this.meshesCache)r==null||r.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let r in this.clippingSlotToPixiMasks)(s=this.clippingSlotToPixiMasks[r].mask)==null||s.destroy(),delete this.clippingSlotToPixiMasks[r];super.destroy(e)}resetMeshes(){for(const[,e]of this.meshesCache)e.zIndex=-1,e.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(e){return this.meshesCache.has(e)}getMeshForSlot(e){if(this.hasMeshForSlot(e)){let s=this.meshesCache.get(e);return s.visible=!0,s}else{let s=this.slotMeshFactory();return this.addChild(s),this.meshesCache.set(e,s),s}}getSlotFromRef(e){let s;if(typeof e=="number"?s=this.skeleton.slots[e]:typeof e=="string"?s=this.skeleton.findSlot(e):s=e,!s)throw new Error(`No slot found with the given slot reference: ${e}`);return s}addSlotObject(e,s,r){var o;let n=this.getSlotFromRef(e);const a=(o=this.slotsObject.get(n))==null?void 0:o.container;if(!(a&&a===s)){for(const[h,{container:l}]of this.slotsObject)if(h!==n&&l===s){this.removeSlotObject(h,s);break}a&&this.removeChild(a),this.slotsObject.set(n,{container:s,followAttachmentTimeline:(r==null?void 0:r.followAttachmentTimeline)||!1,followSlotColor:(r==null?void 0:r.followSlotColor)||!1}),this.addChild(s)}}getSlotObject(e){const s=this.slotsObject.get(this.getSlotFromRef(e));return s?s.container:void 0}removeSlotObject(e,s){var a;let r=this.getSlotFromRef(e),n=(a=this.slotsObject.get(r))==null?void 0:a.container;n&&(s&&s!==n||(this.removeChild(n),this.slotsObject.delete(r)))}removeSlotObjects(){for(const[,e]of this.slotsObject)e.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(e,s,r){const{container:n,followAttachmentTimeline:a}=e,o=a?!!s.attachment:!0;if(n.visible=this.skeleton.drawOrder.includes(s)&&o,n.visible){let h=s.bone;const l=n.localTransform;l.a=h.a,l.b=h.c,l.c=-h.b,l.d=-h.d,l.tx=h.worldX,l.ty=h.worldY,n.transform.setFromMatrix(l),n.zIndex=r,n.alpha=this.skeleton.color.a*s.color.a,e.followSlotColor&&this.setSlotObjectTint(n,255*this.skeleton.color.r*s.color.r<<16|255*this.skeleton.color.g*s.color.g<<8|255*this.skeleton.color.b*s.color.b)}}setSlotObjectTint(e,s){const r=e;"tint"in r&&(r.tint=s);for(const n of r.children??[])this.setSlotObjectTint(n,s)}updateAndSetPixiMask(e,s){var o,h;const r=e.attachment;if(r&&r instanceof Bo){const l=(o=this.clippingSlotToPixiMasks)[h=e.data.name]||(o[h]={slot:e,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let n=this.currentClippingSlot;const a=this.slotsObject.get(e);if(n&&a){let l=n.mask;if(l||(l=rb.obtain(),n.mask=l,this.addChild(l)),!n.maskComputed){let c=n.slot,u=c.attachment;n.maskComputed=!0;const d=u.worldVerticesLength,f=n.vertices;u.computeWorldVertices(c,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}a.container.mask=l}else a!=null&&a.container.mask&&(a.container.mask=null);if(n&&n.slot.attachment.endSlot==e.data&&(this.currentClippingSlot=void 0),s){for(const l in this.clippingSlotToPixiMasks){const c=this.clippingSlotToPixiMasks[l];(!(c.slot.attachment instanceof Bo)||!c.maskComputed)&&c.mask&&(this.removeChild(c.mask),rb.free(c.mask),c.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var n,a;this.resetMeshes();let e=null,s=null;const r=this.skeleton.drawOrder;for(let o=0,h=r.length,l=0;o>1)*m,_>this.verticesCache.length&&(this.verticesCache=xt.newFloatArray(_)),v.computeWorldVertices(c,0,v.worldVerticesLength,this.verticesCache,0,m),e=v.triangles,s=v.uvs,y=(a=v.region)==null?void 0:a.texture}else if(p instanceof Bo){qt.clipper.clipStart(c,p);continue}else{this.hasMeshForSlot(c)&&(this.getMeshForSlot(c).visible=!1),qt.clipper.clipEndWithSlot(c);continue}if(y!=null){const b=c.bone.skeleton.color,T=c.color,S=b.a*T.a*g.a;this.lightColor.set(b.r*T.r*g.r,b.g*T.g*g.g,b.b*T.b*g.b,S),c.darkColor!=null?this.darkColor.set(c.darkColor.r,c.darkColor.g,c.darkColor.b,1):this.darkColor.set(0,0,0,1);let w,E,A,P;if(qt.clipper.isClipping())qt.clipper.clipTriangles(this.verticesCache,e,e.length,s,this.lightColor,this.darkColor,f),w=qt.clipper.clippedVertices,E=w.length,A=qt.clipper.clippedTriangles,P=A.length;else{const C=this.verticesCache;for(let R=2,F=0,D=_;Rnew gs);Kp.yDown=!0;const fh="spineTextureAtlasLoader",hk={extension:gt.Asset,resolver:{test:i=>Ue(i,".atlas"),parse:i=>{var e,s;const t=i.split(".");return{resolution:parseFloat(((s=(e=_t.RETINA_PREFIX)==null?void 0:e.exec(i))==null?void 0:s[1])??"1"),format:t[t.length-2],src:i}}},loader:{name:fh,extension:{type:gt.LoadParser,priority:Ts.Normal,name:fh},test(i){return Ue(i,".atlas")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${fh}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return await t.text()},testParse(i,t){const e=Ue(t.src,".atlas"),s=typeof i=="string",r=t.loadParser===fh;return Promise.resolve((e||r)&&s)},unload(i){i.dispose()},async parse(i,t,e){var h;const s=t.data||{};let r=ye.dirname(t.src);r&&r.lastIndexOf("/")!==r.length-1&&(r+="/");const n=new dF(i);if(s.images instanceof Lt||typeof s.images=="string"){const l=s.images;s.images={},s.images[n.pages[0].name]=l}const a=[];let o=!0;for(const l of e.parsers)if(l.name=="loadTextures"){o=(h=l.config)==null?void 0:h.preferCreateImageBitmap;break}Cs.setPreferences({preferCreateImageBitmap:!1});for(const l of n.pages){const c=l.name,u=s!=null&&s.images?s.images[c]:void 0;if(u instanceof Lt)l.setTexture(hc.from(u));else{const d=u??ye.normalize([...r.split(ye.sep),c].join(ye.sep)),f={src:sl(d,t.src),data:{...s.imageMetadata,alphaMode:l.pma?Ke.PMA:Ke.UNPACK}},m=e.load(f).then(p=>{l.setTexture(hc.from(p.baseTexture))});a.push(m)}}return await Promise.all(a),Cs.setPreferences({preferCreateImageBitmap:o}),n}}};St.add(hk);const mh="spineSkeletonLoader";function ck(i){return i.hasOwnProperty("bones")}function uk(i){return i instanceof Uint8Array}const dk={extension:gt.Asset,loader:{name:mh,extension:{type:gt.LoadParser,priority:Ts.Normal,name:mh},test(i){return Ue(i,".skel")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${mh}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())},testParse(i,t){const e=Ue(t.src,".json")&&ck(i),s=Ue(t.src,".skel")&&uk(i),r=t.loadParser===mh;return Promise.resolve(e||s||r)}}};St.add(dk);let fk=class extends er{constructor(e=!1){super();x(this,"_buffer");x(this,"_indexBuffer");this._buffer=new ne(void 0,e,!1),this._indexBuffer=new ne(void 0,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,wt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,wt.FLOAT).addAttribute("aColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,wt.FLOAT).addIndex(this._indexBuffer)}};const mk=` precision highp float; attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; attribute vec4 aColor; attribute vec4 aDarkColor; attribute float aTextureId; uniform mat3 projectionMatrix; uniform mat3 translationMatrix; uniform vec4 tint; varying vec2 vTextureCoord; varying vec4 vColor; varying vec4 vDarkColor; varying float vTextureId; void main(void){ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; vTextureId = aTextureId; vColor = aColor * tint; vDarkColor = aDarkColor * tint; } `,pk=` varying vec2 vTextureCoord; varying vec4 vColor; varying vec4 vDarkColor; varying float vTextureId; uniform sampler2D uSamplers[%count%]; void main(void){ vec4 color; %forloop% gl_FragColor.a = color.a * vColor.a; gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; } `;var Vf;let gk=(Vf=class extends li{constructor(t){super(t),this.shaderGenerator=new Np(mk,pk),this.geometryClass=fk,this.vertexSize=7}packInterleavedGeometry(t,e,s,r,n){const{uint32View:a,float32View:o}=e,h=r/this.vertexSize,l=t.uvs,c=t.indices,u=t.vertexData,d=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),m=Wt.shared.setValue(t._tintRGB).toPremultiplied(f,!0),p=Wt.shared.setValue(t._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}toRgb888(){const t=e=>`0${(e*255).toString(16)}`.slice(-2);return+`0x${t(this.r)}${t(this.g)}${t(this.b)}`}static fromString(t,e=new Bs){return e.setFromString(t)}};x(Bs,"WHITE",new Bs(1,1,1,1)),x(Bs,"RED",new Bs(1,0,0,1)),x(Bs,"GREEN",new Bs(0,1,0,1)),x(Bs,"BLUE",new Bs(0,0,1,1)),x(Bs,"MAGENTA",new Bs(1,0,1,1));let Ft=Bs;const Se=class Se{static clamp(t,e,s){return ts?s:t}static cosDeg(t){return Math.cos(t*Se.degRad)}static sinDeg(t){return Math.sin(t*Se.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*Se.radDeg}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){const e=Math.pow(Math.abs(t),.3333333333333333);return t<0?-e:e}static randomTriangular(t,e){return Se.randomTriangularWith(t,e,(t+e)*.5)}static randomTriangularWith(t,e,s){const r=Math.random(),n=e-t;return r<=(s-t)/n?t+Math.sqrt(r*n*(s-t)):e-Math.sqrt((1-r)*n*(e-s))}static isPowerOfTwo(t){return t&&(t&t-1)===0}};x(Se,"epsilon",1e-5),x(Se,"epsilon2",Se.epsilon*Se.epsilon),x(Se,"PI",3.1415927),x(Se,"PI2",Se.PI*2),x(Se,"invPI2",1/Se.PI2),x(Se,"radiansToDegrees",180/Se.PI),x(Se,"radDeg",Se.radiansToDegrees),x(Se,"degreesToRadians",Se.PI/180),x(Se,"degRad",Se.degreesToRadians);let pt=Se;const Gs=class Gs{apply(t,e,s){return e===void 0||s===void 0?this.applyInternal(t):t+(e-t)*this.applyInternal(s)}};x(Gs,"linear",new class extends Gs{applyInternal(t){return t}}),x(Gs,"smooth",new class extends Gs{applyInternal(t){return t*t*(3-2*t)}}),x(Gs,"slowFast",new class extends Gs{applyInternal(t){return t*t}}),x(Gs,"fastSlow",new class extends Gs{applyInternal(t){return(t-1)*(t-1)*-1+1}}),x(Gs,"circle",new class extends Gs{applyInternal(t){return t<=.5?(t*=2,(1-Math.sqrt(1-t*t))/2):(t--,t*=2,(Math.sqrt(1-t*t)+1)/2)}});let en=Gs;class Jp extends en{constructor(e){super();x(this,"power",2);this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class Iw extends Jp{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2===0?-1:1)+1}}const Wi=class Wi{static arrayCopy(t,e,s,r,n){for(let a=e,o=r;a=e?t:Wi.setArraySize(t,e,s)}static newArray(t,e){const s=[];for(let r=0;r0?this.items.pop():this.instantiator()}free(t){var e;(e=t.reset)==null||e.call(t),this.items.push(t)}freeAll(t){for(let e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class Rw{constructor(t=32){x(this,"values");x(this,"addedValues",0);x(this,"lastValue",0);x(this,"mean",0);x(this,"dirty",!0);this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e{c.width=parseInt(s[1]),c.height=parseInt(s[2])},r.format=()=>{},r.filter=c=>{c.minFilter=bt.enumValue(Oe,s[1]),c.magFilter=bt.enumValue(Oe,s[2])},r.repeat=c=>{s[1].indexOf("x")!==-1&&(c.uWrap=xr.Repeat),s[1].indexOf("y")!==-1&&(c.vWrap=xr.Repeat)},r.pma=c=>{c.pma=s[1]==="true"};var n={};n.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},n.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},n.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},n.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},n.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},n.rotate=c=>{const u=s[1];u==="true"?c.degrees=90:u!=="false"&&(c.degrees=parseInt(u))},n.index=c=>{c.index=parseInt(s[1])};let a=e.readLine();for(;a&&a.trim().length===0;)a=e.readLine();for(;!(!a||a.trim().length===0||e.readEntry(s,a)===0);)a=e.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length===0)o=null,a=e.readLine();else if(o){const c=new su(o,a);for(;;){const u=e.readEntry(s,a=e.readLine());if(u===0)break;const d=n[s[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(s[0]);const f=[];for(let m=0;m0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees===90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new tg(a.trim());e.readEntry(s,a=e.readLine())!==0;){const c=r[s[0]];c&&c(o)}this.pages.push(o)}}findRegion(t){for(let e=0;e=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||(e=e.trim(),e.length===0))return 0;const s=e.indexOf(":");if(s===-1)return 0;t[0]=e.substr(0,s).trim();for(let r=1,n=s+1;;r++){const a=e.indexOf(",",n);if(a===-1)return t[r]=e.substr(n).trim(),r;if(t[r]=e.substr(n,a-n).trim(),n=a+1,r===4)return 4}}}class tg{constructor(t){x(this,"name");x(this,"minFilter",Oe.Nearest);x(this,"magFilter",Oe.Nearest);x(this,"uWrap",xr.ClampToEdge);x(this,"vWrap",xr.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(this,"regions",[]);this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(const e of this.regions)e.texture=t}}class su extends Qp{constructor(e,s){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=e,this.name=s,e.regions.push(this)}}const xc=class xc{constructor(t){x(this,"name");x(this,"timelineAttachment");x(this,"timelineSlots",xc.empty);if(!t)throw new Error("name cannot be null.");this.name=t,this.timelineAttachment=this}isTimelineActive(t,e,s){let r=t[e];if(r.bone.isActive()){const n=(s?r.getAppliedPose():r.getPose()).getAttachment();if(n!=null&&n.timelineAttachment===this)return!0}for(let n=0,a=this.timelineSlots.length;n>1)*h;const l=s.appliedPose.deform;let c=this.vertices;const u=this.bones;if(!u){l.length>0&&(c=l);const p=s.bone.appliedPose,g=p.worldX,y=p.worldY,_=p.a,v=p.b,b=p.c,T=p.d;for(let S=r,w=o;w=this.regions.length&&(e=this.regions.length-1),e}getUVs(t){return this.uvs[t]}hasPathSuffix(){return this.pathSuffix}getPath(t,e){if(!this.pathSuffix)return t;let s=t;const r=(this.start+e).toString();for(let n=this.digits-r.length;n>0;n--)s+="0";return s+=r,s}static nextID(){return _a._nextID++}};x(_a,"_nextID",0);let nn=_a;var He;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(He||(He={}));const ru=[He.hold,He.once,He.loop,He.pingpong,He.onceReverse,He.loopReverse,He.pingpongReverse];class Pl{constructor(t,e,s){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds");x(this,"bones");x(this,"color",new Ft(1,1,1,1));x(this,"duration");if(!t)throw new Error("name cannot be null.");this.name=t,this.duration=s,this.timelineIds=new Zp,this.bones=[],this.setTimelines(e)}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t;const e=t.length;this.timelineIds.clear(),this.bones.length=0;const s=new Set,r=t;for(let n=0;n0&&(e%=this.duration));const u=this.timelines;for(let d=0,f=u.length;de)return n-s;return r-s}}function eg(i){return typeof i=="object"&&i!==null&&typeof i.slotIndex=="number"}class Fi extends ce{constructor(e,s,...r){super(e,...r);x(this,"curves");this.curves=bt.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){const s=this.getFrameCount()+e*18;if(this.curves.length>s){const r=bt.newFloatArray(s);bt.arrayCopy(this.curves,0,r,0,s),this.curves=r}}setBezier(e,s,r,n,a,o,h,l,c,u,d){const f=this.curves;let m=this.getFrameCount()+e*18;r===0&&(f[s]=2+m);const p=(n-o*2+l)*.03,g=(a-h*2+c)*.03,y=((o-l)*3-n+u)*.006,_=((h-c)*3-a+d)*.006;let v=p*2+y,b=g*2+_,T=(o-n)*.3+p+y*.16666667,S=(h-a)*.3+g+_*.16666667,w=n+T,E=a+S;for(let A=m+18;me){const c=this.frames[s],u=this.frames[s+r];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}const o=n+18;for(n+=2;n=e){const c=a[n-2],u=a[n-1];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}s+=this.getFrameEntries();const h=a[o-2],l=a[o-1];return l+(e-h)/(this.frames[s]-h)*(this.frames[s+r]-l)}}class dr extends Fi{constructor(t,e,s){super(t,e,s)}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){const e=this.frames;let s=e.length-2;for(let n=2;n<=s;n+=2)if(e[n]>t){s=n-2;break}const r=this.curves[s>>1];switch(r){case 0:{const n=e[s],a=e[s+1];return a+(t-n)/(e[s+2]-n)*(e[s+2+1]-a)}case 1:return e[s+1]}return this.getBezierValue(t,s,1,r-2)}getRelativeValue(t,e,s,r,n,a){if(t>2];switch(f){case 0:{const m=u[d];h=u[d+1],l=u[d+2],c=u[d+3];const p=(s-m)/(u[d+4]-m);h+=(u[d+4+1]-h)*p,l+=(u[d+4+2]-l)*p,c+=(u[d+4+3]-c)*p;break}case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(s,d,1,f-2),l=this.getBezierValue(s,d,2,f+18-2),c=this.getBezierValue(s,d,3,f+36-2)}if(r!==1)if(n===At.setup){const m=t.data.setupPose.color;h=m.r+(h-m.r)*r,l=m.g+(l-m.g)*r,c=m.b+(c-m.b)*r}else h=o.r+(h-o.r)*r,l=o.g+(l-o.g)*r,c=o.b+(c-o.b)*r;o.r=h<0?0:h>1?1:h,o.g=l<0?0:l>1?1:l,o.b=c<0?0:c>1?1:c}}class gu extends dr{constructor(e,s,r){super(e,s,`${Bt.alpha}|${r}`);x(this,"slotIndex",0);this.slotIndex=r}apply(e,s,r,n,a,o,h,l,c){const u=e.slots[this.slotIndex];if(!u.bone.active)return;const d=(c?u.appliedPose:u.pose).color;let f=0;const m=this.frames;if(r1?1:f}}class yu extends so{constructor(t,e,s){super(t,e,s,`${Bt.rgb}|${s}`,`${Bt.alpha}|${s}`,`${Bt.rgb2}|${s}`)}getFrameEntries(){return 8}setFrame(t,e,s,r,n,a,o,h,l){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=n,this.frames[t+4]=a,this.frames[t+5]=o,this.frames[t+6]=h,this.frames[t+7]=l}apply1(t,e,s,r,n,a){const o=e.color,h=e.darkColor;let l=0,c=0,u=0;const d=this.frames;if(s>3];switch(_){case 0:{const v=d[y];f=d[y+1],m=d[y+2],p=d[y+3],g=d[y+4],l=d[y+5],c=d[y+6],u=d[y+7];const b=(s-v)/(d[y+8]-v);f+=(d[y+8+1]-f)*b,m+=(d[y+8+2]-m)*b,p+=(d[y+8+3]-p)*b,g+=(d[y+8+4]-g)*b,l+=(d[y+8+5]-l)*b,c+=(d[y+8+6]-c)*b,u+=(d[y+8+7]-u)*b;break}case 1:f=d[y+1],m=d[y+2],p=d[y+3],g=d[y+4],l=d[y+5],c=d[y+6],u=d[y+7];break;default:f=this.getBezierValue(s,y,1,_-2),m=this.getBezierValue(s,y,2,_+18-2),p=this.getBezierValue(s,y,3,_+36-2),g=this.getBezierValue(s,y,4,_+54-2),l=this.getBezierValue(s,y,5,_+72-2),c=this.getBezierValue(s,y,6,_+90-2),u=this.getBezierValue(s,y,7,_+108-2)}if(r===1)o.set(f,m,p,g);else if(n===At.setup){const v=t.data.setupPose;let b=v.color;o.set(b.r+(f-b.r)*r,b.g+(m-b.g)*r,b.b+(p-b.b)*r,b.a+(g-b.a)*r),b=v.darkColor,l=b.r+(l-b.r)*r,c=b.g+(c-b.g)*r,u=b.b+(u-b.b)*r}else o.add((f-o.r)*r,(m-o.g)*r,(p-o.b)*r,(g-o.a)*r),l=h.r+(l-h.r)*r,c=h.g+(c-h.g)*r,u=h.b+(u-h.b)*r;h.r=l<0?0:l>1?1:l,h.g=c<0?0:c>1?1:c,h.b=u<0?0:u>1?1:u}}class xu extends so{constructor(t,e,s){super(t,e,s,`${Bt.rgb}|${s}`,`${Bt.rgb2}|${s}`)}getFrameEntries(){return 7}setFrame(t,e,s,r,n,a,o,h){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=n,this.frames[t+4]=a,this.frames[t+5]=o,this.frames[t+6]=h}apply1(t,e,s,r,n,a){const o=e.color,h=e.darkColor;let l=0,c=0,u=0,d=0,f=0,m=0;const p=this.frames;if(s1?1:l,o.g=c<0?0:c>1?1:c,o.b=u<0?0:u>1?1:u,h.r=d<0?0:d>1?1:d,h.g=f<0?0:f>1?1:f,h.b=m<0?0:m>1?1:m}}class Yn extends ce{constructor(e,s){super(e,`${Bt.attachment}|${s}`);x(this,"slotIndex",0);x(this,"attachmentNames");this.slotIndex=s,this.attachmentNames=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.attachmentNames[e]=r}apply(e,s,r,n,a,o,h,l,c){const u=e.slots[this.slotIndex];if(!u.bone.active)return;const d=c?u.appliedPose:u.pose;l||re){const l=this.frames[s];return r[n+1]*(e-l)/(r[n]-l)}const a=n+18;for(n+=2;n=e){const l=r[n-2],c=r[n-1];return c+(e-l)/(r[n]-l)*(r[n+1]-c)}const o=r[a-2],h=r[a-1];return h+(1-h)*(e-o)/(this.frames[s+this.getFrameEntries()]-o)}apply(e,s,r,n,a,o,h,l,c){const u=e.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,c))return;const d=this.attachment.timelineSlots,f=this.frames;if(r=f[f.length-1])g=0,m=this.vertices[f.length-1],p=null;else{const _=ce.search(f,r);g=this.getCurvePercent(r,_),m=this.vertices[_],p=this.vertices[_+1]}const y=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],c,m,p,g,y,a,o,h);for(const _ of d)this.applyToSlot(u[_],c,m,p,g,y,a,o,h)}applyBeforeFirst(e,s,r,n){if(!e.bone.active)return;const a=s?e.appliedPose:e.pose;if(a.attachment==null||a.attachment.timelineAttachment!==this.attachment)return;const o=a.deform;switch(o.length===0&&(n=At.setup),n){case At.setup:o.length=0;break;case At.first:{if(r===1){o.length=0;return}const h=this.vertices[0].length;o.length=h;const l=o,c=a.attachment;if(c.bones===null){const u=c.vertices;for(let d=0;d>4,c=h.attachment.sequence.regions.length;const u=ru[a&15];if(u!==He.hold)switch(l+=(r-n)/o+1e-5|0,u){case He.once:l=Math.min(c-1,l);break;case He.loop:l%=c;break;case He.pingpong:{const d=(c<<1)-2;l=d===0?0:l%d,l>=c&&(l=d-l);break}case He.onceReverse:l=Math.max(c-1-l,0);break;case He.loopReverse:l=c-1-l%c;break;case He.pingpongReverse:{const d=(c<<1)-2;l=d===0?0:(l+c-1)%d,l>=c&&(l=d-l)}}h.sequenceIndex=l}};x($s,"ENTRIES",3),x($s,"MODE",1),x($s,"DELAY",2);let za=$s;const vc=class vc extends ce{constructor(e){super(e,...vc.propertyIds);x(this,"events");this.events=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s.time,this.events[e]=s}apply(e,s,r,n,a,o,h,l,c){if(!n)return;const u=this.frames,d=this.frames.length;if(s>r)this.apply(null,s,Number.MAX_VALUE,n,0,o,!1,!1,!1),s=-1;else if(s>=u[d-1])return;if(r0&&u[f-1]===m;)f--}for(;f=u[f];f++)n.push(this.events[f])}};x(vc,"propertyIds",[`${Bt.event}`]);let jn=vc;const wa=class wa extends ce{constructor(e){super(e,...wa.propertyIds);x(this,"drawOrders");this.drawOrders=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.drawOrders[e]=r}apply(e,s,r,n,a,o,h,l,c){const u=c?e.drawOrder.appliedPose:e.drawOrder.pose,d=e.slots;if(l||r>2];switch(_){case 0:{const b=f[y];m=f[y+1],p=f[y+2],g=f[y+3];const T=(r-b)/(f[y+4]-b);m+=(f[y+4+1]-m)*T,p+=(f[y+4+2]-p)*T,g+=(f[y+4+3]-g)*T;break}case 1:m=f[y+1],p=f[y+2],g=f[y+3];break;default:m=this.getBezierValue(r,y,1,_-2),p=this.getBezierValue(r,y,2,_+18-2),g=this.getBezierValue(r,y,3,_+36-2)}const v=o===At.setup?u.data.setupPose:d;h?(d.mixRotate=v.mixRotate+m*a,d.mixX=v.mixX+p*a,d.mixY=v.mixY+g*a):(d.mixRotate=v.mixRotate+(m-v.mixRotate)*a,d.mixX=v.mixX+(p-v.mixX)*a,d.mixY=v.mixY+(g-v.mixY)*a)}}class Kr extends Qn{constructor(t,e,s,r){super(t,e,s,r)}apply(t,e,s,r,n,a,o,h,l){if(o&&!this.additive&&(o=!1),this.constraintIndex===-1){const c=s>=this.frames[0]?this.getCurveValue(s):0,u=t.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=l?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(s,n,a,o,this.get(f),this.get(d.data.setupPose),c))}}else{const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;this.set(u,this.getAbsoluteValue(s,n,a,o,this.get(u),this.get(c.data.setupPose)))}}}}class Eu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintInertia)}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}}class Au extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintStrength)}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}}class Cu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintDamping)}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}}class Iu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintMass)}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}}class Pu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintWind),this.additive=!0}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}}class Mu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintGravity),this.additive=!0}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}}class Ru extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintMix)}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}}const _c=class _c extends ce{constructor(e,s){super(e,..._c.propertyIds);x(this,"constraintIndex");this.constraintIndex=s,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s}apply(e,s,r,n,a,o,h,l,c){let u;if(this.constraintIndex!==-1&&(u=e.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(s>r)this.apply(e,s,Number.MAX_VALUE,[],a,o,!1,!1,!1),s=-1;else if(s>=d[d.length-1])return;if(!(r=d[ce.search(d,s)+1]))if(u!=null)u.reset(e);else for(const f of e.physics)f.active&&f.reset(e)}};x(_c,"propertyIds",[Bt.physicsConstraintReset.toString()]);let ja=_c;class Fu extends Qn{constructor(t,e,s){super(t,e,s,Bt.sliderTime)}apply(t,e,s,r,n,a,o,h,l){const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.time=this.getAbsoluteValue(s,n,a,o,u.time,c.data.setupPose.time)}}}class ku extends Qn{constructor(t,e,s){super(t,e,s,Bt.sliderMix),this.additive=!0}apply(t,e,s,r,n,a,o,h,l){const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.mix=this.getAbsoluteValue(s,n,a,o,u.mix,c.data.setupPose.mix)}}}const Do=class Do{constructor(t){x(this,"data");x(this,"tracks",[]);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",[]);x(this,"listeners",[]);x(this,"queue",new ng(this));x(this,"propertyIds",new Map);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new $a(()=>new ig));this.data=t}update(t){t*=this.timeScale;const e=this.tracks;for(let s=0,r=e.length;s0){if(n.delay-=a,n.delay>0)continue;a=-n.delay,n.delay=0}let o=n.next;if(o){const h=n.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=n.timeScale===0?0:(h/n.timeScale+t)*o.timeScale,n.trackTime+=a,this.setTrack(s,o,!0);o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){e[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,t)){let h=n.mixingFrom;for(n.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}n.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){const s=t.mixingFrom;if(!s)return!0;const r=this.updateMixingFrom(s,e);if(s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.nextTrackLast!==-1&&t.mixTime>=t.mixDuration){if(s.totalAlpha===0||t.mixDuration===0){if(t.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=t),s.totalAlpha===0)for(let n=t;n.mixingTo!=null;n=n.mixingTo)n.keepHold=!0;this.queue.end(s)}return r}return s.trackTime+=e*s.timeScale,t.mixTime+=e,!1}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const e=this.events,s=this.tracks;let r=!1;for(let o=0,h=s.length;o0)continue;r=!0;let c=l.alpha;l.mixingFrom?c*=this.applyMixingFrom(l,t):l.trackTime>=l.trackEnd&&!l.next&&(c=0);let u=l.animationLast,d=l.getAnimationTime(),f=d,m=e;l.reverse&&(f=l.animation.duration-f,m=null);const p=l.animation.timelines,g=p.length;if(o===0&&c===1)for(let y=0;y=l.alphaAttachmentThreshold,v=l.additive,b=v||l.shortestRotation,T=!b&&l.timelinesRotation.length!==g<<1;T&&(l.timelinesRotation.length=g<<1);for(let S=0;S0?h/o:a,c=s.animation.timelines,u=c.length,d=s.timelineMode,f=s.timelineHoldMix,m=n=s.alphaAttachmentThreshold);else{const R=!p||!(A instanceof Wr)||I===At.current;A.apply(e,b,S,w,C,I,g,R,!1)}}return s.reverse&&n0&&this.queueEvents(s,T),this.events.length=0,s.nextAnimationLast=T,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,s,r,n){const a=e.slots[t.slotIndex];if(!a.bone.active||!n&&a.attachmentState===this.unkeyedState+mc)return;let o=s=0,T=y>=0;Math.abs(_)<=90&&pt.signum(_)!==pt.signum(g)&&(Math.abs(y-v)>180?(p+=360*pt.signum(y),T=b):v!==0?p-=360*pt.signum(y):T=b),T!==b&&(p+=360*pt.signum(y)),a[o]=p}a[o+1]=g,c.rotation=f+p*r}queueEvents(t,e){const s=t.animationStart,r=t.animationEnd,n=r-s,a=t.reverse;let o=t.trackLast%n;a&&(o=n-o);const h=this.events;let l=0,c=h.length;for(;l=s&&d.time<=r&&this.queue.event(t,d)}let u=!1;if(t.loop)if(n===0)u=!0;else{const d=Math.floor(t.trackTime/n);u=d>0&&d>Math.floor(t.trackLast/n)}else u=e>=r&&t.animationLast=s&&d.time<=r&&this.queue.event(t,d)}}eventsReverse(t,e,s){const r=t.animation.duration,n=r-e,a=r-s,o=t.animation.timelines;for(let h=0,l=t.animation.timelines.length;h=a){for(let m=0;m=n)break;this.events.push(u[m])}}else{for(let p=0;p=n);p++)this.events.push(u[p]);let m=0;for(;m=a);m++);for(;m= 0.");if(t>=this.tracks.length)return;const e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){const r=s.mixingFrom;if(!r)break;this.queue.end(r),s.mixingFrom=null,s.mixingTo=null,s=r}this.tracks[e.trackIndex]=null,this.queue.drain()}setTrack(t,e,s){const r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(r.next=null,s&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){return typeof e=="string"?this.setAnimation1(t,e,s):this.setAnimation2(t,e,s)}setAnimation1(t,e,s=!1){const r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error(`Animation not found: ${e}`);return this.setAnimation2(t,r,s)}setAnimation2(t,e,s=!1){if(t<0)throw new Error("trackIndex must be >= 0.");if(!e)throw new Error("animation cannot be null.");let r=!0,n=this.expandToIndex(t);n&&(n.nextTrackLast===-1&&n.animation===e?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,r=!1):this.clearNext(n));const a=this.trackEntry(t,e,s,n);return this.setTrack(t,a,r),this.queue.drain(),a}addAnimation(t,e,s=!1,r=0){return typeof e=="string"?this.addAnimation1(t,e,s,r):this.addAnimation2(t,e,s,r)}addAnimation1(t,e,s=!1,r=0){const n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error(`Animation not found: ${e}`);return this.addAnimation2(t,n,s,r)}addAnimation2(t,e,s=!1,r=0){if(t<0)throw new Error("trackIndex must be >= 0.");if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;const a=this.trackEntry(t,e,s,n);return n?(n.next=a,a.previous=n,r<=0&&(r=Math.max(r+n.getTrackComplete()-a.mixDuration,0))):(this.setTrack(t,a,!0),this.queue.drain(),r<0&&(r=0)),a.delay=r,a}setEmptyAnimation(t,e=0){const s=this.setAnimation(t,Do.emptyAnimation,!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){const r=this.addAnimation(t,Do.emptyAnimation,!1,s);return s<=0&&(r.delay=Math.max(r.delay+r.mixDuration-e,0)),r.mixDuration=e,r.trackEnd=e,r}setEmptyAnimations(t=0){const e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s0&&(a[d]=y);break}}h&&(g=g&~va|n[d]&va),n[d]=g}}from(t,e,s){const r=this.propertyIds;let n=ag;for(let a=0,o=s.length;a= 0.");return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};x(Do,"emptyAnimation",new Pl("",[],0));let qa=Do;class ig{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"additive",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"keepHold",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"mixDuration",0);x(this,"totalAlpha",0);x(this,"mixInterpolation",en.linear);x(this,"timelineMode",[]);x(this,"timelineHoldMix",[]);x(this,"timelinesRotation",[])}setMixDuration(t,e){this.mixDuration=t,e!==void 0&&(e<=0&&(e=this.previous==null?0:Math.max(e+this.previous.getTrackComplete()-t,0)),this.delay=e)}setMixInterpolation(t){if(!t)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=t}mix(){if(this.mixDuration===0)return 1;let t=this.mixTime/this.mixDuration;return t>=1?1:this.mixInterpolation===en.linear?t:(t=this.mixInterpolation.apply(t),t<0?0:t>1?1:t)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=en.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const t=this.animationEnd-this.animationStart;return t===0?this.animationStart:this.trackTime%t+this.animationStart}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const t=this.animationEnd-this.animationStart;if(t!==0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime=0}}class ng{constructor(t){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=t}start(t){this.objects.push(ns.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(ns.interrupt),this.objects.push(t)}end(t){this.objects.push(ns.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(ns.dispose),this.objects.push(t)}complete(t){this.objects.push(ns.complete),this.objects.push(t)}event(t,e){this.objects.push(ns.event),this.objects.push(t),this.objects.push(e)}drain(){var t,e,s,r,n,a;if(!this.drainDisabled){this.drainDisabled=!0;for(let o=0;o{const r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):e(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},s=()=>{}){t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((r,n)=>{this.downloader.downloadBinary(t,a=>{this.success(e,t,a),r(a)},(a,o)=>{const h=`Couldn't load binary ${t}: status ${a}, ${o}`;this.error(s,t,h),n(h)})}))}loadText(t,e=()=>{},s=()=>{}){t=this.start(t),this.downloader.downloadText(t,r=>{this.success(e,t,r)},(r,n)=>{this.error(s,t,`Couldn't load text ${t}: status ${r}, ${n}`)})}loadJson(t,e=()=>{},s=()=>{}){t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((r,n)=>{this.downloader.downloadJson(t,a=>{this.success(e,t,a),r(a)},(a,o)=>{const h=`Couldn't load JSON ${t}: status ${a}, ${o}`;this.error(s,t,h),n(h)})}))}reuseAssets(t,e=()=>{},s=()=>{}){const r=this.cache.getAsset(t),n=r!==void 0;return n&&(this.cache.assetsLoaded[t]=r.then(a=>(a=a instanceof Image||a instanceof ImageBitmap?this.textureLoader(a):a,this.success(e,t,a),a)).catch(a=>{this.error(s,t,a)})),n}loadTexture(t,e=()=>{},s=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,s))return;const r=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((n,a)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(l=>{if(l.ok)return l.blob();const c=`Couldn't load image: ${t}`;this.error(s,t,`Couldn't load image: ${t}`),a(c)}).then(l=>l?createImageBitmap(l,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(l=>{if(l){const c=this.createTexture(t,r,l);this.success(e,t,c),n(c)}});else{const l=new Image;l.crossOrigin="anonymous",l.onload=()=>{const c=this.createTexture(t,r,l);this.success(e,t,c),n(c)},l.onerror=()=>{const c=`Couldn't load image: ${t}`;this.error(s,t,c),a(c)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),l.src=t}})}loadTextureAtlas(t,e=()=>{},s=()=>{},r){const n=t.lastIndexOf("/"),a=n>=0?t.substring(0,n+1):"";t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((o,h)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,a,t,r);let u=c.pages.length,d=!1;if(u===0){this.success(e,t,c),o(c);return}for(const f of c.pages)this.loadTexture(this.texturePath(a,f.name,r),(m,p)=>{d||(f.setTexture(p),--u===0&&(this.success(e,t,c),o(c)))},(m,p)=>{if(!d){const g=`Couldn't load texture ${t} page image: ${m}`;this.error(s,t,g),h(g)}d=!0})}catch(c){const u=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(s,t,u),h(u)}},(l,c)=>{const u=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(s,t,u),h(u)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},s=()=>{}){const r=t.lastIndexOf("/"),n=r>=0?t.substring(0,r+1):"";t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((a,o)=>{this.downloader.downloadText(t,h=>{try{const l=this.createTextureAtlas(h,n,t);this.success(e,t,l),a(l)}catch(l){const c=`Couldn't parse texture atlas ${t}: ${l.message}`;this.error(s,t,c),o(c)}},(h,l)=>{const c=`Couldn't load texture atlas ${t}: status ${h}, ${l}`;this.error(s,t,c),o(c)})}))}async loadBinaryAsync(t){return new Promise((e,s)=>{this.loadBinary(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadJsonAsync(t){return new Promise((e,s)=>{this.loadJson(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadTextureAsync(t){return new Promise((e,s)=>{this.loadTexture(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadTextureAtlasAsync(t){return new Promise((e,s)=>{this.loadTextureAtlas(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,s)=>{this.loadTextureAtlasButNoTextures(t,(r,n)=>e(n),(r,n)=>s(n))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const s=this.errors[t];throw Error(`Asset not found: ${t}${s?` ${s}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof nl){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,s,r){const n=new nl(t);n.dispose=()=>{var a;if(!(this.cache.assetsRefCount[s]<=0)){this.disposeAssetInternal(s);for(const o of n.pages)(a=o.texture)==null||a.dispose()}};for(const a of n.pages){const o=this.texturePath(e,a.name,r);this.texturePmaInfo[this.pathPrefix+o]=a.pma}return n}createTexture(t,e,s){const r=this.textureLoader(s,e),n=r.dispose.bind(r);return r.dispose=()=>{this.disposeAssetInternal(t)&&n()},r}texturePath(t,e,s){return s?s[e]:t+e}}const Ta=class Ta{constructor(){x(this,"assets",{});x(this,"assetsRefCount",{});x(this,"assetsLoaded",{})}static getCache(t){const e=Ta.AVAILABLE_CACHES.get(t);if(e)return e;const s=new Ta;return Ta.AVAILABLE_CACHES.set(t,s),s}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};x(Ta,"AVAILABLE_CACHES",new Map);let al=Ta;class lg{constructor(){x(this,"callbacks",{});x(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),s=e.length,r=new Uint8Array(s);for(let n=0;n{this.finish(t,n.status,n.responseText)};n.onload=a,n.onerror=a,n.send()}downloadJson(t,e,s){this.downloadText(t,r=>{e(JSON.parse(r))},s)}downloadBinary(t,e,s){if(this.start(t,e,s))return;const r=this.rawDataUris[t];if(r&&!r.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(r))}catch(o){this.finish(t,400,JSON.stringify(o))}return}const n=new XMLHttpRequest;n.open("GET",r||t,!0),n.responseType="arraybuffer";const a=()=>{this.finish(t,n.status,n.response)};n.onload=()=>{n.status===200||n.status===0?this.finish(t,200,new Uint8Array(n.response)):a()},n.onerror=a,n.send()}start(t,e,s){let r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,s)}}finish(t,e,s){const r=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let n=0,a=r.length;n= 0.");if(!s)throw new Error("name cannot be null.");this.index=e,this.parent=r}copy(e){const s=new io(this.index,this.name,e);return s.length=this.length,s.setupPose.set(this.setupPose),s}}var be;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(be||(be={}));class ol{constructor(){x(this,"bone");x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"inherit",be.Normal);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"world",0);x(this,"local",0)}set(t){if(t==null)throw new Error("pose cannot be null.");this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}setPosition(t,e){this.x=t,this.y=e}setScale(t,e){this.scaleX=t,this.scaleY=e===void 0?t:e}getInherit(){return this.inherit}setInherit(t){if(t==null)throw new Error("inherit cannot be null.");this.inherit=t}update(t,e){this.world!==t._update&&this.updateWorldTransform(t)}updateWorldTransform(t){this.local===t._update?this.updateLocalTransform(t):this.world=t._update;const e=this.rotation,s=this.scaleX,r=this.scaleY,n=this.shearX,a=this.shearY;if(!this.bone.parent){const d=t.scaleX,f=t.scaleY,m=(e+n)*pt.degRad,p=(e+90+a)*pt.degRad;this.a=Math.cos(m)*s*d,this.b=Math.cos(p)*r*d,this.c=Math.sin(m)*s*f,this.d=Math.sin(p)*r*f,this.worldX=this.x*d+t.x,this.worldY=this.y*f+t.y;return}const o=this.bone.parent.appliedPose;let h=o.a,l=o.b,c=o.c,u=o.d;switch(this.worldX=h*this.x+l*this.y+o.worldX,this.worldY=c*this.x+u*this.y+o.worldY,this.inherit){case be.Normal:{const d=(e+n)*pt.degRad,f=(e+90+a)*pt.degRad,m=Math.cos(d)*s,p=Math.cos(f)*r,g=Math.sin(d)*s,y=Math.sin(f)*r;this.a=h*m+l*g,this.b=h*p+l*y,this.c=c*m+u*g,this.d=c*p+u*y;return}case be.OnlyTranslation:{const d=t.scaleX,f=t.scaleY,m=(e+n)*pt.degRad,p=(e+90+a)*pt.degRad;this.a=Math.cos(m)*s*d,this.b=Math.cos(p)*r*d,this.c=Math.sin(m)*s*f,this.d=Math.sin(p)*r*f;break}case be.NoRotationOrReflection:{const d=t.scaleX,f=t.scaleY,m=1/d,p=1/f;h*=m,c*=p;let g=h*h+c*c,y=0;g>pt.epsilon2?(g=Math.abs(h*u*p-l*m*c)/g,l=c*g,u=h*g,y=e-pt.atan2Deg(c,h)):(h=0,c=0,y=e-90+pt.atan2Deg(u,l));const _=(y+n)*pt.degRad,v=(y+a+90)*pt.degRad,b=Math.cos(_)*s,T=Math.cos(v)*r,S=Math.sin(_)*s,w=Math.sin(v)*r;this.a=(h*b-l*S)*d,this.b=(h*T-l*w)*d,this.c=(c*b+u*S)*f,this.d=(c*T+u*w)*f;break}case be.NoScale:case be.NoScaleOrReflection:{const d=t.scaleX,f=t.scaleY,m=1/d,p=1/f,g=e*pt.degRad,y=Math.cos(g),_=Math.sin(g);let v=(h*y+l*_)*m,b=(c*y+u*_)*p;const T=1/Math.sqrt(v*v+b*b);v*=T,b*=T;let S=-b,w=v;this.inherit===be.NoScale&&h*u-l*c<0!=(d<0!=f<0)&&(S=-S,w=-w);const E=n*pt.degRad,A=(90+a)*pt.degRad,P=Math.cos(E)*s,I=Math.cos(A)*r,C=Math.sin(E)*s,R=Math.sin(A)*r;this.a=(v*P+S*C)*d,this.b=(v*I+S*R)*d,this.c=(b*P+w*C)*f,this.d=(b*I+w*R)*f;break}}}updateLocalTransform(t){this.local=0,this.world=t._update;const e=t.scaleX,s=t.scaleY;if(!this.bone.parent){const y=1/e,_=1/s;this.x=(this.worldX-t.x)*y,this.y=(this.worldY-t.y)*_,this.set5(this.a*y,this.b*y,this.c*_,this.d*_,0);return}const r=this.bone.parent.appliedPose;let n=r.a,a=r.b,o=r.c,h=r.d;const l=n*h-a*o,c=1/(n*h-a*o),u=h*c,d=a*c,f=o*c,m=n*c,p=this.worldX-r.worldX,g=this.worldY-r.worldY;switch(this.x=p*u-g*d,this.y=g*m-p*f,this.inherit){case be.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,m*this.c-f*this.a,m*this.d-f*this.b,0);break;case be.OnlyTranslation:{const y=1/e,_=1/s;this.set5(this.a*y,this.b*y,this.c*_,this.d*_,0);break}case be.NoRotationOrReflection:{const y=1/e,_=1/s;n*=y,o*=_;const v=this.a*y,b=this.b*y,T=this.c*_,S=this.d*_,w=1/(n*n+o*o),E=1/Math.abs(l*y*_);this.set5((n*v+o*T)*w,(n*b+o*S)*w,(n*T-o*v)*E,(n*S-o*b)*E,pt.atan2Deg(o,n));break}case be.NoScale:case be.NoScaleOrReflection:{const y=1/e,_=1/s,v=this.a*y,b=this.b*y,T=this.c*_,S=this.d*_;let w=h*this.a-a*this.c,E=n*this.c-o*this.a;l<0&&(w=-w,E=-E);let A=pt.atan2Deg(E,w);this.rotation=A,A*=pt.degRad;const P=Math.cos(A),I=Math.sin(A);let C=(n*P+a*I)*y,R=(o*P+h*I)*_;const F=1/Math.sqrt(C*C+R*R);C*=F,R*=F;const D=this.inherit===be.NoScale&&l<0!=(e<0!=s<0)?-1:1;this.set4(C*v+R*T,C*b+R*S,(C*T-R*v)*D,(C*S-R*b)*D)}}}set4(t,e,s,r){const n=t*t+s*s,a=e*e+r*r;n>pt.epsilon2?(this.shearX=pt.atan2Deg(s,t),this.scaleX=Math.sqrt(n)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(a),a>pt.epsilon2?(this.shearY=pt.atan2Deg(r,e),t*r-e*s<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(t,e,s,r,n){this.shearX=0;const a=t*t+s*s,o=e*e+r*r;if(a>pt.epsilon2){const h=pt.atan2Deg(s,t);this.rotation=h+n,this.scaleX=Math.sqrt(a),this.scaleY=Math.sqrt(o),o>pt.epsilon2?(this.shearY=pt.atan2Deg(r,e),t*r-e*s<0?(this.scaleY=-this.scaleY,this.shearY+=90-h):this.shearY-=90+h,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(o),this.shearY=0,this.rotation=o>pt.epsilon2?pt.atan2Deg(r,e)-90+n:n}validateLocalTransform(t){this.local===t._update&&this.updateLocalTransform(t)}modifyLocal(t){this.local===t._update&&this.updateLocalTransform(t),this.world=0,this.resetWorld(t,t._update)}modifyWorld(t){const e=t._update;this.local=e,this.world=e,this.resetWorld(t,e)}resetWorld(t,e){const s=this.bone.children;for(let r=0,n=s.length;r1&&e.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(e,s,r,n,a,o,h,l,c,u){typeof r=="number"?Ur.apply1(e,s,r,n,a,o,h,l):Ur.apply2(e,s,r,n,a,o,h,l,c,u)}static apply1(e,s,r,n,a,o,h,l){s.modifyLocal(e);const c=s.bone.parent.appliedPose;let u=c.a,d=c.b,f=c.c,m=c.d,p=-s.shearX-s.rotation,g=0,y=0;switch(s.inherit){case be.OnlyTranslation:g=(r-s.worldX)*pt.signum(e.scaleX),y=(n-s.worldY)*pt.signum(e.scaleY);break;case be.NoRotationOrReflection:{const _=Math.abs(u*m-d*f)/Math.max(pt.epsilon,u*u+f*f),v=u/e.scaleX,b=f/e.scaleY;d=-b*_*e.scaleX,m=v*_*e.scaleY,p+=pt.atan2Deg(b,v)}default:{const _=r-c.worldX,v=n-c.worldY,b=u*m-d*f;Math.abs(b)<=pt.epsilon?(g=0,y=0):(g=(_*m-v*d)/b-s.x,y=(v*u-_*f)/b-s.y)}}if(p+=pt.atan2Deg(y,g),s.scaleX<0&&(p+=180),p>180?p-=360:p<=-180&&(p+=360),s.rotation+=p*l,a||o){switch(s.inherit){case be.NoScale:case be.NoScaleOrReflection:g=r-s.worldX,y=n-s.worldY}const _=s.bone.data.length*s.scaleX;if(_>pt.epsilon){const v=g*g+y*y;if(a&&v<_*_||o&&v>_*_){const b=(Math.sqrt(v)/_-1)*l+1;switch(s.scaleX*=b,h){case es.Uniform:s.scaleY*=b;break;case es.Volume:s.scaleY/=b<.7?.25+.642857*b:b}}}}}static apply2(e,s,r,n,a,o,h,l,c,u){if(s.inherit!==be.Normal||r.inherit!==be.Normal)return;s.modifyLocal(e),r.modifyLocal(e);let d=s.x,f=s.y,m=s.scaleX,p=s.scaleY,g=r.scaleX,y=0,_=0,v=0;m<0?(m=-m,y=180,v=-1):(y=0,v=1),p<0&&(p=-p,v=-v),g<0?(g=-g,_=180):_=0;let b=0,T=0,S=s.a,w=s.b,E=s.c,A=s.d;const P=Math.abs(m-p)<=pt.epsilon;!P||h?(r.y=0,b=S*r.x+s.worldX,T=E*r.x+s.worldY):(b=S*r.x+w*r.y+s.worldX,T=E*r.x+A*r.y+s.worldY);const I=s.bone.parent.appliedPose;S=I.a,w=I.b,E=I.c,A=I.d;let C=S*A-w*E,R=b-I.worldX,F=T-I.worldY;C=Math.abs(C)<=pt.epsilon?0:1/C;const D=(R*A-F*w)*C-d,M=(F*S-R*E)*C-f;let O=Math.sqrt(D*D+M*M),k=r.bone.data.length*g,N,B;if(O0){let et=Math.min(1,at/(c*2))-1;et=(at-c*(1-et*et))/H,L-=et*L,G-=et*G,V=L*L+G*G}}t:if(P){k*=m;let H=(V-O*O-k*k)/(2*O*k);if(H<-1)H=-1,B=Math.PI*o;else if(H>1){if(H=1,B=0,h)switch(S=(Math.sqrt(V)/(O+k)-1)*u+1,s.scaleX*=S,l){case es.Uniform:s.scaleY*=S;break;case es.Volume:s.scaleY/=S<.7?.25+.642857*S:S}}else B=Math.acos(H)*o;S=O+k*H,w=k*Math.sin(B),N=Math.atan2(G*S-L*w,L*S+G*w)}else{S=m*k,w=p*k;const H=S*S,at=w*w,et=Math.atan2(G,L);E=at*O*O+H*V-H*at;const ot=-2*at*O,ct=at-H;if(A=ot*ot-4*ct*E,A>=0){let U=Math.sqrt(A);ot<0&&(U=-U),U=-(ot+U)*.5;let Y=U/ct,W=E/U;const j=Math.abs(Y)=0){F=Math.sqrt(Y)*o,N=et-Math.atan2(F,j),B=Math.atan2(F/p,(j-O)/m);break t}}let rt=pt.PI,dt=O-S,X=dt*dt,$=0,K=0,J=O+S,Q=J*J,it=0;E=-S*O/(H-at),E>=-1&&E<=1&&(E=Math.acos(E),R=S*Math.cos(E)+O,F=w*Math.sin(E),A=R*R+F*F,AQ&&(K=E,Q=A,J=R,it=F)),V<=(X+Q)*.5?(N=et-Math.atan2($*o,dt),B=rt*o):(N=et-Math.atan2(it*o,J),B=K*o)}const q=Math.atan2(r.y,r.x)*v;N=(N-q)*pt.radDeg+y-s.rotation,N>180?N-=360:N<=-180&&(N+=360),s.rotation+=N*u,B=((B+q)*pt.radDeg-r.shearX)*v+_-r.rotation,B>180?B-=360:B<=-180&&(B+=360),r.rotation+=B*u}}class Ba extends ea{constructor(e){super(e,new ll);x(this,"bones",[]);x(this,"_target",null);x(this,"_scaleYMode",es.None)}set target(e){this._target=e}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(e){this._scaleYMode=e}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(e){return new Ur(this,e)}}class hl{constructor(){x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0)}set(t){this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}}class Oa extends ea{constructor(e){super(e,new hl);x(this,"bones",[]);x(this,"_slot",null);x(this,"positionMode",Qs.Fixed);x(this,"spacingMode",ke.Fixed);x(this,"rotateMode",Ti.Chain);x(this,"offsetRotation",0)}set slot(e){this._slot=e}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(e){return new cl(this,e)}}var Qs;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Qs||(Qs={}));var ke;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(ke||(ke={}));var Ti;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(Ti||(Ti={}));const lr=class lr extends ta{constructor(e,s){super(e,new hl,new hl);x(this,"data");x(this,"bones");x(this,"slot");x(this,"spaces",[]);x(this,"positions",[]);x(this,"world",[]);x(this,"curves",[]);x(this,"lengths",[]);x(this,"segments",[]);if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.bones=[];for(const r of this.data.bones)this.bones.push(s.bones[r.index].constrainedPose);this.slot=s.slots[e.slot.index]}copy(e){var s=new lr(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.slot.appliedPose.attachment;if(!(r instanceof on))return;const n=this.appliedPose,a=n.mixRotate,o=n.mixX,h=n.mixY;if(a===0&&o===0&&h===0)return;const l=this.data,c=l.rotateMode===Ti.Tangent,u=l.rotateMode===Ti.ChainScale,d=this.bones,f=d.length,m=c?f:f+1,p=bt.setArraySize(this.spaces,m),g=u?this.lengths=bt.setArraySize(this.lengths,f):[],y=n.spacing;switch(l.spacingMode){case ke.Percent:if(u)for(let w=0,E=m-1;w0){w=m/w*y;for(let E=1;E0?pt.degRad:-pt.degRad}for(let w=0,E=3;w0){let F=A.a,D=A.b,M=A.c,O=A.d,k=0,N=0,B=0;if(c?k=_[E-1]:p[w+1]===0?k=_[E+2]:k=Math.atan2(R,C),k-=Math.atan2(M,F),S){N=Math.cos(k),B=Math.sin(k);const L=A.bone.data.length;v+=(L*(N*F-B*M)-C)*a,b+=(L*(B*F+N*M)-R)*a}else k+=T;k>pt.PI?k-=pt.PI2:k<-pt.PI&&(k+=pt.PI2),k*=a,N=Math.cos(k),B=Math.sin(k),A.a=N*F-B*M,A.b=N*D-B*O,A.c=B*F+N*M,A.d=B*D+N*O}}}computeWorldPositions(e,s,r,n){const a=this.slot;let o=this.appliedPose.position,h=this.spaces,l=bt.setArraySize(this.positions,r*3+2),c=this.world;const u=s.closed;let d=s.worldVerticesLength,f=d/6,m=lr.NONE;if(!s.constantSpeed){const B=s.lengths;f-=u?1:2;const L=B[f];this.data.positionMode===Qs.Percent&&(o*=L);let G;switch(this.data.spacingMode){case ke.Percent:G=L;break;case ke.Proportional:G=L/r;break;default:G=1}c=bt.setArraySize(this.world,8);for(let V=0,q=0,H=0;VL){m!==lr.AFTER&&(m=lr.AFTER,s.computeWorldVertices(e,a,d-6,4,c,0,2)),this.addAfterPosition(et-L,c,0,l,q);continue}for(;;H++){const ot=B[H];if(!(et>ot)){if(H===0)et/=ot;else{const ct=B[H-1];et=(et-ct)/(ot-ct)}break}}H!==m&&(m=H,u&&H===f?(s.computeWorldVertices(e,a,d-4,4,c,0,2),s.computeWorldVertices(e,a,0,4,c,4,2)):s.computeWorldVertices(e,a,H*6+2,8,c,0,2)),this.addCurvePosition(et,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],l,q,n||V>0&&at===0)}return l}u?(d+=2,c=bt.setArraySize(this.world,d),s.computeWorldVertices(e,a,2,d-4,c,0,2),s.computeWorldVertices(e,a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(f--,d-=4,c=bt.setArraySize(this.world,d),s.computeWorldVertices(e,a,2,d,c,0,2));const p=bt.setArraySize(this.curves,f);let g=0,y=c[0],_=c[1],v=0,b=0,T=0,S=0,w=0,E=0,A=0,P=0,I=0,C=0,R=0,F=0,D=0,M=0;for(let B=0,L=2;Bg){this.addAfterPosition(H-g,c,d-4,l,L);continue}for(;;G++){const at=p[G];if(!(H>at)){if(G===0)H/=at;else{const et=p[G-1];H=(H-et)/(at-et)}break}}if(G!==m){m=G;let at=G*6;for(y=c[at],_=c[at+1],v=c[at+2],b=c[at+3],T=c[at+4],S=c[at+5],w=c[at+6],E=c[at+7],A=(y-v*2+T)*.03,P=(_-b*2+S)*.03,I=((v-T)*3-y+w)*.006,C=((b-S)*3-_+E)*.006,R=A*2+I,F=P*2+C,D=(v-y)*.3+A+I*.16666667,M=(b-_)*.3+P+C*.16666667,N=Math.sqrt(D*D+M*M),k[0]=N,at=1;at<8;at++)D+=R,M+=F,R+=I,F+=C,N+=Math.sqrt(D*D+M*M),k[at]=N;D+=R,M+=F,N+=Math.sqrt(D*D+M*M),k[8]=N,D+=R+I,M+=F+C,N+=Math.sqrt(D*D+M*M),k[9]=N,V=0}for(H*=N;;V++){const at=k[V];if(!(H>at)){if(V===0)H/=at;else{const et=k[V-1];H=V+(H-et)/(at-et)}break}}this.addCurvePosition(H*.1,y,_,v,b,T,S,w,E,l,L,n||B>0&&q===0)}return l}addBeforePosition(e,s,r,n,a){const o=s[r],h=s[r+1],l=s[r+2]-o,c=s[r+3]-h,u=Math.atan2(c,l);n[a]=o+e*Math.cos(u),n[a+1]=h+e*Math.sin(u),n[a+2]=u}addAfterPosition(e,s,r,n,a){const o=s[r+2],h=s[r+3],l=o-s[r],c=h-s[r+1],u=Math.atan2(c,l);n[a]=o+e*Math.cos(u),n[a+1]=h+e*Math.sin(u),n[a+2]=u}addCurvePosition(e,s,r,n,a,o,h,l,c,u,d,f){if(e===0||Number.isNaN(e)){u[d]=s,u[d+1]=r,u[d+2]=Math.atan2(a-r,n-s);return}const m=e*e,p=m*e,g=1-e,y=g*g,_=y*g,v=g*e,b=v*3,T=g*b,S=b*e,w=s*_+n*T+o*S+l*p,E=r*_+a*T+h*S+c*p;u[d]=w,u[d+1]=E,f&&(e<.001?u[d+2]=Math.atan2(a-r,n-s):u[d+2]=Math.atan2(E-(r*y+a*v*2+h*m),w-(s*y+n*v*2+o*m)))}sort(e){const s=this.slot.data.index,r=this.slot.bone;e.skin!=null&&this.sortPathSlot(e,e.skin,s,r),e.data.defaultSkin!=null&&e.data.defaultSkin!==e.skin&&this.sortPathSlot(e,e.data.defaultSkin,s,r),this.sortPath(e,this.slot.pose.attachment,r);const n=this.bones,a=this.bones.length;for(let o=0;o0,o=this.data.y>0,h=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,c=this.bone;let u=c.bone.data.length,d=this.data.step,f=0;if(s!==Os.none){switch(c.modifyWorld(e),s){case Os.reset:this.reset(e);case Os.update:{const m=Math.max(e.time-this.lastTime,0),p=this.remaining;this.remaining+=m,this.lastTime=e.time;const g=c.worldX,y=c.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=y;else{let _=this.remaining,v=r.inertia,b=e.data.referenceScale,T=-1,S=0,w=0,E=this.data.limit*m,A=E*Math.abs(e.scaleY);if(E*=Math.abs(e.scaleX),a||o){if(a){const P=(this.ux-g)*v;this.xOffset+=P>E?E:P<-E?-E:P,this.ux=g}if(o){const P=(this.uy-y)*v;this.yOffset+=P>A?A:P<-A?-A:P,this.uy=y}if(_>=d){const P=this.xOffset,I=this.yOffset;T=r.damping**(60*d),S=d*r.massInverse,w=r.strength;const C=b*r.wind,R=b*r.gravity,F=(C*e.windX+R*e.gravityX)*e.scaleX,D=(C*e.windY+R*e.gravityY)*e.scaleY;do a&&(this.xVelocity+=(F-this.xOffset*w)*S,this.xOffset+=this.xVelocity*d,this.xVelocity*=T),o&&(this.yVelocity-=(D+this.yOffset*w)*S,this.yOffset+=this.yVelocity*d,this.yVelocity*=T),_-=d;while(_>=d);this.xLag=this.xOffset-P,this.yLag=this.yOffset-I}f=Math.max(0,1-_/d),a&&(c.worldX+=(this.xOffset-this.xLag*f)*n*this.data.x),o&&(c.worldY+=(this.yOffset-this.yLag*f)*n*this.data.y)}if(h||l){let P=Math.atan2(c.c,c.a),I=0,C=0,R=0,F=this.cx-c.worldX,D=this.cy-c.worldY;if(F>E?F=E:F<-E&&(F=-E),D>A?D=A:D<-A&&(D=-A),_=this.remaining,h){R=(this.data.rotate+this.data.shearX)*n,f=this.rotateLag*Math.max(0,1-p/d);let M=Math.atan2(D+this.ty,F+this.tx)-P-(this.rotateOffset-f)*R;this.rotateOffset+=(M-Math.ceil(M*pt.invPI2-.5)*pt.PI2)*v,M=(this.rotateOffset-f)*R+P,I=Math.cos(M),C=Math.sin(M),l&&(M=u*c.getWorldScaleX(),M>0&&(this.scaleOffset+=(F*I+D*C)*v/M))}else{I=Math.cos(P),C=Math.sin(P);const M=u*c.getWorldScaleX()-this.scaleLag*Math.max(0,1-p/d);M>0&&(this.scaleOffset+=(F*I+D*C)*v/M)}if(_>=d){T===-1&&(T=r.damping**(60*d),S=d*r.massInverse,w=r.strength);const M=r.wind*e.windX+r.gravity*e.gravityX,O=(r.wind*e.windY+r.gravity*e.gravityY)*Mi.yDir,k=this.rotateOffset,N=this.scaleOffset,B=u/b;for(;;)if(_-=d,l&&(this.scaleVelocity+=(M*I-O*C-this.scaleOffset*w)*S,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=T),h){if(this.rotateVelocity-=((M*C+O*I)*B+this.rotateOffset*w)*S,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=T,_0){let _=0;this.data.rotate>0&&(_=m*this.data.rotate,p=Math.sin(_),g=Math.cos(_),y=c.b,c.b=g*y-p*c.d,c.d=p*y+g*c.d),_+=m*this.data.shearX,p=Math.sin(_),g=Math.cos(_),y=c.a,c.a=g*y-p*c.c,c.c=p*y+g*c.c}else m*=this.data.rotate,p=Math.sin(m),g=Math.cos(m),y=c.a,c.a=g*y-p*c.c,c.c=p*y+g*c.c,y=c.b,c.b=g*y-p*c.d,c.d=p*y+g*c.d}if(l){let m=1+(this.scaleOffset-this.scaleLag*f)*n*this.data.scaleX;switch(c.a*=m,c.c*=m,this.data.scaleYMode){case es.Uniform:c.b*=m,c.d*=m;break;case es.Volume:m=Math.abs(m),m=m>=.7?1/m:4-3.67347*m,c.b*=m,c.d*=m}}s!==Os.pose&&(this.tx=u*c.a,this.ty=u*c.c)}}sort(e){const s=this.bone.bone;e.sortBone(s),e._updateCache.push(this),e.sortReset(s.children),e.constrained(s)}isSourceActive(){return this.bone.bone.active}}class Da extends ea{constructor(e){super(e,new ul);x(this,"_bone",null);x(this,"x",0);x(this,"y",0);x(this,"rotate",0);x(this,"scaleX",0);x(this,"shearX",0);x(this,"limit",0);x(this,"step",0);x(this,"inertiaGlobal",!1);x(this,"strengthGlobal",!1);x(this,"dampingGlobal",!1);x(this,"massGlobal",!1);x(this,"windGlobal",!1);x(this,"gravityGlobal",!1);x(this,"mixGlobal",!1);x(this,"_scaleYMode",es.None)}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(e){if(e==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=e}create(e){return new no(this,e)}}typeof Math.fround>"u"&&(Math.fround=(i=>t=>(i[0]=t,i[0]))(new Float32Array(1)));class fl{constructor(){x(this,"time",0);x(this,"mix",0)}set(t){this.time=t.time,this.mix=t.mix}}const No=class No extends ta{constructor(e,s){super(e,new fl,new fl);x(this,"bone",null);if(!s)throw new Error("skeleton cannot be null.");e.bone!=null&&(this.bone=s.bones[e.bone.index])}copy(e){var s=new No(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.appliedPose;if(r.mix===0)return;const n=this.data,a=n.animation,o=this.bone;if(o!==null){if(!o.active)return;n.local&&o.appliedPose.validateLocalTransform(e),r.time=n.offset+(n.property.value(e,o.appliedPose,n.local,No.offsets)-n.property.offset)*n.scale,n.loop?r.time=a.duration+r.time%a.duration:r.time=Math.max(0,r.time)}const h=e.bones,l=a.bones;for(let c=0,u=a.bones.length;c=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=s}addSkin(t){for(let s=0;s= 0.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.boneData=r}}var fr;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(fr||(fr={}));class pl{constructor(){x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0)}set(t){this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}}class Ol extends ta{constructor(e,s){super(e,new pl,new pl);x(this,"bones");x(this,"source");if(!s)throw new Error("skeleton cannot be null.");this.bones=[];for(const n of e.bones)this.bones.push(s.bones[n.index].constrainedPose);const r=s.bones[e.source.index];if(r==null)throw new Error("source cannot be null.");this.source=r}copy(e){var s=new Ol(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.appliedPose;if(r.mixRotate===0&&r.mixX===0&&r.mixY===0&&r.mixScaleX===0&&r.mixScaleY===0&&r.mixShearY===0)return;const n=this.data,a=n.localSource,o=n.localTarget,h=n.additive,l=n.clamp,c=n.offsets,u=this.source.appliedPose;a&&u.validateLocalTransform(e);const d=n.properties,f=n.properties.length,m=this.bones;for(let p=0,g=this.bones.length;p0?r[te.ROTATION]:-r[te.ROTATION]);return o<0&&(o+=360),o}}class Nu extends fn{mix(t){return t.mixRotate}apply(t,e,s,r,n,a){if(n)s.rotation+=(a?r:r-s.rotation)*e.mixRotate;else{const o=t.scaleX,h=t.scaleY,l=1/o,c=1/h,u=s.a*l,d=s.b*l,f=s.c*c,m=s.d*c;r*=pt.degRad,a||(r-=Math.atan2(f,u)),r>pt.PI?r-=pt.PI2:r<-pt.PI&&(r+=pt.PI2),r*=e.mixRotate;const p=Math.cos(r),g=Math.sin(r);s.a=(p*u-g*f)*o,s.b=(p*d-g*m)*o,s.c=(g*u+p*f)*h,s.d=(g*d+p*m)*h}}}class yl extends dn{value(t,e,s,r){return s?e.x+r[te.X]:(r[te.X]*e.a+r[te.Y]*e.b+e.worldX)/t.scaleX}}class Uu extends fn{mix(t){return t.mixX}apply(t,e,s,r,n,a){n?s.x+=(a?r:r-s.x)*e.mixX:(a||(r-=s.worldX/t.scaleX),s.worldX+=r*e.mixX*t.scaleX)}}class xl extends dn{value(t,e,s,r){return s?e.y+r[te.Y]:(r[te.X]*e.c+r[te.Y]*e.d+e.worldY)/t.scaleY}}class Xu extends fn{mix(t){return t.mixY}apply(t,e,s,r,n,a){n?s.y+=(a?r:r-s.y)*e.mixY:(a||(r-=s.worldY/t.scaleY),s.worldY+=r*e.mixY*t.scaleY)}}class bl extends dn{value(t,e,s,r){if(s)return e.scaleX+r[te.SCALEX];const n=e.a/t.scaleX,a=e.c/t.scaleY;return Math.sqrt(n*n+a*a)+r[te.SCALEX]}}class Vu extends fn{mix(t){return t.mixScaleX}apply(t,e,s,r,n,a){if(n)a?s.scaleX*=1+(r-1)*e.mixScaleX:s.scaleX!==0&&(s.scaleX+=(r-s.scaleX)*e.mixScaleX);else if(a){const o=1+(r-1)*e.mixScaleX;s.a*=o,s.c*=o}else{let o=s.a/t.scaleX,h=s.c/t.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(r-l)*e.mixScaleX/l,s.a*=l,s.c*=l)}}}class vl extends dn{value(t,e,s,r){if(s)return e.scaleY+r[te.SCALEY];const n=e.b/t.scaleX,a=e.d/t.scaleY;return Math.sqrt(n*n+a*a)+r[te.SCALEY]}}class Yu extends fn{mix(t){return t.mixScaleY}apply(t,e,s,r,n,a){if(n)a?s.scaleY*=1+(r-1)*e.mixScaleY:s.scaleY!==0&&(s.scaleY+=(r-s.scaleY)*e.mixScaleY);else if(a){const o=1+(r-1)*e.mixScaleY;s.b*=o,s.d*=o}else{let o=s.b/t.scaleX,h=s.d/t.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(r-l)*e.mixScaleY/l,s.b*=l,s.d*=l)}}}class _l extends dn{value(t,e,s,r){if(s)return e.shearY+r[te.SHEARY];const n=1/t.scaleX,a=1/t.scaleY;return(Math.atan2(e.d*a,e.b*n)-Math.atan2(e.c*a,e.a*n))*pt.radDeg-90+r[te.SHEARY]}}class Gu extends fn{mix(t){return t.mixShearY}apply(t,e,s,r,n,a){if(n)a||(r-=s.shearY),s.shearY+=r*e.mixShearY;else{const o=t.scaleX,h=t.scaleY,l=s.b/o,c=s.d/h,u=Math.atan2(c,l);r=(r+90)*pt.degRad,a?r-=pt.PI/2:(r-=u-Math.atan2(s.c/h,s.a/o),r>pt.PI?r-=pt.PI2:r<-pt.PI&&(r+=pt.PI2)),r=u+r*e.mixShearY;const d=Math.sqrt(l*l+c*c);s.b=Math.cos(r)*d*o,s.d=Math.sin(r)*d*h}}}class ug{constructor(t){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",[]);this.attachmentLoader=t}readSkeletonData(t){const e=this.scale,s=new Bl;s.name="";const r=new dg(t),n=r.readInt32(),a=r.readInt32();s.hash=a===0&&n===0?null:a.toString(16)+n.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*e;const o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let h=0;h=r.readInt(!0);for(let m=0;m>5;for(let b=0,T;b>1&1,y.spacingMode=_>>2&3,y.rotateMode=_>>4&3,(_&128)!==0&&(y.offsetRotation=r.readFloat());const v=y.setupPose;v.position=r.readFloat(),y.positionMode===Qs.Fixed&&(v.position*=e),v.spacing=r.readFloat(),(y.spacingMode===ke.Length||y.spacingMode===ke.Fixed)&&(v.spacing*=e),v.mixRotate=r.readFloat(),v.mixX=r.readFloat(),v.mixY=r.readFloat(),c.push(y);break}case Vk:{const y=new Da(p);y.bone=l[r.readInt(!0)];let _=r.readByte();if(y.skinRequired=(_&1)!==0,(_&2)!==0&&(y.x=r.readFloat()),(_&4)!==0&&(y.y=r.readFloat()),(_&8)!==0&&(y.rotate=r.readFloat()),(_&16)!==0){let b=r.readFloat();b<-2?(y.scaleYMode=es.Volume,b=-2-b):b<0&&(y.scaleYMode=es.Uniform,b=-1-b),y.scaleX=b}(_&32)!==0&&(y.shearX=r.readFloat()),y.limit=((_&64)!==0?r.readFloat():5e3)*e,y.step=1/r.readUnsignedByte();const v=y.setupPose;v.inertia=r.readFloat(),v.strength=r.readFloat(),v.damping=r.readFloat(),v.massInverse=(_&128)!==0?r.readFloat():1,v.wind=r.readFloat(),v.gravity=r.readFloat(),_=r.readByte(),(_&1)!==0&&(y.inertiaGlobal=!0),(_&2)!==0&&(y.strengthGlobal=!0),(_&4)!==0&&(y.dampingGlobal=!0),(_&8)!==0&&(y.massGlobal=!0),(_&16)!==0&&(y.windGlobal=!0),(_&32)!==0&&(y.gravityGlobal=!0),(_&64)!==0&&(y.mixGlobal=!0),v.mix=(_&128)!==0?r.readFloat():1,c.push(y);break}case Yk:{const y=new yi(p),_=r.readByte();if(y.skinRequired=(_&1)!==0,y.loop=(_&2)!==0,y.additive=(_&4)!==0,(_&8)!==0){const v=r.readFloat();o&&(_&64)!==0?y.max=v:y.setupPose.time=v}if((_&16)!==0&&(y.setupPose.mix=(_&32)!==0?r.readFloat():1),(_&64)!==0){y.local=(_&128)!==0,y.bone=l[r.readInt(!0)];const v=r.readFloat();let b=1;switch(r.readByte()){case 0:y.property=new gl;break;case 1:{b=e,y.property=new yl;break}case 2:{b=e,y.property=new xl;break}case 3:y.property=new bl;break;case 4:y.property=new vl;break;case 5:y.property=new _l;break;default:continue}y.property.offset=v*b,y.offset=r.readFloat(),y.scale=r.readFloat()/b}c.push(y);break}}}const d=this.readSkin(r,s,!0,o);d&&(s.defaultSkin=d,s.skins.push(d));{let m=s.skins.length;for(bt.setArraySize(s.skins,h=m+r.readInt(!0));m0){_=[];for(let w=0;w>4,t.readFloat())}n.push(P);break}}}}}const o=s.slots.length,h=t.readInt(!0);if(h>0){const f=new Wr(h);for(let m=0;m0){const f=new jn(c);for(let m=0;m>>1^-(s&1)}readStringRef(){const t=this.readInt(!0);return t===0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s>4){case 12:case 13:e+=String.fromCharCode((r&31)<<6|this.readByte()&63),s+=2;break;case 14:e+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:e+=String.fromCharCode(r),s++}}return e}readFloat(){const t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!==0}}let xk=class{constructor(t,e,s,r,n,a){x(this,"source");x(this,"skinIndex");x(this,"slotIndex");x(this,"sourceIndex");x(this,"mesh");x(this,"inheritTimelines");this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.sourceIndex=r,this.source=n,this.inheritTimelines=a}};class ib{constructor(t=null,e,s=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=t,this.vertices=e,this.length=s}}var ii;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(ii||(ii={}));function Fe(i,t,e,s){e instanceof dr?bk(i,t,e,s):vk(i,t,e,s)}function bk(i,t,e,s){let r=i.readFloat(),n=i.readFloat()*s;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,r,n),a!==h;a++){const l=i.readFloat(),c=i.readFloat()*s;switch(i.readByte()){case Lr:e.setStepped(a);break;case Br:jt(i,e,o++,a,0,r,l,n,c,s)}r=l,n=c}t.push(e)}function vk(i,t,e,s){let r=i.readFloat(),n=i.readFloat()*s,a=i.readFloat()*s;for(let o=0,h=0,l=e.getFrameCount()-1;e.setFrame(o,r,n,a),o!==l;o++){const c=i.readFloat(),u=i.readFloat()*s,d=i.readFloat()*s;switch(i.readByte()){case Lr:e.setStepped(o);break;case Br:jt(i,e,h++,o,0,r,c,n,u,s),jt(i,e,h++,o,1,r,c,a,d,s)}r=c,n=u,a=d}t.push(e)}function nb(i,t){const e=i.readInt(!0);if(e===0)return null;const s=new Array(t).fill(-1),r=new Array(t-e);let n=0,a=0;for(let o=0;o=0;o--)s[o]===-1&&(s[o]=r[--a]);return s}function jt(i,t,e,s,r,n,a,o,h,l){t.setBezier(e,s,r,n,o,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,a,h)}const _k=0,wk=1,Tk=2,Sk=3,Ek=4,Ak=5,Ck=6,Ik=7,Pk=8,Mk=9,Rk=10,Fk=0,kk=1,Lk=2,Bk=3,Ok=4,Dk=5,Nk=0,Uk=1,Xk=2,Vk=3,Yk=4,Gk=0,$k=1,Hk=0,Wk=1,zk=2,jk=0,qk=1,Kk=2,Zk=4,Jk=5,Qk=6,tL=7,eL=8,sL=0,rL=1,Lr=1,Br=2;class fg{constructor(){x(this,"minX",0);x(this,"minY",0);x(this,"maxX",0);x(this,"maxY",0);x(this,"boundingBoxes",[]);x(this,"polygons",[]);x(this,"polygonPool",new $a(()=>bt.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const s=this.boundingBoxes,r=this.polygons,n=this.polygonPool,a=t.slots,o=a.length;s.length=0,n.freeAll(r),r.length=0;for(let h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,r){const n=this.minX,a=this.minY,o=this.maxX,h=this.maxY;if(t<=n&&s<=n||e<=a&&r<=a||t>=o&&s>=o||e>=h&&r>=h)return!1;const l=(r-e)/(s-t);let c=l*(n-t)+e;if(c>a&&ca&&cn&&un&&ut.minX&&this.minYt.minY}containsPoint(t,e){const s=this.polygons;for(let r=0,n=s.length;r=s||c=s){const u=r[h];u+(s-l)/(c-l)*(r[a]-u)=u&&b<=m||b>=m&&b<=u)&&(b>=e&&b<=r||b>=r&&b<=e)){const T=(c*_-l*g)/v;if((T>=d&&T<=p||T>=p&&T<=d)&&(T>=s&&T<=n||T>=n&&T<=s))return!0}u=m,d=p}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");const e=this.boundingBoxes.indexOf(t);return e===-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class Je{constructor(){x(this,"convexPolygons",[]);x(this,"convexPolygonsIndices",[]);x(this,"indicesArray",[]);x(this,"isConcaveArray",[]);x(this,"triangles",[]);x(this,"polygonPool",new $a(()=>[]));x(this,"polygonIndicesPool",new $a(()=>[]))}triangulate(t){const e=t;let s=t.length>>1;const r=this.indicesArray;r.length=0;for(let o=0;o3;){let o=s-1,h=0,l=1;for(;;){t:if(!n[h]){const d=r[o]<<1,f=r[h]<<1,m=r[l]<<1,p=e[d],g=e[d+1],y=e[f],_=e[f+1],v=e[m],b=e[m+1];for(let T=l+10);o=h>0?h-1:s-1,l=h+10?h-1:s-1,u=h0&&(r.push(o),n.push(a),o=this.polygonPool.obtain(),a=this.polygonIndicesPool.obtain()),o.length=0,o.push(p,g,y,_),o.push(v,b),a.length=0,a.push(d,f,m),l=Je.winding(p,g,y,_,v,b),h=d}o.length>0&&(r.push(o),n.push(a));for(let c=0,u=r.length;c=0;c--)o=r[c],o.length===0?(r.splice(c,1),this.polygonPool.free(o),a=n[c],n.splice(c,1),this.polygonIndicesPool.free(a)):o.push(o[0],o[1]);return r}static isConcave(t,e,s,r){const n=r[t>0?t-1:e-1]<<1,a=r[t]<<1,o=r[t+1=0}static winding(t,e,s,r,n,a){return t*(a-r)+s*(e-a)+n*(r-e)>=0?1:-1}}class ao{constructor(){x(this,"triangulator",null);x(this,"clippingPolygon",[]);x(this,"clippingPolygons",[]);x(this,"clipOutput",[]);x(this,"clippedVertices",[]);x(this,"clippedUVs",[]);x(this,"clippedTriangles",[]);x(this,"inverseVertices",[]);x(this,"_clippedVerticesTyped",new Float32Array(1024));x(this,"_clippedUVsTyped",new Float32Array(1024));x(this,"_clippedTrianglesTyped",new Uint16Array(1024));x(this,"clippedVerticesTyped",new Float32Array(0));x(this,"clippedUVsTyped",new Float32Array(0));x(this,"clippedTrianglesTyped",new Uint16Array(0));x(this,"clippedVerticesLength",0);x(this,"clippedUVsLength",0);x(this,"clippedTrianglesLength",0);x(this,"scratch",[]);x(this,"inverse",!1);x(this,"clipAttachment",null)}clipStart(t,e,s){if(this.clipAttachment)return;const r=s.worldVerticesLength;this.clipAttachment=s,this.inverse=s.inverse;const n=bt.setArraySize(this.clippingPolygon,r);s.computeWorldVertices(t,e,0,r,n,0,2);const a=this.clippingPolygon,o=this.makeClockwise(a);o||this.inverse||s.convex?(o||this.makeConvex(a),this.clippingPolygon.push(a[0],a[1]),this.clippingPolygons.push(a)):(this.triangulator===null&&(this.triangulator=new Je),this.clippingPolygons.push(...this.triangulator.decompose(a,this.triangulator.triangulate(a))))}clipEnd(t){this.clipAttachment&&(t&&this.clipAttachment.endSlot!==t.data||(this.clipAttachment=null,this.clippingPolygons.length=0))}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,s,r,n,a,o,h){return r&&n&&a&&typeof o=="boolean"&&typeof h=="number"?this.clipTrianglesRender(t,e,s,r,n,a,o,h):this.clipTrianglesNoRender(t,e,s)}clipTrianglesNoRender(t,e,s){const r=this.clippedVertices;r.length=0;const n=this.clippedTriangles;n.length=0;let a=0;if(this.inverse){const u=this.clippingPolygons[0];for(let d=0;d>1,A=r.length;const P=bt.setArraySize(r,A+w);bt.arrayCopy(b,T,P,A,w),A=n.length;const I=bt.setArraySize(n,A+3*(E-2));for(let C=1;C>1;const w=bt.setArraySize(r,b+T);bt.arrayCopy(c,0,w,b,T),b=n.length;const E=bt.setArraySize(n,b+3*(S-2));S--;for(let A=1;A>1;let et=l.length;const ot=bt.setArraySize(l,et+at*h);for(let rt=0;rt>1;k===0&&(F=w-I,D=P-S,M=_-P,O=I-v,k=1/(F*M-D*O));const V=bt.setArraySize(l,B+G*h);for(let H=0;H>1;let H=this.clippedVerticesLength;const at=H+q*a,et=this.clippedUVsLength+q*2;o.length>1;N===0&&(D=E-C,M=I-w,O=_-I,k=C-v,N=1/(D*O-M*k));const q=L+V*a;o.length=2?(c=this.clipOutput,u=this.scratch):(c=this.scratch,u=this.clipOutput);const d=o;c.length=8;const f=c;f[0]=t,f[1]=e,f[2]=s,f[3]=r,f[4]=n,f[5]=a,f[6]=t,f[7]=e,u.length=0;const m=o.length-4;for(let p=0;;p+=2){const g=d[p],y=d[p+1],_=g-d[p+2],v=y-d[p+3],b=u.length,T=c;t=T[0],e=T[1];let S=v*(g-t)-_*(y-e);for(let E=2,A=c.length-2;E<=A;E+=2){s=T[E],r=T[E+1];const P=v*(g-s)-_*(y-r);if(S>0)if(P>0)u.push(s,r);else{const I=s-t,C=r-e,R=S/(I*v-C*_);R>=0&&R<=1?(u.push(t+I*R,e+C*R),l=!0):u.push(s,r)}else if(P>0){const I=s-t,C=r-e,R=S/(I*v-C*_);R>=0&&R<=1?(u.push(t+I*R,e+C*R,s,r),l=!0):u.push(s,r)}else l=!0;t=s,e=r,S=P}if(b===u.length)return h.length=0,!0;if(u.push(u[0],u[1]),p===m)break;const w=u;u=c,u.length=0,c=w}if(h!==u){h.length=0;for(let p=0,g=u.length-2;p=2?(l=this.clipOutput,c=this.scratch):(l=this.scratch,c=this.clipOutput),l.length=8;let u=o,d=l;d[0]=t,d[1]=e,d[2]=s,d[3]=r,d[4]=n,d[5]=a,d[6]=t,d[7]=e,c.length=0;for(let f=0;;f+=2){const m=u[f],p=u[f+1],g=m-u[f+2],y=p-u[f+3],_=c.length,v=this.inverseVertices.length;this.inverseVertices.push(0),d=l,t=d[0],e=d[1];let b=y*(m-t)-g*(p-e);for(let w=2,E=l.length-2;w<=E;w+=2){s=d[w],r=d[w+1];const A=y*(m-s)-g*(p-r);if(b>0)if(A>0)c.push(s,r);else{const P=s-t,I=r-e,C=b/(P*y-I*g);if(C>=0&&C<=1){const R=t+P*C,F=e+I*C;c.push(R,F),this.inverseVertices.push(R,F,s,r)}else c.push(s,r)}else if(A>0){const P=s-t,I=r-e,C=b/(P*y-I*g);if(C>=0&&C<=1){const R=t+P*C,F=e+I*C;this.inverseVertices.push(R,F),c.push(R,F,s,r)}else c.push(s,r)}else this.inverseVertices.push(s,r);t=s,e=r,b=A}const T=this.inverseVertices.length-v-1;if(T>=6?this.inverseVertices[v]=T:this.inverseVertices.length=v,_===c.length||(c.push(c[0],c[1]),f===h))break;const S=c;c=l,c.length=0,l=S}}makeClockwise(t){const e=t,s=t.length;let r=!0,n=!0,a=0,o=e[s-2],h=e[s-1],l=e[0],c=e[1];for(let d=2;d=0,o=l,h=c,l=f,c=m}a+=l*e[1]-e[0]*c;const u=(l-o)*(e[1]-c)-(c-h)*(e[0]-l);if(n=n&&u<=0,r=r&&u>=0,a>=0){for(let d=0,f=s-2,m=s>>1;d=0&&(r[c]>h||r[c]===h&&r[c+1]>l);c-=2)r[c+2]=r[c],r[c+3]=r[c+1];r[c+2]=h,r[c+3]=l}s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3];let n=4;for(let o=4;o=0&&(n-=2,n!==2););s[n]=h,s[n+1]=l}s[n]=r[e-4],s[n+1]=r[e-3];const a=n;n+=2;for(let o=e-6;o>=0;o-=2,n+=2){const h=r[o],l=r[o+1];for(;(s[n-2]-s[n-4])*(l-s[n-3])-(s[n-1]-s[n-3])*(h-s[n-4])>=0&&(n-=2,n!==a););s[n]=h,s[n+1]=l}t.length=n-2}}class mg{constructor(t){x(this,"attachmentLoader");x(this,"scale",1);x(this,"linkedMeshes",[]);this.attachmentLoader=t}readSkeletonData(t){const e=this.scale,s=new Bl,r=typeof t=="string"?JSON.parse(t):t,n=r.skeleton;if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=z(n,"referenceScale",100)*e,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),r.bones)for(let a=0;a0&&l.properties.push(S)}l.offsets[te.ROTATION]=z(a,"rotation",0),l.offsets[te.X]=z(a,"x",0)*e,l.offsets[te.Y]=z(a,"y",0)*e,l.offsets[te.SCALEX]=z(a,"scaleX",0),l.offsets[te.SCALEY]=z(a,"scaleY",0),l.offsets[te.SHEARY]=z(a,"shearY",0);const v=l.setupPose;d&&(v.mixRotate=z(a,"mixRotate",1)),f&&(v.mixX=z(a,"mixX",1)),m&&(v.mixY=z(a,"mixY",v.mixX)),p&&(v.mixScaleX=z(a,"mixScaleX",1)),g&&(v.mixScaleY=z(a,"mixScaleY",v.mixScaleX)),y&&(v.mixShearY=z(a,"mixShearY",1)),s.constraints.push(l);break}case"path":{const l=new Oa(o);l.skinRequired=h;for(let f=0;f0){const d=s.findConstraint(l,Da);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=s.constraints.indexOf(d)}for(const d in c){const f=c[d];let m=f[0];if(!m)continue;const p=f.length;let g,y=0;if(d==="reset"){const _=new ja(p,u);for(let v=0;m!=null;m=f[v+1],v++)_.setFrame(v,z(m,"time",0));n.push(_);continue}switch(d){case"inertia":g=new Eu(p,p,u);break;case"strength":g=new Au(p,p,u);break;case"damping":g=new Cu(p,p,u);break;case"mass":g=new Iu(p,p,u);break;case"wind":g=new Pu(p,p,u);break;case"gravity":g=new Mu(p,p,u);break;case"mix":{y=1,g=new Ru(p,p,u);break}default:continue}Fs(n,f,g,y,1)}}if(t.slider)for(const l in t.slider){const c=t.slider[l],u=s.findConstraint(l,yi);if(!u)throw new Error(`Slider not found: ${l}`);const d=s.constraints.indexOf(u);for(const f in c){const m=c[f];if(!m[0])continue;const g=m.length;switch(f){case"time":Fs(n,m,new Fu(g,g,d),1,1);break;case"mix":Fs(n,m,new ku(g,g,d),1,1);break}}}if(t.attachments)for(const l in t.attachments){const c=t.attachments[l],u=s.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in c){const f=c[d],m=s.findSlot(d);if(!m)throw new Error(`Attachment slot not found: ${d}`);const p=m.index;for(const g in f){const y=f[g],_=u.getAttachment(p,g);if(!_)throw new Error(`Timeline attachment not found: ${g}`);for(const v in y){const b=y[v];let T=b[0];if(T){if(v==="deform"){const S=_.bones,w=_.vertices,E=S?w.length/3*2:w.length,A=new bu(b.length,b.length,p,_);let P=z(T,"time",0);for(let I=0,C=0;;I++){let R;const F=z(T,"vertices",null);if(!F)R=S?bt.newFloatArray(E):w;else{R=bt.newFloatArray(E);const k=z(T,"offset",0);if(bt.arrayCopy(F,0,R,k,F.length),r!==1)for(let N=k,B=N+F.length;N=0;l--)n[l]===-1&&(n[l]=a[--h]);return n}function Qt(i,t,e,s,r,n,a,o,h,l){if(i==="stepped")return t.setStepped(s),e;const c=r<<2,u=i[c],d=i[c+1]*l,f=i[c+2],m=i[c+3]*l;return t.setBezier(e,s,r,n,o,u,d,f,m,a,h),e+1}function z(i,t,e){return i[t]!==void 0?i[t]:e}class pg{constructor(t,e,s={}){x(this,"skeleton");x(this,"adapter");x(this,"positionInheritanceFactorX",0);x(this,"positionInheritanceFactorY",0);x(this,"rotationInheritanceFactor",0);x(this,"hasLastTransform",!1);x(this,"lastX",0);x(this,"lastY",0);x(this,"lastZ",0);x(this,"lastRotation",0);x(this,"currentTransform",{x:0,y:0,z:0,rotation:0});x(this,"currentPosition",{x:0,y:0,z:0});x(this,"lastPosition",{x:0,y:0,z:0});this.skeleton=t,this.adapter=e,this.positionInheritanceFactorX=s.positionInheritanceX??0,this.positionInheritanceFactorY=s.positionInheritanceY??0,this.rotationInheritanceFactor=s.rotationInheritance??0}get positionInheritanceX(){return this.positionInheritanceFactorX}get positionInheritanceY(){return this.positionInheritanceFactorY}setPositionInheritance(t,e){const s=this.positionInheritanceFactorX===0&&this.positionInheritanceFactorY===0,r=t!==0||e!==0;this.positionInheritanceFactorX=t,this.positionInheritanceFactorY=e,s&&r&&this.resetPosition()}get rotationInheritance(){return this.rotationInheritanceFactor}set rotationInheritance(t){const e=this.rotationInheritanceFactor===0;this.rotationInheritanceFactor=t,e&&t!==0&&this.resetRotation()}resetPosition(){const t=this.currentTransform,e=!this.hasLastTransform&&this.rotationInheritanceFactor!==0;this.adapter.readTransform(t,e),this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z,e&&(this.lastRotation=t.rotation),this.hasLastTransform=!0}resetRotation(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.lastRotation=t.rotation,this.hasLastTransform||(this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z),this.hasLastTransform=!0}resetTransform(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.setLastTransform(t.x,t.y,t.z,t.rotation)}applyTransformMovement(){const t=this.positionInheritanceFactorX!==0||this.positionInheritanceFactorY!==0,e=this.rotationInheritanceFactor!==0;if(!t&&!e)return;const s=this.currentTransform;this.adapter.readTransform(s,e);const{x:r,y:n,z:a}=s,o=e?s.rotation:this.lastRotation,h=r!==this.lastX||n!==this.lastY||a!==this.lastZ;if(this.hasLastTransform){if(!h&&o===this.lastRotation)return;t&&h&&this.applyPositionMovement(r,n,a),e&&o!==this.lastRotation&&this.applyRotationMovement(o)}this.setLastTransform(r,n,a,o)}applyPositionMovement(t,e,s){const r=this.currentPosition;r.x=t,r.y=e,r.z=s,this.adapter.worldToSkeleton(r);const n=this.lastPosition;n.x=this.lastX,n.y=this.lastY,n.z=this.lastZ,this.adapter.worldToSkeleton(n),this.skeleton.physicsTranslate((r.x-n.x)*this.positionInheritanceFactorX,(r.y-n.y)*this.positionInheritanceFactorY)}applyRotationMovement(t){const e=this.rotationInheritanceFactor;e!==0&&this.skeleton.physicsRotate(0,0,this.getRotationDelta(t,this.lastRotation)*e)}setLastTransform(t,e,s,r){this.lastX=t,this.lastY=e,this.lastZ=s,this.lastRotation=r,this.hasLastTransform=!0}getRotationDelta(t,e){let s=t-e;return s=(s+180)%360-180,s<-180?s+360:s}}class Bw{constructor(){x(this,"commandPool",new nL);x(this,"worldVertices",new Float32Array(12*1024));x(this,"quadIndices",new Uint16Array([0,1,2,2,3,0]));x(this,"clipping",new ao);x(this,"renderCommands",[])}render(t,e=!1,s,r=2,n=0){var l,c;this.commandPool.reset(),this.renderCommands.length=0;const a=this.clipping;let o=0;const h=t.drawOrder.appliedPose;for(let u=0,d=h.length;u>1;const R=p.sequence,F=R.resolveIndex(m);b=R.getUVs(F),T=p.triangles,S=T.length,E=(c=R.regions[F])==null?void 0:c.texture}else if(p instanceof zr){a.clipEnd(f),a.clipStart(t,f,p);continue}else{a.clipEnd(f);continue}if(!E){a.clipEnd(f);continue}const A=t.color;let P,I;if(e){let R;if(s){R=Math.floor(s[3]*A.a*g.a*w.a*255);const F=Math.floor(R*s[0]*A.r*g.r*w.r),D=Math.floor(R*s[1]*A.g*g.g*w.g),M=Math.floor(R*s[2]*A.b*g.b*w.b);P=R<<24|F<<16|D<<8|M}else{R=Math.floor(A.a*g.a*w.a*255);const F=Math.floor(R*A.r*g.r*w.r),D=Math.floor(R*A.g*g.g*w.g),M=Math.floor(R*A.b*g.b*w.b);P=R<<24|F<<16|D<<8|M}if(I=4278190080,m.darkColor){const{r:F,g:D,b:M}=m.darkColor;I=4278190080|Math.floor(F*R)<<16|Math.floor(D*R)<<8|Math.floor(M*R)}}else{if(s){const R=Math.floor(s[3]*A.a*g.a*w.a*255),F=Math.floor(s[0]*A.r*g.r*w.r*255),D=Math.floor(s[1]*A.g*g.g*w.g*255),M=Math.floor(s[2]*A.b*g.b*w.b*255);P=R<<24|F<<16|D<<8|M}else{const R=Math.floor(A.a*g.a*w.a*255),F=Math.floor(A.r*g.r*w.r*255),D=Math.floor(A.g*g.g*w.g*255),M=Math.floor(A.b*g.b*w.b*255);P=R<<24|F<<16|D<<8|M}if(I=0,m.darkColor){const{r:R,g:F,b:D}=m.darkColor;I=Math.floor(R*255)<<16|Math.floor(F*255)<<8|Math.floor(D*255)}}a.isClipping()&&(a.clipTrianglesUnpacked(_,0,T,S,b,r),_=a.clippedVerticesTyped,v=a.clippedVerticesLength/r,b=a.clippedUVsTyped,T=a.clippedTrianglesTyped,S=a.clippedTrianglesLength);const C=this.commandPool.getCommand(v,S,r);if(C.blendMode=f.data.blendMode,C.texture=E,C.positions.set(_.subarray(0,v*r)),r>=3)for(let R=2,F=v*r;R=t*s&&n._indices.length>=e){r=n;break}if(r)this.pool.splice(this.pool.indexOf(r),1),r.next=void 0,r.numVertices=t,r.numIndices=e,r.positions=r._positions.subarray(0,t*s),r.uvs=r._uvs.subarray(0,t<<1),r.colors=r._colors.subarray(0,t),r.darkColors=r._darkColors.subarray(0,t),r.indices=r._indices.subarray(0,e);else{const n=new Float32Array(t*s),a=new Float32Array(t<<1),o=new Uint32Array(t),h=new Uint32Array(t),l=new Uint16Array(e);r={positions:n,uvs:a,colors:o,darkColors:h,indices:l,_positions:n,_uvs:a,_colors:o,_darkColors:h,_indices:l,numVertices:t,numIndices:e,blendMode:fr.Normal,texture:null}}return this.inUse.push(r),r}reset(){this.pool.push(...this.inUse),this.inUse.length=0}}const uO=Object.freeze(Object.defineProperty({__proto__:null,ATTACH_RETAIN:mc,ATTACH_SETUP:fc,AlphaTimeline:gu,Animation:Pl,AnimationState:qa,AnimationStateAdapter:kw,AnimationStateData:og,AssetCache:al,AssetManagerBase:Lw,AtlasAttachmentLoader:hg,Attachment:Ha,AttachmentTimeline:Yn,BinaryInput:dg,get BlendMode(){return fr},Bone:Gn,BoneData:io,BonePose:ol,BoneTimeline1:ki,BoneTimeline2:Ml,BoundingBoxAttachment:ro,CURRENT:cc,ClippingAttachment:zr,Color:Ft,Constraint:ta,ConstraintData:ea,ConstraintTimeline1:Qn,CurveTimeline:Fi,CurveTimeline1:dr,DebugUtils:Pw,DeformTimeline:bu,Downloader:lg,DrawOrder:cg,DrawOrderFolderTimeline:an,DrawOrderTimeline:Wr,Event:kl,EventData:Ou,EventQueue:ng,EventTimeline:jn,get EventType(){return ns},FIRST:uc,FakeTexture:Fw,FromProperty:dn,FromRotate:gl,FromScaleX:bl,FromScaleY:vl,FromShearY:_l,FromX:yl,FromY:xl,HOLD:va,IkConstraint:Ur,IkConstraintData:Ba,IkConstraintPose:ll,IkConstraintTimeline:vu,get Inherit(){return be},InheritTimeline:fu,IntSet:Cw,Interpolation:en,MODE:dc,MathUtils:pt,MeshAttachment:Vs,get MixFrom(){return At},PathAttachment:on,PathConstraint:cl,PathConstraintData:Oa,PathConstraintMixTimeline:Su,PathConstraintPose:hl,PathConstraintPositionTimeline:wu,PathConstraintSpacingTimeline:Tu,get Physics(){return Os},PhysicsConstraint:no,PhysicsConstraintDampingTimeline:Cu,PhysicsConstraintData:Da,PhysicsConstraintGravityTimeline:Mu,PhysicsConstraintInertiaTimeline:Eu,PhysicsConstraintMassTimeline:Iu,PhysicsConstraintMixTimeline:Ru,PhysicsConstraintPose:ul,PhysicsConstraintResetTimeline:ja,PhysicsConstraintStrengthTimeline:Au,PhysicsConstraintTimeline:Kr,PhysicsConstraintWindTimeline:Pu,PointAttachment:Rl,Pool:$a,Posed:Lu,PosedActive:Bu,PosedData:Fl,get PositionMode(){return Qs},Pow:Jp,PowOut:Iw,get Property(){return Bt},RGB2Timeline:xu,RGBA2Timeline:yu,RGBATimeline:mu,RGBTimeline:pu,RegionAttachment:_r,get RotateMode(){return Ti},RotateTimeline:Wa,SETUP:ag,ScaleTimeline:ou,ScaleXTimeline:lu,get ScaleYMode(){return es},ScaleYTimeline:hu,Sequence:nn,get SequenceMode(){return He},SequenceModeValues:ru,SequenceTimeline:za,ShearTimeline:cu,ShearXTimeline:uu,ShearYTimeline:du,Skeleton:Mi,SkeletonBinary:ug,SkeletonBounds:fg,SkeletonClipping:ao,SkeletonData:Bl,SkeletonJson:mg,SkeletonPhysicsMovement:pg,SkeletonRendererCore:Bw,Skin:Ka,SkinEntry:pc,Slider:ml,SliderData:yi,SliderMixTimeline:ku,SliderPose:fl,SliderTimeline:Fu,Slot:Ll,SlotCurveTimeline:so,SlotData:Du,SlotPose:dl,get SpacingMode(){return ke},StringSet:Zp,Texture:eu,TextureAtlas:nl,TextureAtlasPage:tg,TextureAtlasRegion:su,get TextureFilter(){return Oe},TextureRegion:Qp,get TextureWrap(){return xr},TimeKeeper:Mw,Timeline:ce,ToProperty:fn,ToRotate:Nu,ToScaleX:Vu,ToScaleY:Yu,ToShearY:Gu,ToX:Uu,ToY:Xu,TrackEntry:ig,TransformConstraint:Ol,TransformConstraintData:te,TransformConstraintPose:pl,TransformConstraintTimeline:_u,TranslateTimeline:iu,TranslateXTimeline:nu,TranslateYTimeline:au,Triangulator:Je,Utils:bt,Vector2:il,VertexAttachment:vr,WindowedMean:Rw,isBoneTimeline:sg,isConstraintTimeline:rg,isSlotTimeline:eg},Symbol.toStringTag,{value:"Module"}));if(typeof window<"u"&&window.PIXI){const i=window.require;window.require=t=>{if(i)return i(t);if(t.startsWith("@pixi/"))return window.PIXI}}const ni=class ni extends eu{constructor(e){super(e.resource.source);x(this,"texture");this.texture=Nt.from(e)}static from(e){return ni.textureMap.has(e)?ni.textureMap.get(e):new ni(e)}setFilters(e,s){this.texture.baseTexture.scaleMode=ni.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=ni.toPixiMipMap(e)}setWraps(e,s){this.texture.baseTexture.wrapMode=ni.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case Oe.Nearest:case Oe.MipMapNearestLinear:case Oe.MipMapNearestNearest:return Ns.NEAREST;case Oe.Linear:case Oe.MipMapLinearLinear:case Oe.MipMapLinearNearest:return Ns.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case Oe.Nearest:case Oe.Linear:return Ms.OFF;case Oe.MipMapNearestLinear:case Oe.MipMapNearestNearest:case Oe.MipMapLinearLinear:case Oe.MipMapLinearNearest:return Ms.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case xr.ClampToEdge:return Ps.CLAMP;case xr.MirroredRepeat:return Ps.MIRRORED_REPEAT;case xr.Repeat:return Ps.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case fr.Normal:return It.NORMAL;case fr.Additive:return It.ADD;case fr.Multiply:return It.MULTIPLY;case fr.Screen:return It.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};x(ni,"textureMap",new Map);let qn=ni;const ph="spineTextureAtlasLoader",aL={extension:gt.Asset,resolver:{test:i=>Ue(i,".atlas"),parse:i=>{var e,s;const t=i.split(".");return{resolution:parseFloat(((s=(e=_t.RETINA_PREFIX)==null?void 0:e.exec(i))==null?void 0:s[1])??"1"),format:t[t.length-2],src:i}}},loader:{name:ph,extension:{type:gt.LoadParser,priority:Ts.Normal,name:ph},test(i){return Ue(i,".atlas")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${ph}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return await t.text()},testParse(i,t){const e=Ue(t.src,".atlas"),s=typeof i=="string",r=t.loadParser===ph;return Promise.resolve((e||r)&&s)},unload(i){i.dispose()},async parse(i,t,e){var h;const s=t.data||{};let r=ye.dirname(t.src);r&&r.lastIndexOf("/")!==r.length-1&&(r+="/");const n=new nl(i);if(s.images instanceof Lt||typeof s.images=="string"){const l=s.images;s.images={},s.images[n.pages[0].name]=l}const a=[];let o=!0;for(const l of e.parsers)if(l.name==="loadTextures"){o=(h=l.config)==null?void 0:h.preferCreateImageBitmap;break}Cs.setPreferences({preferCreateImageBitmap:!1});for(const l of n.pages){const c=l.name,u=s!=null&&s.images?s.images[c]:void 0;if(u instanceof Lt)l.setTexture(qn.from(u));else{const d=u??ye.normalize([...r.split(ye.sep),c].join(ye.sep)),f={src:sl(d,t.src),data:{...s.imageMetadata,alphaMode:l.pma?Ke.PMA:Ke.UNPACK}},m=e.load(f).then(p=>{l.setTexture(qn.from(p.baseTexture))});a.push(m)}}return await Promise.all(a),Cs.setPreferences({preferCreateImageBitmap:o}),n}}};St.add(aL);const gh="spineSkeletonLoader";function oL(i){return i.hasOwnProperty("bones")}function lL(i){return i instanceof Uint8Array}const hL={extension:gt.Asset,loader:{name:gh,extension:{type:gt.LoadParser,priority:Ts.Normal,name:gh},test(i){return Ue(i,".skel")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${gh}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())},testParse(i,t){const e=Ue(t.src,".json")&&oL(i),s=Ue(t.src,".skel")&&lL(i),r=t.loadParser===gh;return Promise.resolve(e||s||r)}}};St.add(hL);class Ow extends er{constructor(t=!1){super();const e=new ne(void 0),s=new ne(void 0,!0),r=new ne(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,wt.FLOAT),this.addAttribute("aTextureCoord",s,2,!1,wt.FLOAT),this.addIndex(r)}}const cL=` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; uniform mat3 translationMatrix; uniform mat3 uTextureMatrix; varying vec2 vTextureCoord; void main(void) { gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy; } `,uL=` varying vec2 vTextureCoord; uniform vec4 uColor; uniform vec4 uDarkColor; uniform sampler2D uSampler; void main(void) { vec4 texColor = texture2D(uSampler, vTextureCoord); gl_FragColor.a = texColor.a * uColor.a; gl_FragColor.rgb = ((texColor.a - 1.0) * uDarkColor.a + 1.0 - texColor.rgb) * uDarkColor.rgb + texColor.rgb * uColor.rgb; } `;class Dw extends Js{constructor(e){const s={uSampler:e??Nt.EMPTY,alpha:1,uTextureMatrix:fe.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},r={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(ur.from(cL,uL),s);x(this,"uvMatrix");x(this,"batchable");x(this,"pluginName");x(this,"_tintRGB");x(this,"_darkTintRGB");x(this,"_colorDirty");x(this,"_alpha");x(this,"_tintColor");x(this,"_darkTintColor");this._colorDirty=!1,this.uvMatrix=new jc(s.uSampler),this.batchable=!0,this.pluginName=r.pluginName,this._tintColor=new Wt(r.tint),this._darkTintColor=new Wt(r.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=r.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(e){e!==this.darkTint&&(this._darkTintColor.setValue(e),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._colorDirty=!0)}get darkTint(){return this._darkTintColor.value}get tintValue(){return this._tintColor.toNumber()}get darkTintValue(){return this._darkTintColor.toNumber()}update(){this._colorDirty&&(this._colorDirty=!1,Wt.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),Wt.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class Nw extends zn{constructor(e){super(new Ow,new Dw(e),void 0,void 0);x(this,"_darkTintRGB",0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(e){this.shader.darkTint=e}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(e){const s=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=s.indexBuffer.data,this._tintRGB=r._tintRGB,this._darkTintRGB=r._darkTintRGB,this._texture=r.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}}const Ve=class Ve extends Nw{constructor(){super();x(this,"name","")}updateFromSpineData(e,s,r,n,a,o,h,l){var y,_;this.texture=e.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((y=u.data)==null?void 0:y.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((_=d.data)==null?void 0:_.length)!==c&&(d.data=new Float32Array(c));let f=0;const m=u.data,p=d.data;for(let v=0;v0){const o=new Ka("custom-skin");for(const h of this.skins){const l=n.findSkin(h);l!=null&&o.addSkin(l)}s.setSkin(o)}s.setupPose();const a=this.animation!=null?n.findAnimation(this.animation):null;if(a==null){s.updateWorldTransform(Os.update);const o=s.getBoundsRect(r);return o.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:o}else{let o=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;e.clearTracks(),e.setAnimation(0,a,!1);const u=Math.max(a.duration/this.timeStep,1);for(let f=0;f0?this.timeStep:0;e.update(m),e.apply(s),s.update(m),s.updateWorldTransform(Os.update);const p=s.getBoundsRect(r);o=Math.min(o,p.x),h=Math.min(h,p.y),l=Math.max(l,p.x+p.width),c=Math.max(c,p.y+p.height)}const d={x:o,y:h,width:l-o,height:c-h};return d.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:d}}}const $t=class $t extends fs{constructor(e){super();x(this,"skeleton");x(this,"state");x(this,"skeletonPhysics");x(this,"darkTint",!1);x(this,"hasNeverUpdated",!0);x(this,"_debug");x(this,"slotMeshFactory",()=>new yc);x(this,"beforeUpdateWorldTransforms",()=>{});x(this,"afterUpdateWorldTransforms",()=>{});x(this,"_autoUpdate",!1);x(this,"_ticker",ss.shared);x(this,"meshesCache",new Map);x(this,"lightColor",new Ft);x(this,"darkColor",new Ft);x(this,"clippingVertAux",new Float32Array(6));x(this,"_boundsProvider");x(this,"_boundsPoint",new Kt);x(this,"_boundsSpineID",-1);x(this,"_boundsSpineDirty",!0);x(this,"slotsObject",new Map);x(this,"verticesCache",bt.newFloatArray(1024));x(this,"clippingSlotToPixiMasks",{});e instanceof Bl?e={skeletonData:e}:"skeleton"in e&&(e=new.target.createOptions(e));const{autoUpdate:s=!0,boundsProvider:r,darkTint:n,skeletonData:a,ticker:o}=e;this.skeleton=new Mi(a),this.skeletonPhysics=new pg(this.skeleton,{readTransform:(h,l)=>this.readPhysicsTransform(h,l),worldToSkeleton:h=>this.pixiWorldCoordinatesToSkeleton(h)}),this.state=new qa(new og(a)),o&&(this._ticker=o),this.autoUpdate=s,this.boundsProvider=r,this.darkTint=n===void 0?this.skeleton.slots.some(h=>!!h.data.setupPose.darkColor):n,this.darkTint&&(this.slotMeshFactory=()=>new gc)}get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!e&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=e}get ticker(){return this._ticker}set ticker(e){e=e??ss.shared,this._ticker!==e&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),e.add(this.internalUpdate,this)),this._ticker=e)}get boundsProvider(){return this._boundsProvider}set boundsProvider(e){this._boundsProvider=e,e?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}update(e){this.internalUpdate(0,e)}internalUpdate(e,s){this.hasNeverUpdated=!1;const r=s??this._ticker.deltaMS/1e3;this.state.update(r),this.state.apply(this.skeleton),this.skeletonPhysics.applyTransformMovement(),this.beforeUpdateWorldTransforms(this),this.skeleton.update(r),this.skeleton.updateWorldTransform(Os.update),this.afterUpdateWorldTransforms(this)}readPhysicsTransform(e,s){const r=this.worldTransform;if(e.x=r.tx,e.y=r.ty,e.z=0,!s)return;let n=0;for(let a=this;a;a=a.parent)n+=a.rotation+(a.skew.y-a.skew.x)/2;e.rotation=n*180/Math.PI}updateTransform(){var e;this.renderMeshes(),this.sortChildren(),(e=this.debug)==null||e.renderDebug(this),super.updateTransform()}destroy(e){this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,s]of this.meshesCache)s==null||s.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(const s in this.clippingSlotToPixiMasks)this.clippingSlotToPixiMasks[s].destroy(),delete this.clippingSlotToPixiMasks[s];super.destroy(e)}unloadFromCache(){var r;const e=(r=this.skeleton)==null?void 0:r.data;if(!e)return!1;const s=$t.skeletonDataCacheKeys.get(e);return!s||$t.skeletonCache[s]!==e?!1:(delete $t.skeletonCache[s],$t.skeletonDataCacheKeys.delete(e),!0)}resetMeshes(){for(const[,e]of this.meshesCache)e.zIndex=-1,e.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(e){return this.meshesCache.has(e)}getMeshForSlot(e){let s=this.hasMeshForSlot(e)?this.meshesCache.get(e):null;return s?s.visible=!0:(s=this.slotMeshFactory(),this.addChild(s),this.meshesCache.set(e,s)),s}getSlotFromRef(e){let s;if(typeof e=="number"?s=this.skeleton.slots[e]:typeof e=="string"?s=this.skeleton.findSlot(e):s=e,!s)throw new Error(`No slot found with the given slot reference: ${e}`);return s}addSlotObject(e,s,r){var o;const n=this.getSlotFromRef(e),a=(o=this.slotsObject.get(n))==null?void 0:o.container;if(!(a&&a===s)){for(const[h,{container:l}]of this.slotsObject)if(h!==n&&l===s){this.removeSlotObject(h,s);break}a&&this.removeChild(a),this.slotsObject.set(n,{container:s,followAttachmentTimeline:(r==null?void 0:r.followAttachmentTimeline)||!1,followSlotColor:(r==null?void 0:r.followSlotColor)||!1}),this.addChild(s)}}getSlotObject(e){const s=this.slotsObject.get(this.getSlotFromRef(e));return s?s.container:void 0}removeSlotObject(e,s){var a;const r=this.getSlotFromRef(e),n=(a=this.slotsObject.get(r))==null?void 0:a.container;n&&(s&&s!==n||(this.removeChild(n),this.slotsObject.delete(r)))}removeSlotObjects(){for(const[,e]of this.slotsObject)e.container.removeFromParent();this.slotsObject.clear()}pixiMaskCleanup(e){const s=this.clippingSlotToPixiMasks[e.data.name];s&&(delete this.clippingSlotToPixiMasks[e.data.name],s.destroy())}updateSlotObject(e,s,r){const{container:n,followAttachmentTimeline:a}=e,o=s.appliedPose,h=a?!!o.attachment:!0,l=this.skeleton.drawOrder.appliedPose;if(n.visible=l.includes(s)&&h,n.visible){const c=s.bone.appliedPose,u=n.localTransform;u.a=c.a,u.b=c.c,u.c=-c.b,u.d=-c.d,u.tx=c.worldX,u.ty=c.worldY,n.transform.setFromMatrix(u),n.zIndex=r+1,n.alpha=this.skeleton.color.a*o.color.a,e.followSlotColor&&this.setSlotObjectTint(n,255*this.skeleton.color.r*o.color.r<<16|255*this.skeleton.color.g*o.color.g<<8|255*this.skeleton.color.b*o.color.b)}}setSlotObjectTint(e,s){const r=e;"tint"in r&&(r.tint=s);for(const n of r.children??[])this.setSlotObjectTint(n,s)}updateAndSetPixiMask(e,s){if($t.clipper.isClipping()&&e){let r=this.clippingSlotToPixiMasks[e.slot.data.name];if(r||(r=new gs,this.clippingSlotToPixiMasks[e.slot.data.name]=r,this.addChild(r)),!e.computed){e.computed=!0;const n=e.slot.appliedPose.attachment,a=n.worldVerticesLength;this.clippingVertAux.length>1)*y,T>this.verticesCache.length&&(this.verticesCache=bt.newFloatArray(T)),w.computeWorldVertices(S,d,0,w.worldVerticesLength,this.verticesCache,0,y),e=w.triangles;const E=_.sequence,A=E.resolveIndex(p);s=E.getUVs(A),b=(h=E.regions[A])==null?void 0:h.texture}else if(_ instanceof zr){$t.clipper.clipStart(S,d,_),r={slot:d,computed:!1};continue}else{this.hasMeshForSlot(d)&&(this.getMeshForSlot(d).visible=!1),$t.clipper.clipEnd(d),this.pixiMaskCleanup(d);continue}if(b!=null){const w=S.color,E=p.color,A=w.a*E.a*v.a;this.lightColor.set(w.r*E.r*v.r,w.g*E.g*v.g,w.b*E.b*v.b,A),p.darkColor!=null?this.darkColor.set(p.darkColor.r,p.darkColor.g,p.darkColor.b,1):this.darkColor.set(0,0,0,1);let P,I,C,R;if($t.clipper.isClipping()&&$t.clipper.clipTriangles(this.verticesCache,e,e.length,s,this.lightColor,this.darkColor,g,y))P=$t.clipper.clippedVertices,I=P.length,C=$t.clipper.clippedTriangles,R=C.length;else{const D=this.verticesCache;for(let M=2,O=0,k=T;M{if(this.drawEvents){const n=Math.abs(t.scale.x||t.scale.y||1),a=new Hp(r.data.name,{fontSize:this.eventFontSize/n,fill:this.eventFontColor,fontFamily:"monospace"});a.scale.x=Math.sign(t.scale.x),a.anchor.set(.5),e.eventText.addChild(a),setTimeout(()=>{a.destroyed||a.destroy()},250)}}}};e.parentDebugContainer.addChild(e.bones),e.parentDebugContainer.addChild(e.skeletonXY),e.parentDebugContainer.addChild(e.regionAttachmentsShape),e.parentDebugContainer.addChild(e.meshTrianglesLine),e.parentDebugContainer.addChild(e.meshHullLine),e.parentDebugContainer.addChild(e.clippingPolygon),e.parentDebugContainer.addChild(e.boundingBoxesRect),e.parentDebugContainer.addChild(e.boundingBoxesCircle),e.parentDebugContainer.addChild(e.boundingBoxesPolygon),e.parentDebugContainer.addChild(e.pathsCurve),e.parentDebugContainer.addChild(e.pathsLine),e.parentDebugContainer.addChild(e.eventText),e.parentDebugContainer.zIndex=9999999,e.parentDebugContainer.accessibleChildren=!1,e.parentDebugContainer.eventMode="none",e.parentDebugContainer.interactiveChildren=!1,t.addChild(e.parentDebugContainer),t.state.addListener(e.eventCallback),this.registeredSpines.set(t,e)}renderDebug(t){this.registeredSpines.has(t)||this.registerSpine(t);const e=this.registeredSpines.get(t);if(!e)return;t.addChild(e.parentDebugContainer),e.skeletonXY.clear(),e.regionAttachmentsShape.clear(),e.meshTrianglesLine.clear(),e.meshHullLine.clear(),e.clippingPolygon.clear(),e.boundingBoxesRect.clear(),e.boundingBoxesCircle.clear(),e.boundingBoxesPolygon.clear(),e.pathsCurve.clear(),e.pathsLine.clear();for(let n=e.bones.children.length;n>0;n--)e.bones.children[n-1].destroy({children:!0,texture:!0,baseTexture:!0});const s=Math.abs(t.scale.x||t.scale.y||1),r=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(t,e,r,s),this.drawPaths&&this.drawPathsFunc(t,e,r),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(t,e,r),this.drawClipping&&this.drawClippingFunc(t,e,r),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(t,e,r),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(t,e,r),this.drawEvents)for(const n of e.eventText.children)n.alpha-=.05,n.y-=2}drawBonesFunc(t,e,s,r){const n=t.skeleton,a=n.x,o=n.y,h=n.bones;e.skeletonXY.lineStyle(s,this.skeletonXYColor,1);for(let c=0,u=h.length;cy&&g<_?F=180*P+I:p>y&&g>_?F=-I:p_?F=I:g===_&&py?F=-90*P:p===y&&g<_?F=180*P:p===y&&g>_&&(F=0),C.rotation=F,C.lineStyle(s+R/2.4,this.bonesColor,1),C.beginFill(0,.6),C.drawCircle(0,E,R*1.2),C.endFill()}const l=s*3;e.skeletonXY.moveTo(a-l,o-l),e.skeletonXY.lineTo(a+l,o+l),e.skeletonXY.moveTo(a+l,o-l),e.skeletonXY.lineTo(a-l,o+l)}drawRegionAttachmentsFunc(t,e,s){const n=t.skeleton.slots;e.regionAttachmentsShape.lineStyle(s,this.regionAttachmentsColor,1);for(let a=0,o=n.length;a0){f=(f>>1)*2;let m=u[f-2],p=u[f-1];for(let g=0,y=f;g{if(e.boundingBoxesPolygon.lineStyle(s,this.boundingBoxesPolygonColor,1),e.boundingBoxesPolygon.beginFill(this.boundingBoxesPolygonColor,.1),l<3)throw new Error("Polygon must contain at least 3 vertices");const c=[],u=s*2;for(let d=0,f=o.length;d