reacthub-pixitweenjs 0.2.107-alpha.97 → 0.2.107-alpha.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(le,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("@pixi/react"),require("pixi.js"),require("gsap"),require("reacthub-react-bindings")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","pixi.js","gsap","reacthub-react-bindings"],P):(le=typeof globalThis<"u"?globalThis:le||self,P(le["reacthub-pixitweenjs"]={},le.React,le.PIXIReact,le.PIXI,le.gsap,le.reacthubReactBindings))})(this,function(le,P,te,Nh,k,kh){"use strict";function Ya(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const L=Ya(P),Ge=Ya(Nh);var Xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lh(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var Ka={exports:{}},Ti={};/**
1
+ (function(le,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("@pixi/react"),require("pixi.js"),require("gsap"),require("reacthub-react-bindings")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","pixi.js","gsap","reacthub-react-bindings"],P):(le=typeof globalThis<"u"?globalThis:le||self,P(le["reacthub-pixitweenjs"]={},le.React,le.PIXIReact,le.PIXI,le.gsap,le.reacthubReactBindings))})(this,function(le,P,te,Fh,k,Oh){"use strict";function Wa(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const D=Wa(P),$e=Wa(Fh);var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Nh(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var qa={exports:{}},yi={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Dh=P,Bh=Symbol.for("react.element"),Uh=Symbol.for("react.fragment"),$h=Object.prototype.hasOwnProperty,Gh=Dh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zh={key:!0,ref:!0,__self:!0,__source:!0};function Za(t,e,r){var i,n={},s=null,a=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)$h.call(e,i)&&!zh.hasOwnProperty(i)&&(n[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)n[i]===void 0&&(n[i]=e[i]);return{$$typeof:Bh,type:t,key:s,ref:a,props:n,_owner:Gh.current}}Ti.Fragment=Uh,Ti.jsx=Za,Ti.jsxs=Za,Ka.exports=Ti;var K=Ka.exports,Ut=(t=>(t.BlackAndWhite="BlackAndWhite",t.Sepia="Sepia",t.RetroVintage="RetroVintage",t.NightVision="NightVision",t.Normal="Normal",t.Vignette="Vignette",t.None="Normal",t))(Ut||{});let Qa;function Ja(){return Qa=document.body,Qa}function Oe(t,e,r){let i;return P.useEffect(()=>{i=i||Ja();const n=s=>{const a=s.detail;e(a)};return i.addEventListener(t,n,!1),()=>{i==null||i.removeEventListener(t,n,!1)}},r),n=>{i=n}}function ar(t,e){const r=Ja(),i=new CustomEvent(t,{detail:e});r.dispatchEvent(i)}function jh(){let t;function e(r){t=r}return e.emit=function(r,i){const n=new CustomEvent(r,{bubbles:!0,detail:i});t==null||t.dispatchEvent(n)},e}const Et=L.createContext({}),we={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END"},Hh=({children:t})=>{const[e,r]=P.useState(0),i=P.useRef(),n=P.useRef(),s=P.useRef(0),a=P.useRef(!1),o=P.useRef(!1),[u,h]=P.useState(!1);P.useLayoutEffect(()=>(n.current=k.context(()=>{i.current&&i.current.progress(0).kill(),i.current&&i.current.clear(),i.current&&k.killTweensOf(i.current),i.current=k.timeline({paused:!0,defaults:{duration:0}})}),()=>{i.current&&i.current.revert(),n.current.revert()}),[]);const d=P.useCallback(()=>{if(i.current){let x=i.current.time();x<s.current?a.current=!0:a.current=!1,s.current=x}},[]);P.useEffect(()=>{if(i.current){const _=i.current;_.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){_.pause(),d()}).eventCallback("onUpdate",function(){d()}).eventCallback("onRepeat",function(){console.log("onrepeat",_.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",_.progress())}).eventCallback("onComplete",function(){_.seek(0),_.pause(),ar(we.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),d()})}},[]);const l=P.useCallback(()=>{i.current&&i.current.revert()},[]),c=P.useCallback(()=>{i.current&&i.current.restart()},[]),f=P.useCallback(()=>{if(i.current){const _=i.current;_.repeat(1),_.restart()}},[]),p=P.useCallback(_=>{i.current&&i.current.seek(_)},[]),m=P.useCallback(()=>{i.current&&i.current.seek(4)},[]),v=P.useCallback(()=>{const _=i.current;return _?_.totalDuration():0},[]),g=()=>{i.current&&(i.current.pause(),ar(we.PAUSE))},y=()=>{i.current&&(i.current.resume(),ar(we.RESUME))};return Oe(we.SEEK_START,()=>{o.current=!0}),Oe(we.SCRUBBER_PLAY,()=>{y()}),Oe(we.SCRUBBER_PAUSE,()=>{g()}),Oe(we.SCRUBBER_SEEK,_=>{p(_)}),Oe(we.SEEK_END,()=>{o.current=!1}),Oe(we.REVERSE_MODE_START,()=>{a.current=!0}),Oe(we.REVERSE_MODE_END,()=>{a.current=!1}),Oe(we.SCRUBBER_PROGRESS_UPDATE,_=>{}),K.jsx(Et.Provider,{value:{gsapCtx:n,tl:i,handlePlay:y,handlePause:g,handleReset:l,handleSeek:p,handleSeekTest:m,handleRestart:c,handleRepeat:f,playerTimeRef:s,getTimelineDuration:v,totalDuration:e,setTotalDuration:r,reverseModeRef:a,dragModeRef:o,isRemotion:u,setIsRemotion:h},children:t})},Vh=({pixiTransformerRef:t,imageRef:e,isMounted:r,transformCommit:i,transformChange:n,mouseoverEvent:s,onDoubleClick:a,uniqueId:o="",isText:u=!1})=>{const h=Ge.utils.string2hex("#F3C409"),d=Ge.utils.string2hex("#F3C409"),l=L.useRef({isDragging:!1}),c=300,f=L.useRef(0),p=L.useCallback(()=>{s&&!l.current.isDragging&&s(!0)},[s]),m=L.useCallback(()=>{s&&!l.current.isDragging&&s(!1)},[s]),v=L.useCallback(()=>{l.current.isDragging=!0;const _=new Date().getTime();_-f.current<c&&a&&a(),f.current=_},[]),g=L.useCallback(_=>{l.current.isDragging=!0,n&&n(_),ar(we.TRANSFORMER_DRAG_START,{uniqueId:"timeline"})},[n]),y=L.useCallback(()=>{if(e.current===null)return;const _=e.current.x,x=e.current.y,b=e.current.width,T=e.current.height,w=e.current.rotation,S=[e.current.scale.x,e.current.scale.y],A=S[0]<0?-1:1,C=S[1]<0?-1:1;i&&(i({uniqueId:o,transformation:{x:Math.round(_),y:Math.round(x),width:Math.round(Math.max(5,b)),height:Math.round(Math.max(5,T)),rotation:w,scale:u?S:[A,C]}}),ar(we.TRANSFORMER_DRAG_END,{uniqueId:"timeline"})),l.current.isDragging=!1},[i]);return L.useEffect(()=>(t.current&&(t.current.on("mouseover",p),t.current.on("mouseout",m),t.current.on("mousedown",v)),()=>{t.current&&(t.current.off("mouseover",p),t.current.off("mouseout",m),t.current.off("mousedown",v))}),[]),K.jsx(kh.Transformer,{ref:t,group:r?[e.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:2,color:d},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:h,shape:"circle",radius:10},transformchange:g,transformcommit:y})};function Xh(){this.__data__=[],this.size=0}var Wh=Xh;function qh(t,e){return t===e||t!==t&&e!==e}var eo=qh,Yh=eo;function Kh(t,e){for(var r=t.length;r--;)if(Yh(t[r][0],e))return r;return-1}var wi=Kh,Zh=wi,Qh=Array.prototype,Jh=Qh.splice;function ef(t){var e=this.__data__,r=Zh(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():Jh.call(e,r,1),--this.size,!0}var tf=ef,rf=wi;function nf(t){var e=this.__data__,r=rf(e,t);return r<0?void 0:e[r][1]}var sf=nf,af=wi;function of(t){return af(this.__data__,t)>-1}var lf=of,uf=wi;function cf(t,e){var r=this.__data__,i=uf(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}var hf=cf,ff=Wh,df=tf,pf=sf,mf=lf,gf=hf;function or(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}or.prototype.clear=ff,or.prototype.delete=df,or.prototype.get=pf,or.prototype.has=mf,or.prototype.set=gf;var Si=or,vf=Si;function _f(){this.__data__=new vf,this.size=0}var yf=_f;function xf(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var bf=xf;function Tf(t){return this.__data__.get(t)}var wf=Tf;function Sf(t){return this.__data__.has(t)}var Af=Sf,Ef=typeof Xe=="object"&&Xe&&Xe.Object===Object&&Xe,to=Ef,Cf=to,If=typeof self=="object"&&self&&self.Object===Object&&self,Rf=Cf||If||Function("return this")(),ht=Rf,Pf=ht,Mf=Pf.Symbol,Ai=Mf,ro=Ai,io=Object.prototype,Ff=io.hasOwnProperty,Of=io.toString,zr=ro?ro.toStringTag:void 0;function Nf(t){var e=Ff.call(t,zr),r=t[zr];try{t[zr]=void 0;var i=!0}catch{}var n=Of.call(t);return i&&(e?t[zr]=r:delete t[zr]),n}var kf=Nf,Lf=Object.prototype,Df=Lf.toString;function Bf(t){return Df.call(t)}var Uf=Bf,no=Ai,$f=kf,Gf=Uf,zf="[object Null]",jf="[object Undefined]",so=no?no.toStringTag:void 0;function Hf(t){return t==null?t===void 0?jf:zf:so&&so in Object(t)?$f(t):Gf(t)}var jr=Hf;function Vf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Hr=Vf,Xf=jr,Wf=Hr,qf="[object AsyncFunction]",Yf="[object Function]",Kf="[object GeneratorFunction]",Zf="[object Proxy]";function Qf(t){if(!Wf(t))return!1;var e=Xf(t);return e==Yf||e==Kf||e==qf||e==Zf}var ao=Qf,Jf=ht,ed=Jf["__core-js_shared__"],td=ed,Vn=td,oo=function(){var t=/[^.]+$/.exec(Vn&&Vn.keys&&Vn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function rd(t){return!!oo&&oo in t}var id=rd,nd=Function.prototype,sd=nd.toString;function ad(t){if(t!=null){try{return sd.call(t)}catch{}try{return t+""}catch{}}return""}var lo=ad,od=ao,ld=id,ud=Hr,cd=lo,hd=/[\\^$.*+?()[\]{}|]/g,fd=/^\[object .+?Constructor\]$/,dd=Function.prototype,pd=Object.prototype,md=dd.toString,gd=pd.hasOwnProperty,vd=RegExp("^"+md.call(gd).replace(hd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _d(t){if(!ud(t)||ld(t))return!1;var e=od(t)?vd:fd;return e.test(cd(t))}var yd=_d;function xd(t,e){return t==null?void 0:t[e]}var bd=xd,Td=yd,wd=bd;function Sd(t,e){var r=wd(t,e);return Td(r)?r:void 0}var lr=Sd,Ad=lr,Ed=ht,Cd=Ad(Ed,"Map"),Xn=Cd,Id=lr,Rd=Id(Object,"create"),Ei=Rd,uo=Ei;function Pd(){this.__data__=uo?uo(null):{},this.size=0}var Md=Pd;function Fd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Od=Fd,Nd=Ei,kd="__lodash_hash_undefined__",Ld=Object.prototype,Dd=Ld.hasOwnProperty;function Bd(t){var e=this.__data__;if(Nd){var r=e[t];return r===kd?void 0:r}return Dd.call(e,t)?e[t]:void 0}var Ud=Bd,$d=Ei,Gd=Object.prototype,zd=Gd.hasOwnProperty;function jd(t){var e=this.__data__;return $d?e[t]!==void 0:zd.call(e,t)}var Hd=jd,Vd=Ei,Xd="__lodash_hash_undefined__";function Wd(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Vd&&e===void 0?Xd:e,this}var qd=Wd,Yd=Md,Kd=Od,Zd=Ud,Qd=Hd,Jd=qd;function ur(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}ur.prototype.clear=Yd,ur.prototype.delete=Kd,ur.prototype.get=Zd,ur.prototype.has=Qd,ur.prototype.set=Jd;var ep=ur,co=ep,tp=Si,rp=Xn;function ip(){this.size=0,this.__data__={hash:new co,map:new(rp||tp),string:new co}}var np=ip;function sp(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ap=sp,op=ap;function lp(t,e){var r=t.__data__;return op(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ci=lp,up=Ci;function cp(t){var e=up(this,t).delete(t);return this.size-=e?1:0,e}var hp=cp,fp=Ci;function dp(t){return fp(this,t).get(t)}var pp=dp,mp=Ci;function gp(t){return mp(this,t).has(t)}var vp=gp,_p=Ci;function yp(t,e){var r=_p(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}var xp=yp,bp=np,Tp=hp,wp=pp,Sp=vp,Ap=xp;function cr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}cr.prototype.clear=bp,cr.prototype.delete=Tp,cr.prototype.get=wp,cr.prototype.has=Sp,cr.prototype.set=Ap;var Wn=cr,Ep=Si,Cp=Xn,Ip=Wn,Rp=200;function Pp(t,e){var r=this.__data__;if(r instanceof Ep){var i=r.__data__;if(!Cp||i.length<Rp-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ip(i)}return r.set(t,e),this.size=r.size,this}var Mp=Pp,Fp=Si,Op=yf,Np=bf,kp=wf,Lp=Af,Dp=Mp;function hr(t){var e=this.__data__=new Fp(t);this.size=e.size}hr.prototype.clear=Op,hr.prototype.delete=Np,hr.prototype.get=kp,hr.prototype.has=Lp,hr.prototype.set=Dp;var ho=hr,Bp="__lodash_hash_undefined__";function Up(t){return this.__data__.set(t,Bp),this}var $p=Up;function Gp(t){return this.__data__.has(t)}var zp=Gp,jp=Wn,Hp=$p,Vp=zp;function Ii(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new jp;++e<r;)this.add(t[e])}Ii.prototype.add=Ii.prototype.push=Hp,Ii.prototype.has=Vp;var Xp=Ii;function Wp(t,e){for(var r=-1,i=t==null?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}var qp=Wp;function Yp(t,e){return t.has(e)}var Kp=Yp,Zp=Xp,Qp=qp,Jp=Kp,em=1,tm=2;function rm(t,e,r,i,n,s){var a=r&em,o=t.length,u=e.length;if(o!=u&&!(a&&u>o))return!1;var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var l=-1,c=!0,f=r&tm?new Zp:void 0;for(s.set(t,e),s.set(e,t);++l<o;){var p=t[l],m=e[l];if(i)var v=a?i(m,p,l,e,t,s):i(p,m,l,t,e,s);if(v!==void 0){if(v)continue;c=!1;break}if(f){if(!Qp(e,function(g,y){if(!Jp(f,y)&&(p===g||n(p,g,r,i,s)))return f.push(y)})){c=!1;break}}else if(!(p===m||n(p,m,r,i,s))){c=!1;break}}return s.delete(t),s.delete(e),c}var fo=rm,im=ht,nm=im.Uint8Array,sm=nm;function am(t){var e=-1,r=Array(t.size);return t.forEach(function(i,n){r[++e]=[n,i]}),r}var om=am;function lm(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}var um=lm,po=Ai,mo=sm,cm=eo,hm=fo,fm=om,dm=um,pm=1,mm=2,gm="[object Boolean]",vm="[object Date]",_m="[object Error]",ym="[object Map]",xm="[object Number]",bm="[object RegExp]",Tm="[object Set]",wm="[object String]",Sm="[object Symbol]",Am="[object ArrayBuffer]",Em="[object DataView]",go=po?po.prototype:void 0,qn=go?go.valueOf:void 0;function Cm(t,e,r,i,n,s,a){switch(r){case Em:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Am:return!(t.byteLength!=e.byteLength||!s(new mo(t),new mo(e)));case gm:case vm:case xm:return cm(+t,+e);case _m:return t.name==e.name&&t.message==e.message;case bm:case wm:return t==e+"";case ym:var o=fm;case Tm:var u=i&pm;if(o||(o=dm),t.size!=e.size&&!u)return!1;var h=a.get(t);if(h)return h==e;i|=mm,a.set(t,e);var d=hm(o(t),o(e),i,n,s,a);return a.delete(t),d;case Sm:if(qn)return qn.call(t)==qn.call(e)}return!1}var Im=Cm;function Rm(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}var Pm=Rm,Mm=Array.isArray,ft=Mm,Fm=Pm,Om=ft;function Nm(t,e,r){var i=e(t);return Om(t)?i:Fm(i,r(t))}var km=Nm;function Lm(t,e){for(var r=-1,i=t==null?0:t.length,n=0,s=[];++r<i;){var a=t[r];e(a,r,t)&&(s[n++]=a)}return s}var Dm=Lm;function Bm(){return[]}var Um=Bm,$m=Dm,Gm=Um,zm=Object.prototype,jm=zm.propertyIsEnumerable,vo=Object.getOwnPropertySymbols,Hm=vo?function(t){return t==null?[]:(t=Object(t),$m(vo(t),function(e){return jm.call(t,e)}))}:Gm,Vm=Hm;function Xm(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}var Wm=Xm;function qm(t){return t!=null&&typeof t=="object"}var Vr=qm,Ym=jr,Km=Vr,Zm="[object Arguments]";function Qm(t){return Km(t)&&Ym(t)==Zm}var Jm=Qm,_o=Jm,e0=Vr,yo=Object.prototype,t0=yo.hasOwnProperty,r0=yo.propertyIsEnumerable,i0=_o(function(){return arguments}())?_o:function(t){return e0(t)&&t0.call(t,"callee")&&!r0.call(t,"callee")},Yn=i0,Ri={exports:{}};function n0(){return!1}var s0=n0;Ri.exports,function(t,e){var r=ht,i=s0,n=e&&!e.nodeType&&e,s=n&&!0&&t&&!t.nodeType&&t,a=s&&s.exports===n,o=a?r.Buffer:void 0,u=o?o.isBuffer:void 0,h=u||i;t.exports=h}(Ri,Ri.exports);var Kn=Ri.exports,a0=9007199254740991,o0=/^(?:0|[1-9]\d*)$/;function l0(t,e){var r=typeof t;return e=e??a0,!!e&&(r=="number"||r!="symbol"&&o0.test(t))&&t>-1&&t%1==0&&t<e}var xo=l0,u0=9007199254740991;function c0(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=u0}var Zn=c0,h0=jr,f0=Zn,d0=Vr,p0="[object Arguments]",m0="[object Array]",g0="[object Boolean]",v0="[object Date]",_0="[object Error]",y0="[object Function]",x0="[object Map]",b0="[object Number]",T0="[object Object]",w0="[object RegExp]",S0="[object Set]",A0="[object String]",E0="[object WeakMap]",C0="[object ArrayBuffer]",I0="[object DataView]",R0="[object Float32Array]",P0="[object Float64Array]",M0="[object Int8Array]",F0="[object Int16Array]",O0="[object Int32Array]",N0="[object Uint8Array]",k0="[object Uint8ClampedArray]",L0="[object Uint16Array]",D0="[object Uint32Array]",_e={};_e[R0]=_e[P0]=_e[M0]=_e[F0]=_e[O0]=_e[N0]=_e[k0]=_e[L0]=_e[D0]=!0,_e[p0]=_e[m0]=_e[C0]=_e[g0]=_e[I0]=_e[v0]=_e[_0]=_e[y0]=_e[x0]=_e[b0]=_e[T0]=_e[w0]=_e[S0]=_e[A0]=_e[E0]=!1;function B0(t){return d0(t)&&f0(t.length)&&!!_e[h0(t)]}var U0=B0;function $0(t){return function(e){return t(e)}}var G0=$0,Pi={exports:{}};Pi.exports,function(t,e){var r=to,i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,s=n&&n.exports===i,a=s&&r.process,o=function(){try{var u=n&&n.require&&n.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();t.exports=o}(Pi,Pi.exports);var z0=Pi.exports,j0=U0,H0=G0,bo=z0,To=bo&&bo.isTypedArray,V0=To?H0(To):j0,Qn=V0,X0=Wm,W0=Yn,q0=ft,Y0=Kn,K0=xo,Z0=Qn,Q0=Object.prototype,J0=Q0.hasOwnProperty;function eg(t,e){var r=q0(t),i=!r&&W0(t),n=!r&&!i&&Y0(t),s=!r&&!i&&!n&&Z0(t),a=r||i||n||s,o=a?X0(t.length,String):[],u=o.length;for(var h in t)(e||J0.call(t,h))&&!(a&&(h=="length"||n&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||K0(h,u)))&&o.push(h);return o}var tg=eg,rg=Object.prototype;function ig(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||rg;return t===r}var wo=ig;function ng(t,e){return function(r){return t(e(r))}}var sg=ng,ag=sg,og=ag(Object.keys,Object),lg=og,ug=wo,cg=lg,hg=Object.prototype,fg=hg.hasOwnProperty;function dg(t){if(!ug(t))return cg(t);var e=[];for(var r in Object(t))fg.call(t,r)&&r!="constructor"&&e.push(r);return e}var So=dg,pg=ao,mg=Zn;function gg(t){return t!=null&&mg(t.length)&&!pg(t)}var Mi=gg,vg=tg,_g=So,yg=Mi;function xg(t){return yg(t)?vg(t):_g(t)}var Jn=xg,bg=km,Tg=Vm,wg=Jn;function Sg(t){return bg(t,wg,Tg)}var Ag=Sg,Ao=Ag,Eg=1,Cg=Object.prototype,Ig=Cg.hasOwnProperty;function Rg(t,e,r,i,n,s){var a=r&Eg,o=Ao(t),u=o.length,h=Ao(e),d=h.length;if(u!=d&&!a)return!1;for(var l=u;l--;){var c=o[l];if(!(a?c in e:Ig.call(e,c)))return!1}var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var m=!0;s.set(t,e),s.set(e,t);for(var v=a;++l<u;){c=o[l];var g=t[c],y=e[c];if(i)var _=a?i(y,g,c,e,t,s):i(g,y,c,t,e,s);if(!(_===void 0?g===y||n(g,y,r,i,s):_)){m=!1;break}v||(v=c=="constructor")}if(m&&!v){var x=t.constructor,b=e.constructor;x!=b&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof b=="function"&&b instanceof b)&&(m=!1)}return s.delete(t),s.delete(e),m}var Pg=Rg,Mg=lr,Fg=ht,Og=Mg(Fg,"DataView"),Ng=Og,kg=lr,Lg=ht,Dg=kg(Lg,"Promise"),Bg=Dg,Ug=lr,$g=ht,Gg=Ug($g,"Set"),zg=Gg,jg=lr,Hg=ht,Vg=jg(Hg,"WeakMap"),Xg=Vg,es=Ng,ts=Xn,rs=Bg,is=zg,ns=Xg,Eo=jr,fr=lo,Co="[object Map]",Wg="[object Object]",Io="[object Promise]",Ro="[object Set]",Po="[object WeakMap]",Mo="[object DataView]",qg=fr(es),Yg=fr(ts),Kg=fr(rs),Zg=fr(is),Qg=fr(ns),$t=Eo;(es&&$t(new es(new ArrayBuffer(1)))!=Mo||ts&&$t(new ts)!=Co||rs&&$t(rs.resolve())!=Io||is&&$t(new is)!=Ro||ns&&$t(new ns)!=Po)&&($t=function(t){var e=Eo(t),r=e==Wg?t.constructor:void 0,i=r?fr(r):"";if(i)switch(i){case qg:return Mo;case Yg:return Co;case Kg:return Io;case Zg:return Ro;case Qg:return Po}return e});var Fo=$t,ss=ho,Jg=fo,ev=Im,tv=Pg,Oo=Fo,No=ft,ko=Kn,rv=Qn,iv=1,Lo="[object Arguments]",Do="[object Array]",Fi="[object Object]",nv=Object.prototype,Bo=nv.hasOwnProperty;function sv(t,e,r,i,n,s){var a=No(t),o=No(e),u=a?Do:Oo(t),h=o?Do:Oo(e);u=u==Lo?Fi:u,h=h==Lo?Fi:h;var d=u==Fi,l=h==Fi,c=u==h;if(c&&ko(t)){if(!ko(e))return!1;a=!0,d=!1}if(c&&!d)return s||(s=new ss),a||rv(t)?Jg(t,e,r,i,n,s):ev(t,e,u,r,i,n,s);if(!(r&iv)){var f=d&&Bo.call(t,"__wrapped__"),p=l&&Bo.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,v=p?e.value():e;return s||(s=new ss),n(m,v,r,i,s)}}return c?(s||(s=new ss),tv(t,e,r,i,n,s)):!1}var av=sv,ov=av,Uo=Vr;function $o(t,e,r,i,n){return t===e?!0:t==null||e==null||!Uo(t)&&!Uo(e)?t!==t&&e!==e:ov(t,e,r,i,$o,n)}var as=$o,lv=as;function uv(t,e){return lv(t,e)}var cv=uv;const hv=Bt(cv),fv=(t,e)=>{const r=P.useRef(!0),i=P.useRef(e);P.useEffect(()=>{const n=i.current.every((s,a)=>hv(s,e[a]));(r.current||!n)&&t(),r.current=!1,i.current=e},e)};function dv(t,e=700){const[r,i]=P.useState(t);return fv(()=>{const n=setTimeout(()=>{i(t)},e);return()=>{clearTimeout(n)}},[t,e]),r}var pv=So,mv=Fo,gv=Yn,vv=ft,_v=Mi,yv=Kn,xv=wo,bv=Qn,Tv="[object Map]",wv="[object Set]",Sv=Object.prototype,Av=Sv.hasOwnProperty;function Ev(t){if(t==null)return!0;if(_v(t)&&(vv(t)||typeof t=="string"||typeof t.splice=="function"||yv(t)||bv(t)||gv(t)))return!t.length;var e=mv(t);if(e==Tv||e==wv)return!t.size;if(xv(t))return!pv(t).length;for(var r in t)if(Av.call(t,r))return!1;return!0}var Cv=Ev;const dr=Bt(Cv);var os=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(os||{});const Go={normal:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:0},lensflare:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:1},filmstrip:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/frames_filmstrip_5.png",blendmode:"ADD",alpha:1},grunge:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/pixi_overlay_grunge_60.jpg",blendmode:"ADD",alpha:1},bricks:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/bricks_Overlay_100.jpg",blendmode:"MULTIPLY",alpha:1}},Iv=t=>{const{overlay:e,width:r,height:i,x:n,y:s}=t,{src:a,blendmode:o}=Go[e]||Go.normal;return K.jsx(te.TilingSprite,{image:a,width:r,height:i,x:n,y:s,tilePosition:{x:0,y:0},tileScale:.5,alpha:.5,anchor:.5})};/*!
9
+ */var kh=P,Lh=Symbol.for("react.element"),Dh=Symbol.for("react.fragment"),Bh=Object.prototype.hasOwnProperty,Uh=kh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$h={key:!0,ref:!0,__self:!0,__source:!0};function Ya(t,e,r){var i,n={},s=null,a=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)Bh.call(e,i)&&!$h.hasOwnProperty(i)&&(n[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)n[i]===void 0&&(n[i]=e[i]);return{$$typeof:Lh,type:t,key:s,ref:a,props:n,_owner:Uh.current}}yi.Fragment=Dh,yi.jsx=Ya,yi.jsxs=Ya,qa.exports=yi;var Z=qa.exports,Dt=(t=>(t.BlackAndWhite="BlackAndWhite",t.Sepia="Sepia",t.RetroVintage="RetroVintage",t.NightVision="NightVision",t.Normal="Normal",t.Vignette="Vignette",t.None="Normal",t))(Dt||{});let Ka;function Za(){return Ka=document.body,Ka}function Oe(t,e,r){let i;return P.useEffect(()=>{i=i||Za();const n=s=>{const a=s.detail;e(a)};return i.addEventListener(t,n,!1),()=>{i==null||i.removeEventListener(t,n,!1)}},r),n=>{i=n}}function nr(t,e){const r=Za(),i=new CustomEvent(t,{detail:e});r.dispatchEvent(i)}function Gh(){let t;function e(r){t=r}return e.emit=function(r,i){const n=new CustomEvent(r,{bubbles:!0,detail:i});t==null||t.dispatchEvent(n)},e}const At=D.createContext({}),we={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END"},zh=({children:t})=>{const[e,r]=P.useState(0),i=P.useRef(),n=P.useRef(),s=P.useRef(0),a=P.useRef(!1),o=P.useRef(!1),[u,h]=P.useState(!1);P.useLayoutEffect(()=>(n.current=k.context(()=>{i.current&&i.current.progress(0).kill(),i.current&&i.current.clear(),i.current&&k.killTweensOf(i.current),i.current=k.timeline({paused:!0,defaults:{duration:0}})}),()=>{i.current&&i.current.revert(),n.current.revert()}),[]);const d=P.useCallback(()=>{if(i.current){let x=i.current.time();x<s.current?a.current=!0:a.current=!1,s.current=x}},[]);P.useEffect(()=>{if(i.current){const _=i.current;_.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){_.pause(),d()}).eventCallback("onUpdate",function(){d()}).eventCallback("onRepeat",function(){console.log("onrepeat",_.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",_.progress())}).eventCallback("onComplete",function(){_.seek(0),_.pause(),nr(we.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),d()})}},[]);const l=P.useCallback(()=>{i.current&&i.current.revert()},[]),c=P.useCallback(()=>{i.current&&i.current.restart()},[]),f=P.useCallback(()=>{if(i.current){const _=i.current;_.repeat(1),_.restart()}},[]),p=P.useCallback(_=>{i.current&&i.current.seek(_)},[]),m=P.useCallback(()=>{i.current&&i.current.seek(4)},[]),v=P.useCallback(()=>{const _=i.current;return _?_.totalDuration():0},[]),g=()=>{i.current&&(i.current.pause(),nr(we.PAUSE))},y=()=>{i.current&&(i.current.resume(),nr(we.RESUME))};return Oe(we.SEEK_START,()=>{o.current=!0}),Oe(we.SCRUBBER_PLAY,()=>{y()}),Oe(we.SCRUBBER_PAUSE,()=>{g()}),Oe(we.SCRUBBER_SEEK,_=>{p(_)}),Oe(we.SEEK_END,()=>{o.current=!1}),Oe(we.REVERSE_MODE_START,()=>{a.current=!0}),Oe(we.REVERSE_MODE_END,()=>{a.current=!1}),Oe(we.SCRUBBER_PROGRESS_UPDATE,_=>{}),Z.jsx(At.Provider,{value:{gsapCtx:n,tl:i,handlePlay:y,handlePause:g,handleReset:l,handleSeek:p,handleSeekTest:m,handleRestart:c,handleRepeat:f,playerTimeRef:s,getTimelineDuration:v,totalDuration:e,setTotalDuration:r,reverseModeRef:a,dragModeRef:o,isRemotion:u,setIsRemotion:h},children:t})},jh=({pixiTransformerRef:t,imageRef:e,isMounted:r,transformCommit:i,transformChange:n,mouseoverEvent:s,onDoubleClick:a,uniqueId:o="",isText:u=!1})=>{const h=$e.utils.string2hex("#F3C409"),d=$e.utils.string2hex("#F3C409"),l=D.useRef({isDragging:!1}),c=300,f=D.useRef(0),p=D.useCallback(()=>{s&&!l.current.isDragging&&s(!0)},[s]),m=D.useCallback(()=>{s&&!l.current.isDragging&&s(!1)},[s]),v=D.useCallback(()=>{l.current.isDragging=!0;const _=new Date().getTime();_-f.current<c&&a&&a(),f.current=_},[]),g=D.useCallback(_=>{l.current.isDragging=!0,n&&n(_),nr(we.TRANSFORMER_DRAG_START,{uniqueId:"timeline"})},[n]),y=D.useCallback(()=>{if(e.current===null)return;const _=e.current.x,x=e.current.y,b=e.current.width,T=e.current.height,w=e.current.rotation,S=[e.current.scale.x,e.current.scale.y],A=S[0]<0?-1:1,I=S[1]<0?-1:1;i&&(i({uniqueId:o,transformation:{x:Math.round(_),y:Math.round(x),width:Math.round(Math.max(5,b)),height:Math.round(Math.max(5,T)),rotation:w,scale:u?S:[A,I]}}),nr(we.TRANSFORMER_DRAG_END,{uniqueId:"timeline"})),l.current.isDragging=!1},[i]);return D.useEffect(()=>(t.current&&(t.current.on("mouseover",p),t.current.on("mouseout",m),t.current.on("mousedown",v)),()=>{t.current&&(t.current.off("mouseover",p),t.current.off("mouseout",m),t.current.off("mousedown",v))}),[]),Z.jsx(Oh.Transformer,{ref:t,group:r?[e.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:2,color:d},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:h,shape:"circle",radius:10},transformchange:g,transformcommit:y})};function Hh(){this.__data__=[],this.size=0}var Vh=Hh;function Xh(t,e){return t===e||t!==t&&e!==e}var Qa=Xh,Wh=Qa;function qh(t,e){for(var r=t.length;r--;)if(Wh(t[r][0],e))return r;return-1}var xi=qh,Yh=xi,Kh=Array.prototype,Zh=Kh.splice;function Qh(t){var e=this.__data__,r=Yh(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():Zh.call(e,r,1),--this.size,!0}var Jh=Qh,ef=xi;function tf(t){var e=this.__data__,r=ef(e,t);return r<0?void 0:e[r][1]}var rf=tf,nf=xi;function sf(t){return nf(this.__data__,t)>-1}var af=sf,of=xi;function lf(t,e){var r=this.__data__,i=of(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}var uf=lf,cf=Vh,hf=Jh,ff=rf,df=af,pf=uf;function sr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}sr.prototype.clear=cf,sr.prototype.delete=hf,sr.prototype.get=ff,sr.prototype.has=df,sr.prototype.set=pf;var bi=sr,mf=bi;function gf(){this.__data__=new mf,this.size=0}var vf=gf;function _f(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var yf=_f;function xf(t){return this.__data__.get(t)}var bf=xf;function Tf(t){return this.__data__.has(t)}var wf=Tf,Sf=typeof Ve=="object"&&Ve&&Ve.Object===Object&&Ve,Ja=Sf,Af=Ja,Ef=typeof self=="object"&&self&&self.Object===Object&&self,Cf=Af||Ef||Function("return this")(),ht=Cf,If=ht,Rf=If.Symbol,Ti=Rf,eo=Ti,to=Object.prototype,Pf=to.hasOwnProperty,Mf=to.toString,Ur=eo?eo.toStringTag:void 0;function Ff(t){var e=Pf.call(t,Ur),r=t[Ur];try{t[Ur]=void 0;var i=!0}catch{}var n=Mf.call(t);return i&&(e?t[Ur]=r:delete t[Ur]),n}var Of=Ff,Nf=Object.prototype,kf=Nf.toString;function Lf(t){return kf.call(t)}var Df=Lf,ro=Ti,Bf=Of,Uf=Df,$f="[object Null]",Gf="[object Undefined]",io=ro?ro.toStringTag:void 0;function zf(t){return t==null?t===void 0?Gf:$f:io&&io in Object(t)?Bf(t):Uf(t)}var $r=zf;function jf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Gr=jf,Hf=$r,Vf=Gr,Xf="[object AsyncFunction]",Wf="[object Function]",qf="[object GeneratorFunction]",Yf="[object Proxy]";function Kf(t){if(!Vf(t))return!1;var e=Hf(t);return e==Wf||e==qf||e==Xf||e==Yf}var no=Kf,Zf=ht,Qf=Zf["__core-js_shared__"],Jf=Qf,Gn=Jf,so=function(){var t=/[^.]+$/.exec(Gn&&Gn.keys&&Gn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ed(t){return!!so&&so in t}var td=ed,rd=Function.prototype,id=rd.toString;function nd(t){if(t!=null){try{return id.call(t)}catch{}try{return t+""}catch{}}return""}var ao=nd,sd=no,ad=td,od=Gr,ld=ao,ud=/[\\^$.*+?()[\]{}|]/g,cd=/^\[object .+?Constructor\]$/,hd=Function.prototype,fd=Object.prototype,dd=hd.toString,pd=fd.hasOwnProperty,md=RegExp("^"+dd.call(pd).replace(ud,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gd(t){if(!od(t)||ad(t))return!1;var e=sd(t)?md:cd;return e.test(ld(t))}var vd=gd;function _d(t,e){return t==null?void 0:t[e]}var yd=_d,xd=vd,bd=yd;function Td(t,e){var r=bd(t,e);return xd(r)?r:void 0}var ar=Td,wd=ar,Sd=ht,Ad=wd(Sd,"Map"),zn=Ad,Ed=ar,Cd=Ed(Object,"create"),wi=Cd,oo=wi;function Id(){this.__data__=oo?oo(null):{},this.size=0}var Rd=Id;function Pd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Md=Pd,Fd=wi,Od="__lodash_hash_undefined__",Nd=Object.prototype,kd=Nd.hasOwnProperty;function Ld(t){var e=this.__data__;if(Fd){var r=e[t];return r===Od?void 0:r}return kd.call(e,t)?e[t]:void 0}var Dd=Ld,Bd=wi,Ud=Object.prototype,$d=Ud.hasOwnProperty;function Gd(t){var e=this.__data__;return Bd?e[t]!==void 0:$d.call(e,t)}var zd=Gd,jd=wi,Hd="__lodash_hash_undefined__";function Vd(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=jd&&e===void 0?Hd:e,this}var Xd=Vd,Wd=Rd,qd=Md,Yd=Dd,Kd=zd,Zd=Xd;function or(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}or.prototype.clear=Wd,or.prototype.delete=qd,or.prototype.get=Yd,or.prototype.has=Kd,or.prototype.set=Zd;var Qd=or,lo=Qd,Jd=bi,ep=zn;function tp(){this.size=0,this.__data__={hash:new lo,map:new(ep||Jd),string:new lo}}var rp=tp;function ip(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var np=ip,sp=np;function ap(t,e){var r=t.__data__;return sp(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Si=ap,op=Si;function lp(t){var e=op(this,t).delete(t);return this.size-=e?1:0,e}var up=lp,cp=Si;function hp(t){return cp(this,t).get(t)}var fp=hp,dp=Si;function pp(t){return dp(this,t).has(t)}var mp=pp,gp=Si;function vp(t,e){var r=gp(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}var _p=vp,yp=rp,xp=up,bp=fp,Tp=mp,wp=_p;function lr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}lr.prototype.clear=yp,lr.prototype.delete=xp,lr.prototype.get=bp,lr.prototype.has=Tp,lr.prototype.set=wp;var jn=lr,Sp=bi,Ap=zn,Ep=jn,Cp=200;function Ip(t,e){var r=this.__data__;if(r instanceof Sp){var i=r.__data__;if(!Ap||i.length<Cp-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ep(i)}return r.set(t,e),this.size=r.size,this}var Rp=Ip,Pp=bi,Mp=vf,Fp=yf,Op=bf,Np=wf,kp=Rp;function ur(t){var e=this.__data__=new Pp(t);this.size=e.size}ur.prototype.clear=Mp,ur.prototype.delete=Fp,ur.prototype.get=Op,ur.prototype.has=Np,ur.prototype.set=kp;var uo=ur,Lp="__lodash_hash_undefined__";function Dp(t){return this.__data__.set(t,Lp),this}var Bp=Dp;function Up(t){return this.__data__.has(t)}var $p=Up,Gp=jn,zp=Bp,jp=$p;function Ai(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Gp;++e<r;)this.add(t[e])}Ai.prototype.add=Ai.prototype.push=zp,Ai.prototype.has=jp;var Hp=Ai;function Vp(t,e){for(var r=-1,i=t==null?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}var Xp=Vp;function Wp(t,e){return t.has(e)}var qp=Wp,Yp=Hp,Kp=Xp,Zp=qp,Qp=1,Jp=2;function em(t,e,r,i,n,s){var a=r&Qp,o=t.length,u=e.length;if(o!=u&&!(a&&u>o))return!1;var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var l=-1,c=!0,f=r&Jp?new Yp:void 0;for(s.set(t,e),s.set(e,t);++l<o;){var p=t[l],m=e[l];if(i)var v=a?i(m,p,l,e,t,s):i(p,m,l,t,e,s);if(v!==void 0){if(v)continue;c=!1;break}if(f){if(!Kp(e,function(g,y){if(!Zp(f,y)&&(p===g||n(p,g,r,i,s)))return f.push(y)})){c=!1;break}}else if(!(p===m||n(p,m,r,i,s))){c=!1;break}}return s.delete(t),s.delete(e),c}var co=em,tm=ht,rm=tm.Uint8Array,im=rm;function nm(t){var e=-1,r=Array(t.size);return t.forEach(function(i,n){r[++e]=[n,i]}),r}var sm=nm;function am(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}var om=am,ho=Ti,fo=im,lm=Qa,um=co,cm=sm,hm=om,fm=1,dm=2,pm="[object Boolean]",mm="[object Date]",gm="[object Error]",vm="[object Map]",_m="[object Number]",ym="[object RegExp]",xm="[object Set]",bm="[object String]",Tm="[object Symbol]",wm="[object ArrayBuffer]",Sm="[object DataView]",po=ho?ho.prototype:void 0,Hn=po?po.valueOf:void 0;function Am(t,e,r,i,n,s,a){switch(r){case Sm:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case wm:return!(t.byteLength!=e.byteLength||!s(new fo(t),new fo(e)));case pm:case mm:case _m:return lm(+t,+e);case gm:return t.name==e.name&&t.message==e.message;case ym:case bm:return t==e+"";case vm:var o=cm;case xm:var u=i&fm;if(o||(o=hm),t.size!=e.size&&!u)return!1;var h=a.get(t);if(h)return h==e;i|=dm,a.set(t,e);var d=um(o(t),o(e),i,n,s,a);return a.delete(t),d;case Tm:if(Hn)return Hn.call(t)==Hn.call(e)}return!1}var Em=Am;function Cm(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}var Im=Cm,Rm=Array.isArray,ft=Rm,Pm=Im,Mm=ft;function Fm(t,e,r){var i=e(t);return Mm(t)?i:Pm(i,r(t))}var Om=Fm;function Nm(t,e){for(var r=-1,i=t==null?0:t.length,n=0,s=[];++r<i;){var a=t[r];e(a,r,t)&&(s[n++]=a)}return s}var km=Nm;function Lm(){return[]}var Dm=Lm,Bm=km,Um=Dm,$m=Object.prototype,Gm=$m.propertyIsEnumerable,mo=Object.getOwnPropertySymbols,zm=mo?function(t){return t==null?[]:(t=Object(t),Bm(mo(t),function(e){return Gm.call(t,e)}))}:Um,jm=zm;function Hm(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}var Vm=Hm;function Xm(t){return t!=null&&typeof t=="object"}var zr=Xm,Wm=$r,qm=zr,Ym="[object Arguments]";function Km(t){return qm(t)&&Wm(t)==Ym}var Zm=Km,go=Zm,Qm=zr,vo=Object.prototype,Jm=vo.hasOwnProperty,e0=vo.propertyIsEnumerable,t0=go(function(){return arguments}())?go:function(t){return Qm(t)&&Jm.call(t,"callee")&&!e0.call(t,"callee")},Vn=t0,Ei={exports:{}};function r0(){return!1}var i0=r0;Ei.exports,function(t,e){var r=ht,i=i0,n=e&&!e.nodeType&&e,s=n&&!0&&t&&!t.nodeType&&t,a=s&&s.exports===n,o=a?r.Buffer:void 0,u=o?o.isBuffer:void 0,h=u||i;t.exports=h}(Ei,Ei.exports);var Xn=Ei.exports,n0=9007199254740991,s0=/^(?:0|[1-9]\d*)$/;function a0(t,e){var r=typeof t;return e=e??n0,!!e&&(r=="number"||r!="symbol"&&s0.test(t))&&t>-1&&t%1==0&&t<e}var _o=a0,o0=9007199254740991;function l0(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=o0}var Wn=l0,u0=$r,c0=Wn,h0=zr,f0="[object Arguments]",d0="[object Array]",p0="[object Boolean]",m0="[object Date]",g0="[object Error]",v0="[object Function]",_0="[object Map]",y0="[object Number]",x0="[object Object]",b0="[object RegExp]",T0="[object Set]",w0="[object String]",S0="[object WeakMap]",A0="[object ArrayBuffer]",E0="[object DataView]",C0="[object Float32Array]",I0="[object Float64Array]",R0="[object Int8Array]",P0="[object Int16Array]",M0="[object Int32Array]",F0="[object Uint8Array]",O0="[object Uint8ClampedArray]",N0="[object Uint16Array]",k0="[object Uint32Array]",ve={};ve[C0]=ve[I0]=ve[R0]=ve[P0]=ve[M0]=ve[F0]=ve[O0]=ve[N0]=ve[k0]=!0,ve[f0]=ve[d0]=ve[A0]=ve[p0]=ve[E0]=ve[m0]=ve[g0]=ve[v0]=ve[_0]=ve[y0]=ve[x0]=ve[b0]=ve[T0]=ve[w0]=ve[S0]=!1;function L0(t){return h0(t)&&c0(t.length)&&!!ve[u0(t)]}var D0=L0;function B0(t){return function(e){return t(e)}}var U0=B0,Ci={exports:{}};Ci.exports,function(t,e){var r=Ja,i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,s=n&&n.exports===i,a=s&&r.process,o=function(){try{var u=n&&n.require&&n.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();t.exports=o}(Ci,Ci.exports);var $0=Ci.exports,G0=D0,z0=U0,yo=$0,xo=yo&&yo.isTypedArray,j0=xo?z0(xo):G0,qn=j0,H0=Vm,V0=Vn,X0=ft,W0=Xn,q0=_o,Y0=qn,K0=Object.prototype,Z0=K0.hasOwnProperty;function Q0(t,e){var r=X0(t),i=!r&&V0(t),n=!r&&!i&&W0(t),s=!r&&!i&&!n&&Y0(t),a=r||i||n||s,o=a?H0(t.length,String):[],u=o.length;for(var h in t)(e||Z0.call(t,h))&&!(a&&(h=="length"||n&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||q0(h,u)))&&o.push(h);return o}var J0=Q0,eg=Object.prototype;function tg(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||eg;return t===r}var bo=tg;function rg(t,e){return function(r){return t(e(r))}}var ig=rg,ng=ig,sg=ng(Object.keys,Object),ag=sg,og=bo,lg=ag,ug=Object.prototype,cg=ug.hasOwnProperty;function hg(t){if(!og(t))return lg(t);var e=[];for(var r in Object(t))cg.call(t,r)&&r!="constructor"&&e.push(r);return e}var To=hg,fg=no,dg=Wn;function pg(t){return t!=null&&dg(t.length)&&!fg(t)}var Ii=pg,mg=J0,gg=To,vg=Ii;function _g(t){return vg(t)?mg(t):gg(t)}var Yn=_g,yg=Om,xg=jm,bg=Yn;function Tg(t){return yg(t,bg,xg)}var wg=Tg,wo=wg,Sg=1,Ag=Object.prototype,Eg=Ag.hasOwnProperty;function Cg(t,e,r,i,n,s){var a=r&Sg,o=wo(t),u=o.length,h=wo(e),d=h.length;if(u!=d&&!a)return!1;for(var l=u;l--;){var c=o[l];if(!(a?c in e:Eg.call(e,c)))return!1}var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var m=!0;s.set(t,e),s.set(e,t);for(var v=a;++l<u;){c=o[l];var g=t[c],y=e[c];if(i)var _=a?i(y,g,c,e,t,s):i(g,y,c,t,e,s);if(!(_===void 0?g===y||n(g,y,r,i,s):_)){m=!1;break}v||(v=c=="constructor")}if(m&&!v){var x=t.constructor,b=e.constructor;x!=b&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof b=="function"&&b instanceof b)&&(m=!1)}return s.delete(t),s.delete(e),m}var Ig=Cg,Rg=ar,Pg=ht,Mg=Rg(Pg,"DataView"),Fg=Mg,Og=ar,Ng=ht,kg=Og(Ng,"Promise"),Lg=kg,Dg=ar,Bg=ht,Ug=Dg(Bg,"Set"),$g=Ug,Gg=ar,zg=ht,jg=Gg(zg,"WeakMap"),Hg=jg,Kn=Fg,Zn=zn,Qn=Lg,Jn=$g,es=Hg,So=$r,cr=ao,Ao="[object Map]",Vg="[object Object]",Eo="[object Promise]",Co="[object Set]",Io="[object WeakMap]",Ro="[object DataView]",Xg=cr(Kn),Wg=cr(Zn),qg=cr(Qn),Yg=cr(Jn),Kg=cr(es),Bt=So;(Kn&&Bt(new Kn(new ArrayBuffer(1)))!=Ro||Zn&&Bt(new Zn)!=Ao||Qn&&Bt(Qn.resolve())!=Eo||Jn&&Bt(new Jn)!=Co||es&&Bt(new es)!=Io)&&(Bt=function(t){var e=So(t),r=e==Vg?t.constructor:void 0,i=r?cr(r):"";if(i)switch(i){case Xg:return Ro;case Wg:return Ao;case qg:return Eo;case Yg:return Co;case Kg:return Io}return e});var Po=Bt,ts=uo,Zg=co,Qg=Em,Jg=Ig,Mo=Po,Fo=ft,Oo=Xn,ev=qn,tv=1,No="[object Arguments]",ko="[object Array]",Ri="[object Object]",rv=Object.prototype,Lo=rv.hasOwnProperty;function iv(t,e,r,i,n,s){var a=Fo(t),o=Fo(e),u=a?ko:Mo(t),h=o?ko:Mo(e);u=u==No?Ri:u,h=h==No?Ri:h;var d=u==Ri,l=h==Ri,c=u==h;if(c&&Oo(t)){if(!Oo(e))return!1;a=!0,d=!1}if(c&&!d)return s||(s=new ts),a||ev(t)?Zg(t,e,r,i,n,s):Qg(t,e,u,r,i,n,s);if(!(r&tv)){var f=d&&Lo.call(t,"__wrapped__"),p=l&&Lo.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,v=p?e.value():e;return s||(s=new ts),n(m,v,r,i,s)}}return c?(s||(s=new ts),Jg(t,e,r,i,n,s)):!1}var nv=iv,sv=nv,Do=zr;function Bo(t,e,r,i,n){return t===e?!0:t==null||e==null||!Do(t)&&!Do(e)?t!==t&&e!==e:sv(t,e,r,i,Bo,n)}var rs=Bo,av=rs;function ov(t,e){return av(t,e)}var lv=ov;const uv=Lt(lv),cv=(t,e)=>{const r=P.useRef(!0),i=P.useRef(e);P.useEffect(()=>{const n=i.current.every((s,a)=>uv(s,e[a]));(r.current||!n)&&t(),r.current=!1,i.current=e},e)};function hv(t,e=700){const[r,i]=P.useState(t);return cv(()=>{const n=setTimeout(()=>{i(t)},e);return()=>{clearTimeout(n)}},[t,e]),r}var fv=To,dv=Po,pv=Vn,mv=ft,gv=Ii,vv=Xn,_v=bo,yv=qn,xv="[object Map]",bv="[object Set]",Tv=Object.prototype,wv=Tv.hasOwnProperty;function Sv(t){if(t==null)return!0;if(gv(t)&&(mv(t)||typeof t=="string"||typeof t.splice=="function"||vv(t)||yv(t)||pv(t)))return!t.length;var e=dv(t);if(e==xv||e==bv)return!t.size;if(_v(t))return!fv(t).length;for(var r in t)if(wv.call(t,r))return!1;return!0}var Av=Sv;const hr=Lt(Av);var is=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(is||{});const Uo={normal:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:0},lensflare:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/eyecast_lensflare_overlay_50.jpg",blendmode:"ADD",alpha:1},filmstrip:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/frames_filmstrip_5.png",blendmode:"ADD",alpha:1},grunge:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/pixi_overlay_grunge_60.jpg",blendmode:"ADD",alpha:1},bricks:{src:"https://eyecastvideoeditorfiles.s3.ap-southeast-2.amazonaws.com/assets/overlays/bricks_Overlay_100.jpg",blendmode:"MULTIPLY",alpha:1}},Ev=t=>{const{overlay:e,width:r,height:i,x:n,y:s}=t,{src:a,blendmode:o}=Uo[e]||Uo.normal;return Z.jsx(te.TilingSprite,{image:a,width:r,height:i,x:n,y:s,tilePosition:{x:0,y:0},tileScale:.5,alpha:.5,anchor:.5})};/*!
10
10
  * paths 3.11.5
11
11
  * https://greensock.com
12
12
  *
@@ -14,7 +14,7 @@
14
14
  * Subject to the terms at https://greensock.com/standard-license or for
15
15
  * Club GreenSock members, the agreement issued with that membership.
16
16
  * @author: Jack Doyle, jack@greensock.com
17
- */var Rv=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,Pv=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,Mv=Math.PI/180,Oi=Math.sin,Ni=Math.cos,Xr=Math.abs,Wr=Math.sqrt,Fv=function(e){return typeof e=="number"},zo=1e5,Ct=function(e){return Math.round(e*zo)/zo||0};function Ov(t,e,r,i,n,s,a){for(var o=t.length,u,h,d,l,c;--o>-1;)for(u=t[o],h=u.length,d=0;d<h;d+=2)l=u[d],c=u[d+1],u[d]=l*e+c*i+s,u[d+1]=l*r+c*n+a;return t._dirty=1,t}function Nv(t,e,r,i,n,s,a,o,u){if(!(t===o&&e===u)){r=Xr(r),i=Xr(i);var h=n%360*Mv,d=Ni(h),l=Oi(h),c=Math.PI,f=c*2,p=(t-o)/2,m=(e-u)/2,v=d*p+l*m,g=-l*p+d*m,y=v*v,_=g*g,x=y/(r*r)+_/(i*i);x>1&&(r=Wr(x)*r,i=Wr(x)*i);var b=r*r,T=i*i,w=(b*T-b*_-T*y)/(b*_+T*y);w<0&&(w=0);var S=(s===a?-1:1)*Wr(w),A=S*(r*g/i),C=S*-(i*v/r),F=(t+o)/2,z=(e+u)/2,I=F+(d*A-l*C),E=z+(l*A+d*C),B=(v-A)/r,U=(g-C)/i,R=(-v-A)/r,$=(-g-C)/i,X=B*B+U*U,M=(U<0?-1:1)*Math.acos(B/Wr(X)),O=(B*$-U*R<0?-1:1)*Math.acos((B*R+U*$)/Wr(X*(R*R+$*$)));isNaN(O)&&(O=c),!a&&O>0?O-=f:a&&O<0&&(O+=f),M%=f,O%=f;var H=Math.ceil(Xr(O)/(f/4)),V=[],W=O/H,ne=4/3*Oi(W/2)/(1+Ni(W/2)),oe=d*r,ce=l*r,ve=l*-i,de=d*i,G;for(G=0;G<H;G++)n=M+G*W,v=Ni(n),g=Oi(n),B=Ni(n+=W),U=Oi(n),V.push(v-ne*g,g+ne*v,B+ne*U,U-ne*B,B,U);for(G=0;G<V.length;G+=2)v=V[G],g=V[G+1],V[G]=v*oe+g*ve+I,V[G+1]=v*ce+g*de+E;return V[G-2]=o,V[G-1]=u,V}}function kv(t){var e=(t+"").replace(Pv,function(A){var C=+A;return C<1e-4&&C>-1e-4?0:C}).match(Rv)||[],r=[],i=0,n=0,s=2/3,a=e.length,o=0,u="ERROR: malformed path: "+t,h,d,l,c,f,p,m,v,g,y,_,x,b,T,w,S=function(C,F,z,I){y=(z-C)/3,_=(I-F)/3,m.push(C+y,F+_,z-y,I-_,z,I)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(u),r;for(h=0;h<a;h++)if(b=f,isNaN(e[h])?(f=e[h].toUpperCase(),p=f!==e[h]):h--,l=+e[h+1],c=+e[h+2],p&&(l+=i,c+=n),h||(v=l,g=c),f==="M")m&&(m.length<8?r.length-=1:o+=m.length),i=v=l,n=g=c,m=[l,c],r.push(m),h+=2,f="L";else if(f==="C")m||(m=[0,0]),p||(i=n=0),m.push(l,c,i+e[h+3]*1,n+e[h+4]*1,i+=e[h+5]*1,n+=e[h+6]*1),h+=6;else if(f==="S")y=i,_=n,(b==="C"||b==="S")&&(y+=i-m[m.length-4],_+=n-m[m.length-3]),p||(i=n=0),m.push(y,_,l,c,i+=e[h+3]*1,n+=e[h+4]*1),h+=4;else if(f==="Q")y=i+(l-i)*s,_=n+(c-n)*s,p||(i=n=0),i+=e[h+3]*1,n+=e[h+4]*1,m.push(y,_,i+(l-i)*s,n+(c-n)*s,i,n),h+=4;else if(f==="T")y=i-m[m.length-4],_=n-m[m.length-3],m.push(i+y,n+_,l+(i+y*1.5-l)*s,c+(n+_*1.5-c)*s,i=l,n=c),h+=2;else if(f==="H")S(i,n,i=l,n),h+=1;else if(f==="V")S(i,n,i,n=l+(p?n-i:0)),h+=1;else if(f==="L"||f==="Z")f==="Z"&&(l=v,c=g,m.closed=!0),(f==="L"||Xr(i-l)>.5||Xr(n-c)>.5)&&(S(i,n,l,c),f==="L"&&(h+=2)),i=l,n=c;else if(f==="A"){if(T=e[h+4],w=e[h+5],y=e[h+6],_=e[h+7],d=7,T.length>1&&(T.length<3?(_=y,y=w,d--):(_=w,y=T.substr(2),d-=2),w=T.charAt(1),T=T.charAt(0)),x=Nv(i,n,+e[h+1],+e[h+2],+e[h+3],+T,+w,(p?i:0)+y*1,(p?n:0)+_*1),h+=d,x)for(d=0;d<x.length;d++)m.push(x[d]);i=m[m.length-2],n=m[m.length-1]}else console.log(u);return h=m.length,h<6?(r.pop(),h=0):m[0]===m[h-2]&&m[1]===m[h-1]&&(m.closed=!0),r.totalPoints=o+h,r}function Lv(t){Fv(t[0])&&(t=[t]);var e="",r=t.length,i,n,s,a;for(n=0;n<r;n++){for(a=t[n],e+="M"+Ct(a[0])+","+Ct(a[1])+" C",i=a.length,s=2;s<i;s++)e+=Ct(a[s++])+","+Ct(a[s++])+" "+Ct(a[s++])+","+Ct(a[s++])+" "+Ct(a[s++])+","+Ct(a[s])+" ";a.closed&&(e+="z")}return e}/*!
17
+ */var Cv=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,Iv=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,Rv=Math.PI/180,Pi=Math.sin,Mi=Math.cos,jr=Math.abs,Hr=Math.sqrt,Pv=function(e){return typeof e=="number"},$o=1e5,Et=function(e){return Math.round(e*$o)/$o||0};function Mv(t,e,r,i,n,s,a){for(var o=t.length,u,h,d,l,c;--o>-1;)for(u=t[o],h=u.length,d=0;d<h;d+=2)l=u[d],c=u[d+1],u[d]=l*e+c*i+s,u[d+1]=l*r+c*n+a;return t._dirty=1,t}function Fv(t,e,r,i,n,s,a,o,u){if(!(t===o&&e===u)){r=jr(r),i=jr(i);var h=n%360*Rv,d=Mi(h),l=Pi(h),c=Math.PI,f=c*2,p=(t-o)/2,m=(e-u)/2,v=d*p+l*m,g=-l*p+d*m,y=v*v,_=g*g,x=y/(r*r)+_/(i*i);x>1&&(r=Hr(x)*r,i=Hr(x)*i);var b=r*r,T=i*i,w=(b*T-b*_-T*y)/(b*_+T*y);w<0&&(w=0);var S=(s===a?-1:1)*Hr(w),A=S*(r*g/i),I=S*-(i*v/r),F=(t+o)/2,$=(e+u)/2,E=F+(d*A-l*I),C=$+(l*A+d*I),U=(v-A)/r,G=(g-I)/i,R=(-v-A)/r,B=(-g-I)/i,X=U*U+G*G,M=(G<0?-1:1)*Math.acos(U/Hr(X)),O=(U*B-G*R<0?-1:1)*Math.acos((U*R+G*B)/Hr(X*(R*R+B*B)));isNaN(O)&&(O=c),!a&&O>0?O-=f:a&&O<0&&(O+=f),M%=f,O%=f;var H=Math.ceil(jr(O)/(f/4)),V=[],W=O/H,ne=4/3*Pi(W/2)/(1+Mi(W/2)),oe=d*r,ce=l*r,ge=l*-i,fe=d*i,z;for(z=0;z<H;z++)n=M+z*W,v=Mi(n),g=Pi(n),U=Mi(n+=W),G=Pi(n),V.push(v-ne*g,g+ne*v,U+ne*G,G-ne*U,U,G);for(z=0;z<V.length;z+=2)v=V[z],g=V[z+1],V[z]=v*oe+g*ge+E,V[z+1]=v*ce+g*fe+C;return V[z-2]=o,V[z-1]=u,V}}function Ov(t){var e=(t+"").replace(Iv,function(A){var I=+A;return I<1e-4&&I>-1e-4?0:I}).match(Cv)||[],r=[],i=0,n=0,s=2/3,a=e.length,o=0,u="ERROR: malformed path: "+t,h,d,l,c,f,p,m,v,g,y,_,x,b,T,w,S=function(I,F,$,E){y=($-I)/3,_=(E-F)/3,m.push(I+y,F+_,$-y,E-_,$,E)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(u),r;for(h=0;h<a;h++)if(b=f,isNaN(e[h])?(f=e[h].toUpperCase(),p=f!==e[h]):h--,l=+e[h+1],c=+e[h+2],p&&(l+=i,c+=n),h||(v=l,g=c),f==="M")m&&(m.length<8?r.length-=1:o+=m.length),i=v=l,n=g=c,m=[l,c],r.push(m),h+=2,f="L";else if(f==="C")m||(m=[0,0]),p||(i=n=0),m.push(l,c,i+e[h+3]*1,n+e[h+4]*1,i+=e[h+5]*1,n+=e[h+6]*1),h+=6;else if(f==="S")y=i,_=n,(b==="C"||b==="S")&&(y+=i-m[m.length-4],_+=n-m[m.length-3]),p||(i=n=0),m.push(y,_,l,c,i+=e[h+3]*1,n+=e[h+4]*1),h+=4;else if(f==="Q")y=i+(l-i)*s,_=n+(c-n)*s,p||(i=n=0),i+=e[h+3]*1,n+=e[h+4]*1,m.push(y,_,i+(l-i)*s,n+(c-n)*s,i,n),h+=4;else if(f==="T")y=i-m[m.length-4],_=n-m[m.length-3],m.push(i+y,n+_,l+(i+y*1.5-l)*s,c+(n+_*1.5-c)*s,i=l,n=c),h+=2;else if(f==="H")S(i,n,i=l,n),h+=1;else if(f==="V")S(i,n,i,n=l+(p?n-i:0)),h+=1;else if(f==="L"||f==="Z")f==="Z"&&(l=v,c=g,m.closed=!0),(f==="L"||jr(i-l)>.5||jr(n-c)>.5)&&(S(i,n,l,c),f==="L"&&(h+=2)),i=l,n=c;else if(f==="A"){if(T=e[h+4],w=e[h+5],y=e[h+6],_=e[h+7],d=7,T.length>1&&(T.length<3?(_=y,y=w,d--):(_=w,y=T.substr(2),d-=2),w=T.charAt(1),T=T.charAt(0)),x=Fv(i,n,+e[h+1],+e[h+2],+e[h+3],+T,+w,(p?i:0)+y*1,(p?n:0)+_*1),h+=d,x)for(d=0;d<x.length;d++)m.push(x[d]);i=m[m.length-2],n=m[m.length-1]}else console.log(u);return h=m.length,h<6?(r.pop(),h=0):m[0]===m[h-2]&&m[1]===m[h-1]&&(m.closed=!0),r.totalPoints=o+h,r}function Nv(t){Pv(t[0])&&(t=[t]);var e="",r=t.length,i,n,s,a;for(n=0;n<r;n++){for(a=t[n],e+="M"+Et(a[0])+","+Et(a[1])+" C",i=a.length,s=2;s<i;s++)e+=Et(a[s++])+","+Et(a[s++])+" "+Et(a[s++])+","+Et(a[s++])+" "+Et(a[s++])+","+Et(a[s])+" ";a.closed&&(e+="z")}return e}/*!
18
18
  * CustomEase 3.11.5
19
19
  * https://greensock.com
20
20
  *
@@ -22,7 +22,7 @@
22
22
  * Subject to the terms at https://greensock.com/standard-license or for
23
23
  * Club GreenSock members, the agreement issued with that membership.
24
24
  * @author: Jack Doyle, jack@greensock.com
25
- */var ze,jo,Ho=function(){return ze||typeof window<"u"&&(ze=window.gsap)&&ze.registerPlugin&&ze},Vo=function(){ze=Ho(),ze?(ze.registerEase("_CE",qr.create),jo=1):console.warn("Please gsap.registerPlugin(CustomEase)")},Dv=1e20,ki=function(e){return~~(e*1e3+(e<0?-.5:.5))/1e3},Bv=/[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,Uv=/[cLlsSaAhHvVtTqQ]/g,$v=function(e){var r=e.length,i=Dv,n;for(n=1;n<r;n+=6)+e[n]<i&&(i=+e[n]);return i},Gv=function(e,r,i){!i&&i!==0&&(i=Math.max(+e[e.length-1],+e[1]));var n=+e[0]*-1,s=-i,a=e.length,o=1/(+e[a-2]+n),u=-r||(Math.abs(+e[a-1]-+e[1])<.01*(+e[a-2]-+e[0])?$v(e)+s:+e[a-1]+s),h;for(u?u=1/u:u=-o,h=0;h<a;h+=2)e[h]=(+e[h]+n)*o,e[h+1]=(+e[h+1]+s)*u},zv=function t(e,r,i,n,s,a,o,u,h,d,l){var c=(e+i)/2,f=(r+n)/2,p=(i+s)/2,m=(n+a)/2,v=(s+o)/2,g=(a+u)/2,y=(c+p)/2,_=(f+m)/2,x=(p+v)/2,b=(m+g)/2,T=(y+x)/2,w=(_+b)/2,S=o-e,A=u-r,C=Math.abs((i-o)*A-(n-u)*S),F=Math.abs((s-o)*A-(a-u)*S),z;return d||(d=[{x:e,y:r},{x:o,y:u}],l=1),d.splice(l||d.length-1,0,{x:T,y:w}),(C+F)*(C+F)>h*(S*S+A*A)&&(z=d.length,t(e,r,c,f,y,_,T,w,h,d,l),t(T,w,x,b,v,g,o,u,h,d,l+1+(d.length-z))),d},qr=function(){function t(r,i,n){jo||Vo(),this.id=r,this.setData(i,n)}var e=t.prototype;return e.setData=function(i,n){n=n||{},i=i||"0,0,1,1";var s=i.match(Bv),a=1,o=[],u=[],h=n.precision||1,d=h<=1,l,c,f,p,m,v,g,y,_;if(this.data=i,(Uv.test(i)||~i.indexOf("M")&&i.indexOf("C")<0)&&(s=kv(i)[0]),l=s.length,l===4)s.unshift(0,0),s.push(1,1),l=8;else if((l-2)%6)throw"Invalid CustomEase";for((+s[0]!=0||+s[l-2]!=1)&&Gv(s,n.height,n.originY),this.segment=s,p=2;p<l;p+=6)c={x:+s[p-2],y:+s[p-1]},f={x:+s[p+4],y:+s[p+5]},o.push(c,f),zv(c.x,c.y,+s[p],+s[p+1],+s[p+2],+s[p+3],f.x,f.y,1/(h*2e5),o,o.length-1);for(l=o.length,p=0;p<l;p++)g=o[p],y=o[p-1]||g,(g.x>y.x||y.y!==g.y&&y.x===g.x||g===y)&&g.x<=1?(y.cx=g.x-y.x,y.cy=g.y-y.y,y.n=g,y.nx=g.x,d&&p>1&&Math.abs(y.cy/y.cx-o[p-2].cy/o[p-2].cx)>2&&(d=0),y.cx<a&&(y.cx?a=y.cx:(y.cx=.001,p===l-1&&(y.x-=.001,a=Math.min(a,.001),d=0)))):(o.splice(p--,1),l--);if(l=1/a+1|0,m=1/l,v=0,g=o[0],d){for(p=0;p<l;p++)_=p*m,g.nx<_&&(g=o[++v]),c=g.y+(_-g.x)/g.cx*g.cy,u[p]={x:_,cx:m,y:c,cy:0,nx:9},p&&(u[p-1].cy=c-u[p-1].y);u[l-1].cy=o[o.length-1].y-c}else{for(p=0;p<l;p++)g.nx<p*m&&(g=o[++v]),u[p]=g;v<o.length-1&&(u[p-1]=o[o.length-2])}return this.ease=function(x){var b=u[x*l|0]||u[l-1];return b.nx<x&&(b=b.n),b.y+(x-b.x)/b.cx*b.cy},this.ease.custom=this,this.id&&ze&&ze.registerEase(this.id,this.ease),this},e.getSVGData=function(i){return t.getSVGData(this,i)},t.create=function(i,n,s){return new t(i,n,s).ease},t.register=function(i){ze=i,Vo()},t.get=function(i){return ze.parseEase(i)},t.getSVGData=function(i,n){n=n||{};var s=n.width||100,a=n.height||100,o=n.x||0,u=(n.y||0)+a,h=ze.utils.toArray(n.path)[0],d,l,c,f,p,m,v,g,y,_;if(n.invert&&(a=-a,u=0),typeof i=="string"&&(i=ze.parseEase(i)),i.custom&&(i=i.custom),i instanceof t)d=Lv(Ov([i.segment],s,0,0,-a,o,u));else{for(d=[o,u],v=Math.max(5,(n.precision||1)*200),f=1/v,v+=2,g=5/v,y=ki(o+f*s),_=ki(u+i(f)*-a),l=(_-u)/(y-o),c=2;c<v;c++)p=ki(o+c*f*s),m=ki(u+i(c*f)*-a),(Math.abs((m-_)/(p-y)-l)>g||c===v-1)&&(d.push(y,_),l=(m-_)/(p-y)),y=p,_=m;d="M"+d.join(",")}return h&&h.setAttribute("d",d),d},t}();Ho()&&ze.registerPlugin(qr),qr.version="3.11.5";/*!
25
+ */var Ge,Go,zo=function(){return Ge||typeof window<"u"&&(Ge=window.gsap)&&Ge.registerPlugin&&Ge},jo=function(){Ge=zo(),Ge?(Ge.registerEase("_CE",Vr.create),Go=1):console.warn("Please gsap.registerPlugin(CustomEase)")},kv=1e20,Fi=function(e){return~~(e*1e3+(e<0?-.5:.5))/1e3},Lv=/[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,Dv=/[cLlsSaAhHvVtTqQ]/g,Bv=function(e){var r=e.length,i=kv,n;for(n=1;n<r;n+=6)+e[n]<i&&(i=+e[n]);return i},Uv=function(e,r,i){!i&&i!==0&&(i=Math.max(+e[e.length-1],+e[1]));var n=+e[0]*-1,s=-i,a=e.length,o=1/(+e[a-2]+n),u=-r||(Math.abs(+e[a-1]-+e[1])<.01*(+e[a-2]-+e[0])?Bv(e)+s:+e[a-1]+s),h;for(u?u=1/u:u=-o,h=0;h<a;h+=2)e[h]=(+e[h]+n)*o,e[h+1]=(+e[h+1]+s)*u},$v=function t(e,r,i,n,s,a,o,u,h,d,l){var c=(e+i)/2,f=(r+n)/2,p=(i+s)/2,m=(n+a)/2,v=(s+o)/2,g=(a+u)/2,y=(c+p)/2,_=(f+m)/2,x=(p+v)/2,b=(m+g)/2,T=(y+x)/2,w=(_+b)/2,S=o-e,A=u-r,I=Math.abs((i-o)*A-(n-u)*S),F=Math.abs((s-o)*A-(a-u)*S),$;return d||(d=[{x:e,y:r},{x:o,y:u}],l=1),d.splice(l||d.length-1,0,{x:T,y:w}),(I+F)*(I+F)>h*(S*S+A*A)&&($=d.length,t(e,r,c,f,y,_,T,w,h,d,l),t(T,w,x,b,v,g,o,u,h,d,l+1+(d.length-$))),d},Vr=function(){function t(r,i,n){Go||jo(),this.id=r,this.setData(i,n)}var e=t.prototype;return e.setData=function(i,n){n=n||{},i=i||"0,0,1,1";var s=i.match(Lv),a=1,o=[],u=[],h=n.precision||1,d=h<=1,l,c,f,p,m,v,g,y,_;if(this.data=i,(Dv.test(i)||~i.indexOf("M")&&i.indexOf("C")<0)&&(s=Ov(i)[0]),l=s.length,l===4)s.unshift(0,0),s.push(1,1),l=8;else if((l-2)%6)throw"Invalid CustomEase";for((+s[0]!=0||+s[l-2]!=1)&&Uv(s,n.height,n.originY),this.segment=s,p=2;p<l;p+=6)c={x:+s[p-2],y:+s[p-1]},f={x:+s[p+4],y:+s[p+5]},o.push(c,f),$v(c.x,c.y,+s[p],+s[p+1],+s[p+2],+s[p+3],f.x,f.y,1/(h*2e5),o,o.length-1);for(l=o.length,p=0;p<l;p++)g=o[p],y=o[p-1]||g,(g.x>y.x||y.y!==g.y&&y.x===g.x||g===y)&&g.x<=1?(y.cx=g.x-y.x,y.cy=g.y-y.y,y.n=g,y.nx=g.x,d&&p>1&&Math.abs(y.cy/y.cx-o[p-2].cy/o[p-2].cx)>2&&(d=0),y.cx<a&&(y.cx?a=y.cx:(y.cx=.001,p===l-1&&(y.x-=.001,a=Math.min(a,.001),d=0)))):(o.splice(p--,1),l--);if(l=1/a+1|0,m=1/l,v=0,g=o[0],d){for(p=0;p<l;p++)_=p*m,g.nx<_&&(g=o[++v]),c=g.y+(_-g.x)/g.cx*g.cy,u[p]={x:_,cx:m,y:c,cy:0,nx:9},p&&(u[p-1].cy=c-u[p-1].y);u[l-1].cy=o[o.length-1].y-c}else{for(p=0;p<l;p++)g.nx<p*m&&(g=o[++v]),u[p]=g;v<o.length-1&&(u[p-1]=o[o.length-2])}return this.ease=function(x){var b=u[x*l|0]||u[l-1];return b.nx<x&&(b=b.n),b.y+(x-b.x)/b.cx*b.cy},this.ease.custom=this,this.id&&Ge&&Ge.registerEase(this.id,this.ease),this},e.getSVGData=function(i){return t.getSVGData(this,i)},t.create=function(i,n,s){return new t(i,n,s).ease},t.register=function(i){Ge=i,jo()},t.get=function(i){return Ge.parseEase(i)},t.getSVGData=function(i,n){n=n||{};var s=n.width||100,a=n.height||100,o=n.x||0,u=(n.y||0)+a,h=Ge.utils.toArray(n.path)[0],d,l,c,f,p,m,v,g,y,_;if(n.invert&&(a=-a,u=0),typeof i=="string"&&(i=Ge.parseEase(i)),i.custom&&(i=i.custom),i instanceof t)d=Nv(Mv([i.segment],s,0,0,-a,o,u));else{for(d=[o,u],v=Math.max(5,(n.precision||1)*200),f=1/v,v+=2,g=5/v,y=Fi(o+f*s),_=Fi(u+i(f)*-a),l=(_-u)/(y-o),c=2;c<v;c++)p=Fi(o+c*f*s),m=Fi(u+i(c*f)*-a),(Math.abs((m-_)/(p-y)-l)>g||c===v-1)&&(d.push(y,_),l=(m-_)/(p-y)),y=p,_=m;d="M"+d.join(",")}return h&&h.setAttribute("d",d),d},t}();zo()&&Ge.registerPlugin(Vr),Vr.version="3.11.5";/*!
26
26
  * PixiPlugin 3.11.5
27
27
  * https://greensock.com
28
28
  *
@@ -30,24 +30,24 @@
30
30
  * Subject to the terms at https://greensock.com/standard-license or for
31
31
  * Club GreenSock members, the agreement issued with that membership.
32
32
  * @author: Jack Doyle, jack@greensock.com
33
- */var It,Xo,Li,We,Yr,Wo,ls,qo=function(){return typeof window<"u"},Yo=function(){return It||qo()&&(It=window.gsap)&&It.registerPlugin&&It},Ko=function(e){return typeof e=="function"},jv=function(e){return console.warn(e)},Hv=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],qe=.212671,Ye=.71516,Ke=.072169,Di=function(e,r){var i=[],n=0,s=0,a,o;for(a=0;a<4;a++){for(o=0;o<5;o++)s=o===4?e[n+4]:0,i[n+o]=e[n]*r[o]+e[n+1]*r[o+5]+e[n+2]*r[o+10]+e[n+3]*r[o+15]+s;n+=5}return i},Zo=function(e,r){var i=1-r,n=i*qe,s=i*Ye,a=i*Ke;return Di([n+r,s,a,0,0,n,s+r,a,0,0,n,s,a+r,0,0,0,0,0,1,0],e)},Qo=function(e,r,i){var n=Li(r),s=n[0]/255,a=n[1]/255,o=n[2]/255,u=1-i;return Di([u+i*s*qe,i*s*Ye,i*s*Ke,0,0,i*a*qe,u+i*a*Ye,i*a*Ke,0,0,i*o*qe,i*o*Ye,u+i*o*Ke,0,0,0,0,0,1,0],e)},Jo=function(e,r){r*=Math.PI/180;var i=Math.cos(r),n=Math.sin(r);return Di([qe+i*(1-qe)+n*-qe,Ye+i*-Ye+n*-Ye,Ke+i*-Ke+n*(1-Ke),0,0,qe+i*-qe+n*.143,Ye+i*(1-Ye)+n*.14,Ke+i*-Ke+n*-.283,0,0,qe+i*-qe+n*-(1-qe),Ye+i*-Ye+n*Ye,Ke+i*(1-Ke)+n*Ke,0,0,0,0,0,1,0,0,0,0,0,1],e)},el=function(e,r){return Di([r,0,0,0,.5*(1-r),0,r,0,0,.5*(1-r),0,0,r,0,.5*(1-r),0,0,0,1,0],e)},tl=function(e,r){var i=We.filters[r],n=e.filters||[],s=n.length,a;for(i||jv(r+" not found. PixiPlugin.registerPIXI(PIXI)");--s>-1;)if(n[s]instanceof i)return n[s];return a=new i,r==="BlurFilter"&&(a.blur=0),n.push(a),e.filters=n,a},Ce=function(e,r,i,n){r.add(i,e,i[e],n[e]),r._props.push(e)},rl=function(e,r){var i=new We.filters.ColorMatrixFilter;return i.matrix=r,i.brightness(e,!0),i.matrix},Vv=function(e){var r={},i;for(i in e)r[i]=e[i];return r},je={contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},Xv=function(e,r,i){var n=tl(e,"ColorMatrixFilter"),s=e._gsColorMatrixFilter=e._gsColorMatrixFilter||Vv(je),a=r.combineCMF&&!("colorMatrixFilter"in r&&!r.colorMatrixFilter),o,u,h;for(h=n.matrix,r.resolution&&(n.resolution=r.resolution),r.matrix&&r.matrix.length===h.length?(u=r.matrix,s.contrast!==1&&Ce("contrast",i,s,je),s.hue&&Ce("hue",i,s,je),s.brightness!==1&&Ce("brightness",i,s,je),s.colorizeAmount&&(Ce("colorize",i,s,je),Ce("colorizeAmount",i,s,je)),s.saturation!==1&&Ce("saturation",i,s,je)):(u=Hv.slice(),r.contrast!=null?(u=el(u,+r.contrast),Ce("contrast",i,s,r)):s.contrast!==1&&(a?u=el(u,s.contrast):Ce("contrast",i,s,je)),r.hue!=null?(u=Jo(u,+r.hue),Ce("hue",i,s,r)):s.hue&&(a?u=Jo(u,s.hue):Ce("hue",i,s,je)),r.brightness!=null?(u=rl(+r.brightness,u),Ce("brightness",i,s,r)):s.brightness!==1&&(a?u=rl(s.brightness,u):Ce("brightness",i,s,je)),r.colorize!=null?(r.colorizeAmount="colorizeAmount"in r?+r.colorizeAmount:1,u=Qo(u,r.colorize,r.colorizeAmount),Ce("colorize",i,s,r),Ce("colorizeAmount",i,s,r)):s.colorizeAmount&&(a?u=Qo(u,s.colorize,s.colorizeAmount):(Ce("colorize",i,s,je),Ce("colorizeAmount",i,s,je))),r.saturation!=null?(u=Zo(u,+r.saturation),Ce("saturation",i,s,r)):s.saturation!==1&&(a?u=Zo(u,s.saturation):Ce("saturation",i,s,je))),o=u.length;--o>-1;)u[o]!==h[o]&&i.add(h,o,h[o],u[o],"colorMatrixFilter");i._props.push("colorMatrixFilter")},Wv=function(e,r){var i=r.t,n=r.p,s=r.color,a=r.set;a(i,n,s[0]<<16|s[1]<<8|s[2])},qv=function(e,r){var i=r.g;i&&(i.dirty++,i.clearDirty++)},Yv=function(e,r){r.t.visible=!!r.t.alpha},il=function(e,r,i,n){var s=e[r],a=Li(Ko(s)?e[r.indexOf("set")||!Ko(e["get"+r.substr(3)])?r:"get"+r.substr(3)]():s),o=Li(i);n._pt=new Yr(n._pt,e,r,0,0,Wv,{t:e,p:r,color:a,set:Wo(e,r)}),n.add(a,0,a[0],o[0]),n.add(a,1,a[1],o[1]),n.add(a,2,a[2],o[2])},Kv={tint:1,lineColor:1,fillColor:1},nl="position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),us={x:"position",y:"position",tileX:"tilePosition",tileY:"tilePosition"},Zv={colorMatrixFilter:1,saturation:1,contrast:1,hue:1,colorize:1,colorizeAmount:1,brightness:1,combineCMF:1},Bi=Math.PI/180,sl=function(e){return typeof e=="string"},Qv=function(e){return sl(e)&&e.charAt(1)==="="?e.substr(0,2)+parseFloat(e.substr(2))*Bi:e*Bi},Jv=function(e,r){return r.set(r.t,r.p,e===1?r.e:Math.round((r.s+r.c*e)*1e5)/1e5,r)},e_=function(e,r,i,n,s,a){var o=360*(a?Bi:1),u=sl(s),h=u&&s.charAt(1)==="="?+(s.charAt(0)+"1"):0,d=parseFloat(h?s.substr(2):s)*(a?Bi:1),l=h?d*h:d-n,c=n+l,f,p;return u&&(f=s.split("_")[1],f==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),f==="cw"&&l<0?l=(l+o*1e10)%o-~~(l/o)*o:f==="ccw"&&l>0&&(l=(l-o*1e10)%o-~~(l/o)*o)),e._pt=p=new Yr(e._pt,r,i,n,l,Jv),p.e=c,p},al=function(){qo()&&(Xo=window,It=Yo(),We=We||Xo.PIXI,ls=We&&We.VERSION&&We.VERSION.charAt(0)==="4",Li=function(r){return It.utils.splitColor((r+"").substr(0,2)==="0x"?"#"+r.substr(2):r)})},Ui,Kr;for(Ui=0;Ui<nl.length;Ui++)Kr=nl[Ui],us[Kr+"X"]=Kr,us[Kr+"Y"]=Kr;var cs={version:"3.11.5",name:"pixi",register:function(e,r,i){It=e,Yr=i,Wo=r.getSetter,al()},registerPIXI:function(e){We=e},init:function(e,r,i,n,s){if(We||al(),!We||!(e instanceof We.DisplayObject))return console.warn(e,"is not a DisplayObject or PIXI was not found. PixiPlugin.registerPIXI(PIXI);"),!1;var a,o,u,h,d,l,c,f,p;for(l in r){if(a=us[l],u=r[l],a)o=~l.charAt(l.length-1).toLowerCase().indexOf("x")?"x":"y",this.add(e[a],o,e[a][o],a==="skew"?Qv(u):u,0,0,0,0,0,1);else if(l==="scale"||l==="anchor"||l==="pivot"||l==="tileScale")this.add(e[l],"x",e[l].x,u),this.add(e[l],"y",e[l].y,u);else if(l==="rotation"||l==="angle")e_(this,e,l,e[l],u,l==="rotation");else if(Zv[l])h||(Xv(e,r.colorMatrixFilter||r,this),h=!0);else if(l==="blur"||l==="blurX"||l==="blurY"||l==="blurPadding"){if(d=tl(e,"BlurFilter"),this.add(d,l,d[l],u),r.blurPadding!==0)for(c=r.blurPadding||Math.max(d[l],u)*2,f=e.filters.length;--f>-1;)e.filters[f].padding=Math.max(e.filters[f].padding,c)}else if(Kv[l])if((l==="lineColor"||l==="fillColor")&&e instanceof We.Graphics)for(p=(e.geometry||e).graphicsData,this._pt=new Yr(this._pt,e,l,0,0,qv,{g:e.geometry||e}),f=p.length;--f>-1;)il(ls?p[f]:p[f][l.substr(0,4)+"Style"],ls?l:"color",u,this);else il(e,l,u,this);else l==="autoAlpha"?(this._pt=new Yr(this._pt,e,"visible",0,0,Yv),this.add(e,"alpha",e.alpha,u),this._props.push("alpha","visible")):l!=="resolution"&&this.add(e,l,"get",u);this._props.push(l)}}};Yo()&&It.registerPlugin(cs),k.registerPlugin(cs),cs.registerPIXI(Ge),k.registerPlugin(qr),qr.create("springBounce","0.32, 1.06, 0.61, 0.93"),k.registerEffect({name:"PULSE",effect(t,e){return k.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),k.registerEffect({name:"SHAKE",effect(t,e){return k.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),k.registerEffect({name:"SWING",effect(t,e){return k.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),k.registerEffect({name:"JELLO",effect(t,e){return k.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),k.registerEffect({name:"WOOBLE",effect(t,e){return k.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),k.registerEffect({name:"NONE",effect(t,e){return k.timeline().to(t,{duration:0})}}),k.registerEffect({name:"FLASH",effect(t,e){return k.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),k.registerEffect({name:"BOUNCE_IN",effect(t,e){return k.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e==null?void 0:e.x,y:e==null?void 0:e.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),k.registerEffect({name:"BOUNCE_IN_DOWN",effect(t,e){return k.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e==null?void 0:e.x,y:-2500,alpha:0}})}}),k.registerEffect({name:"BOUNCE_IN_LEFT",effect(t,e){return k.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),k.registerEffect({name:"BOUNCE_IN_RIGHT",effect(t,e){const r=Math.max(1e3,(e==null?void 0:e.maxX)+500);return k.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:r}})}}),k.registerEffect({name:"BOUNCE_IN_UP",effect(t,e){return k.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),k.registerEffect({name:"BOUNCE_OUT",effect(t,e){return k.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),k.registerEffect({name:"FADE_IN",effect(t){return k.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),k.registerEffect({name:"FADE_IN_DOWN",effect(t,e){return k.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),k.registerEffect({name:"FADE_IN_LEFT",effect(t,e){return k.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),k.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){return k.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),k.registerEffect({name:"FADE_IN_UP",effect(t,e){return k.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),k.registerEffect({name:"SPIN",effect(t){return k.to(t,{rotation:(e,r)=>k.utils.snap(360,Number(k.getProperty(r,"rotation"))+360)})}});function ol(){return{updateEffect:P.useCallback((e,r,i)=>k.effects[r]&&e?k.effects[r](e,i):k.effects.NONE(e,i),[])}}var hs=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t))(hs||{});const t_=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Gt=L.forwardRef((t,e)=>{const[r,i]=L.useState(!1),[n,s]=P.useState(!1),[a,o]=P.useState(!1),[u,h]=P.useState(),d=dv(u,300),l=P.useRef(null),c=P.useRef(null),f=P.useRef(null),p=P.useRef(null),m=P.useRef(null),v=P.useRef(null),{tl:g}=P.useContext(Et),y=te.useApp(),_=y.screen.width,x=y.screen.height,{uniqueId:b,visible:T,startAt:w,transformation:{x:S,y:A,width:C,height:F,scale:z=[1,1],rotation:I=0,effect:E,overlay:B,animation:U=hs.NONE},applyTransformer:R,disabled:$,pointerdown:X,pointerout:M,pointerover:O,isText:H,isDragging:V,isGif:W,onDoubleClick:ne,isTextEditMode:oe}=t,ce=ol();Oe(we.COMPLETE,()=>{l.current}),L.useImperativeHandle(e,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>a}),[n,a]),L.useEffect(()=>{l.current&&i(!0)},[]),L.useEffect(()=>{h({x:S,y:A,width:C,height:F,animation:U,maxX:_,maxY:x})},[U,S,A,C,F,_,x]),L.useEffect(()=>{if(!c.current)return;const Y=k.context(()=>{if(g.current&&d){const{x:me,y:De,animation:Be,maxX:ct,maxY:Q}=d||{},he=g.current.progress(),Me=ce.updateEffect(l.current,Be,{immediateRender:!1,x:me,y:De,overwrite:!0,maxX:ct,maxY:Q});m.current&&(g.current.remove(m.current),m.current.progress(0).kill()),he>.1?(Me.eventCallback("onComplete",()=>{Me.remove("onComplete"),g.current.add(Me,w),m.current=Me}),Me.play()):(Me.progress(1),g.current.add(Me,w),m.current=Me)}else m.current&&m.current.progress(0).kill()},c.current);return()=>{Y.revert()}},[w,d]);const ve=L.useCallback(()=>{o(!0),O&&O()},[]),de=L.useCallback(()=>{s(!0)},[]),G=L.useCallback(Y=>{t.onAnchorTransformationEnd&&t.onAnchorTransformationEnd(Y),s(!1)},[]),q=te.withFilters(te.Container,{matrix:Ge.filters.ColorMatrixFilter});return K.jsxs(te.Container,{ref:c,children:[K.jsx(te.Container,{ref:l,position:[S,A],pivot:[S,A],width:C,height:F,scale:z,rotation:I,...!$&&T&&!n&&!V&&{interactive:!0,buttonMode:!0,pointerdown:X,pointerover:O,pointerout:M},children:K.jsxs(te.Container,{ref:v,children:[!W&&K.jsx(q,{scale:1,apply:({matrix:Y})=>{E===Ut.BlackAndWhite?Y.desaturate():E===Ut.Sepia?Y.sepia():E===Ut.RetroVintage||E===Ut.NightVision?Y.negative():E===Ut.Normal&&Y.reset()},matrix:{enabled:!0,matrix:t_},children:K.jsx(te.Container,{ref:f,children:t.children})}),W&&K.jsx(te.Container,{ref:f,children:t.children}),!dr(B)&&B!==os.NONE&&B!==os.NORMAL&&K.jsx(Iv,{overlay:B,width:C,height:F,x:S,y:A})]})}),R&&T&&!oe&&K.jsx(Vh,{pixiTransformerRef:p,imageRef:l,isMounted:r,transformCommit:G,transformChange:de,mouseoverEvent:ve,uniqueId:b,isText:H,onDoubleClick:ne})]})});var zt=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(zt||{}),ll=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(ll||{}),fs=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(fs||{}),j=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(j||{}),Rt=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(Rt||{}),N=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(N||{}),pr=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(pr||{}),se=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(se||{}),ds=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(ds||{}),dt=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(dt||{}),Zr=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(Zr||{}),jt=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(jt||{}),Pt=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(Pt||{}),Ht=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(Ht||{}),ps=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(ps||{}),Ze=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(Ze||{}),Ee=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(Ee||{}),Ae=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(Ae||{}),pt=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(pt||{});const Z={ADAPTER:{createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var ms=/iPhone/i,ul=/iPod/i,cl=/iPad/i,hl=/\biOS-universal(?:.+)Mac\b/i,gs=/\bAndroid(?:.+)Mobile\b/i,fl=/Android/i,mr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,$i=/Silk/i,yt=/Windows Phone/i,dl=/\bWindows(?:.+)ARM\b/i,pl=/BlackBerry/i,ml=/BB10/i,gl=/Opera Mini/i,vl=/\b(CriOS|Chrome)(?:.+)Mobile/i,_l=/Mobile(?:.+)Firefox\b/i,yl=function(t){return typeof t<"u"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function r_(t){return function(e){return e.test(t)}}function xl(t){var e={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var r=e.userAgent,i=r.split("[FBAN");typeof i[1]<"u"&&(r=i[0]),i=r.split("Twitter"),typeof i[1]<"u"&&(r=i[0]);var n=r_(r),s={apple:{phone:n(ms)&&!n(yt),ipod:n(ul),tablet:!n(ms)&&(n(cl)||yl(e))&&!n(yt),universal:n(hl),device:(n(ms)||n(ul)||n(cl)||n(hl)||yl(e))&&!n(yt)},amazon:{phone:n(mr),tablet:!n(mr)&&n($i),device:n(mr)||n($i)},android:{phone:!n(yt)&&n(mr)||!n(yt)&&n(gs),tablet:!n(yt)&&!n(mr)&&!n(gs)&&(n($i)||n(fl)),device:!n(yt)&&(n(mr)||n($i)||n(gs)||n(fl))||n(/\bokhttp\b/i)},windows:{phone:n(yt),tablet:n(dl),device:n(yt)||n(dl)},other:{blackberry:n(pl),blackberry10:n(ml),opera:n(gl),firefox:n(_l),chrome:n(vl),device:n(pl)||n(ml)||n(gl)||n(_l)||n(vl)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const gr=(xl.default??xl)(globalThis.navigator);Z.RETINA_PREFIX=/@([0-9\.]+)x/,Z.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var bl={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function n(u,h,d){this.fn=u,this.context=h,this.once=d||!1}function s(u,h,d,l,c){if(typeof d!="function")throw new TypeError("The listener must be a function");var f=new n(d,l||u,c),p=r?r+h:h;return u._events[p]?u._events[p].fn?u._events[p]=[u._events[p],f]:u._events[p].push(f):(u._events[p]=f,u._eventsCount++),u}function a(u,h){--u._eventsCount===0?u._events=new i:delete u._events[h]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],d,l;if(this._eventsCount===0)return h;for(l in d=this._events)e.call(d,l)&&h.push(r?l.slice(1):l);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},o.prototype.listeners=function(h){var d=r?r+h:h,l=this._events[d];if(!l)return[];if(l.fn)return[l.fn];for(var c=0,f=l.length,p=new Array(f);c<f;c++)p[c]=l[c].fn;return p},o.prototype.listenerCount=function(h){var d=r?r+h:h,l=this._events[d];return l?l.fn?1:l.length:0},o.prototype.emit=function(h,d,l,c,f,p){var m=r?r+h:h;if(!this._events[m])return!1;var v=this._events[m],g=arguments.length,y,_;if(v.fn){switch(v.once&&this.removeListener(h,v.fn,void 0,!0),g){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,l),!0;case 4:return v.fn.call(v.context,d,l,c),!0;case 5:return v.fn.call(v.context,d,l,c,f),!0;case 6:return v.fn.call(v.context,d,l,c,f,p),!0}for(_=1,y=new Array(g-1);_<g;_++)y[_-1]=arguments[_];v.fn.apply(v.context,y)}else{var x=v.length,b;for(_=0;_<x;_++)switch(v[_].once&&this.removeListener(h,v[_].fn,void 0,!0),g){case 1:v[_].fn.call(v[_].context);break;case 2:v[_].fn.call(v[_].context,d);break;case 3:v[_].fn.call(v[_].context,d,l);break;case 4:v[_].fn.call(v[_].context,d,l,c);break;default:if(!y)for(b=1,y=new Array(g-1);b<g;b++)y[b-1]=arguments[b];v[_].fn.apply(v[_].context,y)}}return!0},o.prototype.on=function(h,d,l){return s(this,h,d,l,!1)},o.prototype.once=function(h,d,l){return s(this,h,d,l,!0)},o.prototype.removeListener=function(h,d,l,c){var f=r?r+h:h;if(!this._events[f])return this;if(!d)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===d&&(!c||p.once)&&(!l||p.context===l)&&a(this,f);else{for(var m=0,v=[],g=p.length;m<g;m++)(p[m].fn!==d||c&&!p[m].once||l&&p[m].context!==l)&&v.push(p[m]);v.length?this._events[f]=v.length===1?v[0]:v:a(this,f)}return this},o.prototype.removeAllListeners=function(h){var d;return h?(d=r?r+h:h,this._events[d]&&a(this,d)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(bl);var i_=bl.exports;const Gi=Bt(i_);var vs={exports:{}};vs.exports=zi,vs.exports.default=zi;function zi(t,e,r){r=r||2;var i=e&&e.length,n=i?e[0]*r:t.length,s=Tl(t,0,n,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,u,h,d,l,c,f;if(i&&(s=l_(t,e,s,r)),t.length>80*r){o=h=t[0],u=d=t[1];for(var p=r;p<n;p+=r)l=t[p],c=t[p+1],l<o&&(o=l),c<u&&(u=c),l>h&&(h=l),c>d&&(d=c);f=Math.max(h-o,d-u),f=f!==0?32767/f:0}return Qr(s,a,r,o,u,f,0),a}function Tl(t,e,r,i,n){var s,a;if(n===xs(t,e,r,i)>0)for(s=e;s<r;s+=i)a=Al(s,t[s],t[s+1],a);else for(s=r-i;s>=e;s-=i)a=Al(s,t[s],t[s+1],a);return a&&ji(a,a.next)&&(ei(a),a=a.next),a}function Vt(t,e){if(!t)return t;e||(e=t);var r=t,i;do if(i=!1,!r.steiner&&(ji(r,r.next)||xe(r.prev,r,r.next)===0)){if(ei(r),r=e=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function Qr(t,e,r,i,n,s,a){if(t){!a&&s&&d_(t,i,n,s);for(var o=t,u,h;t.prev!==t.next;){if(u=t.prev,h=t.next,s?s_(t,i,n,s):n_(t)){e.push(u.i/r|0),e.push(t.i/r|0),e.push(h.i/r|0),ei(t),t=h.next,o=h.next;continue}if(t=h,t===o){a?a===1?(t=a_(Vt(t),e,r),Qr(t,e,r,i,n,s,2)):a===2&&o_(t,e,r,i,n,s):Qr(Vt(t),e,r,i,n,s,1);break}}}}function n_(t){var e=t.prev,r=t,i=t.next;if(xe(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,a=i.x,o=e.y,u=r.y,h=i.y,d=n<s?n<a?n:a:s<a?s:a,l=o<u?o<h?o:h:u<h?u:h,c=n>s?n>a?n:a:s>a?s:a,f=o>u?o>h?o:h:u>h?u:h,p=i.next;p!==e;){if(p.x>=d&&p.x<=c&&p.y>=l&&p.y<=f&&vr(n,o,s,u,a,h,p.x,p.y)&&xe(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function s_(t,e,r,i){var n=t.prev,s=t,a=t.next;if(xe(n,s,a)>=0)return!1;for(var o=n.x,u=s.x,h=a.x,d=n.y,l=s.y,c=a.y,f=o<u?o<h?o:h:u<h?u:h,p=d<l?d<c?d:c:l<c?l:c,m=o>u?o>h?o:h:u>h?u:h,v=d>l?d>c?d:c:l>c?l:c,g=_s(f,p,e,r,i),y=_s(m,v,e,r,i),_=t.prevZ,x=t.nextZ;_&&_.z>=g&&x&&x.z<=y;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=v&&_!==n&&_!==a&&vr(o,d,u,l,h,c,_.x,_.y)&&xe(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=v&&x!==n&&x!==a&&vr(o,d,u,l,h,c,x.x,x.y)&&xe(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=v&&_!==n&&_!==a&&vr(o,d,u,l,h,c,_.x,_.y)&&xe(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=v&&x!==n&&x!==a&&vr(o,d,u,l,h,c,x.x,x.y)&&xe(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function a_(t,e,r){var i=t;do{var n=i.prev,s=i.next.next;!ji(n,s)&&wl(n,i,i.next,s)&&Jr(n,s)&&Jr(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),ei(i),ei(i.next),i=t=s),i=i.next}while(i!==t);return Vt(i)}function o_(t,e,r,i,n,s){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&g_(a,o)){var u=Sl(a,o);a=Vt(a,a.next),u=Vt(u,u.next),Qr(a,e,r,i,n,s,0),Qr(u,e,r,i,n,s,0);return}o=o.next}a=a.next}while(a!==t)}function l_(t,e,r,i){var n=[],s,a,o,u,h;for(s=0,a=e.length;s<a;s++)o=e[s]*i,u=s<a-1?e[s+1]*i:t.length,h=Tl(t,o,u,i,!1),h===h.next&&(h.steiner=!0),n.push(m_(h));for(n.sort(u_),s=0;s<n.length;s++)r=c_(n[s],r);return r}function u_(t,e){return t.x-e.x}function c_(t,e){var r=h_(t,e);if(!r)return e;var i=Sl(r,t);return Vt(i,i.next),Vt(r,r.next)}function h_(t,e){var r=e,i=t.x,n=t.y,s=-1/0,a;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=i&&o>s&&(s=o,a=r.x<r.next.x?r:r.next,o===i))return a}r=r.next}while(r!==e);if(!a)return null;var u=a,h=a.x,d=a.y,l=1/0,c;r=a;do i>=r.x&&r.x>=h&&i!==r.x&&vr(n<d?i:s,n,h,d,n<d?s:i,n,r.x,r.y)&&(c=Math.abs(n-r.y)/(i-r.x),Jr(r,t)&&(c<l||c===l&&(r.x>a.x||r.x===a.x&&f_(a,r)))&&(a=r,l=c)),r=r.next;while(r!==u);return a}function f_(t,e){return xe(t.prev,t,e.prev)<0&&xe(e.next,t,t.next)<0}function d_(t,e,r,i){var n=t;do n.z===0&&(n.z=_s(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,p_(n)}function p_(t){var e,r,i,n,s,a,o,u,h=1;do{for(r=t,t=null,s=null,a=0;r;){for(a++,i=r,o=0,e=0;e<h&&(o++,i=i.nextZ,!!i);e++);for(u=h;o>0||u>0&&i;)o!==0&&(u===0||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,u--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,h*=2}while(a>1);return t}function _s(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function m_(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function vr(t,e,r,i,n,s,a,o){return(n-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(r-a)*(e-o)&&(r-a)*(s-o)>=(n-a)*(i-o)}function g_(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!v_(t,e)&&(Jr(t,e)&&Jr(e,t)&&__(t,e)&&(xe(t.prev,t,e.prev)||xe(t,e.prev,e))||ji(t,e)&&xe(t.prev,t,t.next)>0&&xe(e.prev,e,e.next)>0)}function xe(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ji(t,e){return t.x===e.x&&t.y===e.y}function wl(t,e,r,i){var n=Vi(xe(t,e,r)),s=Vi(xe(t,e,i)),a=Vi(xe(r,i,t)),o=Vi(xe(r,i,e));return!!(n!==s&&a!==o||n===0&&Hi(t,r,e)||s===0&&Hi(t,i,e)||a===0&&Hi(r,t,i)||o===0&&Hi(r,e,i))}function Hi(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Vi(t){return t>0?1:t<0?-1:0}function v_(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&wl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Jr(t,e){return xe(t.prev,t,t.next)<0?xe(t,e,t.next)>=0&&xe(t,t.prev,e)>=0:xe(t,e,t.prev)<0||xe(t,t.next,e)<0}function __(t,e){var r=t,i=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function Sl(t,e){var r=new ys(t.i,t.x,t.y),i=new ys(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function Al(t,e,r,i){var n=new ys(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function ei(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ys(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}zi.deviation=function(t,e,r,i){var n=e&&e.length,s=n?e[0]*r:t.length,a=Math.abs(xs(t,0,s,r));if(n)for(var o=0,u=e.length;o<u;o++){var h=e[o]*r,d=o<u-1?e[o+1]*r:t.length;a-=Math.abs(xs(t,h,d,r))}var l=0;for(o=0;o<i.length;o+=3){var c=i[o]*r,f=i[o+1]*r,p=i[o+2]*r;l+=Math.abs((t[c]-t[p])*(t[f+1]-t[c+1])-(t[c]-t[f])*(t[p+1]-t[c+1]))}return a===0&&l===0?0:Math.abs((l-a)/a)};function xs(t,e,r,i){for(var n=0,s=e,a=r-i;s<r;s+=i)n+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return n}zi.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var s=0;s<t[n].length;s++)for(var a=0;a<e;a++)r.vertices.push(t[n][s][a]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r};var y_=vs.exports;const x_=Bt(y_);var Xi={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Xi.exports,function(t,e){(function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,s=typeof Xe=="object"&&Xe;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,u=36,h=1,d=26,l=38,c=700,f=72,p=128,m="-",v=/^xn--/,g=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=u-h,b=Math.floor,T=String.fromCharCode,w;function S(M){throw new RangeError(_[M])}function A(M,O){for(var H=M.length,V=[];H--;)V[H]=O(M[H]);return V}function C(M,O){var H=M.split("@"),V="";H.length>1&&(V=H[0]+"@",M=H[1]),M=M.replace(y,".");var W=M.split("."),ne=A(W,O).join(".");return V+ne}function F(M){for(var O=[],H=0,V=M.length,W,ne;H<V;)W=M.charCodeAt(H++),W>=55296&&W<=56319&&H<V?(ne=M.charCodeAt(H++),(ne&64512)==56320?O.push(((W&1023)<<10)+(ne&1023)+65536):(O.push(W),H--)):O.push(W);return O}function z(M){return A(M,function(O){var H="";return O>65535&&(O-=65536,H+=T(O>>>10&1023|55296),O=56320|O&1023),H+=T(O),H}).join("")}function I(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:u}function E(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function B(M,O,H){var V=0;for(M=H?b(M/c):M>>1,M+=b(M/O);M>x*d>>1;V+=u)M=b(M/x);return b(V+(x+1)*M/(M+l))}function U(M){var O=[],H=M.length,V,W=0,ne=p,oe=f,ce,ve,de,G,q,Y,me,De,Be;for(ce=M.lastIndexOf(m),ce<0&&(ce=0),ve=0;ve<ce;++ve)M.charCodeAt(ve)>=128&&S("not-basic"),O.push(M.charCodeAt(ve));for(de=ce>0?ce+1:0;de<H;){for(G=W,q=1,Y=u;de>=H&&S("invalid-input"),me=I(M.charCodeAt(de++)),(me>=u||me>b((o-W)/q))&&S("overflow"),W+=me*q,De=Y<=oe?h:Y>=oe+d?d:Y-oe,!(me<De);Y+=u)Be=u-De,q>b(o/Be)&&S("overflow"),q*=Be;V=O.length+1,oe=B(W-G,V,G==0),b(W/V)>o-ne&&S("overflow"),ne+=b(W/V),W%=V,O.splice(W++,0,ne)}return z(O)}function R(M){var O,H,V,W,ne,oe,ce,ve,de,G,q,Y=[],me,De,Be,ct;for(M=F(M),me=M.length,O=p,H=0,ne=f,oe=0;oe<me;++oe)q=M[oe],q<128&&Y.push(T(q));for(V=W=Y.length,W&&Y.push(m);V<me;){for(ce=o,oe=0;oe<me;++oe)q=M[oe],q>=O&&q<ce&&(ce=q);for(De=V+1,ce-O>b((o-H)/De)&&S("overflow"),H+=(ce-O)*De,O=ce,oe=0;oe<me;++oe)if(q=M[oe],q<O&&++H>o&&S("overflow"),q==O){for(ve=H,de=u;G=de<=ne?h:de>=ne+d?d:de-ne,!(ve<G);de+=u)ct=ve-G,Be=u-G,Y.push(T(E(G+ct%Be,0))),ve=b(ct/Be);Y.push(T(E(ve,0))),ne=B(H,De,V==W),H=0,++V}++H,++O}return Y.join("")}function $(M){return C(M,function(O){return v.test(O)?U(O.slice(4).toLowerCase()):O})}function X(M){return C(M,function(O){return g.test(O)?"xn--"+R(O):O})}if(a={version:"1.4.1",ucs2:{decode:F,encode:z},decode:U,encode:R,toASCII:X,toUnicode:$},i&&n)if(t.exports==i)n.exports=a;else for(w in a)a.hasOwnProperty(w)&&(i[w]=a[w]);else r.punycode=a})(Xe)}(Xi,Xi.exports);var b_=Xi.exports,T_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,r);if(a.value!==n||a.enumerable!==!0)return!1}return!0},El=typeof Symbol<"u"&&Symbol,w_=T_,S_=function(){return typeof El!="function"||typeof Symbol!="function"||typeof El("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:w_()},Cl={foo:{}},A_=Object,E_=function(){return{__proto__:Cl}.foo===Cl.foo&&!({__proto__:null}instanceof A_)},C_="Function.prototype.bind called on incompatible ",bs=Array.prototype.slice,I_=Object.prototype.toString,R_="[object Function]",P_=function(e){var r=this;if(typeof r!="function"||I_.call(r)!==R_)throw new TypeError(C_+r);for(var i=bs.call(arguments,1),n,s=function(){if(this instanceof n){var d=r.apply(this,i.concat(bs.call(arguments)));return Object(d)===d?d:this}else return r.apply(e,i.concat(bs.call(arguments)))},a=Math.max(0,r.length-i.length),o=[],u=0;u<a;u++)o.push("$"+u);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=function(){};h.prototype=r.prototype,n.prototype=new h,h.prototype=null}return n},M_=P_,Ts=Function.prototype.bind||M_,F_=Ts,O_=F_.call(Function.call,Object.prototype.hasOwnProperty),J,_r=SyntaxError,Il=Function,yr=TypeError,ws=function(t){try{return Il('"use strict"; return ('+t+").constructor;")()}catch{}},Xt=Object.getOwnPropertyDescriptor;if(Xt)try{Xt({},"")}catch{Xt=null}var Ss=function(){throw new yr},N_=Xt?function(){try{return arguments.callee,Ss}catch{try{return Xt(arguments,"callee").get}catch{return Ss}}}():Ss,xr=S_(),k_=E_(),Ie=Object.getPrototypeOf||(k_?function(t){return t.__proto__}:null),br={},L_=typeof Uint8Array>"u"||!Ie?J:Ie(Uint8Array),Wt={"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":xr&&Ie?Ie([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":br,"%AsyncGenerator%":br,"%AsyncGeneratorFunction%":br,"%AsyncIteratorPrototype%":br,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":Il,"%GeneratorFunction%":br,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xr&&Ie?Ie(Ie([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xr||!Ie?J:Ie(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xr||!Ie?J:Ie(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xr&&Ie?Ie(""[Symbol.iterator]()):J,"%Symbol%":xr?Symbol:J,"%SyntaxError%":_r,"%ThrowTypeError%":N_,"%TypedArray%":L_,"%TypeError%":yr,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet};if(Ie)try{null.error}catch(t){var D_=Ie(Ie(t));Wt["%Error.prototype%"]=D_}var B_=function t(e){var r;if(e==="%AsyncFunction%")r=ws("async function () {}");else if(e==="%GeneratorFunction%")r=ws("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ws("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Ie&&(r=Ie(n.prototype))}return Wt[e]=r,r},Rl={"%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"]},ti=Ts,Wi=O_,U_=ti.call(Function.call,Array.prototype.concat),$_=ti.call(Function.apply,Array.prototype.splice),Pl=ti.call(Function.call,String.prototype.replace),qi=ti.call(Function.call,String.prototype.slice),G_=ti.call(Function.call,RegExp.prototype.exec),z_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j_=/\\(\\)?/g,H_=function(e){var r=qi(e,0,1),i=qi(e,-1);if(r==="%"&&i!=="%")throw new _r("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new _r("invalid intrinsic syntax, expected opening `%`");var n=[];return Pl(e,z_,function(s,a,o,u){n[n.length]=o?Pl(u,j_,"$1"):a||s}),n},V_=function(e,r){var i=e,n;if(Wi(Rl,i)&&(n=Rl[i],i="%"+n[0]+"%"),Wi(Wt,i)){var s=Wt[i];if(s===br&&(s=B_(i)),typeof s>"u"&&!r)throw new yr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new _r("intrinsic "+e+" does not exist!")},As=function(e,r){if(typeof e!="string"||e.length===0)throw new yr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new yr('"allowMissing" argument must be a boolean');if(G_(/^%?[^%]*%?$/,e)===null)throw new _r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=H_(e),n=i.length>0?i[0]:"",s=V_("%"+n+"%",r),a=s.name,o=s.value,u=!1,h=s.alias;h&&(n=h[0],$_(i,U_([0,1],h)));for(var d=1,l=!0;d<i.length;d+=1){var c=i[d],f=qi(c,0,1),p=qi(c,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new _r("property names with quotes must have matching quotes");if((c==="constructor"||!l)&&(u=!0),n+="."+c,a="%"+n+"%",Wi(Wt,a))o=Wt[a];else if(o!=null){if(!(c in o)){if(!r)throw new yr("base intrinsic for "+e+" exists, but the property is not available.");return}if(Xt&&d+1>=i.length){var m=Xt(o,c);l=!!m,l&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[c]}else l=Wi(o,c),o=o[c];l&&!u&&(Wt[a]=o)}}return o},Ml={exports:{}};(function(t){var e=Ts,r=As,i=r("%Function.prototype.apply%"),n=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(n,i),a=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}t.exports=function(l){var c=s(e,n,arguments);if(a&&o){var f=a(c,"length");f.configurable&&o(c,"length",{value:1+u(0,l.length-(arguments.length-1))})}return c};var h=function(){return s(e,i,arguments)};o?o(t.exports,"apply",{value:h}):t.exports.apply=h})(Ml);var X_=Ml.exports,Fl=As,Ol=X_,W_=Ol(Fl("String.prototype.indexOf")),q_=function(e,r){var i=Fl(e,!!r);return typeof i=="function"&&W_(e,".prototype.")>-1?Ol(i):i};const Y_=Lh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Es=typeof Map=="function"&&Map.prototype,Cs=Object.getOwnPropertyDescriptor&&Es?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Yi=Es&&Cs&&typeof Cs.get=="function"?Cs.get:null,Nl=Es&&Map.prototype.forEach,Is=typeof Set=="function"&&Set.prototype,Rs=Object.getOwnPropertyDescriptor&&Is?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ki=Is&&Rs&&typeof Rs.get=="function"?Rs.get:null,kl=Is&&Set.prototype.forEach,K_=typeof WeakMap=="function"&&WeakMap.prototype,ri=K_?WeakMap.prototype.has:null,Z_=typeof WeakSet=="function"&&WeakSet.prototype,ii=Z_?WeakSet.prototype.has:null,Q_=typeof WeakRef=="function"&&WeakRef.prototype,Ll=Q_?WeakRef.prototype.deref:null,J_=Boolean.prototype.valueOf,ey=Object.prototype.toString,ty=Function.prototype.toString,ry=String.prototype.match,Ps=String.prototype.slice,Mt=String.prototype.replace,iy=String.prototype.toUpperCase,Dl=String.prototype.toLowerCase,Bl=RegExp.prototype.test,Ul=Array.prototype.concat,mt=Array.prototype.join,ny=Array.prototype.slice,$l=Math.floor,Ms=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Fs=Object.getOwnPropertySymbols,Os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Tr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ne=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Tr||"symbol")?Symbol.toStringTag:null,Gl=Object.prototype.propertyIsEnumerable,zl=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function jl(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Bl.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-$l(-t):$l(t);if(i!==t){var n=String(i),s=Ps.call(e,n.length+1);return Mt.call(n,r,"$&_")+"."+Mt.call(Mt.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Mt.call(e,r,"$&_")}var Ns=Y_,Hl=Ns.custom,Vl=ql(Hl)?Hl:null,sy=function t(e,r,i,n){var s=r||{};if(Ft(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ft(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Ft(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ft(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ft(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Kl(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return o?jl(e,u):u}if(typeof e=="bigint"){var h=String(e)+"n";return o?jl(e,h):h}var d=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof e=="object")return ks(e)?"[Array]":"[Object]";var l=wy(s,i);if(typeof n>"u")n=[];else if(Yl(n,e)>=0)return"[Circular]";function c(I,E,B){if(E&&(n=ny.call(n),n.push(E)),B){var U={depth:s.depth};return Ft(s,"quoteStyle")&&(U.quoteStyle=s.quoteStyle),t(I,U,i+1,n)}return t(I,s,i+1,n)}if(typeof e=="function"&&!Wl(e)){var f=py(e),p=Zi(e,c);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+mt.call(p,", ")+" }":"")}if(ql(e)){var m=Tr?Mt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Os.call(e);return typeof e=="object"&&!Tr?ni(m):m}if(xy(e)){for(var v="<"+Dl.call(String(e.nodeName)),g=e.attributes||[],y=0;y<g.length;y++)v+=" "+g[y].name+"="+Xl(ay(g[y].value),"double",s);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+Dl.call(String(e.nodeName))+">",v}if(ks(e)){if(e.length===0)return"[]";var _=Zi(e,c);return l&&!Ty(_)?"["+Ds(_,l)+"]":"[ "+mt.call(_,", ")+" ]"}if(ly(e)){var x=Zi(e,c);return!("cause"in Error.prototype)&&"cause"in e&&!Gl.call(e,"cause")?"{ ["+String(e)+"] "+mt.call(Ul.call("[cause]: "+c(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+mt.call(x,", ")+" }"}if(typeof e=="object"&&a){if(Vl&&typeof e[Vl]=="function"&&Ns)return Ns(e,{depth:d-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(my(e)){var b=[];return Nl&&Nl.call(e,function(I,E){b.push(c(E,e,!0)+" => "+c(I,e))}),Zl("Map",Yi.call(e),b,l)}if(_y(e)){var T=[];return kl&&kl.call(e,function(I){T.push(c(I,e))}),Zl("Set",Ki.call(e),T,l)}if(gy(e))return Ls("WeakMap");if(yy(e))return Ls("WeakSet");if(vy(e))return Ls("WeakRef");if(cy(e))return ni(c(Number(e)));if(fy(e))return ni(c(Ms.call(e)));if(hy(e))return ni(J_.call(e));if(uy(e))return ni(c(String(e)));if(!oy(e)&&!Wl(e)){var w=Zi(e,c),S=zl?zl(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",C=!S&&Ne&&Object(e)===e&&Ne in e?Ps.call(Ot(e),8,-1):A?"Object":"",F=S||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",z=F+(C||A?"["+mt.call(Ul.call([],C||[],A||[]),": ")+"] ":"");return w.length===0?z+"{}":l?z+"{"+Ds(w,l)+"}":z+"{ "+mt.call(w,", ")+" }"}return String(e)};function Xl(t,e,r){var i=(r.quoteStyle||e)==="double"?'"':"'";return i+t+i}function ay(t){return Mt.call(String(t),/"/g,"&quot;")}function ks(t){return Ot(t)==="[object Array]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function oy(t){return Ot(t)==="[object Date]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function Wl(t){return Ot(t)==="[object RegExp]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function ly(t){return Ot(t)==="[object Error]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function uy(t){return Ot(t)==="[object String]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function cy(t){return Ot(t)==="[object Number]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function hy(t){return Ot(t)==="[object Boolean]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function ql(t){if(Tr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Os)return!1;try{return Os.call(t),!0}catch{}return!1}function fy(t){if(!t||typeof t!="object"||!Ms)return!1;try{return Ms.call(t),!0}catch{}return!1}var dy=Object.prototype.hasOwnProperty||function(t){return t in this};function Ft(t,e){return dy.call(t,e)}function Ot(t){return ey.call(t)}function py(t){if(t.name)return t.name;var e=ry.call(ty.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Yl(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function my(t){if(!Yi||!t||typeof t!="object")return!1;try{Yi.call(t);try{Ki.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function gy(t){if(!ri||!t||typeof t!="object")return!1;try{ri.call(t,ri);try{ii.call(t,ii)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function vy(t){if(!Ll||!t||typeof t!="object")return!1;try{return Ll.call(t),!0}catch{}return!1}function _y(t){if(!Ki||!t||typeof t!="object")return!1;try{Ki.call(t);try{Yi.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function yy(t){if(!ii||!t||typeof t!="object")return!1;try{ii.call(t,ii);try{ri.call(t,ri)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function xy(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Kl(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return Kl(Ps.call(t,0,e.maxStringLength),e)+i}var n=Mt.call(Mt.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,by);return Xl(n,"single",e)}function by(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+iy.call(e.toString(16))}function ni(t){return"Object("+t+")"}function Ls(t){return t+" { ? }"}function Zl(t,e,r,i){var n=i?Ds(r,i):mt.call(r,", ");return t+" ("+e+") {"+n+"}"}function Ty(t){for(var e=0;e<t.length;e++)if(Yl(t[e],`
34
- `)>=0)return!1;return!0}function wy(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=mt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:mt.call(Array(e+1),r)}}function Ds(t,e){if(t.length===0)return"";var r=`
33
+ */var Ct,Ho,Oi,Xe,Xr,Vo,ns,Xo=function(){return typeof window<"u"},Wo=function(){return Ct||Xo()&&(Ct=window.gsap)&&Ct.registerPlugin&&Ct},qo=function(e){return typeof e=="function"},Gv=function(e){return console.warn(e)},zv=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],We=.212671,qe=.71516,Ye=.072169,Ni=function(e,r){var i=[],n=0,s=0,a,o;for(a=0;a<4;a++){for(o=0;o<5;o++)s=o===4?e[n+4]:0,i[n+o]=e[n]*r[o]+e[n+1]*r[o+5]+e[n+2]*r[o+10]+e[n+3]*r[o+15]+s;n+=5}return i},Yo=function(e,r){var i=1-r,n=i*We,s=i*qe,a=i*Ye;return Ni([n+r,s,a,0,0,n,s+r,a,0,0,n,s,a+r,0,0,0,0,0,1,0],e)},Ko=function(e,r,i){var n=Oi(r),s=n[0]/255,a=n[1]/255,o=n[2]/255,u=1-i;return Ni([u+i*s*We,i*s*qe,i*s*Ye,0,0,i*a*We,u+i*a*qe,i*a*Ye,0,0,i*o*We,i*o*qe,u+i*o*Ye,0,0,0,0,0,1,0],e)},Zo=function(e,r){r*=Math.PI/180;var i=Math.cos(r),n=Math.sin(r);return Ni([We+i*(1-We)+n*-We,qe+i*-qe+n*-qe,Ye+i*-Ye+n*(1-Ye),0,0,We+i*-We+n*.143,qe+i*(1-qe)+n*.14,Ye+i*-Ye+n*-.283,0,0,We+i*-We+n*-(1-We),qe+i*-qe+n*qe,Ye+i*(1-Ye)+n*Ye,0,0,0,0,0,1,0,0,0,0,0,1],e)},Qo=function(e,r){return Ni([r,0,0,0,.5*(1-r),0,r,0,0,.5*(1-r),0,0,r,0,.5*(1-r),0,0,0,1,0],e)},Jo=function(e,r){var i=Xe.filters[r],n=e.filters||[],s=n.length,a;for(i||Gv(r+" not found. PixiPlugin.registerPIXI(PIXI)");--s>-1;)if(n[s]instanceof i)return n[s];return a=new i,r==="BlurFilter"&&(a.blur=0),n.push(a),e.filters=n,a},Ce=function(e,r,i,n){r.add(i,e,i[e],n[e]),r._props.push(e)},el=function(e,r){var i=new Xe.filters.ColorMatrixFilter;return i.matrix=r,i.brightness(e,!0),i.matrix},jv=function(e){var r={},i;for(i in e)r[i]=e[i];return r},ze={contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},Hv=function(e,r,i){var n=Jo(e,"ColorMatrixFilter"),s=e._gsColorMatrixFilter=e._gsColorMatrixFilter||jv(ze),a=r.combineCMF&&!("colorMatrixFilter"in r&&!r.colorMatrixFilter),o,u,h;for(h=n.matrix,r.resolution&&(n.resolution=r.resolution),r.matrix&&r.matrix.length===h.length?(u=r.matrix,s.contrast!==1&&Ce("contrast",i,s,ze),s.hue&&Ce("hue",i,s,ze),s.brightness!==1&&Ce("brightness",i,s,ze),s.colorizeAmount&&(Ce("colorize",i,s,ze),Ce("colorizeAmount",i,s,ze)),s.saturation!==1&&Ce("saturation",i,s,ze)):(u=zv.slice(),r.contrast!=null?(u=Qo(u,+r.contrast),Ce("contrast",i,s,r)):s.contrast!==1&&(a?u=Qo(u,s.contrast):Ce("contrast",i,s,ze)),r.hue!=null?(u=Zo(u,+r.hue),Ce("hue",i,s,r)):s.hue&&(a?u=Zo(u,s.hue):Ce("hue",i,s,ze)),r.brightness!=null?(u=el(+r.brightness,u),Ce("brightness",i,s,r)):s.brightness!==1&&(a?u=el(s.brightness,u):Ce("brightness",i,s,ze)),r.colorize!=null?(r.colorizeAmount="colorizeAmount"in r?+r.colorizeAmount:1,u=Ko(u,r.colorize,r.colorizeAmount),Ce("colorize",i,s,r),Ce("colorizeAmount",i,s,r)):s.colorizeAmount&&(a?u=Ko(u,s.colorize,s.colorizeAmount):(Ce("colorize",i,s,ze),Ce("colorizeAmount",i,s,ze))),r.saturation!=null?(u=Yo(u,+r.saturation),Ce("saturation",i,s,r)):s.saturation!==1&&(a?u=Yo(u,s.saturation):Ce("saturation",i,s,ze))),o=u.length;--o>-1;)u[o]!==h[o]&&i.add(h,o,h[o],u[o],"colorMatrixFilter");i._props.push("colorMatrixFilter")},Vv=function(e,r){var i=r.t,n=r.p,s=r.color,a=r.set;a(i,n,s[0]<<16|s[1]<<8|s[2])},Xv=function(e,r){var i=r.g;i&&(i.dirty++,i.clearDirty++)},Wv=function(e,r){r.t.visible=!!r.t.alpha},tl=function(e,r,i,n){var s=e[r],a=Oi(qo(s)?e[r.indexOf("set")||!qo(e["get"+r.substr(3)])?r:"get"+r.substr(3)]():s),o=Oi(i);n._pt=new Xr(n._pt,e,r,0,0,Vv,{t:e,p:r,color:a,set:Vo(e,r)}),n.add(a,0,a[0],o[0]),n.add(a,1,a[1],o[1]),n.add(a,2,a[2],o[2])},qv={tint:1,lineColor:1,fillColor:1},rl="position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),ss={x:"position",y:"position",tileX:"tilePosition",tileY:"tilePosition"},Yv={colorMatrixFilter:1,saturation:1,contrast:1,hue:1,colorize:1,colorizeAmount:1,brightness:1,combineCMF:1},ki=Math.PI/180,il=function(e){return typeof e=="string"},Kv=function(e){return il(e)&&e.charAt(1)==="="?e.substr(0,2)+parseFloat(e.substr(2))*ki:e*ki},Zv=function(e,r){return r.set(r.t,r.p,e===1?r.e:Math.round((r.s+r.c*e)*1e5)/1e5,r)},Qv=function(e,r,i,n,s,a){var o=360*(a?ki:1),u=il(s),h=u&&s.charAt(1)==="="?+(s.charAt(0)+"1"):0,d=parseFloat(h?s.substr(2):s)*(a?ki:1),l=h?d*h:d-n,c=n+l,f,p;return u&&(f=s.split("_")[1],f==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),f==="cw"&&l<0?l=(l+o*1e10)%o-~~(l/o)*o:f==="ccw"&&l>0&&(l=(l-o*1e10)%o-~~(l/o)*o)),e._pt=p=new Xr(e._pt,r,i,n,l,Zv),p.e=c,p},nl=function(){Xo()&&(Ho=window,Ct=Wo(),Xe=Xe||Ho.PIXI,ns=Xe&&Xe.VERSION&&Xe.VERSION.charAt(0)==="4",Oi=function(r){return Ct.utils.splitColor((r+"").substr(0,2)==="0x"?"#"+r.substr(2):r)})},Li,Wr;for(Li=0;Li<rl.length;Li++)Wr=rl[Li],ss[Wr+"X"]=Wr,ss[Wr+"Y"]=Wr;var as={version:"3.11.5",name:"pixi",register:function(e,r,i){Ct=e,Xr=i,Vo=r.getSetter,nl()},registerPIXI:function(e){Xe=e},init:function(e,r,i,n,s){if(Xe||nl(),!Xe||!(e instanceof Xe.DisplayObject))return console.warn(e,"is not a DisplayObject or PIXI was not found. PixiPlugin.registerPIXI(PIXI);"),!1;var a,o,u,h,d,l,c,f,p;for(l in r){if(a=ss[l],u=r[l],a)o=~l.charAt(l.length-1).toLowerCase().indexOf("x")?"x":"y",this.add(e[a],o,e[a][o],a==="skew"?Kv(u):u,0,0,0,0,0,1);else if(l==="scale"||l==="anchor"||l==="pivot"||l==="tileScale")this.add(e[l],"x",e[l].x,u),this.add(e[l],"y",e[l].y,u);else if(l==="rotation"||l==="angle")Qv(this,e,l,e[l],u,l==="rotation");else if(Yv[l])h||(Hv(e,r.colorMatrixFilter||r,this),h=!0);else if(l==="blur"||l==="blurX"||l==="blurY"||l==="blurPadding"){if(d=Jo(e,"BlurFilter"),this.add(d,l,d[l],u),r.blurPadding!==0)for(c=r.blurPadding||Math.max(d[l],u)*2,f=e.filters.length;--f>-1;)e.filters[f].padding=Math.max(e.filters[f].padding,c)}else if(qv[l])if((l==="lineColor"||l==="fillColor")&&e instanceof Xe.Graphics)for(p=(e.geometry||e).graphicsData,this._pt=new Xr(this._pt,e,l,0,0,Xv,{g:e.geometry||e}),f=p.length;--f>-1;)tl(ns?p[f]:p[f][l.substr(0,4)+"Style"],ns?l:"color",u,this);else tl(e,l,u,this);else l==="autoAlpha"?(this._pt=new Xr(this._pt,e,"visible",0,0,Wv),this.add(e,"alpha",e.alpha,u),this._props.push("alpha","visible")):l!=="resolution"&&this.add(e,l,"get",u);this._props.push(l)}}};Wo()&&Ct.registerPlugin(as),k.registerPlugin(as),as.registerPIXI($e),k.registerPlugin(Vr),Vr.create("springBounce","0.32, 1.06, 0.61, 0.93"),k.registerEffect({name:"PULSE",effect(t,e){return k.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),k.registerEffect({name:"SHAKE",effect(t,e){return k.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),k.registerEffect({name:"SWING",effect(t,e){return k.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),k.registerEffect({name:"JELLO",effect(t,e){return k.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),k.registerEffect({name:"WOOBLE",effect(t,e){return k.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),k.registerEffect({name:"NONE",effect(t,e){return k.timeline().to(t,{duration:0})}}),k.registerEffect({name:"FLASH",effect(t,e){return k.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),k.registerEffect({name:"BOUNCE_IN",effect(t,e){return k.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e==null?void 0:e.x,y:e==null?void 0:e.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),k.registerEffect({name:"BOUNCE_IN_DOWN",effect(t,e){return k.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e==null?void 0:e.x,y:-2500,alpha:0}})}}),k.registerEffect({name:"BOUNCE_IN_LEFT",effect(t,e){return k.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),k.registerEffect({name:"BOUNCE_IN_RIGHT",effect(t,e){const r=Math.max(1e3,(e==null?void 0:e.maxX)+500);return k.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:r}})}}),k.registerEffect({name:"BOUNCE_IN_UP",effect(t,e){return k.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),k.registerEffect({name:"BOUNCE_OUT",effect(t,e){return k.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),k.registerEffect({name:"FADE_IN",effect(t){return k.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),k.registerEffect({name:"FADE_IN_DOWN",effect(t,e){return k.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),k.registerEffect({name:"FADE_IN_LEFT",effect(t,e){return k.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),k.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){return k.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),k.registerEffect({name:"FADE_IN_UP",effect(t,e){return k.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),k.registerEffect({name:"SPIN",effect(t){return k.to(t,{rotation:(e,r)=>k.utils.snap(360,Number(k.getProperty(r,"rotation"))+360)})}});function sl(){return{updateEffect:P.useCallback((e,r,i)=>k.effects[r]&&e?k.effects[r](e,i):k.effects.NONE(e,i),[])}}var os=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t))(os||{});const Jv=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Ut=D.forwardRef((t,e)=>{const[r,i]=D.useState(!1),[n,s]=P.useState(!1),[a,o]=P.useState(!1),[u,h]=P.useState(),d=hv(u,300),l=P.useRef(null),c=P.useRef(null),f=P.useRef(null),p=P.useRef(null),m=P.useRef(null),v=P.useRef(null),{tl:g}=P.useContext(At),y=te.useApp(),_=y.screen.width,x=y.screen.height,{uniqueId:b,visible:T,startAt:w,transformation:{x:S,y:A,width:I,height:F,scale:$=[1,1],rotation:E=0,effect:C,overlay:U,animation:G=os.NONE},applyTransformer:R,disabled:B,pointerdown:X,pointerout:M,pointerover:O,isText:H,isDragging:V,isGif:W,onDoubleClick:ne,isTextEditMode:oe}=t,ce=sl();Oe(we.COMPLETE,()=>{l.current}),D.useImperativeHandle(e,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>a}),[n,a]),D.useEffect(()=>{l.current&&i(!0)},[]),D.useEffect(()=>{h({x:S,y:A,width:I,height:F,animation:G,maxX:_,maxY:x})},[G,S,A,I,F,_,x]),D.useEffect(()=>{if(!c.current)return;const Y=k.context(()=>{if(g.current&&d){const{x:pe,y:De,animation:K,maxX:_e,maxY:Qe}=d||{},ct=g.current.progress(),Fe=ce.updateEffect(l.current,K,{immediateRender:!1,x:pe,y:De,overwrite:!0,maxX:_e,maxY:Qe});m.current&&(g.current.remove(m.current),m.current.progress(0).kill()),ct>.1?(Fe.eventCallback("onComplete",()=>{Fe.remove("onComplete"),g.current.add(Fe,w),m.current=Fe}),Fe.play()):(Fe.progress(1),g.current.add(Fe,w),m.current=Fe)}else m.current&&m.current.progress(0).kill()},c.current);return()=>{Y.revert()}},[w,d]);const ge=D.useCallback(()=>{o(!0),O&&O()},[]),fe=D.useCallback(()=>{s(!0)},[]),z=D.useCallback(Y=>{t.onAnchorTransformationEnd&&t.onAnchorTransformationEnd(Y),s(!1)},[]),q=te.withFilters(te.Container,{matrix:$e.filters.ColorMatrixFilter});return Z.jsxs(te.Container,{ref:c,children:[Z.jsx(te.Container,{ref:l,position:[S,A],pivot:[S,A],width:I,height:F,scale:$,rotation:E,...!B&&T&&!n&&!V&&{interactive:!0,buttonMode:!0,pointerdown:X,pointerover:O,pointerout:M},children:Z.jsxs(te.Container,{ref:v,children:[!W&&Z.jsx(q,{scale:1,apply:({matrix:Y})=>{C===Dt.BlackAndWhite?Y.desaturate():C===Dt.Sepia?Y.sepia():C===Dt.RetroVintage||C===Dt.NightVision?Y.negative():C===Dt.Normal&&Y.reset()},matrix:{enabled:!0,matrix:Jv},children:Z.jsx(te.Container,{ref:f,children:t.children})}),W&&Z.jsx(te.Container,{ref:f,children:t.children}),!hr(U)&&U!==is.NONE&&U!==is.NORMAL&&Z.jsx(Ev,{overlay:U,width:I,height:F,x:S,y:A})]})}),R&&T&&!oe&&Z.jsx(jh,{pixiTransformerRef:p,imageRef:l,isMounted:r,transformCommit:z,transformChange:fe,mouseoverEvent:ge,uniqueId:b,isText:H,onDoubleClick:ne})]})});var $t=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))($t||{}),al=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(al||{}),ls=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(ls||{}),j=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(j||{}),It=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(It||{}),N=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(N||{}),fr=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(fr||{}),se=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(se||{}),us=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(us||{}),dt=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(dt||{}),qr=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(qr||{}),Gt=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(Gt||{}),Rt=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(Rt||{}),zt=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(zt||{}),cs=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(cs||{}),Ke=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(Ke||{}),Ee=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(Ee||{}),Ae=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(Ae||{}),pt=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(pt||{});const Q={ADAPTER:{createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var hs=/iPhone/i,ol=/iPod/i,ll=/iPad/i,ul=/\biOS-universal(?:.+)Mac\b/i,fs=/\bAndroid(?:.+)Mobile\b/i,cl=/Android/i,dr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Di=/Silk/i,yt=/Windows Phone/i,hl=/\bWindows(?:.+)ARM\b/i,fl=/BlackBerry/i,dl=/BB10/i,pl=/Opera Mini/i,ml=/\b(CriOS|Chrome)(?:.+)Mobile/i,gl=/Mobile(?:.+)Firefox\b/i,vl=function(t){return typeof t<"u"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function e_(t){return function(e){return e.test(t)}}function _l(t){var e={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var r=e.userAgent,i=r.split("[FBAN");typeof i[1]<"u"&&(r=i[0]),i=r.split("Twitter"),typeof i[1]<"u"&&(r=i[0]);var n=e_(r),s={apple:{phone:n(hs)&&!n(yt),ipod:n(ol),tablet:!n(hs)&&(n(ll)||vl(e))&&!n(yt),universal:n(ul),device:(n(hs)||n(ol)||n(ll)||n(ul)||vl(e))&&!n(yt)},amazon:{phone:n(dr),tablet:!n(dr)&&n(Di),device:n(dr)||n(Di)},android:{phone:!n(yt)&&n(dr)||!n(yt)&&n(fs),tablet:!n(yt)&&!n(dr)&&!n(fs)&&(n(Di)||n(cl)),device:!n(yt)&&(n(dr)||n(Di)||n(fs)||n(cl))||n(/\bokhttp\b/i)},windows:{phone:n(yt),tablet:n(hl),device:n(yt)||n(hl)},other:{blackberry:n(fl),blackberry10:n(dl),opera:n(pl),firefox:n(gl),chrome:n(ml),device:n(fl)||n(dl)||n(pl)||n(gl)||n(ml)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const pr=(_l.default??_l)(globalThis.navigator);Q.RETINA_PREFIX=/@([0-9\.]+)x/,Q.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var yl={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function n(u,h,d){this.fn=u,this.context=h,this.once=d||!1}function s(u,h,d,l,c){if(typeof d!="function")throw new TypeError("The listener must be a function");var f=new n(d,l||u,c),p=r?r+h:h;return u._events[p]?u._events[p].fn?u._events[p]=[u._events[p],f]:u._events[p].push(f):(u._events[p]=f,u._eventsCount++),u}function a(u,h){--u._eventsCount===0?u._events=new i:delete u._events[h]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],d,l;if(this._eventsCount===0)return h;for(l in d=this._events)e.call(d,l)&&h.push(r?l.slice(1):l);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},o.prototype.listeners=function(h){var d=r?r+h:h,l=this._events[d];if(!l)return[];if(l.fn)return[l.fn];for(var c=0,f=l.length,p=new Array(f);c<f;c++)p[c]=l[c].fn;return p},o.prototype.listenerCount=function(h){var d=r?r+h:h,l=this._events[d];return l?l.fn?1:l.length:0},o.prototype.emit=function(h,d,l,c,f,p){var m=r?r+h:h;if(!this._events[m])return!1;var v=this._events[m],g=arguments.length,y,_;if(v.fn){switch(v.once&&this.removeListener(h,v.fn,void 0,!0),g){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,l),!0;case 4:return v.fn.call(v.context,d,l,c),!0;case 5:return v.fn.call(v.context,d,l,c,f),!0;case 6:return v.fn.call(v.context,d,l,c,f,p),!0}for(_=1,y=new Array(g-1);_<g;_++)y[_-1]=arguments[_];v.fn.apply(v.context,y)}else{var x=v.length,b;for(_=0;_<x;_++)switch(v[_].once&&this.removeListener(h,v[_].fn,void 0,!0),g){case 1:v[_].fn.call(v[_].context);break;case 2:v[_].fn.call(v[_].context,d);break;case 3:v[_].fn.call(v[_].context,d,l);break;case 4:v[_].fn.call(v[_].context,d,l,c);break;default:if(!y)for(b=1,y=new Array(g-1);b<g;b++)y[b-1]=arguments[b];v[_].fn.apply(v[_].context,y)}}return!0},o.prototype.on=function(h,d,l){return s(this,h,d,l,!1)},o.prototype.once=function(h,d,l){return s(this,h,d,l,!0)},o.prototype.removeListener=function(h,d,l,c){var f=r?r+h:h;if(!this._events[f])return this;if(!d)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===d&&(!c||p.once)&&(!l||p.context===l)&&a(this,f);else{for(var m=0,v=[],g=p.length;m<g;m++)(p[m].fn!==d||c&&!p[m].once||l&&p[m].context!==l)&&v.push(p[m]);v.length?this._events[f]=v.length===1?v[0]:v:a(this,f)}return this},o.prototype.removeAllListeners=function(h){var d;return h?(d=r?r+h:h,this._events[d]&&a(this,d)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(yl);var t_=yl.exports;const Bi=Lt(t_);var ds={exports:{}};ds.exports=Ui,ds.exports.default=Ui;function Ui(t,e,r){r=r||2;var i=e&&e.length,n=i?e[0]*r:t.length,s=xl(t,0,n,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,u,h,d,l,c,f;if(i&&(s=a_(t,e,s,r)),t.length>80*r){o=h=t[0],u=d=t[1];for(var p=r;p<n;p+=r)l=t[p],c=t[p+1],l<o&&(o=l),c<u&&(u=c),l>h&&(h=l),c>d&&(d=c);f=Math.max(h-o,d-u),f=f!==0?32767/f:0}return Yr(s,a,r,o,u,f,0),a}function xl(t,e,r,i,n){var s,a;if(n===gs(t,e,r,i)>0)for(s=e;s<r;s+=i)a=wl(s,t[s],t[s+1],a);else for(s=r-i;s>=e;s-=i)a=wl(s,t[s],t[s+1],a);return a&&$i(a,a.next)&&(Zr(a),a=a.next),a}function jt(t,e){if(!t)return t;e||(e=t);var r=t,i;do if(i=!1,!r.steiner&&($i(r,r.next)||xe(r.prev,r,r.next)===0)){if(Zr(r),r=e=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function Yr(t,e,r,i,n,s,a){if(t){!a&&s&&h_(t,i,n,s);for(var o=t,u,h;t.prev!==t.next;){if(u=t.prev,h=t.next,s?i_(t,i,n,s):r_(t)){e.push(u.i/r|0),e.push(t.i/r|0),e.push(h.i/r|0),Zr(t),t=h.next,o=h.next;continue}if(t=h,t===o){a?a===1?(t=n_(jt(t),e,r),Yr(t,e,r,i,n,s,2)):a===2&&s_(t,e,r,i,n,s):Yr(jt(t),e,r,i,n,s,1);break}}}}function r_(t){var e=t.prev,r=t,i=t.next;if(xe(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,a=i.x,o=e.y,u=r.y,h=i.y,d=n<s?n<a?n:a:s<a?s:a,l=o<u?o<h?o:h:u<h?u:h,c=n>s?n>a?n:a:s>a?s:a,f=o>u?o>h?o:h:u>h?u:h,p=i.next;p!==e;){if(p.x>=d&&p.x<=c&&p.y>=l&&p.y<=f&&mr(n,o,s,u,a,h,p.x,p.y)&&xe(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function i_(t,e,r,i){var n=t.prev,s=t,a=t.next;if(xe(n,s,a)>=0)return!1;for(var o=n.x,u=s.x,h=a.x,d=n.y,l=s.y,c=a.y,f=o<u?o<h?o:h:u<h?u:h,p=d<l?d<c?d:c:l<c?l:c,m=o>u?o>h?o:h:u>h?u:h,v=d>l?d>c?d:c:l>c?l:c,g=ps(f,p,e,r,i),y=ps(m,v,e,r,i),_=t.prevZ,x=t.nextZ;_&&_.z>=g&&x&&x.z<=y;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=v&&_!==n&&_!==a&&mr(o,d,u,l,h,c,_.x,_.y)&&xe(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=v&&x!==n&&x!==a&&mr(o,d,u,l,h,c,x.x,x.y)&&xe(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=v&&_!==n&&_!==a&&mr(o,d,u,l,h,c,_.x,_.y)&&xe(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=v&&x!==n&&x!==a&&mr(o,d,u,l,h,c,x.x,x.y)&&xe(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function n_(t,e,r){var i=t;do{var n=i.prev,s=i.next.next;!$i(n,s)&&bl(n,i,i.next,s)&&Kr(n,s)&&Kr(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),Zr(i),Zr(i.next),i=t=s),i=i.next}while(i!==t);return jt(i)}function s_(t,e,r,i,n,s){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&p_(a,o)){var u=Tl(a,o);a=jt(a,a.next),u=jt(u,u.next),Yr(a,e,r,i,n,s,0),Yr(u,e,r,i,n,s,0);return}o=o.next}a=a.next}while(a!==t)}function a_(t,e,r,i){var n=[],s,a,o,u,h;for(s=0,a=e.length;s<a;s++)o=e[s]*i,u=s<a-1?e[s+1]*i:t.length,h=xl(t,o,u,i,!1),h===h.next&&(h.steiner=!0),n.push(d_(h));for(n.sort(o_),s=0;s<n.length;s++)r=l_(n[s],r);return r}function o_(t,e){return t.x-e.x}function l_(t,e){var r=u_(t,e);if(!r)return e;var i=Tl(r,t);return jt(i,i.next),jt(r,r.next)}function u_(t,e){var r=e,i=t.x,n=t.y,s=-1/0,a;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=i&&o>s&&(s=o,a=r.x<r.next.x?r:r.next,o===i))return a}r=r.next}while(r!==e);if(!a)return null;var u=a,h=a.x,d=a.y,l=1/0,c;r=a;do i>=r.x&&r.x>=h&&i!==r.x&&mr(n<d?i:s,n,h,d,n<d?s:i,n,r.x,r.y)&&(c=Math.abs(n-r.y)/(i-r.x),Kr(r,t)&&(c<l||c===l&&(r.x>a.x||r.x===a.x&&c_(a,r)))&&(a=r,l=c)),r=r.next;while(r!==u);return a}function c_(t,e){return xe(t.prev,t,e.prev)<0&&xe(e.next,t,t.next)<0}function h_(t,e,r,i){var n=t;do n.z===0&&(n.z=ps(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,f_(n)}function f_(t){var e,r,i,n,s,a,o,u,h=1;do{for(r=t,t=null,s=null,a=0;r;){for(a++,i=r,o=0,e=0;e<h&&(o++,i=i.nextZ,!!i);e++);for(u=h;o>0||u>0&&i;)o!==0&&(u===0||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,u--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,h*=2}while(a>1);return t}function ps(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function d_(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function mr(t,e,r,i,n,s,a,o){return(n-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(r-a)*(e-o)&&(r-a)*(s-o)>=(n-a)*(i-o)}function p_(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!m_(t,e)&&(Kr(t,e)&&Kr(e,t)&&g_(t,e)&&(xe(t.prev,t,e.prev)||xe(t,e.prev,e))||$i(t,e)&&xe(t.prev,t,t.next)>0&&xe(e.prev,e,e.next)>0)}function xe(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $i(t,e){return t.x===e.x&&t.y===e.y}function bl(t,e,r,i){var n=zi(xe(t,e,r)),s=zi(xe(t,e,i)),a=zi(xe(r,i,t)),o=zi(xe(r,i,e));return!!(n!==s&&a!==o||n===0&&Gi(t,r,e)||s===0&&Gi(t,i,e)||a===0&&Gi(r,t,i)||o===0&&Gi(r,e,i))}function Gi(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function zi(t){return t>0?1:t<0?-1:0}function m_(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&bl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Kr(t,e){return xe(t.prev,t,t.next)<0?xe(t,e,t.next)>=0&&xe(t,t.prev,e)>=0:xe(t,e,t.prev)<0||xe(t,t.next,e)<0}function g_(t,e){var r=t,i=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function Tl(t,e){var r=new ms(t.i,t.x,t.y),i=new ms(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function wl(t,e,r,i){var n=new ms(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Zr(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ms(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ui.deviation=function(t,e,r,i){var n=e&&e.length,s=n?e[0]*r:t.length,a=Math.abs(gs(t,0,s,r));if(n)for(var o=0,u=e.length;o<u;o++){var h=e[o]*r,d=o<u-1?e[o+1]*r:t.length;a-=Math.abs(gs(t,h,d,r))}var l=0;for(o=0;o<i.length;o+=3){var c=i[o]*r,f=i[o+1]*r,p=i[o+2]*r;l+=Math.abs((t[c]-t[p])*(t[f+1]-t[c+1])-(t[c]-t[f])*(t[p+1]-t[c+1]))}return a===0&&l===0?0:Math.abs((l-a)/a)};function gs(t,e,r,i){for(var n=0,s=e,a=r-i;s<r;s+=i)n+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return n}Ui.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var s=0;s<t[n].length;s++)for(var a=0;a<e;a++)r.vertices.push(t[n][s][a]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r};var v_=ds.exports;const __=Lt(v_);var ji={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ji.exports,function(t,e){(function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,s=typeof Ve=="object"&&Ve;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,u=36,h=1,d=26,l=38,c=700,f=72,p=128,m="-",v=/^xn--/,g=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=u-h,b=Math.floor,T=String.fromCharCode,w;function S(M){throw new RangeError(_[M])}function A(M,O){for(var H=M.length,V=[];H--;)V[H]=O(M[H]);return V}function I(M,O){var H=M.split("@"),V="";H.length>1&&(V=H[0]+"@",M=H[1]),M=M.replace(y,".");var W=M.split("."),ne=A(W,O).join(".");return V+ne}function F(M){for(var O=[],H=0,V=M.length,W,ne;H<V;)W=M.charCodeAt(H++),W>=55296&&W<=56319&&H<V?(ne=M.charCodeAt(H++),(ne&64512)==56320?O.push(((W&1023)<<10)+(ne&1023)+65536):(O.push(W),H--)):O.push(W);return O}function $(M){return A(M,function(O){var H="";return O>65535&&(O-=65536,H+=T(O>>>10&1023|55296),O=56320|O&1023),H+=T(O),H}).join("")}function E(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:u}function C(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function U(M,O,H){var V=0;for(M=H?b(M/c):M>>1,M+=b(M/O);M>x*d>>1;V+=u)M=b(M/x);return b(V+(x+1)*M/(M+l))}function G(M){var O=[],H=M.length,V,W=0,ne=p,oe=f,ce,ge,fe,z,q,Y,pe,De,K;for(ce=M.lastIndexOf(m),ce<0&&(ce=0),ge=0;ge<ce;++ge)M.charCodeAt(ge)>=128&&S("not-basic"),O.push(M.charCodeAt(ge));for(fe=ce>0?ce+1:0;fe<H;){for(z=W,q=1,Y=u;fe>=H&&S("invalid-input"),pe=E(M.charCodeAt(fe++)),(pe>=u||pe>b((o-W)/q))&&S("overflow"),W+=pe*q,De=Y<=oe?h:Y>=oe+d?d:Y-oe,!(pe<De);Y+=u)K=u-De,q>b(o/K)&&S("overflow"),q*=K;V=O.length+1,oe=U(W-z,V,z==0),b(W/V)>o-ne&&S("overflow"),ne+=b(W/V),W%=V,O.splice(W++,0,ne)}return $(O)}function R(M){var O,H,V,W,ne,oe,ce,ge,fe,z,q,Y=[],pe,De,K,_e;for(M=F(M),pe=M.length,O=p,H=0,ne=f,oe=0;oe<pe;++oe)q=M[oe],q<128&&Y.push(T(q));for(V=W=Y.length,W&&Y.push(m);V<pe;){for(ce=o,oe=0;oe<pe;++oe)q=M[oe],q>=O&&q<ce&&(ce=q);for(De=V+1,ce-O>b((o-H)/De)&&S("overflow"),H+=(ce-O)*De,O=ce,oe=0;oe<pe;++oe)if(q=M[oe],q<O&&++H>o&&S("overflow"),q==O){for(ge=H,fe=u;z=fe<=ne?h:fe>=ne+d?d:fe-ne,!(ge<z);fe+=u)_e=ge-z,K=u-z,Y.push(T(C(z+_e%K,0))),ge=b(_e/K);Y.push(T(C(ge,0))),ne=U(H,De,V==W),H=0,++V}++H,++O}return Y.join("")}function B(M){return I(M,function(O){return v.test(O)?G(O.slice(4).toLowerCase()):O})}function X(M){return I(M,function(O){return g.test(O)?"xn--"+R(O):O})}if(a={version:"1.4.1",ucs2:{decode:F,encode:$},decode:G,encode:R,toASCII:X,toUnicode:B},i&&n)if(t.exports==i)n.exports=a;else for(w in a)a.hasOwnProperty(w)&&(i[w]=a[w]);else r.punycode=a})(Ve)}(ji,ji.exports);var y_=ji.exports,x_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,r);if(a.value!==n||a.enumerable!==!0)return!1}return!0},Sl=typeof Symbol<"u"&&Symbol,b_=x_,T_=function(){return typeof Sl!="function"||typeof Symbol!="function"||typeof Sl("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:b_()},Al={foo:{}},w_=Object,S_=function(){return{__proto__:Al}.foo===Al.foo&&!({__proto__:null}instanceof w_)},A_="Function.prototype.bind called on incompatible ",vs=Array.prototype.slice,E_=Object.prototype.toString,C_="[object Function]",I_=function(e){var r=this;if(typeof r!="function"||E_.call(r)!==C_)throw new TypeError(A_+r);for(var i=vs.call(arguments,1),n,s=function(){if(this instanceof n){var d=r.apply(this,i.concat(vs.call(arguments)));return Object(d)===d?d:this}else return r.apply(e,i.concat(vs.call(arguments)))},a=Math.max(0,r.length-i.length),o=[],u=0;u<a;u++)o.push("$"+u);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=function(){};h.prototype=r.prototype,n.prototype=new h,h.prototype=null}return n},R_=I_,_s=Function.prototype.bind||R_,P_=_s,M_=P_.call(Function.call,Object.prototype.hasOwnProperty),J,gr=SyntaxError,El=Function,vr=TypeError,ys=function(t){try{return El('"use strict"; return ('+t+").constructor;")()}catch{}},Ht=Object.getOwnPropertyDescriptor;if(Ht)try{Ht({},"")}catch{Ht=null}var xs=function(){throw new vr},F_=Ht?function(){try{return arguments.callee,xs}catch{try{return Ht(arguments,"callee").get}catch{return xs}}}():xs,_r=T_(),O_=S_(),Ie=Object.getPrototypeOf||(O_?function(t){return t.__proto__}:null),yr={},N_=typeof Uint8Array>"u"||!Ie?J:Ie(Uint8Array),Vt={"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":_r&&Ie?Ie([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":yr,"%AsyncGenerator%":yr,"%AsyncGeneratorFunction%":yr,"%AsyncIteratorPrototype%":yr,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":El,"%GeneratorFunction%":yr,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_r&&Ie?Ie(Ie([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_r||!Ie?J:Ie(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_r||!Ie?J:Ie(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_r&&Ie?Ie(""[Symbol.iterator]()):J,"%Symbol%":_r?Symbol:J,"%SyntaxError%":gr,"%ThrowTypeError%":F_,"%TypedArray%":N_,"%TypeError%":vr,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet};if(Ie)try{null.error}catch(t){var k_=Ie(Ie(t));Vt["%Error.prototype%"]=k_}var L_=function t(e){var r;if(e==="%AsyncFunction%")r=ys("async function () {}");else if(e==="%GeneratorFunction%")r=ys("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ys("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Ie&&(r=Ie(n.prototype))}return Vt[e]=r,r},Cl={"%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"]},Qr=_s,Hi=M_,D_=Qr.call(Function.call,Array.prototype.concat),B_=Qr.call(Function.apply,Array.prototype.splice),Il=Qr.call(Function.call,String.prototype.replace),Vi=Qr.call(Function.call,String.prototype.slice),U_=Qr.call(Function.call,RegExp.prototype.exec),$_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G_=/\\(\\)?/g,z_=function(e){var r=Vi(e,0,1),i=Vi(e,-1);if(r==="%"&&i!=="%")throw new gr("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new gr("invalid intrinsic syntax, expected opening `%`");var n=[];return Il(e,$_,function(s,a,o,u){n[n.length]=o?Il(u,G_,"$1"):a||s}),n},j_=function(e,r){var i=e,n;if(Hi(Cl,i)&&(n=Cl[i],i="%"+n[0]+"%"),Hi(Vt,i)){var s=Vt[i];if(s===yr&&(s=L_(i)),typeof s>"u"&&!r)throw new vr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new gr("intrinsic "+e+" does not exist!")},bs=function(e,r){if(typeof e!="string"||e.length===0)throw new vr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new vr('"allowMissing" argument must be a boolean');if(U_(/^%?[^%]*%?$/,e)===null)throw new gr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=z_(e),n=i.length>0?i[0]:"",s=j_("%"+n+"%",r),a=s.name,o=s.value,u=!1,h=s.alias;h&&(n=h[0],B_(i,D_([0,1],h)));for(var d=1,l=!0;d<i.length;d+=1){var c=i[d],f=Vi(c,0,1),p=Vi(c,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new gr("property names with quotes must have matching quotes");if((c==="constructor"||!l)&&(u=!0),n+="."+c,a="%"+n+"%",Hi(Vt,a))o=Vt[a];else if(o!=null){if(!(c in o)){if(!r)throw new vr("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ht&&d+1>=i.length){var m=Ht(o,c);l=!!m,l&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[c]}else l=Hi(o,c),o=o[c];l&&!u&&(Vt[a]=o)}}return o},Rl={exports:{}};(function(t){var e=_s,r=bs,i=r("%Function.prototype.apply%"),n=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(n,i),a=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}t.exports=function(l){var c=s(e,n,arguments);if(a&&o){var f=a(c,"length");f.configurable&&o(c,"length",{value:1+u(0,l.length-(arguments.length-1))})}return c};var h=function(){return s(e,i,arguments)};o?o(t.exports,"apply",{value:h}):t.exports.apply=h})(Rl);var H_=Rl.exports,Pl=bs,Ml=H_,V_=Ml(Pl("String.prototype.indexOf")),X_=function(e,r){var i=Pl(e,!!r);return typeof i=="function"&&V_(e,".prototype.")>-1?Ml(i):i};const W_=Nh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ts=typeof Map=="function"&&Map.prototype,ws=Object.getOwnPropertyDescriptor&&Ts?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xi=Ts&&ws&&typeof ws.get=="function"?ws.get:null,Fl=Ts&&Map.prototype.forEach,Ss=typeof Set=="function"&&Set.prototype,As=Object.getOwnPropertyDescriptor&&Ss?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wi=Ss&&As&&typeof As.get=="function"?As.get:null,Ol=Ss&&Set.prototype.forEach,q_=typeof WeakMap=="function"&&WeakMap.prototype,Jr=q_?WeakMap.prototype.has:null,Y_=typeof WeakSet=="function"&&WeakSet.prototype,ei=Y_?WeakSet.prototype.has:null,K_=typeof WeakRef=="function"&&WeakRef.prototype,Nl=K_?WeakRef.prototype.deref:null,Z_=Boolean.prototype.valueOf,Q_=Object.prototype.toString,J_=Function.prototype.toString,ey=String.prototype.match,Es=String.prototype.slice,Pt=String.prototype.replace,ty=String.prototype.toUpperCase,kl=String.prototype.toLowerCase,Ll=RegExp.prototype.test,Dl=Array.prototype.concat,mt=Array.prototype.join,ry=Array.prototype.slice,Bl=Math.floor,Cs=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Is=Object.getOwnPropertySymbols,Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,xr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ne=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===xr||"symbol")?Symbol.toStringTag:null,Ul=Object.prototype.propertyIsEnumerable,$l=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Gl(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ll.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-Bl(-t):Bl(t);if(i!==t){var n=String(i),s=Es.call(e,n.length+1);return Pt.call(n,r,"$&_")+"."+Pt.call(Pt.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Pt.call(e,r,"$&_")}var Ps=W_,zl=Ps.custom,jl=Xl(zl)?zl:null,iy=function t(e,r,i,n){var s=r||{};if(Mt(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Mt(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Mt(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Mt(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Mt(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ql(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return o?Gl(e,u):u}if(typeof e=="bigint"){var h=String(e)+"n";return o?Gl(e,h):h}var d=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof e=="object")return Ms(e)?"[Array]":"[Object]";var l=by(s,i);if(typeof n>"u")n=[];else if(Wl(n,e)>=0)return"[Circular]";function c(E,C,U){if(C&&(n=ry.call(n),n.push(C)),U){var G={depth:s.depth};return Mt(s,"quoteStyle")&&(G.quoteStyle=s.quoteStyle),t(E,G,i+1,n)}return t(E,s,i+1,n)}if(typeof e=="function"&&!Vl(e)){var f=fy(e),p=qi(e,c);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+mt.call(p,", ")+" }":"")}if(Xl(e)){var m=xr?Pt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Rs.call(e);return typeof e=="object"&&!xr?ti(m):m}if(_y(e)){for(var v="<"+kl.call(String(e.nodeName)),g=e.attributes||[],y=0;y<g.length;y++)v+=" "+g[y].name+"="+Hl(ny(g[y].value),"double",s);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+kl.call(String(e.nodeName))+">",v}if(Ms(e)){if(e.length===0)return"[]";var _=qi(e,c);return l&&!xy(_)?"["+Os(_,l)+"]":"[ "+mt.call(_,", ")+" ]"}if(ay(e)){var x=qi(e,c);return!("cause"in Error.prototype)&&"cause"in e&&!Ul.call(e,"cause")?"{ ["+String(e)+"] "+mt.call(Dl.call("[cause]: "+c(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+mt.call(x,", ")+" }"}if(typeof e=="object"&&a){if(jl&&typeof e[jl]=="function"&&Ps)return Ps(e,{depth:d-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(dy(e)){var b=[];return Fl&&Fl.call(e,function(E,C){b.push(c(C,e,!0)+" => "+c(E,e))}),Yl("Map",Xi.call(e),b,l)}if(gy(e)){var T=[];return Ol&&Ol.call(e,function(E){T.push(c(E,e))}),Yl("Set",Wi.call(e),T,l)}if(py(e))return Fs("WeakMap");if(vy(e))return Fs("WeakSet");if(my(e))return Fs("WeakRef");if(ly(e))return ti(c(Number(e)));if(cy(e))return ti(c(Cs.call(e)));if(uy(e))return ti(Z_.call(e));if(oy(e))return ti(c(String(e)));if(!sy(e)&&!Vl(e)){var w=qi(e,c),S=$l?$l(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",I=!S&&Ne&&Object(e)===e&&Ne in e?Es.call(Ft(e),8,-1):A?"Object":"",F=S||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",$=F+(I||A?"["+mt.call(Dl.call([],I||[],A||[]),": ")+"] ":"");return w.length===0?$+"{}":l?$+"{"+Os(w,l)+"}":$+"{ "+mt.call(w,", ")+" }"}return String(e)};function Hl(t,e,r){var i=(r.quoteStyle||e)==="double"?'"':"'";return i+t+i}function ny(t){return Pt.call(String(t),/"/g,"&quot;")}function Ms(t){return Ft(t)==="[object Array]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function sy(t){return Ft(t)==="[object Date]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function Vl(t){return Ft(t)==="[object RegExp]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function ay(t){return Ft(t)==="[object Error]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function oy(t){return Ft(t)==="[object String]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function ly(t){return Ft(t)==="[object Number]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function uy(t){return Ft(t)==="[object Boolean]"&&(!Ne||!(typeof t=="object"&&Ne in t))}function Xl(t){if(xr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Rs)return!1;try{return Rs.call(t),!0}catch{}return!1}function cy(t){if(!t||typeof t!="object"||!Cs)return!1;try{return Cs.call(t),!0}catch{}return!1}var hy=Object.prototype.hasOwnProperty||function(t){return t in this};function Mt(t,e){return hy.call(t,e)}function Ft(t){return Q_.call(t)}function fy(t){if(t.name)return t.name;var e=ey.call(J_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Wl(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function dy(t){if(!Xi||!t||typeof t!="object")return!1;try{Xi.call(t);try{Wi.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function py(t){if(!Jr||!t||typeof t!="object")return!1;try{Jr.call(t,Jr);try{ei.call(t,ei)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function my(t){if(!Nl||!t||typeof t!="object")return!1;try{return Nl.call(t),!0}catch{}return!1}function gy(t){if(!Wi||!t||typeof t!="object")return!1;try{Wi.call(t);try{Xi.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function vy(t){if(!ei||!t||typeof t!="object")return!1;try{ei.call(t,ei);try{Jr.call(t,Jr)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function _y(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function ql(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return ql(Es.call(t,0,e.maxStringLength),e)+i}var n=Pt.call(Pt.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,yy);return Hl(n,"single",e)}function yy(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+ty.call(e.toString(16))}function ti(t){return"Object("+t+")"}function Fs(t){return t+" { ? }"}function Yl(t,e,r,i){var n=i?Os(r,i):mt.call(r,", ");return t+" ("+e+") {"+n+"}"}function xy(t){for(var e=0;e<t.length;e++)if(Wl(t[e],`
34
+ `)>=0)return!1;return!0}function by(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=mt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:mt.call(Array(e+1),r)}}function Os(t,e){if(t.length===0)return"";var r=`
35
35
  `+e.prev+e.base;return r+mt.call(t,","+r)+`
36
- `+e.prev}function Zi(t,e){var r=ks(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=Ft(t,n)?e(t[n],t):""}var s=typeof Fs=="function"?Fs(t):[],a;if(Tr){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var u in t)Ft(t,u)&&(r&&String(Number(u))===u&&u<t.length||Tr&&a["$"+u]instanceof Symbol||(Bl.call(/[^\w$]/,u)?i.push(e(u,t)+": "+e(t[u],t)):i.push(u+": "+e(t[u],t))));if(typeof Fs=="function")for(var h=0;h<s.length;h++)Gl.call(t,s[h])&&i.push("["+e(s[h])+"]: "+e(t[s[h]],t));return i}var Bs=As,wr=q_,Sy=sy,Ay=Bs("%TypeError%"),Qi=Bs("%WeakMap%",!0),Ji=Bs("%Map%",!0),Ey=wr("WeakMap.prototype.get",!0),Cy=wr("WeakMap.prototype.set",!0),Iy=wr("WeakMap.prototype.has",!0),Ry=wr("Map.prototype.get",!0),Py=wr("Map.prototype.set",!0),My=wr("Map.prototype.has",!0),Us=function(t,e){for(var r=t,i;(i=r.next)!==null;r=i)if(i.key===e)return r.next=i.next,i.next=t.next,t.next=i,i},Fy=function(t,e){var r=Us(t,e);return r&&r.value},Oy=function(t,e,r){var i=Us(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},Ny=function(t,e){return!!Us(t,e)},ky=function(){var e,r,i,n={assert:function(s){if(!n.has(s))throw new Ay("Side channel does not contain "+Sy(s))},get:function(s){if(Qi&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Ey(e,s)}else if(Ji){if(r)return Ry(r,s)}else if(i)return Fy(i,s)},has:function(s){if(Qi&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Iy(e,s)}else if(Ji){if(r)return My(r,s)}else if(i)return Ny(i,s);return!1},set:function(s,a){Qi&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new Qi),Cy(e,s,a)):Ji?(r||(r=new Ji),Py(r,s,a)):(i||(i={key:{},next:null}),Oy(i,s,a))}};return n},Ly=String.prototype.replace,Dy=/%20/g,$s={RFC1738:"RFC1738",RFC3986:"RFC3986"},Gs={default:$s.RFC3986,formatters:{RFC1738:function(t){return Ly.call(t,Dy,"+")},RFC3986:function(t){return String(t)}},RFC1738:$s.RFC1738,RFC3986:$s.RFC3986},By=Gs,zs=Object.prototype.hasOwnProperty,qt=Array.isArray,gt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Uy=function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(qt(i)){for(var n=[],s=0;s<i.length;++s)typeof i[s]<"u"&&n.push(i[s]);r.obj[r.prop]=n}}},Ql=function(e,r){for(var i=r&&r.plainObjects?Object.create(null):{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},$y=function t(e,r,i){if(!r)return e;if(typeof r!="object"){if(qt(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!zs.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return qt(e)&&!qt(r)&&(n=Ql(e,i)),qt(e)&&qt(r)?(r.forEach(function(s,a){if(zs.call(e,a)){var o=e[a];o&&typeof o=="object"&&s&&typeof s=="object"?e[a]=t(o,s,i):e.push(s)}else e[a]=s}),e):Object.keys(r).reduce(function(s,a){var o=r[a];return zs.call(s,a)?s[a]=t(s[a],o,i):s[a]=o,s},n)},Gy=function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},zy=function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},jy=function(e,r,i,n,s){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var o="",u=0;u<a.length;++u){var h=a.charCodeAt(u);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===By.RFC1738&&(h===40||h===41)){o+=a.charAt(u);continue}if(h<128){o=o+gt[h];continue}if(h<2048){o=o+(gt[192|h>>6]+gt[128|h&63]);continue}if(h<55296||h>=57344){o=o+(gt[224|h>>12]+gt[128|h>>6&63]+gt[128|h&63]);continue}u+=1,h=65536+((h&1023)<<10|a.charCodeAt(u)&1023),o+=gt[240|h>>18]+gt[128|h>>12&63]+gt[128|h>>6&63]+gt[128|h&63]}return o},Hy=function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var s=r[n],a=s.obj[s.prop],o=Object.keys(a),u=0;u<o.length;++u){var h=o[u],d=a[h];typeof d=="object"&&d!==null&&i.indexOf(d)===-1&&(r.push({obj:a,prop:h}),i.push(d))}return Uy(r),e},Vy=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Xy=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Wy=function(e,r){return[].concat(e,r)},qy=function(e,r){if(qt(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},Jl={arrayToObject:Ql,assign:Gy,combine:Wy,compact:Hy,decode:zy,encode:jy,isBuffer:Xy,isRegExp:Vy,maybeMap:qy,merge:$y},eu=ky,en=Jl,si=Gs,Yy=Object.prototype.hasOwnProperty,tu={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},xt=Array.isArray,Ky=Array.prototype.push,ru=function(t,e){Ky.apply(t,xt(e)?e:[e])},Zy=Date.prototype.toISOString,iu=si.default,ke={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:en.encode,encodeValuesOnly:!1,format:iu,formatter:si.formatters[iu],indices:!1,serializeDate:function(e){return Zy.call(e)},skipNulls:!1,strictNullHandling:!1},Qy=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},js={},Jy=function t(e,r,i,n,s,a,o,u,h,d,l,c,f,p,m,v){for(var g=e,y=v,_=0,x=!1;(y=y.get(js))!==void 0&&!x;){var b=y.get(e);if(_+=1,typeof b<"u"){if(b===_)throw new RangeError("Cyclic object value");x=!0}typeof y.get(js)>"u"&&(_=0)}if(typeof u=="function"?g=u(r,g):g instanceof Date?g=l(g):i==="comma"&&xt(g)&&(g=en.maybeMap(g,function(U){return U instanceof Date?l(U):U})),g===null){if(s)return o&&!p?o(r,ke.encoder,m,"key",c):r;g=""}if(Qy(g)||en.isBuffer(g)){if(o){var T=p?r:o(r,ke.encoder,m,"key",c);return[f(T)+"="+f(o(g,ke.encoder,m,"value",c))]}return[f(r)+"="+f(String(g))]}var w=[];if(typeof g>"u")return w;var S;if(i==="comma"&&xt(g))p&&o&&(g=en.maybeMap(g,o)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(xt(u))S=u;else{var A=Object.keys(g);S=h?A.sort(h):A}for(var C=n&&xt(g)&&g.length===1?r+"[]":r,F=0;F<S.length;++F){var z=S[F],I=typeof z=="object"&&typeof z.value<"u"?z.value:g[z];if(!(a&&I===null)){var E=xt(g)?typeof i=="function"?i(C,z):C:C+(d?"."+z:"["+z+"]");v.set(e,_);var B=eu();B.set(js,v),ru(w,t(I,E,i,n,s,a,i==="comma"&&p&&xt(g)?null:o,u,h,d,l,c,f,p,m,B))}}return w},ex=function(e){if(!e)return ke;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||ke.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=si.default;if(typeof e.format<"u"){if(!Yy.call(si.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=si.formatters[i],s=ke.filter;return(typeof e.filter=="function"||xt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ke.addQueryPrefix,allowDots:typeof e.allowDots>"u"?ke.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ke.charsetSentinel,delimiter:typeof e.delimiter>"u"?ke.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ke.encode,encoder:typeof e.encoder=="function"?e.encoder:ke.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ke.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ke.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ke.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ke.strictNullHandling}},tx=function(t,e){var r=t,i=ex(e),n,s;typeof i.filter=="function"?(s=i.filter,r=s("",r)):xt(i.filter)&&(s=i.filter,n=s);var a=[];if(typeof r!="object"||r===null)return"";var o;e&&e.arrayFormat in tu?o=e.arrayFormat:e&&"indices"in e?o=e.indices?"indices":"repeat":o="indices";var u=tu[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=u==="comma"&&e&&e.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var d=eu(),l=0;l<n.length;++l){var c=n[l];i.skipNulls&&r[c]===null||ru(a,Jy(r[c],c,u,h,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,d))}var f=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},Sr=Jl,Hs=Object.prototype.hasOwnProperty,rx=Array.isArray,Re={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Sr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ix=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},nu=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},nx="utf8=%26%2310003%3B",sx="utf8=%E2%9C%93",ax=function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,a=n.split(r.delimiter,s),o=-1,u,h=r.charset;if(r.charsetSentinel)for(u=0;u<a.length;++u)a[u].indexOf("utf8=")===0&&(a[u]===sx?h="utf-8":a[u]===nx&&(h="iso-8859-1"),o=u,u=a.length);for(u=0;u<a.length;++u)if(u!==o){var d=a[u],l=d.indexOf("]="),c=l===-1?d.indexOf("="):l+1,f,p;c===-1?(f=r.decoder(d,Re.decoder,h,"key"),p=r.strictNullHandling?null:""):(f=r.decoder(d.slice(0,c),Re.decoder,h,"key"),p=Sr.maybeMap(nu(d.slice(c+1),r),function(m){return r.decoder(m,Re.decoder,h,"value")})),p&&r.interpretNumericEntities&&h==="iso-8859-1"&&(p=ix(p)),d.indexOf("[]=")>-1&&(p=rx(p)?[p]:p),Hs.call(i,f)?i[f]=Sr.combine(i[f],p):i[f]=p}return i},ox=function(t,e,r,i){for(var n=i?e:nu(e,r),s=t.length-1;s>=0;--s){var a,o=t[s];if(o==="[]"&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var u=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,h=parseInt(u,10);!r.parseArrays&&u===""?a={0:n}:!isNaN(h)&&o!==u&&String(h)===u&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[],a[h]=n):u!=="__proto__"&&(a[u]=n)}n=a}return n},lx=function(e,r,i,n){if(e){var s=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,u=i.depth>0&&a.exec(s),h=u?s.slice(0,u.index):s,d=[];if(h){if(!i.plainObjects&&Hs.call(Object.prototype,h)&&!i.allowPrototypes)return;d.push(h)}for(var l=0;i.depth>0&&(u=o.exec(s))!==null&&l<i.depth;){if(l+=1,!i.plainObjects&&Hs.call(Object.prototype,u[1].slice(1,-1))&&!i.allowPrototypes)return;d.push(u[1])}return u&&d.push("["+s.slice(u.index)+"]"),ox(d,r,i,n)}},ux=function(e){if(!e)return Re;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?Re.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Re.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Re.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Re.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Re.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Re.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Re.comma,decoder:typeof e.decoder=="function"?e.decoder:Re.decoder,delimiter:typeof e.delimiter=="string"||Sr.isRegExp(e.delimiter)?e.delimiter:Re.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Re.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Re.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Re.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Re.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Re.strictNullHandling}},cx=function(t,e){var r=ux(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var i=typeof t=="string"?ax(t,r):t,n=r.plainObjects?Object.create(null):{},s=Object.keys(i),a=0;a<s.length;++a){var o=s[a],u=lx(o,i[o],r,typeof t=="string");n=Sr.merge(n,u,r)}return r.allowSparse===!0?n:Sr.compact(n)},hx=tx,fx=cx,dx=Gs,px={formats:dx,parse:fx,stringify:hx},mx=b_;function Je(){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 gx=/^([a-z0-9.+-]+:)/i,vx=/:[0-9]*$/,_x=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,yx=["<",">",'"',"`"," ","\r",`
37
- `," "],xx=["{","}","|","\\","^","`"].concat(yx),Vs=["'"].concat(xx),su=["%","/","?",";","#"].concat(Vs),au=["/","?","#"],bx=255,ou=/^[+a-z0-9A-Z_-]{0,63}$/,Tx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wx={javascript:!0,"javascript:":!0},Xs={javascript:!0,"javascript:":!0},Ar={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Ws=px;function tn(t,e,r){if(t&&typeof t=="object"&&t instanceof Je)return t;var i=new Je;return i.parse(t,e,r),i}Je.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",s=t.split(n),a=/\\/g;s[0]=s[0].replace(a,"/"),t=s.join(n);var o=t;if(o=o.trim(),!r&&t.split("#").length===1){var u=_x.exec(o);if(u)return this.path=o,this.href=o,this.pathname=u[1],u[2]?(this.search=u[2],e?this.query=Ws.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=gx.exec(o);if(h){h=h[0];var d=h.toLowerCase();this.protocol=d,o=o.substr(h.length)}if(r||h||o.match(/^\/\/[^@/]+@[^@/]+/)){var l=o.substr(0,2)==="//";l&&!(h&&Xs[h])&&(o=o.substr(2),this.slashes=!0)}if(!Xs[h]&&(l||h&&!Ar[h])){for(var c=-1,f=0;f<au.length;f++){var p=o.indexOf(au[f]);p!==-1&&(c===-1||p<c)&&(c=p)}var m,v;c===-1?v=o.lastIndexOf("@"):v=o.lastIndexOf("@",c),v!==-1&&(m=o.slice(0,v),o=o.slice(v+1),this.auth=decodeURIComponent(m)),c=-1;for(var f=0;f<su.length;f++){var p=o.indexOf(su[f]);p!==-1&&(c===-1||p<c)&&(c=p)}c===-1&&(c=o.length),this.host=o.slice(0,c),o=o.slice(c),this.parseHost(),this.hostname=this.hostname||"";var g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g)for(var y=this.hostname.split(/\./),f=0,_=y.length;f<_;f++){var x=y[f];if(x&&!x.match(ou)){for(var b="",T=0,w=x.length;T<w;T++)x.charCodeAt(T)>127?b+="x":b+=x[T];if(!b.match(ou)){var S=y.slice(0,f),A=y.slice(f+1),C=x.match(Tx);C&&(S.push(C[1]),A.unshift(C[2])),A.length&&(o="/"+A.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>bx?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=mx.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!wx[d])for(var f=0,_=Vs.length;f<_;f++){var I=Vs[f];if(o.indexOf(I)!==-1){var E=encodeURIComponent(I);E===I&&(E=escape(I)),o=o.split(I).join(E)}}var B=o.indexOf("#");B!==-1&&(this.hash=o.substr(B),o=o.slice(0,B));var U=o.indexOf("?");if(U!==-1?(this.search=o.substr(U),this.query=o.substr(U+1),e&&(this.query=Ws.parse(this.query)),o=o.slice(0,U)):e&&(this.search="",this.query={}),o&&(this.pathname=o),Ar[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",R=this.search||"";this.path=F+R}return this.href=this.format(),this};function Sx(t){return typeof t=="string"&&(t=tn(t)),t instanceof Je?t.format():Je.prototype.format.call(t)}Je.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,s="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=Ws.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Ar[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),e+n+r+a+i};function Ax(t,e){return tn(t,!1,!0).resolve(e)}Je.prototype.resolve=function(t){return this.resolveObject(tn(t,!1,!0)).format()},Je.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new Je;e.parse(t,!1,!0),t=e}for(var r=new Je,i=Object.keys(this),n=0;n<i.length;n++){var s=i[n];r[s]=this[s]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),o=0;o<a.length;o++){var u=a[o];u!=="protocol"&&(r[u]=t[u])}return Ar[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!Ar[t.protocol]){for(var h=Object.keys(t),d=0;d<h.length;d++){var l=h[d];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!Xs[t.protocol]){for(var _=(t.pathname||"").split("/");_.length&&!(t.host=_.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),_[0]!==""&&_.unshift(""),_.length<2&&_.unshift(""),r.pathname=_.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var c=r.pathname||"",f=r.search||"";r.path=c+f}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var p=r.pathname&&r.pathname.charAt(0)==="/",m=t.host||t.pathname&&t.pathname.charAt(0)==="/",v=m||p||r.host&&t.pathname,g=v,y=r.pathname&&r.pathname.split("/")||[],_=t.pathname&&t.pathname.split("/")||[],x=r.protocol&&!Ar[r.protocol];if(x&&(r.hostname="",r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(_[0]===""?_[0]=t.host:_.unshift(t.host)),t.host=null),v=v&&(_[0]===""||y[0]==="")),m)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,y=_;else if(_.length)y||(y=[]),y.pop(),y=y.concat(_),r.search=t.search,r.query=t.query;else if(t.search!=null){if(x){r.host=y.shift(),r.hostname=r.host;var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.hostname=b.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=y.slice(-1)[0],w=(r.host||t.host||y.length>1)&&(T==="."||T==="..")||T==="",S=0,A=y.length;A>=0;A--)T=y[A],T==="."?y.splice(A,1):T===".."?(y.splice(A,1),S++):S&&(y.splice(A,1),S--);if(!v&&!g)for(;S--;S)y.unshift("..");v&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),w&&y.join("/").substr(-1)!=="/"&&y.push("");var C=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(x){r.hostname=C?"":y.length?y.shift():"",r.host=r.hostname;var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.hostname=b.shift(),r.host=r.hostname)}return v=v||r.host&&y.length,v&&!C&&y.unshift(""),y.length>0?r.pathname=y.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Je.prototype.parseHost=function(){var t=this.host,e=vx.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var Ex=tn,Cx=Ax,Ix=Sx;const Rx={parse:Ex,format:Ix,resolve:Cx},lu={};function re(t,e,r=3){if(lu[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
36
+ `+e.prev}function qi(t,e){var r=Ms(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=Mt(t,n)?e(t[n],t):""}var s=typeof Is=="function"?Is(t):[],a;if(xr){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var u in t)Mt(t,u)&&(r&&String(Number(u))===u&&u<t.length||xr&&a["$"+u]instanceof Symbol||(Ll.call(/[^\w$]/,u)?i.push(e(u,t)+": "+e(t[u],t)):i.push(u+": "+e(t[u],t))));if(typeof Is=="function")for(var h=0;h<s.length;h++)Ul.call(t,s[h])&&i.push("["+e(s[h])+"]: "+e(t[s[h]],t));return i}var Ns=bs,br=X_,Ty=iy,wy=Ns("%TypeError%"),Yi=Ns("%WeakMap%",!0),Ki=Ns("%Map%",!0),Sy=br("WeakMap.prototype.get",!0),Ay=br("WeakMap.prototype.set",!0),Ey=br("WeakMap.prototype.has",!0),Cy=br("Map.prototype.get",!0),Iy=br("Map.prototype.set",!0),Ry=br("Map.prototype.has",!0),ks=function(t,e){for(var r=t,i;(i=r.next)!==null;r=i)if(i.key===e)return r.next=i.next,i.next=t.next,t.next=i,i},Py=function(t,e){var r=ks(t,e);return r&&r.value},My=function(t,e,r){var i=ks(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},Fy=function(t,e){return!!ks(t,e)},Oy=function(){var e,r,i,n={assert:function(s){if(!n.has(s))throw new wy("Side channel does not contain "+Ty(s))},get:function(s){if(Yi&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Sy(e,s)}else if(Ki){if(r)return Cy(r,s)}else if(i)return Py(i,s)},has:function(s){if(Yi&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Ey(e,s)}else if(Ki){if(r)return Ry(r,s)}else if(i)return Fy(i,s);return!1},set:function(s,a){Yi&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new Yi),Ay(e,s,a)):Ki?(r||(r=new Ki),Iy(r,s,a)):(i||(i={key:{},next:null}),My(i,s,a))}};return n},Ny=String.prototype.replace,ky=/%20/g,Ls={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ds={default:Ls.RFC3986,formatters:{RFC1738:function(t){return Ny.call(t,ky,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ls.RFC1738,RFC3986:Ls.RFC3986},Ly=Ds,Bs=Object.prototype.hasOwnProperty,Xt=Array.isArray,gt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Dy=function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(Xt(i)){for(var n=[],s=0;s<i.length;++s)typeof i[s]<"u"&&n.push(i[s]);r.obj[r.prop]=n}}},Kl=function(e,r){for(var i=r&&r.plainObjects?Object.create(null):{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},By=function t(e,r,i){if(!r)return e;if(typeof r!="object"){if(Xt(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Bs.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return Xt(e)&&!Xt(r)&&(n=Kl(e,i)),Xt(e)&&Xt(r)?(r.forEach(function(s,a){if(Bs.call(e,a)){var o=e[a];o&&typeof o=="object"&&s&&typeof s=="object"?e[a]=t(o,s,i):e.push(s)}else e[a]=s}),e):Object.keys(r).reduce(function(s,a){var o=r[a];return Bs.call(s,a)?s[a]=t(s[a],o,i):s[a]=o,s},n)},Uy=function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},$y=function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Gy=function(e,r,i,n,s){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var o="",u=0;u<a.length;++u){var h=a.charCodeAt(u);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===Ly.RFC1738&&(h===40||h===41)){o+=a.charAt(u);continue}if(h<128){o=o+gt[h];continue}if(h<2048){o=o+(gt[192|h>>6]+gt[128|h&63]);continue}if(h<55296||h>=57344){o=o+(gt[224|h>>12]+gt[128|h>>6&63]+gt[128|h&63]);continue}u+=1,h=65536+((h&1023)<<10|a.charCodeAt(u)&1023),o+=gt[240|h>>18]+gt[128|h>>12&63]+gt[128|h>>6&63]+gt[128|h&63]}return o},zy=function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var s=r[n],a=s.obj[s.prop],o=Object.keys(a),u=0;u<o.length;++u){var h=o[u],d=a[h];typeof d=="object"&&d!==null&&i.indexOf(d)===-1&&(r.push({obj:a,prop:h}),i.push(d))}return Dy(r),e},jy=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Hy=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Vy=function(e,r){return[].concat(e,r)},Xy=function(e,r){if(Xt(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},Zl={arrayToObject:Kl,assign:Uy,combine:Vy,compact:zy,decode:$y,encode:Gy,isBuffer:Hy,isRegExp:jy,maybeMap:Xy,merge:By},Ql=Oy,Zi=Zl,ri=Ds,Wy=Object.prototype.hasOwnProperty,Jl={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},xt=Array.isArray,qy=Array.prototype.push,eu=function(t,e){qy.apply(t,xt(e)?e:[e])},Yy=Date.prototype.toISOString,tu=ri.default,ke={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Zi.encode,encodeValuesOnly:!1,format:tu,formatter:ri.formatters[tu],indices:!1,serializeDate:function(e){return Yy.call(e)},skipNulls:!1,strictNullHandling:!1},Ky=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Us={},Zy=function t(e,r,i,n,s,a,o,u,h,d,l,c,f,p,m,v){for(var g=e,y=v,_=0,x=!1;(y=y.get(Us))!==void 0&&!x;){var b=y.get(e);if(_+=1,typeof b<"u"){if(b===_)throw new RangeError("Cyclic object value");x=!0}typeof y.get(Us)>"u"&&(_=0)}if(typeof u=="function"?g=u(r,g):g instanceof Date?g=l(g):i==="comma"&&xt(g)&&(g=Zi.maybeMap(g,function(G){return G instanceof Date?l(G):G})),g===null){if(s)return o&&!p?o(r,ke.encoder,m,"key",c):r;g=""}if(Ky(g)||Zi.isBuffer(g)){if(o){var T=p?r:o(r,ke.encoder,m,"key",c);return[f(T)+"="+f(o(g,ke.encoder,m,"value",c))]}return[f(r)+"="+f(String(g))]}var w=[];if(typeof g>"u")return w;var S;if(i==="comma"&&xt(g))p&&o&&(g=Zi.maybeMap(g,o)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(xt(u))S=u;else{var A=Object.keys(g);S=h?A.sort(h):A}for(var I=n&&xt(g)&&g.length===1?r+"[]":r,F=0;F<S.length;++F){var $=S[F],E=typeof $=="object"&&typeof $.value<"u"?$.value:g[$];if(!(a&&E===null)){var C=xt(g)?typeof i=="function"?i(I,$):I:I+(d?"."+$:"["+$+"]");v.set(e,_);var U=Ql();U.set(Us,v),eu(w,t(E,C,i,n,s,a,i==="comma"&&p&&xt(g)?null:o,u,h,d,l,c,f,p,m,U))}}return w},Qy=function(e){if(!e)return ke;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||ke.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=ri.default;if(typeof e.format<"u"){if(!Wy.call(ri.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=ri.formatters[i],s=ke.filter;return(typeof e.filter=="function"||xt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ke.addQueryPrefix,allowDots:typeof e.allowDots>"u"?ke.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ke.charsetSentinel,delimiter:typeof e.delimiter>"u"?ke.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ke.encode,encoder:typeof e.encoder=="function"?e.encoder:ke.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ke.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ke.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ke.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ke.strictNullHandling}},Jy=function(t,e){var r=t,i=Qy(e),n,s;typeof i.filter=="function"?(s=i.filter,r=s("",r)):xt(i.filter)&&(s=i.filter,n=s);var a=[];if(typeof r!="object"||r===null)return"";var o;e&&e.arrayFormat in Jl?o=e.arrayFormat:e&&"indices"in e?o=e.indices?"indices":"repeat":o="indices";var u=Jl[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=u==="comma"&&e&&e.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var d=Ql(),l=0;l<n.length;++l){var c=n[l];i.skipNulls&&r[c]===null||eu(a,Zy(r[c],c,u,h,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,d))}var f=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},Tr=Zl,$s=Object.prototype.hasOwnProperty,ex=Array.isArray,Re={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Tr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},tx=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},ru=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},rx="utf8=%26%2310003%3B",ix="utf8=%E2%9C%93",nx=function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,a=n.split(r.delimiter,s),o=-1,u,h=r.charset;if(r.charsetSentinel)for(u=0;u<a.length;++u)a[u].indexOf("utf8=")===0&&(a[u]===ix?h="utf-8":a[u]===rx&&(h="iso-8859-1"),o=u,u=a.length);for(u=0;u<a.length;++u)if(u!==o){var d=a[u],l=d.indexOf("]="),c=l===-1?d.indexOf("="):l+1,f,p;c===-1?(f=r.decoder(d,Re.decoder,h,"key"),p=r.strictNullHandling?null:""):(f=r.decoder(d.slice(0,c),Re.decoder,h,"key"),p=Tr.maybeMap(ru(d.slice(c+1),r),function(m){return r.decoder(m,Re.decoder,h,"value")})),p&&r.interpretNumericEntities&&h==="iso-8859-1"&&(p=tx(p)),d.indexOf("[]=")>-1&&(p=ex(p)?[p]:p),$s.call(i,f)?i[f]=Tr.combine(i[f],p):i[f]=p}return i},sx=function(t,e,r,i){for(var n=i?e:ru(e,r),s=t.length-1;s>=0;--s){var a,o=t[s];if(o==="[]"&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var u=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,h=parseInt(u,10);!r.parseArrays&&u===""?a={0:n}:!isNaN(h)&&o!==u&&String(h)===u&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[],a[h]=n):u!=="__proto__"&&(a[u]=n)}n=a}return n},ax=function(e,r,i,n){if(e){var s=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,u=i.depth>0&&a.exec(s),h=u?s.slice(0,u.index):s,d=[];if(h){if(!i.plainObjects&&$s.call(Object.prototype,h)&&!i.allowPrototypes)return;d.push(h)}for(var l=0;i.depth>0&&(u=o.exec(s))!==null&&l<i.depth;){if(l+=1,!i.plainObjects&&$s.call(Object.prototype,u[1].slice(1,-1))&&!i.allowPrototypes)return;d.push(u[1])}return u&&d.push("["+s.slice(u.index)+"]"),sx(d,r,i,n)}},ox=function(e){if(!e)return Re;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?Re.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Re.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Re.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Re.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Re.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Re.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Re.comma,decoder:typeof e.decoder=="function"?e.decoder:Re.decoder,delimiter:typeof e.delimiter=="string"||Tr.isRegExp(e.delimiter)?e.delimiter:Re.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Re.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Re.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Re.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Re.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Re.strictNullHandling}},lx=function(t,e){var r=ox(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var i=typeof t=="string"?nx(t,r):t,n=r.plainObjects?Object.create(null):{},s=Object.keys(i),a=0;a<s.length;++a){var o=s[a],u=ax(o,i[o],r,typeof t=="string");n=Tr.merge(n,u,r)}return r.allowSparse===!0?n:Tr.compact(n)},ux=Jy,cx=lx,hx=Ds,fx={formats:hx,parse:cx,stringify:ux},dx=y_;function Je(){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 px=/^([a-z0-9.+-]+:)/i,mx=/:[0-9]*$/,gx=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,vx=["<",">",'"',"`"," ","\r",`
37
+ `," "],_x=["{","}","|","\\","^","`"].concat(vx),Gs=["'"].concat(_x),iu=["%","/","?",";","#"].concat(Gs),nu=["/","?","#"],yx=255,su=/^[+a-z0-9A-Z_-]{0,63}$/,xx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,bx={javascript:!0,"javascript:":!0},zs={javascript:!0,"javascript:":!0},wr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},js=fx;function Qi(t,e,r){if(t&&typeof t=="object"&&t instanceof Je)return t;var i=new Je;return i.parse(t,e,r),i}Je.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",s=t.split(n),a=/\\/g;s[0]=s[0].replace(a,"/"),t=s.join(n);var o=t;if(o=o.trim(),!r&&t.split("#").length===1){var u=gx.exec(o);if(u)return this.path=o,this.href=o,this.pathname=u[1],u[2]?(this.search=u[2],e?this.query=js.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=px.exec(o);if(h){h=h[0];var d=h.toLowerCase();this.protocol=d,o=o.substr(h.length)}if(r||h||o.match(/^\/\/[^@/]+@[^@/]+/)){var l=o.substr(0,2)==="//";l&&!(h&&zs[h])&&(o=o.substr(2),this.slashes=!0)}if(!zs[h]&&(l||h&&!wr[h])){for(var c=-1,f=0;f<nu.length;f++){var p=o.indexOf(nu[f]);p!==-1&&(c===-1||p<c)&&(c=p)}var m,v;c===-1?v=o.lastIndexOf("@"):v=o.lastIndexOf("@",c),v!==-1&&(m=o.slice(0,v),o=o.slice(v+1),this.auth=decodeURIComponent(m)),c=-1;for(var f=0;f<iu.length;f++){var p=o.indexOf(iu[f]);p!==-1&&(c===-1||p<c)&&(c=p)}c===-1&&(c=o.length),this.host=o.slice(0,c),o=o.slice(c),this.parseHost(),this.hostname=this.hostname||"";var g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g)for(var y=this.hostname.split(/\./),f=0,_=y.length;f<_;f++){var x=y[f];if(x&&!x.match(su)){for(var b="",T=0,w=x.length;T<w;T++)x.charCodeAt(T)>127?b+="x":b+=x[T];if(!b.match(su)){var S=y.slice(0,f),A=y.slice(f+1),I=x.match(xx);I&&(S.push(I[1]),A.unshift(I[2])),A.length&&(o="/"+A.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>yx?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=dx.toASCII(this.hostname));var F=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+F,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!bx[d])for(var f=0,_=Gs.length;f<_;f++){var E=Gs[f];if(o.indexOf(E)!==-1){var C=encodeURIComponent(E);C===E&&(C=escape(E)),o=o.split(E).join(C)}}var U=o.indexOf("#");U!==-1&&(this.hash=o.substr(U),o=o.slice(0,U));var G=o.indexOf("?");if(G!==-1?(this.search=o.substr(G),this.query=o.substr(G+1),e&&(this.query=js.parse(this.query)),o=o.slice(0,G)):e&&(this.search="",this.query={}),o&&(this.pathname=o),wr[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",R=this.search||"";this.path=F+R}return this.href=this.format(),this};function Tx(t){return typeof t=="string"&&(t=Qi(t)),t instanceof Je?t.format():Je.prototype.format.call(t)}Je.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,s="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=js.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||wr[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),e+n+r+a+i};function wx(t,e){return Qi(t,!1,!0).resolve(e)}Je.prototype.resolve=function(t){return this.resolveObject(Qi(t,!1,!0)).format()},Je.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new Je;e.parse(t,!1,!0),t=e}for(var r=new Je,i=Object.keys(this),n=0;n<i.length;n++){var s=i[n];r[s]=this[s]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),o=0;o<a.length;o++){var u=a[o];u!=="protocol"&&(r[u]=t[u])}return wr[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!wr[t.protocol]){for(var h=Object.keys(t),d=0;d<h.length;d++){var l=h[d];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!zs[t.protocol]){for(var _=(t.pathname||"").split("/");_.length&&!(t.host=_.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),_[0]!==""&&_.unshift(""),_.length<2&&_.unshift(""),r.pathname=_.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var c=r.pathname||"",f=r.search||"";r.path=c+f}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var p=r.pathname&&r.pathname.charAt(0)==="/",m=t.host||t.pathname&&t.pathname.charAt(0)==="/",v=m||p||r.host&&t.pathname,g=v,y=r.pathname&&r.pathname.split("/")||[],_=t.pathname&&t.pathname.split("/")||[],x=r.protocol&&!wr[r.protocol];if(x&&(r.hostname="",r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(_[0]===""?_[0]=t.host:_.unshift(t.host)),t.host=null),v=v&&(_[0]===""||y[0]==="")),m)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,y=_;else if(_.length)y||(y=[]),y.pop(),y=y.concat(_),r.search=t.search,r.query=t.query;else if(t.search!=null){if(x){r.host=y.shift(),r.hostname=r.host;var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.hostname=b.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=y.slice(-1)[0],w=(r.host||t.host||y.length>1)&&(T==="."||T==="..")||T==="",S=0,A=y.length;A>=0;A--)T=y[A],T==="."?y.splice(A,1):T===".."?(y.splice(A,1),S++):S&&(y.splice(A,1),S--);if(!v&&!g)for(;S--;S)y.unshift("..");v&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),w&&y.join("/").substr(-1)!=="/"&&y.push("");var I=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(x){r.hostname=I?"":y.length?y.shift():"",r.host=r.hostname;var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.hostname=b.shift(),r.host=r.hostname)}return v=v||r.host&&y.length,v&&!I&&y.unshift(""),y.length>0?r.pathname=y.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Je.prototype.parseHost=function(){var t=this.host,e=mx.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var Sx=Qi,Ax=wx,Ex=Tx;const Cx={parse:Sx,format:Ex,resolve:Ax},au={};function re(t,e,r=3){if(au[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
38
38
  Deprecated since v${t}`):(i=i.split(`
39
39
  `).splice(r).join(`
40
40
  `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
41
41
  Deprecated since v${t}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
42
- Deprecated since v${t}`),console.warn(i))),lu[e]=!0}let qs;function Px(){return typeof qs>"u"&&(qs=function(){var r;const e={stencil:!0,failIfMajorPerformanceCaveat:Z.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Z.ADAPTER.getWebGLRenderingContext())return!1;const i=Z.ADAPTER.createCanvas();let n=i.getContext("webgl",e)||i.getContext("experimental-webgl",e);const s=!!((r=n==null?void 0:n.getContextAttributes())!=null&&r.stencil);if(n){const a=n.getExtension("WEBGL_lose_context");a&&a.loseContext()}return n=null,s}catch{return!1}}()),qs}var Mx={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Pe=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},Qe=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},uu=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},cu=function(t){return{r:Qe(t.r,0,255),g:Qe(t.g,0,255),b:Qe(t.b,0,255),a:Qe(t.a)}},Ys=function(t){return{r:Pe(t.r),g:Pe(t.g),b:Pe(t.b),a:Pe(t.a,3)}},Fx=/^#([0-9a-f]{3,8})$/i,rn=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},hu=function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=Math.max(e,r,i),a=s-Math.min(e,r,i),o=a?s===e?(r-i)/a:s===r?2+(i-e)/a:4+(e-r)/a:0;return{h:60*(o<0?o+6:o),s:s?a/s*100:0,v:s/255*100,a:n}},fu=function(t){var e=t.h,r=t.s,i=t.v,n=t.a;e=e/360*6,r/=100,i/=100;var s=Math.floor(e),a=i*(1-r),o=i*(1-(e-s)*r),u=i*(1-(1-e+s)*r),h=s%6;return{r:255*[i,o,a,a,u,i][h],g:255*[u,i,i,o,a,a][h],b:255*[a,a,u,i,i,o][h],a:n}},du=function(t){return{h:uu(t.h),s:Qe(t.s,0,100),l:Qe(t.l,0,100),a:Qe(t.a)}},pu=function(t){return{h:Pe(t.h),s:Pe(t.s),l:Pe(t.l),a:Pe(t.a,3)}},mu=function(t){return fu((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},ai=function(t){return{h:(e=hu(t)).h,s:(n=(200-(r=e.s))*(i=e.v)/100)>0&&n<200?r*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,r,i,n},Ox=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Lx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ks={string:[[function(t){var e=Fx.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Pe(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Pe(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=kx.exec(t)||Lx.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:cu({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=Ox.exec(t)||Nx.exec(t);if(!e)return null;var r,i,n=du({h:(r=e[1],i=e[2],i===void 0&&(i="deg"),Number(r)*(Mx[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return mu(n)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=n===void 0?1:n;return bt(e)&&bt(r)&&bt(i)?cu({r:Number(e),g:Number(r),b:Number(i),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,n=t.a,s=n===void 0?1:n;if(!bt(e)||!bt(r)||!bt(i))return null;var a=du({h:Number(e),s:Number(r),l:Number(i),a:Number(s)});return mu(a)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,n=t.a,s=n===void 0?1:n;if(!bt(e)||!bt(r)||!bt(i))return null;var a=function(o){return{h:uu(o.h),s:Qe(o.s,0,100),v:Qe(o.v,0,100),a:Qe(o.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(s)});return fu(a)},"hsv"]]},gu=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},Dx=function(t){return typeof t=="string"?gu(t.trim(),Ks.string):typeof t=="object"&&t!==null?gu(t,Ks.object):[null,void 0]},Zs=function(t,e){var r=ai(t);return{h:r.h,s:Qe(r.s+100*e,0,100),l:r.l,a:r.a}},Qs=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},vu=function(t,e){var r=ai(t);return{h:r.h,s:r.s,l:Qe(r.l+100*e,0,100),a:r.a}},Js=function(){function t(e){this.parsed=Dx(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return Pe(Qs(this.rgba),2)},t.prototype.isDark=function(){return Qs(this.rgba)<.5},t.prototype.isLight=function(){return Qs(this.rgba)>=.5},t.prototype.toHex=function(){return e=Ys(this.rgba),r=e.r,i=e.g,n=e.b,a=(s=e.a)<1?rn(Pe(255*s)):"","#"+rn(r)+rn(i)+rn(n)+a;var e,r,i,n,s,a},t.prototype.toRgb=function(){return Ys(this.rgba)},t.prototype.toRgbString=function(){return e=Ys(this.rgba),r=e.r,i=e.g,n=e.b,(s=e.a)<1?"rgba("+r+", "+i+", "+n+", "+s+")":"rgb("+r+", "+i+", "+n+")";var e,r,i,n,s},t.prototype.toHsl=function(){return pu(ai(this.rgba))},t.prototype.toHslString=function(){return e=pu(ai(this.rgba)),r=e.h,i=e.s,n=e.l,(s=e.a)<1?"hsla("+r+", "+i+"%, "+n+"%, "+s+")":"hsl("+r+", "+i+"%, "+n+"%)";var e,r,i,n,s},t.prototype.toHsv=function(){return e=hu(this.rgba),{h:Pe(e.h),s:Pe(e.s),v:Pe(e.v),a:Pe(e.a,3)};var e},t.prototype.invert=function(){return vt({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),vt(Zs(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),vt(Zs(this.rgba,-e))},t.prototype.grayscale=function(){return vt(Zs(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),vt(vu(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),vt(vu(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?vt({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):Pe(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=ai(this.rgba);return typeof e=="number"?vt({h:e,s:r.s,l:r.l,a:r.a}):Pe(r.h)},t.prototype.isEqual=function(e){return this.toHex()===vt(e).toHex()},t}(),vt=function(t){return t instanceof Js?t:new Js(t)},_u=[],Bx=function(t){t.forEach(function(e){_u.indexOf(e)<0&&(e(Js,Ks),_u.push(e))})};function Ux(t,e){var r={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"},i={};for(var n in r)i[r[n]]=n;var s={};t.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,u,h=i[this.toHex()];if(h)return h;if(a!=null&&a.closest){var d=this.toRgb(),l=1/0,c="black";if(!s.length)for(var f in r)s[f]=new t(r[f]).toRgb();for(var p in r){var m=(o=d,u=s[p],Math.pow(o.r-u.r,2)+Math.pow(o.g-u.g,2)+Math.pow(o.b-u.b,2));m<l&&(l=m,c=p)}return c}},e.string.push([function(a){var o=a.toLowerCase(),u=o==="transparent"?"#0000":r[o];return u?new t(u).toRgb():null},"name"])}Bx([Ux]);const Er=class{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Er)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if(r==="number"||r==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,s)=>n===e[s]);if(t!==null&&e!==null){const n=Object.keys(t),s=Object.keys(e);return n.length!==s.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(r*255),t[2]=Math.round(i*255),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,r,i,n]=Er.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=i,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){if(t===1)return(t*255<<24)+this._int;if(t===0)return 0;let e=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return e=e*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(e<<16)+(r<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,n]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}normalize(t){let e;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const r=t;e=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4){t=this._clamp(t);const[r,i,n,s=1]=t;e=[r,i,n,s]}else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4){t=this._clamp(t,0,255);const[r,i,n,s=255]=t;e=[r/255,i/255,n/255,s/255]}else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const i=Er.HEX_PATTERN.exec(t);i&&(t=`#${i[2]}`)}const r=vt(t);if(r.isValid()){const{r:i,g:n,b:s,a}=r.rgba;e=[i/255,n/255,s/255,a]}}if(e)this._components.set(e),this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(t*255<<16)+(e*255<<8)+(r*255|0)}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),r)}),t)}};let Le=Er;Le.shared=new Er,Le.temp=new Er,Le.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function nn(t,e=[]){return re("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),Le.shared.setValue(t).toRgbArray(e)}function ea(t){return re("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Le.shared.setValue(t).toNumber()}function $x(){const t=[],e=[];for(let i=0;i<32;i++)t[i]=i,e[i]=i;t[j.NORMAL_NPM]=j.NORMAL,t[j.ADD_NPM]=j.ADD,t[j.SCREEN_NPM]=j.SCREEN,e[j.NORMAL]=j.NORMAL_NPM,e[j.ADD]=j.ADD_NPM,e[j.SCREEN]=j.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}const Gx=$x();function yu(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function sn(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function xu(t){return!(t&t-1)&&!!t}function bu(t){let e=(t>65535?1:0)<<4;t>>>=e;let r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function an(t,e,r){const i=t.length;let n;if(e>=i||r===0)return;r=e+r>i?i-e:r;const s=i-r;for(n=e;n<s;++n)t[n]=t[n+r];t.length=s}let zx=0;function oi(){return++zx}const Tu={},_t=Object.create(null),Nt=Object.create(null);let on;function jx(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location,on||(on=document.createElement("a")),on.href=t;const r=Rx.parse(on.href),i=!r.port&&e.port===""||r.port===e.port;return r.hostname!==e.hostname||!i||r.protocol!==e.protocol?"anonymous":""}function wu(t,e=1){var i;const r=(i=Z.RETINA_PREFIX)==null?void 0:i.exec(t);return r?parseFloat(r[1]):e}var ee=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(ee||{});const ta=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Su=(t,e)=>ta(t).priority??e,fe={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(ta).forEach(e=>{e.type.forEach(r=>{var i,n;return(n=(i=this._removeHandlers)[r])==null?void 0:n.call(i,e)})}),this},add(...t){return t.map(ta).forEach(e=>{e.type.forEach(r=>{const i=this._addHandlers,n=this._queue;i[r]?i[r](e):(n[r]=n[r]||[],n[r].push(e))})}),this},handle(t,e,r){const i=this._addHandlers,n=this._removeHandlers;if(i[t]||n[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,n[t]=r;const s=this._queue;return s[t]&&(s[t].forEach(a=>e(a)),delete s[t]),this},handleByMap(t,e){return this.handle(t,r=>{e[r.name]=r.ref},r=>{delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((n,s)=>Su(s,r)-Su(n,r)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class Hx{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,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(e){return this[`${e}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(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const Vx=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
43
- `);function Xx(t){let e="";for(let r=0;r<t;++r)r>0&&(e+=`
44
- else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function Wx(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=Vx.replace(/%forloop%/gi,Xx(t));if(e.shaderSource(r,i),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))t=t/2|0;else break}return t}const ra=0,ia=1,na=2,sa=3,aa=4,oa=5;let ln=class Fh{constructor(){this.data=0,this.blendMode=j.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<ra)}set blend(e){!!(this.data&1<<ra)!==e&&(this.data^=1<<ra)}get offsets(){return!!(this.data&1<<ia)}set offsets(e){!!(this.data&1<<ia)!==e&&(this.data^=1<<ia)}get culling(){return!!(this.data&1<<na)}set culling(e){!!(this.data&1<<na)!==e&&(this.data^=1<<na)}get depthTest(){return!!(this.data&1<<sa)}set depthTest(e){!!(this.data&1<<sa)!==e&&(this.data^=1<<sa)}get depthMask(){return!!(this.data&1<<oa)}set depthMask(e){!!(this.data&1<<oa)!==e&&(this.data^=1<<oa)}get clockwiseFrontFace(){return!!(this.data&1<<aa)}set clockwiseFrontFace(e){!!(this.data&1<<aa)!==e&&(this.data^=1<<aa)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==j.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new Fh;return e.depthTest=!1,e.blend=!0,e}};const la=[];function Au(t,e){if(!t)return null;let r="";if(typeof t=="string"){const i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(let i=la.length-1;i>=0;--i){const n=la[i];if(n.test&&n.test(t,r))return new n(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class et{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,i,n,s,a,o,u){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:d}=this;this._aliasCount++;for(let l=0,c=d.length;l<c;l++)d[l][h](e,r,i,n,s,a,o,u);return d===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(et.prototype,{dispatch:{value:et.prototype.emit},run:{value:et.prototype.emit}});class li{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new et("setRealSize"),this.onUpdate=new et("update"),this.onError=new et("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){(e!==this._width||r!==this._height)&&(this._width=e,this._height=r,this.onResize.emit(e,r))}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(e,r,i){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(e,r){return!1}}class ua extends li{constructor(e,r){const{width:i,height:n}=r||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=e}upload(e,r,i){const n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Pt.UNPACK);const s=r.realWidth,a=r.realHeight;return i.width===s&&i.height===a?n.texSubImage2D(r.target,0,0,0,s,a,r.format,i.type,this.data):(i.width=s,i.height=a,n.texImage2D(r.target,0,i.internalFormat,s,a,0,r.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array}}const qx={scaleMode:dt.NEAREST,format:N.RGBA,alphaMode:Pt.NPM},Cr=class extends Gi{constructor(t=null,e=null){super(),e=Object.assign({},Cr.defaultOptions,e);const{alphaMode:r,mipmap:i,anisotropicLevel:n,scaleMode:s,width:a,height:o,wrapMode:u,format:h,type:d,target:l,resolution:c,resourceOptions:f}=e;t&&!(t instanceof li)&&(t=Au(t,f),t.internal=!0),this.resolution=c||Z.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=n,this._wrapMode=u,this._scaleMode=s,this.format=h,this.type=d,this.target=l,this.alphaMode=r,this.uid=oi(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>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 r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=xu(this.realWidth)&&xu(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 Nt[this.cacheId],delete _t[this.cacheId],this.cacheId=null),this.dispose(),Cr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,r=Z.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let n=null;if(i)n=t;else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${oi()}`}n=t._pixiId}let s=Nt[n];if(i&&r&&!s)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return s||(s=new Cr(t,e),s.cacheId=n,Cr.addToCache(s,n)),s}static fromBuffer(t,e,r,i){t=t||new Float32Array(e*r*4);const n=new ua(t,{width:e,height:r}),s=t instanceof Float32Array?se.FLOAT:se.UNSIGNED_BYTE;return new Cr(n,Object.assign({},qx,i||{width:e,height:r,type:s}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Nt[e]&&Nt[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Nt[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Nt[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Nt[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Nt[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};let ae=Cr;ae.defaultOptions={mipmap:jt.POW2,anisotropicLevel:0,scaleMode:dt.LINEAR,wrapMode:Zr.CLAMP,alphaMode:Pt.UNPACK,target:pr.TEXTURE_2D,format:N.RGBA,type:se.UNSIGNED_BYTE},ae._globalBatch=0;class ca{constructor(){this.texArray=null,this.blend=0,this.type=Rt.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Yx=0;class Ue{constructor(e,r=!0,i=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=r,this.id=Yx++,this.disposeRunner=new et("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?pt.ELEMENT_ARRAY_BUFFER:pt.ARRAY_BUFFER}get index(){return this.type===pt.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new Ue(e)}}class un{constructor(e,r=0,i=!1,n=se.FLOAT,s,a,o,u=1){this.buffer=e,this.size=r,this.normalized=i,this.type=n,this.stride=s,this.start=a,this.instance=o,this.divisor=u}destroy(){this.buffer=null}static from(e,r,i,n,s){return new un(e,r,i,n,s)}}const Kx={Float32Array,Uint32Array,Int32Array,Uint8Array};function Zx(t,e){let r=0,i=0;const n={};for(let u=0;u<t.length;u++)i+=e[u],r+=t[u].length;const s=new ArrayBuffer(r*4);let a=null,o=0;for(let u=0;u<t.length;u++){const h=e[u],d=t[u],l=yu(d);n[l]||(n[l]=new Kx[l](s)),a=n[l];for(let c=0;c<d.length;c++){const f=(c/h|0)*i+o,p=c%h;a[f+p]=d[c]}o+=h}return new Float32Array(s)}const Eu={5126:4,5123:2,5121:1};let Qx=0;const Jx={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Ir{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=Qx++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new et("disposeGeometry"),this.refCount=0}addAttribute(e,r,i=0,n=!1,s,a,o,u=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Ue||(r instanceof Array&&(r=new Float32Array(r)),r=new Ue(r));const h=e.split("|");if(h.length>1){for(let l=0;l<h.length;l++)this.addAttribute(h[l],r,i,n,s);return this}let d=this.buffers.indexOf(r);return d===-1&&(this.buffers.push(r),d=this.buffers.length-1),this.attributes[e]=new un(d,i,n,s,a,o,u),this.instanced=this.instanced||u,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof Ue||(e instanceof Array&&(e=new Uint16Array(e)),e=new Ue(e)),e.type=pt.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],i=new Ue;let n;for(n in this.attributes){const s=this.attributes[n],a=this.buffers[s.buffer];e.push(a.data),r.push(s.size*Eu[s.type]/4),s.buffer=0}for(i.data=Zx(e,r),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new Ir;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new Ue(this.buffers[r].data.slice(0));for(const r in this.attributes){const i=this.attributes[r];e.attributes[r]=new un(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=pt.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new Ir,i=[],n=[],s=[];let a;for(let o=0;o<e.length;o++){a=e[o];for(let u=0;u<a.buffers.length;u++)n[u]=n[u]||0,n[u]+=a.buffers[u].data.length,s[u]=0}for(let o=0;o<a.buffers.length;o++)i[o]=new Jx[yu(a.buffers[o].data)](n[o]),r.buffers[o]=new Ue(i[o]);for(let o=0;o<e.length;o++){a=e[o];for(let u=0;u<a.buffers.length;u++)i[u].set(a.buffers[u].data,s[u]),s[u]+=a.buffers[u].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=pt.ELEMENT_ARRAY_BUFFER;let o=0,u=0,h=0,d=0;for(let l=0;l<a.buffers.length;l++)if(a.buffers[l]!==a.indexBuffer){d=l;break}for(const l in a.attributes){const c=a.attributes[l];(c.buffer|0)===d&&(u+=c.size*Eu[c.type]/4)}for(let l=0;l<e.length;l++){const c=e[l].indexBuffer.data;for(let f=0;f<c.length;f++)r.indexBuffer.data[f+h]+=o;o+=e[l].buffers[d].data.length/u,h+=c.length}}return r}}class Cu extends Ir{constructor(e=!1){super(),this._buffer=new Ue(null,e,!1),this._indexBuffer=new Ue(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,se.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,se.FLOAT).addAttribute("aColor",this._buffer,4,!0,se.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,se.FLOAT).addIndex(this._indexBuffer)}}const cn=Math.PI*2,eb=180/Math.PI,ui=Math.PI/180;var Fe=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(Fe||{});class ge{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new ge(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,r=e){return this.x=e,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const hn=[new ge,new ge,new ge,new ge];class pe{constructor(e=0,r=0,i=0,n=0){this.x=Number(e),this.y=Number(r),this.width=Number(i),this.height=Number(n),this.type=Fe.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 pe(0,0,0,0)}clone(){return new pe(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const S=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=S)return!1;const C=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>C}const i=this.left,n=this.right,s=this.top,a=this.bottom;if(n<=i||a<=s)return!1;const o=hn[0].set(e.left,e.top),u=hn[1].set(e.left,e.bottom),h=hn[2].set(e.right,e.top),d=hn[3].set(e.right,e.bottom);if(h.x<=o.x||u.y<=o.y)return!1;const l=Math.sign(r.a*r.d-r.b*r.c);if(l===0||(r.apply(o,o),r.apply(u,u),r.apply(h,h),r.apply(d,d),Math.max(o.x,u.x,h.x,d.x)<=i||Math.min(o.x,u.x,h.x,d.x)>=n||Math.max(o.y,u.y,h.y,d.y)<=s||Math.min(o.y,u.y,h.y,d.y)>=a))return!1;const c=l*(u.y-o.y),f=l*(o.x-u.x),p=c*i+f*s,m=c*n+f*s,v=c*i+f*a,g=c*n+f*a;if(Math.max(p,m,v,g)<=c*o.x+f*o.y||Math.min(p,m,v,g)>=c*d.x+f*d.y)return!1;const y=l*(o.y-h.y),_=l*(h.x-o.x),x=y*i+_*s,b=y*n+_*s,T=y*i+_*a,w=y*n+_*a;return!(Math.max(x,b,T,w)<=y*o.x+_*o.y||Math.min(x,b,T,w)>=y*d.x+_*d.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2,this}fit(e){const r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(i-r,0),this.y=n,this.height=Math.max(s-n,0),this}ceil(e=1,r=.001){const i=Math.ceil((this.x+this.width-r)*e)/e,n=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=i-this.x,this.height=n-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=i-r,this.y=n,this.height=s-n,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class ha{constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.radius=i,this.type=Fe.CIRC}clone(){return new ha(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-e,s=this.y-r;return n*=n,s*=s,n+s<=i}getBounds(){return new pe(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let tb=class Oh{constructor(e=0,r=0,i=0,n=0){this.x=e,this.y=r,this.width=i,this.height=n,this.type=Fe.ELIP}clone(){return new Oh(this.x,this.y,this.width,this.height)}contains(e,r){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,n=(r-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new pe(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class ci{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const i=[];for(let n=0,s=r.length;n<s;n++)i.push(r[n].x,r[n].y);r=i}this.points=r,this.type=Fe.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new ci(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let i=!1;const n=this.points.length/2;for(let s=0,a=n-1;s<n;a=s++){const o=this.points[s*2],u=this.points[s*2+1],h=this.points[a*2],d=this.points[a*2+1];u>r!=d>r&&e<(h-o)*((r-u)/(d-u))+o&&(i=!i)}return i}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((e,r)=>`${e}, ${r}`,"")}]`}}class fa{constructor(e=0,r=0,i=0,n=0,s=20){this.x=e,this.y=r,this.width=i,this.height=n,this.radius=s,this.type=Fe.RREC}clone(){return new fa(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+i&&r<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let n=e-(this.x+i),s=r-(this.y+i);const a=i*i;if(n*n+s*s<=a||(n=e-(this.x+this.width-i),n*n+s*s<=a)||(s=r-(this.y+this.height-i),n*n+s*s<=a)||(n=e-(this.x+i),n*n+s*s<=a))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let $e=class Hn{constructor(e=1,r=0,i=0,n=1,s=0,a=0){this.array=null,this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,r,i,n,s,a){return this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=a,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const i=r||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,r){r=r||new ge;const i=e.x,n=e.y;return r.x=this.a*i+this.c*n+this.tx,r.y=this.b*i+this.d*n+this.ty,r}applyInverse(e,r){r=r||new ge;const i=1/(this.a*this.d+this.c*-this.b),n=e.x,s=e.y;return r.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,r.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),i=Math.sin(e),n=this.a,s=this.c,a=this.tx;return this.a=n*r-this.b*i,this.b=n*i+this.b*r,this.c=s*r-this.d*i,this.d=s*i+this.d*r,this.tx=a*r-this.ty*i,this.ty=a*i+this.ty*r,this}append(e){const r=this.a,i=this.b,n=this.c,s=this.d;return this.a=e.a*r+e.b*n,this.b=e.a*i+e.b*s,this.c=e.c*r+e.d*n,this.d=e.c*i+e.d*s,this.tx=e.tx*r+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}setTransform(e,r,i,n,s,a,o,u,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-u)*a,this.d=Math.cos(o-u)*a,this.tx=e-(i*this.a+n*this.c),this.ty=r-(i*this.b+n*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,i=this.b,n=this.c,s=this.d,a=e.pivot,o=-Math.atan2(-n,s),u=Math.atan2(i,r),h=Math.abs(o+u);return h<1e-5||Math.abs(cn-h)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=u),e.scale.x=Math.sqrt(r*r+i*i),e.scale.y=Math.sqrt(n*n+s*s),e.position.x=this.tx+(a.x*r+a.y*n),e.position.y=this.ty+(a.x*i+a.y*s),e}invert(){const e=this.a,r=this.b,i=this.c,n=this.d,s=this.tx,a=e*n-r*i;return this.a=n/a,this.b=-r/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*s)/a,this.ty=-(e*this.ty-r*s)/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 e=new Hn;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new Hn}static get TEMP_MATRIX(){return new Hn}};const Yt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Kt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Zt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Qt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],da=[],Iu=[],fn=Math.sign;function rb(){for(let t=0;t<16;t++){const e=[];da.push(e);for(let r=0;r<16;r++){const i=fn(Yt[t]*Yt[r]+Zt[t]*Kt[r]),n=fn(Kt[t]*Yt[r]+Qt[t]*Kt[r]),s=fn(Yt[t]*Zt[r]+Zt[t]*Qt[r]),a=fn(Kt[t]*Zt[r]+Qt[t]*Qt[r]);for(let o=0;o<16;o++)if(Yt[o]===i&&Kt[o]===n&&Zt[o]===s&&Qt[o]===a){e.push(o);break}}}for(let t=0;t<16;t++){const e=new $e;e.set(Yt[t],Kt[t],Zt[t],Qt[t],0,0),Iu.push(e)}}rb();const be={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:t=>Yt[t],uY:t=>Kt[t],vX:t=>Zt[t],vY:t=>Qt[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>da[t][e],sub:(t,e)=>da[t][be.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?be.S:be.N:Math.abs(e)*2<=Math.abs(t)?t>0?be.E:be.W:e>0?t>0?be.SE:be.SW:t>0?be.NE:be.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const n=Iu[be.inv(e)];n.tx=r,n.ty=i,t.append(n)}};class Jt{constructor(e,r,i=0,n=0){this._x=i,this._y=n,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new Jt(e,r,this._x,this._y)}set(e=0,r=e){return(this._x!==e||this._y!==r)&&(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}const Ru=class{constructor(){this.worldTransform=new $e,this.localTransform=new $e,this.position=new Jt(this.onChange,this,0,0),this.scale=new Jt(this.onChange,this,1,1),this.pivot=new Jt(this.onChange,this,0,0),this.skew=new Jt(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++}toString(){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}) ]`}updateLocalTransform(){const t=this.localTransform;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)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let pa=Ru;pa.IDENTITY=new Ru;var ib=`varying vec2 vTextureCoord;
42
+ Deprecated since v${t}`),console.warn(i))),au[e]=!0}let Hs;function Ix(){return typeof Hs>"u"&&(Hs=function(){var r;const e={stencil:!0,failIfMajorPerformanceCaveat:Q.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Q.ADAPTER.getWebGLRenderingContext())return!1;const i=Q.ADAPTER.createCanvas();let n=i.getContext("webgl",e)||i.getContext("experimental-webgl",e);const s=!!((r=n==null?void 0:n.getContextAttributes())!=null&&r.stencil);if(n){const a=n.getExtension("WEBGL_lose_context");a&&a.loseContext()}return n=null,s}catch{return!1}}()),Hs}var Rx={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Pe=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},Ze=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},ou=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},lu=function(t){return{r:Ze(t.r,0,255),g:Ze(t.g,0,255),b:Ze(t.b,0,255),a:Ze(t.a)}},Vs=function(t){return{r:Pe(t.r),g:Pe(t.g),b:Pe(t.b),a:Pe(t.a,3)}},Px=/^#([0-9a-f]{3,8})$/i,Ji=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},uu=function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=Math.max(e,r,i),a=s-Math.min(e,r,i),o=a?s===e?(r-i)/a:s===r?2+(i-e)/a:4+(e-r)/a:0;return{h:60*(o<0?o+6:o),s:s?a/s*100:0,v:s/255*100,a:n}},cu=function(t){var e=t.h,r=t.s,i=t.v,n=t.a;e=e/360*6,r/=100,i/=100;var s=Math.floor(e),a=i*(1-r),o=i*(1-(e-s)*r),u=i*(1-(1-e+s)*r),h=s%6;return{r:255*[i,o,a,a,u,i][h],g:255*[u,i,i,o,a,a][h],b:255*[a,a,u,i,i,o][h],a:n}},hu=function(t){return{h:ou(t.h),s:Ze(t.s,0,100),l:Ze(t.l,0,100),a:Ze(t.a)}},fu=function(t){return{h:Pe(t.h),s:Pe(t.s),l:Pe(t.l),a:Pe(t.a,3)}},du=function(t){return cu((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},ii=function(t){return{h:(e=uu(t)).h,s:(n=(200-(r=e.s))*(i=e.v)/100)>0&&n<200?r*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,r,i,n},Mx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Fx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ox=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xs={string:[[function(t){var e=Px.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Pe(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Pe(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=Ox.exec(t)||Nx.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:lu({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=Mx.exec(t)||Fx.exec(t);if(!e)return null;var r,i,n=hu({h:(r=e[1],i=e[2],i===void 0&&(i="deg"),Number(r)*(Rx[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return du(n)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=n===void 0?1:n;return bt(e)&&bt(r)&&bt(i)?lu({r:Number(e),g:Number(r),b:Number(i),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,n=t.a,s=n===void 0?1:n;if(!bt(e)||!bt(r)||!bt(i))return null;var a=hu({h:Number(e),s:Number(r),l:Number(i),a:Number(s)});return du(a)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,n=t.a,s=n===void 0?1:n;if(!bt(e)||!bt(r)||!bt(i))return null;var a=function(o){return{h:ou(o.h),s:Ze(o.s,0,100),v:Ze(o.v,0,100),a:Ze(o.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(s)});return cu(a)},"hsv"]]},pu=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},kx=function(t){return typeof t=="string"?pu(t.trim(),Xs.string):typeof t=="object"&&t!==null?pu(t,Xs.object):[null,void 0]},Ws=function(t,e){var r=ii(t);return{h:r.h,s:Ze(r.s+100*e,0,100),l:r.l,a:r.a}},qs=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},mu=function(t,e){var r=ii(t);return{h:r.h,s:r.s,l:Ze(r.l+100*e,0,100),a:r.a}},Ys=function(){function t(e){this.parsed=kx(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return Pe(qs(this.rgba),2)},t.prototype.isDark=function(){return qs(this.rgba)<.5},t.prototype.isLight=function(){return qs(this.rgba)>=.5},t.prototype.toHex=function(){return e=Vs(this.rgba),r=e.r,i=e.g,n=e.b,a=(s=e.a)<1?Ji(Pe(255*s)):"","#"+Ji(r)+Ji(i)+Ji(n)+a;var e,r,i,n,s,a},t.prototype.toRgb=function(){return Vs(this.rgba)},t.prototype.toRgbString=function(){return e=Vs(this.rgba),r=e.r,i=e.g,n=e.b,(s=e.a)<1?"rgba("+r+", "+i+", "+n+", "+s+")":"rgb("+r+", "+i+", "+n+")";var e,r,i,n,s},t.prototype.toHsl=function(){return fu(ii(this.rgba))},t.prototype.toHslString=function(){return e=fu(ii(this.rgba)),r=e.h,i=e.s,n=e.l,(s=e.a)<1?"hsla("+r+", "+i+"%, "+n+"%, "+s+")":"hsl("+r+", "+i+"%, "+n+"%)";var e,r,i,n,s},t.prototype.toHsv=function(){return e=uu(this.rgba),{h:Pe(e.h),s:Pe(e.s),v:Pe(e.v),a:Pe(e.a,3)};var e},t.prototype.invert=function(){return vt({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),vt(Ws(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),vt(Ws(this.rgba,-e))},t.prototype.grayscale=function(){return vt(Ws(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),vt(mu(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),vt(mu(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?vt({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):Pe(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=ii(this.rgba);return typeof e=="number"?vt({h:e,s:r.s,l:r.l,a:r.a}):Pe(r.h)},t.prototype.isEqual=function(e){return this.toHex()===vt(e).toHex()},t}(),vt=function(t){return t instanceof Ys?t:new Ys(t)},gu=[],Lx=function(t){t.forEach(function(e){gu.indexOf(e)<0&&(e(Ys,Xs),gu.push(e))})};function Dx(t,e){var r={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"},i={};for(var n in r)i[r[n]]=n;var s={};t.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,u,h=i[this.toHex()];if(h)return h;if(a!=null&&a.closest){var d=this.toRgb(),l=1/0,c="black";if(!s.length)for(var f in r)s[f]=new t(r[f]).toRgb();for(var p in r){var m=(o=d,u=s[p],Math.pow(o.r-u.r,2)+Math.pow(o.g-u.g,2)+Math.pow(o.b-u.b,2));m<l&&(l=m,c=p)}return c}},e.string.push([function(a){var o=a.toLowerCase(),u=o==="transparent"?"#0000":r[o];return u?new t(u).toRgb():null},"name"])}Lx([Dx]);const Sr=class{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Sr)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if(r==="number"||r==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,s)=>n===e[s]);if(t!==null&&e!==null){const n=Object.keys(t),s=Object.keys(e);return n.length!==s.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(r*255),t[2]=Math.round(i*255),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,r,i,n]=Sr.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=i,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){if(t===1)return(t*255<<24)+this._int;if(t===0)return 0;let e=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return e=e*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(e<<16)+(r<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,n]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}normalize(t){let e;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const r=t;e=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4){t=this._clamp(t);const[r,i,n,s=1]=t;e=[r,i,n,s]}else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4){t=this._clamp(t,0,255);const[r,i,n,s=255]=t;e=[r/255,i/255,n/255,s/255]}else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const i=Sr.HEX_PATTERN.exec(t);i&&(t=`#${i[2]}`)}const r=vt(t);if(r.isValid()){const{r:i,g:n,b:s,a}=r.rgba;e=[i/255,n/255,s/255,a]}}if(e)this._components.set(e),this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(t*255<<16)+(e*255<<8)+(r*255|0)}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),r)}),t)}};let Le=Sr;Le.shared=new Sr,Le.temp=new Sr,Le.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function en(t,e=[]){return re("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),Le.shared.setValue(t).toRgbArray(e)}function Ks(t){return re("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Le.shared.setValue(t).toNumber()}function Bx(){const t=[],e=[];for(let i=0;i<32;i++)t[i]=i,e[i]=i;t[j.NORMAL_NPM]=j.NORMAL,t[j.ADD_NPM]=j.ADD,t[j.SCREEN_NPM]=j.SCREEN,e[j.NORMAL]=j.NORMAL_NPM,e[j.ADD]=j.ADD_NPM,e[j.SCREEN]=j.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}const Ux=Bx();function vu(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function tn(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function _u(t){return!(t&t-1)&&!!t}function yu(t){let e=(t>65535?1:0)<<4;t>>>=e;let r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function rn(t,e,r){const i=t.length;let n;if(e>=i||r===0)return;r=e+r>i?i-e:r;const s=i-r;for(n=e;n<s;++n)t[n]=t[n+r];t.length=s}let $x=0;function ni(){return++$x}const xu={},_t=Object.create(null),Ot=Object.create(null);let nn;function Gx(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location,nn||(nn=document.createElement("a")),nn.href=t;const r=Cx.parse(nn.href),i=!r.port&&e.port===""||r.port===e.port;return r.hostname!==e.hostname||!i||r.protocol!==e.protocol?"anonymous":""}function bu(t,e=1){var i;const r=(i=Q.RETINA_PREFIX)==null?void 0:i.exec(t);return r?parseFloat(r[1]):e}var ee=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(ee||{});const Zs=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Tu=(t,e)=>Zs(t).priority??e,he={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Zs).forEach(e=>{e.type.forEach(r=>{var i,n;return(n=(i=this._removeHandlers)[r])==null?void 0:n.call(i,e)})}),this},add(...t){return t.map(Zs).forEach(e=>{e.type.forEach(r=>{const i=this._addHandlers,n=this._queue;i[r]?i[r](e):(n[r]=n[r]||[],n[r].push(e))})}),this},handle(t,e,r){const i=this._addHandlers,n=this._removeHandlers;if(i[t]||n[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,n[t]=r;const s=this._queue;return s[t]&&(s[t].forEach(a=>e(a)),delete s[t]),this},handleByMap(t,e){return this.handle(t,r=>{e[r.name]=r.ref},r=>{delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((n,s)=>Tu(s,r)-Tu(n,r)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class zx{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,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(e){return this[`${e}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(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const jx=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
43
+ `);function Hx(t){let e="";for(let r=0;r<t;++r)r>0&&(e+=`
44
+ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function Vx(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=jx.replace(/%forloop%/gi,Hx(t));if(e.shaderSource(r,i),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))t=t/2|0;else break}return t}const Qs=0,Js=1,ea=2,ta=3,ra=4,ia=5;let sn=class Ph{constructor(){this.data=0,this.blendMode=j.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Qs)}set blend(e){!!(this.data&1<<Qs)!==e&&(this.data^=1<<Qs)}get offsets(){return!!(this.data&1<<Js)}set offsets(e){!!(this.data&1<<Js)!==e&&(this.data^=1<<Js)}get culling(){return!!(this.data&1<<ea)}set culling(e){!!(this.data&1<<ea)!==e&&(this.data^=1<<ea)}get depthTest(){return!!(this.data&1<<ta)}set depthTest(e){!!(this.data&1<<ta)!==e&&(this.data^=1<<ta)}get depthMask(){return!!(this.data&1<<ia)}set depthMask(e){!!(this.data&1<<ia)!==e&&(this.data^=1<<ia)}get clockwiseFrontFace(){return!!(this.data&1<<ra)}set clockwiseFrontFace(e){!!(this.data&1<<ra)!==e&&(this.data^=1<<ra)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==j.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new Ph;return e.depthTest=!1,e.blend=!0,e}};const na=[];function wu(t,e){if(!t)return null;let r="";if(typeof t=="string"){const i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(let i=na.length-1;i>=0;--i){const n=na[i];if(n.test&&n.test(t,r))return new n(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class et{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,i,n,s,a,o,u){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:d}=this;this._aliasCount++;for(let l=0,c=d.length;l<c;l++)d[l][h](e,r,i,n,s,a,o,u);return d===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(et.prototype,{dispatch:{value:et.prototype.emit},run:{value:et.prototype.emit}});class si{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new et("setRealSize"),this.onUpdate=new et("update"),this.onError=new et("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){(e!==this._width||r!==this._height)&&(this._width=e,this._height=r,this.onResize.emit(e,r))}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(e,r,i){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(e,r){return!1}}class sa extends si{constructor(e,r){const{width:i,height:n}=r||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=e}upload(e,r,i){const n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Rt.UNPACK);const s=r.realWidth,a=r.realHeight;return i.width===s&&i.height===a?n.texSubImage2D(r.target,0,0,0,s,a,r.format,i.type,this.data):(i.width=s,i.height=a,n.texImage2D(r.target,0,i.internalFormat,s,a,0,r.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array}}const Xx={scaleMode:dt.NEAREST,format:N.RGBA,alphaMode:Rt.NPM},Ar=class extends Bi{constructor(t=null,e=null){super(),e=Object.assign({},Ar.defaultOptions,e);const{alphaMode:r,mipmap:i,anisotropicLevel:n,scaleMode:s,width:a,height:o,wrapMode:u,format:h,type:d,target:l,resolution:c,resourceOptions:f}=e;t&&!(t instanceof si)&&(t=wu(t,f),t.internal=!0),this.resolution=c||Q.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=n,this._wrapMode=u,this._scaleMode=s,this.format=h,this.type=d,this.target=l,this.alphaMode=r,this.uid=ni(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>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 r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=_u(this.realWidth)&&_u(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 Ot[this.cacheId],delete _t[this.cacheId],this.cacheId=null),this.dispose(),Ar.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,r=Q.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let n=null;if(i)n=t;else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${ni()}`}n=t._pixiId}let s=Ot[n];if(i&&r&&!s)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return s||(s=new Ar(t,e),s.cacheId=n,Ar.addToCache(s,n)),s}static fromBuffer(t,e,r,i){t=t||new Float32Array(e*r*4);const n=new sa(t,{width:e,height:r}),s=t instanceof Float32Array?se.FLOAT:se.UNSIGNED_BYTE;return new Ar(n,Object.assign({},Xx,i||{width:e,height:r,type:s}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Ot[e]&&Ot[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Ot[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Ot[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Ot[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Ot[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};let ae=Ar;ae.defaultOptions={mipmap:Gt.POW2,anisotropicLevel:0,scaleMode:dt.LINEAR,wrapMode:qr.CLAMP,alphaMode:Rt.UNPACK,target:fr.TEXTURE_2D,format:N.RGBA,type:se.UNSIGNED_BYTE},ae._globalBatch=0;class aa{constructor(){this.texArray=null,this.blend=0,this.type=It.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Wx=0;class Be{constructor(e,r=!0,i=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=r,this.id=Wx++,this.disposeRunner=new et("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?pt.ELEMENT_ARRAY_BUFFER:pt.ARRAY_BUFFER}get index(){return this.type===pt.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new Be(e)}}class an{constructor(e,r=0,i=!1,n=se.FLOAT,s,a,o,u=1){this.buffer=e,this.size=r,this.normalized=i,this.type=n,this.stride=s,this.start=a,this.instance=o,this.divisor=u}destroy(){this.buffer=null}static from(e,r,i,n,s){return new an(e,r,i,n,s)}}const qx={Float32Array,Uint32Array,Int32Array,Uint8Array};function Yx(t,e){let r=0,i=0;const n={};for(let u=0;u<t.length;u++)i+=e[u],r+=t[u].length;const s=new ArrayBuffer(r*4);let a=null,o=0;for(let u=0;u<t.length;u++){const h=e[u],d=t[u],l=vu(d);n[l]||(n[l]=new qx[l](s)),a=n[l];for(let c=0;c<d.length;c++){const f=(c/h|0)*i+o,p=c%h;a[f+p]=d[c]}o+=h}return new Float32Array(s)}const Su={5126:4,5123:2,5121:1};let Kx=0;const Zx={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Er{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=Kx++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new et("disposeGeometry"),this.refCount=0}addAttribute(e,r,i=0,n=!1,s,a,o,u=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Be||(r instanceof Array&&(r=new Float32Array(r)),r=new Be(r));const h=e.split("|");if(h.length>1){for(let l=0;l<h.length;l++)this.addAttribute(h[l],r,i,n,s);return this}let d=this.buffers.indexOf(r);return d===-1&&(this.buffers.push(r),d=this.buffers.length-1),this.attributes[e]=new an(d,i,n,s,a,o,u),this.instanced=this.instanced||u,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof Be||(e instanceof Array&&(e=new Uint16Array(e)),e=new Be(e)),e.type=pt.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],i=new Be;let n;for(n in this.attributes){const s=this.attributes[n],a=this.buffers[s.buffer];e.push(a.data),r.push(s.size*Su[s.type]/4),s.buffer=0}for(i.data=Yx(e,r),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new Er;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new Be(this.buffers[r].data.slice(0));for(const r in this.attributes){const i=this.attributes[r];e.attributes[r]=new an(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=pt.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new Er,i=[],n=[],s=[];let a;for(let o=0;o<e.length;o++){a=e[o];for(let u=0;u<a.buffers.length;u++)n[u]=n[u]||0,n[u]+=a.buffers[u].data.length,s[u]=0}for(let o=0;o<a.buffers.length;o++)i[o]=new Zx[vu(a.buffers[o].data)](n[o]),r.buffers[o]=new Be(i[o]);for(let o=0;o<e.length;o++){a=e[o];for(let u=0;u<a.buffers.length;u++)i[u].set(a.buffers[u].data,s[u]),s[u]+=a.buffers[u].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=pt.ELEMENT_ARRAY_BUFFER;let o=0,u=0,h=0,d=0;for(let l=0;l<a.buffers.length;l++)if(a.buffers[l]!==a.indexBuffer){d=l;break}for(const l in a.attributes){const c=a.attributes[l];(c.buffer|0)===d&&(u+=c.size*Su[c.type]/4)}for(let l=0;l<e.length;l++){const c=e[l].indexBuffer.data;for(let f=0;f<c.length;f++)r.indexBuffer.data[f+h]+=o;o+=e[l].buffers[d].data.length/u,h+=c.length}}return r}}class Au extends Er{constructor(e=!1){super(),this._buffer=new Be(null,e,!1),this._indexBuffer=new Be(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,se.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,se.FLOAT).addAttribute("aColor",this._buffer,4,!0,se.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,se.FLOAT).addIndex(this._indexBuffer)}}const on=Math.PI*2,Qx=180/Math.PI,ai=Math.PI/180;var Me=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(Me||{});class me{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new me(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,r=e){return this.x=e,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const ln=[new me,new me,new me,new me];class de{constructor(e=0,r=0,i=0,n=0){this.x=Number(e),this.y=Number(r),this.width=Number(i),this.height=Number(n),this.type=Me.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 de(0,0,0,0)}clone(){return new de(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const S=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=S)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const i=this.left,n=this.right,s=this.top,a=this.bottom;if(n<=i||a<=s)return!1;const o=ln[0].set(e.left,e.top),u=ln[1].set(e.left,e.bottom),h=ln[2].set(e.right,e.top),d=ln[3].set(e.right,e.bottom);if(h.x<=o.x||u.y<=o.y)return!1;const l=Math.sign(r.a*r.d-r.b*r.c);if(l===0||(r.apply(o,o),r.apply(u,u),r.apply(h,h),r.apply(d,d),Math.max(o.x,u.x,h.x,d.x)<=i||Math.min(o.x,u.x,h.x,d.x)>=n||Math.max(o.y,u.y,h.y,d.y)<=s||Math.min(o.y,u.y,h.y,d.y)>=a))return!1;const c=l*(u.y-o.y),f=l*(o.x-u.x),p=c*i+f*s,m=c*n+f*s,v=c*i+f*a,g=c*n+f*a;if(Math.max(p,m,v,g)<=c*o.x+f*o.y||Math.min(p,m,v,g)>=c*d.x+f*d.y)return!1;const y=l*(o.y-h.y),_=l*(h.x-o.x),x=y*i+_*s,b=y*n+_*s,T=y*i+_*a,w=y*n+_*a;return!(Math.max(x,b,T,w)<=y*o.x+_*o.y||Math.min(x,b,T,w)>=y*d.x+_*d.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2,this}fit(e){const r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(i-r,0),this.y=n,this.height=Math.max(s-n,0),this}ceil(e=1,r=.001){const i=Math.ceil((this.x+this.width-r)*e)/e,n=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=i-this.x,this.height=n-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=i-r,this.y=n,this.height=s-n,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class oa{constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.radius=i,this.type=Me.CIRC}clone(){return new oa(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-e,s=this.y-r;return n*=n,s*=s,n+s<=i}getBounds(){return new de(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let Jx=class Mh{constructor(e=0,r=0,i=0,n=0){this.x=e,this.y=r,this.width=i,this.height=n,this.type=Me.ELIP}clone(){return new Mh(this.x,this.y,this.width,this.height)}contains(e,r){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,n=(r-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new de(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class oi{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const i=[];for(let n=0,s=r.length;n<s;n++)i.push(r[n].x,r[n].y);r=i}this.points=r,this.type=Me.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new oi(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let i=!1;const n=this.points.length/2;for(let s=0,a=n-1;s<n;a=s++){const o=this.points[s*2],u=this.points[s*2+1],h=this.points[a*2],d=this.points[a*2+1];u>r!=d>r&&e<(h-o)*((r-u)/(d-u))+o&&(i=!i)}return i}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((e,r)=>`${e}, ${r}`,"")}]`}}class la{constructor(e=0,r=0,i=0,n=0,s=20){this.x=e,this.y=r,this.width=i,this.height=n,this.radius=s,this.type=Me.RREC}clone(){return new la(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+i&&r<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let n=e-(this.x+i),s=r-(this.y+i);const a=i*i;if(n*n+s*s<=a||(n=e-(this.x+this.width-i),n*n+s*s<=a)||(s=r-(this.y+this.height-i),n*n+s*s<=a)||(n=e-(this.x+i),n*n+s*s<=a))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let Ue=class $n{constructor(e=1,r=0,i=0,n=1,s=0,a=0){this.array=null,this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,r,i,n,s,a){return this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=a,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const i=r||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,r){r=r||new me;const i=e.x,n=e.y;return r.x=this.a*i+this.c*n+this.tx,r.y=this.b*i+this.d*n+this.ty,r}applyInverse(e,r){r=r||new me;const i=1/(this.a*this.d+this.c*-this.b),n=e.x,s=e.y;return r.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,r.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),i=Math.sin(e),n=this.a,s=this.c,a=this.tx;return this.a=n*r-this.b*i,this.b=n*i+this.b*r,this.c=s*r-this.d*i,this.d=s*i+this.d*r,this.tx=a*r-this.ty*i,this.ty=a*i+this.ty*r,this}append(e){const r=this.a,i=this.b,n=this.c,s=this.d;return this.a=e.a*r+e.b*n,this.b=e.a*i+e.b*s,this.c=e.c*r+e.d*n,this.d=e.c*i+e.d*s,this.tx=e.tx*r+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}setTransform(e,r,i,n,s,a,o,u,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-u)*a,this.d=Math.cos(o-u)*a,this.tx=e-(i*this.a+n*this.c),this.ty=r-(i*this.b+n*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,i=this.b,n=this.c,s=this.d,a=e.pivot,o=-Math.atan2(-n,s),u=Math.atan2(i,r),h=Math.abs(o+u);return h<1e-5||Math.abs(on-h)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=u),e.scale.x=Math.sqrt(r*r+i*i),e.scale.y=Math.sqrt(n*n+s*s),e.position.x=this.tx+(a.x*r+a.y*n),e.position.y=this.ty+(a.x*i+a.y*s),e}invert(){const e=this.a,r=this.b,i=this.c,n=this.d,s=this.tx,a=e*n-r*i;return this.a=n/a,this.b=-r/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*s)/a,this.ty=-(e*this.ty-r*s)/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 e=new $n;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new $n}static get TEMP_MATRIX(){return new $n}};const Wt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],qt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Yt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Kt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ua=[],Eu=[],un=Math.sign;function eb(){for(let t=0;t<16;t++){const e=[];ua.push(e);for(let r=0;r<16;r++){const i=un(Wt[t]*Wt[r]+Yt[t]*qt[r]),n=un(qt[t]*Wt[r]+Kt[t]*qt[r]),s=un(Wt[t]*Yt[r]+Yt[t]*Kt[r]),a=un(qt[t]*Yt[r]+Kt[t]*Kt[r]);for(let o=0;o<16;o++)if(Wt[o]===i&&qt[o]===n&&Yt[o]===s&&Kt[o]===a){e.push(o);break}}}for(let t=0;t<16;t++){const e=new Ue;e.set(Wt[t],qt[t],Yt[t],Kt[t],0,0),Eu.push(e)}}eb();const be={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:t=>Wt[t],uY:t=>qt[t],vX:t=>Yt[t],vY:t=>Kt[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>ua[t][e],sub:(t,e)=>ua[t][be.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?be.S:be.N:Math.abs(e)*2<=Math.abs(t)?t>0?be.E:be.W:e>0?t>0?be.SE:be.SW:t>0?be.NE:be.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const n=Eu[be.inv(e)];n.tx=r,n.ty=i,t.append(n)}};class Zt{constructor(e,r,i=0,n=0){this._x=i,this._y=n,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new Zt(e,r,this._x,this._y)}set(e=0,r=e){return(this._x!==e||this._y!==r)&&(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}const Cu=class{constructor(){this.worldTransform=new Ue,this.localTransform=new Ue,this.position=new Zt(this.onChange,this,0,0),this.scale=new Zt(this.onChange,this,1,1),this.pivot=new Zt(this.onChange,this,0,0),this.skew=new Zt(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++}toString(){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}) ]`}updateLocalTransform(){const t=this.localTransform;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)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let ca=Cu;ca.IDENTITY=new Cu;var tb=`varying vec2 vTextureCoord;
45
45
 
46
46
  uniform sampler2D uSampler;
47
47
 
48
48
  void main(void){
49
49
  gl_FragColor *= texture2D(uSampler, vTextureCoord);
50
- }`,nb=`attribute vec2 aVertexPosition;
50
+ }`,rb=`attribute vec2 aVertexPosition;
51
51
  attribute vec2 aTextureCoord;
52
52
 
53
53
  uniform mat3 projectionMatrix;
@@ -58,7 +58,7 @@ void main(void){
58
58
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
59
59
  vTextureCoord = aTextureCoord;
60
60
  }
61
- `;function Pu(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function ma(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function Mu(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return ma(2*e);case"bvec3":return ma(3*e);case"bvec4":return ma(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Rr=[{test:t=>t.type==="float"&&t.size===1&&!t.isArray,code:t=>`
61
+ `;function Iu(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function ha(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function Ru(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return ha(2*e);case"bvec3":return ha(3*e);case"bvec4":return ha(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Cr=[{test:t=>t.type==="float"&&t.size===1&&!t.isArray,code:t=>`
62
62
  if(uv["${t}"] !== ud["${t}"].value)
63
63
  {
64
64
  ud["${t}"].value = uv["${t}"]
@@ -178,7 +178,7 @@ void main(void){
178
178
  cv[3] = v[3];
179
179
 
180
180
  gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])
181
- }`}],sb={float:`
181
+ }`}],ib={float:`
182
182
  if (cv !== v)
183
183
  {
184
184
  cu.value = v;
@@ -314,7 +314,7 @@ void main(void){
314
314
  cu.value = v;
315
315
 
316
316
  gl.uniform1i(location, v);
317
- }`},ab={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 ob(t,e){var i;const r=[`
317
+ }`},nb={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 sb(t,e){var i;const r=[`
318
318
  var v = null;
319
319
  var cv = null;
320
320
  var cu = null;
@@ -324,18 +324,18 @@ void main(void){
324
324
  renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}');
325
325
  `):r.push(`
326
326
  renderer.shader.syncUniformGroup(uv.${n}, syncData);
327
- `));continue}const a=t.uniforms[n];let o=!1;for(let u=0;u<Rr.length;u++)if(Rr[u].test(s,a)){r.push(Rr[u].code(n,a)),o=!0;break}if(!o){const h=(s.size===1&&!s.isArray?sb:ab)[s.type].replace("location",`ud["${n}"].location`);r.push(`
327
+ `));continue}const a=t.uniforms[n];let o=!1;for(let u=0;u<Cr.length;u++)if(Cr[u].test(s,a)){r.push(Cr[u].code(n,a)),o=!0;break}if(!o){const h=(s.size===1&&!s.isArray?ib:nb)[s.type].replace("location",`ud["${n}"].location`);r.push(`
328
328
  cu = ud["${n}"];
329
329
  cv = cu.value;
330
330
  v = uv["${n}"];
331
331
  ${h};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
332
- `))}const Fu={};let Pr=Fu;function lb(){if(Pr===Fu||Pr!=null&&Pr.isContextLost()){const t=Z.ADAPTER.createCanvas();let e;Z.PREFER_ENV>=zt.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Pr=e}return Pr}let dn;function ub(){if(!dn){dn=Ze.MEDIUM;const t=lb();t&&t.getShaderPrecisionFormat&&(dn=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?Ze.HIGH:Ze.MEDIUM)}return dn}function Ou(t,e){const r=t.getShaderSource(e).split(`
332
+ `))}const Pu={};let Ir=Pu;function ab(){if(Ir===Pu||Ir!=null&&Ir.isContextLost()){const t=Q.ADAPTER.createCanvas();let e;Q.PREFER_ENV>=$t.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Ir=e}return Ir}let cn;function ob(){if(!cn){cn=Ke.MEDIUM;const t=ab();t&&t.getShaderPrecisionFormat&&(cn=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?Ke.HIGH:Ke.MEDIUM)}return cn}function Mu(t,e){const r=t.getShaderSource(e).split(`
333
333
  `).map((h,d)=>`${d}: ${h}`),i=t.getShaderInfoLog(e),n=i.split(`
334
334
  `),s={},a=n.map(h=>parseFloat(h.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(h=>h&&!s[h]?(s[h]=!0,!0):!1),o=[""];a.forEach(h=>{r[h-1]=`%c${r[h-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const u=r.join(`
335
- `);o[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function cb(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Ou(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Ou(t,i),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}const hb={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 Nu(t){return hb[t]}let pn=null;const ku={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 Lu(t,e){if(!pn){const r=Object.keys(ku);pn={};for(let i=0;i<r.length;++i){const n=r[i];pn[t[n]]=ku[n]}}return pn[e]}function Du(t,e,r){if(t.substring(0,9)!=="precision"){let i=e;return e===Ze.HIGH&&r!==Ze.HIGH&&(i=Ze.MEDIUM),`precision ${i} float;
336
- ${t}`}else if(r!==Ze.HIGH&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}let hi;function fb(){if(typeof hi=="boolean")return hi;try{hi=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{hi=!1}return hi}let db=0;const mn={},Mr=class{constructor(t,e,r="pixi-shader",i={}){this.extra={},this.id=db++,this.vertexSrc=t||Mr.defaultVertexSrc,this.fragmentSrc=e||Mr.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=i,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),mn[r]?(mn[r]++,r+=`-${mn[r]}`):mn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
335
+ `);o[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function lb(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Mu(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Mu(t,i),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}const ub={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 Fu(t){return ub[t]}let hn=null;const Ou={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 Nu(t,e){if(!hn){const r=Object.keys(Ou);hn={};for(let i=0;i<r.length;++i){const n=r[i];hn[t[n]]=Ou[n]}}return hn[e]}function ku(t,e,r){if(t.substring(0,9)!=="precision"){let i=e;return e===Ke.HIGH&&r!==Ke.HIGH&&(i=Ke.MEDIUM),`precision ${i} float;
336
+ ${t}`}else if(r!==Ke.HIGH&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}let li;function cb(){if(typeof li=="boolean")return li;try{li=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{li=!1}return li}let hb=0;const fn={},Rr=class{constructor(t,e,r="pixi-shader",i={}){this.extra={},this.id=hb++,this.vertexSrc=t||Rr.defaultVertexSrc,this.fragmentSrc=e||Rr.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=i,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),fn[r]?(fn[r]++,r+=`-${fn[r]}`):fn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
337
337
  ${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${r}
338
- ${this.fragmentSrc}`,this.vertexSrc=Du(this.vertexSrc,Mr.defaultVertexPrecision,Ze.HIGH),this.fragmentSrc=Du(this.fragmentSrc,Mr.defaultFragmentPrecision,ub())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return nb}static get defaultFragmentSrc(){return ib}static from(t,e,r){const i=t+e;let n=Tu[i];return n||(Tu[i]=n=new Mr(t,e,r)),n}};let Tt=Mr;Tt.defaultVertexPrecision=Ze.HIGH,Tt.defaultFragmentPrecision=gr.apple.device?Ze.HIGH:Ze.MEDIUM;let pb=0;class tt{constructor(e,r,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=pb++,this.static=!!r,this.ubo=!!i,e instanceof Ue?(this.buffer=e,this.buffer.type=pt.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Ue(new Float32Array(1)),this.buffer.type=pt.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(e,r,i){if(!this.ubo)this.uniforms[e]=new tt(r,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(e,r,i){return new tt(e,r,i)}static uboFrom(e,r){return new tt(e,r??!0,!0)}}class fi{constructor(e,r){this.uniformBindCount=0,this.program=e,r?r instanceof tt?this.uniformGroup=r:this.uniformGroup=new tt(r):this.uniformGroup=new tt({}),this.disposeRunner=new et("disposeShader")}checkUniformExists(e,r){if(r.uniforms[e])return!0;for(const i in r.uniforms){const n=r.uniforms[i];if(n.group&&this.checkUniformExists(e,n))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(e,r,i){const n=Tt.from(e,r);return new fi(n,i)}}class mb{constructor(e,r){if(this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(e){if(!this.programCache[e]){const i=new Int32Array(e);for(let s=0;s<e;s++)i[s]=s;this.defaultGroupCache[e]=tt.from({uSamplers:i},!0);let n=this.fragTemplate;n=n.replace(/%count%/gi,`${e}`),n=n.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Tt(this.vertexSrc,n)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new $e,default:this.defaultGroupCache[e]};return new fi(this.programCache[e],r)}generateSampleSrc(e){let r="";r+=`
338
+ ${this.fragmentSrc}`,this.vertexSrc=ku(this.vertexSrc,Rr.defaultVertexPrecision,Ke.HIGH),this.fragmentSrc=ku(this.fragmentSrc,Rr.defaultFragmentPrecision,ob())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return rb}static get defaultFragmentSrc(){return tb}static from(t,e,r){const i=t+e;let n=xu[i];return n||(xu[i]=n=new Rr(t,e,r)),n}};let Tt=Rr;Tt.defaultVertexPrecision=Ke.HIGH,Tt.defaultFragmentPrecision=pr.apple.device?Ke.HIGH:Ke.MEDIUM;let fb=0;class tt{constructor(e,r,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=fb++,this.static=!!r,this.ubo=!!i,e instanceof Be?(this.buffer=e,this.buffer.type=pt.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Be(new Float32Array(1)),this.buffer.type=pt.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(e,r,i){if(!this.ubo)this.uniforms[e]=new tt(r,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(e,r,i){return new tt(e,r,i)}static uboFrom(e,r){return new tt(e,r??!0,!0)}}class ui{constructor(e,r){this.uniformBindCount=0,this.program=e,r?r instanceof tt?this.uniformGroup=r:this.uniformGroup=new tt(r):this.uniformGroup=new tt({}),this.disposeRunner=new et("disposeShader")}checkUniformExists(e,r){if(r.uniforms[e])return!0;for(const i in r.uniforms){const n=r.uniforms[i];if(n.group&&this.checkUniformExists(e,n))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(e,r,i){const n=Tt.from(e,r);return new ui(n,i)}}class db{constructor(e,r){if(this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(e){if(!this.programCache[e]){const i=new Int32Array(e);for(let s=0;s<e;s++)i[s]=s;this.defaultGroupCache[e]=tt.from({uSamplers:i},!0);let n=this.fragTemplate;n=n.replace(/%count%/gi,`${e}`),n=n.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Tt(this.vertexSrc,n)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ue,default:this.defaultGroupCache[e]};return new ui(this.programCache[e],r)}generateSampleSrc(e){let r="";r+=`
339
339
  `,r+=`
340
340
  `;for(let i=0;i<e;i++)i>0&&(r+=`
341
341
  else `),i<e-1&&(r+=`if(vTextureId < ${i}.5)`),r+=`
@@ -343,7 +343,7 @@ else `),i<e-1&&(r+=`if(vTextureId < ${i}.5)`),r+=`
343
343
  color = texture2D(uSamplers[${i}], vTextureCoord);`,r+=`
344
344
  }`;return r+=`
345
345
  `,r+=`
346
- `,r}}class ga{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}}function gb(){return!gr.apple.device}function vb(t){let e=!0;const r=Z.ADAPTER.getNavigator();if(gr.tablet||gr.phone){if(gr.apple.device){const i=r.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)<11&&(e=!1)}if(gr.android.device){const i=r.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)<7&&(e=!1)}}return e?t:4}class Bu{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}}var _b=`varying vec2 vTextureCoord;
346
+ `,r}}class fa{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}}function pb(){return!pr.apple.device}function mb(t){let e=!0;const r=Q.ADAPTER.getNavigator();if(pr.tablet||pr.phone){if(pr.apple.device){const i=r.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)<11&&(e=!1)}if(pr.android.device){const i=r.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)<7&&(e=!1)}}return e?t:4}class Lu{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}}var gb=`varying vec2 vTextureCoord;
347
347
  varying vec4 vColor;
348
348
  varying float vTextureId;
349
349
  uniform sampler2D uSamplers[%count%];
@@ -353,7 +353,7 @@ void main(void){
353
353
  %forloop%
354
354
  gl_FragColor = color * vColor;
355
355
  }
356
- `,yb=`precision highp float;
356
+ `,vb=`precision highp float;
357
357
  attribute vec2 aVertexPosition;
358
358
  attribute vec2 aTextureCoord;
359
359
  attribute vec4 aColor;
@@ -374,14 +374,14 @@ void main(void){
374
374
  vTextureId = aTextureId;
375
375
  vColor = aColor * tint;
376
376
  }
377
- `;const rt=class extends Bu{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=Cu,this.vertexSize=6,this.state=ln.for2d(),this.size=rt.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??vb(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??gb(),this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return re("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return yb}static get defaultFragmentTemplate(){return _b}setShaderGenerator({vertex:t=rt.defaultVertexSrc,fragment:e=rt.defaultFragmentTemplate}={}){this.shaderGenerator=new mb(t,e)}contextChange(){const t=this.renderer.gl;Z.PREFER_ENV===zt.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),rt.defaultMaxTextures),this.maxTextures=Wx(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:t,_textureArrayPool:e}=rt,r=this.size/4,i=Math.floor(r/this.maxTextures)+1;for(;t.length<r;)t.push(new ca);for(;e.length<i;)e.push(new ga);for(let n=0;n<this.maxTextures;n++)this._tempBoundTextures[n]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.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,r=rt._textureArrayPool,i=this.renderer.batch,n=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++ae._globalBatch,o=0,u=r[0],h=0;i.copyBoundTextures(n,e);for(let d=0;d<this._bufferSize;++d){const l=t[d];t[d]=null,l._batchEnabled!==a&&(u.count>=e&&(i.boundArray(u,n,a,e),this.buildDrawCalls(u,h,d),h=d,u=r[++o],++a),l._batchEnabled=a,l.touched=s,u.elements[u.count++]=l)}u.count>0&&(i.boundArray(u,n,a,e),this.buildDrawCalls(u,h,this._bufferSize),++o,++a);for(let d=0;d<n.length;d++)n[d]=null;ae._globalBatch=a}buildDrawCalls(t,e,r){const{_bufferedElements:i,_attributeBuffer:n,_indexBuffer:s,vertexSize:a}=this,o=rt._drawCallPool;let u=this._dcIndex,h=this._aIndex,d=this._iIndex,l=o[u];l.start=this._iIndex,l.texArray=t;for(let c=e;c<r;++c){const f=i[c],p=f._texture.baseTexture,m=Gx[p.alphaMode?1:0][f.blendMode];i[c]=null,e<c&&l.blend!==m&&(l.size=d-l.start,e=c,l=o[++u],l.texArray=t,l.start=d),this.packInterleavedGeometry(f,n,s,h,d),h+=f.vertexData.length/2*a,d+=f.indices.length,l.blend=m}e<r&&(l.size=d-l.start,++u),this._dcIndex=u,this._aIndex=h,this._iIndex=d}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:r}=this;rt.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:r}=this.renderer,i=rt._drawCallPool;let n=null;for(let s=0;s<t;s++){const{texArray:a,type:o,size:u,start:h,blend:d}=i[s];n!==a&&(n=a,this.bindAndClearTexArray(a)),this.state.blendMode=d,r.set(this.state),e.drawElements(o,u,e.UNSIGNED_SHORT,h*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),rt.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=sn(Math.ceil(t/8)),r=bu(e),i=e*8;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new Hx(i*this.vertexSize*4)),n}getIndexBuffer(t){const e=sn(Math.ceil(t/12)),r=bu(e),i=e*12;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n}packInterleavedGeometry(t,e,r,i,n){const{uint32View:s,float32View:a}=e,o=i/this.vertexSize,u=t.uvs,h=t.indices,d=t.vertexData,l=t._texture.baseTexture._batchLocation,c=Math.min(t.worldAlpha,1),f=Le.shared.setValue(t._tintRGB).toPremultiplied(c);for(let p=0;p<d.length;p+=2)a[i++]=d[p],a[i++]=d[p+1],a[i++]=u[p],a[i++]=u[p+1],s[i++]=f,a[i++]=l;for(let p=0;p<h.length;p++)r[n++]=o+h[p]}};let it=rt;it.defaultBatchSize=4096,it.extension={name:"batch",type:ee.RendererPlugin},it._drawCallPool=[],it._textureArrayPool=[],fe.add(it);var xb=`varying vec2 vTextureCoord;
377
+ `;const rt=class extends Lu{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=Au,this.vertexSize=6,this.state=sn.for2d(),this.size=rt.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??mb(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??pb(),this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return re("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return vb}static get defaultFragmentTemplate(){return gb}setShaderGenerator({vertex:t=rt.defaultVertexSrc,fragment:e=rt.defaultFragmentTemplate}={}){this.shaderGenerator=new db(t,e)}contextChange(){const t=this.renderer.gl;Q.PREFER_ENV===$t.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),rt.defaultMaxTextures),this.maxTextures=Vx(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:t,_textureArrayPool:e}=rt,r=this.size/4,i=Math.floor(r/this.maxTextures)+1;for(;t.length<r;)t.push(new aa);for(;e.length<i;)e.push(new fa);for(let n=0;n<this.maxTextures;n++)this._tempBoundTextures[n]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.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,r=rt._textureArrayPool,i=this.renderer.batch,n=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++ae._globalBatch,o=0,u=r[0],h=0;i.copyBoundTextures(n,e);for(let d=0;d<this._bufferSize;++d){const l=t[d];t[d]=null,l._batchEnabled!==a&&(u.count>=e&&(i.boundArray(u,n,a,e),this.buildDrawCalls(u,h,d),h=d,u=r[++o],++a),l._batchEnabled=a,l.touched=s,u.elements[u.count++]=l)}u.count>0&&(i.boundArray(u,n,a,e),this.buildDrawCalls(u,h,this._bufferSize),++o,++a);for(let d=0;d<n.length;d++)n[d]=null;ae._globalBatch=a}buildDrawCalls(t,e,r){const{_bufferedElements:i,_attributeBuffer:n,_indexBuffer:s,vertexSize:a}=this,o=rt._drawCallPool;let u=this._dcIndex,h=this._aIndex,d=this._iIndex,l=o[u];l.start=this._iIndex,l.texArray=t;for(let c=e;c<r;++c){const f=i[c],p=f._texture.baseTexture,m=Ux[p.alphaMode?1:0][f.blendMode];i[c]=null,e<c&&l.blend!==m&&(l.size=d-l.start,e=c,l=o[++u],l.texArray=t,l.start=d),this.packInterleavedGeometry(f,n,s,h,d),h+=f.vertexData.length/2*a,d+=f.indices.length,l.blend=m}e<r&&(l.size=d-l.start,++u),this._dcIndex=u,this._aIndex=h,this._iIndex=d}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:r}=this;rt.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:r}=this.renderer,i=rt._drawCallPool;let n=null;for(let s=0;s<t;s++){const{texArray:a,type:o,size:u,start:h,blend:d}=i[s];n!==a&&(n=a,this.bindAndClearTexArray(a)),this.state.blendMode=d,r.set(this.state),e.drawElements(o,u,e.UNSIGNED_SHORT,h*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),rt.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=tn(Math.ceil(t/8)),r=yu(e),i=e*8;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new zx(i*this.vertexSize*4)),n}getIndexBuffer(t){const e=tn(Math.ceil(t/12)),r=yu(e),i=e*12;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n}packInterleavedGeometry(t,e,r,i,n){const{uint32View:s,float32View:a}=e,o=i/this.vertexSize,u=t.uvs,h=t.indices,d=t.vertexData,l=t._texture.baseTexture._batchLocation,c=Math.min(t.worldAlpha,1),f=Le.shared.setValue(t._tintRGB).toPremultiplied(c);for(let p=0;p<d.length;p+=2)a[i++]=d[p],a[i++]=d[p+1],a[i++]=u[p],a[i++]=u[p+1],s[i++]=f,a[i++]=l;for(let p=0;p<h.length;p++)r[n++]=o+h[p]}};let it=rt;it.defaultBatchSize=4096,it.extension={name:"batch",type:ee.RendererPlugin},it._drawCallPool=[],it._textureArrayPool=[],he.add(it);var _b=`varying vec2 vTextureCoord;
378
378
 
379
379
  uniform sampler2D uSampler;
380
380
 
381
381
  void main(void){
382
382
  gl_FragColor = texture2D(uSampler, vTextureCoord);
383
383
  }
384
- `,bb=`attribute vec2 aVertexPosition;
384
+ `,yb=`attribute vec2 aVertexPosition;
385
385
 
386
386
  uniform mat3 projectionMatrix;
387
387
 
@@ -407,7 +407,7 @@ void main(void)
407
407
  gl_Position = filterVertexPosition();
408
408
  vTextureCoord = filterTextureCoord();
409
409
  }
410
- `;const di=class extends fi{constructor(t,e,r){const i=Tt.from(t||di.defaultVertexSrc,e||di.defaultFragmentSrc);super(i,r),this.padding=0,this.resolution=di.defaultResolution,this.multisample=di.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new ln}apply(t,e,r,i,n){t.applyFilter(this,e,r,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return bb}static get defaultFragmentSrc(){return xb}};let ue=di;ue.defaultResolution=1,ue.defaultMultisample=Ae.NONE;class gn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Le(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:i,backgroundAlpha:n}=e,s=i??r;s!==void 0&&(this.color=s),this.alpha=n}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}gn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},gn.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"background"},fe.add(gn);class Uu{constructor(e){this.renderer=e,this.emptyRenderer=new Bu(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:i}=this.renderer.texture;for(let n=r-1;n>=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,r,i,n){const{elements:s,ids:a,count:o}=e;let u=0;for(let h=0;h<o;h++){const d=s[h],l=d._batchLocation;if(l>=0&&l<n&&r[l]===d){a[h]=l;continue}for(;u<n;){const c=r[u];if(c&&c._batchEnabled===i&&c._batchLocation===u){u++;continue}a[h]=u,d._batchLocation=u,r[u]=d;break}}}destroy(){this.renderer=null}}Uu.extension={type:ee.RendererSystem,name:"batch"},fe.add(Uu);let $u=0;class vn{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=$u++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,i=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:i,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=$u++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let i;if(Z.PREFER_ENV>=zt.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}vn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},vn.extension={type:ee.RendererSystem,name:"context"},fe.add(vn);class Tb extends ua{upload(e,r,i){const n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Pt.UNPACK);const s=r.realWidth,a=r.realHeight;return i.width===s&&i.height===a?n.texSubImage2D(r.target,0,0,0,s,a,r.format,i.type,this.data):(i.width=s,i.height=a,n.texImage2D(r.target,0,i.internalFormat,s,a,0,r.format,i.type,this.data)),!0}}class va{constructor(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),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 et("disposeFramebuffer"),this.multisample=Ae.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new ae(null,{scaleMode:dt.NEAREST,resolution:1,mipmap:jt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new ae(new Tb(null,{width:this.width,height:this.height}),{scaleMode:dt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:jt.OFF,format:N.DEPTH_COMPONENT,type:se.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(e,r){if(e=Math.round(e),r=Math.round(r),!(e===this.width&&r===this.height)){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let i=0;i<this.colorTextures.length;i++){const n=this.colorTextures[i],s=n.resolution;n.setSize(e/s,r/s)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(e/i,r/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class Gu extends ae{constructor(e={}){if(typeof e=="number"){const r=arguments[0],i=arguments[1],n=arguments[2],s=arguments[3];e={width:r,height:i,scaleMode:n,resolution:s}}e.width=e.width||100,e.height=e.height||100,e.multisample??(e.multisample=Ae.NONE),super(null,e),this.mipmap=jt.OFF,this.valid=!0,this._clear=new Le([0,0,0,0]),this.framebuffer=new va(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class kt extends li{constructor(e){const r=e,i=r.naturalWidth||r.videoWidth||r.width,n=r.naturalHeight||r.videoHeight||r.height;super(i,n),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,i){i===void 0&&!r.startsWith("data:")?e.crossOrigin=jx(r):i!==!1&&(e.crossOrigin=typeof i=="string"?i:"anonymous")}upload(e,r,i,n){const s=e.gl,a=r.realWidth,o=r.realHeight;if(n=n||this.source,typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement){if(!n.complete||n.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement&&n.readyState<=1&&n.buffered.length===0)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Pt.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&i.width===a&&i.height===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,i.type,n):(i.width=a,i.height=o,s.texImage2D(r.target,0,i.internalFormat,r.format,i.type,n)),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),super.update()}dispose(){this.source=null}}class zu extends kt{constructor(e,r){if(r=r||{},typeof e=="string"){const i=new Image;kt.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??Z.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,i)=>{const n=this.source;this.url=n.src;const s=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.resize(n.width,n.height),this._load=null,this.createBitmap?r(this.process()):r(this))};n.complete&&n.src?s():(n.onload=s,n.onerror=a=>{i(a),this.onError.emit(a)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>r(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Pt.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,i){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,i,this.bitmap),!this.preserveBitmap){let n=!0;const s=r._glTextures;for(const a in s){const o=s[a];if(o!==i&&o.dirtyId!==r.dirtyId){n=!1;break}}n&&(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(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class ju{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(e,r,i){const n=r.width,s=r.height;if(i){const a=e.width/2/n,o=e.height/2/s,u=e.x/n+a,h=e.y/s+o;i=be.add(i,be.NW),this.x0=u+a*be.uX(i),this.y0=h+o*be.uY(i),i=be.add(i,2),this.x1=u+a*be.uX(i),this.y1=h+o*be.uY(i),i=be.add(i,2),this.x2=u+a*be.uX(i),this.y2=h+o*be.uY(i),i=be.add(i,2),this.x3=u+a*be.uX(i),this.y3=h+o*be.uY(i)}else this.x0=e.x/n,this.y0=e.y/s,this.x1=(e.x+e.width)/n,this.y1=e.y/s,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/s,this.x3=e.x/n,this.y3=(e.y+e.height)/s;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}toString(){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 Hu=new ju;function _n(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class ie extends Gi{constructor(e,r,i,n,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new pe(0,0,1,1)),e instanceof ie&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=n,this.valid=!1,this._uvs=Hu,this.uvMatrix=null,this.orig=i||r,this._rotate=Number(s||0),s===!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 ge(a.x,a.y):new ge(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&_t[r.url]&&ie.removeFromCache(r.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,ie.removeFromCache(this),this.textureCacheIds=null}clone(){var n;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),i=new ie(this.baseTexture,!this.noFrame&&e,r,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===Hu&&(this._uvs=new ju),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},i=Z.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let s=null;if(n)s=e;else if(e instanceof ae){if(!e.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${o}-${oi()}`,ae.addToCache(e,e.cacheId)}s=e.cacheId}else{if(!e._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${oi()}`}s=e._pixiId}let a=_t[s];if(n&&i&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(e instanceof ae)?(r.resolution||(r.resolution=wu(e)),a=new ie(new ae(e,r)),a.baseTexture.cacheId=s,ae.addToCache(a.baseTexture,s),ie.addToCache(a,s)):!a&&e instanceof ae&&(a=new ie(e),ie.addToCache(a,s)),a}static fromURL(e,r){const i=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),n=ie.from(e,Object.assign({resourceOptions:i},r),!1),s=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):s.load().then(()=>Promise.resolve(n))}static fromBuffer(e,r,i,n){return new ie(ae.fromBuffer(e,r,i,n))}static fromLoader(e,r,i,n){const s=new ae(e,Object.assign({scaleMode:ae.defaultOptions.scaleMode,resolution:wu(r)},n)),{resource:a}=s;a instanceof zu&&(a.url=r);const o=new ie(s);return i||(i=r),ae.addToCache(o.baseTexture,i),ie.addToCache(o,i),i!==r&&(ae.addToCache(o.baseTexture,r),ie.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(u=>{o.baseTexture.once("loaded",()=>u(o))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),_t[r]&&_t[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),_t[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=_t[e];if(r){const i=r.textureCacheIds.indexOf(e);return i>-1&&r.textureCacheIds.splice(i,1),delete _t[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)_t[e.textureCacheIds[r]]===e&&delete _t[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:i,width:n,height:s}=e,a=r+n>this.baseTexture.width,o=i+s>this.baseTexture.height;if(a||o){const u=a&&o?"and":"or",h=`X: ${r} + ${n} = ${r+n} > ${this.baseTexture.width}`,d=`Y: ${i} + ${s} = ${i+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${h} ${u} ${d}`)}this.valid=n&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return ie._EMPTY||(ie._EMPTY=new ie(new ae),_n(ie._EMPTY),_n(ie._EMPTY.baseTexture)),ie._EMPTY}static get WHITE(){if(!ie._WHITE){const e=Z.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),ie._WHITE=new ie(ae.from(e)),_n(ie._WHITE),_n(ie._WHITE.baseTexture)}return ie._WHITE}}class yn extends ie{constructor(e,r){super(e,r),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(e){this.framebuffer.multisample=e}resize(e,r,i=!0){const n=this.baseTexture.resolution,s=Math.round(e*n)/n,a=Math.round(r*n)/n;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(s,a),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new yn(new Gu(e))}}class Vu{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,i=Ae.NONE){const n=new Gu(Object.assign({width:e,height:r,resolution:1,multisample:i},this.textureOptions));return new yn(n)}getOptimalTexture(e,r,i=1,n=Ae.NONE){let s;e=Math.ceil(e*i-1e-6),r=Math.ceil(r*i-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||r!==this._pixelsHeight?(e=sn(e),r=sn(r),s=((e&65535)<<16|r&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);let a=this.texturePool[s].pop();return a||(a=this.createTexture(e,r,n)),a.filterPoolKey=s,a.setResolution(i),a}getFilterTexture(e,r,i){const n=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||Ae.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const r in this.texturePool){const i=this.texturePool[r];if(i)for(let n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const i=this.texturePool[r];if(i)for(let n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}Vu.SCREEN_KEY=-1;class wb extends Ir{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class Sb extends Ir{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Ue(this.vertices),this.uvBuffer=new Ue(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let i=0,n=0;return this.uvs[0]=i,this.uvs[1]=n,this.uvs[2]=i+r.width/e.width,this.uvs[3]=n,this.uvs[4]=i+r.width/e.width,this.uvs[5]=n+r.height/e.height,this.uvs[6]=i,this.uvs[7]=n+r.height/e.height,i=r.x,n=r.y,this.vertices[0]=i,this.vertices[1]=n,this.vertices[2]=i+r.width,this.vertices[3]=n,this.vertices[4]=i+r.width,this.vertices[5]=n+r.height,this.vertices[6]=i,this.vertices[7]=n+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class Ab{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ae.NONE,this.sourceFrame=new pe,this.destinationFrame=new pe,this.bindingSourceFrame=new pe,this.bindingDestinationFrame=new pe,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const xn=[new ge,new ge,new ge,new ge],_a=new $e;class Xu{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new Vu,this.statePool=[],this.quad=new wb,this.quadUv=new Sb,this.tempRect=new pe,this.activeState={},this.globalUniforms=new tt({outputFrame:new pe,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const i=this.renderer,n=this.defaultFilterStack,s=this.statePool.pop()||new Ab,a=this.renderer.renderTexture;let o=r[0].resolution,u=r[0].multisample,h=r[0].padding,d=r[0].autoFit,l=r[0].legacy??!0;for(let p=1;p<r.length;p++){const m=r[p];o=Math.min(o,m.resolution),u=Math.min(u,m.multisample),h=this.useMaxPadding?Math.max(h,m.padding):h+m.padding,d=d&&m.autoFit,l=l||(m.legacy??!0)}n.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),n.push(s),s.resolution=o,s.multisample=u,s.legacy=l,s.target=e,s.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),s.sourceFrame.pad(h);const c=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(_a.copyFrom(i.projection.transform).invert(),c),d?(s.sourceFrame.fit(c),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(c)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,o,u),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const f=this.tempRect;f.x=0,f.y=0,f.width=s.sourceFrame.width,f.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=i.projection.transform,i.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,f),i.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),i=r.filters;this.activeState=r;const n=this.globalUniforms.uniforms;n.outputFrame=r.sourceFrame,n.resolution=r.resolution;const s=n.inputSize,a=n.inputPixel,o=n.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*r.resolution),a[1]=Math.round(s[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*s[2]-.5*a[2],o[3]=r.sourceFrame.height*s[3]-.5*a[3],r.legacy){const h=n.filterArea;h[0]=r.destinationFrame.width,h[1]=r.destinationFrame.height,h[2]=r.sourceFrame.x,h[3]=r.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();const u=e[e.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,r.renderTexture,u.renderTexture,Ht.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let h=r.renderTexture,d=this.getOptimalFilterTexture(h.width,h.height,r.resolution);d.filterFrame=h.filterFrame;let l=0;for(l=0;l<i.length-1;++l){l===1&&r.multisample>1&&(d=this.getOptimalFilterTexture(h.width,h.height,r.resolution),d.filterFrame=h.filterFrame),i[l].apply(this,h,d,Ht.CLEAR,r);const c=h;h=d,d=c}i[l].apply(this,h,u.renderTexture,Ht.BLEND,r),l>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=Ht.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e!=null&&e.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,i.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=n.stateId&1||this.forceClear;(r===Ht.CLEAR||r===Ht.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,i,n){const s=this.renderer;s.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Rt.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Rt.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:s}=r._texture,a=e.set(n.width,0,0,n.height,i.x,i.y),o=r.worldTransform.copyTo($e.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/s.width,1/s.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,i=1,n=Ae.NONE){return this.texturePool.getOptimalTexture(e,r,i,n)}getFilterTexture(e,r,i){if(typeof e=="number"){const s=e;e=r,r=s}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||Ae.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const i=xn[0],n=xn[1],s=xn[2],a=xn[3];i.set(r.left,r.top),n.set(r.left,r.bottom),s.set(r.right,r.top),a.set(r.right,r.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(a,a);const o=Math.min(i.x,n.x,s.x,a.x),u=Math.min(i.y,n.y,s.y,a.y),h=Math.max(i.x,n.x,s.x,a.x),d=Math.max(i.y,n.y,s.y,a.y);r.x=o,r.y=u,r.width=h-o,r.height=d-u}roundFrame(e,r,i,n,s){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(s){const{a,b:o,c:u,d:h}=s;if((Math.abs(o)>1e-4||Math.abs(u)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(h)>1e-4))return}s=s?_a.copyFrom(s):_a.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,e),e.ceil(r),this.transformAABB(s.invert(),e)}}}Xu.extension={type:ee.RendererSystem,name:"filter"},fe.add(Xu);class Eb{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ae.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Cb=new pe;class Wu{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new va(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new pe,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Z.PREFER_ENV===zt.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=n=>r.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,i=0){const{gl:n}=this;if(e){const s=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,s.mipLevel=i),s.dirtyId!==e.dirtyId&&(s.dirtyId=e.dirtyId,s.dirtyFormat!==e.dirtyFormat?(s.dirtyFormat=e.dirtyFormat,s.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):s.dirtySize!==e.dirtySize&&(s.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let a=0;a<e.colorTextures.length;a++){const o=e.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const a=r.width>>i,o=r.height>>i,u=a/r.width;this.setViewport(r.x*u,r.y*u,a,o)}else{const a=e.width>>i,o=e.height>>i;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,i,n){const s=this.viewport;e=Math.round(e),r=Math.round(r),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==e||s.y!==r)&&(s.x=e,s.y=r,s.width=i,s.height=n,this.gl.viewport(e,r,i,n))}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(e,r,i,n,s=fs.COLOR|fs.DEPTH){const{gl:a}=this;a.clearColor(e,r,i,n),a.clear(s)}initFramebuffer(e){const{gl:r}=this,i=new Eb(r.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:r}=this,i=e.glFramebuffers[this.CONTEXT_UID];i.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height));const n=e.colorTextures;let s=n.length;r.drawBuffers||(s=Math.min(s,1));for(let a=0;a<s;a++){const o=n[a],u=o.parentTextureArray||o;this.renderer.texture.bind(u,0),a===0&&i.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,u._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:i}=this,n=e.glFramebuffers[this.CONTEXT_UID],s=e.colorTextures;let a=s.length;i.drawBuffers||(a=Math.min(a,1)),n.multisample>1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const o=[];for(let u=0;u<a;u++){const h=s[u],d=h.parentTextureArray||h;this.renderer.texture.bind(d,0),u===0&&n.msaaBuffer?(i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,d._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+u,h.target,d._glTextures[this.CONTEXT_UID].texture,r),o.push(i.COLOR_ATTACHMENT0+u))}if(o.length>1&&i.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){const h=e.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,r)}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let i=Ae.NONE;if(e<=1||r===null)return i;for(let n=0;n<r.length;n++)if(r[n]<=e){i=r[n];break}return i===1&&(i=Ae.NONE),i}blit(e,r,i){const{current:n,renderer:s,gl:a,CONTEXT_UID:o}=this;if(s.context.webGLVersion!==2||!n)return;const u=n.glFramebuffers[o];if(!u)return;if(!e){if(!u.msaaBuffer)return;const d=n.colorTextures[0];if(!d)return;u.blitFramebuffer||(u.blitFramebuffer=new va(n.width,n.height),u.blitFramebuffer.addColorTexture(0,d)),e=u.blitFramebuffer,e.colorTextures[0]!==d&&(e.colorTextures[0]=d,e.dirtyId++,e.dirtyFormat++),(e.width!==n.width||e.height!==n.height)&&(e.width=n.width,e.height=n.height,e.dirtyId++,e.dirtySize++)}r||(r=Cb,r.width=n.width,r.height=n.height),i||(i=r);const h=r.width===i.width&&r.height===i.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,u.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,i.left,i.top,i.right,i.bottom,a.COLOR_BUFFER_BIT,h?a.NEAREST:a.LINEAR)}disposeFramebuffer(e,r){const i=e.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(!i)return;delete e.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(e);s>=0&&this.managedFramebuffers.splice(s,1),e.disposeRunner.remove(this),r||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<r.length;i++)this.disposeFramebuffer(r[i],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;e.stencil=!0;const i=e.width,n=e.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),r.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new pe}destroy(){this.renderer=null}}Wu.extension={type:ee.RendererSystem,name:"framebuffer"},fe.add(Wu);const ya={5126:4,5123:2,5121:1};class qu{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let i=this.renderer.context.extensions.vertexArrayObject;Z.PREFER_ENV===zt.WEBGL_LEGACY&&(i=null),i?(e.createVertexArray=()=>i.createVertexArrayOES(),e.bindVertexArray=n=>i.bindVertexArrayOES(n),e.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(n,s)=>i.vertexAttribDivisorANGLE(n,s),e.drawElementsInstanced=(n,s,a,o,u)=>i.drawElementsInstancedANGLE(n,s,a,o,u),e.drawArraysInstanced=(n,s,a,o)=>i.drawArraysInstancedANGLE(n,s,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:i}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);const a=n[r.program.id]||this.initGeometryVao(e,r,s);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let i=0;i<e.buffers.length;i++){const n=e.buffers[i];r.update(n)}}checkCompatibility(e,r){const i=e.attributes,n=r.attributeData;for(const s in n)if(!i[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(e,r){const i=e.attributes,n=r.attributeData,s=["g",e.id];for(const a in i)n[a]&&s.push(a,n[a].location);return s.join("-")}initGeometryVao(e,r,i=!0){const n=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,o);const u=this.getSignature(e,o),h=e.glVertexArrayObjects[this.CONTEXT_UID];let d=h[u];if(d)return h[o.id]=d,d;const l=e.buffers,c=e.attributes,f={},p={};for(const m in l)f[m]=0,p[m]=0;for(const m in c)!c[m].size&&o.attributeData[m]?c[m].size=o.attributeData[m].size:c[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),f[c[m].buffer]+=c[m].size*ya[c[m].type];for(const m in c){const v=c[m],g=v.size;v.stride===void 0&&(f[v.buffer]===g*ya[v.type]?v.stride=0:v.stride=f[v.buffer]),v.start===void 0&&(v.start=p[v.buffer],p[v.buffer]+=g*ya[v.type])}d=n.createVertexArray(),n.bindVertexArray(d);for(let m=0;m<l.length;m++){const v=l[m];a.bind(v),i&&v._glBuffers[s].refCount++}return this.activateVao(e,o),h[o.id]=d,h[u]=d,n.bindVertexArray(null),a.unbind(pt.ARRAY_BUFFER),d}disposeGeometry(e,r){var o;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const i=e.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,s=e.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(e.disposeRunner.remove(this),!!i){if(a)for(let u=0;u<s.length;u++){const h=s[u]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&a.dispose(s[u],r))}if(!r){for(const u in i)if(u[0]==="g"){const h=i[u];this._activeVao===h&&this.unbind(),n.deleteVertexArray(h)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let i=0;i<r.length;i++)this.disposeGeometry(this.managedGeometries[r[i]],e)}activateVao(e,r){const i=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let u=null;for(const h in o){const d=o[h],l=a[d.buffer],c=l._glBuffers[n];if(r.attributeData[h]){u!==c&&(s.bind(l),u=c);const f=r.attributeData[h].location;if(i.enableVertexAttribArray(f),i.vertexAttribPointer(f,d.size,d.type||i.FLOAT,d.normalized,d.stride,d.start),d.instance)if(this.hasInstance)i.vertexAttribDivisor(f,d.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,i,n){const{gl:s}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(e,r||a.indexBuffer.data.length,u,(i||0)*o,n||1):s.drawElements(e,r||a.indexBuffer.data.length,u,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(e,i,r||a.getSize(),n||1):s.drawArrays(e,i,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}qu.extension={type:ee.RendererSystem,name:"geometry"},fe.add(qu);const Yu=new $e;class Ib{constructor(e,r){this._texture=e,this.mapCoord=new $e,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const i=this.mapCoord;for(let n=0;n<e.length;n+=2){const s=e[n],a=e[n+1];r[n]=s*i.a+a*i.c+i.tx,r[n+1]=s*i.b+a*i.d+i.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const i=r._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const n=r.orig,s=r.trim;s&&(Yu.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Yu));const a=r.baseTexture,o=this.uClampFrame,u=this.clampMargin/a.resolution,h=this.clampOffset;return o[0]=(r._frame.x+u+h)/a.width,o[1]=(r._frame.y+u+h)/a.height,o[2]=(r._frame.x+r._frame.width-u+h)/a.width,o[3]=(r._frame.y+r._frame.height-u+h)/a.height,this.uClampOffset[0]=h/a.realWidth,this.uClampOffset[1]=h/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var Rb=`varying vec2 vMaskCoord;
410
+ `;const ci=class extends ui{constructor(t,e,r){const i=Tt.from(t||ci.defaultVertexSrc,e||ci.defaultFragmentSrc);super(i,r),this.padding=0,this.resolution=ci.defaultResolution,this.multisample=ci.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new sn}apply(t,e,r,i,n){t.applyFilter(this,e,r,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return yb}static get defaultFragmentSrc(){return _b}};let ue=ci;ue.defaultResolution=1,ue.defaultMultisample=Ae.NONE;class dn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Le(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:i,backgroundAlpha:n}=e,s=i??r;s!==void 0&&(this.color=s),this.alpha=n}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}dn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},dn.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"background"},he.add(dn);class Du{constructor(e){this.renderer=e,this.emptyRenderer=new Lu(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:i}=this.renderer.texture;for(let n=r-1;n>=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,r,i,n){const{elements:s,ids:a,count:o}=e;let u=0;for(let h=0;h<o;h++){const d=s[h],l=d._batchLocation;if(l>=0&&l<n&&r[l]===d){a[h]=l;continue}for(;u<n;){const c=r[u];if(c&&c._batchEnabled===i&&c._batchLocation===u){u++;continue}a[h]=u,d._batchLocation=u,r[u]=d;break}}}destroy(){this.renderer=null}}Du.extension={type:ee.RendererSystem,name:"batch"},he.add(Du);let Bu=0;class pn{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Bu++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,i=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:i,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Bu++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let i;if(Q.PREFER_ENV>=$t.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}pn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},pn.extension={type:ee.RendererSystem,name:"context"},he.add(pn);class xb extends sa{upload(e,r,i){const n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Rt.UNPACK);const s=r.realWidth,a=r.realHeight;return i.width===s&&i.height===a?n.texSubImage2D(r.target,0,0,0,s,a,r.format,i.type,this.data):(i.width=s,i.height=a,n.texImage2D(r.target,0,i.internalFormat,s,a,0,r.format,i.type,this.data)),!0}}class da{constructor(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),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 et("disposeFramebuffer"),this.multisample=Ae.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new ae(null,{scaleMode:dt.NEAREST,resolution:1,mipmap:Gt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new ae(new xb(null,{width:this.width,height:this.height}),{scaleMode:dt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Gt.OFF,format:N.DEPTH_COMPONENT,type:se.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(e,r){if(e=Math.round(e),r=Math.round(r),!(e===this.width&&r===this.height)){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let i=0;i<this.colorTextures.length;i++){const n=this.colorTextures[i],s=n.resolution;n.setSize(e/s,r/s)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(e/i,r/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class Uu extends ae{constructor(e={}){if(typeof e=="number"){const r=arguments[0],i=arguments[1],n=arguments[2],s=arguments[3];e={width:r,height:i,scaleMode:n,resolution:s}}e.width=e.width||100,e.height=e.height||100,e.multisample??(e.multisample=Ae.NONE),super(null,e),this.mipmap=Gt.OFF,this.valid=!0,this._clear=new Le([0,0,0,0]),this.framebuffer=new da(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Nt extends si{constructor(e){const r=e,i=r.naturalWidth||r.videoWidth||r.width,n=r.naturalHeight||r.videoHeight||r.height;super(i,n),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,i){i===void 0&&!r.startsWith("data:")?e.crossOrigin=Gx(r):i!==!1&&(e.crossOrigin=typeof i=="string"?i:"anonymous")}upload(e,r,i,n){const s=e.gl,a=r.realWidth,o=r.realHeight;if(n=n||this.source,typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement){if(!n.complete||n.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement&&n.readyState<=1&&n.buffered.length===0)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Rt.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&i.width===a&&i.height===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,i.type,n):(i.width=a,i.height=o,s.texImage2D(r.target,0,i.internalFormat,r.format,i.type,n)),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),super.update()}dispose(){this.source=null}}class $u extends Nt{constructor(e,r){if(r=r||{},typeof e=="string"){const i=new Image;Nt.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??Q.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,i)=>{const n=this.source;this.url=n.src;const s=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.resize(n.width,n.height),this._load=null,this.createBitmap?r(this.process()):r(this))};n.complete&&n.src?s():(n.onload=s,n.onerror=a=>{i(a),this.onError.emit(a)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>r(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Rt.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,i){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,i,this.bitmap),!this.preserveBitmap){let n=!0;const s=r._glTextures;for(const a in s){const o=s[a];if(o!==i&&o.dirtyId!==r.dirtyId){n=!1;break}}n&&(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(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class Gu{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(e,r,i){const n=r.width,s=r.height;if(i){const a=e.width/2/n,o=e.height/2/s,u=e.x/n+a,h=e.y/s+o;i=be.add(i,be.NW),this.x0=u+a*be.uX(i),this.y0=h+o*be.uY(i),i=be.add(i,2),this.x1=u+a*be.uX(i),this.y1=h+o*be.uY(i),i=be.add(i,2),this.x2=u+a*be.uX(i),this.y2=h+o*be.uY(i),i=be.add(i,2),this.x3=u+a*be.uX(i),this.y3=h+o*be.uY(i)}else this.x0=e.x/n,this.y0=e.y/s,this.x1=(e.x+e.width)/n,this.y1=e.y/s,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/s,this.x3=e.x/n,this.y3=(e.y+e.height)/s;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}toString(){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 zu=new Gu;function mn(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class ie extends Bi{constructor(e,r,i,n,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new de(0,0,1,1)),e instanceof ie&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=n,this.valid=!1,this._uvs=zu,this.uvMatrix=null,this.orig=i||r,this._rotate=Number(s||0),s===!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 me(a.x,a.y):new me(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&_t[r.url]&&ie.removeFromCache(r.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,ie.removeFromCache(this),this.textureCacheIds=null}clone(){var n;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),i=new ie(this.baseTexture,!this.noFrame&&e,r,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===zu&&(this._uvs=new Gu),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},i=Q.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let s=null;if(n)s=e;else if(e instanceof ae){if(!e.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${o}-${ni()}`,ae.addToCache(e,e.cacheId)}s=e.cacheId}else{if(!e._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${ni()}`}s=e._pixiId}let a=_t[s];if(n&&i&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(e instanceof ae)?(r.resolution||(r.resolution=bu(e)),a=new ie(new ae(e,r)),a.baseTexture.cacheId=s,ae.addToCache(a.baseTexture,s),ie.addToCache(a,s)):!a&&e instanceof ae&&(a=new ie(e),ie.addToCache(a,s)),a}static fromURL(e,r){const i=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),n=ie.from(e,Object.assign({resourceOptions:i},r),!1),s=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):s.load().then(()=>Promise.resolve(n))}static fromBuffer(e,r,i,n){return new ie(ae.fromBuffer(e,r,i,n))}static fromLoader(e,r,i,n){const s=new ae(e,Object.assign({scaleMode:ae.defaultOptions.scaleMode,resolution:bu(r)},n)),{resource:a}=s;a instanceof $u&&(a.url=r);const o=new ie(s);return i||(i=r),ae.addToCache(o.baseTexture,i),ie.addToCache(o,i),i!==r&&(ae.addToCache(o.baseTexture,r),ie.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(u=>{o.baseTexture.once("loaded",()=>u(o))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),_t[r]&&_t[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),_t[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=_t[e];if(r){const i=r.textureCacheIds.indexOf(e);return i>-1&&r.textureCacheIds.splice(i,1),delete _t[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)_t[e.textureCacheIds[r]]===e&&delete _t[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:i,width:n,height:s}=e,a=r+n>this.baseTexture.width,o=i+s>this.baseTexture.height;if(a||o){const u=a&&o?"and":"or",h=`X: ${r} + ${n} = ${r+n} > ${this.baseTexture.width}`,d=`Y: ${i} + ${s} = ${i+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${h} ${u} ${d}`)}this.valid=n&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return ie._EMPTY||(ie._EMPTY=new ie(new ae),mn(ie._EMPTY),mn(ie._EMPTY.baseTexture)),ie._EMPTY}static get WHITE(){if(!ie._WHITE){const e=Q.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),ie._WHITE=new ie(ae.from(e)),mn(ie._WHITE),mn(ie._WHITE.baseTexture)}return ie._WHITE}}class gn extends ie{constructor(e,r){super(e,r),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(e){this.framebuffer.multisample=e}resize(e,r,i=!0){const n=this.baseTexture.resolution,s=Math.round(e*n)/n,a=Math.round(r*n)/n;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(s,a),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new gn(new Uu(e))}}class ju{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,i=Ae.NONE){const n=new Uu(Object.assign({width:e,height:r,resolution:1,multisample:i},this.textureOptions));return new gn(n)}getOptimalTexture(e,r,i=1,n=Ae.NONE){let s;e=Math.ceil(e*i-1e-6),r=Math.ceil(r*i-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||r!==this._pixelsHeight?(e=tn(e),r=tn(r),s=((e&65535)<<16|r&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);let a=this.texturePool[s].pop();return a||(a=this.createTexture(e,r,n)),a.filterPoolKey=s,a.setResolution(i),a}getFilterTexture(e,r,i){const n=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||Ae.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const r in this.texturePool){const i=this.texturePool[r];if(i)for(let n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const i=this.texturePool[r];if(i)for(let n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}ju.SCREEN_KEY=-1;class bb extends Er{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class Tb extends Er{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Be(this.vertices),this.uvBuffer=new Be(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let i=0,n=0;return this.uvs[0]=i,this.uvs[1]=n,this.uvs[2]=i+r.width/e.width,this.uvs[3]=n,this.uvs[4]=i+r.width/e.width,this.uvs[5]=n+r.height/e.height,this.uvs[6]=i,this.uvs[7]=n+r.height/e.height,i=r.x,n=r.y,this.vertices[0]=i,this.vertices[1]=n,this.vertices[2]=i+r.width,this.vertices[3]=n,this.vertices[4]=i+r.width,this.vertices[5]=n+r.height,this.vertices[6]=i,this.vertices[7]=n+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class wb{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ae.NONE,this.sourceFrame=new de,this.destinationFrame=new de,this.bindingSourceFrame=new de,this.bindingDestinationFrame=new de,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const vn=[new me,new me,new me,new me],pa=new Ue;class Hu{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new ju,this.statePool=[],this.quad=new bb,this.quadUv=new Tb,this.tempRect=new de,this.activeState={},this.globalUniforms=new tt({outputFrame:new de,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const i=this.renderer,n=this.defaultFilterStack,s=this.statePool.pop()||new wb,a=this.renderer.renderTexture;let o=r[0].resolution,u=r[0].multisample,h=r[0].padding,d=r[0].autoFit,l=r[0].legacy??!0;for(let p=1;p<r.length;p++){const m=r[p];o=Math.min(o,m.resolution),u=Math.min(u,m.multisample),h=this.useMaxPadding?Math.max(h,m.padding):h+m.padding,d=d&&m.autoFit,l=l||(m.legacy??!0)}n.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),n.push(s),s.resolution=o,s.multisample=u,s.legacy=l,s.target=e,s.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),s.sourceFrame.pad(h);const c=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(pa.copyFrom(i.projection.transform).invert(),c),d?(s.sourceFrame.fit(c),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(c)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,o,u),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const f=this.tempRect;f.x=0,f.y=0,f.width=s.sourceFrame.width,f.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=i.projection.transform,i.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,f),i.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),i=r.filters;this.activeState=r;const n=this.globalUniforms.uniforms;n.outputFrame=r.sourceFrame,n.resolution=r.resolution;const s=n.inputSize,a=n.inputPixel,o=n.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*r.resolution),a[1]=Math.round(s[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*s[2]-.5*a[2],o[3]=r.sourceFrame.height*s[3]-.5*a[3],r.legacy){const h=n.filterArea;h[0]=r.destinationFrame.width,h[1]=r.destinationFrame.height,h[2]=r.sourceFrame.x,h[3]=r.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();const u=e[e.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,r.renderTexture,u.renderTexture,zt.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let h=r.renderTexture,d=this.getOptimalFilterTexture(h.width,h.height,r.resolution);d.filterFrame=h.filterFrame;let l=0;for(l=0;l<i.length-1;++l){l===1&&r.multisample>1&&(d=this.getOptimalFilterTexture(h.width,h.height,r.resolution),d.filterFrame=h.filterFrame),i[l].apply(this,h,d,zt.CLEAR,r);const c=h;h=d,d=c}i[l].apply(this,h,u.renderTexture,zt.BLEND,r),l>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=zt.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e!=null&&e.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,i.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=n.stateId&1||this.forceClear;(r===zt.CLEAR||r===zt.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,i,n){const s=this.renderer;s.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(It.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(It.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:s}=r._texture,a=e.set(n.width,0,0,n.height,i.x,i.y),o=r.worldTransform.copyTo(Ue.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/s.width,1/s.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,i=1,n=Ae.NONE){return this.texturePool.getOptimalTexture(e,r,i,n)}getFilterTexture(e,r,i){if(typeof e=="number"){const s=e;e=r,r=s}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||Ae.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const i=vn[0],n=vn[1],s=vn[2],a=vn[3];i.set(r.left,r.top),n.set(r.left,r.bottom),s.set(r.right,r.top),a.set(r.right,r.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(a,a);const o=Math.min(i.x,n.x,s.x,a.x),u=Math.min(i.y,n.y,s.y,a.y),h=Math.max(i.x,n.x,s.x,a.x),d=Math.max(i.y,n.y,s.y,a.y);r.x=o,r.y=u,r.width=h-o,r.height=d-u}roundFrame(e,r,i,n,s){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(s){const{a,b:o,c:u,d:h}=s;if((Math.abs(o)>1e-4||Math.abs(u)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(h)>1e-4))return}s=s?pa.copyFrom(s):pa.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,e),e.ceil(r),this.transformAABB(s.invert(),e)}}}Hu.extension={type:ee.RendererSystem,name:"filter"},he.add(Hu);class Sb{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ae.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Ab=new de;class Vu{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new da(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new de,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Q.PREFER_ENV===$t.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=n=>r.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,i=0){const{gl:n}=this;if(e){const s=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,s.mipLevel=i),s.dirtyId!==e.dirtyId&&(s.dirtyId=e.dirtyId,s.dirtyFormat!==e.dirtyFormat?(s.dirtyFormat=e.dirtyFormat,s.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):s.dirtySize!==e.dirtySize&&(s.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let a=0;a<e.colorTextures.length;a++){const o=e.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const a=r.width>>i,o=r.height>>i,u=a/r.width;this.setViewport(r.x*u,r.y*u,a,o)}else{const a=e.width>>i,o=e.height>>i;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,i,n){const s=this.viewport;e=Math.round(e),r=Math.round(r),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==e||s.y!==r)&&(s.x=e,s.y=r,s.width=i,s.height=n,this.gl.viewport(e,r,i,n))}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(e,r,i,n,s=ls.COLOR|ls.DEPTH){const{gl:a}=this;a.clearColor(e,r,i,n),a.clear(s)}initFramebuffer(e){const{gl:r}=this,i=new Sb(r.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:r}=this,i=e.glFramebuffers[this.CONTEXT_UID];i.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height));const n=e.colorTextures;let s=n.length;r.drawBuffers||(s=Math.min(s,1));for(let a=0;a<s;a++){const o=n[a],u=o.parentTextureArray||o;this.renderer.texture.bind(u,0),a===0&&i.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,u._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:i}=this,n=e.glFramebuffers[this.CONTEXT_UID],s=e.colorTextures;let a=s.length;i.drawBuffers||(a=Math.min(a,1)),n.multisample>1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const o=[];for(let u=0;u<a;u++){const h=s[u],d=h.parentTextureArray||h;this.renderer.texture.bind(d,0),u===0&&n.msaaBuffer?(i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,d._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+u,h.target,d._glTextures[this.CONTEXT_UID].texture,r),o.push(i.COLOR_ATTACHMENT0+u))}if(o.length>1&&i.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){const h=e.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,r)}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let i=Ae.NONE;if(e<=1||r===null)return i;for(let n=0;n<r.length;n++)if(r[n]<=e){i=r[n];break}return i===1&&(i=Ae.NONE),i}blit(e,r,i){const{current:n,renderer:s,gl:a,CONTEXT_UID:o}=this;if(s.context.webGLVersion!==2||!n)return;const u=n.glFramebuffers[o];if(!u)return;if(!e){if(!u.msaaBuffer)return;const d=n.colorTextures[0];if(!d)return;u.blitFramebuffer||(u.blitFramebuffer=new da(n.width,n.height),u.blitFramebuffer.addColorTexture(0,d)),e=u.blitFramebuffer,e.colorTextures[0]!==d&&(e.colorTextures[0]=d,e.dirtyId++,e.dirtyFormat++),(e.width!==n.width||e.height!==n.height)&&(e.width=n.width,e.height=n.height,e.dirtyId++,e.dirtySize++)}r||(r=Ab,r.width=n.width,r.height=n.height),i||(i=r);const h=r.width===i.width&&r.height===i.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,u.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,i.left,i.top,i.right,i.bottom,a.COLOR_BUFFER_BIT,h?a.NEAREST:a.LINEAR)}disposeFramebuffer(e,r){const i=e.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(!i)return;delete e.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(e);s>=0&&this.managedFramebuffers.splice(s,1),e.disposeRunner.remove(this),r||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<r.length;i++)this.disposeFramebuffer(r[i],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;e.stencil=!0;const i=e.width,n=e.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),r.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new de}destroy(){this.renderer=null}}Vu.extension={type:ee.RendererSystem,name:"framebuffer"},he.add(Vu);const ma={5126:4,5123:2,5121:1};class Xu{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let i=this.renderer.context.extensions.vertexArrayObject;Q.PREFER_ENV===$t.WEBGL_LEGACY&&(i=null),i?(e.createVertexArray=()=>i.createVertexArrayOES(),e.bindVertexArray=n=>i.bindVertexArrayOES(n),e.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(n,s)=>i.vertexAttribDivisorANGLE(n,s),e.drawElementsInstanced=(n,s,a,o,u)=>i.drawElementsInstancedANGLE(n,s,a,o,u),e.drawArraysInstanced=(n,s,a,o)=>i.drawArraysInstancedANGLE(n,s,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:i}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);const a=n[r.program.id]||this.initGeometryVao(e,r,s);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let i=0;i<e.buffers.length;i++){const n=e.buffers[i];r.update(n)}}checkCompatibility(e,r){const i=e.attributes,n=r.attributeData;for(const s in n)if(!i[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(e,r){const i=e.attributes,n=r.attributeData,s=["g",e.id];for(const a in i)n[a]&&s.push(a,n[a].location);return s.join("-")}initGeometryVao(e,r,i=!0){const n=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,o);const u=this.getSignature(e,o),h=e.glVertexArrayObjects[this.CONTEXT_UID];let d=h[u];if(d)return h[o.id]=d,d;const l=e.buffers,c=e.attributes,f={},p={};for(const m in l)f[m]=0,p[m]=0;for(const m in c)!c[m].size&&o.attributeData[m]?c[m].size=o.attributeData[m].size:c[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),f[c[m].buffer]+=c[m].size*ma[c[m].type];for(const m in c){const v=c[m],g=v.size;v.stride===void 0&&(f[v.buffer]===g*ma[v.type]?v.stride=0:v.stride=f[v.buffer]),v.start===void 0&&(v.start=p[v.buffer],p[v.buffer]+=g*ma[v.type])}d=n.createVertexArray(),n.bindVertexArray(d);for(let m=0;m<l.length;m++){const v=l[m];a.bind(v),i&&v._glBuffers[s].refCount++}return this.activateVao(e,o),h[o.id]=d,h[u]=d,n.bindVertexArray(null),a.unbind(pt.ARRAY_BUFFER),d}disposeGeometry(e,r){var o;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const i=e.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,s=e.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(e.disposeRunner.remove(this),!!i){if(a)for(let u=0;u<s.length;u++){const h=s[u]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&a.dispose(s[u],r))}if(!r){for(const u in i)if(u[0]==="g"){const h=i[u];this._activeVao===h&&this.unbind(),n.deleteVertexArray(h)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let i=0;i<r.length;i++)this.disposeGeometry(this.managedGeometries[r[i]],e)}activateVao(e,r){const i=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let u=null;for(const h in o){const d=o[h],l=a[d.buffer],c=l._glBuffers[n];if(r.attributeData[h]){u!==c&&(s.bind(l),u=c);const f=r.attributeData[h].location;if(i.enableVertexAttribArray(f),i.vertexAttribPointer(f,d.size,d.type||i.FLOAT,d.normalized,d.stride,d.start),d.instance)if(this.hasInstance)i.vertexAttribDivisor(f,d.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,i,n){const{gl:s}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(e,r||a.indexBuffer.data.length,u,(i||0)*o,n||1):s.drawElements(e,r||a.indexBuffer.data.length,u,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(e,i,r||a.getSize(),n||1):s.drawArrays(e,i,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Xu.extension={type:ee.RendererSystem,name:"geometry"},he.add(Xu);const Wu=new Ue;class Eb{constructor(e,r){this._texture=e,this.mapCoord=new Ue,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const i=this.mapCoord;for(let n=0;n<e.length;n+=2){const s=e[n],a=e[n+1];r[n]=s*i.a+a*i.c+i.tx,r[n+1]=s*i.b+a*i.d+i.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const i=r._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const n=r.orig,s=r.trim;s&&(Wu.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Wu));const a=r.baseTexture,o=this.uClampFrame,u=this.clampMargin/a.resolution,h=this.clampOffset;return o[0]=(r._frame.x+u+h)/a.width,o[1]=(r._frame.y+u+h)/a.height,o[2]=(r._frame.x+r._frame.width-u+h)/a.width,o[3]=(r._frame.y+r._frame.height-u+h)/a.height,this.uClampOffset[0]=h/a.realWidth,this.uClampOffset[1]=h/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var Cb=`varying vec2 vMaskCoord;
411
411
  varying vec2 vTextureCoord;
412
412
 
413
413
  uniform sampler2D uSampler;
@@ -432,7 +432,7 @@ void main(void)
432
432
 
433
433
  gl_FragColor = original;
434
434
  }
435
- `,Pb=`attribute vec2 aVertexPosition;
435
+ `,Ib=`attribute vec2 aVertexPosition;
436
436
  attribute vec2 aTextureCoord;
437
437
 
438
438
  uniform mat3 projectionMatrix;
@@ -448,7 +448,7 @@ void main(void)
448
448
  vTextureCoord = aTextureCoord;
449
449
  vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
450
450
  }
451
- `;class Mb extends ue{constructor(e,r,i){let n=null;typeof e!="string"&&r===void 0&&i===void 0&&(n=e,e=void 0,r=void 0,i=void 0),super(e||Pb,r||Rb,i),this.maskSprite=n,this.maskMatrix=new $e}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,i,n){const s=this._maskSprite,a=s._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new Ib(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,s).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,e.applyFilter(this,r,i,n))}}class Fb{constructor(e=null){this.type=Ee.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=ue.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ee.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class Ku{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let i=r;if(!i.isMaskData){const s=this.maskDataPool.pop()||new Fb;s.pooled=!0,s.maskObject=r,i=s}const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(n),i._colorMask=n?n._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==Ee.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Ee.SCISSOR:this.renderer.scissor.push(i);break;case Ee.STENCIL:this.renderer.stencil.push(i);break;case Ee.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Ee.COLOR:this.pushColorMask(i);break}i.type===Ee.SPRITE&&this.maskStack.push(i)}pop(e){const r=this.maskStack.pop();if(!(!r||r._target!==e)){if(r.enabled)switch(r.type){case Ee.SCISSOR:this.renderer.scissor.pop(r);break;case Ee.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ee.SPRITE:this.popSpriteMask(r);break;case Ee.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===Ee.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=Ee.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Ee.SCISSOR:e.type=Ee.STENCIL:e.type=Ee.COLOR}pushSpriteMask(e){const{maskObject:r}=e,i=e._target;let n=e._filters;n||(n=this.alphaMaskPool[this.alphaMaskIndex],n||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new Mb]));const s=this.renderer,a=s.renderTexture;let o,u;if(a.current){const d=a.current;o=e.resolution||d.resolution,u=e.multisample??d.multisample}else o=e.resolution||s.resolution,u=e.multisample??s.multisample;n[0].resolution=o,n[0].multisample=u,n[0].maskSprite=r;const h=i.filterArea;i.filterArea=r.getBounds(!0),s.filter.push(i,n),i.filterArea=h,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,i=e._colorMask=r&e.colorMask;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(e){const r=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}Ku.extension={type:ee.RendererSystem,name:"mask"},fe.add(Ku);class Zu{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Qu=new $e,Ju=[],bn=class extends Zu{constructor(t){super(t),this.glConst=Z.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:r}=t,{renderer:i}=this,n=i.renderTexture,s=r.getBounds(!0,Ju.pop()??new pe);this.roundFrameToPixels(s,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),e&&s.fit(e),t._scissorRectLocal=s}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:n}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||bn.isMatrixRotated(e.worldTransform)||bn.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,e,r,i,n){bn.isMatrixRotated(n)||(n=n?Qu.copyFrom(n):Qu.identity(),n.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(n,t),t.fit(i),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&&Ju.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)}};let ec=bn;ec.extension={type:ee.RendererSystem,name:"scissor"},fe.add(ec);class tc extends Zu{constructor(e){super(e),this.glConst=Z.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const s=e._colorMask;s!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(e._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,r.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}tc.extension={type:ee.RendererSystem,name:"stencil"},fe.add(tc);class rc{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return re("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return re("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return re("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}rc.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"_plugin"},fe.add(rc);class ic{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new $e,this.transform=null}update(e,r,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(e,r,i,n){const s=this.projectionMatrix,a=n?-1:1;s.identity(),s.a=1/r.width*2,s.d=a*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-a-r.y*s.d}setTransform(e){}destroy(){this.renderer=null}}ic.extension={type:ee.RendererSystem,name:"projection"},fe.add(ic);const Ob=new pa;class nc{constructor(e){this.renderer=e,this._tempMatrix=new $e}generateTexture(e,r){const{region:i,...n}=r||{},s=i||e.getLocalBounds(null,!0);s.width===0&&(s.width=1),s.height===0&&(s.height=1);const a=yn.create({width:s.width,height:s.height,...n});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=e.transform;return e.transform=Ob,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=o,a}destroy(){}}nc.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"textureGenerator"},fe.add(nc);const er=new pe,pi=new pe;class sc{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new pe,this.destinationFrame=new pe,this.viewportFrame=new pe}bind(e=null,r,i){const n=this.renderer;this.current=e;let s,a,o;e?(s=e.baseTexture,o=s.resolution,r||(er.width=e.frame.width,er.height=e.frame.height,r=er),i||(pi.x=e.frame.x,pi.y=e.frame.y,pi.width=r.width,pi.height=r.height,i=pi),a=s.framebuffer):(o=n.resolution,r||(er.width=n._view.screen.width,er.height=n._view.screen.height,r=er),i||(i=er,i.width=r.width,i.height=r.height));const u=this.viewportFrame;u.x=i.x*o,u.y=i.y*o,u.width=i.width*o,u.height=i.height*o,e||(u.y=n.view.height-(u.y+u.height)),u.ceil(),this.renderer.framebuffer.bind(a,u),this.renderer.projection.update(i,r,o,!a),e?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(i)}clear(e,r){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=e?Le.shared.setValue(e):i,s=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==a.width||s.height!==a.height;if(o){let{x:u,y:h,width:d,height:l}=this.viewportFrame;u=Math.round(u),h=Math.round(h),d=Math.round(d),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(u,h,d,l)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}sc.extension={type:ee.RendererSystem,name:"renderTexture"},fe.add(sc);class Nb{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function kb(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let n=0;n<i;n++){const s=e.getActiveAttrib(t,n);if(s.name.startsWith("gl_"))continue;const a=Lu(e,s.type),o={type:a,name:s.name,size:Nu(a),location:e.getAttribLocation(t,s.name)};r[s.name]=o}return r}function Lb(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<i;n++){const s=e.getActiveUniform(t,n),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),u=Lu(e,s.type);r[a]={name:a,index:n,type:u,size:s.size,isArray:o,value:Mu(u,s.size)}}return r}function Db(t,e){var u;const r=Pu(t,t.VERTEX_SHADER,e.vertexSrc),i=Pu(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,i);const s=(u=e.extra)==null?void 0:u.transformFeedbackVaryings;if(s&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,s.names,s.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||cb(t,n,r,i),e.attributeData=kb(n,t),e.uniformData=Lb(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const h=Object.keys(e.attributeData);h.sort((d,l)=>d>l?1:-1);for(let d=0;d<h.length;d++)e.attributeData[h[d]].location=d,t.bindAttribLocation(n,d,h[d]);t.linkProgram(n)}t.deleteShader(r),t.deleteShader(i);const a={};for(const h in e.uniformData){const d=e.uniformData[h];a[h]={location:t.getUniformLocation(n,h),value:Mu(d.type,d.size)}}return new Nb(n,a)}function Bb(t,e,r,i,n){r.buffer.update(n)}const Ub={float:`
451
+ `;class Rb extends ue{constructor(e,r,i){let n=null;typeof e!="string"&&r===void 0&&i===void 0&&(n=e,e=void 0,r=void 0,i=void 0),super(e||Ib,r||Cb,i),this.maskSprite=n,this.maskMatrix=new Ue}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,i,n){const s=this._maskSprite,a=s._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new Eb(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,s).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,e.applyFilter(this,r,i,n))}}class Pb{constructor(e=null){this.type=Ee.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=ue.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ee.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class qu{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let i=r;if(!i.isMaskData){const s=this.maskDataPool.pop()||new Pb;s.pooled=!0,s.maskObject=r,i=s}const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(n),i._colorMask=n?n._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==Ee.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Ee.SCISSOR:this.renderer.scissor.push(i);break;case Ee.STENCIL:this.renderer.stencil.push(i);break;case Ee.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Ee.COLOR:this.pushColorMask(i);break}i.type===Ee.SPRITE&&this.maskStack.push(i)}pop(e){const r=this.maskStack.pop();if(!(!r||r._target!==e)){if(r.enabled)switch(r.type){case Ee.SCISSOR:this.renderer.scissor.pop(r);break;case Ee.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ee.SPRITE:this.popSpriteMask(r);break;case Ee.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===Ee.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=Ee.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Ee.SCISSOR:e.type=Ee.STENCIL:e.type=Ee.COLOR}pushSpriteMask(e){const{maskObject:r}=e,i=e._target;let n=e._filters;n||(n=this.alphaMaskPool[this.alphaMaskIndex],n||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new Rb]));const s=this.renderer,a=s.renderTexture;let o,u;if(a.current){const d=a.current;o=e.resolution||d.resolution,u=e.multisample??d.multisample}else o=e.resolution||s.resolution,u=e.multisample??s.multisample;n[0].resolution=o,n[0].multisample=u,n[0].maskSprite=r;const h=i.filterArea;i.filterArea=r.getBounds(!0),s.filter.push(i,n),i.filterArea=h,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,i=e._colorMask=r&e.colorMask;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(e){const r=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}qu.extension={type:ee.RendererSystem,name:"mask"},he.add(qu);class Yu{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Ku=new Ue,Zu=[],_n=class extends Yu{constructor(t){super(t),this.glConst=Q.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:r}=t,{renderer:i}=this,n=i.renderTexture,s=r.getBounds(!0,Zu.pop()??new de);this.roundFrameToPixels(s,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),e&&s.fit(e),t._scissorRectLocal=s}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:n}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||_n.isMatrixRotated(e.worldTransform)||_n.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,e,r,i,n){_n.isMatrixRotated(n)||(n=n?Ku.copyFrom(n):Ku.identity(),n.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(n,t),t.fit(i),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&&Zu.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)}};let Qu=_n;Qu.extension={type:ee.RendererSystem,name:"scissor"},he.add(Qu);class Ju extends Yu{constructor(e){super(e),this.glConst=Q.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const s=e._colorMask;s!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(e._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,r.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}Ju.extension={type:ee.RendererSystem,name:"stencil"},he.add(Ju);class ec{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return re("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return re("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return re("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}ec.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"_plugin"},he.add(ec);class tc{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ue,this.transform=null}update(e,r,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(e,r,i,n){const s=this.projectionMatrix,a=n?-1:1;s.identity(),s.a=1/r.width*2,s.d=a*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-a-r.y*s.d}setTransform(e){}destroy(){this.renderer=null}}tc.extension={type:ee.RendererSystem,name:"projection"},he.add(tc);const Mb=new ca;class rc{constructor(e){this.renderer=e,this._tempMatrix=new Ue}generateTexture(e,r){const{region:i,...n}=r||{},s=i||e.getLocalBounds(null,!0);s.width===0&&(s.width=1),s.height===0&&(s.height=1);const a=gn.create({width:s.width,height:s.height,...n});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=e.transform;return e.transform=Mb,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=o,a}destroy(){}}rc.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"textureGenerator"},he.add(rc);const Qt=new de,hi=new de;class ic{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new de,this.destinationFrame=new de,this.viewportFrame=new de}bind(e=null,r,i){const n=this.renderer;this.current=e;let s,a,o;e?(s=e.baseTexture,o=s.resolution,r||(Qt.width=e.frame.width,Qt.height=e.frame.height,r=Qt),i||(hi.x=e.frame.x,hi.y=e.frame.y,hi.width=r.width,hi.height=r.height,i=hi),a=s.framebuffer):(o=n.resolution,r||(Qt.width=n._view.screen.width,Qt.height=n._view.screen.height,r=Qt),i||(i=Qt,i.width=r.width,i.height=r.height));const u=this.viewportFrame;u.x=i.x*o,u.y=i.y*o,u.width=i.width*o,u.height=i.height*o,e||(u.y=n.view.height-(u.y+u.height)),u.ceil(),this.renderer.framebuffer.bind(a,u),this.renderer.projection.update(i,r,o,!a),e?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(i)}clear(e,r){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=e?Le.shared.setValue(e):i,s=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==a.width||s.height!==a.height;if(o){let{x:u,y:h,width:d,height:l}=this.viewportFrame;u=Math.round(u),h=Math.round(h),d=Math.round(d),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(u,h,d,l)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}ic.extension={type:ee.RendererSystem,name:"renderTexture"},he.add(ic);class Fb{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Ob(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let n=0;n<i;n++){const s=e.getActiveAttrib(t,n);if(s.name.startsWith("gl_"))continue;const a=Nu(e,s.type),o={type:a,name:s.name,size:Fu(a),location:e.getAttribLocation(t,s.name)};r[s.name]=o}return r}function Nb(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<i;n++){const s=e.getActiveUniform(t,n),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),u=Nu(e,s.type);r[a]={name:a,index:n,type:u,size:s.size,isArray:o,value:Ru(u,s.size)}}return r}function kb(t,e){var u;const r=Iu(t,t.VERTEX_SHADER,e.vertexSrc),i=Iu(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,i);const s=(u=e.extra)==null?void 0:u.transformFeedbackVaryings;if(s&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,s.names,s.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||lb(t,n,r,i),e.attributeData=Ob(n,t),e.uniformData=Nb(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const h=Object.keys(e.attributeData);h.sort((d,l)=>d>l?1:-1);for(let d=0;d<h.length;d++)e.attributeData[h[d]].location=d,t.bindAttribLocation(n,d,h[d]);t.linkProgram(n)}t.deleteShader(r),t.deleteShader(i);const a={};for(const h in e.uniformData){const d=e.uniformData[h];a[h]={location:t.getUniformLocation(n,h),value:Ru(d.type,d.size)}}return new Fb(n,a)}function Lb(t,e,r,i,n){r.buffer.update(n)}const Db={float:`
452
452
  data[offset] = v;
453
453
  `,vec2:`
454
454
  data[offset] = v[0];
@@ -486,7 +486,7 @@ void main(void)
486
486
  {
487
487
  data[offset + i] = v[i];
488
488
  }
489
- `},ac={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function $b(t){const e=t.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,i=0,n=0;for(let s=0;s<e.length;s++){const a=e[s];if(r=ac[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,i%r!==0&&i<16){const o=i%r%16;i+=o,n+=o}i+r>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=r,i=r):(a.offset=n,i+=r,n+=r)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function Gb(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort((i,n)=>i.index-n.index),r}function zb(t,e){if(!t.autoManage)return{size:0,syncFunc:Bb};const r=Gb(t.uniforms,e),{uboElements:i,size:n}=$b(r),s=[`
489
+ `},nc={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Bb(t){const e=t.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,i=0,n=0;for(let s=0;s<e.length;s++){const a=e[s];if(r=nc[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,i%r!==0&&i<16){const o=i%r%16;i+=o,n+=o}i+r>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=r,i=r):(a.offset=n,i+=r,n+=r)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function Ub(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort((i,n)=>i.index-n.index),r}function $b(t,e){if(!t.autoManage)return{size:0,syncFunc:Lb};const r=Ub(t.uniforms,e),{uboElements:i,size:n}=Bb(r),s=[`
490
490
  var v = null;
491
491
  var v2 = null;
492
492
  var cv = null;
@@ -494,7 +494,7 @@ void main(void)
494
494
  var gl = renderer.gl
495
495
  var index = 0;
496
496
  var data = buffer.data;
497
- `];for(let a=0;a<i.length;a++){const o=i[a],u=t.uniforms[o.data.name],h=o.data.name;let d=!1;for(let l=0;l<Rr.length;l++){const c=Rr[l];if(c.codeUbo&&c.test(o.data,u)){s.push(`offset = ${o.offset/4};`,Rr[l].codeUbo(o.data.name,u)),d=!0;break}}if(!d)if(o.data.size>1){const l=Nu(o.data.type),c=Math.max(ac[o.data.type]/16,1),f=l/c,p=(4-f%4)%4;s.push(`
497
+ `];for(let a=0;a<i.length;a++){const o=i[a],u=t.uniforms[o.data.name],h=o.data.name;let d=!1;for(let l=0;l<Cr.length;l++){const c=Cr[l];if(c.codeUbo&&c.test(o.data,u)){s.push(`offset = ${o.offset/4};`,Cr[l].codeUbo(o.data.name,u)),d=!0;break}}if(!d)if(o.data.size>1){const l=Fu(o.data.type),c=Math.max(nc[o.data.type]/16,1),f=l/c,p=(4-f%4)%4;s.push(`
498
498
  cv = ud.${h}.value;
499
499
  v = uv.${h};
500
500
  offset = ${o.offset/4};
@@ -510,7 +510,7 @@ void main(void)
510
510
  offset += ${p};
511
511
  }
512
512
 
513
- `)}else{const l=Ub[o.data.type];s.push(`
513
+ `)}else{const l=Db[o.data.type];s.push(`
514
514
  cv = ud.${h}.value;
515
515
  v = uv.${h};
516
516
  offset = ${o.offset/4};
@@ -518,7 +518,7 @@ void main(void)
518
518
  `)}}return s.push(`
519
519
  renderer.buffer.update(buffer);
520
520
  `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
521
- `))}}let jb=0;const Tn={textureCount:0,uboCount:0};class oc{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=jb++}systemCheck(){if(!fb())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),r||(Tn.textureCount=0,Tn.uboCount=0,this.syncUniformGroup(e.uniformGroup,Tn)),n}setUniforms(e){const r=this.shader.program,i=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,r){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,r))}syncUniforms(e,r,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=ob(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,r);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,Tn,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[r])}createSyncBufferGroup(e,r,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const s=this.gl.getUniformBlockIndex(r.program,i);r.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(e,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=zb(e,this.shader.program.uniformData)),e.autoManage){const u=new Float32Array(o.size/4);e.buffer.update(u)}return r.uniformGroups[e.id]=o.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,i){const n=e.uniforms,s=[`${i}-`];for(const a in n)s.push(a),r[a]&&s.push(r[a].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,i=e.program,n=Db(r,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}oc.extension={type:ee.RendererSystem,name:"shader"},fe.add(oc);class wn{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}wn.defaultOptions={hello:!1},wn.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"startup"},fe.add(wn);function Hb(t,e=[]){return e[j.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.ADD]=[t.ONE,t.ONE],e[j.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.NONE]=[0,0],e[j.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[j.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[j.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[j.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[j.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[j.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[j.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[j.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[j.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[j.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}const Vb=0,Xb=1,Wb=2,qb=3,Yb=4,Kb=5,xa=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=j.NONE,this._blendEq=!1,this.map=[],this.map[Vb]=this.setBlend,this.map[Xb]=this.setOffset,this.map[Wb]=this.setCullFace,this.map[qb]=this.setDepthTest,this.map[Yb]=this.setFrontFace,this.map[Kb]=this.setDepthMask,this.checks=[],this.defaultState=new ln,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=Hb(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)e&1&&this.map[r].call(this,!!(t.data&1<<r)),e=e>>1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(xa.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(xa.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],r=this.gl;e.length===2?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&r===-1?this.checks.push(t):!e&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};let lc=xa;lc.extension={type:ee.RendererSystem,name:"state"},fe.add(lc);class Zb extends Gi{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(n=>e.systems[n]),i=[...r,...Object.keys(e.systems).filter(n=>!r.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(r=>{this.runners[r]=new et(r)})}addSystem(e,r){const i=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=i,this._systemsHash[r]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,r){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const s=i.find(a=>this._systemsHash[a]===n);n[e.name](r[s])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Sn=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Sn.defaultMaxIdle,this.checkCountMax=Sn.defaultCheckCountMax,this.mode=Sn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==ps.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;i<e.length;i++){const n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){let i=0;for(let n=0;n<e.length;n++)e[n]!==null&&(e[i++]=e[n]);e.length=i}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let i=t.children.length-1;i>=0;i--)this.unload(t.children[i])}destroy(){this.renderer=null}};let nt=Sn;nt.defaultMode=ps.AUTO,nt.defaultMaxIdle=60*60,nt.defaultCheckCountMax=60*10,nt.extension={type:ee.RendererSystem,name:"textureGC"},fe.add(nt);class ba{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=se.UNSIGNED_BYTE,this.internalFormat=N.RGBA,this.samplerType=0}}function Qb(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[se.UNSIGNED_BYTE]:{[N.RGBA]:t.RGBA8,[N.RGB]:t.RGB8,[N.RG]:t.RG8,[N.RED]:t.R8,[N.RGBA_INTEGER]:t.RGBA8UI,[N.RGB_INTEGER]:t.RGB8UI,[N.RG_INTEGER]:t.RG8UI,[N.RED_INTEGER]:t.R8UI,[N.ALPHA]:t.ALPHA,[N.LUMINANCE]:t.LUMINANCE,[N.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[se.BYTE]:{[N.RGBA]:t.RGBA8_SNORM,[N.RGB]:t.RGB8_SNORM,[N.RG]:t.RG8_SNORM,[N.RED]:t.R8_SNORM,[N.RGBA_INTEGER]:t.RGBA8I,[N.RGB_INTEGER]:t.RGB8I,[N.RG_INTEGER]:t.RG8I,[N.RED_INTEGER]:t.R8I},[se.UNSIGNED_SHORT]:{[N.RGBA_INTEGER]:t.RGBA16UI,[N.RGB_INTEGER]:t.RGB16UI,[N.RG_INTEGER]:t.RG16UI,[N.RED_INTEGER]:t.R16UI,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[se.SHORT]:{[N.RGBA_INTEGER]:t.RGBA16I,[N.RGB_INTEGER]:t.RGB16I,[N.RG_INTEGER]:t.RG16I,[N.RED_INTEGER]:t.R16I},[se.UNSIGNED_INT]:{[N.RGBA_INTEGER]:t.RGBA32UI,[N.RGB_INTEGER]:t.RGB32UI,[N.RG_INTEGER]:t.RG32UI,[N.RED_INTEGER]:t.R32UI,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[se.INT]:{[N.RGBA_INTEGER]:t.RGBA32I,[N.RGB_INTEGER]:t.RGB32I,[N.RG_INTEGER]:t.RG32I,[N.RED_INTEGER]:t.R32I},[se.FLOAT]:{[N.RGBA]:t.RGBA32F,[N.RGB]:t.RGB32F,[N.RG]:t.RG32F,[N.RED]:t.R32F,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[se.HALF_FLOAT]:{[N.RGBA]:t.RGBA16F,[N.RGB]:t.RGB16F,[N.RG]:t.RG16F,[N.RED]:t.R16F},[se.UNSIGNED_SHORT_5_6_5]:{[N.RGB]:t.RGB565},[se.UNSIGNED_SHORT_4_4_4_4]:{[N.RGBA]:t.RGBA4},[se.UNSIGNED_SHORT_5_5_5_1]:{[N.RGBA]:t.RGB5_A1},[se.UNSIGNED_INT_2_10_10_10_REV]:{[N.RGBA]:t.RGB10_A2,[N.RGBA_INTEGER]:t.RGB10_A2UI},[se.UNSIGNED_INT_10F_11F_11F_REV]:{[N.RGB]:t.R11F_G11F_B10F},[se.UNSIGNED_INT_5_9_9_9_REV]:{[N.RGB]:t.RGB9_E5},[se.UNSIGNED_INT_24_8]:{[N.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[se.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[N.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:e={[se.UNSIGNED_BYTE]:{[N.RGBA]:t.RGBA,[N.RGB]:t.RGB,[N.ALPHA]:t.ALPHA,[N.LUMINANCE]:t.LUMINANCE,[N.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[se.UNSIGNED_SHORT_5_6_5]:{[N.RGB]:t.RGB},[se.UNSIGNED_SHORT_4_4_4_4]:{[N.RGBA]:t.RGBA},[se.UNSIGNED_SHORT_5_5_5_1]:{[N.RGBA]:t.RGBA}},e}class uc{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ae,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Qb(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let n=0;n<r;n++)this.boundTextures[n]=null;this.emptyTextures={};const i=new ba(e.createTexture());e.bindTexture(e.TEXTURE_2D,i.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=i,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new ba(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let n=0;n<this.boundTextures.length;n++)this.bind(null,n)}bind(e,r=0){const{gl:i}=this;if(e=e==null?void 0:e.castToBaseTexture(),e!=null&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const n=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(e.target,n.texture)),n.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),this.updateTexture(e)):n.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let n=0;n<i.length;n++)i[n]===this.unknownTexture&&this.bind(null,n)}for(let n=0;n<i.length;n++)i[n]===e&&(this.currentLocation!==n&&(r.activeTexture(r.TEXTURE0+n),this.currentLocation=n),r.bindTexture(e.target,this.emptyTextures[e.target].texture),i[n]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:i,CONTEXT_UID:n}=this;if(i)for(let s=e-1;s>=0;--s){const a=r[s];a&&a._glTextures[n].samplerType!==ds.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(e){const r=new ba(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var i;r.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,this.webGLVersion===2&&e.type===se.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var n;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const i=this.renderer;if(this.initTextureType(e,r),(n=e.resource)!=null&&n.upload(i,e,r))r.samplerType!==ds.FLOAT&&(this.hasIntegerTextures=!0);else{const s=e.realWidth,a=e.realHeight,o=i.gl;(r.width!==s||r.height!==a||r.dirtyId<0)&&(r.width=s,r.height=a,o.texImage2D(e.target,0,r.internalFormat,s,a,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const n=this.managedTextures.indexOf(e);n!==-1&&an(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const r=e._glTextures[this.CONTEXT_UID];r&&((e.mipmap===jt.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?r.mipmap=!1:r.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?r.wrapMode=Zr.CLAMP:r.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const i=this.gl;if(r.mipmap&&e.mipmap!==jt.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===dt.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===dt.LINEAR){const s=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===dt.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===dt.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}uc.extension={type:ee.RendererSystem,name:"texture"},fe.add(uc);class cc{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:i,renderer:n}=this;r&&n.shader.bind(r),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:i,CONTEXT_UID:n}=this,s=r.createTransformFeedback();e._glTransformFeedbacks[n]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];o&&(i.buffer.update(o),o._glBuffers[n].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[n].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),s}disposeTransformFeedback(e,r){const i=e._glTransformFeedbacks[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];if(!o)continue;const u=o._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!r&&s.dispose(o,r))}i&&(r||n.deleteTransformFeedback(i),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}cc.extension={type:ee.RendererSystem,name:"transformFeedback"},fe.add(cc);class An{constructor(e){this.renderer=e}init(e){this.screen=new pe(0,0,e.width,e.height),this.element=e.view||Z.ADAPTER.createCanvas(),this.resolution=e.resolution||Z.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const i=this.element.width/this.resolution,n=this.element.height/this.resolution;this.screen.width=i,this.screen.height=n,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${n}px`),this.renderer.emit("resize",i,n),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}An.defaultOptions={width:800,height:600,resolution:Z.RESOLUTION,autoDensity:!1},An.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"_view"},fe.add(An),Z.PREFER_ENV=zt.WEBGL2,Z.STRICT_TEXTURE_CACHE=!1,Z.RENDER_OPTIONS={...vn.defaultOptions,...gn.defaultOptions,...An.defaultOptions,...wn.defaultOptions},Object.defineProperties(Z,{WRAP_MODE:{get(){return ae.defaultOptions.wrapMode},set(t){re("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),ae.defaultOptions.wrapMode=t}},SCALE_MODE:{get(){return ae.defaultOptions.scaleMode},set(t){re("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),ae.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get(){return ae.defaultOptions.mipmap},set(t){re("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),ae.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get(){return ae.defaultOptions.anisotropicLevel},set(t){re("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),ae.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get(){return re("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),ue.defaultResolution},set(t){ue.defaultResolution=t}},FILTER_MULTISAMPLE:{get(){return re("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),ue.defaultMultisample},set(t){ue.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get(){return it.defaultMaxTextures},set(t){re("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),it.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get(){return it.defaultBatchSize},set(t){re("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),it.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get(){return it.canUploadSameBuffer},set(t){re("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),it.canUploadSameBuffer=t}},GC_MODE:{get(){return nt.defaultMode},set(t){re("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),nt.defaultMode=t}},GC_MAX_IDLE:{get(){return nt.defaultMaxIdle},set(t){re("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),nt.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get(){return nt.defaultCheckCountMax},set(t){re("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),nt.defaultCheckCountMax=t}},PRECISION_VERTEX:{get(){return Tt.defaultVertexPrecision},set(t){re("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Tt.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get(){return Tt.defaultFragmentPrecision},set(t){re("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Tt.defaultFragmentPrecision=t}}});var En=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(En||{});class Ta{constructor(e,r=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=i,this.once=n}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!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 r=this.next;return this.next=e?null:r,this.previous=null,r}}const He=class{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 Ta(null,null,1/0),this.deltaMS=1/He.targetFPMS,this.elapsedMS=1/He.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,r=En.NORMAL){return this._addListener(new Ta(t,e,r))}addOnce(t,e,r=En.NORMAL){return this._addListener(new Ta(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(!e)t.connect(r);else{for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r.match(t,e)?r=r.destroy():r=r.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._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*He.targetFPMS;const r=this._head;let i=r.next;for(;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,He.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!He._shared){const t=He._shared=new He;t.autoStart=!0,t._protected=!0}return He._shared}static get system(){if(!He._system){const t=He._system=new He;t.autoStart=!0,t._protected=!0}return He._system}};let st=He;st.targetFPMS=.06,Object.defineProperties(Z,{TARGET_FPMS:{get(){return st.targetFPMS},set(t){re("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),st.targetFPMS=t}}});class hc{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,En.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?st.shared:new st,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}hc.extension=ee.Application,fe.add(hc);const Jb=[];fe.handleByList(ee.Renderer,Jb);class fc{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}r>=Ae.HIGH?this.multisample=Ae.HIGH:r>=Ae.MEDIUM?this.multisample=Ae.MEDIUM:r>=Ae.LOW?this.multisample=Ae.LOW:this.multisample=Ae.NONE}destroy(){}}fc.extension={type:ee.RendererSystem,name:"_multisample"},fe.add(fc);class e1{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class dc{constructor(e){this.renderer=e,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(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);r.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[r]!==e){const s=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[r]=e,i.bindBufferBase(i.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(e,r,i){const{gl:n,CONTEXT_UID:s}=this;i=i||0;const a=e._glBuffers[s]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,a.buffer,i*256,256)}update(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,r.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const s=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,s)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(r||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let i=0;i<r.length;i++)this.dispose(this.managedBuffers[r[i]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:i}=this;return e._glBuffers[r]=new e1(i.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}dc.extension={type:ee.RendererSystem,name:"buffer"},fe.add(dc);class pc{constructor(e){this.renderer=e}render(e,r){const i=this.renderer;let n,s,a,o;if(r&&(n=r.renderTexture,s=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!n,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=a,!i.context.isLost){if(n||(this.lastObjectRendered=e),!o){const u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}i.renderTexture.bind(n),i.batch.currentRenderer.start(),(s??i.background.clearBeforeRender)&&i.renderTexture.clear(),e.render(i),i.batch.currentRenderer.flush(),n&&(r.blit&&i.framebuffer.blit(),n.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}pc.extension={type:ee.RendererSystem,name:"objectRenderer"},fe.add(pc);const wa=class extends Zb{constructor(t){super(),this.type=ll.WEBGL,t=Object.assign({},Z.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new tt({projectionMatrix:new $e},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:wa.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(re("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!=="notMultiplied",t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=wa.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:Px()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return re("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return re("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return re("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return re("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){re("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return re("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){re("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return re("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};let Fr=wa;Fr.extension={type:ee.Renderer,priority:1},Fr.__plugins={},Fr.__systems={},fe.handleByMap(ee.RendererPlugin,Fr.__plugins),fe.handleByMap(ee.RendererSystem,Fr.__systems),fe.add(Fr);class mc extends li{constructor(e,r){const{width:i,height:n}=r||{};super(i,n),this.items=[],this.itemDirtyIds=[];for(let s=0;s<e;s++){const a=new ae;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let i=0;i<this.length;i++)e[i]&&(e[i].castToBaseTexture?this.addBaseTextureAt(e[i].castToBaseTexture(),i):e[i]instanceof li?this.addResourceAt(e[i],i):this.addResourceAt(Au(e[i],r),i))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const r=this.items.map(i=>i.resource).filter(i=>i).map(i=>i.load());return this._load=Promise.all(r).then(()=>{const{realWidth:i,realHeight:n}=this.items[0];return this.resize(i,n),Promise.resolve(this)}),this._load}}class t1 extends mc{constructor(e,r){const{width:i,height:n}=r||{};let s,a;Array.isArray(e)?(s=e,a=e.length):a=e,super(a,{width:i,height:n}),s&&this.initFromArray(s,r)}addBaseTextureAt(e,r){if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=pr.TEXTURE_2D_ARRAY}upload(e,r,i){const{length:n,itemDirtyIds:s,items:a}=this,{gl:o}=e;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,r.format,i.type,null);for(let u=0;u<n;u++){const h=a[u];s[u]<h.dirtyId&&(s[u]=h.dirtyId,h.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,u,h.resource.width,h.resource.height,1,r.format,i.type,h.resource.source))}return!0}}class r1 extends kt{constructor(e){super(e)}static test(e){const{OffscreenCanvas:r}=globalThis;return r&&e instanceof r?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}}const mi=class extends mc{constructor(t,e){const{width:r,height:i,autoLoad:n,linkBaseTexture:s}=e||{};if(t&&t.length!==mi.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:r,height:i});for(let a=0;a<mi.SIDES;a++)this.items[a].target=pr.TEXTURE_CUBE_MAP_POSITIVE_X+a;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,e),n!==!1&&this.load()}bind(t){super.bind(t),t.target=pr.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=pr.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,r){const i=this.itemDirtyIds;for(let n=0;n<mi.SIDES;n++){const s=this.items[n];(i[n]<s.dirtyId||r.dirtyId<e.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,r),i[n]=s.dirtyId):i[n]<-1&&(t.gl.texImage2D(s.target,0,r.internalFormat,e.realWidth,e.realHeight,0,e.format,r.type,null),i[n]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===mi.SIDES}};let gc=mi;gc.SIDES=6;class Or extends kt{constructor(e,r){r=r||{};let i,n;typeof e=="string"?(i=Or.EMPTY,n=e):(i=e,n=null),super(i),this.url=n,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(e,r)=>{if(this.url===null){e(this);return}try{const i=await Z.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const s=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Pt.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=s,this.update(),e(this)}catch(i){if(this.destroyed)return;r(i),this.onError.emit(i)}}),this._load)}upload(e,r,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,i)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Or._EMPTY=Or._EMPTY??Z.ADAPTER.createCanvas(0,0),Or._EMPTY}}const Cn=class extends kt{constructor(t,e){e=e||{},super(Z.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.resize(this.source.width,this.source.height),t(this)},Cn.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;kt.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,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,n=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,n=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),n=Math.round(n);const s=this.source;s.width=i,s.height=n,s._pixiId=`canvas_${oi()}`,s.getContext("2d").drawImage(t,0,0,e,r,0,0,i,n),this._resolve(),this._resolve=null}}static getSize(t){const e=Cn.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}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"&&Cn.SVG_XML.test(t)}};let Sa=Cn;Sa.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Sa.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Aa=class extends kt{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);const i=t[0].src||t[0];kt.crossOrigin(r,i,e.crossorigin);for(let n=0;n<t.length;++n){const s=document.createElement("source");let{src:a,mime:o}=t[n];a=a||t[n];const u=a.split("?").shift().toLowerCase(),h=u.slice(u.lastIndexOf(".")+1);o=o||Aa.MIME_TYPES[h]||`video/${h}`,s.src=a,s.type=o,r.appendChild(s)}t=r}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),e.autoLoad!==!1&&this.load()}update(t=0){if(!this.destroyed){const e=st.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(e=>{this.valid?e(this):(this._resolve=e,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(st.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(st.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._isConnectedToTicker&&(st.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(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._autoUpdate&&this._isConnectedToTicker?(st.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(st.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||Aa.TYPES.includes(e)}};let Ea=Aa;Ea.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ea.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},la.push(Or,zu,r1,Ea,Sa,ua,gc,t1);var i1=`attribute vec2 aVertexPosition;
521
+ `))}}let Gb=0;const yn={textureCount:0,uboCount:0};class sc{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Gb++}systemCheck(){if(!cb())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),r||(yn.textureCount=0,yn.uboCount=0,this.syncUniformGroup(e.uniformGroup,yn)),n}setUniforms(e){const r=this.shader.program,i=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,r){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,r))}syncUniforms(e,r,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=sb(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,r);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,yn,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[r])}createSyncBufferGroup(e,r,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const s=this.gl.getUniformBlockIndex(r.program,i);r.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(e,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=$b(e,this.shader.program.uniformData)),e.autoManage){const u=new Float32Array(o.size/4);e.buffer.update(u)}return r.uniformGroups[e.id]=o.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,i){const n=e.uniforms,s=[`${i}-`];for(const a in n)s.push(a),r[a]&&s.push(r[a].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,i=e.program,n=kb(r,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}sc.extension={type:ee.RendererSystem,name:"shader"},he.add(sc);class xn{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}xn.defaultOptions={hello:!1},xn.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"startup"},he.add(xn);function zb(t,e=[]){return e[j.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.ADD]=[t.ONE,t.ONE],e[j.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.NONE]=[0,0],e[j.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[j.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[j.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[j.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[j.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[j.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[j.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[j.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[j.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[j.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[j.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}const jb=0,Hb=1,Vb=2,Xb=3,Wb=4,qb=5,ga=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=j.NONE,this._blendEq=!1,this.map=[],this.map[jb]=this.setBlend,this.map[Hb]=this.setOffset,this.map[Vb]=this.setCullFace,this.map[Xb]=this.setDepthTest,this.map[Wb]=this.setFrontFace,this.map[qb]=this.setDepthMask,this.checks=[],this.defaultState=new sn,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=zb(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)e&1&&this.map[r].call(this,!!(t.data&1<<r)),e=e>>1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(ga.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(ga.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],r=this.gl;e.length===2?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&r===-1?this.checks.push(t):!e&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};let ac=ga;ac.extension={type:ee.RendererSystem,name:"state"},he.add(ac);class Yb extends Bi{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(n=>e.systems[n]),i=[...r,...Object.keys(e.systems).filter(n=>!r.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(r=>{this.runners[r]=new et(r)})}addSystem(e,r){const i=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=i,this._systemsHash[r]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,r){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const s=i.find(a=>this._systemsHash[a]===n);n[e.name](r[s])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const bn=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=bn.defaultMaxIdle,this.checkCountMax=bn.defaultCheckCountMax,this.mode=bn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==cs.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;i<e.length;i++){const n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){let i=0;for(let n=0;n<e.length;n++)e[n]!==null&&(e[i++]=e[n]);e.length=i}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let i=t.children.length-1;i>=0;i--)this.unload(t.children[i])}destroy(){this.renderer=null}};let nt=bn;nt.defaultMode=cs.AUTO,nt.defaultMaxIdle=60*60,nt.defaultCheckCountMax=60*10,nt.extension={type:ee.RendererSystem,name:"textureGC"},he.add(nt);class va{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=se.UNSIGNED_BYTE,this.internalFormat=N.RGBA,this.samplerType=0}}function Kb(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[se.UNSIGNED_BYTE]:{[N.RGBA]:t.RGBA8,[N.RGB]:t.RGB8,[N.RG]:t.RG8,[N.RED]:t.R8,[N.RGBA_INTEGER]:t.RGBA8UI,[N.RGB_INTEGER]:t.RGB8UI,[N.RG_INTEGER]:t.RG8UI,[N.RED_INTEGER]:t.R8UI,[N.ALPHA]:t.ALPHA,[N.LUMINANCE]:t.LUMINANCE,[N.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[se.BYTE]:{[N.RGBA]:t.RGBA8_SNORM,[N.RGB]:t.RGB8_SNORM,[N.RG]:t.RG8_SNORM,[N.RED]:t.R8_SNORM,[N.RGBA_INTEGER]:t.RGBA8I,[N.RGB_INTEGER]:t.RGB8I,[N.RG_INTEGER]:t.RG8I,[N.RED_INTEGER]:t.R8I},[se.UNSIGNED_SHORT]:{[N.RGBA_INTEGER]:t.RGBA16UI,[N.RGB_INTEGER]:t.RGB16UI,[N.RG_INTEGER]:t.RG16UI,[N.RED_INTEGER]:t.R16UI,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[se.SHORT]:{[N.RGBA_INTEGER]:t.RGBA16I,[N.RGB_INTEGER]:t.RGB16I,[N.RG_INTEGER]:t.RG16I,[N.RED_INTEGER]:t.R16I},[se.UNSIGNED_INT]:{[N.RGBA_INTEGER]:t.RGBA32UI,[N.RGB_INTEGER]:t.RGB32UI,[N.RG_INTEGER]:t.RG32UI,[N.RED_INTEGER]:t.R32UI,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[se.INT]:{[N.RGBA_INTEGER]:t.RGBA32I,[N.RGB_INTEGER]:t.RGB32I,[N.RG_INTEGER]:t.RG32I,[N.RED_INTEGER]:t.R32I},[se.FLOAT]:{[N.RGBA]:t.RGBA32F,[N.RGB]:t.RGB32F,[N.RG]:t.RG32F,[N.RED]:t.R32F,[N.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[se.HALF_FLOAT]:{[N.RGBA]:t.RGBA16F,[N.RGB]:t.RGB16F,[N.RG]:t.RG16F,[N.RED]:t.R16F},[se.UNSIGNED_SHORT_5_6_5]:{[N.RGB]:t.RGB565},[se.UNSIGNED_SHORT_4_4_4_4]:{[N.RGBA]:t.RGBA4},[se.UNSIGNED_SHORT_5_5_5_1]:{[N.RGBA]:t.RGB5_A1},[se.UNSIGNED_INT_2_10_10_10_REV]:{[N.RGBA]:t.RGB10_A2,[N.RGBA_INTEGER]:t.RGB10_A2UI},[se.UNSIGNED_INT_10F_11F_11F_REV]:{[N.RGB]:t.R11F_G11F_B10F},[se.UNSIGNED_INT_5_9_9_9_REV]:{[N.RGB]:t.RGB9_E5},[se.UNSIGNED_INT_24_8]:{[N.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[se.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[N.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:e={[se.UNSIGNED_BYTE]:{[N.RGBA]:t.RGBA,[N.RGB]:t.RGB,[N.ALPHA]:t.ALPHA,[N.LUMINANCE]:t.LUMINANCE,[N.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[se.UNSIGNED_SHORT_5_6_5]:{[N.RGB]:t.RGB},[se.UNSIGNED_SHORT_4_4_4_4]:{[N.RGBA]:t.RGBA},[se.UNSIGNED_SHORT_5_5_5_1]:{[N.RGBA]:t.RGBA}},e}class oc{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ae,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Kb(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let n=0;n<r;n++)this.boundTextures[n]=null;this.emptyTextures={};const i=new va(e.createTexture());e.bindTexture(e.TEXTURE_2D,i.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=i,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new va(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let n=0;n<this.boundTextures.length;n++)this.bind(null,n)}bind(e,r=0){const{gl:i}=this;if(e=e==null?void 0:e.castToBaseTexture(),e!=null&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const n=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(e.target,n.texture)),n.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),this.updateTexture(e)):n.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let n=0;n<i.length;n++)i[n]===this.unknownTexture&&this.bind(null,n)}for(let n=0;n<i.length;n++)i[n]===e&&(this.currentLocation!==n&&(r.activeTexture(r.TEXTURE0+n),this.currentLocation=n),r.bindTexture(e.target,this.emptyTextures[e.target].texture),i[n]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:i,CONTEXT_UID:n}=this;if(i)for(let s=e-1;s>=0;--s){const a=r[s];a&&a._glTextures[n].samplerType!==us.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(e){const r=new va(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var i;r.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,this.webGLVersion===2&&e.type===se.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var n;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const i=this.renderer;if(this.initTextureType(e,r),(n=e.resource)!=null&&n.upload(i,e,r))r.samplerType!==us.FLOAT&&(this.hasIntegerTextures=!0);else{const s=e.realWidth,a=e.realHeight,o=i.gl;(r.width!==s||r.height!==a||r.dirtyId<0)&&(r.width=s,r.height=a,o.texImage2D(e.target,0,r.internalFormat,s,a,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const n=this.managedTextures.indexOf(e);n!==-1&&rn(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const r=e._glTextures[this.CONTEXT_UID];r&&((e.mipmap===Gt.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?r.mipmap=!1:r.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?r.wrapMode=qr.CLAMP:r.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const i=this.gl;if(r.mipmap&&e.mipmap!==Gt.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===dt.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===dt.LINEAR){const s=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===dt.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===dt.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}oc.extension={type:ee.RendererSystem,name:"texture"},he.add(oc);class lc{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:i,renderer:n}=this;r&&n.shader.bind(r),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:i,CONTEXT_UID:n}=this,s=r.createTransformFeedback();e._glTransformFeedbacks[n]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];o&&(i.buffer.update(o),o._glBuffers[n].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[n].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),s}disposeTransformFeedback(e,r){const i=e._glTransformFeedbacks[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];if(!o)continue;const u=o._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!r&&s.dispose(o,r))}i&&(r||n.deleteTransformFeedback(i),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}lc.extension={type:ee.RendererSystem,name:"transformFeedback"},he.add(lc);class Tn{constructor(e){this.renderer=e}init(e){this.screen=new de(0,0,e.width,e.height),this.element=e.view||Q.ADAPTER.createCanvas(),this.resolution=e.resolution||Q.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const i=this.element.width/this.resolution,n=this.element.height/this.resolution;this.screen.width=i,this.screen.height=n,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${n}px`),this.renderer.emit("resize",i,n),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Tn.defaultOptions={width:800,height:600,resolution:Q.RESOLUTION,autoDensity:!1},Tn.extension={type:[ee.RendererSystem,ee.CanvasRendererSystem],name:"_view"},he.add(Tn),Q.PREFER_ENV=$t.WEBGL2,Q.STRICT_TEXTURE_CACHE=!1,Q.RENDER_OPTIONS={...pn.defaultOptions,...dn.defaultOptions,...Tn.defaultOptions,...xn.defaultOptions},Object.defineProperties(Q,{WRAP_MODE:{get(){return ae.defaultOptions.wrapMode},set(t){re("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),ae.defaultOptions.wrapMode=t}},SCALE_MODE:{get(){return ae.defaultOptions.scaleMode},set(t){re("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),ae.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get(){return ae.defaultOptions.mipmap},set(t){re("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),ae.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get(){return ae.defaultOptions.anisotropicLevel},set(t){re("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),ae.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get(){return re("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),ue.defaultResolution},set(t){ue.defaultResolution=t}},FILTER_MULTISAMPLE:{get(){return re("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),ue.defaultMultisample},set(t){ue.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get(){return it.defaultMaxTextures},set(t){re("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),it.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get(){return it.defaultBatchSize},set(t){re("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),it.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get(){return it.canUploadSameBuffer},set(t){re("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),it.canUploadSameBuffer=t}},GC_MODE:{get(){return nt.defaultMode},set(t){re("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),nt.defaultMode=t}},GC_MAX_IDLE:{get(){return nt.defaultMaxIdle},set(t){re("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),nt.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get(){return nt.defaultCheckCountMax},set(t){re("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),nt.defaultCheckCountMax=t}},PRECISION_VERTEX:{get(){return Tt.defaultVertexPrecision},set(t){re("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Tt.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get(){return Tt.defaultFragmentPrecision},set(t){re("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Tt.defaultFragmentPrecision=t}}});var wn=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(wn||{});class _a{constructor(e,r=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=i,this.once=n}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!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 r=this.next;return this.next=e?null:r,this.previous=null,r}}const je=class{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 _a(null,null,1/0),this.deltaMS=1/je.targetFPMS,this.elapsedMS=1/je.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,r=wn.NORMAL){return this._addListener(new _a(t,e,r))}addOnce(t,e,r=wn.NORMAL){return this._addListener(new _a(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(!e)t.connect(r);else{for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r.match(t,e)?r=r.destroy():r=r.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._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*je.targetFPMS;const r=this._head;let i=r.next;for(;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,je.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!je._shared){const t=je._shared=new je;t.autoStart=!0,t._protected=!0}return je._shared}static get system(){if(!je._system){const t=je._system=new je;t.autoStart=!0,t._protected=!0}return je._system}};let st=je;st.targetFPMS=.06,Object.defineProperties(Q,{TARGET_FPMS:{get(){return st.targetFPMS},set(t){re("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),st.targetFPMS=t}}});class uc{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,wn.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?st.shared:new st,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}uc.extension=ee.Application,he.add(uc);const Zb=[];he.handleByList(ee.Renderer,Zb);class cc{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}r>=Ae.HIGH?this.multisample=Ae.HIGH:r>=Ae.MEDIUM?this.multisample=Ae.MEDIUM:r>=Ae.LOW?this.multisample=Ae.LOW:this.multisample=Ae.NONE}destroy(){}}cc.extension={type:ee.RendererSystem,name:"_multisample"},he.add(cc);class Qb{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class hc{constructor(e){this.renderer=e,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(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);r.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[r]!==e){const s=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[r]=e,i.bindBufferBase(i.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(e,r,i){const{gl:n,CONTEXT_UID:s}=this;i=i||0;const a=e._glBuffers[s]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,a.buffer,i*256,256)}update(e){const{gl:r,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,r.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const s=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,s)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(r||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let i=0;i<r.length;i++)this.dispose(this.managedBuffers[r[i]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:i}=this;return e._glBuffers[r]=new Qb(i.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}hc.extension={type:ee.RendererSystem,name:"buffer"},he.add(hc);class fc{constructor(e){this.renderer=e}render(e,r){const i=this.renderer;let n,s,a,o;if(r&&(n=r.renderTexture,s=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!n,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=a,!i.context.isLost){if(n||(this.lastObjectRendered=e),!o){const u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}i.renderTexture.bind(n),i.batch.currentRenderer.start(),(s??i.background.clearBeforeRender)&&i.renderTexture.clear(),e.render(i),i.batch.currentRenderer.flush(),n&&(r.blit&&i.framebuffer.blit(),n.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}fc.extension={type:ee.RendererSystem,name:"objectRenderer"},he.add(fc);const ya=class extends Yb{constructor(t){super(),this.type=al.WEBGL,t=Object.assign({},Q.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new tt({projectionMatrix:new Ue},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:ya.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(re("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!=="notMultiplied",t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=ya.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:Ix()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return re("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return re("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return re("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return re("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){re("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return re("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){re("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return re("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};let Pr=ya;Pr.extension={type:ee.Renderer,priority:1},Pr.__plugins={},Pr.__systems={},he.handleByMap(ee.RendererPlugin,Pr.__plugins),he.handleByMap(ee.RendererSystem,Pr.__systems),he.add(Pr);class dc extends si{constructor(e,r){const{width:i,height:n}=r||{};super(i,n),this.items=[],this.itemDirtyIds=[];for(let s=0;s<e;s++){const a=new ae;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let i=0;i<this.length;i++)e[i]&&(e[i].castToBaseTexture?this.addBaseTextureAt(e[i].castToBaseTexture(),i):e[i]instanceof si?this.addResourceAt(e[i],i):this.addResourceAt(wu(e[i],r),i))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const r=this.items.map(i=>i.resource).filter(i=>i).map(i=>i.load());return this._load=Promise.all(r).then(()=>{const{realWidth:i,realHeight:n}=this.items[0];return this.resize(i,n),Promise.resolve(this)}),this._load}}class Jb extends dc{constructor(e,r){const{width:i,height:n}=r||{};let s,a;Array.isArray(e)?(s=e,a=e.length):a=e,super(a,{width:i,height:n}),s&&this.initFromArray(s,r)}addBaseTextureAt(e,r){if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=fr.TEXTURE_2D_ARRAY}upload(e,r,i){const{length:n,itemDirtyIds:s,items:a}=this,{gl:o}=e;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,r.format,i.type,null);for(let u=0;u<n;u++){const h=a[u];s[u]<h.dirtyId&&(s[u]=h.dirtyId,h.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,u,h.resource.width,h.resource.height,1,r.format,i.type,h.resource.source))}return!0}}class e1 extends Nt{constructor(e){super(e)}static test(e){const{OffscreenCanvas:r}=globalThis;return r&&e instanceof r?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}}const fi=class extends dc{constructor(t,e){const{width:r,height:i,autoLoad:n,linkBaseTexture:s}=e||{};if(t&&t.length!==fi.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:r,height:i});for(let a=0;a<fi.SIDES;a++)this.items[a].target=fr.TEXTURE_CUBE_MAP_POSITIVE_X+a;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,e),n!==!1&&this.load()}bind(t){super.bind(t),t.target=fr.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=fr.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,r){const i=this.itemDirtyIds;for(let n=0;n<fi.SIDES;n++){const s=this.items[n];(i[n]<s.dirtyId||r.dirtyId<e.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,r),i[n]=s.dirtyId):i[n]<-1&&(t.gl.texImage2D(s.target,0,r.internalFormat,e.realWidth,e.realHeight,0,e.format,r.type,null),i[n]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===fi.SIDES}};let pc=fi;pc.SIDES=6;class Mr extends Nt{constructor(e,r){r=r||{};let i,n;typeof e=="string"?(i=Mr.EMPTY,n=e):(i=e,n=null),super(i),this.url=n,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(e,r)=>{if(this.url===null){e(this);return}try{const i=await Q.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const s=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Rt.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=s,this.update(),e(this)}catch(i){if(this.destroyed)return;r(i),this.onError.emit(i)}}),this._load)}upload(e,r,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,i)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Mr._EMPTY=Mr._EMPTY??Q.ADAPTER.createCanvas(0,0),Mr._EMPTY}}const Sn=class extends Nt{constructor(t,e){e=e||{},super(Q.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.resize(this.source.width,this.source.height),t(this)},Sn.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;Nt.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,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,n=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,n=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),n=Math.round(n);const s=this.source;s.width=i,s.height=n,s._pixiId=`canvas_${ni()}`,s.getContext("2d").drawImage(t,0,0,e,r,0,0,i,n),this._resolve(),this._resolve=null}}static getSize(t){const e=Sn.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}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"&&Sn.SVG_XML.test(t)}};let xa=Sn;xa.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,xa.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const ba=class extends Nt{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);const i=t[0].src||t[0];Nt.crossOrigin(r,i,e.crossorigin);for(let n=0;n<t.length;++n){const s=document.createElement("source");let{src:a,mime:o}=t[n];a=a||t[n];const u=a.split("?").shift().toLowerCase(),h=u.slice(u.lastIndexOf(".")+1);o=o||ba.MIME_TYPES[h]||`video/${h}`,s.src=a,s.type=o,r.appendChild(s)}t=r}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),e.autoLoad!==!1&&this.load()}update(t=0){if(!this.destroyed){const e=st.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(e=>{this.valid?e(this):(this._resolve=e,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(st.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(st.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._isConnectedToTicker&&(st.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(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._autoUpdate&&this._isConnectedToTicker?(st.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(st.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||ba.TYPES.includes(e)}};let Ta=ba;Ta.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ta.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},na.push(Mr,$u,e1,Ta,xa,sa,pc,Jb);var t1=`attribute vec2 aVertexPosition;
522
522
  attribute vec2 aTextureCoord;
523
523
 
524
524
  uniform mat3 projectionMatrix;
@@ -529,7 +529,7 @@ void main(void)
529
529
  {
530
530
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
531
531
  vTextureCoord = aTextureCoord;
532
- }`,n1=`varying vec2 vTextureCoord;
532
+ }`,r1=`varying vec2 vTextureCoord;
533
533
  uniform sampler2D uSampler;
534
534
 
535
535
  uniform float gamma;
@@ -560,7 +560,7 @@ void main(void)
560
560
 
561
561
  gl_FragColor = c * alpha;
562
562
  }
563
- `;let s1=class extends ue{constructor(e){super(i1,n1),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,e)}apply(e,r,i,n){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,i,n)}};var a1=`attribute vec2 aVertexPosition;
563
+ `;let i1=class extends ue{constructor(e){super(t1,r1),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,e)}apply(e,r,i,n){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,i,n)}};var n1=`attribute vec2 aVertexPosition;
564
564
  attribute vec2 aTextureCoord;
565
565
 
566
566
  uniform mat3 projectionMatrix;
@@ -571,7 +571,7 @@ void main(void)
571
571
  {
572
572
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
573
573
  vTextureCoord = aTextureCoord;
574
- }`,o1=`
574
+ }`,s1=`
575
575
  varying vec2 vTextureCoord;
576
576
  uniform sampler2D uSampler;
577
577
 
@@ -597,7 +597,7 @@ void main(void)
597
597
  color *= 0.25;
598
598
 
599
599
  gl_FragColor = color;
600
- }`,l1=`
600
+ }`,a1=`
601
601
  varying vec2 vTextureCoord;
602
602
  uniform sampler2D uSampler;
603
603
 
@@ -625,7 +625,7 @@ void main(void)
625
625
 
626
626
  gl_FragColor = color;
627
627
  }
628
- `;let gi=class extends ue{constructor(e=4,r=3,i=!1){super(a1,i?l1:o1),this._kernels=[],this._blur=4,this._quality=3,this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new ge,this.pixelSize=1,this._clamp=i,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=r)}apply(e,r,i,n){const s=this._pixelSize.x/r._frame.width,a=this._pixelSize.y/r._frame.height;let o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,r,i,n);else{const u=e.getFilterTexture();let h=r,d=u,l;const c=this._quality-1;for(let f=0;f<c;f++)o=this._kernels[f]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,h,d,1),l=h,h=d,d=l;o=this._kernels[c]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,h,i,n),e.returnFilterTexture(u)}}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((e,r)=>e+r+.5,0))}_generateKernels(){const e=this._blur,r=this._quality,i=[e];if(e>0){let n=e;const s=e/r;for(let a=1;a<r;a++)n-=s,i.push(n)}this._kernels=i,this._updatePadding()}get kernels(){return this._kernels}set kernels(e){Array.isArray(e)&&e.length>0?(this._kernels=e,this._quality=e.length,this._blur=Math.max(...e)):(this._kernels=[0],this._quality=1)}get clamp(){return this._clamp}set pixelSize(e){typeof e=="number"?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof ge?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)}get pixelSize(){return this._pixelSize}get quality(){return this._quality}set quality(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()}get blur(){return this._blur}set blur(e){this._blur=e,this._generateKernels()}};var vc=`attribute vec2 aVertexPosition;
628
+ `;let di=class extends ue{constructor(e=4,r=3,i=!1){super(n1,i?a1:s1),this._kernels=[],this._blur=4,this._quality=3,this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new me,this.pixelSize=1,this._clamp=i,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=r)}apply(e,r,i,n){const s=this._pixelSize.x/r._frame.width,a=this._pixelSize.y/r._frame.height;let o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,r,i,n);else{const u=e.getFilterTexture();let h=r,d=u,l;const c=this._quality-1;for(let f=0;f<c;f++)o=this._kernels[f]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,h,d,1),l=h,h=d,d=l;o=this._kernels[c]+.5,this.uniforms.uOffset[0]=o*s,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,h,i,n),e.returnFilterTexture(u)}}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((e,r)=>e+r+.5,0))}_generateKernels(){const e=this._blur,r=this._quality,i=[e];if(e>0){let n=e;const s=e/r;for(let a=1;a<r;a++)n-=s,i.push(n)}this._kernels=i,this._updatePadding()}get kernels(){return this._kernels}set kernels(e){Array.isArray(e)&&e.length>0?(this._kernels=e,this._quality=e.length,this._blur=Math.max(...e)):(this._kernels=[0],this._quality=1)}get clamp(){return this._clamp}set pixelSize(e){typeof e=="number"?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof me?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)}get pixelSize(){return this._pixelSize}get quality(){return this._quality}set quality(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()}get blur(){return this._blur}set blur(e){this._blur=e,this._generateKernels()}};var mc=`attribute vec2 aVertexPosition;
629
629
  attribute vec2 aTextureCoord;
630
630
 
631
631
  uniform mat3 projectionMatrix;
@@ -636,7 +636,7 @@ void main(void)
636
636
  {
637
637
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
638
638
  vTextureCoord = aTextureCoord;
639
- }`,u1=`
639
+ }`,o1=`
640
640
  uniform sampler2D uSampler;
641
641
  varying vec2 vTextureCoord;
642
642
 
@@ -657,7 +657,7 @@ void main() {
657
657
  gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
658
658
  }
659
659
  }
660
- `;let c1=class extends ue{constructor(e=.5){super(vc,u1),this.threshold=e}get threshold(){return this.uniforms.threshold}set threshold(e){this.uniforms.threshold=e}};var h1=`uniform sampler2D uSampler;
660
+ `;let l1=class extends ue{constructor(e=.5){super(mc,o1),this.threshold=e}get threshold(){return this.uniforms.threshold}set threshold(e){this.uniforms.threshold=e}};var u1=`uniform sampler2D uSampler;
661
661
  varying vec2 vTextureCoord;
662
662
 
663
663
  uniform sampler2D bloomTexture;
@@ -671,7 +671,7 @@ void main() {
671
671
  bloomColor.rgb *= bloomScale;
672
672
  gl_FragColor = color + bloomColor;
673
673
  }
674
- `;const _c=class extends ue{constructor(e){super(vc,h1),this.bloomScale=1,this.brightness=1,this._resolution=Z.FILTER_RESOLUTION,typeof e=="number"&&(e={threshold:e});const r=Object.assign(_c.defaults,e);this.bloomScale=r.bloomScale,this.brightness=r.brightness;const{kernels:i,blur:n,quality:s,pixelSize:a,resolution:o}=r;this._extractFilter=new c1(r.threshold),this._extractFilter.resolution=o,this._blurFilter=i?new gi(i):new gi(n,s),this.pixelSize=a,this.resolution=o}apply(e,r,i,n,s){const a=e.getFilterTexture();this._extractFilter.apply(e,r,a,1,s);const o=e.getFilterTexture();this._blurFilter.apply(e,a,o,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=o,e.applyFilter(this,r,i,n),e.returnFilterTexture(o),e.returnFilterTexture(a)}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get threshold(){return this._extractFilter.threshold}set threshold(e){this._extractFilter.threshold=e}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let f1=_c;f1.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:Z.FILTER_RESOLUTION};var d1=`attribute vec2 aVertexPosition;
674
+ `;const gc=class extends ue{constructor(e){super(mc,u1),this.bloomScale=1,this.brightness=1,this._resolution=Q.FILTER_RESOLUTION,typeof e=="number"&&(e={threshold:e});const r=Object.assign(gc.defaults,e);this.bloomScale=r.bloomScale,this.brightness=r.brightness;const{kernels:i,blur:n,quality:s,pixelSize:a,resolution:o}=r;this._extractFilter=new l1(r.threshold),this._extractFilter.resolution=o,this._blurFilter=i?new di(i):new di(n,s),this.pixelSize=a,this.resolution=o}apply(e,r,i,n,s){const a=e.getFilterTexture();this._extractFilter.apply(e,r,a,1,s);const o=e.getFilterTexture();this._blurFilter.apply(e,a,o,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=o,e.applyFilter(this,r,i,n),e.returnFilterTexture(o),e.returnFilterTexture(a)}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get threshold(){return this._extractFilter.threshold}set threshold(e){this._extractFilter.threshold=e}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let c1=gc;c1.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:Q.FILTER_RESOLUTION};var h1=`attribute vec2 aVertexPosition;
675
675
  attribute vec2 aTextureCoord;
676
676
 
677
677
  uniform mat3 projectionMatrix;
@@ -682,7 +682,7 @@ void main(void)
682
682
  {
683
683
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
684
684
  vTextureCoord = aTextureCoord;
685
- }`,p1=`uniform float radius;
685
+ }`,f1=`uniform float radius;
686
686
  uniform float strength;
687
687
  uniform vec2 center;
688
688
  uniform sampler2D uSampler;
@@ -715,7 +715,7 @@ void main()
715
715
 
716
716
  gl_FragColor = color;
717
717
  }
718
- `;const yc=class extends ue{constructor(e){super(d1,p1),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,yc.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,e.applyFilter(this,r,i,n)}get radius(){return this.uniforms.radius}set radius(e){this.uniforms.radius=e}get strength(){return this.uniforms.strength}set strength(e){this.uniforms.strength=e}get center(){return this.uniforms.center}set center(e){this.uniforms.center=e}};let m1=yc;m1.defaults={center:[.5,.5],radius:100,strength:1};var g1=`const float PI = 3.1415926538;
718
+ `;const vc=class extends ue{constructor(e){super(h1,f1),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,vc.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,e.applyFilter(this,r,i,n)}get radius(){return this.uniforms.radius}set radius(e){this.uniforms.radius=e}get strength(){return this.uniforms.strength}set strength(e){this.uniforms.strength=e}get center(){return this.uniforms.center}set center(e){this.uniforms.center=e}};let d1=vc;d1.defaults={center:[.5,.5],radius:100,strength:1};var p1=`const float PI = 3.1415926538;
719
719
  const float PI_2 = PI*2.;
720
720
 
721
721
  varying vec2 vTextureCoord;
@@ -842,7 +842,7 @@ void main(void) {
842
842
  // mix resulting color with current color
843
843
  gl_FragColor = gradientColor + currentColor*(1.-gradientColor.a);
844
844
  }
845
- `,v1=`attribute vec2 aVertexPosition;
845
+ `,m1=`attribute vec2 aVertexPosition;
846
846
  attribute vec2 aTextureCoord;
847
847
 
848
848
  uniform mat3 projectionMatrix;
@@ -858,7 +858,7 @@ void main(void)
858
858
  vTextureCoord = aTextureCoord;
859
859
  vFilterCoord = vTextureCoord * inputSize.xy / outputFrame.zw;
860
860
  }
861
- `,tr=tr||{};tr.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var r=t.visit(e.orientation);return r&&(r+=", "),e.type+"("+r+t.visit(e.colorStops)+")"},visit_shape:function(e){var r=e.value,i=t.visit(e.at),n=t.visit(e.style);return n&&(r+=" "+n),i&&(r+=" at "+i),r},"visit_default-radial":function(e){var r="",i=t.visit(e.at);return i&&(r+=i),r},"visit_extent-keyword":function(e){var r=e.value,i=t.visit(e.at);return i&&(r+=" at "+i),r},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,r){var i=e,n=t.visit(r.length);return n&&(i+=" "+n),i},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var r="",i=e.length;return e.forEach(function(n,s){r+=t.visit(n),s<i-1&&(r+=", ")}),r},visit:function(e){if(!e)return"";var r="";if(e instanceof Array)return t.visit_array(e,r);if(e.type){var i=t["visit_"+e.type];if(i)return i(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();var tr=tr||{};tr.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function r(R){var $=new Error(e+": "+R);throw $.source=e,$}function i(){var R=n();return e.length>0&&r("Invalid input not EOF"),R}function n(){return _(s)}function s(){return a("linear-gradient",t.linearGradient,u)||a("repeating-linear-gradient",t.repeatingLinearGradient,u)||a("radial-gradient",t.radialGradient,l)||a("repeating-radial-gradient",t.repeatingRadialGradient,l)}function a(R,$,X){return o($,function(M){var O=X();return O&&(B(t.comma)||r("Missing comma before color stops")),{type:R,orientation:O,colorStops:_(x)}})}function o(R,$){var X=B(R);if(X){B(t.startCall)||r("Missing (");var M=$(X);return B(t.endCall)||r("Missing )"),M}}function u(){return h()||d()}function h(){return E("directional",t.sideOrCorner,1)}function d(){return E("angular",t.angleValue,1)}function l(){var R,$=c(),X;return $&&(R=[],R.push($),X=e,B(t.comma)&&($=c(),$?R.push($):e=X)),R}function c(){var R=f()||p();if(R)R.at=v();else{var $=m();if($){R=$;var X=v();X&&(R.at=X)}else{var M=g();M&&(R={type:"default-radial",at:M})}}return R}function f(){var R=E("shape",/^(circle)/i,0);return R&&(R.style=I()||m()),R}function p(){var R=E("shape",/^(ellipse)/i,0);return R&&(R.style=F()||m()),R}function m(){return E("extent-keyword",t.extentKeywords,1)}function v(){if(E("position",/^at/,0)){var R=g();return R||r("Missing positioning value"),R}}function g(){var R=y();if(R.x||R.y)return{type:"position",value:R}}function y(){return{x:F(),y:F()}}function _(R){var $=R(),X=[];if($)for(X.push($);B(t.comma);)$=R(),$?X.push($):r("One extra comma");return X}function x(){var R=b();return R||r("Expected color definition"),R.length=F(),R}function b(){return w()||A()||S()||T()}function T(){return E("literal",t.literalColor,0)}function w(){return E("hex",t.hexColor,1)}function S(){return o(t.rgbColor,function(){return{type:"rgb",value:_(C)}})}function A(){return o(t.rgbaColor,function(){return{type:"rgba",value:_(C)}})}function C(){return B(t.number)[1]}function F(){return E("%",t.percentageValue,1)||z()||I()}function z(){return E("position-keyword",t.positionKeywords,1)}function I(){return E("px",t.pixelValue,1)||E("em",t.emValue,1)}function E(R,$,X){var M=B($);if(M)return{type:R,value:M[X]}}function B(R){var $,X;return X=/^[\n\r\t\s]+/.exec(e),X&&U(X[0].length),$=R.exec(e),$&&U($[0].length),$}function U(R){e=e.substr(R)}return function(R){return e=R.toString(),i()}}();var _1=tr.parse;tr.stringify;var xc={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},bc={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function y1(t){var e,r=[],i=1,n;if(typeof t=="string")if(xc[t])r=xc[t].slice(),n="rgb";else if(t==="transparent")i=0,n="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1),a=s.length,o=a<=4;i=1,o?(r=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],a===4&&(i=parseInt(s[3]+s[3],16)/255)):(r=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],a===8&&(i=parseInt(s[6]+s[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),n="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var u=e[1],h=u==="rgb",s=u.replace(/a$/,"");n=s;var a=s==="cmyk"?4:s==="gray"?1:3;r=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(c,f){if(/%$/.test(c))return f===a?parseFloat(c)/100:s==="rgb"?parseFloat(c)*255/100:parseFloat(c);if(s[f]==="h"){if(/deg$/.test(c))return parseFloat(c);if(bc[c]!==void 0)return bc[c]}return parseFloat(c)}),u===s&&r.push(1),i=h||r[a]===void 0?1:r[a],r=r.slice(0,a)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(r=t.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),n=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(r=[t[0],t[1],t[2]],n="rgb",i=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(n="rgb",r=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(n="hsl",r=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),i=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(i/=100)):(n="rgb",r=[t>>>16,(t&65280)>>>8,t&255]);return{space:n,values:r,alpha:i}}var Ca={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},Ia={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,n,s,a,o,u;if(r===0)return u=i*255,[u,u,u];i<.5?s=i*(1+r):s=i+r-i*r,n=2*i-s,o=[0,0,0];for(var h=0;h<3;h++)a=e+1/3*-(h-1),a<0?a++:a>1&&a--,6*a<1?u=n+(s-n)*6*a:2*a<1?u=s:3*a<2?u=n+(s-n)*(2/3-a)*6:u=n,o[h]=u*255;return o}};Ca.hsl=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),s=Math.max(e,r,i),a=s-n,o,u,h;return s===n?o=0:e===s?o=(r-i)/a:r===s?o=2+(i-e)/a:i===s&&(o=4+(e-r)/a),o=Math.min(o*60,360),o<0&&(o+=360),h=(n+s)/2,s===n?u=0:h<=.5?u=a/(s+n):u=a/(2-s-n),[o,u*100,h*100]};function x1(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,r=y1(t);if(!r.space)return[];const i=r.space[0]==="h"?Ia.min:Ca.min,n=r.space[0]==="h"?Ia.max:Ca.max;return e=Array(3),e[0]=Math.min(Math.max(r.values[0],i[0]),n[0]),e[1]=Math.min(Math.max(r.values[1],i[1]),n[1]),e[2]=Math.min(Math.max(r.values[2],i[2]),n[2]),r.space[0]==="h"&&(e=Ia.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}function Tc(t){switch(typeof t){case"string":return b1(t);case"number":return nn(t);default:return t}}function b1(t){const e=x1(t);if(!e)throw new Error(`Unable to parse color "${t}" as RGBA.`);return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function T1(t){const e=_1(M1(t));if(e.length===0)throw new Error("Invalid CSS gradient.");if(e.length!==1)throw new Error("Unsupported CSS gradient (multiple gradients is not supported).");const r=e[0],i=w1(r.type),n=S1(r.colorStops),s=R1(r.orientation);return{type:i,stops:n,angle:s}}function w1(t){const e={"linear-gradient":0,"radial-gradient":1};if(!(t in e))throw new Error(`Unsupported gradient type "${t}"`);return e[t]}function S1(t){const e=C1(t),r=[];for(let i=0;i<t.length;i++){const n=A1(t[i]);r.push({offset:e[i],color:n.slice(0,3),alpha:n[3]})}return r}function A1(t){return Tc(E1(t))}function E1(t){switch(t.type){case"hex":return`#${t.value}`;case"literal":return t.value;default:return`${t.type}(${t.value.join(",")})`}}function C1(t){const e=[];for(let n=0;n<t.length;n++){const s=t[n];let a=-1;s.type==="literal"&&s.length&&"type"in s.length&&s.length.type==="%"&&"value"in s.length&&(a=parseFloat(s.length.value)/100),e.push(a)}const r=n=>{for(let s=n;s<e.length;s++)if(e[s]!==-1)return{indexDelta:s-n,offset:e[s]};return{indexDelta:e.length-1-n,offset:1}};let i=0;for(let n=0;n<e.length;n++){const s=e[n];if(s!==-1)i=s;else if(n===0)e[n]=0;else if(n+1===e.length)e[n]=1;else{const a=r(n),o=(a.offset-i)/(1+a.indexDelta);for(let u=0;u<=a.indexDelta;u++)e[n+u]=i+(u+1)*o;n+=a.indexDelta,i=e[n]}}return e.map(I1)}function I1(t){return t.toString().length>6?parseFloat(t.toString().substring(0,6)):t}function R1(t){if(typeof t>"u")return 0;if("type"in t&&"value"in t)switch(t.type){case"angular":return parseFloat(t.value);case"directional":return P1(t.value)}return 0}function P1(t){const e={left:270,top:0,bottom:180,right:90,"left top":315,"top left":315,"left bottom":225,"bottom left":225,"right top":45,"top right":45,"right bottom":135,"bottom right":135};if(!(t in e))throw new Error(`Unsupported directional value "${t}"`);return e[t]}function M1(t){let e=t.replace(/\s{2,}/gu," ");return e=e.replace(/;/g,""),e=e.replace(/ ,/g,","),e=e.replace(/\( /g,"("),e=e.replace(/ \)/g,")"),e.trim()}var F1=Object.defineProperty,O1=Object.defineProperties,N1=Object.getOwnPropertyDescriptors,wc=Object.getOwnPropertySymbols,k1=Object.prototype.hasOwnProperty,L1=Object.prototype.propertyIsEnumerable,Sc=(t,e,r)=>e in t?F1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ra=(t,e)=>{for(var r in e||(e={}))k1.call(e,r)&&Sc(t,r,e[r]);if(wc)for(var r of wc(e))L1.call(e,r)&&Sc(t,r,e[r]);return t},D1=(t,e)=>O1(t,N1(e));const Ac=90;function B1(t){return[...t].sort((e,r)=>e.offset-r.offset)}const Pa=class extends ue{constructor(e){e&&"css"in e&&(e=D1(Ra({},T1(e.css||"")),{alpha:e.alpha,maxColors:e.maxColors}));const r=Ra(Ra({},Pa.defaults),e);if(!r.stops||r.stops.length<2)throw new Error("ColorGradientFilter requires at least 2 color stops.");super(v1,g1),this._stops=[],this.autoFit=!1,Object.assign(this,r)}get stops(){return this._stops}set stops(e){const r=B1(e),i=new Float32Array(r.length*3),n=0,s=1,a=2;for(let o=0;o<r.length;o++){const u=Tc(r[o].color),h=o*3;i[h+n]=u[n],i[h+s]=u[s],i[h+a]=u[a]}this.uniforms.uColors=i,this.uniforms.uOffsets=r.map(o=>o.offset),this.uniforms.uAlphas=r.map(o=>o.alpha),this.uniforms.uNumStops=r.length,this._stops=r}set type(e){this.uniforms.uType=e}get type(){return this.uniforms.uType}set angle(e){this.uniforms.uAngle=e-Ac}get angle(){return this.uniforms.uAngle+Ac}set alpha(e){this.uniforms.uAlpha=e}get alpha(){return this.uniforms.uAlpha}set maxColors(e){this.uniforms.uMaxColors=e}get maxColors(){return this.uniforms.uMaxColors}};let In=Pa;In.LINEAR=0,In.RADIAL=1,In.CONIC=2,In.defaults={type:Pa.LINEAR,stops:[{offset:0,color:16711680,alpha:1},{offset:1,color:255,alpha:1}],alpha:1,angle:90,maxColors:0};var U1=`attribute vec2 aVertexPosition;
861
+ `,Jt=Jt||{};Jt.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var r=t.visit(e.orientation);return r&&(r+=", "),e.type+"("+r+t.visit(e.colorStops)+")"},visit_shape:function(e){var r=e.value,i=t.visit(e.at),n=t.visit(e.style);return n&&(r+=" "+n),i&&(r+=" at "+i),r},"visit_default-radial":function(e){var r="",i=t.visit(e.at);return i&&(r+=i),r},"visit_extent-keyword":function(e){var r=e.value,i=t.visit(e.at);return i&&(r+=" at "+i),r},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,r){var i=e,n=t.visit(r.length);return n&&(i+=" "+n),i},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var r="",i=e.length;return e.forEach(function(n,s){r+=t.visit(n),s<i-1&&(r+=", ")}),r},visit:function(e){if(!e)return"";var r="";if(e instanceof Array)return t.visit_array(e,r);if(e.type){var i=t["visit_"+e.type];if(i)return i(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();var Jt=Jt||{};Jt.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function r(R){var B=new Error(e+": "+R);throw B.source=e,B}function i(){var R=n();return e.length>0&&r("Invalid input not EOF"),R}function n(){return _(s)}function s(){return a("linear-gradient",t.linearGradient,u)||a("repeating-linear-gradient",t.repeatingLinearGradient,u)||a("radial-gradient",t.radialGradient,l)||a("repeating-radial-gradient",t.repeatingRadialGradient,l)}function a(R,B,X){return o(B,function(M){var O=X();return O&&(U(t.comma)||r("Missing comma before color stops")),{type:R,orientation:O,colorStops:_(x)}})}function o(R,B){var X=U(R);if(X){U(t.startCall)||r("Missing (");var M=B(X);return U(t.endCall)||r("Missing )"),M}}function u(){return h()||d()}function h(){return C("directional",t.sideOrCorner,1)}function d(){return C("angular",t.angleValue,1)}function l(){var R,B=c(),X;return B&&(R=[],R.push(B),X=e,U(t.comma)&&(B=c(),B?R.push(B):e=X)),R}function c(){var R=f()||p();if(R)R.at=v();else{var B=m();if(B){R=B;var X=v();X&&(R.at=X)}else{var M=g();M&&(R={type:"default-radial",at:M})}}return R}function f(){var R=C("shape",/^(circle)/i,0);return R&&(R.style=E()||m()),R}function p(){var R=C("shape",/^(ellipse)/i,0);return R&&(R.style=F()||m()),R}function m(){return C("extent-keyword",t.extentKeywords,1)}function v(){if(C("position",/^at/,0)){var R=g();return R||r("Missing positioning value"),R}}function g(){var R=y();if(R.x||R.y)return{type:"position",value:R}}function y(){return{x:F(),y:F()}}function _(R){var B=R(),X=[];if(B)for(X.push(B);U(t.comma);)B=R(),B?X.push(B):r("One extra comma");return X}function x(){var R=b();return R||r("Expected color definition"),R.length=F(),R}function b(){return w()||A()||S()||T()}function T(){return C("literal",t.literalColor,0)}function w(){return C("hex",t.hexColor,1)}function S(){return o(t.rgbColor,function(){return{type:"rgb",value:_(I)}})}function A(){return o(t.rgbaColor,function(){return{type:"rgba",value:_(I)}})}function I(){return U(t.number)[1]}function F(){return C("%",t.percentageValue,1)||$()||E()}function $(){return C("position-keyword",t.positionKeywords,1)}function E(){return C("px",t.pixelValue,1)||C("em",t.emValue,1)}function C(R,B,X){var M=U(B);if(M)return{type:R,value:M[X]}}function U(R){var B,X;return X=/^[\n\r\t\s]+/.exec(e),X&&G(X[0].length),B=R.exec(e),B&&G(B[0].length),B}function G(R){e=e.substr(R)}return function(R){return e=R.toString(),i()}}();var g1=Jt.parse;Jt.stringify;var _c={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},yc={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function v1(t){var e,r=[],i=1,n;if(typeof t=="string")if(_c[t])r=_c[t].slice(),n="rgb";else if(t==="transparent")i=0,n="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1),a=s.length,o=a<=4;i=1,o?(r=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],a===4&&(i=parseInt(s[3]+s[3],16)/255)):(r=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],a===8&&(i=parseInt(s[6]+s[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),n="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var u=e[1],h=u==="rgb",s=u.replace(/a$/,"");n=s;var a=s==="cmyk"?4:s==="gray"?1:3;r=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(c,f){if(/%$/.test(c))return f===a?parseFloat(c)/100:s==="rgb"?parseFloat(c)*255/100:parseFloat(c);if(s[f]==="h"){if(/deg$/.test(c))return parseFloat(c);if(yc[c]!==void 0)return yc[c]}return parseFloat(c)}),u===s&&r.push(1),i=h||r[a]===void 0?1:r[a],r=r.slice(0,a)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(r=t.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),n=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(r=[t[0],t[1],t[2]],n="rgb",i=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(n="rgb",r=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(n="hsl",r=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),i=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(i/=100)):(n="rgb",r=[t>>>16,(t&65280)>>>8,t&255]);return{space:n,values:r,alpha:i}}var wa={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},Sa={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,n,s,a,o,u;if(r===0)return u=i*255,[u,u,u];i<.5?s=i*(1+r):s=i+r-i*r,n=2*i-s,o=[0,0,0];for(var h=0;h<3;h++)a=e+1/3*-(h-1),a<0?a++:a>1&&a--,6*a<1?u=n+(s-n)*6*a:2*a<1?u=s:3*a<2?u=n+(s-n)*(2/3-a)*6:u=n,o[h]=u*255;return o}};wa.hsl=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),s=Math.max(e,r,i),a=s-n,o,u,h;return s===n?o=0:e===s?o=(r-i)/a:r===s?o=2+(i-e)/a:i===s&&(o=4+(e-r)/a),o=Math.min(o*60,360),o<0&&(o+=360),h=(n+s)/2,s===n?u=0:h<=.5?u=a/(s+n):u=a/(2-s-n),[o,u*100,h*100]};function _1(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,r=v1(t);if(!r.space)return[];const i=r.space[0]==="h"?Sa.min:wa.min,n=r.space[0]==="h"?Sa.max:wa.max;return e=Array(3),e[0]=Math.min(Math.max(r.values[0],i[0]),n[0]),e[1]=Math.min(Math.max(r.values[1],i[1]),n[1]),e[2]=Math.min(Math.max(r.values[2],i[2]),n[2]),r.space[0]==="h"&&(e=Sa.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}function xc(t){switch(typeof t){case"string":return y1(t);case"number":return en(t);default:return t}}function y1(t){const e=_1(t);if(!e)throw new Error(`Unable to parse color "${t}" as RGBA.`);return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function x1(t){const e=g1(R1(t));if(e.length===0)throw new Error("Invalid CSS gradient.");if(e.length!==1)throw new Error("Unsupported CSS gradient (multiple gradients is not supported).");const r=e[0],i=b1(r.type),n=T1(r.colorStops),s=C1(r.orientation);return{type:i,stops:n,angle:s}}function b1(t){const e={"linear-gradient":0,"radial-gradient":1};if(!(t in e))throw new Error(`Unsupported gradient type "${t}"`);return e[t]}function T1(t){const e=A1(t),r=[];for(let i=0;i<t.length;i++){const n=w1(t[i]);r.push({offset:e[i],color:n.slice(0,3),alpha:n[3]})}return r}function w1(t){return xc(S1(t))}function S1(t){switch(t.type){case"hex":return`#${t.value}`;case"literal":return t.value;default:return`${t.type}(${t.value.join(",")})`}}function A1(t){const e=[];for(let n=0;n<t.length;n++){const s=t[n];let a=-1;s.type==="literal"&&s.length&&"type"in s.length&&s.length.type==="%"&&"value"in s.length&&(a=parseFloat(s.length.value)/100),e.push(a)}const r=n=>{for(let s=n;s<e.length;s++)if(e[s]!==-1)return{indexDelta:s-n,offset:e[s]};return{indexDelta:e.length-1-n,offset:1}};let i=0;for(let n=0;n<e.length;n++){const s=e[n];if(s!==-1)i=s;else if(n===0)e[n]=0;else if(n+1===e.length)e[n]=1;else{const a=r(n),o=(a.offset-i)/(1+a.indexDelta);for(let u=0;u<=a.indexDelta;u++)e[n+u]=i+(u+1)*o;n+=a.indexDelta,i=e[n]}}return e.map(E1)}function E1(t){return t.toString().length>6?parseFloat(t.toString().substring(0,6)):t}function C1(t){if(typeof t>"u")return 0;if("type"in t&&"value"in t)switch(t.type){case"angular":return parseFloat(t.value);case"directional":return I1(t.value)}return 0}function I1(t){const e={left:270,top:0,bottom:180,right:90,"left top":315,"top left":315,"left bottom":225,"bottom left":225,"right top":45,"top right":45,"right bottom":135,"bottom right":135};if(!(t in e))throw new Error(`Unsupported directional value "${t}"`);return e[t]}function R1(t){let e=t.replace(/\s{2,}/gu," ");return e=e.replace(/;/g,""),e=e.replace(/ ,/g,","),e=e.replace(/\( /g,"("),e=e.replace(/ \)/g,")"),e.trim()}var P1=Object.defineProperty,M1=Object.defineProperties,F1=Object.getOwnPropertyDescriptors,bc=Object.getOwnPropertySymbols,O1=Object.prototype.hasOwnProperty,N1=Object.prototype.propertyIsEnumerable,Tc=(t,e,r)=>e in t?P1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Aa=(t,e)=>{for(var r in e||(e={}))O1.call(e,r)&&Tc(t,r,e[r]);if(bc)for(var r of bc(e))N1.call(e,r)&&Tc(t,r,e[r]);return t},k1=(t,e)=>M1(t,F1(e));const wc=90;function L1(t){return[...t].sort((e,r)=>e.offset-r.offset)}const Ea=class extends ue{constructor(e){e&&"css"in e&&(e=k1(Aa({},x1(e.css||"")),{alpha:e.alpha,maxColors:e.maxColors}));const r=Aa(Aa({},Ea.defaults),e);if(!r.stops||r.stops.length<2)throw new Error("ColorGradientFilter requires at least 2 color stops.");super(m1,p1),this._stops=[],this.autoFit=!1,Object.assign(this,r)}get stops(){return this._stops}set stops(e){const r=L1(e),i=new Float32Array(r.length*3),n=0,s=1,a=2;for(let o=0;o<r.length;o++){const u=xc(r[o].color),h=o*3;i[h+n]=u[n],i[h+s]=u[s],i[h+a]=u[a]}this.uniforms.uColors=i,this.uniforms.uOffsets=r.map(o=>o.offset),this.uniforms.uAlphas=r.map(o=>o.alpha),this.uniforms.uNumStops=r.length,this._stops=r}set type(e){this.uniforms.uType=e}get type(){return this.uniforms.uType}set angle(e){this.uniforms.uAngle=e-wc}get angle(){return this.uniforms.uAngle+wc}set alpha(e){this.uniforms.uAlpha=e}get alpha(){return this.uniforms.uAlpha}set maxColors(e){this.uniforms.uMaxColors=e}get maxColors(){return this.uniforms.uMaxColors}};let An=Ea;An.LINEAR=0,An.RADIAL=1,An.CONIC=2,An.defaults={type:Ea.LINEAR,stops:[{offset:0,color:16711680,alpha:1},{offset:1,color:255,alpha:1}],alpha:1,angle:90,maxColors:0};var D1=`attribute vec2 aVertexPosition;
862
862
  attribute vec2 aTextureCoord;
863
863
 
864
864
  uniform mat3 projectionMatrix;
@@ -869,7 +869,7 @@ void main(void)
869
869
  {
870
870
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
871
871
  vTextureCoord = aTextureCoord;
872
- }`,$1=`precision mediump float;
872
+ }`,B1=`precision mediump float;
873
873
 
874
874
  varying mediump vec2 vTextureCoord;
875
875
 
@@ -898,7 +898,7 @@ void main(void)
898
898
 
899
899
  gl_FragColor.a = c22.a;
900
900
  }
901
- `;let G1=class extends ue{constructor(e,r=200,i=200){super(U1,$1),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),e!==void 0&&(this.matrix=e),this.width=r,this.height=i}get matrix(){return this.uniforms.matrix}set matrix(e){e.forEach((r,i)=>{this.uniforms.matrix[i]=r})}get width(){return 1/this.uniforms.texelSize[0]}set width(e){this.uniforms.texelSize[0]=1/e}get height(){return 1/this.uniforms.texelSize[1]}set height(e){this.uniforms.texelSize[1]=1/e}};var z1=`attribute vec2 aVertexPosition;
901
+ `;let U1=class extends ue{constructor(e,r=200,i=200){super(D1,B1),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),e!==void 0&&(this.matrix=e),this.width=r,this.height=i}get matrix(){return this.uniforms.matrix}set matrix(e){e.forEach((r,i)=>{this.uniforms.matrix[i]=r})}get width(){return 1/this.uniforms.texelSize[0]}set width(e){this.uniforms.texelSize[0]=1/e}get height(){return 1/this.uniforms.texelSize[1]}set height(e){this.uniforms.texelSize[1]=1/e}};var $1=`attribute vec2 aVertexPosition;
902
902
  attribute vec2 aTextureCoord;
903
903
 
904
904
  uniform mat3 projectionMatrix;
@@ -909,7 +909,7 @@ void main(void)
909
909
  {
910
910
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
911
911
  vTextureCoord = aTextureCoord;
912
- }`,j1=`varying vec2 vTextureCoord;
912
+ }`,G1=`varying vec2 vTextureCoord;
913
913
  uniform sampler2D uSampler;
914
914
 
915
915
  uniform vec4 filterArea;
@@ -975,7 +975,7 @@ void main(void)
975
975
 
976
976
  gl_FragColor.rgb = rgb;
977
977
  }
978
- `;const Ec=class extends ue{constructor(e){super(z1,j1),this.time=0,this.seed=0,this.uniforms.dimensions=new Float32Array(2),Object.assign(this,Ec.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}set curvature(e){this.uniforms.curvature=e}get curvature(){return this.uniforms.curvature}set lineWidth(e){this.uniforms.lineWidth=e}get lineWidth(){return this.uniforms.lineWidth}set lineContrast(e){this.uniforms.lineContrast=e}get lineContrast(){return this.uniforms.lineContrast}set verticalLine(e){this.uniforms.verticalLine=e}get verticalLine(){return this.uniforms.verticalLine}set noise(e){this.uniforms.noise=e}get noise(){return this.uniforms.noise}set noiseSize(e){this.uniforms.noiseSize=e}get noiseSize(){return this.uniforms.noiseSize}set vignetting(e){this.uniforms.vignetting=e}get vignetting(){return this.uniforms.vignetting}set vignettingAlpha(e){this.uniforms.vignettingAlpha=e}get vignettingAlpha(){return this.uniforms.vignettingAlpha}set vignettingBlur(e){this.uniforms.vignettingBlur=e}get vignettingBlur(){return this.uniforms.vignettingBlur}};let H1=Ec;H1.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0};var V1=`attribute vec2 aVertexPosition;
978
+ `;const Sc=class extends ue{constructor(e){super($1,G1),this.time=0,this.seed=0,this.uniforms.dimensions=new Float32Array(2),Object.assign(this,Sc.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}set curvature(e){this.uniforms.curvature=e}get curvature(){return this.uniforms.curvature}set lineWidth(e){this.uniforms.lineWidth=e}get lineWidth(){return this.uniforms.lineWidth}set lineContrast(e){this.uniforms.lineContrast=e}get lineContrast(){return this.uniforms.lineContrast}set verticalLine(e){this.uniforms.verticalLine=e}get verticalLine(){return this.uniforms.verticalLine}set noise(e){this.uniforms.noise=e}get noise(){return this.uniforms.noise}set noiseSize(e){this.uniforms.noiseSize=e}get noiseSize(){return this.uniforms.noiseSize}set vignetting(e){this.uniforms.vignetting=e}get vignetting(){return this.uniforms.vignetting}set vignettingAlpha(e){this.uniforms.vignettingAlpha=e}get vignettingAlpha(){return this.uniforms.vignettingAlpha}set vignettingBlur(e){this.uniforms.vignettingBlur=e}get vignettingBlur(){return this.uniforms.vignettingBlur}};let z1=Sc;z1.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0};var j1=`attribute vec2 aVertexPosition;
979
979
  attribute vec2 aTextureCoord;
980
980
 
981
981
  uniform mat3 projectionMatrix;
@@ -986,7 +986,7 @@ void main(void)
986
986
  {
987
987
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
988
988
  vTextureCoord = aTextureCoord;
989
- }`,X1=`varying vec2 vTextureCoord;
989
+ }`,H1=`varying vec2 vTextureCoord;
990
990
  uniform sampler2D uSampler;
991
991
  uniform float alpha;
992
992
  uniform vec3 color;
@@ -1004,7 +1004,7 @@ void main(void){
1004
1004
  sample *= alpha;
1005
1005
 
1006
1006
  gl_FragColor = sample;
1007
- }`,W1=Object.defineProperty,Cc=Object.getOwnPropertySymbols,q1=Object.prototype.hasOwnProperty,Y1=Object.prototype.propertyIsEnumerable,Ic=(t,e,r)=>e in t?W1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rc=(t,e)=>{for(var r in e||(e={}))q1.call(e,r)&&Ic(t,r,e[r]);if(Cc)for(var r of Cc(e))Y1.call(e,r)&&Ic(t,r,e[r]);return t};const Ma=class extends ue{constructor(e){super(),this.angle=45,this._distance=5,this._resolution=Z.FILTER_RESOLUTION;const r=e?Rc(Rc({},Ma.defaults),e):Ma.defaults,{kernels:i,blur:n,quality:s,pixelSize:a,resolution:o}=r;this._offset=new Jt(this._updatePadding,this),this._tintFilter=new ue(V1,X1),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=this._offset,this._tintFilter.resolution=o,this._blurFilter=i?new gi(i):new gi(n,s),this.pixelSize=a,this.resolution=o;const{shadowOnly:u,rotation:h,distance:d,offset:l,alpha:c,color:f}=r;this.shadowOnly=u,h!==void 0&&d!==void 0?(this.rotation=h,this.distance=d):this.offset=l,this.alpha=c,this.color=f}apply(e,r,i,n){const s=e.getFilterTexture();this._tintFilter.apply(e,r,s,1),this._blurFilter.apply(e,s,i,n),this.shadowOnly!==!0&&e.applyFilter(this,r,i,0),e.returnFilterTexture(s)}_updatePadding(){const e=Math.max(Math.abs(this._offset.x),Math.abs(this._offset.y));this.padding=e+this.blur*2}_updateShift(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))}set offset(e){this._offset.copyFrom(e),this._updatePadding()}get offset(){return this._offset}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get distance(){return this._distance}set distance(e){re("5.3.0","DropShadowFilter distance is deprecated, use offset"),this._distance=e,this._updatePadding(),this._updateShift()}get rotation(){return this.angle/ui}set rotation(e){re("5.3.0","DropShadowFilter rotation is deprecated, use offset"),this.angle=e*ui,this._updateShift()}get alpha(){return this._tintFilter.uniforms.alpha}set alpha(e){this._tintFilter.uniforms.alpha=e}get color(){return ea(this._tintFilter.uniforms.color)}set color(e){nn(e,this._tintFilter.uniforms.color)}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let K1=Ma;K1.defaults={offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:Z.FILTER_RESOLUTION};var Z1=`attribute vec2 aVertexPosition;
1007
+ }`,V1=Object.defineProperty,Ac=Object.getOwnPropertySymbols,X1=Object.prototype.hasOwnProperty,W1=Object.prototype.propertyIsEnumerable,Ec=(t,e,r)=>e in t?V1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cc=(t,e)=>{for(var r in e||(e={}))X1.call(e,r)&&Ec(t,r,e[r]);if(Ac)for(var r of Ac(e))W1.call(e,r)&&Ec(t,r,e[r]);return t};const Ca=class extends ue{constructor(e){super(),this.angle=45,this._distance=5,this._resolution=Q.FILTER_RESOLUTION;const r=e?Cc(Cc({},Ca.defaults),e):Ca.defaults,{kernels:i,blur:n,quality:s,pixelSize:a,resolution:o}=r;this._offset=new Zt(this._updatePadding,this),this._tintFilter=new ue(j1,H1),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=this._offset,this._tintFilter.resolution=o,this._blurFilter=i?new di(i):new di(n,s),this.pixelSize=a,this.resolution=o;const{shadowOnly:u,rotation:h,distance:d,offset:l,alpha:c,color:f}=r;this.shadowOnly=u,h!==void 0&&d!==void 0?(this.rotation=h,this.distance=d):this.offset=l,this.alpha=c,this.color=f}apply(e,r,i,n){const s=e.getFilterTexture();this._tintFilter.apply(e,r,s,1),this._blurFilter.apply(e,s,i,n),this.shadowOnly!==!0&&e.applyFilter(this,r,i,0),e.returnFilterTexture(s)}_updatePadding(){const e=Math.max(Math.abs(this._offset.x),Math.abs(this._offset.y));this.padding=e+this.blur*2}_updateShift(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))}set offset(e){this._offset.copyFrom(e),this._updatePadding()}get offset(){return this._offset}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get distance(){return this._distance}set distance(e){re("5.3.0","DropShadowFilter distance is deprecated, use offset"),this._distance=e,this._updatePadding(),this._updateShift()}get rotation(){return this.angle/ai}set rotation(e){re("5.3.0","DropShadowFilter rotation is deprecated, use offset"),this.angle=e*ai,this._updateShift()}get alpha(){return this._tintFilter.uniforms.alpha}set alpha(e){this._tintFilter.uniforms.alpha=e}get color(){return Ks(this._tintFilter.uniforms.color)}set color(e){en(e,this._tintFilter.uniforms.color)}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let q1=Ca;q1.defaults={offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:Q.FILTER_RESOLUTION};var Y1=`attribute vec2 aVertexPosition;
1008
1008
  attribute vec2 aTextureCoord;
1009
1009
 
1010
1010
  uniform mat3 projectionMatrix;
@@ -1015,7 +1015,7 @@ void main(void)
1015
1015
  {
1016
1016
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1017
1017
  vTextureCoord = aTextureCoord;
1018
- }`,Q1=`// precision highp float;
1018
+ }`,K1=`// precision highp float;
1019
1019
 
1020
1020
  varying vec2 vTextureCoord;
1021
1021
  uniform sampler2D uSampler;
@@ -1111,7 +1111,7 @@ void main(void)
1111
1111
  gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;
1112
1112
  gl_FragColor.a = texture2D(uSampler, coord).a;
1113
1113
  }
1114
- `;const Fa=class extends ue{constructor(e){super(Z1,Q1),this.offset=100,this.fillMode=Fa.TRANSPARENT,this.average=!1,this.seed=0,this.minSize=8,this.sampleSize=512,this._slices=0,this._offsets=new Float32Array(1),this._sizes=new Float32Array(1),this._direction=-1,this.uniforms.dimensions=new Float32Array(2),this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=ie.from(this._canvas,{scaleMode:dt.NEAREST}),Object.assign(this,Fa.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/s,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,r,i,n)}_randomizeSizes(){const e=this._sizes,r=this._slices-1,i=this.sampleSize,n=Math.min(this.minSize/i,.9/this._slices);if(this.average){const s=this._slices;let a=1;for(let o=0;o<r;o++){const u=a/(s-o),h=Math.max(u*(1-Math.random()*.6),n);e[o]=h,a-=h}e[r]=a}else{let s=1;const a=Math.sqrt(1/this._slices);for(let o=0;o<r;o++){const u=Math.max(a*s*Math.random(),n);e[o]=u,s-=u}e[r]=s}this.shuffle()}shuffle(){const e=this._sizes,r=this._slices-1;for(let i=r;i>0;i--){const n=Math.random()*i>>0,s=e[i];e[i]=e[n],e[n]=s}}_randomizeOffsets(){for(let e=0;e<this._slices;e++)this._offsets[e]=Math.random()*(Math.random()<.5?-1:1)}refresh(){this._randomizeSizes(),this._randomizeOffsets(),this.redraw()}redraw(){const e=this.sampleSize,r=this.texture,i=this._canvas.getContext("2d");i.clearRect(0,0,8,e);let n,s=0;for(let a=0;a<this._slices;a++){n=Math.floor(this._offsets[a]*256);const o=this._sizes[a]*e,u=n>0?n:0,h=n<0?-n:0;i.fillStyle=`rgba(${u}, ${h}, 0, 1)`,i.fillRect(0,s>>0,e,o+1>>0),s+=o}r.baseTexture.update(),this.uniforms.displacementMap=r}set sizes(e){const r=Math.min(this._slices,e.length);for(let i=0;i<r;i++)this._sizes[i]=e[i]}get sizes(){return this._sizes}set offsets(e){const r=Math.min(this._slices,e.length);for(let i=0;i<r;i++)this._offsets[i]=e[i]}get offsets(){return this._offsets}get slices(){return this._slices}set slices(e){this._slices!==e&&(this._slices=e,this.uniforms.slices=e,this._sizes=this.uniforms.slicesWidth=new Float32Array(e),this._offsets=this.uniforms.slicesOffset=new Float32Array(e),this.refresh())}get direction(){return this._direction}set direction(e){if(this._direction===e)return;this._direction=e;const r=e*ui;this.uniforms.sinDir=Math.sin(r),this.uniforms.cosDir=Math.cos(r)}get red(){return this.uniforms.red}set red(e){this.uniforms.red=e}get green(){return this.uniforms.green}set green(e){this.uniforms.green=e}get blue(){return this.uniforms.blue}set blue(e){this.uniforms.blue=e}destroy(){var e;(e=this.texture)==null||e.destroy(!0),this.texture=this._canvas=this.red=this.green=this.blue=this._sizes=this._offsets=null}};let Nr=Fa;Nr.defaults={slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},Nr.TRANSPARENT=0,Nr.ORIGINAL=1,Nr.LOOP=2,Nr.CLAMP=3,Nr.MIRROR=4;var J1=`attribute vec2 aVertexPosition;
1114
+ `;const Ia=class extends ue{constructor(e){super(Y1,K1),this.offset=100,this.fillMode=Ia.TRANSPARENT,this.average=!1,this.seed=0,this.minSize=8,this.sampleSize=512,this._slices=0,this._offsets=new Float32Array(1),this._sizes=new Float32Array(1),this._direction=-1,this.uniforms.dimensions=new Float32Array(2),this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=ie.from(this._canvas,{scaleMode:dt.NEAREST}),Object.assign(this,Ia.defaults,e)}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/s,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,r,i,n)}_randomizeSizes(){const e=this._sizes,r=this._slices-1,i=this.sampleSize,n=Math.min(this.minSize/i,.9/this._slices);if(this.average){const s=this._slices;let a=1;for(let o=0;o<r;o++){const u=a/(s-o),h=Math.max(u*(1-Math.random()*.6),n);e[o]=h,a-=h}e[r]=a}else{let s=1;const a=Math.sqrt(1/this._slices);for(let o=0;o<r;o++){const u=Math.max(a*s*Math.random(),n);e[o]=u,s-=u}e[r]=s}this.shuffle()}shuffle(){const e=this._sizes,r=this._slices-1;for(let i=r;i>0;i--){const n=Math.random()*i>>0,s=e[i];e[i]=e[n],e[n]=s}}_randomizeOffsets(){for(let e=0;e<this._slices;e++)this._offsets[e]=Math.random()*(Math.random()<.5?-1:1)}refresh(){this._randomizeSizes(),this._randomizeOffsets(),this.redraw()}redraw(){const e=this.sampleSize,r=this.texture,i=this._canvas.getContext("2d");i.clearRect(0,0,8,e);let n,s=0;for(let a=0;a<this._slices;a++){n=Math.floor(this._offsets[a]*256);const o=this._sizes[a]*e,u=n>0?n:0,h=n<0?-n:0;i.fillStyle=`rgba(${u}, ${h}, 0, 1)`,i.fillRect(0,s>>0,e,o+1>>0),s+=o}r.baseTexture.update(),this.uniforms.displacementMap=r}set sizes(e){const r=Math.min(this._slices,e.length);for(let i=0;i<r;i++)this._sizes[i]=e[i]}get sizes(){return this._sizes}set offsets(e){const r=Math.min(this._slices,e.length);for(let i=0;i<r;i++)this._offsets[i]=e[i]}get offsets(){return this._offsets}get slices(){return this._slices}set slices(e){this._slices!==e&&(this._slices=e,this.uniforms.slices=e,this._sizes=this.uniforms.slicesWidth=new Float32Array(e),this._offsets=this.uniforms.slicesOffset=new Float32Array(e),this.refresh())}get direction(){return this._direction}set direction(e){if(this._direction===e)return;this._direction=e;const r=e*ai;this.uniforms.sinDir=Math.sin(r),this.uniforms.cosDir=Math.cos(r)}get red(){return this.uniforms.red}set red(e){this.uniforms.red=e}get green(){return this.uniforms.green}set green(e){this.uniforms.green=e}get blue(){return this.uniforms.blue}set blue(e){this.uniforms.blue=e}destroy(){var e;(e=this.texture)==null||e.destroy(!0),this.texture=this._canvas=this.red=this.green=this.blue=this._sizes=this._offsets=null}};let Fr=Ia;Fr.defaults={slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},Fr.TRANSPARENT=0,Fr.ORIGINAL=1,Fr.LOOP=2,Fr.CLAMP=3,Fr.MIRROR=4;var Z1=`attribute vec2 aVertexPosition;
1115
1115
  attribute vec2 aTextureCoord;
1116
1116
 
1117
1117
  uniform mat3 projectionMatrix;
@@ -1122,7 +1122,7 @@ void main(void)
1122
1122
  {
1123
1123
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1124
1124
  vTextureCoord = aTextureCoord;
1125
- }`,eT=`varying vec2 vTextureCoord;
1125
+ }`,Q1=`varying vec2 vTextureCoord;
1126
1126
  varying vec4 vColor;
1127
1127
 
1128
1128
  uniform sampler2D uSampler;
@@ -1188,7 +1188,7 @@ void main(void) {
1188
1188
  gl_FragColor = innerColor + outerGlowColor;
1189
1189
  }
1190
1190
  }
1191
- `;const Pc=class extends ue{constructor(t){const e=Object.assign({},Pc.defaults,t),{outerStrength:r,innerStrength:i,color:n,knockout:s,quality:a,alpha:o}=e,u=Math.round(e.distance);super(J1,eT.replace(/__ANGLE_STEP_SIZE__/gi,`${(1/a/u).toFixed(7)}`).replace(/__DIST__/gi,`${u.toFixed(0)}.0`)),this.uniforms.glowColor=new Float32Array([0,0,0,1]),this.uniforms.alpha=1,Object.assign(this,{color:n,outerStrength:r,innerStrength:i,padding:u,knockout:s,alpha:o})}get color(){return ea(this.uniforms.glowColor)}set color(t){nn(t,this.uniforms.glowColor)}get outerStrength(){return this.uniforms.outerStrength}set outerStrength(t){this.uniforms.outerStrength=t}get innerStrength(){return this.uniforms.innerStrength}set innerStrength(t){this.uniforms.innerStrength=t}get knockout(){return this.uniforms.knockout}set knockout(t){this.uniforms.knockout=t}get alpha(){return this.uniforms.alpha}set alpha(t){this.uniforms.alpha=t}};let tT=Pc;tT.defaults={distance:10,outerStrength:4,innerStrength:0,color:16777215,quality:.1,knockout:!1,alpha:1};var rT=`attribute vec2 aVertexPosition;
1191
+ `;const Ic=class extends ue{constructor(t){const e=Object.assign({},Ic.defaults,t),{outerStrength:r,innerStrength:i,color:n,knockout:s,quality:a,alpha:o}=e,u=Math.round(e.distance);super(Z1,Q1.replace(/__ANGLE_STEP_SIZE__/gi,`${(1/a/u).toFixed(7)}`).replace(/__DIST__/gi,`${u.toFixed(0)}.0`)),this.uniforms.glowColor=new Float32Array([0,0,0,1]),this.uniforms.alpha=1,Object.assign(this,{color:n,outerStrength:r,innerStrength:i,padding:u,knockout:s,alpha:o})}get color(){return Ks(this.uniforms.glowColor)}set color(t){en(t,this.uniforms.glowColor)}get outerStrength(){return this.uniforms.outerStrength}set outerStrength(t){this.uniforms.outerStrength=t}get innerStrength(){return this.uniforms.innerStrength}set innerStrength(t){this.uniforms.innerStrength=t}get knockout(){return this.uniforms.knockout}set knockout(t){this.uniforms.knockout=t}get alpha(){return this.uniforms.alpha}set alpha(t){this.uniforms.alpha=t}};let J1=Ic;J1.defaults={distance:10,outerStrength:4,innerStrength:0,color:16777215,quality:.1,knockout:!1,alpha:1};var eT=`attribute vec2 aVertexPosition;
1192
1192
  attribute vec2 aTextureCoord;
1193
1193
 
1194
1194
  uniform mat3 projectionMatrix;
@@ -1199,7 +1199,7 @@ void main(void)
1199
1199
  {
1200
1200
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1201
1201
  vTextureCoord = aTextureCoord;
1202
- }`,iT=`vec3 mod289(vec3 x)
1202
+ }`,tT=`vec3 mod289(vec3 x)
1203
1203
  {
1204
1204
  return x - floor(x * (1.0 / 289.0)) * 289.0;
1205
1205
  }
@@ -1294,7 +1294,7 @@ float turb(vec3 P, vec3 rep, float lacunarity, float gain)
1294
1294
  }
1295
1295
  return abs(sum);
1296
1296
  }
1297
- `,nT=`varying vec2 vTextureCoord;
1297
+ `,rT=`varying vec2 vTextureCoord;
1298
1298
  uniform sampler2D uSampler;
1299
1299
  uniform vec4 filterArea;
1300
1300
  uniform vec2 dimensions;
@@ -1339,7 +1339,7 @@ void main(void) {
1339
1339
  gl_FragColor = texture2D(uSampler, vTextureCoord) + mist;
1340
1340
 
1341
1341
  }
1342
- `;const Mc=class extends ue{constructor(e){super(rT,nT.replace("${perlin}",iT)),this.parallel=!0,this.time=0,this._angle=0,this.uniforms.dimensions=new Float32Array(2);const r=Object.assign(Mc.defaults,e);this._angleLight=new ge,this.angle=r.angle,this.gain=r.gain,this.lacunarity=r.lacunarity,this.alpha=r.alpha,this.parallel=r.parallel,this.center=r.center,this.time=r.time}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.light=this.parallel?this._angleLight:this.center,this.uniforms.parallel=this.parallel,this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/s,this.uniforms.time=this.time,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,i,n)}get angle(){return this._angle}set angle(e){this._angle=e;const r=e*ui;this._angleLight.x=Math.cos(r),this._angleLight.y=Math.sin(r)}get gain(){return this.uniforms.gain}set gain(e){this.uniforms.gain=e}get lacunarity(){return this.uniforms.lacunarity}set lacunarity(e){this.uniforms.lacunarity=e}get alpha(){return this.uniforms.alpha}set alpha(e){this.uniforms.alpha=e}};let sT=Mc;sT.defaults={angle:30,gain:.5,lacunarity:2.5,time:0,parallel:!0,center:[0,0],alpha:1};var aT=`attribute vec2 aVertexPosition;
1342
+ `;const Rc=class extends ue{constructor(e){super(eT,rT.replace("${perlin}",tT)),this.parallel=!0,this.time=0,this._angle=0,this.uniforms.dimensions=new Float32Array(2);const r=Object.assign(Rc.defaults,e);this._angleLight=new me,this.angle=r.angle,this.gain=r.gain,this.lacunarity=r.lacunarity,this.alpha=r.alpha,this.parallel=r.parallel,this.center=r.center,this.time=r.time}apply(e,r,i,n){const{width:s,height:a}=r.filterFrame;this.uniforms.light=this.parallel?this._angleLight:this.center,this.uniforms.parallel=this.parallel,this.uniforms.dimensions[0]=s,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/s,this.uniforms.time=this.time,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,i,n)}get angle(){return this._angle}set angle(e){this._angle=e;const r=e*ai;this._angleLight.x=Math.cos(r),this._angleLight.y=Math.sin(r)}get gain(){return this.uniforms.gain}set gain(e){this.uniforms.gain=e}get lacunarity(){return this.uniforms.lacunarity}set lacunarity(e){this.uniforms.lacunarity=e}get alpha(){return this.uniforms.alpha}set alpha(e){this.uniforms.alpha=e}};let iT=Rc;iT.defaults={angle:30,gain:.5,lacunarity:2.5,time:0,parallel:!0,center:[0,0],alpha:1};var nT=`attribute vec2 aVertexPosition;
1343
1343
  attribute vec2 aTextureCoord;
1344
1344
 
1345
1345
  uniform mat3 projectionMatrix;
@@ -1350,7 +1350,7 @@ void main(void)
1350
1350
  {
1351
1351
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1352
1352
  vTextureCoord = aTextureCoord;
1353
- }`,oT=`precision mediump float;
1353
+ }`,sT=`precision mediump float;
1354
1354
 
1355
1355
  varying vec2 vTextureCoord;
1356
1356
  uniform sampler2D uSampler;
@@ -1408,7 +1408,7 @@ void main()
1408
1408
  // alpha
1409
1409
  gl_FragColor = mix(color, result, uAlpha);
1410
1410
  }
1411
- `;const Fc=class extends ue{constructor(t){super(aT,oT),this._hue=0;const e=Object.assign({},Fc.defaults,t);Object.assign(this,e)}get hue(){return this._hue}set hue(t){this._hue=t,this.uniforms.uHue=this._hue*(Math.PI/180)}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}get colorize(){return this.uniforms.uColorize}set colorize(t){this.uniforms.uColorize=t}get lightness(){return this.uniforms.uLightness}set lightness(t){this.uniforms.uLightness=t}get saturation(){return this.uniforms.uSaturation}set saturation(t){this.uniforms.uSaturation=t}};let lT=Fc;lT.defaults={hue:0,saturation:0,lightness:0,colorize:!1,alpha:1};var uT=`attribute vec2 aVertexPosition;
1411
+ `;const Pc=class extends ue{constructor(t){super(nT,sT),this._hue=0;const e=Object.assign({},Pc.defaults,t);Object.assign(this,e)}get hue(){return this._hue}set hue(t){this._hue=t,this.uniforms.uHue=this._hue*(Math.PI/180)}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}get colorize(){return this.uniforms.uColorize}set colorize(t){this.uniforms.uColorize=t}get lightness(){return this.uniforms.uLightness}set lightness(t){this.uniforms.uLightness=t}get saturation(){return this.uniforms.uSaturation}set saturation(t){this.uniforms.uSaturation=t}};let aT=Pc;aT.defaults={hue:0,saturation:0,lightness:0,colorize:!1,alpha:1};var oT=`attribute vec2 aVertexPosition;
1412
1412
  attribute vec2 aTextureCoord;
1413
1413
 
1414
1414
  uniform mat3 projectionMatrix;
@@ -1419,7 +1419,7 @@ void main(void)
1419
1419
  {
1420
1420
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1421
1421
  vTextureCoord = aTextureCoord;
1422
- }`,cT=`varying vec2 vTextureCoord;
1422
+ }`,lT=`varying vec2 vTextureCoord;
1423
1423
  uniform sampler2D uSampler;
1424
1424
  uniform vec4 filterArea;
1425
1425
  uniform vec2 dimensions;
@@ -1523,7 +1523,7 @@ void main()
1523
1523
 
1524
1524
  gl_FragColor.rgb = color;
1525
1525
  }
1526
- `;const Oc=class extends ue{constructor(e,r=0){super(uT,cT),this.seed=0,this.uniforms.dimensions=new Float32Array(2),typeof e=="number"?(this.seed=e,e=void 0):this.seed=r,Object.assign(this,Oc.defaults,e)}apply(e,r,i,n){var s,a;this.uniforms.dimensions[0]=(s=r.filterFrame)==null?void 0:s.width,this.uniforms.dimensions[1]=(a=r.filterFrame)==null?void 0:a.height,this.uniforms.seed=this.seed,e.applyFilter(this,r,i,n)}set sepia(e){this.uniforms.sepia=e}get sepia(){return this.uniforms.sepia}set noise(e){this.uniforms.noise=e}get noise(){return this.uniforms.noise}set noiseSize(e){this.uniforms.noiseSize=e}get noiseSize(){return this.uniforms.noiseSize}set scratch(e){this.uniforms.scratch=e}get scratch(){return this.uniforms.scratch}set scratchDensity(e){this.uniforms.scratchDensity=e}get scratchDensity(){return this.uniforms.scratchDensity}set scratchWidth(e){this.uniforms.scratchWidth=e}get scratchWidth(){return this.uniforms.scratchWidth}set vignetting(e){this.uniforms.vignetting=e}get vignetting(){return this.uniforms.vignetting}set vignettingAlpha(e){this.uniforms.vignettingAlpha=e}get vignettingAlpha(){return this.uniforms.vignettingAlpha}set vignettingBlur(e){this.uniforms.vignettingBlur=e}get vignettingBlur(){return this.uniforms.vignettingBlur}};let Nc=Oc;Nc.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3};var hT=`attribute vec2 aVertexPosition;
1526
+ `;const Mc=class extends ue{constructor(e,r=0){super(oT,lT),this.seed=0,this.uniforms.dimensions=new Float32Array(2),typeof e=="number"?(this.seed=e,e=void 0):this.seed=r,Object.assign(this,Mc.defaults,e)}apply(e,r,i,n){var s,a;this.uniforms.dimensions[0]=(s=r.filterFrame)==null?void 0:s.width,this.uniforms.dimensions[1]=(a=r.filterFrame)==null?void 0:a.height,this.uniforms.seed=this.seed,e.applyFilter(this,r,i,n)}set sepia(e){this.uniforms.sepia=e}get sepia(){return this.uniforms.sepia}set noise(e){this.uniforms.noise=e}get noise(){return this.uniforms.noise}set noiseSize(e){this.uniforms.noiseSize=e}get noiseSize(){return this.uniforms.noiseSize}set scratch(e){this.uniforms.scratch=e}get scratch(){return this.uniforms.scratch}set scratchDensity(e){this.uniforms.scratchDensity=e}get scratchDensity(){return this.uniforms.scratchDensity}set scratchWidth(e){this.uniforms.scratchWidth=e}get scratchWidth(){return this.uniforms.scratchWidth}set vignetting(e){this.uniforms.vignetting=e}get vignetting(){return this.uniforms.vignetting}set vignettingAlpha(e){this.uniforms.vignettingAlpha=e}get vignettingAlpha(){return this.uniforms.vignettingAlpha}set vignettingBlur(e){this.uniforms.vignettingBlur=e}get vignettingBlur(){return this.uniforms.vignettingBlur}};let Fc=Mc;Fc.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3};var uT=`attribute vec2 aVertexPosition;
1527
1527
  attribute vec2 aTextureCoord;
1528
1528
 
1529
1529
  uniform mat3 projectionMatrix;
@@ -1534,7 +1534,7 @@ void main(void)
1534
1534
  {
1535
1535
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1536
1536
  vTextureCoord = aTextureCoord;
1537
- }`,fT=`varying vec2 vTextureCoord;
1537
+ }`,cT=`varying vec2 vTextureCoord;
1538
1538
  uniform sampler2D uSampler;
1539
1539
  uniform vec4 filterClamp;
1540
1540
 
@@ -1572,7 +1572,7 @@ void main(void) {
1572
1572
  vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);
1573
1573
  gl_FragColor = contentColor + outlineColor;
1574
1574
  }
1575
- `;const Rn=class extends ue{constructor(e=1,r=0,i=.1,n=1,s=!1){super(hT,fT.replace(/\$\{angleStep\}/,Rn.getAngleStep(i))),this._thickness=1,this._alpha=1,this._knockout=!1,this.uniforms.uThickness=new Float32Array([0,0]),this.uniforms.uColor=new Float32Array([0,0,0,1]),this.uniforms.uAlpha=n,this.uniforms.uKnockout=s,Object.assign(this,{thickness:e,color:r,quality:i,alpha:n,knockout:s})}static getAngleStep(e){const r=Math.max(e*Rn.MAX_SAMPLES,Rn.MIN_SAMPLES);return(Math.PI*2/r).toFixed(7)}apply(e,r,i,n){this.uniforms.uThickness[0]=this._thickness/r._frame.width,this.uniforms.uThickness[1]=this._thickness/r._frame.height,this.uniforms.uAlpha=this._alpha,this.uniforms.uKnockout=this._knockout,e.applyFilter(this,r,i,n)}get alpha(){return this._alpha}set alpha(e){this._alpha=e}get color(){return ea(this.uniforms.uColor)}set color(e){nn(e,this.uniforms.uColor)}get knockout(){return this._knockout}set knockout(e){this._knockout=e}get thickness(){return this._thickness}set thickness(e){this._thickness=e,this.padding=e}};let kc=Rn;kc.MIN_SAMPLES=1,kc.MAX_SAMPLES=100;var dT=`attribute vec2 aVertexPosition;
1575
+ `;const En=class extends ue{constructor(e=1,r=0,i=.1,n=1,s=!1){super(uT,cT.replace(/\$\{angleStep\}/,En.getAngleStep(i))),this._thickness=1,this._alpha=1,this._knockout=!1,this.uniforms.uThickness=new Float32Array([0,0]),this.uniforms.uColor=new Float32Array([0,0,0,1]),this.uniforms.uAlpha=n,this.uniforms.uKnockout=s,Object.assign(this,{thickness:e,color:r,quality:i,alpha:n,knockout:s})}static getAngleStep(e){const r=Math.max(e*En.MAX_SAMPLES,En.MIN_SAMPLES);return(Math.PI*2/r).toFixed(7)}apply(e,r,i,n){this.uniforms.uThickness[0]=this._thickness/r._frame.width,this.uniforms.uThickness[1]=this._thickness/r._frame.height,this.uniforms.uAlpha=this._alpha,this.uniforms.uKnockout=this._knockout,e.applyFilter(this,r,i,n)}get alpha(){return this._alpha}set alpha(e){this._alpha=e}get color(){return Ks(this.uniforms.uColor)}set color(e){en(e,this.uniforms.uColor)}get knockout(){return this._knockout}set knockout(e){this._knockout=e}get thickness(){return this._thickness}set thickness(e){this._thickness=e,this.padding=e}};let Oc=En;Oc.MIN_SAMPLES=1,Oc.MAX_SAMPLES=100;var hT=`attribute vec2 aVertexPosition;
1576
1576
  attribute vec2 aTextureCoord;
1577
1577
 
1578
1578
  uniform mat3 projectionMatrix;
@@ -1583,7 +1583,7 @@ void main(void)
1583
1583
  {
1584
1584
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1585
1585
  vTextureCoord = aTextureCoord;
1586
- }`,pT=`varying vec2 vTextureCoord;
1586
+ }`,fT=`varying vec2 vTextureCoord;
1587
1587
  uniform sampler2D uSampler;
1588
1588
 
1589
1589
  uniform vec4 filterArea;
@@ -1627,7 +1627,7 @@ void main(void)
1627
1627
 
1628
1628
  gl_FragColor = color * _alpha;
1629
1629
  }
1630
- `;const Lc=class extends ue{constructor(e){super(dT,pT),this.time=0,this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,Lc.defaults,e)}apply(e,r,i,n){var s,a;this.uniforms.dimensions[0]=(s=r.filterFrame)==null?void 0:s.width,this.uniforms.dimensions[1]=(a=r.filterFrame)==null?void 0:a.height,this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}set mirror(e){this.uniforms.mirror=e}get mirror(){return this.uniforms.mirror}set boundary(e){this.uniforms.boundary=e}get boundary(){return this.uniforms.boundary}set amplitude(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]}get amplitude(){return this.uniforms.amplitude}set waveLength(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]}get waveLength(){return this.uniforms.waveLength}set alpha(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]}get alpha(){return this.uniforms.alpha}};let mT=Lc;mT.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0};var gT=`attribute vec2 aVertexPosition;
1630
+ `;const Nc=class extends ue{constructor(e){super(hT,fT),this.time=0,this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,Nc.defaults,e)}apply(e,r,i,n){var s,a;this.uniforms.dimensions[0]=(s=r.filterFrame)==null?void 0:s.width,this.uniforms.dimensions[1]=(a=r.filterFrame)==null?void 0:a.height,this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}set mirror(e){this.uniforms.mirror=e}get mirror(){return this.uniforms.mirror}set boundary(e){this.uniforms.boundary=e}get boundary(){return this.uniforms.boundary}set amplitude(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]}get amplitude(){return this.uniforms.amplitude}set waveLength(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]}get waveLength(){return this.uniforms.waveLength}set alpha(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]}get alpha(){return this.uniforms.alpha}};let dT=Nc;dT.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0};var pT=`attribute vec2 aVertexPosition;
1631
1631
  attribute vec2 aTextureCoord;
1632
1632
 
1633
1633
  uniform mat3 projectionMatrix;
@@ -1638,7 +1638,7 @@ void main(void)
1638
1638
  {
1639
1639
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1640
1640
  vTextureCoord = aTextureCoord;
1641
- }`,vT=`varying vec2 vTextureCoord;
1641
+ }`,mT=`varying vec2 vTextureCoord;
1642
1642
  uniform sampler2D uSampler;
1643
1643
  uniform vec4 filterArea;
1644
1644
  uniform vec4 filterClamp;
@@ -1707,7 +1707,7 @@ void main()
1707
1707
 
1708
1708
  gl_FragColor = color;
1709
1709
  }
1710
- `;const Dc=class extends ue{constructor(e=[0,0],r,i=0){super(gT,vT),this.center=e,Object.assign(this,Dc.defaults,r),this.time=i}apply(e,r,i,n){this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}get center(){return this.uniforms.center}set center(e){this.uniforms.center=e}get amplitude(){return this.uniforms.amplitude}set amplitude(e){this.uniforms.amplitude=e}get wavelength(){return this.uniforms.wavelength}set wavelength(e){this.uniforms.wavelength=e}get brightness(){return this.uniforms.brightness}set brightness(e){this.uniforms.brightness=e}get speed(){return this.uniforms.speed}set speed(e){this.uniforms.speed=e}get radius(){return this.uniforms.radius}set radius(e){this.uniforms.radius=e}};let _T=Dc;_T.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1};var yT=`attribute vec2 aVertexPosition;
1710
+ `;const kc=class extends ue{constructor(e=[0,0],r,i=0){super(pT,mT),this.center=e,Object.assign(this,kc.defaults,r),this.time=i}apply(e,r,i,n){this.uniforms.time=this.time,e.applyFilter(this,r,i,n)}get center(){return this.uniforms.center}set center(e){this.uniforms.center=e}get amplitude(){return this.uniforms.amplitude}set amplitude(e){this.uniforms.amplitude=e}get wavelength(){return this.uniforms.wavelength}set wavelength(e){this.uniforms.wavelength=e}get brightness(){return this.uniforms.brightness}set brightness(e){this.uniforms.brightness=e}get speed(){return this.uniforms.speed}set speed(e){this.uniforms.speed=e}get radius(){return this.uniforms.radius}set radius(e){this.uniforms.radius=e}};let gT=kc;gT.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1};var vT=`attribute vec2 aVertexPosition;
1711
1711
  attribute vec2 aTextureCoord;
1712
1712
 
1713
1713
  uniform mat3 projectionMatrix;
@@ -1718,7 +1718,7 @@ void main(void)
1718
1718
  {
1719
1719
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1720
1720
  vTextureCoord = aTextureCoord;
1721
- }`,xT=`varying vec2 vTextureCoord;
1721
+ }`,_T=`varying vec2 vTextureCoord;
1722
1722
 
1723
1723
  uniform sampler2D uSampler;
1724
1724
  uniform float blur;
@@ -1757,7 +1757,7 @@ void main(void)
1757
1757
 
1758
1758
  gl_FragColor = color;
1759
1759
  }
1760
- `;let Bc=class extends ue{constructor(e){var r,i;super(yT,xT),this.uniforms.blur=e.blur,this.uniforms.gradientBlur=e.gradientBlur,this.uniforms.start=(r=e.start)!=null?r:new ge(0,window.innerHeight/2),this.uniforms.end=(i=e.end)!=null?i:new ge(600,window.innerHeight/2),this.uniforms.delta=new ge(30,30),this.uniforms.texSize=new ge(window.innerWidth,window.innerHeight),this.updateDelta()}updateDelta(){this.uniforms.delta.x=0,this.uniforms.delta.y=0}get blur(){return this.uniforms.blur}set blur(e){this.uniforms.blur=e}get gradientBlur(){return this.uniforms.gradientBlur}set gradientBlur(e){this.uniforms.gradientBlur=e}get start(){return this.uniforms.start}set start(e){this.uniforms.start=e,this.updateDelta()}get end(){return this.uniforms.end}set end(e){this.uniforms.end=e,this.updateDelta()}},bT=class extends Bc{updateDelta(){const e=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(e*e+r*r);this.uniforms.delta.x=e/i,this.uniforms.delta.y=r/i}},TT=class extends Bc{updateDelta(){const e=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(e*e+r*r);this.uniforms.delta.x=-r/i,this.uniforms.delta.y=e/i}};const Uc=class extends ue{constructor(e,r,i,n){super(),typeof e=="number"&&(re("5.3.0","TiltShiftFilter constructor arguments is deprecated, use options."),e={blur:e,gradientBlur:r,start:i,end:n}),e=Object.assign({},Uc.defaults,e),this.tiltShiftXFilter=new bT(e),this.tiltShiftYFilter=new TT(e)}apply(e,r,i,n){const s=e.getFilterTexture();this.tiltShiftXFilter.apply(e,r,s,1),this.tiltShiftYFilter.apply(e,s,i,n),e.returnFilterTexture(s)}get blur(){return this.tiltShiftXFilter.blur}set blur(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e}get gradientBlur(){return this.tiltShiftXFilter.gradientBlur}set gradientBlur(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e}get start(){return this.tiltShiftXFilter.start}set start(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e}get end(){return this.tiltShiftXFilter.end}set end(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e}};let wT=Uc;wT.defaults={blur:100,gradientBlur:600,start:void 0,end:void 0};var ST=`attribute vec2 aVertexPosition;
1760
+ `;let Lc=class extends ue{constructor(e){var r,i;super(vT,_T),this.uniforms.blur=e.blur,this.uniforms.gradientBlur=e.gradientBlur,this.uniforms.start=(r=e.start)!=null?r:new me(0,window.innerHeight/2),this.uniforms.end=(i=e.end)!=null?i:new me(600,window.innerHeight/2),this.uniforms.delta=new me(30,30),this.uniforms.texSize=new me(window.innerWidth,window.innerHeight),this.updateDelta()}updateDelta(){this.uniforms.delta.x=0,this.uniforms.delta.y=0}get blur(){return this.uniforms.blur}set blur(e){this.uniforms.blur=e}get gradientBlur(){return this.uniforms.gradientBlur}set gradientBlur(e){this.uniforms.gradientBlur=e}get start(){return this.uniforms.start}set start(e){this.uniforms.start=e,this.updateDelta()}get end(){return this.uniforms.end}set end(e){this.uniforms.end=e,this.updateDelta()}},yT=class extends Lc{updateDelta(){const e=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(e*e+r*r);this.uniforms.delta.x=e/i,this.uniforms.delta.y=r/i}},xT=class extends Lc{updateDelta(){const e=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(e*e+r*r);this.uniforms.delta.x=-r/i,this.uniforms.delta.y=e/i}};const Dc=class extends ue{constructor(e,r,i,n){super(),typeof e=="number"&&(re("5.3.0","TiltShiftFilter constructor arguments is deprecated, use options."),e={blur:e,gradientBlur:r,start:i,end:n}),e=Object.assign({},Dc.defaults,e),this.tiltShiftXFilter=new yT(e),this.tiltShiftYFilter=new xT(e)}apply(e,r,i,n){const s=e.getFilterTexture();this.tiltShiftXFilter.apply(e,r,s,1),this.tiltShiftYFilter.apply(e,s,i,n),e.returnFilterTexture(s)}get blur(){return this.tiltShiftXFilter.blur}set blur(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e}get gradientBlur(){return this.tiltShiftXFilter.gradientBlur}set gradientBlur(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e}get start(){return this.tiltShiftXFilter.start}set start(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e}get end(){return this.tiltShiftXFilter.end}set end(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e}};let bT=Dc;bT.defaults={blur:100,gradientBlur:600,start:void 0,end:void 0};var TT=`attribute vec2 aVertexPosition;
1761
1761
  attribute vec2 aTextureCoord;
1762
1762
 
1763
1763
  uniform mat3 projectionMatrix;
@@ -1768,7 +1768,7 @@ void main(void)
1768
1768
  {
1769
1769
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1770
1770
  vTextureCoord = aTextureCoord;
1771
- }`,AT=`varying vec2 vTextureCoord;
1771
+ }`,wT=`varying vec2 vTextureCoord;
1772
1772
 
1773
1773
  uniform sampler2D uSampler;
1774
1774
  uniform float radius;
@@ -1824,7 +1824,7 @@ void main(void)
1824
1824
  gl_FragColor = texture2D(uSampler, coord );
1825
1825
 
1826
1826
  }
1827
- `;const $c=class extends ue{constructor(t){super(ST,AT),Object.assign(this,$c.defaults,t)}get offset(){return this.uniforms.offset}set offset(t){this.uniforms.offset=t}get radius(){return this.uniforms.radius}set radius(t){this.uniforms.radius=t}get angle(){return this.uniforms.angle}set angle(t){this.uniforms.angle=t}};let ET=$c;ET.defaults={radius:200,angle:4,padding:20,offset:new ge};var CT=`attribute vec2 aVertexPosition;
1827
+ `;const Bc=class extends ue{constructor(t){super(TT,wT),Object.assign(this,Bc.defaults,t)}get offset(){return this.uniforms.offset}set offset(t){this.uniforms.offset=t}get radius(){return this.uniforms.radius}set radius(t){this.uniforms.radius=t}get angle(){return this.uniforms.angle}set angle(t){this.uniforms.angle=t}};let ST=Bc;ST.defaults={radius:200,angle:4,padding:20,offset:new me};var AT=`attribute vec2 aVertexPosition;
1828
1828
  attribute vec2 aTextureCoord;
1829
1829
 
1830
1830
  uniform mat3 projectionMatrix;
@@ -1835,7 +1835,7 @@ void main(void)
1835
1835
  {
1836
1836
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1837
1837
  vTextureCoord = aTextureCoord;
1838
- }`,IT=`varying vec2 vTextureCoord;
1838
+ }`,ET=`varying vec2 vTextureCoord;
1839
1839
  uniform sampler2D uSampler;
1840
1840
  uniform vec4 filterArea;
1841
1841
 
@@ -1921,7 +1921,7 @@ void main() {
1921
1921
 
1922
1922
  gl_FragColor = color;
1923
1923
  }
1924
- `,Gc=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,PT=Object.prototype.propertyIsEnumerable,MT=(t,e)=>{var r={};for(var i in t)RT.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&Gc)for(var i of Gc(t))e.indexOf(i)<0&&PT.call(t,i)&&(r[i]=t[i]);return r};const zc=class extends ue{constructor(t){const e=Object.assign(zc.defaults,t),{maxKernelSize:r}=e,i=MT(e,["maxKernelSize"]);super(CT,IT.replace("${maxKernelSize}",r.toFixed(1))),Object.assign(this,i)}get center(){return this.uniforms.uCenter}set center(t){this.uniforms.uCenter=t}get strength(){return this.uniforms.uStrength}set strength(t){this.uniforms.uStrength=t}get innerRadius(){return this.uniforms.uInnerRadius}set innerRadius(t){this.uniforms.uInnerRadius=t}get radius(){return this.uniforms.uRadius}set radius(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t}};let FT=zc;FT.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32};const rr=t=>{const{contrast:e=1,saturation:r=1,brightness:i=1,alpha:n=1,red:s=1,blue:a=1,gamma:o=1,green:u=1,blurRadius:h=0,temperature:d=0,hue:l=0,sharpness:c=0,vignette:f=0,noise:p=0}=t||{},m=new Ge.Filter(null,`
1924
+ `,Uc=Object.getOwnPropertySymbols,CT=Object.prototype.hasOwnProperty,IT=Object.prototype.propertyIsEnumerable,RT=(t,e)=>{var r={};for(var i in t)CT.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&Uc)for(var i of Uc(t))e.indexOf(i)<0&&IT.call(t,i)&&(r[i]=t[i]);return r};const $c=class extends ue{constructor(t){const e=Object.assign($c.defaults,t),{maxKernelSize:r}=e,i=RT(e,["maxKernelSize"]);super(AT,ET.replace("${maxKernelSize}",r.toFixed(1))),Object.assign(this,i)}get center(){return this.uniforms.uCenter}set center(t){this.uniforms.uCenter=t}get strength(){return this.uniforms.uStrength}set strength(t){this.uniforms.uStrength=t}get innerRadius(){return this.uniforms.uInnerRadius}set innerRadius(t){this.uniforms.uInnerRadius=t}get radius(){return this.uniforms.uRadius}set radius(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t}};let PT=$c;PT.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32};const er=t=>{const{contrast:e=1,saturation:r=1,brightness:i=1,alpha:n=1,red:s=1,blue:a=1,gamma:o=1,green:u=1,blurRadius:h=0,temperature:d=0,hue:l=0,sharpness:c=0,vignette:f=0,noise:p=0}=t||{},m=new $e.Filter(null,`
1925
1925
  precision mediump float;
1926
1926
  varying vec2 vTextureCoord;
1927
1927
  uniform sampler2D uSampler;
@@ -1933,7 +1933,7 @@ void main() {
1933
1933
  color.b = color.b - (temperature / 100.0);
1934
1934
  gl_FragColor = color;
1935
1935
  }
1936
- `);m.uniforms.temperature=d;const v=new G1([0,-c,0,-c,1+4*c,-c,0,-c,0]),g=new Ge.filters.ColorMatrixFilter;g.hue(l,!1);const y=new gi(h,1,!0),_=new Nc({vignetting:f}),x=new Ge.filters.NoiseFilter(p);return{adjustmentFilter:new s1({...o&&{gamma:o},...i&&{brightness:i},...e&&{contrast:e},...r&&{saturation:r},...s&&{red:s},...u&&{green:u},...a&&{blue:a},...n&&{alpha:n}}),blurFilter:y,hueFilter:g,sharpnessFilter:v,temperatureFilter:m,vignetteFilter:_,noiseFilter:x}},OT=()=>{const t=new Ge.Filter(null,`
1936
+ `);m.uniforms.temperature=d;const v=new U1([0,-c,0,-c,1+4*c,-c,0,-c,0]),g=new $e.filters.ColorMatrixFilter;g.hue(l,!1);const y=new di(h,1,!0),_=new Fc({vignetting:f}),x=new $e.filters.NoiseFilter(p);return{adjustmentFilter:new i1({...o&&{gamma:o},...i&&{brightness:i},...e&&{contrast:e},...r&&{saturation:r},...s&&{red:s},...u&&{green:u},...a&&{blue:a},...n&&{alpha:n}}),blurFilter:y,hueFilter:g,sharpnessFilter:v,temperatureFilter:m,vignetteFilter:_,noiseFilter:x}},MT=()=>{const t=new $e.Filter(null,`
1937
1937
  precision mediump float;
1938
1938
  uniform mat3 uNightVisionMatrix;
1939
1939
  varying vec2 vTextureCoord;
@@ -1944,7 +1944,7 @@ void main() {
1944
1944
  vec3 color = texColor.rgb;
1945
1945
  gl_FragColor = vec4(uNightVisionMatrix * vec3(color), texColor.a);
1946
1946
  }
1947
- `),e=[.393,.769,.189,.349,.686,.168,.272,.534,.131];t.uniforms.uNightVisionMatrix=e;const r=new Ge.Filter(null,`
1947
+ `),e=[.393,.769,.189,.349,.686,.168,.272,.534,.131];t.uniforms.uNightVisionMatrix=e;const r=new $e.Filter(null,`
1948
1948
  precision mediump float;
1949
1949
  varying vec2 vTextureCoord;
1950
1950
  uniform sampler2D uSampler;
@@ -1958,7 +1958,7 @@ void main() {
1958
1958
  float vignette = 1.0 - smoothstep(vignetteSize, 0.5, length(delta));
1959
1959
  gl_FragColor = texColor * vignetteColor * vignetteStrength * vignette;
1960
1960
  }
1961
- `);return r.uniforms.vignetteColor=[0,0,0,1],r.uniforms.vignetteSize=.7,r.uniforms.vignetteStrength=.6,{nightVisionFilter:t,vignetteFilter:r}},jc=L.forwardRef((t,e)=>{const r=P.useRef(null),i=P.useRef(null),{src:n,visible:s,disabled:a,transformation:{x:o,y:u,width:h,height:d,anchor:l,colorCorrection:c={},effect:f},pointerdown:p}=t,{blurRadius:m=0,vignette:v=0,noise:g=0}=c,{temperatureFilter:y,sharpnessFilter:_,hueFilter:x,blurFilter:b,adjustmentFilter:T,vignetteFilter:w,noiseFilter:S}=rr(c),{nightVisionFilter:A}=OT();return L.useEffect(()=>()=>{console.log("PixiImageSprite unmounting")},[]),K.jsx(Gt,{...t,ref:e,children:K.jsx(te.Container,{ref:i,children:K.jsx(te.Sprite,{image:n,width:h,height:d,anchor:l,ref:r,alpha:s?1:0,x:o,y:u,...!a&&s&&{interactive:!0,pointerdown:p},filters:[y,_,x,T,...m>0?[b]:[],...f===Ut.NightVision?[A]:[],...v>0?[w]:[],...g>0?[S]:[]]})})})});jc.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};const Pn={build(t){const e=t.points;let r,i,n,s,a,o;if(t.type===Fe.CIRC){const p=t.shape;r=p.x,i=p.y,a=o=p.radius,n=s=0}else if(t.type===Fe.ELIP){const p=t.shape;r=p.x,i=p.y,a=p.width,o=p.height,n=s=0}else{const p=t.shape,m=p.width/2,v=p.height/2;r=p.x+m,i=p.y+v,a=o=Math.max(0,Math.min(p.radius,Math.min(m,v))),n=m-a,s=v-o}if(!(a>=0&&o>=0&&n>=0&&s>=0)){e.length=0;return}const u=Math.ceil(2.3*Math.sqrt(a+o)),h=u*8+(n?4:0)+(s?4:0);if(e.length=h,h===0)return;if(u===0){e.length=8,e[0]=e[6]=r+n,e[1]=e[3]=i+s,e[2]=e[4]=r-n,e[5]=e[7]=i-s;return}let d=0,l=u*4+(n?2:0)+2,c=l,f=h;{const p=n+a,m=s,v=r+p,g=r-p,y=i+m;if(e[d++]=v,e[d++]=y,e[--l]=y,e[--l]=g,s){const _=i-m;e[c++]=g,e[c++]=_,e[--f]=_,e[--f]=v}}for(let p=1;p<u;p++){const m=Math.PI/2*(p/u),v=n+Math.cos(m)*a,g=s+Math.sin(m)*o,y=r+v,_=r-v,x=i+g,b=i-g;e[d++]=y,e[d++]=x,e[--l]=x,e[--l]=_,e[c++]=_,e[c++]=b,e[--f]=b,e[--f]=y}{const p=n,m=s+o,v=r+p,g=r-p,y=i+m,_=i-m;e[d++]=v,e[d++]=y,e[--f]=_,e[--f]=v,n&&(e[d++]=g,e[d++]=y,e[--f]=_,e[--f]=g)}},triangulate(t,e){const r=t.points,i=e.points,n=e.indices;if(r.length===0)return;let s=i.length/2;const a=s;let o,u;if(t.type!==Fe.RREC){const d=t.shape;o=d.x,u=d.y}else{const d=t.shape;o=d.x+d.width/2,u=d.y+d.height/2}const h=t.matrix;i.push(t.matrix?h.a*o+h.c*u+h.tx:o,t.matrix?h.b*o+h.d*u+h.ty:u),s++,i.push(r[0],r[1]);for(let d=2;d<r.length;d+=2)i.push(r[d],r[d+1]),n.push(s++,a,s);n.push(a+1,a,s)}};function Hc(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let n=0,s=t[r-2],a=t[r-1];n<r;n+=2){const o=t[n],u=t[n+1];i+=(o-s)*(u+a),s=o,a=u}if(!e&&i>0||e&&i<=0){const n=r/2;for(let s=n+n%2;s<r;s+=2){const a=r-s-2,o=r-s-1,u=s,h=s+1;[t[a],t[u]]=[t[u],t[a]],[t[o],t[h]]=[t[h],t[o]]}}}const Vc={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const i=t.holes,n=e.points,s=e.indices;if(r.length>=6){Hc(r,!1);const a=[];for(let h=0;h<i.length;h++){const d=i[h];Hc(d.points,!0),a.push(r.length/2),r=r.concat(d.points)}const o=x_(r,a,2);if(!o)return;const u=n.length/2;for(let h=0;h<o.length;h+=3)s.push(o[h]+u),s.push(o[h+1]+u),s.push(o[h+2]+u);for(let h=0;h<r.length;h++)n.push(r[h])}}},NT={build(t){const e=t.shape,r=e.x,i=e.y,n=e.width,s=e.height,a=t.points;a.length=0,n>=0&&s>=0&&a.push(r,i,r+n,i,r+n,i+s,r,i+s)},triangulate(t,e){const r=t.points,i=e.points;if(r.length===0)return;const n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},kT={build(t){Pn.build(t)},triangulate(t,e){Pn.triangulate(t,e)}};var at=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(at||{}),ir=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(ir||{});const kr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class Xc{static curveTo(e,r,i,n,s,a){const o=a[a.length-2],h=a[a.length-1]-r,d=o-e,l=n-r,c=i-e,f=Math.abs(h*c-d*l);if(f<1e-8||s===0)return(a[a.length-2]!==e||a[a.length-1]!==r)&&a.push(e,r),null;const p=h*h+d*d,m=l*l+c*c,v=h*l+d*c,g=s*Math.sqrt(p)/f,y=s*Math.sqrt(m)/f,_=g*v/p,x=y*v/m,b=g*c+y*d,T=g*l+y*h,w=d*(y+_),S=h*(y+_),A=c*(g+x),C=l*(g+x),F=Math.atan2(S-T,w-b),z=Math.atan2(C-T,A-b);return{cx:b+e,cy:T+r,radius:s,startAngle:F,endAngle:z,anticlockwise:d*l>c*h}}static arc(e,r,i,n,s,a,o,u,h){const d=o-a,l=kr._segmentsCount(Math.abs(d)*s,Math.ceil(Math.abs(d)/cn)*40),c=d/(l*2),f=c*2,p=Math.cos(c),m=Math.sin(c),v=l-1,g=v%1/v;for(let y=0;y<=v;++y){const _=y+g*y,x=c+a+f*_,b=Math.cos(x),T=-Math.sin(x);h.push((p*b+m*T)*s+i,(p*-T+m*b)*s+n)}}}class LT{constructor(){this.reset()}begin(e,r,i){this.reset(),this.style=e,this.start=r,this.attribStart=i}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Oa{static curveLength(e,r,i,n,s,a,o,u){let d=0,l=0,c=0,f=0,p=0,m=0,v=0,g=0,y=0,_=0,x=0,b=e,T=r;for(let w=1;w<=10;++w)l=w/10,c=l*l,f=c*l,p=1-l,m=p*p,v=m*p,g=v*e+3*m*l*i+3*p*c*s+f*o,y=v*r+3*m*l*n+3*p*c*a+f*u,_=b-g,x=T-y,b=g,T=y,d+=Math.sqrt(_*_+x*x);return d}static curveTo(e,r,i,n,s,a,o){const u=o[o.length-2],h=o[o.length-1];o.length-=2;const d=kr._segmentsCount(Oa.curveLength(u,h,e,r,i,n,s,a));let l=0,c=0,f=0,p=0,m=0;o.push(u,h);for(let v=1,g=0;v<=d;++v)g=v/d,l=1-g,c=l*l,f=c*l,p=g*g,m=p*g,o.push(f*u+3*c*g*e+3*l*p*i+m*s,f*h+3*c*g*r+3*l*p*n+m*a)}}function Wc(t,e,r,i,n,s,a,o){const u=t-r*n,h=e-i*n,d=t+r*s,l=e+i*s;let c,f;a?(c=i,f=-r):(c=-i,f=r);const p=u+c,m=h+f,v=d+c,g=l+f;return o.push(p,m,v,g),2}function nr(t,e,r,i,n,s,a,o){const u=r-t,h=i-e;let d=Math.atan2(u,h),l=Math.atan2(n-t,s-e);o&&d<l?d+=Math.PI*2:!o&&d>l&&(l+=Math.PI*2);let c=d;const f=l-d,p=Math.abs(f),m=Math.sqrt(u*u+h*h),v=(15*p*Math.sqrt(m)/Math.PI>>0)+1,g=f/v;if(c+=g,o){a.push(t,e,r,i);for(let y=1,_=c;y<v;y++,_+=g)a.push(t,e,t+Math.sin(_)*m,e+Math.cos(_)*m);a.push(t,e,n,s)}else{a.push(r,i,t,e);for(let y=1,_=c;y<v;y++,_+=g)a.push(t+Math.sin(_)*m,e+Math.cos(_)*m,t,e);a.push(n,s,t,e)}return v*2}function DT(t,e){const r=t.shape;let i=t.points||r.points.slice();const n=e.closePointEps;if(i.length===0)return;const s=t.lineStyle,a=new ge(i[0],i[1]),o=new ge(i[i.length-2],i[i.length-1]),u=r.type!==Fe.POLY||r.closeStroke,h=Math.abs(a.x-o.x)<n&&Math.abs(a.y-o.y)<n;if(u){i=i.slice(),h&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const R=(a.x+o.x)*.5,$=(o.y+a.y)*.5;i.unshift(R,$),i.push(R,$)}const d=e.points,l=i.length/2;let c=i.length;const f=d.length/2,p=s.width/2,m=p*p,v=s.miterLimit*s.miterLimit;let g=i[0],y=i[1],_=i[2],x=i[3],b=0,T=0,w=-(y-x),S=g-_,A=0,C=0,F=Math.sqrt(w*w+S*S);w/=F,S/=F,w*=p,S*=p;const z=s.alignment,I=(1-z)*2,E=z*2;u||(s.cap===ir.ROUND?c+=nr(g-w*(I-E)*.5,y-S*(I-E)*.5,g-w*I,y-S*I,g+w*E,y+S*E,d,!0)+2:s.cap===ir.SQUARE&&(c+=Wc(g,y,w,S,I,E,!0,d))),d.push(g-w*I,y-S*I,g+w*E,y+S*E);for(let R=1;R<l-1;++R){g=i[(R-1)*2],y=i[(R-1)*2+1],_=i[R*2],x=i[R*2+1],b=i[(R+1)*2],T=i[(R+1)*2+1],w=-(y-x),S=g-_,F=Math.sqrt(w*w+S*S),w/=F,S/=F,w*=p,S*=p,A=-(x-T),C=_-b,F=Math.sqrt(A*A+C*C),A/=F,C/=F,A*=p,C*=p;const $=_-g,X=y-x,M=_-b,O=T-x,H=$*M+X*O,V=X*M-O*$,W=V<0;if(Math.abs(V)<.001*Math.abs(H)){d.push(_-w*I,x-S*I,_+w*E,x+S*E),H>=0&&(s.join===at.ROUND?c+=nr(_,x,_-w*I,x-S*I,_-A*I,x-C*I,d,!1)+4:c+=2,d.push(_-A*E,x-C*E,_+A*I,x+C*I));continue}const ne=(-w+g)*(-S+x)-(-w+_)*(-S+y),oe=(-A+b)*(-C+x)-(-A+_)*(-C+T),ce=($*oe-M*ne)/V,ve=(O*ne-X*oe)/V,de=(ce-_)*(ce-_)+(ve-x)*(ve-x),G=_+(ce-_)*I,q=x+(ve-x)*I,Y=_-(ce-_)*E,me=x-(ve-x)*E,De=Math.min($*$+X*X,M*M+O*O),Be=W?I:E,ct=De+Be*Be*m,Q=de<=ct;let he=s.join;if(he===at.MITER&&de/m>v&&(he=at.BEVEL),Q)switch(he){case at.MITER:{d.push(G,q,Y,me);break}case at.BEVEL:{W?d.push(G,q,_+w*E,x+S*E,G,q,_+A*E,x+C*E):d.push(_-w*I,x-S*I,Y,me,_-A*I,x-C*I,Y,me),c+=2;break}case at.ROUND:{W?(d.push(G,q,_+w*E,x+S*E),c+=nr(_,x,_+w*E,x+S*E,_+A*E,x+C*E,d,!0)+4,d.push(G,q,_+A*E,x+C*E)):(d.push(_-w*I,x-S*I,Y,me),c+=nr(_,x,_-w*I,x-S*I,_-A*I,x-C*I,d,!1)+4,d.push(_-A*I,x-C*I,Y,me));break}}else{switch(d.push(_-w*I,x-S*I,_+w*E,x+S*E),he){case at.MITER:{W?d.push(Y,me,Y,me):d.push(G,q,G,q),c+=2;break}case at.ROUND:{W?c+=nr(_,x,_+w*E,x+S*E,_+A*E,x+C*E,d,!0)+2:c+=nr(_,x,_-w*I,x-S*I,_-A*I,x-C*I,d,!1)+2;break}}d.push(_-A*I,x-C*I,_+A*E,x+C*E),c+=2}}g=i[(l-2)*2],y=i[(l-2)*2+1],_=i[(l-1)*2],x=i[(l-1)*2+1],w=-(y-x),S=g-_,F=Math.sqrt(w*w+S*S),w/=F,S/=F,w*=p,S*=p,d.push(_-w*I,x-S*I,_+w*E,x+S*E),u||(s.cap===ir.ROUND?c+=nr(_-w*(I-E)*.5,x-S*(I-E)*.5,_-w*I,x-S*I,_+w*E,x+S*E,d,!1)+2:s.cap===ir.SQUARE&&(c+=Wc(_,x,w,S,I,E,!1,d)));const B=e.indices,U=kr.epsilon*kr.epsilon;for(let R=f;R<c+f-2;++R)g=d[R*2],y=d[R*2+1],_=d[(R+1)*2],x=d[(R+1)*2+1],b=d[(R+2)*2],T=d[(R+2)*2+1],!(Math.abs(g*(x-T)+_*(T-y)+b*(y-x))<U)&&B.push(R,R+1,R+2)}function BT(t,e){let r=0;const i=t.shape,n=t.points||i.points,s=i.type!==Fe.POLY||i.closeStroke;if(n.length===0)return;const a=e.points,o=e.indices,u=n.length/2,h=a.length/2;let d=h;for(a.push(n[0],n[1]),r=1;r<u;r++)a.push(n[r*2],n[r*2+1]),o.push(d,d+1),d++;s&&o.push(d,h)}function qc(t,e){t.lineStyle.native?BT(t,e):DT(t,e)}class Na{static curveLength(e,r,i,n,s,a){const o=e-2*i+s,u=r-2*n+a,h=2*i-2*e,d=2*n-2*r,l=4*(o*o+u*u),c=4*(o*h+u*d),f=h*h+d*d,p=2*Math.sqrt(l+c+f),m=Math.sqrt(l),v=2*l*m,g=2*Math.sqrt(f),y=c/m;return(v*p+m*c*(p-g)+(4*f*l-c*c)*Math.log((2*m+y+p)/(y+g)))/(4*v)}static curveTo(e,r,i,n,s){const a=s[s.length-2],o=s[s.length-1],u=kr._segmentsCount(Na.curveLength(a,o,e,r,i,n));let h=0,d=0;for(let l=1;l<=u;++l){const c=l/u;h=a+(e-a)*c,d=o+(r-o)*c,s.push(h+(e+(i-e)*c-h)*c,d+(r+(n-r)*c-d)*c)}}}const ka={[Fe.POLY]:Vc,[Fe.CIRC]:Pn,[Fe.ELIP]:Pn,[Fe.RECT]:NT,[Fe.RREC]:kT},Yc=[],Mn=[];class La{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(e){return this.minX>this.maxX||this.minY>this.maxY?pe.EMPTY:(e=e||new pe(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:i,b:n,c:s,d:a,tx:o,ty:u}=e,h=i*r.x+s*r.y+o,d=n*r.x+a*r.y+u;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,d),this.maxY=Math.max(this.maxY,d)}addQuad(e){let r=this.minX,i=this.minY,n=this.maxX,s=this.maxY,a=e[0],o=e[1];r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[2],o=e[3],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[4],o=e[5],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[6],o=e[7],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,this.minX=r,this.minY=i,this.maxX=n,this.maxY=s}addFrame(e,r,i,n,s){this.addFrameMatrix(e.worldTransform,r,i,n,s)}addFrameMatrix(e,r,i,n,s){const a=e.a,o=e.b,u=e.c,h=e.d,d=e.tx,l=e.ty;let c=this.minX,f=this.minY,p=this.maxX,m=this.maxY,v=a*r+u*i+d,g=o*r+h*i+l;c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,v=a*n+u*i+d,g=o*n+h*i+l,c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,v=a*r+u*s+d,g=o*r+h*s+l,c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,v=a*n+u*s+d,g=o*n+h*s+l,c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,this.minX=c,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(e,r,i){let n=this.minX,s=this.minY,a=this.maxX,o=this.maxY;for(let u=r;u<i;u+=2){const h=e[u],d=e[u+1];n=h<n?h:n,s=d<s?d:s,a=h>a?h:a,o=d>o?d:o}this.minX=n,this.minY=s,this.maxX=a,this.maxY=o}addVertices(e,r,i,n){this.addVerticesMatrix(e.worldTransform,r,i,n)}addVerticesMatrix(e,r,i,n,s=0,a=s){const o=e.a,u=e.b,h=e.c,d=e.d,l=e.tx,c=e.ty;let f=this.minX,p=this.minY,m=this.maxX,v=this.maxY;for(let g=i;g<n;g+=2){const y=r[g],_=r[g+1],x=o*y+h*_+l,b=d*_+u*y+c;f=Math.min(f,x-s),m=Math.max(m,x+s),p=Math.min(p,b-a),v=Math.max(v,b+a)}this.minX=f,this.minY=p,this.maxX=m,this.maxY=v}addBounds(e){const r=this.minX,i=this.minY,n=this.maxX,s=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<i?e.minY:i,this.maxX=e.maxX>n?e.maxX:n,this.maxY=e.maxY>s?e.maxY:s}addBoundsMask(e,r){const i=e.minX>r.minX?e.minX:r.minX,n=e.minY>r.minY?e.minY:r.minY,s=e.maxX<r.maxX?e.maxX:r.maxX,a=e.maxY<r.maxY?e.maxY:r.maxY;if(i<=s&&n<=a){const o=this.minX,u=this.minY,h=this.maxX,d=this.maxY;this.minX=i<o?i:o,this.minY=n<u?n:u,this.maxX=s>h?s:h,this.maxY=a>d?a:d}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const i=e.minX>r.x?e.minX:r.x,n=e.minY>r.y?e.minY:r.y,s=e.maxX<r.x+r.width?e.maxX:r.x+r.width,a=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(i<=s&&n<=a){const o=this.minX,u=this.minY,h=this.maxX,d=this.maxY;this.minX=i<o?i:o,this.minY=n<u?n:u,this.maxX=s>h?s:h,this.maxY=a>d?a:d}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,i,n,s,a){e-=s,r-=a,i+=s,n+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>n?this.maxY:n}}class Lr extends Gi{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new pa,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 La,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(e){const r=Object.keys(e);for(let i=0;i<r.length;++i){const n=r[i];Object.defineProperty(Lr.prototype,n,Object.getOwnPropertyDescriptor(e,n))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new pe),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new pe),e=this._localBoundsRect),this._localBounds||(this._localBounds=new La);const r=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const n=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,e);return this.parent=i,this.transform=r,this._bounds=n,this._bounds.updateID+=this._boundsID-s,a}toGlobal(e,r,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,i,n){return r&&(e=r.toGlobal(e,i,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,i)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,i=1,n=1,s=0,a=0,o=0,u=0,h=0){return this.position.x=e,this.position.y=r,this.scale.x=i||1,this.scale.y=n||1,this.rotation=s,this.skew.x=a,this.skew.y=o,this.pivot.x=u,this.pivot.y=h,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new UT),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*eb}set angle(e){this.transform.rotation=e*ui}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class UT extends Lr{constructor(){super(...arguments),this.sortDirty=null}}Lr.prototype.displayObjectUpdateTransform=Lr.prototype.updateTransform;const $T=new $e;function GT(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const Da=class extends Lr{constructor(){super(),this.children=[],this.sortableChildren=Da.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.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 r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);an(this.children,r,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;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(r===-1)return null;e.parent=null,e.transform._parentID=-1,an(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,an(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,i=e,n=i-r;let s;if(n>0&&n<=i){s=this.children.splice(r,n);for(let a=0;a<s.length;++a)s[a].parent=null,s[a].transform&&(s[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let a=0;a<s.length;++a)s[a].emit("removed",this),this.emit("childRemoved",s[a],this,a);return s}else if(n===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const i=this.children[e];i._lastSortedIndex=e,!t&&i.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(GT),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;t<e;++t){const r=this.children[t];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(!(!e.visible||!e.renderable))if(e.calculateBounds(),e._mask){const r=e._mask.isMaskData?e._mask.maskObject:e._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let i=0,n=this.children.length;i<n;++i){const s=this.children[i];s.visible&&s.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let r,i;this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==Da.prototype._render&&(r=this.getBounds(!0));const n=t.projection.transform;if(n&&(i?(i=$T.copyFrom(i),i.prepend(n)):i=n),r&&e.intersects(r,i))this._render(t);else if(this.cullArea)return;for(let s=0,a=this.children.length;s<a;++s){const o=this.children[s],u=o.cullable;o.cullable=u||!this.cullArea,o.render(t),o.cullable=u}}render(t){var e;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(e=this.filters)!=null&&e.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let r=0,i=this.children.length;r<i;++r)this.children[r].render(t)}}renderAdvanced(t){var n,s,a;const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let o=0;o<e.length;o++)e[o].enabled&&this._enabledFilters.push(e[o])}const i=e&&((n=this._enabledFilters)==null?void 0:n.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ee.NONE));if(i&&t.batch.flush(),e&&((s=this._enabledFilters)!=null&&s.length)&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let o=0,u=this.children.length;o<u;++o)this.children[o].render(t)}i&&t.batch.flush(),r&&t.mask.pop(this),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e=typeof t=="boolean"?t:t==null?void 0:t.children,r=this.removeChildren(0,this.children.length);if(e)for(let i=0;i<r.length;++i)r[i].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;e!==0?this.scale.x=t/e:this.scale.x=1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;e!==0?this.scale.y=t/e:this.scale.y=1,this._height=t}};let Dr=Da;Dr.defaultSortableChildren=!1,Dr.prototype.containerUpdateTransform=Dr.prototype.updateTransform,Object.defineProperties(Z,{SORTABLE_CHILDREN:{get(){return Dr.defaultSortableChildren},set(t){re("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Dr.defaultSortableChildren=t}}});class Fn{constructor(e,r=null,i=null,n=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=r,this.matrix=n,this.type=e.type}clone(){return new Fn(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const Br=new ge,Kc=class extends Cu{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new La,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Mn.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),Yc.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const n=new Fn(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new Fn(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const i=e[r];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,Br):Br.copyFrom(t),i.shape.contains(Br.x,Br.y))){let n=!1;if(i.holes){for(let s=0;s<i.holes.length;s++)if(i.holes[s].shape.contains(Br.x,Br.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,i=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],i=r.style);for(let o=this.shapeIndex;o<e.length;o++){this.shapeIndex++;const u=e[o],h=u.fillStyle,d=u.lineStyle;ka[u.type].build(u),u.matrix&&this.transformPoints(u.points,u.matrix),(h.visible||d.visible)&&this.processHoles(u.holes);for(let c=0;c<2;c++){const f=c===0?h:d;if(!f.visible)continue;const p=f.texture.baseTexture,m=this.indices.length,v=this.points.length/2;p.wrapMode=Zr.REPEAT,c===0?this.processFill(u):this.processLine(u);const g=this.points.length/2-v;g!==0&&(r&&!this._compareStyles(i,f)&&(r.end(m,v),r=null),r||(r=Yc.pop()||new LT,r.begin(f,m,v),this.batches.push(r),i=f),this.addUvs(this.points,t,f.texture,v,g,f.matrix))}}const n=this.indices.length,s=this.points.length/2;if(r&&r.end(n,s),this.batches.length===0){this.batchable=!0;return}const a=s>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?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;t<e;t++){const r=this.graphicsData[t],i=r.fillStyle,n=r.lineStyle;if(i&&!i.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const i=t[e];for(let n=0;n<i.size;n++){const s=i.start+n;this.indicesUint16[s]=this.indicesUint16[s]-i.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<Kc.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++ae._globalBatch;for(let d=0;d<this.drawCalls.length;d++)this.drawCalls[d].texArray.clear(),Mn.push(this.drawCalls[d]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let i=Mn.pop();i||(i=new ca,i.texArray=new ga),i.texArray.count=0,i.start=0,i.size=0,i.type=Rt.TRIANGLES;let n=0,s=null,a=0,o=!1,u=Rt.TRIANGLES,h=0;this.drawCalls.push(i);for(let d=0;d<this.batches.length;d++){const l=this.batches[d],c=8,f=l.style,p=f.texture.baseTexture;o!==!!f.native&&(o=!!f.native,u=o?Rt.LINES:Rt.TRIANGLES,s=null,n=c,t++),s!==p&&(s=p,p._batchEnabled!==t&&(n===c&&(t++,n=0,i.size>0&&(i=Mn.pop(),i||(i=new ca,i.texArray=new ga),this.drawCalls.push(i)),i.start=h,i.size=0,i.texArray.count=0,i.type=u),p.touched=1,p._batchEnabled=t,p._batchLocation=n,p.wrapMode=Zr.REPEAT,i.texArray.elements[i.texArray.count++]=p,n++)),i.size+=l.size,h+=l.size,a=p._batchLocation,this.addColors(e,f.color,f.alpha,l.attribSize,l.attribStart),this.addTextureIds(r,a,l.attribSize,l.attribStart)}ae._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(t.length*3*4),s=new Float32Array(n),a=new Uint32Array(n);let o=0;for(let u=0;u<t.length/2;u++)s[o++]=t[u*2],s[o++]=t[u*2+1],s[o++]=e[u*2],s[o++]=e[u*2+1],a[o++]=r[u],s[o++]=i[u];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Vc.triangulate(t,this):ka[t.type].triangulate(t,this)}processLine(t){qc(t,this);for(let e=0;e<t.holes.length;e++)qc(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];ka[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const i=t[r*2],n=t[r*2+1];t[r*2]=e.a*i+e.c*n+e.tx,t[r*2+1]=e.b*i+e.d*n+e.ty}}addColors(t,e,r,i,n=0){const s=Le.shared.setValue(e).toLittleEndianNumber(),a=Le.shared.setValue(s).toPremultiplied(r);t.length=Math.max(t.length,n+i);for(let o=0;o<i;o++)t[n+o]=a}addTextureIds(t,e,r,i=0){t.length=Math.max(t.length,i+r);for(let n=0;n<r;n++)t[i+n]=e}addUvs(t,e,r,i,n,s=null){let a=0;const o=e.length,u=r.frame;for(;a<n;){let d=t[(i+a)*2],l=t[(i+a)*2+1];if(s){const c=s.a*d+s.c*l+s.tx;l=s.b*d+s.d*l+s.ty,d=c}a++,e.push(d/u.width,l/u.height)}const h=r.baseTexture;(u.width<h.width||u.height<h.height)&&this.adjustUvs(e,r,o,n)}adjustUvs(t,e,r,i){const n=e.baseTexture,s=1e-6,a=r+i*2,o=e.frame,u=o.width/n.width,h=o.height/n.height;let d=o.x/o.width,l=o.y/o.height,c=Math.floor(t[r]+s),f=Math.floor(t[r+1]+s);for(let p=r+2;p<a;p+=2)c=Math.min(c,Math.floor(t[p]+s)),f=Math.min(f,Math.floor(t[p+1]+s));d-=c,l-=f;for(let p=r;p<a;p+=2)t[p]=(t[p]+d)*u,t[p+1]=(t[p+1]+l)*h}};let Zc=Kc;Zc.BATCHABLE_SIZE=100;class On{constructor(){this.color=16777215,this.alpha=1,this.texture=ie.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new On;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=ie.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class Ba extends On{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=ir.BUTT,this.join=at.MITER,this.miterLimit=10}clone(){const e=new Ba;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const Ua={},Nn=class extends Dr{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new On,this._lineStyle=new Ba,this._matrix=null,this._holeMode=!1,this.state=ln.for2d(),this._geometry=t||new Zc,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Le(16777215),this.blendMode=j.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new Nn(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,i=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:r,alignment:i,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:ie.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:ir.BUTT,join:at.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},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 ci,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new ci,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 r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return(i!==t||n!==e)&&r.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,r,i){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),Na.curveTo(t,e,r,i,n),this}bezierCurveTo(t,e,r,i,n,s){return this._initCurve(),Oa.curveTo(t,e,r,i,n,s,this.currentPath.points),this}arcTo(t,e,r,i,n){this._initCurve(t,e);const s=this.currentPath.points,a=Xc.curveTo(t,e,r,i,n,s);if(a){const{cx:o,cy:u,radius:h,startAngle:d,endAngle:l,anticlockwise:c}=a;this.arc(o,u,h,d,l,c)}return this}arc(t,e,r,i,n,s=!1){if(i===n)return this;if(!s&&n<=i?n+=cn:s&&i<=n&&(i+=cn),n-i===0)return this;const o=t+Math.cos(i)*r,u=e+Math.sin(i)*r,h=this._geometry.closePointEps;let d=this.currentPath?this.currentPath.points:null;if(d){const l=Math.abs(d[d.length-2]-o),c=Math.abs(d[d.length-1]-u);l<h&&c<h||d.push(o,u)}else this.moveTo(o,u),d=this.currentPath.points;return Xc.arc(o,u,t,e,r,i,n,s,d),this}beginFill(t=0,e){return this.beginTextureFill({texture:ie.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Le.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:ie.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,i){return this.drawShape(new pe(t,e,r,i))}drawRoundedRect(t,e,r,i,n){return this.drawShape(new fa(t,e,r,i,n))}drawCircle(t,e,r){return this.drawShape(new ha(t,e,r))}drawEllipse(t,e,r,i){return this.drawShape(new tb(t,e,r,i))}drawPolygon(...t){let e,r=!0;const i=t[0];i.points?(r=i.closeStroke,e=i.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new ci(e);return n.closeStroke=r,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===Fe.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,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(let i=0;i<r;i++){const n=t.batches[i],s=n.style.color,a=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),o=new Float32Array(t.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),u=new Uint16Array(t.indicesUint16.buffer,n.start*2,n.size),h={vertexData:a,blendMode:e,indices:u,uvs:o,_batchRGB:Le.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=h}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,i=this.worldAlpha,n=e.uniforms,s=r.drawCalls;n.translationMatrix=this.transform.worldTransform,Le.shared.setValue(this._tintColor).premultiply(i).toArray(n.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let a=0,o=s.length;a<o;a++)this._renderDrawCallDirect(t,r.drawCalls[a])}_renderDrawCallDirect(t,e){const{texArray:r,type:i,size:n,start:s}=e,a=r.count;for(let o=0;o<a;o++)t.texture.bind(r.elements[o],o);t.geometry.draw(i,n,s)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!Ua[r]){const{maxTextures:i}=t.plugins[r],n=new Int32Array(i);for(let o=0;o<i;o++)n[o]=o;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new $e,default:tt.from({uSamplers:n},!0)},a=t.plugins[r]._shader.program;Ua[r]=new fi(a,s)}e=Ua[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:i,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,r,i,n)}containsPoint(t){return this.worldTransform.applyInverse(t,Nn._TEMP_POINT),this._geometry.containsPoint(Nn._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Le.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,s=e.d,a=e.tx,o=e.ty,u=this._geometry.points,h=this.vertexData;let d=0;for(let l=0;l<u.length;l+=2){const c=u[l],f=u[l+1];h[d++]=r*c+n*f+a,h[d++]=s*f+i*c+o}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let $a=Nn;$a.curves=kr,$a._TEMP_POINT=new ge;var zT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ga={},jT={get exports(){return Ga},set exports(t){Ga=t}};/*!
1961
+ `);return r.uniforms.vignetteColor=[0,0,0,1],r.uniforms.vignetteSize=.7,r.uniforms.vignetteStrength=.6,{nightVisionFilter:t,vignetteFilter:r}},Gc=D.forwardRef((t,e)=>{const r=P.useRef(null),i=P.useRef(null),{src:n,visible:s,disabled:a,transformation:{x:o,y:u,width:h,height:d,anchor:l,colorCorrection:c={},effect:f},pointerdown:p}=t,{blurRadius:m=0,vignette:v=0,noise:g=0}=c,{temperatureFilter:y,sharpnessFilter:_,hueFilter:x,blurFilter:b,adjustmentFilter:T,vignetteFilter:w,noiseFilter:S}=er(c),{nightVisionFilter:A}=MT();return D.useEffect(()=>()=>{console.log("PixiImageSprite unmounting")},[]),Z.jsx(Ut,{...t,ref:e,children:Z.jsx(te.Container,{ref:i,children:Z.jsx(te.Sprite,{image:n,width:h,height:d,anchor:l,ref:r,alpha:s?1:0,x:o,y:u,...!a&&s&&{interactive:!0,pointerdown:p},filters:[y,_,x,T,...m>0?[b]:[],...f===Dt.NightVision?[A]:[],...v>0?[w]:[],...g>0?[S]:[]]})})})});Gc.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};const Cn={build(t){const e=t.points;let r,i,n,s,a,o;if(t.type===Me.CIRC){const p=t.shape;r=p.x,i=p.y,a=o=p.radius,n=s=0}else if(t.type===Me.ELIP){const p=t.shape;r=p.x,i=p.y,a=p.width,o=p.height,n=s=0}else{const p=t.shape,m=p.width/2,v=p.height/2;r=p.x+m,i=p.y+v,a=o=Math.max(0,Math.min(p.radius,Math.min(m,v))),n=m-a,s=v-o}if(!(a>=0&&o>=0&&n>=0&&s>=0)){e.length=0;return}const u=Math.ceil(2.3*Math.sqrt(a+o)),h=u*8+(n?4:0)+(s?4:0);if(e.length=h,h===0)return;if(u===0){e.length=8,e[0]=e[6]=r+n,e[1]=e[3]=i+s,e[2]=e[4]=r-n,e[5]=e[7]=i-s;return}let d=0,l=u*4+(n?2:0)+2,c=l,f=h;{const p=n+a,m=s,v=r+p,g=r-p,y=i+m;if(e[d++]=v,e[d++]=y,e[--l]=y,e[--l]=g,s){const _=i-m;e[c++]=g,e[c++]=_,e[--f]=_,e[--f]=v}}for(let p=1;p<u;p++){const m=Math.PI/2*(p/u),v=n+Math.cos(m)*a,g=s+Math.sin(m)*o,y=r+v,_=r-v,x=i+g,b=i-g;e[d++]=y,e[d++]=x,e[--l]=x,e[--l]=_,e[c++]=_,e[c++]=b,e[--f]=b,e[--f]=y}{const p=n,m=s+o,v=r+p,g=r-p,y=i+m,_=i-m;e[d++]=v,e[d++]=y,e[--f]=_,e[--f]=v,n&&(e[d++]=g,e[d++]=y,e[--f]=_,e[--f]=g)}},triangulate(t,e){const r=t.points,i=e.points,n=e.indices;if(r.length===0)return;let s=i.length/2;const a=s;let o,u;if(t.type!==Me.RREC){const d=t.shape;o=d.x,u=d.y}else{const d=t.shape;o=d.x+d.width/2,u=d.y+d.height/2}const h=t.matrix;i.push(t.matrix?h.a*o+h.c*u+h.tx:o,t.matrix?h.b*o+h.d*u+h.ty:u),s++,i.push(r[0],r[1]);for(let d=2;d<r.length;d+=2)i.push(r[d],r[d+1]),n.push(s++,a,s);n.push(a+1,a,s)}};function zc(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let n=0,s=t[r-2],a=t[r-1];n<r;n+=2){const o=t[n],u=t[n+1];i+=(o-s)*(u+a),s=o,a=u}if(!e&&i>0||e&&i<=0){const n=r/2;for(let s=n+n%2;s<r;s+=2){const a=r-s-2,o=r-s-1,u=s,h=s+1;[t[a],t[u]]=[t[u],t[a]],[t[o],t[h]]=[t[h],t[o]]}}}const jc={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const i=t.holes,n=e.points,s=e.indices;if(r.length>=6){zc(r,!1);const a=[];for(let h=0;h<i.length;h++){const d=i[h];zc(d.points,!0),a.push(r.length/2),r=r.concat(d.points)}const o=__(r,a,2);if(!o)return;const u=n.length/2;for(let h=0;h<o.length;h+=3)s.push(o[h]+u),s.push(o[h+1]+u),s.push(o[h+2]+u);for(let h=0;h<r.length;h++)n.push(r[h])}}},FT={build(t){const e=t.shape,r=e.x,i=e.y,n=e.width,s=e.height,a=t.points;a.length=0,n>=0&&s>=0&&a.push(r,i,r+n,i,r+n,i+s,r,i+s)},triangulate(t,e){const r=t.points,i=e.points;if(r.length===0)return;const n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},OT={build(t){Cn.build(t)},triangulate(t,e){Cn.triangulate(t,e)}};var at=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(at||{}),tr=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(tr||{});const Or={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class Hc{static curveTo(e,r,i,n,s,a){const o=a[a.length-2],h=a[a.length-1]-r,d=o-e,l=n-r,c=i-e,f=Math.abs(h*c-d*l);if(f<1e-8||s===0)return(a[a.length-2]!==e||a[a.length-1]!==r)&&a.push(e,r),null;const p=h*h+d*d,m=l*l+c*c,v=h*l+d*c,g=s*Math.sqrt(p)/f,y=s*Math.sqrt(m)/f,_=g*v/p,x=y*v/m,b=g*c+y*d,T=g*l+y*h,w=d*(y+_),S=h*(y+_),A=c*(g+x),I=l*(g+x),F=Math.atan2(S-T,w-b),$=Math.atan2(I-T,A-b);return{cx:b+e,cy:T+r,radius:s,startAngle:F,endAngle:$,anticlockwise:d*l>c*h}}static arc(e,r,i,n,s,a,o,u,h){const d=o-a,l=Or._segmentsCount(Math.abs(d)*s,Math.ceil(Math.abs(d)/on)*40),c=d/(l*2),f=c*2,p=Math.cos(c),m=Math.sin(c),v=l-1,g=v%1/v;for(let y=0;y<=v;++y){const _=y+g*y,x=c+a+f*_,b=Math.cos(x),T=-Math.sin(x);h.push((p*b+m*T)*s+i,(p*-T+m*b)*s+n)}}}class NT{constructor(){this.reset()}begin(e,r,i){this.reset(),this.style=e,this.start=r,this.attribStart=i}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Ra{static curveLength(e,r,i,n,s,a,o,u){let d=0,l=0,c=0,f=0,p=0,m=0,v=0,g=0,y=0,_=0,x=0,b=e,T=r;for(let w=1;w<=10;++w)l=w/10,c=l*l,f=c*l,p=1-l,m=p*p,v=m*p,g=v*e+3*m*l*i+3*p*c*s+f*o,y=v*r+3*m*l*n+3*p*c*a+f*u,_=b-g,x=T-y,b=g,T=y,d+=Math.sqrt(_*_+x*x);return d}static curveTo(e,r,i,n,s,a,o){const u=o[o.length-2],h=o[o.length-1];o.length-=2;const d=Or._segmentsCount(Ra.curveLength(u,h,e,r,i,n,s,a));let l=0,c=0,f=0,p=0,m=0;o.push(u,h);for(let v=1,g=0;v<=d;++v)g=v/d,l=1-g,c=l*l,f=c*l,p=g*g,m=p*g,o.push(f*u+3*c*g*e+3*l*p*i+m*s,f*h+3*c*g*r+3*l*p*n+m*a)}}function Vc(t,e,r,i,n,s,a,o){const u=t-r*n,h=e-i*n,d=t+r*s,l=e+i*s;let c,f;a?(c=i,f=-r):(c=-i,f=r);const p=u+c,m=h+f,v=d+c,g=l+f;return o.push(p,m,v,g),2}function rr(t,e,r,i,n,s,a,o){const u=r-t,h=i-e;let d=Math.atan2(u,h),l=Math.atan2(n-t,s-e);o&&d<l?d+=Math.PI*2:!o&&d>l&&(l+=Math.PI*2);let c=d;const f=l-d,p=Math.abs(f),m=Math.sqrt(u*u+h*h),v=(15*p*Math.sqrt(m)/Math.PI>>0)+1,g=f/v;if(c+=g,o){a.push(t,e,r,i);for(let y=1,_=c;y<v;y++,_+=g)a.push(t,e,t+Math.sin(_)*m,e+Math.cos(_)*m);a.push(t,e,n,s)}else{a.push(r,i,t,e);for(let y=1,_=c;y<v;y++,_+=g)a.push(t+Math.sin(_)*m,e+Math.cos(_)*m,t,e);a.push(n,s,t,e)}return v*2}function kT(t,e){const r=t.shape;let i=t.points||r.points.slice();const n=e.closePointEps;if(i.length===0)return;const s=t.lineStyle,a=new me(i[0],i[1]),o=new me(i[i.length-2],i[i.length-1]),u=r.type!==Me.POLY||r.closeStroke,h=Math.abs(a.x-o.x)<n&&Math.abs(a.y-o.y)<n;if(u){i=i.slice(),h&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const R=(a.x+o.x)*.5,B=(o.y+a.y)*.5;i.unshift(R,B),i.push(R,B)}const d=e.points,l=i.length/2;let c=i.length;const f=d.length/2,p=s.width/2,m=p*p,v=s.miterLimit*s.miterLimit;let g=i[0],y=i[1],_=i[2],x=i[3],b=0,T=0,w=-(y-x),S=g-_,A=0,I=0,F=Math.sqrt(w*w+S*S);w/=F,S/=F,w*=p,S*=p;const $=s.alignment,E=(1-$)*2,C=$*2;u||(s.cap===tr.ROUND?c+=rr(g-w*(E-C)*.5,y-S*(E-C)*.5,g-w*E,y-S*E,g+w*C,y+S*C,d,!0)+2:s.cap===tr.SQUARE&&(c+=Vc(g,y,w,S,E,C,!0,d))),d.push(g-w*E,y-S*E,g+w*C,y+S*C);for(let R=1;R<l-1;++R){g=i[(R-1)*2],y=i[(R-1)*2+1],_=i[R*2],x=i[R*2+1],b=i[(R+1)*2],T=i[(R+1)*2+1],w=-(y-x),S=g-_,F=Math.sqrt(w*w+S*S),w/=F,S/=F,w*=p,S*=p,A=-(x-T),I=_-b,F=Math.sqrt(A*A+I*I),A/=F,I/=F,A*=p,I*=p;const B=_-g,X=y-x,M=_-b,O=T-x,H=B*M+X*O,V=X*M-O*B,W=V<0;if(Math.abs(V)<.001*Math.abs(H)){d.push(_-w*E,x-S*E,_+w*C,x+S*C),H>=0&&(s.join===at.ROUND?c+=rr(_,x,_-w*E,x-S*E,_-A*E,x-I*E,d,!1)+4:c+=2,d.push(_-A*C,x-I*C,_+A*E,x+I*E));continue}const ne=(-w+g)*(-S+x)-(-w+_)*(-S+y),oe=(-A+b)*(-I+x)-(-A+_)*(-I+T),ce=(B*oe-M*ne)/V,ge=(O*ne-X*oe)/V,fe=(ce-_)*(ce-_)+(ge-x)*(ge-x),z=_+(ce-_)*E,q=x+(ge-x)*E,Y=_-(ce-_)*C,pe=x-(ge-x)*C,De=Math.min(B*B+X*X,M*M+O*O),K=W?E:C,_e=De+K*K*m,Qe=fe<=_e;let ct=s.join;if(ct===at.MITER&&fe/m>v&&(ct=at.BEVEL),Qe)switch(ct){case at.MITER:{d.push(z,q,Y,pe);break}case at.BEVEL:{W?d.push(z,q,_+w*C,x+S*C,z,q,_+A*C,x+I*C):d.push(_-w*E,x-S*E,Y,pe,_-A*E,x-I*E,Y,pe),c+=2;break}case at.ROUND:{W?(d.push(z,q,_+w*C,x+S*C),c+=rr(_,x,_+w*C,x+S*C,_+A*C,x+I*C,d,!0)+4,d.push(z,q,_+A*C,x+I*C)):(d.push(_-w*E,x-S*E,Y,pe),c+=rr(_,x,_-w*E,x-S*E,_-A*E,x-I*E,d,!1)+4,d.push(_-A*E,x-I*E,Y,pe));break}}else{switch(d.push(_-w*E,x-S*E,_+w*C,x+S*C),ct){case at.MITER:{W?d.push(Y,pe,Y,pe):d.push(z,q,z,q),c+=2;break}case at.ROUND:{W?c+=rr(_,x,_+w*C,x+S*C,_+A*C,x+I*C,d,!0)+2:c+=rr(_,x,_-w*E,x-S*E,_-A*E,x-I*E,d,!1)+2;break}}d.push(_-A*E,x-I*E,_+A*C,x+I*C),c+=2}}g=i[(l-2)*2],y=i[(l-2)*2+1],_=i[(l-1)*2],x=i[(l-1)*2+1],w=-(y-x),S=g-_,F=Math.sqrt(w*w+S*S),w/=F,S/=F,w*=p,S*=p,d.push(_-w*E,x-S*E,_+w*C,x+S*C),u||(s.cap===tr.ROUND?c+=rr(_-w*(E-C)*.5,x-S*(E-C)*.5,_-w*E,x-S*E,_+w*C,x+S*C,d,!1)+2:s.cap===tr.SQUARE&&(c+=Vc(_,x,w,S,E,C,!1,d)));const U=e.indices,G=Or.epsilon*Or.epsilon;for(let R=f;R<c+f-2;++R)g=d[R*2],y=d[R*2+1],_=d[(R+1)*2],x=d[(R+1)*2+1],b=d[(R+2)*2],T=d[(R+2)*2+1],!(Math.abs(g*(x-T)+_*(T-y)+b*(y-x))<G)&&U.push(R,R+1,R+2)}function LT(t,e){let r=0;const i=t.shape,n=t.points||i.points,s=i.type!==Me.POLY||i.closeStroke;if(n.length===0)return;const a=e.points,o=e.indices,u=n.length/2,h=a.length/2;let d=h;for(a.push(n[0],n[1]),r=1;r<u;r++)a.push(n[r*2],n[r*2+1]),o.push(d,d+1),d++;s&&o.push(d,h)}function Xc(t,e){t.lineStyle.native?LT(t,e):kT(t,e)}class Pa{static curveLength(e,r,i,n,s,a){const o=e-2*i+s,u=r-2*n+a,h=2*i-2*e,d=2*n-2*r,l=4*(o*o+u*u),c=4*(o*h+u*d),f=h*h+d*d,p=2*Math.sqrt(l+c+f),m=Math.sqrt(l),v=2*l*m,g=2*Math.sqrt(f),y=c/m;return(v*p+m*c*(p-g)+(4*f*l-c*c)*Math.log((2*m+y+p)/(y+g)))/(4*v)}static curveTo(e,r,i,n,s){const a=s[s.length-2],o=s[s.length-1],u=Or._segmentsCount(Pa.curveLength(a,o,e,r,i,n));let h=0,d=0;for(let l=1;l<=u;++l){const c=l/u;h=a+(e-a)*c,d=o+(r-o)*c,s.push(h+(e+(i-e)*c-h)*c,d+(r+(n-r)*c-d)*c)}}}const Ma={[Me.POLY]:jc,[Me.CIRC]:Cn,[Me.ELIP]:Cn,[Me.RECT]:FT,[Me.RREC]:OT},Wc=[],In=[];class Fa{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(e){return this.minX>this.maxX||this.minY>this.maxY?de.EMPTY:(e=e||new de(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:i,b:n,c:s,d:a,tx:o,ty:u}=e,h=i*r.x+s*r.y+o,d=n*r.x+a*r.y+u;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,d),this.maxY=Math.max(this.maxY,d)}addQuad(e){let r=this.minX,i=this.minY,n=this.maxX,s=this.maxY,a=e[0],o=e[1];r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[2],o=e[3],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[4],o=e[5],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[6],o=e[7],r=a<r?a:r,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,this.minX=r,this.minY=i,this.maxX=n,this.maxY=s}addFrame(e,r,i,n,s){this.addFrameMatrix(e.worldTransform,r,i,n,s)}addFrameMatrix(e,r,i,n,s){const a=e.a,o=e.b,u=e.c,h=e.d,d=e.tx,l=e.ty;let c=this.minX,f=this.minY,p=this.maxX,m=this.maxY,v=a*r+u*i+d,g=o*r+h*i+l;c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,v=a*n+u*i+d,g=o*n+h*i+l,c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,v=a*r+u*s+d,g=o*r+h*s+l,c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,v=a*n+u*s+d,g=o*n+h*s+l,c=v<c?v:c,f=g<f?g:f,p=v>p?v:p,m=g>m?g:m,this.minX=c,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(e,r,i){let n=this.minX,s=this.minY,a=this.maxX,o=this.maxY;for(let u=r;u<i;u+=2){const h=e[u],d=e[u+1];n=h<n?h:n,s=d<s?d:s,a=h>a?h:a,o=d>o?d:o}this.minX=n,this.minY=s,this.maxX=a,this.maxY=o}addVertices(e,r,i,n){this.addVerticesMatrix(e.worldTransform,r,i,n)}addVerticesMatrix(e,r,i,n,s=0,a=s){const o=e.a,u=e.b,h=e.c,d=e.d,l=e.tx,c=e.ty;let f=this.minX,p=this.minY,m=this.maxX,v=this.maxY;for(let g=i;g<n;g+=2){const y=r[g],_=r[g+1],x=o*y+h*_+l,b=d*_+u*y+c;f=Math.min(f,x-s),m=Math.max(m,x+s),p=Math.min(p,b-a),v=Math.max(v,b+a)}this.minX=f,this.minY=p,this.maxX=m,this.maxY=v}addBounds(e){const r=this.minX,i=this.minY,n=this.maxX,s=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<i?e.minY:i,this.maxX=e.maxX>n?e.maxX:n,this.maxY=e.maxY>s?e.maxY:s}addBoundsMask(e,r){const i=e.minX>r.minX?e.minX:r.minX,n=e.minY>r.minY?e.minY:r.minY,s=e.maxX<r.maxX?e.maxX:r.maxX,a=e.maxY<r.maxY?e.maxY:r.maxY;if(i<=s&&n<=a){const o=this.minX,u=this.minY,h=this.maxX,d=this.maxY;this.minX=i<o?i:o,this.minY=n<u?n:u,this.maxX=s>h?s:h,this.maxY=a>d?a:d}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const i=e.minX>r.x?e.minX:r.x,n=e.minY>r.y?e.minY:r.y,s=e.maxX<r.x+r.width?e.maxX:r.x+r.width,a=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(i<=s&&n<=a){const o=this.minX,u=this.minY,h=this.maxX,d=this.maxY;this.minX=i<o?i:o,this.minY=n<u?n:u,this.maxX=s>h?s:h,this.maxY=a>d?a:d}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,i,n,s,a){e-=s,r-=a,i+=s,n+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>n?this.maxY:n}}class Nr extends Bi{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new ca,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 Fa,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(e){const r=Object.keys(e);for(let i=0;i<r.length;++i){const n=r[i];Object.defineProperty(Nr.prototype,n,Object.getOwnPropertyDescriptor(e,n))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new de),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new de),e=this._localBoundsRect),this._localBounds||(this._localBounds=new Fa);const r=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const n=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,e);return this.parent=i,this.transform=r,this._bounds=n,this._bounds.updateID+=this._boundsID-s,a}toGlobal(e,r,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,i,n){return r&&(e=r.toGlobal(e,i,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,i)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,i=1,n=1,s=0,a=0,o=0,u=0,h=0){return this.position.x=e,this.position.y=r,this.scale.x=i||1,this.scale.y=n||1,this.rotation=s,this.skew.x=a,this.skew.y=o,this.pivot.x=u,this.pivot.y=h,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new DT),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*Qx}set angle(e){this.transform.rotation=e*ai}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class DT extends Nr{constructor(){super(...arguments),this.sortDirty=null}}Nr.prototype.displayObjectUpdateTransform=Nr.prototype.updateTransform;const BT=new Ue;function UT(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const Oa=class extends Nr{constructor(){super(),this.children=[],this.sortableChildren=Oa.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.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 r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);rn(this.children,r,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;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(r===-1)return null;e.parent=null,e.transform._parentID=-1,rn(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,rn(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,i=e,n=i-r;let s;if(n>0&&n<=i){s=this.children.splice(r,n);for(let a=0;a<s.length;++a)s[a].parent=null,s[a].transform&&(s[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let a=0;a<s.length;++a)s[a].emit("removed",this),this.emit("childRemoved",s[a],this,a);return s}else if(n===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const i=this.children[e];i._lastSortedIndex=e,!t&&i.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(UT),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;t<e;++t){const r=this.children[t];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(!(!e.visible||!e.renderable))if(e.calculateBounds(),e._mask){const r=e._mask.isMaskData?e._mask.maskObject:e._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let i=0,n=this.children.length;i<n;++i){const s=this.children[i];s.visible&&s.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let r,i;this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==Oa.prototype._render&&(r=this.getBounds(!0));const n=t.projection.transform;if(n&&(i?(i=BT.copyFrom(i),i.prepend(n)):i=n),r&&e.intersects(r,i))this._render(t);else if(this.cullArea)return;for(let s=0,a=this.children.length;s<a;++s){const o=this.children[s],u=o.cullable;o.cullable=u||!this.cullArea,o.render(t),o.cullable=u}}render(t){var e;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(e=this.filters)!=null&&e.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let r=0,i=this.children.length;r<i;++r)this.children[r].render(t)}}renderAdvanced(t){var n,s,a;const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let o=0;o<e.length;o++)e[o].enabled&&this._enabledFilters.push(e[o])}const i=e&&((n=this._enabledFilters)==null?void 0:n.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ee.NONE));if(i&&t.batch.flush(),e&&((s=this._enabledFilters)!=null&&s.length)&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let o=0,u=this.children.length;o<u;++o)this.children[o].render(t)}i&&t.batch.flush(),r&&t.mask.pop(this),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e=typeof t=="boolean"?t:t==null?void 0:t.children,r=this.removeChildren(0,this.children.length);if(e)for(let i=0;i<r.length;++i)r[i].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;e!==0?this.scale.x=t/e:this.scale.x=1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;e!==0?this.scale.y=t/e:this.scale.y=1,this._height=t}};let kr=Oa;kr.defaultSortableChildren=!1,kr.prototype.containerUpdateTransform=kr.prototype.updateTransform,Object.defineProperties(Q,{SORTABLE_CHILDREN:{get(){return kr.defaultSortableChildren},set(t){re("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),kr.defaultSortableChildren=t}}});class Rn{constructor(e,r=null,i=null,n=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=r,this.matrix=n,this.type=e.type}clone(){return new Rn(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const Lr=new me,qc=class extends Au{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new Fa,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),In.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),Wc.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const n=new Rn(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new Rn(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const i=e[r];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,Lr):Lr.copyFrom(t),i.shape.contains(Lr.x,Lr.y))){let n=!1;if(i.holes){for(let s=0;s<i.holes.length;s++)if(i.holes[s].shape.contains(Lr.x,Lr.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,i=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],i=r.style);for(let o=this.shapeIndex;o<e.length;o++){this.shapeIndex++;const u=e[o],h=u.fillStyle,d=u.lineStyle;Ma[u.type].build(u),u.matrix&&this.transformPoints(u.points,u.matrix),(h.visible||d.visible)&&this.processHoles(u.holes);for(let c=0;c<2;c++){const f=c===0?h:d;if(!f.visible)continue;const p=f.texture.baseTexture,m=this.indices.length,v=this.points.length/2;p.wrapMode=qr.REPEAT,c===0?this.processFill(u):this.processLine(u);const g=this.points.length/2-v;g!==0&&(r&&!this._compareStyles(i,f)&&(r.end(m,v),r=null),r||(r=Wc.pop()||new NT,r.begin(f,m,v),this.batches.push(r),i=f),this.addUvs(this.points,t,f.texture,v,g,f.matrix))}}const n=this.indices.length,s=this.points.length/2;if(r&&r.end(n,s),this.batches.length===0){this.batchable=!0;return}const a=s>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?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;t<e;t++){const r=this.graphicsData[t],i=r.fillStyle,n=r.lineStyle;if(i&&!i.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const i=t[e];for(let n=0;n<i.size;n++){const s=i.start+n;this.indicesUint16[s]=this.indicesUint16[s]-i.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<qc.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++ae._globalBatch;for(let d=0;d<this.drawCalls.length;d++)this.drawCalls[d].texArray.clear(),In.push(this.drawCalls[d]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let i=In.pop();i||(i=new aa,i.texArray=new fa),i.texArray.count=0,i.start=0,i.size=0,i.type=It.TRIANGLES;let n=0,s=null,a=0,o=!1,u=It.TRIANGLES,h=0;this.drawCalls.push(i);for(let d=0;d<this.batches.length;d++){const l=this.batches[d],c=8,f=l.style,p=f.texture.baseTexture;o!==!!f.native&&(o=!!f.native,u=o?It.LINES:It.TRIANGLES,s=null,n=c,t++),s!==p&&(s=p,p._batchEnabled!==t&&(n===c&&(t++,n=0,i.size>0&&(i=In.pop(),i||(i=new aa,i.texArray=new fa),this.drawCalls.push(i)),i.start=h,i.size=0,i.texArray.count=0,i.type=u),p.touched=1,p._batchEnabled=t,p._batchLocation=n,p.wrapMode=qr.REPEAT,i.texArray.elements[i.texArray.count++]=p,n++)),i.size+=l.size,h+=l.size,a=p._batchLocation,this.addColors(e,f.color,f.alpha,l.attribSize,l.attribStart),this.addTextureIds(r,a,l.attribSize,l.attribStart)}ae._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(t.length*3*4),s=new Float32Array(n),a=new Uint32Array(n);let o=0;for(let u=0;u<t.length/2;u++)s[o++]=t[u*2],s[o++]=t[u*2+1],s[o++]=e[u*2],s[o++]=e[u*2+1],a[o++]=r[u],s[o++]=i[u];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?jc.triangulate(t,this):Ma[t.type].triangulate(t,this)}processLine(t){Xc(t,this);for(let e=0;e<t.holes.length;e++)Xc(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];Ma[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const i=t[r*2],n=t[r*2+1];t[r*2]=e.a*i+e.c*n+e.tx,t[r*2+1]=e.b*i+e.d*n+e.ty}}addColors(t,e,r,i,n=0){const s=Le.shared.setValue(e).toLittleEndianNumber(),a=Le.shared.setValue(s).toPremultiplied(r);t.length=Math.max(t.length,n+i);for(let o=0;o<i;o++)t[n+o]=a}addTextureIds(t,e,r,i=0){t.length=Math.max(t.length,i+r);for(let n=0;n<r;n++)t[i+n]=e}addUvs(t,e,r,i,n,s=null){let a=0;const o=e.length,u=r.frame;for(;a<n;){let d=t[(i+a)*2],l=t[(i+a)*2+1];if(s){const c=s.a*d+s.c*l+s.tx;l=s.b*d+s.d*l+s.ty,d=c}a++,e.push(d/u.width,l/u.height)}const h=r.baseTexture;(u.width<h.width||u.height<h.height)&&this.adjustUvs(e,r,o,n)}adjustUvs(t,e,r,i){const n=e.baseTexture,s=1e-6,a=r+i*2,o=e.frame,u=o.width/n.width,h=o.height/n.height;let d=o.x/o.width,l=o.y/o.height,c=Math.floor(t[r]+s),f=Math.floor(t[r+1]+s);for(let p=r+2;p<a;p+=2)c=Math.min(c,Math.floor(t[p]+s)),f=Math.min(f,Math.floor(t[p+1]+s));d-=c,l-=f;for(let p=r;p<a;p+=2)t[p]=(t[p]+d)*u,t[p+1]=(t[p+1]+l)*h}};let Yc=qc;Yc.BATCHABLE_SIZE=100;class Pn{constructor(){this.color=16777215,this.alpha=1,this.texture=ie.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new Pn;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=ie.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class Na extends Pn{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=tr.BUTT,this.join=at.MITER,this.miterLimit=10}clone(){const e=new Na;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const ka={},Mn=class extends kr{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new Pn,this._lineStyle=new Na,this._matrix=null,this._holeMode=!1,this.state=sn.for2d(),this._geometry=t||new Yc,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Le(16777215),this.blendMode=j.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new Mn(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,i=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:r,alignment:i,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:ie.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:tr.BUTT,join:at.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},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 oi,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new oi,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 r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return(i!==t||n!==e)&&r.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,r,i){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),Pa.curveTo(t,e,r,i,n),this}bezierCurveTo(t,e,r,i,n,s){return this._initCurve(),Ra.curveTo(t,e,r,i,n,s,this.currentPath.points),this}arcTo(t,e,r,i,n){this._initCurve(t,e);const s=this.currentPath.points,a=Hc.curveTo(t,e,r,i,n,s);if(a){const{cx:o,cy:u,radius:h,startAngle:d,endAngle:l,anticlockwise:c}=a;this.arc(o,u,h,d,l,c)}return this}arc(t,e,r,i,n,s=!1){if(i===n)return this;if(!s&&n<=i?n+=on:s&&i<=n&&(i+=on),n-i===0)return this;const o=t+Math.cos(i)*r,u=e+Math.sin(i)*r,h=this._geometry.closePointEps;let d=this.currentPath?this.currentPath.points:null;if(d){const l=Math.abs(d[d.length-2]-o),c=Math.abs(d[d.length-1]-u);l<h&&c<h||d.push(o,u)}else this.moveTo(o,u),d=this.currentPath.points;return Hc.arc(o,u,t,e,r,i,n,s,d),this}beginFill(t=0,e){return this.beginTextureFill({texture:ie.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Le.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:ie.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,i){return this.drawShape(new de(t,e,r,i))}drawRoundedRect(t,e,r,i,n){return this.drawShape(new la(t,e,r,i,n))}drawCircle(t,e,r){return this.drawShape(new oa(t,e,r))}drawEllipse(t,e,r,i){return this.drawShape(new Jx(t,e,r,i))}drawPolygon(...t){let e,r=!0;const i=t[0];i.points?(r=i.closeStroke,e=i.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new oi(e);return n.closeStroke=r,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===Me.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,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(let i=0;i<r;i++){const n=t.batches[i],s=n.style.color,a=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),o=new Float32Array(t.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),u=new Uint16Array(t.indicesUint16.buffer,n.start*2,n.size),h={vertexData:a,blendMode:e,indices:u,uvs:o,_batchRGB:Le.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=h}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,i=this.worldAlpha,n=e.uniforms,s=r.drawCalls;n.translationMatrix=this.transform.worldTransform,Le.shared.setValue(this._tintColor).premultiply(i).toArray(n.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let a=0,o=s.length;a<o;a++)this._renderDrawCallDirect(t,r.drawCalls[a])}_renderDrawCallDirect(t,e){const{texArray:r,type:i,size:n,start:s}=e,a=r.count;for(let o=0;o<a;o++)t.texture.bind(r.elements[o],o);t.geometry.draw(i,n,s)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!ka[r]){const{maxTextures:i}=t.plugins[r],n=new Int32Array(i);for(let o=0;o<i;o++)n[o]=o;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ue,default:tt.from({uSamplers:n},!0)},a=t.plugins[r]._shader.program;ka[r]=new ui(a,s)}e=ka[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:i,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,r,i,n)}containsPoint(t){return this.worldTransform.applyInverse(t,Mn._TEMP_POINT),this._geometry.containsPoint(Mn._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Le.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,s=e.d,a=e.tx,o=e.ty,u=this._geometry.points,h=this.vertexData;let d=0;for(let l=0;l<u.length;l+=2){const c=u[l],f=u[l+1];h[d++]=r*c+n*f+a,h[d++]=s*f+i*c+o}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let La=Mn;La.curves=Or,La._TEMP_POINT=new me;var $T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Da={},GT={get exports(){return Da},set exports(t){Da=t}};/*!
1962
1962
  * d-path-parser - v1.0.0
1963
1963
  * by Massimo Artizzu (MaxArt2501)
1964
1964
  *
@@ -1966,10 +1966,10 @@ void main() {
1966
1966
  *
1967
1967
  * Licensed under the MIT License
1968
1968
  * See LICENSE for details
1969
- */(function(t,e){(function(r,i){t.exports=i()})(zT,function(){return function(i){for(var n={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},s={number:function(m){return+f("number",m)},"coordinate pair":function(m){var v=f("number",m);if(v===null&&!m)return null;f("comma");var g=f("number",!0);return{x:+v,y:+g}},"arc definition":function(m){var v=s["coordinate pair"](m);if(!v&&!m)return null;f("comma");var g=+f("number",!0);f("comma",!0);var y=!!+f("flag",!0);f("comma");var _=!!+f("flag",!0);f("comma");var x=s["coordinate pair"](!0);return{radii:v,rotation:g,large:y,clockwise:_,end:x}}},a=0,o=[];a<i.length;){var u=f("command"),h=u.toUpperCase(),d=u!==h,l;switch(h){case"M":l=p("coordinate pair").map(function(m,v){return v===1&&(u=d?"l":"L"),c({end:m})});break;case"L":case"T":l=p("coordinate pair").map(function(m){return c({end:m})});break;case"C":if(l=p("coordinate pair"),l.length%3)throw Error("Expected coordinate pair triplet at position "+a);l=l.reduce(function(m,v,g){var y=g%3;if(!y)m.push(c({cp1:v}));else{var _=m[m.length-1];_[y===1?"cp2":"end"]=v}return m},[]);break;case"Q":case"S":if(l=p("coordinate pair"),l.length&1)throw Error("Expected coordinate pair couple at position "+a);l=l.reduce(function(m,v,g){var y=g&1;if(!y)m.push(c({cp:v}));else{var _=m[m.length-1];_.end=v}return m},[]);break;case"H":case"V":l=p("number").map(function(m){return c({value:m})});break;case"A":l=p("arc definition").map(c);break;case"Z":l=[{code:"Z"}];break}o.push.apply(o,l)}return o;function c(m){return m.code=u,m.relative=d,m}function f(m,v){n[m].lastIndex=a;var g=n[m].exec(i);if(!g||g.index!==a){if(!v)return null;throw Error("Expected "+m+" at position "+a)}return a=n[m].lastIndex,g[1]}function p(m){for(var v=[],g,y=!0;g=s[m](y);)v.push(g),y=!!f("comma");return v}}})})(jT);const HT=/^\s+/,VT=/\s+$/;function D(t,e){if(t=t||"",e=e||{},t instanceof D)return t;if(!(this instanceof D))return new D(t,e);var r=XT(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,r,i,n,s,a;return e=t.r/255,r=t.g/255,i=t.b/255,e<=.03928?n=e/12.92:n=Math.pow((e+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*a},setAlpha:function(t){return this._a=ih(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Jc(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Jc(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+r+"%, "+i+"%)":"hsva("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=Qc(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Qc(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return eh(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return KT(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ye(this._r,255)*100)+"%",g:Math.round(ye(this._g,255)*100)+"%",b:Math.round(ye(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%)":"rgba("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:lw[eh(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+th(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var n=D(t);r="#"+th(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,n=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return n?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(ew,arguments)},brighten:function(){return this._applyModification(tw,arguments)},darken:function(){return this._applyModification(rw,arguments)},desaturate:function(){return this._applyModification(ZT,arguments)},saturate:function(){return this._applyModification(QT,arguments)},greyscale:function(){return this._applyModification(JT,arguments)},spin:function(){return this._applyModification(iw,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(aw,arguments)},complement:function(){return this._applyCombination(nw,arguments)},monochromatic:function(){return this._applyCombination(ow,arguments)},splitcomplement:function(){return this._applyCombination(sw,arguments)},triad:function(){return this._applyCombination(rh,[3])},tetrad:function(){return this._applyCombination(rh,[4])}},D.fromRatio=function(t,e){if(typeof t=="object"){var r={};for(var i in t)t.hasOwnProperty(i)&&(i==="a"?r[i]=t[i]:r[i]=vi(t[i]));t=r}return D(t,e)};function XT(t){var e={r:0,g:0,b:0},r=1,i=null,n=null,s=null,a=!1,o=!1;return typeof t=="string"&&(t=fw(t)),typeof t=="object"&&(wt(t.r)&&wt(t.g)&&wt(t.b)?(e=WT(t.r,t.g,t.b),a=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):wt(t.h)&&wt(t.s)&&wt(t.v)?(i=vi(t.s),n=vi(t.v),e=YT(t.h,i,n),a=!0,o="hsv"):wt(t.h)&&wt(t.s)&&wt(t.l)&&(i=vi(t.s),s=vi(t.l),e=qT(t.h,i,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=ih(r),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function WT(t,e,r){return{r:ye(t,255)*255,g:ye(e,255)*255,b:ye(r,255)*255}}function Qc(t,e,r){t=ye(t,255),e=ye(e,255),r=ye(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),s,a,o=(i+n)/2;if(i==n)s=a=0;else{var u=i-n;switch(a=o>.5?u/(2-i-n):u/(i+n),i){case t:s=(e-r)/u+(e<r?6:0);break;case e:s=(r-t)/u+2;break;case r:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,l:o}}function qT(t,e,r){var i,n,s;t=ye(t,360),e=ye(e,100),r=ye(r,100);function a(h,d,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?h+(d-h)*6*l:l<1/2?d:l<2/3?h+(d-h)*(2/3-l)*6:h}if(e===0)i=n=s=r;else{var o=r<.5?r*(1+e):r+e-r*e,u=2*r-o;i=a(u,o,t+1/3),n=a(u,o,t),s=a(u,o,t-1/3)}return{r:i*255,g:n*255,b:s*255}}function Jc(t,e,r){t=ye(t,255),e=ye(e,255),r=ye(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),s,a,o=i,u=i-n;if(a=i===0?0:u/i,i==n)s=0;else{switch(i){case t:s=(e-r)/u+(e<r?6:0);break;case e:s=(r-t)/u+2;break;case r:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,v:o}}function YT(t,e,r){t=ye(t,360)*6,e=ye(e,100),r=ye(r,100);var i=Math.floor(t),n=t-i,s=r*(1-e),a=r*(1-n*e),o=r*(1-(1-n)*e),u=i%6,h=[r,a,s,s,o,r][u],d=[o,r,r,a,s,s][u],l=[s,s,o,r,r,a][u];return{r:h*255,g:d*255,b:l*255}}function eh(t,e,r,i){var n=[ot(Math.round(t).toString(16)),ot(Math.round(e).toString(16)),ot(Math.round(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function KT(t,e,r,i,n){var s=[ot(Math.round(t).toString(16)),ot(Math.round(e).toString(16)),ot(Math.round(r).toString(16)),ot(nh(i))];return n&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function th(t,e,r,i){var n=[ot(nh(i)),ot(Math.round(t).toString(16)),ot(Math.round(e).toString(16)),ot(Math.round(r).toString(16))];return n.join("")}D.equals=function(t,e){return!t||!e?!1:D(t).toRgbString()==D(e).toRgbString()},D.random=function(){return D.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ZT(t,e){e=e===0?0:e||10;var r=D(t).toHsl();return r.s-=e/100,r.s=kn(r.s),D(r)}function QT(t,e){e=e===0?0:e||10;var r=D(t).toHsl();return r.s+=e/100,r.s=kn(r.s),D(r)}function JT(t){return D(t).desaturate(100)}function ew(t,e){e=e===0?0:e||10;var r=D(t).toHsl();return r.l+=e/100,r.l=kn(r.l),D(r)}function tw(t,e){e=e===0?0:e||10;var r=D(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),D(r)}function rw(t,e){e=e===0?0:e||10;var r=D(t).toHsl();return r.l-=e/100,r.l=kn(r.l),D(r)}function iw(t,e){var r=D(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,D(r)}function nw(t){var e=D(t).toHsl();return e.h=(e.h+180)%360,D(e)}function rh(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=D(t).toHsl(),i=[D(t)],n=360/e,s=1;s<e;s++)i.push(D({h:(r.h+s*n)%360,s:r.s,l:r.l}));return i}function sw(t){var e=D(t).toHsl(),r=e.h;return[D(t),D({h:(r+72)%360,s:e.s,l:e.l}),D({h:(r+216)%360,s:e.s,l:e.l})]}function aw(t,e,r){e=e||6,r=r||30;var i=D(t).toHsl(),n=360/r,s=[D(t)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,s.push(D(i));return s}function ow(t,e){e=e||6;for(var r=D(t).toHsv(),i=r.h,n=r.s,s=r.v,a=[],o=1/e;e--;)a.push(D({h:i,s:n,v:s})),s=(s+o)%1;return a}D.mix=function(t,e,r){r=r===0?0:r||50;var i=D(t).toRgb(),n=D(e).toRgb(),s=r/100,a={r:(n.r-i.r)*s+i.r,g:(n.g-i.g)*s+i.g,b:(n.b-i.b)*s+i.b,a:(n.a-i.a)*s+i.a};return D(a)},D.readability=function(t,e){var r=D(t),i=D(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},D.isReadable=function(t,e,r){var i=D.readability(t,e),n,s;switch(s=!1,n=dw(r),n.level+n.size){case"AAsmall":case"AAAlarge":s=i>=4.5;break;case"AAlarge":s=i>=3;break;case"AAAsmall":s=i>=7;break}return s},D.mostReadable=function(t,e,r){var i=null,n=0,s,a,o,u;r=r||{},a=r.includeFallbackColors,o=r.level,u=r.size;for(var h=0;h<e.length;h++)s=D.readability(t,e[h]),s>n&&(n=s,i=D(e[h]));return D.isReadable(t,i,{level:o,size:u})||!a?i:(r.includeFallbackColors=!1,D.mostReadable(t,["#fff","#000"],r))};var za=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},lw=D.hexNames=uw(za);function uw(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function ih(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ye(t,e){cw(t)&&(t="100%");var r=hw(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function kn(t){return Math.min(1,Math.max(0,t))}function Ve(t){return parseInt(t,16)}function cw(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function hw(t){return typeof t=="string"&&t.indexOf("%")!=-1}function ot(t){return t.length==1?"0"+t:""+t}function vi(t){return t<=1&&(t=t*100+"%"),t}function nh(t){return Math.round(parseFloat(t)*255).toString(16)}function sh(t){return Ve(t)/255}var lt=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function wt(t){return!!lt.CSS_UNIT.exec(t)}function fw(t){t=t.replace(HT,"").replace(VT,"").toLowerCase();var e=!1;if(za[t])t=za[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=lt.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=lt.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=lt.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=lt.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=lt.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=lt.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=lt.hex8.exec(t))?{r:Ve(r[1]),g:Ve(r[2]),b:Ve(r[3]),a:sh(r[4]),format:e?"name":"hex8"}:(r=lt.hex6.exec(t))?{r:Ve(r[1]),g:Ve(r[2]),b:Ve(r[3]),format:e?"name":"hex"}:(r=lt.hex4.exec(t))?{r:Ve(r[1]+""+r[1]),g:Ve(r[2]+""+r[2]),b:Ve(r[3]+""+r[3]),a:sh(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=lt.hex3.exec(t))?{r:Ve(r[1]+""+r[1]),g:Ve(r[2]+""+r[2]),b:Ve(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function dw(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}var pw=function(){function t(e,r){var i=[],n=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(i.push(u.value),!(r&&i.length===r));n=!0);}catch(h){s=!0,a=h}finally{try{!n&&o.return&&o.return()}finally{if(s)throw a}}return i}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_i=Math.PI*2,ja=function(e,r,i,n,s,a,o){var u=e.x,h=e.y;u*=r,h*=i;var d=n*u-s*h,l=s*u+n*h;return{x:d+a,y:l+o}},mw=function(e,r){var i=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),n=Math.cos(e),s=Math.sin(e),a=Math.cos(e+r),o=Math.sin(e+r);return[{x:n-s*i,y:s+n*i},{x:a+o*i,y:o-a*i},{x:a,y:o}]},ah=function(e,r,i,n){var s=e*n-r*i<0?-1:1,a=e*i+r*n;return a>1&&(a=1),a<-1&&(a=-1),s*Math.acos(a)},gw=function(e,r,i,n,s,a,o,u,h,d,l,c){var f=Math.pow(s,2),p=Math.pow(a,2),m=Math.pow(l,2),v=Math.pow(c,2),g=f*p-f*v-p*m;g<0&&(g=0),g/=f*v+p*m,g=Math.sqrt(g)*(o===u?-1:1);var y=g*s/a*c,_=g*-a/s*l,x=d*y-h*_+(e+i)/2,b=h*y+d*_+(r+n)/2,T=(l-y)/s,w=(c-_)/a,S=(-l-y)/s,A=(-c-_)/a,C=ah(1,0,T,w),F=ah(T,w,S,A);return u===0&&F>0&&(F-=_i),u===1&&F<0&&(F+=_i),[x,b,C,F]},oh=function(e){var r=e.px,i=e.py,n=e.cx,s=e.cy,a=e.rx,o=e.ry,u=e.xAxisRotation,h=u===void 0?0:u,d=e.largeArcFlag,l=d===void 0?0:d,c=e.sweepFlag,f=c===void 0?0:c,p=[];if(a===0||o===0)return[];var m=Math.sin(h*_i/360),v=Math.cos(h*_i/360),g=v*(r-n)/2+m*(i-s)/2,y=-m*(r-n)/2+v*(i-s)/2;if(g===0&&y===0)return[];a=Math.abs(a),o=Math.abs(o);var _=Math.pow(g,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(o,2);_>1&&(a*=Math.sqrt(_),o*=Math.sqrt(_));var x=gw(r,i,n,s,a,o,l,f,m,v,g,y),b=pw(x,4),T=b[0],w=b[1],S=b[2],A=b[3],C=Math.abs(A)/(_i/4);Math.abs(1-C)<1e-7&&(C=1);var F=Math.max(Math.ceil(C),1);A/=F;for(var z=0;z<F;z++)p.push(mw(S,A)),S+=A;return p.map(function(I){var E=ja(I[0],a,o,v,m,T,w),B=E.x,U=E.y,R=ja(I[1],a,o,v,m,T,w),$=R.x,X=R.y,M=ja(I[2],a,o,v,m,T,w),O=M.x,H=M.y;return{x1:B,y1:U,x2:$,y2:X,x:O,y:H}})};class vw extends $a{constructor(e){super(),this.lineColor=null,e&&this.drawSVG(e)}drawSVG(e){if(typeof e=="string"){const r=document.createElement("div");r.innerHTML=e.trim(),e=r.querySelector("svg")}if(!e)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(e),this._svgChildren(e.children),this}_svgChildren(e,r=!1){for(let i=0;i<e.length;i++){const n=e[i];switch(this._svgFill(n,r),n.nodeName.toLowerCase()){case"path":{this._svgPath(n);break}case"circle":case"ellipse":{this._svgCircle(n);break}case"rect":{this._svgRect(n);break}case"polygon":{this._svgPoly(n,!0);break}case"polyline":{this._svgPoly(n);break}case"g":break;default:{console.info(`[PIXI.SVG] <${n.nodeName}> elements unsupported`);break}}this._svgChildren(n.children,!0)}}_hexToUint(e){if(e[0]==="#")return e=e.substr(1),e.length===3&&(e=e.replace(/([a-f0-9])/ig,"$1$1")),parseInt(e,16);const{r,g:i,b:n}=D(e).toRgb();return(r<<16)+(i<<8)+n}_svgCircle(e){let r="r",i="r";const n=e.nodeName==="elipse";n&&(r+="x",i+="y");const s=parseFloat(e.getAttribute(i)),a=parseFloat(e.getAttribute(r)),o=e.getAttribute("cx"),u=e.getAttribute("cy");let h=0,d=0;o!==null&&(h=parseFloat(o)),u!==null&&(d=parseFloat(u)),n?this.drawEllipse(h,d,s,a):this.drawCircle(h,d,s)}_svgRect(e){const r=parseFloat(e.getAttribute("x")),i=parseFloat(e.getAttribute("y")),n=parseFloat(e.getAttribute("width")),s=parseFloat(e.getAttribute("height")),a=parseFloat(e.getAttribute("rx"));a?this.drawRoundedRect(r,i,n,s,a):this.drawRect(r,i,n,s)}_convertStyleName(e){return e.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(e){const r=e.getAttribute("style"),i=e.getAttribute("opacity"),n={fill:e.getAttribute("fill"),opacity:i||e.getAttribute("fill-opacity"),stroke:e.getAttribute("stroke"),strokeOpacity:i||e.getAttribute("stroke-opacity"),strokeWidth:e.getAttribute("stroke-width"),cap:e.getAttribute("stroke-linecap"),join:e.getAttribute("stroke-linejoin"),miterLimit:e.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(s=>{const[a,o]=s.split(":");if(a){const u=this._convertStyleName(a);n[u]||(n[u]=o.trim())}}),n}_svgPoly(e,r){const i=e.getAttribute("points").split(/[ ,]/g).map(n=>parseInt(n,10));this.drawPolygon(i),r&&this.closePath()}_svgFill(e,r){const{fill:i,opacity:n,stroke:s,strokeOpacity:a,strokeWidth:o,cap:u,join:h,miterLimit:d}=this._svgStyle(e),c=o!==null?parseFloat(o):s!==null?1:0,f=s!==null?this._hexToUint(s):this.lineColor;i?i==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(i),n!==null?parseFloat(n):1):r||this.beginFill(0),this.lineStyle({width:s===null&&o===null&&r?this.line.width:c,alpha:a===null?this.line.alpha:parseFloat(a),color:s===null&&r?this.line.color:f,cap:u===null&&r?this.line.cap:u,join:h===null&&r?this.line.join:h,miterLimit:d===null&&r?this.line.miterLimit:parseFloat(d)}),e.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(e){const r=e.getAttribute("d");let i=0,n=0;const s=Ga(r.trim());for(let a=0;a<s.length;a++){const o=s[a];switch(o.code){case"m":{this.moveTo(i+=o.end.x,n+=o.end.y);break}case"M":{this.moveTo(i=o.end.x,n=o.end.y);break}case"H":{this.lineTo(i=o.value,n);break}case"h":{this.lineTo(i+=o.value,n);break}case"V":{this.lineTo(i,n=o.value);break}case"v":{this.lineTo(i,n+=o.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(i=o.end.x,n=o.end.y);break}case"l":{this.lineTo(i+=o.end.x,n+=o.end.y);break}case"C":{this.bezierCurveTo(o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,i=o.end.x,n=o.end.y);break}case"c":{const u=i,h=n;this.bezierCurveTo(u+o.cp1.x,h+o.cp1.y,u+o.cp2.x,h+o.cp2.y,i+=o.end.x,n+=o.end.y);break}case"s":case"q":{const u=i,h=n;this.quadraticCurveTo(u+o.cp.x,h+o.cp.y,i+=o.end.x,n+=o.end.y);break}case"S":case"Q":{this.quadraticCurveTo(o.cp.x,o.cp.y,i=o.end.x,n=o.end.y);break}case"a":{oh({px:i,py:n,cx:i+=o.end.x,cy:n+=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:u,y1:h,x2:d,y2:l,x:c,y:f})=>this.bezierCurveTo(u,h,d,l,c,f));break}case"A":{oh({px:i,py:n,cx:i=o.end.x,cy:n=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:u,y1:h,x2:d,y2:l,x:c,y:f})=>this.bezierCurveTo(u,h,d,l,c,f));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var Ln={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},_w=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function yw(t){return t===10||t===13||t===8232||t===8233||t===32||t===9||t===11||t===12||t===160||t>=5760&&_w.indexOf(t)>=0}function xw(t){switch(t|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function bw(t){return(t|32)===97}function Ur(t){return t>=48&&t<=57}function Tw(t){return t>=48&&t<=57||t===43||t===45||t===46}function ww(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Dn(t){for(;t.index<t.max&&yw(t.path.charCodeAt(t.index));)t.index++}function Sw(t){var e=t.path.charCodeAt(t.index);if(e===48){t.param=0,t.index++;return}if(e===49){t.param=1,t.index++;return}t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")"}function Aw(t){var e=t.index,r=e,i=t.max,n=!1,s=!1,a=!1,o=!1,u;if(r>=i){t.err="SvgPath: missed param (at pos "+r+")";return}if(u=t.path.charCodeAt(r),(u===43||u===45)&&(r++,u=r<i?t.path.charCodeAt(r):0),!Ur(u)&&u!==46){t.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(u!==46){if(n=u===48,r++,u=r<i?t.path.charCodeAt(r):0,n&&r<i&&u&&Ur(u)){t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+e+")";return}for(;r<i&&Ur(t.path.charCodeAt(r));)r++,s=!0;u=r<i?t.path.charCodeAt(r):0}if(u===46){for(o=!0,r++;Ur(t.path.charCodeAt(r));)r++,a=!0;u=r<i?t.path.charCodeAt(r):0}if(u===101||u===69){if(o&&!s&&!a){t.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,u=r<i?t.path.charCodeAt(r):0,(u===43||u===45)&&r++,r<i&&Ur(t.path.charCodeAt(r)))for(;r<i&&Ur(t.path.charCodeAt(r));)r++;else{t.err="SvgPath: invalid float exponent (at pos "+r+")";return}}t.index=r,t.param=parseFloat(t.path.slice(e,r))+0}function Ha(t){var e,r;e=t.path[t.segmentStart],r=e.toLowerCase();var i=t.data;if(r==="m"&&i.length>2&&(t.result.push([e,i[0],i[1]]),i=i.slice(2),r="l",e=e==="m"?"l":"L"),r==="r")t.result.push([e].concat(i));else for(;i.length>=Ln[r]&&(t.result.push([e].concat(i.splice(0,Ln[r]))),!!Ln[r]););}function Ew(t){var e=t.max,r,i,n,s,a;if(t.segmentStart=t.index,r=t.path.charCodeAt(t.index),i=bw(r),!xw(r)){t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")";return}if(s=Ln[t.path[t.index].toLowerCase()],t.index++,Dn(t),t.data=[],!s){Ha(t);return}for(n=!1;;){for(a=s;a>0;a--){if(i&&(a===3||a===4)?Sw(t):Aw(t),t.err.length){Ha(t);return}t.data.push(t.param),Dn(t),n=!1,t.index<e&&t.path.charCodeAt(t.index)===44&&(t.index++,Dn(t),n=!0)}if(!n&&(t.index>=t.max||!Tw(t.path.charCodeAt(t.index))))break}Ha(t)}var Cw=function(e){var r=new ww(e),i=r.max;for(Dn(r);r.index<i&&!r.err.length;)Ew(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function Iw(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function ut(){if(!(this instanceof ut))return new ut;this.queue=[],this.cache=null}ut.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0?this:(this.cache=null,this.queue.push(t),this)},ut.prototype.translate=function(t,e){return(t!==0||e!==0)&&(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},ut.prototype.scale=function(t,e){return(t!==1||e!==1)&&(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},ut.prototype.rotate=function(t,e,r){var i,n,s;return t!==0&&(this.translate(e,r),i=t*Math.PI/180,n=Math.cos(i),s=Math.sin(i),this.queue.push([n,s,-s,n,0,0]),this.cache=null,this.translate(-e,-r)),this},ut.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},ut.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},ut.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=Iw(this.cache,this.queue[t]);return this.cache},ut.prototype.calc=function(t,e,r){var i;return this.queue.length?(this.cache||(this.cache=this.toArray()),i=this.cache,[t*i[0]+e*i[2]+(r?0:i[4]),t*i[1]+e*i[3]+(r?0:i[5])]):[t,e]};var lh=ut,Rw=lh,Pw={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},Mw=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,Fw=/[\s,]+/,Ow=function(e){var r=new Rw,i,n;return e.split(Mw).forEach(function(s){if(s.length){if(typeof Pw[s]<"u"){i=s;return}switch(n=s.split(Fw).map(function(a){return+a||0}),i){case"matrix":n.length===6&&r.matrix(n);return;case"scale":n.length===1?r.scale(n[0],n[0]):n.length===2&&r.scale(n[0],n[1]);return;case"rotate":n.length===1?r.rotate(n[0],0,0):n.length===3&&r.rotate(n[0],n[1],n[2]);return;case"translate":n.length===1?r.translate(n[0],0):n.length===2&&r.translate(n[0],n[1]);return;case"skewX":n.length===1&&r.skewX(n[0]);return;case"skewY":n.length===1&&r.skewY(n[0]);return}}}),r},yi=Math.PI*2;function uh(t,e,r,i){var n=t*i-e*r<0?-1:1,s=t*r+e*i;return s>1&&(s=1),s<-1&&(s=-1),n*Math.acos(s)}function Nw(t,e,r,i,n,s,a,o,u,h){var d=h*(t-r)/2+u*(e-i)/2,l=-u*(t-r)/2+h*(e-i)/2,c=a*a,f=o*o,p=d*d,m=l*l,v=c*f-c*m-f*p;v<0&&(v=0),v/=c*m+f*p,v=Math.sqrt(v)*(n===s?-1:1);var g=v*a/o*l,y=v*-o/a*d,_=h*g-u*y+(t+r)/2,x=u*g+h*y+(e+i)/2,b=(d-g)/a,T=(l-y)/o,w=(-d-g)/a,S=(-l-y)/o,A=uh(1,0,b,T),C=uh(b,T,w,S);return s===0&&C>0&&(C-=yi),s===1&&C<0&&(C+=yi),[_,x,A,C]}function kw(t,e){var r=1.3333333333333333*Math.tan(e/4),i=Math.cos(t),n=Math.sin(t),s=Math.cos(t+e),a=Math.sin(t+e);return[i,n,i-n*r,n+i*r,s+a*r,a-s*r,s,a]}var Lw=function(e,r,i,n,s,a,o,u,h){var d=Math.sin(h*yi/360),l=Math.cos(h*yi/360),c=l*(e-i)/2+d*(r-n)/2,f=-d*(e-i)/2+l*(r-n)/2;if(c===0&&f===0)return[];if(o===0||u===0)return[];o=Math.abs(o),u=Math.abs(u);var p=c*c/(o*o)+f*f/(u*u);p>1&&(o*=Math.sqrt(p),u*=Math.sqrt(p));var m=Nw(e,r,i,n,s,a,o,u,d,l),v=[],g=m[2],y=m[3],_=Math.max(Math.ceil(Math.abs(y)/(yi/4)),1);y/=_;for(var x=0;x<_;x++)v.push(kw(g,y)),g+=y;return v.map(function(b){for(var T=0;T<b.length;T+=2){var w=b[T+0],S=b[T+1];w*=o,S*=u;var A=l*w-d*S,C=d*w+l*S;b[T+0]=A+m[0],b[T+1]=C+m[1]}return b})},xi=1e-10,ch=Math.PI/180;function bi(t,e,r){if(!(this instanceof bi))return new bi(t,e,r);this.rx=t,this.ry=e,this.ax=r}bi.prototype.transform=function(t){var e=Math.cos(this.ax*ch),r=Math.sin(this.ax*ch),i=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],n=i[0]*i[0]+i[2]*i[2],s=i[1]*i[1]+i[3]*i[3],a=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1])),o=(n+s)/2;if(a<xi*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var u=i[0]*i[1]+i[2]*i[3];a=Math.sqrt(a);var h=o+a/2,d=o-a/2;return this.ax=Math.abs(u)<xi&&Math.abs(h-s)<xi?90:Math.atan(Math.abs(u)>Math.abs(h-s)?(h-n)/u:u/(h-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)):(this.ax+=90,this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)),this},bi.prototype.isDegenerate=function(){return this.rx<xi*this.ry||this.ry<xi*this.rx};var Dw=bi,Bw=Cw,Uw=Ow,Lt=lh,$w=Lw,Gw=Dw;function Te(t){if(!(this instanceof Te))return new Te(t);var e=Bw(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}Te.from=function(t){if(typeof t=="string")return new Te(t);if(t instanceof Te){var e=new Te("");return e.err=t.err,e.segments=t.segments.map(function(r){return r.slice()}),e.__stack=t.__stack.map(function(r){return Lt().matrix(r.toArray())}),e}throw new Error("SvgPath.from: invalid param type "+t)},Te.prototype.__matrix=function(t){var e=this,r;t.queue.length&&this.iterate(function(i,n,s,a){var o,u,h,d;switch(i[0]){case"v":o=t.calc(0,i[1],!0),u=o[0]===0?["v",o[1]]:["l",o[0],o[1]];break;case"V":o=t.calc(s,i[1],!1),u=o[0]===t.calc(s,a,!1)[0]?["V",o[1]]:["L",o[0],o[1]];break;case"h":o=t.calc(i[1],0,!0),u=o[1]===0?["h",o[0]]:["l",o[0],o[1]];break;case"H":o=t.calc(i[1],a,!1),u=o[1]===t.calc(s,a,!1)[1]?["H",o[0]]:["L",o[0],o[1]];break;case"a":case"A":var l=t.toArray(),c=Gw(i[1],i[2],i[3]).transform(l);if(l[0]*l[3]-l[1]*l[2]<0&&(i[5]=i[5]?"0":"1"),o=t.calc(i[6],i[7],i[0]==="a"),i[0]==="A"&&i[6]===s&&i[7]===a||i[0]==="a"&&i[6]===0&&i[7]===0){u=[i[0]==="a"?"l":"L",o[0],o[1]];break}c.isDegenerate()?u=[i[0]==="a"?"l":"L",o[0],o[1]]:u=[i[0],c.rx,c.ry,c.ax,i[4],i[5],o[0],o[1]];break;case"m":d=n>0,o=t.calc(i[1],i[2],d),u=["m",o[0],o[1]];break;default:for(h=i[0],u=[h],d=h.toLowerCase()===h,r=1;r<i.length;r+=2)o=t.calc(i[r],i[r+1],d),u.push(o[0],o[1])}e.segments[n]=u},!0)},Te.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(t=Lt(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},Te.prototype.toString=function(){var t="",e="",r=!1;this.__evaluateStack();for(var i=0,n=this.segments.length;i<n;i++){var s=this.segments[i],a=s[0];a!==e||a==="m"||a==="M"?(a==="m"&&e==="z"&&(t+=" "),t+=a,r=!1):r=!0;for(var o=1;o<s.length;o++){var u=s[o];o===1?r&&u>=0&&(t+=" "):u>=0&&(t+=" "),t+=u}e=a}return t},Te.prototype.translate=function(t,e){return this.__stack.push(Lt().translate(t,e||0)),this},Te.prototype.scale=function(t,e){return this.__stack.push(Lt().scale(t,!e&&e!==0?t:e)),this},Te.prototype.rotate=function(t,e,r){return this.__stack.push(Lt().rotate(t,e||0,r||0)),this},Te.prototype.skewX=function(t){return this.__stack.push(Lt().skewX(t)),this},Te.prototype.skewY=function(t){return this.__stack.push(Lt().skewY(t)),this},Te.prototype.matrix=function(t){return this.__stack.push(Lt().matrix(t)),this},Te.prototype.transform=function(t){return t.trim()?(this.__stack.push(Uw(t)),this):this},Te.prototype.round=function(t){var e=0,r=0,i=0,n=0,s;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(a){var o=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":o&&(a[1]+=i),i=a[1]-a[1].toFixed(t),a[1]=+a[1].toFixed(t);return;case"V":case"v":o&&(a[1]+=n),n=a[1]-a[1].toFixed(t),a[1]=+a[1].toFixed(t);return;case"Z":case"z":i=e,n=r;return;case"M":case"m":o&&(a[1]+=i,a[2]+=n),i=a[1]-a[1].toFixed(t),n=a[2]-a[2].toFixed(t),e=i,r=n,a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t);return;case"A":case"a":o&&(a[6]+=i,a[7]+=n),i=a[6]-a[6].toFixed(t),n=a[7]-a[7].toFixed(t),a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t),a[3]=+a[3].toFixed(t+2),a[6]=+a[6].toFixed(t),a[7]=+a[7].toFixed(t);return;default:s=a.length,o&&(a[s-2]+=i,a[s-1]+=n),i=a[s-2]-a[s-2].toFixed(t),n=a[s-1]-a[s-1].toFixed(t),a.forEach(function(u,h){h&&(a[h]=+a[h].toFixed(t))});return}}),this},Te.prototype.iterate=function(t,e){var r=this.segments,i={},n=!1,s=0,a=0,o=0,u=0,h,d,l;if(e||this.__evaluateStack(),r.forEach(function(c,f){var p=t(c,f,s,a);Array.isArray(p)&&(i[f]=p,n=!0);var m=c[0]===c[0].toLowerCase();switch(c[0]){case"m":case"M":s=c[1]+(m?s:0),a=c[2]+(m?a:0),o=s,u=a;return;case"h":case"H":s=c[1]+(m?s:0);return;case"v":case"V":a=c[1]+(m?a:0);return;case"z":case"Z":s=o,a=u;return;default:s=c[c.length-2]+(m?s:0),a=c[c.length-1]+(m?a:0)}}),!n)return this;for(l=[],h=0;h<r.length;h++)if(typeof i[h]<"u")for(d=0;d<i[h].length;d++)l.push(i[h][d]);else l.push(r[h]);return this.segments=l,this},Te.prototype.abs=function(){return this.iterate(function(t,e,r,i){var n=t[0],s=n.toUpperCase(),a;if(n!==s)switch(t[0]=s,n){case"v":t[1]+=i;return;case"a":t[6]+=r,t[7]+=i;return;default:for(a=1;a<t.length;a++)t[a]+=a%2?r:i}},!0),this},Te.prototype.rel=function(){return this.iterate(function(t,e,r,i){var n=t[0],s=n.toLowerCase(),a;if(n!==s&&!(e===0&&n==="M"))switch(t[0]=s,n){case"V":t[1]-=i;return;case"A":t[6]-=r,t[7]-=i;return;default:for(a=1;a<t.length;a++)t[a]-=a%2?r:i}},!0),this},Te.prototype.unarc=function(){return this.iterate(function(t,e,r,i){var n,s,a,o=[],u=t[0];return u!=="A"&&u!=="a"?null:(u==="a"?(s=r+t[6],a=i+t[7]):(s=t[6],a=t[7]),n=$w(r,i,s,a,t[4],t[5],t[1],t[2],t[3]),n.length===0?[[t[0]==="a"?"l":"L",t[6],t[7]]]:(n.forEach(function(h){o.push(["C",h[2],h[3],h[4],h[5],h[6],h[7]])}),o))}),this},Te.prototype.unshort=function(){var t=this.segments,e,r,i,n,s;return this.iterate(function(a,o,u,h){var d=a[0],l=d.toUpperCase(),c;o&&(l==="T"?(c=d==="t",i=t[o-1],i[0]==="Q"?(e=i[1]-u,r=i[2]-h):i[0]==="q"?(e=i[1]-i[3],r=i[2]-i[4]):(e=0,r=0),n=-e,s=-r,c||(n+=u,s+=h),t[o]=[c?"q":"Q",n,s,a[1],a[2]]):l==="S"&&(c=d==="s",i=t[o-1],i[0]==="C"?(e=i[3]-u,r=i[4]-h):i[0]==="c"?(e=i[3]-i[5],r=i[4]-i[6]):(e=0,r=0),n=-e,s=-r,c||(n+=u,s+=h),t[o]=[c?"c":"C",n,s,a[1],a[2],a[3],a[4]]))}),this};var zw=Te,jw=zw;const Hw=Bt(jw),Vw=L.forwardRef((t,e)=>{const[r,i]=L.useState(null),n=P.useRef(null),s=P.useRef(null),a=P.useRef(null),{path:o,visible:u,disabled:h,transformation:{x:d,y:l,width:c,height:f,anchor:p,hexColor:m,fill:v,stroke:g="none",strokeWidth:y=0,colorCorrection:_={}},pointerdown:x,pointerup:b}=t,T=te.useApp(),{temperatureFilter:w,sharpnessFilter:S,hueFilter:A,blurFilter:C,adjustmentFilter:F,vignetteFilter:z,noiseFilter:I}=rr(_),{blurRadius:E=0,vignette:B=0,noise:U=0}=_;return L.useEffect(()=>{const R=Hw(o).scale(5).translate(0,0).toString(),$=`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${f}">
1969
+ */(function(t,e){(function(r,i){t.exports=i()})($T,function(){return function(i){for(var n={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},s={number:function(m){return+f("number",m)},"coordinate pair":function(m){var v=f("number",m);if(v===null&&!m)return null;f("comma");var g=f("number",!0);return{x:+v,y:+g}},"arc definition":function(m){var v=s["coordinate pair"](m);if(!v&&!m)return null;f("comma");var g=+f("number",!0);f("comma",!0);var y=!!+f("flag",!0);f("comma");var _=!!+f("flag",!0);f("comma");var x=s["coordinate pair"](!0);return{radii:v,rotation:g,large:y,clockwise:_,end:x}}},a=0,o=[];a<i.length;){var u=f("command"),h=u.toUpperCase(),d=u!==h,l;switch(h){case"M":l=p("coordinate pair").map(function(m,v){return v===1&&(u=d?"l":"L"),c({end:m})});break;case"L":case"T":l=p("coordinate pair").map(function(m){return c({end:m})});break;case"C":if(l=p("coordinate pair"),l.length%3)throw Error("Expected coordinate pair triplet at position "+a);l=l.reduce(function(m,v,g){var y=g%3;if(!y)m.push(c({cp1:v}));else{var _=m[m.length-1];_[y===1?"cp2":"end"]=v}return m},[]);break;case"Q":case"S":if(l=p("coordinate pair"),l.length&1)throw Error("Expected coordinate pair couple at position "+a);l=l.reduce(function(m,v,g){var y=g&1;if(!y)m.push(c({cp:v}));else{var _=m[m.length-1];_.end=v}return m},[]);break;case"H":case"V":l=p("number").map(function(m){return c({value:m})});break;case"A":l=p("arc definition").map(c);break;case"Z":l=[{code:"Z"}];break}o.push.apply(o,l)}return o;function c(m){return m.code=u,m.relative=d,m}function f(m,v){n[m].lastIndex=a;var g=n[m].exec(i);if(!g||g.index!==a){if(!v)return null;throw Error("Expected "+m+" at position "+a)}return a=n[m].lastIndex,g[1]}function p(m){for(var v=[],g,y=!0;g=s[m](y);)v.push(g),y=!!f("comma");return v}}})})(GT);const zT=/^\s+/,jT=/\s+$/;function L(t,e){if(t=t||"",e=e||{},t instanceof L)return t;if(!(this instanceof L))return new L(t,e);var r=HT(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,r,i,n,s,a;return e=t.r/255,r=t.g/255,i=t.b/255,e<=.03928?n=e/12.92:n=Math.pow((e+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*a},setAlpha:function(t){return this._a=th(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Zc(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Zc(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+r+"%, "+i+"%)":"hsva("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=Kc(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Kc(this._r,this._g,this._b),e=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return Qc(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return qT(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ye(this._r,255)*100)+"%",g:Math.round(ye(this._g,255)*100)+"%",b:Math.round(ye(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%)":"rgba("+Math.round(ye(this._r,255)*100)+"%, "+Math.round(ye(this._g,255)*100)+"%, "+Math.round(ye(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:aw[Qc(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+Jc(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var n=L(t);r="#"+Jc(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,n=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return n?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(QT,arguments)},brighten:function(){return this._applyModification(JT,arguments)},darken:function(){return this._applyModification(ew,arguments)},desaturate:function(){return this._applyModification(YT,arguments)},saturate:function(){return this._applyModification(KT,arguments)},greyscale:function(){return this._applyModification(ZT,arguments)},spin:function(){return this._applyModification(tw,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(nw,arguments)},complement:function(){return this._applyCombination(rw,arguments)},monochromatic:function(){return this._applyCombination(sw,arguments)},splitcomplement:function(){return this._applyCombination(iw,arguments)},triad:function(){return this._applyCombination(eh,[3])},tetrad:function(){return this._applyCombination(eh,[4])}},L.fromRatio=function(t,e){if(typeof t=="object"){var r={};for(var i in t)t.hasOwnProperty(i)&&(i==="a"?r[i]=t[i]:r[i]=pi(t[i]));t=r}return L(t,e)};function HT(t){var e={r:0,g:0,b:0},r=1,i=null,n=null,s=null,a=!1,o=!1;return typeof t=="string"&&(t=cw(t)),typeof t=="object"&&(wt(t.r)&&wt(t.g)&&wt(t.b)?(e=VT(t.r,t.g,t.b),a=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):wt(t.h)&&wt(t.s)&&wt(t.v)?(i=pi(t.s),n=pi(t.v),e=WT(t.h,i,n),a=!0,o="hsv"):wt(t.h)&&wt(t.s)&&wt(t.l)&&(i=pi(t.s),s=pi(t.l),e=XT(t.h,i,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=th(r),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function VT(t,e,r){return{r:ye(t,255)*255,g:ye(e,255)*255,b:ye(r,255)*255}}function Kc(t,e,r){t=ye(t,255),e=ye(e,255),r=ye(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),s,a,o=(i+n)/2;if(i==n)s=a=0;else{var u=i-n;switch(a=o>.5?u/(2-i-n):u/(i+n),i){case t:s=(e-r)/u+(e<r?6:0);break;case e:s=(r-t)/u+2;break;case r:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,l:o}}function XT(t,e,r){var i,n,s;t=ye(t,360),e=ye(e,100),r=ye(r,100);function a(h,d,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?h+(d-h)*6*l:l<1/2?d:l<2/3?h+(d-h)*(2/3-l)*6:h}if(e===0)i=n=s=r;else{var o=r<.5?r*(1+e):r+e-r*e,u=2*r-o;i=a(u,o,t+1/3),n=a(u,o,t),s=a(u,o,t-1/3)}return{r:i*255,g:n*255,b:s*255}}function Zc(t,e,r){t=ye(t,255),e=ye(e,255),r=ye(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),s,a,o=i,u=i-n;if(a=i===0?0:u/i,i==n)s=0;else{switch(i){case t:s=(e-r)/u+(e<r?6:0);break;case e:s=(r-t)/u+2;break;case r:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,v:o}}function WT(t,e,r){t=ye(t,360)*6,e=ye(e,100),r=ye(r,100);var i=Math.floor(t),n=t-i,s=r*(1-e),a=r*(1-n*e),o=r*(1-(1-n)*e),u=i%6,h=[r,a,s,s,o,r][u],d=[o,r,r,a,s,s][u],l=[s,s,o,r,r,a][u];return{r:h*255,g:d*255,b:l*255}}function Qc(t,e,r,i){var n=[ot(Math.round(t).toString(16)),ot(Math.round(e).toString(16)),ot(Math.round(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function qT(t,e,r,i,n){var s=[ot(Math.round(t).toString(16)),ot(Math.round(e).toString(16)),ot(Math.round(r).toString(16)),ot(rh(i))];return n&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function Jc(t,e,r,i){var n=[ot(rh(i)),ot(Math.round(t).toString(16)),ot(Math.round(e).toString(16)),ot(Math.round(r).toString(16))];return n.join("")}L.equals=function(t,e){return!t||!e?!1:L(t).toRgbString()==L(e).toRgbString()},L.random=function(){return L.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function YT(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.s-=e/100,r.s=Fn(r.s),L(r)}function KT(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.s+=e/100,r.s=Fn(r.s),L(r)}function ZT(t){return L(t).desaturate(100)}function QT(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.l+=e/100,r.l=Fn(r.l),L(r)}function JT(t,e){e=e===0?0:e||10;var r=L(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),L(r)}function ew(t,e){e=e===0?0:e||10;var r=L(t).toHsl();return r.l-=e/100,r.l=Fn(r.l),L(r)}function tw(t,e){var r=L(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,L(r)}function rw(t){var e=L(t).toHsl();return e.h=(e.h+180)%360,L(e)}function eh(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=L(t).toHsl(),i=[L(t)],n=360/e,s=1;s<e;s++)i.push(L({h:(r.h+s*n)%360,s:r.s,l:r.l}));return i}function iw(t){var e=L(t).toHsl(),r=e.h;return[L(t),L({h:(r+72)%360,s:e.s,l:e.l}),L({h:(r+216)%360,s:e.s,l:e.l})]}function nw(t,e,r){e=e||6,r=r||30;var i=L(t).toHsl(),n=360/r,s=[L(t)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,s.push(L(i));return s}function sw(t,e){e=e||6;for(var r=L(t).toHsv(),i=r.h,n=r.s,s=r.v,a=[],o=1/e;e--;)a.push(L({h:i,s:n,v:s})),s=(s+o)%1;return a}L.mix=function(t,e,r){r=r===0?0:r||50;var i=L(t).toRgb(),n=L(e).toRgb(),s=r/100,a={r:(n.r-i.r)*s+i.r,g:(n.g-i.g)*s+i.g,b:(n.b-i.b)*s+i.b,a:(n.a-i.a)*s+i.a};return L(a)},L.readability=function(t,e){var r=L(t),i=L(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},L.isReadable=function(t,e,r){var i=L.readability(t,e),n,s;switch(s=!1,n=hw(r),n.level+n.size){case"AAsmall":case"AAAlarge":s=i>=4.5;break;case"AAlarge":s=i>=3;break;case"AAAsmall":s=i>=7;break}return s},L.mostReadable=function(t,e,r){var i=null,n=0,s,a,o,u;r=r||{},a=r.includeFallbackColors,o=r.level,u=r.size;for(var h=0;h<e.length;h++)s=L.readability(t,e[h]),s>n&&(n=s,i=L(e[h]));return L.isReadable(t,i,{level:o,size:u})||!a?i:(r.includeFallbackColors=!1,L.mostReadable(t,["#fff","#000"],r))};var Ba=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},aw=L.hexNames=ow(Ba);function ow(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function th(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ye(t,e){lw(t)&&(t="100%");var r=uw(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Fn(t){return Math.min(1,Math.max(0,t))}function He(t){return parseInt(t,16)}function lw(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function uw(t){return typeof t=="string"&&t.indexOf("%")!=-1}function ot(t){return t.length==1?"0"+t:""+t}function pi(t){return t<=1&&(t=t*100+"%"),t}function rh(t){return Math.round(parseFloat(t)*255).toString(16)}function ih(t){return He(t)/255}var lt=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function wt(t){return!!lt.CSS_UNIT.exec(t)}function cw(t){t=t.replace(zT,"").replace(jT,"").toLowerCase();var e=!1;if(Ba[t])t=Ba[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=lt.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=lt.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=lt.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=lt.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=lt.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=lt.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=lt.hex8.exec(t))?{r:He(r[1]),g:He(r[2]),b:He(r[3]),a:ih(r[4]),format:e?"name":"hex8"}:(r=lt.hex6.exec(t))?{r:He(r[1]),g:He(r[2]),b:He(r[3]),format:e?"name":"hex"}:(r=lt.hex4.exec(t))?{r:He(r[1]+""+r[1]),g:He(r[2]+""+r[2]),b:He(r[3]+""+r[3]),a:ih(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=lt.hex3.exec(t))?{r:He(r[1]+""+r[1]),g:He(r[2]+""+r[2]),b:He(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function hw(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}var fw=function(){function t(e,r){var i=[],n=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(i.push(u.value),!(r&&i.length===r));n=!0);}catch(h){s=!0,a=h}finally{try{!n&&o.return&&o.return()}finally{if(s)throw a}}return i}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),mi=Math.PI*2,Ua=function(e,r,i,n,s,a,o){var u=e.x,h=e.y;u*=r,h*=i;var d=n*u-s*h,l=s*u+n*h;return{x:d+a,y:l+o}},dw=function(e,r){var i=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),n=Math.cos(e),s=Math.sin(e),a=Math.cos(e+r),o=Math.sin(e+r);return[{x:n-s*i,y:s+n*i},{x:a+o*i,y:o-a*i},{x:a,y:o}]},nh=function(e,r,i,n){var s=e*n-r*i<0?-1:1,a=e*i+r*n;return a>1&&(a=1),a<-1&&(a=-1),s*Math.acos(a)},pw=function(e,r,i,n,s,a,o,u,h,d,l,c){var f=Math.pow(s,2),p=Math.pow(a,2),m=Math.pow(l,2),v=Math.pow(c,2),g=f*p-f*v-p*m;g<0&&(g=0),g/=f*v+p*m,g=Math.sqrt(g)*(o===u?-1:1);var y=g*s/a*c,_=g*-a/s*l,x=d*y-h*_+(e+i)/2,b=h*y+d*_+(r+n)/2,T=(l-y)/s,w=(c-_)/a,S=(-l-y)/s,A=(-c-_)/a,I=nh(1,0,T,w),F=nh(T,w,S,A);return u===0&&F>0&&(F-=mi),u===1&&F<0&&(F+=mi),[x,b,I,F]},sh=function(e){var r=e.px,i=e.py,n=e.cx,s=e.cy,a=e.rx,o=e.ry,u=e.xAxisRotation,h=u===void 0?0:u,d=e.largeArcFlag,l=d===void 0?0:d,c=e.sweepFlag,f=c===void 0?0:c,p=[];if(a===0||o===0)return[];var m=Math.sin(h*mi/360),v=Math.cos(h*mi/360),g=v*(r-n)/2+m*(i-s)/2,y=-m*(r-n)/2+v*(i-s)/2;if(g===0&&y===0)return[];a=Math.abs(a),o=Math.abs(o);var _=Math.pow(g,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(o,2);_>1&&(a*=Math.sqrt(_),o*=Math.sqrt(_));var x=pw(r,i,n,s,a,o,l,f,m,v,g,y),b=fw(x,4),T=b[0],w=b[1],S=b[2],A=b[3],I=Math.abs(A)/(mi/4);Math.abs(1-I)<1e-7&&(I=1);var F=Math.max(Math.ceil(I),1);A/=F;for(var $=0;$<F;$++)p.push(dw(S,A)),S+=A;return p.map(function(E){var C=Ua(E[0],a,o,v,m,T,w),U=C.x,G=C.y,R=Ua(E[1],a,o,v,m,T,w),B=R.x,X=R.y,M=Ua(E[2],a,o,v,m,T,w),O=M.x,H=M.y;return{x1:U,y1:G,x2:B,y2:X,x:O,y:H}})};class mw extends La{constructor(e){super(),this.lineColor=null,e&&this.drawSVG(e)}drawSVG(e){if(typeof e=="string"){const r=document.createElement("div");r.innerHTML=e.trim(),e=r.querySelector("svg")}if(!e)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(e),this._svgChildren(e.children),this}_svgChildren(e,r=!1){for(let i=0;i<e.length;i++){const n=e[i];switch(this._svgFill(n,r),n.nodeName.toLowerCase()){case"path":{this._svgPath(n);break}case"circle":case"ellipse":{this._svgCircle(n);break}case"rect":{this._svgRect(n);break}case"polygon":{this._svgPoly(n,!0);break}case"polyline":{this._svgPoly(n);break}case"g":break;default:{console.info(`[PIXI.SVG] <${n.nodeName}> elements unsupported`);break}}this._svgChildren(n.children,!0)}}_hexToUint(e){if(e[0]==="#")return e=e.substr(1),e.length===3&&(e=e.replace(/([a-f0-9])/ig,"$1$1")),parseInt(e,16);const{r,g:i,b:n}=L(e).toRgb();return(r<<16)+(i<<8)+n}_svgCircle(e){let r="r",i="r";const n=e.nodeName==="elipse";n&&(r+="x",i+="y");const s=parseFloat(e.getAttribute(i)),a=parseFloat(e.getAttribute(r)),o=e.getAttribute("cx"),u=e.getAttribute("cy");let h=0,d=0;o!==null&&(h=parseFloat(o)),u!==null&&(d=parseFloat(u)),n?this.drawEllipse(h,d,s,a):this.drawCircle(h,d,s)}_svgRect(e){const r=parseFloat(e.getAttribute("x")),i=parseFloat(e.getAttribute("y")),n=parseFloat(e.getAttribute("width")),s=parseFloat(e.getAttribute("height")),a=parseFloat(e.getAttribute("rx"));a?this.drawRoundedRect(r,i,n,s,a):this.drawRect(r,i,n,s)}_convertStyleName(e){return e.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(e){const r=e.getAttribute("style"),i=e.getAttribute("opacity"),n={fill:e.getAttribute("fill"),opacity:i||e.getAttribute("fill-opacity"),stroke:e.getAttribute("stroke"),strokeOpacity:i||e.getAttribute("stroke-opacity"),strokeWidth:e.getAttribute("stroke-width"),cap:e.getAttribute("stroke-linecap"),join:e.getAttribute("stroke-linejoin"),miterLimit:e.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(s=>{const[a,o]=s.split(":");if(a){const u=this._convertStyleName(a);n[u]||(n[u]=o.trim())}}),n}_svgPoly(e,r){const i=e.getAttribute("points").split(/[ ,]/g).map(n=>parseInt(n,10));this.drawPolygon(i),r&&this.closePath()}_svgFill(e,r){const{fill:i,opacity:n,stroke:s,strokeOpacity:a,strokeWidth:o,cap:u,join:h,miterLimit:d}=this._svgStyle(e),c=o!==null?parseFloat(o):s!==null?1:0,f=s!==null?this._hexToUint(s):this.lineColor;i?i==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(i),n!==null?parseFloat(n):1):r||this.beginFill(0),this.lineStyle({width:s===null&&o===null&&r?this.line.width:c,alpha:a===null?this.line.alpha:parseFloat(a),color:s===null&&r?this.line.color:f,cap:u===null&&r?this.line.cap:u,join:h===null&&r?this.line.join:h,miterLimit:d===null&&r?this.line.miterLimit:parseFloat(d)}),e.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(e){const r=e.getAttribute("d");let i=0,n=0;const s=Da(r.trim());for(let a=0;a<s.length;a++){const o=s[a];switch(o.code){case"m":{this.moveTo(i+=o.end.x,n+=o.end.y);break}case"M":{this.moveTo(i=o.end.x,n=o.end.y);break}case"H":{this.lineTo(i=o.value,n);break}case"h":{this.lineTo(i+=o.value,n);break}case"V":{this.lineTo(i,n=o.value);break}case"v":{this.lineTo(i,n+=o.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(i=o.end.x,n=o.end.y);break}case"l":{this.lineTo(i+=o.end.x,n+=o.end.y);break}case"C":{this.bezierCurveTo(o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,i=o.end.x,n=o.end.y);break}case"c":{const u=i,h=n;this.bezierCurveTo(u+o.cp1.x,h+o.cp1.y,u+o.cp2.x,h+o.cp2.y,i+=o.end.x,n+=o.end.y);break}case"s":case"q":{const u=i,h=n;this.quadraticCurveTo(u+o.cp.x,h+o.cp.y,i+=o.end.x,n+=o.end.y);break}case"S":case"Q":{this.quadraticCurveTo(o.cp.x,o.cp.y,i=o.end.x,n=o.end.y);break}case"a":{sh({px:i,py:n,cx:i+=o.end.x,cy:n+=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:u,y1:h,x2:d,y2:l,x:c,y:f})=>this.bezierCurveTo(u,h,d,l,c,f));break}case"A":{sh({px:i,py:n,cx:i=o.end.x,cy:n=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:u,y1:h,x2:d,y2:l,x:c,y:f})=>this.bezierCurveTo(u,h,d,l,c,f));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var On={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},gw=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function vw(t){return t===10||t===13||t===8232||t===8233||t===32||t===9||t===11||t===12||t===160||t>=5760&&gw.indexOf(t)>=0}function _w(t){switch(t|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function yw(t){return(t|32)===97}function Dr(t){return t>=48&&t<=57}function xw(t){return t>=48&&t<=57||t===43||t===45||t===46}function bw(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Nn(t){for(;t.index<t.max&&vw(t.path.charCodeAt(t.index));)t.index++}function Tw(t){var e=t.path.charCodeAt(t.index);if(e===48){t.param=0,t.index++;return}if(e===49){t.param=1,t.index++;return}t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")"}function ww(t){var e=t.index,r=e,i=t.max,n=!1,s=!1,a=!1,o=!1,u;if(r>=i){t.err="SvgPath: missed param (at pos "+r+")";return}if(u=t.path.charCodeAt(r),(u===43||u===45)&&(r++,u=r<i?t.path.charCodeAt(r):0),!Dr(u)&&u!==46){t.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(u!==46){if(n=u===48,r++,u=r<i?t.path.charCodeAt(r):0,n&&r<i&&u&&Dr(u)){t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+e+")";return}for(;r<i&&Dr(t.path.charCodeAt(r));)r++,s=!0;u=r<i?t.path.charCodeAt(r):0}if(u===46){for(o=!0,r++;Dr(t.path.charCodeAt(r));)r++,a=!0;u=r<i?t.path.charCodeAt(r):0}if(u===101||u===69){if(o&&!s&&!a){t.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,u=r<i?t.path.charCodeAt(r):0,(u===43||u===45)&&r++,r<i&&Dr(t.path.charCodeAt(r)))for(;r<i&&Dr(t.path.charCodeAt(r));)r++;else{t.err="SvgPath: invalid float exponent (at pos "+r+")";return}}t.index=r,t.param=parseFloat(t.path.slice(e,r))+0}function $a(t){var e,r;e=t.path[t.segmentStart],r=e.toLowerCase();var i=t.data;if(r==="m"&&i.length>2&&(t.result.push([e,i[0],i[1]]),i=i.slice(2),r="l",e=e==="m"?"l":"L"),r==="r")t.result.push([e].concat(i));else for(;i.length>=On[r]&&(t.result.push([e].concat(i.splice(0,On[r]))),!!On[r]););}function Sw(t){var e=t.max,r,i,n,s,a;if(t.segmentStart=t.index,r=t.path.charCodeAt(t.index),i=yw(r),!_w(r)){t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")";return}if(s=On[t.path[t.index].toLowerCase()],t.index++,Nn(t),t.data=[],!s){$a(t);return}for(n=!1;;){for(a=s;a>0;a--){if(i&&(a===3||a===4)?Tw(t):ww(t),t.err.length){$a(t);return}t.data.push(t.param),Nn(t),n=!1,t.index<e&&t.path.charCodeAt(t.index)===44&&(t.index++,Nn(t),n=!0)}if(!n&&(t.index>=t.max||!xw(t.path.charCodeAt(t.index))))break}$a(t)}var Aw=function(e){var r=new bw(e),i=r.max;for(Nn(r);r.index<i&&!r.err.length;)Sw(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function Ew(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function ut(){if(!(this instanceof ut))return new ut;this.queue=[],this.cache=null}ut.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0?this:(this.cache=null,this.queue.push(t),this)},ut.prototype.translate=function(t,e){return(t!==0||e!==0)&&(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},ut.prototype.scale=function(t,e){return(t!==1||e!==1)&&(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},ut.prototype.rotate=function(t,e,r){var i,n,s;return t!==0&&(this.translate(e,r),i=t*Math.PI/180,n=Math.cos(i),s=Math.sin(i),this.queue.push([n,s,-s,n,0,0]),this.cache=null,this.translate(-e,-r)),this},ut.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},ut.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},ut.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=Ew(this.cache,this.queue[t]);return this.cache},ut.prototype.calc=function(t,e,r){var i;return this.queue.length?(this.cache||(this.cache=this.toArray()),i=this.cache,[t*i[0]+e*i[2]+(r?0:i[4]),t*i[1]+e*i[3]+(r?0:i[5])]):[t,e]};var ah=ut,Cw=ah,Iw={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},Rw=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,Pw=/[\s,]+/,Mw=function(e){var r=new Cw,i,n;return e.split(Rw).forEach(function(s){if(s.length){if(typeof Iw[s]<"u"){i=s;return}switch(n=s.split(Pw).map(function(a){return+a||0}),i){case"matrix":n.length===6&&r.matrix(n);return;case"scale":n.length===1?r.scale(n[0],n[0]):n.length===2&&r.scale(n[0],n[1]);return;case"rotate":n.length===1?r.rotate(n[0],0,0):n.length===3&&r.rotate(n[0],n[1],n[2]);return;case"translate":n.length===1?r.translate(n[0],0):n.length===2&&r.translate(n[0],n[1]);return;case"skewX":n.length===1&&r.skewX(n[0]);return;case"skewY":n.length===1&&r.skewY(n[0]);return}}}),r},gi=Math.PI*2;function oh(t,e,r,i){var n=t*i-e*r<0?-1:1,s=t*r+e*i;return s>1&&(s=1),s<-1&&(s=-1),n*Math.acos(s)}function Fw(t,e,r,i,n,s,a,o,u,h){var d=h*(t-r)/2+u*(e-i)/2,l=-u*(t-r)/2+h*(e-i)/2,c=a*a,f=o*o,p=d*d,m=l*l,v=c*f-c*m-f*p;v<0&&(v=0),v/=c*m+f*p,v=Math.sqrt(v)*(n===s?-1:1);var g=v*a/o*l,y=v*-o/a*d,_=h*g-u*y+(t+r)/2,x=u*g+h*y+(e+i)/2,b=(d-g)/a,T=(l-y)/o,w=(-d-g)/a,S=(-l-y)/o,A=oh(1,0,b,T),I=oh(b,T,w,S);return s===0&&I>0&&(I-=gi),s===1&&I<0&&(I+=gi),[_,x,A,I]}function Ow(t,e){var r=1.3333333333333333*Math.tan(e/4),i=Math.cos(t),n=Math.sin(t),s=Math.cos(t+e),a=Math.sin(t+e);return[i,n,i-n*r,n+i*r,s+a*r,a-s*r,s,a]}var Nw=function(e,r,i,n,s,a,o,u,h){var d=Math.sin(h*gi/360),l=Math.cos(h*gi/360),c=l*(e-i)/2+d*(r-n)/2,f=-d*(e-i)/2+l*(r-n)/2;if(c===0&&f===0)return[];if(o===0||u===0)return[];o=Math.abs(o),u=Math.abs(u);var p=c*c/(o*o)+f*f/(u*u);p>1&&(o*=Math.sqrt(p),u*=Math.sqrt(p));var m=Fw(e,r,i,n,s,a,o,u,d,l),v=[],g=m[2],y=m[3],_=Math.max(Math.ceil(Math.abs(y)/(gi/4)),1);y/=_;for(var x=0;x<_;x++)v.push(Ow(g,y)),g+=y;return v.map(function(b){for(var T=0;T<b.length;T+=2){var w=b[T+0],S=b[T+1];w*=o,S*=u;var A=l*w-d*S,I=d*w+l*S;b[T+0]=A+m[0],b[T+1]=I+m[1]}return b})},vi=1e-10,lh=Math.PI/180;function _i(t,e,r){if(!(this instanceof _i))return new _i(t,e,r);this.rx=t,this.ry=e,this.ax=r}_i.prototype.transform=function(t){var e=Math.cos(this.ax*lh),r=Math.sin(this.ax*lh),i=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],n=i[0]*i[0]+i[2]*i[2],s=i[1]*i[1]+i[3]*i[3],a=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1])),o=(n+s)/2;if(a<vi*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var u=i[0]*i[1]+i[2]*i[3];a=Math.sqrt(a);var h=o+a/2,d=o-a/2;return this.ax=Math.abs(u)<vi&&Math.abs(h-s)<vi?90:Math.atan(Math.abs(u)>Math.abs(h-s)?(h-n)/u:u/(h-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)):(this.ax+=90,this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)),this},_i.prototype.isDegenerate=function(){return this.rx<vi*this.ry||this.ry<vi*this.rx};var kw=_i,Lw=Aw,Dw=Mw,kt=ah,Bw=Nw,Uw=kw;function Te(t){if(!(this instanceof Te))return new Te(t);var e=Lw(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}Te.from=function(t){if(typeof t=="string")return new Te(t);if(t instanceof Te){var e=new Te("");return e.err=t.err,e.segments=t.segments.map(function(r){return r.slice()}),e.__stack=t.__stack.map(function(r){return kt().matrix(r.toArray())}),e}throw new Error("SvgPath.from: invalid param type "+t)},Te.prototype.__matrix=function(t){var e=this,r;t.queue.length&&this.iterate(function(i,n,s,a){var o,u,h,d;switch(i[0]){case"v":o=t.calc(0,i[1],!0),u=o[0]===0?["v",o[1]]:["l",o[0],o[1]];break;case"V":o=t.calc(s,i[1],!1),u=o[0]===t.calc(s,a,!1)[0]?["V",o[1]]:["L",o[0],o[1]];break;case"h":o=t.calc(i[1],0,!0),u=o[1]===0?["h",o[0]]:["l",o[0],o[1]];break;case"H":o=t.calc(i[1],a,!1),u=o[1]===t.calc(s,a,!1)[1]?["H",o[0]]:["L",o[0],o[1]];break;case"a":case"A":var l=t.toArray(),c=Uw(i[1],i[2],i[3]).transform(l);if(l[0]*l[3]-l[1]*l[2]<0&&(i[5]=i[5]?"0":"1"),o=t.calc(i[6],i[7],i[0]==="a"),i[0]==="A"&&i[6]===s&&i[7]===a||i[0]==="a"&&i[6]===0&&i[7]===0){u=[i[0]==="a"?"l":"L",o[0],o[1]];break}c.isDegenerate()?u=[i[0]==="a"?"l":"L",o[0],o[1]]:u=[i[0],c.rx,c.ry,c.ax,i[4],i[5],o[0],o[1]];break;case"m":d=n>0,o=t.calc(i[1],i[2],d),u=["m",o[0],o[1]];break;default:for(h=i[0],u=[h],d=h.toLowerCase()===h,r=1;r<i.length;r+=2)o=t.calc(i[r],i[r+1],d),u.push(o[0],o[1])}e.segments[n]=u},!0)},Te.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(t=kt(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},Te.prototype.toString=function(){var t="",e="",r=!1;this.__evaluateStack();for(var i=0,n=this.segments.length;i<n;i++){var s=this.segments[i],a=s[0];a!==e||a==="m"||a==="M"?(a==="m"&&e==="z"&&(t+=" "),t+=a,r=!1):r=!0;for(var o=1;o<s.length;o++){var u=s[o];o===1?r&&u>=0&&(t+=" "):u>=0&&(t+=" "),t+=u}e=a}return t},Te.prototype.translate=function(t,e){return this.__stack.push(kt().translate(t,e||0)),this},Te.prototype.scale=function(t,e){return this.__stack.push(kt().scale(t,!e&&e!==0?t:e)),this},Te.prototype.rotate=function(t,e,r){return this.__stack.push(kt().rotate(t,e||0,r||0)),this},Te.prototype.skewX=function(t){return this.__stack.push(kt().skewX(t)),this},Te.prototype.skewY=function(t){return this.__stack.push(kt().skewY(t)),this},Te.prototype.matrix=function(t){return this.__stack.push(kt().matrix(t)),this},Te.prototype.transform=function(t){return t.trim()?(this.__stack.push(Dw(t)),this):this},Te.prototype.round=function(t){var e=0,r=0,i=0,n=0,s;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(a){var o=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":o&&(a[1]+=i),i=a[1]-a[1].toFixed(t),a[1]=+a[1].toFixed(t);return;case"V":case"v":o&&(a[1]+=n),n=a[1]-a[1].toFixed(t),a[1]=+a[1].toFixed(t);return;case"Z":case"z":i=e,n=r;return;case"M":case"m":o&&(a[1]+=i,a[2]+=n),i=a[1]-a[1].toFixed(t),n=a[2]-a[2].toFixed(t),e=i,r=n,a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t);return;case"A":case"a":o&&(a[6]+=i,a[7]+=n),i=a[6]-a[6].toFixed(t),n=a[7]-a[7].toFixed(t),a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t),a[3]=+a[3].toFixed(t+2),a[6]=+a[6].toFixed(t),a[7]=+a[7].toFixed(t);return;default:s=a.length,o&&(a[s-2]+=i,a[s-1]+=n),i=a[s-2]-a[s-2].toFixed(t),n=a[s-1]-a[s-1].toFixed(t),a.forEach(function(u,h){h&&(a[h]=+a[h].toFixed(t))});return}}),this},Te.prototype.iterate=function(t,e){var r=this.segments,i={},n=!1,s=0,a=0,o=0,u=0,h,d,l;if(e||this.__evaluateStack(),r.forEach(function(c,f){var p=t(c,f,s,a);Array.isArray(p)&&(i[f]=p,n=!0);var m=c[0]===c[0].toLowerCase();switch(c[0]){case"m":case"M":s=c[1]+(m?s:0),a=c[2]+(m?a:0),o=s,u=a;return;case"h":case"H":s=c[1]+(m?s:0);return;case"v":case"V":a=c[1]+(m?a:0);return;case"z":case"Z":s=o,a=u;return;default:s=c[c.length-2]+(m?s:0),a=c[c.length-1]+(m?a:0)}}),!n)return this;for(l=[],h=0;h<r.length;h++)if(typeof i[h]<"u")for(d=0;d<i[h].length;d++)l.push(i[h][d]);else l.push(r[h]);return this.segments=l,this},Te.prototype.abs=function(){return this.iterate(function(t,e,r,i){var n=t[0],s=n.toUpperCase(),a;if(n!==s)switch(t[0]=s,n){case"v":t[1]+=i;return;case"a":t[6]+=r,t[7]+=i;return;default:for(a=1;a<t.length;a++)t[a]+=a%2?r:i}},!0),this},Te.prototype.rel=function(){return this.iterate(function(t,e,r,i){var n=t[0],s=n.toLowerCase(),a;if(n!==s&&!(e===0&&n==="M"))switch(t[0]=s,n){case"V":t[1]-=i;return;case"A":t[6]-=r,t[7]-=i;return;default:for(a=1;a<t.length;a++)t[a]-=a%2?r:i}},!0),this},Te.prototype.unarc=function(){return this.iterate(function(t,e,r,i){var n,s,a,o=[],u=t[0];return u!=="A"&&u!=="a"?null:(u==="a"?(s=r+t[6],a=i+t[7]):(s=t[6],a=t[7]),n=Bw(r,i,s,a,t[4],t[5],t[1],t[2],t[3]),n.length===0?[[t[0]==="a"?"l":"L",t[6],t[7]]]:(n.forEach(function(h){o.push(["C",h[2],h[3],h[4],h[5],h[6],h[7]])}),o))}),this},Te.prototype.unshort=function(){var t=this.segments,e,r,i,n,s;return this.iterate(function(a,o,u,h){var d=a[0],l=d.toUpperCase(),c;o&&(l==="T"?(c=d==="t",i=t[o-1],i[0]==="Q"?(e=i[1]-u,r=i[2]-h):i[0]==="q"?(e=i[1]-i[3],r=i[2]-i[4]):(e=0,r=0),n=-e,s=-r,c||(n+=u,s+=h),t[o]=[c?"q":"Q",n,s,a[1],a[2]]):l==="S"&&(c=d==="s",i=t[o-1],i[0]==="C"?(e=i[3]-u,r=i[4]-h):i[0]==="c"?(e=i[3]-i[5],r=i[4]-i[6]):(e=0,r=0),n=-e,s=-r,c||(n+=u,s+=h),t[o]=[c?"c":"C",n,s,a[1],a[2],a[3],a[4]]))}),this};var $w=Te,Gw=$w;const zw=Lt(Gw),jw=D.forwardRef((t,e)=>{const[r,i]=D.useState(null),n=P.useRef(null),s=P.useRef(null),a=P.useRef(null),{path:o,visible:u,disabled:h,transformation:{x:d,y:l,width:c,height:f,anchor:p,hexColor:m,fill:v,stroke:g="none",strokeWidth:y=0,colorCorrection:_={}},pointerdown:x,pointerup:b}=t,T=te.useApp(),{temperatureFilter:w,sharpnessFilter:S,hueFilter:A,blurFilter:I,adjustmentFilter:F,vignetteFilter:$,noiseFilter:E}=er(_),{blurRadius:C=0,vignette:U=0,noise:G=0}=_;return D.useEffect(()=>{const R=zw(o).scale(5).translate(0,0).toString(),B=`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${f}">
1970
1970
  <path stroke="${g}" stroke-width="${y}" fill="${m||v}" d="${R}">
1971
1971
  </path>
1972
- </svg>`,X=new vw($),M=T.renderer.generateTexture(X);return i(M),()=>{}},[T,o,g,y,m,v]),K.jsx(Gt,{...t,ref:e,children:K.jsx(te.Container,{ref:s,children:K.jsx(te.Container,{ref:a,children:r&&K.jsx(te.Sprite,{texture:r,width:c,height:f,anchor:p,ref:n,x:d,y:l,alpha:u?1:0,...!h&&u&&{interactive:!0,pointerdown:x,pointerup:b},filters:[w,S,A,F,...E>0?[C]:[],...B>0?[z]:[],...U>0?[I]:[]]})})})})});var hh={};/*!
1972
+ </svg>`,X=new mw(B),M=T.renderer.generateTexture(X);return i(M),()=>{}},[T,o,g,y,m,v]),Z.jsx(Ut,{...t,ref:e,children:Z.jsx(te.Container,{ref:s,children:Z.jsx(te.Container,{ref:a,children:r&&Z.jsx(te.Sprite,{texture:r,width:c,height:f,anchor:p,ref:n,x:d,y:l,alpha:u?1:0,...!h&&u&&{interactive:!0,pointerdown:x,pointerup:b},filters:[w,S,A,F,...C>0?[I]:[],...U>0?[$]:[],...G>0?[E]:[]]})})})})});var uh={};/*!
1973
1973
  * howler.js v2.2.3
1974
1974
  * howlerjs.com
1975
1975
  *
@@ -1977,7 +1977,7 @@ void main() {
1977
1977
  * goldfirestudios.com
1978
1978
  *
1979
1979
  * MIT License
1980
- */(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var l=this||r;return l._counter=1e3,l._html5AudioPool=[],l.html5PoolSize=10,l._codecs={},l._howls=[],l._muted=!1,l._volume=1,l._canPlayEvent="canplaythrough",l._navigator=typeof window<"u"&&window.navigator?window.navigator:null,l.masterGain=null,l.noAudio=!1,l.usingWebAudio=!0,l.autoSuspend=!0,l.ctx=null,l.autoUnlock=!0,l._setup(),l},volume:function(l){var c=this||r;if(l=parseFloat(l),c.ctx||d(),typeof l<"u"&&l>=0&&l<=1){if(c._volume=l,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(l,r.ctx.currentTime);for(var f=0;f<c._howls.length;f++)if(!c._howls[f]._webAudio)for(var p=c._howls[f]._getSoundIds(),m=0;m<p.length;m++){var v=c._howls[f]._soundById(p[m]);v&&v._node&&(v._node.volume=v._volume*l)}return c}return c._volume},mute:function(l){var c=this||r;c.ctx||d(),c._muted=l,c.usingWebAudio&&c.masterGain.gain.setValueAtTime(l?0:c._volume,r.ctx.currentTime);for(var f=0;f<c._howls.length;f++)if(!c._howls[f]._webAudio)for(var p=c._howls[f]._getSoundIds(),m=0;m<p.length;m++){var v=c._howls[f]._soundById(p[m]);v&&v._node&&(v._node.muted=l?!0:v._muted)}return c},stop:function(){for(var l=this||r,c=0;c<l._howls.length;c++)l._howls[c].stop();return l},unload:function(){for(var l=this||r,c=l._howls.length-1;c>=0;c--)l._howls[c].unload();return l.usingWebAudio&&l.ctx&&typeof l.ctx.close<"u"&&(l.ctx.close(),l.ctx=null,d()),l},codecs:function(l){return(this||r)._codecs[l.replace(/^x-/,"")]},_setup:function(){var l=this||r;if(l.state=l.ctx&&l.ctx.state||"suspended",l._autoSuspend(),!l.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(l._canPlayEvent="canplay")}catch{l.noAudio=!0}else l.noAudio=!0;try{var c=new Audio;c.muted&&(l.noAudio=!0)}catch{}return l.noAudio||l._setupCodecs(),l},_setupCodecs:function(){var l=this||r,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return l}if(!c||typeof c.canPlayType!="function")return l;var f=c.canPlayType("audio/mpeg;").replace(/^no$/,""),p=l._navigator?l._navigator.userAgent:"",m=p.match(/OPR\/([0-6].)/g),v=m&&parseInt(m[0].split("/")[1],10)<33,g=p.indexOf("Safari")!==-1&&p.indexOf("Chrome")===-1,y=p.match(/Version\/(.*?) /),_=g&&y&&parseInt(y[1],10)<15;return l._codecs={mp3:!!(!v&&(f||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!f,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!_&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!_&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},l},_unlockAudio:function(){var l=this||r;if(!(l._audioUnlocked||!l.ctx)){l._audioUnlocked=!1,l.autoUnlock=!1,!l._mobileUnloaded&&l.ctx.sampleRate!==44100&&(l._mobileUnloaded=!0,l.unload()),l._scratchBuffer=l.ctx.createBuffer(1,1,22050);var c=function(f){for(;l._html5AudioPool.length<l.html5PoolSize;)try{var p=new Audio;p._unlocked=!0,l._releaseHtml5Audio(p)}catch{l.noAudio=!0;break}for(var m=0;m<l._howls.length;m++)if(!l._howls[m]._webAudio)for(var v=l._howls[m]._getSoundIds(),g=0;g<v.length;g++){var y=l._howls[m]._soundById(v[g]);y&&y._node&&!y._node._unlocked&&(y._node._unlocked=!0,y._node.load())}l._autoResume();var _=l.ctx.createBufferSource();_.buffer=l._scratchBuffer,_.connect(l.ctx.destination),typeof _.start>"u"?_.noteOn(0):_.start(0),typeof l.ctx.resume=="function"&&l.ctx.resume(),_.onended=function(){_.disconnect(0),l._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var x=0;x<l._howls.length;x++)l._howls[x]._emit("unlock")}};return document.addEventListener("touchstart",c,!0),document.addEventListener("touchend",c,!0),document.addEventListener("click",c,!0),document.addEventListener("keydown",c,!0),l}},_obtainHtml5Audio:function(){var l=this||r;if(l._html5AudioPool.length)return l._html5AudioPool.pop();var c=new Audio().play();return c&&typeof Promise<"u"&&(c instanceof Promise||typeof c.then=="function")&&c.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(l){var c=this||r;return l._unlocked&&c._html5AudioPool.push(l),c},_autoSuspend:function(){var l=this;if(!(!l.autoSuspend||!l.ctx||typeof l.ctx.suspend>"u"||!r.usingWebAudio)){for(var c=0;c<l._howls.length;c++)if(l._howls[c]._webAudio){for(var f=0;f<l._howls[c]._sounds.length;f++)if(!l._howls[c]._sounds[f]._paused)return l}return l._suspendTimer&&clearTimeout(l._suspendTimer),l._suspendTimer=setTimeout(function(){if(l.autoSuspend){l._suspendTimer=null,l.state="suspending";var p=function(){l.state="suspended",l._resumeAfterSuspend&&(delete l._resumeAfterSuspend,l._autoResume())};l.ctx.suspend().then(p,p)}},3e4),l}},_autoResume:function(){var l=this;if(!(!l.ctx||typeof l.ctx.resume>"u"||!r.usingWebAudio))return l.state==="running"&&l.ctx.state!=="interrupted"&&l._suspendTimer?(clearTimeout(l._suspendTimer),l._suspendTimer=null):l.state==="suspended"||l.state==="running"&&l.ctx.state==="interrupted"?(l.ctx.resume().then(function(){l.state="running";for(var c=0;c<l._howls.length;c++)l._howls[c]._emit("resume")}),l._suspendTimer&&(clearTimeout(l._suspendTimer),l._suspendTimer=null)):l.state==="suspending"&&(l._resumeAfterSuspend=!0),l}};var r=new e,i=function(l){var c=this;if(!l.src||l.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}c.init(l)};i.prototype={init:function(l){var c=this;return r.ctx||d(),c._autoplay=l.autoplay||!1,c._format=typeof l.format!="string"?l.format:[l.format],c._html5=l.html5||!1,c._muted=l.mute||!1,c._loop=l.loop||!1,c._pool=l.pool||5,c._preload=typeof l.preload=="boolean"||l.preload==="metadata"?l.preload:!0,c._rate=l.rate||1,c._sprite=l.sprite||{},c._src=typeof l.src!="string"?l.src:[l.src],c._volume=l.volume!==void 0?l.volume:1,c._xhr={method:l.xhr&&l.xhr.method?l.xhr.method:"GET",headers:l.xhr&&l.xhr.headers?l.xhr.headers:null,withCredentials:l.xhr&&l.xhr.withCredentials?l.xhr.withCredentials:!1},c._duration=0,c._state="unloaded",c._sounds=[],c._endTimers={},c._queue=[],c._playLock=!1,c._onend=l.onend?[{fn:l.onend}]:[],c._onfade=l.onfade?[{fn:l.onfade}]:[],c._onload=l.onload?[{fn:l.onload}]:[],c._onloaderror=l.onloaderror?[{fn:l.onloaderror}]:[],c._onplayerror=l.onplayerror?[{fn:l.onplayerror}]:[],c._onpause=l.onpause?[{fn:l.onpause}]:[],c._onplay=l.onplay?[{fn:l.onplay}]:[],c._onstop=l.onstop?[{fn:l.onstop}]:[],c._onmute=l.onmute?[{fn:l.onmute}]:[],c._onvolume=l.onvolume?[{fn:l.onvolume}]:[],c._onrate=l.onrate?[{fn:l.onrate}]:[],c._onseek=l.onseek?[{fn:l.onseek}]:[],c._onunlock=l.onunlock?[{fn:l.onunlock}]:[],c._onresume=[],c._webAudio=r.usingWebAudio&&!c._html5,typeof r.ctx<"u"&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(c),c._autoplay&&c._queue.push({event:"play",action:function(){c.play()}}),c._preload&&c._preload!=="none"&&c.load(),c},load:function(){var l=this,c=null;if(r.noAudio){l._emit("loaderror",null,"No audio support.");return}typeof l._src=="string"&&(l._src=[l._src]);for(var f=0;f<l._src.length;f++){var p,m;if(l._format&&l._format[f])p=l._format[f];else{if(m=l._src[f],typeof m!="string"){l._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}p=/^data:audio\/([^;,]+);/i.exec(m),p||(p=/\.([^.]+)$/.exec(m.split("?",1)[0])),p&&(p=p[1].toLowerCase())}if(p||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),p&&r.codecs(p)){c=l._src[f];break}}if(!c){l._emit("loaderror",null,"No codec support for selected audio sources.");return}return l._src=c,l._state="loading",window.location.protocol==="https:"&&c.slice(0,5)==="http:"&&(l._html5=!0,l._webAudio=!1),new n(l),l._webAudio&&a(l),l},play:function(l,c){var f=this,p=null;if(typeof l=="number")p=l,l=null;else{if(typeof l=="string"&&f._state==="loaded"&&!f._sprite[l])return null;if(typeof l>"u"&&(l="__default",!f._playLock)){for(var m=0,v=0;v<f._sounds.length;v++)f._sounds[v]._paused&&!f._sounds[v]._ended&&(m++,p=f._sounds[v]._id);m===1?l=null:p=null}}var g=p?f._soundById(p):f._inactiveSound();if(!g)return null;if(p&&!l&&(l=g._sprite||"__default"),f._state!=="loaded"){g._sprite=l,g._ended=!1;var y=g._id;return f._queue.push({event:"play",action:function(){f.play(y)}}),y}if(p&&!g._paused)return c||f._loadQueue("play"),g._id;f._webAudio&&r._autoResume();var _=Math.max(0,g._seek>0?g._seek:f._sprite[l][0]/1e3),x=Math.max(0,(f._sprite[l][0]+f._sprite[l][1])/1e3-_),b=x*1e3/Math.abs(g._rate),T=f._sprite[l][0]/1e3,w=(f._sprite[l][0]+f._sprite[l][1])/1e3;g._sprite=l,g._ended=!1;var S=function(){g._paused=!1,g._seek=_,g._start=T,g._stop=w,g._loop=!!(g._loop||f._sprite[l][2])};if(_>=w){f._ended(g);return}var A=g._node;if(f._webAudio){var C=function(){f._playLock=!1,S(),f._refreshBuffer(g);var E=g._muted||f._muted?0:g._volume;A.gain.setValueAtTime(E,r.ctx.currentTime),g._playStart=r.ctx.currentTime,typeof A.bufferSource.start>"u"?g._loop?A.bufferSource.noteGrainOn(0,_,86400):A.bufferSource.noteGrainOn(0,_,x):g._loop?A.bufferSource.start(0,_,86400):A.bufferSource.start(0,_,x),b!==1/0&&(f._endTimers[g._id]=setTimeout(f._ended.bind(f,g),b)),c||setTimeout(function(){f._emit("play",g._id),f._loadQueue()},0)};r.state==="running"&&r.ctx.state!=="interrupted"?C():(f._playLock=!0,f.once("resume",C),f._clearTimer(g._id))}else{var F=function(){A.currentTime=_,A.muted=g._muted||f._muted||r._muted||A.muted,A.volume=g._volume*r.volume(),A.playbackRate=g._rate;try{var E=A.play();if(E&&typeof Promise<"u"&&(E instanceof Promise||typeof E.then=="function")?(f._playLock=!0,S(),E.then(function(){f._playLock=!1,A._unlocked=!0,c?f._loadQueue():f._emit("play",g._id)}).catch(function(){f._playLock=!1,f._emit("playerror",g._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),g._ended=!0,g._paused=!0})):c||(f._playLock=!1,S(),f._emit("play",g._id)),A.playbackRate=g._rate,A.paused){f._emit("playerror",g._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}l!=="__default"||g._loop?f._endTimers[g._id]=setTimeout(f._ended.bind(f,g),b):(f._endTimers[g._id]=function(){f._ended(g),A.removeEventListener("ended",f._endTimers[g._id],!1)},A.addEventListener("ended",f._endTimers[g._id],!1))}catch(B){f._emit("playerror",g._id,B)}};A.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(A.src=f._src,A.load());var z=window&&window.ejecta||!A.readyState&&r._navigator.isCocoonJS;if(A.readyState>=3||z)F();else{f._playLock=!0,f._state="loading";var I=function(){f._state="loaded",F(),A.removeEventListener(r._canPlayEvent,I,!1)};A.addEventListener(r._canPlayEvent,I,!1),f._clearTimer(g._id)}}return g._id},pause:function(l){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(l)}}),c;for(var f=c._getSoundIds(l),p=0;p<f.length;p++){c._clearTimer(f[p]);var m=c._soundById(f[p]);if(m&&!m._paused&&(m._seek=c.seek(f[p]),m._rateSeek=0,m._paused=!0,c._stopFade(f[p]),m._node))if(c._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),c._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||c._emit("pause",m?m._id:null)}return c},stop:function(l,c){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"stop",action:function(){f.stop(l)}}),f;for(var p=f._getSoundIds(l),m=0;m<p.length;m++){f._clearTimer(p[m]);var v=f._soundById(p[m]);v&&(v._seek=v._start||0,v._rateSeek=0,v._paused=!0,v._ended=!0,f._stopFade(p[m]),v._node&&(f._webAudio?v._node.bufferSource&&(typeof v._node.bufferSource.stop>"u"?v._node.bufferSource.noteOff(0):v._node.bufferSource.stop(0),f._cleanBuffer(v._node)):(!isNaN(v._node.duration)||v._node.duration===1/0)&&(v._node.currentTime=v._start||0,v._node.pause(),v._node.duration===1/0&&f._clearSound(v._node))),c||f._emit("stop",v._id))}return f},mute:function(l,c){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"mute",action:function(){f.mute(l,c)}}),f;if(typeof c>"u")if(typeof l=="boolean")f._muted=l;else return f._muted;for(var p=f._getSoundIds(c),m=0;m<p.length;m++){var v=f._soundById(p[m]);v&&(v._muted=l,v._interval&&f._stopFade(v._id),f._webAudio&&v._node?v._node.gain.setValueAtTime(l?0:v._volume,r.ctx.currentTime):v._node&&(v._node.muted=r._muted?!0:l),f._emit("mute",v._id))}return f},volume:function(){var l=this,c=arguments,f,p;if(c.length===0)return l._volume;if(c.length===1||c.length===2&&typeof c[1]>"u"){var m=l._getSoundIds(),v=m.indexOf(c[0]);v>=0?p=parseInt(c[0],10):f=parseFloat(c[0])}else c.length>=2&&(f=parseFloat(c[0]),p=parseInt(c[1],10));var g;if(typeof f<"u"&&f>=0&&f<=1){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"volume",action:function(){l.volume.apply(l,c)}}),l;typeof p>"u"&&(l._volume=f),p=l._getSoundIds(p);for(var y=0;y<p.length;y++)g=l._soundById(p[y]),g&&(g._volume=f,c[2]||l._stopFade(p[y]),l._webAudio&&g._node&&!g._muted?g._node.gain.setValueAtTime(f,r.ctx.currentTime):g._node&&!g._muted&&(g._node.volume=f*r.volume()),l._emit("volume",g._id))}else return g=p?l._soundById(p):l._sounds[0],g?g._volume:0;return l},fade:function(l,c,f,p){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(l,c,f,p)}}),m;l=Math.min(Math.max(0,parseFloat(l)),1),c=Math.min(Math.max(0,parseFloat(c)),1),f=parseFloat(f),m.volume(l,p);for(var v=m._getSoundIds(p),g=0;g<v.length;g++){var y=m._soundById(v[g]);if(y){if(p||m._stopFade(v[g]),m._webAudio&&!y._muted){var _=r.ctx.currentTime,x=_+f/1e3;y._volume=l,y._node.gain.setValueAtTime(l,_),y._node.gain.linearRampToValueAtTime(c,x)}m._startFadeInterval(y,l,c,f,v[g],typeof p>"u")}}return m},_startFadeInterval:function(l,c,f,p,m,v){var g=this,y=c,_=f-c,x=Math.abs(_/.01),b=Math.max(4,x>0?p/x:p),T=Date.now();l._fadeTo=f,l._interval=setInterval(function(){var w=(Date.now()-T)/p;T=Date.now(),y+=_*w,y=Math.round(y*100)/100,_<0?y=Math.max(f,y):y=Math.min(f,y),g._webAudio?l._volume=y:g.volume(y,l._id,!0),v&&(g._volume=y),(f<c&&y<=f||f>c&&y>=f)&&(clearInterval(l._interval),l._interval=null,l._fadeTo=null,g.volume(f,l._id),g._emit("fade",l._id))},b)},_stopFade:function(l){var c=this,f=c._soundById(l);return f&&f._interval&&(c._webAudio&&f._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(f._interval),f._interval=null,c.volume(f._fadeTo,l),f._fadeTo=null,c._emit("fade",l)),c},loop:function(){var l=this,c=arguments,f,p,m;if(c.length===0)return l._loop;if(c.length===1)if(typeof c[0]=="boolean")f=c[0],l._loop=f;else return m=l._soundById(parseInt(c[0],10)),m?m._loop:!1;else c.length===2&&(f=c[0],p=parseInt(c[1],10));for(var v=l._getSoundIds(p),g=0;g<v.length;g++)m=l._soundById(v[g]),m&&(m._loop=f,l._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=f,f&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,l.playing(v[g])&&(l.pause(v[g],!0),l.play(v[g],!0)))));return l},rate:function(){var l=this,c=arguments,f,p;if(c.length===0)p=l._sounds[0]._id;else if(c.length===1){var m=l._getSoundIds(),v=m.indexOf(c[0]);v>=0?p=parseInt(c[0],10):f=parseFloat(c[0])}else c.length===2&&(f=parseFloat(c[0]),p=parseInt(c[1],10));var g;if(typeof f=="number"){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"rate",action:function(){l.rate.apply(l,c)}}),l;typeof p>"u"&&(l._rate=f),p=l._getSoundIds(p);for(var y=0;y<p.length;y++)if(g=l._soundById(p[y]),g){l.playing(p[y])&&(g._rateSeek=l.seek(p[y]),g._playStart=l._webAudio?r.ctx.currentTime:g._playStart),g._rate=f,l._webAudio&&g._node&&g._node.bufferSource?g._node.bufferSource.playbackRate.setValueAtTime(f,r.ctx.currentTime):g._node&&(g._node.playbackRate=f);var _=l.seek(p[y]),x=(l._sprite[g._sprite][0]+l._sprite[g._sprite][1])/1e3-_,b=x*1e3/Math.abs(g._rate);(l._endTimers[p[y]]||!g._paused)&&(l._clearTimer(p[y]),l._endTimers[p[y]]=setTimeout(l._ended.bind(l,g),b)),l._emit("rate",g._id)}}else return g=l._soundById(p),g?g._rate:l._rate;return l},seek:function(){var l=this,c=arguments,f,p;if(c.length===0)l._sounds.length&&(p=l._sounds[0]._id);else if(c.length===1){var m=l._getSoundIds(),v=m.indexOf(c[0]);v>=0?p=parseInt(c[0],10):l._sounds.length&&(p=l._sounds[0]._id,f=parseFloat(c[0]))}else c.length===2&&(f=parseFloat(c[0]),p=parseInt(c[1],10));if(typeof p>"u")return 0;if(typeof f=="number"&&(l._state!=="loaded"||l._playLock))return l._queue.push({event:"seek",action:function(){l.seek.apply(l,c)}}),l;var g=l._soundById(p);if(g)if(typeof f=="number"&&f>=0){var y=l.playing(p);y&&l.pause(p,!0),g._seek=f,g._ended=!1,l._clearTimer(p),!l._webAudio&&g._node&&!isNaN(g._node.duration)&&(g._node.currentTime=f);var _=function(){y&&l.play(p,!0),l._emit("seek",p)};if(y&&!l._webAudio){var x=function(){l._playLock?setTimeout(x,0):_()};setTimeout(x,0)}else _()}else if(l._webAudio){var b=l.playing(p)?r.ctx.currentTime-g._playStart:0,T=g._rateSeek?g._rateSeek-g._seek:0;return g._seek+(T+b*Math.abs(g._rate))}else return g._node.currentTime;return l},playing:function(l){var c=this;if(typeof l=="number"){var f=c._soundById(l);return f?!f._paused:!1}for(var p=0;p<c._sounds.length;p++)if(!c._sounds[p]._paused)return!0;return!1},duration:function(l){var c=this,f=c._duration,p=c._soundById(l);return p&&(f=c._sprite[p._sprite][1]/1e3),f},state:function(){return this._state},unload:function(){for(var l=this,c=l._sounds,f=0;f<c.length;f++)c[f]._paused||l.stop(c[f]._id),l._webAudio||(l._clearSound(c[f]._node),c[f]._node.removeEventListener("error",c[f]._errorFn,!1),c[f]._node.removeEventListener(r._canPlayEvent,c[f]._loadFn,!1),c[f]._node.removeEventListener("ended",c[f]._endFn,!1),r._releaseHtml5Audio(c[f]._node)),delete c[f]._node,l._clearTimer(c[f]._id);var p=r._howls.indexOf(l);p>=0&&r._howls.splice(p,1);var m=!0;for(f=0;f<r._howls.length;f++)if(r._howls[f]._src===l._src||l._src.indexOf(r._howls[f]._src)>=0){m=!1;break}return s&&m&&delete s[l._src],r.noAudio=!1,l._state="unloaded",l._sounds=[],l=null,null},on:function(l,c,f,p){var m=this,v=m["_on"+l];return typeof c=="function"&&v.push(p?{id:f,fn:c,once:p}:{id:f,fn:c}),m},off:function(l,c,f){var p=this,m=p["_on"+l],v=0;if(typeof c=="number"&&(f=c,c=null),c||f)for(v=0;v<m.length;v++){var g=f===m[v].id;if(c===m[v].fn&&g||!c&&g){m.splice(v,1);break}}else if(l)p["_on"+l]=[];else{var y=Object.keys(p);for(v=0;v<y.length;v++)y[v].indexOf("_on")===0&&Array.isArray(p[y[v]])&&(p[y[v]]=[])}return p},once:function(l,c,f){var p=this;return p.on(l,c,f,1),p},_emit:function(l,c,f){for(var p=this,m=p["_on"+l],v=m.length-1;v>=0;v--)(!m[v].id||m[v].id===c||l==="load")&&(setTimeout((function(g){g.call(this,c,f)}).bind(p,m[v].fn),0),m[v].once&&p.off(l,m[v].fn,m[v].id));return p._loadQueue(l),p},_loadQueue:function(l){var c=this;if(c._queue.length>0){var f=c._queue[0];f.event===l&&(c._queue.shift(),c._loadQueue()),l||f.action()}return c},_ended:function(l){var c=this,f=l._sprite;if(!c._webAudio&&l._node&&!l._node.paused&&!l._node.ended&&l._node.currentTime<l._stop)return setTimeout(c._ended.bind(c,l),100),c;var p=!!(l._loop||c._sprite[f][2]);if(c._emit("end",l._id),!c._webAudio&&p&&c.stop(l._id,!0).play(l._id),c._webAudio&&p){c._emit("play",l._id),l._seek=l._start||0,l._rateSeek=0,l._playStart=r.ctx.currentTime;var m=(l._stop-l._start)*1e3/Math.abs(l._rate);c._endTimers[l._id]=setTimeout(c._ended.bind(c,l),m)}return c._webAudio&&!p&&(l._paused=!0,l._ended=!0,l._seek=l._start||0,l._rateSeek=0,c._clearTimer(l._id),c._cleanBuffer(l._node),r._autoSuspend()),!c._webAudio&&!p&&c.stop(l._id,!0),c},_clearTimer:function(l){var c=this;if(c._endTimers[l]){if(typeof c._endTimers[l]!="function")clearTimeout(c._endTimers[l]);else{var f=c._soundById(l);f&&f._node&&f._node.removeEventListener("ended",c._endTimers[l],!1)}delete c._endTimers[l]}return c},_soundById:function(l){for(var c=this,f=0;f<c._sounds.length;f++)if(l===c._sounds[f]._id)return c._sounds[f];return null},_inactiveSound:function(){var l=this;l._drain();for(var c=0;c<l._sounds.length;c++)if(l._sounds[c]._ended)return l._sounds[c].reset();return new n(l)},_drain:function(){var l=this,c=l._pool,f=0,p=0;if(!(l._sounds.length<c)){for(p=0;p<l._sounds.length;p++)l._sounds[p]._ended&&f++;for(p=l._sounds.length-1;p>=0;p--){if(f<=c)return;l._sounds[p]._ended&&(l._webAudio&&l._sounds[p]._node&&l._sounds[p]._node.disconnect(0),l._sounds.splice(p,1),f--)}}},_getSoundIds:function(l){var c=this;if(typeof l>"u"){for(var f=[],p=0;p<c._sounds.length;p++)f.push(c._sounds[p]._id);return f}else return[l]},_refreshBuffer:function(l){var c=this;return l._node.bufferSource=r.ctx.createBufferSource(),l._node.bufferSource.buffer=s[c._src],l._panner?l._node.bufferSource.connect(l._panner):l._node.bufferSource.connect(l._node),l._node.bufferSource.loop=l._loop,l._loop&&(l._node.bufferSource.loopStart=l._start||0,l._node.bufferSource.loopEnd=l._stop||0),l._node.bufferSource.playbackRate.setValueAtTime(l._rate,r.ctx.currentTime),c},_cleanBuffer:function(l){var c=this,f=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(r._scratchBuffer&&l.bufferSource&&(l.bufferSource.onended=null,l.bufferSource.disconnect(0),f))try{l.bufferSource.buffer=r._scratchBuffer}catch{}return l.bufferSource=null,c},_clearSound:function(l){var c=/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent);c||(l.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(l){this._parent=l,this.init()};n.prototype={init:function(){var l=this,c=l._parent;return l._muted=c._muted,l._loop=c._loop,l._volume=c._volume,l._rate=c._rate,l._seek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++r._counter,c._sounds.push(l),l.create(),l},create:function(){var l=this,c=l._parent,f=r._muted||l._muted||l._parent._muted?0:l._volume;return c._webAudio?(l._node=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),l._node.gain.setValueAtTime(f,r.ctx.currentTime),l._node.paused=!0,l._node.connect(r.masterGain)):r.noAudio||(l._node=r._obtainHtml5Audio(),l._errorFn=l._errorListener.bind(l),l._node.addEventListener("error",l._errorFn,!1),l._loadFn=l._loadListener.bind(l),l._node.addEventListener(r._canPlayEvent,l._loadFn,!1),l._endFn=l._endListener.bind(l),l._node.addEventListener("ended",l._endFn,!1),l._node.src=c._src,l._node.preload=c._preload===!0?"auto":c._preload,l._node.volume=f*r.volume(),l._node.load()),l},reset:function(){var l=this,c=l._parent;return l._muted=c._muted,l._loop=c._loop,l._volume=c._volume,l._rate=c._rate,l._seek=0,l._rateSeek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++r._counter,l},_errorListener:function(){var l=this;l._parent._emit("loaderror",l._id,l._node.error?l._node.error.code:0),l._node.removeEventListener("error",l._errorFn,!1)},_loadListener:function(){var l=this,c=l._parent;c._duration=Math.ceil(l._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),l._node.removeEventListener(r._canPlayEvent,l._loadFn,!1)},_endListener:function(){var l=this,c=l._parent;c._duration===1/0&&(c._duration=Math.ceil(l._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(l)),l._node.removeEventListener("ended",l._endFn,!1)}};var s={},a=function(l){var c=l._src;if(s[c]){l._duration=s[c].duration,h(l);return}if(/^data:[^;]+;base64,/.test(c)){for(var f=atob(c.split(",")[1]),p=new Uint8Array(f.length),m=0;m<f.length;++m)p[m]=f.charCodeAt(m);u(p.buffer,l)}else{var v=new XMLHttpRequest;v.open(l._xhr.method,c,!0),v.withCredentials=l._xhr.withCredentials,v.responseType="arraybuffer",l._xhr.headers&&Object.keys(l._xhr.headers).forEach(function(g){v.setRequestHeader(g,l._xhr.headers[g])}),v.onload=function(){var g=(v.status+"")[0];if(g!=="0"&&g!=="2"&&g!=="3"){l._emit("loaderror",null,"Failed loading audio file with status: "+v.status+".");return}u(v.response,l)},v.onerror=function(){l._webAudio&&(l._html5=!0,l._webAudio=!1,l._sounds=[],delete s[c],l.load())},o(v)}},o=function(l){try{l.send()}catch{l.onerror()}},u=function(l,c){var f=function(){c._emit("loaderror",null,"Decoding audio data failed.")},p=function(m){m&&c._sounds.length>0?(s[c._src]=m,h(c,m)):f()};typeof Promise<"u"&&r.ctx.decodeAudioData.length===1?r.ctx.decodeAudioData(l).then(p).catch(f):r.ctx.decodeAudioData(l,p,f)},h=function(l,c){c&&!l._duration&&(l._duration=c.duration),Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue())},d=function(){if(r.usingWebAudio){try{typeof AudioContext<"u"?r.ctx=new AudioContext:typeof webkitAudioContext<"u"?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch{r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var l=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),c=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),f=c?parseInt(c[1],10):null;if(l&&f&&f<9){var p=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!p&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};t.Howler=r,t.Howl=i,typeof Xe<"u"?(Xe.HowlerGlobal=e,Xe.Howler=r,Xe.Howl=i,Xe.Sound=n):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=r,window.Howl=i,window.Sound=n)})();/*!
1980
+ */(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var l=this||r;return l._counter=1e3,l._html5AudioPool=[],l.html5PoolSize=10,l._codecs={},l._howls=[],l._muted=!1,l._volume=1,l._canPlayEvent="canplaythrough",l._navigator=typeof window<"u"&&window.navigator?window.navigator:null,l.masterGain=null,l.noAudio=!1,l.usingWebAudio=!0,l.autoSuspend=!0,l.ctx=null,l.autoUnlock=!0,l._setup(),l},volume:function(l){var c=this||r;if(l=parseFloat(l),c.ctx||d(),typeof l<"u"&&l>=0&&l<=1){if(c._volume=l,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(l,r.ctx.currentTime);for(var f=0;f<c._howls.length;f++)if(!c._howls[f]._webAudio)for(var p=c._howls[f]._getSoundIds(),m=0;m<p.length;m++){var v=c._howls[f]._soundById(p[m]);v&&v._node&&(v._node.volume=v._volume*l)}return c}return c._volume},mute:function(l){var c=this||r;c.ctx||d(),c._muted=l,c.usingWebAudio&&c.masterGain.gain.setValueAtTime(l?0:c._volume,r.ctx.currentTime);for(var f=0;f<c._howls.length;f++)if(!c._howls[f]._webAudio)for(var p=c._howls[f]._getSoundIds(),m=0;m<p.length;m++){var v=c._howls[f]._soundById(p[m]);v&&v._node&&(v._node.muted=l?!0:v._muted)}return c},stop:function(){for(var l=this||r,c=0;c<l._howls.length;c++)l._howls[c].stop();return l},unload:function(){for(var l=this||r,c=l._howls.length-1;c>=0;c--)l._howls[c].unload();return l.usingWebAudio&&l.ctx&&typeof l.ctx.close<"u"&&(l.ctx.close(),l.ctx=null,d()),l},codecs:function(l){return(this||r)._codecs[l.replace(/^x-/,"")]},_setup:function(){var l=this||r;if(l.state=l.ctx&&l.ctx.state||"suspended",l._autoSuspend(),!l.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(l._canPlayEvent="canplay")}catch{l.noAudio=!0}else l.noAudio=!0;try{var c=new Audio;c.muted&&(l.noAudio=!0)}catch{}return l.noAudio||l._setupCodecs(),l},_setupCodecs:function(){var l=this||r,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return l}if(!c||typeof c.canPlayType!="function")return l;var f=c.canPlayType("audio/mpeg;").replace(/^no$/,""),p=l._navigator?l._navigator.userAgent:"",m=p.match(/OPR\/([0-6].)/g),v=m&&parseInt(m[0].split("/")[1],10)<33,g=p.indexOf("Safari")!==-1&&p.indexOf("Chrome")===-1,y=p.match(/Version\/(.*?) /),_=g&&y&&parseInt(y[1],10)<15;return l._codecs={mp3:!!(!v&&(f||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!f,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!_&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!_&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},l},_unlockAudio:function(){var l=this||r;if(!(l._audioUnlocked||!l.ctx)){l._audioUnlocked=!1,l.autoUnlock=!1,!l._mobileUnloaded&&l.ctx.sampleRate!==44100&&(l._mobileUnloaded=!0,l.unload()),l._scratchBuffer=l.ctx.createBuffer(1,1,22050);var c=function(f){for(;l._html5AudioPool.length<l.html5PoolSize;)try{var p=new Audio;p._unlocked=!0,l._releaseHtml5Audio(p)}catch{l.noAudio=!0;break}for(var m=0;m<l._howls.length;m++)if(!l._howls[m]._webAudio)for(var v=l._howls[m]._getSoundIds(),g=0;g<v.length;g++){var y=l._howls[m]._soundById(v[g]);y&&y._node&&!y._node._unlocked&&(y._node._unlocked=!0,y._node.load())}l._autoResume();var _=l.ctx.createBufferSource();_.buffer=l._scratchBuffer,_.connect(l.ctx.destination),typeof _.start>"u"?_.noteOn(0):_.start(0),typeof l.ctx.resume=="function"&&l.ctx.resume(),_.onended=function(){_.disconnect(0),l._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var x=0;x<l._howls.length;x++)l._howls[x]._emit("unlock")}};return document.addEventListener("touchstart",c,!0),document.addEventListener("touchend",c,!0),document.addEventListener("click",c,!0),document.addEventListener("keydown",c,!0),l}},_obtainHtml5Audio:function(){var l=this||r;if(l._html5AudioPool.length)return l._html5AudioPool.pop();var c=new Audio().play();return c&&typeof Promise<"u"&&(c instanceof Promise||typeof c.then=="function")&&c.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(l){var c=this||r;return l._unlocked&&c._html5AudioPool.push(l),c},_autoSuspend:function(){var l=this;if(!(!l.autoSuspend||!l.ctx||typeof l.ctx.suspend>"u"||!r.usingWebAudio)){for(var c=0;c<l._howls.length;c++)if(l._howls[c]._webAudio){for(var f=0;f<l._howls[c]._sounds.length;f++)if(!l._howls[c]._sounds[f]._paused)return l}return l._suspendTimer&&clearTimeout(l._suspendTimer),l._suspendTimer=setTimeout(function(){if(l.autoSuspend){l._suspendTimer=null,l.state="suspending";var p=function(){l.state="suspended",l._resumeAfterSuspend&&(delete l._resumeAfterSuspend,l._autoResume())};l.ctx.suspend().then(p,p)}},3e4),l}},_autoResume:function(){var l=this;if(!(!l.ctx||typeof l.ctx.resume>"u"||!r.usingWebAudio))return l.state==="running"&&l.ctx.state!=="interrupted"&&l._suspendTimer?(clearTimeout(l._suspendTimer),l._suspendTimer=null):l.state==="suspended"||l.state==="running"&&l.ctx.state==="interrupted"?(l.ctx.resume().then(function(){l.state="running";for(var c=0;c<l._howls.length;c++)l._howls[c]._emit("resume")}),l._suspendTimer&&(clearTimeout(l._suspendTimer),l._suspendTimer=null)):l.state==="suspending"&&(l._resumeAfterSuspend=!0),l}};var r=new e,i=function(l){var c=this;if(!l.src||l.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}c.init(l)};i.prototype={init:function(l){var c=this;return r.ctx||d(),c._autoplay=l.autoplay||!1,c._format=typeof l.format!="string"?l.format:[l.format],c._html5=l.html5||!1,c._muted=l.mute||!1,c._loop=l.loop||!1,c._pool=l.pool||5,c._preload=typeof l.preload=="boolean"||l.preload==="metadata"?l.preload:!0,c._rate=l.rate||1,c._sprite=l.sprite||{},c._src=typeof l.src!="string"?l.src:[l.src],c._volume=l.volume!==void 0?l.volume:1,c._xhr={method:l.xhr&&l.xhr.method?l.xhr.method:"GET",headers:l.xhr&&l.xhr.headers?l.xhr.headers:null,withCredentials:l.xhr&&l.xhr.withCredentials?l.xhr.withCredentials:!1},c._duration=0,c._state="unloaded",c._sounds=[],c._endTimers={},c._queue=[],c._playLock=!1,c._onend=l.onend?[{fn:l.onend}]:[],c._onfade=l.onfade?[{fn:l.onfade}]:[],c._onload=l.onload?[{fn:l.onload}]:[],c._onloaderror=l.onloaderror?[{fn:l.onloaderror}]:[],c._onplayerror=l.onplayerror?[{fn:l.onplayerror}]:[],c._onpause=l.onpause?[{fn:l.onpause}]:[],c._onplay=l.onplay?[{fn:l.onplay}]:[],c._onstop=l.onstop?[{fn:l.onstop}]:[],c._onmute=l.onmute?[{fn:l.onmute}]:[],c._onvolume=l.onvolume?[{fn:l.onvolume}]:[],c._onrate=l.onrate?[{fn:l.onrate}]:[],c._onseek=l.onseek?[{fn:l.onseek}]:[],c._onunlock=l.onunlock?[{fn:l.onunlock}]:[],c._onresume=[],c._webAudio=r.usingWebAudio&&!c._html5,typeof r.ctx<"u"&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(c),c._autoplay&&c._queue.push({event:"play",action:function(){c.play()}}),c._preload&&c._preload!=="none"&&c.load(),c},load:function(){var l=this,c=null;if(r.noAudio){l._emit("loaderror",null,"No audio support.");return}typeof l._src=="string"&&(l._src=[l._src]);for(var f=0;f<l._src.length;f++){var p,m;if(l._format&&l._format[f])p=l._format[f];else{if(m=l._src[f],typeof m!="string"){l._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}p=/^data:audio\/([^;,]+);/i.exec(m),p||(p=/\.([^.]+)$/.exec(m.split("?",1)[0])),p&&(p=p[1].toLowerCase())}if(p||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),p&&r.codecs(p)){c=l._src[f];break}}if(!c){l._emit("loaderror",null,"No codec support for selected audio sources.");return}return l._src=c,l._state="loading",window.location.protocol==="https:"&&c.slice(0,5)==="http:"&&(l._html5=!0,l._webAudio=!1),new n(l),l._webAudio&&a(l),l},play:function(l,c){var f=this,p=null;if(typeof l=="number")p=l,l=null;else{if(typeof l=="string"&&f._state==="loaded"&&!f._sprite[l])return null;if(typeof l>"u"&&(l="__default",!f._playLock)){for(var m=0,v=0;v<f._sounds.length;v++)f._sounds[v]._paused&&!f._sounds[v]._ended&&(m++,p=f._sounds[v]._id);m===1?l=null:p=null}}var g=p?f._soundById(p):f._inactiveSound();if(!g)return null;if(p&&!l&&(l=g._sprite||"__default"),f._state!=="loaded"){g._sprite=l,g._ended=!1;var y=g._id;return f._queue.push({event:"play",action:function(){f.play(y)}}),y}if(p&&!g._paused)return c||f._loadQueue("play"),g._id;f._webAudio&&r._autoResume();var _=Math.max(0,g._seek>0?g._seek:f._sprite[l][0]/1e3),x=Math.max(0,(f._sprite[l][0]+f._sprite[l][1])/1e3-_),b=x*1e3/Math.abs(g._rate),T=f._sprite[l][0]/1e3,w=(f._sprite[l][0]+f._sprite[l][1])/1e3;g._sprite=l,g._ended=!1;var S=function(){g._paused=!1,g._seek=_,g._start=T,g._stop=w,g._loop=!!(g._loop||f._sprite[l][2])};if(_>=w){f._ended(g);return}var A=g._node;if(f._webAudio){var I=function(){f._playLock=!1,S(),f._refreshBuffer(g);var C=g._muted||f._muted?0:g._volume;A.gain.setValueAtTime(C,r.ctx.currentTime),g._playStart=r.ctx.currentTime,typeof A.bufferSource.start>"u"?g._loop?A.bufferSource.noteGrainOn(0,_,86400):A.bufferSource.noteGrainOn(0,_,x):g._loop?A.bufferSource.start(0,_,86400):A.bufferSource.start(0,_,x),b!==1/0&&(f._endTimers[g._id]=setTimeout(f._ended.bind(f,g),b)),c||setTimeout(function(){f._emit("play",g._id),f._loadQueue()},0)};r.state==="running"&&r.ctx.state!=="interrupted"?I():(f._playLock=!0,f.once("resume",I),f._clearTimer(g._id))}else{var F=function(){A.currentTime=_,A.muted=g._muted||f._muted||r._muted||A.muted,A.volume=g._volume*r.volume(),A.playbackRate=g._rate;try{var C=A.play();if(C&&typeof Promise<"u"&&(C instanceof Promise||typeof C.then=="function")?(f._playLock=!0,S(),C.then(function(){f._playLock=!1,A._unlocked=!0,c?f._loadQueue():f._emit("play",g._id)}).catch(function(){f._playLock=!1,f._emit("playerror",g._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),g._ended=!0,g._paused=!0})):c||(f._playLock=!1,S(),f._emit("play",g._id)),A.playbackRate=g._rate,A.paused){f._emit("playerror",g._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}l!=="__default"||g._loop?f._endTimers[g._id]=setTimeout(f._ended.bind(f,g),b):(f._endTimers[g._id]=function(){f._ended(g),A.removeEventListener("ended",f._endTimers[g._id],!1)},A.addEventListener("ended",f._endTimers[g._id],!1))}catch(U){f._emit("playerror",g._id,U)}};A.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(A.src=f._src,A.load());var $=window&&window.ejecta||!A.readyState&&r._navigator.isCocoonJS;if(A.readyState>=3||$)F();else{f._playLock=!0,f._state="loading";var E=function(){f._state="loaded",F(),A.removeEventListener(r._canPlayEvent,E,!1)};A.addEventListener(r._canPlayEvent,E,!1),f._clearTimer(g._id)}}return g._id},pause:function(l){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(l)}}),c;for(var f=c._getSoundIds(l),p=0;p<f.length;p++){c._clearTimer(f[p]);var m=c._soundById(f[p]);if(m&&!m._paused&&(m._seek=c.seek(f[p]),m._rateSeek=0,m._paused=!0,c._stopFade(f[p]),m._node))if(c._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),c._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||c._emit("pause",m?m._id:null)}return c},stop:function(l,c){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"stop",action:function(){f.stop(l)}}),f;for(var p=f._getSoundIds(l),m=0;m<p.length;m++){f._clearTimer(p[m]);var v=f._soundById(p[m]);v&&(v._seek=v._start||0,v._rateSeek=0,v._paused=!0,v._ended=!0,f._stopFade(p[m]),v._node&&(f._webAudio?v._node.bufferSource&&(typeof v._node.bufferSource.stop>"u"?v._node.bufferSource.noteOff(0):v._node.bufferSource.stop(0),f._cleanBuffer(v._node)):(!isNaN(v._node.duration)||v._node.duration===1/0)&&(v._node.currentTime=v._start||0,v._node.pause(),v._node.duration===1/0&&f._clearSound(v._node))),c||f._emit("stop",v._id))}return f},mute:function(l,c){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"mute",action:function(){f.mute(l,c)}}),f;if(typeof c>"u")if(typeof l=="boolean")f._muted=l;else return f._muted;for(var p=f._getSoundIds(c),m=0;m<p.length;m++){var v=f._soundById(p[m]);v&&(v._muted=l,v._interval&&f._stopFade(v._id),f._webAudio&&v._node?v._node.gain.setValueAtTime(l?0:v._volume,r.ctx.currentTime):v._node&&(v._node.muted=r._muted?!0:l),f._emit("mute",v._id))}return f},volume:function(){var l=this,c=arguments,f,p;if(c.length===0)return l._volume;if(c.length===1||c.length===2&&typeof c[1]>"u"){var m=l._getSoundIds(),v=m.indexOf(c[0]);v>=0?p=parseInt(c[0],10):f=parseFloat(c[0])}else c.length>=2&&(f=parseFloat(c[0]),p=parseInt(c[1],10));var g;if(typeof f<"u"&&f>=0&&f<=1){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"volume",action:function(){l.volume.apply(l,c)}}),l;typeof p>"u"&&(l._volume=f),p=l._getSoundIds(p);for(var y=0;y<p.length;y++)g=l._soundById(p[y]),g&&(g._volume=f,c[2]||l._stopFade(p[y]),l._webAudio&&g._node&&!g._muted?g._node.gain.setValueAtTime(f,r.ctx.currentTime):g._node&&!g._muted&&(g._node.volume=f*r.volume()),l._emit("volume",g._id))}else return g=p?l._soundById(p):l._sounds[0],g?g._volume:0;return l},fade:function(l,c,f,p){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(l,c,f,p)}}),m;l=Math.min(Math.max(0,parseFloat(l)),1),c=Math.min(Math.max(0,parseFloat(c)),1),f=parseFloat(f),m.volume(l,p);for(var v=m._getSoundIds(p),g=0;g<v.length;g++){var y=m._soundById(v[g]);if(y){if(p||m._stopFade(v[g]),m._webAudio&&!y._muted){var _=r.ctx.currentTime,x=_+f/1e3;y._volume=l,y._node.gain.setValueAtTime(l,_),y._node.gain.linearRampToValueAtTime(c,x)}m._startFadeInterval(y,l,c,f,v[g],typeof p>"u")}}return m},_startFadeInterval:function(l,c,f,p,m,v){var g=this,y=c,_=f-c,x=Math.abs(_/.01),b=Math.max(4,x>0?p/x:p),T=Date.now();l._fadeTo=f,l._interval=setInterval(function(){var w=(Date.now()-T)/p;T=Date.now(),y+=_*w,y=Math.round(y*100)/100,_<0?y=Math.max(f,y):y=Math.min(f,y),g._webAudio?l._volume=y:g.volume(y,l._id,!0),v&&(g._volume=y),(f<c&&y<=f||f>c&&y>=f)&&(clearInterval(l._interval),l._interval=null,l._fadeTo=null,g.volume(f,l._id),g._emit("fade",l._id))},b)},_stopFade:function(l){var c=this,f=c._soundById(l);return f&&f._interval&&(c._webAudio&&f._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(f._interval),f._interval=null,c.volume(f._fadeTo,l),f._fadeTo=null,c._emit("fade",l)),c},loop:function(){var l=this,c=arguments,f,p,m;if(c.length===0)return l._loop;if(c.length===1)if(typeof c[0]=="boolean")f=c[0],l._loop=f;else return m=l._soundById(parseInt(c[0],10)),m?m._loop:!1;else c.length===2&&(f=c[0],p=parseInt(c[1],10));for(var v=l._getSoundIds(p),g=0;g<v.length;g++)m=l._soundById(v[g]),m&&(m._loop=f,l._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=f,f&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,l.playing(v[g])&&(l.pause(v[g],!0),l.play(v[g],!0)))));return l},rate:function(){var l=this,c=arguments,f,p;if(c.length===0)p=l._sounds[0]._id;else if(c.length===1){var m=l._getSoundIds(),v=m.indexOf(c[0]);v>=0?p=parseInt(c[0],10):f=parseFloat(c[0])}else c.length===2&&(f=parseFloat(c[0]),p=parseInt(c[1],10));var g;if(typeof f=="number"){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"rate",action:function(){l.rate.apply(l,c)}}),l;typeof p>"u"&&(l._rate=f),p=l._getSoundIds(p);for(var y=0;y<p.length;y++)if(g=l._soundById(p[y]),g){l.playing(p[y])&&(g._rateSeek=l.seek(p[y]),g._playStart=l._webAudio?r.ctx.currentTime:g._playStart),g._rate=f,l._webAudio&&g._node&&g._node.bufferSource?g._node.bufferSource.playbackRate.setValueAtTime(f,r.ctx.currentTime):g._node&&(g._node.playbackRate=f);var _=l.seek(p[y]),x=(l._sprite[g._sprite][0]+l._sprite[g._sprite][1])/1e3-_,b=x*1e3/Math.abs(g._rate);(l._endTimers[p[y]]||!g._paused)&&(l._clearTimer(p[y]),l._endTimers[p[y]]=setTimeout(l._ended.bind(l,g),b)),l._emit("rate",g._id)}}else return g=l._soundById(p),g?g._rate:l._rate;return l},seek:function(){var l=this,c=arguments,f,p;if(c.length===0)l._sounds.length&&(p=l._sounds[0]._id);else if(c.length===1){var m=l._getSoundIds(),v=m.indexOf(c[0]);v>=0?p=parseInt(c[0],10):l._sounds.length&&(p=l._sounds[0]._id,f=parseFloat(c[0]))}else c.length===2&&(f=parseFloat(c[0]),p=parseInt(c[1],10));if(typeof p>"u")return 0;if(typeof f=="number"&&(l._state!=="loaded"||l._playLock))return l._queue.push({event:"seek",action:function(){l.seek.apply(l,c)}}),l;var g=l._soundById(p);if(g)if(typeof f=="number"&&f>=0){var y=l.playing(p);y&&l.pause(p,!0),g._seek=f,g._ended=!1,l._clearTimer(p),!l._webAudio&&g._node&&!isNaN(g._node.duration)&&(g._node.currentTime=f);var _=function(){y&&l.play(p,!0),l._emit("seek",p)};if(y&&!l._webAudio){var x=function(){l._playLock?setTimeout(x,0):_()};setTimeout(x,0)}else _()}else if(l._webAudio){var b=l.playing(p)?r.ctx.currentTime-g._playStart:0,T=g._rateSeek?g._rateSeek-g._seek:0;return g._seek+(T+b*Math.abs(g._rate))}else return g._node.currentTime;return l},playing:function(l){var c=this;if(typeof l=="number"){var f=c._soundById(l);return f?!f._paused:!1}for(var p=0;p<c._sounds.length;p++)if(!c._sounds[p]._paused)return!0;return!1},duration:function(l){var c=this,f=c._duration,p=c._soundById(l);return p&&(f=c._sprite[p._sprite][1]/1e3),f},state:function(){return this._state},unload:function(){for(var l=this,c=l._sounds,f=0;f<c.length;f++)c[f]._paused||l.stop(c[f]._id),l._webAudio||(l._clearSound(c[f]._node),c[f]._node.removeEventListener("error",c[f]._errorFn,!1),c[f]._node.removeEventListener(r._canPlayEvent,c[f]._loadFn,!1),c[f]._node.removeEventListener("ended",c[f]._endFn,!1),r._releaseHtml5Audio(c[f]._node)),delete c[f]._node,l._clearTimer(c[f]._id);var p=r._howls.indexOf(l);p>=0&&r._howls.splice(p,1);var m=!0;for(f=0;f<r._howls.length;f++)if(r._howls[f]._src===l._src||l._src.indexOf(r._howls[f]._src)>=0){m=!1;break}return s&&m&&delete s[l._src],r.noAudio=!1,l._state="unloaded",l._sounds=[],l=null,null},on:function(l,c,f,p){var m=this,v=m["_on"+l];return typeof c=="function"&&v.push(p?{id:f,fn:c,once:p}:{id:f,fn:c}),m},off:function(l,c,f){var p=this,m=p["_on"+l],v=0;if(typeof c=="number"&&(f=c,c=null),c||f)for(v=0;v<m.length;v++){var g=f===m[v].id;if(c===m[v].fn&&g||!c&&g){m.splice(v,1);break}}else if(l)p["_on"+l]=[];else{var y=Object.keys(p);for(v=0;v<y.length;v++)y[v].indexOf("_on")===0&&Array.isArray(p[y[v]])&&(p[y[v]]=[])}return p},once:function(l,c,f){var p=this;return p.on(l,c,f,1),p},_emit:function(l,c,f){for(var p=this,m=p["_on"+l],v=m.length-1;v>=0;v--)(!m[v].id||m[v].id===c||l==="load")&&(setTimeout((function(g){g.call(this,c,f)}).bind(p,m[v].fn),0),m[v].once&&p.off(l,m[v].fn,m[v].id));return p._loadQueue(l),p},_loadQueue:function(l){var c=this;if(c._queue.length>0){var f=c._queue[0];f.event===l&&(c._queue.shift(),c._loadQueue()),l||f.action()}return c},_ended:function(l){var c=this,f=l._sprite;if(!c._webAudio&&l._node&&!l._node.paused&&!l._node.ended&&l._node.currentTime<l._stop)return setTimeout(c._ended.bind(c,l),100),c;var p=!!(l._loop||c._sprite[f][2]);if(c._emit("end",l._id),!c._webAudio&&p&&c.stop(l._id,!0).play(l._id),c._webAudio&&p){c._emit("play",l._id),l._seek=l._start||0,l._rateSeek=0,l._playStart=r.ctx.currentTime;var m=(l._stop-l._start)*1e3/Math.abs(l._rate);c._endTimers[l._id]=setTimeout(c._ended.bind(c,l),m)}return c._webAudio&&!p&&(l._paused=!0,l._ended=!0,l._seek=l._start||0,l._rateSeek=0,c._clearTimer(l._id),c._cleanBuffer(l._node),r._autoSuspend()),!c._webAudio&&!p&&c.stop(l._id,!0),c},_clearTimer:function(l){var c=this;if(c._endTimers[l]){if(typeof c._endTimers[l]!="function")clearTimeout(c._endTimers[l]);else{var f=c._soundById(l);f&&f._node&&f._node.removeEventListener("ended",c._endTimers[l],!1)}delete c._endTimers[l]}return c},_soundById:function(l){for(var c=this,f=0;f<c._sounds.length;f++)if(l===c._sounds[f]._id)return c._sounds[f];return null},_inactiveSound:function(){var l=this;l._drain();for(var c=0;c<l._sounds.length;c++)if(l._sounds[c]._ended)return l._sounds[c].reset();return new n(l)},_drain:function(){var l=this,c=l._pool,f=0,p=0;if(!(l._sounds.length<c)){for(p=0;p<l._sounds.length;p++)l._sounds[p]._ended&&f++;for(p=l._sounds.length-1;p>=0;p--){if(f<=c)return;l._sounds[p]._ended&&(l._webAudio&&l._sounds[p]._node&&l._sounds[p]._node.disconnect(0),l._sounds.splice(p,1),f--)}}},_getSoundIds:function(l){var c=this;if(typeof l>"u"){for(var f=[],p=0;p<c._sounds.length;p++)f.push(c._sounds[p]._id);return f}else return[l]},_refreshBuffer:function(l){var c=this;return l._node.bufferSource=r.ctx.createBufferSource(),l._node.bufferSource.buffer=s[c._src],l._panner?l._node.bufferSource.connect(l._panner):l._node.bufferSource.connect(l._node),l._node.bufferSource.loop=l._loop,l._loop&&(l._node.bufferSource.loopStart=l._start||0,l._node.bufferSource.loopEnd=l._stop||0),l._node.bufferSource.playbackRate.setValueAtTime(l._rate,r.ctx.currentTime),c},_cleanBuffer:function(l){var c=this,f=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(r._scratchBuffer&&l.bufferSource&&(l.bufferSource.onended=null,l.bufferSource.disconnect(0),f))try{l.bufferSource.buffer=r._scratchBuffer}catch{}return l.bufferSource=null,c},_clearSound:function(l){var c=/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent);c||(l.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(l){this._parent=l,this.init()};n.prototype={init:function(){var l=this,c=l._parent;return l._muted=c._muted,l._loop=c._loop,l._volume=c._volume,l._rate=c._rate,l._seek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++r._counter,c._sounds.push(l),l.create(),l},create:function(){var l=this,c=l._parent,f=r._muted||l._muted||l._parent._muted?0:l._volume;return c._webAudio?(l._node=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),l._node.gain.setValueAtTime(f,r.ctx.currentTime),l._node.paused=!0,l._node.connect(r.masterGain)):r.noAudio||(l._node=r._obtainHtml5Audio(),l._errorFn=l._errorListener.bind(l),l._node.addEventListener("error",l._errorFn,!1),l._loadFn=l._loadListener.bind(l),l._node.addEventListener(r._canPlayEvent,l._loadFn,!1),l._endFn=l._endListener.bind(l),l._node.addEventListener("ended",l._endFn,!1),l._node.src=c._src,l._node.preload=c._preload===!0?"auto":c._preload,l._node.volume=f*r.volume(),l._node.load()),l},reset:function(){var l=this,c=l._parent;return l._muted=c._muted,l._loop=c._loop,l._volume=c._volume,l._rate=c._rate,l._seek=0,l._rateSeek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++r._counter,l},_errorListener:function(){var l=this;l._parent._emit("loaderror",l._id,l._node.error?l._node.error.code:0),l._node.removeEventListener("error",l._errorFn,!1)},_loadListener:function(){var l=this,c=l._parent;c._duration=Math.ceil(l._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),l._node.removeEventListener(r._canPlayEvent,l._loadFn,!1)},_endListener:function(){var l=this,c=l._parent;c._duration===1/0&&(c._duration=Math.ceil(l._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(l)),l._node.removeEventListener("ended",l._endFn,!1)}};var s={},a=function(l){var c=l._src;if(s[c]){l._duration=s[c].duration,h(l);return}if(/^data:[^;]+;base64,/.test(c)){for(var f=atob(c.split(",")[1]),p=new Uint8Array(f.length),m=0;m<f.length;++m)p[m]=f.charCodeAt(m);u(p.buffer,l)}else{var v=new XMLHttpRequest;v.open(l._xhr.method,c,!0),v.withCredentials=l._xhr.withCredentials,v.responseType="arraybuffer",l._xhr.headers&&Object.keys(l._xhr.headers).forEach(function(g){v.setRequestHeader(g,l._xhr.headers[g])}),v.onload=function(){var g=(v.status+"")[0];if(g!=="0"&&g!=="2"&&g!=="3"){l._emit("loaderror",null,"Failed loading audio file with status: "+v.status+".");return}u(v.response,l)},v.onerror=function(){l._webAudio&&(l._html5=!0,l._webAudio=!1,l._sounds=[],delete s[c],l.load())},o(v)}},o=function(l){try{l.send()}catch{l.onerror()}},u=function(l,c){var f=function(){c._emit("loaderror",null,"Decoding audio data failed.")},p=function(m){m&&c._sounds.length>0?(s[c._src]=m,h(c,m)):f()};typeof Promise<"u"&&r.ctx.decodeAudioData.length===1?r.ctx.decodeAudioData(l).then(p).catch(f):r.ctx.decodeAudioData(l,p,f)},h=function(l,c){c&&!l._duration&&(l._duration=c.duration),Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue())},d=function(){if(r.usingWebAudio){try{typeof AudioContext<"u"?r.ctx=new AudioContext:typeof webkitAudioContext<"u"?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch{r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var l=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),c=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),f=c?parseInt(c[1],10):null;if(l&&f&&f<9){var p=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!p&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};t.Howler=r,t.Howl=i,typeof Ve<"u"?(Ve.HowlerGlobal=e,Ve.Howler=r,Ve.Howl=i,Ve.Sound=n):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=r,window.Howl=i,window.Sound=n)})();/*!
1981
1981
  * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
1982
1982
  *
1983
1983
  * howler.js v2.2.3
@@ -1987,4 +1987,4 @@ void main() {
1987
1987
  * goldfirestudios.com
1988
1988
  *
1989
1989
  * MIT License
1990
- */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(r){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var n=i._howls.length-1;n>=0;n--)i._howls[n].stereo(r);return i},HowlerGlobal.prototype.pos=function(r,i,n){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(i=typeof i!="number"?s._pos[1]:i,n=typeof n!="number"?s._pos[2]:n,typeof r=="number")s._pos=[r,i,n],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(r,i,n,s,a,o){var u=this;if(!u.ctx||!u.ctx.listener)return u;var h=u._orientation;if(i=typeof i!="number"?h[1]:i,n=typeof n!="number"?h[2]:n,s=typeof s!="number"?h[3]:s,a=typeof a!="number"?h[4]:a,o=typeof o!="number"?h[5]:o,typeof r=="number")u._orientation=[r,i,n,s,a,o],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(r,i,n,s,a,o);else return h;return u},Howl.prototype.init=function(r){return function(i){var n=this;return n._orientation=i.orientation||[1,0,0],n._stereo=i.stereo||null,n._pos=i.pos||null,n._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},n._onstereo=i.onstereo?[{fn:i.onstereo}]:[],n._onpos=i.onpos?[{fn:i.onpos}]:[],n._onorientation=i.onorientation?[{fn:i.onorientation}]:[],r.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(r,i){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(r,i)}}),n;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof r=="number")n._stereo=r,n._pos=[r,0,0];else return n._stereo;for(var a=n._getSoundIds(i),o=0;o<a.length;o++){var u=n._soundById(a[o]);if(u)if(typeof r=="number")u._stereo=r,u._pos=[r,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&e(u,s),s==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(r,0,0):u._panner.pan.setValueAtTime(r,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(r,i,n,s){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"pos",action:function(){a.pos(r,i,n,s)}}),a;if(i=typeof i!="number"?0:i,n=typeof n!="number"?-.5:n,typeof s>"u")if(typeof r=="number")a._pos=[r,i,n];else return a._pos;for(var o=a._getSoundIds(s),u=0;u<o.length;u++){var h=a._soundById(o[u]);if(h)if(typeof r=="number")h._pos=[r,i,n],h._node&&((!h._panner||h._panner.pan)&&e(h,"spatial"),typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setPosition(r,i,n)),a._emit("pos",h._id);else return h._pos}return a},Howl.prototype.orientation=function(r,i,n,s){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"orientation",action:function(){a.orientation(r,i,n,s)}}),a;if(i=typeof i!="number"?a._orientation[1]:i,n=typeof n!="number"?a._orientation[2]:n,typeof s>"u")if(typeof r=="number")a._orientation=[r,i,n];else return a._orientation;for(var o=a._getSoundIds(s),u=0;u<o.length;u++){var h=a._soundById(o[u]);if(h)if(typeof r=="number")h._orientation=[r,i,n],h._node&&(h._panner||(h._pos||(h._pos=a._pos||[0,0,-.5]),e(h,"spatial")),typeof h._panner.orientationX<"u"?(h._panner.orientationX.setValueAtTime(r,Howler.ctx.currentTime),h._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setOrientation(r,i,n)),a._emit("orientation",h._id);else return h._orientation}return a},Howl.prototype.pannerAttr=function(){var r=this,i=arguments,n,s,a;if(!r._webAudio)return r;if(i.length===0)return r._pannerAttr;if(i.length===1)if(typeof i[0]=="object")n=i[0],typeof s>"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),r._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:r._panningModel});else return a=r._soundById(parseInt(i[0],10)),a?a._pannerAttr:r._pannerAttr;else i.length===2&&(n=i[0],s=parseInt(i[1],10));for(var o=r._getSoundIds(s),u=0;u<o.length;u++)if(a=r._soundById(o[u]),a){var h=a._pannerAttr;h={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:h.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:h.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:h.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:h.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:h.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:h.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:h.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:h.panningModel};var d=a._panner;d?(d.coneInnerAngle=h.coneInnerAngle,d.coneOuterAngle=h.coneOuterAngle,d.coneOuterGain=h.coneOuterGain,d.distanceModel=h.distanceModel,d.maxDistance=h.maxDistance,d.refDistance=h.refDistance,d.rolloffFactor=h.rolloffFactor,d.panningModel=h.panningModel):(a._pos||(a._pos=r._pos||[0,0,-.5]),e(a,"spatial"))}return r},Sound.prototype.init=function(r){return function(){var i=this,n=i._parent;i._orientation=n._orientation,i._stereo=n._stereo,i._pos=n._pos,i._pannerAttr=n._pannerAttr,r.call(this),i._stereo?n.stereo(i._stereo):i._pos&&n.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(r){return function(){var i=this,n=i._parent;return i._orientation=n._orientation,i._stereo=n._stereo,i._pos=n._pos,i._pannerAttr=n._pannerAttr,i._stereo?n.stereo(i._stereo):i._pos?n.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,n._refreshBuffer(i)),r.call(this)}}(Sound.prototype.reset);var e=function(r,i){i=i||"spatial",i==="spatial"?(r._panner=Howler.ctx.createPanner(),r._panner.coneInnerAngle=r._pannerAttr.coneInnerAngle,r._panner.coneOuterAngle=r._pannerAttr.coneOuterAngle,r._panner.coneOuterGain=r._pannerAttr.coneOuterGain,r._panner.distanceModel=r._pannerAttr.distanceModel,r._panner.maxDistance=r._pannerAttr.maxDistance,r._panner.refDistance=r._pannerAttr.refDistance,r._panner.rolloffFactor=r._pannerAttr.rolloffFactor,r._panner.panningModel=r._pannerAttr.panningModel,typeof r._panner.positionX<"u"?(r._panner.positionX.setValueAtTime(r._pos[0],Howler.ctx.currentTime),r._panner.positionY.setValueAtTime(r._pos[1],Howler.ctx.currentTime),r._panner.positionZ.setValueAtTime(r._pos[2],Howler.ctx.currentTime)):r._panner.setPosition(r._pos[0],r._pos[1],r._pos[2]),typeof r._panner.orientationX<"u"?(r._panner.orientationX.setValueAtTime(r._orientation[0],Howler.ctx.currentTime),r._panner.orientationY.setValueAtTime(r._orientation[1],Howler.ctx.currentTime),r._panner.orientationZ.setValueAtTime(r._orientation[2],Howler.ctx.currentTime)):r._panner.setOrientation(r._orientation[0],r._orientation[1],r._orientation[2])):(r._panner=Howler.ctx.createStereoPanner(),r._panner.pan.setValueAtTime(r._stereo,Howler.ctx.currentTime)),r._panner.connect(r._node),r._paused||r._parent.pause(r._id,!0).play(r._id,!0)}})()})(hh);const Xw=t=>{const e={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=L.useState(!1),i=P.useRef(null),n=P.useRef(e),s=P.useRef(null),a=L.useRef(null),{tl:o,dragModeRef:u}=P.useContext(Et),{uniqueId:h,src:d,startAt:l,endAt:c,mute:f,speed:p,audioStartAt:m,audioEndAt:v,visible:g}=t;Oe(we.PAUSE,()=>{var T;i.current&&a.current&&((T=a.current)==null||T.pause(),n.current.isPlaying=!1)}),Oe(we.COMPLETE,()=>{m>0&&a.current&&a.current.seek(m)}),Oe(we.SCRUBBER_CLICKED,()=>{var T;i.current&&a.current&&((T=a.current)==null||T.pause(),n.current.isPlaying=!1)}),L.useEffect(()=>{a.current&&(u.current?(a.current.pause(),n.current.isPlaying=!1,n.current.isDragging=!0):n.current.isDragging=!1)},[u]);const y=(T,w)=>{o.current&&o.current.isActive()&&s.current&&s.current.isActive()&&!u.current&&a.current&&(console.log("gsap on start 0020",h,T,w),a.current.play(),n.current.isPlaying=!0)},_=()=>{var T;i.current&&((T=a.current)==null||T.stop(),n.current.isPlaying=!1,n.current.completed=!0)},x=T=>{var S,A;const w=T+((S=s.current)==null?void 0:S.time());a.current&&u.current?(a.current.seek(w),a.current.pause(),n.current.isPlaying=!1):i.current&&!n.current.isPlaying&&((A=o.current)!=null&&A.isActive())&&a.current&&(a.current.seek(w),a.current.play(),n.current.isPlaying=!0)},b=()=>{};return P.useEffect(()=>{let T=k.context(()=>{});if(i.current&&o.current){const w={duration:Number(v)-Number(m),onStart:y,onComplete:_,onStartParams:[m,v],onCompleteParams:[],onInterrupt:b,onUpdate:x,onUpdateParams:[m,v]};T=k.context(()=>{s.current=k.from(i.current,w,m),o.current.to(i.current,{alpha:1,duration:.01},l).to(i.current,{alpha:0,duration:.1},Number(c)),o.current.add(s.current,l)})}return()=>{s.current&&(s.current.kill(),k.killTweensOf(s.current)),T.revert()}},[l,c,m,v]),L.useEffect(()=>{i.current&&r(!0)},[]),L.useEffect(()=>(dr(d)||(a.current=new hh.Howl({src:[d],autoplay:!1,loop:!1,rate:p||1,volume:!f&&g?1:0,onload:()=>{console.log("loaded audio sprite"+h),n.current.loaded=!0,a.current&&(m>0&&a.current.seek(m),a.current.volume(!f&&g?1:0),a.current.rate(p||1),a.current.pause(),n.current.isPlaying=!1,n.current.completed=!1)},onend:()=>{console.log("end of playing audio sprite"+h),n.current.isPlaying=!1,n.current.completed=!0},onplay:()=>{console.log("play of playing audio sprite"+h),n.current.isPlaying=!0},onpause:()=>{console.log("pause of playing audio sprite"+h),n.current.isPlaying=!1},onstop:()=>{console.log("stop of playing audio sprite"+h),n.current.isPlaying=!1}})),()=>{a.current&&a.current.unload()}),[h,d,l,c,m,v,f,g,p]),L.useEffect(()=>{a.current&&(console.log("running updateEffect 2002",h,v),a.current.volume(!f&&g?1:0),a.current.rate(p||1),n.current.isPlaying=!0)},[f,g,p]),K.jsx(te.Container,{ref:i})};function Ww(t,e){for(var r=-1,i=t==null?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}var fh=Ww,qw=ho,Yw=as,Kw=1,Zw=2;function Qw(t,e,r,i){var n=r.length,s=n,a=!i;if(t==null)return!s;for(t=Object(t);n--;){var o=r[n];if(a&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++n<s;){o=r[n];var u=o[0],h=t[u],d=o[1];if(a&&o[2]){if(h===void 0&&!(u in t))return!1}else{var l=new qw;if(i)var c=i(h,d,u,t,e,l);if(!(c===void 0?Yw(d,h,Kw|Zw,i,l):c))return!1}}return!0}var Jw=Qw,eS=Hr;function tS(t){return t===t&&!eS(t)}var dh=tS,rS=dh,iS=Jn;function nS(t){for(var e=iS(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,rS(n)]}return e}var sS=nS;function aS(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var ph=aS,oS=Jw,lS=sS,uS=ph;function cS(t){var e=lS(t);return e.length==1&&e[0][2]?uS(e[0][0],e[0][1]):function(r){return r===t||oS(r,t,e)}}var hS=cS,fS=jr,dS=Vr,pS="[object Symbol]";function mS(t){return typeof t=="symbol"||dS(t)&&fS(t)==pS}var Bn=mS,gS=ft,vS=Bn,_S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yS=/^\w*$/;function xS(t,e){if(gS(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||vS(t)?!0:yS.test(t)||!_S.test(t)||e!=null&&t in Object(e)}var Va=xS,mh=Wn,bS="Expected a function";function Xa(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(bS);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=t.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(Xa.Cache||mh),r}Xa.Cache=mh;var TS=Xa,wS=TS,SS=500;function AS(t){var e=wS(t,function(i){return r.size===SS&&r.clear(),i}),r=e.cache;return e}var ES=AS,CS=ES,IS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,RS=/\\(\\)?/g,PS=CS(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(IS,function(r,i,n,s){e.push(n?s.replace(RS,"$1"):i||r)}),e}),MS=PS,gh=Ai,FS=fh,OS=ft,NS=Bn,kS=1/0,vh=gh?gh.prototype:void 0,_h=vh?vh.toString:void 0;function yh(t){if(typeof t=="string")return t;if(OS(t))return FS(t,yh)+"";if(NS(t))return _h?_h.call(t):"";var e=t+"";return e=="0"&&1/t==-kS?"-0":e}var LS=yh,DS=LS;function BS(t){return t==null?"":DS(t)}var US=BS,$S=ft,GS=Va,zS=MS,jS=US;function HS(t,e){return $S(t)?t:GS(t,e)?[t]:zS(jS(t))}var xh=HS,VS=Bn,XS=1/0;function WS(t){if(typeof t=="string"||VS(t))return t;var e=t+"";return e=="0"&&1/t==-XS?"-0":e}var Un=WS,qS=xh,YS=Un;function KS(t,e){e=qS(e,t);for(var r=0,i=e.length;t!=null&&r<i;)t=t[YS(e[r++])];return r&&r==i?t:void 0}var bh=KS,ZS=bh;function QS(t,e,r){var i=t==null?void 0:ZS(t,e);return i===void 0?r:i}var JS=QS;function eA(t,e){return t!=null&&e in Object(t)}var tA=eA,rA=xh,iA=Yn,nA=ft,sA=xo,aA=Zn,oA=Un;function lA(t,e,r){e=rA(e,t);for(var i=-1,n=e.length,s=!1;++i<n;){var a=oA(e[i]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++i!=n?s:(n=t==null?0:t.length,!!n&&aA(n)&&sA(a,n)&&(nA(t)||iA(t)))}var uA=lA,cA=tA,hA=uA;function fA(t,e){return t!=null&&hA(t,e,cA)}var dA=fA,pA=as,mA=JS,gA=dA,vA=Va,_A=dh,yA=ph,xA=Un,bA=1,TA=2;function wA(t,e){return vA(t)&&_A(e)?yA(xA(t),e):function(r){var i=mA(r,t);return i===void 0&&i===e?gA(r,t):pA(e,i,bA|TA)}}var SA=wA;function AA(t){return t}var EA=AA;function CA(t){return function(e){return e==null?void 0:e[t]}}var IA=CA,RA=bh;function PA(t){return function(e){return RA(e,t)}}var MA=PA,FA=IA,OA=MA,NA=Va,kA=Un;function LA(t){return NA(t)?FA(kA(t)):OA(t)}var DA=LA,BA=hS,UA=SA,$A=EA,GA=ft,zA=DA;function jA(t){return typeof t=="function"?t:t==null?$A:typeof t=="object"?GA(t)?UA(t[0],t[1]):BA(t):zA(t)}var HA=jA;function VA(t){return function(e,r,i){for(var n=-1,s=Object(e),a=i(e),o=a.length;o--;){var u=a[t?o:++n];if(r(s[u],u,s)===!1)break}return e}}var XA=VA,WA=XA,qA=WA(),YA=qA,KA=YA,ZA=Jn;function QA(t,e){return t&&KA(t,e,ZA)}var JA=QA,eE=Mi;function tE(t,e){return function(r,i){if(r==null)return r;if(!eE(r))return t(r,i);for(var n=r.length,s=e?n:-1,a=Object(r);(e?s--:++s<n)&&i(a[s],s,a)!==!1;);return r}}var rE=tE,iE=JA,nE=rE,sE=nE(iE),aE=sE,oE=aE,lE=Mi;function uE(t,e){var r=-1,i=lE(t)?Array(t.length):[];return oE(t,function(n,s,a){i[++r]=e(n,s,a)}),i}var cE=uE,hE=fh,fE=HA,dE=cE,pE=ft;function mE(t,e){var r=pE(t)?hE:dE;return r(t,fE(e))}var gE=mE;const vE=Bt(gE);var sr={},Th={},St={};Object.defineProperty(St,"__esModule",{value:!0}),St.loop=St.conditional=St.parse=void 0;var _E=function t(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i;if(Array.isArray(r))r.forEach(function(a){return t(e,a,i,n)});else if(typeof r=="function")r(e,i,n,t);else{var s=Object.keys(r)[0];Array.isArray(r[s])?(n[s]={},t(e,r[s],i,n[s])):n[s]=r[s](e,i,n,t)}return i};St.parse=_E;var yE=function(e,r){return function(i,n,s,a){r(i,n,s)&&a(i,e,n,s)}};St.conditional=yE;var xE=function(e,r){return function(i,n,s,a){for(var o=[],u=i.pos;r(i,n,s);){var h={};if(a(i,e,n,h),i.pos===u)break;u=i.pos,o.push(h)}return o}};St.loop=xE;var Se={};Object.defineProperty(Se,"__esModule",{value:!0}),Se.readBits=Se.readArray=Se.readUnsigned=Se.readString=Se.peekBytes=Se.readBytes=Se.peekByte=Se.readByte=Se.buildStream=void 0;var bE=function(e){return{data:e,pos:0}};Se.buildStream=bE;var wh=function(){return function(e){return e.data[e.pos++]}};Se.readByte=wh;var TE=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};Se.peekByte=TE;var $n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};Se.readBytes=$n;var wE=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};Se.peekBytes=wE;var SE=function(e){return function(r){return Array.from($n(e)(r)).map(function(i){return String.fromCharCode(i)}).join("")}};Se.readString=SE;var AE=function(e){return function(r){var i=$n(2)(r);return e?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};Se.readUnsigned=AE;var EE=function(e,r){return function(i,n,s){for(var a=typeof r=="function"?r(i,n,s):r,o=$n(e),u=new Array(a),h=0;h<a;h++)u[h]=o(i);return u}};Se.readArray=EE;var CE=function(e,r,i){for(var n=0,s=0;s<i;s++)n+=e[r+s]&&Math.pow(2,i-s-1);return n},IE=function(e){return function(r){for(var i=wh()(r),n=new Array(8),s=0;s<8;s++)n[7-s]=!!(i&1<<s);return Object.keys(e).reduce(function(a,o){var u=e[o];return u.length?a[o]=CE(n,u.index,u.length):a[o]=n[u.index],a},{})}};Se.readBits=IE,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=St,r=Se,i={blocks:function(c){for(var f=0,p=[],m=c.data.length,v=0,g=(0,r.readByte)()(c);g!==f&&g;g=(0,r.readByte)()(c)){if(c.pos+g>=m){var y=m-c.pos;p.push((0,r.readBytes)(y)(c)),v+=y;break}p.push((0,r.readBytes)(g)(c)),v+=g}for(var _=new Uint8Array(v),x=0,b=0;b<p.length;b++)_.set(p[b],x),x+=p[b].length;return _}},n=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===249}),s=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(l,c,f){return Math.pow(2,f.descriptor.lct.size+1)})},function(l,c,f){return f.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},i]}]},function(l){return(0,r.peekByte)()(l)===44}),a=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(c,f,p){return(0,r.readBytes)(p.text.blockSize)(c)}},i]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===1}),o=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(c,f,p){return(0,r.readString)(p.blockSize)(c)}},i]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},i]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===254}),h=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(l,c){return Math.pow(2,c.lsd.gct.size+1)})},function(l,c){return c.lsd.gct.exists}),{frames:(0,e.loop)([n,o,u,s,a],function(l){var c=(0,r.peekByte)()(l);return c===33||c===44})}],d=h;t.default=d}(Th);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.deinterlace=void 0;var RE=function(e,r){for(var i=new Array(e.length),n=e.length/r,s=function(c,f){var p=e.slice(f*r,(f+1)*r);i.splice.apply(i,[c*r,r].concat(p))},a=[0,4,2,1],o=[8,8,4,2],u=0,h=0;h<4;h++)for(var d=a[h];d<n;d+=o[h])s(d,u),u++;return i};Gn.deinterlace=RE;var zn={};Object.defineProperty(zn,"__esModule",{value:!0}),zn.lzw=void 0;var PE=function(e,r,i){var n=4096,s=-1,a=i,o,u,h,d,l,c,f,T,p,m,b,v,w,S,C,A,g=new Array(i),y=new Array(n),_=new Array(n),x=new Array(n+1);for(v=e,u=1<<v,l=u+1,o=u+2,f=s,d=v+1,h=(1<<d)-1,p=0;p<u;p++)y[p]=0,_[p]=p;var b,T,w,S,A,C;for(b=T=w=S=A=C=0,m=0;m<a;){if(S===0){if(T<d){b+=r[C]<<T,T+=8,C++;continue}if(p=b&h,b>>=d,T-=d,p>o||p==l)break;if(p==u){d=v+1,h=(1<<d)-1,o=u+2,f=s;continue}if(f==s){x[S++]=_[p],f=p,w=p;continue}for(c=p,p==o&&(x[S++]=w,p=f);p>u;)x[S++]=_[p],p=y[p];w=_[p]&255,x[S++]=w,o<n&&(y[o]=f,_[o]=w,o++,!(o&h)&&o<n&&(d++,h+=o)),f=c}S--,g[A++]=x[S],m++}for(m=A;m<a;m++)g[m]=0;return g};zn.lzw=PE,Object.defineProperty(sr,"__esModule",{value:!0}),sr.decompressFrames=sr.decompressFrame=sr.parseGIF=void 0;var ME=LE(Th),FE=St,OE=Se,NE=Gn,kE=zn;function LE(t){return t&&t.__esModule?t:{default:t}}var DE=function(e){var r=new Uint8Array(e);return(0,FE.parse)((0,OE.buildStream)(r),ME.default)};sr.parseGIF=DE;var BE=function(e){for(var r=e.pixels.length,i=new Uint8ClampedArray(r*4),n=0;n<r;n++){var s=n*4,a=e.pixels[n],o=e.colorTable[a]||[0,0,0];i[s]=o[0],i[s+1]=o[1],i[s+2]=o[2],i[s+3]=a!==e.transparentIndex?255:0}return i},Sh=function(e,r,i){if(!e.image){console.warn("gif frame does not have associated image.");return}var n=e.image,s=n.descriptor.width*n.descriptor.height,a=(0,kE.lzw)(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(a=(0,NE.deinterlace)(a,n.descriptor.width));var o={pixels:a,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=r,e.gce&&(o.delay=(e.gce.delay||10)*10,o.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(o.transparentIndex=e.gce.transparentColorIndex)),i&&(o.patch=BE(o)),o};sr.decompressFrame=Sh;var UE=function(e,r){return e.frames.filter(function(i){return i.image}).map(function(i){return Sh(i,e.gct,r)})};sr.decompressFrames=UE;const Ah=(t,e={})=>{typeof e=="function"&&(e=e(t));const r=e.loaded&&t.loaded!==e.loaded,{playing:i,...n}=e,s={...t,...n};return r&&Object.assign(s,{playing:s.autoPlay&&s.loaded}),(e.delays!=null||e.frames!=null)&&Object.assign(s,{length:s.frames.length}),(e.index!=null||e.frames!=null)&&Object.assign(s,{index:s.length===0?0:(s.length+s.index)%s.length}),e.playing!=null&&Object.assign(s,s.loaded?{playing:i}:{autoPlay:i}),s},$E=t=>Ah({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},t),GE=t=>P.useReducer(Ah,t,$E);var zE='function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n';function jE(t){const e=new Blob([zE],{type:"application/javascript"}),r=URL.createObjectURL(e),i=new Worker(r,t);return URL.revokeObjectURL(r),i}const HE=t=>({...t,frames:t.frames.map(e=>{const r=new ImageData(t.width,t.height);return r.data.set(new Uint8ClampedArray(e)),r})}),VE=(t,e)=>{const r={};return()=>(r.instance||(r.instance=t()),P.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(e&&e(r.instance),delete r.instance,delete r.timeout)})}),[r,e]),r.instance)},XE=t=>{const e=P.useRef(t);return P.useEffect(()=>{e.current=t},[t]),e},WE=t=>{const e=XE(t);return P.useCallback(r=>e.current&&e.current(r),[])},qE=VE(()=>new jE,t=>t.terminate()),YE=(t,e)=>{const r=WE(e),i=qE();P.useEffect(()=>{if(typeof t=="string"){const n=s=>{const a=s.data||s;if(a.src===t){const o=a.error?a:HE(a);r(o)}};return i.addEventListener("message",n),i.postMessage({src:t,type:"parse"}),()=>{i.postMessage({src:t,type:"cancel"}),i.removeEventListener("message",n)}}},[i,t])},KE=({isPlaying:t,forwardRef:e,...r})=>{const i=L.useRef(null);return L.useImperativeHandle(e,()=>i.current,[i]),L.useEffect(()=>{if(i.current===null)return;const n=i.current;n[t?"gotoAndPlay":"gotoAndStop"](n.currentFrame)},[t]),K.jsx(te.AnimatedSprite,{ref:i,...r,isPlaying:t})},Eh=L.memo(KE),ZE={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0,currentFrame:0},QE=L.forwardRef((t,e)=>{const[r,i]=L.useState(0),[n,s]=L.useState([]),[,a]=P.useState(!1),o=P.useRef(null),u=P.useRef(null),h=P.useRef(ZE),d=P.useRef(),[l,c]=GE({autoPlay:!1}),{tl:f}=P.useContext(Et),{src:p,uniqueId:m,startAt:v,endAt:g,frameStartAt:y,frameEndAt:_,loop:x,visible:b,disabled:T,transformation:{width:w=0,height:S=0,x:A,y:C,colorCorrection:F={}},pointerdown:z}=t,{frames:I,delays:E}=l;YE(p,c);const{temperatureFilter:B,sharpnessFilter:U,hueFilter:R,blurFilter:$,adjustmentFilter:X,vignetteFilter:M,noiseFilter:O}=rr(F),{blurRadius:H=0,vignette:V=0,noise:W=0}=F,ne=.1;L.useEffect(()=>{if(!dr(I)){const G=vE(I,Y=>{const{data:me,width:De,height:Be}=Y,ct=new Uint8Array(me);return Ge.Texture.fromBuffer(ct,De,Be)}).map((Y,me)=>({texture:Y,time:E[me]}));s(G);let q=0;E.forEach(Y=>{q+=Y}),i(q/1e3),h.current.totalDuration=q,h.current.totalFrames=I.length}},[m,I,E]);const oe=()=>{o.current&&(o.current.stop(),h.current.isPlaying=!1)},ce=()=>{if(o.current&&d.current){const de=d.current.time();let G=de===0?0:de/ne;G=isNaN(G)?0:G;const q=h.current.totalFrames;G=G>q?q:G,G=Math.round(G),G>=q?(o.current.gotoAndStop(0),h.current.isPlaying=!1):(o.current.currentFrame=G,h.current.isPlaying=!0)}},ve=()=>{a(!0)};return P.useEffect(()=>{let de=k.context(()=>{});if(u.current&&f.current&&r>0){const G={duration:Number(r),onInterrupt:oe,onUpdate:ce,onUpdateParams:[y,_]},q=Number(g)-Number(v),Y=Math.max(0,Math.floor(q/r)-1);d.current&&d.current.kill(),de=k.context(()=>{d.current=k.timeline({repeat:x?Y:0,repeatDelay:0}).from(u.current,G,y),f.current.add(d.current,v)})}return()=>{d.current&&(d.current.kill(),k.killTweensOf(d.current)),de.revert()}},[p,m,v,g,y,_,r,x]),K.jsx(Gt,{...t,ref:e,ignoreTlForVideo:!0,isGif:!0,children:K.jsx(te.Container,{ref:u,children:!dr(n)&&K.jsx(Eh,{x:A,y:C,width:w,height:S,animationSpeed:1,alpha:b?1:0,loop:x,textures:n,onComplete:ve,anchor:.5,forwardRef:o,...!T&&b&&{interactive:!0,pointerdown:z},filters:[B,U,R,X,...H>0?[$]:[],...V>0?[M]:[],...W>0?[O]:[]]})})})}),JE=L.forwardRef((t,e)=>{const i=P.useRef(null),n=P.useRef(0),s=P.useRef(null),a=P.useRef(null),o=P.useRef(16),u=P.useRef(null),{visible:h,text:d,disabled:l,transformation:c,pointerdown:f,onDobuleClick:p}=t,{x:m,y:v,fontFamily:g="Arial",fontWeight:y="normal",fontStyle:_="normal",fontSize:x=16,fontVariant:b="normal",fill:T="black",stroke:w,strokeThickness:S=0,blurRadius:A=0,blurEnabled:C=!1,dropShadowColor:F=null,dropShadow:z=!1,dropShadowBlur:I=0,wordWrapWidth:E=5e7,leading:B=0,letterSpacing:U,colorCorrection:R={}}=c,{temperatureFilter:$,sharpnessFilter:X,hueFilter:M,blurFilter:O,adjustmentFilter:H}=rr(R),{blurRadius:V=0}=R;L.useEffect(()=>{o.current=Number(x)},[x]);const W=["italic","oblique"].includes(_)?_:void 0,ne=["small-caps"].includes(b),oe=["bold","bolder","lighter","100","200","300"].includes(y)?y:void 0,ce=Number(U)>0?U:void 0,ve=L.useMemo(()=>new Ge.TextStyle({fontFamily:g,fontSize:x,fill:T||"white",...w&&S>0&&{stroke:w,strokeThickness:S},...W&&{fontStyle:W},...ne&&{fontVariant:ne},...oe&&{fontWeight:oe},...ce&&{letterSpacing:ce},...C&&{dropShadow:!0,dropShadowBlur:Number(A),dropShadowColor:(F==null?void 0:F.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},...z&&{dropShadow:!0,dropShadowBlur:Number(I),dropShadowColor:(F==null?void 0:F.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},wordWrap:!0,breakWords:!0,wordWrapWidth:E||500,leading:B||0}),[C,A,T,g,x,_,B,W,oe,ne,ce,F,w,S,E,z,I]);L.useEffect(()=>{u.current={...c}},[c]);const de=()=>{const q=new Date().getTime();q-n.current<300&&p?p():f&&f(),n.current=q},G=()=>{!l&&p&&p()};return K.jsx(Gt,{...t,ref:e,isText:!0,onDoubleClick:G,children:K.jsx(te.Container,{ref:i,children:K.jsx(te.Container,{alpha:1,ref:a,children:K.jsx(te.Text,{style:ve,x:m,y:v,anchor:.5,text:d,alpha:h?1:0,...h&&!l&&{interactive:!0,buttonMode:!0,pointerdown:de},ref:s,filters:[$,X,M,H,...V>0?[O]:[]]})})})})});var eC=ht,tC=function(){return eC.Date.now()},rC=tC,iC=/\s/;function nC(t){for(var e=t.length;e--&&iC.test(t.charAt(e)););return e}var sC=nC,aC=sC,oC=/^\s+/;function lC(t){return t&&t.slice(0,aC(t)+1).replace(oC,"")}var uC=lC,cC=uC,Ch=Hr,hC=Bn,Ih=0/0,fC=/^[-+]0x[0-9a-f]+$/i,dC=/^0b[01]+$/i,pC=/^0o[0-7]+$/i,mC=parseInt;function gC(t){if(typeof t=="number")return t;if(hC(t))return Ih;if(Ch(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ch(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=cC(t);var r=dC.test(t);return r||pC.test(t)?mC(t.slice(2),r?2:8):fC.test(t)?Ih:+t}var vC=gC,_C=Hr,Wa=rC,Rh=vC,yC="Expected a function",xC=Math.max,bC=Math.min;function TC(t,e,r){var i,n,s,a,o,u,h=0,d=!1,l=!1,c=!0;if(typeof t!="function")throw new TypeError(yC);e=Rh(e)||0,_C(r)&&(d=!!r.leading,l="maxWait"in r,s=l?xC(Rh(r.maxWait)||0,e):s,c="trailing"in r?!!r.trailing:c);function f(T){var w=i,S=n;return i=n=void 0,h=T,a=t.apply(S,w),a}function p(T){return h=T,o=setTimeout(g,e),d?f(T):a}function m(T){var w=T-u,S=T-h,A=e-w;return l?bC(A,s-S):A}function v(T){var w=T-u,S=T-h;return u===void 0||w>=e||w<0||l&&S>=s}function g(){var T=Wa();if(v(T))return y(T);o=setTimeout(g,m(T))}function y(T){return o=void 0,c&&i?f(T):(i=n=void 0,a)}function _(){o!==void 0&&clearTimeout(o),h=0,i=u=n=o=void 0}function x(){return o===void 0?a:y(Wa())}function b(){var T=Wa(),w=v(T);if(i=arguments,n=this,u=T,w){if(o===void 0)return p(u);if(l)return clearTimeout(o),o=setTimeout(g,e),f(u)}return o===void 0&&(o=setTimeout(g,e)),a}return b.cancel=_,b.flush=x,b}var wC=TC;const jn=Bt(wC),qa=(t,e,r,i)=>{const n=P.useCallback(jn(t,i),[t,i]),s=P.useCallback(jn(e,i),[e,i]),a=P.useCallback(jn(r,i),[r,i]),o=P.useCallback(()=>{n()},[n]),u=P.useCallback(()=>{s()},[s]),h=P.useCallback(()=>{a()},[a]);return{onPointerOver:o,onPointerDown:u,onPointerOut:h}},SC={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,isStalled:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,timeDiff:0},Ph=L.forwardRef((t,e)=>{const[r,i]=L.useState(0),[n,s]=L.useState(),a=P.useRef(null),o=P.useRef(null),u=P.useRef(null),h=P.useRef(SC),d=P.useRef(),{uniqueId:l,mute:c=!1,src:f,startAt:p,endAt:m,frameStartAt:v,frameEndAt:g,visible:y,disabled:_,transformation:{x,y:b,width:T,height:w,animation:S,colorCorrection:A={}},pointerdown:C=()=>{},pointerout:F=()=>{},pointerover:z=()=>{},fps:I=0}=t,{tl:E,dragModeRef:B,isRemotion:U}=P.useContext(Et),{onPointerDown:R,onPointerOut:$,onPointerOver:X}=qa(z,C,F,1),{blurRadius:M=0,vignette:O=0,noise:H=0}=A,{temperatureFilter:V,sharpnessFilter:W,hueFilter:ne,blurFilter:oe,adjustmentFilter:ce,vignetteFilter:ve,noiseFilter:de}=rr(A),G=f||"",q=L.useMemo(()=>{const Q=document.createElement("video");return Q.src=f,Q.crossOrigin="Anonymus",Q.autoplay=!1,Q.currentTime=v===0?.001:v,Q},[f,v]);Oe(we.PAUSE,()=>{u.current&&(u.current.pause(),h.current.isPlaying=!1)}),Oe(we.SCRUBBER_CLICKED,()=>{u.current&&(u.current.pause(),h.current.isPlaying=!1)}),Oe(we.REVERSE_MODE_END,()=>{u.current&&(u.current.pause(),h.current.isPlaying=!1)});const Y=L.useCallback(jn(()=>{if(u.current){const Q=u.current;Q.currentTime>0&&!Q.paused&&!Q.ended&&Q.readyState>Q.HAVE_CURRENT_DATA&&u.current.pause(),h.current.isPlaying=!1}},400),[u]);L.useEffect(()=>{u.current&&!U?(B.current?(Y(),h.current.isPlaying=!1,h.current.isDragging=!0):h.current.isDragging=!1,u.current.muted=c):h.current.isDragging=!1,h.current.isMuted=c},[c,B,Y,u]);const me=Q=>{if(u.current){if(u.current.currentTime=Number(Q),!B.current){const he=u.current,Me=he.currentTime>0&&!he.paused&&!he.ended&&he.readyState>he.HAVE_CURRENT_DATA;E.current&&E.current.isActive()&&d.current&&d.current.isActive()&&(Me||u.current.play(),h.current.isPlaying=!0,i($r=>$r+1))}h.current.progress=0}},De=()=>{if(u.current){const Q=u.current;Q.currentTime>0&&!Q.paused&&!Q.ended&&Q.readyState>Q.HAVE_CURRENT_DATA&&u.current.pause(),h.current.isPlaying=!1,d.current&&(h.current.progress=d.current.progress())}},Be=()=>{},ct=()=>{var Q,he;if(d.current&&(h.current.progress=d.current.progress()),u.current&&d.current){const Me=v+((Q=d==null?void 0:d.current)==null?void 0:Q.time()),$r=Math.abs(u.current.currentTime-Me),Dt=u.current,Gr=Dt.currentTime>0&&!Dt.paused&&!Dt.ended&&Dt.readyState>Dt.HAVE_CURRENT_DATA;B.current?(u.current.currentTime=Me,setTimeout(()=>{u.current&&u.current.play().then(()=>{h.current.isPlaying=!1,u.current&&u.current.pause()})},100),h.current.isPlaying=!1):(Gr!==h.current.isPlaying||!Gr)&&h.current.progress>.01&&h.current.progress<.99?(he=E.current)!=null&&he.isActive()&&d.current&&d.current.isActive()&&(Gr||u.current.play(),h.current.isPlaying=!0):$r>.3&&h.current.progress>.01&&h.current.progress<.99&&(u.current.currentTime=Me)}};return P.useEffect(()=>{let Q=k.context(()=>{});if(o.current&&E.current){const he={duration:Number(g)-Number(v),onStart:me,onComplete:De,onStartParams:[v,g],onCompleteParams:[],onInterrupt:Be,onUpdate:ct,onUpdateParams:[v,g],onPause:()=>{console.log("onPause video sprite pause",l)},onResume:()=>{console.log("onResume video sprite resume",l)},onReverseComplete:()=>{console.log("onReverseComplete video sprite reverse complete",l)},onKill:()=>{console.log("onKill video sprite kill",l)}};Q=k.context(()=>{d.current=k.from(o.current,he,v),E.current.add(d.current,p)})}return()=>{d.current&&(d.current.kill(),k.killTweensOf(d.current)),Q.revert()}},[S,p,m,v,g]),L.useEffect(()=>{u.current&&(u.current.muted=c,h.current.isMuted=c);const Q=setTimeout(()=>{u.current&&(u.current.muted=c,h.current.isMuted=c)},1500);return()=>{clearTimeout(Q)}},[c]),L.useEffect(()=>{const Q=Math.round((Number(v)+Number.EPSILON)*100)/100,he=function(){u.current&&(u.current.currentTime=Q,u.current.muted=c)},Me=function(){if(u.current){const At=u.current;At.currentTime>0&&!At.paused&&!At.ended&&At.readyState>At.HAVE_CURRENT_DATA&&u.current.pause()}h.current.isWaiting=!1,h.current.isStalled=!1},$r=function(){u.current&&u.current.pause(),h.current.isWaiting=!0,h.current.isStalled=!1},Dt=function(){h.current.isWaiting=!1,h.current.isStalled=!1},Gr=function(){h.current.isWaiting=!1,h.current.isStalled=!0},RC=Math.round((Number(v)+Number.EPSILON)*100)/100,PC=Math.round((Number(g)+Number.EPSILON)*100)/100,MC=`${G}#t=${RC},${PC}`;return Ge.Texture.fromLoader(q,MC,l,{pixiIdPrefix:l,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:I?Math.max(120,Number(I)):30}}).then(At=>{At&&(s(At),u.current=At.baseTexture.resource.source,u.current.id=l,u.current.addEventListener("loadedmetadata",he),u.current.addEventListener("ended",Me),u.current.addEventListener("loadstart",$r),u.current.addEventListener("canplaythrough",Dt),u.current.addEventListener("stalled",Gr))}),()=>{u.current&&(u.current.pause(),u.current.removeEventListener("loadedmetadata",he),u.current.removeEventListener("ended",Me),u.current.removeEventListener("loadstart",$r),u.current.removeEventListener("canplaythrough",Dt),u.current.removeEventListener("stalled",Gr))}},[G,l,v,g,q]),L.useEffect(()=>{const Q=setTimeout(()=>{n&&d.current&&E.current&&d.current.progress()<.1&&u.current&&!d.current.isActive()&&!U&&u.current.play().then(()=>{h.current.isPlaying=!1,u.current&&u.current.pause()})},30);return()=>{clearTimeout(Q)}},[n]),L.useEffect(()=>{E.current&&!E.current.isActive()&&!U&&(h.current.isPlaying=!1,u.current&&u.current.pause());const Q=setTimeout(()=>{if(n&&E.current&&r>0&&!U){E.current.isActive()||(h.current.isPlaying=!1,u.current&&u.current.pause());const he=u.current;he&&E.current.isActive()&&d.current&&d.current.isActive()&&(he.currentTime>0&&!he.paused&&!he.ended&&he.readyState>he.HAVE_CURRENT_DATA||u.current.play(),h.current.isPlaying=!0)}},10);return()=>{clearTimeout(Q)}},[r,n]),K.jsx(Gt,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:R,pointerover:X,pointerout:$,children:K.jsx(te.Container,{ref:o,children:n&&K.jsx(te.Sprite,{texture:n,width:T,height:w,anchor:.5,x,y:b,ref:a,alpha:y?1:0,...!_&&y&&{interactive:!0,pointerdown:C},filters:[V,W,ne,ce,...M>0?[oe]:[],...O>0?[ve]:[],...H>0?[de]:[]]})})})});Ph.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const AC=L.forwardRef((t,e)=>{const[r,i]=L.useState(),n=P.useRef(null),s=P.useRef(null),{visible:a,disabled:o,transformation:{x:u,y:h,width:d,height:l,colorCorrection:c={}},pointerdown:f=()=>{},pointerout:p=()=>{},pointerover:m=()=>{},canvasImageRef:v}=t,g=v&&(v==null?void 0:v.getCanvas()),y=te.useApp(),{onPointerDown:_,onPointerOut:x,onPointerOver:b}=qa(m,f,p,1),{blurRadius:T=0,vignette:w=0,noise:S=0}=c,{temperatureFilter:A,sharpnessFilter:C,hueFilter:F,blurFilter:z,adjustmentFilter:I,vignetteFilter:E,noiseFilter:B}=rr(c);return te.useTick(()=>{if(n.current&&n.current.texture){const U=n.current.texture.baseTexture;U&&U.update(),s.current&&y.renderer.render(s.current)}}),L.useEffect(()=>{if(!dr(g)){const U=Ge.Texture.from(g);i(U)}},[g]),K.jsx(Gt,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:_,pointerover:b,pointerout:x,children:K.jsx(te.Container,{ref:s,children:r&&K.jsx(te.Sprite,{texture:r,width:d,height:l,anchor:.5,x:u,y:h,ref:n,alpha:a?1:0,...!o&&a&&{interactive:!0,pointerdown:f},filters:[A,C,F,I,...T>0?[z]:[],...w>0?[E]:[],...S>0?[B]:[]]})})})}),EC=t=>{const{startAt:e,endAt:r,uniqueId:i}=t,n=P.useRef(null),s=P.useRef(null),a=P.useRef(null),o=P.useRef(null),{tl:u,totalDuration:h=0,playerTimeRef:d}=P.useContext(Et);return console.log("playerTimerRef",d.current),L.useEffect(()=>{const l=k.context(()=>{var c;if(n.current&&u.current){o.current&&(o.current.kill(),u.current.remove(o.current));const f=e<.2?1:0;o.current=k.timeline().set(n.current,{alpha:f}).to(n.current,{pixi:{alpha:1,eventMode:"static"},duration:Number(r)-Number(e)}).set(n.current,{alpha:0,eventMode:"none"}),u.current.add([o.current],e),console.log("start tween current progress 003",(c=n==null?void 0:n.current)==null?void 0:c.alpha)}});return()=>{o.current&&(u.current.remove(o.current),o.current.progress(0).kill()),l.revert()}},[e,r,h,i]),K.jsx(te.Container,{ref:n,alpha:e<.2?1:0,eventMode:e<.2?"static":"none",children:K.jsx(te.Container,{ref:a,children:K.jsx(te.Container,{ref:s,alpha:1,children:t.children})})})},CC=t=>{const{startAt:e,endAt:r}=t,{setTotalDuration:i}=P.useContext(Et);return L.useEffect(()=>{i&&i(Number(r)+.2)},[e,r]),t.children},IC=L.forwardRef((t,e)=>{const[r,i]=L.useState(),n=P.useRef(null),s=P.useRef(null),{visible:a,disabled:o,transformation:{x:u,y:h,width:d,height:l,colorCorrection:c={}},pointerdown:f=()=>{},pointerout:p=()=>{},pointerover:m=()=>{},canvasImageRef:v}=t,g=v&&(v==null?void 0:v.getCanvas()),y=te.useApp(),{onPointerDown:_,onPointerOut:x,onPointerOver:b}=qa(m,f,p,1),{blurRadius:T=0,vignette:w=0,noise:S=0}=c,{temperatureFilter:A,sharpnessFilter:C,hueFilter:F,blurFilter:z,adjustmentFilter:I,vignetteFilter:E,noiseFilter:B}=rr(c);return te.useTick(()=>{if(n.current&&n.current.texture){const U=n.current.texture.baseTexture;U&&U.update(),s.current&&y.renderer.render(s.current)}}),L.useEffect(()=>{if(!dr(g)){const U=Ge.Texture.from(g);i(U)}},[g]),K.jsx(Gt,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:_,pointerover:b,pointerout:x,children:K.jsx(te.Container,{ref:s,children:r&&K.jsx(te.Sprite,{texture:r,width:d,height:l,anchor:.5,x:u,y:h,ref:n,alpha:a?1:0,...!o&&a&&{interactive:!0,pointerdown:f},filters:[A,C,F,I,...T>0?[z]:[],...w>0?[E]:[],...S>0?[B]:[]]})})})});var Mh=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(Mh||{});le.Animations=hs,le.BlendModes=Mh,le.Events=we,le.GsapPixieContext=Et,le.GsapPixieContextProvider=Hh,le.PixiAnimatedSprite=Eh,le.PixiAudioSprite=Xw,le.PixiGifSprite=QE,le.PixiImageSprite=jc,le.PixiRemotionSprite=IC,le.PixiSequence=EC,le.PixiSequenceWrapper=CC,le.PixiSvgPathSprite=Vw,le.PixiTextSprite=JE,le.PixiVideoCanvasSyncSprite=AC,le.PixiVideoSprite=Ph,le.emitCustomEvent=ar,le.newCustomEventEmitter=jh,le.useCustomEventListener=Oe,le.useGsapEffect=ol,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
1990
+ */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(r){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var n=i._howls.length-1;n>=0;n--)i._howls[n].stereo(r);return i},HowlerGlobal.prototype.pos=function(r,i,n){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(i=typeof i!="number"?s._pos[1]:i,n=typeof n!="number"?s._pos[2]:n,typeof r=="number")s._pos=[r,i,n],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(r,i,n,s,a,o){var u=this;if(!u.ctx||!u.ctx.listener)return u;var h=u._orientation;if(i=typeof i!="number"?h[1]:i,n=typeof n!="number"?h[2]:n,s=typeof s!="number"?h[3]:s,a=typeof a!="number"?h[4]:a,o=typeof o!="number"?h[5]:o,typeof r=="number")u._orientation=[r,i,n,s,a,o],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(r,i,n,s,a,o);else return h;return u},Howl.prototype.init=function(r){return function(i){var n=this;return n._orientation=i.orientation||[1,0,0],n._stereo=i.stereo||null,n._pos=i.pos||null,n._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},n._onstereo=i.onstereo?[{fn:i.onstereo}]:[],n._onpos=i.onpos?[{fn:i.onpos}]:[],n._onorientation=i.onorientation?[{fn:i.onorientation}]:[],r.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(r,i){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(r,i)}}),n;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof r=="number")n._stereo=r,n._pos=[r,0,0];else return n._stereo;for(var a=n._getSoundIds(i),o=0;o<a.length;o++){var u=n._soundById(a[o]);if(u)if(typeof r=="number")u._stereo=r,u._pos=[r,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&e(u,s),s==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(r,0,0):u._panner.pan.setValueAtTime(r,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(r,i,n,s){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"pos",action:function(){a.pos(r,i,n,s)}}),a;if(i=typeof i!="number"?0:i,n=typeof n!="number"?-.5:n,typeof s>"u")if(typeof r=="number")a._pos=[r,i,n];else return a._pos;for(var o=a._getSoundIds(s),u=0;u<o.length;u++){var h=a._soundById(o[u]);if(h)if(typeof r=="number")h._pos=[r,i,n],h._node&&((!h._panner||h._panner.pan)&&e(h,"spatial"),typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setPosition(r,i,n)),a._emit("pos",h._id);else return h._pos}return a},Howl.prototype.orientation=function(r,i,n,s){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"orientation",action:function(){a.orientation(r,i,n,s)}}),a;if(i=typeof i!="number"?a._orientation[1]:i,n=typeof n!="number"?a._orientation[2]:n,typeof s>"u")if(typeof r=="number")a._orientation=[r,i,n];else return a._orientation;for(var o=a._getSoundIds(s),u=0;u<o.length;u++){var h=a._soundById(o[u]);if(h)if(typeof r=="number")h._orientation=[r,i,n],h._node&&(h._panner||(h._pos||(h._pos=a._pos||[0,0,-.5]),e(h,"spatial")),typeof h._panner.orientationX<"u"?(h._panner.orientationX.setValueAtTime(r,Howler.ctx.currentTime),h._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setOrientation(r,i,n)),a._emit("orientation",h._id);else return h._orientation}return a},Howl.prototype.pannerAttr=function(){var r=this,i=arguments,n,s,a;if(!r._webAudio)return r;if(i.length===0)return r._pannerAttr;if(i.length===1)if(typeof i[0]=="object")n=i[0],typeof s>"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),r._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:r._panningModel});else return a=r._soundById(parseInt(i[0],10)),a?a._pannerAttr:r._pannerAttr;else i.length===2&&(n=i[0],s=parseInt(i[1],10));for(var o=r._getSoundIds(s),u=0;u<o.length;u++)if(a=r._soundById(o[u]),a){var h=a._pannerAttr;h={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:h.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:h.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:h.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:h.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:h.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:h.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:h.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:h.panningModel};var d=a._panner;d?(d.coneInnerAngle=h.coneInnerAngle,d.coneOuterAngle=h.coneOuterAngle,d.coneOuterGain=h.coneOuterGain,d.distanceModel=h.distanceModel,d.maxDistance=h.maxDistance,d.refDistance=h.refDistance,d.rolloffFactor=h.rolloffFactor,d.panningModel=h.panningModel):(a._pos||(a._pos=r._pos||[0,0,-.5]),e(a,"spatial"))}return r},Sound.prototype.init=function(r){return function(){var i=this,n=i._parent;i._orientation=n._orientation,i._stereo=n._stereo,i._pos=n._pos,i._pannerAttr=n._pannerAttr,r.call(this),i._stereo?n.stereo(i._stereo):i._pos&&n.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(r){return function(){var i=this,n=i._parent;return i._orientation=n._orientation,i._stereo=n._stereo,i._pos=n._pos,i._pannerAttr=n._pannerAttr,i._stereo?n.stereo(i._stereo):i._pos?n.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,n._refreshBuffer(i)),r.call(this)}}(Sound.prototype.reset);var e=function(r,i){i=i||"spatial",i==="spatial"?(r._panner=Howler.ctx.createPanner(),r._panner.coneInnerAngle=r._pannerAttr.coneInnerAngle,r._panner.coneOuterAngle=r._pannerAttr.coneOuterAngle,r._panner.coneOuterGain=r._pannerAttr.coneOuterGain,r._panner.distanceModel=r._pannerAttr.distanceModel,r._panner.maxDistance=r._pannerAttr.maxDistance,r._panner.refDistance=r._pannerAttr.refDistance,r._panner.rolloffFactor=r._pannerAttr.rolloffFactor,r._panner.panningModel=r._pannerAttr.panningModel,typeof r._panner.positionX<"u"?(r._panner.positionX.setValueAtTime(r._pos[0],Howler.ctx.currentTime),r._panner.positionY.setValueAtTime(r._pos[1],Howler.ctx.currentTime),r._panner.positionZ.setValueAtTime(r._pos[2],Howler.ctx.currentTime)):r._panner.setPosition(r._pos[0],r._pos[1],r._pos[2]),typeof r._panner.orientationX<"u"?(r._panner.orientationX.setValueAtTime(r._orientation[0],Howler.ctx.currentTime),r._panner.orientationY.setValueAtTime(r._orientation[1],Howler.ctx.currentTime),r._panner.orientationZ.setValueAtTime(r._orientation[2],Howler.ctx.currentTime)):r._panner.setOrientation(r._orientation[0],r._orientation[1],r._orientation[2])):(r._panner=Howler.ctx.createStereoPanner(),r._panner.pan.setValueAtTime(r._stereo,Howler.ctx.currentTime)),r._panner.connect(r._node),r._paused||r._parent.pause(r._id,!0).play(r._id,!0)}})()})(uh);const Hw=t=>{const e={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=D.useState(!1),i=P.useRef(null),n=P.useRef(e),s=P.useRef(null),a=D.useRef(null),{tl:o,dragModeRef:u}=P.useContext(At),{uniqueId:h,src:d,startAt:l,endAt:c,mute:f,speed:p,audioStartAt:m,audioEndAt:v,visible:g}=t;Oe(we.PAUSE,()=>{var T;i.current&&a.current&&((T=a.current)==null||T.pause(),n.current.isPlaying=!1)}),Oe(we.COMPLETE,()=>{m>0&&a.current&&a.current.seek(m)}),Oe(we.SCRUBBER_CLICKED,()=>{var T;i.current&&a.current&&((T=a.current)==null||T.pause(),n.current.isPlaying=!1)}),D.useEffect(()=>{a.current&&(u.current?(a.current.pause(),n.current.isPlaying=!1,n.current.isDragging=!0):n.current.isDragging=!1)},[u]);const y=(T,w)=>{o.current&&o.current.isActive()&&s.current&&s.current.isActive()&&!u.current&&a.current&&(console.log("gsap on start 0020",h,T,w),a.current.play(),n.current.isPlaying=!0)},_=()=>{var T;i.current&&((T=a.current)==null||T.stop(),n.current.isPlaying=!1,n.current.completed=!0)},x=T=>{var S,A;const w=T+((S=s.current)==null?void 0:S.time());a.current&&u.current?(a.current.seek(w),a.current.pause(),n.current.isPlaying=!1):i.current&&!n.current.isPlaying&&((A=o.current)!=null&&A.isActive())&&a.current&&(a.current.seek(w),a.current.play(),n.current.isPlaying=!0)},b=()=>{};return P.useEffect(()=>{let T=k.context(()=>{});if(i.current&&o.current){const w={duration:Number(v)-Number(m),onStart:y,onComplete:_,onStartParams:[m,v],onCompleteParams:[],onInterrupt:b,onUpdate:x,onUpdateParams:[m,v]};T=k.context(()=>{s.current=k.from(i.current,w,m),o.current.to(i.current,{alpha:1,duration:.01},l).to(i.current,{alpha:0,duration:.1},Number(c)),o.current.add(s.current,l)})}return()=>{s.current&&(s.current.kill(),k.killTweensOf(s.current)),T.revert()}},[l,c,m,v]),D.useEffect(()=>{i.current&&r(!0)},[]),D.useEffect(()=>(hr(d)||(a.current=new uh.Howl({src:[d],autoplay:!1,loop:!1,rate:p||1,volume:!f&&g?1:0,onload:()=>{console.log("loaded audio sprite"+h),n.current.loaded=!0,a.current&&(m>0&&a.current.seek(m),a.current.volume(!f&&g?1:0),a.current.rate(p||1),a.current.pause(),n.current.isPlaying=!1,n.current.completed=!1)},onend:()=>{console.log("end of playing audio sprite"+h),n.current.isPlaying=!1,n.current.completed=!0},onplay:()=>{console.log("play of playing audio sprite"+h),n.current.isPlaying=!0},onpause:()=>{console.log("pause of playing audio sprite"+h),n.current.isPlaying=!1},onstop:()=>{console.log("stop of playing audio sprite"+h),n.current.isPlaying=!1}})),()=>{a.current&&a.current.unload()}),[h,d,l,c,m,v,f,g,p]),D.useEffect(()=>{a.current&&(console.log("running updateEffect 2002",h,v),a.current.volume(!f&&g?1:0),a.current.rate(p||1),n.current.isPlaying=!0)},[f,g,p]),Z.jsx(te.Container,{ref:i})};function Vw(t,e){for(var r=-1,i=t==null?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}var ch=Vw,Xw=uo,Ww=rs,qw=1,Yw=2;function Kw(t,e,r,i){var n=r.length,s=n,a=!i;if(t==null)return!s;for(t=Object(t);n--;){var o=r[n];if(a&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++n<s;){o=r[n];var u=o[0],h=t[u],d=o[1];if(a&&o[2]){if(h===void 0&&!(u in t))return!1}else{var l=new Xw;if(i)var c=i(h,d,u,t,e,l);if(!(c===void 0?Ww(d,h,qw|Yw,i,l):c))return!1}}return!0}var Zw=Kw,Qw=Gr;function Jw(t){return t===t&&!Qw(t)}var hh=Jw,eS=hh,tS=Yn;function rS(t){for(var e=tS(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,eS(n)]}return e}var iS=rS;function nS(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var fh=nS,sS=Zw,aS=iS,oS=fh;function lS(t){var e=aS(t);return e.length==1&&e[0][2]?oS(e[0][0],e[0][1]):function(r){return r===t||sS(r,t,e)}}var uS=lS,cS=$r,hS=zr,fS="[object Symbol]";function dS(t){return typeof t=="symbol"||hS(t)&&cS(t)==fS}var kn=dS,pS=ft,mS=kn,gS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vS=/^\w*$/;function _S(t,e){if(pS(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||mS(t)?!0:vS.test(t)||!gS.test(t)||e!=null&&t in Object(e)}var Ga=_S,dh=jn,yS="Expected a function";function za(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(yS);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=t.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(za.Cache||dh),r}za.Cache=dh;var xS=za,bS=xS,TS=500;function wS(t){var e=bS(t,function(i){return r.size===TS&&r.clear(),i}),r=e.cache;return e}var SS=wS,AS=SS,ES=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,CS=/\\(\\)?/g,IS=AS(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ES,function(r,i,n,s){e.push(n?s.replace(CS,"$1"):i||r)}),e}),RS=IS,ph=Ti,PS=ch,MS=ft,FS=kn,OS=1/0,mh=ph?ph.prototype:void 0,gh=mh?mh.toString:void 0;function vh(t){if(typeof t=="string")return t;if(MS(t))return PS(t,vh)+"";if(FS(t))return gh?gh.call(t):"";var e=t+"";return e=="0"&&1/t==-OS?"-0":e}var NS=vh,kS=NS;function LS(t){return t==null?"":kS(t)}var DS=LS,BS=ft,US=Ga,$S=RS,GS=DS;function zS(t,e){return BS(t)?t:US(t,e)?[t]:$S(GS(t))}var _h=zS,jS=kn,HS=1/0;function VS(t){if(typeof t=="string"||jS(t))return t;var e=t+"";return e=="0"&&1/t==-HS?"-0":e}var Ln=VS,XS=_h,WS=Ln;function qS(t,e){e=XS(e,t);for(var r=0,i=e.length;t!=null&&r<i;)t=t[WS(e[r++])];return r&&r==i?t:void 0}var yh=qS,YS=yh;function KS(t,e,r){var i=t==null?void 0:YS(t,e);return i===void 0?r:i}var ZS=KS;function QS(t,e){return t!=null&&e in Object(t)}var JS=QS,eA=_h,tA=Vn,rA=ft,iA=_o,nA=Wn,sA=Ln;function aA(t,e,r){e=eA(e,t);for(var i=-1,n=e.length,s=!1;++i<n;){var a=sA(e[i]);if(!(s=t!=null&&r(t,a)))break;t=t[a]}return s||++i!=n?s:(n=t==null?0:t.length,!!n&&nA(n)&&iA(a,n)&&(rA(t)||tA(t)))}var oA=aA,lA=JS,uA=oA;function cA(t,e){return t!=null&&uA(t,e,lA)}var hA=cA,fA=rs,dA=ZS,pA=hA,mA=Ga,gA=hh,vA=fh,_A=Ln,yA=1,xA=2;function bA(t,e){return mA(t)&&gA(e)?vA(_A(t),e):function(r){var i=dA(r,t);return i===void 0&&i===e?pA(r,t):fA(e,i,yA|xA)}}var TA=bA;function wA(t){return t}var SA=wA;function AA(t){return function(e){return e==null?void 0:e[t]}}var EA=AA,CA=yh;function IA(t){return function(e){return CA(e,t)}}var RA=IA,PA=EA,MA=RA,FA=Ga,OA=Ln;function NA(t){return FA(t)?PA(OA(t)):MA(t)}var kA=NA,LA=uS,DA=TA,BA=SA,UA=ft,$A=kA;function GA(t){return typeof t=="function"?t:t==null?BA:typeof t=="object"?UA(t)?DA(t[0],t[1]):LA(t):$A(t)}var zA=GA;function jA(t){return function(e,r,i){for(var n=-1,s=Object(e),a=i(e),o=a.length;o--;){var u=a[t?o:++n];if(r(s[u],u,s)===!1)break}return e}}var HA=jA,VA=HA,XA=VA(),WA=XA,qA=WA,YA=Yn;function KA(t,e){return t&&qA(t,e,YA)}var ZA=KA,QA=Ii;function JA(t,e){return function(r,i){if(r==null)return r;if(!QA(r))return t(r,i);for(var n=r.length,s=e?n:-1,a=Object(r);(e?s--:++s<n)&&i(a[s],s,a)!==!1;);return r}}var eE=JA,tE=ZA,rE=eE,iE=rE(tE),nE=iE,sE=nE,aE=Ii;function oE(t,e){var r=-1,i=aE(t)?Array(t.length):[];return sE(t,function(n,s,a){i[++r]=e(n,s,a)}),i}var lE=oE,uE=ch,cE=zA,hE=lE,fE=ft;function dE(t,e){var r=fE(t)?uE:hE;return r(t,cE(e))}var pE=dE;const mE=Lt(pE);var ir={},xh={},St={};Object.defineProperty(St,"__esModule",{value:!0}),St.loop=St.conditional=St.parse=void 0;var gE=function t(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i;if(Array.isArray(r))r.forEach(function(a){return t(e,a,i,n)});else if(typeof r=="function")r(e,i,n,t);else{var s=Object.keys(r)[0];Array.isArray(r[s])?(n[s]={},t(e,r[s],i,n[s])):n[s]=r[s](e,i,n,t)}return i};St.parse=gE;var vE=function(e,r){return function(i,n,s,a){r(i,n,s)&&a(i,e,n,s)}};St.conditional=vE;var _E=function(e,r){return function(i,n,s,a){for(var o=[],u=i.pos;r(i,n,s);){var h={};if(a(i,e,n,h),i.pos===u)break;u=i.pos,o.push(h)}return o}};St.loop=_E;var Se={};Object.defineProperty(Se,"__esModule",{value:!0}),Se.readBits=Se.readArray=Se.readUnsigned=Se.readString=Se.peekBytes=Se.readBytes=Se.peekByte=Se.readByte=Se.buildStream=void 0;var yE=function(e){return{data:e,pos:0}};Se.buildStream=yE;var bh=function(){return function(e){return e.data[e.pos++]}};Se.readByte=bh;var xE=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};Se.peekByte=xE;var Dn=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};Se.readBytes=Dn;var bE=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};Se.peekBytes=bE;var TE=function(e){return function(r){return Array.from(Dn(e)(r)).map(function(i){return String.fromCharCode(i)}).join("")}};Se.readString=TE;var wE=function(e){return function(r){var i=Dn(2)(r);return e?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};Se.readUnsigned=wE;var SE=function(e,r){return function(i,n,s){for(var a=typeof r=="function"?r(i,n,s):r,o=Dn(e),u=new Array(a),h=0;h<a;h++)u[h]=o(i);return u}};Se.readArray=SE;var AE=function(e,r,i){for(var n=0,s=0;s<i;s++)n+=e[r+s]&&Math.pow(2,i-s-1);return n},EE=function(e){return function(r){for(var i=bh()(r),n=new Array(8),s=0;s<8;s++)n[7-s]=!!(i&1<<s);return Object.keys(e).reduce(function(a,o){var u=e[o];return u.length?a[o]=AE(n,u.index,u.length):a[o]=n[u.index],a},{})}};Se.readBits=EE,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=St,r=Se,i={blocks:function(c){for(var f=0,p=[],m=c.data.length,v=0,g=(0,r.readByte)()(c);g!==f&&g;g=(0,r.readByte)()(c)){if(c.pos+g>=m){var y=m-c.pos;p.push((0,r.readBytes)(y)(c)),v+=y;break}p.push((0,r.readBytes)(g)(c)),v+=g}for(var _=new Uint8Array(v),x=0,b=0;b<p.length;b++)_.set(p[b],x),x+=p[b].length;return _}},n=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===249}),s=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(l,c,f){return Math.pow(2,f.descriptor.lct.size+1)})},function(l,c,f){return f.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},i]}]},function(l){return(0,r.peekByte)()(l)===44}),a=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(c,f,p){return(0,r.readBytes)(p.text.blockSize)(c)}},i]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===1}),o=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(c,f,p){return(0,r.readString)(p.blockSize)(c)}},i]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},i]},function(l){var c=(0,r.peekBytes)(2)(l);return c[0]===33&&c[1]===254}),h=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(l,c){return Math.pow(2,c.lsd.gct.size+1)})},function(l,c){return c.lsd.gct.exists}),{frames:(0,e.loop)([n,o,u,s,a],function(l){var c=(0,r.peekByte)()(l);return c===33||c===44})}],d=h;t.default=d}(xh);var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.deinterlace=void 0;var CE=function(e,r){for(var i=new Array(e.length),n=e.length/r,s=function(c,f){var p=e.slice(f*r,(f+1)*r);i.splice.apply(i,[c*r,r].concat(p))},a=[0,4,2,1],o=[8,8,4,2],u=0,h=0;h<4;h++)for(var d=a[h];d<n;d+=o[h])s(d,u),u++;return i};Bn.deinterlace=CE;var Un={};Object.defineProperty(Un,"__esModule",{value:!0}),Un.lzw=void 0;var IE=function(e,r,i){var n=4096,s=-1,a=i,o,u,h,d,l,c,f,T,p,m,b,v,w,S,I,A,g=new Array(i),y=new Array(n),_=new Array(n),x=new Array(n+1);for(v=e,u=1<<v,l=u+1,o=u+2,f=s,d=v+1,h=(1<<d)-1,p=0;p<u;p++)y[p]=0,_[p]=p;var b,T,w,S,A,I;for(b=T=w=S=A=I=0,m=0;m<a;){if(S===0){if(T<d){b+=r[I]<<T,T+=8,I++;continue}if(p=b&h,b>>=d,T-=d,p>o||p==l)break;if(p==u){d=v+1,h=(1<<d)-1,o=u+2,f=s;continue}if(f==s){x[S++]=_[p],f=p,w=p;continue}for(c=p,p==o&&(x[S++]=w,p=f);p>u;)x[S++]=_[p],p=y[p];w=_[p]&255,x[S++]=w,o<n&&(y[o]=f,_[o]=w,o++,!(o&h)&&o<n&&(d++,h+=o)),f=c}S--,g[A++]=x[S],m++}for(m=A;m<a;m++)g[m]=0;return g};Un.lzw=IE,Object.defineProperty(ir,"__esModule",{value:!0}),ir.decompressFrames=ir.decompressFrame=ir.parseGIF=void 0;var RE=NE(xh),PE=St,ME=Se,FE=Bn,OE=Un;function NE(t){return t&&t.__esModule?t:{default:t}}var kE=function(e){var r=new Uint8Array(e);return(0,PE.parse)((0,ME.buildStream)(r),RE.default)};ir.parseGIF=kE;var LE=function(e){for(var r=e.pixels.length,i=new Uint8ClampedArray(r*4),n=0;n<r;n++){var s=n*4,a=e.pixels[n],o=e.colorTable[a]||[0,0,0];i[s]=o[0],i[s+1]=o[1],i[s+2]=o[2],i[s+3]=a!==e.transparentIndex?255:0}return i},Th=function(e,r,i){if(!e.image){console.warn("gif frame does not have associated image.");return}var n=e.image,s=n.descriptor.width*n.descriptor.height,a=(0,OE.lzw)(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(a=(0,FE.deinterlace)(a,n.descriptor.width));var o={pixels:a,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=r,e.gce&&(o.delay=(e.gce.delay||10)*10,o.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(o.transparentIndex=e.gce.transparentColorIndex)),i&&(o.patch=LE(o)),o};ir.decompressFrame=Th;var DE=function(e,r){return e.frames.filter(function(i){return i.image}).map(function(i){return Th(i,e.gct,r)})};ir.decompressFrames=DE;const wh=(t,e={})=>{typeof e=="function"&&(e=e(t));const r=e.loaded&&t.loaded!==e.loaded,{playing:i,...n}=e,s={...t,...n};return r&&Object.assign(s,{playing:s.autoPlay&&s.loaded}),(e.delays!=null||e.frames!=null)&&Object.assign(s,{length:s.frames.length}),(e.index!=null||e.frames!=null)&&Object.assign(s,{index:s.length===0?0:(s.length+s.index)%s.length}),e.playing!=null&&Object.assign(s,s.loaded?{playing:i}:{autoPlay:i}),s},BE=t=>wh({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},t),UE=t=>P.useReducer(wh,t,BE);var $E='function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n';function GE(t){const e=new Blob([$E],{type:"application/javascript"}),r=URL.createObjectURL(e),i=new Worker(r,t);return URL.revokeObjectURL(r),i}const zE=t=>({...t,frames:t.frames.map(e=>{const r=new ImageData(t.width,t.height);return r.data.set(new Uint8ClampedArray(e)),r})}),jE=(t,e)=>{const r={};return()=>(r.instance||(r.instance=t()),P.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(e&&e(r.instance),delete r.instance,delete r.timeout)})}),[r,e]),r.instance)},HE=t=>{const e=P.useRef(t);return P.useEffect(()=>{e.current=t},[t]),e},VE=t=>{const e=HE(t);return P.useCallback(r=>e.current&&e.current(r),[])},XE=jE(()=>new GE,t=>t.terminate()),WE=(t,e)=>{const r=VE(e),i=XE();P.useEffect(()=>{if(typeof t=="string"){const n=s=>{const a=s.data||s;if(a.src===t){const o=a.error?a:zE(a);r(o)}};return i.addEventListener("message",n),i.postMessage({src:t,type:"parse"}),()=>{i.postMessage({src:t,type:"cancel"}),i.removeEventListener("message",n)}}},[i,t])},qE=({isPlaying:t,forwardRef:e,...r})=>{const i=D.useRef(null);return D.useImperativeHandle(e,()=>i.current,[i]),D.useEffect(()=>{if(i.current===null)return;const n=i.current;n[t?"gotoAndPlay":"gotoAndStop"](n.currentFrame)},[t]),Z.jsx(te.AnimatedSprite,{ref:i,...r,isPlaying:t})},Sh=D.memo(qE),YE={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0,currentFrame:0},KE=D.forwardRef((t,e)=>{const[r,i]=D.useState(0),[n,s]=D.useState([]),[,a]=P.useState(!1),o=P.useRef(null),u=P.useRef(null),h=P.useRef(YE),d=P.useRef(),[l,c]=UE({autoPlay:!1}),{tl:f}=P.useContext(At),{src:p,uniqueId:m,startAt:v,endAt:g,frameStartAt:y,frameEndAt:_,loop:x,visible:b,disabled:T,transformation:{width:w=0,height:S=0,x:A,y:I,colorCorrection:F={}},pointerdown:$}=t,{frames:E,delays:C}=l;WE(p,c);const{temperatureFilter:U,sharpnessFilter:G,hueFilter:R,blurFilter:B,adjustmentFilter:X,vignetteFilter:M,noiseFilter:O}=er(F),{blurRadius:H=0,vignette:V=0,noise:W=0}=F,ne=.1;D.useEffect(()=>{if(!hr(E)){const z=mE(E,Y=>{const{data:pe,width:De,height:K}=Y,_e=new Uint8Array(pe);return $e.Texture.fromBuffer(_e,De,K)}).map((Y,pe)=>({texture:Y,time:C[pe]}));s(z);let q=0;C.forEach(Y=>{q+=Y}),i(q/1e3),h.current.totalDuration=q,h.current.totalFrames=E.length}},[m,E,C]);const oe=()=>{o.current&&(o.current.stop(),h.current.isPlaying=!1)},ce=()=>{if(o.current&&d.current){const fe=d.current.time();let z=fe===0?0:fe/ne;z=isNaN(z)?0:z;const q=h.current.totalFrames;z=z>q?q:z,z=Math.round(z),z>=q?(o.current.gotoAndStop(0),h.current.isPlaying=!1):(o.current.currentFrame=z,h.current.isPlaying=!0)}},ge=()=>{a(!0)};return P.useEffect(()=>{let fe=k.context(()=>{});if(u.current&&f.current&&r>0){const z={duration:Number(r),onInterrupt:oe,onUpdate:ce,onUpdateParams:[y,_]},q=Number(g)-Number(v),Y=Math.max(0,Math.floor(q/r)-1);d.current&&d.current.kill(),fe=k.context(()=>{d.current=k.timeline({repeat:x?Y:0,repeatDelay:0}).from(u.current,z,y),f.current.add(d.current,v)})}return()=>{d.current&&(d.current.kill(),k.killTweensOf(d.current)),fe.revert()}},[p,m,v,g,y,_,r,x]),Z.jsx(Ut,{...t,ref:e,ignoreTlForVideo:!0,isGif:!0,children:Z.jsx(te.Container,{ref:u,children:!hr(n)&&Z.jsx(Sh,{x:A,y:I,width:w,height:S,animationSpeed:1,alpha:b?1:0,loop:x,textures:n,onComplete:ge,anchor:.5,forwardRef:o,...!T&&b&&{interactive:!0,pointerdown:$},filters:[U,G,R,X,...H>0?[B]:[],...V>0?[M]:[],...W>0?[O]:[]]})})})}),ZE=D.forwardRef((t,e)=>{const i=P.useRef(null),n=P.useRef(0),s=P.useRef(null),a=P.useRef(null),o=P.useRef(16),u=P.useRef(null),{visible:h,text:d,disabled:l,transformation:c,pointerdown:f,onDobuleClick:p}=t,{x:m,y:v,fontFamily:g="Arial",fontWeight:y="normal",fontStyle:_="normal",fontSize:x=16,fontVariant:b="normal",fill:T="black",stroke:w,strokeThickness:S=0,blurRadius:A=0,blurEnabled:I=!1,dropShadowColor:F=null,dropShadow:$=!1,dropShadowBlur:E=0,wordWrapWidth:C=5e7,leading:U=0,letterSpacing:G,colorCorrection:R={}}=c,{temperatureFilter:B,sharpnessFilter:X,hueFilter:M,blurFilter:O,adjustmentFilter:H}=er(R),{blurRadius:V=0}=R;D.useEffect(()=>{o.current=Number(x)},[x]);const W=["italic","oblique"].includes(_)?_:void 0,ne=["small-caps"].includes(b),oe=["bold","bolder","lighter","100","200","300"].includes(y)?y:void 0,ce=Number(G)>0?G:void 0,ge=D.useMemo(()=>new $e.TextStyle({fontFamily:g,fontSize:x,fill:T||"white",...w&&S>0&&{stroke:w,strokeThickness:S},...W&&{fontStyle:W},...ne&&{fontVariant:ne},...oe&&{fontWeight:oe},...ce&&{letterSpacing:ce},...I&&{dropShadow:!0,dropShadowBlur:Number(A),dropShadowColor:(F==null?void 0:F.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},...$&&{dropShadow:!0,dropShadowBlur:Number(E),dropShadowColor:(F==null?void 0:F.toString())||"black",dropShadowAngle:.5235987755982988,dropShadowDistance:5},wordWrap:!0,breakWords:!0,wordWrapWidth:C||500,leading:U||0}),[I,A,T,g,x,_,U,W,oe,ne,ce,F,w,S,C,$,E]);D.useEffect(()=>{u.current={...c}},[c]);const fe=()=>{const q=new Date().getTime();q-n.current<300&&p?p():f&&f(),n.current=q},z=()=>{!l&&p&&p()};return Z.jsx(Ut,{...t,ref:e,isText:!0,onDoubleClick:z,children:Z.jsx(te.Container,{ref:i,children:Z.jsx(te.Container,{alpha:1,ref:a,children:Z.jsx(te.Text,{style:ge,x:m,y:v,anchor:.5,text:d,alpha:h?1:0,...h&&!l&&{interactive:!0,buttonMode:!0,pointerdown:fe},ref:s,filters:[B,X,M,H,...V>0?[O]:[]]})})})})});var QE=ht,JE=function(){return QE.Date.now()},eC=JE,tC=/\s/;function rC(t){for(var e=t.length;e--&&tC.test(t.charAt(e)););return e}var iC=rC,nC=iC,sC=/^\s+/;function aC(t){return t&&t.slice(0,nC(t)+1).replace(sC,"")}var oC=aC,lC=oC,Ah=Gr,uC=kn,Eh=0/0,cC=/^[-+]0x[0-9a-f]+$/i,hC=/^0b[01]+$/i,fC=/^0o[0-7]+$/i,dC=parseInt;function pC(t){if(typeof t=="number")return t;if(uC(t))return Eh;if(Ah(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ah(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=lC(t);var r=hC.test(t);return r||fC.test(t)?dC(t.slice(2),r?2:8):cC.test(t)?Eh:+t}var mC=pC,gC=Gr,ja=eC,Ch=mC,vC="Expected a function",_C=Math.max,yC=Math.min;function xC(t,e,r){var i,n,s,a,o,u,h=0,d=!1,l=!1,c=!0;if(typeof t!="function")throw new TypeError(vC);e=Ch(e)||0,gC(r)&&(d=!!r.leading,l="maxWait"in r,s=l?_C(Ch(r.maxWait)||0,e):s,c="trailing"in r?!!r.trailing:c);function f(T){var w=i,S=n;return i=n=void 0,h=T,a=t.apply(S,w),a}function p(T){return h=T,o=setTimeout(g,e),d?f(T):a}function m(T){var w=T-u,S=T-h,A=e-w;return l?yC(A,s-S):A}function v(T){var w=T-u,S=T-h;return u===void 0||w>=e||w<0||l&&S>=s}function g(){var T=ja();if(v(T))return y(T);o=setTimeout(g,m(T))}function y(T){return o=void 0,c&&i?f(T):(i=n=void 0,a)}function _(){o!==void 0&&clearTimeout(o),h=0,i=u=n=o=void 0}function x(){return o===void 0?a:y(ja())}function b(){var T=ja(),w=v(T);if(i=arguments,n=this,u=T,w){if(o===void 0)return p(u);if(l)return clearTimeout(o),o=setTimeout(g,e),f(u)}return o===void 0&&(o=setTimeout(g,e)),a}return b.cancel=_,b.flush=x,b}var bC=xC;const Ha=Lt(bC),Va=(t,e,r,i)=>{const n=P.useCallback(Ha(t,i),[t,i]),s=P.useCallback(Ha(e,i),[e,i]),a=P.useCallback(Ha(r,i),[r,i]),o=P.useCallback(()=>{n()},[n]),u=P.useCallback(()=>{s()},[s]),h=P.useCallback(()=>{a()},[a]);return{onPointerOver:o,onPointerDown:u,onPointerOut:h}},TC={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,isStalled:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,timeDiff:0},Ih=D.forwardRef((t,e)=>{const[r,i]=D.useState(!1),n=D.useRef(),s=P.useRef(null),a=P.useRef(null),o=P.useRef(null),u=P.useRef(TC),h=P.useRef(),{uniqueId:d,mute:l=!1,src:c,startAt:f,endAt:p,frameStartAt:m,frameEndAt:v,visible:g,disabled:y,transformation:{x:_,y:x,width:b,height:T,animation:w,colorCorrection:S={}},pointerdown:A=()=>{},pointerout:I=()=>{},pointerover:F=()=>{},fps:$=0}=t,{tl:E,dragModeRef:C,isRemotion:U}=P.useContext(At),{onPointerDown:G,onPointerOut:R,onPointerOver:B}=Va(F,A,I,1),{blurRadius:X=0,vignette:M=0,noise:O=0}=S,{temperatureFilter:H,sharpnessFilter:V,hueFilter:W,blurFilter:ne,adjustmentFilter:oe,vignetteFilter:ce,noiseFilter:ge}=er(S),fe=c||"",z=D.useMemo(()=>{const K=document.createElement("video");return K.src=c,K.crossOrigin="Anonymus",K.autoplay=!1,K.currentTime=m===0?.001:m,K},[c,m]);Oe(we.PAUSE,()=>{o.current&&(o.current.pause(),u.current.isPlaying=!1)}),Oe(we.SCRUBBER_CLICKED,()=>{o.current&&(o.current.pause(),u.current.isPlaying=!1)}),Oe(we.REVERSE_MODE_END,()=>{o.current&&(o.current.pause(),u.current.isPlaying=!1)});const q=K=>{if(o.current){if(o.current.currentTime=Number(K),!C.current){const _e=o.current,Qe=_e.currentTime>0&&!_e.paused&&!_e.ended&&_e.readyState>_e.HAVE_CURRENT_DATA;E.current&&E.current.isActive()&&h.current&&h.current.isActive()&&(Qe||o.current.play(),u.current.isPlaying=!0)}u.current.progress=0}},Y=()=>{if(o.current){const K=o.current;K.currentTime>0&&!K.paused&&!K.ended&&K.readyState>K.HAVE_CURRENT_DATA&&o.current.pause(),u.current.isPlaying=!1,h.current&&(u.current.progress=h.current.progress())}},pe=()=>{},De=()=>{var K,_e;if(h.current&&(u.current.progress=h.current.progress()),o.current&&h.current){const Qe=m+((K=h==null?void 0:h.current)==null?void 0:K.time()),ct=Math.abs(o.current.currentTime-Qe),Fe=o.current,Br=Fe.currentTime>0&&!Fe.paused&&!Fe.ended&&Fe.readyState>Fe.HAVE_CURRENT_DATA;C.current&&n.current?(o.current.currentTime=Qe,n.current.update(),u.current.isPlaying=!1):(Br!==u.current.isPlaying||!Br)&&u.current.progress>.01&&u.current.progress<.99?(_e=E.current)!=null&&_e.isActive()&&h.current&&h.current.isActive()&&(Br||o.current.play(),u.current.isPlaying=!0):ct>.3&&u.current.progress>.01&&u.current.progress<.99&&(o.current.currentTime=Qe)}};return P.useEffect(()=>{let K=k.context(()=>{});if(a.current&&E.current){const _e={duration:Number(p)-Number(f),onStart:q,onComplete:Y,onStartParams:[m,v],onCompleteParams:[],onInterrupt:pe,onUpdate:De,onUpdateParams:[m,v],onPause:()=>{console.log("onPause video sprite pause",d)},onResume:()=>{console.log("onResume video sprite resume",d)},onReverseComplete:()=>{console.log("onReverseComplete video sprite reverse complete",d)},onKill:()=>{console.log("onKill video sprite kill",d)}};h.current&&(h.current.kill(),E.current.remove(h.current)),K=k.context(()=>{h.current=k.to(a.current,_e,m),E.current.add(h.current,f)})}return()=>{h.current&&(h.current.kill(),k.killTweensOf(h.current)),K.revert()}},[w,f,p,m,v,d]),D.useEffect(()=>{o.current&&(o.current.muted=l,u.current.isMuted=l);const K=setTimeout(()=>{o.current&&(o.current.muted=l,u.current.isMuted=l)},1500);return()=>{clearTimeout(K)}},[l]),D.useEffect(()=>{const K=Math.round((Number(m)+Number.EPSILON)*100)/100,_e=function(){o.current&&(o.current.currentTime=K,o.current.muted=l)},Qe=function(){u.current.isWaiting=!1,u.current.isStalled=!1},ct=function(){u.current.isWaiting=!0,u.current.isStalled=!1},Fe=function(){u.current.isWaiting=!1,u.current.isStalled=!1},Br=function(){u.current.isWaiting=!1,u.current.isStalled=!0},CC=Math.round((Number(m)+Number.EPSILON)*100)/100,IC=Math.round((Number(v)+Number.EPSILON)*100)/100,RC=`${fe}#t=${CC},${IC}`;return $e.Texture.fromLoader(z,RC,d,{pixiIdPrefix:d,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:$?Math.max(120,Number($)):30}}).then(Xa=>{Xa&&(n.current=Xa,i(!0),o.current=Xa.baseTexture.resource.source,o.current.id=d,o.current.addEventListener("loadedmetadata",_e),o.current.addEventListener("ended",Qe),o.current.addEventListener("loadstart",ct),o.current.addEventListener("canplaythrough",Fe),o.current.addEventListener("stalled",Br))}),()=>{o.current&&(o.current.pause(),o.current.removeEventListener("loadedmetadata",_e),o.current.removeEventListener("ended",Qe),o.current.removeEventListener("loadstart",ct),o.current.removeEventListener("canplaythrough",Fe),o.current.removeEventListener("stalled",Br))}},[fe,d,m,v,z]),D.useEffect(()=>{const K=setTimeout(()=>{r&&n.current&&h.current&&E.current&&h.current.progress()<.1&&o.current&&!h.current.isActive()&&!U&&(o.current.currentTime=m,n.current.update())},30);return()=>{clearTimeout(K)}},[r]),Z.jsx(Ut,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:G,pointerover:B,pointerout:R,children:Z.jsx(te.Container,{ref:a,children:n.current&&Z.jsx(te.Sprite,{texture:n.current,width:b,height:T,anchor:.5,x:_,y:x,ref:s,alpha:g?1:0,...!y&&g&&{interactive:!0,pointerdown:A},filters:[H,V,W,oe,...X>0?[ne]:[],...M>0?[ce]:[],...O>0?[ge]:[]]})})})});Ih.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const wC=D.forwardRef((t,e)=>{const[r,i]=D.useState(),n=P.useRef(null),s=P.useRef(null),{visible:a,disabled:o,transformation:{x:u,y:h,width:d,height:l,colorCorrection:c={}},pointerdown:f=()=>{},pointerout:p=()=>{},pointerover:m=()=>{},canvasImageRef:v}=t,g=v&&(v==null?void 0:v.getCanvas()),y=te.useApp(),{onPointerDown:_,onPointerOut:x,onPointerOver:b}=Va(m,f,p,1),{blurRadius:T=0,vignette:w=0,noise:S=0}=c,{temperatureFilter:A,sharpnessFilter:I,hueFilter:F,blurFilter:$,adjustmentFilter:E,vignetteFilter:C,noiseFilter:U}=er(c);return te.useTick(()=>{if(n.current&&n.current.texture){const G=n.current.texture.baseTexture;G&&G.update(),s.current&&y.renderer.render(s.current)}}),D.useEffect(()=>{if(!hr(g)){const G=$e.Texture.from(g);i(G)}},[g]),Z.jsx(Ut,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:_,pointerover:b,pointerout:x,children:Z.jsx(te.Container,{ref:s,children:r&&Z.jsx(te.Sprite,{texture:r,width:d,height:l,anchor:.5,x:u,y:h,ref:n,alpha:a?1:0,...!o&&a&&{interactive:!0,pointerdown:f},filters:[A,I,F,E,...T>0?[$]:[],...w>0?[C]:[],...S>0?[U]:[]]})})})}),SC=t=>{const{startAt:e,endAt:r,uniqueId:i}=t,n=P.useRef(null),s=P.useRef(null),a=P.useRef(null),o=P.useRef(null),{tl:u,totalDuration:h=0}=P.useContext(At);return D.useEffect(()=>{const d=k.context(()=>{if(n.current&&u.current){o.current&&(o.current.kill(),u.current.remove(o.current));const l=e<.2?1:0;o.current=k.timeline().set(n.current,{alpha:l}).to(n.current,{pixi:{alpha:1,eventMode:"static"},duration:Number(r)-Number(e)}).set(n.current,{alpha:0,eventMode:"none"}),u.current.add([o.current],e)}});return()=>{o.current&&(u.current.remove(o.current),o.current.progress(0).kill()),d.revert()}},[e,r,h,i]),Z.jsx(te.Container,{ref:n,alpha:e<.2?1:0,eventMode:e<.2?"static":"none",children:Z.jsx(te.Container,{ref:a,children:Z.jsx(te.Container,{ref:s,alpha:1,children:t.children})})})},AC=t=>{const{startAt:e,endAt:r}=t,{setTotalDuration:i}=P.useContext(At);return D.useEffect(()=>{i&&i(Number(r)+.2)},[e,r]),t.children},EC=D.forwardRef((t,e)=>{const[r,i]=D.useState(),n=P.useRef(null),s=P.useRef(null),{visible:a,disabled:o,transformation:{x:u,y:h,width:d,height:l,colorCorrection:c={}},pointerdown:f=()=>{},pointerout:p=()=>{},pointerover:m=()=>{},canvasImageRef:v}=t,g=v&&(v==null?void 0:v.getCanvas()),y=te.useApp(),{onPointerDown:_,onPointerOut:x,onPointerOver:b}=Va(m,f,p,1),{blurRadius:T=0,vignette:w=0,noise:S=0}=c,{temperatureFilter:A,sharpnessFilter:I,hueFilter:F,blurFilter:$,adjustmentFilter:E,vignetteFilter:C,noiseFilter:U}=er(c);return te.useTick(()=>{if(n.current&&n.current.texture){const G=n.current.texture.baseTexture;G&&G.update(),s.current&&y.renderer.render(s.current)}}),D.useEffect(()=>{if(!hr(g)){const G=$e.Texture.from(g);i(G)}},[g]),Z.jsx(Ut,{...t,ref:e,ignoreTlForVideo:!0,pointerdown:_,pointerover:b,pointerout:x,children:Z.jsx(te.Container,{ref:s,children:r&&Z.jsx(te.Sprite,{texture:r,width:d,height:l,anchor:.5,x:u,y:h,ref:n,alpha:a?1:0,...!o&&a&&{interactive:!0,pointerdown:f},filters:[A,I,F,E,...T>0?[$]:[],...w>0?[C]:[],...S>0?[U]:[]]})})})});var Rh=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(Rh||{});le.Animations=os,le.BlendModes=Rh,le.Events=we,le.GsapPixieContext=At,le.GsapPixieContextProvider=zh,le.PixiAnimatedSprite=Sh,le.PixiAudioSprite=Hw,le.PixiGifSprite=KE,le.PixiImageSprite=Gc,le.PixiRemotionSprite=EC,le.PixiSequence=SC,le.PixiSequenceWrapper=AC,le.PixiSvgPathSprite=jw,le.PixiTextSprite=ZE,le.PixiVideoCanvasSyncSprite=wC,le.PixiVideoSprite=Ih,le.emitCustomEvent=nr,le.newCustomEventEmitter=Gh,le.useCustomEventListener=Oe,le.useGsapEffect=sl,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});