!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).TXLivePusher=e()}(this,(function(){"use strict";function t(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(r){if("default"!==r&&!(r in t)){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}))})),Object.freeze(t)}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var i=function(t){return t&&t.Math==Math&&t},o=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof e&&e)||function(){return this}()||Function("return this")(),s=function(t){try{return!!t()}catch(t){return!0}},a=!s((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),u=a,c=Function.prototype,h=c.apply,l=c.call,d="object"==typeof Reflect&&Reflect.apply||(u?l.bind(h):function(){return l.apply(h,arguments)}),f=a,p=Function.prototype,v=p.call,m=f&&p.bind.bind(v,v),y=f?m:function(t){return function(){return v.apply(t,arguments)}},g=y,_=g({}.toString),b=g("".slice),T=function(t){return b(_(t),8,-1)},x=T,E=y,S=function(t){if("Function"===x(t))return E(t)},w="object"==typeof document&&document.all,R={all:w,IS_HTMLDDA:void 0===w&&void 0!==w},C=R.all,P=R.IS_HTMLDDA?function(t){return"function"==typeof t||t===C}:function(t){return"function"==typeof t},A={},O=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),I=a,M=Function.prototype.call,D=I?M.bind(M):function(){return M.apply(M,arguments)},L={},F={}.propertyIsEnumerable,N=Object.getOwnPropertyDescriptor,k=N&&!F.call({1:2},1);L.f=k?function(t){var e=N(this,t);return!!e&&e.enumerable}:F;var B,G,U=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},j=s,X=T,V=Object,H=S("".split),W=j((function(){return!V("z").propertyIsEnumerable(0)}))?function(t){return"String"==X(t)?H(t,""):V(t)}:V,Y=function(t){return null==t},z=Y,Z=TypeError,J=function(t){if(z(t))throw Z("Can't call method on "+t);return t},K=W,q=J,Q=function(t){return K(q(t))},$=P,tt=R.all,et=R.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:$(t)||t===tt}:function(t){return"object"==typeof t?null!==t:$(t)},rt={},nt=rt,it=o,ot=P,st=function(t){return ot(t)?t:void 0},at=function(t,e){return arguments.length<2?st(nt[t])||st(it[t]):nt[t]&&nt[t][e]||it[t]&&it[t][e]},ut=S({}.isPrototypeOf),ct=at("navigator","userAgent")||"",ht=o,lt=ct,dt=ht.process,ft=ht.Deno,pt=dt&&dt.versions||ft&&ft.version,vt=pt&&pt.v8;vt&&(G=(B=vt.split("."))[0]>0&&B[0]<4?1:+(B[0]+B[1])),!G&&lt&&(!(B=lt.match(/Edge\/(\d+)/))||B[1]>=74)&&(B=lt.match(/Chrome\/(\d+)/))&&(G=+B[1]);var mt=G,yt=mt,gt=s,_t=!!Object.getOwnPropertySymbols&&!gt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&yt&&yt<41})),bt=_t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Tt=at,xt=P,Et=ut,St=Object,wt=bt?function(t){return"symbol"==typeof t}:function(t){var e=Tt("Symbol");return xt(e)&&Et(e.prototype,St(t))},Rt=String,Ct=function(t){try{return Rt(t)}catch(t){return"Object"}},Pt=P,At=Ct,Ot=TypeError,It=function(t){if(Pt(t))return t;throw Ot(At(t)+" is not a function")},Mt=It,Dt=Y,Lt=function(t,e){var r=t[e];return Dt(r)?void 0:Mt(r)},Ft=D,Nt=P,kt=et,Bt=TypeError,Gt={exports:{}},Ut=o,jt=Object.defineProperty,Xt=function(t,e){try{jt(Ut,t,{value:e,configurable:!0,writable:!0})}catch(r){Ut[t]=e}return e},Vt="__core-js_shared__",Ht=o[Vt]||Xt(Vt,{}),Wt=Ht;(Gt.exports=function(t,e){return Wt[t]||(Wt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.26.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Yt=J,zt=Object,Zt=function(t){return zt(Yt(t))},Jt=Zt,Kt=S({}.hasOwnProperty),qt=Object.hasOwn||function(t,e){return Kt(Jt(t),e)},Qt=S,$t=0,te=Math.random(),ee=Qt(1..toString),re=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ee(++$t+te,36)},ne=o,ie=Gt.exports,oe=qt,se=re,ae=_t,ue=bt,ce=ie("wks"),he=ne.Symbol,le=he&&he.for,de=ue?he:he&&he.withoutSetter||se,fe=function(t){if(!oe(ce,t)||!ae&&"string"!=typeof ce[t]){var e="Symbol."+t;ae&&oe(he,t)?ce[t]=he[t]:ce[t]=ue&&le?le(e):de(e)}return ce[t]},pe=D,ve=et,me=wt,ye=Lt,ge=function(t,e){var r,n;if("string"===e&&Nt(r=t.toString)&&!kt(n=Ft(r,t)))return n;if(Nt(r=t.valueOf)&&!kt(n=Ft(r,t)))return n;if("string"!==e&&Nt(r=t.toString)&&!kt(n=Ft(r,t)))return n;throw Bt("Can't convert object to primitive value")},_e=TypeError,be=fe("toPrimitive"),Te=function(t,e){if(!ve(t)||me(t))return t;var r,n=ye(t,be);if(n){if(void 0===e&&(e="default"),r=pe(n,t,e),!ve(r)||me(r))return r;throw _e("Can't convert object to primitive value")}return void 0===e&&(e="number"),ge(t,e)},xe=wt,Ee=function(t){var e=Te(t,"string");return xe(e)?e:e+""},Se=et,we=o.document,Re=Se(we)&&Se(we.createElement),Ce=function(t){return Re?we.createElement(t):{}},Pe=Ce,Ae=!O&&!s((function(){return 7!=Object.defineProperty(Pe("div"),"a",{get:function(){return 7}}).a})),Oe=O,Ie=D,Me=L,De=U,Le=Q,Fe=Ee,Ne=qt,ke=Ae,Be=Object.getOwnPropertyDescriptor;A.f=Oe?Be:function(t,e){if(t=Le(t),e=Fe(e),ke)try{return Be(t,e)}catch(t){}if(Ne(t,e))return De(!Ie(Me.f,t,e),t[e])};var Ge=s,Ue=P,je=/#|\.prototype\./,Xe=function(t,e){var r=He[Ve(t)];return r==Ye||r!=We&&(Ue(e)?Ge(e):!!e)},Ve=Xe.normalize=function(t){return String(t).replace(je,".").toLowerCase()},He=Xe.data={},We=Xe.NATIVE="N",Ye=Xe.POLYFILL="P",ze=Xe,Ze=It,Je=a,Ke=S(S.bind),qe=function(t,e){return Ze(t),void 0===e?t:Je?Ke(t,e):function(){return t.apply(e,arguments)}},Qe={},$e=O&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),tr=et,er=String,rr=TypeError,nr=function(t){if(tr(t))return t;throw rr(er(t)+" is not an object")},ir=O,or=Ae,sr=$e,ar=nr,ur=Ee,cr=TypeError,hr=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,dr="enumerable",fr="configurable",pr="writable";Qe.f=ir?sr?function(t,e,r){if(ar(t),e=ur(e),ar(r),"function"==typeof t&&"prototype"===e&&"value"in r&&pr in r&&!r.writable){var n=lr(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:fr in r?r.configurable:n.configurable,enumerable:dr in r?r.enumerable:n.enumerable,writable:!1})}return hr(t,e,r)}:hr:function(t,e,r){if(ar(t),e=ur(e),ar(r),or)try{return hr(t,e,r)}catch(t){}if("get"in r||"set"in r)throw cr("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var vr=Qe,mr=U,yr=O?function(t,e,r){return vr.f(t,e,mr(1,r))}:function(t,e,r){return t[e]=r,t},gr=o,_r=d,br=S,Tr=P,xr=A.f,Er=ze,Sr=rt,wr=qe,Rr=yr,Cr=qt,Pr=function(t){var e=function(r,n,i){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,n)}return new t(r,n,i)}return _r(t,this,arguments)};return e.prototype=t.prototype,e},Ar=function(t,e){var r,n,i,o,s,a,u,c,h=t.target,l=t.global,d=t.stat,f=t.proto,p=l?gr:d?gr[h]:(gr[h]||{}).prototype,v=l?Sr:Sr[h]||Rr(Sr,h,{})[h],m=v.prototype;for(i in e)r=!Er(l?i:h+(d?".":"#")+i,t.forced)&&p&&Cr(p,i),s=v[i],r&&(a=t.dontCallGetSet?(c=xr(p,i))&&c.value:p[i]),o=r&&a?a:e[i],r&&typeof s==typeof o||(u=t.bind&&r?wr(o,gr):t.wrap&&r?Pr(o):f&&Tr(o)?br(o):o,(t.sham||o&&o.sham||s&&s.sham)&&Rr(u,"sham",!0),Rr(v,i,u),f&&(Cr(Sr,n=h+"Prototype")||Rr(Sr,n,{}),Rr(Sr[n],i,o),t.real&&m&&!m[i]&&Rr(m,i,o)))},Or=T,Ir=Array.isArray||function(t){return"Array"==Or(t)},Mr=Math.ceil,Dr=Math.floor,Lr=Math.trunc||function(t){var e=+t;return(e>0?Dr:Mr)(e)},Fr=Lr,Nr=function(t){var e=+t;return e!=e||0===e?0:Fr(e)},kr=Nr,Br=Math.min,Gr=function(t){return t>0?Br(kr(t),9007199254740991):0},Ur=Gr,jr=function(t){return Ur(t.length)},Xr=TypeError,Vr=function(t){if(t>9007199254740991)throw Xr("Maximum allowed index exceeded");return t},Hr=Ee,Wr=Qe,Yr=U,zr=function(t,e,r){var n=Hr(e);n in t?Wr.f(t,n,Yr(0,r)):t[n]=r},Zr={};Zr[fe("toStringTag")]="z";var Jr="[object z]"===String(Zr),Kr=Jr,qr=P,Qr=T,$r=fe("toStringTag"),tn=Object,en="Arguments"==Qr(function(){return arguments}()),rn=Kr?Qr:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=tn(t),$r))?r:en?Qr(e):"Object"==(n=Qr(e))&&qr(e.callee)?"Arguments":n},nn=P,on=Ht,sn=S(Function.toString);nn(on.inspectSource)||(on.inspectSource=function(t){return sn(t)});var an=on.inspectSource,un=S,cn=s,hn=P,ln=rn,dn=an,fn=function(){},pn=[],vn=at("Reflect","construct"),mn=/^\s*(?:class|function)\b/,yn=un(mn.exec),gn=!mn.exec(fn),_n=function(t){if(!hn(t))return!1;try{return vn(fn,pn,t),!0}catch(t){return!1}},bn=function(t){if(!hn(t))return!1;switch(ln(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return gn||!!yn(mn,dn(t))}catch(t){return!0}};bn.sham=!0;var Tn=!vn||cn((function(){var t;return _n(_n.call)||!_n(Object)||!_n((function(){t=!0}))||t}))?bn:_n,xn=Ir,En=Tn,Sn=et,wn=fe("species"),Rn=Array,Cn=function(t){var e;return xn(t)&&(e=t.constructor,(En(e)&&(e===Rn||xn(e.prototype))||Sn(e)&&null===(e=e[wn]))&&(e=void 0)),void 0===e?Rn:e},Pn=function(t,e){return new(Cn(t))(0===e?0:e)},An=s,On=mt,In=fe("species"),Mn=function(t){return On>=51||!An((function(){var e=[];return(e.constructor={})[In]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Dn=Ar,Ln=s,Fn=Ir,Nn=et,kn=Zt,Bn=jr,Gn=Vr,Un=zr,jn=Pn,Xn=Mn,Vn=mt,Hn=fe("isConcatSpreadable"),Wn=Vn>=51||!Ln((function(){var t=[];return t[Hn]=!1,t.concat()[0]!==t})),Yn=Xn("concat"),zn=function(t){if(!Nn(t))return!1;var e=t[Hn];return void 0!==e?!!e:Fn(t)};Dn({target:"Array",proto:!0,arity:1,forced:!Wn||!Yn},{concat:function(t){var e,r,n,i,o,s=kn(this),a=jn(s,0),u=0;for(e=-1,n=arguments.length;e<n;e++)if(zn(o=-1===e?s:arguments[e]))for(i=Bn(o),Gn(u+i),r=0;r<i;r++,u++)r in o&&Un(a,u,o[r]);else Gn(u+1),Un(a,u++,o);return a.length=u,a}});var Zn=rn,Jn=String,Kn=function(t){if("Symbol"===Zn(t))throw TypeError("Cannot convert a Symbol value to a string");return Jn(t)},qn={},Qn=Nr,$n=Math.max,ti=Math.min,ei=function(t,e){var r=Qn(t);return r<0?$n(r+e,0):ti(r,e)},ri=Q,ni=ei,ii=jr,oi=function(t){return function(e,r,n){var i,o=ri(e),s=ii(o),a=ni(n,s);if(t&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},si={includes:oi(!0),indexOf:oi(!1)},ai={},ui=qt,ci=Q,hi=si.indexOf,li=ai,di=S([].push),fi=function(t,e){var r,n=ci(t),i=0,o=[];for(r in n)!ui(li,r)&&ui(n,r)&&di(o,r);for(;e.length>i;)ui(n,r=e[i++])&&(~hi(o,r)||di(o,r));return o},pi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vi=fi,mi=pi,yi=Object.keys||function(t){return vi(t,mi)},gi=O,_i=$e,bi=Qe,Ti=nr,xi=Q,Ei=yi;qn.f=gi&&!_i?Object.defineProperties:function(t,e){Ti(t);for(var r,n=xi(e),i=Ei(e),o=i.length,s=0;o>s;)bi.f(t,r=i[s++],n[r]);return t};var Si,wi=at("document","documentElement"),Ri=Gt.exports,Ci=re,Pi=Ri("keys"),Ai=function(t){return Pi[t]||(Pi[t]=Ci(t))},Oi=nr,Ii=qn,Mi=pi,Di=ai,Li=wi,Fi=Ce,Ni=Ai("IE_PROTO"),ki=function(){},Bi=function(t){return"<script>"+t+"</"+"script>"},Gi=function(t){t.write(Bi("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ui=function(){try{Si=new ActiveXObject("htmlfile")}catch(t){}var t,e;Ui="undefined"!=typeof document?document.domain&&Si?Gi(Si):((e=Fi("iframe")).style.display="none",Li.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Bi("document.F=Object")),t.close(),t.F):Gi(Si);for(var r=Mi.length;r--;)delete Ui.prototype[Mi[r]];return Ui()};Di[Ni]=!0;var ji=Object.create||function(t,e){var r;return null!==t?(ki.prototype=Oi(t),r=new ki,ki.prototype=null,r[Ni]=t):r=Ui(),void 0===e?r:Ii.f(r,e)},Xi={},Vi=fi,Hi=pi.concat("length","prototype");Xi.f=Object.getOwnPropertyNames||function(t){return Vi(t,Hi)};var Wi={},Yi=ei,zi=jr,Zi=zr,Ji=Array,Ki=Math.max,qi=function(t,e,r){for(var n=zi(t),i=Yi(e,n),o=Yi(void 0===r?n:r,n),s=Ji(Ki(o-i,0)),a=0;i<o;i++,a++)Zi(s,a,t[i]);return s.length=a,s},Qi=T,$i=Q,to=Xi.f,eo=qi,ro="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Wi.f=function(t){return ro&&"Window"==Qi(t)?function(t){try{return to(t)}catch(t){return eo(ro)}}(t):to($i(t))};var no={};no.f=Object.getOwnPropertySymbols;var io=yr,oo=function(t,e,r,n){return n&&n.enumerable?t[e]=r:io(t,e,r),t},so={},ao=fe;so.f=ao;var uo,co,ho,lo=rt,fo=qt,po=so,vo=Qe.f,mo=function(t){var e=lo.Symbol||(lo.Symbol={});fo(e,t)||vo(e,t,{value:po.f(t)})},yo=D,go=at,_o=fe,bo=oo,To=function(){var t=go("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,n=_o("toPrimitive");e&&!e[n]&&bo(e,n,(function(t){return yo(r,this)}),{arity:1})},xo=rn,Eo=Jr?{}.toString:function(){return"[object "+xo(this)+"]"},So=Jr,wo=Qe.f,Ro=yr,Co=qt,Po=Eo,Ao=fe("toStringTag"),Oo=function(t,e,r,n){if(t){var i=r?t:t.prototype;Co(i,Ao)||wo(i,Ao,{configurable:!0,value:e}),n&&!So&&Ro(i,"toString",Po)}},Io=P,Mo=o.WeakMap,Do=Io(Mo)&&/native code/.test(String(Mo)),Lo=o,Fo=et,No=yr,ko=qt,Bo=Ht,Go=Ai,Uo=ai,jo="Object already initialized",Xo=Lo.TypeError,Vo=Lo.WeakMap;if(Do||Bo.state){var Ho=Bo.state||(Bo.state=new Vo);Ho.get=Ho.get,Ho.has=Ho.has,Ho.set=Ho.set,uo=function(t,e){if(Ho.has(t))throw Xo(jo);return e.facade=t,Ho.set(t,e),e},co=function(t){return Ho.get(t)||{}},ho=function(t){return Ho.has(t)}}else{var Wo=Go("state");Uo[Wo]=!0,uo=function(t,e){if(ko(t,Wo))throw Xo(jo);return e.facade=t,No(t,Wo,e),e},co=function(t){return ko(t,Wo)?t[Wo]:{}},ho=function(t){return ko(t,Wo)}}var Yo={set:uo,get:co,has:ho,enforce:function(t){return ho(t)?co(t):uo(t,{})},getterFor:function(t){return function(e){var r;if(!Fo(e)||(r=co(e)).type!==t)throw Xo("Incompatible receiver, "+t+" required");return r}}},zo=qe,Zo=W,Jo=Zt,Ko=jr,qo=Pn,Qo=S([].push),$o=function(t){var e=1==t,r=2==t,n=3==t,i=4==t,o=6==t,s=7==t,a=5==t||o;return function(u,c,h,l){for(var d,f,p=Jo(u),v=Zo(p),m=zo(c,h),y=Ko(v),g=0,_=l||qo,b=e?_(u,y):r||s?_(u,0):void 0;y>g;g++)if((a||g in v)&&(f=m(d=v[g],g,p),t))if(e)b[g]=f;else if(f)switch(t){case 3:return!0;case 5:return d;case 6:return g;case 2:Qo(b,d)}else switch(t){case 4:return!1;case 7:Qo(b,d)}return o?-1:n||i?i:b}},ts={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},es=Ar,rs=o,ns=D,is=S,os=O,ss=_t,as=s,us=qt,cs=ut,hs=nr,ls=Q,ds=Ee,fs=Kn,ps=U,vs=ji,ms=yi,ys=Xi,gs=Wi,_s=no,bs=A,Ts=Qe,xs=qn,Es=L,Ss=oo,ws=Gt.exports,Rs=ai,Cs=re,Ps=fe,As=so,Os=mo,Is=To,Ms=Oo,Ds=Yo,Ls=ts.forEach,Fs=Ai("hidden"),Ns="Symbol",ks=Ds.set,Bs=Ds.getterFor(Ns),Gs=Object.prototype,Us=rs.Symbol,js=Us&&Us.prototype,Xs=rs.TypeError,Vs=rs.QObject,Hs=bs.f,Ws=Ts.f,Ys=gs.f,zs=Es.f,Zs=is([].push),Js=ws("symbols"),Ks=ws("op-symbols"),qs=ws("wks"),Qs=!Vs||!Vs.prototype||!Vs.prototype.findChild,$s=os&&as((function(){return 7!=vs(Ws({},"a",{get:function(){return Ws(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Hs(Gs,e);n&&delete Gs[e],Ws(t,e,r),n&&t!==Gs&&Ws(Gs,e,n)}:Ws,ta=function(t,e){var r=Js[t]=vs(js);return ks(r,{type:Ns,tag:t,description:e}),os||(r.description=e),r},ea=function(t,e,r){t===Gs&&ea(Ks,e,r),hs(t);var n=ds(e);return hs(r),us(Js,n)?(r.enumerable?(us(t,Fs)&&t[Fs][n]&&(t[Fs][n]=!1),r=vs(r,{enumerable:ps(0,!1)})):(us(t,Fs)||Ws(t,Fs,ps(1,{})),t[Fs][n]=!0),$s(t,n,r)):Ws(t,n,r)},ra=function(t,e){hs(t);var r=ls(e),n=ms(r).concat(sa(r));return Ls(n,(function(e){os&&!ns(na,r,e)||ea(t,e,r[e])})),t},na=function(t){var e=ds(t),r=ns(zs,this,e);return!(this===Gs&&us(Js,e)&&!us(Ks,e))&&(!(r||!us(this,e)||!us(Js,e)||us(this,Fs)&&this[Fs][e])||r)},ia=function(t,e){var r=ls(t),n=ds(e);if(r!==Gs||!us(Js,n)||us(Ks,n)){var i=Hs(r,n);return!i||!us(Js,n)||us(r,Fs)&&r[Fs][n]||(i.enumerable=!0),i}},oa=function(t){var e=Ys(ls(t)),r=[];return Ls(e,(function(t){us(Js,t)||us(Rs,t)||Zs(r,t)})),r},sa=function(t){var e=t===Gs,r=Ys(e?Ks:ls(t)),n=[];return Ls(r,(function(t){!us(Js,t)||e&&!us(Gs,t)||Zs(n,Js[t])})),n};ss||(Us=function(){if(cs(js,this))throw Xs("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?fs(arguments[0]):void 0,e=Cs(t),r=function(t){this===Gs&&ns(r,Ks,t),us(this,Fs)&&us(this[Fs],e)&&(this[Fs][e]=!1),$s(this,e,ps(1,t))};return os&&Qs&&$s(Gs,e,{configurable:!0,set:r}),ta(e,t)},Ss(js=Us.prototype,"toString",(function(){return Bs(this).tag})),Ss(Us,"withoutSetter",(function(t){return ta(Cs(t),t)})),Es.f=na,Ts.f=ea,xs.f=ra,bs.f=ia,ys.f=gs.f=oa,_s.f=sa,As.f=function(t){return ta(Ps(t),t)},os&&Ws(js,"description",{configurable:!0,get:function(){return Bs(this).description}})),es({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Us}),Ls(ms(qs),(function(t){Os(t)})),es({target:Ns,stat:!0,forced:!ss},{useSetter:function(){Qs=!0},useSimple:function(){Qs=!1}}),es({target:"Object",stat:!0,forced:!ss,sham:!os},{create:function(t,e){return void 0===e?vs(t):ra(vs(t),e)},defineProperty:ea,defineProperties:ra,getOwnPropertyDescriptor:ia}),es({target:"Object",stat:!0,forced:!ss},{getOwnPropertyNames:oa}),Is(),Ms(Us,Ns),Rs[Fs]=!0;var aa=_t&&!!Symbol.for&&!!Symbol.keyFor,ua=Ar,ca=at,ha=qt,la=Kn,da=Gt.exports,fa=aa,pa=da("string-to-symbol-registry"),va=da("symbol-to-string-registry");ua({target:"Symbol",stat:!0,forced:!fa},{for:function(t){var e=la(t);if(ha(pa,e))return pa[e];var r=ca("Symbol")(e);return pa[e]=r,va[r]=e,r}});var ma=Ar,ya=qt,ga=wt,_a=Ct,ba=aa,Ta=(0,Gt.exports)("symbol-to-string-registry");ma({target:"Symbol",stat:!0,forced:!ba},{keyFor:function(t){if(!ga(t))throw TypeError(_a(t)+" is not a symbol");if(ya(Ta,t))return Ta[t]}});var xa=S([].slice),Ea=Ar,Sa=at,wa=d,Ra=D,Ca=S,Pa=s,Aa=Ir,Oa=P,Ia=et,Ma=wt,Da=xa,La=_t,Fa=Sa("JSON","stringify"),Na=Ca(/./.exec),ka=Ca("".charAt),Ba=Ca("".charCodeAt),Ga=Ca("".replace),Ua=Ca(1..toString),ja=/[\uD800-\uDFFF]/g,Xa=/^[\uD800-\uDBFF]$/,Va=/^[\uDC00-\uDFFF]$/,Ha=!La||Pa((function(){var t=Sa("Symbol")();return"[null]"!=Fa([t])||"{}"!=Fa({a:t})||"{}"!=Fa(Object(t))})),Wa=Pa((function(){return'"\\udf06\\ud834"'!==Fa("\udf06\ud834")||'"\\udead"'!==Fa("\udead")})),Ya=function(t,e){var r=Da(arguments),n=e;if((Ia(e)||void 0!==t)&&!Ma(t))return Aa(e)||(e=function(t,e){if(Oa(n)&&(e=Ra(n,this,t,e)),!Ma(e))return e}),r[1]=e,wa(Fa,null,r)},za=function(t,e,r){var n=ka(r,e-1),i=ka(r,e+1);return Na(Xa,t)&&!Na(Va,i)||Na(Va,t)&&!Na(Xa,n)?"\\u"+Ua(Ba(t,0),16):t};Fa&&Ea({target:"JSON",stat:!0,arity:3,forced:Ha||Wa},{stringify:function(t,e,r){var n=Da(arguments),i=wa(Ha?Ya:Fa,null,n);return Wa&&"string"==typeof i?Ga(i,ja,za):i}});var Za=no,Ja=Zt;Ar({target:"Object",stat:!0,forced:!_t||s((function(){Za.f(1)}))},{getOwnPropertySymbols:function(t){var e=Za.f;return e?e(Ja(t)):[]}}),mo("asyncIterator"),mo("hasInstance"),mo("isConcatSpreadable"),mo("iterator"),mo("match"),mo("matchAll"),mo("replace"),mo("search"),mo("species"),mo("split");var Ka=To;mo("toPrimitive"),Ka();var qa=at,Qa=Oo;mo("toStringTag"),Qa(qa("Symbol"),"Symbol"),mo("unscopables"),Oo(o.JSON,"JSON",!0);var $a,tu,eu,ru=rt.Symbol,nu={},iu=O,ou=qt,su=Function.prototype,au=iu&&Object.getOwnPropertyDescriptor,uu=ou(su,"name"),cu={EXISTS:uu,PROPER:uu&&"something"===function(){}.name,CONFIGURABLE:uu&&(!iu||iu&&au(su,"name").configurable)},hu=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),lu=qt,du=P,fu=Zt,pu=hu,vu=Ai("IE_PROTO"),mu=Object,yu=mu.prototype,gu=pu?mu.getPrototypeOf:function(t){var e=fu(t);if(lu(e,vu))return e[vu];var r=e.constructor;return du(r)&&e instanceof r?r.prototype:e instanceof mu?yu:null},_u=s,bu=P,Tu=et,xu=ji,Eu=gu,Su=oo,wu=fe("iterator"),Ru=!1;[].keys&&("next"in(eu=[].keys())?(tu=Eu(Eu(eu)))!==Object.prototype&&($a=tu):Ru=!0);var Cu=!Tu($a)||_u((function(){var t={};return $a[wu].call(t)!==t}));bu(($a=Cu?{}:xu($a))[wu])||Su($a,wu,(function(){return this}));var Pu={IteratorPrototype:$a,BUGGY_SAFARI_ITERATORS:Ru},Au=Pu.IteratorPrototype,Ou=ji,Iu=U,Mu=Oo,Du=nu,Lu=function(){return this},Fu=function(t,e,r,n){var i=e+" Iterator";return t.prototype=Ou(Au,{next:Iu(+!n,r)}),Mu(t,i,!1,!0),Du[i]=Lu,t},Nu=P,ku=String,Bu=TypeError,Gu=S,Uu=nr,ju=function(t){if("object"==typeof t||Nu(t))return t;throw Bu("Can't set "+ku(t)+" as a prototype")},Xu=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Gu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Uu(r),ju(n),e?t(r,n):r.__proto__=n,r}}():void 0),Vu=Ar,Hu=D,Wu=cu,Yu=Fu,zu=gu,Zu=Oo,Ju=oo,Ku=nu,qu=Pu,Qu=Wu.PROPER,$u=qu.BUGGY_SAFARI_ITERATORS,tc=fe("iterator"),ec="keys",rc="values",nc="entries",ic=function(){return this},oc=function(t,e,r,n,i,o,s){Yu(r,e,n);var a,u,c,h=function(t){if(t===i&&v)return v;if(!$u&&t in f)return f[t];switch(t){case ec:case rc:case nc:return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",d=!1,f=t.prototype,p=f[tc]||f["@@iterator"]||i&&f[i],v=!$u&&p||h(i),m="Array"==e&&f.entries||p;if(m&&(a=zu(m.call(new t)))!==Object.prototype&&a.next&&(Zu(a,l,!0,!0),Ku[l]=ic),Qu&&i==rc&&p&&p.name!==rc&&(d=!0,v=function(){return Hu(p,this)}),i)if(u={values:h(rc),keys:o?v:h(ec),entries:h(nc)},s)for(c in u)($u||d||!(c in f))&&Ju(f,c,u[c]);else Vu({target:e,proto:!0,forced:$u||d},u);return s&&f[tc]!==v&&Ju(f,tc,v,{name:i}),Ku[e]=v,u},sc=function(t,e){return{value:t,done:e}},ac=Q,uc=function(){},cc=nu,hc=Yo,lc=(Qe.f,oc),dc=sc,fc="Array Iterator",pc=hc.set,vc=hc.getterFor(fc);lc(Array,"Array",(function(t,e){pc(this,{type:fc,target:ac(t),index:0,kind:e})}),(function(){var t=vc(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,dc(void 0,!0)):dc("keys"==r?n:"values"==r?e[n]:[n,e[n]],!1)}),"values");cc.Arguments=cc.Array;uc(),uc(),uc();var mc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},yc=o,gc=rn,_c=yr,bc=nu,Tc=fe("toStringTag");for(var xc in mc){var Ec=yc[xc],Sc=Ec&&Ec.prototype;Sc&&gc(Sc)!==Tc&&_c(Sc,Tc,xc),bc[xc]=bc.Array}var wc=ru;mo("asyncDispose"),mo("dispose"),mo("matcher"),mo("metadataKey"),mo("observable"),mo("metadata"),mo("patternMatch"),mo("replaceAll");var Rc=wc,Cc=S,Pc=Nr,Ac=Kn,Oc=J,Ic=Cc("".charAt),Mc=Cc("".charCodeAt),Dc=Cc("".slice),Lc=function(t){return function(e,r){var n,i,o=Ac(Oc(e)),s=Pc(r),a=o.length;return s<0||s>=a?t?"":void 0:(n=Mc(o,s))<55296||n>56319||s+1===a||(i=Mc(o,s+1))<56320||i>57343?t?Ic(o,s):n:t?Dc(o,s,s+2):i-56320+(n-55296<<10)+65536}},Fc={codeAt:Lc(!1),charAt:Lc(!0)},Nc=Fc.charAt,kc=Kn,Bc=Yo,Gc=oc,Uc=sc,jc="String Iterator",Xc=Bc.set,Vc=Bc.getterFor(jc);Gc(String,"String",(function(t){Xc(this,{type:jc,string:kc(t),index:0})}),(function(){var t,e=Vc(this),r=e.string,n=e.index;return n>=r.length?Uc(void 0,!0):(t=Nc(r,n),e.index+=t.length,Uc(t,!1))}));var Hc=so.f("iterator");function Wc(t){return Wc="function"==typeof Rc&&"symbol"==typeof Hc?function(t){return typeof t}:function(t){return t&&"function"==typeof Rc&&t.constructor===Rc&&t!==Rc.prototype?"symbol":typeof t},Wc(t)}var Yc=S,zc=It,Zc=et,Jc=qt,Kc=xa,qc=a,Qc=Function,$c=Yc([].concat),th=Yc([].join),eh={},rh=function(t,e,r){if(!Jc(eh,e)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";eh[e]=Qc("C,a","return new C("+th(n,",")+")")}return eh[e](t,r)},nh=qc?Qc.bind:function(t){var e=zc(this),r=e.prototype,n=Kc(arguments,1),i=function(){var r=$c(n,Kc(arguments));return this instanceof i?rh(e,r.length,r):e.apply(t,r)};return Zc(r)&&(i.prototype=r),i},ih=nh;Ar({target:"Function",proto:!0,forced:Function.bind!==ih},{bind:ih});var oh=rt,sh=function(t){return oh[t+"Prototype"]},ah=sh("Function").bind,uh=ut,ch=ah,hh=Function.prototype,lh=function(t){var e=t.bind;return t===hh||uh(hh,t)&&e===hh.bind?ch:e},dh=sh("Array").concat,fh=ut,ph=dh,vh=Array.prototype,mh=function(t){var e=t.concat;return t===vh||fh(vh,t)&&e===vh.concat?ph:e},yh=s,gh=function(t,e){var r=[][t];return!!r&&yh((function(){r.call(null,e||function(){return 1},1)}))},_h=ts.forEach,bh=gh("forEach")?[].forEach:function(t){return _h(this,t,arguments.length>1?arguments[1]:void 0)};Ar({target:"Array",proto:!0,forced:[].forEach!=bh},{forEach:bh});var Th=sh("Array").forEach,xh=rn,Eh=qt,Sh=ut,wh=Th,Rh=Array.prototype,Ch={DOMTokenList:!0,NodeList:!0},Ph=function(t){var e=t.forEach;return t===Rh||Sh(Rh,t)&&e===Rh.forEach||Eh(Ch,xh(t))?wh:e},Ah=ts.filter;Ar({target:"Array",proto:!0,forced:!Mn("filter")},{filter:function(t){return Ah(this,t,arguments.length>1?arguments[1]:void 0)}});var Oh=sh("Array").filter,Ih=ut,Mh=Oh,Dh=Array.prototype,Lh=function(t){var e=t.filter;return t===Dh||Ih(Dh,t)&&e===Dh.filter?Mh:e},Fh=Ar,Nh=ts.findIndex,kh="findIndex",Bh=!0;kh in[]&&Array(1).findIndex((function(){Bh=!1})),Fh({target:"Array",proto:!0,forced:Bh},{findIndex:function(t){return Nh(this,t,arguments.length>1?arguments[1]:void 0)}});var Gh=sh("Array").findIndex,Uh=ut,jh=Gh,Xh=Array.prototype,Vh=function(t){var e=t.findIndex;return t===Xh||Uh(Xh,t)&&e===Xh.findIndex?jh:e},Hh=O,Wh=Ir,Yh=TypeError,zh=Object.getOwnPropertyDescriptor,Zh=Hh&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),Jh=Ct,Kh=TypeError,qh=Ar,Qh=Zt,$h=ei,tl=Nr,el=jr,rl=Zh?function(t,e){if(Wh(t)&&!zh(t,"length").writable)throw Yh("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},nl=Vr,il=Pn,ol=zr,sl=function(t,e){if(!delete t[e])throw Kh("Cannot delete property "+Jh(e)+" of "+Jh(t))},al=Mn("splice"),ul=Math.max,cl=Math.min;qh({target:"Array",proto:!0,forced:!al},{splice:function(t,e){var r,n,i,o,s,a,u=Qh(this),c=el(u),h=$h(t,c),l=arguments.length;for(0===l?r=n=0:1===l?(r=0,n=c-h):(r=l-2,n=cl(ul(tl(e),0),c-h)),nl(c+r-n),i=il(u,n),o=0;o<n;o++)(s=h+o)in u&&ol(i,o,u[s]);if(i.length=n,r<n){for(o=h;o<c-n;o++)a=o+r,(s=o+n)in u?u[a]=u[s]:sl(u,a);for(o=c;o>c-n+r;o--)sl(u,o-1)}else if(r>n)for(o=c-n;o>h;o--)a=o+r-1,(s=o+n-1)in u?u[a]=u[s]:sl(u,a);for(o=0;o<r;o++)u[o+h]=arguments[o+2];return rl(u,c-n+r),i}});var hl=sh("Array").splice,ll=ut,dl=hl,fl=Array.prototype,pl=function(t){var e=t.splice;return t===fl||ll(fl,t)&&e===fl.splice?dl:e},vl=Ar,ml=ts.find,yl="find",gl=!0;yl in[]&&Array(1).find((function(){gl=!1})),vl({target:"Array",proto:!0,forced:gl},{find:function(t){return ml(this,t,arguments.length>1?arguments[1]:void 0)}});var _l=sh("Array").find,bl=ut,Tl=_l,xl=Array.prototype,El=function(t){var e=t.find;return t===xl||bl(xl,t)&&e===xl.find?Tl:e},Sl=Zt,wl=yi;Ar({target:"Object",stat:!0,forced:s((function(){wl(1)}))},{keys:function(t){return wl(Sl(t))}});var Rl=rt.Object.keys,Cl=si.includes;Ar({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(t){return Cl(this,t,arguments.length>1?arguments[1]:void 0)}});var Pl=sh("Array").includes,Al=et,Ol=T,Il=fe("match"),Ml=function(t){var e;return Al(t)&&(void 0!==(e=t[Il])?!!e:"RegExp"==Ol(t))},Dl=TypeError,Ll=function(t){if(Ml(t))throw Dl("The method doesn't accept regular expressions");return t},Fl=fe("match"),Nl=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Fl]=!1,"/./"[t](e)}catch(t){}}return!1},kl=Ar,Bl=Ll,Gl=J,Ul=Kn,jl=Nl,Xl=S("".indexOf);kl({target:"String",proto:!0,forced:!jl("includes")},{includes:function(t){return!!~Xl(Ul(Gl(this)),Ul(Bl(t)),arguments.length>1?arguments[1]:void 0)}});var Vl=sh("String").includes,Hl=ut,Wl=Pl,Yl=Vl,zl=Array.prototype,Zl=String.prototype,Jl=function(t){var e=t.includes;return t===zl||Hl(zl,t)&&e===zl.includes?Wl:"string"==typeof t||t===Zl||Hl(Zl,t)&&e===Zl.includes?Yl:e},Kl=TypeError,ql=function(t,e){if(t<e)throw Kl("Not enough arguments");return t},Ql=o,$l=d,td=P,ed=xa,rd=ql,nd=/MSIE .\./.test(ct),id=Ql.Function,od=function(t){return nd?function(e,r){var n=rd(arguments.length,1)>2,i=td(e)?e:id(e),o=n?ed(arguments,2):void 0;return t(n?function(){$l(i,this,o)}:i,r)}:t},sd={setTimeout:od(Ql.setTimeout),setInterval:od(Ql.setInterval)},ad=sd.setInterval;Ar({global:!0,bind:!0,forced:o.setInterval!==ad},{setInterval:ad});var ud=sd.setTimeout;Ar({global:!0,bind:!0,forced:o.setTimeout!==ud},{setTimeout:ud});var cd=rt.setTimeout,hd=ts.map;Ar({target:"Array",proto:!0,forced:!Mn("map")},{map:function(t){return hd(this,t,arguments.length>1?arguments[1]:void 0)}});var ld=sh("Array").map,dd=ut,fd=ld,pd=Array.prototype,vd=function(t){var e=t.map;return t===pd||dd(pd,t)&&e===pd.map?fd:e},md=ts.some;Ar({target:"Array",proto:!0,forced:!gh("some")},{some:function(t){return md(this,t,arguments.length>1?arguments[1]:void 0)}});var yd=sh("Array").some,gd=ut,_d=yd,bd=Array.prototype,Td=function(t){var e=t.some;return t===bd||gd(bd,t)&&e===bd.some?_d:e},xd=function(){return xd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},xd.apply(this,arguments)};function Ed(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function Sd(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function wd(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rd(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}let Cd=!0,Pd=!0;function Ad(t,e,r){const n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function Od(t,e,r){if(!t.RTCPeerConnection)return;const n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(t,n){if(t!==e)return i.apply(this,arguments);const o=t=>{const e=r(t);e&&(n.handleEvent?n.handleEvent(e):n(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(n,o),i.apply(this,[t,o])};const o=n.removeEventListener;n.removeEventListener=function(t,r){if(t!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(r))return o.apply(this,arguments);const n=this._eventMap[e].get(r);return this._eventMap[e].delete(r),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[t,n])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(t){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),t&&this.addEventListener(e,this["_on"+e]=t)},enumerable:!0,configurable:!0})}function Id(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(Cd=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Md(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(Pd=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Dd(){if("object"==typeof window){if(Cd)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function Ld(t,e){Pd&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Fd(t){return"[object Object]"===Object.prototype.toString.call(t)}function Nd(t){return Fd(t)?Object.keys(t).reduce((function(e,r){const n=Fd(t[r]),i=n?Nd(t[r]):t[r],o=n&&!Object.keys(i).length;return void 0===i||o?e:Object.assign(e,{[r]:i})}),{}):t}function kd(t,e,r){e&&!r.has(e.id)&&(r.set(e.id,e),Object.keys(e).forEach((n=>{n.endsWith("Id")?kd(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach((e=>{kd(t,t.get(e),r)}))})))}function Bd(t,e,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const o=[];return t.forEach((t=>{"track"===t.type&&t.trackIdentifier===e.id&&o.push(t)})),o.forEach((e=>{t.forEach((r=>{r.type===n&&r.trackId===e.id&&kd(t,r,i)}))})),i}const Gd=Dd;function Ud(t,e){const r=t&&t.navigator;if(!r.mediaDevices)return;const n=function(t){if("object"!=typeof t||t.mandatory||t.optional)return t;const e={};return Object.keys(t).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof t[r]?t[r]:{ideal:t[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(t,e){return t?t+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==n.ideal){e.optional=e.optional||[];let t={};"number"==typeof n.ideal?(t[i("min",r)]=n.ideal,e.optional.push(t),t={},t[i("max",r)]=n.ideal,e.optional.push(t)):(t[i("",r)]=n.ideal,e.optional.push(t))}void 0!==n.exact&&"number"!=typeof n.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",r)]=n.exact):["min","max"].forEach((t=>{void 0!==n[t]&&(e.mandatory=e.mandatory||{},e.mandatory[i(t,r)]=n[t])}))})),t.advanced&&(e.optional=(e.optional||[]).concat(t.advanced)),e},i=function(t,i){if(e.version>=61)return i(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"==typeof t.audio){const e=function(t,e,r){e in t&&!(r in t)&&(t[r]=t[e],delete t[e])};e((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),e(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=n(t.audio)}if(t&&"object"==typeof t.video){let o=t.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=e.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let e;if(delete t.video.facingMode,"environment"===o.exact||"environment"===o.ideal?e=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(e=["front"]),e)return r.mediaDevices.enumerateDevices().then((r=>{r=r.filter((t=>"videoinput"===t.kind));let s=r.find((t=>e.some((e=>t.label.toLowerCase().includes(e)))));return!s&&r.length&&e.includes("back")&&(s=r[r.length-1]),s&&(t.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),t.video=n(t.video),Gd("chrome: "+JSON.stringify(t)),i(t)}))}t.video=n(t.video)}return Gd("chrome: "+JSON.stringify(t)),i(t)},o=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(t,e,n){i(t,(t=>{r.webkitGetUserMedia(t,e,(t=>{n&&n(o(t))}))}))}.bind(r),r.mediaDevices.getUserMedia){const t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return i(e,(e=>t(e).then((t=>{if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((t=>{t.stop()})),new DOMException("","NotFoundError");return t}),(t=>Promise.reject(o(t))))))}}}function jd(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function Xd(t){if("object"==typeof t&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",(r=>{let n;n=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((t=>t.track&&t.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[e.stream],this.dispatchEvent(i)})),e.stream.getTracks().forEach((r=>{let n;n=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((t=>t.track&&t.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[e.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Od(t,"track",(t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t)))}function Vd(t){if("object"==typeof t&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(t,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=t.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,n){let i=r.apply(this,arguments);return i||(i=e(this,t),this._senders.push(i)),i};const n=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){n.apply(this,arguments);const e=this._senders.indexOf(t);-1!==e&&this._senders.splice(e,1)}}const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach((t=>{this._senders.push(e(this,t))}))};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._senders=this._senders||[],n.apply(this,[t]),t.getTracks().forEach((t=>{const e=this._senders.find((e=>e.track===t));e&&this._senders.splice(this._senders.indexOf(e),1)}))}}else if("object"==typeof t&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Hd(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,r,n]=arguments;if(arguments.length>0&&"function"==typeof t)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof t))return e.apply(this,[]);const i=function(t){const e={};return t.result().forEach((t=>{const r={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach((e=>{r[e]=t.stat(e)})),e[r.id]=r})),e},o=function(t){return new Map(Object.keys(t).map((e=>[e,t[e]])))};if(arguments.length>=2){const n=function(t){r(o(i(t)))};return e.apply(this,[n,t])}return new Promise(((t,r)=>{e.apply(this,[function(e){t(o(i(e)))},r])})).then(r,n)}}function Wd(t){if(!("object"==typeof t&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=r.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){const t=this;return this._pc.getStats().then((e=>Bd(e,t.track,!0)))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t}),Od(t,"track",(t=>(t.receiver._pc=t.srcElement,t))),t.RTCRtpReceiver.prototype.getStats=function(){const t=this;return this._pc.getStats().then((e=>Bd(e,t.track,!1)))}}if(!("getStats"in t.RTCRtpSender.prototype)||!("getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const t=arguments[0];let e,r,n;return this.getSenders().forEach((r=>{r.track===t&&(e?n=!0:e=r)})),this.getReceivers().forEach((e=>(e.track===t&&(r?n=!0:r=e),e.track===t))),n||e&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Yd(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((t=>this._shimmedLocalStreams[t][0]))};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,r){if(!r)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=e.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach((t=>{const e=this.getSenders().find((e=>e.track===t));if(e)throw new DOMException("Track already exists.","InvalidAccessError")}));const e=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((t=>-1===e.indexOf(t)));this._shimmedLocalStreams[t.id]=[t].concat(n)};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],n.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach((e=>{const r=this._shimmedLocalStreams[e].indexOf(t);-1!==r&&this._shimmedLocalStreams[e].splice(r,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]})),i.apply(this,arguments)}}function zd(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Yd(t);const r=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const t=r.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((t=>this._reverseStreams[t.id]))};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach((t=>{const e=this.getSenders().find((e=>e.track===t));if(e)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[e.id]){const r=new t.MediaStream(e.getTracks());this._streams[e.id]=r,this._reverseStreams[r.id]=e,e=r}n.apply(this,[e])};const i=t.RTCPeerConnection.prototype.removeStream;function o(t,e){let r=e.sdp;return Object.keys(t._reverseStreams||[]).forEach((e=>{const n=t._reverseStreams[e],i=t._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:e.type,sdp:r})}function s(t,e){let r=e.sdp;return Object.keys(t._reverseStreams||[]).forEach((e=>{const n=t._reverseStreams[e],i=t._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:e.type,sdp:r})}t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(e,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((t=>t===e)))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find((t=>t.track===e));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(e),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new t.MediaStream([e]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((t=>t.track===e))},["createOffer","createAnswer"].forEach((function(e){const r=t.RTCPeerConnection.prototype[e],n={[e](){const t=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[e=>{const r=o(this,e);t[0].apply(null,[r])},e=>{t[1]&&t[1].apply(null,e)},arguments[2]]):r.apply(this,arguments).then((t=>o(this,t)))}};t.RTCPeerConnection.prototype[e]=n[e]}));const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const u=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const t=u.get.apply(this);return""===t.type?t:o(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(t._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((e=>t.track===e))&&(e=this._streams[r])})),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Zd(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const r=t.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=n[e]}))}function Jd(t,e){Od(t,"negotiationneeded",(t=>{const r=t.target;if(!(e.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return t}))}var Kd=Object.freeze({__proto__:null,shimMediaStream:jd,shimOnTrack:Xd,shimGetSendersWithDtmf:Vd,shimGetStats:Hd,shimSenderReceiverGetStats:Wd,shimAddTrackRemoveTrackWithNative:Yd,shimAddTrackRemoveTrack:zd,shimPeerConnection:Zd,fixNegotiationNeeded:Jd,shimGetUserMedia:Ud,shimGetDisplayMedia:function(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof e?t.navigator.mediaDevices.getDisplayMedia=function(r){return e(r).then((e=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),t.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function qd(t,e){const r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(t,e,n){Ld("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(t).then(e,n)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const t=function(t,e,r){e in t&&!(r in t)&&(t[r]=t[e],delete t[e])},e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),t(r.audio,"autoGainControl","mozAutoGainControl"),t(r.audio,"noiseSuppression","mozNoiseSuppression")),e(r)},n&&n.prototype.getSettings){const e=n.prototype.getSettings;n.prototype.getSettings=function(){const r=e.apply(this,arguments);return t(r,"mozAutoGainControl","autoGainControl"),t(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const e=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),t(r,"autoGainControl","mozAutoGainControl"),t(r,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[r])}}}}function Qd(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function $d(t,e){if("object"!=typeof t||!t.RTCPeerConnection&&!t.mozRTCPeerConnection)return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const r=t.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=n[e]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,i,o]=arguments;return n.apply(this,[t||null]).then((t=>{if(e.version<53&&!i)try{t.forEach((t=>{t.type=r[t.type]||t.type}))}catch(e){if("TypeError"!==e.name)throw e;t.forEach(((e,n)=>{t.set(n,Object.assign({},e,{type:r[e.type]||e.type}))}))}return t})).then(i,o)}}function tf(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=r.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ef(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t}),Od(t,"track",(t=>(t.receiver._pc=t.srcElement,t))),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function rf(t){t.RTCPeerConnection&&!("removeStream"in t.RTCPeerConnection.prototype)&&(t.RTCPeerConnection.prototype.removeStream=function(t){Ld("removeStream","removeTrack"),this.getSenders().forEach((e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)}))})}function nf(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function of(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let t=arguments[1]&&arguments[1].sendEncodings;void 0===t&&(t=[]),t=[...t];const r=t.length>0;r&&t.forEach((t=>{if("rid"in t){if(!/^[a-z0-9]{0,16}$/i.test(t.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in t&&!(parseFloat(t.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in t&&!(parseFloat(t.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=e.apply(this,arguments);if(r){const{sender:e}=n,r=e.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=t,e.sendEncodings=t,this.setParametersPromises.push(e.setParameters(r).then((()=>{delete e.sendEncodings})).catch((()=>{delete e.sendEncodings}))))}return n})}function sf(t){if("object"!=typeof t||!t.RTCRtpSender)return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}function af(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>e.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):e.apply(this,arguments)}}function uf(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>e.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):e.apply(this,arguments)}}var cf=Object.freeze({__proto__:null,shimOnTrack:Qd,shimPeerConnection:$d,shimSenderGetStats:tf,shimReceiverGetStats:ef,shimRemoveStream:rf,shimRTCDataChannel:nf,shimAddTransceiver:of,shimGetParameters:sf,shimCreateOffer:af,shimCreateAnswer:uf,shimGetUserMedia:qd,shimGetDisplayMedia:function(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const t=new DOMException("getDisplayMedia without video constraints is undefined");return t.name="NotFoundError",t.code=8,Promise.reject(t)}return!0===r.video?r.video={mediaSource:e}:r.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(r)})}});function hf(t){if("object"==typeof t&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach((r=>e.call(this,r,t))),t.getVideoTracks().forEach((r=>e.call(this,r,t)))},t.RTCPeerConnection.prototype.addTrack=function(t,...r){return r&&r.forEach((t=>{this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]})),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(t);if(-1===e)return;this._localStreams.splice(e,1);const r=t.getTracks();this.getSenders().forEach((t=>{r.includes(t.track)&&this.removeTrack(t)}))})}}function lf(t){if("object"==typeof t&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=t=>{t.streams.forEach((t=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(t))return;this._remoteStreams.push(t);const e=new Event("addstream");e.stream=t,this.dispatchEvent(e)}))})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((e=>{if(t._remoteStreams||(t._remoteStreams=[]),t._remoteStreams.indexOf(e)>=0)return;t._remoteStreams.push(e);const r=new Event("addstream");r.stream=e,t.dispatchEvent(r)}))}),e.apply(t,arguments)}}}function df(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,r=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,o=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(t,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return e?(i.then(t,e),Promise.resolve()):i},e.createAnswer=function(t,e){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return e?(i.then(t,e),Promise.resolve()):i};let a=function(t,e,r){const n=i.apply(this,[t]);return r?(n.then(e,r),Promise.resolve()):n};e.setLocalDescription=a,a=function(t,e,r){const n=o.apply(this,[t]);return r?(n.then(e,r),Promise.resolve()):n},e.setRemoteDescription=a,a=function(t,e,r){const n=s.apply(this,[t]);return r?(n.then(e,r),Promise.resolve()):n},e.addIceCandidate=a}function ff(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=t=>r(pf(t))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(t,r,n){e.mediaDevices.getUserMedia(t).then(r,n)}.bind(e))}function pf(t){return t&&void 0!==t.video?Object.assign({},t,{video:Nd(t.video)}):t}function vf(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(t,r){if(t&&t.iceServers){const e=[];for(let r=0;r<t.iceServers.length;r++){let n=t.iceServers[r];void 0===n.urls&&n.url?(Ld("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,e.push(n)):e.push(t.iceServers[r])}t.iceServers=e}return new e(t,r)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function mf(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function yf(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);const e=this.getTransceivers().find((t=>"audio"===t.receiver.track.kind));!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);const r=this.getTransceivers().find((t=>"video"===t.receiver.track.kind));!1===t.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==t.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function gf(t){"object"!=typeof t||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var _f=Object.freeze({__proto__:null,shimLocalStreamsAPI:hf,shimRemoteStreamsAPI:lf,shimCallbacksAPI:df,shimGetUserMedia:ff,shimConstraints:pf,shimRTCIceServerUrls:vf,shimTrackEventTransceiver:mf,shimCreateOfferLegacy:yf,shimAudioContext:gf}),bf={exports:{}};!function(t){const e={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split("\n").map((t=>t.trim()))},e.splitSections=function(t){return t.split("\nm=").map(((t,e)=>(e>0?"m="+t:t).trim()+"\r\n"))},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter((t=>0===t.indexOf(r)))},e.parseCandidate=function(t){let e;e=0===t.indexOf("a=candidate:")?t.substring(12).split(" "):t.substring(10).split(" ");const r={foundation:e[0],component:{1:"rtp",2:"rtcp"}[e[1]]||e[1],protocol:e[2].toLowerCase(),priority:parseInt(e[3],10),ip:e[4],address:e[4],port:parseInt(e[5],10),type:e[7]};for(let t=8;t<e.length;t+=2)switch(e[t]){case"raddr":r.relatedAddress=e[t+1];break;case"rport":r.relatedPort=parseInt(e[t+1],10);break;case"tcptype":r.tcpType=e[t+1];break;case"ufrag":r.ufrag=e[t+1],r.usernameFragment=e[t+1];break;default:void 0===r[e[t]]&&(r[e[t]]=e[t+1])}return r},e.writeCandidate=function(t){const e=[];e.push(t.foundation);const r=t.component;"rtp"===r?e.push(1):"rtcp"===r?e.push(2):e.push(r),e.push(t.protocol.toUpperCase()),e.push(t.priority),e.push(t.address||t.ip),e.push(t.port);const n=t.type;return e.push("typ"),e.push(n),"host"!==n&&t.relatedAddress&&t.relatedPort&&(e.push("raddr"),e.push(t.relatedAddress),e.push("rport"),e.push(t.relatedPort)),t.tcpType&&"tcp"===t.protocol.toLowerCase()&&(e.push("tcptype"),e.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(e.push("ufrag"),e.push(t.usernameFragment||t.ufrag)),"candidate:"+e.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let e=t.substring(9).split(" ");const r={payloadType:parseInt(e.shift(),10)};return e=e[0].split("/"),r.name=e[0],r.clockRate=parseInt(e[1],10),r.channels=3===e.length?parseInt(e[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(t){let e=t.payloadType;void 0!==t.preferredPayloadType&&(e=t.preferredPayloadType);const r=t.channels||t.numChannels||1;return"a=rtpmap:"+e+" "+t.name+"/"+t.clockRate+(1!==r?"/"+r:"")+"\r\n"},e.parseExtmap=function(t){const e=t.substring(9).split(" ");return{id:parseInt(e[0],10),direction:e[0].indexOf("/")>0?e[0].split("/")[1]:"sendrecv",uri:e[1],attributes:e.slice(2).join(" ")}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&"sendrecv"!==t.direction?"/"+t.direction:"")+" "+t.uri+(t.attributes?" "+t.attributes:"")+"\r\n"},e.parseFmtp=function(t){const e={};let r;const n=t.substring(t.indexOf(" ")+1).split(";");for(let t=0;t<n.length;t++)r=n[t].trim().split("="),e[r[0].trim()]=r[1];return e},e.writeFmtp=function(t){let e="",r=t.payloadType;if(void 0!==t.preferredPayloadType&&(r=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const n=[];Object.keys(t.parameters).forEach((e=>{void 0!==t.parameters[e]?n.push(e+"="+t.parameters[e]):n.push(e)})),e+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return e},e.parseRtcpFb=function(t){const e=t.substring(t.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},e.writeRtcpFb=function(t){let e="",r=t.payloadType;return void 0!==t.preferredPayloadType&&(r=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach((t=>{e+="a=rtcp-fb:"+r+" "+t.type+(t.parameter&&t.parameter.length?" "+t.parameter:"")+"\r\n"})),e},e.parseSsrcMedia=function(t){const e=t.indexOf(" "),r={ssrc:parseInt(t.substring(7,e),10)},n=t.indexOf(":",e);return n>-1?(r.attribute=t.substring(e+1,n),r.value=t.substring(n+1)):r.attribute=t.substring(e+1),r},e.parseSsrcGroup=function(t){const e=t.substring(13).split(" ");return{semantics:e.shift(),ssrcs:e.map((t=>parseInt(t,10)))}},e.getMid=function(t){const r=e.matchPrefix(t,"a=mid:")[0];if(r)return r.substring(6)},e.parseFingerprint=function(t){const e=t.substring(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},e.getDtlsParameters=function(t,r){return{role:"auto",fingerprints:e.matchPrefix(t+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,e){let r="a=setup:"+e+"\r\n";return t.fingerprints.forEach((t=>{r+="a=fingerprint:"+t.algorithm+" "+t.value+"\r\n"})),r},e.parseCryptoLine=function(t){const e=t.substring(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+("object"==typeof t.keyParams?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+"\r\n"},e.parseCryptoKeyParams=function(t){if(0!==t.indexOf("inline:"))return null;const e=t.substring(7).split("|");return{keyMethod:"inline",keySalt:e[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,r){return e.matchPrefix(t+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,r){const n=e.matchPrefix(t+r,"a=ice-ufrag:")[0],i=e.matchPrefix(t+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},e.writeIceParameters=function(t){let e="a=ice-ufrag:"+t.usernameFragment+"\r\na=ice-pwd:"+t.password+"\r\n";return t.iceLite&&(e+="a=ice-lite\r\n"),e},e.parseRtpParameters=function(t){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=e.splitLines(t)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],s=e.matchPrefix(t,"a=rtpmap:"+o+" ")[0];if(s){const n=e.parseRtpMap(s),i=e.matchPrefix(t,"a=fmtp:"+o+" ");switch(n.parameters=i.length?e.parseFmtp(i[0]):{},n.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+o+" ").map(e.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}e.matchPrefix(t,"a=extmap:").forEach((t=>{r.headerExtensions.push(e.parseExtmap(t))}));const i=e.matchPrefix(t,"a=rtcp-fb:* ").map(e.parseRtcpFb);return r.codecs.forEach((t=>{i.forEach((e=>{t.rtcpFeedback.find((t=>t.type===e.type&&t.parameter===e.parameter))||t.rtcpFeedback.push(e)}))})),r},e.writeRtpDescription=function(t,r){let n="";n+="m="+t+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((t=>void 0!==t.preferredPayloadType?t.preferredPayloadType:t.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((t=>{n+=e.writeRtpMap(t),n+=e.writeFmtp(t),n+=e.writeRtcpFb(t)}));let i=0;return r.codecs.forEach((t=>{t.maxptime>i&&(i=t.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((t=>{n+=e.writeExtmap(t)})),n},e.parseRtpEncodingParameters=function(t){const r=[],n=e.parseRtpParameters(t),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=e.matchPrefix(t,"a=ssrc:").map((t=>e.parseSsrcMedia(t))).filter((t=>"cname"===t.attribute)),a=s.length>0&&s[0].ssrc;let u;const c=e.matchPrefix(t,"a=ssrc-group:FID").map((t=>t.substring(17).split(" ").map((t=>parseInt(t,10)))));c.length>0&&c[0].length>1&&c[0][0]===a&&(u=c[0][1]),n.codecs.forEach((t=>{if("RTX"===t.name.toUpperCase()&&t.parameters.apt){let e={ssrc:a,codecPayloadType:parseInt(t.parameters.apt,10)};a&&u&&(e.rtx={ssrc:u}),r.push(e),i&&(e=JSON.parse(JSON.stringify(e)),e.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(e))}})),0===r.length&&a&&r.push({ssrc:a});let h=e.matchPrefix(t,"b=");return h.length&&(h=0===h[0].indexOf("b=TIAS:")?parseInt(h[0].substring(7),10):0===h[0].indexOf("b=AS:")?1e3*parseInt(h[0].substring(5),10)*.95-16e3:void 0,r.forEach((t=>{t.maxBitrate=h}))),r},e.parseRtcpParameters=function(t){const r={},n=e.matchPrefix(t,"a=ssrc:").map((t=>e.parseSsrcMedia(t))).filter((t=>"cname"===t.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=e.matchPrefix(t,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=e.matchPrefix(t,"a=rtcp-mux");return r.mux=o.length>0,r},e.writeRtcpParameters=function(t){let e="";return t.reducedSize&&(e+="a=rtcp-rsize\r\n"),t.mux&&(e+="a=rtcp-mux\r\n"),void 0!==t.ssrc&&t.cname&&(e+="a=ssrc:"+t.ssrc+" cname:"+t.cname+"\r\n"),e},e.parseMsid=function(t){let r;const n=e.matchPrefix(t,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=e.matchPrefix(t,"a=ssrc:").map((t=>e.parseSsrcMedia(t))).filter((t=>"msid"===t.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},e.parseSctpDescription=function(t){const r=e.parseMLine(t),n=e.matchPrefix(t,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=e.matchPrefix(t,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const s=e.matchPrefix(t,"a=sctpmap:");if(s.length>0){const t=s[0].substring(10).split(" ");return{port:parseInt(t[0],10),protocol:t[1],maxMessageSize:i}}},e.writeSctpDescription=function(t,e){let r=[];return r="DTLS/SCTP"!==t.protocol?["m="+t.kind+" 9 "+t.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+t.kind+" 9 "+t.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&r.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),r.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(t,r,n){let i;const o=void 0!==r?r:2;i=t||e.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},e.getDirection=function(t,r){const n=e.splitLines(t);for(let t=0;t<n.length;t++)switch(n[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[t].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substring(2)},e.isRejected=function(t){return"0"===t.split(" ",2)[1]},e.parseMLine=function(t){const r=e.splitLines(t)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},e.parseOLine=function(t){const r=e.matchPrefix(t,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},e.isValidSDP=function(t){if("string"!=typeof t||0===t.length)return!1;const r=e.splitLines(t);for(let t=0;t<r.length;t++)if(r[t].length<2||"="!==r[t].charAt(1))return!1;return!0},t.exports=e}(bf);var Tf=bf.exports,xf=t({__proto__:null,default:Tf},[bf.exports]);function Ef(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substring(2)),t.candidate&&t.candidate.length){const r=new e(t),n=Tf.parseCandidate(t.candidate);for(const t in n)t in r||Object.defineProperty(r,t,{value:n[t]});return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,Od(t,"icecandidate",(e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new t.RTCIceCandidate(e.candidate),writable:"false"}),e)))}function Sf(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||Od(t,"icecandidate",(t=>{if(t.candidate){const e=Tf.parseCandidate(t.candidate.candidate);"relay"===e.type&&(t.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[e.priority>>24])}return t}))}function wf(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=function(t){if(!t||!t.sdp)return!1;const e=Tf.splitSections(t.sdp);return e.shift(),e.some((t=>{const e=Tf.parseMLine(t);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")}))},n=function(t){const e=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const r=parseInt(e[1],10);return r!=r?-1:r},i=function(t){let r=65536;return"firefox"===e.browser&&(r=e.version<57?-1===t?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),r},o=function(t,r){let n=65536;"firefox"===e.browser&&57===e.version&&(n=65535);const i=Tf.matchPrefix(t.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===e.browser&&-1!==r&&(n=2147483637),n},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:t}=this.getConfiguration();"plan-b"===t&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(r(arguments[0])){const t=n(arguments[0]),e=i(t),r=o(arguments[0],t);let s;s=0===e&&0===r?Number.POSITIVE_INFINITY:0===e||0===r?Math.max(e,r):Math.min(e,r);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function Rf(t){if(!t.RTCPeerConnection||!("createDataChannel"in t.RTCPeerConnection.prototype))return;function e(t,e){const r=t.send;t.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===t.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return r.apply(t,arguments)}}const r=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const t=r.apply(this,arguments);return e(t,this),t},Od(t,"datachannel",(t=>(e(t.channel,t.target),t)))}function Cf(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((t=>{const r=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=t=>{const e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const r=new Event("connectionstatechange",t);e.dispatchEvent(r)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function Pf(t,e){if(!t.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const r=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const r=e.sdp.split("\n").filter((t=>"a=extmap-allow-mixed"!==t.trim())).join("\n");t.RTCSessionDescription&&e instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:e.type,sdp:r}):e.sdp=r}return r.apply(this,arguments)}}function Af(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const r=t.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Of(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const r=t.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let t=arguments[0]||{};if("object"!=typeof t||t.type&&t.sdp)return r.apply(this,arguments);if(t={type:t.type,sdp:t.sdp},!t.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":t.type="offer";break;default:t.type="answer"}if(t.sdp||"offer"!==t.type&&"answer"!==t.type)return r.apply(this,[t]);const e="offer"===t.type?this.createOffer:this.createAnswer;return e.apply(this).then((t=>r.apply(this,[t])))})}var If=Object.freeze({__proto__:null,shimRTCIceCandidate:Ef,shimRTCIceCandidateRelayProtocol:Sf,shimMaxMessageSize:wf,shimSendThrowTypeError:Rf,shimConnectionState:Cf,removeExtmapAllowMixed:Pf,shimAddIceCandidateNullOrEmpty:Af,shimParameterlessSetLocalDescription:Of});const Mf=function({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=Dd,n=function(t){const e={browser:null,version:null};if(void 0===t||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:r}=t;if(r.mozGetUserMedia)e.browser="firefox",e.version=Ad(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=Ad(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=Ad(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype}return e}(t),i={browserDetails:n,commonShim:If,extractVersion:Ad,disableLog:Id,disableWarnings:Md,sdp:xf};switch(n.browser){case"chrome":if(!Kd||!Zd||!e.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(null===n.version)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=Kd,Af(t,n),Of(t),Ud(t,n),jd(t),Zd(t,n),Xd(t),zd(t,n),Vd(t),Hd(t),Wd(t),Jd(t,n),Ef(t),Sf(t),Cf(t),wf(t,n),Rf(t),Pf(t,n);break;case"firefox":if(!cf||!$d||!e.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=cf,Af(t,n),Of(t),qd(t,n),$d(t,n),Qd(t),rf(t),tf(t),ef(t),nf(t),of(t),sf(t),af(t),uf(t),Ef(t),Cf(t),wf(t,n),Rf(t);break;case"safari":if(!_f||!e.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=_f,Af(t,n),Of(t),vf(t),yf(t),df(t),hf(t),lf(t),mf(t),ff(t),gf(t),Ef(t),Sf(t),wf(t,n),Rf(t),Pf(t,n);break;default:r("Unsupported browser!")}return i}({window:"undefined"==typeof window?void 0:window});let Df=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"");var Lf={exports:{}},Ff=1e3,Nf=60*Ff,kf=60*Nf,Bf=24*kf,Gf=7*Bf,Uf=365.25*Bf,jf=function(t,e){e=e||{};var r=typeof t;if("string"===r&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*Uf;case"weeks":case"week":case"w":return r*Gf;case"days":case"day":case"d":return r*Bf;case"hours":case"hour":case"hrs":case"hr":case"h":return r*kf;case"minutes":case"minute":case"mins":case"min":case"m":return r*Nf;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ff;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===r&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=Bf)return Xf(t,e,Bf,"day");if(e>=kf)return Xf(t,e,kf,"hour");if(e>=Nf)return Xf(t,e,Nf,"minute");if(e>=Ff)return Xf(t,e,Ff,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=Bf)return Math.round(t/Bf)+"d";if(e>=kf)return Math.round(t/kf)+"h";if(e>=Nf)return Math.round(t/Nf)+"m";if(e>=Ff)return Math.round(t/Ff)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Xf(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}var Vf=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t);(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function n(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(n),...e.skips.map(n).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=jf,e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e};!function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=Vf(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(Lf,Lf.exports);var Hf,Wf,Yf=Lf.exports,zf="2.1.1",Zf="max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;",Jf={"120p":{width:160,height:120,frameRate:15,bitrate:200},"180p":{width:320,height:180,frameRate:15,bitrate:350},"240p":{width:320,height:240,frameRate:15,bitrate:400},"360p":{width:640,height:360,frameRate:15,bitrate:800},"480p":{width:640,height:480,frameRate:15,bitrate:900},"720p":{width:1280,height:720,frameRate:15,bitrate:1500},"1080p":{width:1920,height:1080,frameRate:15,bitrate:2e3},"2K":{width:2560,height:1440,frameRate:30,bitrate:4860},"4K":{width:3840,height:2160,frameRate:30,bitrate:9e3}},Kf={standard:{sampleRate:48e3,bitrate:40},high:{sampleRate:48e3,bitrate:128}};!function(t){t[t.TXLIVE_ERROR_WEBRTC_FAILED=-1]="TXLIVE_ERROR_WEBRTC_FAILED",t[t.TXLIVE_ERROR_REQUEST_FAILED=-2]="TXLIVE_ERROR_REQUEST_FAILED",t[t.TXLIVE_WARNING_CAMERA_START_FAILED=-1001]="TXLIVE_WARNING_CAMERA_START_FAILED",t[t.TXLIVE_WARNING_MICROPHONE_START_FAILED=-1002]="TXLIVE_WARNING_MICROPHONE_START_FAILED",t[t.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED=-1003]="TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED",t[t.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED=-1004]="TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED",t[t.TXLIVE_WARNING_CAMERA_INTERRUPTED=-1005]="TXLIVE_WARNING_CAMERA_INTERRUPTED",t[t.TXLIVE_WARNING_MICROPHONE_INTERRUPTED=-1006]="TXLIVE_WARNING_MICROPHONE_INTERRUPTED",t[t.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED=-1007]="TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED"}(Hf||(Hf={})),function(t){t[t.TXLIVE_PUSH_STATUS_DISCONNECTED=0]="TXLIVE_PUSH_STATUS_DISCONNECTED",t[t.TXLIVE_PUSH_STATUS_CONNECTING=1]="TXLIVE_PUSH_STATUS_CONNECTING",t[t.TXLIVE_PUSH_STATUS_CONNECTED=2]="TXLIVE_PUSH_STATUS_CONNECTED",t[t.TXLIVE_PUSH_STATUS_RECONNECTING=3]="TXLIVE_PUSH_STATUS_RECONNECTING"}(Wf||(Wf={}));var qf,Qf,$f="disconnected",tp="connecting",ep="connected",rp="request_push_start",np="request_push_success",ip=["device","screen","file"],op={deviceId:"",frameRate:15,resolution:{width:1280,height:720}},sp={deviceId:"",sampleRate:48e3,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},ap=["image/bmp","image/jpeg","image/png"],up=[".bmp",".jpeg",".jpg",".png"],cp={type:mh(qf=["video/mp4","video/webm","video/ogg","audio/mpeg","audio/ogg","audio/wav"]).call(qf,ap),extension:mh(Qf=[".mp4",".webm",".ogg",".mp3",".wav"]).call(Qf,up)},hp="track_stop",lp="stream_stop",dp=["user","environment"],fp="object"==typeof global&&global&&global.Object===Object&&global,pp="object"==typeof self&&self&&self.Object===Object&&self,vp=fp||pp||Function("return this")(),mp=vp.Symbol,yp=Object.prototype,gp=yp.hasOwnProperty,_p=yp.toString,bp=mp?mp.toStringTag:void 0;var Tp=Object.prototype.toString;var xp=mp?mp.toStringTag:void 0;function Ep(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":xp&&xp in Object(t)?function(t){var e=gp.call(t,bp),r=t[bp];try{t[bp]=void 0;var n=!0}catch(t){}var i=_p.call(t);return n&&(e?t[bp]=r:delete t[bp]),i}(t):function(t){return Tp.call(t)}(t)}function Sp(t){return null!=t&&"object"==typeof t}var wp=Array.isArray;function Rp(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Cp(t){return t}function Pp(t){if(!Rp(t))return!1;var e=Ep(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Ap=vp["__core-js_shared__"],Op=function(){var t=/[^.]+$/.exec(Ap&&Ap.keys&&Ap.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Ip=Function.prototype.toString;function Mp(t){if(null!=t){try{return Ip.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Dp=/^\[object .+?Constructor\]$/,Lp=Function.prototype,Fp=Object.prototype,Np=Lp.toString,kp=Fp.hasOwnProperty,Bp=RegExp("^"+Np.call(kp).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gp(t){return!(!Rp(t)||(e=t,Op&&Op in e))&&(Pp(t)?Bp:Dp).test(Mp(t));var e}function Up(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Gp(r)?r:void 0}var jp=Up(vp,"WeakMap"),Xp=Object.create,Vp=function(){function t(){}return function(e){if(!Rp(e))return{};if(Xp)return Xp(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Hp(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Wp=Date.now;var Yp,zp,Zp,Jp=function(){try{var t=Up(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Kp=Jp,qp=Kp?function(t,e){return Kp(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:Cp,Qp=(Yp=qp,zp=0,Zp=0,function(){var t=Wp(),e=16-(t-Zp);if(Zp=t,e>0){if(++zp>=800)return arguments[0]}else zp=0;return Yp.apply(void 0,arguments)}),$p=Qp;function tv(t){return t!=t}function ev(t,e){return!!(null==t?0:t.length)&&function(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,tv,r)}(t,e,0)>-1}var rv=/^(?:0|[1-9]\d*)$/;function nv(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&rv.test(t))&&t>-1&&t%1==0&&t<e}function iv(t,e,r){"__proto__"==e&&Kp?Kp(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ov(t,e){return t===e||t!=t&&e!=e}var sv=Object.prototype.hasOwnProperty;function av(t,e,r){var n=t[e];sv.call(t,e)&&ov(n,r)&&(void 0!==r||e in t)||iv(t,e,r)}function uv(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;void 0===u&&(u=t[a]),i?iv(r,a,u):av(r,a,u)}return r}var cv=Math.max;function hv(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function lv(t){return null!=t&&hv(t.length)&&!Pp(t)}var dv=Object.prototype;function fv(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||dv)}function pv(t){return Sp(t)&&"[object Arguments]"==Ep(t)}var vv=Object.prototype,mv=vv.hasOwnProperty,yv=vv.propertyIsEnumerable,gv=pv(function(){return arguments}())?pv:function(t){return Sp(t)&&mv.call(t,"callee")&&!yv.call(t,"callee")},_v=gv;var bv="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tv=bv&&"object"==typeof module&&module&&!module.nodeType&&module,xv=Tv&&Tv.exports===bv?vp.Buffer:void 0,Ev=(xv?xv.isBuffer:void 0)||function(){return!1},Sv={};function wv(t){return function(e){return t(e)}}Sv["[object Float32Array]"]=Sv["[object Float64Array]"]=Sv["[object Int8Array]"]=Sv["[object Int16Array]"]=Sv["[object Int32Array]"]=Sv["[object Uint8Array]"]=Sv["[object Uint8ClampedArray]"]=Sv["[object Uint16Array]"]=Sv["[object Uint32Array]"]=!0,Sv["[object Arguments]"]=Sv["[object Array]"]=Sv["[object ArrayBuffer]"]=Sv["[object Boolean]"]=Sv["[object DataView]"]=Sv["[object Date]"]=Sv["[object Error]"]=Sv["[object Function]"]=Sv["[object Map]"]=Sv["[object Number]"]=Sv["[object Object]"]=Sv["[object RegExp]"]=Sv["[object Set]"]=Sv["[object String]"]=Sv["[object WeakMap]"]=!1;var Rv="object"==typeof exports&&exports&&!exports.nodeType&&exports,Cv=Rv&&"object"==typeof module&&module&&!module.nodeType&&module,Pv=Cv&&Cv.exports===Rv&&fp.process,Av=function(){try{var t=Cv&&Cv.require&&Cv.require("util").types;return t||Pv&&Pv.binding&&Pv.binding("util")}catch(t){}}(),Ov=Av&&Av.isTypedArray,Iv=Ov?wv(Ov):function(t){return Sp(t)&&hv(t.length)&&!!Sv[Ep(t)]},Mv=Object.prototype.hasOwnProperty;function Dv(t,e){var r=wp(t),n=!r&&_v(t),i=!r&&!n&&Ev(t),o=!r&&!n&&!i&&Iv(t),s=r||n||i||o,a=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],u=a.length;for(var c in t)!e&&!Mv.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||nv(c,u))||a.push(c);return a}function Lv(t,e){return function(r){return t(e(r))}}var Fv=Lv(Object.keys,Object),Nv=Object.prototype.hasOwnProperty;function kv(t){return lv(t)?Dv(t):function(t){if(!fv(t))return Fv(t);var e=[];for(var r in Object(t))Nv.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}var Bv=Object.prototype.hasOwnProperty;function Gv(t){if(!Rp(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=fv(t),r=[];for(var n in t)("constructor"!=n||!e&&Bv.call(t,n))&&r.push(n);return r}function Uv(t){return lv(t)?Dv(t,!0):Gv(t)}var jv=Up(Object,"create");var Xv=Object.prototype.hasOwnProperty;var Vv=Object.prototype.hasOwnProperty;function Hv(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wv(t,e){for(var r=t.length;r--;)if(ov(t[r][0],e))return r;return-1}Hv.prototype.clear=function(){this.__data__=jv?jv(null):{},this.size=0},Hv.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Hv.prototype.get=function(t){var e=this.__data__;if(jv){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Xv.call(e,t)?e[t]:void 0},Hv.prototype.has=function(t){var e=this.__data__;return jv?void 0!==e[t]:Vv.call(e,t)},Hv.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=jv&&void 0===e?"__lodash_hash_undefined__":e,this};var Yv=Array.prototype.splice;function zv(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}zv.prototype.clear=function(){this.__data__=[],this.size=0},zv.prototype.delete=function(t){var e=this.__data__,r=Wv(e,t);return!(r<0)&&(r==e.length-1?e.pop():Yv.call(e,r,1),--this.size,!0)},zv.prototype.get=function(t){var e=this.__data__,r=Wv(e,t);return r<0?void 0:e[r][1]},zv.prototype.has=function(t){return Wv(this.__data__,t)>-1},zv.prototype.set=function(t,e){var r=this.__data__,n=Wv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Zv=Up(vp,"Map");function Jv(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Kv(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function qv(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}Kv.prototype.clear=function(){this.size=0,this.__data__={hash:new Hv,map:new(Zv||zv),string:new Hv}},Kv.prototype.delete=function(t){var e=Jv(this,t).delete(t);return this.size-=e?1:0,e},Kv.prototype.get=function(t){return Jv(this,t).get(t)},Kv.prototype.has=function(t){return Jv(this,t).has(t)},Kv.prototype.set=function(t,e){var r=Jv(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var Qv=mp?mp.isConcatSpreadable:void 0;function $v(t){return wp(t)||_v(t)||!!(Qv&&t&&t[Qv])}function tm(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=$v),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?tm(a,e-1,r,n,i):qv(i,a):n||(i[i.length]=a)}return i}var em=Lv(Object.getPrototypeOf,Object);function rm(t){var e=this.__data__=new zv(t);this.size=e.size}rm.prototype.clear=function(){this.__data__=new zv,this.size=0},rm.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},rm.prototype.get=function(t){return this.__data__.get(t)},rm.prototype.has=function(t){return this.__data__.has(t)},rm.prototype.set=function(t,e){var r=this.__data__;if(r instanceof zv){var n=r.__data__;if(!Zv||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Kv(n)}return r.set(t,e),this.size=r.size,this};var nm="object"==typeof exports&&exports&&!exports.nodeType&&exports,im=nm&&"object"==typeof module&&module&&!module.nodeType&&module,om=im&&im.exports===nm?vp.Buffer:void 0,sm=om?om.allocUnsafe:void 0;function am(){return[]}var um=Object.prototype.propertyIsEnumerable,cm=Object.getOwnPropertySymbols,hm=cm?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}(cm(t),(function(e){return um.call(t,e)})))}:am,lm=hm;var dm=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)qv(e,lm(t)),t=em(t);return e}:am;function fm(t,e,r){var n=e(t);return wp(t)?n:qv(n,r(t))}function pm(t){return fm(t,kv,lm)}function vm(t){return fm(t,Uv,dm)}var mm=Up(vp,"DataView"),ym=Up(vp,"Promise"),gm=Up(vp,"Set"),_m="[object Map]",bm="[object Promise]",Tm="[object Set]",xm="[object WeakMap]",Em="[object DataView]",Sm=Mp(mm),wm=Mp(Zv),Rm=Mp(ym),Cm=Mp(gm),Pm=Mp(jp),Am=Ep;(mm&&Am(new mm(new ArrayBuffer(1)))!=Em||Zv&&Am(new Zv)!=_m||ym&&Am(ym.resolve())!=bm||gm&&Am(new gm)!=Tm||jp&&Am(new jp)!=xm)&&(Am=function(t){var e=Ep(t),r="[object Object]"==e?t.constructor:void 0,n=r?Mp(r):"";if(n)switch(n){case Sm:return Em;case wm:return _m;case Rm:return bm;case Cm:return Tm;case Pm:return xm}return e});var Om=Am,Im=Object.prototype.hasOwnProperty;var Mm=vp.Uint8Array;function Dm(t){var e=new t.constructor(t.byteLength);return new Mm(e).set(new Mm(t)),e}var Lm=/\w*$/;var Fm=mp?mp.prototype:void 0,Nm=Fm?Fm.valueOf:void 0;function km(t,e,r){var n,i,o=t.constructor;switch(e){case"[object ArrayBuffer]":return Dm(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?Dm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var r=e?Dm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,r);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return(i=new(n=t).constructor(n.source,Lm.exec(n))).lastIndex=n.lastIndex,i;case"[object Symbol]":return function(t){return Nm?Object(Nm.call(t)):{}}(t)}}var Bm=Av&&Av.isMap,Gm=Bm?wv(Bm):function(t){return Sp(t)&&"[object Map]"==Om(t)};var Um=Av&&Av.isSet,jm=Um?wv(Um):function(t){return Sp(t)&&"[object Set]"==Om(t)},Xm="[object Arguments]",Vm="[object Function]",Hm="[object Object]",Wm={};function Ym(t,e,r,n,i,o){var s,a=1&e,u=2&e,c=4&e;if(r&&(s=i?r(t,n,i,o):r(t)),void 0!==s)return s;if(!Rp(t))return t;var h=wp(t);if(h){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Im.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!a)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,s)}else{var l=Om(t),d=l==Vm||"[object GeneratorFunction]"==l;if(Ev(t))return function(t,e){if(e)return t.slice();var r=t.length,n=sm?sm(r):new t.constructor(r);return t.copy(n),n}(t,a);if(l==Hm||l==Xm||d&&!i){if(s=u||d?{}:function(t){return"function"!=typeof t.constructor||fv(t)?{}:Vp(em(t))}(t),!a)return u?function(t,e){return uv(t,dm(t),e)}(t,function(t,e){return t&&uv(e,Uv(e),t)}(s,t)):function(t,e){return uv(t,lm(t),e)}(t,function(t,e){return t&&uv(e,kv(e),t)}(s,t))}else{if(!Wm[l])return i?t:{};s=km(t,l,a)}}o||(o=new rm);var f=o.get(t);if(f)return f;o.set(t,s),jm(t)?t.forEach((function(n){s.add(Ym(n,e,r,n,t,o))})):Gm(t)&&t.forEach((function(n,i){s.set(i,Ym(n,e,r,i,t,o))}));var p=h?void 0:(c?u?vm:pm:u?Uv:kv)(t);return function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););}(p||t,(function(n,i){p&&(n=t[i=n]),av(s,i,Ym(n,e,r,i,t,o))})),s}Wm[Xm]=Wm["[object Array]"]=Wm["[object ArrayBuffer]"]=Wm["[object DataView]"]=Wm["[object Boolean]"]=Wm["[object Date]"]=Wm["[object Float32Array]"]=Wm["[object Float64Array]"]=Wm["[object Int8Array]"]=Wm["[object Int16Array]"]=Wm["[object Int32Array]"]=Wm["[object Map]"]=Wm["[object Number]"]=Wm[Hm]=Wm["[object RegExp]"]=Wm["[object Set]"]=Wm["[object String]"]=Wm["[object Symbol]"]=Wm["[object Uint8Array]"]=Wm["[object Uint8ClampedArray]"]=Wm["[object Uint16Array]"]=Wm["[object Uint32Array]"]=!0,Wm["[object Error]"]=Wm[Vm]=Wm["[object WeakMap]"]=!1;function zm(t){return Ym(t,5)}function Zm(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Kv;++e<r;)this.add(t[e])}function Jm(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Km(t,e){return t.has(e)}Zm.prototype.add=Zm.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Zm.prototype.has=function(t){return this.__data__.has(t)};function qm(t,e,r,n,i,o){var s=1&r,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t),h=o.get(e);if(c&&h)return c==e&&h==t;var l=-1,d=!0,f=2&r?new Zm:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var p=t[l],v=e[l];if(n)var m=s?n(v,p,l,e,t,o):n(p,v,l,t,e,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!Jm(e,(function(t,e){if(!Km(f,e)&&(p===t||i(p,t,r,n,o)))return f.push(e)}))){d=!1;break}}else if(p!==v&&!i(p,v,r,n,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function Qm(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function $m(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var ty=mp?mp.prototype:void 0,ey=ty?ty.valueOf:void 0;var ry=Object.prototype.hasOwnProperty;var ny="[object Arguments]",iy="[object Array]",oy="[object Object]",sy=Object.prototype.hasOwnProperty;function ay(t,e,r,n,i,o){var s=wp(t),a=wp(e),u=s?iy:Om(t),c=a?iy:Om(e),h=(u=u==ny?oy:u)==oy,l=(c=c==ny?oy:c)==oy,d=u==c;if(d&&Ev(t)){if(!Ev(e))return!1;s=!0,h=!1}if(d&&!h)return o||(o=new rm),s||Iv(t)?qm(t,e,r,n,i,o):function(t,e,r,n,i,o,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Mm(t),new Mm(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ov(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Qm;case"[object Set]":var u=1&n;if(a||(a=$m),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var h=qm(a(t),a(e),n,i,o,s);return s.delete(t),h;case"[object Symbol]":if(ey)return ey.call(t)==ey.call(e)}return!1}(t,e,u,r,n,i,o);if(!(1&r)){var f=h&&sy.call(t,"__wrapped__"),p=l&&sy.call(e,"__wrapped__");if(f||p){var v=f?t.value():t,m=p?e.value():e;return o||(o=new rm),i(v,m,r,n,o)}}return!!d&&(o||(o=new rm),function(t,e,r,n,i,o){var s=1&r,a=pm(t),u=a.length;if(u!=pm(e).length&&!s)return!1;for(var c=u;c--;){var h=a[c];if(!(s?h in e:ry.call(e,h)))return!1}var l=o.get(t),d=o.get(e);if(l&&d)return l==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var p=s;++c<u;){var v=t[h=a[c]],m=e[h];if(n)var y=s?n(m,v,h,e,t,o):n(v,m,h,t,e,o);if(!(void 0===y?v===m||i(v,m,r,n,o):y)){f=!1;break}p||(p="constructor"==h)}if(f&&!p){var g=t.constructor,_=e.constructor;g==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(t),o.delete(e),f}(t,e,r,n,i,o))}function uy(t,e,r,n,i){return t===e||(null==t||null==e||!Sp(t)&&!Sp(e)?t!=t&&e!=e:ay(t,e,r,n,uy,i))}function cy(t){return Sp(t)&&lv(t)}function hy(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function ly(t,e,r,n){var i=-1,o=ev,s=!0,a=t.length,u=[],c=e.length;if(!a)return u;r&&(e=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}(e,wv(r))),n?(o=hy,s=!1):e.length>=200&&(o=Km,s=!1,e=new Zm(e));t:for(;++i<a;){var h=t[i],l=null==r?h:r(h);if(h=n||0!==h?h:0,s&&l==l){for(var d=c;d--;)if(e[d]===l)continue t;u.push(h)}else o(e,l,n)||u.push(h)}return u}var dy=function(t,e){return $p(function(t,e,r){return e=cv(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=cv(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Hp(t,this,a)}}(t,e,Cp),t+"")}((function(t,e){var r=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}(e);return cy(r)&&(r=void 0),cy(t)?ly(t,tm(e,1,cy,!0),void 0,r):[]})),fy=dy;function py(t,e){return uy(t,e)}var vy="position:fixed;left:0;top:0;pointer-events:none;opacity:0;z-index:-1;",my=function(t){if("suspended"===t.state||"interrupted"===t.state){var e=document.body,r=["touchstart","touchend","mouseup","click"];Ph(r).call(r,(function(t){return e.addEventListener(t,n,!1)})),n()}function n(){t.resume().then(i).catch(null)}function i(){Ph(r).call(r,(function(t){return e.removeEventListener(t,n,!1)}))}},yy=function(){var t=null;return window.TXLiveAudioContext?t=window.TXLiveAudioContext:(t=new(window.AudioContext||window.webkitAudioContext),window.TXLiveAudioContext=t),my(t),t},gy=function(t){void 0===t&&(t={});var e=t.parentEl,r=void 0===e?document.body:e,n=t.style,i=void 0===n?vy:n,o=t.crossOrigin,s=void 0===o||o,a=t.loop,u=void 0===a||a,c=document.createElement("video");return c.autoplay=!0,c.controls=!1,c.preload="auto",c.playsInline=!0,c.setAttribute("webkit-playsinline",""),c.setAttribute("x5-playsinline",""),c.loop=u,s&&(c.crossOrigin="anonymous"),c.setAttribute("style",i),r.appendChild(c),c},_y=function(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:{width:t.width,height:t.height}},by="\t\n\v\f\r                　\u2028\u2029\ufeff",Ty=J,xy=Kn,Ey=S("".replace),Sy="[\t\n\v\f\r                　\u2028\u2029\ufeff]",wy=RegExp("^"+Sy+Sy+"*"),Ry=RegExp(Sy+Sy+"*$"),Cy=function(t){return function(e){var r=xy(Ty(e));return 1&t&&(r=Ey(r,wy,"")),2&t&&(r=Ey(r,Ry,"")),r}},Py={start:Cy(1),end:Cy(2),trim:Cy(3)},Ay=o,Oy=s,Iy=S,My=Kn,Dy=Py.trim,Ly=by,Fy=Ay.parseInt,Ny=Ay.Symbol,ky=Ny&&Ny.iterator,By=/^[+-]?0x/i,Gy=Iy(By.exec),Uy=8!==Fy(Ly+"08")||22!==Fy(Ly+"0x16")||ky&&!Oy((function(){Fy(Object(ky))}))?function(t,e){var r=Dy(My(t));return Fy(r,e>>>0||(Gy(By,r)?16:10))}:Fy;Ar({global:!0,forced:parseInt!=Uy},{parseInt:Uy});var jy=rt.parseInt,Xy=at,Vy=Xi,Hy=no,Wy=nr,Yy=S([].concat),zy=Xy("Reflect","ownKeys")||function(t){var e=Vy.f(Wy(t)),r=Hy.f;return r?Yy(e,r(t)):e},Zy=qt,Jy=zy,Ky=A,qy=Qe,Qy=Error,$y=S("".replace),tg=String(Qy("zxcasd").stack),eg=/\n\s*at [^:]*:[^\n]*/,rg=eg.test(tg),ng=et,ig=yr,og=nu,sg=fe("iterator"),ag=Array.prototype,ug=function(t){return void 0!==t&&(og.Array===t||ag[sg]===t)},cg=rn,hg=Lt,lg=Y,dg=nu,fg=fe("iterator"),pg=function(t){if(!lg(t))return hg(t,fg)||hg(t,"@@iterator")||dg[cg(t)]},vg=D,mg=It,yg=nr,gg=Ct,_g=pg,bg=TypeError,Tg=function(t,e){var r=arguments.length<2?_g(t):e;if(mg(r))return yg(vg(r,t));throw bg(gg(t)+" is not iterable")},xg=D,Eg=nr,Sg=Lt,wg=function(t,e,r){var n,i;Eg(t);try{if(!(n=Sg(t,"return"))){if("throw"===e)throw r;return r}n=xg(n,t)}catch(t){i=!0,n=t}if("throw"===e)throw r;if(i)throw n;return Eg(n),r},Rg=qe,Cg=D,Pg=nr,Ag=Ct,Og=ug,Ig=jr,Mg=ut,Dg=Tg,Lg=pg,Fg=wg,Ng=TypeError,kg=function(t,e){this.stopped=t,this.result=e},Bg=kg.prototype,Gg=function(t,e,r){var n,i,o,s,a,u,c,h=r&&r.that,l=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),v=Rg(e,h),m=function(t){return n&&Fg(n,"normal",t),new kg(!0,t)},y=function(t){return l?(Pg(t),p?v(t[0],t[1],m):v(t[0],t[1])):p?v(t,m):v(t)};if(d)n=t.iterator;else if(f)n=t;else{if(!(i=Lg(t)))throw Ng(Ag(t)+" is not iterable");if(Og(i)){for(o=0,s=Ig(t);s>o;o++)if((a=y(t[o]))&&Mg(Bg,a))return a;return new kg(!1)}n=Dg(t,i)}for(u=d?t.next:n.next;!(c=Cg(u,n)).done;){try{a=y(c.value)}catch(t){Fg(n,"throw",t)}if("object"==typeof a&&a&&Mg(Bg,a))return a}return new kg(!1)},Ug=Kn,jg=U,Xg=!s((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",jg(1,7)),7!==t.stack)})),Vg=Ar,Hg=ut,Wg=gu,Yg=Xu,zg=function(t,e,r){for(var n=Jy(e),i=qy.f,o=Ky.f,s=0;s<n.length;s++){var a=n[s];Zy(t,a)||r&&Zy(r,a)||i(t,a,o(e,a))}},Zg=ji,Jg=yr,Kg=U,qg=function(t,e){if(rg&&"string"==typeof t&&!Qy.prepareStackTrace)for(;e--;)t=$y(t,eg,"");return t},Qg=function(t,e){ng(e)&&"cause"in e&&ig(t,"cause",e.cause)},$g=Gg,t_=function(t,e){return void 0===t?arguments.length<2?"":e:Ug(t)},e_=Xg,r_=fe("toStringTag"),n_=Error,i_=[].push,o_=function(t,e){var r,n=arguments.length>2?arguments[2]:void 0,i=Hg(s_,this);Yg?r=Yg(n_(),i?Wg(this):s_):(r=i?this:Zg(s_),Jg(r,r_,"Error")),void 0!==e&&Jg(r,"message",t_(e)),e_&&Jg(r,"stack",qg(r.stack,1)),Qg(r,n);var o=[];return $g(t,i_,{that:o}),Jg(r,"errors",o),r};Yg?Yg(o_,n_):zg(o_,n_,{name:!0});var s_=o_.prototype=Zg(n_.prototype,{constructor:Kg(1,o_),message:Kg(1,""),name:Kg(1,"AggregateError")});Vg({global:!0,constructor:!0,arity:2},{AggregateError:o_});var a_,u_,c_,h_,l_="process"==T(o.process),d_=at,f_=Qe,p_=O,v_=fe("species"),m_=ut,y_=TypeError,g_=function(t,e){if(m_(e,t))return t;throw y_("Incorrect invocation")},__=Tn,b_=Ct,T_=TypeError,x_=nr,E_=function(t){if(__(t))return t;throw T_(b_(t)+" is not a constructor")},S_=Y,w_=fe("species"),R_=function(t,e){var r,n=x_(t).constructor;return void 0===n||S_(r=x_(n)[w_])?e:E_(r)},C_=/(?:ipad|iphone|ipod).*applewebkit/i.test(ct),P_=o,A_=d,O_=qe,I_=P,M_=qt,D_=s,L_=wi,F_=xa,N_=Ce,k_=ql,B_=C_,G_=l_,U_=P_.setImmediate,j_=P_.clearImmediate,X_=P_.process,V_=P_.Dispatch,H_=P_.Function,W_=P_.MessageChannel,Y_=P_.String,z_=0,Z_={},J_="onreadystatechange";try{a_=P_.location}catch(t){}var K_=function(t){if(M_(Z_,t)){var e=Z_[t];delete Z_[t],e()}},q_=function(t){return function(){K_(t)}},Q_=function(t){K_(t.data)},$_=function(t){P_.postMessage(Y_(t),a_.protocol+"//"+a_.host)};U_&&j_||(U_=function(t){k_(arguments.length,1);var e=I_(t)?t:H_(t),r=F_(arguments,1);return Z_[++z_]=function(){A_(e,void 0,r)},u_(z_),z_},j_=function(t){delete Z_[t]},G_?u_=function(t){X_.nextTick(q_(t))}:V_&&V_.now?u_=function(t){V_.now(q_(t))}:W_&&!B_?(h_=(c_=new W_).port2,c_.port1.onmessage=Q_,u_=O_(h_.postMessage,h_)):P_.addEventListener&&I_(P_.postMessage)&&!P_.importScripts&&a_&&"file:"!==a_.protocol&&!D_($_)?(u_=$_,P_.addEventListener("message",Q_,!1)):u_=J_ in N_("script")?function(t){L_.appendChild(N_("script")).onreadystatechange=function(){L_.removeChild(this),K_(t)}}:function(t){setTimeout(q_(t),0)});var tb,eb,rb,nb,ib,ob,sb,ab,ub={set:U_,clear:j_},cb=o,hb=/ipad|iphone|ipod/i.test(ct)&&void 0!==cb.Pebble,lb=/web0s(?!.*chrome)/i.test(ct),db=o,fb=qe,pb=A.f,vb=ub.set,mb=C_,yb=hb,gb=lb,_b=l_,bb=db.MutationObserver||db.WebKitMutationObserver,Tb=db.document,xb=db.process,Eb=db.Promise,Sb=pb(db,"queueMicrotask"),wb=Sb&&Sb.value;wb||(tb=function(){var t,e;for(_b&&(t=xb.domain)&&t.exit();eb;){e=eb.fn,eb=eb.next;try{e()}catch(t){throw eb?nb():rb=void 0,t}}rb=void 0,t&&t.enter()},mb||_b||gb||!bb||!Tb?!yb&&Eb&&Eb.resolve?((sb=Eb.resolve(void 0)).constructor=Eb,ab=fb(sb.then,sb),nb=function(){ab(tb)}):_b?nb=function(){xb.nextTick(tb)}:(vb=fb(vb,db),nb=function(){vb(tb)}):(ib=!0,ob=Tb.createTextNode(""),new bb(tb).observe(ob,{characterData:!0}),nb=function(){ob.data=ib=!ib}));var Rb=wb||function(t){var e={fn:t,next:void 0};rb&&(rb.next=e),eb||(eb=e,nb()),rb=e},Cb=o,Pb=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ab=function(){this.head=null,this.tail=null};Ab.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var Ob=Ab,Ib=o.Promise,Mb="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Db=!Mb&&!l_&&"object"==typeof window&&"object"==typeof document,Lb=o,Fb=Ib,Nb=P,kb=ze,Bb=an,Gb=fe,Ub=Db,jb=Mb,Xb=mt,Vb=Fb&&Fb.prototype,Hb=Gb("species"),Wb=!1,Yb=Nb(Lb.PromiseRejectionEvent),zb=kb("Promise",(function(){var t=Bb(Fb),e=t!==String(Fb);if(!e&&66===Xb)return!0;if(!Vb.catch||!Vb.finally)return!0;if(!Xb||Xb<51||!/native code/.test(t)){var r=new Fb((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[Hb]=n,!(Wb=r.then((function(){}))instanceof n))return!0}return!e&&(Ub||jb)&&!Yb})),Zb={CONSTRUCTOR:zb,REJECTION_EVENT:Yb,SUBCLASSING:Wb},Jb={},Kb=It,qb=TypeError,Qb=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw qb("Bad Promise constructor");e=t,r=n})),this.resolve=Kb(e),this.reject=Kb(r)};Jb.f=function(t){return new Qb(t)};var $b,tT,eT=Ar,rT=l_,nT=o,iT=D,oT=oo,sT=Oo,aT=function(t){var e=d_(t),r=f_.f;p_&&e&&!e[v_]&&r(e,v_,{configurable:!0,get:function(){return this}})},uT=It,cT=P,hT=et,lT=g_,dT=R_,fT=ub.set,pT=Rb,vT=function(t,e){var r=Cb.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))},mT=Pb,yT=Ob,gT=Yo,_T=Ib,bT=Zb,TT=Jb,xT="Promise",ET=bT.CONSTRUCTOR,ST=bT.REJECTION_EVENT,wT=gT.getterFor(xT),RT=gT.set,CT=_T&&_T.prototype,PT=_T,AT=CT,OT=nT.TypeError,IT=nT.document,MT=nT.process,DT=TT.f,LT=DT,FT=!!(IT&&IT.createEvent&&nT.dispatchEvent),NT="unhandledrejection",kT=function(t){var e;return!(!hT(t)||!cT(e=t.then))&&e},BT=function(t,e){var r,n,i,o=e.value,s=1==e.state,a=s?t.ok:t.fail,u=t.resolve,c=t.reject,h=t.domain;try{a?(s||(2===e.rejection&&VT(e),e.rejection=1),!0===a?r=o:(h&&h.enter(),r=a(o),h&&(h.exit(),i=!0)),r===t.promise?c(OT("Promise-chain cycle")):(n=kT(r))?iT(n,r,u,c):u(r)):c(o)}catch(t){h&&!i&&h.exit(),c(t)}},GT=function(t,e){t.notified||(t.notified=!0,pT((function(){for(var r,n=t.reactions;r=n.get();)BT(r,t);t.notified=!1,e&&!t.rejection&&jT(t)})))},UT=function(t,e,r){var n,i;FT?((n=IT.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),nT.dispatchEvent(n)):n={promise:e,reason:r},!ST&&(i=nT["on"+t])?i(n):t===NT&&vT("Unhandled promise rejection",r)},jT=function(t){iT(fT,nT,(function(){var e,r=t.facade,n=t.value;if(XT(t)&&(e=mT((function(){rT?MT.emit("unhandledRejection",n,r):UT(NT,r,n)})),t.rejection=rT||XT(t)?2:1,e.error))throw e.value}))},XT=function(t){return 1!==t.rejection&&!t.parent},VT=function(t){iT(fT,nT,(function(){var e=t.facade;rT?MT.emit("rejectionHandled",e):UT("rejectionhandled",e,t.value)}))},HT=function(t,e,r){return function(n){t(e,n,r)}},WT=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,GT(t,!0))},YT=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw OT("Promise can't be resolved itself");var n=kT(e);n?pT((function(){var r={done:!1};try{iT(n,e,HT(YT,r,t),HT(WT,r,t))}catch(e){WT(r,e,t)}})):(t.value=e,t.state=1,GT(t,!1))}catch(e){WT({done:!1},e,t)}}};ET&&(AT=(PT=function(t){lT(this,AT),uT(t),iT($b,this);var e=wT(this);try{t(HT(YT,e),HT(WT,e))}catch(t){WT(e,t)}}).prototype,($b=function(t){RT(this,{type:xT,done:!1,notified:!1,parent:!1,reactions:new yT,rejection:!1,state:0,value:void 0})}).prototype=oT(AT,"then",(function(t,e){var r=wT(this),n=DT(dT(this,PT));return r.parent=!0,n.ok=!cT(t)||t,n.fail=cT(e)&&e,n.domain=rT?MT.domain:void 0,0==r.state?r.reactions.add(n):pT((function(){BT(n,r)})),n.promise})),tT=function(){var t=new $b,e=wT(t);this.promise=t,this.resolve=HT(YT,e),this.reject=HT(WT,e)},TT.f=DT=function(t){return t===PT||undefined===t?new tT(t):LT(t)}),eT({global:!0,constructor:!0,wrap:!0,forced:ET},{Promise:PT}),sT(PT,xT,!1,!0),aT(xT);var zT=fe("iterator"),ZT=!1;try{var JT=0,KT={next:function(){return{done:!!JT++}},return:function(){ZT=!0}};KT[zT]=function(){return this},Array.from(KT,(function(){throw 2}))}catch(t){}var qT=Ib,QT=function(t,e){if(!e&&!ZT)return!1;var r=!1;try{var n={};n[zT]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},$T=Zb.CONSTRUCTOR||!QT((function(t){qT.all(t).then(void 0,(function(){}))})),tx=D,ex=It,rx=Jb,nx=Pb,ix=Gg;Ar({target:"Promise",stat:!0,forced:$T},{all:function(t){var e=this,r=rx.f(e),n=r.resolve,i=r.reject,o=nx((function(){var r=ex(e.resolve),o=[],s=0,a=1;ix(t,(function(t){var u=s++,c=!1;a++,tx(r,e,t).then((function(t){c||(c=!0,o[u]=t,--a||n(o))}),i)})),--a||n(o)}));return o.error&&i(o.value),r.promise}});var ox=Ar,sx=Zb.CONSTRUCTOR;Ib&&Ib.prototype,ox({target:"Promise",proto:!0,forced:sx,real:!0},{catch:function(t){return this.then(void 0,t)}});var ax=D,ux=It,cx=Jb,hx=Pb,lx=Gg;Ar({target:"Promise",stat:!0,forced:$T},{race:function(t){var e=this,r=cx.f(e),n=r.reject,i=hx((function(){var i=ux(e.resolve);lx(t,(function(t){ax(i,e,t).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var dx=D,fx=Jb;Ar({target:"Promise",stat:!0,forced:Zb.CONSTRUCTOR},{reject:function(t){var e=fx.f(this);return dx(e.reject,void 0,t),e.promise}});var px=nr,vx=et,mx=Jb,yx=function(t,e){if(px(t),vx(e)&&e.constructor===t)return e;var r=mx.f(t);return(0,r.resolve)(e),r.promise},gx=Ar,_x=Ib,bx=Zb.CONSTRUCTOR,Tx=yx,xx=at("Promise"),Ex=!bx;gx({target:"Promise",stat:!0,forced:true},{resolve:function(t){return Tx(Ex&&this===xx?_x:this,t)}});var Sx=D,wx=It,Rx=Jb,Cx=Pb,Px=Gg;Ar({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=Rx.f(e),n=r.resolve,i=r.reject,o=Cx((function(){var r=wx(e.resolve),i=[],o=0,s=1;Px(t,(function(t){var a=o++,u=!1;s++,Sx(r,e,t).then((function(t){u||(u=!0,i[a]={status:"fulfilled",value:t},--s||n(i))}),(function(t){u||(u=!0,i[a]={status:"rejected",reason:t},--s||n(i))}))})),--s||n(i)}));return o.error&&i(o.value),r.promise}});var Ax=D,Ox=It,Ix=at,Mx=Jb,Dx=Pb,Lx=Gg,Fx="No one promise resolved";Ar({target:"Promise",stat:!0},{any:function(t){var e=this,r=Ix("AggregateError"),n=Mx.f(e),i=n.resolve,o=n.reject,s=Dx((function(){var n=Ox(e.resolve),s=[],a=0,u=1,c=!1;Lx(t,(function(t){var h=a++,l=!1;u++,Ax(n,e,t).then((function(t){l||c||(c=!0,i(t))}),(function(t){l||c||(l=!0,s[h]=t,--u||o(new r(s,Fx)))}))})),--u||o(new r(s,Fx))}));return s.error&&o(s.value),n.promise}});var Nx=Ar,kx=Ib,Bx=s,Gx=at,Ux=P,jx=R_,Xx=yx,Vx=kx&&kx.prototype;Nx({target:"Promise",proto:!0,real:!0,forced:!!kx&&Bx((function(){Vx.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=jx(this,Gx("Promise")),r=Ux(t);return this.then(r?function(r){return Xx(e,t()).then((function(){return r}))}:t,r?function(r){return Xx(e,t()).then((function(){throw r}))}:t)}});var Hx=rt.Promise,Wx=Jb,Yx=Pb;Ar({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=Wx.f(this),r=Yx(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}});var zx=Hx,Zx=/Version\/(\d+)\.(\d+)/i,Jx=/OS (\d+)_(\d+)_?(\d+)?/i;/firefox\/(\d+)\./i.test(navigator.userAgent);var Kx=/safari\/(\d+)\./i.test(navigator.userAgent)&&!/chrome\/(\d+)\./i.test(navigator.userAgent),qx=/iPhone|iPad|iOS/i.test(navigator.userAgent),Qx=function(){var t=navigator.userAgent.match(Zx);return t?[jy(t[1],10),jy(t[2],10)]:[]}(),$x=Kx&&15===Qx[0]||qx&&15===function(){var t=navigator.userAgent.match(Jx);return t?jy(t[1],10):null}(),tE=Kx&&16===Qx[0]&&Qx[1]<4,eE=function(){var t,e;return!(!(null===(t=navigator.mediaDevices)||void 0===t?void 0:t.enumerateDevices)||!(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))},rE=function(){var t;return!!(null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getDisplayMedia)},nE=rt,iE=d;nE.JSON||(nE.JSON={stringify:JSON.stringify});var oE=function(t,e,r){return iE(nE.JSON.stringify,null,arguments)},sE=oE,aE=function(t,e){return fetch(t,{body:sE(e),cache:"no-cache",credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST",mode:"cors"}).then((function(t){if(200!==t.status)throw new Error("status Code:".concat(t.status));return t.json()}))},uE=Ar,cE=S,hE=Gr,lE=Kn,dE=Ll,fE=J,pE=Nl,vE=cE("".endsWith),mE=cE("".slice),yE=Math.min;uE({target:"String",proto:!0,forced:!pE("endsWith")},{endsWith:function(t){var e=lE(fE(this));dE(t);var r=arguments.length>1?arguments[1]:void 0,n=e.length,i=void 0===r?n:yE(hE(r),n),o=lE(t);return vE?vE(e,o,i):mE(e,i-o.length,i)===o}});var gE=sh("String").endsWith,_E=ut,bE=gE,TE=String.prototype,xE=function(t){var e=t.endsWith;return"string"==typeof t||t===TE||_E(TE,t)&&e===TE.endsWith?bE:e},EE=ts.every;Ar({target:"Array",proto:!0,forced:!gh("every")},{every:function(t){return EE(this,t,arguments.length>1?arguments[1]:void 0)}});var SE=sh("Array").every,wE=ut,RE=SE,CE=Array.prototype,PE=function(t){var e=t.every;return t===CE||wE(CE,t)&&e===CE.every?RE:e},AE=Yf("stream:device"),OE=function(){function t(){this.mediaStream=null}return t.prototype.start=function(t){var e=t.video,r=t.audio;return Ed(this,void 0,void 0,(function(){var t,n,i,o,s,a,u,c,h,l,d,f,p;return Sd(this,(function(v){switch(v.label){case 0:if(this.mediaStream)return AE("stream is existed"),[2,this.mediaStream];t={},e&&(s=e.deviceId,n=e.frameRate,i=e.resolution,o={frameRate:{ideal:n},width:{ideal:i.width},height:{ideal:i.height}},s&&(Jl(dp).call(dp,s)?o.facingMode={exact:s}:o.deviceId={exact:s}),t.video=o),r&&(s=r.deviceId,a=r.sampleRate,u=r.echoCancellation,c=r.noiseSuppression,h=r.autoGainControl,l={sampleRate:a,echoCancellation:u,noiseSuppression:c,autoGainControl:h},s&&(l.deviceId={exact:s}),t.audio=l),v.label=1;case 1:return v.trys.push([1,3,,4]),d=this,[4,navigator.mediaDevices.getUserMedia(t)];case 2:return d.mediaStream=v.sent(),[2,this.mediaStream];case 3:switch(f=v.sent(),AE("start error, ".concat(f.toString())),p="",f.name){case"NotFoundError":case"DevicesNotFoundError":p="NotFoundError";break;case"NotAllowedError":case"PermissionDeniedError":p="NotAllowedError";break;default:p=f.name}throw f.name!==p&&(f.name=p),f;case 4:return[2]}}))}))},t.prototype.stop=function(){var t,e;null===(e=this.mediaStream)||void 0===e||Ph(t=e.getTracks()).call(t,(function(t){"ended"!==t.readyState&&t.stop()})),this.mediaStream=null},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings();return{width:e.width,height:e.height}},t}(),IE=Yf("stream:screen"),ME=function(){function t(){this.mediaStream=null}return t.prototype.start=function(t){var e=t.video,r=t.audio;return Ed(this,void 0,void 0,(function(){var t,n,i,o,s,a,u,c,h,l;return Sd(this,(function(d){var f;switch(d.label){case 0:if(this.mediaStream)return IE("stream is existed"),[2,this.mediaStream];t={},e&&(n=e.frameRate,i=e.resolution,o={frameRate:{ideal:n},width:tE?{max:i.width}:{ideal:i.width},height:tE?{max:i.height}:{ideal:i.height}},t.video=o),r&&(s=r.echoCancellation,a=r.noiseSuppression,u=r.autoGainControl,c={echoCancellation:s,noiseSuppression:a,autoGainControl:u},t.audio=c),d.label=1;case 1:return d.trys.push([1,3,,4]),h=this,[4,navigator.mediaDevices.getDisplayMedia(t)];case 2:return h.mediaStream=d.sent(),Ph(f=this.mediaStream.getVideoTracks()).call(f,(function(r){var n;null===(n=r.applyConstraints)||void 0===n||n.call(r,xd(xd({},t.video),{frameRate:{min:e.frameRate,ideal:e.frameRate}})).catch((function(t){IE("video track applyConstraints error, ".concat(t.toString()))})),r.contentHint="detail"})),[2,this.mediaStream];case 3:throw l=d.sent(),IE("start error, ".concat(l.toString())),l;case 4:return[2]}}))}))},t.prototype.stop=function(){var t,e;null===(e=this.mediaStream)||void 0===e||Ph(t=e.getTracks()).call(t,(function(t){"ended"!==t.readyState&&t.stop()})),this.mediaStream=null},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings();return{width:e.width,height:e.height}},t}(),DE=s,LE=fe("iterator"),FE=!DE((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[LE]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),NE=Qe,kE=O,BE=S,GE=D,UE=s,jE=yi,XE=no,VE=L,HE=Zt,WE=W,YE=Object.assign,zE=Object.defineProperty,ZE=BE([].concat),JE=!YE||UE((function(){if(kE&&1!==YE({b:1},YE(zE({},"a",{enumerable:!0,get:function(){zE(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=YE({},t)[r]||jE(YE({},e)).join("")!=n}))?function(t,e){for(var r=HE(t),n=arguments.length,i=1,o=XE.f,s=VE.f;n>i;)for(var a,u=WE(arguments[i++]),c=o?ZE(jE(u),o(u)):jE(u),h=c.length,l=0;h>l;)a=c[l++],kE&&!GE(s,u,a)||(r[a]=u[a]);return r}:YE,KE=nr,qE=wg,QE=qe,$E=D,tS=Zt,eS=function(t,e,r,n){try{return n?e(KE(r)[0],r[1]):e(r)}catch(e){qE(t,"throw",e)}},rS=ug,nS=Tn,iS=jr,oS=zr,sS=Tg,aS=pg,uS=Array,cS=S,hS=2147483647,lS=/[^\0-\u007E]/,dS=/[.\u3002\uFF0E\uFF61]/g,fS="Overflow: input needs wider integers to process",pS=RangeError,vS=cS(dS.exec),mS=Math.floor,yS=String.fromCharCode,gS=cS("".charCodeAt),_S=cS([].join),bS=cS([].push),TS=cS("".replace),xS=cS("".split),ES=cS("".toLowerCase),SS=function(t){return t+22+75*(t<26)},wS=function(t,e,r){var n=0;for(t=r?mS(t/700):t>>1,t+=mS(t/e);t>455;)t=mS(t/35),n+=36;return mS(n+36*t/(t+38))},RS=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var i=gS(t,r++);if(i>=55296&&i<=56319&&r<n){var o=gS(t,r++);56320==(64512&o)?bS(e,((1023&i)<<10)+(1023&o)+65536):(bS(e,i),r--)}else bS(e,i)}return e}(t);var r,n,i=t.length,o=128,s=0,a=72;for(r=0;r<t.length;r++)(n=t[r])<128&&bS(e,yS(n));var u=e.length,c=u;for(u&&bS(e,"-");c<i;){var h=hS;for(r=0;r<t.length;r++)(n=t[r])>=o&&n<h&&(h=n);var l=c+1;if(h-o>mS((hS-s)/l))throw pS(fS);for(s+=(h-o)*l,o=h,r=0;r<t.length;r++){if((n=t[r])<o&&++s>hS)throw pS(fS);if(n==o){for(var d=s,f=36;;){var p=f<=a?1:f>=a+26?26:f-a;if(d<p)break;var v=d-p,m=36-p;bS(e,yS(SS(p+v%m))),d=mS(v/m),f+=36}bS(e,yS(SS(d))),a=wS(s,l,c==u),s=0,c++}}s++,o++}return _S(e,"")},CS=oo,PS=qi,AS=Math.floor,OS=function(t,e){var r=t.length,n=AS(r/2);return r<8?IS(t,e):MS(t,OS(PS(t,0,n),e),OS(PS(t,n),e),e)},IS=function(t,e){for(var r,n,i=t.length,o=1;o<i;){for(n=o,r=t[o];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==o++&&(t[n]=r)}return t},MS=function(t,e,r,n){for(var i=e.length,o=r.length,s=0,a=0;s<i||a<o;)t[s+a]=s<i&&a<o?n(e[s],r[a])<=0?e[s++]:r[a++]:s<i?e[s++]:r[a++];return t},DS=Ar,LS=o,FS=D,NS=S,kS=O,BS=FE,GS=oo,US=function(t,e,r){for(var n in e)r&&r.unsafe&&t[n]?t[n]=e[n]:CS(t,n,e[n],r);return t},jS=Oo,XS=Fu,VS=Yo,HS=g_,WS=P,YS=qt,zS=qe,ZS=rn,JS=nr,KS=et,qS=Kn,QS=ji,$S=U,tw=Tg,ew=pg,rw=ql,nw=OS,iw=fe("iterator"),ow="URLSearchParams",sw="URLSearchParamsIterator",aw=VS.set,uw=VS.getterFor(ow),cw=VS.getterFor(sw),hw=Object.getOwnPropertyDescriptor,lw=function(t){if(!kS)return LS[t];var e=hw(LS,t);return e&&e.value},dw=lw("fetch"),fw=lw("Request"),pw=lw("Headers"),vw=fw&&fw.prototype,mw=pw&&pw.prototype,yw=LS.RegExp,gw=LS.TypeError,_w=LS.decodeURIComponent,bw=LS.encodeURIComponent,Tw=NS("".charAt),xw=NS([].join),Ew=NS([].push),Sw=NS("".replace),ww=NS([].shift),Rw=NS([].splice),Cw=NS("".split),Pw=NS("".slice),Aw=/\+/g,Ow=Array(4),Iw=function(t){return Ow[t-1]||(Ow[t-1]=yw("((?:%[\\da-f]{2}){"+t+"})","gi"))},Mw=function(t){try{return _w(t)}catch(e){return t}},Dw=function(t){var e=Sw(t,Aw," "),r=4;try{return _w(e)}catch(t){for(;r;)e=Sw(e,Iw(r--),Mw);return e}},Lw=/[!'()~]|%20/g,Fw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Nw=function(t){return Fw[t]},kw=function(t){return Sw(bw(t),Lw,Nw)},Bw=XS((function(t,e){aw(this,{type:sw,iterator:tw(uw(t).entries),kind:e})}),"Iterator",(function(){var t=cw(this),e=t.kind,r=t.iterator.next(),n=r.value;return r.done||(r.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),r}),!0),Gw=function(t){this.entries=[],this.url=null,void 0!==t&&(KS(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Tw(t,0)?Pw(t,1):t:qS(t)))};Gw.prototype={type:ow,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,i,o,s,a,u=ew(t);if(u)for(r=(e=tw(t,u)).next;!(n=FS(r,e)).done;){if(o=(i=tw(JS(n.value))).next,(s=FS(o,i)).done||(a=FS(o,i)).done||!FS(o,i).done)throw gw("Expected sequence with length 2");Ew(this.entries,{key:qS(s.value),value:qS(a.value)})}else for(var c in t)YS(t,c)&&Ew(this.entries,{key:c,value:qS(t[c])})},parseQuery:function(t){if(t)for(var e,r,n=Cw(t,"&"),i=0;i<n.length;)(e=n[i++]).length&&(r=Cw(e,"="),Ew(this.entries,{key:Dw(ww(r)),value:Dw(xw(r,"="))}))},serialize:function(){for(var t,e=this.entries,r=[],n=0;n<e.length;)t=e[n++],Ew(r,kw(t.key)+"="+kw(t.value));return xw(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Uw=function(){HS(this,jw);var t=arguments.length>0?arguments[0]:void 0;aw(this,new Gw(t))},jw=Uw.prototype;if(US(jw,{append:function(t,e){rw(arguments.length,2);var r=uw(this);Ew(r.entries,{key:qS(t),value:qS(e)}),r.updateURL()},delete:function(t){rw(arguments.length,1);for(var e=uw(this),r=e.entries,n=qS(t),i=0;i<r.length;)r[i].key===n?Rw(r,i,1):i++;e.updateURL()},get:function(t){rw(arguments.length,1);for(var e=uw(this).entries,r=qS(t),n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function(t){rw(arguments.length,1);for(var e=uw(this).entries,r=qS(t),n=[],i=0;i<e.length;i++)e[i].key===r&&Ew(n,e[i].value);return n},has:function(t){rw(arguments.length,1);for(var e=uw(this).entries,r=qS(t),n=0;n<e.length;)if(e[n++].key===r)return!0;return!1},set:function(t,e){rw(arguments.length,1);for(var r,n=uw(this),i=n.entries,o=!1,s=qS(t),a=qS(e),u=0;u<i.length;u++)(r=i[u]).key===s&&(o?Rw(i,u--,1):(o=!0,r.value=a));o||Ew(i,{key:s,value:a}),n.updateURL()},sort:function(){var t=uw(this);nw(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=uw(this).entries,n=zS(t,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((e=r[i++]).value,e.key,this)},keys:function(){return new Bw(this,"keys")},values:function(){return new Bw(this,"values")},entries:function(){return new Bw(this,"entries")}},{enumerable:!0}),GS(jw,iw,jw.entries,{name:"entries"}),GS(jw,"toString",(function(){return uw(this).serialize()}),{enumerable:!0}),jS(Uw,ow),DS({global:!0,constructor:!0,forced:!BS},{URLSearchParams:Uw}),!BS&&WS(pw)){var Xw=NS(mw.has),Vw=NS(mw.set),Hw=function(t){if(KS(t)){var e,r=t.body;if(ZS(r)===ow)return e=t.headers?new pw(t.headers):new pw,Xw(e,"content-type")||Vw(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),QS(t,{body:$S(0,qS(r)),headers:$S(0,e)})}return t};if(WS(dw)&&DS({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return dw(t,arguments.length>1?Hw(arguments[1]):{})}}),WS(fw)){var Ww=function(t){return HS(this,vw),new fw(t,arguments.length>1?Hw(arguments[1]):{})};vw.constructor=Ww,Ww.prototype=vw,DS({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ww})}}var Yw,zw=Ar,Zw=O,Jw=FE,Kw=o,qw=qe,Qw=S,$w=oo,tR=function(t,e,r){return NE.f(t,e,r)},eR=g_,rR=qt,nR=JE,iR=function(t){var e=tS(t),r=nS(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=QE(i,n>2?arguments[2]:void 0));var s,a,u,c,h,l,d=aS(e),f=0;if(!d||this===uS&&rS(d))for(s=iS(e),a=r?new this(s):uS(s);s>f;f++)l=o?i(e[f],f):e[f],oS(a,f,l);else for(h=(c=sS(e,d)).next,a=r?new this:[];!(u=$E(h,c)).done;f++)l=o?eS(c,i,[u.value,f],!0):u.value,oS(a,f,l);return a.length=f,a},oR=qi,sR=Fc.codeAt,aR=function(t){var e,r,n=[],i=xS(TS(ES(t),dS,"."),".");for(e=0;e<i.length;e++)r=i[e],bS(n,vS(lS,r)?"xn--"+RS(r):r);return _S(n,".")},uR=Kn,cR=Oo,hR=ql,lR={URLSearchParams:Uw,getState:uw},dR=Yo,fR=dR.set,pR=dR.getterFor("URL"),vR=lR.URLSearchParams,mR=lR.getState,yR=Kw.URL,gR=Kw.TypeError,_R=Kw.parseInt,bR=Math.floor,TR=Math.pow,xR=Qw("".charAt),ER=Qw(/./.exec),SR=Qw([].join),wR=Qw(1..toString),RR=Qw([].pop),CR=Qw([].push),PR=Qw("".replace),AR=Qw([].shift),OR=Qw("".split),IR=Qw("".slice),MR=Qw("".toLowerCase),DR=Qw([].unshift),LR="Invalid scheme",FR="Invalid host",NR="Invalid port",kR=/[a-z]/i,BR=/[\d+-.a-z]/i,GR=/\d/,UR=/^0x/i,jR=/^[0-7]+$/,XR=/^\d+$/,VR=/^[\da-f]+$/i,HR=/[\0\t\n\r #%/:<>?@[\\\]^|]/,WR=/[\0\t\n\r #/:<>?@[\\\]^|]/,YR=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,zR=/[\t\n\r]/g,ZR=function(t){var e,r,n,i;if("number"==typeof t){for(e=[],r=0;r<4;r++)DR(e,t%256),t=bR(t/256);return SR(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,i=0,o=0;o<8;o++)0!==t[o]?(i>r&&(e=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(e=n,r=i),e}(t),r=0;r<8;r++)i&&0===t[r]||(i&&(i=!1),n===r?(e+=r?":":"::",i=!0):(e+=wR(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},JR={},KR=nR({},JR,{" ":1,'"':1,"<":1,">":1,"`":1}),qR=nR({},KR,{"#":1,"?":1,"{":1,"}":1}),QR=nR({},qR,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$R=function(t,e){var r=sR(t,0);return r>32&&r<127&&!rR(e,t)?t:encodeURIComponent(t)},tC={ftp:21,file:null,http:80,https:443,ws:80,wss:443},eC=function(t,e){var r;return 2==t.length&&ER(kR,xR(t,0))&&(":"==(r=xR(t,1))||!e&&"|"==r)},rC=function(t){var e;return t.length>1&&eC(IR(t,0,2))&&(2==t.length||"/"===(e=xR(t,2))||"\\"===e||"?"===e||"#"===e)},nC=function(t){return"."===t||"%2e"===MR(t)},iC={},oC={},sC={},aC={},uC={},cC={},hC={},lC={},dC={},fC={},pC={},vC={},mC={},yC={},gC={},_C={},bC={},TC={},xC={},EC={},SC={},wC=function(t,e,r){var n,i,o,s=uR(t);if(e){if(i=this.parse(s))throw gR(i);this.searchParams=null}else{if(void 0!==r&&(n=new wC(r,!0)),i=this.parse(s,null,n))throw gR(i);(o=mR(new vR)).bindURL(this),this.searchParams=o}};wC.prototype={type:"URL",parse:function(t,e,r){var n,i,o,s,a,u=this,c=e||iC,h=0,l="",d=!1,f=!1,p=!1;for(t=uR(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=PR(t,YR,"")),t=PR(t,zR,""),n=iR(t);h<=n.length;){switch(i=n[h],c){case iC:if(!i||!ER(kR,i)){if(e)return LR;c=sC;continue}l+=MR(i),c=oC;break;case oC:if(i&&(ER(BR,i)||"+"==i||"-"==i||"."==i))l+=MR(i);else{if(":"!=i){if(e)return LR;l="",c=sC,h=0;continue}if(e&&(u.isSpecial()!=rR(tC,l)||"file"==l&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=l,e)return void(u.isSpecial()&&tC[u.scheme]==u.port&&(u.port=null));l="","file"==u.scheme?c=yC:u.isSpecial()&&r&&r.scheme==u.scheme?c=aC:u.isSpecial()?c=lC:"/"==n[h+1]?(c=uC,h++):(u.cannotBeABaseURL=!0,CR(u.path,""),c=xC)}break;case sC:if(!r||r.cannotBeABaseURL&&"#"!=i)return LR;if(r.cannotBeABaseURL&&"#"==i){u.scheme=r.scheme,u.path=oR(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,c=SC;break}c="file"==r.scheme?yC:cC;continue;case aC:if("/"!=i||"/"!=n[h+1]){c=cC;continue}c=dC,h++;break;case uC:if("/"==i){c=fC;break}c=TC;continue;case cC:if(u.scheme=r.scheme,i==Yw)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=oR(r.path),u.query=r.query;else if("/"==i||"\\"==i&&u.isSpecial())c=hC;else if("?"==i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=oR(r.path),u.query="",c=EC;else{if("#"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=oR(r.path),u.path.length--,c=TC;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=oR(r.path),u.query=r.query,u.fragment="",c=SC}break;case hC:if(!u.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,c=TC;continue}c=fC}else c=dC;break;case lC:if(c=dC,"/"!=i||"/"!=xR(l,h+1))continue;h++;break;case dC:if("/"!=i&&"\\"!=i){c=fC;continue}break;case fC:if("@"==i){d&&(l="%40"+l),d=!0,o=iR(l);for(var v=0;v<o.length;v++){var m=o[v];if(":"!=m||p){var y=$R(m,QR);p?u.password+=y:u.username+=y}else p=!0}l=""}else if(i==Yw||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(d&&""==l)return"Invalid authority";h-=iR(l).length+1,l="",c=pC}else l+=i;break;case pC:case vC:if(e&&"file"==u.scheme){c=_C;continue}if(":"!=i||f){if(i==Yw||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()){if(u.isSpecial()&&""==l)return FR;if(e&&""==l&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(l))return s;if(l="",c=bC,e)return;continue}"["==i?f=!0:"]"==i&&(f=!1),l+=i}else{if(""==l)return FR;if(s=u.parseHost(l))return s;if(l="",c=mC,e==vC)return}break;case mC:if(!ER(GR,i)){if(i==Yw||"/"==i||"?"==i||"#"==i||"\\"==i&&u.isSpecial()||e){if(""!=l){var g=_R(l,10);if(g>65535)return NR;u.port=u.isSpecial()&&g===tC[u.scheme]?null:g,l=""}if(e)return;c=bC;continue}return NR}l+=i;break;case yC:if(u.scheme="file","/"==i||"\\"==i)c=gC;else{if(!r||"file"!=r.scheme){c=TC;continue}if(i==Yw)u.host=r.host,u.path=oR(r.path),u.query=r.query;else if("?"==i)u.host=r.host,u.path=oR(r.path),u.query="",c=EC;else{if("#"!=i){rC(SR(oR(n,h),""))||(u.host=r.host,u.path=oR(r.path),u.shortenPath()),c=TC;continue}u.host=r.host,u.path=oR(r.path),u.query=r.query,u.fragment="",c=SC}}break;case gC:if("/"==i||"\\"==i){c=_C;break}r&&"file"==r.scheme&&!rC(SR(oR(n,h),""))&&(eC(r.path[0],!0)?CR(u.path,r.path[0]):u.host=r.host),c=TC;continue;case _C:if(i==Yw||"/"==i||"\\"==i||"?"==i||"#"==i){if(!e&&eC(l))c=TC;else if(""==l){if(u.host="",e)return;c=bC}else{if(s=u.parseHost(l))return s;if("localhost"==u.host&&(u.host=""),e)return;l="",c=bC}continue}l+=i;break;case bC:if(u.isSpecial()){if(c=TC,"/"!=i&&"\\"!=i)continue}else if(e||"?"!=i)if(e||"#"!=i){if(i!=Yw&&(c=TC,"/"!=i))continue}else u.fragment="",c=SC;else u.query="",c=EC;break;case TC:if(i==Yw||"/"==i||"\\"==i&&u.isSpecial()||!e&&("?"==i||"#"==i)){if(".."===(a=MR(a=l))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(u.shortenPath(),"/"==i||"\\"==i&&u.isSpecial()||CR(u.path,"")):nC(l)?"/"==i||"\\"==i&&u.isSpecial()||CR(u.path,""):("file"==u.scheme&&!u.path.length&&eC(l)&&(u.host&&(u.host=""),l=xR(l,0)+":"),CR(u.path,l)),l="","file"==u.scheme&&(i==Yw||"?"==i||"#"==i))for(;u.path.length>1&&""===u.path[0];)AR(u.path);"?"==i?(u.query="",c=EC):"#"==i&&(u.fragment="",c=SC)}else l+=$R(i,qR);break;case xC:"?"==i?(u.query="",c=EC):"#"==i?(u.fragment="",c=SC):i!=Yw&&(u.path[0]+=$R(i,JR));break;case EC:e||"#"!=i?i!=Yw&&("'"==i&&u.isSpecial()?u.query+="%27":u.query+="#"==i?"%23":$R(i,JR)):(u.fragment="",c=SC);break;case SC:i!=Yw&&(u.fragment+=$R(i,KR))}h++}},parseHost:function(t){var e,r,n;if("["==xR(t,0)){if("]"!=xR(t,t.length-1))return FR;if(e=function(t){var e,r,n,i,o,s,a,u=[0,0,0,0,0,0,0,0],c=0,h=null,l=0,d=function(){return xR(t,l)};if(":"==d()){if(":"!=xR(t,1))return;l+=2,h=++c}for(;d();){if(8==c)return;if(":"!=d()){for(e=r=0;r<4&&ER(VR,d());)e=16*e+_R(d(),16),l++,r++;if("."==d()){if(0==r)return;if(l-=r,c>6)return;for(n=0;d();){if(i=null,n>0){if(!("."==d()&&n<4))return;l++}if(!ER(GR,d()))return;for(;ER(GR,d());){if(o=_R(d(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}u[c]=256*u[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(l++,!d())return}else if(d())return;u[c++]=e}else{if(null!==h)return;l++,h=++c}}if(null!==h)for(s=c-h,c=7;0!=c&&s>0;)a=u[c],u[c--]=u[h+s-1],u[h+--s]=a;else if(8!=c)return;return u}(IR(t,1,-1)),!e)return FR;this.host=e}else if(this.isSpecial()){if(t=aR(t),ER(HR,t))return FR;if(e=function(t){var e,r,n,i,o,s,a,u=OR(t,".");if(u.length&&""==u[u.length-1]&&u.length--,(e=u.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(i=u[n]))return t;if(o=10,i.length>1&&"0"==xR(i,0)&&(o=ER(UR,i)?16:8,i=IR(i,8==o?1:2)),""===i)s=0;else{if(!ER(10==o?XR:8==o?jR:VR,i))return t;s=_R(i,o)}CR(r,s)}for(n=0;n<e;n++)if(s=r[n],n==e-1){if(s>=TR(256,5-e))return null}else if(s>255)return null;for(a=RR(r),n=0;n<r.length;n++)a+=r[n]*TR(256,3-n);return a}(t),null===e)return FR;this.host=e}else{if(ER(WR,t))return FR;for(e="",r=iR(t),n=0;n<r.length;n++)e+=$R(r[n],JR);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return rR(tC,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&eC(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,i=t.host,o=t.port,s=t.path,a=t.query,u=t.fragment,c=e+":";return null!==i?(c+="//",t.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=ZR(i),null!==o&&(c+=":"+o)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?s[0]:s.length?"/"+SR(s,"/"):"",null!==a&&(c+="?"+a),null!==u&&(c+="#"+u),c},setHref:function(t){var e=this.parse(t);if(e)throw gR(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new RC(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+ZR(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(uR(t)+":",iC)},getUsername:function(){return this.username},setUsername:function(t){var e=iR(uR(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=$R(e[r],QR)}},getPassword:function(){return this.password},setPassword:function(t){var e=iR(uR(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=$R(e[r],QR)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?ZR(t):ZR(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,pC)},getHostname:function(){var t=this.host;return null===t?"":ZR(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,vC)},getPort:function(){var t=this.port;return null===t?"":uR(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=uR(t))?this.port=null:this.parse(t,mC))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+SR(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,bC))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=uR(t))?this.query=null:("?"==xR(t,0)&&(t=IR(t,1)),this.query="",this.parse(t,EC)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=uR(t))?("#"==xR(t,0)&&(t=IR(t,1)),this.fragment="",this.parse(t,SC)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var RC=function(t){var e=eR(this,CC),r=hR(arguments.length,1)>1?arguments[1]:void 0,n=fR(e,new wC(t,!1,r));Zw||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},CC=RC.prototype,PC=function(t,e){return{get:function(){return pR(this)[t]()},set:e&&function(t){return pR(this)[e](t)},configurable:!0,enumerable:!0}};if(Zw&&(tR(CC,"href",PC("serialize","setHref")),tR(CC,"origin",PC("getOrigin")),tR(CC,"protocol",PC("getProtocol","setProtocol")),tR(CC,"username",PC("getUsername","setUsername")),tR(CC,"password",PC("getPassword","setPassword")),tR(CC,"host",PC("getHost","setHost")),tR(CC,"hostname",PC("getHostname","setHostname")),tR(CC,"port",PC("getPort","setPort")),tR(CC,"pathname",PC("getPathname","setPathname")),tR(CC,"search",PC("getSearch","setSearch")),tR(CC,"searchParams",PC("getSearchParams")),tR(CC,"hash",PC("getHash","setHash"))),$w(CC,"toJSON",(function(){return pR(this).serialize()}),{enumerable:!0}),$w(CC,"toString",(function(){return pR(this).serialize()}),{enumerable:!0}),yR){var AC=yR.createObjectURL,OC=yR.revokeObjectURL;AC&&$w(RC,"createObjectURL",qw(AC,yR)),OC&&$w(RC,"revokeObjectURL",qw(OC,yR))}cR(RC,"URL"),zw({global:!0,constructor:!0,forced:!Jw,sham:!Zw},{URL:RC});var IC=rt.URL;function MC(t,e,r){var n=void 0===e?null:e,i=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var DC=function(t,e,r){var n;return function(i){return n=n||MC(t,e,r),new Worker(n,i)}}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9InVuZGVmaW5lZCIhPXR5cGVvZiBnbG9iYWxUaGlzP2dsb2JhbFRoaXM6InVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3c/d2luZG93OiJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsP2dsb2JhbDoidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGY/c2VsZjp7fSxlPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0Lk1hdGg9PU1hdGgmJnR9LG49ZSgib2JqZWN0Ij09dHlwZW9mIGdsb2JhbFRoaXMmJmdsb2JhbFRoaXMpfHxlKCJvYmplY3QiPT10eXBlb2Ygd2luZG93JiZ3aW5kb3cpfHxlKCJvYmplY3QiPT10eXBlb2Ygc2VsZiYmc2VsZil8fGUoIm9iamVjdCI9PXR5cGVvZiB0JiZ0KXx8ZnVuY3Rpb24oKXtyZXR1cm4gdGhpc30oKXx8RnVuY3Rpb24oInJldHVybiB0aGlzIikoKSxyPWZ1bmN0aW9uKHQpe3RyeXtyZXR1cm4hIXQoKX1jYXRjaCh0KXtyZXR1cm4hMH19LG89IXIoKGZ1bmN0aW9uKCl7dmFyIHQ9ZnVuY3Rpb24oKXt9LmJpbmQoKTtyZXR1cm4iZnVuY3Rpb24iIT10eXBlb2YgdHx8dC5oYXNPd25Qcm9wZXJ0eSgicHJvdG90eXBlIil9KSksaT1vLHU9RnVuY3Rpb24ucHJvdG90eXBlLGM9dS5hcHBseSxhPXUuY2FsbCxmPSJvYmplY3QiPT10eXBlb2YgUmVmbGVjdCYmUmVmbGVjdC5hcHBseXx8KGk/YS5iaW5kKGMpOmZ1bmN0aW9uKCl7cmV0dXJuIGEuYXBwbHkoYyxhcmd1bWVudHMpfSksbD1vLHA9RnVuY3Rpb24ucHJvdG90eXBlLHM9cC5jYWxsLGI9bCYmcC5iaW5kLmJpbmQocyxzKSx5PWw/YjpmdW5jdGlvbih0KXtyZXR1cm4gZnVuY3Rpb24oKXtyZXR1cm4gcy5hcHBseSh0LGFyZ3VtZW50cyl9fSx2PXksZD12KHt9LnRvU3RyaW5nKSxoPXYoIiIuc2xpY2UpLG09ZnVuY3Rpb24odCl7cmV0dXJuIGgoZCh0KSw4LC0xKX0sZz1tLHc9eSxqPWZ1bmN0aW9uKHQpe2lmKCJGdW5jdGlvbiI9PT1nKHQpKXJldHVybiB3KHQpfSxTPSJvYmplY3QiPT10eXBlb2YgZG9jdW1lbnQmJmRvY3VtZW50LmFsbCxPPXthbGw6UyxJU19IVE1MRERBOnZvaWQgMD09PVMmJnZvaWQgMCE9PVN9LFQ9Ty5hbGwsRT1PLklTX0hUTUxEREE/ZnVuY3Rpb24odCl7cmV0dXJuImZ1bmN0aW9uIj09dHlwZW9mIHR8fHQ9PT1UfTpmdW5jdGlvbih0KXtyZXR1cm4iZnVuY3Rpb24iPT10eXBlb2YgdH0sUD17fSxJPSFyKChmdW5jdGlvbigpe3JldHVybiA3IT1PYmplY3QuZGVmaW5lUHJvcGVydHkoe30sMSx7Z2V0OmZ1bmN0aW9uKCl7cmV0dXJuIDd9fSlbMV19KSksRD1vLF89RnVuY3Rpb24ucHJvdG90eXBlLmNhbGwsTD1EP18uYmluZChfKTpmdW5jdGlvbigpe3JldHVybiBfLmFwcGx5KF8sYXJndW1lbnRzKX0saz17fSxNPXt9LnByb3BlcnR5SXNFbnVtZXJhYmxlLEM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcixGPUMmJiFNLmNhbGwoezE6Mn0sMSk7ay5mPUY/ZnVuY3Rpb24odCl7dmFyIGU9Qyh0aGlzLHQpO3JldHVybiEhZSYmZS5lbnVtZXJhYmxlfTpNO3ZhciBBLHosTj1mdW5jdGlvbih0LGUpe3JldHVybntlbnVtZXJhYmxlOiEoMSZ0KSxjb25maWd1cmFibGU6ISgyJnQpLHdyaXRhYmxlOiEoNCZ0KSx2YWx1ZTplfX0seD1yLEg9bSxSPU9iamVjdCxHPWooIiIuc3BsaXQpLFY9eCgoZnVuY3Rpb24oKXtyZXR1cm4hUigieiIpLnByb3BlcnR5SXNFbnVtZXJhYmxlKDApfSkpP2Z1bmN0aW9uKHQpe3JldHVybiJTdHJpbmciPT1IKHQpP0codCwiIik6Uih0KX06UixZPWZ1bmN0aW9uKHQpe3JldHVybiBudWxsPT10fSxxPVksQj1UeXBlRXJyb3IsSj1mdW5jdGlvbih0KXtpZihxKHQpKXRocm93IEIoIkNhbid0IGNhbGwgbWV0aG9kIG9uICIrdCk7cmV0dXJuIHR9LEs9VixRPUosVT1FLFc9Ty5hbGwsWD1PLklTX0hUTUxEREE/ZnVuY3Rpb24odCl7cmV0dXJuIm9iamVjdCI9PXR5cGVvZiB0P251bGwhPT10OlUodCl8fHQ9PT1XfTpmdW5jdGlvbih0KXtyZXR1cm4ib2JqZWN0Ij09dHlwZW9mIHQ/bnVsbCE9PXQ6VSh0KX0sWj17fSwkPVosdHQ9bixldD1FLG50PWZ1bmN0aW9uKHQpe3JldHVybiBldCh0KT90OnZvaWQgMH0scnQ9ZnVuY3Rpb24odCxlKXtyZXR1cm4gYXJndW1lbnRzLmxlbmd0aDwyP250KCRbdF0pfHxudCh0dFt0XSk6JFt0XSYmJFt0XVtlXXx8dHRbdF0mJnR0W3RdW2VdfSxvdD1qKHt9LmlzUHJvdG90eXBlT2YpLGl0PXJ0KCJuYXZpZ2F0b3IiLCJ1c2VyQWdlbnQiKXx8IiIsdXQ9bixjdD1pdCxhdD11dC5wcm9jZXNzLGZ0PXV0LkRlbm8sbHQ9YXQmJmF0LnZlcnNpb25zfHxmdCYmZnQudmVyc2lvbixwdD1sdCYmbHQudjg7cHQmJih6PShBPXB0LnNwbGl0KCIuIikpWzBdPjAmJkFbMF08ND8xOisoQVswXStBWzFdKSksIXomJmN0JiYoIShBPWN0Lm1hdGNoKC9FZGdlXC8oXGQrKS8pKXx8QVsxXT49NzQpJiYoQT1jdC5tYXRjaCgvQ2hyb21lXC8oXGQrKS8pKSYmKHo9K0FbMV0pO3ZhciBzdD16LGJ0PXIseXQ9ISFPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzJiYhYnQoKGZ1bmN0aW9uKCl7dmFyIHQ9U3ltYm9sKCk7cmV0dXJuIVN0cmluZyh0KXx8IShPYmplY3QodClpbnN0YW5jZW9mIFN5bWJvbCl8fCFTeW1ib2wuc2hhbSYmc3QmJnN0PDQxfSkpLHZ0PXl0JiYhU3ltYm9sLnNoYW0mJiJzeW1ib2wiPT10eXBlb2YgU3ltYm9sLml0ZXJhdG9yLGR0PXJ0LGh0PUUsbXQ9b3QsZ3Q9T2JqZWN0LHd0PXZ0P2Z1bmN0aW9uKHQpe3JldHVybiJzeW1ib2wiPT10eXBlb2YgdH06ZnVuY3Rpb24odCl7dmFyIGU9ZHQoIlN5bWJvbCIpO3JldHVybiBodChlKSYmbXQoZS5wcm90b3R5cGUsZ3QodCkpfSxqdD1TdHJpbmcsU3Q9RSxPdD1mdW5jdGlvbih0KXt0cnl7cmV0dXJuIGp0KHQpfWNhdGNoKHQpe3JldHVybiJPYmplY3QifX0sVHQ9VHlwZUVycm9yLEV0PWZ1bmN0aW9uKHQpe2lmKFN0KHQpKXJldHVybiB0O3Rocm93IFR0KE90KHQpKyIgaXMgbm90IGEgZnVuY3Rpb24iKX0sUHQ9RXQsSXQ9WSxEdD1MLF90PUUsTHQ9WCxrdD1UeXBlRXJyb3IsTXQ9e2V4cG9ydHM6e319LEN0PW4sRnQ9T2JqZWN0LmRlZmluZVByb3BlcnR5LEF0PWZ1bmN0aW9uKHQsZSl7dHJ5e0Z0KEN0LHQse3ZhbHVlOmUsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwfSl9Y2F0Y2gobil7Q3RbdF09ZX1yZXR1cm4gZX0senQ9Il9fY29yZS1qc19zaGFyZWRfXyIsTnQ9blt6dF18fEF0KHp0LHt9KTsoTXQuZXhwb3J0cz1mdW5jdGlvbih0LGUpe3JldHVybiBOdFt0XXx8KE50W3RdPXZvaWQgMCE9PWU/ZTp7fSl9KSgidmVyc2lvbnMiLFtdKS5wdXNoKHt2ZXJzaW9uOiIzLjI2LjAiLG1vZGU6InB1cmUiLGNvcHlyaWdodDoiwqkgMjAxNC0yMDIyIERlbmlzIFB1c2hrYXJldiAoemxvaXJvY2sucnUpIixsaWNlbnNlOiJodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcy9ibG9iL3YzLjI2LjAvTElDRU5TRSIsc291cmNlOiJodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcyJ9KTt2YXIgeHQ9SixIdD1PYmplY3QsUnQ9ZnVuY3Rpb24odCl7cmV0dXJuIEh0KHh0KHQpKX0sR3Q9aih7fS5oYXNPd25Qcm9wZXJ0eSksVnQ9T2JqZWN0Lmhhc093bnx8ZnVuY3Rpb24odCxlKXtyZXR1cm4gR3QoUnQodCksZSl9LFl0PWoscXQ9MCxCdD1NYXRoLnJhbmRvbSgpLEp0PVl0KDEuLnRvU3RyaW5nKSxLdD1uLFF0PU10LmV4cG9ydHMsVXQ9VnQsV3Q9ZnVuY3Rpb24odCl7cmV0dXJuIlN5bWJvbCgiKyh2b2lkIDA9PT10PyIiOnQpKyIpXyIrSnQoKytxdCtCdCwzNil9LFh0PXl0LFp0PXZ0LCR0PVF0KCJ3a3MiKSx0ZT1LdC5TeW1ib2wsZWU9dGUmJnRlLmZvcixuZT1adD90ZTp0ZSYmdGUud2l0aG91dFNldHRlcnx8V3QscmU9TCxvZT1YLGllPXd0LHVlPWZ1bmN0aW9uKHQsZSl7dmFyIG49dFtlXTtyZXR1cm4gSXQobik/dm9pZCAwOlB0KG4pfSxjZT1mdW5jdGlvbih0LGUpe3ZhciBuLHI7aWYoInN0cmluZyI9PT1lJiZfdChuPXQudG9TdHJpbmcpJiYhTHQocj1EdChuLHQpKSlyZXR1cm4gcjtpZihfdChuPXQudmFsdWVPZikmJiFMdChyPUR0KG4sdCkpKXJldHVybiByO2lmKCJzdHJpbmciIT09ZSYmX3Qobj10LnRvU3RyaW5nKSYmIUx0KHI9RHQobix0KSkpcmV0dXJuIHI7dGhyb3cga3QoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfSxhZT1UeXBlRXJyb3IsZmU9ZnVuY3Rpb24odCl7aWYoIVV0KCR0LHQpfHwhWHQmJiJzdHJpbmciIT10eXBlb2YgJHRbdF0pe3ZhciBlPSJTeW1ib2wuIit0O1h0JiZVdCh0ZSx0KT8kdFt0XT10ZVt0XTokdFt0XT1adCYmZWU/ZWUoZSk6bmUoZSl9cmV0dXJuICR0W3RdfSgidG9QcmltaXRpdmUiKSxsZT1mdW5jdGlvbih0LGUpe2lmKCFvZSh0KXx8aWUodCkpcmV0dXJuIHQ7dmFyIG4scj11ZSh0LGZlKTtpZihyKXtpZih2b2lkIDA9PT1lJiYoZT0iZGVmYXVsdCIpLG49cmUocix0LGUpLCFvZShuKXx8aWUobikpcmV0dXJuIG47dGhyb3cgYWUoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfXJldHVybiB2b2lkIDA9PT1lJiYoZT0ibnVtYmVyIiksY2UodCxlKX0scGU9d3Qsc2U9ZnVuY3Rpb24odCl7dmFyIGU9bGUodCwic3RyaW5nIik7cmV0dXJuIHBlKGUpP2U6ZSsiIn0sYmU9WCx5ZT1uLmRvY3VtZW50LHZlPWJlKHllKSYmYmUoeWUuY3JlYXRlRWxlbWVudCksZGU9ZnVuY3Rpb24odCl7cmV0dXJuIHZlP3llLmNyZWF0ZUVsZW1lbnQodCk6e319LGhlPSFJJiYhcigoZnVuY3Rpb24oKXtyZXR1cm4gNyE9T2JqZWN0LmRlZmluZVByb3BlcnR5KGRlKCJkaXYiKSwiYSIse2dldDpmdW5jdGlvbigpe3JldHVybiA3fX0pLmF9KSksbWU9SSxnZT1MLHdlPWssamU9TixTZT1mdW5jdGlvbih0KXtyZXR1cm4gSyhRKHQpKX0sT2U9c2UsVGU9VnQsRWU9aGUsUGU9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtQLmY9bWU/UGU6ZnVuY3Rpb24odCxlKXtpZih0PVNlKHQpLGU9T2UoZSksRWUpdHJ5e3JldHVybiBQZSh0LGUpfWNhdGNoKHQpe31pZihUZSh0LGUpKXJldHVybiBqZSghZ2Uod2UuZix0LGUpLHRbZV0pfTt2YXIgSWU9cixEZT1FLF9lPS8jfFwucHJvdG90eXBlXC4vLExlPWZ1bmN0aW9uKHQsZSl7dmFyIG49TWVba2UodCldO3JldHVybiBuPT1GZXx8biE9Q2UmJihEZShlKT9JZShlKTohIWUpfSxrZT1MZS5ub3JtYWxpemU9ZnVuY3Rpb24odCl7cmV0dXJuIFN0cmluZyh0KS5yZXBsYWNlKF9lLCIuIikudG9Mb3dlckNhc2UoKX0sTWU9TGUuZGF0YT17fSxDZT1MZS5OQVRJVkU9Ik4iLEZlPUxlLlBPTFlGSUxMPSJQIixBZT1MZSx6ZT1FdCxOZT1vLHhlPWooai5iaW5kKSxIZT17fSxSZT1JJiZyKChmdW5jdGlvbigpe3JldHVybiA0MiE9T2JqZWN0LmRlZmluZVByb3BlcnR5KChmdW5jdGlvbigpe30pLCJwcm90b3R5cGUiLHt2YWx1ZTo0Mix3cml0YWJsZTohMX0pLnByb3RvdHlwZX0pKSxHZT1YLFZlPVN0cmluZyxZZT1UeXBlRXJyb3IscWU9SSxCZT1oZSxKZT1SZSxLZT1mdW5jdGlvbih0KXtpZihHZSh0KSlyZXR1cm4gdDt0aHJvdyBZZShWZSh0KSsiIGlzIG5vdCBhbiBvYmplY3QiKX0sUWU9c2UsVWU9VHlwZUVycm9yLFdlPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxYZT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yLFplPSJlbnVtZXJhYmxlIiwkZT0iY29uZmlndXJhYmxlIix0bj0id3JpdGFibGUiO0hlLmY9cWU/SmU/ZnVuY3Rpb24odCxlLG4pe2lmKEtlKHQpLGU9UWUoZSksS2UobiksImZ1bmN0aW9uIj09dHlwZW9mIHQmJiJwcm90b3R5cGUiPT09ZSYmInZhbHVlImluIG4mJnRuIGluIG4mJiFuLndyaXRhYmxlKXt2YXIgcj1YZSh0LGUpO3ImJnIud3JpdGFibGUmJih0W2VdPW4udmFsdWUsbj17Y29uZmlndXJhYmxlOiRlIGluIG4/bi5jb25maWd1cmFibGU6ci5jb25maWd1cmFibGUsZW51bWVyYWJsZTpaZSBpbiBuP24uZW51bWVyYWJsZTpyLmVudW1lcmFibGUsd3JpdGFibGU6ITF9KX1yZXR1cm4gV2UodCxlLG4pfTpXZTpmdW5jdGlvbih0LGUsbil7aWYoS2UodCksZT1RZShlKSxLZShuKSxCZSl0cnl7cmV0dXJuIFdlKHQsZSxuKX1jYXRjaCh0KXt9aWYoImdldCJpbiBufHwic2V0ImluIG4pdGhyb3cgVWUoIkFjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIik7cmV0dXJuInZhbHVlImluIG4mJih0W2VdPW4udmFsdWUpLHR9O3ZhciBlbj1IZSxubj1OLHJuPUk/ZnVuY3Rpb24odCxlLG4pe3JldHVybiBlbi5mKHQsZSxubigxLG4pKX06ZnVuY3Rpb24odCxlLG4pe3JldHVybiB0W2VdPW4sdH0sb249bix1bj1mLGNuPWosYW49RSxmbj1QLmYsbG49QWUscG49Wixzbj1mdW5jdGlvbih0LGUpe3JldHVybiB6ZSh0KSx2b2lkIDA9PT1lP3Q6TmU/eGUodCxlKTpmdW5jdGlvbigpe3JldHVybiB0LmFwcGx5KGUsYXJndW1lbnRzKX19LGJuPXJuLHluPVZ0LHZuPWZ1bmN0aW9uKHQpe3ZhciBlPWZ1bmN0aW9uKG4scixvKXtpZih0aGlzIGluc3RhbmNlb2YgZSl7c3dpdGNoKGFyZ3VtZW50cy5sZW5ndGgpe2Nhc2UgMDpyZXR1cm4gbmV3IHQ7Y2FzZSAxOnJldHVybiBuZXcgdChuKTtjYXNlIDI6cmV0dXJuIG5ldyB0KG4scil9cmV0dXJuIG5ldyB0KG4scixvKX1yZXR1cm4gdW4odCx0aGlzLGFyZ3VtZW50cyl9O3JldHVybiBlLnByb3RvdHlwZT10LnByb3RvdHlwZSxlfSxkbj1mdW5jdGlvbih0LGUpe3ZhciBuLHIsbyxpLHUsYyxhLGYsbD10LnRhcmdldCxwPXQuZ2xvYmFsLHM9dC5zdGF0LGI9dC5wcm90byx5PXA/b246cz9vbltsXToob25bbF18fHt9KS5wcm90b3R5cGUsdj1wP3BuOnBuW2xdfHxibihwbixsLHt9KVtsXSxkPXYucHJvdG90eXBlO2ZvcihvIGluIGUpbj0hbG4ocD9vOmwrKHM/Ii4iOiIjIikrbyx0LmZvcmNlZCkmJnkmJnluKHksbyksdT12W29dLG4mJihjPXQuZG9udENhbGxHZXRTZXQ/KGY9Zm4oeSxvKSkmJmYudmFsdWU6eVtvXSksaT1uJiZjP2M6ZVtvXSxuJiZ0eXBlb2YgdT09dHlwZW9mIGl8fChhPXQuYmluZCYmbj9zbihpLG9uKTp0LndyYXAmJm4/dm4oaSk6YiYmYW4oaSk/Y24oaSk6aSwodC5zaGFtfHxpJiZpLnNoYW18fHUmJnUuc2hhbSkmJmJuKGEsInNoYW0iLCEwKSxibih2LG8sYSksYiYmKHluKHBuLHI9bCsiUHJvdG90eXBlIil8fGJuKHBuLHIse30pLGJuKHBuW3JdLG8saSksdC5yZWFsJiZkJiYhZFtvXSYmYm4oZCxvLGkpKSl9LGhuPWooW10uc2xpY2UpLG1uPVR5cGVFcnJvcixnbj1uLHduPWYsam49RSxTbj1obixPbj1mdW5jdGlvbih0LGUpe2lmKHQ8ZSl0aHJvdyBtbigiTm90IGVub3VnaCBhcmd1bWVudHMiKTtyZXR1cm4gdH0sVG49L01TSUUgLlwuLy50ZXN0KGl0KSxFbj1nbi5GdW5jdGlvbixQbj1mdW5jdGlvbih0KXtyZXR1cm4gVG4/ZnVuY3Rpb24oZSxuKXt2YXIgcj1Pbihhcmd1bWVudHMubGVuZ3RoLDEpPjIsbz1qbihlKT9lOkVuKGUpLGk9cj9Tbihhcmd1bWVudHMsMik6dm9pZCAwO3JldHVybiB0KHI/ZnVuY3Rpb24oKXt3bihvLHRoaXMsaSl9Om8sbil9OnR9LEluPXtzZXRUaW1lb3V0OlBuKGduLnNldFRpbWVvdXQpLHNldEludGVydmFsOlBuKGduLnNldEludGVydmFsKX0sRG49SW4uc2V0SW50ZXJ2YWw7ZG4oe2dsb2JhbDohMCxiaW5kOiEwLGZvcmNlZDpuLnNldEludGVydmFsIT09RG59LHtzZXRJbnRlcnZhbDpEbn0pO3ZhciBfbj1Jbi5zZXRUaW1lb3V0O2RuKHtnbG9iYWw6ITAsYmluZDohMCxmb3JjZWQ6bi5zZXRUaW1lb3V0IT09X259LHtzZXRUaW1lb3V0Ol9ufSk7dmFyIExuPVouc2V0SW50ZXJ2YWwsa249ITEsTW49bnVsbDtzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLChmdW5jdGlvbih0KXt2YXIgZT10LmRhdGEsbj1lLnR5cGUscj1lLmRhdGE7c3dpdGNoKG4pe2Nhc2Uic3RhcnQiOmtufHwoa249ITAsTW49TG4oKGZ1bmN0aW9uKCl7a249ITEsc2VsZi5wb3N0TWVzc2FnZSgidGljayIpfSksci50aW1lKSk7YnJlYWs7Y2FzZSJzdG9wIjpjbGVhckludGVydmFsKE1uKSxrbj0hMX19KSwhMSk7cmV0dXJue319KCk7Cgo=",null,!1),LC=function(){return new DC},FC=Yf("stream:media"),NC=function(){function t(){var t,e,r,n;this.mediaStream=null,this.videoEl=null,this.canvasEl=null,this.canvasContext=null,this.audioContext=null,this.audioSource=null,this.worker=null,this.config=null,this.promise=null,this.onVideoError=lh(t=this.onVideoError).call(t,this),this.onPause=lh(e=this.onPause).call(e,this),this.onVideoPlay=lh(r=this.onVideoPlay).call(r,this),this.renderCanvas=lh(n=this.renderCanvas).call(n,this)}return t.prototype.start=function(t){var e=this,r=t.video,n=t.audio,i=t.fileSource;return this.config=t,new zx((function(t,o){if(e.promise={resolve:t,reject:o},e.mediaStream)return FC("stream is existed"),void t(e.mediaStream);e.videoEl||(e.videoEl=gy()),e.videoEl.muted=!n,r&&!e.canvasEl&&(e.canvasEl=document.createElement("canvas"),e.canvasContext=e.canvasEl.getContext("2d",{desynchronized:!0,willReadFrequently:!0})),r&&!e.worker&&(e.worker=LC()),n&&!e.audioContext&&(e.audioContext=yy());var s=i instanceof File?IC.createObjectURL(i):i;e.playVideo(s)}))},t.prototype.stop=function(){var t;this.mediaStream?(this.destroy(),Ph(t=this.mediaStream.getTracks()).call(t,(function(t){t.stop()})),this.mediaStream=null):FC("stream is not existed")},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings(),r=e.width,n=e.height;return{width:null!=r?r:this.canvasEl.width,height:null!=n?n:this.canvasEl.height}},t.prototype.getRenderView=function(){return this.canvasEl},t.prototype.getRenderElement=function(){return this.videoEl},t.prototype.onVideoError=function(){this.videoEl.error&&(FC("play video error",this.videoEl.error),this.promise.reject(this.videoEl.error))},t.prototype.onPause=function(){var t=this;FC("video is paused, try to resume"),cd((function(){t.videoEl.play()}),50)},t.prototype.onVideoPlay=function(){if(!this.mediaStream){this.videoEl.removeEventListener("timeupdate",this.onVideoPlay);var t=this.config,e=t.video,r=t.audio,n=null,i=null;if(e){var o=e.frameRate;this.renderCanvas(),FC("start render canvas");try{n=this.canvasEl.captureStream(o)}catch(t){return FC("get video stream error, ".concat(t.toString())),void this.promise.reject(t)}}if(r)try{this.audioSource||(this.audioSource=this.audioContext.createMediaElementSource(this.videoEl));var s=this.audioContext.createMediaStreamDestination();this.audioSource.connect(s),i=s.stream}catch(t){return FC("get audio stream error, ".concat(t.toString())),void this.promise.reject(t)}if(n||i){var a,u=new MediaStream;Ph(a=[n,i]).call(a,(function(t){var e,r,n=null===(r=null===(e=null==t?void 0:t.getTracks)||void 0===e?void 0:e.call(t))||void 0===r?void 0:r[0];n&&u.addTrack(n)})),this.mediaStream=u,this.promise.resolve(u)}}},t.prototype.renderCanvas=function(){if(this.canvasEl){var t=this.config.video.resolution,e=this.videoEl,r=t.width,n=t.height,i=e.videoWidth,o=e.videoHeight,s=null,a=null;0===i||0===o?(s=r,a=n):r/n<i/o?(s=r,a=r*o/i):(s=n*i/o,a=n),this.canvasEl.width=s,this.canvasEl.height=a;var u=this.canvasContext;null==u||u.clearRect(0,0,s,a),null==u||u.fillRect(0,0,s,a),null==u||u.drawImage(e,0,0,i,o,0,0,s,a),this.requestAnimationFrameWrapper(this.renderCanvas)}else FC("canvas destroy, render canvas stop")},t.prototype.setWorkerInterval=function(t,e){var r,n,i=this;null===(r=this.worker)||void 0===r||r.addEventListener("message",t),null===(n=this.worker)||void 0===n||n.postMessage({type:"start",data:{time:e}});return function(){var e,r;null===(e=i.worker)||void 0===e||e.postMessage({type:"stop"}),null===(r=i.worker)||void 0===r||r.removeEventListener("message",t)}},t.prototype.requestAnimationFrameWrapper=function(t){var e=this.config.video.frameRate,r=!1,n=this.setWorkerInterval((function(){!r&&document.hidden&&(r=!0,n(),t())}),1e3/e);requestAnimationFrame((function(){r||(r=!0,n(),t())}))},t.prototype.playVideo=function(t){return Ed(this,void 0,void 0,(function(){var e,r;return Sd(this,(function(n){switch(n.label){case 0:(e=this.videoEl).addEventListener("error",this.onVideoError),e.addEventListener("pause",this.onPause),e.addEventListener("timeupdate",this.onVideoPlay),e.src=t,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),FC("play ok"),[3,4];case 3:return r=n.sent(),FC("play failed, ".concat(r.toString())),this.promise.reject(r),this.destroy(),[3,4];case 4:return[2]}}))}))},t.prototype.destroy=function(){var t,e=this.videoEl;e.removeEventListener("error",this.onVideoError),e.removeEventListener("pause",this.onPause),e.removeEventListener("timeupdate",this.onVideoPlay),this.canvasEl&&(this.canvasContext=null,this.canvasEl=null);var r=e.src;e.pause(),e.src="",e.removeAttribute("src"),e.load(),r&&this.config.fileSource instanceof File&&IC.revokeObjectURL(r),this.config=null,this.promise=null,this.audioSource&&(this.audioSource.disconnect(),this.audioSource=null),window.TXLiveAudioContext||(null===(t=this.audioContext)||void 0===t||t.close(),this.audioContext=null),this.worker&&(this.worker.terminate(),this.worker=null),this.videoEl&&(this.videoEl.remove(),this.videoEl=null)},t}(),kC=Yf("stream:image"),BC=function(){function t(){var t,e;this.mediaStream=null,this.imageEl=null,this.canvasEl=null,this.canvasContext=null,this.worker=null,this.config=null,this.promise=null,this.onLoad=lh(t=this.onLoad).call(t,this),this.renderCanvas=lh(e=this.renderCanvas).call(e,this)}return t.prototype.start=function(t){var e=this,r=t.fileSource;return this.config=t,new zx((function(t,n){if(e.promise={resolve:t,reject:n},e.mediaStream)return kC("stream is existed"),void t(e.mediaStream);e.imageEl||(e.imageEl=new Image),e.canvasEl||(e.canvasEl=document.createElement("canvas"),e.canvasContext=e.canvasEl.getContext("2d",{desynchronized:!0})),e.worker||(e.worker=LC());var i=r instanceof File?IC.createObjectURL(r):r;e.loadImage(i)}))},t.prototype.stop=function(){var t;if(this.mediaStream){var e=this.imageEl.src;this.imageEl.removeEventListener("load",this.onLoad),this.imageEl.src="",this.imageEl=null,e&&this.config.fileSource instanceof File&&IC.revokeObjectURL(e),this.canvasContext=null,this.canvasEl=null,this.config=null,this.promise=null,this.worker&&(this.worker.terminate(),this.worker=null),Ph(t=this.mediaStream.getTracks()).call(t,(function(t){t.stop()})),this.mediaStream=null}else kC("stream is not existed")},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings(),r=e.width,n=e.height;return{width:null!=r?r:this.canvasEl.width,height:null!=n?n:this.canvasEl.height}},t.prototype.getRenderView=function(){return this.canvasEl},t.prototype.getRenderElement=function(){return this.imageEl},t.prototype.onLoad=function(){var t=this.config.video.frameRate;this.renderCanvas(),kC("start render canvas");try{var e=this.canvasEl.captureStream(t),r=e.getAudioTracks();Ph(r).call(r,(function(t){e.removeTrack(t)})),this.mediaStream=e,this.promise.resolve(e)}catch(t){kC("get image stream error, ".concat(t.toString())),this.promise.reject(t)}},t.prototype.renderCanvas=function(){if(this.imageEl&&this.canvasEl){var t=this.config.video.resolution,e=t.width,r=t.height,n=this.imageEl.naturalWidth,i=this.imageEl.naturalHeight,o=null,s=null;0===n||0===i?(o=e,s=r):e/r<n/i?(o=e,s=e*i/n):(o=r*n/i,s=r),this.canvasEl.width=o,this.canvasEl.height=s;var a=this.canvasContext;null==a||a.clearRect(0,0,o,s),null==a||a.fillRect(0,0,o,s),null==a||a.drawImage(this.imageEl,0,0,n,i,0,0,o,s),this.requestAnimationFrameWrapper(this.renderCanvas)}else kC("render canvas stop")},t.prototype.loadImage=function(t){this.imageEl.addEventListener("load",this.onLoad),this.imageEl.src=t},t.prototype.setWorkerInterval=function(t,e){var r,n,i=this;null===(r=this.worker)||void 0===r||r.addEventListener("message",t),null===(n=this.worker)||void 0===n||n.postMessage({type:"start",data:{time:e}});return function(){var e,r;null===(e=i.worker)||void 0===e||e.postMessage({type:"stop"}),null===(r=i.worker)||void 0===r||r.removeEventListener("message",t)}},t.prototype.requestAnimationFrameWrapper=function(t){var e=this.config.video.frameRate,r=!1,n=this.setWorkerInterval((function(){!r&&document.hidden&&(r=!0,n(),t())}),1e3/e);requestAnimationFrame((function(){r||(r=!0,n(),t())}))},t}(),GC=Yf("stream"),UC=function(){function t(t){this.type=null,this.videoConfig=null,this.audioConfig=null,this.fileSource=null,this.onEvent=null,this.instance=null,this.needStopListener=!1;var e=t.type,r=t.video,n=t.audio,i=t.fileSource,o=t.onEvent;e&&Jl(ip).call(ip,e)?(this.type=e,"file"===e&&this.setFileSource(i),r||n?((r||"screen"===e)&&(this.videoConfig=zm(op)),n&&(this.audioConfig=zm(sp)),o&&"function"==typeof o&&(this.onEvent=o)):GC("video or audio must be existed")):GC("stream type(".concat(e,") is invalid"))}return t.prototype.setFileSource=function(t){var e,r;if("file"===this.type)if(t)if("string"==typeof t||t instanceof File){var n="string"==typeof t?Td(e=cp.extension).call(e,(function(e){var r;return xE(r=t.toLowerCase()).call(r,e)})):Td(r=cp.type).call(r,(function(e){return t.type===e}));n?this.fileSource=t:GC("File format is not supported")}else GC("fileSource must be string or file object");else GC("fileSource must be existed");else GC("stream type must be file")},t.prototype.setVideoConfig=function(t){if(this.videoConfig){var e=t.deviceId,r=t.frameRate,n=t.resolution;void 0!==e&&("string"==typeof e?this.videoConfig.deviceId=e:GC("deviceId must be string")),void 0!==r&&"number"==typeof r&&r>0?this.videoConfig.frameRate=r:GC("frameRate must be a number greater than 0"),void 0!==n&&"object"===Wc(n)&&"number"==typeof n.width&&"number"==typeof n.height&&n.width>0&&n.height>0?this.videoConfig.resolution=n:GC("resolution width and height must be a number greater than 0")}},t.prototype.setAudioConfig=function(t){if(this.audioConfig){var e=t.deviceId,r=t.sampleRate,n=t.echoCancellation,i=t.noiseSuppression,o=t.autoGainControl;void 0!==e&&("string"==typeof e?this.audioConfig.deviceId=e:GC("deviceId must be string")),void 0!==r&&"number"==typeof r&&r>0?this.audioConfig.sampleRate=r:GC("sampleRate must be a number greater than 0"),void 0!==n&&(this.audioConfig.echoCancellation=!!n),void 0!==i&&(this.audioConfig.noiseSuppression=!!i),void 0!==o&&(this.audioConfig.autoGainControl=!!o)}},t.prototype.start=function(){return Ed(this,void 0,void 0,(function(){var t,e,r,n,i,o,s;return Sd(this,(function(a){switch(a.label){case 0:if(!this.type)throw GC("start failed, init param type is invalid"),(n=new Error("init param type is invalid")).name="InitializedError",n;if(!this.videoConfig&&!this.audioConfig)throw GC("start failed, init param video or audio must be existed"),(n=new Error("init param video or audio must be existed")).name="InitializedError",n;if("file"===this.type&&!this.fileSource)throw GC("start failed, file source is not existed"),(n=new Error("file source is not existed")).name="NotFoundError",n;var u,c;if(t="media","file"===this.type)if(e=this.fileSource,r="string"==typeof e?Td(u=up).call(u,(function(t){var r;return xE(r=e.toLowerCase()).call(r,t)})):Td(c=ap).call(c,(function(t){return e.type===t})),"image"===(t=r?"image":"media")&&!this.videoConfig)throw GC("start failed, init param video must be existed"),(n=new Error("init param video must be existed")).name="InitializedError",n;if(!this.instance){switch(i=null,this.type){case"device":i=new OE;break;case"screen":i=new ME;break;case"file":i="media"===t?new NC:new BC}this.instance=i}if(this.instance.mediaStream)return GC("stream is existed"),[2,this.instance.mediaStream];o=void 0,"file"!==this.type?o={video:this.videoConfig,audio:this.audioConfig}:"media"===t?o={video:this.videoConfig,audio:!!this.audioConfig,fileSource:this.fileSource}:"image"===t&&(o={video:this.videoConfig,fileSource:this.fileSource}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.start(o)];case 2:return s=a.sent(),this.needStopListener=!1,this.addStopListener(s),[2,s];case 3:throw a.sent();case 4:return[2]}}))}))},t.prototype.stop=function(){var t,e;this.needStopListener=!0,null===(t=this.instance)||void 0===t||t.stop(),null===(e=this.onEvent)||void 0===e||e.call(this,{type:lp,data:{message:"manual stop"}})},t.prototype.getMediaStream=function(){var t;return null===(t=this.instance)||void 0===t?void 0:t.mediaStream},t.prototype.getVideoTrack=function(){var t,e,r,n;return null===(n=null===(r=null===(e=null===(t=this.instance)||void 0===t?void 0:t.mediaStream)||void 0===e?void 0:e.getVideoTracks)||void 0===r?void 0:r.call(e))||void 0===n?void 0:n[0]},t.prototype.getAudioTrack=function(){var t,e,r,n;return null===(n=null===(r=null===(e=null===(t=this.instance)||void 0===t?void 0:t.mediaStream)||void 0===e?void 0:e.getAudioTracks)||void 0===r?void 0:r.call(e))||void 0===n?void 0:n[0]},t.prototype.getResolution=function(){var t;return null===(t=this.instance)||void 0===t?void 0:t.getResolution()},t.prototype.getRenderView=function(){return this.instance&&(this.instance instanceof BC||this.instance instanceof NC)?this.instance.getRenderView():null},t.prototype.getRenderElement=function(){return this.instance&&(this.instance instanceof BC||this.instance instanceof NC)?this.instance.getRenderElement():null},t.prototype.addStopListener=function(t){var e,r=this;"file"!==this.type&&Ph(e=t.getTracks()).call(e,(function(e){e.addEventListener("ended",(function n(){var i,o,s,a;if(!r.needStopListener){GC("".concat(e.kind," track is ended")),e.stop(),null===(o=r.onEvent)||void 0===o||o.call(r,{type:hp,data:{message:"track ended",kind:e.kind}});var u=PE(i=t.getTracks()).call(i,(function(t){return"ended"===t.readyState}));u&&(GC("stream is ended"),null===(s=r.instance)||void 0===s||s.stop(),null===(a=r.onEvent)||void 0===a||a.call(r,{type:lp,data:{message:"stream ended"}})),e.removeEventListener("ended",n,!1)}}),!1)}))},t}(),jC=Yf("manager:device"),XC=function(){function t(t){this.getCommonData=null;var e=t.getCommonData;this.getCommonData=e}return t.prototype.getDevicesList=function(t){return Ed(this,void 0,void 0,(function(){var e,r,n,i;return Sd(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,navigator.mediaDevices.enumerateDevices()];case 1:var s;return e=o.sent(),r=[],n=[],Ph(e).call(e,(function(t){var e=t.kind,i=t.deviceId,o=t.label;"videoinput"===e?r.push({type:"video",deviceId:i,deviceName:o}):"audioinput"===e&&"default"!==i&&n.push({type:"audio",deviceId:i,deviceName:o})})),t?"video"===t?[2,r]:"audio"===t?[2,n]:[2,[]]:[2,mh(s=[]).call(s,r,n)];case 2:throw i=o.sent(),jC("enumerateDevices error: ",i),i;case 3:return[2]}}))}))},t.prototype.getCurrentDevice=function(t,e){return Ed(this,void 0,void 0,(function(){var r,n,i,o,s,a,u,c,h,l,d,f,p;return Sd(this,(function(v){var m;switch(v.label){case 0:if(r=this.getCommonData(),n=r.streamList,i=r.videoEffectManager,!Jl(m=["video","audio"]).call(m,t))throw jC("type is invalid"),new Error("type is invalid");if(i.enabled&&!e)throw jC("streamId is not existed"),new Error("streamId is not existed");if(o="video"===t?"camera":"microphone",!((s=El(n).call(n,(function(t){return t.type===o&&(!e||t.id===e)})))&&s.source instanceof UC))return[3,5];if(!(a="video"===t?s.source.getVideoTrack():s.source.getAudioTrack()))return[3,5];u=a.getSettings().deviceId,c={type:t,deviceId:u,deviceName:""},v.label=1;case 1:return v.trys.push([1,3,,4]),[4,navigator.mediaDevices.enumerateDevices()];case 2:return h=v.sent(),l="".concat(t,"input"),(d=El(h).call(h,(function(t){return t.kind===l&&t.deviceId===u})))&&("default"===u?(f=El(h).call(h,(function(t){return t.kind===l&&"default"!==t.deviceId&&t.groupId===d.groupId})))&&(c.deviceId=f.deviceId,c.deviceName=f.label):c.deviceName=d.label),[3,4];case 3:return p=v.sent(),jC("enumerateDevices error: ",p),[3,4];case 4:return[2,c];case 5:return[2,null]}}))}))},t.prototype.switchDevice=function(t,e,r){var n;return Ed(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,l,d,f,p,v,m,y,g,_,b,T,x,E,S,w,R,C,P,A,O=this;return Sd(this,(function(I){var M;switch(I.label){case 0:if(i=this.getCommonData(),o=i.streamList,s=i.videoEffectManager,a=i.observer,u=i.videoQuality,c=i.audioQuality,h=i.streamOutput,l=i.isStreamPushing,d=i.connection,f=i.setProcessData,!Jl(M=["video","audio"]).call(M,t))throw jC("type is invalid"),new Error("type is invalid");if(!e)throw jC("deviceId is not existed"),new Error("deviceId is not existed");if(s.enabled&&!r)throw jC("streamId is not existed"),new Error("streamId is not existed");if(p="video"===t?"camera":"microphone",!((v=El(o).call(o,(function(t){return t.type===p&&(!r||t.id===r)})))&&v.source instanceof UC))return[3,9];m=null,"video"===t?(m=new UC({type:"device",video:!0,audio:!1,onEvent:function(t){var e,r;t.type===lp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(r=a.onWarning)||void 0===r||r.call(a,Hf.TXLIVE_WARNING_CAMERA_INTERRUPTED,"interrupted",{streamId:v.id}))}}),y=u.frameRate,g=u.width,_=u.height,m.setVideoConfig({deviceId:e,frameRate:y,resolution:{width:g,height:_}})):(m=new UC({type:"device",video:!1,audio:!0,onEvent:function(t){var e,r;t.type===lp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(r=a.onWarning)||void 0===r||r.call(a,Hf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,"interrupted",{streamId:v.id}))}}),b=c.sampleRate,T=c.echoCancellation,x=c.noiseSuppression,E=c.autoGainControl,m.setAudioConfig({deviceId:e,sampleRate:b,echoCancellation:T,noiseSuppression:x,autoGainControl:E})),S=v.source,v.source=m,w=function(){return Ed(O,void 0,void 0,(function(){return Sd(this,(function(e){switch(e.label){case 0:cd((function(){S.getMediaStream()&&S.stop()}),1500),e.label=1;case 1:return e.trys.push([1,3,,5]),[4,m.start()];case 2:return e.sent(),[3,5];case 3:return e.sent(),jC("switch ".concat("video"===t?"camera":"microphone"," failed, try to switch again")),S.getMediaStream()&&S.stop(),[4,m.start()];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},I.label=1;case 1:return I.trys.push([1,7,,8]),[4,w()];case 2:return I.sent(),s.enabled||"video"!==t?[3,5]:(R=S.getVideoTrack(),C=m.getVideoTrack(),h&&(R?h.removeTrack(R):(P=h.getTracks(),Ph(P).call(P,(function(e){e.kind===t&&"ended"===e.readyState&&h.removeTrack(e)}))),h.addTrack(C)),l&&d?[4,d.replaceStreamTrack(C)]:[3,4]);case 3:I.sent(),I.label=4;case 4:return[3,6];case 5:v.track.setSource(m),f(),I.label=6;case 6:return S.getMediaStream()&&S.stop(),jC("switch ".concat("video"===t?"camera":"microphone"," successfully")),[3,8];case 7:throw A=I.sent(),null===(n=a.onWarning)||void 0===n||n.call(a,"video"===t?Hf.TXLIVE_WARNING_CAMERA_START_FAILED:Hf.TXLIVE_WARNING_MICROPHONE_START_FAILED,A.toString(),null),A;case 8:return[3,10];case 9:jC("stream is not existed"),I.label=10;case 10:return[2]}}))}))},t.prototype.switchCamera=function(t,e){return this.switchDevice("video",t,e)},t.prototype.switchMicrophone=function(t,e){return this.switchDevice("audio",t,e)},t}();Ar({target:"Array",stat:!0},{isArray:Ir});var VC,HC=rt.Array.isArray,WC={width:1280,height:720},YC={video:["video","image"],audio:["audio"],text:["text"]};!function(t){t[t.NONE=0]="NONE",t[t.LEFT_RIGHT=1]="LEFT_RIGHT",t[t.UP_DOWN=2]="UP_DOWN",t[t.ALL=3]="ALL"}(VC||(VC={}));var zC={font:"fontFamily",font_size:"fontSize",font_color:"fill",bold:"fontWeight",italic:"fontStyle",shadow_color:"dropShadowColor",shadow_alpha:"dropShadowAlpha",stroke_color:"stroke",stroke_thickness:"strokeThickness"},ZC={threshold:{value:-24,min:-100,max:0},ratio:{value:12,min:1,max:20},knee:{value:30,min:0,max:40},attack:{value:3,min:0,max:1e3},release:{value:250,min:0,max:1e3}},JC=Yf("process:helper"),KC=function(){function t(t,e){this.data={},this.data.id=Df(),this.data.type=t,this.data.order=0;var r={};r.id=Df(8),r.type=t,e&&(r.source=e,e instanceof HTMLImageElement&&(r.type="image")),this.data.items=[r]}return t.prototype.setSource=function(t){var e=this.data,r=e.type,n=e.items[0];"video"===r||"audio"===r?t?"video"!==r||t instanceof UC||t instanceof MediaStream||t instanceof HTMLVideoElement||t instanceof HTMLImageElement?"audio"!==r||t instanceof UC||t instanceof MediaStream||t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?(n.source=t,t instanceof HTMLImageElement&&(n.type="image"),this.data.items[0]=xd({},n)):JC("audio source is invalid"):JC("video source is invalid"):JC("source must be existed"):JC("type(".concat(r,") is invalid"))},t.prototype.setOrder=function(t){"number"==typeof t?this.data.order=t:JC("order must be a number")},t.prototype.setLayout=function(t){var e;if("video"===this.data.type){var r=t.width,n=t.height,i=t.x,o=t.y,s=PE(e=[r,n,i,o]).call(e,(function(t){return"number"==typeof t}));if(s)if(r<0||n<0)JC("width or height must be a number greater than or equal to 0");else{var a=this.data.items[0];this.data.items[0]=xd(xd({},a),{width:r,height:n,position:{x:i,y:o}})}else JC("layout params must be number")}else JC("type is ".concat(this.data.type,", setLayout is not working"))},t.prototype.setPosition=function(t,e){var r;if("video"===this.data.type||"text"===this.data.type){var n=PE(r=[t,e]).call(r,(function(t){return"number"==typeof t}));if(n){var i=this.data.items[0];this.data.items[0]=xd(xd({},i),{position:{x:t,y:e}})}else JC("position params must be number")}else JC("type is ".concat(this.data.type,", setPosition is not working"))},t.prototype.setSize=function(t,e){var r;if("video"===this.data.type){var n=PE(r=[t,e]).call(r,(function(t){return"number"==typeof t}));if(n)if(t<0||e<0)JC("width or height must be a number greater than or equal to 0");else{var i=this.data.items[0];this.data.items[0]=xd(xd({},i),{width:t,height:e})}else JC("size params must be number")}else JC("type is ".concat(this.data.type,", setSize is not working"))},t.prototype.setMirror=function(t){if("video"===this.data.type)if("number"!=typeof t||t<VC.NONE||t>VC.ALL)JC("mirror type must be a number between 0 and 3");else{var e=this.data.items[0],r=e.operations;if(void 0!==r||t!==VC.NONE){var n=Vh(r=r||[]).call(r,(function(t){return"image_mirror"===t.type})),i=function(t){-1!==n?r[n]=t:r.push(t)};switch(t){case VC.NONE:-1!==n&&pl(r).call(r,n,1);break;case VC.LEFT_RIGHT:i({type:"image_mirror",params:{left_right:1}});break;case VC.UP_DOWN:i({type:"image_mirror",params:{up_down:1}});break;case VC.ALL:i({type:"image_mirror",params:{left_right:1,up_down:1}})}this.data.items[0]=xd(xd({},e),{operations:r})}}else JC("type is ".concat(this.data.type,", setMirror is not working"))},t.prototype.setVolume=function(t){if("video"===this.data.type||"audio"===this.data.type){var e=this.data.items[0];if("image"!==e.type)if("number"==typeof t){var r=e.operations,n=void 0===r?[]:r,i=Vh(n).call(n,(function(t){return"audio_volumes"===t.type})),o={type:"audio_volumes",params:{all:t}};-1!==i?n[i]=o:n.push(o),this.data.items[0]=xd(xd({},e),{operations:n})}else JC("volume must be a number");else JC("type is image, setVolume is not working")}else JC("type is ".concat(this.data.type,", setVolume is not working"))},t.prototype.setCompressor=function(t){var e;if("video"===this.data.type||"audio"===this.data.type){var r=this.data.items[0];if("image"!==r.type){var n=r.operations,i=void 0===n?[]:n,o=Vh(i).call(i,(function(t){return"audio_compressor"===t.type}));if(t){if(PE(e=Rl(t)).call(e,(function(e){var r=ZC[e];if(!r)return JC("param ".concat(e," is invalid")),!1;var n,i,o=t[e];return!("number"!=typeof o||o<r.min||o>r.max)||(JC(mh(n=mh(i="param ".concat(e," must be a number between ")).call(i,r.min," and ")).call(n,r.max)),!1)}))){var s={type:"audio_compressor",params:xd({},t)};-1!==o?i[o]=s:i.push(s),this.data.items[0]=xd(xd({},r),{operations:i})}}else-1!==o&&(pl(i).call(i,o,1),this.data.items[0]=xd(xd({},r),{operations:i}))}else JC("type is image, setCompressor is not working")}else JC("type is ".concat(this.data.type,", setCompressor is not working"))},t.prototype.setNormalFilter=function(t){var e;if("video"===this.data.type){var r=this.data.items[0],n=r.operations,i=void 0===n?[]:n,o=Vh(i).call(i,(function(t){return"image_filter_normal"===t.type}));if(t){if(PE(e=Rl(t)).call(e,(function(e){var r=t[e];return!("number"!=typeof r||r<-100||r>100)||(JC("param ".concat(e," must be a number between -100 and 100")),!1)}))){var s={type:"image_filter_normal",params:xd({},t)};-1!==o?i[o]=s:i.push(s),this.data.items[0]=xd(xd({},r),{operations:i})}}else-1!==o&&(pl(i).call(i,o,1),this.data.items[0]=xd(xd({},r),{operations:i}))}else JC("type is ".concat(this.data.type,", setNormalFilter is not working"))},t.prototype.setText=function(t,e){if("text"===this.data.type)if(t)if("object"!==Wc(e)||HC(e)||null===e)JC("style is invalid");else{var r=this.data.items[0];this.data.items[0]=xd(xd({},r),{content:{text:t,text_style:e}})}else JC("text content is not existed");else JC("type is ".concat(this.data.type,", setText is not working"))},t}(),qC=function(t,e){var r;if(Jl(r=Rl(YC)).call(r,t)){if("video"===t||"audio"===t){if(!e)return void JC("source must be existed");if(!("video"!==t||e instanceof UC||e instanceof MediaStream||e instanceof HTMLVideoElement||e instanceof HTMLImageElement))return void JC("video source is invalid");if(!("audio"!==t||e instanceof UC||e instanceof MediaStream||e instanceof HTMLVideoElement||e instanceof HTMLAudioElement))return void JC("audio source is invalid")}return new KC(t,e)}JC("type(".concat(t,") is invalid"))},QC=Yf("manager:video"),$C=function(){function t(t){this.enabled=!1,this.getCommonData=null,this.config={videoWidth:null,videoHeight:null,videoFramerate:null,backgroundColor:null};var e=t.getCommonData;this.getCommonData=e}return t.prototype.enableMixing=function(t){var e=this.getCommonData(),r=e.streamList,n=e.streamOutput;r.length>0||n?QC("stream is existed, please stop streaming first"):this.enabled=!!t},t.prototype.setMixingConfig=function(t){if(t){var e=t.videoWidth,r=t.videoHeight,n=t.videoFramerate,i=t.backgroundColor;void 0!==e&&("number"==typeof e&&e>0?this.config.videoWidth=e:QC("videoWidth must be a number greater than 0")),void 0!==r&&("number"==typeof r&&r>0?this.config.videoHeight=r:QC("videoHeight must be a number greater than 0")),void 0!==n&&("number"==typeof n&&n>0?this.config.videoFramerate=n:QC("videoFramerate must be a number greater than 0")),void 0!==i&&("number"==typeof i&&i>=0&&i<=16777215?this.config.backgroundColor=i:QC("backgroundColor must be a valid color number"));var o=this.getCommonData().effectProcess;if(o){var s=this.getMixingConfig(),a=s.videoWidth,u=s.videoHeight,c=s.videoFramerate,h=s.backgroundColor;o.setResolution({width:a,height:u}),o.setFrameRate(c),o.setBackgroundColor(h)}}},t.prototype.getMixingConfig=function(){var t=this.getCommonData().videoQuality,e=t.frameRate,r=t.width,n=t.height,i=this.config,o=i.videoWidth,s=i.videoHeight,a=i.videoFramerate,u=i.backgroundColor;return{videoWidth:null!=o?o:r,videoHeight:null!=s?s:n,videoFramerate:null!=a?a:e,backgroundColor:null!=u?u:0}},t.prototype.setLayout=function(t){var e,r;if(t){var n=this.getCommonData(),i=n.streamList,o=n.setProcessData,s=HC(t)?t:[t],a=function(t){var e=t.streamId,r=t.x,n=t.y,o=t.width,s=t.height,a=t.zOrder,u=El(i).call(i,(function(t){var r,n=t.source,i=n instanceof UC?n.getMediaStream():n;return(null===(r=null==i?void 0:i.getVideoTracks())||void 0===r?void 0:r.length)&&t.id===e}));u?(u.track.setOrder(a),u.track.setSize(o,s),u.track.setPosition(r,n)):QC("stream ".concat(e," is not existed"))};try{for(var u=wd(s),c=u.next();!c.done;c=u.next()){a(c.value)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}o()}},t.prototype.getLayout=function(t){var e,r;if(!t)return QC("streamId is not existed"),null;var n=this.getCommonData().streamList,i=El(n).call(n,(function(e){return e.id===t}));if(!i)return QC("stream ".concat(t," is not existed")),null;var o=i.track.data,s=o.items[0];return{streamId:t,zOrder:o.order,x:null===(e=s.position)||void 0===e?void 0:e.x,y:null===(r=s.position)||void 0===r?void 0:r.y,width:s.width,height:s.height}},t.prototype.setMirror=function(t){var e,r;if(t){var n=this.getCommonData(),i=n.streamList,o=n.setProcessData,s=HC(t)?t:[t],a=function(t){var e=t.streamId,r=t.mirrorType,n=El(i).call(i,(function(t){var r,n=t.source,i=n instanceof UC?n.getMediaStream():n;return(null===(r=null==i?void 0:i.getVideoTracks())||void 0===r?void 0:r.length)&&t.id===e}));n?n.track.setMirror(r):QC("stream ".concat(e," is not existed"))};try{for(var u=wd(s),c=u.next();!c.done;c=u.next()){a(c.value)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}o()}},t.prototype.setNormalFilter=function(t){var e,r;if(t){var n=this.getCommonData(),i=n.streamList,o=n.setProcessData,s=HC(t)?t:[t],a=function(t){var e=t.streamId,r=t.contrast,n=void 0===r?0:r,o=t.brightness,s=void 0===o?0:o,a=t.saturation,u=void 0===a?0:a,c=El(i).call(i,(function(t){var r,n=t.source,i=n instanceof UC?n.getMediaStream():n;return(null===(r=null==i?void 0:i.getVideoTracks())||void 0===r?void 0:r.length)&&t.id===e}));c?c.track.setNormalFilter(0===n&&0===s&&0===u?null:{contrast:n,brightness:s,saturation:u}):QC("stream ".concat(e," is not existed"))};try{for(var u=wd(s),c=u.next();!c.done;c=u.next()){a(c.value)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}o()}},t.prototype.setWatermark=function(t){var e,r,n,i,o=this.getCommonData(),s=o.effectTrackList,a=o.setProcessData,u=Lh(s).call(s,(function(t){return"video"===t.data.type})),c=function(t){var e=Vh(s).call(s,(function(e){return e===t}));pl(s).call(s,e,1)};try{for(var h=wd(u),l=h.next();!l.done;l=h.next()){c(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}if(t){var d=HC(t)?t:[t];try{for(var f=wd(d),p=f.next();!p.done;p=f.next()){var v=p.value,m=v.image,y=v.x,g=v.y,_=v.width,b=v.height,T=v.zOrder;if(m&&m instanceof HTMLImageElement){var x=qC("video",m);x.setOrder(T),x.setSize(_,b),x.setPosition(y,g),s.push(x)}else QC("image is invalid")}}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}a()}else a()},t.prototype.setText=function(t){var e,r,n,i,o=this.getCommonData(),s=o.effectTrackList,a=o.setProcessData,u=Lh(s).call(s,(function(t){return"text"===t.data.type})),c=function(t){var e=Vh(s).call(s,(function(e){return e===t}));pl(s).call(s,e,1)};try{for(var h=wd(u),l=h.next();!l.done;l=h.next()){c(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}if(t){var d=HC(t)?t:[t];try{for(var f=wd(d),p=f.next();!p.done;p=f.next()){var v=p.value,m=v.text,y=v.style,g=v.x,_=v.y,b=v.zOrder;if(m&&"string"==typeof m){var T=qC("text");T.setText(m,y),T.setOrder(b),T.setPosition(g,_),s.push(T)}else QC("text is invalid")}}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}a()}else a()},t}(),tP=Yf("manager:audio"),eP=function(){function t(t){this.getCommonData=null;var e=t.getCommonData;this.getCommonData=e}return t.prototype.setVolume=function(t,e){var r=this.getCommonData(),n=r.videoEffectManager,i=r.streamList,o=r.setProcessData;if("number"==typeof t)if(!n.enabled||e){var s=El(i).call(i,(function(t){var r,n=t.source,i=n instanceof UC?n.getMediaStream():n;return(null===(r=null==i?void 0:i.getAudioTracks())||void 0===r?void 0:r.length)&&(!e||t.id===e)}));s?(s.track.setVolume(t),o()):tP("stream is not existed")}else tP("streamId is not existed");else tP("volume must be a number")},t}(),rP=rt.setInterval,nP={exports:{}};!function(t,e){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=90)}({17:function(t,e,r){e.__esModule=!0,e.default=void 0;var n=r(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var r=e.match(t);return r&&r.length>0&&r[1]||""},t.getSecondMatch=function(t,e){var r=e.match(t);return r&&r.length>1&&r[2]||""},t.matchAndReturnConst=function(t,e,r){if(t.test(e))return r},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,r,n){void 0===n&&(n=!1);var i=t.getVersionPrecision(e),o=t.getVersionPrecision(r),s=Math.max(i,o),a=0,u=t.map([e,r],(function(e){var r=s-t.getVersionPrecision(e),n=e+new Array(r+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(u[0][s]>u[1][s])return 1;if(u[0][s]===u[1][s]){if(s===a)return 0;s-=1}else if(u[0][s]<u[1][s])return-1}},t.map=function(t,e){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(t,e);for(r=0;r<t.length;r+=1)n.push(e(t[r]));return n},t.find=function(t,e){var r,n;if(Array.prototype.find)return Array.prototype.find.call(t,e);for(r=0,n=t.length;r<n;r+=1){var i=t[r];if(e(i,r))return i}},t.assign=function(t){for(var e,r,n=t,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[t].concat(o));var a=function(){var t=o[e];"object"==typeof t&&null!==t&&Object.keys(t).forEach((function(e){n[e]=t[e]}))};for(e=0,r=o.length;e<r;e+=1)a();return t},t.getBrowserAlias=function(t){return n.BROWSER_ALIASES_MAP[t]},t.getBrowserTypeByAlias=function(t){return n.BROWSER_MAP[t]||""},t}();e.default=i,t.exports=e.default},18:function(t,e,r){e.__esModule=!0,e.ENGINE_MAP=e.OS_MAP=e.PLATFORMS_MAP=e.BROWSER_MAP=e.BROWSER_ALIASES_MAP=void 0,e.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},e.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},e.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},e.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},e.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(t,e,r){e.__esModule=!0,e.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=function(){function t(){}var e,r,n;return t.getParser=function(t,e){if(void 0===e&&(e=!1),"string"!=typeof t)throw new Error("UserAgent should be a string");return new i.default(t,e)},t.parse=function(t){return new i.default(t).getResult()},e=t,n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(r=null)&&s(e.prototype,r),n&&s(e,n),t}();e.default=a,t.exports=e.default},91:function(t,e,r){e.__esModule=!0,e.default=void 0;var n=u(r(92)),i=u(r(93)),o=u(r(94)),s=u(r(95)),a=u(r(17));function u(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(t,e){if(void 0===e&&(e=!1),null==t||""===t)throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},!0!==e&&this.parse()}var e=t.prototype;return e.getUA=function(){return this._ua},e.test=function(t){return t.test(this._ua)},e.parseBrowser=function(){var t=this;this.parsedResult.browser={};var e=a.default.find(n.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser},e.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},e.getBrowserName=function(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},e.getBrowserVersion=function(){return this.getBrowser().version},e.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},e.parseOS=function(){var t=this;this.parsedResult.os={};var e=a.default.find(i.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os},e.getOSName=function(t){var e=this.getOS().name;return t?String(e).toLowerCase()||"":e||""},e.getOSVersion=function(){return this.getOS().version},e.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},e.getPlatformType=function(t){void 0===t&&(t=!1);var e=this.getPlatform().type;return t?String(e).toLowerCase()||"":e||""},e.parsePlatform=function(){var t=this;this.parsedResult.platform={};var e=a.default.find(o.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform},e.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},e.getEngineName=function(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},e.parseEngine=function(){var t=this;this.parsedResult.engine={};var e=a.default.find(s.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine},e.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},e.getResult=function(){return a.default.assign({},this.parsedResult)},e.satisfies=function(t){var e=this,r={},n=0,i={},o=0;if(Object.keys(t).forEach((function(e){var s=t[e];"string"==typeof s?(i[e]=s,o+=1):"object"==typeof s&&(r[e]=s,n+=1)})),n>0){var s=Object.keys(r),u=a.default.find(s,(function(t){return e.isOS(t)}));if(u){var c=this.satisfies(r[u]);if(void 0!==c)return c}var h=a.default.find(s,(function(t){return e.isPlatform(t)}));if(h){var l=this.satisfies(r[h]);if(void 0!==l)return l}}if(o>0){var d=Object.keys(i),f=a.default.find(d,(function(t){return e.isBrowser(t,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var r=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return e&&i&&(n=i.toLowerCase()),n===r},e.compareVersion=function(t){var e=[0],r=t,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(r=t.substr(1),"="===t[1]?(n=!0,r=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?r=t.substr(1):"~"===t[0]&&(n=!0,r=t.substr(1)),e.indexOf(a.default.compareVersions(i,r,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=c,t.exports=e.default},92:function(t,e,r){e.__esModule=!0,e.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return r&&(e.version=r),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},r=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:function(t){var e=!t.test(/like android/i),r=t.test(/android/i);return e&&r},describe:function(t){var e={name:"Android Browser"},r=i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},r=i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},r=i.default.getFirstMatch(o,t);return r&&(e.version=r),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=s,t.exports=e.default},93:function(t,e,r){e.__esModule=!0,e.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:o.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),r=i.default.getWindowsVersionName(e);return{name:o.OS_MAP.Windows,version:e,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return r&&(e.version=r),e}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(e),n={name:o.OS_MAP.MacOS,version:e};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),r=t.test(/android/i);return e&&r},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),r=i.default.getAndroidVersionName(e),n={name:o.OS_MAP.Android,version:e};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),r={name:o.OS_MAP.WebOS};return e&&e.length&&(r.version=e),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:o.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.PlayStation4,version:e}}}];e.default=s,t.exports=e.default},94:function(t,e,r){e.__esModule=!0,e.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(r.model=e),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),r=t.test(/like (ipod|iphone)/i);return e&&!r},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];e.default=s,t.exports=e.default},95:function(t,e,r){e.__esModule=!0,e.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:o.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:o.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:function(t){var e=t.test(/gecko/i),r=t.test(/like gecko/i);return e&&!r},describe:function(t){var e={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}}];e.default=s,t.exports=e.default}})}(nP);var iP=r(nP.exports),oP=function(){function t(){this.baseUrl="",this.setSignalingServer("webrtcpush.myqcloud.com")}return t.prototype.setSignalingServer=function(t){this.baseUrl="https://".concat(t)},t.prototype.fetchPushStream=function(t){return Ed(this,void 0,void 0,(function(){var e,r,n,i,o;return Sd(this,(function(s){switch(s.label){case 0:e="".concat(this.baseUrl,"/webrtc/v1/pushstream"),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,aE(e,t)];case 2:var a;if(r=s.sent(),n=r.errcode,i=r.errmsg,o=r.remotesdp,0!==n)throw new Error(mh(a="push stream failed, errCode:".concat(n,", errMsg:")).call(a,i));return[2,{remoteSdp:o,sessionId:t.sessionid}];case 3:throw s.sent();case 4:return[2]}}))}))},t.prototype.fetchStopStream=function(t){return Ed(this,void 0,void 0,(function(){var e,r,n,i;return Sd(this,(function(o){switch(o.label){case 0:e="".concat(this.baseUrl,"/webrtc/v1/stopstream"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,aE(e,t)];case 2:var s;if(r=o.sent(),n=r.errcode,i=r.errmsg,0!==n)throw new Error(mh(s="stop stream failed, errCode:".concat(n,", errmsg:")).call(s,i));return[2,r];case 3:throw o.sent();case 4:return[2]}}))}))},t}(),sP=function(t,e,r){var n,i,o,s="AS";"firefox"===Mf.browserDetails.browser&&(e*=1e3,s="TIAS");var a=new RegExp(mh(n="m=".concat(t," (.*)\r\nc=IN (.*)\r\nb=")).call(n,s,":(.*)\r\n")),u=new RegExp("m=".concat(t," (.*)\r\nc=IN (.*)\r\n")),c=mh(i=mh(o="m=".concat(t," $1\r\nc=IN $2\r\nb=")).call(o,s,":")).call(i,e,"\r\n");return r=a.test(r)?r.replace(a,c):r.replace(u,c)},aP=function(t){var e=t.split("\r\n"),r=[];return Ph(e).call(e,(function(t){var e=t;Jl(t).call(t,"a=fmtp:111")&&(e="".concat(t,";stereo=1"));var n,i=/a=rtpmap:(\d+) (opus|vp8|vp9|h264|h265|av1)/i.exec(t);i&&(e=mh(n="".concat(t,"\r\na=rtcp-fb:")).call(n,i[1]," rrtr"));r.push(e)})),r.join("\r\n")},uP=Yf("connection"),cP=function(){function t(t){var e,r,n;void 0===t&&(t={}),this.status=$f,this.url=null,this.stream=null,this.bitrate={video:null,audio:null},this.signaling=null,this.signalingConfig={},this.listener={onEvent:null,onStatusUpdate:null,onStatisticsUpdate:null},this.promise=null,this.peerConnection=null,this.negotiating=!1,this.intervalId=null,this.lastStatsReport=null,this.sessionId=null;var i=t.url,o=t.streamSource,s=t.videoBitrate,a=t.audioBitrate,u=t.signalingConfig,c=t.onEvent,h=t.onStatusUpdate,l=t.onStatisticsUpdate;i&&this.setUrl(i),o&&this.setStreamSource(o),s&&this.setVideoBitrate(s),a&&this.setAudioBitrate(a),u&&this.setSignalingConfig(u),this.signaling=new oP,c&&"function"==typeof c&&(this.listener.onEvent=c),h&&"function"==typeof h&&(this.listener.onStatusUpdate=h),l&&"function"==typeof l&&(this.listener.onStatisticsUpdate=l),this.onIceConnectionStateChange=lh(e=this.onIceConnectionStateChange).call(e,this),this.onConnectionStateChange=lh(r=this.onConnectionStateChange).call(r,this),this.onNegotiationNeeded=lh(n=this.onNegotiationNeeded).call(n,this)}return t.prototype.setUrl=function(t){if(t){var e=function(t){var e=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_]+)(?:\/)([^?#]*)(?:\?*)(?:[^?#]*)/.exec(t);return e?e[1]:null}(t);null!==e?this.url=t:uP("url is invalid")}else uP("url is not existed")},t.prototype.setStreamSource=function(t){t?t instanceof MediaStream||t instanceof UC?this.stream=t instanceof MediaStream?t:t.getMediaStream():uP("streamSource is invalid"):uP("streamSource is not existed")},t.prototype.setVideoBitrate=function(t){"number"==typeof t&&t>0?this.setBitrate("video",t):uP("videoBitrate must be a number greater than 0")},t.prototype.setAudioBitrate=function(t){"number"==typeof t&&t>0?this.setBitrate("audio",t):uP("audioBitrate must be a number greater than 0")},t.prototype.setSignalingConfig=function(t){if(t){var e=t.domainName,r=t.extraParams;e&&"string"==typeof e&&(this.signalingConfig.domainName=e,this.signaling.setSignalingServer(e)),r&&"object"===Wc(r)&&(this.signalingConfig.extraParams=r)}else uP("signalingConfig is not existed")},t.prototype.start=function(){var t=this,e=this,r=e.status,n=e.url,i=e.stream;return new zx((function(e,o){t.promise={resolve:e,reject:o};var s=function(t){var e=new Error(t);return e.name="CheckError",e};return n?i?r!==$f?(uP("stream is pushing"),void o(s("stream is pushing"))):void t.startConnect():(uP("stream is invalid"),void o(s("stream is invalid"))):(uP("url is invalid"),void o(s("url is invalid")))}))},t.prototype.stop=function(){this.url&&this.sessionId&&(this.signaling.fetchStopStream({streamurl:this.url,sessionid:this.sessionId}).catch((function(t){uP("request stop error, ".concat(t.toString()))})),this.sessionId=null),this.stopConnect()},t.prototype.replaceStreamTrack=function(t){return Ed(this,void 0,void 0,(function(){var e,r;return Sd(this,(function(n){var i;switch(n.label){case 0:if(this.status!==ep)throw uP("no stream is pushing"),new Error("no stream is pushing");if(!(t instanceof MediaStreamTrack))throw uP("newTrack must be MediaStreamTrack"),new Error("newTrack must be MediaStreamTrack");n.label=1;case 1:return n.trys.push([1,4,,5]),(e=El(i=this.peerConnection.getSenders()).call(i,(function(e){return e.track&&e.track.kind===t.kind})))?[4,e.replaceTrack(t)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:throw r=n.sent(),uP("sender replaceTrack failed"),r;case 5:return[2]}}))}))},t.prototype.getLocalDescription=function(){var t;return null===(t=this.peerConnection)||void 0===t?void 0:t.localDescription},t.prototype.getRemoteDescription=function(){var t;return null===(t=this.peerConnection)||void 0===t?void 0:t.remoteDescription},t.prototype.startConnect=function(){var t,e,r,n=this;try{this.peerConnection=new RTCPeerConnection({iceServers:[],bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"})}catch(t){return uP("create connection error, ".concat(t.toString())),void this.promise.reject(t)}this.status=tp,null===(r=(e=this.listener).onStatusUpdate)||void 0===r||r.call(e,{type:tp,data:{message:"connecting"}}),this.negotiating=!1,this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.addEventListener("negotiationneeded",this.onNegotiationNeeded),Ph(t=this.stream.getTracks()).call(t,(function(t){n.peerConnection.addTrack(t,n.stream)}))},t.prototype.stopConnect=function(t){var e,r;void 0===t&&(t="manual stop"),this.status!==$f&&(this.destroyConnect(),null===(r=(e=this.listener).onStatusUpdate)||void 0===r||r.call(e,{type:$f,data:{message:t}}))},t.prototype.destroyConnect=function(){this.status=$f,this.negotiating=!1,this.lastStatsReport=null,this.promise=null,this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.peerConnection&&(this.peerConnection.removeEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.removeEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.removeEventListener("negotiationneeded",this.onNegotiationNeeded),this.peerConnection.close(),this.peerConnection=null)},t.prototype.onIceConnectionStateChange=function(){switch(uP("onIceConnectionStateChange: ".concat(this.peerConnection.iceConnectionState)),this.peerConnection.iceConnectionState){case"failed":case"disconnected":uP("iceConnection disconnected, please try again"),this.promise.reject(new Error("connection disconnected")),this.stopConnect("connection disconnected")}},t.prototype.onConnectionStateChange=function(){var t,e;switch(uP("onConnectionStateChange: ".concat(this.peerConnection.connectionState)),this.peerConnection.connectionState){case"failed":case"disconnected":uP("connection disconnected, please try again"),this.promise.reject(new Error("connection disconnected")),this.stopConnect("connection disconnected");break;case"connected":uP("connection connected"),this.status=ep,null===(e=(t=this.listener).onStatusUpdate)||void 0===e||e.call(t,{type:ep,data:{message:"connected"}});var r=this.bitrate,n=r.video,i=r.audio;n&&this.setBitrate("video",n),i&&this.setBitrate("audio",i),this.startStatReport(),this.promise.resolve()}},t.prototype.onNegotiationNeeded=function(){uP("onNegotiationNeeded"),this.createOffer()},t.prototype.createOffer=function(){return Ed(this,void 0,void 0,(function(){var t,e;return Sd(this,(function(r){switch(r.label){case 0:if(this.negotiating||"stable"!==this.peerConnection.signalingState)return[2];this.negotiating=!0,r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.peerConnection.createOffer()];case 2:return(t=r.sent()).sdp=aP(t.sdp),[4,this.peerConnection.setLocalDescription(t)];case 3:return r.sent(),this.sendOffer(t),[3,6];case 4:return e=r.sent(),uP("setLocalDescription error, ".concat(e.toString())),this.promise.reject(e),this.destroyConnect(),[3,6];case 5:return this.negotiating=!1,[7];case 6:return[2]}}))}))},t.prototype.sendOffer=function(t){var e,r,n,i,o;return Ed(this,void 0,void 0,(function(){var s,a,u,c,h,l,d,f,p;return Sd(this,(function(v){var m,y,g;switch(v.label){case 0:null===(r=(e=this.listener).onEvent)||void 0===r||r.call(e,{type:rp,data:{message:"request push start"}}),v.label=1;case 1:return v.trys.push([1,3,,4]),s=iP.parse(window.navigator.userAgent),a=s.browser,u=s.os,c=mh(m=mh(y=mh(g="".concat(u.name||"other"," ")).call(g,u.version,";")).call(y,a.name||"other"," ")).call(m,a.version),h=null!==(n=this.signalingConfig.extraParams)&&void 0!==n?n:{},[4,this.signaling.fetchPushStream(xd({streamurl:this.url,sessionid:Df(),clientinfo:c,clienttype:"TXLivePusher-".concat(zf),localsdp:t},h))];case 2:return l=v.sent(),d=l.remoteSdp,f=l.sessionId,null===(o=(i=this.listener).onEvent)||void 0===o||o.call(i,{type:np,data:{message:"request push success"}}),this.sessionId=f,this.handleAnswer(d),[3,4];case 3:return p=v.sent(),uP("request push error, ".concat(p.toString())),p.name="RequestError",this.promise.reject(p),this.stopConnect("connection disconnected"),[3,4];case 4:return[2]}}))}))},t.prototype.handleAnswer=function(t){return Ed(this,void 0,void 0,(function(){var e;return Sd(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.peerConnection.setRemoteDescription(new RTCSessionDescription(t))];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),uP("setRemoteDescription error, ".concat(e.toString())),this.promise.reject(e),this.destroyConnect(),[3,3];case 3:return[2]}}))}))},t.prototype.setBitrate=function(t,e){return Ed(this,void 0,void 0,(function(){var r,n,i,o,s,a,u,c,h,l;return Sd(this,(function(d){var f,p;switch(d.label){case 0:if(this.bitrate[t]=e,this.status!==ep)return[2];if(r=Mf.browserDetails,n=r.browser,i=r.version,!(("chrome"===n||"safari"===n||"firefox"===n&&i>=64)&&"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype))return[3,5];if(!(o=El(f=this.peerConnection.getSenders()).call(f,(function(e){return e.track&&e.track.kind===t}))))return[3,4];(s=o.getParameters()).encodings&&0!==s.encodings.length||(s.encodings=[{}]),s.encodings[0].maxBitrate=1e3*e,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,o.setParameters(s)];case 2:return d.sent(),uP(mh(p="".concat(t," bandwidth is set to ")).call(p,e," kbps")),[3,4];case 3:return d.sent(),uP("failed to set bandwidth by setting maxBitrate"),[3,4];case 4:return[2];case 5:return d.trys.push([5,9,,10]),[4,this.peerConnection.createOffer()];case 6:return(a=d.sent()).sdp=aP(a.sdp),[4,this.peerConnection.setLocalDescription(a)];case 7:return d.sent(),u=this.peerConnection.remoteDescription,c=u.type,h=u.sdp,l={type:c,sdp:sP(t,e,h)},uP("applying bandwidth restriction to setRemoteDescription"),[4,this.peerConnection.setRemoteDescription(l)];case 8:return d.sent(),[3,10];case 9:return d.sent(),uP("failed to setRemoteDescription with bandwidth restriction"),[3,10];case 10:return[2]}}))}))},t.prototype.startStatReport=function(){var t=this;this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.intervalId=rP((function(){return Ed(t,void 0,void 0,(function(){var t,e,r,n;return Sd(this,(function(i){switch(i.label){case 0:return this.peerConnection?[4,this.peerConnection.getStats(null)]:[2];case 1:return t=i.sent(),e=function(t,e){var r,n,i,o;if(void 0===e&&(e=null),e){var s=null,a=null,u=null;Ph(t).call(t,(function(t){"track"===t.type&&("video"===t.kind||t.frameWidth)&&(s=t.id),"outbound-rtp"===t.type&&("video"===t.kind||"video"===t.mediaType?a=t.id:"audio"!==t.kind&&"audio"!==t.mediaType||(u=t.id))}));var c=t.get(s),h=t.get(a),l=e.get(s),d=e.get(a),f=void 0;void 0!==(null==h?void 0:h.timestamp)&&void 0!==(null==d?void 0:d.timestamp)&&(f=(h.timestamp-d.timestamp)/1e3);var p=void 0;void 0!==(null==h?void 0:h.framesPerSecond)?p=h.framesPerSecond:void 0!==(null==h?void 0:h.framerateMean)?p=h.framerateMean:void 0!==(null==h?void 0:h.framesSent)&&void 0!==(null==d?void 0:d.framesSent)&&f?p=(h.framesSent-d.framesSent)/f:void 0!==(null==c?void 0:c.framesSent)&&void 0!==(null==l?void 0:l.framesSent)&&f&&(p=(c.framesSent-l.framesSent)/f);var v=void 0;void 0!==(null==h?void 0:h.bytesSent)&&void 0!==(null==d?void 0:d.bytesSent)&&f&&(v=8*(h.bytesSent-d.bytesSent)/f);var m=void 0;void 0!==(null==h?void 0:h.totalEncodeTime)&&void 0!==(null==h?void 0:h.framesEncoded)&&void 0!==(null==d?void 0:d.totalEncodeTime)&&void 0!==(null==d?void 0:d.framesEncoded)&&(m=h.framesEncoded-d.framesEncoded?(h.totalEncodeTime-d.totalEncodeTime)/(h.framesEncoded-d.framesEncoded)*1e3:h.totalEncodeTime/h.framesEncoded*1e3);var y=void 0;void 0!==(null==h?void 0:h.totalPacketSendDelay)&&void 0!==(null==h?void 0:h.packetsSent)&&void 0!==(null==d?void 0:d.totalPacketSendDelay)&&void 0!==(null==d?void 0:d.packetsSent)&&(y=h.packetsSent-d.packetsSent?(h.totalPacketSendDelay-d.totalPacketSendDelay)/(h.packetsSent-d.packetsSent)*1e3:h.totalPacketSendDelay/h.packetsSent*1e3);var g=t.get(u),_=e.get(u);void 0!==(null==g?void 0:g.timestamp)&&void 0!==(null==_?void 0:_.timestamp)&&(f=(g.timestamp-_.timestamp)/1e3);var b=void 0;return void 0!==(null==g?void 0:g.bytesSent)&&void 0!==(null==_?void 0:_.bytesSent)&&f&&(b=8*(g.bytesSent-_.bytesSent)/f),{timestamp:null!==(r=null==h?void 0:h.timestamp)&&void 0!==r?r:null==g?void 0:g.timestamp,video:{bitrate:v&&Number(v.toFixed(2)),framesPerSecond:p&&jy(p.toString(),10),frameWidth:null!==(n=null==h?void 0:h.frameWidth)&&void 0!==n?n:null==c?void 0:c.frameWidth,frameHeight:null!==(i=null==h?void 0:h.frameHeight)&&void 0!==i?i:null==c?void 0:c.frameHeight,framesEncoded:null==h?void 0:h.framesEncoded,framesSent:null!==(o=null==h?void 0:h.framesSent)&&void 0!==o?o:null==c?void 0:c.framesSent,packetsSent:null==h?void 0:h.packetsSent,nackCount:null==h?void 0:h.nackCount,firCount:null==h?void 0:h.firCount,pliCount:null==h?void 0:h.pliCount,frameEncodeAvgTime:m&&Number(m.toFixed(2)),packetSendDelay:y&&Number(y.toFixed(2))},audio:{bitrate:b&&Number(b.toFixed(2)),packetsSent:null==g?void 0:g.packetsSent}}}}(t,this.lastStatsReport),this.lastStatsReport=t,e&&(null===(n=(r=this.listener).onStatisticsUpdate)||void 0===n||n.call(r,e)),[2]}}))}))}),1e3)},t}();function hP(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}hP.prototype=Error.prototype;var lP=setTimeout;function dP(t){return Boolean(t&&void 0!==t.length)}function fP(){}function pP(t){if(!(this instanceof pP))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],bP(t,this)}function vP(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,pP._immediateFn((function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){var n;try{n=r(t._value)}catch(t){return void yP(e.promise,t)}mP(e.promise,n)}else(1===t._state?mP:yP)(e.promise,t._value)}))):t._deferreds.push(e)}function mP(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof pP)return t._state=3,t._value=e,void gP(t);if("function"==typeof r)return void bP((n=r,i=e,function(){n.apply(i,arguments)}),t)}t._state=1,t._value=e,gP(t)}catch(e){yP(t,e)}var n,i}function yP(t,e){t._state=2,t._value=e,gP(t)}function gP(t){2===t._state&&0===t._deferreds.length&&pP._immediateFn((function(){t._handled||pP._unhandledRejectionFn(t._value)}));for(var e=0,r=t._deferreds.length;e<r;e++)vP(t,t._deferreds[e]);t._deferreds=null}function _P(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function bP(t,e){var r=!1;try{t((function(t){r||(r=!0,mP(e,t))}),(function(t){r||(r=!0,yP(e,t))}))}catch(t){if(r)return;r=!0,yP(e,t)}}pP.prototype.catch=function(t){return this.then(null,t)},pP.prototype.then=function(t,e){var r=new this.constructor(fP);return vP(this,new _P(t,e,r)),r},pP.prototype.finally=function(t){var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){return e.reject(r)}))}))},pP.all=function(t){return new pP((function(e,r){if(!dP(t))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(t);if(0===n.length)return e([]);var i=n.length;function o(t,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(e){o(t,e)}),r)}n[t]=s,0==--i&&e(n)}catch(t){r(t)}}for(var s=0;s<n.length;s++)o(s,n[s])}))},pP.any=function(t){var e=this;return new e((function(r,n){if(!t||void 0===t.length)return n(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return n();for(var o=[],s=0;s<i.length;s++)try{e.resolve(i[s]).then(r).catch((function(t){o.push(t),o.length===i.length&&n(new hP(o,"All promises were rejected"))}))}catch(t){n(t)}}))},pP.allSettled=function(t){return new this((function(e,r){if(!t||void 0===t.length)return r(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(t);if(0===n.length)return e([]);var i=n.length;function o(t,r){if(r&&("object"==typeof r||"function"==typeof r)){var s=r.then;if("function"==typeof s)return void s.call(r,(function(e){o(t,e)}),(function(r){n[t]={status:"rejected",reason:r},0==--i&&e(n)}))}n[t]={status:"fulfilled",value:r},0==--i&&e(n)}for(var s=0;s<n.length;s++)o(s,n[s])}))},pP.resolve=function(t){return t&&"object"==typeof t&&t.constructor===pP?t:new pP((function(e){e(t)}))},pP.reject=function(t){return new pP((function(e,r){r(t)}))},pP.race=function(t){return new pP((function(e,r){if(!dP(t))return r(new TypeError("Promise.race accepts an array"));for(var n=0,i=t.length;n<i;n++)pP.resolve(t[n]).then(e,r)}))},pP._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){lP(t,0)},pP._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var TP=Object.getOwnPropertySymbols,xP=Object.prototype.hasOwnProperty,EP=Object.prototype.propertyIsEnumerable;function SP(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var wP=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,i=SP(t),o=1;o<arguments.length;o++){for(var s in r=Object(arguments[o]))xP.call(r,s)&&(i[s]=r[s]);if(TP){n=TP(r);for(var a=0;a<n.length;a++)EP.call(r,n[a])&&(i[n[a]]=r[n[a]])}}return i};"undefined"==typeof globalThis&&("undefined"!=typeof self?self.globalThis=self:"undefined"!=typeof global&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=pP),Object.assign||(Object.assign=wP);if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!globalThis.performance||!globalThis.performance.now){var RP=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-RP}}for(var CP,PP,AP,OP,IP,MP,DP,LP,FP,NP,kP,BP,GP,UP,jP,XP,VP,HP,WP,YP,zP=Date.now(),ZP=["ms","moz","webkit","o"],JP=0;JP<ZP.length&&!globalThis.requestAnimationFrame;++JP){var KP=ZP[JP];globalThis.requestAnimationFrame=globalThis[KP+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[KP+"CancelAnimationFrame"]||globalThis[KP+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),r=16+zP-e;return r<0&&(r=0),zP=e,globalThis.self.setTimeout((function(){zP=Date.now(),t(performance.now())}),r)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(CP||(CP={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(PP||(PP={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(AP||(AP={})),function(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"}(OP||(OP={})),function(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"}(IP||(IP={})),function(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"}(MP||(MP={})),function(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"}(DP||(DP={})),function(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"}(LP||(LP={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(FP||(FP={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(NP||(NP={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(kP||(kP={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(BP||(BP={})),function(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.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(GP||(GP={})),function(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"}(UP||(UP={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(jP||(jP={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(XP||(XP={})),function(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"}(VP||(VP={})),function(t){t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA"}(HP||(HP={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(WP||(WP={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(YP||(YP={}));var qP={createCanvas:function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var t;return null!==(t=document.baseURI)&&void 0!==t?t:window.location.href},fetch:function(t,e){return fetch(t,e)}},QP=/iPhone/i,$P=/iPod/i,tA=/iPad/i,eA=/\biOS-universal(?:.+)Mac\b/i,rA=/\bAndroid(?:.+)Mobile\b/i,nA=/Android/i,iA=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,oA=/Silk/i,sA=/Windows Phone/i,aA=/\bWindows(?:.+)ARM\b/i,uA=/BlackBerry/i,cA=/BB10/i,hA=/Opera Mini/i,lA=/\b(CriOS|Chrome)(?:.+)Mobile/i,dA=/Mobile(?:.+)Firefox\b/i,fA=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};var pA=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,n=r.split("[FBAN");void 0!==n[1]&&(r=n[0]),void 0!==(n=r.split("Twitter"))[1]&&(r=n[0]);var i=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:i(QP)&&!i(sA),ipod:i($P),tablet:!i(QP)&&(i(tA)||fA(e))&&!i(sA),universal:i(eA),device:(i(QP)||i($P)||i(tA)||i(eA)||fA(e))&&!i(sA)},amazon:{phone:i(iA),tablet:!i(iA)&&i(oA),device:i(iA)||i(oA)},android:{phone:!i(sA)&&i(iA)||!i(sA)&&i(rA),tablet:!i(sA)&&!i(iA)&&!i(rA)&&(i(oA)||i(nA)),device:!i(sA)&&(i(iA)||i(oA)||i(rA)||i(nA))||i(/\bokhttp\b/i)},windows:{phone:i(sA),tablet:i(aA),device:i(sA)||i(aA)},other:{blackberry:i(uA),blackberry10:i(cA),opera:i(hA),firefox:i(dA),chrome:i(lA),device:i(uA)||i(cA)||i(hA)||i(dA)||i(lA)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(globalThis.navigator);var vA={ADAPTER:qP,MIPMAP_TEXTURES:BP.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:WP.NONE,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(pA.tablet||pA.phone){var r;if(pA.apple.device)if(r=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(r[1],10)<11&&(e=!1);if(pA.android.device)if(r=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(r[1],10)<7&&(e=!1)}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:jP.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:kP.CLAMP,SCALE_MODE:NP.LINEAR,PRECISION_VERTEX:XP.HIGH,PRECISION_FRAGMENT:pA.apple.device?XP.HIGH:XP.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!pA.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},mA={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var u,c,h=this._events[a],l=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),l){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,i),!0;case 5:return h.fn.call(h.context,e,n,i,o),!0;case 6:return h.fn.call(h.context,e,n,i,o,s),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];h.fn.apply(h.context,u)}else{var d,f=h.length;for(c=0;c<f;c++)switch(h[c].once&&this.removeListener(t,h[c].fn,void 0,!0),l){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,e);break;case 3:h[c].fn.call(h[c].context,e,n);break;case 4:h[c].fn.call(h[c].context,e,n,i);break;default:if(!u)for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];h[c].fn.apply(h[c].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],h=a.length;u<h;u++)(a[u].fn!==e||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a}(mA);var yA=mA.exports,gA={exports:{}};function _A(t,e,r){r=r||2;var n,i,o,s,a,u,c,h=e&&e.length,l=h?e[0]*r:t.length,d=bA(t,0,l,r,!0),f=[];if(!d||d.next===d.prev)return f;if(h&&(d=function(t,e,r,n){var i,o,s,a=[];for(i=0,o=e.length;i<o;i++)(s=bA(t,e[i]*n,i<o-1?e[i+1]*n:t.length,n,!1))===s.next&&(s.steiner=!0),a.push(IA(s));for(a.sort(CA),i=0;i<a.length;i++)r=PA(a[i],r);return r}(t,e,d,r)),t.length>80*r){n=o=t[0],i=s=t[1];for(var p=r;p<l;p+=r)(a=t[p])<n&&(n=a),(u=t[p+1])<i&&(i=u),a>o&&(o=a),u>s&&(s=u);c=0!==(c=Math.max(o-n,s-i))?32767/c:0}return xA(d,f,r,n,i,c,0),f}function bA(t,e,r,n,i){var o,s;if(i===HA(t,e,r,n)>0)for(o=e;o<r;o+=n)s=jA(o,t[o],t[o+1],s);else for(o=r-n;o>=e;o-=n)s=jA(o,t[o],t[o+1],s);return s&&FA(s,s.next)&&(XA(s),s=s.next),s}function TA(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!FA(n,n.next)&&0!==LA(n.prev,n,n.next))n=n.next;else{if(XA(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function xA(t,e,r,n,i,o,s){if(t){!s&&o&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=OA(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,s,a,u,c=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,n=r,a=0,e=0;e<c&&(a++,n=n.nextZ);e++);for(u=c;a>0||u>0&&n;)0!==a&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(s>1)}(i)}(t,n,i,o);for(var a,u,c=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?SA(t,n,i,o):EA(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),XA(t),t=u.next,c=u.next;else if((t=u)===c){s?1===s?xA(t=wA(TA(t),e,r),e,r,n,i,o,2):2===s&&RA(t,e,r,n,i,o):xA(TA(t),e,r,n,i,o,1);break}}}function EA(t){var e=t.prev,r=t,n=t.next;if(LA(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,s=n.x,a=e.y,u=r.y,c=n.y,h=i<o?i<s?i:s:o<s?o:s,l=a<u?a<c?a:c:u<c?u:c,d=i>o?i>s?i:s:o>s?o:s,f=a>u?a>c?a:c:u>c?u:c,p=n.next;p!==e;){if(p.x>=h&&p.x<=d&&p.y>=l&&p.y<=f&&MA(i,a,o,u,s,c,p.x,p.y)&&LA(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function SA(t,e,r,n){var i=t.prev,o=t,s=t.next;if(LA(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,c=s.x,h=i.y,l=o.y,d=s.y,f=a<u?a<c?a:c:u<c?u:c,p=h<l?h<d?h:d:l<d?l:d,v=a>u?a>c?a:c:u>c?u:c,m=h>l?h>d?h:d:l>d?l:d,y=OA(f,p,e,r,n),g=OA(v,m,e,r,n),_=t.prevZ,b=t.nextZ;_&&_.z>=y&&b&&b.z<=g;){if(_.x>=f&&_.x<=v&&_.y>=p&&_.y<=m&&_!==i&&_!==s&&MA(a,h,u,l,c,d,_.x,_.y)&&LA(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,b.x>=f&&b.x<=v&&b.y>=p&&b.y<=m&&b!==i&&b!==s&&MA(a,h,u,l,c,d,b.x,b.y)&&LA(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;_&&_.z>=y;){if(_.x>=f&&_.x<=v&&_.y>=p&&_.y<=m&&_!==i&&_!==s&&MA(a,h,u,l,c,d,_.x,_.y)&&LA(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=g;){if(b.x>=f&&b.x<=v&&b.y>=p&&b.y<=m&&b!==i&&b!==s&&MA(a,h,u,l,c,d,b.x,b.y)&&LA(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function wA(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!FA(i,o)&&NA(i,n,n.next,o)&&GA(i,o)&&GA(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),XA(n),XA(n.next),n=t=o),n=n.next}while(n!==t);return TA(n)}function RA(t,e,r,n,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&DA(s,a)){var u=UA(s,a);return s=TA(s,s.next),u=TA(u,u.next),xA(s,e,r,n,i,o,0),void xA(u,e,r,n,i,o,0)}a=a.next}s=s.next}while(s!==t)}function CA(t,e){return t.x-e.x}function PA(t,e){var r=function(t,e){var r,n=e,i=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>s&&(s=a,r=n.x<n.next.x?n:n.next,a===i))return r}n=n.next}while(n!==e);if(!r)return null;var u,c=r,h=r.x,l=r.y,d=1/0;n=r;do{i>=n.x&&n.x>=h&&i!==n.x&&MA(o<l?i:s,o,h,l,o<l?s:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),GA(n,t)&&(u<d||u===d&&(n.x>r.x||n.x===r.x&&AA(r,n)))&&(r=n,d=u)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var n=UA(r,t);return TA(n,n.next),TA(r,r.next)}function AA(t,e){return LA(t.prev,t,e.prev)<0&&LA(e.next,t,t.next)<0}function OA(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function IA(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 MA(t,e,r,n,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(i-s)*(n-a)}function DA(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&NA(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(GA(t,e)&&GA(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(LA(t.prev,t,e.prev)||LA(t,e.prev,e))||FA(t,e)&&LA(t.prev,t,t.next)>0&&LA(e.prev,e,e.next)>0)}function LA(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function FA(t,e){return t.x===e.x&&t.y===e.y}function NA(t,e,r,n){var i=BA(LA(t,e,r)),o=BA(LA(t,e,n)),s=BA(LA(r,n,t)),a=BA(LA(r,n,e));return i!==o&&s!==a||(!(0!==i||!kA(t,r,e))||(!(0!==o||!kA(t,n,e))||(!(0!==s||!kA(r,t,n))||!(0!==a||!kA(r,e,n)))))}function kA(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 BA(t){return t>0?1:t<0?-1:0}function GA(t,e){return LA(t.prev,t,t.next)<0?LA(t,e,t.next)>=0&&LA(t,t.prev,e)>=0:LA(t,e,t.prev)<0||LA(t,t.next,e)<0}function UA(t,e){var r=new VA(t.i,t.x,t.y),n=new VA(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function jA(t,e,r,n){var i=new VA(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function XA(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 VA(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}function HA(t,e,r,n){for(var i=0,o=e,s=r-n;o<r;o+=n)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}gA.exports=_A,gA.exports.default=_A,_A.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,s=Math.abs(HA(t,0,o,r));if(i)for(var a=0,u=e.length;a<u;a++){var c=e[a]*r,h=a<u-1?e[a+1]*r:t.length;s-=Math.abs(HA(t,c,h,r))}var l=0;for(a=0;a<n.length;a+=3){var d=n[a]*r,f=n[a+1]*r,p=n[a+2]*r;l+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===s&&0===l?0:Math.abs((l-s)/s)},_A.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[i][o][s]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r};var WA=gA.exports,YA={exports:{}};!function(t,r){!function(n){var i=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,u,c=2147483647,h=36,l=/^xn--/,d=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=Math.floor,m=String.fromCharCode;function y(t){throw new RangeError(p[t])}function g(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function _(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+g((t=t.replace(f,".")).split("."),e).join(".")}function b(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function T(t){return g(t,(function(t){var e="";return t>65535&&(e+=m((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=m(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function E(t,e,r){var n=0;for(t=r?v(t/700):t>>1,t+=v(t/e);t>455;n+=h)t=v(t/35);return v(n+36*t/(t+38))}function S(t){var e,r,n,i,o,s,a,u,l,d,f,p=[],m=t.length,g=0,_=128,b=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&y("not-basic"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=g,s=1,a=h;i>=m&&y("invalid-input"),((u=(f=t.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||u>v((c-g)/s))&&y("overflow"),g+=u*s,!(u<(l=a<=b?1:a>=b+26?26:a-b));a+=h)s>v(c/(d=h-l))&&y("overflow"),s*=d;b=E(g-o,e=p.length+1,0==o),v(g/e)>c-_&&y("overflow"),_+=v(g/e),g%=e,p.splice(g++,0,_)}return T(p)}function w(t){var e,r,n,i,o,s,a,u,l,d,f,p,g,_,T,S=[];for(p=(t=b(t)).length,e=128,r=0,o=72,s=0;s<p;++s)(f=t[s])<128&&S.push(m(f));for(n=i=S.length,i&&S.push("-");n<p;){for(a=c,s=0;s<p;++s)(f=t[s])>=e&&f<a&&(a=f);for(a-e>v((c-r)/(g=n+1))&&y("overflow"),r+=(a-e)*g,e=a,s=0;s<p;++s)if((f=t[s])<e&&++r>c&&y("overflow"),f==e){for(u=r,l=h;!(u<(d=l<=o?1:l>=o+26?26:l-o));l+=h)T=u-d,_=h-d,S.push(m(x(d+T%_,0))),u=v(T/_);S.push(m(x(u,0))),o=E(r,g,n==i),r=0,++n}++r,++e}return S.join("")}if(a={version:"1.4.1",ucs2:{decode:b,encode:T},decode:S,encode:w,toASCII:function(t){return _(t,(function(t){return d.test(t)?"xn--"+w(t):t}))},toUnicode:function(t){return _(t,(function(t){return l.test(t)?S(t.slice(4).toLowerCase()):t}))}},i&&o)if(t.exports==i)o.exports=a;else for(u in a)a.hasOwnProperty(u)&&(i[u]=a[u]);else n.punycode=a}(e)}(YA,YA.exports);var zA,ZA="undefined"!=typeof Symbol&&Symbol,JA=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0},KA="Function.prototype.bind called on incompatible ",qA=Array.prototype.slice,QA=Object.prototype.toString,$A="[object Function]",tO=function(t){var e=this;if("function"!=typeof e||QA.call(e)!==$A)throw new TypeError(KA+e);for(var r,n=qA.call(arguments,1),i=function(){if(this instanceof r){var i=e.apply(this,n.concat(qA.call(arguments)));return Object(i)===i?i:this}return e.apply(t,n.concat(qA.call(arguments)))},o=Math.max(0,e.length-n.length),s=[],a=0;a<o;a++)s.push("$"+a);if(r=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var u=function(){};u.prototype=e.prototype,r.prototype=new u,u.prototype=null}return r},eO=Function.prototype.bind||tO,rO=eO.call(Function.call,Object.prototype.hasOwnProperty),nO=SyntaxError,iO=Function,oO=TypeError,sO=function(t){try{return iO('"use strict"; return ('+t+").constructor;")()}catch(t){}},aO=Object.getOwnPropertyDescriptor;if(aO)try{aO({},"")}catch(t){aO=null}var uO=function(){throw new oO},cO=aO?function(){try{return uO}catch(t){try{return aO(arguments,"callee").get}catch(t){return uO}}}():uO,hO="function"==typeof ZA&&"function"==typeof Symbol&&"symbol"==typeof ZA("foo")&&"symbol"==typeof Symbol("bar")&&JA(),lO=Object.getPrototypeOf||function(t){return t.__proto__},dO={},fO="undefined"==typeof Uint8Array?zA:lO(Uint8Array),pO={"%AggregateError%":"undefined"==typeof AggregateError?zA:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?zA:ArrayBuffer,"%ArrayIteratorPrototype%":hO?lO([][Symbol.iterator]()):zA,"%AsyncFromSyncIteratorPrototype%":zA,"%AsyncFunction%":dO,"%AsyncGenerator%":dO,"%AsyncGeneratorFunction%":dO,"%AsyncIteratorPrototype%":dO,"%Atomics%":"undefined"==typeof Atomics?zA:Atomics,"%BigInt%":"undefined"==typeof BigInt?zA:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?zA:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?zA:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?zA:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?zA:FinalizationRegistry,"%Function%":iO,"%GeneratorFunction%":dO,"%Int8Array%":"undefined"==typeof Int8Array?zA:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?zA:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?zA:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hO?lO(lO([][Symbol.iterator]())):zA,"%JSON%":"object"==typeof JSON?JSON:zA,"%Map%":"undefined"==typeof Map?zA:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hO?lO((new Map)[Symbol.iterator]()):zA,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?zA:Promise,"%Proxy%":"undefined"==typeof Proxy?zA:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?zA:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?zA:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hO?lO((new Set)[Symbol.iterator]()):zA,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?zA:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hO?lO(""[Symbol.iterator]()):zA,"%Symbol%":hO?Symbol:zA,"%SyntaxError%":nO,"%ThrowTypeError%":cO,"%TypedArray%":fO,"%TypeError%":oO,"%Uint8Array%":"undefined"==typeof Uint8Array?zA:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?zA:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?zA:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?zA:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?zA:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?zA:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?zA:WeakSet},vO=function t(e){var r;if("%AsyncFunction%"===e)r=sO("async function () {}");else if("%GeneratorFunction%"===e)r=sO("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=sO("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=lO(i.prototype))}return pO[e]=r,r},mO={"%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"]},yO=eO,gO=rO,_O=yO.call(Function.call,Array.prototype.concat),bO=yO.call(Function.apply,Array.prototype.splice),TO=yO.call(Function.call,String.prototype.replace),xO=yO.call(Function.call,String.prototype.slice),EO=yO.call(Function.call,RegExp.prototype.exec),SO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wO=/\\(\\)?/g,RO=function(t){var e=xO(t,0,1),r=xO(t,-1);if("%"===e&&"%"!==r)throw new nO("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new nO("invalid intrinsic syntax, expected opening `%`");var n=[];return TO(t,SO,(function(t,e,r,i){n[n.length]=r?TO(i,wO,"$1"):e||t})),n},CO=function(t,e){var r,n=t;if(gO(mO,n)&&(n="%"+(r=mO[n])[0]+"%"),gO(pO,n)){var i=pO[n];if(i===dO&&(i=vO(n)),void 0===i&&!e)throw new oO("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new nO("intrinsic "+t+" does not exist!")},PO=function(t,e){if("string"!=typeof t||0===t.length)throw new oO("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new oO('"allowMissing" argument must be a boolean');if(null===EO(/^%?[^%]*%?$/,t))throw new nO("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=RO(t),n=r.length>0?r[0]:"",i=CO("%"+n+"%",e),o=i.name,s=i.value,a=!1,u=i.alias;u&&(n=u[0],bO(r,_O([0,1],u)));for(var c=1,h=!0;c<r.length;c+=1){var l=r[c],d=xO(l,0,1),f=xO(l,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new nO("property names with quotes must have matching quotes");if("constructor"!==l&&h||(a=!0),gO(pO,o="%"+(n+="."+l)+"%"))s=pO[o];else if(null!=s){if(!(l in s)){if(!e)throw new oO("base intrinsic for "+t+" exists, but the property is not available.");return}if(aO&&c+1>=r.length){var p=aO(s,l);s=(h=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:s[l]}else h=gO(s,l),s=s[l];h&&!a&&(pO[o]=s)}}return s},AO={exports:{}};!function(t){var e=eO,r=PO,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var r=o(e,i,arguments);if(s&&a){var n=s(r,"length");n.configurable&&a(r,"length",{value:1+u(0,t.length-(arguments.length-1))})}return r};var c=function(){return o(e,n,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c}(AO);var OO=PO,IO=AO.exports,MO=IO(OO("String.prototype.indexOf")),DO=n(Object.freeze({__proto__:null,default:{}})),LO="function"==typeof Map&&Map.prototype,FO=Object.getOwnPropertyDescriptor&&LO?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,NO=LO&&FO&&"function"==typeof FO.get?FO.get:null,kO=LO&&Map.prototype.forEach,BO="function"==typeof Set&&Set.prototype,GO=Object.getOwnPropertyDescriptor&&BO?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,UO=BO&&GO&&"function"==typeof GO.get?GO.get:null,jO=BO&&Set.prototype.forEach,XO="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,VO="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,HO="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,WO=Boolean.prototype.valueOf,YO=Object.prototype.toString,zO=Function.prototype.toString,ZO=String.prototype.match,JO=String.prototype.slice,KO=String.prototype.replace,qO=String.prototype.toUpperCase,QO=String.prototype.toLowerCase,$O=RegExp.prototype.test,tI=Array.prototype.concat,eI=Array.prototype.join,rI=Array.prototype.slice,nI=Math.floor,iI="function"==typeof BigInt?BigInt.prototype.valueOf:null,oI=Object.getOwnPropertySymbols,sI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,aI="function"==typeof Symbol&&"object"==typeof Symbol.iterator,uI="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===aI||"symbol")?Symbol.toStringTag:null,cI=Object.prototype.propertyIsEnumerable,hI=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function lI(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||$O.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-nI(-t):nI(t);if(n!==t){var i=String(n),o=JO.call(e,i.length+1);return KO.call(i,r,"$&_")+"."+KO.call(KO.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return KO.call(e,r,"$&_")}var dI=DO,fI=dI.custom,pI=_I(fI)?fI:null;function vI(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function mI(t){return KO.call(String(t),/"/g,"&quot;")}function yI(t){return!("[object Array]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}function gI(t){return!("[object RegExp]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}function _I(t){if(aI)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!sI)return!1;try{return sI.call(t),!0}catch(t){}return!1}var bI=Object.prototype.hasOwnProperty||function(t){return t in this};function TI(t,e){return bI.call(t,e)}function xI(t){return YO.call(t)}function EI(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function SI(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return SI(JO.call(t,0,e.maxStringLength),e)+n}return vI(KO.call(KO.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,wI),"single",e)}function wI(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":"")+qO.call(e.toString(16))}function RI(t){return"Object("+t+")"}function CI(t){return t+" { ? }"}function PI(t,e,r,n){return t+" ("+e+") {"+(n?AI(r,n):eI.call(r,", "))+"}"}function AI(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+eI.call(t,","+r)+"\n"+e.prev}function OI(t,e){var r=yI(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=TI(t,i)?e(t[i],t):""}var o,s="function"==typeof oI?oI(t):[];if(aI){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)TI(t,u)&&(r&&String(Number(u))===u&&u<t.length||aI&&o["$"+u]instanceof Symbol||($O.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if("function"==typeof oI)for(var c=0;c<s.length;c++)cI.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}var II=PO,MI=function(t,e){var r=OO(t,!!e);return"function"==typeof r&&MO(t,".prototype.")>-1?IO(r):r},DI=function t(e,r,n,i){var o=r||{};if(TI(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(TI(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!TI(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(TI(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(TI(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return SI(e,o);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var u=String(e);return a?lI(e,u):u}if("bigint"==typeof e){var c=String(e)+"n";return a?lI(e,c):c}var h=void 0===o.depth?5:o.depth;if(void 0===n&&(n=0),n>=h&&h>0&&"object"==typeof e)return yI(e)?"[Array]":"[Object]";var l=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=eI.call(Array(t.indent+1)," ")}return{base:r,prev:eI.call(Array(e+1),r)}}(o,n);if(void 0===i)i=[];else if(EI(i,e)>=0)return"[Circular]";function d(e,r,s){if(r&&(i=rI.call(i)).push(r),s){var a={depth:o.depth};return TI(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),t(e,a,n+1,i)}return t(e,o,n+1,i)}if("function"==typeof e&&!gI(e)){var f=function(t){if(t.name)return t.name;var e=ZO.call(zO.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),p=OI(e,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+eI.call(p,", ")+" }":"")}if(_I(e)){var v=aI?KO.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):sI.call(e);return"object"!=typeof e||aI?v:RI(v)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var m="<"+QO.call(String(e.nodeName)),y=e.attributes||[],g=0;g<y.length;g++)m+=" "+y[g].name+"="+vI(mI(y[g].value),"double",o);return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+="</"+QO.call(String(e.nodeName))+">"}if(yI(e)){if(0===e.length)return"[]";var _=OI(e,d);return l&&!function(t){for(var e=0;e<t.length;e++)if(EI(t[e],"\n")>=0)return!1;return!0}(_)?"["+AI(_,l)+"]":"[ "+eI.call(_,", ")+" ]"}if(function(t){return!("[object Error]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}(e)){var b=OI(e,d);return"cause"in Error.prototype||!("cause"in e)||cI.call(e,"cause")?0===b.length?"["+String(e)+"]":"{ ["+String(e)+"] "+eI.call(b,", ")+" }":"{ ["+String(e)+"] "+eI.call(tI.call("[cause]: "+d(e.cause),b),", ")+" }"}if("object"==typeof e&&s){if(pI&&"function"==typeof e[pI]&&dI)return dI(e,{depth:h-n});if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!NO||!t||"object"!=typeof t)return!1;try{NO.call(t);try{UO.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var T=[];return kO.call(e,(function(t,r){T.push(d(r,e,!0)+" => "+d(t,e))})),PI("Map",NO.call(e),T,l)}if(function(t){if(!UO||!t||"object"!=typeof t)return!1;try{UO.call(t);try{NO.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var x=[];return jO.call(e,(function(t){x.push(d(t,e))})),PI("Set",UO.call(e),x,l)}if(function(t){if(!XO||!t||"object"!=typeof t)return!1;try{XO.call(t,XO);try{VO.call(t,VO)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return CI("WeakMap");if(function(t){if(!VO||!t||"object"!=typeof t)return!1;try{VO.call(t,VO);try{XO.call(t,XO)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return CI("WeakSet");if(function(t){if(!HO||!t||"object"!=typeof t)return!1;try{return HO.call(t),!0}catch(t){}return!1}(e))return CI("WeakRef");if(function(t){return!("[object Number]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}(e))return RI(d(Number(e)));if(function(t){if(!t||"object"!=typeof t||!iI)return!1;try{return iI.call(t),!0}catch(t){}return!1}(e))return RI(d(iI.call(e)));if(function(t){return!("[object Boolean]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}(e))return RI(WO.call(e));if(function(t){return!("[object String]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}(e))return RI(d(String(e)));if(!function(t){return!("[object Date]"!==xI(t)||uI&&"object"==typeof t&&uI in t)}(e)&&!gI(e)){var E=OI(e,d),S=hI?hI(e)===Object.prototype:e instanceof Object||e.constructor===Object,w=e instanceof Object?"":"null prototype",R=!S&&uI&&Object(e)===e&&uI in e?JO.call(xI(e),8,-1):w?"Object":"",C=(S||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(R||w?"["+eI.call(tI.call([],R||[],w||[]),": ")+"] ":"");return 0===E.length?C+"{}":l?C+"{"+AI(E,l)+"}":C+"{ "+eI.call(E,", ")+" }"}return String(e)},LI=II("%TypeError%"),FI=II("%WeakMap%",!0),NI=II("%Map%",!0),kI=MI("WeakMap.prototype.get",!0),BI=MI("WeakMap.prototype.set",!0),GI=MI("WeakMap.prototype.has",!0),UI=MI("Map.prototype.get",!0),jI=MI("Map.prototype.set",!0),XI=MI("Map.prototype.has",!0),VI=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},HI=String.prototype.replace,WI=/%20/g,YI="RFC3986",zI={default:YI,formatters:{RFC1738:function(t){return HI.call(t,WI,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:YI},ZI=zI,JI=Object.prototype.hasOwnProperty,KI=Array.isArray,qI=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),QI=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},$I={arrayToObject:QI,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],o=i.obj[i.prop],s=Object.keys(o),a=0;a<s.length;++a){var u=s[a],c=o[u];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(e.push({obj:o,prop:u}),r.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(KI(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,n,i){if(0===t.length)return t;var o=t;if("symbol"==typeof t?o=Symbol.prototype.toString.call(t):"string"!=typeof t&&(o=String(t)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var s="",a=0;a<o.length;++a){var u=o.charCodeAt(a);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===ZI.RFC1738&&(40===u||41===u)?s+=o.charAt(a):u<128?s+=qI[u]:u<2048?s+=qI[192|u>>6]+qI[128|63&u]:u<55296||u>=57344?s+=qI[224|u>>12]+qI[128|u>>6&63]+qI[128|63&u]:(a+=1,u=65536+((1023&u)<<10|1023&o.charCodeAt(a)),s+=qI[240|u>>18]+qI[128|u>>12&63]+qI[128|u>>6&63]+qI[128|63&u])}return s},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(KI(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(KI(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!JI.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var i=e;return KI(e)&&!KI(r)&&(i=QI(e,n)),KI(e)&&KI(r)?(r.forEach((function(r,i){if(JI.call(e,i)){var o=e[i];o&&"object"==typeof o&&r&&"object"==typeof r?e[i]=t(o,r,n):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var o=r[i];return JI.call(e,i)?e[i]=t(e[i],o,n):e[i]=o,e}),i)}},tM=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new LI("Side channel does not contain "+DI(t))},get:function(n){if(FI&&n&&("object"==typeof n||"function"==typeof n)){if(t)return kI(t,n)}else if(NI){if(e)return UI(e,n)}else if(r)return function(t,e){var r=VI(t,e);return r&&r.value}(r,n)},has:function(n){if(FI&&n&&("object"==typeof n||"function"==typeof n)){if(t)return GI(t,n)}else if(NI){if(e)return XI(e,n)}else if(r)return function(t,e){return!!VI(t,e)}(r,n);return!1},set:function(n,i){FI&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new FI),BI(t,n,i)):NI?(e||(e=new NI),jI(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=VI(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n},eM=$I,rM=zI,nM=Object.prototype.hasOwnProperty,iM={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},oM=Array.isArray,sM=Array.prototype.push,aM=function(t,e){sM.apply(t,oM(e)?e:[e])},uM=Date.prototype.toISOString,cM=rM.default,hM={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:eM.encode,encodeValuesOnly:!1,format:cM,formatter:rM.formatters[cM],indices:!1,serializeDate:function(t){return uM.call(t)},skipNulls:!1,strictNullHandling:!1},lM={},dM=function t(e,r,n,i,o,s,a,u,c,h,l,d,f,p,v,m){for(var y,g=e,_=m,b=0,T=!1;void 0!==(_=_.get(lM))&&!T;){var x=_.get(e);if(b+=1,void 0!==x){if(x===b)throw new RangeError("Cyclic object value");T=!0}void 0===_.get(lM)&&(b=0)}if("function"==typeof u?g=u(r,g):g instanceof Date?g=l(g):"comma"===n&&oM(g)&&(g=eM.maybeMap(g,(function(t){return t instanceof Date?l(t):t}))),null===g){if(o)return a&&!p?a(r,hM.encoder,v,"key",d):r;g=""}if("string"==typeof(y=g)||"number"==typeof y||"boolean"==typeof y||"symbol"==typeof y||"bigint"==typeof y||eM.isBuffer(g))return a?[f(p?r:a(r,hM.encoder,v,"key",d))+"="+f(a(g,hM.encoder,v,"value",d))]:[f(r)+"="+f(String(g))];var E,S=[];if(void 0===g)return S;if("comma"===n&&oM(g))p&&a&&(g=eM.maybeMap(g,a)),E=[{value:g.length>0?g.join(",")||null:void 0}];else if(oM(u))E=u;else{var w=Object.keys(g);E=c?w.sort(c):w}for(var R=i&&oM(g)&&1===g.length?r+"[]":r,C=0;C<E.length;++C){var P=E[C],A="object"==typeof P&&void 0!==P.value?P.value:g[P];if(!s||null!==A){var O=oM(g)?"function"==typeof n?n(R,P):R:R+(h?"."+P:"["+P+"]");m.set(e,b);var I=tM();I.set(lM,m),aM(S,t(A,O,n,i,o,s,"comma"===n&&p&&oM(g)?null:a,u,c,h,l,d,f,p,v,I))}}return S},fM=$I,pM=Object.prototype.hasOwnProperty,vM=Array.isArray,mM={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fM.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},yM=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},gM=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},_M=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,u=[];if(a){if(!r.plainObjects&&pM.call(Object.prototype,a)&&!r.allowPrototypes)return;u.push(a)}for(var c=0;r.depth>0&&null!==(s=o.exec(i))&&c<r.depth;){if(c+=1,!r.plainObjects&&pM.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(t,e,r,n){for(var i=n?e:gM(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);r.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[])[c]=i:"__proto__"!==u&&(s[u]=i):s={0:i}}i=s}return i}(u,e,r,n)}},bM=function(t,e){var r,n=t,i=function(t){if(!t)return hM;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||hM.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=rM.default;if(void 0!==t.format){if(!nM.call(rM.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=rM.formatters[r],i=hM.filter;return("function"==typeof t.filter||oM(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:hM.addQueryPrefix,allowDots:void 0===t.allowDots?hM.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:hM.charsetSentinel,delimiter:void 0===t.delimiter?hM.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:hM.encode,encoder:"function"==typeof t.encoder?t.encoder:hM.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:hM.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:hM.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:hM.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:hM.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):oM(i.filter)&&(r=i.filter);var o,s=[];if("object"!=typeof n||null===n)return"";o=e&&e.arrayFormat in iM?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=iM[o];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u="comma"===a&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var c=tM(),h=0;h<r.length;++h){var l=r[h];i.skipNulls&&null===n[l]||aM(s,dM(n[l],l,a,u,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,c))}var d=s.join(i.delimiter),f=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),d.length>0?f+d:""},TM=function(t,e){var r=function(t){if(!t)return mM;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?mM.charset:t.charset;return{allowDots:void 0===t.allowDots?mM.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:mM.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:mM.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:mM.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:mM.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:mM.comma,decoder:"function"==typeof t.decoder?t.decoder:mM.decoder,delimiter:"string"==typeof t.delimiter||fM.isRegExp(t.delimiter)?t.delimiter:mM.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:mM.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:mM.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:mM.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:mM.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:mM.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={__proto__:null},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,s=i.split(e.delimiter,o),a=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?u="utf-8":"utf8=%26%2310003%3B"===s[r]&&(u="iso-8859-1"),a=r,r=s.length);for(r=0;r<s.length;++r)if(r!==a){var c,h,l=s[r],d=l.indexOf("]="),f=-1===d?l.indexOf("="):d+1;-1===f?(c=e.decoder(l,mM.decoder,u,"key"),h=e.strictNullHandling?null:""):(c=e.decoder(l.slice(0,f),mM.decoder,u,"key"),h=fM.maybeMap(gM(l.slice(f+1),e),(function(t){return e.decoder(t,mM.decoder,u,"value")}))),h&&e.interpretNumericEntities&&"iso-8859-1"===u&&(h=yM(h)),l.indexOf("[]=")>-1&&(h=vM(h)?[h]:h),pM.call(n,c)?n[c]=fM.combine(n[c],h):n[c]=h}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],u=_M(a,n[a],r,"string"==typeof t);i=fM.merge(i,u,r)}return!0===r.allowSparse?i:fM.compact(i)},xM={formats:zI,parse:TM,stringify:bM},EM=YA.exports;function SM(){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 wM=/^([a-z0-9.+-]+:)/i,RM=/:[0-9]*$/,CM=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,PM=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),AM=["'"].concat(PM),OM=["%","/","?",";","#"].concat(AM),IM=["/","?","#"],MM=/^[+a-z0-9A-Z_-]{0,63}$/,DM=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,LM={javascript:!0,"javascript:":!0},FM={javascript:!0,"javascript:":!0},NM={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},kM=xM;function BM(t,e,r){if(t&&"object"==typeof t&&t instanceof SM)return t;var n=new SM;return n.parse(t,e,r),n}SM.prototype.parse=function(t,e,r){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n<t.indexOf("#")?"?":"#",o=t.split(i);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(i);if(s=s.trim(),!r&&1===t.split("#").length){var a=CM.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?kM.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=wM.exec(s);if(u){var c=(u=u[0]).toLowerCase();this.protocol=c,s=s.substr(u.length)}if(r||u||s.match(/^\/\/[^@/]+@[^@/]+/)){var h="//"===s.substr(0,2);!h||u&&FM[u]||(s=s.substr(2),this.slashes=!0)}if(!FM[u]&&(h||u&&!NM[u])){for(var l,d,f=-1,p=0;p<IM.length;p++){-1!==(v=s.indexOf(IM[p]))&&(-1===f||v<f)&&(f=v)}-1!==(d=-1===f?s.lastIndexOf("@"):s.lastIndexOf("@",f))&&(l=s.slice(0,d),s=s.slice(d+1),this.auth=decodeURIComponent(l)),f=-1;for(p=0;p<OM.length;p++){var v;-1!==(v=s.indexOf(OM[p]))&&(-1===f||v<f)&&(f=v)}-1===f&&(f=s.length),this.host=s.slice(0,f),s=s.slice(f),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var y=this.hostname.split(/\./),g=(p=0,y.length);p<g;p++){var _=y[p];if(_&&!_.match(MM)){for(var b="",T=0,x=_.length;T<x;T++)_.charCodeAt(T)>127?b+="x":b+=_[T];if(!b.match(MM)){var E=y.slice(0,p),S=y.slice(p+1),w=_.match(DM);w&&(E.push(w[1]),S.unshift(w[2])),S.length&&(s="/"+S.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=EM.toASCII(this.hostname));var R=this.port?":"+this.port:"",C=this.hostname||"";this.host=C+R,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!LM[c])for(p=0,g=AM.length;p<g;p++){var P=AM[p];if(-1!==s.indexOf(P)){var A=encodeURIComponent(P);A===P&&(A=escape(P)),s=s.split(P).join(A)}}var O=s.indexOf("#");-1!==O&&(this.hash=s.substr(O),s=s.slice(0,O));var I=s.indexOf("?");if(-1!==I?(this.search=s.substr(I),this.query=s.substr(I+1),e&&(this.query=kM.parse(this.query)),s=s.slice(0,I)):e&&(this.search="",this.query={}),s&&(this.pathname=s),NM[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){R=this.pathname||"";var M=this.search||"";this.path=R+M}return this.href=this.format(),this},SM.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=kM.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||NM[e])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})),e+i+r+(s=s.replace("#","%23"))+n},SM.prototype.resolve=function(t){return this.resolveObject(BM(t,!1,!0)).format()},SM.prototype.resolveObject=function(t){if("string"==typeof t){var e=new SM;e.parse(t,!1,!0),t=e}for(var r=new SM,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];"protocol"!==u&&(r[u]=t[u])}return NM[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(!NM[t.protocol]){for(var c=Object.keys(t),h=0;h<c.length;h++){var l=c[h];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||FM[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}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 f=r.pathname||"",p=r.search||"";r.path=f+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),m=t.host||t.pathname&&"/"===t.pathname.charAt(0),y=m||v||r.host&&t.pathname,g=y,_=r.pathname&&r.pathname.split("/")||[],b=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!NM[r.protocol]);if(b&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),y=y&&(""===d[0]||""===_[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,_=d;else if(d.length)_||(_=[]),_.pop(),_=_.concat(d),r.search=t.search,r.query=t.query;else if(null!=t.search){if(b)r.host=_.shift(),r.hostname=r.host,(w=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname);return r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=_.slice(-1)[0],x=(r.host||t.host||_.length>1)&&("."===T||".."===T)||""===T,E=0,S=_.length;S>=0;S--)"."===(T=_[S])?_.splice(S,1):".."===T?(_.splice(S,1),E++):E&&(_.splice(S,1),E--);if(!y&&!g)for(;E--;E)_.unshift("..");!y||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),x&&"/"!==_.join("/").substr(-1)&&_.push("");var w,R=""===_[0]||_[0]&&"/"===_[0].charAt(0);b&&(r.hostname=R?"":_.length?_.shift():"",r.host=r.hostname,(w=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname));return(y=y||r.host&&_.length)&&!R&&_.unshift(""),_.length>0?r.pathname=_.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(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},SM.prototype.parseHost=function(){var t=this.host,e=RM.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var GM={parse:BM,format:function(t){return"string"==typeof t&&(t=BM(t)),t instanceof SM?t.format():SM.prototype.format.call(t)},resolve:function(t,e){return BM(t,!1,!0).resolve(e)}};vA.RETINA_PREFIX=/@([0-9\.]+)x/,vA.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var UM,jM=!1;function XM(t){var e;if(!jM){if(vA.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS 6.5.10 - ✰ "+t+" ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.5.10 - "+t+" - http://www.pixijs.com/");jM=!0}}var VM={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function HM(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function WM(t){var e=t.toString(16);return"#"+(e="000000".substring(0,6-e.length)+e)}function YM(t){return"string"==typeof t&&"#"===(t=VM[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}function zM(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var ZM=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[OP.NORMAL_NPM]=OP.NORMAL,t[OP.ADD_NPM]=OP.ADD,t[OP.SCREEN_NPM]=OP.SCREEN,e[OP.NORMAL]=OP.NORMAL_NPM,e[OP.ADD]=OP.ADD_NPM,e[OP.SCREEN]=OP.SCREEN_NPM;var n=[];return n.push(e),n.push(t),n}();function JM(t,e){return ZM[e?1:0][t]}function KM(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,n=t>>8&255,i=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((n=n*e+.5|0)<<8)+(i=i*e+.5|0)}function qM(t,e,r,n){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(n||void 0===n)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function QM(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}function $M(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function tD(t){return!(t&t-1||!t)}function eD(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function rD(t,e,r){var n,i=t.length;if(!(e>=i||0===r)){var o=i-(r=e+r>i?i-e:r);for(n=e;n<o;++n)t[n]=t[n+r];t.length=o}}function nD(t){return 0===t?0:t<0?-1:1}var iD=0;function oD(){return++iD}var sD={};function aD(t,e,r){if(void 0===r&&(r=3),!sD[e]){var n=(new Error).stack;void 0===n?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(n=n.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(n))),sD[e]=!0}}var uD,cD={},hD=Object.create(null),lD=Object.create(null),dD=function(){function t(t,e,r){this.canvas=vA.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=r||vA.RESOLUTION,this.resize(t,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),t}();function fD(t,e){if(void 0===e&&(e=globalThis.location),0===t.indexOf("data:"))return"";e=e||globalThis.location,uD||(uD=document.createElement("a")),uD.href=t;var r=GM.parse(uD.href),n=!r.port&&""===e.port||r.port===e.port;return r.hostname===e.hostname&&n&&r.protocol===e.protocol?"":"anonymous"}function pD(t,e){var r=vA.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}var vD,mD=2*Math.PI,yD=180/Math.PI,gD=Math.PI/180;!function(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"}(vD||(vD={}));var _D=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),bD=[new _D,new _D,new _D,new _D],TD=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(n),this.type=vD.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},t.prototype.intersects=function(t,e){if(!e){var r=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=r)return!1;var n=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>n}var i=this.left,o=this.right,s=this.top,a=this.bottom;if(o<=i||a<=s)return!1;var u=bD[0].set(t.left,t.top),c=bD[1].set(t.left,t.bottom),h=bD[2].set(t.right,t.top),l=bD[3].set(t.right,t.bottom);if(h.x<=u.x||c.y<=u.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d)return!1;if(e.apply(u,u),e.apply(c,c),e.apply(h,h),e.apply(l,l),Math.max(u.x,c.x,h.x,l.x)<=i||Math.min(u.x,c.x,h.x,l.x)>=o||Math.max(u.y,c.y,h.y,l.y)<=s||Math.min(u.y,c.y,h.y,l.y)>=a)return!1;var f=d*(c.y-u.y),p=d*(u.x-c.x),v=f*i+p*s,m=f*o+p*s,y=f*i+p*a,g=f*o+p*a;if(Math.max(v,m,y,g)<=f*u.x+p*u.y||Math.min(v,m,y,g)>=f*l.x+p*l.y)return!1;var _=d*(u.y-h.y),b=d*(h.x-u.x),T=_*i+b*s,x=_*o+b*s,E=_*i+b*a,S=_*o+b*a;return!(Math.max(T,x,E,S)<=_*u.x+b*u.y||Math.min(T,x,E,S)>=_*l.x+b*l.y)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),i=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=n,this.height=Math.max(i-n,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var r=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=n-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=n,this.height=i-n,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),xD=function(){function t(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),this.x=t,this.y=e,this.radius=r,this.type=vD.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,n=this.x-t,i=this.y-e;return(n*=n)+(i*=i)<=r},t.prototype.getBounds=function(){return new TD(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},t}(),ED=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=r,this.height=n,this.type=vD.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return(r*=r)+(n*=n)<=1},t.prototype.getBounds=function(){return new TD(this.x-this.width,this.y-this.height,this.width,this.height)},t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),SD=function(){function t(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var n=Array.isArray(e[0])?e[0]:e;if("number"!=typeof n[0]){for(var i=[],o=0,s=n.length;o<s;o++)i.push(n[o].x,n[o].y);n=i}this.points=n,this.type=vD.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var r=!1,n=this.points.length/2,i=0,o=n-1;i<n;o=i++){var s=this.points[2*i],a=this.points[2*i+1],u=this.points[2*o],c=this.points[2*o+1];a>e!=c>e&&t<(e-a)/(c-a)*(u-s)+s&&(r=!r)}return r},t.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(t,e){return t+", "+e}),"")+"]"},t}(),wD=function(){function t(t,e,r,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=20),this.x=t,this.y=e,this.width=r,this.height=n,this.radius=i,this.type=vD.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;var n=t-(this.x+r),i=e-(this.y+r),o=r*r;if(n*n+i*i<=o)return!0;if((n=t-(this.x+this.width-r))*n+i*i<=o)return!0;if(n*n+(i=e-(this.y+this.height-r))*i<=o)return!0;if((n=t-(this.x+r))*n+i*i<=o)return!0}return!1},t.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},t}(),RD=function(){function t(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this._x=r,this._y=n,this.cb=t,this.scope=e}return t.prototype.clone=function(e,r){return void 0===e&&(e=this.cb),void 0===r&&(r=this.scope),new t(e,r,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),CD=function(){function t(t,e,r,n,i,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===i&&(i=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=o}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,n,i,o){return this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new _D;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new _D;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,i=t.y;return e.x=this.d*r*n+-this.c*r*i+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*i+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this},t.prototype.setTransform=function(t,e,r,n,i,o,s,a,u){return this.a=Math.cos(s+u)*i,this.b=Math.sin(s+u)*i,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+n*this.c),this.ty=e-(r*this.b+n*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,n=this.c,i=this.d,o=t.pivot,s=-Math.atan2(-n,i),a=Math.atan2(r,e),u=Math.abs(s+a);return u<1e-5||Math.abs(mD-u)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(n*n+i*i),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*r+o.y*i),t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;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},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),PD=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],AD=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],OD=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ID=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],MD=[],DD=[],LD=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];MD.push(e);for(var r=0;r<16;r++)for(var n=LD(PD[t]*PD[r]+OD[t]*AD[r]),i=LD(AD[t]*PD[r]+ID[t]*AD[r]),o=LD(PD[t]*OD[r]+OD[t]*ID[r]),s=LD(AD[t]*OD[r]+ID[t]*ID[r]),a=0;a<16;a++)if(PD[a]===n&&AD[a]===i&&OD[a]===o&&ID[a]===s){e.push(a);break}}for(t=0;t<16;t++){var u=new CD;u.set(PD[t],AD[t],OD[t],ID[t],0,0),DD.push(u)}}();var FD={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:function(t){return PD[t]},uY:function(t){return AD[t]},vX:function(t){return OD[t]},vY:function(t){return ID[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return MD[t][e]},sub:function(t,e){return MD[t][FD.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?FD.S:FD.N:2*Math.abs(e)<=Math.abs(t)?t>0?FD.E:FD.W:e>0?t>0?FD.SE:FD.SW:t>0?FD.NE:FD.NW},matrixAppendRotationInv:function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=DD[FD.inv(e)];i.tx=r,i.ty=n,t.append(i)}},ND=function(){function t(){this.worldTransform=new CD,this.localTransform=new CD,this.position=new RD(this.onChange,this,0,0),this.scale=new RD(this.onChange,this,1,1),this.pivot=new RD(this.onChange,this,0,0),this.skew=new RD(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}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){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++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var 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)},t.prototype.updateTransform=function(t){var 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){var r=t.worldTransform,n=this.worldTransform;n.a=e.a*r.a+e.b*r.c,n.b=e.a*r.b+e.b*r.d,n.c=e.c*r.a+e.d*r.c,n.d=e.c*r.b+e.d*r.d,n.tx=e.tx*r.a+e.ty*r.c+r.tx,n.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();vA.SORTABLE_CHILDREN=!1;var kD=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?TD.EMPTY:((t=t||new TD(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var r=t.a,n=t.b,i=t.c,o=t.d,s=t.tx,a=t.ty,u=r*e.x+i*e.y+s,c=n*e.x+o*e.y+a;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,n=this.maxX,i=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,n=o>n?o:n,i=s>i?s:i,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,n=o>n?o:n,i=s>i?s:i,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,n=o>n?o:n,i=s>i?s:i,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,n=o>n?o:n,i=s>i?s:i,this.minX=e,this.minY=r,this.maxX=n,this.maxY=i},t.prototype.addFrame=function(t,e,r,n,i){this.addFrameMatrix(t.worldTransform,e,r,n,i)},t.prototype.addFrameMatrix=function(t,e,r,n,i){var o=t.a,s=t.b,a=t.c,u=t.d,c=t.tx,h=t.ty,l=this.minX,d=this.minY,f=this.maxX,p=this.maxY,v=o*e+a*r+c,m=s*e+u*r+h;l=v<l?v:l,d=m<d?m:d,f=v>f?v:f,p=m>p?m:p,l=(v=o*n+a*r+c)<l?v:l,d=(m=s*n+u*r+h)<d?m:d,f=v>f?v:f,p=m>p?m:p,l=(v=o*e+a*i+c)<l?v:l,d=(m=s*e+u*i+h)<d?m:d,f=v>f?v:f,p=m>p?m:p,l=(v=o*n+a*i+c)<l?v:l,d=(m=s*n+u*i+h)<d?m:d,f=v>f?v:f,p=m>p?m:p,this.minX=l,this.minY=d,this.maxX=f,this.maxY=p},t.prototype.addVertexData=function(t,e,r){for(var n=this.minX,i=this.minY,o=this.maxX,s=this.maxY,a=e;a<r;a+=2){var u=t[a],c=t[a+1];n=u<n?u:n,i=c<i?c:i,o=u>o?u:o,s=c>s?c:s}this.minX=n,this.minY=i,this.maxX=o,this.maxY=s},t.prototype.addVertices=function(t,e,r,n){this.addVerticesMatrix(t.worldTransform,e,r,n)},t.prototype.addVerticesMatrix=function(t,e,r,n,i,o){void 0===i&&(i=0),void 0===o&&(o=i);for(var s=t.a,a=t.b,u=t.c,c=t.d,h=t.tx,l=t.ty,d=this.minX,f=this.minY,p=this.maxX,v=this.maxY,m=r;m<n;m+=2){var y=e[m],g=e[m+1],_=s*y+u*g+h,b=c*g+a*y+l;d=Math.min(d,_-i),p=Math.max(p,_+i),f=Math.min(f,b-o),v=Math.max(v,b+o)}this.minX=d,this.minY=f,this.maxX=p,this.maxY=v},t.prototype.addBounds=function(t){var e=this.minX,r=this.minY,n=this.maxX,i=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>n?t.maxX:n,this.maxY=t.maxY>i?t.maxY:i},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,i=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=i&&n<=o){var s=this.minX,a=this.minY,u=this.maxX,c=this.maxY;this.minX=r<s?r:s,this.minY=n<a?n:a,this.maxX=i>u?i:u,this.maxY=o>c?o:c}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,i=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=i&&n<=o){var s=this.minX,a=this.minY,u=this.maxX,c=this.maxY;this.minX=r<s?r:s,this.minY=n<a?n:a,this.maxX=i>u?i:u,this.maxY=o>c?o:c}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,r,n,i,o){t-=i,e-=o,r+=i,n+=o,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>r?this.maxX:r,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>n?this.maxY:n},t}(),BD=function(t,e){return BD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},BD(t,e)};function GD(t,e){function r(){this.constructor=t}BD(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var UD=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new ND,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new kD,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return GD(e,t),e.mixin=function(t){for(var r=Object.keys(t),n=0;n<r.length;++n){var i=r[n];Object.defineProperty(e.prototype,i,Object.getOwnPropertyDescriptor(t,i))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,e){return t||(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),e||(this._boundsRect||(this._boundsRect=new TD),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new TD),t=this._localBoundsRect),this._localBounds||(this._localBounds=new kD);var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var n=this._bounds,i=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=n,this._bounds.updateID+=this._boundsID-i,o},e.prototype.toGlobal=function(t,e,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,n){return e&&(t=e.toGlobal(t,r,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,r,n,i,o,s,a,u){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===u&&(u=0),this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=n||1,this.rotation=i,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=u,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),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.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new jD),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*yD},set:function(t){this.transform.rotation=t*gD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){var e;if(this._mask)(e=this._mask.isMaskData?this._mask.maskObject:this._mask)&&(e._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1));if(this._mask=t,this._mask)(e=this._mask.isMaskData?this._mask.maskObject:this._mask)&&(0===e._maskRefCount&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++)}},enumerable:!1,configurable:!0}),e}(yA),jD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return GD(e,t),e}(UD);function XD(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}UD.prototype.displayObjectUpdateTransform=UD.prototype.updateTransform;var VD=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=vA.SORTABLE_CHILDREN,e.sortDirty=!1,e}return GD(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var n=0;n<e.length;n++)this.addChild(e[n]);else{var i=e[0];i.parent&&i.parent.removeChild(i),i.parent=this,this.sortDirty=!0,i.transform._parentID=-1,this.children.push(i),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",i,this,this.children.length-1),i.emit("added",this)}return e[0]},e.prototype.addChildAt=function(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},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t,this.onChildrenChange(r<n?r:n)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);rD(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var n=0;n<e.length;n++)this.removeChild(e[n]);else{var i=e[0],o=this.children.indexOf(i);if(-1===o)return null;i.parent=null,i.transform._parentID=-1,rD(this.children,o,1),this._boundsID++,this.onChildrenChange(o),i.emit("removed",this),this.emit("childRemoved",i,this,o)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,rD(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var r,n=t,i=e-n;if(i>0&&i<=e){r=this.children.splice(n,i);for(var o=0;o<r.length;++o)r[o].parent=null,r[o].transform&&(r[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(o=0;o<r.length;++o)r[o].emit("removed",this),this.emit("childRemoved",r[o],this,o);return r}if(0===i&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,r=this.children.length;e<r;++e){var n=this.children[e];n._lastSortedIndex=e,t||0===n.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(XD),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var 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},e.prototype.getLocalBounds=function(e,r){void 0===r&&(r=!1);var n=t.prototype.getLocalBounds.call(this,e);if(!r)for(var i=0,o=this.children.length;i<o;++i){var s=this.children[i];s.visible&&s.updateTransform()}return n},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var r=t.renderTexture.sourceFrame;if(r.width>0&&r.height>0){var n,i;if(this.cullArea?(n=this.cullArea,i=this.worldTransform):this._render!==e.prototype._render&&(n=this.getBounds(!0)),n&&r.intersects(n,i))this._render(t);else if(this.cullArea)return;for(var o=0,s=this.children.length;o<s;++o){var a=this.children[o],u=a.cullable;a.cullable=u||!this.cullArea,a.render(t),a.cullable=u}}},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){var e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var n=0;n<e.length;n++)e[n].enabled&&this._enabledFilters.push(e[n])}var i=e&&this._enabledFilters&&this._enabledFilters.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==VP.NONE));if(i&&t.batch.flush(),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);n=0;for(var o=this.children.length;n<o;++n)this.children[n].render(t)}i&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var r="boolean"==typeof e?e:e&&e.children,n=this.removeChildren(0,this.children.length);if(r)for(var i=0;i<n.length;++i)n[i].destroy(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),e}(UD);VD.prototype.containerUpdateTransform=VD.prototype.updateTransform;var HD,WD=function(){return WD=Object.assign||function(t){for(var e,r=arguments,n=1,i=arguments.length;n<i;n++)for(var o in e=r[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},WD.apply(this,arguments)};!function(t){t.Application="application",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Loader="loader",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser"}(HD||(HD={}));var YD,zD=function(t){if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");var e="object"!=typeof t.extension?{type:t.extension}:t.extension;t=WD(WD({},e),{ref:t})}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t=WD({},t)).type&&(t.type=[t.type]),t},ZD={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var t=arguments,e=this,r=[],n=0;n<arguments.length;n++)r[n]=t[n];return r.map(zD).forEach((function(t){t.type.forEach((function(r){var n,i;return null===(i=(n=e._removeHandlers)[r])||void 0===i?void 0:i.call(n,t)}))})),this},add:function(){for(var t=arguments,e=this,r=[],n=0;n<arguments.length;n++)r[n]=t[n];return r.map(zD).forEach((function(t){t.type.forEach((function(r){var n=e._addHandlers,i=e._queue;n[r]?n[r](t):(i[r]=i[r]||[],i[r].push(t))}))})),this},handle:function(t,e,r){var n=this._addHandlers=this._addHandlers||{},i=this._removeHandlers=this._removeHandlers||{};if(n[t]||i[t])throw new Error("Extension type "+t+" already has a handler");n[t]=e,i[t]=r;var o=this._queue;return o[t]&&(o[t].forEach((function(t){return e(t)})),delete o[t]),this},handleByMap:function(t,e){return this.handle(t,(function(t){e[t.name]=t.ref}),(function(t){delete e[t.name]}))},handleByList:function(t,e){return this.handle(t,(function(r){var n,i;e.includes(r.ref)||(e.push(r.ref),t===HD.Loader&&(null===(i=(n=r.ref).add)||void 0===i||i.call(n)))}),(function(t){var r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))}},JD=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,r,n,i,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var u=this,c=u.name,h=u.items;this._aliasCount++;for(var l=0,d=h.length;l<d;l++)h[l][c](t,e,r,n,i,o,s,a);return h===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(JD.prototype,{dispatch:{value:JD.prototype.emit},run:{value:JD.prototype.emit}}),vA.TARGET_FPMS=.06,function(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"}(YD||(YD={}));var KD=function(){function t(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=0),void 0===n&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=n}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),qD=function(){function t(){var t=this;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 KD(null,null,1/0),this.deltaMS=1/vA.TARGET_FPMS,this.elapsedMS=1/vA.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,r){return void 0===r&&(r=YD.NORMAL),this._addListener(new KD(t,e,r))},t.prototype.addOnce=function(t,e,r){return void 0===r&&(r=YD.NORMAL),this._addListener(new KD(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r<this._minElapsedMS)return;this._lastFrame=t-r%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*vA.TARGET_FPMS;for(var n=this._head,i=n.next;i;)i=i.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,vA.TARGET_FPMS);this._maxElapsedMS=1/r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),QD=function(){function t(){}return t.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,YD.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?qD.shared:new qD,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t.extension=HD.Application,t}();vA.PREFER_ENV=pA.any?CP.WEBGL:CP.WEBGL2,vA.STRICT_TEXTURE_CACHE=!1;var $D=[];function tL(t,e){if(!t)return null;var r="";if("string"==typeof t){var n=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);n&&(r=n[1].toLowerCase())}for(var i=$D.length-1;i>=0;--i){var o=$D[i];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var eL=function(t,e){return eL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},eL(t,e)};function rL(t,e){function r(){this.constructor=t}eL(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var nL=function(){return nL=Object.assign||function(t){for(var e,r=arguments,n=1,i=arguments.length;n<i;n++)for(var o in e=r[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nL.apply(this,arguments)};var iL=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new JD("setRealSize"),this.onUpdate=new JD("update"),this.onError=new JD("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,r){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){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)},t.test=function(t,e){return!1},t}(),oL=function(t){function e(e,r){var n=this,i=r||{},o=i.width,s=i.height;if(!o||!s)throw new Error("BufferResource width or height invalid");return(n=t.call(this,o,s)||this).data=e,n}return rL(e,t),e.prototype.upload=function(t,e,r){var n=t.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===GP.UNPACK);var i=e.realWidth,o=e.realHeight;return r.width===i&&r.height===o?n.texSubImage2D(e.target,0,0,0,i,o,e.format,r.type,this.data):(r.width=i,r.height=o,n.texImage2D(e.target,0,r.internalFormat,i,o,0,e.format,r.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(iL),sL={scaleMode:NP.NEAREST,format:MP.RGBA,alphaMode:GP.NPM},aL=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null);var n=t.call(this)||this,i=(r=r||{}).alphaMode,o=r.mipmap,s=r.anisotropicLevel,a=r.scaleMode,u=r.width,c=r.height,h=r.wrapMode,l=r.format,d=r.type,f=r.target,p=r.resolution,v=r.resourceOptions;return!e||e instanceof iL||((e=tL(e,v)).internal=!0),n.resolution=p||vA.RESOLUTION,n.width=Math.round((u||0)*n.resolution)/n.resolution,n.height=Math.round((c||0)*n.resolution)/n.resolution,n._mipmap=void 0!==o?o:vA.MIPMAP_TEXTURES,n.anisotropicLevel=void 0!==s?s:vA.ANISOTROPIC_LEVEL,n._wrapMode=h||vA.WRAP_MODE,n._scaleMode=void 0!==a?a:vA.SCALE_MODE,n.format=l||MP.RGBA,n.type=d||LP.UNSIGNED_BYTE,n.target=f||DP.TEXTURE_2D,n.alphaMode=void 0!==i?i:GP.UNPACK,n.uid=oD(),n.touched=0,n.isPowerOfTwo=!1,n._refreshPOT(),n._glTextures={},n.dirtyId=0,n.dirtyStyleId=0,n.cacheId=null,n.valid=u>0&&c>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(e),n}return rL(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},e.prototype.setRealSize=function(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},e.prototype._refreshPOT=function(){this.isPowerOfTwo=tD(this.realWidth)&&tD(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(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},e.prototype.setResource=function(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},e.prototype.update=function(){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))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete lD[this.cacheId],delete hD[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,r,n){void 0===n&&(n=vA.STRICT_TEXTURE_CACHE);var i="string"==typeof t,o=null;if(i)o=t;else{if(!t._pixiId){var s=r&&r.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+oD()}o=t._pixiId}var a=lD[o];if(i&&n&&!a)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return a||((a=new e(t,r)).cacheId=o,e.addToCache(a,o)),a},e.fromBuffer=function(t,r,n,i){t=t||new Float32Array(r*n*4);var o=new oL(t,{width:r,height:n}),s=t instanceof Float32Array?LP.FLOAT:LP.UNSIGNED_BYTE;return new e(o,Object.assign({},sL,i||{width:r,height:n,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),lD[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),lD[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=lD[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete lD[t],e}}else if(t&&t.textureCacheIds){for(var n=0;n<t.textureCacheIds.length;++n)delete lD[t.textureCacheIds[n]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(yA),uL=function(t){function e(e,r){var n=this,i=r||{},o=i.width,s=i.height;(n=t.call(this,o,s)||this).items=[],n.itemDirtyIds=[];for(var a=0;a<e;a++){var u=new aL;n.items.push(u),n.itemDirtyIds.push(-2)}return n.length=e,n._load=null,n.baseTexture=null,n}return rL(e,t),e.prototype.initFromArray=function(t,e){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof iL?this.addResourceAt(t[r],r):this.addResourceAt(tL(t[r],e),r))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],r=e.realWidth,n=e.realHeight;return t.resize(r,n),Promise.resolve(t)})),this._load},e}(iL),cL=function(t){function e(e,r){var n,i,o=this,s=r||{},a=s.width,u=s.height;return Array.isArray(e)?(n=e,i=e.length):i=e,o=t.call(this,i,{width:a,height:u})||this,n&&o.initFromArray(n,r),o}return rL(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=DP.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,r){var n=this,i=n.length,o=n.itemDirtyIds,s=n.items,a=t.gl;r.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,i,0,e.format,r.type,null);for(var u=0;u<i;u++){var c=s[u];o[u]<c.dirtyId&&(o[u]=c.dirtyId,c.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,u,c.resource.width,c.resource.height,1,e.format,r.type,c.resource.source))}return!0},e}(uL),hL=function(t){function e(e){var r=this,n=e,i=n.naturalWidth||n.videoWidth||n.width,o=n.naturalHeight||n.videoHeight||n.height;return(r=t.call(this,i,o)||this).source=e,r.noSubImage=!1,r}return rL(e,t),e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=fD(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,n){var i=t.gl,o=e.realWidth,s=e.realHeight;if((n=n||this.source)instanceof HTMLImageElement){if(!n.complete||0===n.naturalWidth)return!1}else if(n instanceof HTMLVideoElement&&n.readyState<=1)return!1;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===GP.UNPACK),this.noSubImage||e.target!==i.TEXTURE_2D||r.width!==o||r.height!==s?(r.width=o,r.height=s,i.texImage2D(e.target,0,r.internalFormat,e.format,r.type,n)):i.texSubImage2D(i.TEXTURE_2D,0,0,0,e.format,r.type,n),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,r=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(r,n),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(iL),lL=function(t){function e(e){return t.call(this,e)||this}return rL(e,t),e.test=function(t){var e=globalThis.OffscreenCanvas;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(hL),dL=function(t){function e(r,n){var i=this,o=n||{},s=o.width,a=o.height,u=o.autoLoad,c=o.linkBaseTexture;if(r&&r.length!==e.SIDES)throw new Error("Invalid length. Got "+r.length+", expected 6");i=t.call(this,6,{width:s,height:a})||this;for(var h=0;h<e.SIDES;h++)i.items[h].target=DP.TEXTURE_CUBE_MAP_POSITIVE_X+h;return i.linkBaseTexture=!1!==c,r&&i.initFromArray(r,n),!1!==u&&i.load(),i}return rL(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=DP.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,r){if(!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)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=DP.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},e.prototype.upload=function(t,r,n){for(var i=this.itemDirtyIds,o=0;o<e.SIDES;o++){var s=this.items[o];(i[o]<s.dirtyId||n.dirtyId<r.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,n),i[o]=s.dirtyId):i[o]<-1&&(t.gl.texImage2D(s.target,0,n.internalFormat,r.realWidth,r.realHeight,0,r.format,n.type,null),i[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(uL),fL=function(t){function e(e,r){var n=this;if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;hL.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}return n=t.call(this,e)||this,!e.complete&&n._width&&n._height&&(n._width=0,n._height=0),n.url=e.src,n._process=null,n.preserveBitmap=!1,n.createBitmap=(void 0!==r.createBitmap?r.createBitmap:vA.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,n.alphaMode="number"==typeof r.alphaMode?r.alphaMode:null,n.bitmap=null,n._load=null,!1!==r.autoLoad&&n.load(),n}return rL(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,r){var n=e.source;e.url=n.src;var i=function(){e.destroyed||(n.onload=null,n.onerror=null,e.resize(n.width,n.height),e._load=null,e.createBitmap?t(e.process()):t(e))};n.complete&&n.src?i():(n.onload=i,n.onerror=function(t){r(t),e.onError.emit(t)})}))),this._load},e.prototype.process=function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);var r=globalThis.createImageBitmap,n=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:n?"cors":"no-cors"}).then((function(t){return t.blob()})).then((function(n){return r(n,0,0,e.width,e.height,{premultiplyAlpha:null===t.alphaMode||t.alphaMode===GP.UNPACK?"premultiply":"none"})})).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process},e.prototype.upload=function(e,r,n){if("number"==typeof this.alphaMode&&(r.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,n,this.bitmap),!this.preserveBitmap){var i=!0,o=r._glTextures;for(var s in o){var a=o[s];if(a!==n&&a.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(hL),pL=function(t){function e(e,r){var n=this;return r=r||{},(n=t.call(this,vA.ADAPTER.createCanvas())||this)._width=0,n._height=0,n.svg=e,n.scale=r.scale||1,n._overrideWidth=r.width,n._overrideHeight=r.height,n._resolve=null,n._crossorigin=r.crossorigin,n._load=null,!1!==r.autoLoad&&n.load(),n}return rL(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(r){if(t._resolve=function(){t.resize(t.source.width,t.source.height),r(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;hL.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(r){t._resolve&&(e.onerror=null,t.onError.emit(r))},e.onload=function(){if(t._resolve){var r=e.width,n=e.height;if(!r||!n)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var i=r*t.scale,o=n*t.scale;(t._overrideWidth||t._overrideHeight)&&(i=t._overrideWidth||t._overrideHeight/n*r,o=t._overrideHeight||t._overrideWidth/r*n),i=Math.round(i),o=Math.round(o);var s=t.source;s.width=i,s.height=o,s._pixiId="canvas_"+oD(),s.getContext("2d").drawImage(e,0,0,r,n,0,0,i,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var r=e.SVG_SIZE.exec(t),n={};return r&&(n[r[1]]=Math.round(parseFloat(r[3])),n[r[5]]=Math.round(parseFloat(r[7]))),n},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,r){return"svg"===r||"string"==typeof t&&t.startsWith("data:image/svg+xml")||"string"==typeof t&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(hL),vL=function(t){function e(r,n){var i=this;if(n=n||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];hL.crossOrigin(o,s,n.crossorigin);for(var a=0;a<r.length;++a){var u=document.createElement("source"),c=r[a],h=c.src,l=c.mime,d=(h=h||r[a]).split("?").shift().toLowerCase(),f=d.slice(d.lastIndexOf(".")+1);l=l||e.MIME_TYPES[f]||"video/"+f,u.src=h,u.type=l,o.appendChild(u)}r=o}return(i=t.call(this,r)||this).noSubImage=!0,i._autoUpdate=!0,i._isConnectedToTicker=!1,i._updateFPS=n.updateFPS||0,i._msToNextUpdate=0,i.autoPlay=!1!==n.autoPlay,i._load=null,i._resolve=null,i._onCanPlay=i._onCanPlay.bind(i),i._onError=i._onError.bind(i),!1!==n.autoLoad&&i.load(),i}return rL(e,t),e.prototype.update=function(e){if(!this.destroyed){var r=qD.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(r){t.valid?r(t):(t._resolve=r,e.load())})),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()},e.prototype._isSourceReady=function(){return this.source.readyState>2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(qD.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(qD.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var 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()},e.prototype.dispose=function(){this._isConnectedToTicker&&(qD.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(qD.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(qD.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(hL),mL=function(t){function e(e){return t.call(this,e)||this}return rL(e,t),e.test=function(t){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap},e}(hL);$D.push(fL,mL,lL,vL,pL,oL,dL,cL);var yL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rL(e,t),e.prototype.upload=function(t,e,r){var n=t.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===GP.UNPACK);var i=e.realWidth,o=e.realHeight;return r.width===i&&r.height===o?n.texSubImage2D(e.target,0,0,0,i,o,e.format,r.type,this.data):(r.width=i,r.height=o,n.texImage2D(e.target,0,r.internalFormat,i,o,0,e.format,r.type,this.data)),!0},e}(oL),gL=function(){function t(t,e){this.width=Math.round(t||100),this.height=Math.round(e||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 JD("disposeFramebuffer"),this.multisample=WP.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new aL(null,{scaleMode:NP.NEAREST,resolution:1,mipmap:BP.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new aL(new yL(null,{width:this.width,height:this.height}),{scaleMode:NP.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:BP.OFF,format:MP.DEPTH_COMPONENT,type:LP.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var n=this.colorTextures[r],i=n.resolution;n.setSize(t/i,e/i)}if(this.depthTexture){i=this.depthTexture.resolution;this.depthTexture.setSize(t/i,e/i)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),_L=function(t){function e(e){void 0===e&&(e={});var r=this;if("number"==typeof e){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];e={width:n,height:i,scaleMode:o,resolution:s}}return e.width=e.width||100,e.height=e.height||100,e.multisample=void 0!==e.multisample?e.multisample:WP.NONE,(r=t.call(this,null,e)||this).mipmap=BP.OFF,r.valid=!0,r.clearColor=[0,0,0,0],r.framebuffer=new gL(r.realWidth,r.realHeight).addColorTexture(0,r),r.framebuffer.multisample=e.multisample,r.maskStack=[],r.filterStack=[{}],r}return rL(e,t),e.prototype.resize=function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(aL),bL=function(){function t(){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)}return t.prototype.set=function(t,e,r){var n=e.width,i=e.height;if(r){var o=t.width/2/n,s=t.height/2/i,a=t.x/n+o,u=t.y/i+s;r=FD.add(r,FD.NW),this.x0=a+o*FD.uX(r),this.y0=u+s*FD.uY(r),r=FD.add(r,2),this.x1=a+o*FD.uX(r),this.y1=u+s*FD.uY(r),r=FD.add(r,2),this.x2=a+o*FD.uX(r),this.y2=u+s*FD.uY(r),r=FD.add(r,2),this.x3=a+o*FD.uX(r),this.y3=u+s*FD.uY(r)}else this.x0=t.x/n,this.y0=t.y/i,this.x1=(t.x+t.width)/n,this.y1=t.y/i,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/i,this.x3=t.x/n,this.y3=(t.y+t.height)/i;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},t.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},t}(),TL=new bL;function xL(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}var EL=function(t){function e(r,n,i,o,s,a){var u=t.call(this)||this;if(u.noFrame=!1,n||(u.noFrame=!0,n=new TD(0,0,1,1)),r instanceof e&&(r=r.baseTexture),u.baseTexture=r,u._frame=n,u.trim=o,u.valid=!1,u._uvs=TL,u.uvMatrix=null,u.orig=i||n,u._rotate=Number(s||0),!0===s)u._rotate=2;else if(u._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return u.defaultAnchor=a?new _D(a.x,a.y):new _D(0,0),u._updateID=0,u.textureCacheIds=[],r.valid?u.noFrame?r.valid&&u.onBaseTextureUpdated(r):u.frame=n:r.once("loaded",u.onBaseTextureUpdated,u),u.noFrame&&r.on("update",u.onBaseTextureUpdated,u),u}return rL(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var r=this.baseTexture.resource;r&&r.url&&hD[r.url]&&e.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,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),n=new e(this.baseTexture,!this.noFrame&&t,r,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(n._frame=t),n},e.prototype.updateUvs=function(){this._uvs===TL&&(this._uvs=new bL),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,r,n){void 0===r&&(r={}),void 0===n&&(n=vA.STRICT_TEXTURE_CACHE);var i="string"==typeof t,o=null;if(i)o=t;else if(t instanceof aL){if(!t.cacheId){var s=r&&r.pixiIdPrefix||"pixiid";t.cacheId=s+"-"+oD(),aL.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){s=r&&r.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+oD()}o=t._pixiId}var a=hD[o];if(i&&n&&!a)throw new Error('The cacheId "'+o+'" does not exist in TextureCache.');return a||t instanceof aL?!a&&t instanceof aL&&(a=new e(t),e.addToCache(a,o)):(r.resolution||(r.resolution=pD(t)),(a=new e(new aL(t,r))).baseTexture.cacheId=o,aL.addToCache(a.baseTexture,o),e.addToCache(a,o)),a},e.fromURL=function(t,r){var n=Object.assign({autoLoad:!1},null==r?void 0:r.resourceOptions),i=e.from(t,Object.assign({resourceOptions:n},r),!1),o=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):o.load().then((function(){return Promise.resolve(i)}))},e.fromBuffer=function(t,r,n,i){return new e(aL.fromBuffer(t,r,n,i))},e.fromLoader=function(t,r,n,i){var o=new aL(t,Object.assign({scaleMode:vA.SCALE_MODE,resolution:pD(r)},i)),s=o.resource;s instanceof fL&&(s.url=r);var a=new e(o);return n||(n=r),aL.addToCache(a.baseTexture,n),e.addToCache(a,n),n!==r&&(aL.addToCache(a.baseTexture,r),e.addToCache(a,r)),a.baseTexture.valid?Promise.resolve(a):new Promise((function(t){a.baseTexture.once("loaded",(function(){return t(a)}))}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),hD[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),hD[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=hD[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete hD[t],e}}else if(t&&t.textureCacheIds){for(var n=0;n<t.textureCacheIds.length;++n)hD[t.textureCacheIds[n]]===t&&delete hD[t.textureCacheIds[n]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,n=t.width,i=t.height,o=e+n>this.baseTexture.width,s=r+i>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+n+" = "+(e+n)+" > "+this.baseTexture.width,c="Y: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+c)}this.valid=n&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new aL),xL(e._EMPTY),xL(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=vA.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),e._WHITE=new e(aL.from(t)),xL(e._WHITE),xL(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(yA),SL=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return rL(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var n=this.baseTexture.resolution,i=Math.round(t*n)/n,o=Math.round(e*n)/n;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(i,o),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var r=arguments,n=[],i=1;i<arguments.length;i++)n[i-1]=r[i];return"number"==typeof t&&(aD("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:n[0],scaleMode:n[1],resolution:n[2]}),new e(new _L(t))},e}(EL),wL=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e,r){void 0===r&&(r=WP.NONE);var n=new _L(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new SL(n)},t.prototype.getOptimalTexture=function(t,e,r,n){var i;void 0===r&&(r=1),void 0===n&&(n=WP.NONE),t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?i=n>1?-n:-1:(i=((65535&(t=$M(t)))<<16|65535&(e=$M(e)))>>>0,n>1&&(i+=4294967296*n)),this.texturePool[i]||(this.texturePool[i]=[]);var o=this.texturePool[i].pop();return o||(o=this.createTexture(t,e,n)),o.filterPoolKey=i,o.setResolution(r),o},t.prototype.getFilterTexture=function(t,e,r){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||WP.NONE);return n.filterFrame=t.filterFrame,n},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var n=0;n<r.length;n++)r[n].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){for(var e in this.enableFullScreen=t.width>0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var n=0;n<r.length;n++)r[n].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},t.SCREEN_KEY=-1,t}(),RL=function(){function t(t,e,r,n,i,o,s){void 0===e&&(e=0),void 0===r&&(r=!1),void 0===n&&(n=LP.FLOAT),this.buffer=t,this.size=e,this.normalized=r,this.type=n,this.stride=i,this.start=o,this.instance=s}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,r,n,i,o){return new t(e,r,n,i,o)},t}(),CL=0,PL=function(){function t(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=CL++,this.disposeRunner=new JD("disposeBuffer")}return t.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(t.prototype,"index",{get:function(){return this.type===YP.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?YP.ELEMENT_ARRAY_BUFFER:YP.ARRAY_BUFFER},enumerable:!1,configurable:!0}),t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}(),AL={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var OL={5126:4,5123:2,5121:1},IL=0,ML={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},DL=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=IL++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new JD("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,r,n,i,o,s,a){if(void 0===r&&(r=0),void 0===n&&(n=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof PL||(e instanceof Array&&(e=new Float32Array(e)),e=new PL(e));var u=t.split("|");if(u.length>1){for(var c=0;c<u.length;c++)this.addAttribute(u[c],e,r,n,i);return this}var h=this.buffers.indexOf(e);return-1===h&&(this.buffers.push(e),h=this.buffers.length-1),this.attributes[t]=new RL(h,r,n,i,o,s,a),this.instanced=this.instanced||a,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof PL||(t instanceof Array&&(t=new Uint16Array(t)),t=new PL(t)),t.type=YP.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],r=[],n=new PL;for(t in this.attributes){var i=this.attributes[t],o=this.buffers[i.buffer];e.push(o.data),r.push(i.size*OL[i.type]/4),i.buffer=0}for(n.data=function(t,e){for(var r=0,n=0,i={},o=0;o<t.length;o++)n+=e[o],r+=t[o].length;var s=new ArrayBuffer(4*r),a=null,u=0;for(o=0;o<t.length;o++){var c=e[o],h=t[o],l=QM(h);i[l]||(i[l]=new AL[l](s)),a=i[l];for(var d=0;d<h.length;d++)a[(d/c|0)*n+u+d%c]=h[d];u+=c}return new Float32Array(s)}(e,r),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,r=0;r<this.buffers.length;r++)e.buffers[r]=new PL(this.buffers[r].data.slice(0));for(var r in this.attributes){var n=this.attributes[r];e.attributes[r]=new RL(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=YP.ELEMENT_ARRAY_BUFFER),e},t.merge=function(e){for(var r,n=new t,i=[],o=[],s=[],a=0;a<e.length;a++){r=e[a];for(var u=0;u<r.buffers.length;u++)o[u]=o[u]||0,o[u]+=r.buffers[u].data.length,s[u]=0}for(a=0;a<r.buffers.length;a++)i[a]=new(ML[QM(r.buffers[a].data)])(o[a]),n.buffers[a]=new PL(i[a]);for(a=0;a<e.length;a++){r=e[a];for(u=0;u<r.buffers.length;u++)i[u].set(r.buffers[u].data,s[u]),s[u]+=r.buffers[u].data.length}if(n.attributes=r.attributes,r.indexBuffer){n.indexBuffer=n.buffers[r.buffers.indexOf(r.indexBuffer)],n.indexBuffer.type=YP.ELEMENT_ARRAY_BUFFER;var c=0,h=0,l=0,d=0;for(a=0;a<r.buffers.length;a++)if(r.buffers[a]!==r.indexBuffer){d=a;break}for(var a in r.attributes){var f=r.attributes[a];(0|f.buffer)===d&&(h+=f.size*OL[f.type]/4)}for(a=0;a<e.length;a++){var p=e[a].indexBuffer.data;for(u=0;u<p.length;u++)n.indexBuffer.data[u+l]+=c;c+=e[a].buffers[d].data.length/h,l+=p.length}}return n},t}(),LL=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return rL(e,t),e}(DL),FL=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new PL(e.vertices),e.uvBuffer=new PL(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return rL(e,t),e.prototype.map=function(t,e){var r=0,n=0;return this.uvs[0]=r,this.uvs[1]=n,this.uvs[2]=r+e.width/t.width,this.uvs[3]=n,this.uvs[4]=r+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=r,this.uvs[7]=n+e.height/t.height,r=e.x,n=e.y,this.vertices[0]=r,this.vertices[1]=n,this.vertices[2]=r+e.width,this.vertices[3]=n,this.vertices[4]=r+e.width,this.vertices[5]=n+e.height,this.vertices[6]=r,this.vertices[7]=n+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(DL),NL=0,kL=function(){function t(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=NL++,this.static=!!e,this.ubo=!!r,t instanceof PL?(this.buffer=t,this.buffer.type=YP.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new PL(new Float32Array(1)),this.buffer.type=YP.UNIFORM_BUFFER,this.autoManage=!0))}return t.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},t.prototype.add=function(e,r,n){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new t(r,n)},t.from=function(e,r,n){return new t(e,r,n)},t.uboFrom=function(e,r){return new t(e,null==r||r,!0)},t}(),BL=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=WP.NONE,this.sourceFrame=new TD,this.destinationFrame=new TD,this.bindingSourceFrame=new TD,this.bindingDestinationFrame=new TD,this.filters=[],this.transform=null}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),GL=[new _D,new _D,new _D,new _D],UL=new CD,jL=function(){function t(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new wL,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new LL,this.quadUv=new FL,this.tempRect=new TD,this.activeState={},this.globalUniforms=new kL({outputFrame:new TD,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}return t.prototype.push=function(t,e){for(var r,n,i=this.renderer,o=this.defaultFilterStack,s=this.statePool.pop()||new BL,a=this.renderer.renderTexture,u=e[0].resolution,c=e[0].multisample,h=e[0].padding,l=e[0].autoFit,d=null===(r=e[0].legacy)||void 0===r||r,f=1;f<e.length;f++){var p=e[f];u=Math.min(u,p.resolution),c=Math.min(c,p.multisample),h=this.useMaxPadding?Math.max(h,p.padding):h+p.padding,l=l&&p.autoFit,d=d||null===(n=p.legacy)||void 0===n||n}1===o.length&&(this.defaultFilterStack[0].renderTexture=a.current),o.push(s),s.resolution=u,s.multisample=c,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(h);var v=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(UL.copyFrom(i.projection.transform).invert(),v),l?(s.sourceFrame.fit(v),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(v)||(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,u,c),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=s.sourceFrame.width,m.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,m),i.framebuffer.clear(0,0,0,0)},t.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;var n=this.globalUniforms.uniforms;n.outputFrame=e.sourceFrame,n.resolution=e.resolution;var i=n.inputSize,o=n.inputPixel,s=n.inputClamp;if(i[0]=e.destinationFrame.width,i[1]=e.destinationFrame.height,i[2]=1/i[0],i[3]=1/i[1],o[0]=Math.round(i[0]*e.resolution),o[1]=Math.round(i[1]*e.resolution),o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*i[2]-.5*o[2],s[3]=e.sourceFrame.height*i[3]-.5*o[3],e.legacy){var a=n.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,u.renderTexture,UP.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var c=e.renderTexture,h=this.getOptimalFilterTexture(c.width,c.height,e.resolution);h.filterFrame=c.filterFrame;var l=0;for(l=0;l<r.length-1;++l){1===l&&e.multisample>1&&((h=this.getOptimalFilterTexture(c.width,c.height,e.resolution)).filterFrame=c.filterFrame),r[l].apply(this,c,h,UP.CLEAR,e);var d=c;c=h,h=d}r[l].apply(this,c,u.renderTexture,UP.BLEND,e),l>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(t,e){void 0===e&&(e=UP.CLEAR);var r=this.renderer,n=r.renderTexture,i=r.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,n.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&i.stateId||this.forceClear;(e===UP.CLEAR||e===UP.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(t,e,r,n){var i=this.renderer;i.state.set(t.state),this.bindAndClear(r,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,i.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),i.geometry.bind(this.quadUv),i.geometry.draw(IP.TRIANGLES)):(i.geometry.bind(this.quad),i.geometry.draw(IP.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,n=r.sourceFrame,i=r.destinationFrame,o=e._texture.orig,s=t.set(i.width,0,0,i.height,n.x,n.y),a=e.worldTransform.copyTo(CD.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=WP.NONE),this.texturePool.getOptimalTexture(t,e,r,n)},t.prototype.getFilterTexture=function(t,e,r){if("number"==typeof t){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var i=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||WP.NONE);return i.filterFrame=t.filterFrame,i},t.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(t,e){var r=GL[0],n=GL[1],i=GL[2],o=GL[3];r.set(e.left,e.top),n.set(e.left,e.bottom),i.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(n,n),t.apply(i,i),t.apply(o,o);var s=Math.min(r.x,n.x,i.x,o.x),a=Math.min(r.y,n.y,i.y,o.y),u=Math.max(r.x,n.x,i.x,o.x),c=Math.max(r.y,n.y,i.y,o.y);e.x=s,e.y=a,e.width=u-s,e.height=c-a},t.prototype.roundFrame=function(t,e,r,n,i){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(i){var o=i.a,s=i.b,a=i.c,u=i.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?UL.copyFrom(i):UL.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.transformAABB(i,t),t.ceil(e),this.transformAABB(i.invert(),t)}},t}(),XL=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),VL=function(){function t(t){this.renderer=t,this.emptyRenderer=new XL(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=r[n]||null,t[n]&&(t[n]._batchLocation=n)},t.prototype.boundArray=function(t,e,r,n){for(var i=t.elements,o=t.ids,s=t.count,a=0,u=0;u<s;u++){var c=i[u],h=c._batchLocation;if(h>=0&&h<n&&e[h]===c)o[u]=h;else for(;a<n;){var l=e[a];if(!l||l._batchEnabled!==r||l._batchLocation!==a){o[u]=a,c._batchLocation=a,e[a]=c;break}a++}}},t.prototype.destroy=function(){this.renderer=null},t}(),HL=0,WL=function(){function t(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(t.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),t.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=HL++},t.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=HL++,this.renderer.runners.contextChange.emit(t)},t.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},t.prototype.createContext=function(t,e){var r;if(vA.PREFER_ENV>=CP.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout((function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()}),0)},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=r||!!t.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")},t}(),YL=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=WP.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},zL=new TD,ZL=function(){function t(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new gL(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new TD,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;vA.PREFER_ENV===CP.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},t.prototype.bind=function(t,e,r){void 0===r&&(r=0);var n=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,i.mipLevel=r),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,i.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o<t.colorTextures.length;o++){var s=t.colorTextures[o];this.renderer.texture.unbind(s.parentTextureArray||s)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var a=e.width>>r,u=e.height>>r,c=a/e.width;this.setViewport(e.x*c,e.y*c,a,u)}else{a=t.width>>r,u=t.height>>r;this.setViewport(0,0,a,u)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(t,e,r,n){var i=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),n=Math.round(n),i.width===r&&i.height===n&&i.x===t&&i.y===e||(i.x=t,i.y=e,i.width=r,i.height=n,this.gl.viewport(t,e,r,n))},Object.defineProperty(t.prototype,"size",{get:function(){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}},enumerable:!1,configurable:!0}),t.prototype.clear=function(t,e,r,n,i){void 0===i&&(i=AP.COLOR|AP.DEPTH);var o=this.gl;o.clearColor(t,e,r,n),o.clear(i)},t.prototype.initFramebuffer=function(t){var e=this.gl,r=new YL(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},t.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var n=t.colorTextures,i=n.length;e.drawBuffers||(i=Math.min(i,1));for(var o=0;o<i;o++){var s=n[o],a=s.parentTextureArray||s;this.renderer.texture.bind(a,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},t.prototype.updateFramebuffer=function(t,e){var r=this.gl,n=t.glFramebuffers[this.CONTEXT_UID],i=t.colorTextures,o=i.length;r.drawBuffers||(o=Math.min(o,1)),n.multisample>1&&this.canMultisampleFramebuffer(t)?(n.msaaBuffer=n.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.RGBA8,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(r.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var s=[],a=0;a<o;a++){var u=i[a],c=u.parentTextureArray||u;this.renderer.texture.bind(c,0),0===a&&n.msaaBuffer||(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,u.target,c._glTextures[this.CONTEXT_UID].texture,e),s.push(r.COLOR_ATTACHMENT0+a))}if((s.length>1&&r.drawBuffers(s),t.depthTexture)&&this.writeDepthTexture){var h=t.depthTexture;this.renderer.texture.bind(h,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?n.stencil&&(r.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,n.stencil))},t.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},t.prototype.detectSamples=function(t){var e=this.msaaSamples,r=WP.NONE;if(t<=1||null===e)return r;for(var n=0;n<e.length;n++)if(e[n]<=t){r=e[n];break}return 1===r&&(r=WP.NONE),r},t.prototype.blit=function(t,e,r){var n=this,i=n.current,o=n.renderer,s=n.gl,a=n.CONTEXT_UID;if(2===o.context.webGLVersion&&i){var u=i.glFramebuffers[a];if(u){if(!t){if(!u.msaaBuffer)return;var c=i.colorTextures[0];if(!c)return;u.blitFramebuffer||(u.blitFramebuffer=new gL(i.width,i.height),u.blitFramebuffer.addColorTexture(0,c)),(t=u.blitFramebuffer).colorTextures[0]!==c&&(t.colorTextures[0]=c,t.dirtyId++,t.dirtyFormat++),t.width===i.width&&t.height===i.height||(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}e||((e=zL).width=i.width,e.height=i.height),r||(r=e);var h=e.width===r.width&&e.height===r.height;this.bind(t),s.bindFramebuffer(s.READ_FRAMEBUFFER,u.framebuffer),s.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,s.COLOR_BUFFER_BIT,h?s.NEAREST:s.LINEAR)}}},t.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var i=this.managedFramebuffers.indexOf(t);i>=0&&this.managedFramebuffers.splice(i,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&n.deleteRenderbuffer(r.msaaBuffer),r.stencil&&n.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)},t.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.stencil=!0;var r=t.width,n=t.height,i=this.gl,o=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,o),e.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,e.multisample,i.DEPTH24_STENCIL8,r,n):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,n),e.stencil=o,i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,o)}}},t.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new TD},t.prototype.destroy=function(){this.renderer=null},t}(),JL={5126:4,5123:2,5121:1},KL=function(){function t(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var r=this.renderer.context.extensions.vertexArrayObject;vA.PREFER_ENV===CP.WEBGL_LEGACY&&(r=null),r?(t.createVertexArray=function(){return r.createVertexArrayOES()},t.bindVertexArray=function(t){return r.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return r.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var n=t.getExtension("ANGLE_instanced_arrays");n?(t.vertexAttribDivisor=function(t,e){return n.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,r,i,o){return n.drawElementsInstancedANGLE(t,e,r,i,o)},t.drawArraysInstanced=function(t,e,r,i){return n.drawArraysInstancedANGLE(t,e,r,i)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},t.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var r=this.gl,n=t.glVertexArrayObjects[this.CONTEXT_UID],i=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},i=!0);var o=n[e.program.id]||this.initGeometryVao(t,e,i);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?r.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()},t.prototype.reset=function(){this.unbind()},t.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,r=0;r<t.buffers.length;r++){var n=t.buffers[r];e.update(n)}},t.prototype.checkCompatibility=function(t,e){var r=t.attributes,n=e.attributeData;for(var i in n)if(!r[i])throw new Error('shader and geometry incompatible, geometry missing the "'+i+'" attribute')},t.prototype.getSignature=function(t,e){var r=t.attributes,n=e.attributeData,i=["g",t.id];for(var o in r)n[o]&&i.push(o,n[o].location);return i.join("-")},t.prototype.initGeometryVao=function(t,e,r){void 0===r&&(r=!0);var n=this.gl,i=this.CONTEXT_UID,o=this.renderer.buffer,s=e.program;s.glPrograms[i]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,s);var a=this.getSignature(t,s),u=t.glVertexArrayObjects[this.CONTEXT_UID],c=u[a];if(c)return u[s.id]=c,c;var h=t.buffers,l=t.attributes,d={},f={};for(var p in h)d[p]=0,f[p]=0;for(var p in l)!l[p].size&&s.attributeData[p]?l[p].size=s.attributeData[p].size:l[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[l[p].buffer]+=l[p].size*JL[l[p].type];for(var p in l){var v=l[p],m=v.size;void 0===v.stride&&(d[v.buffer]===m*JL[v.type]?v.stride=0:v.stride=d[v.buffer]),void 0===v.start&&(v.start=f[v.buffer],f[v.buffer]+=m*JL[v.type])}c=n.createVertexArray(),n.bindVertexArray(c);for(var y=0;y<h.length;y++){var g=h[y];o.bind(g),r&&g._glBuffers[i].refCount++}return this.activateVao(t,s),this._activeVao=c,u[s.id]=c,u[a]=c,c},t.prototype.disposeGeometry=function(t,e){var r;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var n=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,o=t.buffers,s=null===(r=this.renderer)||void 0===r?void 0:r.buffer;if(t.disposeRunner.remove(this),n){if(s)for(var a=0;a<o.length;a++){var u=o[a]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,0!==u.refCount||e||s.dispose(o[a],e))}if(!e)for(var c in n)if("g"===c[0]){var h=n[c];this._activeVao===h&&this.unbind(),i.deleteVertexArray(h)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)},t.prototype.activateVao=function(t,e){var r=this.gl,n=this.CONTEXT_UID,i=this.renderer.buffer,o=t.buffers,s=t.attributes;t.indexBuffer&&i.bind(t.indexBuffer);var a=null;for(var u in s){var c=s[u],h=o[c.buffer],l=h._glBuffers[n];if(e.attributeData[u]){a!==l&&(i.bind(h),a=l);var d=e.attributeData[u].location;if(r.enableVertexAttribArray(d),r.vertexAttribPointer(d,c.size,c.type||r.FLOAT,c.normalized,c.stride,c.start),c.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(d,1)}}}},t.prototype.draw=function(t,e,r,n){var i=this.gl,o=this._activeGeometry;if(o.indexBuffer){var s=o.indexBuffer.data.BYTES_PER_ELEMENT,a=2===s?i.UNSIGNED_SHORT:i.UNSIGNED_INT;2===s||4===s&&this.canUseUInt32ElementIndex?o.instanced?i.drawElementsInstanced(t,e||o.indexBuffer.data.length,a,(r||0)*s,n||1):i.drawElements(t,e||o.indexBuffer.data.length,a,(r||0)*s):console.warn("unsupported index buffer type: uint32")}else o.instanced?i.drawArraysInstanced(t,r,e||o.getSize(),n||1):i.drawArrays(t,r,e||o.getSize());return this},t.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},t.prototype.destroy=function(){this.renderer=null},t}(),qL=function(){function t(t){void 0===t&&(t=null),this.type=VP.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=vA.FILTER_MULTISAMPLE,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}return Object.defineProperty(t.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=VP.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function QL(t,e,r){var n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),n}function $L(t,e){var r=t.getShaderSource(e).split("\n").map((function(t,e){return e+": "+t})),n=t.getShaderInfoLog(e),i=n.split("\n"),o={},s=i.map((function(t){return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))})).filter((function(t){return!(!t||o[t])&&(o[t]=!0,!0)})),a=[""];s.forEach((function(t){r[t-1]="%c"+r[t-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));var u=r.join("\n");a[0]=u,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function tF(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e}function eF(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);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 tF(2*e);case"bvec3":return tF(3*e);case"bvec4":return tF(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}var rF,nF={},iF=nF;function oF(){if(!rF){rF=XP.MEDIUM;var t=function(){if(iF===nF||iF&&iF.isContextLost()){var t=vA.ADAPTER.createCanvas(),e=void 0;vA.PREFER_ENV>=CP.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),iF=e}return iF}();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);rF=e.precision?XP.HIGH:XP.MEDIUM}}return rF}function sF(t,e,r){if("precision"!==t.substring(0,9)){var n=e;return e===XP.HIGH&&r!==XP.HIGH&&(n=XP.MEDIUM),"precision "+n+" float;\n"+t}return r!==XP.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var aF={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 uF(t){return aF[t]}var cF=null,hF={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 lF(t,e){if(!cF){var r=Object.keys(hF);cF={};for(var n=0;n<r.length;++n){var i=r[n];cF[t[i]]=hF[i]}}return cF[e]}var dF=[{test:function(t){return"float"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n            if(uv["'+t+'"] !== ud["'+t+'"].value)\n            {\n                ud["'+t+'"].value = uv["'+t+'"]\n                gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n            }\n            '}},{test:function(t,e){return!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture)},code:function(t){return't = syncData.textureCount++;\n\n            renderer.texture.bind(uv["'+t+'"], t);\n\n            if(ud["'+t+'"].value !== t)\n            {\n                ud["'+t+'"].value = t;\n                gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n            }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a},code:function(t){return'\n            gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n            '},codeUbo:function(t){return"\n                var "+t+"_matrix = uv."+t+".toArray(true);\n\n                data[offset] = "+t+"_matrix[0];\n                data[offset+1] = "+t+"_matrix[1];\n                data[offset+2] = "+t+"_matrix[2];\n        \n                data[offset + 4] = "+t+"_matrix[3];\n                data[offset + 5] = "+t+"_matrix[4];\n                data[offset + 6] = "+t+"_matrix[5];\n        \n                data[offset + 8] = "+t+"_matrix[6];\n                data[offset + 9] = "+t+"_matrix[7];\n                data[offset + 10] = "+t+"_matrix[8];\n            "}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n                }'},codeUbo:function(t){return"\n                v = uv."+t+";\n\n                data[offset] = v.x;\n                data[offset+1] = v.y;\n            "}},{test:function(t){return"vec2"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n                }\n            '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n                }'},codeUbo:function(t){return"\n                    v = uv."+t+";\n\n                    data[offset] = v.x;\n                    data[offset+1] = v.y;\n                    data[offset+2] = v.width;\n                    data[offset+3] = v.height;\n                "}},{test:function(t){return"vec4"===t.type&&1===t.size&&!t.isArray},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n                }'}}],fF={float:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1f(location, v);\n    }",vec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n    }",int:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",ivec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",ivec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",ivec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",uint:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1ui(location, v);\n    }",uvec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2ui(location, v[0], v[1]);\n    }",uvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3ui(location, v[0], v[1], v[2]);\n    }",uvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n    }",bool:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1i(location, v);\n    }",bvec2:"\n    if (cv[0] != v[0] || cv[1] != v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",bvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",bvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",samplerCube:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",sampler2DArray:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }"},pF={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)"};var vF,mF=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function yF(t){for(var e="",r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var gF=0,_F={},bF=function(){function t(e,r,n){void 0===n&&(n="pixi-shader"),this.id=gF++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(n=n.replace(/\s+/g,"-"),_F[n]?(_F[n]++,n+="-"+_F[n]):_F[n]=1,this.vertexSrc="#define SHADER_NAME "+n+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+n+"\n"+this.fragmentSrc,this.vertexSrc=sF(this.vertexSrc,vA.PRECISION_VERTEX,XP.HIGH),this.fragmentSrc=sF(this.fragmentSrc,vA.PRECISION_FRAGMENT,oF())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,r,n){var i=e+r,o=cD[i];return o||(cD[i]=o=new t(e,r,n)),o},t}(),TF=function(){function t(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof kL?e:new kL(e):new kL({}),this.disposeRunner=new JD("disposeShader")}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var n=e.uniforms[r];if(n.group&&this.checkUniformExists(t,n))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,r,n){return new t(bF.from(e,r),n)},t}(),xF=function(){function t(){this.data=0,this.blendMode=OP.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==OP.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),EF=function(t){function e(r,n,i){var o=this,s=bF.from(r||e.defaultVertexSrc,n||e.defaultFragmentSrc);return(o=t.call(this,s,i)||this).padding=0,o.resolution=vA.FILTER_RESOLUTION,o.multisample=vA.FILTER_MULTISAMPLE,o.enabled=!0,o.autoFit=!0,o.state=new xF,o}return rL(e,t),e.prototype.apply=function(t,e,r,n,i){t.applyFilter(this,e,r,n)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(TF),SF=new CD,wF=function(){function t(t,e){this._texture=t,this.mapCoord=new CD,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,n=0;n<t.length;n+=2){var i=t[n],o=t[n+1];e[n]=i*r.a+o*r.c+r.tx,e[n+1]=i*r.b+o*r.d+r.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var n=e.orig,i=e.trim;i&&(SF.set(n.width/i.width,0,0,n.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(SF));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,u=this.clampOffset;return s[0]=(e._frame.x+a+u)/o.width,s[1]=(e._frame.y+a+u)/o.height,s[2]=(e._frame.x+e._frame.width-a+u)/o.width,s[3]=(e._frame.y+e._frame.height-a+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},t}(),RF=function(t){function e(e,r,n){var i=this,o=null;return"string"!=typeof e&&void 0===r&&void 0===n&&(o=e,e=void 0,r=void 0,n=void 0),(i=t.call(this,e||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n",r||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    original *= (alphaMul * masky.r * alpha * clip);\n\n    gl_FragColor = original;\n}\n",n)||this).maskSprite=o,i.maskMatrix=new CD,i}return rL(e,t),Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,e,r,n){var i=this._maskSprite,o=i._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new wF(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,i).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=i.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,e,r,n))},e}(EF),CF=function(){function t(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},t.prototype.push=function(t,e){var r=e;if(!r.isMaskData){var n=this.maskDataPool.pop()||new qL;n.pooled=!0,n.maskObject=e,r=n}var i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(i),r._colorMask=i?i._colorMask:15,r.autoDetect&&this.detect(r),r._target=t,r.type!==VP.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case VP.SCISSOR:this.renderer.scissor.push(r);break;case VP.STENCIL:this.renderer.stencil.push(r);break;case VP.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r);break;case VP.COLOR:this.pushColorMask(r)}r.type===VP.SPRITE&&this.maskStack.push(r)},t.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case VP.SCISSOR:this.renderer.scissor.pop(e);break;case VP.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case VP.SPRITE:this.popSpriteMask(e);break;case VP.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var r=this.maskStack[this.maskStack.length-1];r.type===VP.SPRITE&&r._filters&&(r._filters[0].maskSprite=r.maskObject)}}},t.prototype.detect=function(t){var e=t.maskObject;e?e.isSprite?t.type=VP.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=VP.SCISSOR:t.type=VP.STENCIL:t.type=VP.COLOR},t.prototype.pushSpriteMask=function(t){var e,r,n=t.maskObject,i=t._target,o=t._filters;o||(o=this.alphaMaskPool[this.alphaMaskIndex])||(o=this.alphaMaskPool[this.alphaMaskIndex]=[new RF]);var s,a,u=this.renderer,c=u.renderTexture;if(c.current){var h=c.current;s=t.resolution||h.resolution,a=null!==(e=t.multisample)&&void 0!==e?e:h.multisample}else s=t.resolution||u.resolution,a=null!==(r=t.multisample)&&void 0!==r?r:u.multisample;o[0].resolution=s,o[0].multisample=a,o[0].maskSprite=n;var l=i.filterArea;i.filterArea=n.getBounds(!0),u.filter.push(i,o),i.filterArea=l,t._filters||this.alphaMaskIndex++},t.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},t.prototype.pushColorMask=function(t){var e=t._colorMask,r=t._colorMask=e&t.colorMask;r!==e&&this.renderer.gl.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))},t.prototype.popColorMask=function(t){var e=t._colorMask,r=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))},t.prototype.destroy=function(){this.renderer=null},t}(),PF=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==r&&(0===n?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),AF=new CD,OF=[],IF=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=vA.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,r}return rL(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var e;if(!t._scissorRectLocal){var r=t._scissorRect,n=t.maskObject,i=this.renderer,o=i.renderTexture,s=n.getBounds(!0,null!==(e=OF.pop())&&void 0!==e?e:new TD);this.roundFrameToPixels(s,o.current?o.current.resolution:i.resolution,o.sourceFrame,o.destinationFrame,i.projection.transform),r&&s.fit(r),t._scissorRectLocal=s}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,r=t.b,n=t.c,i=t.d;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(i)>1e-4)},e.prototype.testScissor=function(t){var r=t.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(e.isMatrixRotated(r.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var n=t._scissorRectLocal;return n.width>0&&n.height>0},e.prototype.roundFrameToPixels=function(t,r,n,i,o){e.isMatrixRotated(o)||((o=o?AF.copyFrom(o):AF.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,t),t.fit(i),t.x=Math.round(t.x*r),t.y=Math.round(t.y*r),t.width=Math.round(t.width*r),t.height=Math.round(t.height*r))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;t&&OF.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(PF),MF=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=vA.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,r}return rL(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,n=t._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++;var i=t._colorMask;0!==i&&(t._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilFunc(r.EQUAL,n,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==i&&(t._colorMask=i,r.colorMask(0!=(1&i),0!=(2&i),0!=(4&i),0!=(8&i))),this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{var r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,n=r?r._colorMask:15;0!==n&&(r._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==n&&(r._colorMask=n,e.colorMask(0!=(1&n),0!=(2&n),0!=(4&n),0!=(8&n))),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(PF),DF=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new CD,this.transform=null}return t.prototype.update=function(t,e,r,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,n),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,r,n){var i=this.projectionMatrix,o=n?-1:1;i.identity(),i.a=1/e.width*2,i.d=o*(1/e.height*2),i.tx=-1-e.x*i.a,i.ty=-o-e.y*i.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),LF=new TD,FF=new TD,NF=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new TD,this.destinationFrame=new TD,this.viewportFrame=new TD}return t.prototype.bind=function(t,e,r){void 0===t&&(t=null);var n,i,o,s=this.renderer;this.current=t,t?(o=(n=t.baseTexture).resolution,e||(LF.width=t.frame.width,LF.height=t.frame.height,e=LF),r||(FF.x=t.frame.x,FF.y=t.frame.y,FF.width=e.width,FF.height=e.height,r=FF),i=n.framebuffer):(o=s.resolution,e||(LF.width=s.screen.width,LF.height=s.screen.height,e=LF),r||((r=LF).width=e.width,r.height=e.height));var a=this.viewportFrame;a.x=r.x*o,a.y=r.y*o,a.width=r.width*o,a.height=r.height*o,t||(a.y=s.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(i,a),this.renderer.projection.update(r,e,o,!i),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var r=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,i=r.width!==n.width||r.height!==n.height;if(i){var o=this.viewportFrame,s=o.x,a=o.y,u=o.width,c=o.height;s=Math.round(s),a=Math.round(a),u=Math.round(u),c=Math.round(c),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,a,u,c)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),i&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function kF(t,e,r,n,i){r.buffer.update(i)}var BF={float:"\n        data[offset] = v;\n    ",vec2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n    ",vec3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n    ",vec4:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n        data[offset+3] = v[3];\n    ",mat2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n\n        data[offset+4] = v[2];\n        data[offset+5] = v[3];\n    ",mat3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n        data[offset + 4] = v[3];\n        data[offset + 5] = v[4];\n        data[offset + 6] = v[5];\n\n        data[offset + 8] = v[6];\n        data[offset + 9] = v[7];\n        data[offset + 10] = v[8];\n    ",mat4:"\n        for(var i = 0; i < 16; i++)\n        {\n            data[offset + i] = v[i];\n        }\n    "},GF={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:32,mat3:48,mat4:64};function UF(t,e){if(!t.autoManage)return{size:0,syncFunc:kF};for(var r=function(t,e){var r=[];for(var n in t)e[n]&&r.push(e[n]);return r.sort((function(t,e){return t.index-e.index})),r}(t.uniforms,e),n=function(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),r=0,n=0,i=0,o=0;o<e.length;o++){var s=e[o];if(r=GF[s.data.type],s.data.size>1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,n%r!=0&&n<16){var a=n%r%16;n+=a,i+=a}n+r>16?(i=16*Math.ceil(i/16),s.offset=i,i+=r,n=r):(s.offset=i,n+=r,i+=r)}return{uboElements:e,size:i=16*Math.ceil(i/16)}}(r),i=n.uboElements,o=n.size,s=["\n    var v = null;\n    var v2 = null;\n    var cv = null;\n    var t = 0;\n    var gl = renderer.gl\n    var index = 0;\n    var data = buffer.data;\n    "],a=0;a<i.length;a++){for(var u=i[a],c=t.uniforms[u.data.name],h=u.data.name,l=!1,d=0;d<dF.length;d++){var f=dF[d];if(f.codeUbo&&f.test(u.data,c)){s.push("offset = "+u.offset/4+";",dF[d].codeUbo(u.data.name,c)),l=!0;break}}if(!l)if(u.data.size>1){var p=uF(u.data.type),v=Math.max(GF[u.data.type]/16,1),m=p/v,y=(4-m%4)%4;s.push("\n                cv = ud."+h+".value;\n                v = uv."+h+";\n                offset = "+u.offset/4+";\n\n                t = 0;\n\n                for(var i=0; i < "+u.data.size*v+"; i++)\n                {\n                    for(var j = 0; j < "+m+"; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += "+y+";\n                }\n\n                ")}else{var g=BF[u.data.type];s.push("\n                cv = ud."+h+".value;\n                v = uv."+h+";\n                offset = "+u.offset/4+";\n                "+g+";\n                ")}}return s.push("\n       renderer.buffer.update(buffer);\n    "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join("\n"))}}var jF=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function XF(t,e){var r=QL(t,t.VERTEX_SHADER,e.vertexSrc),n=QL(t,t.FRAGMENT_SHADER,e.fragmentSrc),i=t.createProgram();if(t.attachShader(i,r),t.attachShader(i,n),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||function(t,e,r,n){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||$L(t,r),t.getShaderParameter(n,t.COMPILE_STATUS)||$L(t,n),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,i,r,n),e.attributeData=function(t,e){for(var r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<n;i++){var o=e.getActiveAttrib(t,i);if(0!==o.name.indexOf("gl_")){var s=lF(e,o.type),a={type:s,name:o.name,size:uF(s),location:e.getAttribLocation(t,o.name)};r[o.name]=a}}return r}(i,t),e.uniformData=function(t,e){for(var r={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<n;i++){var o=e.getActiveUniform(t,i),s=o.name.replace(/\[.*?\]$/,""),a=!!o.name.match(/\[.*?\]$/),u=lF(e,o.type);r[s]={name:s,index:i,type:u,size:o.size,isArray:a,value:eF(u,o.size)}}return r}(i,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var o=Object.keys(e.attributeData);o.sort((function(t,e){return t>e?1:-1}));for(var s=0;s<o.length;s++)e.attributeData[o[s]].location=s,t.bindAttribLocation(i,s,o[s]);t.linkProgram(i)}t.deleteShader(r),t.deleteShader(n);var a={};for(var s in e.uniformData){var u=e.uniformData[s];a[s]={location:t.getUniformLocation(i,s),value:eF(u.type,u.size)}}return new jF(i,a)}var VF=0,HF={textureCount:0,uboCount:0},WF=function(){function t(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=VF++}return t.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof vF)return vF;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");vF=!0===t({a:"b"},"a","b")}catch(t){vF=!1}return vF}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},t.prototype.contextChange=function(t){this.gl=t,this.reset()},t.prototype.bind=function(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,n=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(n.program)),e||(HF.textureCount=0,HF.uboCount=0,this.syncUniformGroup(t.uniformGroup,HF)),n},t.prototype.setUniforms=function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)},t.prototype.syncUniformGroup=function(t,e){var r=this.getGlProgram();t.static&&t.dirtyId===r.uniformDirtyGroups[t.id]||(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))},t.prototype.syncUniforms=function(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)},t.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var r,n=["\n        var v = null;\n        var cv = null;\n        var cu = null;\n        var t = 0;\n        var gl = renderer.gl;\n    "];for(var i in t.uniforms){var o=e[i];if(o){for(var s=t.uniforms[i],a=!1,u=0;u<dF.length;u++)if(dF[u].test(o,s)){n.push(dF[u].code(i,s)),a=!0;break}if(!a){var c=(1!==o.size||o.isArray?pF:fF)[o.type].replace("location",'ud["'+i+'"].location');n.push('\n            cu = ud["'+i+'"];\n            cv = cu.value;\n            v = uv["'+i+'"];\n            '+c+";")}}else(null===(r=t.uniforms[i])||void 0===r?void 0:r.group)&&(t.uniforms[i].ubo?n.push("\n                        renderer.shader.syncUniformBufferGroup(uv."+i+", '"+i+"');\n                    "):n.push("\n                        renderer.shader.syncUniformGroup(uv."+i+", syncData);\n                    "))}return new Function("ud","uv","renderer","syncData",n.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},t.prototype.syncUniformBufferGroup=function(t,e){var r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;var n=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);t.buffer.update(),n(r.uniformData,t.uniforms,this.renderer,HF,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])},t.prototype.createSyncBufferGroup=function(t,e,r){var n=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var i=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,i,this.shader.uniformBindCount),this.shader.uniformBindCount++;var o=this.getSignature(t,this.shader.program.uniformData,"ubo"),s=this._uboCache[o];if(s||(s=this._uboCache[o]=UF(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(s.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=s.syncFunc,e.uniformGroups[t.id]},t.prototype.getSignature=function(t,e,r){var n=t.uniforms,i=[r+"-"];for(var o in n)i.push(o),e[o]&&i.push(e[o].type);return i.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(t){var e=this.gl,r=t.program,n=XF(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=n,n},t.prototype.reset=function(){this.program=null,this.shader=null},t.prototype.disposeShader=function(t){this.shader===t&&(this.shader=null)},t.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},t}();var YF=function(){function t(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=OP.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new xF,this.defaultState.blend=!0}return t.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[OP.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.ADD]=[t.ONE,t.ONE],e[OP.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.NONE]=[0,0],e[OP.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[OP.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[OP.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[OP.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[OP.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[OP.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[OP.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[OP.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[OP.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[OP.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[OP.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},t.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(r=0;r<this.checks.length;r++)this.checks[r](this,t)},t.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},t.prototype.setBlend=function(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},t.prototype.setOffset=function(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},t.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},t.prototype.setDepthMask=function(t){this.gl.depthMask(t)},t.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},t.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},t.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},t.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},t.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},t.prototype.updateCheck=function(t,e){var r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)},t.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},t.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},t.prototype.destroy=function(){this.gl=null},t}(),zF=function(){function t(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=vA.GC_MAX_IDLE,this.checkCountMax=vA.GC_MAX_CHECK_COUNT,this.mode=vA.GC_MODE}return t.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==jP.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,n=0;n<e.length;n++){var i=e[n];!i.framebuffer&&this.count-i.touched>this.maxIdle&&(t.destroyTexture(i,!0),e[n]=null,r=!0)}if(r){var o=0;for(n=0;n<e.length;n++)null!==e[n]&&(e[o++]=e[n]);e.length=o}},t.prototype.unload=function(t){var e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(var n=t.children.length-1;n>=0;n--)this.unload(t.children[n])},t.prototype.destroy=function(){this.renderer=null},t}();var ZF=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=LP.UNSIGNED_BYTE,this.internalFormat=MP.RGBA,this.samplerType=0},JF=function(){function t(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new aL,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){var e,r,n,i,o,s,a,u,c,h,l,d,f,p,v,m,y,g,_,b,T,x,E;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?((e={})[LP.UNSIGNED_BYTE]=((r={})[MP.RGBA]=t.RGBA8,r[MP.RGB]=t.RGB8,r[MP.RG]=t.RG8,r[MP.RED]=t.R8,r[MP.RGBA_INTEGER]=t.RGBA8UI,r[MP.RGB_INTEGER]=t.RGB8UI,r[MP.RG_INTEGER]=t.RG8UI,r[MP.RED_INTEGER]=t.R8UI,r[MP.ALPHA]=t.ALPHA,r[MP.LUMINANCE]=t.LUMINANCE,r[MP.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,r),e[LP.BYTE]=((n={})[MP.RGBA]=t.RGBA8_SNORM,n[MP.RGB]=t.RGB8_SNORM,n[MP.RG]=t.RG8_SNORM,n[MP.RED]=t.R8_SNORM,n[MP.RGBA_INTEGER]=t.RGBA8I,n[MP.RGB_INTEGER]=t.RGB8I,n[MP.RG_INTEGER]=t.RG8I,n[MP.RED_INTEGER]=t.R8I,n),e[LP.UNSIGNED_SHORT]=((i={})[MP.RGBA_INTEGER]=t.RGBA16UI,i[MP.RGB_INTEGER]=t.RGB16UI,i[MP.RG_INTEGER]=t.RG16UI,i[MP.RED_INTEGER]=t.R16UI,i[MP.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,i),e[LP.SHORT]=((o={})[MP.RGBA_INTEGER]=t.RGBA16I,o[MP.RGB_INTEGER]=t.RGB16I,o[MP.RG_INTEGER]=t.RG16I,o[MP.RED_INTEGER]=t.R16I,o),e[LP.UNSIGNED_INT]=((s={})[MP.RGBA_INTEGER]=t.RGBA32UI,s[MP.RGB_INTEGER]=t.RGB32UI,s[MP.RG_INTEGER]=t.RG32UI,s[MP.RED_INTEGER]=t.R32UI,s[MP.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,s),e[LP.INT]=((a={})[MP.RGBA_INTEGER]=t.RGBA32I,a[MP.RGB_INTEGER]=t.RGB32I,a[MP.RG_INTEGER]=t.RG32I,a[MP.RED_INTEGER]=t.R32I,a),e[LP.FLOAT]=((u={})[MP.RGBA]=t.RGBA32F,u[MP.RGB]=t.RGB32F,u[MP.RG]=t.RG32F,u[MP.RED]=t.R32F,u[MP.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,u),e[LP.HALF_FLOAT]=((c={})[MP.RGBA]=t.RGBA16F,c[MP.RGB]=t.RGB16F,c[MP.RG]=t.RG16F,c[MP.RED]=t.R16F,c),e[LP.UNSIGNED_SHORT_5_6_5]=((h={})[MP.RGB]=t.RGB565,h),e[LP.UNSIGNED_SHORT_4_4_4_4]=((l={})[MP.RGBA]=t.RGBA4,l),e[LP.UNSIGNED_SHORT_5_5_5_1]=((d={})[MP.RGBA]=t.RGB5_A1,d),e[LP.UNSIGNED_INT_2_10_10_10_REV]=((f={})[MP.RGBA]=t.RGB10_A2,f[MP.RGBA_INTEGER]=t.RGB10_A2UI,f),e[LP.UNSIGNED_INT_10F_11F_11F_REV]=((p={})[MP.RGB]=t.R11F_G11F_B10F,p),e[LP.UNSIGNED_INT_5_9_9_9_REV]=((v={})[MP.RGB]=t.RGB9_E5,v),e[LP.UNSIGNED_INT_24_8]=((m={})[MP.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,m),e[LP.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[MP.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,y),E=e):((g={})[LP.UNSIGNED_BYTE]=((_={})[MP.RGBA]=t.RGBA,_[MP.RGB]=t.RGB,_[MP.ALPHA]=t.ALPHA,_[MP.LUMINANCE]=t.LUMINANCE,_[MP.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,_),g[LP.UNSIGNED_SHORT_5_6_5]=((b={})[MP.RGB]=t.RGB,b),g[LP.UNSIGNED_SHORT_4_4_4_4]=((T={})[MP.RGBA]=t.RGBA,T),g[LP.UNSIGNED_SHORT_5_5_5_1]=((x={})[MP.RGBA]=t.RGBA,x),E=g),E}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};var n=new ZF(t.createTexture());t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new ZF(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(r=0;r<this.boundTextures.length;r++)this.bind(null,r)},t.prototype.bind=function(t,e){void 0===e&&(e=0);var r=this.gl;if((t=null==t?void 0:t.castToBaseTexture())&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var n=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,n.texture)),n.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)):n.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null},t.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},t.prototype.unbind=function(t){var e=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var n=0;n<r.length;n++)r[n]===this.unknownTexture&&this.bind(null,n)}for(n=0;n<r.length;n++)r[n]===t&&(this.currentLocation!==n&&(e.activeTexture(e.TEXTURE0+n),this.currentLocation=n),e.bindTexture(t.target,this.emptyTextures[t.target].texture),r[n]=null)},t.prototype.ensureSamplerType=function(t){var e=this,r=e.boundTextures,n=e.hasIntegerTextures,i=e.CONTEXT_UID;if(n)for(var o=t-1;o>=0;--o){var s=r[o];if(s)s._glTextures[i].samplerType!==FP.FLOAT&&this.renderer.texture.unbind(s)}},t.prototype.initTexture=function(t){var e=new ZF(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(t,e){var r,n;e.internalFormat=null!==(n=null===(r=this.internalFormats[t.type])||void 0===r?void 0:r[t.format])&&void 0!==n?n:t.format,2===this.webGLVersion&&t.type===LP.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},t.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var r=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(r,t,e))e.samplerType!==FP.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,i=t.realHeight,o=r.gl;(e.width!==n||e.height!==i||e.dirtyId<0)&&(e.width=n,e.height=i,o.texImage2D(t.target,0,e.internalFormat,n,i,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},t.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);-1!==n&&rD(this.managedTextures,n,1)}},t.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==BP.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=kP.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},t.prototype.setStyle=function(t,e){var r=this.gl;if(e.mipmap&&t.mipmap!==BP.ON_MANUAL&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===NP.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===NP.LINEAR){var i=Math.min(t.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===NP.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===NP.LINEAR?r.LINEAR:r.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),KF=new CD,qF=function(t){function e(e,r){void 0===e&&(e=PP.UNKNOWN);var n=t.call(this)||this;return r=Object.assign({},vA.RENDER_OPTIONS,r),n.options=r,n.type=e,n.screen=new TD(0,0,r.width,r.height),n.view=r.view||vA.ADAPTER.createCanvas(),n.resolution=r.resolution||vA.RESOLUTION,n.useContextAlpha=r.useContextAlpha,n.autoDensity=!!r.autoDensity,n.preserveDrawingBuffer=r.preserveDrawingBuffer,n.clearBeforeRender=r.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=r.backgroundColor||n._backgroundColor,n.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&(aD("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=r.transparent,n.backgroundAlpha=r.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return rL(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var r=this.view.width/this.resolution,n=this.view.height/this.resolution;this.screen.width=r,this.screen.height=n,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=n+"px"),this.emit("resize",r,n)},e.prototype.generateTexture=function(t,e,r,n){void 0===e&&(e={}),"number"==typeof e&&(aD("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:r,region:n});var i=e.region,o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(e,["region"]);0===(n=i||t.getLocalBounds(null,!0)).width&&(n.width=1),0===n.height&&(n.height=1);var s=SL.create(nL({width:n.width,height:n.height},o));return KF.tx=-n.x,KF.ty=-n.y,this.render(t,{renderTexture:s,clear:!1,transform:KF,skipUpdateTransform:!!t.parent}),s},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var r=this;r.plugins=null,r.type=PP.UNKNOWN,r.view=null,r.screen=null,r._tempDisplayObjectParent=null,r.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=WM(t),HM(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(yA),QF=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},$F=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this.gl,r=this.CONTEXT_UID,n=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,n.buffer)},t.prototype.bindBufferBase=function(t,e){var r=this.gl,n=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var i=t._glBuffers[n]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,i.buffer)}},t.prototype.bindBufferRange=function(t,e,r){var n=this.gl,i=this.CONTEXT_UID;r=r||0;var o=t._glBuffers[i]||this.createGLBuffer(t);n.bindBufferRange(n.UNIFORM_BUFFER,e||0,o.buffer,256*r,256)},t.prototype.update=function(t){var e=this.gl,r=this.CONTEXT_UID,n=t._glBuffers[r];if(t._updateID!==n.updateID)if(n.updateID=t._updateID,e.bindBuffer(t.type,n.buffer),n.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var i=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,i)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),r&&(e||n.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)},t.prototype.createGLBuffer=function(t){var e=this.CONTEXT_UID,r=this.gl;return t._glBuffers[e]=new QF(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]},t}(),tN=function(t){function e(r){var n=t.call(this,PP.WEBGL,r)||this;return r=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new JD("destroy"),contextChange:new JD("contextChange"),reset:new JD("reset"),update:new JD("update"),postrender:new JD("postrender"),prerender:new JD("prerender"),resize:new JD("resize")},n.runners.contextChange.add(n),n.globalUniforms=new kL({projectionMatrix:new CD},!0),n.addSystem(CF,"mask").addSystem(WL,"context").addSystem(YF,"state").addSystem(WF,"shader").addSystem(JF,"texture").addSystem($F,"buffer").addSystem(KL,"geometry").addSystem(ZL,"framebuffer").addSystem(IF,"scissor").addSystem(MF,"stencil").addSystem(DF,"projection").addSystem(zF,"textureGC").addSystem(jL,"filter").addSystem(NF,"renderTexture").addSystem(VL,"batch"),n.initPlugins(e.__plugins),n.multisample=void 0,r.context?n.context.initFromContext(r.context):n.context.initFromOptions({alpha:!!n.useContextAlpha,antialias:r.antialias,premultipliedAlpha:n.useContextAlpha&&"notMultiplied"!==n.useContextAlpha,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,XM(2===n.context.webGLVersion?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return rL(e,t),e.create=function(t){if(void 0===UM&&(UM=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:vA.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!vA.ADAPTER.getWebGLRenderingContext())return!1;var e=vA.ADAPTER.createCanvas(),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!(!r||!r.getContextAttributes().stencil);if(r){var i=r.getExtension("WEBGL_lose_context");i&&i.loseContext()}return r=null,n}catch(t){return!1}}()),UM)return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,e=this.gl;if(1===this.context.webGLVersion){var r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=WP.HIGH?this.multisample=WP.HIGH:t>=WP.MEDIUM?this.multisample=WP.MEDIUM:t>=WP.LOW?this.multisample=WP.LOW:this.multisample=WP.NONE},e.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var n in this[e]=r,this.runners)this.runners[n].add(r);return this},e.prototype.render=function(t,e){var r,n,i,o;if(e&&(e instanceof SL?(aD("6.0.0","Renderer#render arguments changed, use options instead."),r=e,n=arguments[2],i=arguments[3],o=arguments[4]):(r=e.renderTexture,n=e.clear,i=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(e,r,n,i){void 0===r&&(r={});var o=t.prototype.generateTexture.call(this,e,r,n,i);return this.framebuffer.blit(),o},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return aD("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,e){aD("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),ZD.add({name:t,type:HD.RendererPlugin,ref:e})},e.__plugins={},e}(qF);function eN(t){return tN.create(t)}ZD.handleByMap(HD.RendererPlugin,tN.__plugins);var rN="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n",nN=function(){this.texArray=null,this.blend=0,this.type=IP.TRIANGLES,this.start=0,this.size=0,this.data=null},iN=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),oN=function(){function t(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),sN=function(t){function e(e){var r=t.call(this,e)||this;return r.shaderGenerator=null,r.geometryClass=null,r.vertexSize=null,r.state=xF.for2d(),r.size=4*vA.SPRITE_BATCH_SIZE,r._vertexCount=0,r._indexCount=0,r._bufferedElements=[],r._bufferedTextures=[],r._bufferSize=0,r._shader=null,r._packedGeometries=[],r._packedGeometryPoolSize=2,r._flushId=0,r._aBuffers={},r._iBuffers={},r.MAX_TEXTURES=1,r.renderer.on("prerender",r.onPrerender,r),e.runners.contextChange.add(r),r._dcIndex=0,r._aIndex=0,r._iIndex=0,r._attributeBuffer=null,r._indexBuffer=null,r._tempBoundTextures=[],r}return rL(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;vA.PREFER_ENV===CP.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),vA.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var n=mF.replace(/%forloop%/gi,yF(t));if(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,r=e._textureArrayPool,n=this.size/4,i=Math.floor(n/this.MAX_TEXTURES)+1;t.length<n;)t.push(new nN);for(;r.length<i;)r.push(new iN);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(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)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,r=this.MAX_TEXTURES,n=e._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++aL._globalBatch,u=0,c=n[0],h=0;i.copyBoundTextures(o,r);for(var l=0;l<this._bufferSize;++l){var d=t[l];t[l]=null,d._batchEnabled!==a&&(c.count>=r&&(i.boundArray(c,o,a,r),this.buildDrawCalls(c,h,l),h=l,c=n[++u],++a),d._batchEnabled=a,d.touched=s,c.elements[c.count++]=d)}c.count>0&&(i.boundArray(c,o,a,r),this.buildDrawCalls(c,h,this._bufferSize),++u,++a);for(l=0;l<o.length;l++)o[l]=null;aL._globalBatch=a},e.prototype.buildDrawCalls=function(t,r,n){var i=this,o=i._bufferedElements,s=i._attributeBuffer,a=i._indexBuffer,u=i.vertexSize,c=e._drawCallPool,h=this._dcIndex,l=this._aIndex,d=this._iIndex,f=c[h];f.start=this._iIndex,f.texArray=t;for(var p=r;p<n;++p){var v=o[p],m=v._texture.baseTexture,y=ZM[m.alphaMode?1:0][v.blendMode];o[p]=null,r<p&&f.blend!==y&&(f.size=d-f.start,r=p,(f=c[++h]).texArray=t,f.start=d),this.packInterleavedGeometry(v,s,a,l,d),l+=v.vertexData.length/2*u,d+=v.indices.length,f.blend=y}r<n&&(f.size=d-f.start,++h),this._dcIndex=h,this._aIndex=l,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,e=t._packedGeometries,r=t._attributeBuffer,n=t._indexBuffer;vA.CAN_UPLOAD_SAME_BUFFER?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(n),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(n),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,r=this.renderer,n=r.gl,i=r.state,o=e._drawCallPool,s=null,a=0;a<t;a++){var u=o[a],c=u.texArray,h=u.type,l=u.size,d=u.start,f=u.blend;s!==c&&(s=c,this.bindAndClearTexArray(c)),this.state.blendMode=f,i.set(this.state),n.drawElements(h,l,n.UNSIGNED_SHORT,2*d)}},e.prototype.flush=function(){0!==this._vertexCount&&(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)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),vA.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].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),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=$M(Math.ceil(t/8)),r=eD(e),n=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);var i=this._aBuffers[n];return i||(this._aBuffers[n]=i=new oN(n*this.vertexSize*4)),i},e.prototype.getIndexBuffer=function(t){var e=$M(Math.ceil(t/12)),r=eD(e),n=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);var i=this._iBuffers[r];return i||(this._iBuffers[r]=i=new Uint16Array(n)),i},e.prototype.packInterleavedGeometry=function(t,e,r,n,i){for(var o=e.uint32View,s=e.float32View,a=n/this.vertexSize,u=t.uvs,c=t.indices,h=t.vertexData,l=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),f=d<1&&t._texture.baseTexture.alphaMode?KM(t._tintRGB,d):t._tintRGB+(255*d<<24),p=0;p<h.length;p+=2)s[n++]=h[p],s[n++]=h[p+1],s[n++]=u[p],s[n++]=u[p+1],o[n++]=f,s[n++]=l;for(p=0;p<c.length;p++)r[i++]=a+c[p]},e._drawCallPool=[],e._textureArrayPool=[],e}(XL),aN=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=kL.from({uSamplers:e},!0);var n=this.fragTemplate;n=(n=n.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new bF(this.vertexSrc,n)}var i={tint:new Float32Array([1,1,1,1]),translationMatrix:new CD,default:this.defaultGroupCache[t]};return new TF(this.programCache[t],i)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},t}(),uN=function(t){function e(e){void 0===e&&(e=!1);var r=t.call(this)||this;return r._buffer=new PL(null,e,!1),r._indexBuffer=new PL(null,e,!0),r.addAttribute("aVertexPosition",r._buffer,2,!1,LP.FLOAT).addAttribute("aTextureCoord",r._buffer,2,!1,LP.FLOAT).addAttribute("aColor",r._buffer,4,!0,LP.UNSIGNED_BYTE).addAttribute("aTextureId",r._buffer,1,!0,LP.FLOAT).addIndex(r._indexBuffer),r}return rL(e,t),e}(DL),cN="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor * tint;\n}\n",hN="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n    vec4 color;\n    %forloop%\n    gl_FragColor = color * vColor;\n}\n",lN=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:cN,fragment:hN,geometryClass:uN,vertexSize:6},t),r=e.vertex,n=e.fragment,i=e.vertexSize,o=e.geometryClass;return function(t){function e(e){var s=t.call(this,e)||this;return s.shaderGenerator=new aN(r,n),s.geometryClass=o,s.vertexSize=i,s}return rL(e,t),e}(sN)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return cN},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return hN},enumerable:!1,configurable:!0}),t}(),dN=lN.create();Object.assign(dN,{extension:{name:"batch",type:HD.RendererPlugin}});UD.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var fN=function(){function t(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(pA.tablet||pA.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.prototype.activate=function(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(t=this.renderer.view.parentNode)||void 0===t||t.appendChild(this.div))},t.prototype.deactivate=function(){var t;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(t=this.div.parentNode)||void 0===t||t.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var r=0;r<e.length;r++)this.updateAccessibleObjects(e[r])}},t.prototype.update=function(){var t=performance.now();if(!(pA.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),r=e.left,n=e.top,i=e.width,o=e.height,s=this.renderer,a=s.width,u=s.height,c=s.resolution,h=i/a*c,l=o/u*c,d=this.div;d.style.left=r+"px",d.style.top=n+"px",d.style.width=a+"px",d.style.height=u+"px";for(var f=0;f<this.children.length;f++){var p=this.children[f];if(p.renderId!==this.renderId)p._accessibleActive=!1,rD(this.children,f,1),this.div.removeChild(p._accessibleDiv),this.pool.push(p._accessibleDiv),p._accessibleDiv=null,f--;else{d=p._accessibleDiv;var v=p.hitArea,m=p.worldTransform;p.hitArea?(d.style.left=(m.tx+v.x*m.a)*h+"px",d.style.top=(m.ty+v.y*m.d)*l+"px",d.style.width=v.width*m.a*h+"px",d.style.height=v.height*m.d*l+"px"):(v=p.getBounds(),this.capHitArea(v),d.style.left=v.x*h+"px",d.style.top=v.y*l+"px",d.style.width=v.width*h+"px",d.style.height=v.height*l+"px",d.title!==p.accessibleTitle&&null!==p.accessibleTitle&&(d.title=p.accessibleTitle),d.getAttribute("aria-label")!==p.accessibleHint&&null!==p.accessibleHint&&d.setAttribute("aria-label",p.accessibleHint)),p.accessibleTitle===d.title&&p.tabIndex===d.tabIndex||(d.title=p.accessibleTitle,d.tabIndex=p.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},t.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,r=e.width,n=e.height;t.x+t.width>r&&(t.width=r-t.x),t.y+t.height>n&&(t.height=n-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,r=t.target.displayObject,n=e.eventData;e.dispatchEvent(r,"click",n),e.dispatchEvent(r,"pointertap",n),e.dispatchEvent(r,"tap",n)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,r=t.target.displayObject,n=e.eventData;e.dispatchEvent(r,"mouseover",n)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,r=t.target.displayObject,n=e.eventData;e.dispatchEvent(r,"mouseout",n)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t.extension={name:"accessibility",type:[HD.RendererPlugin,HD.CanvasRendererPlugin]},t}(),pN=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new _D,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),vN=function(t,e){return vN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},vN(t,e)};var mN=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),yN=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),gN=function(){function t(){this._tempPoint=new _D}return t.prototype.recursiveFindHit=function(t,e,r,n,i){var o;if(!e||!e.visible)return!1;var s=t.data.global,a=!1,u=i=e.interactive||i,c=!0;if(e.hitArea)n&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(n=!1,c=!1)),u=!1;else if(e._mask&&n){var h=e._mask.isMaskData?e._mask.maskObject:e._mask;h&&!(null===(o=h.containsPoint)||void 0===o?void 0:o.call(h,s))&&(n=!1)}if(c&&e.interactiveChildren&&e.children)for(var l=e.children,d=l.length-1;d>=0;d--){var f=l[d],p=this.recursiveFindHit(t,f,r,n,u);if(p){if(!f.parent)continue;u=!1,p&&(t.target&&(n=!1),a=!0)}}return i&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),r&&r(t,e,!!a))),a},t.prototype.findHit=function(t,e,r,n){this.recursiveFindHit(t,e,r,n,!1)},t}(),_N={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};UD.mixin(_N);var bN={target:null,data:{global:null}},TN=function(t){function e(e,r){var n=t.call(this)||this;return r=r||{},n.renderer=e,n.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,n.interactionFrequency=r.interactionFrequency||10,n.mouse=new pN,n.mouse.identifier=1,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[1]=n.mouse,n.interactionDataPool=[],n.eventData=new mN,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new gN,n._tempDisplayObject=new jD,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(t,e){function r(){this.constructor=t}vN(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return bN.target=null,bN.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(bN,e,null,!0),bN.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(qD.system.add(this.tickerUpdate,this,YD.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(qD.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var r=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(r,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var e=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(e=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.interactionDOMElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.interactionDOMElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,r){r.stopPropagationHint&&t!==r.stopsPropagatingAt||(r.currentTarget=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},e.prototype.delayDispatchEvent=function(t,e,r){this.delayedEvents.push({displayObject:t,eventString:e,eventData:r})},e.prototype.mapPositionToPoint=function(t,e,r){var n;n=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var i=1/this.resolution;t.x=(e-n.left)*(this.interactionDOMElement.width/n.width)*i,t.y=(r-n.top)*(this.interactionDOMElement.height/n.height)*i},e.prototype.processInteractive=function(t,e,r,n){var i=this.search.findHit(t,e,r,n),o=this.delayedEvents;if(!o.length)return i;t.stopPropagationHint=!1;var s=o.length;this.delayedEvents=[];for(var a=0;a<s;a++){var u=o[a],c=u.displayObject,h=u.eventString,l=u.eventData;l.stopsPropagatingAt===c&&(l.stopPropagationHint=!0),this.dispatchEvent(c,h,l)}return i},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,n=0;n<r;n++){var i=e[n],o=this.getInteractionDataForPointerId(i),s=this.configureInteractionEventForDOMEvent(this.eventData,i,o);if(s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===i.pointerType)this.emit("touchstart",s);else if("mouse"===i.pointerType||"pen"===i.pointerType){var a=2===i.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,r){var n=t.data,i=t.data.identifier;if(r)if(e.trackedPointers[i]||(e.trackedPointers[i]=new yN(i)),this.dispatchEvent(e,"pointerdown",t),"touch"===n.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===n.pointerType||"pen"===n.pointerType){var o=2===n.button;o?e.trackedPointers[i].rightDown=!0:e.trackedPointers[i].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,r){var n=this.normalizeToPointerData(t),i=n.length,o=t.target;t.composedPath&&t.composedPath().length>0&&(o=t.composedPath()[0]);for(var s=o!==this.interactionDOMElement?"outside":"",a=0;a<i;a++){var u=n[a],c=this.getInteractionDataForPointerId(u),h=this.configureInteractionEventForDOMEvent(this.eventData,u,c);if(h.data.originalEvent=t,this.processInteractive(h,this.lastObjectRendered,r,e||!s),this.emit(e?"pointercancel":"pointerup"+s,h),"mouse"===u.pointerType||"pen"===u.pointerType){var l=2===u.button;this.emit(l?"rightup"+s:"mouseup"+s,h)}else"touch"===u.pointerType&&(this.emit(e?"touchcancel":"touchend"+s,h),this.releaseInteractionDataForPointerId(u.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var r=t.data,n=t.data.identifier;void 0!==e.trackedPointers[n]&&(delete e.trackedPointers[n],this.dispatchEvent(e,"pointercancel",t),"touch"===r.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,r){var n=t.data,i=t.data.identifier,o=e.trackedPointers[i],s="touch"===n.pointerType,a="mouse"===n.pointerType||"pen"===n.pointerType,u=!1;if(a){var c=2===n.button,h=yN.FLAGS,l=c?h.RIGHT_DOWN:h.LEFT_DOWN,d=void 0!==o&&o.flags&l;r?(this.dispatchEvent(e,c?"rightup":"mouseup",t),d&&(this.dispatchEvent(e,c?"rightclick":"click",t),u=!0)):d&&this.dispatchEvent(e,c?"rightupoutside":"mouseupoutside",t),o&&(c?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!u||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[i]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var r=e.length,n=0;n<r;n++){var i=e[n],o=this.getInteractionDataForPointerId(i),s=this.configureInteractionEventForDOMEvent(this.eventData,i,o);s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",s),"touch"===i.pointerType&&this.emit("touchmove",s),"mouse"!==i.pointerType&&"pen"!==i.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,r){var n=t.data,i="touch"===n.pointerType,o="mouse"===n.pointerType||"pen"===n.pointerType;o&&this.processPointerOverOut(t,e,r),this.moveWhenInside&&!r||(this.dispatchEvent(e,"pointermove",t),i&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(e),n=this.configureInteractionEventForDOMEvent(this.eventData,e,r);n.data.originalEvent=e,this.processInteractive(n,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",n),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",n):this.releaseInteractionDataForPointerId(r.identifier)}},e.prototype.processPointerOverOut=function(t,e,r){var n=t.data,i=t.data.identifier,o="mouse"===n.pointerType||"pen"===n.pointerType,s=e.trackedPointers[i];r&&!s&&(s=e.trackedPointers[i]=new yN(i)),void 0!==s&&(r&&this.mouseOverRenderer?(s.over||(s.over=!0,this.delayDispatchEvent(e,"pointerover",t),o&&this.delayDispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[i]))},e.prototype.onPointerOver=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0],r=this.getInteractionDataForPointerId(e),n=this.configureInteractionEventForDOMEvent(this.eventData,e,r);n.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",n),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",n)}},e.prototype.getInteractionDataForPointerId=function(t){var e,r=t.pointerId;return 1===r||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[r]?e=this.activeInteractionData[r]:((e=this.interactionDataPool.pop()||new pN).identifier=r,this.activeInteractionData[r]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,r){return t.data=r,this.mapPositionToPoint(r.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=r.global.x,e.globalY=r.global.y),r.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var r=0,n=t.changedTouches.length;r<n;r++){var i=t.changedTouches[r];void 0===i.button&&(i.button=t.touches.length?1:0),void 0===i.buttons&&(i.buttons=t.touches.length?1:0),void 0===i.isPrimary&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===i.width&&(i.width=i.radiusX||1),void 0===i.height&&(i.height=i.radiusY||1),void 0===i.tiltX&&(i.tiltX=0),void 0===i.tiltY&&(i.tiltY=0),void 0===i.pointerType&&(i.pointerType="touch"),void 0===i.pointerId&&(i.pointerId=i.identifier||0),void 0===i.pressure&&(i.pressure=i.force||.5),void 0===i.twist&&(i.twist=0),void 0===i.tangentialPressure&&(i.tangentialPressure=0),void 0===i.layerX&&(i.layerX=i.offsetX=i.clientX),void 0===i.layerY&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,e.push(i)}else if(globalThis.MouseEvent&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof globalThis.PointerEvent))e.push(t);else{var o=t;void 0===o.isPrimary&&(o.isPrimary=!0),void 0===o.width&&(o.width=1),void 0===o.height&&(o.height=1),void 0===o.tiltX&&(o.tiltX=0),void 0===o.tiltY&&(o.tiltY=0),void 0===o.pointerType&&(o.pointerType="mouse"),void 0===o.pointerId&&(o.pointerId=1),void 0===o.pressure&&(o.pressure=.5),void 0===o.twist&&(o.twist=0),void 0===o.tangentialPressure&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}return e},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e.extension={name:"interaction",type:[HD.RendererPlugin,HD.CanvasRendererPlugin]},e}(yA),xN=new TD,EN=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,r){var n=new Image;return n.src=this.base64(t,e,r),n},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(e,r){var n=this._rawPixels(e,r),i=n.pixels,o=n.width,s=n.height,a=n.flipY,u=new dD(o,s,1),c=u.context.getImageData(0,0,o,s);if(t.arrayPostDivide(i,c.data),u.context.putImageData(c,0,0),a){var h=new dD(u.width,u.height,1);h.context.scale(1,-1),h.context.drawImage(u.canvas,0,-s),u.destroy(),u=h}return u.canvas},t.prototype.pixels=function(e,r){var n=this._rawPixels(e,r).pixels;return t.arrayPostDivide(n,n),n},t.prototype._rawPixels=function(t,e){var r,n,i=this.renderer,o=!1,s=!1;if(t)if(t instanceof SL)n=t;else{var a=i.context.webGLVersion>=2?i.multisample:WP.NONE;if(n=this.renderer.generateTexture(t,{multisample:a}),a!==WP.NONE){var u=SL.create({width:n.width,height:n.height});i.framebuffer.bind(n.framebuffer),i.framebuffer.blit(u.framebuffer),i.framebuffer.bind(null),n.destroy(!0),n=u}s=!0}n?(r=n.baseTexture.resolution,e=null!=e?e:n.frame,o=!1,i.renderTexture.bind(n)):(r=i.resolution,e||((e=xN).width=i.width,e.height=i.height),o=!0,i.renderTexture.bind(null));var c=Math.round(e.width*r),h=Math.round(e.height*r),l=new Uint8Array(4*c*h),d=i.gl;return d.readPixels(Math.round(e.x*r),Math.round(e.y*r),c,h,d.RGBA,d.UNSIGNED_BYTE,l),s&&n.destroy(!0),{pixels:l,width:c,height:h,flipY:o}},t.prototype.destroy=function(){this.renderer=null},t.arrayPostDivide=function(t,e){for(var r=0;r<t.length;r+=4){var n=e[r+3]=t[r+3];0!==n?(e[r]=Math.round(Math.min(255*t[r]/n,255)),e[r+1]=Math.round(Math.min(255*t[r+1]/n,255)),e[r+2]=Math.round(Math.min(255*t[r+2]/n,255))):(e[r]=t[r],e[r+1]=t[r+1],e[r+2]=t[r+2])}},t.extension={name:"extract",type:HD.RendererPlugin},t}(),SN=function(){function t(t,e,r){void 0===e&&(e=!1),this._fn=t,this._once=e,this._thisArg=r,this._next=this._prev=this._owner=null}return t.prototype.detach=function(){return null!==this._owner&&(this._owner.detach(this),!0)},t}();function wN(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var RN,CN=function(){function t(){this._head=this._tail=void 0}return t.prototype.handlers=function(t){void 0===t&&(t=!1);var e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r},t.prototype.has=function(t){if(!(t instanceof SN))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},t.prototype.dispatch=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var n=this._head;if(!n)return!1;for(;n;)n._once&&this.detach(n),n._fn.apply(n._thisArg,e),n=n._next;return!0},t.prototype.add=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return wN(this,new SN(t,!1,e))},t.prototype.once=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return wN(this,new SN(t,!0,e))},t.prototype.detach=function(t){if(!(t instanceof SN))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this},t.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},t}();function PN(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},n=r.parser[e.strictMode?"strict":"loose"].exec(t),i={},o=14;o--;)i[r.key[o]]=n[o]||"";return i[r.q.name]={},i[r.key[12]].replace(r.q.parser,(function(t,e,n){e&&(i[r.q.name][e]=n)})),i}var AN=null;function ON(){}function IN(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function MN(t){return t.toString().replace("object ","")}var DN=function(){function t(e,r,n){if(this._dequeue=ON,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,"string"!=typeof e||"string"!=typeof r)throw new Error("Both name and url are required for constructing a resource.");n=n||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===r.indexOf("data:")),this.name=e,this.url=r,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===n.crossOrigin?"anonymous":n.crossOrigin,this.timeout=n.timeout||0,this.loadType=n.loadType||this._determineLoadType(),this.xhrType=n.xhrType,this.metadata=n.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=ON,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new CN,this.onProgress=new CN,this.onComplete=new CN,this.onAfterMiddleware=new CN}return t.setExtensionLoadType=function(e,r){IN(t._loadTypeMap,e,r)},t.setExtensionXhrType=function(e,r){IN(t._xhrTypeMap,e,r)},Object.defineProperty(t.prototype,"isDataUrl",{get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isComplete",{get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(e){var r=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout((function(){return e(r)}),1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:void 0===RN&&(RN=!(!globalThis.XDomainRequest||"withCredentials"in new XMLHttpRequest)),RN&&this.crossOrigin?this._loadXdr():this._loadXhr()}},t.prototype._hasFlag=function(t){return 0!=(this._flags&t)},t.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==globalThis.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==globalThis.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{e=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},t.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;"use-credentials"===this.crossOrigin&&(e.withCredentials=!0),e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},t.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new globalThis.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){return t.send()}),1)},t.prototype._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var n=document.createElement("source");return n.src=e,n.type=r,n},t.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},t.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var t=this.xhr;this.abort(MN(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},t.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(MN(t)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(MN(t)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var e=this.xhr,r="",n=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(r=e.responseText),0===n&&(r.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?n=200:1223===n&&(n=204),2===(n/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var i=new DOMParser;this.data=i.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,AN||(AN=document.createElement("a")),AN.href=t;var r=PN(AN.href,{strictMode:!0}),n=!r.port&&""===e.port||r.port===e.port,i=r.protocol?r.protocol+":":"";return r.host===e.hostname&&n&&i===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var n=t.indexOf("?"),i=t.indexOf("#"),o=Math.min(n>-1?n:t.length,i>-1?i:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}();function LN(){}function FN(t){return function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];if(null===t)throw new Error("Callback was already called.");var i=t;t=null,i.apply(this,r)}}!function(t){var e,r,n,i;(e=t.STATUS_FLAGS||(t.STATUS_FLAGS={}))[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING",(r=t.TYPE||(t.TYPE={}))[r.UNKNOWN=0]="UNKNOWN",r[r.JSON=1]="JSON",r[r.XML=2]="XML",r[r.IMAGE=3]="IMAGE",r[r.AUDIO=4]="AUDIO",r[r.VIDEO=5]="VIDEO",r[r.TEXT=6]="TEXT",(n=t.LOAD_TYPE||(t.LOAD_TYPE={}))[n.XHR=1]="XHR",n[n.IMAGE=2]="IMAGE",n[n.AUDIO=3]="AUDIO",n[n.VIDEO=4]="VIDEO",(i=t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})).DEFAULT="text",i.BUFFER="arraybuffer",i.BLOB="blob",i.DOCUMENT="document",i.JSON="json",i.TEXT="text",t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,avif:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,avif:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(DN||(DN={}));var NN=function(t,e){this.data=t,this.callback=e},kN=function(){function t(t,e){var r=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=LN,this.unsaturated=LN,this.empty=LN,this.drain=LN,this.error=LN,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,n){if(n&&"function"!=typeof n)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout((function(){return r.drain()}),1);else{var i=new NN(t,"function"==typeof n?n:LN);e?r._tasks.unshift(i):r._tasks.push(i),setTimeout(r.process,1)}},this.process=function(){for(;!r.paused&&r.workers<r.concurrency&&r._tasks.length;){var t=r._tasks.shift();0===r._tasks.length&&r.empty(),r.workers+=1,r.workers===r.concurrency&&r.saturated(),r._worker(t.data,FN(r._next(t)))}},this._worker=t,0===e)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return t.prototype._next=function(t){var e=this;return function(){for(var r=arguments,n=[],i=0;i<arguments.length;i++)n[i]=r[i];e.workers-=1,t.callback.apply(t,n),null!=n[0]&&e.error(n[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},t.prototype.push=function(t,e){this._insert(t,!1,e)},t.prototype.kill=function(){this.workers=0,this.drain=LN,this.started=!1,this._tasks=[]},t.prototype.unshift=function(t,e){this._insert(t,!0,e)},t.prototype.length=function(){return this._tasks.length},t.prototype.running=function(){return this.workers},t.prototype.idle=function(){return this._tasks.length+this.workers===0},t.prototype.pause=function(){!0!==this.paused&&(this.paused=!0)},t.prototype.resume=function(){if(!1!==this.paused){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},t.eachSeries=function(t,e,r,n){var i=0,o=t.length;!function s(a){a||i===o?r&&r(a):n?setTimeout((function(){e(t[i++],s)}),1):e(t[i++],s)}()},t.queue=function(e,r){return new t(e,r)},t}(),BN=/(#[\w-]+)?$/,GN=function(){function t(e,r){var n=this;void 0===e&&(e=""),void 0===r&&(r=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return n._loadResource(t,e)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return n._loadResource(t,e)},this._queue=kN.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new CN,this.onError=new CN,this.onLoad=new CN,this.onStart=new CN,this.onComplete=new CN;for(var i=0;i<t._plugins.length;++i){var o=t._plugins[i],s=o.pre,a=o.use;s&&this.pre(s),a&&this.use(a)}this._protected=!1}return t.prototype._add=function(t,e,r,n){if(this.loading&&(!r||!r.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new DN(t,e,r),"function"==typeof n&&this.resources[t].onAfterMiddleware.once(n),this.loading){for(var i=r.parentResource,o=[],s=0;s<i.children.length;++s)i.children[s].isComplete||o.push(i.children[s]);var a=i.progressChunk*(o.length+1)/(o.length+2);i.children.push(this.resources[t]),i.progressChunk=a;for(s=0;s<o.length;++s)o[s].progressChunk=a;this.resources[t].progressChunk=a}return this._queue.push(this.resources[t]),this},t.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},t.prototype.use=function(t){return this._afterMiddleware.push(t),this},t.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},t.prototype.load=function(t){if(aD("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),"function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},Object.defineProperty(t.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),t.prototype._prepareUrl=function(t){var e,r=PN(t,{strictMode:!0});if(e=r.protocol||!r.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var n=BN.exec(e)[0];-1!==(e=e.slice(0,e.length-n.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=n}return e},t.prototype._loadResource=function(t,e){var r=this;t._dequeue=e,kN.eachSeries(this._beforeMiddleware,(function(e,n){e.call(r,t,(function(){n(t.isComplete?{}:null)}))}),(function(){t.isComplete?r._onLoad(t):(t._onLoadBinding=t.onComplete.once(r._onLoad,r),t.load())}),!0)},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),kN.eachSeries(this._afterMiddleware,(function(r,n){r.call(e,t,n)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},t.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(t,"shared",{get:function(){var e=t._shared;return e||((e=new t)._protected=!0,t._shared=e),e},enumerable:!1,configurable:!0}),t.registerPlugin=function(e){return aD("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),ZD.add({type:HD.Loader,ref:e}),t},t._plugins=[],t}();ZD.handleByList(HD.Loader,GN._plugins),GN.prototype.add=function(t,e,r,n){if(Array.isArray(t)){for(var i=0;i<t.length;++i)this.add(t[i]);return this}if("object"==typeof t&&(r=t,n=e||r.callback||r.onComplete,e=r.url,t=r.name||r.key||r.url),"string"!=typeof e&&(n=r,r=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");return"function"==typeof r&&(n=r,r=null),this._add(t,e,r,n)};var UN=function(){function t(){}return t.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?GN.shared:new GN},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.extension=HD.Application,t}(),jN=function(){function t(){}return t.add=function(){DN.setExtensionLoadType("svg",DN.LOAD_TYPE.XHR),DN.setExtensionXhrType("svg",DN.XHR_RESPONSE_TYPE.TEXT)},t.use=function(t,e){if(!t.data||t.type!==DN.TYPE.IMAGE&&"svg"!==t.extension)e();else{var r=t.data,n=t.url,i=t.name,o=t.metadata;EL.fromLoader(r,n,i,o).then((function(r){t.texture=r,e()})).catch(e)}},t.extension=HD.Loader,t}();function XN(t,e){if(t.data){if(t.xhr&&t.xhrType===DN.XHR_RESPONSE_TYPE.BLOB)if(self.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var r=globalThis.URL||globalThis.webkitURL,n=r.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=n,t.type=DN.TYPE.IMAGE,void(t.data.onload=function(){r.revokeObjectURL(n),t.data.onload=null,e()})}}else{var i=t.xhr.getResponseHeader("content-type");if(i&&0===i.indexOf("image"))return t.data=new Image,t.data.src="data:"+i+";base64,"+function(t){for(var e="",r=0;r<t.length;){for(var n=[0,0,0],i=[0,0,0,0],o=0;o<n.length;++o)r<t.length?n[o]=255&t.charCodeAt(r++):n[o]=0;switch(i[0]=n[0]>>2,i[1]=(3&n[0])<<4|n[1]>>4,i[2]=(15&n[1])<<2|n[2]>>6,i[3]=63&n[2],r-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o<i.length;++o)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(i[o])}return e}(t.xhr.responseText),t.type=DN.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}var VN,HN,WN=function(){function t(){}return t.extension=HD.Loader,t.use=XN,t}();ZD.add(jN,WN),function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR"}(HN||(HN={}));var YN=((VN={})[HN.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,VN[HN.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,VN[HN.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,VN[HN.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,VN[HN.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,VN[HN.COMPRESSED_R11_EAC]=.5,VN[HN.COMPRESSED_SIGNED_R11_EAC]=.5,VN[HN.COMPRESSED_RG11_EAC]=1,VN[HN.COMPRESSED_SIGNED_RG11_EAC]=1,VN[HN.COMPRESSED_RGB8_ETC2]=.5,VN[HN.COMPRESSED_RGBA8_ETC2_EAC]=1,VN[HN.COMPRESSED_SRGB8_ETC2]=.5,VN[HN.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,VN[HN.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,VN[HN.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,VN[HN.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,VN[HN.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,VN[HN.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,VN[HN.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,VN[HN.COMPRESSED_RGB_ETC1_WEBGL]=.5,VN[HN.COMPRESSED_RGB_ATC_WEBGL]=.5,VN[HN.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,VN[HN.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,VN[HN.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,VN),zN=function(t,e){return zN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},zN(t,e)};function ZN(t,e){function r(){this.constructor=t}zN(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function JN(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function KN(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var qN,QN,$N=function(t){function e(e,r){void 0===r&&(r={width:1,height:1,autoLoad:!0});var n,i,o=this;return"string"==typeof e?(n=e,i=new Uint8Array):(n=null,i=e),(o=t.call(this,i,r)||this).origin=n,o.buffer=i?new oN(i):null,o.origin&&!1!==r.autoLoad&&o.load(),i&&i.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return ZN(e,t),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return JN(this,void 0,Promise,(function(){var t;return KN(this,(function(e){switch(e.label){case 0:return[4,fetch(this.origin)];case 1:return[4,e.sent().blob()];case 2:return[4,e.sent().arrayBuffer()];case 3:return t=e.sent(),this.data=new Uint32Array(t),this.buffer=new oN(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),[2,this]}}))}))},e}(oL),tk=function(t){function e(r,n){var i=t.call(this,r,n)||this;return i.format=n.format,i.levels=n.levels||1,i._width=n.width,i._height=n.height,i._extension=e._formatToExtension(i.format),(n.levelBuffers||i.buffer)&&(i._levelBuffers=n.levelBuffers||e._createLevelBuffers(r instanceof Uint8Array?r:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return ZN(e,t),e.prototype.upload=function(t,e,r){var n=t.gl;if(!t.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var i=0,o=this.levels;i<o;i++){var s=this._levelBuffers[i],a=s.levelID,u=s.levelWidth,c=s.levelHeight,h=s.levelBuffer;n.compressedTexImage2D(n.TEXTURE_2D,a,this.format,u,c,0,h)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,e,r,n,i,o,s){for(var a=new Array(r),u=t.byteOffset,c=o,h=s,l=c+n-1&~(n-1),d=h+i-1&~(i-1),f=l*d*YN[e],p=0;p<r;p++)a[p]={levelID:p,levelWidth:r>1?c:l,levelHeight:r>1?h:d,levelBuffer:new Uint8Array(t.buffer,u,f)},u+=f,f=(l=(c=c>>1||1)+n-1&~(n-1))*(d=(h=h>>1||1)+i-1&~(i-1))*YN[e];return a},e}($N),ek=function(){function t(){}return t.use=function(e,r){var n=e.data;if(e.type===DN.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var i=n.textures,o=void 0,s=void 0,a=0,u=i.length;a<u;a++){var c=i[a],h=c.src,l=c.format;if(l||(s=h),t.textureFormats[l]){o=h;break}}if(!(o=o||s))return void r(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));if(o===e.url)return void r(new Error("URL of compressed texture cannot be the same as the manifest's URL"));var d={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},f=GM.resolve(e.url.replace(this.baseUrl,""),o),p=n.cacheID;this.add(p,f,d,(function(t){if(t.error)r(t.error);else{var n=t.texture,i=void 0===n?null:n,o=t.textures,s=void 0===o?{}:o;Object.assign(e,{texture:i,textures:s}),r()}}))}else r()},Object.defineProperty(t,"textureExtensions",{get:function(){if(!t._textureExtensions){var e=vA.ADAPTER.createCanvas().getContext("webgl");if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var r={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")};t._textureExtensions=r}return t._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(t,"textureFormats",{get:function(){if(!t._textureFormats){var e=t.textureExtensions;for(var r in t._textureFormats={},e){var n=e[r];n&&Object.assign(t._textureFormats,Object.getPrototypeOf(n))}}return t._textureFormats},enumerable:!1,configurable:!0}),t.extension=HD.Loader,t}();function rk(t,e,r){var n={textures:{},texture:null};return e?(e.map((function(t){return new EL(new aL(t,Object.assign({mipmap:BP.OFF,alphaMode:GP.NO_PREMULTIPLIED_ALPHA},r)))})).forEach((function(e,r){var i=e.baseTexture,o=t+"-"+(r+1);aL.addToCache(i,o),EL.addToCache(e,o),0===r&&(aL.addToCache(i,t),EL.addToCache(e,t),n.texture=e),n.textures[o]=e})),n):n}var nk,ik,ok=124,sk=3,ak=4,uk=7,ck=19,hk=2,lk=0,dk=1,fk=2,pk=3;!function(t){t[t.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",t[t.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",t[t.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",t[t.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",t[t.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",t[t.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",t[t.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",t[t.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",t[t.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",t[t.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",t[t.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",t[t.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",t[t.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",t[t.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",t[t.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",t[t.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",t[t.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",t[t.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",t[t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",t[t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",t[t.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",t[t.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",t[t.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",t[t.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",t[t.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",t[t.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",t[t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",t[t.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",t[t.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",t[t.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",t[t.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",t[t.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",t[t.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",t[t.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",t[t.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",t[t.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",t[t.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",t[t.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",t[t.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",t[t.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",t[t.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",t[t.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",t[t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",t[t.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",t[t.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",t[t.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",t[t.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",t[t.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",t[t.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",t[t.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",t[t.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",t[t.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",t[t.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",t[t.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",t[t.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",t[t.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",t[t.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",t[t.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",t[t.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",t[t.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",t[t.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",t[t.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",t[t.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",t[t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",t[t.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",t[t.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",t[t.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",t[t.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",t[t.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",t[t.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",t[t.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",t[t.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",t[t.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",t[t.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",t[t.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",t[t.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",t[t.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",t[t.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",t[t.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",t[t.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",t[t.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",t[t.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",t[t.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",t[t.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",t[t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",t[t.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",t[t.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",t[t.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",t[t.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",t[t.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",t[t.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",t[t.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",t[t.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",t[t.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",t[t.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",t[t.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",t[t.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",t[t.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",t[t.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",t[t.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",t[t.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",t[t.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",t[t.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",t[t.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",t[t.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",t[t.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",t[t.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",t[t.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",t[t.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",t[t.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",t[t.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",t[t.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"}(nk||(nk={})),function(t){t[t.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",t[t.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",t[t.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(ik||(ik={}));var vk,mk,yk,gk=((qN={})[827611204]=HN.COMPRESSED_RGBA_S3TC_DXT1_EXT,qN[861165636]=HN.COMPRESSED_RGBA_S3TC_DXT3_EXT,qN[894720068]=HN.COMPRESSED_RGBA_S3TC_DXT5_EXT,qN),_k=((QN={})[nk.DXGI_FORMAT_BC1_TYPELESS]=HN.COMPRESSED_RGBA_S3TC_DXT1_EXT,QN[nk.DXGI_FORMAT_BC1_UNORM]=HN.COMPRESSED_RGBA_S3TC_DXT1_EXT,QN[nk.DXGI_FORMAT_BC2_TYPELESS]=HN.COMPRESSED_RGBA_S3TC_DXT3_EXT,QN[nk.DXGI_FORMAT_BC2_UNORM]=HN.COMPRESSED_RGBA_S3TC_DXT3_EXT,QN[nk.DXGI_FORMAT_BC3_TYPELESS]=HN.COMPRESSED_RGBA_S3TC_DXT5_EXT,QN[nk.DXGI_FORMAT_BC3_UNORM]=HN.COMPRESSED_RGBA_S3TC_DXT5_EXT,QN[nk.DXGI_FORMAT_BC1_UNORM_SRGB]=HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,QN[nk.DXGI_FORMAT_BC2_UNORM_SRGB]=HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,QN[nk.DXGI_FORMAT_BC3_UNORM_SRGB]=HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,QN);var bk=[171,75,84,88,32,49,49,187,13,10,26,10],Tk=12,xk=16,Ek=24,Sk=28,wk=36,Rk=40,Ck=44,Pk=48,Ak=52,Ok=56,Ik=60,Mk=((vk={})[LP.UNSIGNED_BYTE]=1,vk[LP.UNSIGNED_SHORT]=2,vk[LP.INT]=4,vk[LP.UNSIGNED_INT]=4,vk[LP.FLOAT]=4,vk[LP.HALF_FLOAT]=8,vk),Dk=((mk={})[MP.RGBA]=4,mk[MP.RGB]=3,mk[MP.RG]=2,mk[MP.RED]=1,mk[MP.LUMINANCE]=1,mk[MP.LUMINANCE_ALPHA]=2,mk[MP.ALPHA]=1,mk),Lk=((yk={})[LP.UNSIGNED_SHORT_4_4_4_4]=2,yk[LP.UNSIGNED_SHORT_5_5_5_1]=2,yk[LP.UNSIGNED_SHORT_5_6_5]=2,yk);function Fk(t,e,r){void 0===r&&(r=!1);var n=new DataView(e);if(!function(t,e){for(var r=0;r<bk.length;r++)if(e.getUint8(r)!==bk[r])return console.error(t+" is not a valid *.ktx file!"),!1;return!0}(t,n))return null;var i=67305985===n.getUint32(Tk,!0),o=n.getUint32(xk,i),s=n.getUint32(Ek,i),a=n.getUint32(Sk,i),u=n.getUint32(wk,i),c=n.getUint32(Rk,i)||1,h=n.getUint32(Ck,i)||1,l=n.getUint32(Pk,i)||1,d=n.getUint32(Ak,i),f=n.getUint32(Ok,i),p=n.getUint32(Ik,i);if(0===c||1!==h)throw new Error("Only 2D textures are supported");if(1!==d)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==l)throw new Error("WebGL does not support array textures");var v,m=u+3&-4,y=c+3&-4,g=new Array(l),_=u*c;if(0===o&&(_=m*y),void 0===(v=0!==o?Mk[o]?Mk[o]*Dk[s]:Lk[o]:YN[a]))throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var b=r?function(t,e,r){var n=new Map,i=0;for(;i<e;){var o=t.getUint32(64+i,r),s=64+i+4,a=3-(o+3)%4;if(0===o||o>e-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u<o&&0!==t.getUint8(s+u);u++);if(-1===u){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var c=(new TextDecoder).decode(new Uint8Array(t.buffer,s,u)),h=new DataView(t.buffer,s+u+1,o-u-1);n.set(c,h),i+=4+o+a}return n}(n,p,i):null,T=_*v,x=u,E=c,S=m,w=y,R=64+p,C=0;C<f;C++){for(var P=n.getUint32(R,i),A=R+4,O=0;O<l;O++){var I=g[O];I||(I=g[O]=new Array(f)),I[C]={levelID:C,levelWidth:f>1||0!==o?x:S,levelHeight:f>1||0!==o?E:w,levelBuffer:new Uint8Array(e,A,T)},A+=T}R=(R+=P+4)%4!=0?R+4-R%4:R,T=(S=(x=x>>1||1)+4-1&-4)*(w=(E=E>>1||1)+4-1&-4)*v}return 0!==o?{uncompressed:g.map((function(t){var e=t[0].levelBuffer,r=!1;return o===LP.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===LP.UNSIGNED_INT?(r=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===LP.INT&&(r=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new oL(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:r?Nk(s):s}})),kvData:b}:{compressed:g.map((function(t){return new tk(null,{format:a,width:u,height:c,levels:f,levelBuffers:t})})),kvData:b}}function Nk(t){switch(t){case MP.RGBA:return MP.RGBA_INTEGER;case MP.RGB:return MP.RGB_INTEGER;case MP.RG:return MP.RG_INTEGER;case MP.RED:return MP.RED_INTEGER;default:return t}}DN.setExtensionXhrType("dds",DN.XHR_RESPONSE_TYPE.BUFFER);var kk=function(){function t(){}return t.use=function(t,e){if("dds"===t.extension&&t.data)try{Object.assign(t,rk(t.name||t.url,function(t){var e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");var r=new Uint32Array(t,0,ok/Uint32Array.BYTES_PER_ELEMENT),n=r[sk],i=r[ak],o=r[uk],s=new Uint32Array(t,ck*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=s[1];if(4&a){var u=s[hk];if(808540228!==u){var c=gk[u],h=new Uint8Array(t,128);return[new tk(h,{format:c,width:i,height:n,levels:o})]}var l=new Uint32Array(e.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),d=l[lk],f=l[dk],p=l[fk],v=l[pk],m=_k[d];if(void 0===m)throw new Error("DDSParser cannot parse texture data with DXGI format "+d);if(4===p)throw new Error("DDSParser does not support cubemap textures");if(f===ik.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var y=new Array;if(1===v)y.push(new Uint8Array(t,148));else{for(var g=YN[m],_=0,b=i,T=n,x=0;x<o;x++)_+=Math.max(1,b+3&-4)*Math.max(1,T+3&-4)*g,b>>>=1,T>>>=1;var E=148;for(x=0;x<v;x++)y.push(new Uint8Array(t,E,_)),E+=_}return y.map((function(t){return new tk(t,{format:m,width:i,height:n,levels:o})}))}if(64&a)throw new Error("DDSParser does not support uncompressed texture data.");if(512&a)throw new Error("DDSParser does not supported YUV uncompressed texture data.");if(131072&a)throw new Error("DDSParser does not support single-channel (lumninance) texture data!");if(2&a)throw new Error("DDSParser does not support single-channel (alpha) texture data!");throw new Error("DDSParser failed to load a texture file due to an unknown reason!")}(t.data),t.metadata))}catch(t){return void e(t)}e()},t.extension=HD.Loader,t}();DN.setExtensionXhrType("ktx",DN.XHR_RESPONSE_TYPE.BUFFER);var Bk=function(){function t(){}return t.use=function(t,e){if("ktx"===t.extension&&t.data)try{var r=t.name||t.url,n=Fk(r,t.data,this.loadKeyValueData),i=n.compressed,o=n.uncompressed,s=n.kvData;if(i){var a=rk(r,i,t.metadata);if(s&&a.textures)for(var u in a.textures)a.textures[u].baseTexture.ktxKeyValueData=s;Object.assign(t,a)}else if(o){var c={};o.forEach((function(t,e){var n=new EL(new aL(t.resource,{mipmap:BP.OFF,alphaMode:GP.NO_PREMULTIPLIED_ALPHA,type:t.type,format:t.format})),i=r+"-"+(e+1);s&&(n.baseTexture.ktxKeyValueData=s),aL.addToCache(n.baseTexture,i),EL.addToCache(n,i),0===e&&(c[r]=n,aL.addToCache(n.baseTexture,r),EL.addToCache(n,r)),c[i]=n})),Object.assign(t,{textures:c})}}catch(t){return void e(t)}e()},t.extension=HD.Loader,t.loadKeyValueData=!1,t}(),Gk=function(t,e){return Gk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Gk(t,e)};function Uk(t,e){function r(){this.constructor=t}Gk(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var jk,Xk,Vk=function(t){function e(e,r,n,i){void 0===e&&(e=1500),void 0===n&&(n=16384),void 0===i&&(i=!1);var o=t.call(this)||this;return n>16384&&(n=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=e,o._batchSize=n,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=OP.NORMAL,o.autoResize=i,o.roundPixels=!0,o.baseTexture=null,o.setProperties(r),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return Uk(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,HM(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(VD),Hk=function(){function t(t,e,r){this.geometry=new DL,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<t.length;++n){var i=t[n];i={attributeName:i.attributeName,size:i.size,uploadFunction:i.uploadFunction,type:i.type||LP.FLOAT,offset:i.offset},e[n]?this.dynamicProperties.push(i):this.staticProperties.push(i)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return t.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new PL(function(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var n=0,i=0;n<r;n+=6,i+=4)e[n+0]=i+0,e[n+1]=i+1,e[n+2]=i+2,e[n+3]=i+0,e[n+4]=i+2,e[n+5]=i+3;return e}(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var r=0;r<this.dynamicProperties.length;++r){(s=this.dynamicProperties[r]).offset=e,e+=s.size,this.dynamicStride+=s.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new PL(this.dynamicData,!1,!1);var i=0;this.staticStride=0;for(r=0;r<this.staticProperties.length;++r){(s=this.staticProperties[r]).offset=i,i+=s.size,this.staticStride+=s.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new PL(this.staticData,!0,!1);for(r=0;r<this.dynamicProperties.length;++r){var s=this.dynamicProperties[r];t.addAttribute(s.attributeName,this.dynamicBuffer,0,s.type===LP.UNSIGNED_BYTE,s.type,4*this.dynamicStride,4*s.offset)}for(r=0;r<this.staticProperties.length;++r){s=this.staticProperties[r];t.addAttribute(s.attributeName,this.staticBuffer,0,s.type===LP.UNSIGNED_BYTE,s.type,4*this.staticStride,4*s.offset)}},t.prototype.uploadDynamic=function(t,e,r){for(var n=0;n<this.dynamicProperties.length;n++){var i=this.dynamicProperties[n];i.uploadFunction(t,e,r,i.type===LP.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,i.offset)}this.dynamicBuffer._updateID++},t.prototype.uploadStatic=function(t,e,r){for(var n=0;n<this.staticProperties.length;n++){var i=this.staticProperties[n];i.uploadFunction(t,e,r,i.type===LP.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,i.offset)}this.staticBuffer._updateID++},t.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},t}(),Wk=function(t){function e(e){var r=t.call(this,e)||this;return r.shader=null,r.properties=null,r.tempMatrix=new CD,r.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:r.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:r.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:r.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:r.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:LP.UNSIGNED_BYTE,uploadFunction:r.uploadTint,offset:0}],r.shader=TF.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n    vec2 v = vec2(x, y);\n    v = v + aPositionCoord;\n\n    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n    gl_FragColor = color;\n}",{}),r.state=xF.for2d(),r}return Uk(e,t),e.prototype.render=function(t){var e=t.children,r=t._maxSize,n=t._batchSize,i=this.renderer,o=e.length;if(0!==o){o>r&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture,u=a.alphaMode>0;this.state.blendMode=JM(t.blendMode,u),i.state.set(this.state);var c,h,l,d,f=i.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=(c=t.tintRgb,h=t.worldAlpha,l=this.shader.uniforms.uColor,d=u,l=l||new Float32Array(4),d||void 0===d?(l[0]=c[0]*h,l[1]=c[1]*h,l[2]=c[2]*h):(l[0]=c[0],l[1]=c[1],l[2]=c[2]),l[3]=h,l),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var v=!1,m=0,y=0;m<o;m+=n,y+=1){var g=o-m;g>n&&(g=n),y>=s.length&&s.push(this._generateOneMoreBuffer(t));var _=s[y];_.uploadDynamic(e,m,g);var b=t._bufferUpdateIDs[y]||0;(v=v||_._updateID<b)&&(_._updateID=t._updateID,_.uploadStatic(e,m,g)),i.geometry.bind(_.geometry),f.drawElements(f.TRIANGLES,6*g,f.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],r=t._maxSize,n=t._batchSize,i=t._properties,o=0;o<r;o+=n)e.push(new Hk(this.properties,i,n));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,r=t._properties;return new Hk(this.properties,r,e)},e.prototype.uploadVertices=function(t,e,r,n,i,o){for(var s=0,a=0,u=0,c=0,h=0;h<r;++h){var l=t[e+h],d=l._texture,f=l.scale.x,p=l.scale.y,v=d.trim,m=d.orig;v?(s=(a=v.x-l.anchor.x*m.width)+v.width,u=(c=v.y-l.anchor.y*m.height)+v.height):(s=m.width*(1-l.anchor.x),a=m.width*-l.anchor.x,u=m.height*(1-l.anchor.y),c=m.height*-l.anchor.y),n[o]=a*f,n[o+1]=c*p,n[o+i]=s*f,n[o+i+1]=c*p,n[o+2*i]=s*f,n[o+2*i+1]=u*p,n[o+3*i]=a*f,n[o+3*i+1]=u*p,o+=4*i}},e.prototype.uploadPosition=function(t,e,r,n,i,o){for(var s=0;s<r;s++){var a=t[e+s].position;n[o]=a.x,n[o+1]=a.y,n[o+i]=a.x,n[o+i+1]=a.y,n[o+2*i]=a.x,n[o+2*i+1]=a.y,n[o+3*i]=a.x,n[o+3*i+1]=a.y,o+=4*i}},e.prototype.uploadRotation=function(t,e,r,n,i,o){for(var s=0;s<r;s++){var a=t[e+s].rotation;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},e.prototype.uploadUvs=function(t,e,r,n,i,o){for(var s=0;s<r;++s){var a=t[e+s]._texture._uvs;a?(n[o]=a.x0,n[o+1]=a.y0,n[o+i]=a.x1,n[o+i+1]=a.y1,n[o+2*i]=a.x2,n[o+2*i+1]=a.y2,n[o+3*i]=a.x3,n[o+3*i+1]=a.y3,o+=4*i):(n[o]=0,n[o+1]=0,n[o+i]=0,n[o+i+1]=0,n[o+2*i]=0,n[o+2*i+1]=0,n[o+3*i]=0,n[o+3*i+1]=0,o+=4*i)}},e.prototype.uploadTint=function(t,e,r,n,i,o){for(var s=0;s<r;++s){var a=t[e+s],u=a._texture.baseTexture.alphaMode>0,c=a.alpha,h=c<1&&u?KM(a._tintRGB,c):a._tintRGB+(255*c<<24);n[o]=h,n[o+i]=h,n[o+2*i]=h,n[o+3*i]=h,o+=4*i}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e.extension={name:"particle",type:HD.RendererPlugin},e}(XL);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(jk||(jk={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(Xk||(Xk={}));var Yk={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},zk=function(){function t(){this.color=16777215,this.alpha=1,this.texture=EL.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=EL.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),Zk=function(t,e){return Zk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Zk(t,e)};function Jk(t,e){function r(){this.constructor=t}Zk(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function Kk(t,e){var r,n;void 0===e&&(e=!1);var i=t.length;if(!(i<6)){for(var o=0,s=0,a=t[i-2],u=t[i-1];s<i;s+=2){var c=t[s],h=t[s+1];o+=(c-a)*(h+u),a=c,u=h}if(!e&&o>0||e&&o<=0){var l=i/2;for(s=l+l%2;s<i;s+=2){var d=i-s-2,f=i-s-1,p=s,v=s+1;r=[t[p],t[d]],t[d]=r[0],t[p]=r[1],n=[t[v],t[f]],t[f]=n[0],t[v]=n[1]}}}}var qk={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,n=t.holes,i=e.points,o=e.indices;if(r.length>=6){Kk(r,!1);for(var s=[],a=0;a<n.length;a++){var u=n[a];Kk(u.points,!0),s.push(r.length/2),r=r.concat(u.points)}var c=WA(r,s,2);if(!c)return;var h=i.length/2;for(a=0;a<c.length;a+=3)o.push(c[a]+h),o.push(c[a+1]+h),o.push(c[a+2]+h);for(a=0;a<r.length;a++)i.push(r[a])}}},Qk={build:function(t){var e,r,n,i,o,s,a=t.points;if(t.type===vD.CIRC){var u=t.shape;e=u.x,r=u.y,o=s=u.radius,n=i=0}else if(t.type===vD.ELIP){var c=t.shape;e=c.x,r=c.y,o=c.width,s=c.height,n=i=0}else{var h=t.shape,l=h.width/2,d=h.height/2;e=h.x+l,r=h.y+d,n=l-(o=s=Math.max(0,Math.min(h.radius,Math.min(l,d)))),i=d-s}if(o>=0&&s>=0&&n>=0&&i>=0){var f=Math.ceil(2.3*Math.sqrt(o+s)),p=8*f+(n?4:0)+(i?4:0);if(a.length=p,0!==p){if(0===f)return a.length=8,a[0]=a[6]=e+n,a[1]=a[3]=r+i,a[2]=a[4]=e-n,void(a[5]=a[7]=r-i);var v=0,m=4*f+(n?2:0)+2,y=m,g=p,_=e+(w=n+o),b=e-w,T=r+(R=i);if(a[v++]=_,a[v++]=T,a[--m]=T,a[--m]=b,i){var x=r-R;a[y++]=b,a[y++]=x,a[--g]=x,a[--g]=_}for(var E=1;E<f;E++){var S=Math.PI/2*(E/f);_=e+(w=n+Math.cos(S)*o),b=e-w,T=r+(R=i+Math.sin(S)*s),x=r-R;a[v++]=_,a[v++]=T,a[--m]=T,a[--m]=b,a[y++]=b,a[y++]=x,a[--g]=x,a[--g]=_}var w,R;_=e+(w=n),b=e-w,T=r+(R=i+s),x=r-R;a[v++]=_,a[v++]=T,a[--g]=x,a[--g]=_,n&&(a[v++]=b,a[v++]=T,a[--g]=x,a[--g]=b)}}else a.length=0},triangulate:function(t,e){var r=t.points,n=e.points,i=e.indices;if(0!==r.length){var o,s,a=n.length/2,u=a;if(t.type!==vD.RREC){var c=t.shape;o=c.x,s=c.y}else{var h=t.shape;o=h.x+h.width/2,s=h.y+h.height/2}var l=t.matrix;n.push(t.matrix?l.a*o+l.c*s+l.tx:o,t.matrix?l.b*o+l.d*s+l.ty:s),a++,n.push(r[0],r[1]);for(var d=2;d<r.length;d+=2)n.push(r[d],r[d+1]),i.push(a++,u,a);i.push(u+1,u,a)}}};function $k(t,e,r){return t+(e-t)*r}function tB(t,e,r,n,i,o,s){void 0===s&&(s=[]);for(var a=s,u=0,c=0,h=0,l=0,d=0,f=0,p=0,v=0;p<=20;++p)u=$k(t,r,v=p/20),c=$k(e,n,v),h=$k(r,i,v),l=$k(n,o,v),d=$k(u,h,v),f=$k(c,l,v),0===p&&a[a.length-2]===d&&a[a.length-1]===f||a.push(d,f);return a}var eB={build:function(t){if(_B.nextRoundedRectBehavior)Qk.build(t);else{var e=t.shape,r=t.points,n=e.x,i=e.y,o=e.width,s=e.height,a=Math.max(0,Math.min(e.radius,Math.min(o,s)/2));r.length=0,a?(tB(n,i+a,n,i,n+a,i,r),tB(n+o-a,i,n+o,i,n+o,i+a,r),tB(n+o,i+s-a,n+o,i+s,n+o-a,i+s,r),tB(n+a,i+s,n,i+s,n,i+s-a,r)):r.push(n,i,n+o,i,n+o,i+s,n,i+s)}},triangulate:function(t,e){if(_B.nextRoundedRectBehavior)Qk.triangulate(t,e);else{for(var r=t.points,n=e.points,i=e.indices,o=n.length/2,s=WA(r,null,2),a=0,u=s.length;a<u;a+=3)i.push(s[a]+o),i.push(s[a+1]+o),i.push(s[a+2]+o);for(a=0,u=r.length;a<u;a++)n.push(r[a],r[++a])}}};function rB(t,e,r,n,i,o,s,a){var u,c;s?(u=n,c=-r):(u=-n,c=r);var h=t-r*i+u,l=e-n*i+c,d=t+r*o+u,f=e+n*o+c;return a.push(h,l),a.push(d,f),2}function nB(t,e,r,n,i,o,s,a){var u=r-t,c=n-e,h=Math.atan2(u,c),l=Math.atan2(i-t,o-e);a&&h<l?h+=2*Math.PI:!a&&h>l&&(l+=2*Math.PI);var d=h,f=l-h,p=Math.abs(f),v=Math.sqrt(u*u+c*c),m=1+(15*p*Math.sqrt(v)/Math.PI>>0),y=f/m;if(d+=y,a){s.push(t,e),s.push(r,n);for(var g=1,_=d;g<m;g++,_+=y)s.push(t,e),s.push(t+Math.sin(_)*v,e+Math.cos(_)*v);s.push(t,e),s.push(i,o)}else{s.push(r,n),s.push(t,e);for(g=1,_=d;g<m;g++,_+=y)s.push(t+Math.sin(_)*v,e+Math.cos(_)*v),s.push(t,e);s.push(i,o),s.push(t,e)}return 2*m}function iB(t,e){t.lineStyle.native?function(t,e){var r=0,n=t.shape,i=t.points||n.points,o=n.type!==vD.POLY||n.closeStroke;if(0!==i.length){var s=e.points,a=e.indices,u=i.length/2,c=s.length/2,h=c;for(s.push(i[0],i[1]),r=1;r<u;r++)s.push(i[2*r],i[2*r+1]),a.push(h,h+1),h++;o&&a.push(h,c)}}(t,e):function(t,e){var r=t.shape,n=t.points||r.points.slice(),i=e.closePointEps;if(0!==n.length){var o=t.lineStyle,s=new _D(n[0],n[1]),a=new _D(n[n.length-2],n[n.length-1]),u=r.type!==vD.POLY||r.closeStroke,c=Math.abs(s.x-a.x)<i&&Math.abs(s.y-a.y)<i;if(u){n=n.slice(),c&&(n.pop(),n.pop(),a.set(n[n.length-2],n[n.length-1]));var h=.5*(s.x+a.x),l=.5*(a.y+s.y);n.unshift(h,l),n.push(h,l)}var d=e.points,f=n.length/2,p=n.length,v=d.length/2,m=o.width/2,y=m*m,g=o.miterLimit*o.miterLimit,_=n[0],b=n[1],T=n[2],x=n[3],E=0,S=0,w=-(b-x),R=_-T,C=0,P=0,A=Math.sqrt(w*w+R*R);w/=A,R/=A,w*=m,R*=m;var O=o.alignment,I=2*(1-O),M=2*O;u||(o.cap===Xk.ROUND?p+=nB(_-w*(I-M)*.5,b-R*(I-M)*.5,_-w*I,b-R*I,_+w*M,b+R*M,d,!0)+2:o.cap===Xk.SQUARE&&(p+=rB(_,b,w,R,I,M,!0,d))),d.push(_-w*I,b-R*I),d.push(_+w*M,b+R*M);for(var D=1;D<f-1;++D){_=n[2*(D-1)],b=n[2*(D-1)+1],T=n[2*D],x=n[2*D+1],E=n[2*(D+1)],S=n[2*(D+1)+1],w=-(b-x),R=_-T,w/=A=Math.sqrt(w*w+R*R),R/=A,w*=m,R*=m,C=-(x-S),P=T-E,C/=A=Math.sqrt(C*C+P*P),P/=A,C*=m,P*=m;var L=T-_,F=b-x,N=T-E,k=S-x,B=L*N+F*k,G=F*N-k*L,U=G<0;if(Math.abs(G)<.001*Math.abs(B))d.push(T-w*I,x-R*I),d.push(T+w*M,x+R*M),B>=0&&(o.join===jk.ROUND?p+=nB(T,x,T-w*I,x-R*I,T-C*I,x-P*I,d,!1)+4:p+=2,d.push(T-C*M,x-P*M),d.push(T+C*I,x+P*I));else{var j=(-w+_)*(-R+x)-(-w+T)*(-R+b),X=(-C+E)*(-P+x)-(-C+T)*(-P+S),V=(L*X-N*j)/G,H=(k*j-F*X)/G,W=(V-T)*(V-T)+(H-x)*(H-x),Y=T+(V-T)*I,z=x+(H-x)*I,Z=T-(V-T)*M,J=x-(H-x)*M,K=U?I:M;W<=Math.min(L*L+F*F,N*N+k*k)+K*K*y?o.join===jk.BEVEL||W/y>g?(U?(d.push(Y,z),d.push(T+w*M,x+R*M),d.push(Y,z),d.push(T+C*M,x+P*M)):(d.push(T-w*I,x-R*I),d.push(Z,J),d.push(T-C*I,x-P*I),d.push(Z,J)),p+=2):o.join===jk.ROUND?U?(d.push(Y,z),d.push(T+w*M,x+R*M),p+=nB(T,x,T+w*M,x+R*M,T+C*M,x+P*M,d,!0)+4,d.push(Y,z),d.push(T+C*M,x+P*M)):(d.push(T-w*I,x-R*I),d.push(Z,J),p+=nB(T,x,T-w*I,x-R*I,T-C*I,x-P*I,d,!1)+4,d.push(T-C*I,x-P*I),d.push(Z,J)):(d.push(Y,z),d.push(Z,J)):(d.push(T-w*I,x-R*I),d.push(T+w*M,x+R*M),o.join===jk.ROUND?p+=U?nB(T,x,T+w*M,x+R*M,T+C*M,x+P*M,d,!0)+2:nB(T,x,T-w*I,x-R*I,T-C*I,x-P*I,d,!1)+2:o.join===jk.MITER&&W/y<=g&&(U?(d.push(Z,J),d.push(Z,J)):(d.push(Y,z),d.push(Y,z)),p+=2),d.push(T-C*I,x-P*I),d.push(T+C*M,x+P*M),p+=2)}}_=n[2*(f-2)],b=n[2*(f-2)+1],T=n[2*(f-1)],w=-(b-(x=n[2*(f-1)+1])),R=_-T,w/=A=Math.sqrt(w*w+R*R),R/=A,w*=m,R*=m,d.push(T-w*I,x-R*I),d.push(T+w*M,x+R*M),u||(o.cap===Xk.ROUND?p+=nB(T-w*(I-M)*.5,x-R*(I-M)*.5,T-w*I,x-R*I,T+w*M,x+R*M,d,!1)+2:o.cap===Xk.SQUARE&&(p+=rB(T,x,w,R,I,M,!1,d)));var q=e.indices,Q=Yk.epsilon*Yk.epsilon;for(D=v;D<p+v-2;++D)_=d[2*D],b=d[2*D+1],T=d[2*(D+1)],x=d[2*(D+1)+1],E=d[2*(D+2)],S=d[2*(D+2)+1],Math.abs(_*(x-S)+T*(S-b)+E*(b-x))<Q||q.push(D,D+1,D+2)}}(t,e)}var oB,sB=function(){function t(){}return t.curveTo=function(t,e,r,n,i,o){var s=o[o.length-2],a=o[o.length-1]-e,u=s-t,c=n-e,h=r-t,l=Math.abs(a*h-u*c);if(l<1e-8||0===i)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var d=a*a+u*u,f=c*c+h*h,p=a*c+u*h,v=i*Math.sqrt(d)/l,m=i*Math.sqrt(f)/l,y=v*p/d,g=m*p/f,_=v*h+m*u,b=v*c+m*a,T=u*(m+y),x=a*(m+y),E=h*(v+g),S=c*(v+g);return{cx:_+t,cy:b+e,radius:i,startAngle:Math.atan2(x-b,T-_),endAngle:Math.atan2(S-b,E-_),anticlockwise:u*c>h*a}},t.arc=function(t,e,r,n,i,o,s,a,u){for(var c=s-o,h=Yk._segmentsCount(Math.abs(c)*i,40*Math.ceil(Math.abs(c)/mD)),l=c/(2*h),d=2*l,f=Math.cos(l),p=Math.sin(l),v=h-1,m=v%1/v,y=0;y<=v;++y){var g=l+o+d*(y+m*y),_=Math.cos(g),b=-Math.sin(g);u.push((f*_+p*b)*i+r,(f*-b+p*_)*i+n)}},t}(),aB=function(){function t(){}return t.curveLength=function(t,e,r,n,i,o,s,a){for(var u=0,c=0,h=0,l=0,d=0,f=0,p=0,v=0,m=0,y=0,g=0,_=t,b=e,T=1;T<=10;++T)y=_-(v=(p=(f=(d=1-(c=T/10))*d)*d)*t+3*f*c*r+3*d*(h=c*c)*i+(l=h*c)*s),g=b-(m=p*e+3*f*c*n+3*d*h*o+l*a),_=v,b=m,u+=Math.sqrt(y*y+g*g);return u},t.curveTo=function(e,r,n,i,o,s,a){var u=a[a.length-2],c=a[a.length-1];a.length-=2;var h=Yk._segmentsCount(t.curveLength(u,c,e,r,n,i,o,s)),l=0,d=0,f=0,p=0,v=0;a.push(u,c);for(var m=1,y=0;m<=h;++m)f=(d=(l=1-(y=m/h))*l)*l,v=(p=y*y)*y,a.push(f*u+3*d*y*e+3*l*p*n+v*o,f*c+3*d*y*r+3*l*p*i+v*s)},t}(),uB=function(){function t(){}return t.curveLength=function(t,e,r,n,i,o){var s=t-2*r+i,a=e-2*n+o,u=2*r-2*t,c=2*n-2*e,h=4*(s*s+a*a),l=4*(s*u+a*c),d=u*u+c*c,f=2*Math.sqrt(h+l+d),p=Math.sqrt(h),v=2*h*p,m=2*Math.sqrt(d),y=l/p;return(v*f+p*l*(f-m)+(4*d*h-l*l)*Math.log((2*p+y+f)/(y+m)))/(4*v)},t.curveTo=function(e,r,n,i,o){for(var s=o[o.length-2],a=o[o.length-1],u=Yk._segmentsCount(t.curveLength(s,a,e,r,n,i)),c=0,h=0,l=1;l<=u;++l){var d=l/u;c=s+(e-s)*d,h=a+(r-a)*d,o.push(c+(e+(n-e)*d-c)*d,h+(r+(i-r)*d-h)*d)}},t}(),cB=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),hB=((oB={})[vD.POLY]=qk,oB[vD.CIRC]=Qk,oB[vD.ELIP]=Qk,oB[vD.RECT]={build:function(t){var e=t.shape,r=e.x,n=e.y,i=e.width,o=e.height,s=t.points;s.length=0,s.push(r,n,r+i,n,r+i,n+o,r,n+o)},triangulate:function(t,e){var r=t.points,n=e.points,i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},oB[vD.RREC]=eB,oB),lB=[],dB=[],fB=function(){function t(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=null),void 0===n&&(n=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=n,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),pB=new _D,vB=function(t){function e(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new kD,e.boundsDirty=-1,e}return Jk(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){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(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),dB.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),lB.push(e)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=null),void 0===n&&(n=null);var i=new fB(t,e,r,n);return this.graphicsData.push(i),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var r=new fB(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].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},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,r=0;r<e.length;++r){var n=e[r];if(n.fillStyle.visible&&(n.shape&&(n.matrix?n.matrix.applyInverse(t,pB):pB.copyFrom(t),n.shape.contains(pB.x,pB.y)))){var i=!1;if(n.holes)for(var o=0;o<n.holes.length;o++){if(n.holes[o].shape.contains(pB.x,pB.y)){i=!0;break}}if(!i)return!0}}return!1},e.prototype.updateBatches=function(){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var t=this.uvs,e=this.graphicsData,r=null,n=null;this.batches.length>0&&(n=(r=this.batches[this.batches.length-1]).style);for(var i=this.shapeIndex;i<e.length;i++){this.shapeIndex++;var o=e[i],s=o.fillStyle,a=o.lineStyle;hB[o.type].build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(s.visible||a.visible)&&this.processHoles(o.holes);for(var u=0;u<2;u++){var c=0===u?s:a;if(c.visible){var h=c.texture.baseTexture,l=this.indices.length,d=this.points.length/2;h.wrapMode=kP.REPEAT,0===u?this.processFill(o):this.processLine(o);var f=this.points.length/2-d;0!==f&&(r&&!this._compareStyles(n,c)&&(r.end(l,d),r=null),r||((r=lB.pop()||new cB).begin(c,l,d),this.batches.push(r),n=c),this.addUvs(this.points,t,c.texture,d,f,c.matrix))}}}var p=this.indices.length,v=this.points.length/2;if(r&&r.end(p,v),0!==this.batches.length){var m=v>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&m===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=m?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var r=this.graphicsData[t],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid)return!1;if(i&&!i.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,r=t.length;e<r;e++)for(var n=t[e],i=0;i<n.size;i++){var o=n.start+i;this.indicesUint16[o]=this.indicesUint16[o]-n.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,r=0;r<t.length;r++)if(t[r].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++aL._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),dB.push(this.drawCalls[e]);this.drawCalls.length=0;var r=this.colors,n=this.textureIds,i=dB.pop();i||((i=new nN).texArray=new iN),i.texArray.count=0,i.start=0,i.size=0,i.type=IP.TRIANGLES;var o=0,s=null,a=0,u=!1,c=IP.TRIANGLES,h=0;this.drawCalls.push(i);for(e=0;e<this.batches.length;e++){var l=this.batches[e],d=l.style,f=d.texture.baseTexture;u!==!!d.native&&(c=(u=!!d.native)?IP.LINES:IP.TRIANGLES,s=null,o=8,t++),s!==f&&(s=f,f._batchEnabled!==t&&(8===o&&(t++,o=0,i.size>0&&((i=dB.pop())||((i=new nN).texArray=new iN),this.drawCalls.push(i)),i.start=h,i.size=0,i.texArray.count=0,i.type=c),f.touched=1,f._batchEnabled=t,f._batchLocation=o,f.wrapMode=kP.REPEAT,i.texArray.elements[i.texArray.count++]=f,o++)),i.size+=l.size,h+=l.size,a=f._batchLocation,this.addColors(r,d.color,d.alpha,l.attribSize,l.attribStart),this.addTextureIds(n,a,l.attribSize,l.attribStart)}aL._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(3*t.length*4),o=new Float32Array(i),s=new Uint32Array(i),a=0,u=0;u<t.length/2;u++)o[a++]=t[2*u],o[a++]=t[2*u+1],o[a++]=e[2*u],o[a++]=e[2*u+1],s[a++]=r[u],o[a++]=n[u];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?qk.triangulate(t,this):hB[t.type].triangulate(t,this)},e.prototype.processLine=function(t){iB(t,this);for(var e=0;e<t.holes.length;e++)iB(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var r=t[e];hB[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var r=0;r<t.length/2;r++){var n=t[2*r],i=t[2*r+1];t[2*r]=e.a*n+e.c*i+e.tx,t[2*r+1]=e.b*n+e.d*i+e.ty}},e.prototype.addColors=function(t,e,r,n,i){void 0===i&&(i=0);var o=KM((e>>16)+(65280&e)+((255&e)<<16),r);t.length=Math.max(t.length,i+n);for(var s=0;s<n;s++)t[i+s]=o},e.prototype.addTextureIds=function(t,e,r,n){void 0===n&&(n=0),t.length=Math.max(t.length,n+r);for(var i=0;i<r;i++)t[n+i]=e},e.prototype.addUvs=function(t,e,r,n,i,o){void 0===o&&(o=null);for(var s=0,a=e.length,u=r.frame;s<i;){var c=t[2*(n+s)],h=t[2*(n+s)+1];if(o){var l=o.a*c+o.c*h+o.tx;h=o.b*c+o.d*h+o.ty,c=l}s++,e.push(c/u.width,h/u.height)}var d=r.baseTexture;(u.width<d.width||u.height<d.height)&&this.adjustUvs(e,r,a,i)},e.prototype.adjustUvs=function(t,e,r,n){for(var i=e.baseTexture,o=1e-6,s=r+2*n,a=e.frame,u=a.width/i.width,c=a.height/i.height,h=a.x/a.width,l=a.y/a.height,d=Math.floor(t[r]+o),f=Math.floor(t[r+1]+o),p=r+2;p<s;p+=2)d=Math.min(d,Math.floor(t[p]+o)),f=Math.min(f,Math.floor(t[p+1]+o));h-=d,l-=f;for(p=r;p<s;p+=2)t[p]=(t[p]+h)*u,t[p+1]=(t[p+1]+l)*c},e.BATCHABLE_SIZE=100,e}(uN),mB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=Xk.BUTT,e.join=jk.MITER,e.miterLimit=10,e}return Jk(e,t),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(zk),yB=new Float32Array(3),gB={},_B=function(t){function e(e){void 0===e&&(e=null);var r=t.call(this)||this;return r.shader=null,r.pluginName="batch",r.currentPath=null,r.batches=[],r.batchTint=-1,r.batchDirty=-1,r.vertexData=null,r._fillStyle=new zk,r._lineStyle=new mB,r._matrix=null,r._holeMode=!1,r.state=xF.for2d(),r._geometry=e||new vB,r._geometry.refCount++,r._transformID=-1,r.tint=16777215,r.blendMode=OP.NORMAL,r}return Jk(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,e,r,n,i){return void 0===t&&(t=null),void 0===e&&(e=0),void 0===r&&(r=1),void 0===n&&(n=.5),void 0===i&&(i=!1),"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:n,native:i}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:EL.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Xk.BUTT,join:jk.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new SD,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new SD,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return n===t&&i===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,n){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),uB.curveTo(t,e,r,n,i),this},e.prototype.bezierCurveTo=function(t,e,r,n,i,o){return this._initCurve(),aB.curveTo(t,e,r,n,i,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,n,i){this._initCurve(t,e);var o=this.currentPath.points,s=sB.curveTo(t,e,r,n,i,o);if(s){var a=s.cx,u=s.cy,c=s.radius,h=s.startAngle,l=s.endAngle,d=s.anticlockwise;this.arc(a,u,c,h,l,d)}return this},e.prototype.arc=function(t,e,r,n,i,o){if(void 0===o&&(o=!1),n===i)return this;if(!o&&i<=n?i+=mD:o&&n<=i&&(n+=mD),0===i-n)return this;var s=t+Math.cos(n)*r,a=e+Math.sin(n)*r,u=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var h=Math.abs(c[c.length-2]-s),l=Math.abs(c[c.length-1]-a);h<u&&l<u||c.push(s,a)}else this.moveTo(s,a),c=this.currentPath.points;return sB.arc(s,a,t,e,r,n,i,o,c),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:EL.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:EL.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,n){return this.drawShape(new TD(t,e,r,n))},e.prototype.drawRoundedRect=function(t,e,r,n,i){return this.drawShape(new wD(t,e,r,n,i))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new xD(t,e,r))},e.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new ED(t,e,r,n))},e.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];var i=!0,o=r[0];o.points?(i=o.closeStroke,t=o.points):t=Array.isArray(r[0])?r[0]:r;var s=new SD(t);return s.closeStroke=i,this.drawShape(s),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==vD.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var 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(var n=0;n<r;n++){var i=t.batches[n],o=i.style.color,s=new Float32Array(this.vertexData.buffer,4*i.attribStart*2,2*i.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*i.attribStart*2,2*i.attribSize),u={vertexData:s,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*i.start,i.size),uvs:a,_batchRGB:HM(o),_tintRGB:o,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=u}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,r=this.batches.length;e<r;e++){var n=this.batches[e];n.worldAlpha=this.worldAlpha*n.alpha,t.plugins[this.pluginName].render(n)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),r=this._geometry,n=this.tint,i=this.worldAlpha,o=e.uniforms,s=r.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(n>>16&255)/255*i,o.tint[1]=(n>>8&255)/255*i,o.tint[2]=(255&n)/255*i,o.tint[3]=i,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,u=s.length;a<u;a++)this._renderDrawCallDirect(t,r.drawCalls[a])},e.prototype._renderDrawCallDirect=function(t,e){for(var r=e.texArray,n=e.type,i=e.size,o=e.start,s=r.count,a=0;a<s;a++)t.texture.bind(r.elements[a],a);t.geometry.draw(n,i,o)},e.prototype._resolveDirectShader=function(t){var e=this.shader,r=this.pluginName;if(!e){if(!gB[r]){for(var n=t.plugins[r].MAX_TEXTURES,i=new Int32Array(n),o=0;o<n;o++)i[o]=o;var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new CD,default:kL.from({uSamplers:i},!0)},a=t.plugins[r]._shader.program;gB[r]=new TF(a,s)}e=gB[r]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,r=e.minX,n=e.minY,i=e.maxX,o=e.maxY;this._bounds.addFrame(this.transform,r,n,i,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=HM(this.tint,yB),e=0;e<this.batches.length;e++){var r=this.batches[e],n=r._batchRGB,i=(t[0]*n[0]*255<<16)+(t[1]*n[1]*255<<8)+(0|t[2]*n[2]*255);r._tintRGB=(i>>16)+(65280&i)+((255&i)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,r=e.a,n=e.b,i=e.c,o=e.d,s=e.tx,a=e.ty,u=this._geometry.points,c=this.vertexData,h=0,l=0;l<u.length;l+=2){var d=u[l],f=u[l+1];c[h++]=r*d+i*f+s,c[h++]=o*f+n*d+a}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){this._geometry.refCount--,0===this._geometry.refCount&&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,t.prototype.destroy.call(this,e)},e.nextRoundedRectBehavior=!1,e._TEMP_POINT=new _D,e}(VD),bB=function(t,e){return bB=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},bB(t,e)};var TB,xB=new _D,EB=new Uint16Array([0,1,2,0,2,3]),SB=function(t){function e(e){var r=t.call(this)||this;return r._anchor=new RD(r._onAnchorUpdate,r,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),r._texture=null,r._width=0,r._height=0,r._tint=null,r._tintRGB=null,r.tint=16777215,r.blendMode=OP.NORMAL,r._cachedTint=16777215,r.uvs=null,r.texture=e||EL.EMPTY,r.vertexData=new Float32Array(8),r.vertexTrimmedData=null,r._transformID=-1,r._textureID=-1,r._transformTrimmedID=-1,r._textureTrimmedID=-1,r.indices=EB,r.pluginName="batch",r.isSprite=!0,r._roundPixels=vA.ROUND_PIXELS,r}return function(t,e){function r(){this.constructor=t}bB(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=nD(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=nD(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,r=e.a,n=e.b,i=e.c,o=e.d,s=e.tx,a=e.ty,u=this.vertexData,c=t.trim,h=t.orig,l=this._anchor,d=0,f=0,p=0,v=0;if(c?(d=(f=c.x-l._x*h.width)+c.width,p=(v=c.y-l._y*h.height)+c.height):(d=(f=-l._x*h.width)+h.width,p=(v=-l._y*h.height)+h.height),u[0]=r*f+i*v+s,u[1]=o*v+n*f+a,u[2]=r*d+i*v+s,u[3]=o*v+n*d+a,u[4]=r*d+i*p+s,u[5]=o*p+n*d+a,u[6]=r*f+i*p+s,u[7]=o*p+n*f+a,this._roundPixels)for(var m=vA.RESOLUTION,y=0;y<u.length;++y)u[y]=Math.round((u[y]*m|0)/m)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,r=t.orig,n=this._anchor,i=this.transform.worldTransform,o=i.a,s=i.b,a=i.c,u=i.d,c=i.tx,h=i.ty,l=-n._x*r.width,d=l+r.width,f=-n._y*r.height,p=f+r.height;e[0]=o*l+a*f+c,e[1]=u*f+s*l+h,e[2]=o*d+a*f+c,e[3]=u*f+s*d+h,e[4]=o*d+a*p+c,e[5]=u*p+s*d+h,e[6]=o*l+a*p+c,e[7]=u*p+s*l+h},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._localBounds||(this._localBounds=new kD),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new TD),e=this._localBoundsRect),this._localBounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,xB);var e=this._texture.orig.width,r=this._texture.orig.height,n=-e*this.anchor.x,i=0;return xB.x>=n&&xB.x<n+e&&(i=-r*this.anchor.y,xB.y>=i&&xB.y<i+r)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var r="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!r)}this._texture=null},e.from=function(t,r){return new e(t instanceof EL?t:EL.from(t,r))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=nD(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=nD(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||EL.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(VD),wB=function(t,e){return wB=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},wB(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(TB||(TB={}));var RB={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:TB.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},CB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],PB=function(){function t(t){this.styleID=0,this.reset(),IB(this,t,t)}return t.prototype.clone=function(){var e={};return IB(e,this,RB),new t(e)},t.prototype.reset=function(){IB(this,RB,RB)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=OB(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=OB(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=OB(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var r=e.length-1;r>=0;r--){var n=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&CB.indexOf(n)<0&&(n='"'+n+'"'),e[r]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function AB(t){return"number"==typeof t?WM(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function OB(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=AB(t[e]);return t}return AB(t)}function IB(t,e,r){for(var n in r)Array.isArray(e[n])?t[n]=e[n].slice():t[n]=e[n]}var MB={willReadFrequently:!0},DB=function(){function t(t,e,r,n,i,o,s,a,u){this.text=t,this.style=e,this.width=r,this.height=n,this.lines=i,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=u}return t.measureText=function(e,r,n,i){void 0===i&&(i=t._canvas),n=null==n?r.wordWrap:n;var o=r.toFontString(),s=t.measureFont(o);0===s.fontSize&&(s.fontSize=r.fontSize,s.ascent=r.fontSize);var a=i.getContext("2d",MB);a.font=o;for(var u=(n?t.wordWrap(e,r,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(u.length),h=0,l=0;l<u.length;l++){var d=a.measureText(u[l]).width+(u[l].length-1)*r.letterSpacing;c[l]=d,h=Math.max(h,d)}var f=h+r.strokeThickness;r.dropShadow&&(f+=r.dropShadowDistance);var p=r.lineHeight||s.fontSize+r.strokeThickness,v=Math.max(p,s.fontSize+r.strokeThickness)+(u.length-1)*(p+r.leading);return r.dropShadow&&(v+=r.dropShadowDistance),new t(e,r,f,v,u,c,p+r.leading,h,s)},t.wordWrap=function(e,r,n){void 0===n&&(n=t._canvas);for(var i=n.getContext("2d",MB),o=0,s="",a="",u=Object.create(null),c=r.letterSpacing,h=r.whiteSpace,l=t.collapseSpaces(h),d=t.collapseNewlines(h),f=!l,p=r.wordWrapWidth+c,v=t.tokenize(e),m=0;m<v.length;m++){var y=v[m];if(t.isNewline(y)){if(!d){a+=t.addLine(s),f=!l,s="",o=0;continue}y=" "}if(l){var g=t.isBreakingSpace(y),_=t.isBreakingSpace(s[s.length-1]);if(g&&_)continue}var b=t.getFromCache(y,c,u,i);if(b>p)if(""!==s&&(a+=t.addLine(s),s="",o=0),t.canBreakWords(y,r.breakWords))for(var T=t.wordWrapSplit(y),x=0;x<T.length;x++){for(var E=T[x],S=1;T[x+S];){var w=T[x+S],R=E[E.length-1];if(t.canBreakChars(R,w,y,x,r.breakWords))break;E+=w,S++}x+=E.length-1;var C=t.getFromCache(E,c,u,i);C+o>p&&(a+=t.addLine(s),f=!1,s="",o=0),s+=E,o+=C}else{s.length>0&&(a+=t.addLine(s),s="",o=0);var P=m===v.length-1;a+=t.addLine(y,!P),f=!1,s="",o=0}else b+o>p&&(f=!1,a+=t.addLine(s),s="",o=0),(s.length>0||!t.isBreakingSpace(y)||f)&&(s+=y,o+=b)}return a+=t.addLine(s,!1)},t.addLine=function(e,r){return void 0===r&&(r=!0),e=t.trimRight(e),e=r?e+"\n":e},t.getFromCache=function(t,e,r,n){var i=r[t];if("number"!=typeof i){var o=t.length*e;i=n.measureText(t).width+o,r[t]=i}return i},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var n=e[r];if(!t.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,r){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var r=[],n="";if("string"!=typeof e)return r;for(var i=0;i<e.length;i++){var o=e[i],s=e[i+1];t.isBreakingSpace(o,s)||t.isNewline(o)?(""!==n&&(r.push(n),n=""),r.push(o)):n+=o}return""!==n&&r.push(n),r},t.canBreakWords=function(t,e){return e},t.canBreakChars=function(t,e,r,n,i){return!0},t.wordWrapSplit=function(t){return t.split("")},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var r={ascent:0,descent:0,fontSize:0},n=t._canvas,i=t._context;i.font=e;var o=t.METRICS_STRING+t.BASELINE_SYMBOL,s=Math.ceil(i.measureText(o).width),a=Math.ceil(i.measureText(t.BASELINE_SYMBOL).width),u=Math.ceil(t.HEIGHT_MULTIPLIER*a);a=a*t.BASELINE_MULTIPLIER|0,n.width=s,n.height=u,i.fillStyle="#f00",i.fillRect(0,0,s,u),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,a);var c=i.getImageData(0,0,s,u).data,h=c.length,l=4*s,d=0,f=0,p=!1;for(d=0;d<a;++d){for(var v=0;v<l;v+=4)if(255!==c[f+v]){p=!0;break}if(p)break;f+=l}for(r.ascent=a-d,f=h-l,p=!1,d=u;d>a;--d){for(v=0;v<l;v+=4)if(255!==c[f+v]){p=!0;break}if(p)break;f-=l}return r.descent=d-a,r.fontSize=r.ascent+r.descent,t._fonts[e]=r,r},t.clearMetrics=function(e){void 0===e&&(e=""),e?delete t._fonts[e]:t._fonts={}},Object.defineProperty(t,"_canvas",{get:function(){if(!t.__canvas){var e=void 0;try{var r=new OffscreenCanvas(0,0),n=r.getContext("2d",MB);if(n&&n.measureText)return t.__canvas=r,r;e=vA.ADAPTER.createCanvas()}catch(t){e=vA.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(t,"_context",{get:function(){return t.__context||(t.__context=t._canvas.getContext("2d",MB)),t.__context},enumerable:!1,configurable:!0}),t}();DB._fonts={},DB.METRICS_STRING="|ÉqÅ",DB.BASELINE_SYMBOL="M",DB.BASELINE_MULTIPLIER=1.4,DB.HEIGHT_MULTIPLIER=2,DB._newlines=[10,13],DB._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var LB={texture:!0,children:!1,baseTexture:!0},FB=function(t){function e(e,r,n){var i=this,o=!1;n||(n=vA.ADAPTER.createCanvas(),o=!0),n.width=3,n.height=3;var s=EL.from(n);return s.orig=new TD,s.trim=new TD,(i=t.call(this,s)||this)._ownCanvas=o,i.canvas=n,i.context=n.getContext("2d",{willReadFrequently:!0}),i._resolution=vA.RESOLUTION,i._autoResolution=!0,i._text=null,i._style=null,i._styleListener=null,i._font="",i.text=e,i.style=r,i.localStyleID=-1,i}return function(t,e){function r(){this.constructor=t}wB(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.updateText=function(t){var r=this._style;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),this.dirty||!t){this._font=this._style.toFontString();var n,i,o=this.context,s=DB.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=s.width,u=s.height,c=s.lines,h=s.lineHeight,l=s.lineWidths,d=s.maxLineWidth,f=s.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+2*r.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,u)+2*r.padding)*this._resolution),o.scale(this._resolution,this._resolution),o.clearRect(0,0,this.canvas.width,this.canvas.height),o.font=this._font,o.lineWidth=r.strokeThickness,o.textBaseline=r.textBaseline,o.lineJoin=r.lineJoin,o.miterLimit=r.miterLimit;for(var p=r.dropShadow?2:1,v=0;v<p;++v){var m=r.dropShadow&&0===v,y=m?Math.ceil(Math.max(1,u)+2*r.padding):0,g=y*this._resolution;if(m){o.fillStyle="black",o.strokeStyle="black";var _=r.dropShadowColor,b=HM("number"==typeof _?_:YM(_)),T=r.dropShadowBlur*this._resolution,x=r.dropShadowDistance*this._resolution;o.shadowColor="rgba("+255*b[0]+","+255*b[1]+","+255*b[2]+","+r.dropShadowAlpha+")",o.shadowBlur=T,o.shadowOffsetX=Math.cos(r.dropShadowAngle)*x,o.shadowOffsetY=Math.sin(r.dropShadowAngle)*x+g}else o.fillStyle=this._generateFillStyle(r,c,s),o.strokeStyle=r.stroke,o.shadowColor="black",o.shadowBlur=0,o.shadowOffsetX=0,o.shadowOffsetY=0;var E=(h-f.fontSize)/2;(!e.nextLineHeightBehavior||h-f.fontSize<0)&&(E=0);for(var S=0;S<c.length;S++)n=r.strokeThickness/2,i=r.strokeThickness/2+S*h+f.ascent+E,"right"===r.align?n+=d-l[S]:"center"===r.align&&(n+=(d-l[S])/2),r.stroke&&r.strokeThickness&&this.drawLetterSpacing(c[S],n+r.padding,i+r.padding-y,!0),r.fill&&this.drawLetterSpacing(c[S],n+r.padding,i+r.padding-y)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,r,n,i){void 0===i&&(i=!1);var o=this._style.letterSpacing,s=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(0===o||s)return s&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),void(i?this.context.strokeText(t,r,n):this.context.fillText(t,r,n));for(var a=r,u=Array.from?Array.from(t):t.split(""),c=this.context.measureText(t).width,h=0,l=0;l<u.length;++l){var d=u[l];i?this.context.strokeText(d,a,n):this.context.fillText(d,a,n);for(var f="",p=l+1;p<u.length;++p)f+=u[p];a+=c-(h=this.context.measureText(f).width)+o,c=h}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=function(t){var e,r,n,i=t.width,o=t.height,s=t.getContext("2d",{willReadFrequently:!0}),a=s.getImageData(0,0,i,o).data,u=a.length,c={top:null,left:null,right:null,bottom:null},h=null;for(e=0;e<u;e+=4)0!==a[e+3]&&(r=e/4%i,n=~~(e/4/i),null===c.top&&(c.top=n),(null===c.left||r<c.left)&&(c.left=r),(null===c.right||c.right<r)&&(c.right=r+1),(null===c.bottom||c.bottom<n)&&(c.bottom=n));return null!==c.top&&(i=c.right-c.left,o=c.bottom-c.top+1,h=s.getImageData(c.left,c.top,i,o)),{height:o,width:i,data:h}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var r=this._texture,n=this._style,i=n.trim?0:n.padding,o=r.baseTexture;r.trim.width=r._frame.width=t.width/this._resolution,r.trim.height=r._frame.height=t.height/this._resolution,r.trim.x=-i,r.trim.y=-i,r.orig.width=r._frame.width-2*i,r.orig.height=r._frame.height-2*i,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),r.updateUvs(),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.updateTransform=function(){this.updateText(!0),t.prototype.updateTransform.call(this)},e.prototype.getBounds=function(e,r){return this.updateText(!0),-1===this._textureID&&(e=!1),t.prototype.getBounds.call(this,e,r)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,e,r){var n,i=t.fill;if(!Array.isArray(i))return i;if(1===i.length)return i[0];var o=t.dropShadow?t.dropShadowDistance:0,s=t.padding||0,a=this.canvas.width/this._resolution-o-2*s,u=this.canvas.height/this._resolution-o-2*s,c=i.slice(),h=t.fillGradientStops.slice();if(!h.length)for(var l=c.length+1,d=1;d<l;++d)h.push(d/l);if(c.unshift(i[0]),h.unshift(0),c.push(i[i.length-1]),h.push(1),t.fillGradientType===TB.LINEAR_VERTICAL){n=this.context.createLinearGradient(a/2,s,a/2,u+s);var f=r.fontProperties.fontSize+t.strokeThickness;for(d=0;d<e.length;d++){var p=r.lineHeight*(d-1)+f,v=r.lineHeight*d,m=v;d>0&&p>v&&(m=(v+p)/2);var y=v+f,g=r.lineHeight*(d+1),_=y;d+1<e.length&&g<y&&(_=(y+g)/2);for(var b=(_-m)/u,T=0;T<c.length;T++){var x=0;x="number"==typeof h[T]?h[T]:T/c.length;var E=Math.min(1,Math.max(0,m/u+x*b));E=Number(E.toFixed(5)),n.addColorStop(E,c[T])}}}else{n=this.context.createLinearGradient(s,u/2,a+s,u/2);var S=c.length+1,w=1;for(d=0;d<c.length;d++){var R=void 0;R="number"==typeof h[d]?h[d]:w/S,n.addColorStop(R,c[d]),w++}}return n},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},LB,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=nD(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=nD(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof PB?t:new PB(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e.experimentalLetterSpacing=!1,e}(SB);vA.UPLOADS_PER_FRAME=4;var NB=function(t,e){return NB=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},NB(t,e)};var kB=function(){function t(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function BB(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var n=0;n<t._textures.length;n++)if(t._textures[n]instanceof EL){var i=t._textures[n].baseTexture;-1===e.indexOf(i)&&(e.push(i),r=!0)}return r}function GB(t,e){if(t.baseTexture instanceof aL){var r=t.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function UB(t,e){if(t._texture&&t._texture instanceof EL){var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function jB(t,e){return e instanceof FB&&(e.updateText(!0),!0)}function XB(t,e){if(e instanceof PB){var r=e.toFontString();return DB.measureFont(r),!0}return!1}function VB(t,e){if(t instanceof FB){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function HB(t,e){return t instanceof PB&&(-1===e.indexOf(t)&&e.push(t),!0)}var WB=function(){function t(t){var e=this;this.limiter=new kB(vA.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(VB),this.registerFindHook(HB),this.registerFindHook(BB),this.registerFindHook(GB),this.registerFindHook(UB),this.registerUploadHook(jB),this.registerUploadHook(XB)}return t.prototype.upload=function(t,e){var r=this;return"function"==typeof t&&(e=t,t=null),e&&aD("6.5.0","BasePrepare.upload callback is deprecated, use the return Promise instead."),new Promise((function(n){t&&r.add(t);var i=function(){null==e||e(),n()};r.queue.length?(r.completes.push(i),r.ticking||(r.ticking=!0,qD.system.addOnce(r.tick,r,YD.UTILITY))):i()}))},t.prototype.tick=function(){setTimeout(this.delayedTick,0)},t.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var r=0,n=this.uploadHooks.length;r<n;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)qD.system.addOnce(this.tick,this,YD.UTILITY);else{this.ticking=!1;var i=this.completes.slice(0);this.completes.length=0;for(r=0,n=i.length;r<n;r++)i[r]()}},t.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},t.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},t.prototype.add=function(t){for(var e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof VD)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&qD.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function YB(t,e){return e instanceof aL&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function zB(t,e){if(!(e instanceof _B))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var n=r.batches,i=0;i<n.length;i++){var o=n[i].style.texture;o&&YB(t,o.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function ZB(t,e){return t instanceof _B&&(e.push(t),!0)}var JB=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r.renderer,r.registerFindHook(ZB),r.registerUploadHook(YB),r.registerUploadHook(zB),r}return function(t,e){function r(){this.constructor=t}NB(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.extension={name:"prepare",type:HD.RendererPlugin},e}(WB),KB=function(){function t(t,e,r){void 0===r&&(r=null),this.linkedSheets=[],this._texture=t instanceof EL?t:null,this.baseTexture=t instanceof aL?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var n=this.baseTexture.resource;this.resolution=this._updateResolution(r||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return t.prototype._updateResolution=function(t){void 0===t&&(t=null);var e=this.data.meta.scale,r=pD(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&this.baseTexture.setResolution(r),r},t.prototype.parse=function(e){var r=this;return e&&aD("6.5.0","Spritesheet.parse callback is deprecated, use the return Promise instead."),new Promise((function(n){r._callback=function(t){null==e||e(t),n(t)},r._batchIndex=0,r._frameKeys.length<=t.BATCH_SIZE?(r._processFrames(0),r._processAnimations(),r._parseComplete()):r._nextBatch()}))},t.prototype._processFrames=function(e){for(var r=e,n=t.BATCH_SIZE;r-e<n&&r<this._frameKeys.length;){var i=this._frameKeys[r],o=this._frames[i],s=o.frame;if(s){var a=null,u=null,c=!1!==o.trimmed&&o.sourceSize?o.sourceSize:o.frame,h=new TD(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);a=o.rotated?new TD(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new TD(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==o.trimmed&&o.spriteSourceSize&&(u=new TD(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[i]=new EL(this.baseTexture,a,h,u,o.rotated?2:0,o.anchor),EL.addToCache(this.textures[i],i)}r++}},t.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var r=0;r<t[e].length;r++){var n=t[e][r];this.animations[e].push(this.textures[n])}}},t.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},t.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((function(){e._batchIndex*t.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())}),0)},t.prototype.destroy=function(t){var e;for(var r in void 0===t&&(t=!1),this.textures)this.textures[r].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null===(e=this._texture)||void 0===e||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},t.BATCH_SIZE=1e3,t}(),qB=function(){function t(){}return t.use=function(e,r){var n,i,o=this,s=e.name+"_image";if(e.data&&e.type===DN.TYPE.JSON&&e.data.frames&&!o.resources[s]){var a=null===(i=null===(n=e.data)||void 0===n?void 0:n.meta)||void 0===i?void 0:i.related_multi_packs;if(Array.isArray(a))for(var u=function(t){if("string"!=typeof t)return"continue";var r=t.replace(".json",""),n=GM.resolve(e.url.replace(o.baseUrl,""),t);if(o.resources[r]||Object.values(o.resources).some((function(t){return GM.format(GM.parse(t.url))===n})))return"continue";var i={crossOrigin:e.crossOrigin,loadType:DN.LOAD_TYPE.XHR,xhrType:DN.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};o.add(r,n,i)},c=0,h=a;c<h.length;c++){u(h[c])}var l={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},d=t.getResourcePath(e,o.baseUrl);o.add(s,d,l,(function(t){if(t.error)r(t.error);else{var n=new KB(t.texture,e.data,e.url);n.parse().then((function(){e.spritesheet=n,e.textures=n.textures,r()}))}}))}else r()},t.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:GM.resolve(t.url.replace(e,""),t.data.meta.image)},t.extension=HD.Loader,t}(),QB=function(t,e){return QB=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},QB(t,e)};function $B(t,e){function r(){this.constructor=t}QB(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var tG=new _D,eG=function(t){function e(e,r,n){void 0===r&&(r=100),void 0===n&&(n=100);var i=t.call(this,e)||this;return i.tileTransform=new ND,i._width=r,i._height=n,i.uvMatrix=i.texture.uvMatrix||new wF(e),i.pluginName="tilingSprite",i.uvRespectAnchor=!1,i}return $B(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),n=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,n)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new TD),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,tG);var e=this._width,r=this._height,n=-e*this.anchor._x;if(tG.x>=n&&tG.x<n+e){var i=-r*this.anchor._y;if(tG.y>=i&&tG.y<i+r)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,r){return new e(t instanceof EL?t:EL.from(t,r),r.width,r.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(SB),rG="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",nG=new CD,iG=function(t){function e(e){var r=t.call(this,e)||this;return e.runners.contextChange.add(r),r.quad=new FL,r.state=xF.for2d(),r}return $B(e,t),e.prototype.contextChange=function(){var t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=TF.from(rG,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n    vec4 texSample = texture2D(uSampler, vTextureCoord);\n    gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?TF.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    vec2 unclamped = coord;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n    fragmentColor = texSample * uColor;\n}\n",e):TF.from(rG,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n    #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    vec2 unclamped = coord;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    #ifdef GL_EXT_shader_texture_lod\n        vec4 texSample = unclamped == coord\n            ? texture2D(uSampler, coord) \n            : texture2DLodEXT(uSampler, coord, 0);\n    #else\n        vec4 texSample = texture2D(uSampler, coord);\n    #endif\n\n    gl_FragColor = texSample * uColor;\n}\n",e)},e.prototype.render=function(t){var e=this.renderer,r=this.quad,n=r.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y);var i=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;(n=r.uvs)[0]=n[6]=-i,n[1]=n[3]=-o,n[2]=n[4]=1-i,n[5]=n[7]=1-o,r.invalidate();var s=t._texture,a=s.baseTexture,u=a.alphaMode>0,c=t.tileTransform.localTransform,h=t.uvMatrix,l=a.isPowerOfTwo&&s.frame.width===a.width&&s.frame.height===a.height;l&&(a._glTextures[e.CONTEXT_UID]?l=a.wrapMode!==kP.CLAMP:a.wrapMode===kP.CLAMP&&(a.wrapMode=kP.REPEAT));var d=l?this.simpleShader:this.shader,f=s.width,p=s.height,v=t._width,m=t._height;nG.set(c.a*f/v,c.b*f/m,c.c*p/v,c.d*p/m,c.tx/v,c.ty/m),nG.invert(),l?nG.prepend(h.mapCoord):(d.uniforms.uMapCoord=h.mapCoord.toArray(!0),d.uniforms.uClampFrame=h.uClampFrame,d.uniforms.uClampOffset=h.uClampOffset),d.uniforms.uTransform=nG.toArray(!0),d.uniforms.uColor=qM(t.tint,t.worldAlpha,d.uniforms.uColor,u),d.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),d.uniforms.uSampler=s,e.shader.bind(d),e.geometry.bind(r),this.state.blendMode=JM(t.blendMode,u),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:HD.RendererPlugin},e}(XL),oG=function(t,e){return oG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},oG(t,e)};function sG(t,e){function r(){this.constructor=t}oG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var aG=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),uG=new _D,cG=new SD,hG=function(t){function e(e,r,n,i){void 0===i&&(i=IP.TRIANGLES);var o=t.call(this)||this;return o.geometry=e,o.shader=r,o.state=n||xF.for2d(),o.drawMode=i,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=-1,o._transformID=-1,o._roundPixels=vA.ROUND_PIXELS,o.batchUvs=null,o}return sG(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===IP.TRIANGLES&&r.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;var n=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[n]),t.plugins[n].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var n=this.transform.worldTransform,i=n.a,o=n.b,s=n.c,a=n.d,u=n.tx,c=n.ty,h=this.vertexData,l=0;l<h.length/2;l++){var d=e[2*l],f=e[2*l+1];h[2*l]=i*d+s*f+u,h[2*l+1]=o*d+a*f+c}if(this._roundPixels){var p=vA.RESOLUTION;for(l=0;l<h.length;++l)h[l]=Math.round((h[l]*p|0)/p)}this.vertexDirty=r}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new aG(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,uG);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=cG.points,n=this.geometry.getIndex().data,i=n.length,o=4===this.drawMode?3:1,s=0;s+2<i;s+=o){var a=2*n[s],u=2*n[s+1],c=2*n[s+2];if(r[0]=e[a],r[1]=e[a+1],r[2]=e[u],r[3]=e[u+1],r[4]=e[c],r[5]=e[c+1],cG.contains(uG.x,uG.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(VD),lG=function(t){function e(e,r){var n=this,i={uSampler:e,alpha:1,uTextureMatrix:CD.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r)).uniforms&&Object.assign(i,r.uniforms),(n=t.call(this,r.program||bF.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),i)||this)._colorDirty=!1,n.uvMatrix=new wF(e),n.batchable=void 0===r.program,n.pluginName=r.pluginName,n.tint=r.tint,n.alpha=r.alpha,n}return sG(e,t),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;qM(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(TF),dG=function(t){function e(e,r,n){var i=t.call(this)||this,o=new PL(e),s=new PL(r,!0),a=new PL(n,!0,!0);return i.addAttribute("aVertexPosition",o,2,!1,LP.FLOAT).addAttribute("aTextureCoord",s,2,!1,LP.FLOAT).addIndex(a),i._updateId=-1,i}return sG(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(DL),fG=function(t,e){return fG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},fG(t,e)};var pG=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},vG=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in e){var i=e[n].match(/^[a-z]+/gm)[0],o=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var a in o){var u=o[a].split("="),c=u[0],h=u[1].replace(/"/gm,""),l=parseFloat(h),d=isNaN(l)?h:l;s[c]=d}r[i].push(s)}var f=new pG;return r.info.forEach((function(t){return f.info.push({face:t.face,size:parseInt(t.size,10)})})),r.common.forEach((function(t){return f.common.push({lineHeight:parseInt(t.lineHeight,10)})})),r.page.forEach((function(t){return f.page.push({id:parseInt(t.id,10),file:t.file})})),r.char.forEach((function(t){return f.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),r.kerning.forEach((function(t){return f.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),r.distanceField.forEach((function(t){return f.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})})),f},t}(),mG=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new pG,r=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),i=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField"),u=0;u<r.length;u++)e.info.push({face:r[u].getAttribute("face"),size:parseInt(r[u].getAttribute("size"),10)});for(u=0;u<n.length;u++)e.common.push({lineHeight:parseInt(n[u].getAttribute("lineHeight"),10)});for(u=0;u<i.length;u++)e.page.push({id:parseInt(i[u].getAttribute("id"),10)||0,file:i[u].getAttribute("file")});for(u=0;u<o.length;u++){var c=o[u];e.char.push({id:parseInt(c.getAttribute("id"),10),page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xoffset:parseInt(c.getAttribute("xoffset"),10),yoffset:parseInt(c.getAttribute("yoffset"),10),xadvance:parseInt(c.getAttribute("xadvance"),10)})}for(u=0;u<s.length;u++)e.kerning.push({first:parseInt(s[u].getAttribute("first"),10),second:parseInt(s[u].getAttribute("second"),10),amount:parseInt(s[u].getAttribute("amount"),10)});for(u=0;u<a.length;u++)e.distanceField.push({fieldType:a[u].getAttribute("fieldType"),distanceRange:parseInt(a[u].getAttribute("distanceRange"),10)});return e},t}(),yG=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return mG.test(e)}return!1},t.parse=function(t){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return mG.parse(e)},t}(),gG=[vG,mG,yG];function _G(t){for(var e=0;e<gG.length;e++)if(gG[e].test(t))return gG[e];return null}function bG(t,e,r,n,i,o,s){var a=r.text,u=r.fontProperties;e.translate(n,i),e.scale(o,o);var c=s.strokeThickness/2,h=-s.strokeThickness/2;if(e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=function(t,e,r,n,i,o){var s,a=r.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];var u=r.dropShadow?r.dropShadowDistance:0,c=r.padding||0,h=t.width/n-u-2*c,l=t.height/n-u-2*c,d=a.slice(),f=r.fillGradientStops.slice();if(!f.length)for(var p=d.length+1,v=1;v<p;++v)f.push(v/p);if(d.unshift(a[0]),f.unshift(0),d.push(a[a.length-1]),f.push(1),r.fillGradientType===TB.LINEAR_VERTICAL){s=e.createLinearGradient(h/2,c,h/2,l+c);var m=0,y=(o.fontProperties.fontSize+r.strokeThickness)/l;for(v=0;v<i.length;v++)for(var g=o.lineHeight*v,_=0;_<d.length;_++){var b=g/l+("number"==typeof f[_]?f[_]:_/d.length)*y,T=Math.max(m,b);T=Math.min(T,1),s.addColorStop(T,d[_]),m=T}}else{s=e.createLinearGradient(c,l/2,h+c,l/2);var x=d.length+1,E=1;for(v=0;v<d.length;v++){var S=void 0;S="number"==typeof f[v]?f[v]:E/x,s.addColorStop(S,d[v]),E++}}return s}(t,e,s,o,[a],r),e.strokeStyle=s.stroke,s.dropShadow){var l=s.dropShadowColor,d=HM("number"==typeof l?l:YM(l)),f=s.dropShadowBlur*o,p=s.dropShadowDistance*o;e.shadowColor="rgba("+255*d[0]+","+255*d[1]+","+255*d[2]+","+s.dropShadowAlpha+")",e.shadowBlur=f,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*p,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*p}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;s.stroke&&s.strokeThickness&&e.strokeText(a,c,h+r.lineHeight-u.descent),s.fill&&e.fillText(a,c,h+r.lineHeight-u.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function TG(t){return Array.from?Array.from(t):t.split("")}function xG(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}var EG=function(){function t(t,e,r){var n,i,o=t.info[0],s=t.common[0],a=t.page[0],u=t.distanceField[0],c=pD(a.file),h={};this._ownsTextures=r,this.font=o.face,this.size=o.size,this.lineHeight=s.lineHeight/c,this.chars={},this.pageTextures=h;for(var l=0;l<t.page.length;l++){var d=t.page[l],f=d.id,p=d.file;h[f]=e instanceof Array?e[l]:e[p],(null==u?void 0:u.fieldType)&&"none"!==u.fieldType&&(h[f].baseTexture.alphaMode=GP.NO_PREMULTIPLIED_ALPHA,h[f].baseTexture.mipmap=BP.OFF)}for(l=0;l<t.char.length;l++){var v=t.char[l],m=(f=v.id,v.page),y=t.char[l],g=y.x,_=y.y,b=y.width,T=y.height,x=y.xoffset,E=y.yoffset,S=y.xadvance;_/=c,b/=c,T/=c,x/=c,E/=c,S/=c;var w=new TD((g/=c)+h[m].frame.x/c,_+h[m].frame.y/c,b,T);this.chars[f]={xOffset:x,yOffset:E,xAdvance:S,kerning:{},texture:new EL(h[m].baseTexture,w),page:m}}for(l=0;l<t.kerning.length;l++){var R=t.kerning[l],C=R.first,P=R.second,A=R.amount;C/=c,P/=c,A/=c,this.chars[P]&&(this.chars[P].kerning[C]=A)}this.distanceFieldRange=null==u?void 0:u.distanceRange,this.distanceFieldType=null!==(i=null===(n=null==u?void 0:u.fieldType)||void 0===n?void 0:n.toLowerCase())&&void 0!==i?i:"none"}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r,n){var i;if(e instanceof pG)i=e;else{var o=_G(e);if(!o)throw new Error("Unrecognized data format for font.");i=o.parse(e)}r instanceof EL&&(r=[r]);var s=new t(i,r,n);return t.available[s.font]=s,s},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var i=Object.assign({},t.defaultOptions,n),o=i.chars,s=i.padding,a=i.resolution,u=i.textureWidth,c=i.textureHeight,h=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r];if(Array.isArray(i)){if(2!==i.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+i.length+".");var o=i[0].charCodeAt(0),s=i[1].charCodeAt(0);if(s<o)throw new Error("[BitmapFont]: Invalid character range.");for(var a=o,u=s;a<=u;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,TG(i))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(o),l=r instanceof PB?r:new PB(r),d=u,f=new pG;f.info[0]={face:l.fontFamily,size:l.fontSize},f.common[0]={lineHeight:l.fontSize};for(var p,v,m,y=0,g=0,_=0,b=[],T=0;T<h.length;T++){p||((p=vA.ADAPTER.createCanvas()).width=u,p.height=c,v=p.getContext("2d"),m=new aL(p,{resolution:a}),b.push(new EL(m)),f.page.push({id:b.length-1,file:""}));var x=h[T],E=DB.measureText(x,l,!1,p),S=E.width,w=Math.ceil(E.height),R=Math.ceil(("italic"===l.fontStyle?2:1)*S);if(g>=c-w*a){if(0===g)throw new Error("[BitmapFont] textureHeight "+c+"px is too small (fontFamily: '"+l.fontFamily+"', fontSize: "+l.fontSize+"px, char: '"+x+"')");--T,p=null,v=null,m=null,g=0,y=0,_=0}else if(_=Math.max(w+E.fontProperties.descent,_),R*a+y>=d){if(0===y)throw new Error("[BitmapFont] textureWidth "+u+"px is too small (fontFamily: '"+l.fontFamily+"', fontSize: "+l.fontSize+"px, char: '"+x+"')");--T,g+=_*a,g=Math.ceil(g),y=0,_=0}else{bG(p,v,E,y,g,a,l);var C=xG(E.text);f.char.push({id:C,page:b.length-1,x:y/a,y:g/a,width:R,height:w,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(l.dropShadow?l.dropShadowDistance:0)-(l.stroke?l.strokeThickness:0))}),y+=(R+2*s)*a,y=Math.ceil(y)}}if(!(null==n?void 0:n.skipKerning)){T=0;for(var P=h.length;T<P;T++)for(var A=h[T],O=0;O<P;O++){var I=h[O],M=v.measureText(A).width,D=v.measureText(I).width,L=v.measureText(A+I).width-(M+D);L&&f.kerning.push({first:xG(A),second:xG(I),amount:L})}}var F=new t(f,b,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=F,F},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),SG=[],wG=[],RG=[];!function(t){function e(r,n){void 0===n&&(n={});var i=t.call(this)||this;i._tint=16777215;var o=Object.assign({},e.styleDefaults,n),s=o.align,a=o.tint,u=o.maxWidth,c=o.letterSpacing,h=o.fontName,l=o.fontSize;if(!EG.available[h])throw new Error('Missing BitmapFont "'+h+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=s,i._tint=a,i._font=void 0,i._fontName=h,i._fontSize=l,i.text=r,i._maxWidth=u,i._maxLineHeight=0,i._letterSpacing=c,i._anchor=new RD((function(){i.dirty=!0}),i,0,0),i._roundPixels=vA.ROUND_PIXELS,i.dirty=!0,i._resolution=vA.RESOLUTION,i._autoResolution=!0,i._textureCache={},i}(function(t,e){function r(){this.constructor=t}fG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),e.prototype.updateText=function(){for(var t,e=EG.available[this._fontName],r=this.fontSize,n=r/e.size,i=new _D,o=[],s=[],a=[],u=TG(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),c=this._maxWidth*e.size/r,h="none"===e.distanceFieldType?SG:wG,l=null,d=0,f=0,p=0,v=-1,m=0,y=0,g=0,_=0,b=0;b<u.length;b++){var T=xG(j=u[b]);if(/(?:\s)/.test(j)&&(v=b,m=d,_++),"\r"!==j&&"\n"!==j){var x=e.chars[T];if(x){l&&x.kerning[l]&&(i.x+=x.kerning[l]);var E=RG.pop()||{texture:EL.EMPTY,line:0,charCode:0,prevSpaces:0,position:new _D};E.texture=x.texture,E.line=p,E.charCode=T,E.position.x=i.x+x.xOffset+this._letterSpacing/2,E.position.y=i.y+x.yOffset,E.prevSpaces=_,o.push(E),d=E.position.x+Math.max(x.xAdvance-x.xOffset,x.texture.orig.width),i.x+=x.xAdvance+this._letterSpacing,g=Math.max(g,x.yOffset+x.texture.height),l=T,-1!==v&&c>0&&i.x>c&&(rD(o,1+v-++y,1+b-v),b=v,v=-1,s.push(m),a.push(o.length>0?o[o.length-1].prevSpaces:0),f=Math.max(f,m),p++,i.x=0,i.y+=e.lineHeight,l=null,_=0)}}else s.push(d),a.push(-1),f=Math.max(f,d),++p,++y,i.x=0,i.y+=e.lineHeight,l=null,_=0}var S=u[u.length-1];"\r"!==S&&"\n"!==S&&(/(?:\s)/.test(S)&&(d=m),s.push(d),f=Math.max(f,d),a.push(-1));var w=[];for(b=0;b<=p;b++){var R=0;"right"===this._align?R=f-s[b]:"center"===this._align?R=(f-s[b])/2:"justify"===this._align&&(R=a[b]<0?0:(f-s[b])/a[b]),w.push(R)}var C=o.length,P={},A=[],O=this._activePagesMeshData;h.push.apply(h,O);for(b=0;b<C;b++){var I=(V=o[b].texture).baseTexture.uid;if(!P[I]){if(!(K=h.pop())){var M=new dG,D=void 0,L=void 0;"none"===e.distanceFieldType?(D=new lG(EL.EMPTY),L=OP.NORMAL):(D=new lG(EL.EMPTY,{program:bF.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n  // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n  vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n  // MSDF\r\n  float median = texColor.r + texColor.g + texColor.b -\r\n                  min(texColor.r, min(texColor.g, texColor.b)) -\r\n                  max(texColor.r, max(texColor.g, texColor.b));\r\n  // SDF\r\n  median = min(median, texColor.a);\r\n\r\n  float screenPxDistance = uFWidth * (median - 0.5);\r\n  float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n  if (median < 0.01) {\r\n    alpha = 0.0;\r\n  } else if (median > 0.99) {\r\n    alpha = 1.0;\r\n  }\r\n\r\n  // NPM Textures, NPM outputs\r\n  gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),L=OP.NORMAL_NPM);var F=new hG(M,D);F.blendMode=L,K={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:F,vertices:null,uvs:null,indices:null}}K.index=0,K.indexCount=0,K.vertexCount=0,K.uvsCount=0,K.total=0;var N=this._textureCache;N[I]=N[I]||new EL(V.baseTexture),K.mesh.texture=N[I],K.mesh.tint=this._tint,A.push(K),P[I]=K}P[I].total++}for(b=0;b<O.length;b++)-1===A.indexOf(O[b])&&this.removeChild(O[b].mesh);for(b=0;b<A.length;b++)A[b].mesh.parent!==this&&this.addChild(A[b].mesh);for(var b in this._activePagesMeshData=A,P){var k=(K=P[b]).total;if(!((null===(t=K.indices)||void 0===t?void 0:t.length)>6*k)||K.vertices.length<2*hG.BATCHABLE_SIZE)K.vertices=new Float32Array(8*k),K.uvs=new Float32Array(8*k),K.indices=new Uint16Array(6*k);else for(var B=K.total,G=K.vertices,U=4*B*2;U<G.length;U++)G[U]=0;K.mesh.size=6*k}for(b=0;b<C;b++){var j,X=(j=o[b]).position.x+w[j.line]*("justify"===this._align?j.prevSpaces:1);this._roundPixels&&(X=Math.round(X));var V,H=X*n,W=j.position.y*n,Y=P[(V=j.texture).baseTexture.uid],z=V.frame,Z=V._uvs,J=Y.index++;Y.indices[6*J+0]=0+4*J,Y.indices[6*J+1]=1+4*J,Y.indices[6*J+2]=2+4*J,Y.indices[6*J+3]=0+4*J,Y.indices[6*J+4]=2+4*J,Y.indices[6*J+5]=3+4*J,Y.vertices[8*J+0]=H,Y.vertices[8*J+1]=W,Y.vertices[8*J+2]=H+z.width*n,Y.vertices[8*J+3]=W,Y.vertices[8*J+4]=H+z.width*n,Y.vertices[8*J+5]=W+z.height*n,Y.vertices[8*J+6]=H,Y.vertices[8*J+7]=W+z.height*n,Y.uvs[8*J+0]=Z.x0,Y.uvs[8*J+1]=Z.y0,Y.uvs[8*J+2]=Z.x1,Y.uvs[8*J+3]=Z.y1,Y.uvs[8*J+4]=Z.x2,Y.uvs[8*J+5]=Z.y2,Y.uvs[8*J+6]=Z.x3,Y.uvs[8*J+7]=Z.y3}for(var b in this._textWidth=f*n,this._textHeight=(i.y+e.lineHeight)*n,P){var K=P[b];if(0!==this.anchor.x||0!==this.anchor.y)for(var q=0,Q=this._textWidth*this.anchor.x,$=this._textHeight*this.anchor.y,tt=0;tt<K.total;tt++)K.vertices[q++]-=Q,K.vertices[q++]-=$,K.vertices[q++]-=Q,K.vertices[q++]-=$,K.vertices[q++]-=Q,K.vertices[q++]-=$,K.vertices[q++]-=Q,K.vertices[q++]-=$;this._maxLineHeight=g*n;var et=K.mesh.geometry.getBuffer("aVertexPosition"),rt=K.mesh.geometry.getBuffer("aTextureCoord"),nt=K.mesh.geometry.getIndex();et.data=K.vertices,rt.data=K.uvs,nt.data=K.indices,et.update(),rt.update(),nt.update()}for(b=0;b<o.length;b++)RG.push(o[b]);this._font=e,this.dirty=!1},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);var r=EG.available[this._fontName],n=r.distanceFieldRange,i=r.distanceFieldType,o=r.size;if("none"!==i)for(var s=this.worldTransform,a=s.a,u=s.b,c=s.c,h=s.d,l=Math.sqrt(a*a+u*u),d=Math.sqrt(c*c+h*h),f=(Math.abs(l)+Math.abs(d))/2,p=this.fontSize/o,v=0,m=this._activePagesMeshData;v<m.length;v++){m[v].mesh.shader.uniforms.uFWidth=f*n*p*this._resolution}t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){var t=EG.available[this._fontName];if(!t)throw new Error('Missing BitmapFont "'+this._fontName+'"');this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!EG.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){var t;return null!==(t=this._fontSize)&&void 0!==t?t:EG.available[this._fontName].size},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(e){var r=this._textureCache,n="none"===EG.available[this._fontName].distanceFieldType?SG:wG;n.push.apply(n,this._activePagesMeshData);for(var i=0,o=this._activePagesMeshData;i<o.length;i++){var s=o[i];this.removeChild(s.mesh)}for(var a in this._activePagesMeshData=[],n.filter((function(t){return r[t.mesh.texture.baseTexture.uid]})).forEach((function(t){t.mesh.texture=EL.EMPTY})),r){r[a].destroy(),delete r[a]}this._font=null,this._textureCache=null,t.prototype.destroy.call(this,e)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0}}(VD);var CG=function(){function t(){}return t.add=function(){DN.setExtensionXhrType("fnt",DN.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var n=_G(e.data);if(n)for(var i=t.getBaseUrl(this,e),o=n.parse(e.data),s={},a=function(t){s[t.metadata.pageFile]=t.texture,Object.keys(s).length===o.page.length&&(e.bitmapFont=EG.install(o,s,!0),r())},u=0;u<o.page.length;++u){var c=o.page[u].file,h=i+c,l=!1;for(var d in this.resources){var f=this.resources[d];if(f.url===h){f.metadata.pageFile=c,f.texture?a(f):f.onAfterMiddleware.add(a),l=!0;break}}if(!l){var p={crossOrigin:e.crossOrigin,loadType:DN.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:c},e.metadata.imageMetadata),parentResource:e};this.add(h,p,a)}}else r()},t.getBaseUrl=function(e,r){var n=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===n&&(n=""),e.baseUrl&&n&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(n+="/")),(n=n.replace(e.baseUrl,""))&&"/"!==n.charAt(n.length-1)&&(n+="/"),n},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t.extension=HD.Loader,t}(),PG=function(t,e){return PG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},PG(t,e)};!function(t){function e(e){void 0===e&&(e=1);var r=t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1})||this;return r.alpha=e,r}(function(t,e){function r(){this.constructor=t}PG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0})}(EF);var AG=function(t,e){return AG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},AG(t,e)};function OG(t,e){function r(){this.constructor=t}AG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var IG={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},MG=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");var DG=function(t){function e(e,r,n,i,o){void 0===r&&(r=8),void 0===n&&(n=4),void 0===i&&(i=vA.FILTER_RESOLUTION),void 0===o&&(o=5);var s=this,a=function(t,e){var r,n=Math.ceil(t/2),i="\n    attribute vec2 aVertexPosition;\n\n    uniform mat3 projectionMatrix;\n\n    uniform float strength;\n\n    varying vec2 vBlurTexCoords[%size%];\n\n    uniform vec4 inputSize;\n    uniform vec4 outputFrame;\n\n    vec4 filterVertexPosition( void )\n    {\n        vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n        return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n    }\n\n    vec2 filterTextureCoord( void )\n    {\n        return aVertexPosition * (outputFrame.zw * inputSize.zw);\n    }\n\n    void main(void)\n    {\n        gl_Position = filterVertexPosition();\n\n        vec2 textureCoord = filterTextureCoord();\n        %blur%\n    }",o="";r=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var a=r.replace("%index%",s.toString());o+=a=a.replace("%sampleIndex%",s-(n-1)+".0"),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",t.toString())}(o,e),u=function(t){for(var e,r=IG[t],n=r.length,i=MG,o="",s=0;s<t;s++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s.toString());e=s,s>=n&&(e=t-s-1),o+=a=a.replace("%value%",r[e].toString()),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",t.toString())}(o);return(s=t.call(this,a,u)||this).horizontal=e,s.resolution=i,s._quality=0,s.quality=n,s.blur=r,s}return OG(e,t),e.prototype.apply=function(t,e,r,n){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,n);else{var i=t.getFilterTexture(),o=t.renderer,s=e,a=i;this.state.blend=!1,t.applyFilter(this,s,a,UP.CLEAR);for(var u=1;u<this.passes-1;u++){t.bindAndClear(s,UP.BLIT),this.uniforms.uSampler=a;var c=a;a=s,s=c,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,r,n),t.returnFilterTexture(i)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+2*Math.abs(t),this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(EF);!function(t){function e(e,r,n,i){void 0===e&&(e=8),void 0===r&&(r=4),void 0===n&&(n=vA.FILTER_RESOLUTION),void 0===i&&(i=5);var o=t.call(this)||this;return o.blurXFilter=new DG(!0,e,r,n,i),o.blurYFilter=new DG(!1,e,r,n,i),o.resolution=n,o.quality=r,o.blur=e,o.repeatEdgePixels=!1,o}OG(e,t),e.prototype.apply=function(t,e,r,n){var i=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(i&&o){var s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,UP.CLEAR),this.blurYFilter.apply(t,s,r,n),t.returnFilterTexture(s)}else o?this.blurYFilter.apply(t,e,r,n):this.blurXFilter.apply(t,e,r,n)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0})}(EF);var LG=function(t,e){return LG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},LG(t,e)};var FG=function(t){function e(){var e=this,r={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,rN,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (uAlpha == 0.0) {\n        gl_FragColor = c;\n        return;\n    }\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (c.a > 0.0) {\n      c.rgb /= c.a;\n    }\n\n    vec4 result;\n\n    result.r = (m[0] * c.r);\n        result.r += (m[1] * c.g);\n        result.r += (m[2] * c.b);\n        result.r += (m[3] * c.a);\n        result.r += m[4];\n\n    result.g = (m[5] * c.r);\n        result.g += (m[6] * c.g);\n        result.g += (m[7] * c.b);\n        result.g += (m[8] * c.a);\n        result.g += m[9];\n\n    result.b = (m[10] * c.r);\n       result.b += (m[11] * c.g);\n       result.b += (m[12] * c.b);\n       result.b += (m[13] * c.a);\n       result.b += m[14];\n\n    result.a = (m[15] * c.r);\n       result.a += (m[16] * c.g);\n       result.a += (m[17] * c.b);\n       result.a += (m[18] * c.a);\n       result.a += m[19];\n\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n    // Premultiply alpha again.\n    rgb *= result.a;\n\n    gl_FragColor = vec4(rgb, result.a);\n}\n",r)||this).alpha=1,e}return function(t,e){function r(){this.constructor=t}LG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.tint=function(t,e){var r=[(t>>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),n=Math.sin(t),i=1/3,o=(0,Math.sqrt)(i),s=[r+(1-r)*i,i*(1-r)-o*n,i*(1-r)+o*n,0,0,i*(1-r)+o*n,r+i*(1-r),i*(1-r)-o*n,0,0,i*(1-r)-o*n,i*(1-r)+o*n,r+i*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,n=-.5*(r-1),i=[r,0,0,0,n,0,r,0,0,n,0,0,r,0,n,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,n=-.5*(r-1),i=[r,n,n,0,0,n,r,n,0,0,n,n,r,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,n,i){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,u=((n=n||3375104)>>16&255)/255,c=(n>>8&255)/255,h=(255&n)/255,l=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,u,c,h,e=e||.15,0,o-u,s-c,a-h,0,0];this._loadMatrix(l,i)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(EF);FG.prototype.grayscale=FG.prototype.greyscale;var NG=function(t,e){return NG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},NG(t,e)};!function(t){function e(e,r){var n=this,i=new CD;return e.renderable=!1,(n=t.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0)  ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n  vec4 map =  texture2D(mapSampler, vFilterCoord);\n\n  map -= 0.5;\n  map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,n.maskMatrix=i,null==r&&(r=20),n.scale=new _D(r,r),n}(function(t,e){function r(){this.constructor=t}NG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),e.prototype.apply=function(t,e,r,n){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),s=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/s,this.uniforms.rotation[3]=i.d/s),t.applyFilter(this,e,r,n)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0})}(EF);var kG=function(t,e){return kG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},kG(t,e)};!function(t){function e(){return t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n               out vec2 v_rgbNW, out vec2 v_rgbNE,\n               out vec2 v_rgbSW, out vec2 v_rgbSE,\n               out vec2 v_rgbM) {\n    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n    v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n   gl_Position = filterVertexPosition();\n\n   vFragCoord = aVertexPosition * outputFrame.zw;\n\n   texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN   (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL   (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX     8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n          vec2 v_rgbNW, vec2 v_rgbNE,\n          vec2 v_rgbSW, vec2 v_rgbSE,\n          vec2 v_rgbM) {\n    vec4 color;\n    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n    vec4 texColor = texture2D(tex, v_rgbM);\n    vec3 rgbM  = texColor.xyz;\n    vec3 luma = vec3(0.299, 0.587, 0.114);\n    float lumaNW = dot(rgbNW, luma);\n    float lumaNE = dot(rgbNE, luma);\n    float lumaSW = dot(rgbSW, luma);\n    float lumaSE = dot(rgbSE, luma);\n    float lumaM  = dot(rgbM,  luma);\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n    mediump vec2 dir;\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n                  dir * rcpDirMin)) * inverseVP;\n\n    vec3 rgbA = 0.5 * (\n                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\n                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n    float lumaB = dot(rgbB, luma);\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\n        color = vec4(rgbA, texColor.a);\n    else\n        color = vec4(rgbB, texColor.a);\n    return color;\n}\n\nvoid main() {\n\n      vec4 color;\n\n      color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n      gl_FragColor = color;\n}\n')||this}(function(t,e){function r(){this.constructor=t}kG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t)}(EF);var BG=function(t,e){return BG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},BG(t,e)};!function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random());var n=t.call(this,rN,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n    vec4 color = texture2D(uSampler, vTextureCoord);\n    float randomValue = rand(gl_FragCoord.xy * uSeed);\n    float diff = (randomValue - 0.5) * uNoise;\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (color.a > 0.0) {\n        color.rgb /= color.a;\n    }\n\n    color.r += diff;\n    color.g += diff;\n    color.b += diff;\n\n    // Premultiply alpha again.\n    color.rgb *= color.a;\n\n    gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return n.noise=e,n.seed=r,n}(function(t,e){function r(){this.constructor=t}BG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0})}(EF);var GG=new CD;UD.prototype._cacheAsBitmap=!1,UD.prototype._cacheData=null,UD.prototype._cacheAsBitmapResolution=null,UD.prototype._cacheAsBitmapMultisample=WP.NONE;var UG=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(UD.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new UG),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),UD.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},UD.prototype._initCachedDisplayObject=function(t){var e;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,t.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var i=this.filters[0].padding;n.pad(i)}n.ceil(vA.RESOLUTION);var o=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),u=t.projection.transform,c=SL.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),h="cacheAsBitmap_"+oD();this._cacheData.textureCacheId=h,aL.addToCache(c.baseTexture,h),EL.addToCache(c,h);var l=this.transform.localTransform.copyTo(GG).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:c,clear:!0,transform:l,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=u,t.renderTexture.bind(o,s,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new SB(c);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-n.x/n.width,d.anchor.y=-n.y/n.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},UD.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},UD.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var n=t.context,i=t._projTransform;e.ceil(vA.RESOLUTION);var o=SL.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+oD();this._cacheData.textureCacheId=s,aL.addToCache(o.baseTexture,s),EL.addToCache(o,s);var a=GG;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:a,skipUpdateTransform:!1}),t.context=n,t._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var u=new SB(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-e.x/e.width,u.anchor.y=-e.y/e.height,u.alpha=r,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},UD.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},UD.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},UD.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,aL.removeFromCache(this._cacheData.textureCacheId),EL.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},UD.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},UD.prototype.name=null,VD.prototype.getChildByName=function(t,e){for(var r=0,n=this.children.length;r<n;r++)if(this.children[r].name===t)return this.children[r];if(e)for(r=0,n=this.children.length;r<n;r++){var i=this.children[r];if(i.getChildByName){var o=i.getChildByName(t,!0);if(o)return o}}return null},UD.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new _D),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var jG=function(){function t(){}return t.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,r;if(e.cancelResize(),e._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{var n=e._resizeTo;t=n.clientWidth,r=n.clientHeight}e.renderer.resize(t,r)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},t.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t.extension=HD.Application,t}(),XG=function(){function t(e){var r=this;this.stage=new VD,e=Object.assign({forceCanvas:!1},e),this.renderer=eN(e),t._plugins.forEach((function(t){t.init.call(r,e)}))}return t.registerPlugin=function(t){aD("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),ZD.add({type:HD.Application,ref:t})},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e,r){var n=this,i=t._plugins.slice(0);i.reverse(),i.forEach((function(t){t.destroy.call(n)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null},t._plugins=[],t}();ZD.handleByList(HD.Application,XG._plugins),ZD.add(jG);var VG=function(t,e){return VG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},VG(t,e)};function HG(t,e){function r(){this.constructor=t}VG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var WG=function(t){function e(e,r,n,i){void 0===e&&(e=100),void 0===r&&(r=100),void 0===n&&(n=10),void 0===i&&(i=10);var o=t.call(this)||this;return o.segWidth=n,o.segHeight=i,o.width=e,o.height=r,o.build(),o}return HG(e,t),e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],n=[],i=this.segWidth-1,o=this.segHeight-1,s=this.width/i,a=this.height/o,u=0;u<t;u++){var c=u%this.segWidth,h=u/this.segWidth|0;e.push(c*s,h*a),r.push(c/i,h/o)}var l=i*o;for(u=0;u<l;u++){var d=u%i,f=u/i|0,p=f*this.segWidth+d,v=f*this.segWidth+d+1,m=(f+1)*this.segWidth+d,y=(f+1)*this.segWidth+d+1;n.push(p,v,m,v,y,m)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint16Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(dG),YG=function(t){function e(e,r,n){void 0===e&&(e=200),void 0===n&&(n=0);var i=t.call(this,new Float32Array(4*r.length),new Float32Array(4*r.length),new Uint16Array(6*(r.length-1)))||this;return i.points=r,i._width=e,i.textureScale=n,i.build(),i}return HG(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),n=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),r.data=new Float32Array(4*t.length),n.data=new Uint16Array(6*(t.length-1)));var i=r.data,o=n.data;i[0]=0,i[1]=0,i[2]=0,i[3]=1;for(var s=0,a=t[0],u=this._width*this.textureScale,c=t.length,h=0;h<c;h++){var l=4*h;if(this.textureScale>0){var d=a.x-t[h].x,f=a.y-t[h].y,p=Math.sqrt(d*d+f*f);a=t[h],s+=p/u}else s=h/(c-1);i[l]=s,i[l+1]=0,i[l+2]=s,i[l+3]=1}var v=0;for(h=0;h<c-1;h++){l=2*h;o[v++]=l,o[v++]=l+1,o[v++]=l+2,o[v++]=l+2,o[v++]=l+1,o[v++]=l+3}r.update(),n.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,r=t[0],n=0,i=0,o=this.buffers[0].data,s=t.length,a=0;a<s;a++){var u=t[a],c=4*a;i=-((e=a<t.length-1?t[a+1]:u).x-r.x),n=e.y-r.y;var h=Math.sqrt(n*n+i*i),l=this.textureScale>0?this.textureScale*this._width/2:this._width/2;n/=h,i/=h,n*=l,i*=l,o[c]=u.x+n,o[c+1]=u.y+i,o[c+2]=u.x-n,o[c+3]=u.y-i,r=u}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(dG),zG=function(t){function e(e,r,n){void 0===n&&(n=0);var i=this,o=new YG(e.height,r,n),s=new lG(e);return n>0&&(e.baseTexture.wrapMode=kP.REPEAT),(i=t.call(this,o,s)||this).autoUpdate=!0,i}return HG(e,t),e.prototype._render=function(e){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),t.prototype._render.call(this,e)},e}(hG),ZG=function(t){function e(e,r,n){var i=this,o=new WG(e.width,e.height,r,n),s=new lG(EL.WHITE);return(i=t.call(this,o,s)||this).texture=e,i.autoResize=!0,i}return HG(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,r=e.width,n=e.height;!this.autoResize||t.width===r&&t.height===n||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(hG),JG=function(t){function e(e,r,n,i,o){void 0===e&&(e=EL.EMPTY);var s=this,a=new dG(r,n,i);a.getBuffer("aVertexPosition").static=!1;var u=new lG(e);return(s=t.call(this,a,u,null,o)||this).autoUpdate=!0,s}return HG(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(hG),KG=function(t){function e(e,r,n,i,o){void 0===r&&(r=10),void 0===n&&(n=10),void 0===i&&(i=10),void 0===o&&(o=10);var s=t.call(this,EL.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=i,s._topHeight=n,s._bottomHeight=o,s.texture=e,s}return HG(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,r=this._topHeight+this._bottomHeight,n=this._height>r?1:this._height/r;return Math.min(e,n)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,n=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=n*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-n*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(ZG),qG=function(t,e){return qG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},qG(t,e)};!function(t){function e(e,r){void 0===r&&(r=!0);var n=t.call(this,e[0]instanceof EL?e[0]:e[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=r,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=e,n}(function(t,e){function r(){this.constructor=t}qG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(qD.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(qD.shared.add(this.update,this,YD.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var n=this._currentTime%1*this._durations[this.currentFrame];for(n+=e/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<r||this.animationSpeed<0&&this.currentFrame>r)&&this.onLoop(),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],n=0;n<t.length;++n)r.push(EL.from(t[n]));return new e(r)},e.fromImages=function(t){for(var r=[],n=0;n<t.length;++n)r.push(EL.from(t[n]));return new e(r)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof EL)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(qD.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(qD.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0})}(SB),ZD.add(fN,EN,TN,Wk,JB,dN,iG,CG,ek,kk,Bk,qB,QD,UN);var QG=function(t,e){return QG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},QG(t,e)};var $G=function(){function t(t){this._foundShapes=[],this.renderer=t}return t.prototype.pushMask=function(t){var e=this.renderer,r=t.maskObject||t;e.context.save();var n=this._foundShapes;if(this.recursiveFindShapes(r,n),n.length>0){var i=e.context;i.beginPath();for(var o=0;o<n.length;o++){var s=n[o],a=s.transform.worldTransform;this.renderer.setContextTransform(a),this.renderGraphicsShape(s)}n.length=0,i.clip()}},t.prototype.recursiveFindShapes=function(t,e){t.geometry&&t.geometry.graphicsData&&e.push(t);var r=t.children;if(r)for(var n=0;n<r.length;n++)this.recursiveFindShapes(r[n],e)},t.prototype.renderGraphicsShape=function(t){t.finishPoly();var e=this.renderer.context,r=t.geometry.graphicsData,n=r.length;if(0!==n)for(var i=0;i<n;i++){var o=r[i],s=o.shape;if(s.type===vD.POLY){var a=s.points,u=o.holes,c=void 0,h=void 0,l=void 0,d=void 0;e.moveTo(a[0],a[1]);for(var f=1;f<a.length/2;f++)e.lineTo(a[2*f],a[2*f+1]);if(u.length>0){c=0,l=a[0],d=a[1];for(f=2;f+2<a.length;f+=2)c+=(a[f]-l)*(a[f+3]-d)-(a[f+2]-l)*(a[f+1]-d);for(var p=0;p<u.length;p++)if(a=u[p].shape.points){h=0,l=a[0],d=a[1];for(f=2;f+2<a.length;f+=2)h+=(a[f]-l)*(a[f+3]-d)-(a[f+2]-l)*(a[f+1]-d);if(h*c<0){e.moveTo(a[0],a[1]);for(f=2;f<a.length;f+=2)e.lineTo(a[f],a[f+1])}else{e.moveTo(a[a.length-2],a[a.length-1]);for(f=a.length-4;f>=0;f-=2)e.lineTo(a[f],a[f+1])}u[p].shape.closeStroke&&e.closePath()}}a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&e.closePath()}else if(s.type===vD.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(s.type===vD.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(s.type===vD.ELIP){var v=2*s.width,m=2*s.height,y=s.x-v/2,g=s.y-m/2,_=.5522848,b=v/2*_,T=m/2*_,x=y+v,E=g+m,S=y+v/2,w=g+m/2;e.moveTo(y,w),e.bezierCurveTo(y,w-T,S-b,g,S,g),e.bezierCurveTo(S+b,g,x,w-T,x,w),e.bezierCurveTo(x,w+T,S+b,E,S,E),e.bezierCurveTo(S-b,E,y,w+T,y,w),e.closePath()}else if(s.type===vD.RREC){var R=s.x,C=s.y,P=s.width,A=s.height,O=s.radius,I=Math.min(P,A)/2;O=O>I?I:O,e.moveTo(R,C+O),e.lineTo(R,C+A-O),e.quadraticCurveTo(R,C+A,R+O,C+A),e.lineTo(R+P-O,C+A),e.quadraticCurveTo(R+P,C+A,R+P,C+A-O),e.lineTo(R+P,C+O),e.quadraticCurveTo(R+P,C,R+P-O,C),e.lineTo(R+O,C),e.quadraticCurveTo(R,C,R,C+O),e.closePath()}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();function tU(t){var e=vA.ADAPTER.createCanvas(6,1),r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}function eU(){if("undefined"==typeof document)return!1;var t=tU("#ff00ff"),e=tU("#ffff00"),r=vA.ADAPTER.createCanvas(6,1).getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(t,0,0),r.drawImage(e,2,0);var n=r.getImageData(2,0,1,1);if(!n)return!1;var i=n.data;return 255===i[0]&&0===i[1]&&0===i[2]}var rU=new CD,nU=function(t){function e(r){var n,i=t.call(this,PP.CANVAS,r)||this;if(i.refresh=!0,i.maskManager=new $G(i),i.smoothProperty="imageSmoothingEnabled",i.blendModes=(void 0===n&&(n=[]),eU()?(n[OP.NORMAL]="source-over",n[OP.ADD]="lighter",n[OP.MULTIPLY]="multiply",n[OP.SCREEN]="screen",n[OP.OVERLAY]="overlay",n[OP.DARKEN]="darken",n[OP.LIGHTEN]="lighten",n[OP.COLOR_DODGE]="color-dodge",n[OP.COLOR_BURN]="color-burn",n[OP.HARD_LIGHT]="hard-light",n[OP.SOFT_LIGHT]="soft-light",n[OP.DIFFERENCE]="difference",n[OP.EXCLUSION]="exclusion",n[OP.HUE]="hue",n[OP.SATURATION]="saturation",n[OP.COLOR]="color",n[OP.LUMINOSITY]="luminosity"):(n[OP.NORMAL]="source-over",n[OP.ADD]="lighter",n[OP.MULTIPLY]="source-over",n[OP.SCREEN]="source-over",n[OP.OVERLAY]="source-over",n[OP.DARKEN]="source-over",n[OP.LIGHTEN]="source-over",n[OP.COLOR_DODGE]="source-over",n[OP.COLOR_BURN]="source-over",n[OP.HARD_LIGHT]="source-over",n[OP.SOFT_LIGHT]="source-over",n[OP.DIFFERENCE]="source-over",n[OP.EXCLUSION]="source-over",n[OP.HUE]="source-over",n[OP.SATURATION]="source-over",n[OP.COLOR]="source-over",n[OP.LUMINOSITY]="source-over"),n[OP.NORMAL_NPM]=n[OP.NORMAL],n[OP.ADD_NPM]=n[OP.ADD],n[OP.SCREEN_NPM]=n[OP.SCREEN],n[OP.SRC_IN]="source-in",n[OP.SRC_OUT]="source-out",n[OP.SRC_ATOP]="source-atop",n[OP.DST_OVER]="destination-over",n[OP.DST_IN]="destination-in",n[OP.DST_OUT]="destination-out",n[OP.DST_ATOP]="destination-atop",n[OP.XOR]="xor",n[OP.SUBTRACT]="source-over",n),i.renderingToScreen=!1,i._activeBlendMode=null,i._projTransform=null,i._outerBlend=!1,i.rootContext=i.view.getContext("2d",{alpha:i.useContextAlpha}),i.context=i.rootContext,!i.rootContext.imageSmoothingEnabled){var o=i.rootContext;o.webkitImageSmoothingEnabled?i.smoothProperty="webkitImageSmoothingEnabled":o.mozImageSmoothingEnabled?i.smoothProperty="mozImageSmoothingEnabled":o.oImageSmoothingEnabled?i.smoothProperty="oImageSmoothingEnabled":o.msImageSmoothingEnabled&&(i.smoothProperty="msImageSmoothingEnabled")}return i.initPlugins(e.__plugins),XM("Canvas"),i.resize(i.options.width,i.options.height),i}return function(t,e){function r(){this.constructor=t}QG(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.addSystem=function(){return this},e.prototype.render=function(t,e){if(this.view){var r,n,i,o;e&&(e instanceof SL||e instanceof _L?(aD("6.0.0","CanvasRenderer#render arguments changed, use options instead."),r=e,n=arguments[2],i=arguments[3],o=arguments[4]):(r=e.renderTexture,n=e.clear,i=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.emit("prerender");var s=this.resolution;r?((r=r.castToBaseTexture())._canvasRenderTarget||(r._canvasRenderTarget=new dD(r.width,r.height,r.resolution),r.resource=new lL(r._canvasRenderTarget.canvas),r.valid=!0),this.context=r._canvasRenderTarget.context,this.resolution=r._canvasRenderTarget.resolution):this.context=this.rootContext;var a=this.context;if(this._projTransform=i||null,r||(this._lastObjectRendered=t),!o){var u=t.enableTempParent();t.updateTransform(),t.disableTempParent(u)}if(a.save(),a.setTransform(1,0,0,1,0,0),a.globalAlpha=1,this._activeBlendMode=OP.NORMAL,this._outerBlend=!1,a.globalCompositeOperation=this.blendModes[OP.NORMAL],void 0!==n?n:this.clearBeforeRender)if(this.renderingToScreen)a.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(a.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,a.fillStyle=this._backgroundColorString,a.fillRect(0,0,this.width,this.height),a.globalAlpha=1);else{r._canvasRenderTarget.clear();var c=r.clearColor;c[3]>0&&(a.globalAlpha=this.useContextAlpha?c[3]:1,a.fillStyle=WM(zM(c)),a.fillRect(0,0,r.realWidth,r.realHeight),a.globalAlpha=1)}var h=this.context;this.context=a,t.renderCanvas(this),this.context=h,a.restore(),this.resolution=s,this._projTransform=null,this.emit("postrender")}},e.prototype.setContextTransform=function(t,e,r){var n=t,i=this._projTransform,o=this.resolution;r=r||o,i&&((n=rU).copyFrom(t),n.prepend(i)),e?this.context.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*o|0,n.ty*o|0):this.context.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*o,n.ty*o)},e.prototype.clear=function(t,e){void 0===t&&(t=this._backgroundColorString),void 0===e&&(e=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),t&&(r.globalAlpha=this.useContextAlpha?e:1,r.fillStyle=t,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},e.prototype.setBlendMode=function(t,e){var r=t===OP.SRC_IN||t===OP.SRC_OUT||t===OP.DST_IN||t===OP.DST_ATOP;!e&&r&&(t=OP.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=vA.SCALE_MODE===NP.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,e){aD("6.5.0","CanvasRenderer.registerPlugin() has been deprecated, please use extensions.add() instead."),ZD.add({name:t,type:HD.CanvasRendererPlugin,ref:e})},e.__plugins={},e}(qF);ZD.handleByMap(HD.CanvasRendererPlugin,nU.__plugins);var iU={canvas:null,getTintedCanvas:function(t,e){var r=t.texture,n="#"+("00000"+(0|(e=iU.roundColor(e))).toString(16)).slice(-6);r.tintCache=r.tintCache||{};var i,o=r.tintCache[n];if(o){if(o.tintId===r._updateID)return r.tintCache[n];i=r.tintCache[n]}else i=vA.ADAPTER.createCanvas();return iU.tintMethod(r,e,i),i.tintId=r._updateID,r.tintCache[n]=i,i},getTintedPattern:function(t,e){var r="#"+("00000"+(0|(e=iU.roundColor(e))).toString(16)).slice(-6);t.patternCache=t.patternCache||{};var n=t.patternCache[r];return n&&n.tintId===t._updateID||(iU.canvas||(iU.canvas=vA.ADAPTER.createCanvas()),iU.tintMethod(t,e,iU.canvas),(n=iU.canvas.getContext("2d").createPattern(iU.canvas,"repeat")).tintId=t._updateID,t.patternCache[r]=n),n},tintWithMultiply:function(t,e,r){var n=r.getContext("2d"),i=t._frame.clone(),o=t.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();n.drawImage(s,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(s,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore()},tintWithOverlay:function(t,e,r){var n=r.getContext("2d"),i=t._frame.clone(),o=t.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore()},tintWithPerPixel:function(t,e,r){var n=r.getContext("2d"),i=t._frame.clone(),o=t.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,r.width=Math.ceil(i.width),r.height=Math.ceil(i.height),n.save(),n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore();for(var s=HM(e),a=s[0],u=s[1],c=s[2],h=n.getImageData(0,0,i.width,i.height),l=h.data,d=0;d<l.length;d+=4)l[d+0]*=a,l[d+1]*=u,l[d+2]*=c;n.putImageData(h,0,0)},roundColor:function(t){var e=iU.cacheStepsPerColorChannel,r=HM(t);return r[0]=Math.min(255,r[0]/e*e),r[1]=Math.min(255,r[1]/e*e),r[2]=Math.min(255,r[2]/e*e),zM(r)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:eU(),tintMethod:null};iU.tintMethod=iU.canUseMultiply?iU.tintWithMultiply:iU.tintWithPerPixel;var oU=tN.create;tN.create=function(t){if(!(t&&t.forceCanvas))try{return oU(t)}catch(t){}return new nU(t)},aL.prototype.getDrawableSource=function(){var t=this.resource;return t?t.bitmap||t.source:null},_L.prototype._canvasRenderTarget=null,EL.prototype.patternCache=null,EL.prototype.tintCache=null;var sU=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var e=this.renderer,r=t.worldTransform;e.context.globalAlpha=t.worldAlpha,e.setBlendMode(t.blendMode),e.setContextTransform(r,t.roundPixels),t.drawMode!==IP.TRIANGLES?this._renderTriangleMesh(t):this._renderTriangles(t)},t.prototype._renderTriangleMesh=function(t){for(var e=t.geometry.buffers[0].data.length,r=0;r<e-2;r++){var n=2*r;this._renderDrawTriangle(t,n,n+2,n+4)}},t.prototype._renderTriangles=function(t){for(var e=t.geometry.getIndex().data,r=e.length,n=0;n<r;n+=3){var i=2*e[n],o=2*e[n+1],s=2*e[n+2];this._renderDrawTriangle(t,i,o,s)}},t.prototype._renderDrawTriangle=function(t,e,r,n){var i=this.renderer.context,o=t.geometry.buffers[0].data,s=t.uvs,a=t.texture;if(a.valid){var u=16777215!==t.tint,c=a.baseTexture,h=c.width,l=c.height;u&&t._cachedTint!==t.tint&&(t._cachedTint=t.tint,t._cachedTexture=t._cachedTexture||new EL(c),t._tintedCanvas=iU.getTintedCanvas({texture:t._cachedTexture},t.tint));var d=u?t._tintedCanvas:c.getDrawableSource(),f=s[e]*c.width,p=s[r]*c.width,v=s[n]*c.width,m=s[e+1]*c.height,y=s[r+1]*c.height,g=s[n+1]*c.height,_=o[e],b=o[r],T=o[n],x=o[e+1],E=o[r+1],S=o[n+1],w=t.canvasPadding/this.renderer.resolution;if(w>0){var R=t.worldTransform,C=R.a,P=R.b,A=R.c,O=R.d,I=(_+b+T)/3,M=(x+E+S)/3,D=_-I,L=x-M,F=C*D+A*L,N=P*D+O*L,k=Math.sqrt(F*F+N*N),B=1+w/k;_=I+D*B,x=M+L*B,F=C*(D=b-I)+A*(L=E-M),N=P*D+O*L,b=I+D*(B=1+w/(k=Math.sqrt(F*F+N*N))),E=M+L*B,F=C*(D=T-I)+A*(L=S-M),N=P*D+O*L,T=I+D*(B=1+w/(k=Math.sqrt(F*F+N*N))),S=M+L*B}i.save(),i.beginPath(),i.moveTo(_,x),i.lineTo(b,E),i.lineTo(T,S),i.closePath(),i.clip();var G=f*y+m*v+p*g-y*v-m*p-f*g,U=_*y+m*T+b*g-y*T-m*b-_*g,j=f*b+_*v+p*T-b*v-_*p-f*T,X=f*y*T+m*b*v+_*p*g-_*y*v-m*p*T-f*b*g,V=x*y+m*S+E*g-y*S-m*E-x*g,H=f*E+x*v+p*S-E*v-x*p-f*S,W=f*y*S+m*E*v+x*p*g-x*y*v-m*p*S-f*E*g;i.transform(U/G,V/G,j/G,H/G,X/G,W/G),i.drawImage(d,0,0,h*c.resolution,l*c.resolution,0,0,h,l),i.restore(),this.renderer.invalidateBlendMode()}},t.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,n=r.length/2;e.beginPath();for(var i=1;i<n-2;++i){var o=2*i,s=r[o],a=r[o+1],u=r[o+2],c=r[o+3],h=r[o+4],l=r[o+5];e.moveTo(s,a),e.lineTo(u,c),e.lineTo(h,l)}e.fillStyle="#FF0000",e.fill(),e.closePath()},t.prototype.destroy=function(){this.renderer=null},t.extension={name:"mesh",type:HD.CanvasRendererPlugin},t}();vA.MESH_CANVAS_PADDING=0,lG.prototype._renderCanvas=function(t,e){t.plugins.mesh.render(e)},KG.prototype._cachedTint=16777215,KG.prototype._tintedCanvas=null,KG.prototype._canvasUvs=null,KG.prototype._renderCanvas=function(t){var e=t.context,r=this.worldTransform,n=16777215!==this.tint,i=this.texture;if(i.valid){n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedCanvas=iU.getTintedCanvas(this,this.tint));var o=n?this._tintedCanvas:i.baseTexture.getDrawableSource();this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,a=this._canvasUvs,u=n?0:i.frame.x,c=n?0:i.frame.y,h=u+i.frame.width,l=c+i.frame.height;a[0]=u,a[1]=u+this._leftWidth,a[2]=h-this._rightWidth,a[3]=h,a[4]=c,a[5]=c+this._topHeight,a[6]=l-this._bottomHeight,a[7]=l;for(var d=0;d<8;d++)a[d]*=i.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.setContextTransform(r,this.roundPixels);for(var f=0;f<3;f++)for(var p=0;p<3;p++){var v=2*p+8*f,m=Math.max(1,a[p+1]-a[p]),y=Math.max(1,a[f+5]-a[f+4]),g=Math.max(1,s[v+10]-s[v]),_=Math.max(1,s[v+11]-s[v+1]);e.drawImage(o,a[p],a[f+4],m,y,s[v],s[v+1],g,_)}}};var aU=!1;hG.prototype._cachedTint=16777215,hG.prototype._tintedCanvas=null,hG.prototype._cachedTexture=null,hG.prototype._renderCanvas=function(t){this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.material._renderCanvas?this.material._renderCanvas(t,this):aU||(aU=!0,globalThis.console&&console.warn("Mesh with custom shaders are not supported in CanvasRenderer."))},hG.prototype._canvasPadding=null,Object.defineProperty(hG.prototype,"canvasPadding",{get:function(){return null!==this._canvasPadding?this._canvasPadding:vA.MESH_CANVAS_PADDING},set:function(t){this._canvasPadding=t}}),JG.prototype._renderCanvas=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)},zG.prototype._renderCanvas=function(t){(this.autoUpdate||this.geometry._width!==this.shader.texture.height)&&(this.geometry._width=this.shader.texture.height,this.geometry.update()),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)};var uU,cU=function(){function t(){}return t.offsetPolygon=function(e,r){var n=[],i=e.length;r=t.isPolygonClockwise(e)?r:-1*r;for(var o=0;o<i;o+=2){var s=o-2;s<0&&(s+=i);var a=(o+2)%i,u=e[o]-e[s],c=e[o+1]-e[s+1],h=Math.sqrt(u*u+c*c);u/=h,c/=h;var l=-(c*=r),d=u*=r,f=[e[s]+l,e[s+1]+d],p=[e[o]+l,e[o+1]+d],v=e[a]-e[o],m=e[a+1]-e[o+1];v/=h=Math.sqrt(v*v+m*m),m/=h;var y=-(m*=r),g=v*=r,_=[e[o]+y,e[o+1]+g],b=[e[a]+y,e[a+1]+g],T=t.findIntersection(f[0],f[1],p[0],p[1],_[0],_[1],b[0],b[1]);T&&n.push.apply(n,T)}return n},t.findIntersection=function(t,e,r,n,i,o,s,a){var u=(a-o)*(r-t)-(s-i)*(n-e),c=(s-i)*(e-o)-(a-o)*(t-i);if(0===u)return 0===c&&0===(r-t)*(e-o)-(n-e)*(t-i)?[(t+r)/2,(e+n)/2]:null;var h=c/u;return[t+h*(r-t),e+h*(n-e)]},t.isPolygonClockwise=function(t){for(var e=0,r=0,n=t.length-2;r<t.length;n=r,r+=2)e+=(t[r]-t[n])*(t[r+1]+t[n+1]);return e>0},t}(),hU=function(){function t(t){this._svgMatrix=null,this._tempMatrix=new CD,this.renderer=t}return t.prototype._calcCanvasStyle=function(t,e){var r;return t.texture&&t.texture.baseTexture!==EL.WHITE.baseTexture?t.texture.valid?(r=iU.getTintedPattern(t.texture,e),this.setPatternTransform(r,t.matrix||CD.IDENTITY)):r="#808080":r="#"+("00000"+(0|e).toString(16)).slice(-6),r},t.prototype.render=function(t){var e=this.renderer,r=e.context,n=t.worldAlpha,i=t.transform.worldTransform;e.setContextTransform(i),e.setBlendMode(t.blendMode);for(var o,s,a=t.geometry.graphicsData,u=(t.tint>>16&255)/255,c=(t.tint>>8&255)/255,h=(255&t.tint)/255,l=0;l<a.length;l++){var d=a[l],f=d.shape,p=d.fillStyle,v=d.lineStyle,m=0|d.fillStyle.color,y=0|d.lineStyle.color;if(d.matrix&&e.setContextTransform(i.copyTo(this._tempMatrix).append(d.matrix)),p.visible){var g=((m>>16&255)/255*u*255<<16)+((m>>8&255)/255*c*255<<8)+(255&m)/255*h*255;o=this._calcCanvasStyle(p,g)}if(v.visible){var _=((y>>16&255)/255*u*255<<16)+((y>>8&255)/255*c*255<<8)+(255&y)/255*h*255;s=this._calcCanvasStyle(v,_)}if(r.lineWidth=v.width,r.lineCap=v.cap,r.lineJoin=v.join,r.miterLimit=v.miterLimit,d.type===vD.POLY){r.beginPath();var b=(A=f).points,T=d.holes,x=void 0,E=void 0,S=void 0,w=void 0,R=void 0;r.moveTo(b[0],b[1]);for(var C=2;C<b.length;C+=2)r.lineTo(b[C],b[C+1]);if(A.closeStroke&&r.closePath(),T.length>0){R=[],x=0,S=b[0],w=b[1];for(C=2;C+2<b.length;C+=2)x+=(b[C]-S)*(b[C+3]-w)-(b[C+2]-S)*(b[C+1]-w);for(var P=0;P<T.length;P++)if(b=T[P].shape.points){E=0,S=b[0],w=b[1];for(C=2;C+2<b.length;C+=2)E+=(b[C]-S)*(b[C+3]-w)-(b[C+2]-S)*(b[C+1]-w);if(E*x<0){r.moveTo(b[0],b[1]);for(C=2;C<b.length;C+=2)r.lineTo(b[C],b[C+1])}else{r.moveTo(b[b.length-2],b[b.length-1]);for(C=b.length-4;C>=0;C-=2)r.lineTo(b[C],b[C+1])}T[P].shape.closeStroke&&r.closePath(),R[P]=E*x<0}}p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fill()),v.visible&&this.paintPolygonStroke(A,v,s,T,R,n,r)}else if(d.type===vD.RECT){var A=f;if(p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fillRect(A.x,A.y,A.width,A.height)),v.visible){var O=v.width*(.5-(1-v.alignment)),I=A.width+2*O,M=A.height+2*O;r.globalAlpha=v.alpha*n,r.strokeStyle=s,r.strokeRect(A.x-O,A.y-O,I,M)}}else if(d.type===vD.CIRC){A=f;if(r.beginPath(),r.arc(A.x,A.y,A.radius,0,2*Math.PI),r.closePath(),p.visible&&(r.globalAlpha=p.alpha*n,r.fillStyle=o,r.fill()),v.visible){if(.5!==v.alignment){O=v.width*(.5-(1-v.alignment));r.beginPath(),r.arc(A.x,A.y,A.radius+O,0,2*Math.PI),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=s,r.stroke()}}else if(d.type===vD.ELIP){A=f;if((H=1===v.alignment)||this.paintEllipse(A,p,v,o,n,r),v.visible){if(.5!==v.alignment){var D=.5522848,L=(O=v.width*(.5-(1-v.alignment)),2*(A.width+O)),F=2*(A.height+O),N=A.x-L/2,k=A.y-F/2,B=L/2*D,G=F/2*D,U=N+L,j=k+F,X=N+L/2,V=k+F/2;r.beginPath(),r.moveTo(N,V),r.bezierCurveTo(N,V-G,X-B,k,X,k),r.bezierCurveTo(X+B,k,U,V-G,U,V),r.bezierCurveTo(U,V+G,X+B,j,X,j),r.bezierCurveTo(X-B,j,N,V+G,N,V),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=s,r.stroke()}H&&this.paintEllipse(A,p,v,o,n,r)}else if(d.type===vD.RREC){var H;A=f;if((H=1===v.alignment)||this.paintRoundedRectangle(A,p,v,o,n,r),v.visible){if(.5!==v.alignment){I=A.width,M=A.height,O=v.width*(.5-(1-v.alignment));var W=A.x-O,Y=A.y-O,z=A.width+2*O,Z=A.height+2*O,J=O*(v.alignment>=1?Math.min(z/I,Z/M):Math.min(I/z,M/Z)),K=A.radius+J,q=Math.min(z,Z)/2;K=K>q?q:K,r.beginPath(),r.moveTo(W,Y+K),r.lineTo(W,Y+Z-K),r.quadraticCurveTo(W,Y+Z,W+K,Y+Z),r.lineTo(W+z-K,Y+Z),r.quadraticCurveTo(W+z,Y+Z,W+z,Y+Z-K),r.lineTo(W+z,Y+K),r.quadraticCurveTo(W+z,Y,W+z-K,Y),r.lineTo(W+K,Y),r.quadraticCurveTo(W,Y,W,Y+K),r.closePath()}r.globalAlpha=v.alpha*n,r.strokeStyle=s,r.stroke()}H&&this.paintRoundedRectangle(A,p,v,o,n,r)}}},t.prototype.paintPolygonStroke=function(t,e,r,n,i,o,s){if(.5!==e.alignment){var a=e.width*(.5-(1-e.alignment)),u=cU.offsetPolygon(t.points,a),c=void 0;s.beginPath(),s.moveTo(u[0],u[1]);for(var h=2;h<u.length;h+=2)s.lineTo(u[h],u[h+1]);t.closeStroke&&s.closePath();for(var l=0;l<n.length;l++){if(c=n[l].shape.points,u=cU.offsetPolygon(c,a),i[l]){s.moveTo(u[0],u[1]);for(h=2;h<u.length;h+=2)s.lineTo(u[h],u[h+1])}else{s.moveTo(u[u.length-2],u[u.length-1]);for(h=u.length-4;h>=0;h-=2)s.lineTo(u[h],u[h+1])}n[l].shape.closeStroke&&s.closePath()}}s.globalAlpha=e.alpha*o,s.strokeStyle=r,s.stroke()},t.prototype.paintEllipse=function(t,e,r,n,i,o){var s=2*t.width,a=2*t.height,u=t.x-s/2,c=t.y-a/2,h=.5522848,l=s/2*h,d=a/2*h,f=u+s,p=c+a,v=u+s/2,m=c+a/2;0===r.alignment&&o.save(),o.beginPath(),o.moveTo(u,m),o.bezierCurveTo(u,m-d,v-l,c,v,c),o.bezierCurveTo(v+l,c,f,m-d,f,m),o.bezierCurveTo(f,m+d,v+l,p,v,p),o.bezierCurveTo(v-l,p,u,m+d,u,m),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*i,o.fillStyle=n,o.fill()),0===r.alignment&&o.restore()},t.prototype.paintRoundedRectangle=function(t,e,r,n,i,o){var s=t.x,a=t.y,u=t.width,c=t.height,h=t.radius,l=Math.min(u,c)/2;h=h>l?l:h,0===r.alignment&&o.save(),o.beginPath(),o.moveTo(s,a+h),o.lineTo(s,a+c-h),o.quadraticCurveTo(s,a+c,s+h,a+c),o.lineTo(s+u-h,a+c),o.quadraticCurveTo(s+u,a+c,s+u,a+c-h),o.lineTo(s+u,a+h),o.quadraticCurveTo(s+u,a,s+u-h,a),o.lineTo(s+h,a),o.quadraticCurveTo(s,a,s,a+h),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*i,o.fillStyle=n,o.fill()),0===r.alignment&&o.restore()},t.prototype.setPatternTransform=function(t,e){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!t.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=e.a,this._svgMatrix.b=e.b,this._svgMatrix.c=e.c,this._svgMatrix.d=e.d,this._svgMatrix.e=e.tx,this._svgMatrix.f=e.ty,t.setTransform(this._svgMatrix.inverse())}},t.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},t.extension={name:"graphics",type:HD.CanvasRendererPlugin},t}(),lU=new CD;_B.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),n=SL.create({width:r.width,height:r.height,scaleMode:t,resolution:e});uU||(uU=new nU),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(lU),lU.invert(),lU.tx-=r.x,lU.ty-=r.y,uU.render(this,{renderTexture:n,clear:!0,transform:lU});var i=EL.from(n.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return i.baseTexture.setResolution(e),i},_B.prototype.cachedGraphicsData=[],_B.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var dU=new CD,fU=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var e=t._texture,r=this.renderer,n=r.context;if(e.valid){var i=e._frame.width,o=e._frame.height,s=e._frame.width,a=e._frame.height;e.trim&&(FD.isVertical(e.rotate)?(s=e.trim.height,a=e.trim.width):(s=e.trim.width,a=e.trim.height));var u=t.transform.worldTransform,c=0,h=0,l=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&e.valid&&l){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var d=e.baseTexture.scaleMode===NP.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==d&&(n[r.smoothProperty]=d),e.trim?(c=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(c=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(u.copyTo(dU),u=dU,FD.matrixAppendRotationInv(u,e.rotate,c,h),c=0,h=0),c-=s/2,h-=a/2,r.setContextTransform(u,t.roundPixels,1),t.roundPixels&&(c|=0,h|=0);var f=e.baseTexture.resolution,p=r._outerBlend;p&&(n.save(),n.beginPath(),n.rect(c*r.resolution,h*r.resolution,s*r.resolution,a*r.resolution),n.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=iU.getTintedCanvas(t,t.tint)),n.drawImage(t._tintedCanvas,0,0,Math.floor(i*f),Math.floor(o*f),Math.floor(c*r.resolution),Math.floor(h*r.resolution),Math.floor(s*r.resolution),Math.floor(a*r.resolution))):n.drawImage(l,e._frame.x*f,e._frame.y*f,Math.floor(i*f),Math.floor(o*f),Math.floor(c*r.resolution),Math.floor(h*r.resolution),Math.floor(s*r.resolution),Math.floor(a*r.resolution)),p&&n.restore(),r.setBlendMode(OP.NORMAL)}}},t.prototype.destroy=function(){this.renderer=null},t.extension={name:"sprite",type:HD.CanvasRendererPlugin},t}();SB.prototype._tintedCanvas=null,SB.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var pU=new TD,vU=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,r){var n=new Image;return n.src=this.base64(t,e,r),n},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(t,e){var r,n,i,o=this.renderer;t&&(i=t instanceof SL?t:o.generateTexture(t)),i?(r=i.baseTexture._canvasRenderTarget.context,n=i.baseTexture._canvasRenderTarget.resolution,e=null!=e?e:i.frame):(r=o.rootContext,n=o.resolution,e||((e=pU).width=o.width,e.height=o.height));var s=Math.round(e.x*n),a=Math.round(e.y*n),u=Math.round(e.width*n),c=Math.round(e.height*n),h=new dD(u,c,1),l=r.getImageData(s,a,u,c);return h.context.putImageData(l,0,0),h.canvas},t.prototype.pixels=function(t,e){var r,n,i,o=this.renderer;t&&(i=t instanceof SL?t:o.generateTexture(t)),i?(r=i.baseTexture._canvasRenderTarget.context,n=i.baseTexture._canvasRenderTarget.resolution,e=null!=e?e:i.frame):(r=o.rootContext,n=o.resolution,e||((e=pU).width=o.width,e.height=o.height));var s=Math.round(e.x*n),a=Math.round(e.y*n),u=Math.round(e.width*n),c=Math.round(e.height*n);return r.getImageData(s,a,u,c).data},t.prototype.destroy=function(){this.renderer=null},t.extension={name:"extract",type:HD.CanvasRendererPlugin},t}(),mU=function(t,e){return mU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},mU(t,e)};function yU(t,e){var r=t;if(e instanceof aL){var n=e.source,i=0===n.width?r.canvas.width:Math.min(r.canvas.width,n.width),o=0===n.height?r.canvas.height:Math.min(r.canvas.height,n.height);return r.ctx.drawImage(n,0,0,i,o,0,0,r.canvas.width,r.canvas.height),!0}return!1}var gU=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r,r.canvas=vA.ADAPTER.createCanvas(16,16),r.ctx=r.canvas.getContext("2d"),r.registerUploadHook(yU),r}return function(t,e){function r(){this.constructor=t}mU(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e.extension={name:"prepare",type:HD.CanvasRendererPlugin},e}(WB),_U=new CD,bU=new CD,TU=[new _D,new _D,new _D,new _D];eG.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,n=this.worldTransform,i=e.baseTexture,o=i.getDrawableSource(),s=i.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var a=new dD(e._frame.width,e._frame.height,s);16777215!==this.tint?(this._tintedCanvas=iU.getTintedCanvas(this,this.tint),a.context.drawImage(this._tintedCanvas,0,0)):a.context.drawImage(o,-e._frame.x*s,-e._frame.y*s),this._cachedTint=this.tint,this._canvasPattern=a.context.createPattern(a.canvas,"repeat")}r.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var u=this.tileTransform.localTransform,c=this._width,h=this._height;_U.identity(),bU.copyFrom(u),this.uvRespectAnchor||bU.translate(-this.anchor.x*c,-this.anchor.y*h),bU.scale(this.tileScale.x/s,this.tileScale.y/s),_U.prepend(bU),_U.prepend(n),t.setContextTransform(_U),r.fillStyle=this._canvasPattern;var l=this.anchor.x*-c,d=this.anchor.y*-h;TU[0].set(l,d),TU[1].set(l+c,d),TU[2].set(l+c,d+h),TU[3].set(l,d+h);for(var f=0;f<4;f++)bU.applyInverse(TU[f],TU[f]);r.beginPath(),r.moveTo(TU[0].x,TU[0].y);for(f=1;f<4;f++)r.lineTo(TU[f].x,TU[f].y);r.closePath(),r.fill()}},Vk.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,n=!0,i=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u<this.children.length;++u){var c=this.children[u];if(c.visible&&c._texture.valid){var h=c._texture.frame;if(e.globalAlpha=this.worldAlpha*c.alpha,c.rotation%(2*Math.PI)==0)n&&(t.setContextTransform(r,!1,1),n=!1),i=c.anchor.x*(-h.width*c.scale.x)+c.position.x+.5,o=c.anchor.y*(-h.height*c.scale.y)+c.position.y+.5,s=h.width*c.scale.x,a=h.height*c.scale.y;else{n||(n=!0),c.displayObjectUpdateTransform();var l=c.worldTransform;t.setContextTransform(l,this.roundPixels,1),i=c.anchor.x*-h.width+.5,o=c.anchor.y*-h.height+.5,s=h.width,a=h.height}var d=c._texture.baseTexture.resolution;e.drawImage(c._texture.baseTexture.getDrawableSource(),h.x*d,h.y*d,h.width*d,h.height*d,i*t.resolution,o*t.resolution,s*t.resolution,a*t.resolution)}}}},VD.prototype._renderCanvas=function(t){},VD.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask),this._renderCanvas(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},UD.prototype.renderCanvas=function(t){},FB.prototype._renderCanvas=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),SB.prototype._renderCanvas.call(this,t)},ZD.add(vU,hU,sU,gU,fU);var xU=function(t,e){return xU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},xU(t,e)};var EU=function(t){function e(e){var r=t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (c.a > 0.0) {\n        c.rgb /= c.a;\n\n        vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n        rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n        rgb.r *= red;\n        rgb.g *= green;\n        rgb.b *= blue;\n        c.rgb = rgb * brightness;\n\n        c.rgb *= c.a;\n    }\n\n    gl_FragColor = c * alpha;\n}\n")||this;return r.gamma=1,r.saturation=1,r.contrast=1,r.brightness=1,r.red=1,r.green=1,r.blue=1,r.alpha=1,Object.assign(r,e),r}return function(t,e){function r(){this.constructor=t}xU(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.apply=function(t,e,r,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,t.applyFilter(this,e,r,n)},e}(EF),SU=Yf("process:video"),wU=function(){function t(t){var e,r;this.frameRate=null,this.resolution=null,this.backgroundColor=null,this.streamList=[],this.textList=[],this.isStart=!1,this.output=null,this.worker=null,this.renderer=null,this.stage=null,this.ticker=qD.shared,this.isPaused=!1;var n=t.frameRate,i=t.resolution,o=t.backgroundColor;this.frameRate=n,this.resolution=i,this.backgroundColor=o,this.worker=LC(),this.renderer=eN({width:i.width,height:i.height,backgroundColor:o,antialias:!0,resolution:1,forceCanvas:$x}),this.stage=new VD,this.stage.sortableChildren=!0,this.ticker.autoStart=!1,this.ticker.stop(),this.draw=lh(e=this.draw).call(e,this),this.setStreamParams=lh(r=this.setStreamParams).call(r,this)}return t.prototype.setResolution=function(t){var e;this.resolution=t,null===(e=this.renderer)||void 0===e||e.resize(t.width,t.height)},t.prototype.setBackgroundColor=function(t){this.backgroundColor=t,this.renderer&&(this.renderer.backgroundColor=t)},t.prototype.addStream=function(t){var e,r=this,n=t.source,i=t.order,o=null,s=null;if(n instanceof MediaStream){var a,u=El(a=this.streamList).call(a,(function(t){return t.source===n}));u?o=u.element:((o=gy()).onpause=function(){SU("video is paused, try to resume"),cd((function(){var t;null===(t=null==o?void 0:o.play)||void 0===t||t.call(o)}),50)},o.muted=!0,o.srcObject=n,o.load())}else o=n;var c=El(e=this.streamList).call(e,(function(t){return t.element===o}));s=c?c.texture:EL.from(o);var h=new SB(s),l=_y(o),d=l.width,f=l.height;if(0===d||0===f){var p=o instanceof HTMLVideoElement?"loadedmetadata":"load";o.addEventListener(p,(function e(){o.removeEventListener(p,e,!1),r.setStreamParams(h,o,t)}),!1)}else this.setStreamParams(h,o,t);h.zIndex=i,this.stage.addChild(h),this.streamList.push(xd(xd({},t),{element:o,texture:s,sprite:h}))},t.prototype.removeStream=function(t){var e,r,n,i=Vh(e=this.streamList).call(e,(function(e){return e.id===t}));if(-1!==i){var o,s=Rd(pl(r=this.streamList).call(r,i,1),1)[0];if(this.stage.removeChild(s.sprite),s.sprite.filters=null,s.sprite.destroy(),s.sprite=null,!El(n=this.streamList).call(n,(function(t){return t.element===s.element}))){if(s.source instanceof HTMLVideoElement){var a=s.texture.baseTexture.resource,u=a.source,c=a._onError;u&&u.removeEventListener("error",c,!0),a.source=null}s.texture.destroy(!0)}if(s.texture=null,s.source instanceof MediaStream)if(!El(o=this.streamList).call(o,(function(t){return t.source===s.source}))&&s.element instanceof HTMLVideoElement){var h=s.element;h.onpause=null,h.pause(),h.srcObject=null,h.load(),h.remove()}s.element=null}else SU("remove failed, stream ".concat(t," is not existed"))},t.prototype.addText=function(t){var e=t.x,r=t.y,n=t.order,i=t.content,o=t.style,s=o.font_alpha,a=void 0===s?100:s,u=o.background_color,c=o.background_alpha,h=void 0===c?100:c,l=new VD;l.sortableChildren=!0;var d=this.transformTextStyle(o),f=new FB(i,d);if(f.alpha=Number(a)/100,f.zIndex=1,l.addChild(f),u){var p=new _B;p.beginFill("number"==typeof u?u:YM(u),Number(h)/100),p.drawRect(0,0,l.width,l.height),p.endFill(),p.zIndex=0,l.addChild(p)}l.pivot.x=l.width/2,l.pivot.y=l.height/2,l.x=e,l.y=r,l.zIndex=n,this.stage.addChild(l),this.textList.push(xd(xd({},t),{container:l}))},t.prototype.removeText=function(t){var e,r,n=Vh(e=this.textList).call(e,(function(e){return e.id===t}));if(-1!==n){var i=Rd(pl(r=this.textList).call(r,n,1),1)[0];this.stage.removeChild(i.container),i.container.destroy(!0),i.container=null}else SU("remove failed, text ".concat(t," is not existed"))},t.prototype.start=function(){var t;this.isStart?SU("rendering has started"):this.renderer?(this.isStart=!0,this.isPaused=!1,this.draw(),this.output=null===(t=this.getRenderView())||void 0===t?void 0:t.captureStream(this.frameRate)):SU("renderer is not existed")},t.prototype.stop=function(){this.isStart?(this.isStart=!1,this.isPaused=!1,this.destroy()):SU("rendering has stopped")},t.prototype.getOutput=function(){return this.output},t.prototype.getRenderView=function(){var t;return null===(t=this.renderer)||void 0===t?void 0:t.view},t.prototype.pause=function(){this.isPaused=!0},t.prototype.resume=function(){this.isPaused=!1},t.prototype.setStreamParams=function(t,e,r){var n=r.x,i=r.y,o=r.width,s=r.height,a=r.operations,u=_y(e),c=u.width,h=u.height,l={width:o,height:s};0!==c&&0!==h&&(l=o/s<c/h?{width:o,height:o*h/c}:{width:s*c/h,height:s}),t.anchor.set(.5,.5),t.width=l.width,t.height=l.height,t.x=n,t.y=i,Ph(a).call(a,(function(e){var r,n,i,o=e.type,s=e.params,a=void 0===s?{}:s;if("image_mirror"===o&&(a.left_right&&(t.scale.x*=-1),a.up_down&&(t.scale.y*=-1)),"image_filter_normal"===o){t.filters||(t.filters=[]);var u=function(t){return 1+t/100},c={contrast:u(null!==(r=a.contrast)&&void 0!==r?r:0),brightness:u(null!==(n=a.brightness)&&void 0!==n?n:0),saturation:u(null!==(i=a.saturation)&&void 0!==i?i:0)};t.filters.push(new EU(c))}}))},t.prototype.transformTextStyle=function(t){var e,r={};return Ph(e=Rl(t)).call(e,(function(e){var n=zC[e];if(n)switch(n){case"fontWeight":r[n]=t[e]?"bold":"normal";break;case"fontStyle":r[n]=t[e]?"italic":"normal";break;case"dropShadowColor":t[e]&&(r.dropShadow=!0,r[n]=t[e]);break;case"dropShadowAlpha":r[n]=Number(t[e])/100;break;default:r[n]=t[e]}})),new PB(r)},t.prototype.draw=function(){this.isStart&&this.renderer&&this.stage?(this.isPaused||(this.ticker.update(),this.renderer.render(this.stage)),this.requestAnimationFrameWrapper(this.draw)):SU("render stop")},t.prototype.destroy=function(){var t,e,r,n,i,o,s,a=this;null===(n=this.worker)||void 0===n||n.terminate(),this.worker=null;var u=vd(t=this.streamList).call(t,(function(t){return t.id}));Ph(u).call(u,(function(t){a.removeStream(t)})),this.streamList=[];var c=vd(e=this.textList).call(e,(function(t){return t.id}));Ph(c).call(c,(function(t){a.removeText(t)})),this.textList=[],null===(i=this.stage)||void 0===i||i.destroy({children:!0,texture:!0,baseTexture:!0}),this.stage=null,null===(o=this.renderer)||void 0===o||o.destroy(!0),this.renderer=null,null===(s=this.output)||void 0===s||Ph(r=s.getTracks()).call(r,(function(t){t.stop()})),this.output=null},t.prototype.setWorkerInterval=function(t,e){var r,n,i=this;null===(r=this.worker)||void 0===r||r.addEventListener("message",t),null===(n=this.worker)||void 0===n||n.postMessage({type:"start",data:{time:e}});return function(){var e,r;null===(e=i.worker)||void 0===e||e.postMessage({type:"stop"}),null===(r=i.worker)||void 0===r||r.removeEventListener("message",t)}},t.prototype.requestAnimationFrameWrapper=function(t){var e=!1,r=this.setWorkerInterval((function(){!e&&document.hidden&&(e=!0,r(),t())}),1e3/this.frameRate);requestAnimationFrame((function(){e||(e=!0,r(),t())}))},t}(),RU=sh("Array").entries,CU=rn,PU=qt,AU=ut,OU=RU,IU=Array.prototype,MU={DOMTokenList:!0,NodeList:!0},DU=function(t){var e=t.entries;return t===IU||AU(IU,t)&&e===IU.entries||PU(MU,CU(t))?OU:e},LU=Yf("process:audio"),FU=function(){function t(){this.streamList=[],this.isStart=!1,this.output=null,this.audioContext=null,this.audioDestination=null,this.audioConstantSource=null;var t=yy(),e=t.createGain();if(e.gain.value=1,t.createConstantSource){var r=t.createConstantSource();r.start();var n=t.createGain();n.gain.value=0,r.connect(n),n.connect(e),this.audioConstantSource=r}this.audioContext=t,this.audioDestination=e}return t.prototype.addStream=function(t){var e,r,n,i=this,o=t.source,s=t.operations,a=null,u=El(e=this.streamList).call(e,(function(t){return t.source===o}));u?a=u.audioSource:o instanceof MediaStream?o.getAudioTracks().length>0&&(a=this.audioContext.createMediaStreamSource(o)):(a=o._audioSource||this.audioContext.createMediaElementSource(o),o._audioSource=a,a.connect(this.audioContext.destination));var c=[];if(a){Ph(s).call(s,(function(t){var e,r,n,o,s,a,u=t.type,h=t.params,l=void 0===h?{}:h;if("audio_volumes"===u){var d=i.audioContext.createGain();d.gain.value=(null!==(e=l.all)&&void 0!==e?e:100)/100,c.push(d)}if("audio_compressor"===u){var f=i.audioContext.createDynamicsCompressor();f.threshold.value=null!==(r=l.threshold)&&void 0!==r?r:ZC.threshold.value,f.ratio.value=null!==(n=l.ratio)&&void 0!==n?n:ZC.ratio.value,f.knee.value=null!==(o=l.knee)&&void 0!==o?o:ZC.knee.value,f.attack.value=(null!==(s=l.attack)&&void 0!==s?s:ZC.attack.value)/1e3,f.release.value=(null!==(a=l.release)&&void 0!==a?a:ZC.release.value)/1e3,c.push(f)}}));var h=c.length;if(h>0)try{for(var l=wd(DU(c).call(c)),d=l.next();!d.done;d=l.next()){var f=Rd(d.value,2),p=f[0],v=f[1];0===p&&a.connect(v),p===h-1&&v.connect(this.audioDestination),p<h-1&&v.connect(c[p+1])}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}else a.connect(this.audioDestination)}this.streamList.push(xd(xd({},t),{audioSource:a,audioNodeList:c}))},t.prototype.removeStream=function(t){var e,r,n,i,o=Vh(e=this.streamList).call(e,(function(e){return e.id===t}));if(-1!==o){var s=Rd(pl(r=this.streamList).call(r,o,1),1)[0];if(s.audioSource){var a=s.audioSource,u=s.audioNodeList,c=u.length;if(c>0)try{for(var h=wd(DU(u).call(u)),l=h.next();!l.done;l=h.next()){var d=Rd(l.value,2),f=d[0],p=d[1];0===f&&a.disconnect(p),f===c-1&&p.disconnect(this.audioDestination),f<c-1&&p.disconnect(u[f+1])}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}else a.disconnect(this.audioDestination)}s.audioSource=null,s.audioNodeList=null}else LU("remove failed, stream ".concat(t," is not existed"))},t.prototype.start=function(){if(this.isStart)LU("process has started");else if(this.audioContext&&this.audioDestination){this.isStart=!0;var t=this.audioContext.createMediaStreamDestination();this.audioDestination.connect(t),this.output=t.stream}else LU("audio context is not existed")},t.prototype.stop=function(){this.isStart?(this.isStart=!1,this.destroy()):LU("process has stopped")},t.prototype.getOutput=function(){return this.output},t.prototype.destroy=function(){var t,e,r,n,i,o,s,a=this,u=vd(t=this.streamList).call(t,(function(t){return t.id}));Ph(u).call(u,(function(t){a.removeStream(t)})),this.streamList=[],null===(r=this.audioConstantSource)||void 0===r||r.stop(),null===(n=this.audioConstantSource)||void 0===n||n.disconnect(),this.audioConstantSource=null,null===(i=this.audioDestination)||void 0===i||i.disconnect(),this.audioDestination=null,window.TXLiveAudioContext||(null===(o=this.audioContext)||void 0===o||o.close(),this.audioContext=null),null===(s=this.output)||void 0===s||Ph(e=s.getTracks()).call(e,(function(t){t.stop()})),this.output=null},t}(),NU=Yf("process"),kU=function(){function t(t){void 0===t&&(t={}),this.frameRate=15,this.resolution=WC,this.backgroundColor=0,this.lastData=null,this.curData=null,this.isProcessStart=!1,this.output=null,this.videoProcess=null,this.audioProcess=null;var e=t.frameRate,r=t.resolution,n=t.backgroundColor,i=t.data;e&&this.setFrameRate(e),r&&this.setResolution(r),n&&this.setBackgroundColor(n),i&&this.setData(i)}return t.prototype.setFrameRate=function(t){t?"number"!=typeof t||t<=0?NU("frameRate must be a number greater than 0"):this.frameRate=t:NU("frameRate must be existed")},t.prototype.setResolution=function(t){var e;t?"object"===Wc(t)&&"number"==typeof t.width&&"number"==typeof t.height&&(t.width>0&&t.height>0||0===t.width&&0===t.height)?(this.resolution=t,t.width>0&&t.height>0&&(null===(e=this.videoProcess)||void 0===e||e.setResolution(t))):NU("resolution width and height must be a number greater than or equal to 0"):NU("resolution must be existed")},t.prototype.setBackgroundColor=function(t){var e;null!=t?"number"!=typeof t||t<0||t>16777215?NU("backgroundColor must be a valid color number"):(this.backgroundColor=t,null===(e=this.videoProcess)||void 0===e||e.setBackgroundColor(t)):NU("backgroundColor must be existed")},t.prototype.setData=function(t){var e,r,n,i,o,s,a=this;if(HC(t)){try{for(var u=wd(t),c=u.next();!c.done;c=u.next()){var h,l=c.value,d=l.id,f=l.type,p=l.order,v=l.items;if(!d)return void NU("data.id is not existed");if(!Jl(h=Rl(YC)).call(h,f))return void NU("data.type(".concat(f,") is invalid"));if(void 0!==p&&"number"!=typeof p)return void NU("data.order must be a number");if(!HC(v))return void NU("data.items must be an array");try{for(var m=(n=void 0,wd(v)),y=m.next();!y.done;y=m.next()){var g,_=y.value,b=_.id,T=_.type,x=_.source,E=_.content,S=_.operations;if(!b)return void NU("data.items.id is not existed");if(!Jl(g=YC[f]).call(g,T))return void NU("data.items.type(".concat(T,") is invalid"));if("video"===f){if(!("video"!==T||x instanceof UC||x instanceof MediaStream||x instanceof HTMLVideoElement))return void NU("data.items.source(".concat(T,") is invalid"));if("image"===T&&!(x instanceof HTMLImageElement))return void NU("data.items.source(".concat(T,") is invalid"))}else if("audio"===f){if(!(x instanceof UC||x instanceof MediaStream||x instanceof HTMLVideoElement||x instanceof HTMLAudioElement))return void NU("data.items.source(".concat(T,") is invalid"))}else if("text"===f){if(!E)return void NU("data.items.content is not existed");var w=E.text,R=E.text_style;if(!w)return void NU("data.items.content.text is not existed");if("object"!==Wc(R)||HC(R)||null===R)return void NU("data.items.content.text_style is invalid")}if(void 0!==S){if(!HC(S))return void NU("data.items.operations must be an array");var C=function(t){var e,r,n=t.type,i=t.params,o=void 0===i?{}:i;if("audio_volumes"===n&&void 0!==o.all&&"number"!=typeof o.all)return NU("audio_volumes param must be a number"),{value:void 0};if("audio_compressor"===n&&Rl(o).length>0&&!PE(e=Rl(o)).call(e,(function(t){var e=ZC[t];if(!e)return NU("audio_compressor param ".concat(t," is invalid")),!1;var r,n,i=o[t];return!("number"!=typeof i||i<e.min||i>e.max)||(NU(mh(r=mh(n="audio_compressor param ".concat(t," must be a number between ")).call(n,e.min," and ")).call(r,e.max)),!1)})))return{value:void 0};if("image_filter_normal"===n&&Rl(o).length>0&&!PE(r=Rl(o)).call(r,(function(t){var e=o[t];return!("number"!=typeof e||e<-100||e>100)||(NU("image_filter_normal param ".concat(t," must be a number between -100 and 100")),!1)})))return{value:void 0}};try{for(var P=(o=void 0,wd(S)),A=P.next();!A.done;A=P.next()){var O=C(A.value);if("object"===Wc(O))return O.value}}catch(t){o={error:t}}finally{try{A&&!A.done&&(s=P.return)&&s.call(P)}finally{if(o)throw o.error}}}}}catch(t){n={error:t}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(this.lastData=this.curData,this.curData=zm(t),this.isProcessStart){var I=Rd((L=this.curData,F=this.lastData,[fy(F,L,py),fy(L,F,py)]),2),M=I[0],D=I[1];this.videoProcess&&(this.videoProcess.pause(),this.removeVideoData(M),this.addVideoData(D),cd((function(){var t;null===(t=a.videoProcess)||void 0===t||t.resume()}),1500/this.frameRate)),this.removeAudioData(M),this.addAudioData(D)}var L,F}else NU("data must be an array")},t.prototype.start=function(){var t=this;return new zx((function(e,r){var n;if(t.isProcessStart)return NU("processing has started"),void r(new Error("processing has started"));if(!t.curData||0===t.curData.length)return NU("data is empty"),void r(new Error("data is empty"));t.isProcessStart=!0;var i=t,o=i.frameRate,s=i.resolution,a=i.backgroundColor;s.width>0&&s.height>0&&(t.videoProcess=new wU({frameRate:o,resolution:s,backgroundColor:a}),t.addVideoData(t.curData)),t.audioProcess=new FU,t.addAudioData(t.curData),null===(n=t.videoProcess)||void 0===n||n.start(),t.audioProcess.start(),e()}))},t.prototype.stop=function(){var t,e,r;this.isProcessStart?(this.isProcessStart=!1,null===(e=this.videoProcess)||void 0===e||e.stop(),this.audioProcess.stop(),this.lastData=null,this.videoProcess=null,this.audioProcess=null,null===(r=this.output)||void 0===r||Ph(t=r.getTracks()).call(t,(function(t){t.stop()})),this.output=null):NU("processing has stopped")},t.prototype.isStart=function(){return this.isProcessStart},t.prototype.getOutput=function(){var t,e,r,n;if(!this.isProcessStart)return null;var i=this.output||new MediaStream,o=i.getVideoTracks().length>0,s=i.getAudioTracks().length>0,a=null===(e=null===(t=this.videoProcess)||void 0===t?void 0:t.getOutput())||void 0===e?void 0:e.getVideoTracks();!o&&(null==a?void 0:a.length)?i.addTrack(a[0]):o&&!(null==a?void 0:a.length)&&i.removeTrack(i.getVideoTracks()[0]);var u=null===(n=null===(r=this.audioProcess)||void 0===r?void 0:r.getOutput())||void 0===n?void 0:n.getAudioTracks();return!s&&(null==u?void 0:u.length)?i.addTrack(u[0]):s&&!(null==u?void 0:u.length)&&i.removeTrack(i.getAudioTracks()[0]),this.output=i,i},t.prototype.getRenderView=function(){var t;return null===(t=this.videoProcess)||void 0===t?void 0:t.getRenderView()},t.prototype.addVideoData=function(t){var e=this;if(this.videoProcess){var r=Lh(t).call(t,(function(t){return"video"===t.type||"text"===t.type}));Ph(r).call(r,(function(t){var r=t.id,n=t.order,i=void 0===n?0:n,o=t.items;Ph(o).call(o,(function(t){var n,o=t.id,s=t.type,a=t.source,u=t.width,c=void 0===u?e.resolution.width:u,h=t.height,l=void 0===h?e.resolution.height:h,d=t.position,f=void 0===d?{}:d,p=t.content,v=void 0===p?{}:p,m=t.operations,y=void 0===m?[]:m,g=f.x,_=void 0===g?0:g,b=f.y,T=void 0===b?0:b,x=v.text,E=void 0===x?"":x,S=v.text_style,w=void 0===S?{}:S,R=mh(n="".concat(r,"-")).call(n,o);if("video"===s||"image"===s){if(0===c||0===l)return;var C=a instanceof UC?a.getMediaStream():a,P=a instanceof UC?a.getRenderElement():null;if(!C)return;e.videoProcess.addStream({id:R,width:c,height:l,x:_,y:T,order:i,source:null!=P?P:C,operations:y})}else"text"===s&&e.videoProcess.addText({id:R,x:_,y:T,order:i,operations:y,content:E,style:w})}))}))}},t.prototype.removeVideoData=function(t){var e=this;if(this.videoProcess){var r=Lh(t).call(t,(function(t){return"video"===t.type||"text"===t.type}));Ph(r).call(r,(function(t){var r=t.id,n=t.items;Ph(n).call(n,(function(t){var n,i=t.id,o=t.type,s=mh(n="".concat(r,"-")).call(n,i);"video"===o||"image"===o?e.videoProcess.removeStream(s):"text"===o&&e.videoProcess.removeText(s)}))}))}},t.prototype.addAudioData=function(t){var e=this,r=Lh(t).call(t,(function(t){return"video"===t.type||"audio"===t.type}));Ph(r).call(r,(function(t){var r=t.id,n=t.items;Ph(n).call(n,(function(t){var n=t.id,i=t.type,o=t.source,s=t.operations,a=void 0===s?[]:s;if("video"===i||"audio"===i){var u,c=o instanceof UC?o.getMediaStream():o;if(!c)return;e.audioProcess.addStream({id:mh(u="".concat(r,"-")).call(u,n),source:c,operations:a})}}))}))},t.prototype.removeAudioData=function(t){var e=this,r=Lh(t).call(t,(function(t){return"video"===t.type||"audio"===t.type}));Ph(r).call(r,(function(t){var r=t.id,n=t.items;Ph(n).call(n,(function(t){var n,i=t.id,o=t.type;"video"!==o&&"audio"!==o||e.audioProcess.removeStream(mh(n="".concat(r,"-")).call(n,i))}))}))},t}();Yf.disable();var BU=Yf("app"),GU=function(){function t(){var t,e,r,n;this.videoView=null,this.canvasView=null,this.videoQuality=xd({},Jf["720p"]),this.audioQuality=xd(xd({},Kf.standard),{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),this.connectRetry={maxCount:3,curCount:0,delay:1,timeoutId:0},this.connection=null,this.isStreamPushing=!1,this.streamList=[],this.streamOutput=null,this.deviceManager=null,this.videoEffectManager=null,this.audioEffectManager=null,this.effectProcess=null,this.effectTrackList=[],this.observer={onError:null,onWarning:null,onCaptureFirstAudioFrame:null,onCaptureFirstVideoFrame:null,onPushStatusUpdate:null,onStatisticsUpdate:null},this.advancedSettings={signalingServer:null,metadata:null},this.onConnectionStatusUpdate=lh(t=this.onConnectionStatusUpdate).call(t,this),this.setProcessData=lh(e=this.setProcessData).call(e,this),this.getCommonData=lh(r=this.getCommonData).call(r,this),this.onVisibilityChange=lh(n=this.onVisibilityChange).call(n,this),null===document||void 0===document||document.addEventListener("visibilitychange",this.onVisibilityChange),this.deviceManager=new XC({getCommonData:this.getCommonData}),this.videoEffectManager=new $C({getCommonData:this.getCommonData}),this.audioEffectManager=new eP({getCommonData:this.getCommonData})}return t.checkSupport=function(){return Ed(void 0,void 0,void 0,(function(){var t;return Sd(this,(function(e){switch(e.label){case 0:return t={isWebRTCSupported:!(!window.RTCPeerConnection&&!window.webkitRTCPeerConnection)},[4,new zx((function(t){try{var e,r=new RTCPeerConnection({iceServers:[]});r.addEventListener("negotiationneeded",(function e(){r.createOffer().then((function(n){var i,o=Jl(i=n.sdp.toLowerCase()).call(i,"h264");r.removeEventListener("negotiationneeded",e),r.close(),t(o)}))}));var n=document.createElement("canvas");n.getContext("2d");var i=n.captureStream(0);Ph(e=i.getTracks()).call(e,(function(t){r.addTrack(t,i)}))}catch(e){t(!1)}}))];case 1:return t.isH264EncodeSupported=e.sent(),[4,Ed(void 0,void 0,void 0,(function(){var t,e,r,n;return Sd(this,(function(i){var o;switch(i.label){case 0:return i.trys.push([0,2,,3]),t=new RTCPeerConnection({iceServers:[],sdpSemantics:"unified-plan"}),e={},t.addTransceiver?(t.addTransceiver("audio",{direction:"recvonly"}),t.addTransceiver("video",{direction:"recvonly"})):e={offerToReceiveVideo:!0,offerToReceiveAudio:!0},[4,t.createOffer(e)];case 1:return r=i.sent(),n=Jl(o=r.sdp.toLowerCase()).call(o,"h264"),t.close(),[2,n];case 2:return i.sent(),[2,!1];case 3:return[2]}}))}))];case 2:return[2,(t.isH264DecodeSupported=e.sent(),t.isMediaDevicesSupported=eE(),t.isScreenCaptureSupported=rE(),t.isMediaFileSupported=!(!document.createElement("canvas").captureStream||!window.AudioContext&&!window.webkitAudioContext),t)]}}))}))},t.init=function(){var t,e=Mf.browserDetails,r=e.browser,n=e.version;BU(mh(t="browser is ".concat(r,", version is ")).call(t,n));var i=document.body;if(i)if(window.TXLiveAudioContext)BU("TXLiveAudioContext is existed");else{var o=["touchstart","touchend","mouseup","click"],s=function t(){Ph(o).call(o,(function(e){return i.removeEventListener(e,t,!1)}));var e=new(window.AudioContext||window.webkitAudioContext);my(e),window.TXLiveAudioContext=e};Ph(o).call(o,(function(t){return i.addEventListener(t,s,!1)}))}else BU("document.body is not existed")},t.prototype.setRenderView=function(t){if(this.videoView)BU("render view is existed");else{var e="string"==typeof t?document.getElementById(t):t;e&&e instanceof HTMLDivElement?this.videoView=gy({parentEl:e,style:Zf,crossOrigin:!1,loop:!1}):BU("require container element id or HTMLDivElement")}},t.prototype.setVideoQuality=function(t){Jf[t]?this.videoQuality=xd(xd({},this.videoQuality),Jf[t]):BU("video quality ".concat(t," is not existed"))},t.prototype.setAudioQuality=function(t){Kf[t]?this.audioQuality=xd(xd({},this.audioQuality),Kf[t]):BU("audio quality ".concat(t," is not existed"))},t.prototype.setProperty=function(t,e){var r,n;switch(t){case"setVideoResolution":"object"===Wc(e)&&"number"==typeof e.width&&"number"==typeof e.height&&e.width>0&&e.height>0?(this.videoQuality.width=e.width,this.videoQuality.height=e.height):BU("videoResolution width and height must be a number greater than 0");break;case"setVideoFPS":"number"==typeof e&&e>0?this.videoQuality.frameRate=e:BU("videoFPS must be a number greater than 0");break;case"setVideoBitrate":"number"==typeof e&&e>0?(this.videoQuality.bitrate=e,null===(r=this.connection)||void 0===r||r.setVideoBitrate(e)):BU("videoBitrate must be a number greater than 0");break;case"setAudioSampleRate":"number"==typeof e&&e>0?this.audioQuality.sampleRate=e:BU("audioSampleRate must be a number greater than 0");break;case"setAudioBitrate":"number"==typeof e&&e>0?(this.audioQuality.bitrate=e,null===(n=this.connection)||void 0===n||n.setAudioBitrate(e)):BU("audioBitrate must be a number greater than 0");break;case"enableAudioAEC":this.audioQuality.echoCancellation=!!e;break;case"enableAudioAGC":this.audioQuality.autoGainControl=!!e;break;case"enableAudioANS":this.audioQuality.noiseSuppression=!!e;break;case"setConnectRetryCount":"number"==typeof e&&e>=0&&e<=10?this.connectRetry.maxCount=e:BU("connectRetryCount must be a number between 0 and ".concat(10));break;case"setConnectRetryDelay":"number"==typeof e&&e>=0&&e<=10?this.connectRetry.delay=e:BU("connectRetryDelay must be a number between 0 and ".concat(10));break;case"setMetadata":"object"===Wc(e)?this.advancedSettings.metadata=e?xd({},e):null:BU("metadata must be an object");break;case"setSignalingServer":"string"==typeof e?this.advancedSettings.signalingServer=e:BU("signalingServer must be string");break;case"enableLog":e?Yf.enable("*"):Yf.disable();break;default:BU("".concat(t," is not existed"))}},t.prototype.startCamera=function(t){var e,r,n;return Ed(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,l,d,f=this;return Sd(this,(function(p){switch(p.label){case 0:if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw BU("stream is pushing, please stop pushing first"),new Error("stream is pushing");if((null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw BU("video track is existed"),new Error("video track is existed")}i=Df(),o=new UC({type:"device",video:!0,audio:!1,onEvent:function(t){var e,r,n;t.type===lp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(n=(r=f.observer).onWarning)||void 0===n||n.call(r,Hf.TXLIVE_WARNING_CAMERA_INTERRUPTED,"interrupted",{streamId:i}))}}),s=this.videoQuality,a=s.frameRate,u=s.width,c=s.height,o.setVideoConfig({deviceId:t||"",frameRate:a,resolution:{width:u,height:c}}),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,o.start()];case 2:return h=p.sent(),l=qC("video",o),this.initTrackData(l,h),this.streamList.push({id:i,type:"camera",source:o,track:l}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,i];case 3:throw d=p.sent(),null===(n=(r=this.observer).onWarning)||void 0===n||n.call(r,Hf.TXLIVE_WARNING_CAMERA_START_FAILED,d.toString(),null),d;case 4:return[2]}}))}))},t.prototype.stopCamera=function(t){var e,r,n;if(this.videoEffectManager.enabled||!this.isStreamPushing){var i=Lh(e=this.streamList).call(e,(function(e){return"camera"===e.type&&(void 0===t||e.id===t)}));if(0!==i.length){var o=function(t,e){var r;e instanceof UC&&e.stop();var n,i=Vh(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==i&&pl(n=s.streamList).call(n,i,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=wd(i),u=a.next();!u.done;u=a.next()){var c=u.value;o(c.id,c.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else BU("camera stream is not existed")}else BU("stream is pushing, please stop pushing first")},t.prototype.startMicrophone=function(t){var e,r,n;return Ed(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,l,d,f,p=this;return Sd(this,(function(v){switch(v.label){case 0:if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw BU("stream is pushing, please stop pushing first"),new Error("stream is pushing");if((null===(e=this.streamOutput)||void 0===e?void 0:e.getAudioTracks().length)>0)throw BU("audio track is existed"),new Error("audio track is existed")}i=Df(),o=new UC({type:"device",video:!1,audio:!0,onEvent:function(t){var e,r,n;t.type===lp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(n=(r=p.observer).onWarning)||void 0===n||n.call(r,Hf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,"interrupted",{streamId:i}))}}),s=this.audioQuality,a=s.sampleRate,u=s.echoCancellation,c=s.noiseSuppression,h=s.autoGainControl,o.setAudioConfig({deviceId:t||"",sampleRate:a,echoCancellation:u,noiseSuppression:c,autoGainControl:h}),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,o.start()];case 2:return l=v.sent(),d=qC("audio",o),this.initTrackData(d,l),this.streamList.push({id:i,type:"microphone",source:o,track:d}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,i];case 3:throw f=v.sent(),null===(n=(r=this.observer).onWarning)||void 0===n||n.call(r,Hf.TXLIVE_WARNING_MICROPHONE_START_FAILED,f.toString(),null),f;case 4:return[2]}}))}))},t.prototype.stopMicrophone=function(t){var e,r,n;if(this.videoEffectManager.enabled||!this.isStreamPushing){var i=Lh(e=this.streamList).call(e,(function(e){return"microphone"===e.type&&(void 0===t||e.id===t)}));if(0!==i.length){var o=function(t,e){var r;e instanceof UC&&e.stop();var n,i=Vh(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==i&&pl(n=s.streamList).call(n,i,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=wd(i),u=a.next();!u.done;u=a.next()){var c=u.value;o(c.id,c.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else BU("microphone stream is not existed")}else BU("stream is pushing, please stop pushing first")},t.prototype.startScreenCapture=function(t){var e,r,n,i;return void 0===t&&(t=!1),Ed(this,void 0,void 0,(function(){var o,s,a,u,c,h,l,d,f,p,v,m,y,g,_=this;return Sd(this,(function(b){switch(b.label){case 0:if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw BU("stream is pushing, please stop pushing first"),new Error("stream is pushing");if((null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw BU("video track is existed"),new Error("video track is existed");if(t&&(null===(r=this.streamOutput)||void 0===r?void 0:r.getAudioTracks().length)>0)throw BU("audio track is existed"),new Error("audio track is existed")}o=Df(),s=new UC({type:"screen",video:!0,audio:t,onEvent:function(t){var e,r,n;t.type===lp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(n=(r=_.observer).onWarning)||void 0===n||n.call(r,Hf.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED,"interrupted",{streamId:o}))}}),a=this.videoQuality,u=a.frameRate,c=a.width,h=a.height,s.setVideoConfig({frameRate:u,resolution:{width:c,height:h}}),t&&(l=this.audioQuality,d=l.sampleRate,f=l.echoCancellation,p=l.noiseSuppression,v=l.autoGainControl,s.setAudioConfig({sampleRate:d,echoCancellation:f,noiseSuppression:p,autoGainControl:v})),b.label=1;case 1:return b.trys.push([1,3,,4]),[4,s.start()];case 2:return m=b.sent(),y=qC("video",s),this.initTrackData(y,m),this.streamList.push({id:o,type:"screen",source:s,track:y}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,o];case 3:throw g=b.sent(),null===(i=(n=this.observer).onWarning)||void 0===i||i.call(n,Hf.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED,g.toString(),null),g;case 4:return[2]}}))}))},t.prototype.stopScreenCapture=function(t){var e,r,n;if(this.videoEffectManager.enabled||!this.isStreamPushing){var i=Lh(e=this.streamList).call(e,(function(e){return"screen"===e.type&&(void 0===t||e.id===t)}));if(0!==i.length){var o=function(t,e){var r;e instanceof UC&&e.stop();var n,i=Vh(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==i&&pl(n=s.streamList).call(n,i,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=wd(i),u=a.next();!u.done;u=a.next()){var c=u.value;o(c.id,c.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else BU("screen stream is not existed")}else BU("stream is pushing, please stop pushing first")},t.prototype.startVirtualCamera=function(t){var e,r,n,i;return Ed(this,void 0,void 0,(function(){var o,s,a,u,c,h,l,d,f,p;return Sd(this,(function(v){switch(v.label){case 0:if(!(t&&t instanceof File))throw BU("file is invalid"),new Error("file is invalid");if(o=function(t){var e="";switch(t.type){case"video/mp4":e="video";break;case"audio/mpeg":e="audio";break;case"image/jpeg":case"image/png":case"image/bmp":e="image";break;default:e=""}return e}(t),!o)throw BU("file type is invalid"),new Error("file type is invalid");if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw BU("stream is pushing, please stop pushing first"),new Error("stream is pushing");if(("video"===o||"image"===o)&&(null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw BU("video track is existed"),new Error("video track is existed");if(("video"===o||"audio"===o)&&(null===(r=this.streamOutput)||void 0===r?void 0:r.getAudioTracks().length)>0)throw BU("audio track is existed"),new Error("audio track is existed")}s=Df(),a=new UC({type:"file",video:"audio"!==o,audio:"image"!==o,fileSource:t}),u=this.videoQuality,c=u.frameRate,h=u.width,l=u.height,a.setVideoConfig({frameRate:c,resolution:{width:h,height:l}}),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,a.start()];case 2:return d=v.sent(),f=qC("audio"!==o?"video":"audio",a),this.initTrackData(f,d),this.streamList.push({id:s,type:"file",source:a,track:f}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,s];case 3:throw p=v.sent(),null===(i=(n=this.observer).onWarning)||void 0===i||i.call(n,Hf.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED,p.toString(),null),p;case 4:return[2]}}))}))},t.prototype.stopVirtualCamera=function(t){var e,r,n;if(this.videoEffectManager.enabled||!this.isStreamPushing){var i=Lh(e=this.streamList).call(e,(function(e){return"file"===e.type&&(void 0===t||e.id===t)}));if(0!==i.length){var o=function(t,e){var r;e instanceof UC&&e.stop();var n,i=Vh(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==i&&pl(n=s.streamList).call(n,i,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=wd(i),u=a.next();!u.done;u=a.next()){var c=u.value;o(c.id,c.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else BU("file stream is not existed")}else BU("stream is pushing, please stop pushing first")},t.prototype.startMediaFile=function(t){return this.startVirtualCamera(t)},t.prototype.stopMediaFile=function(t){return this.stopVirtualCamera(t)},t.prototype.startCustomCapture=function(t){var e,r;return Ed(this,void 0,void 0,(function(){var n,i,o,s;return Sd(this,(function(a){if(!(t&&t instanceof MediaStream))throw BU("stream is invalid"),new Error("stream is invalid");if(n=t.getVideoTracks().length,i=t.getAudioTracks().length,0===n&&0===i)throw BU("stream is empty"),new Error("stream is empty");if(n>1||i>1)throw BU("the number of ".concat(n>1?"video":"audio"," tracks is greater than 1")),new Error("the number of ".concat(n>1?"video":"audio"," tracks is greater than 1"));if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw BU("stream is pushing, please stop pushing first"),new Error("stream is pushing");if(n>0&&(null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw BU("video track is existed"),new Error("video track is existed");if(i>0&&(null===(r=this.streamOutput)||void 0===r?void 0:r.getAudioTracks().length)>0)throw BU("audio track is existed"),new Error("audio track is existed")}return o=Df(),s=qC(n>0?"video":"audio",t),this.initTrackData(s,t),this.streamList.push({id:o,type:"custom",source:t,track:s}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,o]}))}))},t.prototype.stopCustomCapture=function(t){var e,r,n;if(this.videoEffectManager.enabled||!this.isStreamPushing){var i=Lh(e=this.streamList).call(e,(function(e){return"custom"===e.type&&(void 0===t||e.id===t)}));if(0!==i.length){var o=function(t,e){var r,n,i=Vh(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==i&&pl(n=s.streamList).call(n,i,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay(e)},s=this;try{for(var a=wd(i),u=a.next();!u.done;u=a.next()){var c=u.value;o(c.id,c.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else BU("custom stream is not existed")}else BU("stream is pushing, please stop pushing first")},t.prototype.startPush=function(t){var e,r;return Ed(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,h=this;return Sd(this,(function(l){switch(l.label){case 0:if(!t)throw BU("push url is not existed"),new Error("push url is not existed");if(this.isStreamPushing)throw BU("stream is pushing, please stop pushing first"),new Error("stream is pushing");if(!this.streamOutput)throw BU("no stream for pushing"),new Error("no stream for pushing");this.connection||(this.connection=new cP({onStatusUpdate:this.onConnectionStatusUpdate,onStatisticsUpdate:function(t){var e,r;null===(r=(e=h.observer).onStatisticsUpdate)||void 0===r||r.call(e,t)}})),this.connection.setUrl(t),this.connection.setStreamSource(this.streamOutput),this.connection.setVideoBitrate(this.videoQuality.bitrate),this.connection.setAudioBitrate(this.audioQuality.bitrate),n=this.advancedSettings,i=n.metadata,o=n.signalingServer,s=o?{domainName:o}:{},a=i||{videodatarate:this.videoQuality.bitrate,audiodatarate:this.audioQuality.bitrate},this.connection.setSignalingConfig(xd(xd({},s),{extraParams:{metadata:a}})),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.connection.start()];case 2:return l.sent(),[3,4];case 3:throw u=l.sent(),c="RequestError"===u.name?Hf.TXLIVE_ERROR_REQUEST_FAILED:Hf.TXLIVE_ERROR_WEBRTC_FAILED,null===(r=(e=this.observer).onError)||void 0===r||r.call(e,c,u.toString(),null),u;case 4:return[2]}}))}))},t.prototype.stopPush=function(){var t;this.isStreamPushing?(this.connectRetry.timeoutId&&(window.clearTimeout(this.connectRetry.timeoutId),this.connectRetry.timeoutId=null,this.connectRetry.curCount=0),null===(t=this.connection)||void 0===t||t.stop()):BU("no stream is pushing")},t.prototype.isPushing=function(){return!(!this.streamOutput||!this.isStreamPushing)},t.prototype.getRenderView=function(){return this.videoView},t.prototype.getMediaStream=function(t){var e;if(!t)return BU("streamId is not existed"),null;var r=El(e=this.streamList).call(e,(function(e){return e.id===t}));return r?r.source instanceof UC?r.source.getMediaStream():r.source:(BU("stream is not existed"),null)},t.prototype.getDeviceManager=function(){return this.deviceManager},t.prototype.getVideoEffectManager=function(){return this.videoEffectManager},t.prototype.getAudioEffectManager=function(){return this.audioEffectManager},t.prototype.setVideoMute=function(t){var e,r;null===(r=this.streamOutput)||void 0===r||Ph(e=r.getVideoTracks()).call(e,(function(e){e.enabled=!t})),this.canvasView&&(t?this.canvasView.style.filter="brightness(0%)":this.canvasView.style.removeProperty("filter"))},t.prototype.setAudioMute=function(t){var e,r;null===(r=this.streamOutput)||void 0===r||Ph(e=r.getAudioTracks()).call(e,(function(e){e.enabled=!t}))},t.prototype.pauseVideo=function(){this.setVideoMute(!0)},t.prototype.pauseAudio=function(){this.setAudioMute(!0)},t.prototype.resumeVideo=function(){this.setVideoMute(!1)},t.prototype.resumeAudio=function(){this.setAudioMute(!1)},t.prototype.setVideoContentHint=function(t){var e,r;null===(r=this.streamOutput)||void 0===r||Ph(e=r.getVideoTracks()).call(e,(function(e){e.contentHint=t}))},t.prototype.setObserver=function(t){var e,r=this,n=Rl(this.observer);Ph(e=Rl(t)).call(e,(function(e){var i=t[e];Jl(n).call(n,e)&&"function"==typeof i&&(r.observer[e]=i)}))},t.prototype.destroy=function(){var t,e;(null===document||void 0===document||document.removeEventListener("visibilitychange",this.onVisibilityChange),this.connectRetry.timeoutId&&(window.clearTimeout(this.connectRetry.timeoutId),this.connectRetry.timeoutId=null),this.connection&&(this.connection.stop(),this.connection=null),this.effectProcess&&(this.effectProcess.stop(),this.effectProcess=null),this.streamList)&&(Ph(t=this.streamList).call(t,(function(t){t.source instanceof UC&&t.source.stop()})),this.streamList=null);this.streamOutput&&(Ph(e=this.streamOutput.getTracks()).call(e,(function(t){"ended"!==t.readyState&&t.stop()})),this.streamOutput=null);this.videoView&&(this.videoView.pause(),this.videoView.srcObject=null,this.videoView.load(),this.videoView.remove(),this.videoView=null),this.canvasView&&(this.canvasView.remove(),this.canvasView=null),this.observer=null,this.deviceManager=null,this.videoEffectManager=null,this.audioEffectManager=null},t.prototype.onConnectionStatusUpdate=function(t){var e,r,n,i,o,s,a,u=this;t.type===ep?(this.isStreamPushing=!0,this.connectRetry.curCount=0,null===(r=(e=this.observer).onPushStatusUpdate)||void 0===r||r.call(e,Wf.TXLIVE_PUSH_STATUS_CONNECTED,"connected",null)):t.type===$f?(this.isStreamPushing=!1,"connection disconnected"===(null===(n=t.data)||void 0===n?void 0:n.message)?(this.connection.stop(),this.connectRetry.timeoutId&&(window.clearTimeout(this.connectRetry.timeoutId),this.connectRetry.timeoutId=null),this.connectRetry.timeoutId=cd((function(){var t,e,r,n;u.connectRetry.curCount+=1;var i,o=u.connectRetry,s=o.curCount,a=o.maxCount;s<=a?(BU(mh(i="current retry count: ".concat(s,", max retry count: ")).call(i,a)),null===(e=(t=u.observer).onPushStatusUpdate)||void 0===e||e.call(t,Wf.TXLIVE_PUSH_STATUS_RECONNECTING,"reconnecting",null),u.connection.start().catch((function(t){var e,r;BU("reconnect error, ".concat(t.toString())),"RequestError"===t.name&&(null===(r=(e=u.observer).onError)||void 0===r||r.call(e,Hf.TXLIVE_ERROR_REQUEST_FAILED,t.toString(),null))}))):(null===(n=(r=u.observer).onPushStatusUpdate)||void 0===n||n.call(r,Wf.TXLIVE_PUSH_STATUS_DISCONNECTED,"disconnected",null),u.connectRetry.curCount=0,u.stopVideoProcess());u.connectRetry.timeoutId=null}),1e3*this.connectRetry.delay)):(null===(o=(i=this.observer).onPushStatusUpdate)||void 0===o||o.call(i,Wf.TXLIVE_PUSH_STATUS_DISCONNECTED,"disconnected",null),this.stopVideoProcess())):t.type===tp&&(null===(a=(s=this.observer).onPushStatusUpdate)||void 0===a||a.call(s,Wf.TXLIVE_PUSH_STATUS_CONNECTING,"connecting",null))},t.prototype.initTrackData=function(t,e){if(e.getVideoTracks().length>0){var r,n=Lh(r=this.streamList).call(r,(function(t){var e,r=t.source,n=r instanceof UC?r.getMediaStream():r;return null===(e=null==n?void 0:n.getVideoTracks())||void 0===e?void 0:e.length}));t.setOrder(n.length)}e.getAudioTracks().length>0&&t.setVolume(100)},t.prototype.setProcessData=function(){var t,e,r,n,i,o,s=null;this.videoEffectManager.enabled?s=vd(e=mh(r=vd(n=this.streamList).call(n,(function(t){return t.track}))).call(r,this.effectTrackList)).call(e,(function(t){return t.data})):s=vd(i=Lh(o=this.streamList).call(o,(function(t){var e,r=t.source,n=r instanceof UC?r.getMediaStream():r;return null===(e=null==n?void 0:n.getAudioTracks())||void 0===e?void 0:e.length}))).call(i,(function(t){return t.track.data}));null===(t=this.effectProcess)||void 0===t||t.setData(s)},t.prototype.startVideoPlay=function(){var t,e,r,n,i;return Ed(this,void 0,void 0,(function(){var o,s,a,u,c,h,l,d;return Sd(this,(function(f){switch(f.label){case 0:return this.streamOutput||(this.streamOutput=new MediaStream),this.effectProcess||(this.effectProcess=new kU),o=this.streamList[this.streamList.length-1],s=o.source,a=s instanceof UC?s.getMediaStream():s,u=null,a.getAudioTracks().length>0?(this.setProcessData(),this.effectProcess.isStart()?[3,2]:(this.effectProcess.setResolution({width:0,height:0}),[4,this.effectProcess.start()])):[3,3];case 1:f.sent(),f.label=2;case 2:u=this.effectProcess.getOutput(),f.label=3;case 3:if(c=a.getVideoTracks(),0===this.streamOutput.getVideoTracks().length&&c.length>0&&(this.streamOutput.addTrack(c[0]),null===(e=(t=this.observer).onCaptureFirstVideoFrame)||void 0===e||e.call(t)),h=null==u?void 0:u.getAudioTracks(),0===this.streamOutput.getAudioTracks().length&&(null==h?void 0:h.length)>0&&(this.streamOutput.addTrack(h[0]),null===(n=(r=this.observer).onCaptureFirstAudioFrame)||void 0===n||n.call(r)),!this.videoView)return[2];var p;if(!this.canvasView)if(l=$x&&s instanceof UC?s.getRenderView():null)l.setAttribute("style",Zf),this.canvasView=l,this.videoView.setAttribute("style",mh(p="".concat(Zf)).call(p,vy)),null===(i=this.videoView.parentElement)||void 0===i||i.insertBefore(l,this.videoView);if(this.videoView.srcObject)return[2];if(this.videoView.srcObject=this.streamOutput,this.videoView.load(),!this.videoView.autoplay)return[2];f.label=4;case 4:return f.trys.push([4,6,,7]),[4,this.videoView.play()];case 5:return f.sent(),BU("play ok"),[3,7];case 6:return d=f.sent(),BU("play failed",d),[3,7];case 7:return[2]}}))}))},t.prototype.stopVideoPlay=function(t){var e,r,n=this;if(this.streamOutput){var i,o=null===(e=this.effectProcess)||void 0===e?void 0:e.getOutput();if(null===(r=null==o?void 0:o.getAudioTracks())||void 0===r?void 0:r.length)Td(i=this.streamList).call(i,(function(t){var e=t.source;return e instanceof UC?!!e.getAudioTrack():e.getAudioTracks().length>0}))||(this.streamOutput.removeTrack(o.getAudioTracks()[0]),this.effectProcess.stop());var s,a=this.streamOutput.getTracks();if(Ph(a).call(a,(function(t){"ended"===t.readyState&&n.streamOutput.removeTrack(t)})),t&&t instanceof MediaStream)Ph(s=t.getTracks()).call(s,(function(t){n.streamOutput.removeTrack(t)}));this.canvasView&&0===this.streamOutput.getVideoTracks().length&&(this.canvasView.remove(),this.canvasView=null,this.videoView.setAttribute("style",Zf)),this.streamOutput.getTracks().length>0||(this.streamOutput=null,this.videoView&&(this.videoView.pause(),this.videoView.srcObject=null,this.videoView.load()))}},t.prototype.startVideoProcess=function(){var t,e,r,n,i,o,s;return Ed(this,void 0,void 0,(function(){var a,u,c,h,l,d,f,p,v,m,y,g,_,b,T,x,E,S,w;return Sd(this,(function(R){switch(R.label){case 0:var C;if(this.streamOutput||(this.streamOutput=new MediaStream),this.effectProcess||(this.effectProcess=new kU),a=this.videoEffectManager.getMixingConfig(),u=a.videoWidth,c=a.videoHeight,h=a.videoFramerate,l=a.backgroundColor,d=this.streamList[this.streamList.length-1],f=d.source,p=f instanceof UC?f.getMediaStream():f,null===(t=null==p?void 0:p.getVideoTracks())||void 0===t?void 0:t.length)v=null!==(e=f instanceof UC?f.getResolution():p.getVideoTracks()[0].getSettings())&&void 0!==e?e:{},m=Lh(C=this.streamList).call(C,(function(t){var e,r=t.source,n=r instanceof UC?r.getMediaStream():r;return null===(e=null==n?void 0:n.getVideoTracks())||void 0===e?void 0:e.length})),1===m.length?d.track.setLayout({width:u,height:c,x:u/2,y:c/2}):(y=v.width,g=v.height,_=null!=y?y:u,b=null!=g?g:c,d.track.setLayout({width:_/2,height:b/2,x:_/4,y:b/4}));return this.setProcessData(),this.effectProcess.isStart()?[3,2]:(this.effectProcess.setResolution({width:u,height:c}),this.effectProcess.setFrameRate(h),this.effectProcess.setBackgroundColor(l),[4,this.effectProcess.start()]);case 1:R.sent(),R.label=2;case 2:if(T=this.effectProcess.getOutput(),x=T.getVideoTracks(),0===this.streamOutput.getVideoTracks().length&&x.length>0&&(this.streamOutput.addTrack(x[0]),null===(n=(r=this.observer).onCaptureFirstVideoFrame)||void 0===n||n.call(r)),E=T.getAudioTracks(),0===this.streamOutput.getAudioTracks().length&&E.length>0&&(this.streamOutput.addTrack(E[0]),null===(o=(i=this.observer).onCaptureFirstAudioFrame)||void 0===o||o.call(i)),!this.videoView)return[2];var P;if(!this.canvasView)if(S=$x?this.effectProcess.getRenderView():null)S.setAttribute("style",Zf),this.canvasView=S,this.videoView.setAttribute("style",mh(P="".concat(Zf)).call(P,vy)),null===(s=this.videoView.parentElement)||void 0===s||s.insertBefore(S,this.videoView);if(this.videoView.srcObject)return[2];if(this.videoView.srcObject=this.streamOutput,this.videoView.load(),!this.videoView.autoplay)return[2];R.label=3;case 3:return R.trys.push([3,5,,6]),[4,this.videoView.play()];case 4:return R.sent(),BU("play ok"),[3,6];case 5:return w=R.sent(),BU("play failed",w),[3,6];case 6:return[2]}}))}))},t.prototype.updateVideoProcess=function(){0!==this.streamList.length||this.isStreamPushing?this.setProcessData():this.stopVideoProcess()},t.prototype.stopVideoProcess=function(){var t,e=this;if(this.videoEffectManager.enabled&&this.streamOutput&&0===this.streamList.length){var r,n=null===(t=this.effectProcess)||void 0===t?void 0:t.getOutput();if(n)Ph(r=n.getTracks()).call(r,(function(t){e.streamOutput.removeTrack(t)})),this.effectProcess.stop();this.streamOutput=null,this.canvasView&&(this.canvasView.remove(),this.canvasView=null,this.videoView.setAttribute("style",Zf)),this.videoView&&(this.videoView.pause(),this.videoView.srcObject=null,this.videoView.load())}},t.prototype.getCommonData=function(){return{streamList:this.streamList,videoEffectManager:this.videoEffectManager,observer:this.observer,videoQuality:this.videoQuality,audioQuality:this.audioQuality,streamOutput:this.streamOutput,isStreamPushing:this.isStreamPushing,connection:this.connection,setProcessData:this.setProcessData,effectTrackList:this.effectTrackList,effectProcess:this.effectProcess}},t.prototype.onVisibilityChange=function(){"visible"===document.visibilityState&&window.TXLiveAudioContext&&my(window.TXLiveAudioContext)},t.version=zf,t}();return GU.init(),GU}));
