diff --git a/assets/AgoraRtcWrapper.bundle.js b/assets/AgoraRtcWrapper.bundle.js
index 3a4c3b6be..d6958c8a9 100644
--- a/assets/AgoraRtcWrapper.bundle.js
+++ b/assets/AgoraRtcWrapper.bundle.js
@@ -1,2 +1,2 @@
 /*! For license information please see AgoraRtcWrapper.bundle.js.LICENSE.txt */
-var IrisRtcEngine;(()=>{var e={424:function(e,t,i){e.exports=function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")(),r={},o=function(e){try{return!!e()}catch(e){return!0}},s=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=a,A=Function.prototype.call,d=c?A.bind(A):function(){return A.apply(A,arguments)},u={},E={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,h=l&&!E.call({1:2},1);u.f=h?function(e){var t=l(this,e);return!!t&&t.enumerable}:E;var p,_,I=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=a,f=Function.prototype,R=f.bind,C=f.call,T=g&&R.bind(C,C),m=g?function(e){return e&&T(e)}:function(e){return e&&function(){return C.apply(e,arguments)}},S=m,O=S({}.toString),v=S("".slice),N=function(e){return v(O(e),8,-1)},y=m,D=o,w=N,b=n.Object,L=y("".split),P=D((function(){return!b("z").propertyIsEnumerable(0)}))?function(e){return"String"==w(e)?L(e,""):b(e)}:b,k=n.TypeError,M=function(e){if(null==e)throw k("Can't call method on "+e);return e},U=P,B=M,V=function(e){return U(B(e))},Q=function(e){return"function"==typeof e},x=Q,F=function(e){return"object"==typeof e?null!==e:x(e)},G=n,j=Q,Y=function(e){return j(e)?e:void 0},H=function(e,t){return arguments.length<2?Y(G[e]):G[e]&&G[e][t]},K=m({}.isPrototypeOf),W=H("navigator","userAgent")||"",J=n,q=W,X=J.process,z=J.Deno,Z=X&&X.versions||z&&z.version,$=Z&&Z.v8;$&&(_=(p=$.split("."))[0]>0&&p[0]<4?1:+(p[0]+p[1])),!_&&q&&(!(p=q.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=q.match(/Chrome\/(\d+)/))&&(_=+p[1]);var ee=_,te=ee,ie=o,ne=!!Object.getOwnPropertySymbols&&!ie((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&te&&te<41})),re=ne&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,oe=H,se=Q,ae=K,ce=re,Ae=n.Object,de=ce?function(e){return"symbol"==typeof e}:function(e){var t=oe("Symbol");return se(t)&&ae(t.prototype,Ae(e))},ue=n.String,Ee=function(e){try{return ue(e)}catch(e){return"Object"}},le=Q,he=Ee,pe=n.TypeError,_e=function(e){if(le(e))return e;throw pe(he(e)+" is not a function")},Ie=_e,ge=function(e,t){var i=e[t];return null==i?void 0:Ie(i)},fe=d,Re=Q,Ce=F,Te=n.TypeError,me={exports:{}},Se=n,Oe=Object.defineProperty,ve=function(e,t){try{Oe(Se,e,{value:t,configurable:!0,writable:!0})}catch(i){Se[e]=t}return t},Ne=ve,ye="__core-js_shared__",De=n[ye]||Ne(ye,{}),we=De;(me.exports=function(e,t){return we[e]||(we[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var be=M,Le=n.Object,Pe=function(e){return Le(be(e))},ke=Pe,Me=m({}.hasOwnProperty),Ue=Object.hasOwn||function(e,t){return Me(ke(e),t)},Be=m,Ve=0,Qe=Math.random(),xe=Be(1..toString),Fe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+xe(++Ve+Qe,36)},Ge=n,je=me.exports,Ye=Ue,He=Fe,Ke=ne,We=re,Je=je("wks"),qe=Ge.Symbol,Xe=qe&&qe.for,ze=We?qe:qe&&qe.withoutSetter||He,Ze=function(e){if(!Ye(Je,e)||!Ke&&"string"!=typeof Je[e]){var t="Symbol."+e;Ke&&Ye(qe,e)?Je[e]=qe[e]:Je[e]=We&&Xe?Xe(t):ze(t)}return Je[e]},$e=d,et=F,tt=de,it=ge,nt=Ze,rt=n.TypeError,ot=nt("toPrimitive"),st=function(e,t){if(!et(e)||tt(e))return e;var i,n=it(e,ot);if(n){if(void 0===t&&(t="default"),i=$e(n,e,t),!et(i)||tt(i))return i;throw rt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var i,n;if("string"===t&&Re(i=e.toString)&&!Ce(n=fe(i,e)))return n;if(Re(i=e.valueOf)&&!Ce(n=fe(i,e)))return n;if("string"!==t&&Re(i=e.toString)&&!Ce(n=fe(i,e)))return n;throw Te("Can't convert object to primitive value")}(e,t)},at=de,ct=function(e){var t=st(e,"string");return at(t)?t:t+""},At=F,dt=n.document,ut=At(dt)&&At(dt.createElement),Et=function(e){return ut?dt.createElement(e):{}},lt=Et,ht=!s&&!o((function(){return 7!=Object.defineProperty(lt("div"),"a",{get:function(){return 7}}).a})),pt=s,_t=d,It=u,gt=I,ft=V,Rt=ct,Ct=Ue,Tt=ht,mt=Object.getOwnPropertyDescriptor;r.f=pt?mt:function(e,t){if(e=ft(e),t=Rt(t),Tt)try{return mt(e,t)}catch(e){}if(Ct(e,t))return gt(!_t(It.f,e,t),e[t])};var St={},Ot=s&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),vt=n,Nt=F,yt=vt.String,Dt=vt.TypeError,wt=function(e){if(Nt(e))return e;throw Dt(yt(e)+" is not an object")},bt=s,Lt=ht,Pt=Ot,kt=wt,Mt=ct,Ut=n.TypeError,Bt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor;St.f=bt?Pt?function(e,t,i){if(kt(e),t=Mt(t),kt(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=Vt(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return Bt(e,t,i)}:Bt:function(e,t,i){if(kt(e),t=Mt(t),kt(i),Lt)try{return Bt(e,t,i)}catch(e){}if("get"in i||"set"in i)throw Ut("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var Qt=St,xt=I,Ft=s?function(e,t,i){return Qt.f(e,t,xt(1,i))}:function(e,t,i){return e[t]=i,e},Gt={exports:{}},jt=Q,Yt=De,Ht=m(Function.toString);jt(Yt.inspectSource)||(Yt.inspectSource=function(e){return Ht(e)});var Kt,Wt,Jt,qt=Yt.inspectSource,Xt=Q,zt=qt,Zt=n.WeakMap,$t=Xt(Zt)&&/native code/.test(zt(Zt)),ei=me.exports,ti=Fe,ii=ei("keys"),ni=function(e){return ii[e]||(ii[e]=ti(e))},ri={},oi=$t,si=n,ai=m,ci=F,Ai=Ft,di=Ue,ui=De,Ei=ni,li=ri,hi="Object already initialized",pi=si.TypeError,_i=si.WeakMap;if(oi||ui.state){var Ii=ui.state||(ui.state=new _i),gi=ai(Ii.get),fi=ai(Ii.has),Ri=ai(Ii.set);Kt=function(e,t){if(fi(Ii,e))throw new pi(hi);return t.facade=e,Ri(Ii,e,t),t},Wt=function(e){return gi(Ii,e)||{}},Jt=function(e){return fi(Ii,e)}}else{var Ci=Ei("state");li[Ci]=!0,Kt=function(e,t){if(di(e,Ci))throw new pi(hi);return t.facade=e,Ai(e,Ci,t),t},Wt=function(e){return di(e,Ci)?e[Ci]:{}},Jt=function(e){return di(e,Ci)}}var Ti={set:Kt,get:Wt,has:Jt,enforce:function(e){return Jt(e)?Wt(e):Kt(e,{})},getterFor:function(e){return function(t){var i;if(!ci(t)||(i=Wt(t)).type!==e)throw pi("Incompatible receiver, "+e+" required");return i}}},mi=s,Si=Ue,Oi=Function.prototype,vi=mi&&Object.getOwnPropertyDescriptor,Ni=Si(Oi,"name"),yi={EXISTS:Ni,PROPER:Ni&&"something"===function(){}.name,CONFIGURABLE:Ni&&(!mi||mi&&vi(Oi,"name").configurable)},Di=n,wi=Q,bi=Ue,Li=Ft,Pi=ve,ki=qt,Mi=yi.CONFIGURABLE,Ui=Ti.get,Bi=Ti.enforce,Vi=String(String).split("String");(Gt.exports=function(e,t,i,n){var r,o=!!n&&!!n.unsafe,s=!!n&&!!n.enumerable,a=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:t;wi(i)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!bi(i,"name")||Mi&&i.name!==c)&&Li(i,"name",c),(r=Bi(i)).source||(r.source=Vi.join("string"==typeof c?c:""))),e!==Di?(o?!a&&e[t]&&(s=!0):delete e[t],s?e[t]=i:Li(e,t,i)):s?e[t]=i:Pi(t,i)})(Function.prototype,"toString",(function(){return wi(this)&&Ui(this).source||ki(this)}));var Qi={},xi=Math.ceil,Fi=Math.floor,Gi=function(e){var t=+e;return t!=t||0===t?0:(t>0?Fi:xi)(t)},ji=Gi,Yi=Math.max,Hi=Math.min,Ki=function(e,t){var i=ji(e);return i<0?Yi(i+t,0):Hi(i,t)},Wi=Gi,Ji=Math.min,qi=function(e){return e>0?Ji(Wi(e),9007199254740991):0},Xi=qi,zi=function(e){return Xi(e.length)},Zi=V,$i=Ki,en=zi,tn=function(e){return function(t,i,n){var r,o=Zi(t),s=en(o),a=$i(n,s);if(e&&i!=i){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===i)return e||a||0;return!e&&-1}},nn={includes:tn(!0),indexOf:tn(!1)},rn=Ue,on=V,sn=nn.indexOf,an=ri,cn=m([].push),An=function(e,t){var i,n=on(e),r=0,o=[];for(i in n)!rn(an,i)&&rn(n,i)&&cn(o,i);for(;t.length>r;)rn(n,i=t[r++])&&(~sn(o,i)||cn(o,i));return o},dn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],un=An,En=dn.concat("length","prototype");Qi.f=Object.getOwnPropertyNames||function(e){return un(e,En)};var ln={};ln.f=Object.getOwnPropertySymbols;var hn=H,pn=Qi,_n=ln,In=wt,gn=m([].concat),fn=hn("Reflect","ownKeys")||function(e){var t=pn.f(In(e)),i=_n.f;return i?gn(t,i(e)):t},Rn=Ue,Cn=fn,Tn=r,mn=St,Sn=function(e,t,i){for(var n=Cn(t),r=mn.f,o=Tn.f,s=0;s<n.length;s++){var a=n[s];Rn(e,a)||i&&Rn(i,a)||r(e,a,o(t,a))}},On=o,vn=Q,Nn=/#|\.prototype\./,yn=function(e,t){var i=wn[Dn(e)];return i==Ln||i!=bn&&(vn(t)?On(t):!!t)},Dn=yn.normalize=function(e){return String(e).replace(Nn,".").toLowerCase()},wn=yn.data={},bn=yn.NATIVE="N",Ln=yn.POLYFILL="P",Pn=yn,kn=n,Mn=r.f,Un=Ft,Bn=Gt.exports,Vn=ve,Qn=Sn,xn=Pn,Fn=function(e,t){var i,n,r,o,s,a=e.target,c=e.global,A=e.stat;if(i=c?kn:A?kn[a]||Vn(a,{}):(kn[a]||{}).prototype)for(n in t){if(o=t[n],r=e.noTargetGet?(s=Mn(i,n))&&s.value:i[n],!xn(c?n:a+(A?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;Qn(o,r)}(e.sham||r&&r.sham)&&Un(o,"sham",!0),Bn(i,n,o,e)}},Gn=n.Promise,jn=Gt.exports,Yn=function(e,t,i){for(var n in t)jn(e,n,t[n],i);return e},Hn=n,Kn=Q,Wn=Hn.String,Jn=Hn.TypeError,qn=m,Xn=wt,zn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=qn(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return Xn(i),function(e){if("object"==typeof e||Kn(e))return e;throw Jn("Can't set "+Wn(e)+" as a prototype")}(n),t?e(i,n):i.__proto__=n,i}}():void 0),Zn=St.f,$n=Ue,er=Ze("toStringTag"),tr=function(e,t,i){e&&!i&&(e=e.prototype),e&&!$n(e,er)&&Zn(e,er,{configurable:!0,value:t})},ir=H,nr=St,rr=s,or=Ze("species"),sr=function(e){var t=ir(e),i=nr.f;rr&&t&&!t[or]&&i(t,or,{configurable:!0,get:function(){return this}})},ar=K,cr=n.TypeError,Ar=function(e,t){if(ar(t,e))return e;throw cr("Incorrect invocation")},dr=_e,ur=a,Er=m(m.bind),lr=function(e,t){return dr(e),void 0===t?e:ur?Er(e,t):function(){return e.apply(t,arguments)}},hr={},pr=hr,_r=Ze("iterator"),Ir=Array.prototype,gr=function(e){return void 0!==e&&(pr.Array===e||Ir[_r]===e)},fr={};fr[Ze("toStringTag")]="z";var Rr=n,Cr="[object z]"===String(fr),Tr=Q,mr=N,Sr=Ze("toStringTag"),Or=Rr.Object,vr="Arguments"==mr(function(){return arguments}()),Nr=Cr?mr:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Or(e),Sr))?i:vr?mr(t):"Object"==(n=mr(t))&&Tr(t.callee)?"Arguments":n},yr=Nr,Dr=ge,wr=hr,br=Ze("iterator"),Lr=function(e){if(null!=e)return Dr(e,br)||Dr(e,"@@iterator")||wr[yr(e)]},Pr=d,kr=_e,Mr=wt,Ur=Ee,Br=Lr,Vr=n.TypeError,Qr=function(e,t){var i=arguments.length<2?Br(e):t;if(kr(i))return Mr(Pr(i,e));throw Vr(Ur(e)+" is not iterable")},xr=d,Fr=wt,Gr=ge,jr=lr,Yr=d,Hr=wt,Kr=Ee,Wr=gr,Jr=zi,qr=K,Xr=Qr,zr=Lr,Zr=function(e,t,i){var n,r;Fr(e);try{if(!(n=Gr(e,"return"))){if("throw"===t)throw i;return i}n=xr(n,e)}catch(e){r=!0,n=e}if("throw"===t)throw i;if(r)throw n;return Fr(n),i},$r=n.TypeError,eo=function(e,t){this.stopped=e,this.result=t},to=eo.prototype,io=Ze("iterator"),no=!1;try{var ro=0,oo={next:function(){return{done:!!ro++}},return:function(){no=!0}};oo[io]=function(){return this},Array.from(oo,(function(){throw 2}))}catch(e){}var so=function(e,t){if(!t&&!no)return!1;var i=!1;try{var n={};n[io]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(e){}return i},ao=m,co=o,Ao=Q,uo=Nr,Eo=qt,lo=function(){},ho=[],po=H("Reflect","construct"),_o=/^\s*(?:class|function)\b/,Io=ao(_o.exec),go=!_o.exec(lo),fo=function(e){if(!Ao(e))return!1;try{return po(lo,ho,e),!0}catch(e){return!1}},Ro=function(e){if(!Ao(e))return!1;switch(uo(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return go||!!Io(_o,Eo(e))}catch(e){return!0}};Ro.sham=!0;var Co,To,mo,So,Oo=!po||co((function(){var e;return fo(fo.call)||!fo(Object)||!fo((function(){e=!0}))||e}))?Ro:fo,vo=Oo,No=Ee,yo=n.TypeError,Do=function(e){if(vo(e))return e;throw yo(No(e)+" is not a constructor")},wo=wt,bo=Do,Lo=Ze("species"),Po=function(e,t){var i,n=wo(e).constructor;return void 0===n||null==(i=wo(n)[Lo])?t:bo(i)},ko=a,Mo=Function.prototype,Uo=Mo.apply,Bo=Mo.call,Vo="object"==typeof Reflect&&Reflect.apply||(ko?Bo.bind(Uo):function(){return Bo.apply(Uo,arguments)}),Qo=H("document","documentElement"),xo=m([].slice),Fo=/(?:ipad|iphone|ipod).*applewebkit/i.test(W),Go="process"==N(n.process),jo=n,Yo=Vo,Ho=lr,Ko=Q,Wo=Ue,Jo=o,qo=Qo,Xo=xo,zo=Et,Zo=Fo,$o=Go,es=jo.setImmediate,ts=jo.clearImmediate,is=jo.process,ns=jo.Dispatch,rs=jo.Function,os=jo.MessageChannel,ss=jo.String,as=0,cs={};try{Co=jo.location}catch(e){}var As=function(e){if(Wo(cs,e)){var t=cs[e];delete cs[e],t()}},ds=function(e){return function(){As(e)}},us=function(e){As(e.data)},Es=function(e){jo.postMessage(ss(e),Co.protocol+"//"+Co.host)};es&&ts||(es=function(e){var t=Xo(arguments,1);return cs[++as]=function(){Yo(Ko(e)?e:rs(e),void 0,t)},To(as),as},ts=function(e){delete cs[e]},$o?To=function(e){is.nextTick(ds(e))}:ns&&ns.now?To=function(e){ns.now(ds(e))}:os&&!Zo?(So=(mo=new os).port2,mo.port1.onmessage=us,To=Ho(So.postMessage,So)):jo.addEventListener&&Ko(jo.postMessage)&&!jo.importScripts&&Co&&"file:"!==Co.protocol&&!Jo(Es)?(To=Es,jo.addEventListener("message",us,!1)):To="onreadystatechange"in zo("script")?function(e){qo.appendChild(zo("script")).onreadystatechange=function(){qo.removeChild(this),As(e)}}:function(e){setTimeout(ds(e),0)});var ls,hs,ps,_s,Is,gs,fs,Rs,Cs={set:es,clear:ts},Ts=n,ms=/ipad|iphone|ipod/i.test(W)&&void 0!==Ts.Pebble,Ss=/web0s(?!.*chrome)/i.test(W),Os=n,vs=lr,Ns=r.f,ys=Cs.set,Ds=Fo,ws=ms,bs=Ss,Ls=Go,Ps=Os.MutationObserver||Os.WebKitMutationObserver,ks=Os.document,Ms=Os.process,Us=Os.Promise,Bs=Ns(Os,"queueMicrotask"),Vs=Bs&&Bs.value;Vs||(ls=function(){var e,t;for(Ls&&(e=Ms.domain)&&e.exit();hs;){t=hs.fn,hs=hs.next;try{t()}catch(e){throw hs?_s():ps=void 0,e}}ps=void 0,e&&e.enter()},Ds||Ls||bs||!Ps||!ks?!ws&&Us&&Us.resolve?((fs=Us.resolve(void 0)).constructor=Us,Rs=vs(fs.then,fs),_s=function(){Rs(ls)}):Ls?_s=function(){Ms.nextTick(ls)}:(ys=vs(ys,Os),_s=function(){ys(ls)}):(Is=!0,gs=ks.createTextNode(""),new Ps(ls).observe(gs,{characterData:!0}),_s=function(){gs.data=Is=!Is}));var Qs=Vs||function(e){var t={fn:e,next:void 0};ps&&(ps.next=t),hs||(hs=t,_s()),ps=t},xs={},Fs=_e,Gs=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=Fs(t),this.reject=Fs(i)};xs.f=function(e){return new Gs(e)};var js=wt,Ys=F,Hs=xs,Ks=function(e,t){if(js(e),Ys(t)&&t.constructor===e)return t;var i=Hs.f(e);return(0,i.resolve)(t),i.promise},Ws=n,Js=function(){this.head=null,this.tail=null};Js.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var qs,Xs,zs,Zs,$s=Js,ea="object"==typeof window,ta=Fn,ia=n,na=H,ra=d,oa=Gn,sa=Gt.exports,aa=Yn,ca=zn,Aa=tr,da=sr,ua=_e,Ea=Q,la=F,ha=Ar,pa=qt,_a=function(e,t,i){var n,r,o,s,a,c,A,d=i&&i.that,u=!(!i||!i.AS_ENTRIES),E=!(!i||!i.IS_ITERATOR),l=!(!i||!i.INTERRUPTED),h=jr(t,d),p=function(e){return n&&Zr(n,"normal",e),new eo(!0,e)},_=function(e){return u?(Hr(e),l?h(e[0],e[1],p):h(e[0],e[1])):l?h(e,p):h(e)};if(E)n=e;else{if(!(r=zr(e)))throw $r(Kr(e)+" is not iterable");if(Wr(r)){for(o=0,s=Jr(e);s>o;o++)if((a=_(e[o]))&&qr(to,a))return a;return new eo(!1)}n=Xr(e,r)}for(c=n.next;!(A=Yr(c,n)).done;){try{a=_(A.value)}catch(e){Zr(n,"throw",e)}if("object"==typeof a&&a&&qr(to,a))return a}return new eo(!1)},Ia=so,ga=Po,fa=Cs.set,Ra=Qs,Ca=Ks,Ta=xs,ma=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Sa=$s,Oa=Ti,va=Pn,Na=ea,ya=Go,Da=ee,wa=Ze("species"),ba="Promise",La=Oa.getterFor(ba),Pa=Oa.set,ka=Oa.getterFor(ba),Ma=oa&&oa.prototype,Ua=oa,Ba=Ma,Va=ia.TypeError,Qa=ia.document,xa=ia.process,Fa=Ta.f,Ga=Fa,ja=!!(Qa&&Qa.createEvent&&ia.dispatchEvent),Ya=Ea(ia.PromiseRejectionEvent),Ha="unhandledrejection",Ka=!1,Wa=va(ba,(function(){var e=pa(Ua),t=e!==String(Ua);if(!t&&66===Da)return!0;if(Da>=51&&/native code/.test(e))return!1;var i=new Ua((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(i.constructor={})[wa]=n,!(Ka=i.then((function(){}))instanceof n)||!t&&Na&&!Ya})),Ja=Wa||!Ia((function(e){Ua.all(e).catch((function(){}))})),qa=function(e){var t;return!(!la(e)||!Ea(t=e.then))&&t},Xa=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,A=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&tc(t),t.rejection=1),!0===a?i=o:(d&&d.enter(),i=a(o),d&&(d.exit(),r=!0)),i===e.promise?A(Va("Promise-chain cycle")):(n=qa(i))?ra(n,i,c,A):c(i)):A(o)}catch(e){d&&!r&&d.exit(),A(e)}},za=function(e,t){e.notified||(e.notified=!0,Ra((function(){for(var i,n=e.reactions;i=n.get();)Xa(i,e);e.notified=!1,t&&!e.rejection&&$a(e)})))},Za=function(e,t,i){var n,r;ja?((n=Qa.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),ia.dispatchEvent(n)):n={promise:t,reason:i},!Ya&&(r=ia["on"+e])?r(n):e===Ha&&function(e,t){var i=Ws.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}("Unhandled promise rejection",i)},$a=function(e){ra(fa,ia,(function(){var t,i=e.facade,n=e.value;if(ec(e)&&(t=ma((function(){ya?xa.emit("unhandledRejection",n,i):Za(Ha,i,n)})),e.rejection=ya||ec(e)?2:1,t.error))throw t.value}))},ec=function(e){return 1!==e.rejection&&!e.parent},tc=function(e){ra(fa,ia,(function(){var t=e.facade;ya?xa.emit("rejectionHandled",t):Za("rejectionhandled",t,e.value)}))},ic=function(e,t,i){return function(n){e(t,n,i)}},nc=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,za(e,!0))},rc=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw Va("Promise can't be resolved itself");var n=qa(t);n?Ra((function(){var i={done:!1};try{ra(n,t,ic(rc,i,e),ic(nc,i,e))}catch(t){nc(i,t,e)}})):(e.value=t,e.state=1,za(e,!1))}catch(t){nc({done:!1},t,e)}}};if(Wa&&(Ba=(Ua=function(e){ha(this,Ba),ua(e),ra(qs,this);var t=La(this);try{e(ic(rc,t),ic(nc,t))}catch(e){nc(t,e)}}).prototype,(qs=function(e){Pa(this,{type:ba,done:!1,notified:!1,parent:!1,reactions:new Sa,rejection:!1,state:0,value:void 0})}).prototype=aa(Ba,{then:function(e,t){var i=ka(this),n=Fa(ga(this,Ua));return i.parent=!0,n.ok=!Ea(e)||e,n.fail=Ea(t)&&t,n.domain=ya?xa.domain:void 0,0==i.state?i.reactions.add(n):Ra((function(){Xa(n,i)})),n.promise},catch:function(e){return this.then(void 0,e)}}),Xs=function(){var e=new qs,t=La(e);this.promise=e,this.resolve=ic(rc,t),this.reject=ic(nc,t)},Ta.f=Fa=function(e){return e===Ua||e===zs?new Xs(e):Ga(e)},Ea(oa)&&Ma!==Object.prototype)){Zs=Ma.then,Ka||(sa(Ma,"then",(function(e,t){var i=this;return new Ua((function(e,t){ra(Zs,i,e,t)})).then(e,t)}),{unsafe:!0}),sa(Ma,"catch",Ba.catch,{unsafe:!0}));try{delete Ma.constructor}catch(e){}ca&&ca(Ma,Ba)}ta({global:!0,wrap:!0,forced:Wa},{Promise:Ua}),Aa(Ua,ba,!1),da(ba),zs=na(ba),ta({target:ba,stat:!0,forced:Wa},{reject:function(e){var t=Fa(this);return ra(t.reject,void 0,e),t.promise}}),ta({target:ba,stat:!0,forced:Wa},{resolve:function(e){return Ca(this,e)}}),ta({target:ba,stat:!0,forced:Ja},{all:function(e){var t=this,i=Fa(t),n=i.resolve,r=i.reject,o=ma((function(){var i=ua(t.resolve),o=[],s=0,a=1;_a(e,(function(e){var c=s++,A=!1;a++,ra(i,t,e).then((function(e){A||(A=!0,o[c]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise},race:function(e){var t=this,i=Fa(t),n=i.reject,r=ma((function(){var r=ua(t.resolve);_a(e,(function(e){ra(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var oc=Fn,sc=H,ac=Vo,cc=m,Ac=o,dc=n.Array,uc=sc("JSON","stringify"),Ec=cc(/./.exec),lc=cc("".charAt),hc=cc("".charCodeAt),pc=cc("".replace),_c=cc(1..toString),Ic=/[\uD800-\uDFFF]/g,gc=/^[\uD800-\uDBFF]$/,fc=/^[\uDC00-\uDFFF]$/,Rc=function(e,t,i){var n=lc(i,t-1),r=lc(i,t+1);return Ec(gc,e)&&!Ec(fc,r)||Ec(fc,e)&&!Ec(gc,n)?"\\u"+_c(hc(e,0),16):e},Cc=Ac((function(){return'"\\udf06\\ud834"'!==uc("\udf06\ud834")||'"\\udead"'!==uc("\udead")}));uc&&oc({target:"JSON",stat:!0,forced:Cc},{stringify:function(e,t,i){for(var n=0,r=arguments.length,o=dc(r);n<r;n++)o[n]=arguments[n];var s=ac(uc,null,o);return"string"==typeof s?pc(s,Ic,Rc):s}});var Tc=function(e){try{return!!e()}catch(e){return!0}},mc=!Tc((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Sc=mc,Oc=Function.prototype,vc=Oc.bind,Nc=Oc.call,yc=Sc&&vc.bind(Nc,Nc),Dc=Sc?function(e){return e&&yc(e)}:function(e){return e&&function(){return Nc.apply(e,arguments)}},wc=Dc({}.isPrototypeOf),bc=function(e){return e&&e.Math==Math&&e},Lc=bc("object"==typeof globalThis&&globalThis)||bc("object"==typeof window&&window)||bc("object"==typeof self&&self)||bc("object"==typeof e&&e)||function(){return this}()||Function("return this")(),Pc=mc,kc=Function.prototype,Mc=kc.apply,Uc=kc.call,Bc="object"==typeof Reflect&&Reflect.apply||(Pc?Uc.bind(Mc):function(){return Uc.apply(Mc,arguments)}),Vc=function(e){return"function"==typeof e},Qc={},xc=!Tc((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Fc=mc,Gc=Function.prototype.call,jc=Fc?Gc.bind(Gc):function(){return Gc.apply(Gc,arguments)},Yc={},Hc={}.propertyIsEnumerable,Kc=Object.getOwnPropertyDescriptor,Wc=Kc&&!Hc.call({1:2},1);Yc.f=Wc?function(e){var t=Kc(this,e);return!!t&&t.enumerable}:Hc;var Jc,qc,Xc=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},zc=Dc,Zc=zc({}.toString),$c=zc("".slice),eA=function(e){return $c(Zc(e),8,-1)},tA=Dc,iA=Tc,nA=eA,rA=Lc.Object,oA=tA("".split),sA=iA((function(){return!rA("z").propertyIsEnumerable(0)}))?function(e){return"String"==nA(e)?oA(e,""):rA(e)}:rA,aA=Lc.TypeError,cA=function(e){if(null==e)throw aA("Can't call method on "+e);return e},AA=sA,dA=cA,uA=function(e){return AA(dA(e))},EA=Vc,lA=function(e){return"object"==typeof e?null!==e:EA(e)},hA={},pA=hA,_A=Lc,IA=Vc,gA=function(e){return IA(e)?e:void 0},fA=function(e,t){return arguments.length<2?gA(pA[e])||gA(_A[e]):pA[e]&&pA[e][t]||_A[e]&&_A[e][t]},RA=fA("navigator","userAgent")||"",CA=Lc,TA=RA,mA=CA.process,SA=CA.Deno,OA=mA&&mA.versions||SA&&SA.version,vA=OA&&OA.v8;vA&&(qc=(Jc=vA.split("."))[0]>0&&Jc[0]<4?1:+(Jc[0]+Jc[1])),!qc&&TA&&(!(Jc=TA.match(/Edge\/(\d+)/))||Jc[1]>=74)&&(Jc=TA.match(/Chrome\/(\d+)/))&&(qc=+Jc[1]);var NA=qc,yA=NA,DA=Tc,wA=!!Object.getOwnPropertySymbols&&!DA((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&yA&&yA<41})),bA=wA&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,LA=fA,PA=Vc,kA=wc,MA=bA,UA=Lc.Object,BA=MA?function(e){return"symbol"==typeof e}:function(e){var t=LA("Symbol");return PA(t)&&kA(t.prototype,UA(e))},VA=Lc.String,QA=function(e){try{return VA(e)}catch(e){return"Object"}},xA=Vc,FA=QA,GA=Lc.TypeError,jA=function(e){if(xA(e))return e;throw GA(FA(e)+" is not a function")},YA=jA,HA=function(e,t){var i=e[t];return null==i?void 0:YA(i)},KA=jc,WA=Vc,JA=lA,qA=Lc.TypeError,XA={exports:{}},zA=Lc,ZA=Object.defineProperty,$A="__core-js_shared__",ed=Lc[$A]||function(e,t){try{ZA(zA,e,{value:t,configurable:!0,writable:!0})}catch(i){zA[e]=t}return t}($A,{}),td=ed;(XA.exports=function(e,t){return td[e]||(td[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var id=cA,nd=Lc.Object,rd=function(e){return nd(id(e))},od=rd,sd=Dc({}.hasOwnProperty),ad=Object.hasOwn||function(e,t){return sd(od(e),t)},cd=Dc,Ad=0,dd=Math.random(),ud=cd(1..toString),Ed=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ud(++Ad+dd,36)},ld=Lc,hd=XA.exports,pd=ad,_d=Ed,Id=wA,gd=bA,fd=hd("wks"),Rd=ld.Symbol,Cd=Rd&&Rd.for,Td=gd?Rd:Rd&&Rd.withoutSetter||_d,md=function(e){if(!pd(fd,e)||!Id&&"string"!=typeof fd[e]){var t="Symbol."+e;Id&&pd(Rd,e)?fd[e]=Rd[e]:fd[e]=gd&&Cd?Cd(t):Td(t)}return fd[e]},Sd=jc,Od=lA,vd=BA,Nd=HA,yd=md,Dd=Lc.TypeError,wd=yd("toPrimitive"),bd=function(e,t){if(!Od(e)||vd(e))return e;var i,n=Nd(e,wd);if(n){if(void 0===t&&(t="default"),i=Sd(n,e,t),!Od(i)||vd(i))return i;throw Dd("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var i,n;if("string"===t&&WA(i=e.toString)&&!JA(n=KA(i,e)))return n;if(WA(i=e.valueOf)&&!JA(n=KA(i,e)))return n;if("string"!==t&&WA(i=e.toString)&&!JA(n=KA(i,e)))return n;throw qA("Can't convert object to primitive value")}(e,t)},Ld=BA,Pd=function(e){var t=bd(e,"string");return Ld(t)?t:t+""},kd=lA,Md=Lc.document,Ud=kd(Md)&&kd(Md.createElement),Bd=function(e){return Ud?Md.createElement(e):{}},Vd=Bd,Qd=!xc&&!Tc((function(){return 7!=Object.defineProperty(Vd("div"),"a",{get:function(){return 7}}).a})),xd=xc,Fd=jc,Gd=Yc,jd=Xc,Yd=uA,Hd=Pd,Kd=ad,Wd=Qd,Jd=Object.getOwnPropertyDescriptor;Qc.f=xd?Jd:function(e,t){if(e=Yd(e),t=Hd(t),Wd)try{return Jd(e,t)}catch(e){}if(Kd(e,t))return jd(!Fd(Gd.f,e,t),e[t])};var qd=Tc,Xd=Vc,zd=/#|\.prototype\./,Zd=function(e,t){var i=eu[$d(e)];return i==iu||i!=tu&&(Xd(t)?qd(t):!!t)},$d=Zd.normalize=function(e){return String(e).replace(zd,".").toLowerCase()},eu=Zd.data={},tu=Zd.NATIVE="N",iu=Zd.POLYFILL="P",nu=Zd,ru=jA,ou=mc,su=Dc(Dc.bind),au=function(e,t){return ru(e),void 0===t?e:ou?su(e,t):function(){return e.apply(t,arguments)}},cu={},Au=xc&&Tc((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),du=Lc,uu=lA,Eu=du.String,lu=du.TypeError,hu=function(e){if(uu(e))return e;throw lu(Eu(e)+" is not an object")},pu=xc,_u=Qd,Iu=Au,gu=hu,fu=Pd,Ru=Lc.TypeError,Cu=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor;cu.f=pu?Iu?function(e,t,i){if(gu(e),t=fu(t),gu(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=Tu(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return Cu(e,t,i)}:Cu:function(e,t,i){if(gu(e),t=fu(t),gu(i),_u)try{return Cu(e,t,i)}catch(e){}if("get"in i||"set"in i)throw Ru("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var mu=cu,Su=Xc,Ou=xc?function(e,t,i){return mu.f(e,t,Su(1,i))}:function(e,t,i){return e[t]=i,e},vu=Lc,Nu=Bc,yu=Dc,Du=Vc,wu=Qc.f,bu=nu,Lu=hA,Pu=au,ku=Ou,Mu=ad,Uu=function(e){var t=function(i,n,r){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(i);case 2:return new e(i,n)}return new e(i,n,r)}return Nu(e,this,arguments)};return t.prototype=e.prototype,t},Bu=function(e,t){var i,n,r,o,s,a,c,A,d=e.target,u=e.global,E=e.stat,l=e.proto,h=u?vu:E?vu[d]:(vu[d]||{}).prototype,p=u?Lu:Lu[d]||ku(Lu,d,{})[d],_=p.prototype;for(r in t)i=!bu(u?r:d+(E?".":"#")+r,e.forced)&&h&&Mu(h,r),s=p[r],i&&(a=e.noTargetGet?(A=wu(h,r))&&A.value:h[r]),o=i&&a?a:t[r],i&&typeof s==typeof o||(c=e.bind&&i?Pu(o,vu):e.wrap&&i?Uu(o):l&&Du(o)?yu(o):o,(e.sham||o&&o.sham||s&&s.sham)&&ku(c,"sham",!0),ku(p,r,c),l&&(Mu(Lu,n=d+"Prototype")||ku(Lu,n,{}),ku(Lu[n],r,o),e.real&&_&&!_[r]&&ku(_,r,o)))},Vu=Math.ceil,Qu=Math.floor,xu=function(e){var t=+e;return t!=t||0===t?0:(t>0?Qu:Vu)(t)},Fu=xu,Gu=Math.min,ju=function(e){return function(e){return e>0?Gu(Fu(e),9007199254740991):0}(e.length)},Yu=jA,Hu=rd,Ku=sA,Wu=ju,Ju=Lc.TypeError,qu=function(e){return function(t,i,n,r){Yu(i);var o=Hu(t),s=Ku(o),a=Wu(o),c=e?a-1:0,A=e?-1:1;if(n<2)for(;;){if(c in s){r=s[c],c+=A;break}if(c+=A,e?c<0:a<=c)throw Ju("Reduce of empty array with no initial value")}for(;e?c>=0:a>c;c+=A)c in s&&(r=i(r,s[c],c,o));return r}},Xu={left:qu(!1),right:qu(!0)},zu=Tc,Zu=function(e,t){var i=[][e];return!!i&&zu((function(){i.call(null,t||function(){throw 1},1)}))},$u="process"==eA(Lc.process),eE=Xu.left,tE=NA,iE=$u;Bu({target:"Array",proto:!0,forced:!Zu("reduce")||!iE&&tE>79&&tE<83},{reduce:function(e){var t=arguments.length;return eE(this,e,t,t>1?arguments[1]:void 0)}});var nE=hA,rE=function(e){return nE[e+"Prototype"]},oE=rE("Array").reduce,sE=wc,aE=oE,cE=Array.prototype,AE=function(e){var t=e.reduce;return e===cE||sE(cE,e)&&t===cE.reduce?aE:t},dE=AE,uE=Nr,EE=n.String,lE=function(e){if("Symbol"===uE(e))throw TypeError("Cannot convert a Symbol value to a string");return EE(e)},hE=wt,pE=function(){var e=hE(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},_E=o,IE=n.RegExp,gE=_E((function(){var e=IE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),fE=gE||_E((function(){return!IE("a","y").sticky})),RE={BROKEN_CARET:gE||_E((function(){var e=IE("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:fE,UNSUPPORTED_Y:gE},CE={},TE=An,mE=dn,SE=Object.keys||function(e){return TE(e,mE)},OE=s,vE=Ot,NE=St,yE=wt,DE=V,wE=SE;CE.f=OE&&!vE?Object.defineProperties:function(e,t){yE(e);for(var i,n=DE(t),r=wE(t),o=r.length,s=0;o>s;)NE.f(e,i=r[s++],n[i]);return e};var bE,LE=wt,PE=CE,kE=dn,ME=ri,UE=Qo,BE=Et,VE=ni("IE_PROTO"),QE=function(){},xE=function(e){return"<script>"+e+"<\/script>"},FE=function(e){e.write(xE("")),e.close();var t=e.parentWindow.Object;return e=null,t},GE=function(){try{bE=new ActiveXObject("htmlfile")}catch(e){}var e,t;GE="undefined"!=typeof document?document.domain&&bE?FE(bE):((t=BE("iframe")).style.display="none",UE.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(xE("document.F=Object")),e.close(),e.F):FE(bE);for(var i=kE.length;i--;)delete GE.prototype[kE[i]];return GE()};ME[VE]=!0;var jE=Object.create||function(e,t){var i;return null!==e?(QE.prototype=LE(e),i=new QE,QE.prototype=null,i[VE]=e):i=GE(),void 0===t?i:PE.f(i,t)},YE=o,HE=n.RegExp,KE=YE((function(){var e=HE(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),WE=o,JE=n.RegExp,qE=WE((function(){var e=JE("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),XE=d,zE=m,ZE=lE,$E=pE,el=RE,tl=me.exports,il=jE,nl=Ti.get,rl=KE,ol=qE,sl=tl("native-string-replace",String.prototype.replace),al=RegExp.prototype.exec,cl=al,Al=zE("".charAt),dl=zE("".indexOf),ul=zE("".replace),El=zE("".slice),ll=function(){var e=/a/,t=/b*/g;return XE(al,e,"a"),XE(al,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),hl=el.BROKEN_CARET,pl=void 0!==/()??/.exec("")[1];(ll||pl||hl||rl||ol)&&(cl=function(e){var t,i,n,r,o,s,a,c=this,A=nl(c),d=ZE(e),u=A.raw;if(u)return u.lastIndex=c.lastIndex,t=XE(cl,u,d),c.lastIndex=u.lastIndex,t;var E=A.groups,l=hl&&c.sticky,h=XE($E,c),p=c.source,_=0,I=d;if(l&&(h=ul(h,"y",""),-1===dl(h,"g")&&(h+="g"),I=El(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Al(d,c.lastIndex-1))&&(p="(?: "+p+")",I=" "+I,_++),i=new RegExp("^(?:"+p+")",h)),pl&&(i=new RegExp("^"+p+"$(?!\\s)",h)),ll&&(n=c.lastIndex),r=XE(al,l?i:c,I),l?r?(r.input=El(r.input,_),r[0]=El(r[0],_),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:ll&&r&&(c.lastIndex=c.global?r.index+r[0].length:n),pl&&r&&r.length>1&&XE(sl,r[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&E)for(r.groups=s=il(null),o=0;o<E.length;o++)s[(a=E[o])[0]]=r[a[1]];return r});var _l=cl;Fn({target:"RegExp",proto:!0,forced:/./.exec!==_l},{exec:_l});var Il=jE,gl=St,fl=Ze("unscopables"),Rl=Array.prototype;null==Rl[fl]&&gl.f(Rl,fl,{configurable:!0,value:Il(null)});var Cl,Tl,ml,Sl=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ol=n,vl=Ue,Nl=Q,yl=Pe,Dl=Sl,wl=ni("IE_PROTO"),bl=Ol.Object,Ll=bl.prototype,Pl=Dl?bl.getPrototypeOf:function(e){var t=yl(e);if(vl(t,wl))return t[wl];var i=t.constructor;return Nl(i)&&t instanceof i?i.prototype:t instanceof bl?Ll:null},kl=o,Ml=Q,Ul=Pl,Bl=Gt.exports,Vl=Ze("iterator"),Ql=!1;[].keys&&("next"in(ml=[].keys())?(Tl=Ul(Ul(ml)))!==Object.prototype&&(Cl=Tl):Ql=!0),(null==Cl||kl((function(){var e={};return Cl[Vl].call(e)!==e})))&&(Cl={}),Ml(Cl[Vl])||Bl(Cl,Vl,(function(){return this}));var xl={IteratorPrototype:Cl,BUGGY_SAFARI_ITERATORS:Ql},Fl=xl.IteratorPrototype,Gl=jE,jl=I,Yl=tr,Hl=hr,Kl=function(){return this},Wl=Fn,Jl=d,ql=yi,Xl=Q,zl=Pl,Zl=zn,$l=tr,eh=Ft,th=Gt.exports,ih=hr,nh=ql.PROPER,rh=ql.CONFIGURABLE,oh=xl.IteratorPrototype,sh=xl.BUGGY_SAFARI_ITERATORS,ah=Ze("iterator"),ch="keys",Ah="values",dh="entries",uh=function(){return this},Eh=V,lh=function(e){Rl[fl][e]=!0},hh=hr,ph=Ti,_h=St.f,Ih=s,gh="Array Iterator",fh=ph.set,Rh=ph.getterFor(gh),Ch=function(e,t,i,n,r,o,s){!function(e,t,i,n){var r=t+" Iterator";e.prototype=Gl(Fl,{next:jl(+!n,i)}),Yl(e,r,!1),Hl[r]=Kl}(i,t,n);var a,c,A,d=function(e){if(e===r&&p)return p;if(!sh&&e in l)return l[e];switch(e){case ch:case Ah:case dh:return function(){return new i(this,e)}}return function(){return new i(this)}},u=t+" Iterator",E=!1,l=e.prototype,h=l[ah]||l["@@iterator"]||r&&l[r],p=!sh&&h||d(r),_="Array"==t&&l.entries||h;if(_&&(a=zl(_.call(new e)))!==Object.prototype&&a.next&&(zl(a)!==oh&&(Zl?Zl(a,oh):Xl(a[ah])||th(a,ah,uh)),$l(a,u,!0)),nh&&r==Ah&&h&&h.name!==Ah&&(rh?eh(l,"name",Ah):(E=!0,p=function(){return Jl(h,this)})),r)if(c={values:d(Ah),keys:o?p:d(ch),entries:d(dh)},s)for(A in c)(sh||E||!(A in l))&&th(l,A,c[A]);else Wl({target:t,proto:!0,forced:sh||E},c);return l[ah]!==p&&th(l,ah,p,{name:r}),ih[t]=p,c}(Array,"Array",(function(e,t){fh(this,{type:gh,target:Eh(e),index:0,kind:t})}),(function(){var e=Rh(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Th=hh.Arguments=hh.Array;if(lh("keys"),lh("values"),lh("entries"),Ih&&"values"!==Th.name)try{_h(Th,"name",{value:"values"})}catch(e){}var mh=Et("span").classList,Sh=mh&&mh.constructor&&mh.constructor.prototype,Oh=Sh===Object.prototype?void 0:Sh,vh=n,Nh={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},yh=Oh,Dh=Ch,wh=Ft,bh=Ze,Lh=bh("iterator"),Ph=bh("toStringTag"),kh=Dh.values,Mh=function(e,t){if(e){if(e[Lh]!==kh)try{wh(e,Lh,kh)}catch(t){e[Lh]=kh}if(e[Ph]||wh(e,Ph,t),Nh[t])for(var i in Dh)if(e[i]!==Dh[i])try{wh(e,i,Dh[i])}catch(t){e[i]=Dh[i]}}};for(var Uh in Nh)Mh(vh[Uh]&&vh[Uh].prototype,Uh);Mh(yh,"DOMTokenList");var Bh=Q,Vh=F,Qh=zn,xh=function(e,t,i){var n,r;return Qh&&Bh(n=t.constructor)&&n!==i&&Vh(r=n.prototype)&&r!==i.prototype&&Qh(e,r),e},Fh=lE,Gh=function(e,t){return void 0===e?arguments.length<2?"":t:Fh(e)},jh=F,Yh=Ft,Hh=m("".replace),Kh=String(Error("zxcasd").stack),Wh=/\n\s*at [^:]*:[^\n]*/,Jh=Wh.test(Kh),qh=function(e,t){if(Jh&&"string"==typeof e)for(;t--;)e=Hh(e,Wh,"");return e},Xh=I,zh=!o((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Xh(1,7)),7!==e.stack)})),Zh=H,$h=Ue,ep=Ft,tp=K,ip=zn,np=Sn,rp=xh,op=Gh,sp=function(e,t){jh(t)&&"cause"in t&&Yh(e,"cause",t.cause)},ap=qh,cp=zh,Ap=Fn,dp=Vo,up=function(e,t,i,n){var r=n?2:1,o=e.split("."),s=o[o.length-1],a=Zh.apply(null,o);if(a){var c=a.prototype;if($h(c,"cause")&&delete c.cause,!i)return a;var A=Zh("Error"),d=t((function(e,t){var i=op(n?t:e,void 0),o=n?new a(e):new a;return void 0!==i&&ep(o,"message",i),cp&&ep(o,"stack",ap(o.stack,2)),this&&tp(c,this)&&rp(o,this,d),arguments.length>r&&sp(o,arguments[r]),o}));d.prototype=c,"Error"!==s&&(ip?ip(d,A):np(d,A,{name:!0})),np(d,a);try{c.name!==s&&ep(c,"name",s),c.constructor=d}catch(e){}return d}},Ep=n.WebAssembly,lp=7!==Error("e",{cause:7}).cause,hp=function(e,t){var i={};i[e]=up(e,t,lp),Ap({global:!0,forced:lp},i)},pp=function(e,t){if(Ep&&Ep[e]){var i={};i[e]=up("WebAssembly."+e,t,lp),Ap({target:"WebAssembly",stat:!0,forced:lp},i)}};hp("Error",(function(e){return function(t){return dp(e,this,arguments)}})),hp("EvalError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("RangeError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("ReferenceError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("SyntaxError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("TypeError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("URIError",(function(e){return function(t){return dp(e,this,arguments)}})),pp("CompileError",(function(e){return function(t){return dp(e,this,arguments)}})),pp("LinkError",(function(e){return function(t){return dp(e,this,arguments)}})),pp("RuntimeError",(function(e){return function(t){return dp(e,this,arguments)}}));let _p=!0,Ip=!0;function gp(e,t,i){const n=e.match(t);return n&&n.length>=i&&parseInt(n[i],10)}function fp(e,t,i){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,r=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return r.apply(this,arguments);const o=e=>{const t=i(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),r.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,i){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(i))return o.apply(this,arguments);const n=this._eventMap[t].get(i);return this._eventMap[t].delete(i),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Rp(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(_p=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Cp(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ip=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Tp(){if("object"==typeof window){if(_p)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function mp(e,t){Ip&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Sp(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:i}=e;if(i.mozGetUserMedia)t.browser="firefox",t.version=gp(i.userAgent,/Firefox\/(\d+)\./,1);else if(i.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=gp(i.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.mediaDevices&&i.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=gp(i.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!i.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=gp(i.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}function Op(e){return"[object Object]"===Object.prototype.toString.call(e)}function vp(e){var t;return Op(e)?dE(t=Object.keys(e)).call(t,(function(t,i){const n=Op(e[i]),r=n?vp(e[i]):e[i],o=n&&!Object.keys(r).length;return void 0===r||o?t:Object.assign(t,{[i]:r})}),{}):e}function Np(e,t,i){const n=i?"outbound-rtp":"inbound-rtp",r=new Map;if(null===t)return r;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((i=>{i.type===n&&i.trackId===t.id&&function e(t,i,n){i&&!n.has(i.id)&&(n.set(i.id,i),Object.keys(i).forEach((r=>{r.endsWith("Id")?e(t,t.get(i[r]),n):r.endsWith("Ids")&&i[r].forEach((i=>{e(t,t.get(i),n)}))})))}(e,i,r)}))})),r}var yp=XA.exports,Dp=Ed,wp=yp("keys"),bp=function(e){return wp[e]||(wp[e]=Dp(e))},Lp=!Tc((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Pp=Lc,kp=ad,Mp=Vc,Up=rd,Bp=Lp,Vp=bp("IE_PROTO"),Qp=Pp.Object,xp=Qp.prototype,Fp=Bp?Qp.getPrototypeOf:function(e){var t=Up(e);if(kp(t,Vp))return t[Vp];var i=t.constructor;return Mp(i)&&t instanceof i?i.prototype:t instanceof Qp?xp:null},Gp=Lc,jp=Vc,Yp=Gp.String,Hp=Gp.TypeError,Kp=Dc,Wp=hu,Jp=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Kp(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return Wp(i),function(e){if("object"==typeof e||jp(e))return e;throw Hp("Can't set "+Yp(e)+" as a prototype")}(n),t?e(i,n):i.__proto__=n,i}}():void 0),qp={},Xp=xu,zp=Math.max,Zp=Math.min,$p=function(e,t){var i=Xp(e);return i<0?zp(i+t,0):Zp(i,t)},e_=uA,t_=$p,i_=ju,n_=function(e){return function(t,i,n){var r,o=e_(t),s=i_(o),a=t_(n,s);if(e&&i!=i){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===i)return e||a||0;return!e&&-1}},r_={includes:n_(!0),indexOf:n_(!1)},o_={},s_=ad,a_=uA,c_=r_.indexOf,A_=o_,d_=Dc([].push),u_=function(e,t){var i,n=a_(e),r=0,o=[];for(i in n)!s_(A_,i)&&s_(n,i)&&d_(o,i);for(;t.length>r;)s_(n,i=t[r++])&&(~c_(o,i)||d_(o,i));return o},E_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],l_=u_,h_=E_.concat("length","prototype");qp.f=Object.getOwnPropertyNames||function(e){return l_(e,h_)};var p_={};p_.f=Object.getOwnPropertySymbols;var __=fA,I_=qp,g_=p_,f_=hu,R_=Dc([].concat),C_=__("Reflect","ownKeys")||function(e){var t=I_.f(f_(e)),i=g_.f;return i?R_(t,i(e)):t},T_=ad,m_=C_,S_=Qc,O_=cu,v_={},N_=u_,y_=E_,D_=Object.keys||function(e){return N_(e,y_)},w_=xc,b_=Au,L_=cu,P_=hu,k_=uA,M_=D_;v_.f=w_&&!b_?Object.defineProperties:function(e,t){P_(e);for(var i,n=k_(t),r=M_(t),o=r.length,s=0;o>s;)L_.f(e,i=r[s++],n[i]);return e};var U_,B_=fA("document","documentElement"),V_=hu,Q_=v_,x_=E_,F_=o_,G_=B_,j_=Bd,Y_=bp("IE_PROTO"),H_=function(){},K_=function(e){return"<script>"+e+"<\/script>"},W_=function(e){e.write(K_("")),e.close();var t=e.parentWindow.Object;return e=null,t},J_=function(){try{U_=new ActiveXObject("htmlfile")}catch(e){}var e,t;J_="undefined"!=typeof document?document.domain&&U_?W_(U_):((t=j_("iframe")).style.display="none",G_.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(K_("document.F=Object")),e.close(),e.F):W_(U_);for(var i=x_.length;i--;)delete J_.prototype[x_[i]];return J_()};F_[Y_]=!0;var q_=Object.create||function(e,t){var i;return null!==e?(H_.prototype=V_(e),i=new H_,H_.prototype=null,i[Y_]=e):i=J_(),void 0===t?i:Q_.f(i,t)},X_=Dc("".replace),z_=String(Error("zxcasd").stack),Z_=/\n\s*at [^:]*:[^\n]*/,$_=Z_.test(z_),eI=lA,tI=Ou,iI={},nI=iI,rI=md("iterator"),oI=Array.prototype,sI=function(e){return void 0!==e&&(nI.Array===e||oI[rI]===e)},aI={};aI[md("toStringTag")]="z";var cI="[object z]"===String(aI),AI=Lc,dI=cI,uI=Vc,EI=eA,lI=md("toStringTag"),hI=AI.Object,pI="Arguments"==EI(function(){return arguments}()),_I=dI?EI:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=hI(e),lI))?i:pI?EI(t):"Object"==(n=EI(t))&&uI(t.callee)?"Arguments":n},II=_I,gI=HA,fI=iI,RI=md("iterator"),CI=function(e){if(null!=e)return gI(e,RI)||gI(e,"@@iterator")||fI[II(e)]},TI=jc,mI=jA,SI=hu,OI=QA,vI=CI,NI=Lc.TypeError,yI=function(e,t){var i=arguments.length<2?vI(e):t;if(mI(i))return SI(TI(i,e));throw NI(OI(e)+" is not iterable")},DI=jc,wI=hu,bI=HA,LI=function(e,t,i){var n,r;wI(e);try{if(!(n=bI(e,"return"))){if("throw"===t)throw i;return i}n=DI(n,e)}catch(e){r=!0,n=e}if("throw"===t)throw i;if(r)throw n;return wI(n),i},PI=au,kI=jc,MI=hu,UI=QA,BI=sI,VI=ju,QI=wc,xI=yI,FI=CI,GI=LI,jI=Lc.TypeError,YI=function(e,t){this.stopped=e,this.result=t},HI=YI.prototype,KI=function(e,t,i){var n,r,o,s,a,c,A,d=i&&i.that,u=!(!i||!i.AS_ENTRIES),E=!(!i||!i.IS_ITERATOR),l=!(!i||!i.INTERRUPTED),h=PI(t,d),p=function(e){return n&&GI(n,"normal",e),new YI(!0,e)},_=function(e){return u?(MI(e),l?h(e[0],e[1],p):h(e[0],e[1])):l?h(e,p):h(e)};if(E)n=e;else{if(!(r=FI(e)))throw jI(UI(e)+" is not iterable");if(BI(r)){for(o=0,s=VI(e);s>o;o++)if((a=_(e[o]))&&QI(HI,a))return a;return new YI(!1)}n=xI(e,r)}for(c=n.next;!(A=kI(c,n)).done;){try{a=_(A.value)}catch(e){GI(n,"throw",e)}if("object"==typeof a&&a&&QI(HI,a))return a}return new YI(!1)},WI=_I,JI=Lc.String,qI=function(e){if("Symbol"===WI(e))throw TypeError("Cannot convert a Symbol value to a string");return JI(e)},XI=qI,zI=Xc,ZI=!Tc((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",zI(1,7)),7!==e.stack)})),$I=Bu,eg=Lc,tg=wc,ig=Fp,ng=Jp,rg=q_,og=Ou,sg=Xc,ag=function(e,t){if($_&&"string"==typeof e)for(;t--;)e=X_(e,Z_,"");return e},cg=function(e,t){eI(t)&&"cause"in t&&tI(e,"cause",t.cause)},Ag=KI,dg=function(e,t){return void 0===e?arguments.length<2?"":t:XI(e)},ug=ZI,Eg=md("toStringTag"),lg=eg.Error,hg=[].push,pg=function(e,t){var i,n=arguments.length>2?arguments[2]:void 0,r=tg(_g,this);ng?i=ng(new lg,r?ig(this):_g):(i=r?this:rg(_g),og(i,Eg,"Error")),void 0!==t&&og(i,"message",dg(t)),ug&&og(i,"stack",ag(i.stack,1)),cg(i,n);var o=[];return Ag(e,hg,{that:o}),og(i,"errors",o),i};ng?ng(pg,lg):function(e,t,i){for(var n=m_(t),r=O_.f,o=S_.f,s=0;s<n.length;s++){var a=n[s];T_(e,a)||i&&T_(i,a)||r(e,a,o(t,a))}}(pg,lg,{name:!0});var _g=pg.prototype=rg(lg.prototype,{constructor:sg(1,pg),message:sg(1,""),name:sg(1,"AggregateError")});$I({global:!0},{AggregateError:pg});var Ig=Vc,gg=ed,fg=Dc(Function.toString);Ig(gg.inspectSource)||(gg.inspectSource=function(e){return fg(e)});var Rg,Cg,Tg,mg=gg.inspectSource,Sg=Vc,Og=mg,vg=Lc.WeakMap,Ng=Sg(vg)&&/native code/.test(Og(vg)),yg=Lc,Dg=Dc,wg=lA,bg=Ou,Lg=ad,Pg=ed,kg=bp,Mg=o_,Ug="Object already initialized",Bg=yg.TypeError,Vg=yg.WeakMap;if(Ng||Pg.state){var Qg=Pg.state||(Pg.state=new Vg),xg=Dg(Qg.get),Fg=Dg(Qg.has),Gg=Dg(Qg.set);Rg=function(e,t){if(Fg(Qg,e))throw new Bg(Ug);return t.facade=e,Gg(Qg,e,t),t},Cg=function(e){return xg(Qg,e)||{}},Tg=function(e){return Fg(Qg,e)}}else{var jg=kg("state");Mg[jg]=!0,Rg=function(e,t){if(Lg(e,jg))throw new Bg(Ug);return t.facade=e,bg(e,jg,t),t},Cg=function(e){return Lg(e,jg)?e[jg]:{}},Tg=function(e){return Lg(e,jg)}}var Yg,Hg,Kg,Wg={set:Rg,get:Cg,has:Tg,enforce:function(e){return Tg(e)?Cg(e):Rg(e,{})},getterFor:function(e){return function(t){var i;if(!wg(t)||(i=Cg(t)).type!==e)throw Bg("Incompatible receiver, "+e+" required");return i}}},Jg=xc,qg=ad,Xg=Function.prototype,zg=Jg&&Object.getOwnPropertyDescriptor,Zg=qg(Xg,"name"),$g={EXISTS:Zg,PROPER:Zg&&"something"===function(){}.name,CONFIGURABLE:Zg&&(!Jg||Jg&&zg(Xg,"name").configurable)},ef=Ou,tf=function(e,t,i,n){n&&n.enumerable?e[t]=i:ef(e,t,i)},nf=Tc,rf=Vc,of=q_,sf=Fp,af=tf,cf=md("iterator"),Af=!1;[].keys&&("next"in(Kg=[].keys())?(Hg=sf(sf(Kg)))!==Object.prototype&&(Yg=Hg):Af=!0);var df=null==Yg||nf((function(){var e={};return Yg[cf].call(e)!==e}));rf((Yg=df?{}:of(Yg))[cf])||af(Yg,cf,(function(){return this}));var uf={IteratorPrototype:Yg,BUGGY_SAFARI_ITERATORS:Af},Ef=_I,lf=cI?{}.toString:function(){return"[object "+Ef(this)+"]"},hf=cI,pf=cu.f,_f=Ou,If=ad,gf=lf,ff=md("toStringTag"),Rf=function(e,t,i,n){if(e){var r=i?e:e.prototype;If(r,ff)||pf(r,ff,{configurable:!0,value:t}),n&&!hf&&_f(r,"toString",gf)}},Cf=uf.IteratorPrototype,Tf=q_,mf=Xc,Sf=Rf,Of=iI,vf=function(){return this},Nf=function(e,t,i,n){var r=t+" Iterator";return e.prototype=Tf(Cf,{next:mf(+!n,i)}),Sf(e,r,!1,!0),Of[r]=vf,e},yf=Bu,Df=jc,wf=Nf,bf=Fp,Lf=Rf,Pf=tf,kf=iI,Mf=$g.PROPER,Uf=uf.BUGGY_SAFARI_ITERATORS,Bf=md("iterator"),Vf="keys",Qf="values",xf="entries",Ff=function(){return this},Gf=function(e,t,i,n,r,o,s){wf(i,t,n);var a,c,A,d=function(e){if(e===r&&p)return p;if(!Uf&&e in l)return l[e];switch(e){case Vf:case Qf:case xf:return function(){return new i(this,e)}}return function(){return new i(this)}},u=t+" Iterator",E=!1,l=e.prototype,h=l[Bf]||l["@@iterator"]||r&&l[r],p=!Uf&&h||d(r),_="Array"==t&&l.entries||h;if(_&&(a=bf(_.call(new e)))!==Object.prototype&&a.next&&(Lf(a,u,!0,!0),kf[u]=Ff),Mf&&r==Qf&&h&&h.name!==Qf&&(E=!0,p=function(){return Df(h,this)}),r)if(c={values:d(Qf),keys:o?p:d(Vf),entries:d(xf)},s)for(A in c)(Uf||E||!(A in l))&&Pf(l,A,c[A]);else yf({target:t,proto:!0,forced:Uf||E},c);return s&&l[Bf]!==p&&Pf(l,Bf,p,{name:r}),kf[t]=p,c},jf=uA,Yf=iI,Hf=Wg;cu.f;var Kf=Gf,Wf="Array Iterator",Jf=Hf.set,qf=Hf.getterFor(Wf);Kf(Array,"Array",(function(e,t){Jf(this,{type:Wf,target:jf(e),index:0,kind:t})}),(function(){var e=qf(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Yf.Arguments=Yf.Array;var Xf=Lc.Promise,zf=tf,Zf=function(e,t,i){for(var n in t)i&&i.unsafe&&e[n]?e[n]=t[n]:zf(e,n,t[n],i);return e},$f=fA,eR=cu,tR=xc,iR=md("species"),nR=wc,rR=Lc.TypeError,oR=function(e,t){if(nR(t,e))return e;throw rR("Incorrect invocation")},sR=md("iterator"),aR=!1;try{var cR=0,AR={next:function(){return{done:!!cR++}},return:function(){aR=!0}};AR[sR]=function(){return this},Array.from(AR,(function(){throw 2}))}catch(e){}var dR=Dc,uR=Tc,ER=Vc,lR=_I,hR=mg,pR=function(){},_R=[],IR=fA("Reflect","construct"),gR=/^\s*(?:class|function)\b/,fR=dR(gR.exec),RR=!gR.exec(pR),CR=function(e){if(!ER(e))return!1;try{return IR(pR,_R,e),!0}catch(e){return!1}},TR=function(e){if(!ER(e))return!1;switch(lR(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return RR||!!fR(gR,hR(e))}catch(e){return!0}};TR.sham=!0;var mR,SR,OR,vR,NR=!IR||uR((function(){var e;return CR(CR.call)||!CR(Object)||!CR((function(){e=!0}))||e}))?TR:CR,yR=NR,DR=QA,wR=Lc.TypeError,bR=hu,LR=md("species"),PR=function(e,t){var i,n=bR(e).constructor;return void 0===n||null==(i=bR(n)[LR])?t:function(e){if(yR(e))return e;throw wR(DR(e)+" is not a constructor")}(i)},kR=Dc([].slice),MR=/(?:ipad|iphone|ipod).*applewebkit/i.test(RA),UR=Lc,BR=Bc,VR=au,QR=Vc,xR=ad,FR=Tc,GR=B_,jR=kR,YR=Bd,HR=MR,KR=$u,WR=UR.setImmediate,JR=UR.clearImmediate,qR=UR.process,XR=UR.Dispatch,zR=UR.Function,ZR=UR.MessageChannel,$R=UR.String,eC=0,tC={};try{mR=UR.location}catch(e){}var iC=function(e){if(xR(tC,e)){var t=tC[e];delete tC[e],t()}},nC=function(e){return function(){iC(e)}},rC=function(e){iC(e.data)},oC=function(e){UR.postMessage($R(e),mR.protocol+"//"+mR.host)};WR&&JR||(WR=function(e){var t=jR(arguments,1);return tC[++eC]=function(){BR(QR(e)?e:zR(e),void 0,t)},SR(eC),eC},JR=function(e){delete tC[e]},KR?SR=function(e){qR.nextTick(nC(e))}:XR&&XR.now?SR=function(e){XR.now(nC(e))}:ZR&&!HR?(vR=(OR=new ZR).port2,OR.port1.onmessage=rC,SR=VR(vR.postMessage,vR)):UR.addEventListener&&QR(UR.postMessage)&&!UR.importScripts&&mR&&"file:"!==mR.protocol&&!FR(oC)?(SR=oC,UR.addEventListener("message",rC,!1)):SR="onreadystatechange"in YR("script")?function(e){GR.appendChild(YR("script")).onreadystatechange=function(){GR.removeChild(this),iC(e)}}:function(e){setTimeout(nC(e),0)});var sC,aC,cC,AC,dC,uC,EC,lC,hC={set:WR,clear:JR},pC=Lc,_C=/ipad|iphone|ipod/i.test(RA)&&void 0!==pC.Pebble,IC=/web0s(?!.*chrome)/i.test(RA),gC=Lc,fC=au,RC=Qc.f,CC=hC.set,TC=MR,mC=_C,SC=IC,OC=$u,vC=gC.MutationObserver||gC.WebKitMutationObserver,NC=gC.document,yC=gC.process,DC=gC.Promise,wC=RC(gC,"queueMicrotask"),bC=wC&&wC.value;bC||(sC=function(){var e,t;for(OC&&(e=yC.domain)&&e.exit();aC;){t=aC.fn,aC=aC.next;try{t()}catch(e){throw aC?AC():cC=void 0,e}}cC=void 0,e&&e.enter()},TC||OC||SC||!vC||!NC?!mC&&DC&&DC.resolve?((EC=DC.resolve(void 0)).constructor=DC,lC=fC(EC.then,EC),AC=function(){lC(sC)}):OC?AC=function(){yC.nextTick(sC)}:(CC=fC(CC,gC),AC=function(){CC(sC)}):(dC=!0,uC=NC.createTextNode(""),new vC(sC).observe(uC,{characterData:!0}),AC=function(){uC.data=dC=!dC}));var LC=bC||function(e){var t={fn:e,next:void 0};cC&&(cC.next=t),aC||(aC=t,AC()),cC=t},PC={},kC=jA,MC=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=kC(t),this.reject=kC(i)};PC.f=function(e){return new MC(e)};var UC=hu,BC=lA,VC=PC,QC=function(e,t){if(UC(e),BC(t)&&t.constructor===e)return t;var i=VC.f(e);return(0,i.resolve)(t),i.promise},xC=Lc,FC=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},GC=function(){this.head=null,this.tail=null};GC.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var jC,YC,HC,KC="object"==typeof window,WC=Bu,JC=Lc,qC=fA,XC=jc,zC=Xf,ZC=Zf,$C=Rf,eT=jA,tT=Vc,iT=lA,nT=oR,rT=mg,oT=KI,sT=PR,aT=hC.set,cT=LC,AT=QC,dT=PC,uT=FC,ET=GC,lT=Wg,hT=nu,pT=KC,_T=$u,IT=NA,gT=md("species"),fT="Promise",RT=lT.getterFor(fT),CT=lT.set,TT=lT.getterFor(fT),mT=zC&&zC.prototype,ST=zC,OT=mT,vT=JC.TypeError,NT=JC.document,yT=JC.process,DT=dT.f,wT=DT,bT=!!(NT&&NT.createEvent&&JC.dispatchEvent),LT=tT(JC.PromiseRejectionEvent),PT="unhandledrejection",kT=hT(fT,(function(){var e=rT(ST),t=e!==String(ST);if(!t&&66===IT)return!0;if(!OT.finally)return!0;if(IT>=51&&/native code/.test(e))return!1;var i=new ST((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(i.constructor={})[gT]=n,!(i.then((function(){}))instanceof n)||!t&&pT&&!LT})),MT=kT||!function(e,t){if(!t&&!aR)return!1;var i=!1;try{var n={};n[sR]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(e){}return i}((function(e){ST.all(e).catch((function(){}))})),UT=function(e){var t;return!(!iT(e)||!tT(t=e.then))&&t},BT=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,A=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&GT(t),t.rejection=1),!0===a?i=o:(d&&d.enter(),i=a(o),d&&(d.exit(),r=!0)),i===e.promise?A(vT("Promise-chain cycle")):(n=UT(i))?XC(n,i,c,A):c(i)):A(o)}catch(e){d&&!r&&d.exit(),A(e)}},VT=function(e,t){e.notified||(e.notified=!0,cT((function(){for(var i,n=e.reactions;i=n.get();)BT(i,e);e.notified=!1,t&&!e.rejection&&xT(e)})))},QT=function(e,t,i){var n,r;bT?((n=NT.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),JC.dispatchEvent(n)):n={promise:t,reason:i},!LT&&(r=JC["on"+e])?r(n):e===PT&&function(e,t){var i=xC.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}("Unhandled promise rejection",i)},xT=function(e){XC(aT,JC,(function(){var t,i=e.facade,n=e.value;if(FT(e)&&(t=uT((function(){_T?yT.emit("unhandledRejection",n,i):QT(PT,i,n)})),e.rejection=_T||FT(e)?2:1,t.error))throw t.value}))},FT=function(e){return 1!==e.rejection&&!e.parent},GT=function(e){XC(aT,JC,(function(){var t=e.facade;_T?yT.emit("rejectionHandled",t):QT("rejectionhandled",t,e.value)}))},jT=function(e,t,i){return function(n){e(t,n,i)}},YT=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,VT(e,!0))},HT=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw vT("Promise can't be resolved itself");var n=UT(t);n?cT((function(){var i={done:!1};try{XC(n,t,jT(HT,i,e),jT(YT,i,e))}catch(t){YT(i,t,e)}})):(e.value=t,e.state=1,VT(e,!1))}catch(t){YT({done:!1},t,e)}}};kT&&(OT=(ST=function(e){nT(this,OT),eT(e),XC(jC,this);var t=RT(this);try{e(jT(HT,t),jT(YT,t))}catch(e){YT(t,e)}}).prototype,(jC=function(e){CT(this,{type:fT,done:!1,notified:!1,parent:!1,reactions:new ET,rejection:!1,state:0,value:void 0})}).prototype=ZC(OT,{then:function(e,t){var i=TT(this),n=DT(sT(this,ST));return i.parent=!0,n.ok=!tT(e)||e,n.fail=tT(t)&&t,n.domain=_T?yT.domain:void 0,0==i.state?i.reactions.add(n):cT((function(){BT(n,i)})),n.promise},catch:function(e){return this.then(void 0,e)}}),YC=function(){var e=new jC,t=RT(e);this.promise=e,this.resolve=jT(HT,t),this.reject=jT(YT,t)},dT.f=DT=function(e){return e===ST||e===HC?new YC(e):wT(e)}),WC({global:!0,wrap:!0,forced:kT},{Promise:ST}),$C(ST,fT,!1,!0),function(e){var t=$f(e),i=eR.f;tR&&t&&!t[iR]&&i(t,iR,{configurable:!0,get:function(){return this}})}(fT),HC=qC(fT),WC({target:fT,stat:!0,forced:kT},{reject:function(e){var t=DT(this);return XC(t.reject,void 0,e),t.promise}}),WC({target:fT,stat:!0,forced:!0},{resolve:function(e){return AT(this===HC?ST:this,e)}}),WC({target:fT,stat:!0,forced:MT},{all:function(e){var t=this,i=DT(t),n=i.resolve,r=i.reject,o=uT((function(){var i=eT(t.resolve),o=[],s=0,a=1;oT(e,(function(e){var c=s++,A=!1;a++,XC(i,t,e).then((function(e){A||(A=!0,o[c]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise},race:function(e){var t=this,i=DT(t),n=i.reject,r=uT((function(){var r=eT(t.resolve);oT(e,(function(e){XC(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var KT=jc,WT=jA,JT=PC,qT=FC,XT=KI;Bu({target:"Promise",stat:!0},{allSettled:function(e){var t=this,i=JT.f(t),n=i.resolve,r=i.reject,o=qT((function(){var i=WT(t.resolve),r=[],o=0,s=1;XT(e,(function(e){var a=o++,c=!1;s++,KT(i,t,e).then((function(e){c||(c=!0,r[a]={status:"fulfilled",value:e},--s||n(r))}),(function(e){c||(c=!0,r[a]={status:"rejected",reason:e},--s||n(r))}))})),--s||n(r)}));return o.error&&r(o.value),i.promise}});var zT=jA,ZT=fA,$T=jc,em=PC,tm=FC,im=KI,nm="No one promise resolved";Bu({target:"Promise",stat:!0},{any:function(e){var t=this,i=ZT("AggregateError"),n=em.f(t),r=n.resolve,o=n.reject,s=tm((function(){var n=zT(t.resolve),s=[],a=0,c=1,A=!1;im(e,(function(e){var d=a++,u=!1;c++,$T(n,t,e).then((function(e){u||A||(A=!0,r(e))}),(function(e){u||A||(u=!0,s[d]=e,--c||o(new i(s,nm)))}))})),--c||o(new i(s,nm))}));return s.error&&o(s.value),n.promise}});var rm=Xf,om=fA,sm=Vc,am=PR,cm=QC;Bu({target:"Promise",proto:!0,real:!0,forced:!!rm&&Tc((function(){rm.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=am(this,om("Promise")),i=sm(e);return this.then(i?function(i){return cm(t,e()).then((function(){return i}))}:e,i?function(i){return cm(t,e()).then((function(){throw i}))}:e)}});var Am=Dc,dm=xu,um=qI,Em=cA,lm=Am("".charAt),hm=Am("".charCodeAt),pm=Am("".slice),_m=function(e){return function(t,i){var n,r,o=um(Em(t)),s=dm(i),a=o.length;return s<0||s>=a?e?"":void 0:(n=hm(o,s))<55296||n>56319||s+1===a||(r=hm(o,s+1))<56320||r>57343?e?lm(o,s):n:e?pm(o,s,s+2):r-56320+(n-55296<<10)+65536}},Im={codeAt:_m(!1),charAt:_m(!0)},gm=Im.charAt,fm=qI,Rm=Wg,Cm=Gf,Tm="String Iterator",mm=Rm.set,Sm=Rm.getterFor(Tm);Cm(String,"String",(function(e){mm(this,{type:Tm,string:fm(e),index:0})}),(function(){var e,t=Sm(this),i=t.string,n=t.index;return n>=i.length?{value:void 0,done:!0}:(e=gm(i,n),t.index+=e.length,{value:e,done:!1})}));var Om=hA.Promise,vm=Lc,Nm=_I,ym=Ou,Dm=iI,wm=md("toStringTag");for(var bm in{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}){var Lm=vm[bm],Pm=Lm&&Lm.prototype;Pm&&Nm(Pm)!==wm&&ym(Pm,wm,bm),Dm[bm]=Dm.Array}var km=Om,Mm=km,Um=Go,Bm=s,Vm=o,Qm=wt,xm=jE,Fm=Gh,Gm=Error.prototype.toString,jm=Vm((function(){if(Bm){var e=xm(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==Gm.call(e))return!0}return"2: 1"!==Gm.call({message:1,name:2})||"Error"!==Gm.call({})}))?function(){var e=Qm(this),t=Fm(e.name,"Error"),i=Fm(e.message);return t?i?t+": "+i:t:i}:Gm,Ym={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},Hm=Fn,Km=H,Wm=o,Jm=jE,qm=I,Xm=St.f,zm=CE.f,Zm=Gt.exports,$m=Ue,eS=Ar,tS=wt,iS=jm,nS=Gh,rS=Ym,oS=qh,sS=Ti,aS=s,cS="DOMException",AS=Km("Error"),dS=Km(cS)||function(){try{(new(Km("MessageChannel")||function(e){try{if(Um)return Function('return require("'+e+'")')()}catch(e){}}("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if("DATA_CLONE_ERR"==e.name&&25==e.code)return e.constructor}}(),uS=dS&&dS.prototype,ES=AS.prototype,lS=sS.set,hS=sS.getterFor(cS),pS="stack"in AS(cS),_S=function(e){return $m(rS,e)&&rS[e].m?rS[e].c:0},IS=function(){eS(this,gS);var e=arguments.length,t=nS(e<1?void 0:arguments[0]),i=nS(e<2?void 0:arguments[1],"Error"),n=_S(i);if(lS(this,{type:cS,name:i,message:t,code:n}),aS||(this.name=i,this.message=t,this.code=n),pS){var r=AS(t);r.name=cS,Xm(this,"stack",qm(1,oS(r.stack,1)))}},gS=IS.prototype=Jm(ES),fS=function(e){return{enumerable:!0,configurable:!0,get:e}},RS=function(e){return fS((function(){return hS(this)[e]}))};aS&&zm(gS,{name:RS("name"),message:RS("message"),code:RS("code")}),Xm(gS,"constructor",qm(1,IS));var CS=Wm((function(){return!(new dS instanceof AS)})),TS=CS||Wm((function(){return ES.toString!==iS||"2: 1"!==String(new dS(1,2))})),mS=CS||Wm((function(){return 25!==new dS(1,"DataCloneError").code}));CS||25!==dS.DATA_CLONE_ERR||uS.DATA_CLONE_ERR,Hm({global:!0,forced:CS},{DOMException:CS?IS:dS});var SS=Km(cS),OS=SS.prototype;for(var vS in TS&&dS===SS&&Zm(OS,"toString",iS),mS&&aS&&dS===SS&&Xm(OS,"code",fS((function(){return _S(tS(this).name)}))),rS)if($m(rS,vS)){var NS=rS[vS],yS=NS.s,DS=qm(6,NS.c);$m(SS,yS)||Xm(SS,yS,DS),$m(OS,yS)||Xm(OS,yS,DS)}var wS=Fn,bS=H,LS=I,PS=St.f,kS=Ue,MS=Ar,US=xh,BS=Gh,VS=Ym,QS=qh,xS="DOMException",FS=bS("Error"),GS=bS(xS),jS=function(){MS(this,YS);var e=arguments.length,t=BS(e<1?void 0:arguments[0]),i=BS(e<2?void 0:arguments[1],"Error"),n=new GS(t,i),r=FS(t);return r.name=xS,PS(n,"stack",LS(1,QS(r.stack,1))),US(n,this,jS),n},YS=jS.prototype=GS.prototype,HS="stack"in FS(xS),KS="stack"in new GS(1,2),WS=HS&&!KS;wS({global:!0,forced:WS},{DOMException:WS?jS:GS});var JS=bS(xS),qS=JS.prototype;if(qS.constructor!==JS)for(var XS in PS(qS,"constructor",LS(1,JS)),VS)if(kS(VS,XS)){var zS=VS[XS],ZS=zS.s;kS(JS,ZS)||PS(JS,ZS,LS(6,zS.c))}var $S="DOMException";tr(H($S),$S);var eO=m,tO=Gt.exports,iO=_l,nO=o,rO=Ze,oO=Ft,sO=rO("species"),aO=RegExp.prototype,cO=m,AO=Gi,dO=lE,uO=M,EO=cO("".charAt),lO=cO("".charCodeAt),hO=cO("".slice),pO=function(e){return function(t,i){var n,r,o=dO(uO(t)),s=AO(i),a=o.length;return s<0||s>=a?e?"":void 0:(n=lO(o,s))<55296||n>56319||s+1===a||(r=lO(o,s+1))<56320||r>57343?e?EO(o,s):n:e?hO(o,s,s+2):r-56320+(n-55296<<10)+65536}},_O=(pO(!1),pO(!0)),IO=m,gO=Pe,fO=Math.floor,RO=IO("".charAt),CO=IO("".replace),TO=IO("".slice),mO=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SO=/\$([$&'`]|\d{1,2})/g,OO=d,vO=wt,NO=Q,yO=N,DO=_l,wO=n.TypeError,bO=Vo,LO=d,PO=m,kO=o,MO=wt,UO=Q,BO=Gi,VO=qi,QO=lE,xO=M,FO=function(e,t,i){return t+(i?_O(e,t).length:1)},GO=ge,jO=function(e,t,i,n,r,o){var s=i+e.length,a=n.length,c=SO;return void 0!==r&&(r=gO(r),c=mO),CO(o,c,(function(o,c){var A;switch(RO(c,0)){case"$":return"$";case"&":return e;case"`":return TO(t,0,i);case"'":return TO(t,s);case"<":A=r[TO(c,1,-1)];break;default:var d=+c;if(0===d)return o;if(d>a){var u=fO(d/10);return 0===u?o:u<=a?void 0===n[u-1]?RO(c,1):n[u-1]+RO(c,1):o}A=n[d-1]}return void 0===A?"":A}))},YO=function(e,t){var i=e.exec;if(NO(i)){var n=OO(i,e,t);return null!==n&&vO(n),n}if("RegExp"===yO(e))return OO(DO,e,t);throw wO("RegExp#exec called on incompatible receiver")},HO=Ze("replace"),KO=Math.max,WO=Math.min,JO=PO([].concat),qO=PO([].push),XO=PO("".indexOf),zO=PO("".slice),ZO="$0"==="a".replace(/./,"$0"),$O=!!/./[HO]&&""===/./[HO]("a","$0");!function(e,t,i,n){var r=rO(e),o=!nO((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!nO((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[sO]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!s||i){var a=eO(/./[r]),c=t(r,""[e],(function(e,t,i,n,r){var s=eO(e),c=t.exec;return c===iO||c===aO.exec?o&&!r?{done:!0,value:a(t,i,n)}:{done:!0,value:s(i,t,n)}:{done:!1}}));tO(String.prototype,e,c[0]),tO(aO,r,c[1])}n&&oO(aO[r],"sham",!0)}("replace",(function(e,t,i){var n=$O?"$":"$0";return[function(e,i){var n=xO(this),r=null==e?void 0:GO(e,HO);return r?LO(r,e,n,i):LO(t,QO(n),e,i)},function(e,r){var o=MO(this),s=QO(e);if("string"==typeof r&&-1===XO(r,n)&&-1===XO(r,"$<")){var a=i(t,o,s,r);if(a.done)return a.value}var c=UO(r);c||(r=QO(r));var A=o.global;if(A){var d=o.unicode;o.lastIndex=0}for(var u=[];;){var E=YO(o,s);if(null===E)break;if(qO(u,E),!A)break;""===QO(E[0])&&(o.lastIndex=FO(s,VO(o.lastIndex),d))}for(var l,h="",p=0,_=0;_<u.length;_++){for(var I=QO((E=u[_])[0]),g=KO(WO(BO(E.index),s.length),0),f=[],R=1;R<E.length;R++)qO(f,void 0===(l=E[R])?l:String(l));var C=E.groups;if(c){var T=JO([I],f,g,s);void 0!==C&&qO(T,C);var m=QO(bO(r,void 0,T))}else m=jO(I,s,g,f,C,r);g>=p&&(h+=zO(s,p,g)+m,p=g+I.length)}return h+zO(s,p)}]}),!!kO((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ZO||$O);var ev=F,tv=N,iv=Ze("match"),nv=s,rv=n,ov=m,sv=Pn,av=xh,cv=Ft,Av=St.f,dv=Qi.f,uv=K,Ev=lE,lv=pE,hv=RE,pv=Gt.exports,_v=o,Iv=Ue,gv=Ti.enforce,fv=sr,Rv=KE,Cv=qE,Tv=Ze("match"),mv=rv.RegExp,Sv=mv.prototype,Ov=rv.SyntaxError,vv=ov(lv),Nv=ov(Sv.exec),yv=ov("".charAt),Dv=ov("".replace),wv=ov("".indexOf),bv=ov("".slice),Lv=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Pv=/a/g,kv=/a/g,Mv=new mv(Pv)!==Pv,Uv=hv.MISSED_STICKY,Bv=hv.UNSUPPORTED_Y;if(sv("RegExp",nv&&(!Mv||Uv||Rv||Cv||_v((function(){return kv[Tv]=!1,mv(Pv)!=Pv||mv(kv)==kv||"/a/i"!=mv(Pv,"i")}))))){for(var Vv=function(e,t){var i,n,r,o,s,a,c=uv(Sv,this),A=function(e){var t;return ev(e)&&(void 0!==(t=e[iv])?!!t:"RegExp"==tv(e))}(e),d=void 0===t,u=[],E=e;if(!c&&A&&d&&e.constructor===Vv)return e;if((A||uv(Sv,e))&&(e=e.source,d&&(t="flags"in E?E.flags:vv(E))),e=void 0===e?"":Ev(e),t=void 0===t?"":Ev(t),E=e,Rv&&"dotAll"in Pv&&(n=!!t&&wv(t,"s")>-1)&&(t=Dv(t,/s/g,"")),i=t,Uv&&"sticky"in Pv&&(r=!!t&&wv(t,"y")>-1)&&Bv&&(t=Dv(t,/y/g,"")),Cv&&(e=(o=function(e){for(var t,i=e.length,n=0,r="",o=[],s={},a=!1,c=!1,A=0,d="";n<=i;n++){if("\\"===(t=yv(e,n)))t+=yv(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:Nv(Lv,bv(e,n+1))&&(n+=2,c=!0),r+=t,A++;continue;case">"===t&&c:if(""===d||Iv(s,d))throw new Ov("Invalid capture group name");s[d]=!0,o[o.length]=[d,A],c=!1,d="";continue}c?d+=t:r+=t}return[r,o]}(e))[0],u=o[1]),s=av(mv(e,t),c?this:Sv,Vv),(n||r||u.length)&&(a=gv(s),n&&(a.dotAll=!0,a.raw=Vv(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=yv(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+yv(e,++n);return r}(e),i)),r&&(a.sticky=!0),u.length&&(a.groups=u)),e!==E)try{cv(s,"source",""===E?"(?:)":E)}catch(e){}return s},Qv=function(e){e in Vv||Av(Vv,e,{configurable:!0,get:function(){return mv[e]},set:function(t){mv[e]=t}})},xv=dv(mv),Fv=0;xv.length>Fv;)Qv(xv[Fv++]);Sv.constructor=Vv,Vv.prototype=Sv,pv(rv,"RegExp",Vv)}fv("RegExp");var Gv=n,jv=s,Yv=KE,Hv=N,Kv=St.f,Wv=Ti.get,Jv=RegExp.prototype,qv=Gv.TypeError;jv&&Yv&&Kv(Jv,"dotAll",{configurable:!0,get:function(){if(this!==Jv){if("RegExp"===Hv(this))return!!Wv(this).dotAll;throw qv("Incompatible receiver, RegExp required")}}});const Xv=Tp;function zv(e,t){const i=e&&e.navigator;if(!i.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((i=>{if("require"===i||"advanced"===i||"mediaSource"===i)return;const n="object"==typeof e[i]?e[i]:{ideal:e[i]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[r("min",i)]=n.ideal,t.optional.push(e),e={},e[r("max",i)]=n.ideal,t.optional.push(e)):(e[r("",i)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",i)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,i)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},r=function(e,r){if(t.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!i.mediaDevices.getSupportedConstraints||!i.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return i.mediaDevices.enumerateDevices().then((i=>{let s=(i=i.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&i.length&&t.includes("back")&&(s=i[i.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),Xv("chrome: "+JSON.stringify(e)),r(e)}))}e.video=n(e.video)}return Xv("chrome: "+JSON.stringify(e)),r(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(i.getUserMedia=function(e,t,n){r(e,(e=>{i.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(i),i.mediaDevices.getUserMedia){const e=i.mediaDevices.getUserMedia.bind(i.mediaDevices);i.mediaDevices.getUserMedia=function(t){return r(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Mm.reject(o(e))))))}}}function Zv(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function $v(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(i=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===i.track.id)):{track:i.track};const r=new Event("track");r.track=i.track,r.receiver=n,r.transceiver={receiver:n},r.streams=[t.stream],this.dispatchEvent(r)})),t.stream.getTracks().forEach((i=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===i.id)):{track:i};const r=new Event("track");r.track=i,r.receiver=n,r.transceiver={receiver:n},r.streams=[t.stream],this.dispatchEvent(r)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else fp(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function eN(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let r=i.apply(this,arguments);return r||(r=t(this,e),this._senders.push(r)),r};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.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 tN(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const r=function(e){const t={};return e.result().forEach((e=>{const i={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{i[t]=e.stat(t)})),t[i.id]=i})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){i(o(r(e)))};return t.apply(this,[n,e])}return new Mm(((e,i)=>{t.apply(this,[function(t){e(o(r(t)))},i])})).then(i,n)}}function iN(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Np(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),fp(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Np(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,i,n;return this.getSenders().forEach((i=>{i.track===e&&(t?n=!0:t=i)})),this.getReceivers().forEach((t=>(t.track===e&&(i?n=!0:i=t),t.track===e))),n||t&&i?Mm.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():i?i.getStats():Mm.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function nN(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){if(!i)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[i.id]?-1===this._shimmedLocalStreams[i.id].indexOf(n)&&this._shimmedLocalStreams[i.id].push(n):this._shimmedLocalStreams[i.id]=[i,n],n};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();i.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const i=this._shimmedLocalStreams[t].indexOf(e);-1!==i&&this._shimmedLocalStreams[t].splice(i,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),r.apply(this,arguments)}}function rN(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return nN(e);const i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=i.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const i=new e.MediaStream(t.getTracks());this._streams[t.id]=i,this._reverseStreams[i.id]=t,t=i}n.apply(this,[t])};const r=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],r=e._streams[n.id];i=i.replace(new RegExp(r.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:i})}function s(e,t){let i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],r=e._streams[n.id];i=i.replace(new RegExp(n.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:i})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,i){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((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");const r=this.getSenders().find((e=>e.track===t));if(r)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[i.id];if(o)o.addTrack(t),Mm.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[i.id]=n,this._reverseStreams[n.id]=i,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const i=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?i.apply(this,[t=>{const i=o(this,t);e[0].apply(null,[i])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):i.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.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 c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((i=>{this._streams[i].getTracks().find((t=>e.track===t))&&(t=this._streams[i])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function oN(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const i=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function sN(e,t){fp(e,"negotiationneeded",(e=>{const i=e.target;if(!(t.version<72||i.getConfiguration&&"plan-b"===i.getConfiguration().sdpSemantics)||"stable"===i.signalingState)return e}))}var aN=Object.freeze({__proto__:null,shimMediaStream:Zv,shimOnTrack:$v,shimGetSendersWithDtmf:eN,shimGetStats:tN,shimSenderReceiverGetStats:iN,shimAddTrackRemoveTrackWithNative:nN,shimAddTrackRemoveTrack:rN,shimPeerConnection:oN,fixNegotiationNeeded:sN,shimGetUserMedia:zv,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then((t=>{const n=i.video&&i.video.width,r=i.video&&i.video.height,o=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(i.video.mandatory.maxWidth=n),r&&(i.video.mandatory.maxHeight=r),e.navigator.mediaDevices.getUserMedia(i)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}}),cN={exports:{}};!function(e){var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},t.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},t.getDescription=function(e){var i=t.splitSections(e);return i&&i[0]},t.getMediaSections=function(e){var i=t.splitSections(e);return i.shift(),i},t.matchPrefix=function(e,i){return t.splitLines(e).filter((function(e){return 0===e.indexOf(i)}))},t.parseCandidate=function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":i.relatedAddress=t[n+1];break;case"rport":i.relatedPort=parseInt(t[n+1],10);break;case"tcptype":i.tcpType=t[n+1];break;case"ufrag":i.ufrag=t[n+1],i.usernameFragment=t[n+1];break;default:i[t[n]]=t[n+1]}return i},t.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var t=e.substr(9).split(" "),i={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),i.name=t[0],i.clockRate=parseInt(t[1],10),i.channels=3===t.length?parseInt(t[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var i=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==i?"/"+i:"")+"\r\n"},t.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){for(var t,i={},n=e.substr(e.indexOf(" ")+1).split(";"),r=0;r<n.length;r++)i[(t=n[r].trim().split("="))[0].trim()]=t[1];return i},t.writeFmtp=function(e){var t="",i=e.payloadType;if(void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+i+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){var t="",i=e.payloadType;return void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+i+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){var t=e.indexOf(" "),i={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(i.attribute=e.substr(t+1,n-t-1),i.value=e.substr(n+1)):i.attribute=e.substr(t+1),i},t.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},t.getMid=function(e){var i=t.matchPrefix(e,"a=mid:")[0];if(i)return i.substr(6)},t.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},t.getDtlsParameters=function(e,i){return{role:"auto",fingerprints:t.matchPrefix(e+i,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){var i="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),i},t.getIceParameters=function(e,i){var n=t.splitLines(e);return{usernameFragment:(n=n.concat(t.splitLines(i))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:n.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},t.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},t.parseRtpParameters=function(e){for(var i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=t.parseRtpMap(s),c=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?t.parseFmtp(c[0]):{},a.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),i.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":i.fecMechanisms.push(a.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((function(e){i.headerExtensions.push(t.parseExtmap(e))})),i},t.writeRtpDescription=function(e,i){var n="";n+="m="+e+" ",n+=i.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=i.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.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",i.codecs.forEach((function(e){n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));var r=0;return i.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(n+="a=maxptime:"+r+"\r\n"),n+="a=rtcp-mux\r\n",i.headerExtensions&&i.headerExtensions.forEach((function(e){n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){var i,n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),s=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,A=t.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));A.length>0&&A[0].length>1&&A[0][0]===c&&(i=A[0][1]),r.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var t={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&i&&(t.rtx={ssrc:i}),n.push(t),o&&((t=JSON.parse(JSON.stringify(t))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&c&&n.push({ssrc:c});var d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){var i={},n=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(i.cname=n.value,i.ssrc=n.ssrc);var r=t.matchPrefix(e,"a=rtcp-rsize");i.reducedSize=r.length>0,i.compound=0===r.length;var o=t.matchPrefix(e,"a=rtcp-mux");return i.mux=o.length>0,i},t.parseMsid=function(e){var i,n=t.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(i=n[0].substr(7).split(" "))[0],track:i[1]};var r=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(i=r[0].value.split(" "))[0],track:i[1]}:void 0},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,i,n){var r=void 0!==i?i:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||t.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.writeMediaSection=function(e,i,n,r){var o=t.writeRtpDescription(e.kind,i);if(o+=t.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=t.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+"\r\n"),o},t.getDirection=function(e,i){for(var n=t.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return i?t.getDirection(i):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){var i=t.splitLines(e)[0].substr(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},t.parseOLine=function(e){var i=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var i=t.splitLines(e),n=0;n<i.length;n++)if(i[n].length<2||"="!==i[n].charAt(1))return!1;return!0},e.exports=t}(cN);var AN=cN.exports;function dN(e,t,i,n,r){var o=AN.writeRtpDescription(e.kind,t);if(o+=AN.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=AN.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":r||"active"),o+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var a="msid:"+(n?n.id:"-")+" "+s+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+AN.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+AN.localCName+"\r\n"),o}function uN(e,t){var i={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var i=0;i<t.length;i++)if(t[i].payloadType===e||t[i].preferredPayloadType===e)return t[i]},r=function(e,t,i,r){var o=n(e.parameters.apt,i),s=n(t.parameters.apt,r);return o&&s&&o.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach((function(n){for(var o=0;o<t.codecs.length;o++){var s=t.codecs[o];if(n.name.toLowerCase()===s.name.toLowerCase()&&n.clockRate===s.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&s.parameters.apt&&!r(n,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(n.numChannels,s.numChannels),i.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter((function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var n=0;n<t.headerExtensions.length;n++){var r=t.headerExtensions[n];if(e.uri===r.uri){i.headerExtensions.push(r);break}}})),i}function EN(e,t,i){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(i)}function lN(e,t){var i=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return i||e.addRemoteCandidate(t),!i}function hN(e,t){var i=new Error(t);return i.name=e,i.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],i}function pN(e){const t=e&&e.navigator,i=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e).catch((e=>Mm.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e))))}}function _N(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function IN(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const i=new Event("enabled");i.enabled=e,this.dispatchEvent(i)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const i=function(e,t){function i(t,i){i.addTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function n(t,i,n,r){var o=new Event("track");o.track=i,o.receiver=n,o.transceiver={receiver:n},o.streams=r,e.setTimeout((function(){t._dispatchEvent("track",o)}))}var r=function(i){var n=this,r=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){n[e]=r[e].bind(r)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",i=JSON.parse(JSON.stringify(i||{})),this.usingBundle="max-bundle"===i.bundlePolicy,"negotiate"===i.rtcpMuxPolicy)throw hN("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(i.rtcpMuxPolicy||(i.rtcpMuxPolicy="require"),i.iceTransportPolicy){case"all":case"relay":break;default:i.iceTransportPolicy="all"}switch(i.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:i.bundlePolicy="balanced"}if(i.iceServers=function(e,t){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var r="string"==typeof n;return r&&(n=[n]),n=n.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||i?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(i=!0,!0)})),delete e.url,e.urls=r?n[0]:n,!!n.length}}))}(i.iceServers||[],t),this._iceGatherers=[],i.iceCandidatePoolSize)for(var o=i.iceCandidatePoolSize;o>0;o--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:i.iceServers,gatherPolicy:i.iceTransportPolicy}));else i.iceCandidatePoolSize=0;this._config=i,this.transceivers=[],this._sdpSessionId=AN.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(r.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(r.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),r.prototype.onicecandidate=null,r.prototype.onaddstream=null,r.prototype.ontrack=null,r.prototype.onremovestream=null,r.prototype.onsignalingstatechange=null,r.prototype.oniceconnectionstatechange=null,r.prototype.onconnectionstatechange=null,r.prototype.onicegatheringstatechange=null,r.prototype.onnegotiationneeded=null,r.prototype.ondatachannel=null,r.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},r.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},r.prototype.getConfiguration=function(){return this._config},r.prototype.getLocalStreams=function(){return this.localStreams},r.prototype.getRemoteStreams=function(){return this.remoteStreams},r.prototype._createTransceiver=function(e,t){var i=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&i)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var r=this._createIceAndDtlsTransports();n.iceTransport=r.iceTransport,n.dtlsTransport=r.dtlsTransport}return t||this.transceivers.push(n),n},r.prototype.addTrack=function(t,i){if(this._isClosed)throw hN("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n;if(this.transceivers.find((function(e){return e.track===t})))throw hN("InvalidAccessError","Track already exists.");for(var r=0;r<this.transceivers.length;r++)this.transceivers[r].track||this.transceivers[r].kind!==t.kind||(n=this.transceivers[r]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(i)&&this.localStreams.push(i),n.track=t,n.stream=i,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},r.prototype.addStream=function(e){var i=this;if(t>=15025)e.getTracks().forEach((function(t){i.addTrack(t,e)}));else{var n=e.clone();e.getTracks().forEach((function(e,t){var i=n.getTracks()[t];e.addEventListener("enabled",(function(e){i.enabled=e.enabled}))})),n.getTracks().forEach((function(e){i.addTrack(e,n)}))}},r.prototype.removeTrack=function(t){if(this._isClosed)throw hN("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var i=this.transceivers.find((function(e){return e.rtpSender===t}));if(!i)throw hN("InvalidAccessError","Sender was not created by this connection.");var n=i.stream;i.rtpSender.stop(),i.rtpSender=null,i.track=null,i.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},r.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var i=t.getSenders().find((function(t){return t.track===e}));i&&t.removeTrack(i)}))},r.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},r.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},r.prototype._createIceGatherer=function(t,i){var n=this;if(i&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var r=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(r,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var i=!e.candidate||0===Object.keys(e.candidate).length;r.state=i?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},r.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),r},r.prototype._gather=function(t,i){var n=this,r=this.transceivers[i].iceGatherer;if(!r.onlocalcandidate){var o=this.transceivers[i].bufferedCandidateEvents;this.transceivers[i].bufferedCandidateEvents=null,r.removeEventListener("localcandidate",this.transceivers[i].bufferCandidates),r.onlocalcandidate=function(e){if(!(n.usingBundle&&i>0)){var o=new Event("icecandidate");o.candidate={sdpMid:t,sdpMLineIndex:i};var s=e.candidate,a=!s||0===Object.keys(s).length;if(a)"new"!==r.state&&"gathering"!==r.state||(r.state="completed");else{"new"===r.state&&(r.state="gathering"),s.component=1,s.ufrag=r.getLocalParameters().usernameFragment;var c=AN.writeCandidate(s);o.candidate=Object.assign(o.candidate,AN.parseCandidate(c)),o.candidate.candidate=c,o.candidate.toJSON=function(){return{candidate:o.candidate.candidate,sdpMid:o.candidate.sdpMid,sdpMLineIndex:o.candidate.sdpMLineIndex,usernameFragment:o.candidate.usernameFragment}}}var A=AN.getMediaSections(n._localDescription.sdp);A[o.candidate.sdpMLineIndex]+=a?"a=end-of-candidates\r\n":"a="+o.candidate.candidate+"\r\n",n._localDescription.sdp=AN.getDescription(n._localDescription.sdp)+A.join("");var d=n.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),a||n._dispatchEvent("icecandidate",o),d&&(n._dispatchEvent("icecandidate",new Event("icecandidate")),n.iceGatheringState="complete",n._emitGatheringStateChange())}},e.setTimeout((function(){o.forEach((function(e){r.onlocalcandidate(e)}))}),0)}},r.prototype._createIceAndDtlsTransports=function(){var t=this,i=new e.RTCIceTransport(null);i.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(i);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:i,dtlsTransport:n}},r.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var i=this.transceivers[e].iceTransport;i&&(delete i.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},r.prototype._transceive=function(e,i,n){var r=uN(e.localCapabilities,e.remoteCapabilities);i&&e.rtpSender&&(r.encodings=e.sendEncodingParameters,r.rtcp={cname:AN.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(r.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(r)),n&&e.rtpReceiver&&r.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?r.encodings=e.recvEncodingParameters:r.encodings=[{}],r.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(r.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(r.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(r))},r.prototype.setLocalDescription=function(e){var t,i,n=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(hN("TypeError",'Unsupported type "'+e.type+'"'));if(!EN("setLocalDescription",e.type,n.signalingState)||n._isClosed)return Promise.reject(hN("InvalidStateError","Can not set local "+e.type+" in state "+n.signalingState));if("offer"===e.type)t=AN.splitSections(e.sdp),i=t.shift(),t.forEach((function(e,t){var i=AN.parseRtpParameters(e);n.transceivers[t].localCapabilities=i})),n.transceivers.forEach((function(e,t){n._gather(e.mid,t)}));else if("answer"===e.type){t=AN.splitSections(n._remoteDescription.sdp),i=t.shift();var r=AN.matchPrefix(i,"a=ice-lite").length>0;t.forEach((function(e,t){var o=n.transceivers[t],s=o.iceGatherer,a=o.iceTransport,c=o.dtlsTransport,A=o.localCapabilities,d=o.remoteCapabilities;if(!(AN.isRejected(e)&&0===AN.matchPrefix(e,"a=bundle-only").length||o.rejected)){var u=AN.getIceParameters(e,i),E=AN.getDtlsParameters(e,i);r&&(E.role="server"),n.usingBundle&&0!==t||(n._gather(o.mid,t),"new"===a.state&&a.start(s,u,r?"controlling":"controlled"),"new"===c.state&&c.start(E));var l=uN(A,d);n._transceive(o,l.codecs.length>0,!1)}}))}return n._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?n._updateSignalingState("have-local-offer"):n._updateSignalingState("stable"),Promise.resolve()},r.prototype.setRemoteDescription=function(r){var o=this;if(-1===["offer","answer"].indexOf(r.type))return Promise.reject(hN("TypeError",'Unsupported type "'+r.type+'"'));if(!EN("setRemoteDescription",r.type,o.signalingState)||o._isClosed)return Promise.reject(hN("InvalidStateError","Can not set remote "+r.type+" in state "+o.signalingState));var s={};o.remoteStreams.forEach((function(e){s[e.id]=e}));var a=[],c=AN.splitSections(r.sdp),A=c.shift(),d=AN.matchPrefix(A,"a=ice-lite").length>0,u=AN.matchPrefix(A,"a=group:BUNDLE ").length>0;o.usingBundle=u;var E=AN.matchPrefix(A,"a=ice-options:")[0];return o.canTrickleIceCandidates=!!E&&E.substr(14).split(" ").indexOf("trickle")>=0,c.forEach((function(n,c){var E=AN.splitLines(n),l=AN.getKind(n),h=AN.isRejected(n)&&0===AN.matchPrefix(n,"a=bundle-only").length,p=E[0].substr(2).split(" ")[2],_=AN.getDirection(n,A),I=AN.parseMsid(n),g=AN.getMid(n)||AN.generateIdentifier();if(h||"application"===l&&("DTLS/SCTP"===p||"UDP/DTLS/SCTP"===p))o.transceivers[c]={mid:g,kind:l,protocol:p,rejected:!0};else{var f,R,C,T,m,S,O,v,N;!h&&o.transceivers[c]&&o.transceivers[c].rejected&&(o.transceivers[c]=o._createTransceiver(l,!0));var y,D,w=AN.parseRtpParameters(n);h||(y=AN.getIceParameters(n,A),(D=AN.getDtlsParameters(n,A)).role="client"),O=AN.parseRtpEncodingParameters(n);var b=AN.parseRtcpParameters(n),L=AN.matchPrefix(n,"a=end-of-candidates",A).length>0,P=AN.matchPrefix(n,"a=candidate:").map((function(e){return AN.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===r.type||"answer"===r.type)&&!h&&u&&c>0&&o.transceivers[c]&&(o._disposeIceAndDtlsTransports(c),o.transceivers[c].iceGatherer=o.transceivers[0].iceGatherer,o.transceivers[c].iceTransport=o.transceivers[0].iceTransport,o.transceivers[c].dtlsTransport=o.transceivers[0].dtlsTransport,o.transceivers[c].rtpSender&&o.transceivers[c].rtpSender.setTransport(o.transceivers[0].dtlsTransport),o.transceivers[c].rtpReceiver&&o.transceivers[c].rtpReceiver.setTransport(o.transceivers[0].dtlsTransport)),"offer"!==r.type||h)"answer"!==r.type||h||(R=(f=o.transceivers[c]).iceGatherer,C=f.iceTransport,T=f.dtlsTransport,m=f.rtpReceiver,S=f.sendEncodingParameters,v=f.localCapabilities,o.transceivers[c].recvEncodingParameters=O,o.transceivers[c].remoteCapabilities=w,o.transceivers[c].rtcpParameters=b,P.length&&"new"===C.state&&(!d&&!L||u&&0!==c?P.forEach((function(e){lN(f.iceTransport,e)})):C.setRemoteCandidates(P)),u&&0!==c||("new"===C.state&&C.start(R,y,"controlling"),"new"===T.state&&T.start(D)),!uN(f.localCapabilities,f.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&f.sendEncodingParameters[0].rtx&&delete f.sendEncodingParameters[0].rtx,o._transceive(f,"sendrecv"===_||"recvonly"===_,"sendrecv"===_||"sendonly"===_),!m||"sendrecv"!==_&&"sendonly"!==_?delete f.rtpReceiver:(N=m.track,I?(s[I.stream]||(s[I.stream]=new e.MediaStream),i(N,s[I.stream]),a.push([N,m,s[I.stream]])):(s.default||(s.default=new e.MediaStream),i(N,s.default),a.push([N,m,s.default]))));else{(f=o.transceivers[c]||o._createTransceiver(l)).mid=g,f.iceGatherer||(f.iceGatherer=o._createIceGatherer(c,u)),P.length&&"new"===f.iceTransport.state&&(!L||u&&0!==c?P.forEach((function(e){lN(f.iceTransport,e)})):f.iceTransport.setRemoteCandidates(P)),v=e.RTCRtpReceiver.getCapabilities(l),t<15019&&(v.codecs=v.codecs.filter((function(e){return"rtx"!==e.name}))),S=f.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var k,M=!1;"sendrecv"===_||"sendonly"===_?(M=!f.rtpReceiver,m=f.rtpReceiver||new e.RTCRtpReceiver(f.dtlsTransport,l),M&&(N=m.track,I&&"-"===I.stream||(I?(s[I.stream]||(s[I.stream]=new e.MediaStream,Object.defineProperty(s[I.stream],"id",{get:function(){return I.stream}})),Object.defineProperty(N,"id",{get:function(){return I.track}}),k=s[I.stream]):(s.default||(s.default=new e.MediaStream),k=s.default)),k&&(i(N,k),f.associatedRemoteMediaStreams.push(k)),a.push([N,m,k]))):f.rtpReceiver&&f.rtpReceiver.track&&(f.associatedRemoteMediaStreams.forEach((function(t){var i=t.getTracks().find((function(e){return e.id===f.rtpReceiver.track.id}));i&&function(t,i){i.removeTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(i,t)})),f.associatedRemoteMediaStreams=[]),f.localCapabilities=v,f.remoteCapabilities=w,f.rtpReceiver=m,f.rtcpParameters=b,f.sendEncodingParameters=S,f.recvEncodingParameters=O,o._transceive(o.transceivers[c],!1,M)}}})),void 0===o._dtlsRole&&(o._dtlsRole="offer"===r.type?"active":"passive"),o._remoteDescription={type:r.type,sdp:r.sdp},"offer"===r.type?o._updateSignalingState("have-remote-offer"):o._updateSignalingState("stable"),Object.keys(s).forEach((function(t){var i=s[t];if(i.getTracks().length){if(-1===o.remoteStreams.indexOf(i)){o.remoteStreams.push(i);var r=new Event("addstream");r.stream=i,e.setTimeout((function(){o._dispatchEvent("addstream",r)}))}a.forEach((function(e){var t=e[0],r=e[1];i.id===e[2].id&&n(o,t,r,[i])}))}})),a.forEach((function(e){e[2]||n(o,e[0],e[1],[])})),e.setTimeout((function(){o&&o.transceivers&&o.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},r.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},r.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},r.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},r.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var i=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",i)}},r.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var i=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",i)}},r.prototype.createOffer=function(){var i=this;if(i._isClosed)return Promise.reject(hN("InvalidStateError","Can not call createOffer after close"));var n=i.transceivers.filter((function(e){return"audio"===e.kind})).length,r=i.transceivers.filter((function(e){return"video"===e.kind})).length,o=arguments[0];if(o){if(o.mandatory||o.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==o.offerToReceiveAudio&&(n=!0===o.offerToReceiveAudio?1:!1===o.offerToReceiveAudio?0:o.offerToReceiveAudio),void 0!==o.offerToReceiveVideo&&(r=!0===o.offerToReceiveVideo?1:!1===o.offerToReceiveVideo?0:o.offerToReceiveVideo)}for(i.transceivers.forEach((function(e){"audio"===e.kind?--n<0&&(e.wantReceive=!1):"video"===e.kind&&--r<0&&(e.wantReceive=!1)}));n>0||r>0;)n>0&&(i._createTransceiver("audio"),n--),r>0&&(i._createTransceiver("video"),r--);var s=AN.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.transceivers.forEach((function(n,r){var o=n.track,s=n.kind,a=n.mid||AN.generateIdentifier();n.mid=a,n.iceGatherer||(n.iceGatherer=i._createIceGatherer(r,i.usingBundle));var c=e.RTCRtpSender.getCapabilities(s);t<15019&&(c.codecs=c.codecs.filter((function(e){return"rtx"!==e.name}))),c.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),n.remoteCapabilities&&n.remoteCapabilities.codecs&&n.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),c.headerExtensions.forEach((function(e){(n.remoteCapabilities&&n.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var A=n.sendEncodingParameters||[{ssrc:1001*(2*r+1)}];o&&t>=15019&&"video"===s&&!A[0].rtx&&(A[0].rtx={ssrc:A[0].ssrc+1}),n.wantReceive&&(n.rtpReceiver=new e.RTCRtpReceiver(n.dtlsTransport,s)),n.localCapabilities=c,n.sendEncodingParameters=A})),"max-compat"!==i._config.bundlePolicy&&(s+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",i.transceivers.forEach((function(e,t){s+=dN(e,e.localCapabilities,"offer",e.stream,i._dtlsRole),s+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===i.iceGatheringState||0!==t&&i.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,s+="a="+AN.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))}));var a=new e.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(a)},r.prototype.createAnswer=function(){var i=this;if(i._isClosed)return Promise.reject(hN("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==i.signalingState&&"have-local-pranswer"!==i.signalingState)return Promise.reject(hN("InvalidStateError","Can not call createAnswer in signalingState "+i.signalingState));var n=AN.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.usingBundle&&(n+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),n+="a=ice-options:trickle\r\n";var r=AN.getMediaSections(i._remoteDescription.sdp).length;i.transceivers.forEach((function(e,o){if(!(o+1>r)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?n+="m=application 0 DTLS/SCTP 5000\r\n":n+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?n+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(n+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(n+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var s;e.stream&&("audio"===e.kind?s=e.stream.getAudioTracks()[0]:"video"===e.kind&&(s=e.stream.getVideoTracks()[0]),s&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var a=uN(e.localCapabilities,e.remoteCapabilities);!a.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,n+=dN(e,a,"answer",e.stream,i._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(n+="a=rtcp-rsize\r\n")}}));var o=new e.RTCSessionDescription({type:"answer",sdp:n});return Promise.resolve(o)},r.prototype.addIceCandidate=function(e){var t,i=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(n,r){if(!i._remoteDescription)return r(hN("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var o=e.sdpMLineIndex;if(e.sdpMid)for(var s=0;s<i.transceivers.length;s++)if(i.transceivers[s].mid===e.sdpMid){o=s;break}var a=i.transceivers[o];if(!a)return r(hN("OperationError","Can not add ICE candidate"));if(a.rejected)return n();var c=Object.keys(e.candidate).length>0?AN.parseCandidate(e.candidate):{};if("tcp"===c.protocol&&(0===c.port||9===c.port))return n();if(c.component&&1!==c.component)return n();if((0===o||o>0&&a.iceTransport!==i.transceivers[0].iceTransport)&&!lN(a.iceTransport,c))return r(hN("OperationError","Can not add ICE candidate"));var A=e.candidate.trim();0===A.indexOf("a=")&&(A=A.substr(2)),(t=AN.getMediaSections(i._remoteDescription.sdp))[o]+="a="+(c.type?A:"end-of-candidates")+"\r\n",i._remoteDescription.sdp=AN.getDescription(i._remoteDescription.sdp)+t.join("")}else for(var d=0;d<i.transceivers.length&&(i.transceivers[d].rejected||(i.transceivers[d].iceTransport.addRemoteCandidate({}),(t=AN.getMediaSections(i._remoteDescription.sdp))[d]+="a=end-of-candidates\r\n",i._remoteDescription.sdp=AN.getDescription(i._remoteDescription.sdp)+t.join(""),!i.usingBundle));d++);n()}))},r.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var i=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?i=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(i=e.rtpReceiver)})),!i)throw hN("InvalidAccessError","Invalid selector.");return i.getStats()}var n=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&n.push(e[t].getStats())}))})),Promise.all(n).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var i=e[t];if(i&&i.prototype&&i.prototype.getStats){var n=i.prototype.getStats;i.prototype.getStats=function(){return n.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(i){var n;e[i].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(n=e[i]).type]||n.type,t.set(i,e[i])})),t}))}}}));var o=["createOffer","createAnswer"];return o.forEach((function(e){var t=r.prototype[e];r.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(o=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=r.prototype[e];r.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=r.prototype[e];r.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),r}(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((e=>{if(e&&(e.urls||e.url)){let t=e.urls||e.url;e.url&&!e.urls&&mp("RTCIceServer.url","RTCIceServer.urls");const n="string"==typeof t;return n&&(t=[t]),t=t.filter((e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!i?(i=!0,!0):t&&!i})),delete e.url,e.urls=n?t[0]:t,!!t.length}}))}(e.iceServers,t.version),Tp("ICE servers after filtering:",e.iceServers)),new i(e)},e.RTCPeerConnection.prototype=i.prototype}function gN(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}var fN=Object.freeze({__proto__:null,shimPeerConnection:IN,shimReplaceTrack:gN,shimGetUserMedia:pN,shimGetDisplayMedia:_N}),RN=Fn,CN=Gn,TN=o,mN=H,SN=Q,ON=Po,vN=Ks,NN=Gt.exports;if(RN({target:"Promise",proto:!0,real:!0,forced:!!CN&&TN((function(){CN.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=ON(this,mN("Promise")),i=SN(e);return this.then(i?function(i){return vN(t,e()).then((function(){return i}))}:e,i?function(i){return vN(t,e()).then((function(){throw i}))}:e)}}),SN(CN)){var yN=mN("Promise").prototype.finally;CN.prototype.finally!==yN&&NN(CN.prototype,"finally",yN,{unsafe:!0})}function DN(e,t){const i=e&&e.navigator,n=e&&e.MediaStreamTrack;if(i.getUserMedia=function(e,t,n){mp("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),i.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in i.mediaDevices.getSupportedConstraints())){const e=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])},t=i.mediaDevices.getUserMedia.bind(i.mediaDevices);if(i.mediaDevices.getUserMedia=function(i){return"object"==typeof i&&"object"==typeof i.audio&&(i=JSON.parse(JSON.stringify(i)),e(i.audio,"autoGainControl","mozAutoGainControl"),e(i.audio,"noiseSuppression","mozNoiseSuppression")),t(i)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const i=t.apply(this,arguments);return e(i,"mozAutoGainControl","autoGainControl"),e(i,"mozNoiseSuppression","noiseSuppression"),i}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(i){return"audio"===this.kind&&"object"==typeof i&&(i=JSON.parse(JSON.stringify(i)),e(i,"autoGainControl","mozAutoGainControl"),e(i,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[i])}}}}function wN(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function bN(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const i=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!r)try{e.forEach((e=>{e.type=i[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:i[t.type]||t.type}))}))}return e})).then(r,o)}}function LN(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Mm.resolve(new Map)}}function PN(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),fp(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function kN(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){mp("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function MN(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function UN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],i=e&&"sendEncodings"in e;i&&e.sendEncodings.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(i){const{sender:t}=n,i=t.getParameters();(!("encodings"in i)||1===i.encodings.length&&0===Object.keys(i.encodings[0]).length)&&(i.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(i).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function BN(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function VN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Mm.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function QN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Mm.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var xN=Object.freeze({__proto__:null,shimOnTrack:wN,shimPeerConnection:bN,shimSenderGetStats:LN,shimReceiverGetStats:PN,shimRemoveStream:kN,shimRTCDataChannel:MN,shimAddTransceiver:UN,shimGetParameters:BN,shimCreateOffer:VN,shimCreateAnswer:QN,shimGetUserMedia:DN,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(i){if(!i||!i.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Mm.reject(e)}return!0===i.video?i.video={mediaSource:t}:i.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(i)})}});function FN(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((i=>t.call(this,i,e))),e.getVideoTracks().forEach((i=>t.call(this,i,e)))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const i=e.getTracks();this.getSenders().forEach((e=>{i.includes(e.track)&&this.removeTrack(e)}))})}}function GN(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const i=new Event("addstream");i.stream=t,e.dispatchEvent(i)}))}),t.apply(e,arguments)}}}function jN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,i=t.createOffer,n=t.createAnswer,r=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Mm.resolve()):r},t.createAnswer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],r=n.apply(this,[i]);return t?(r.then(e,t),Mm.resolve()):r};let a=function(e,t,i){const n=r.apply(this,[e]);return i?(n.then(t,i),Mm.resolve()):n};t.setLocalDescription=a,a=function(e,t,i){const n=o.apply(this,[e]);return i?(n.then(t,i),Mm.resolve()):n},t.setRemoteDescription=a,a=function(e,t,i){const n=s.apply(this,[e]);return i?(n.then(t,i),Mm.resolve()):n},t.addIceCandidate=a}function YN(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,i=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>i(HN(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,i,n){t.mediaDevices.getUserMedia(e).then(i,n)}.bind(t))}function HN(e){return e&&void 0!==e.video?Object.assign({},e,{video:vp(e.video)}):e}function KN(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,i){if(e&&e.iceServers){const t=[];for(let i=0;i<e.iceServers.length;i++){let n=e.iceServers[i];!n.hasOwnProperty("urls")&&n.hasOwnProperty("url")?(mp("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[i])}e.iceServers=t}return new t(e,i)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function WN(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function JN(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const i=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":"recvonly"===i.direction&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):!0!==e.offerToReceiveVideo||i||this.addTransceiver("video")}return t.apply(this,arguments)}}function qN(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var XN=Object.freeze({__proto__:null,shimLocalStreamsAPI:FN,shimRemoteStreamsAPI:GN,shimCallbacksAPI:jN,shimGetUserMedia:YN,shimConstraints:HN,shimRTCIceServerUrls:KN,shimTrackEventTransceiver:WN,shimCreateOfferLegacy:JN,shimAudioContext:qN}),zN=cA,ZN=qI,$N=Dc("".replace),ey="[\t\n\v\f\r                 \u2028\u2029\ufeff]",ty=RegExp("^"+ey+ey+"*"),iy=RegExp(ey+ey+"*$"),ny=function(e){return function(t){var i=ZN(zN(t));return 1&e&&(i=$N(i,ty,"")),2&e&&(i=$N(i,iy,"")),i}},ry={start:ny(1),end:ny(2),trim:ny(3)},oy=$g.PROPER,sy=Tc,ay="\t\n\v\f\r                 \u2028\u2029\ufeff",cy=ry.trim;Bu({target:"String",proto:!0,forced:function(e){return sy((function(){return!!ay[e]()||"​…᠎"!=="​…᠎"[e]()||oy&&ay[e].name!==e}))}("trim")},{trim:function(){return cy(this)}});var Ay=rE("String").trim,dy=wc,uy=Ay,Ey=String.prototype,ly=function(e){var t=e.trim;return"string"==typeof e||e===Ey||dy(Ey,e)&&t===Ey.trim?uy:t},hy=d;Fn({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return hy(URL.prototype.toString,this)}});var py={exports:{}};!function(e){var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return ly(e).call(e).split("\n").map((function(e){return ly(e).call(e)}))},t.splitSections=function(e){return e.split("\nm=").map((function(e,t){var i;return ly(i=t>0?"m="+e:e).call(i)+"\r\n"}))},t.getDescription=function(e){var i=t.splitSections(e);return i&&i[0]},t.getMediaSections=function(e){var i=t.splitSections(e);return i.shift(),i},t.matchPrefix=function(e,i){return t.splitLines(e).filter((function(e){return 0===e.indexOf(i)}))},t.parseCandidate=function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":i.relatedAddress=t[n+1];break;case"rport":i.relatedPort=parseInt(t[n+1],10);break;case"tcptype":i.tcpType=t[n+1];break;case"ufrag":i.ufrag=t[n+1],i.usernameFragment=t[n+1];break;default:i[t[n]]=t[n+1]}return i},t.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var t=e.substr(9).split(" "),i={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),i.name=t[0],i.clockRate=parseInt(t[1],10),i.channels=3===t.length?parseInt(t[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var i=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==i?"/"+i:"")+"\r\n"},t.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){for(var t,i={},n=e.substr(e.indexOf(" ")+1).split(";"),r=0;r<n.length;r++){var o,s;t=ly(o=n[r]).call(o).split("="),i[ly(s=t[0]).call(s)]=t[1]}return i},t.writeFmtp=function(e){var t="",i=e.payloadType;if(void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+i+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){var t="",i=e.payloadType;return void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+i+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){var t=e.indexOf(" "),i={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(i.attribute=e.substr(t+1,n-t-1),i.value=e.substr(n+1)):i.attribute=e.substr(t+1),i},t.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},t.getMid=function(e){var i=t.matchPrefix(e,"a=mid:")[0];if(i)return i.substr(6)},t.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},t.getDtlsParameters=function(e,i){return{role:"auto",fingerprints:t.matchPrefix(e+i,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){var i="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),i},t.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,i){return t.matchPrefix(e+i,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,i){var n=t.matchPrefix(e+i,"a=ice-ufrag:")[0],r=t.matchPrefix(e+i,"a=ice-pwd:")[0];return n&&r?{usernameFragment:n.substr(12),password:r.substr(10)}:null},t.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},t.parseRtpParameters=function(e){for(var i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=t.parseRtpMap(s),c=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?t.parseFmtp(c[0]):{},a.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),i.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":i.fecMechanisms.push(a.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((function(e){i.headerExtensions.push(t.parseExtmap(e))})),i},t.writeRtpDescription=function(e,i){var n="";n+="m="+e+" ",n+=i.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=i.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.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",i.codecs.forEach((function(e){n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));var r=0;return i.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(n+="a=maxptime:"+r+"\r\n"),n+="a=rtcp-mux\r\n",i.headerExtensions&&i.headerExtensions.forEach((function(e){n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){var i,n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),s=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,A=t.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));A.length>0&&A[0].length>1&&A[0][0]===c&&(i=A[0][1]),r.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var t={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&i&&(t.rtx={ssrc:i}),n.push(t),o&&((t=JSON.parse(JSON.stringify(t))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&c&&n.push({ssrc:c});var d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){var i={},n=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(i.cname=n.value,i.ssrc=n.ssrc);var r=t.matchPrefix(e,"a=rtcp-rsize");i.reducedSize=r.length>0,i.compound=0===r.length;var o=t.matchPrefix(e,"a=rtcp-mux");return i.mux=o.length>0,i},t.parseMsid=function(e){var i,n=t.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(i=n[0].substr(7).split(" "))[0],track:i[1]};var r=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(i=r[0].value.split(" "))[0],track:i[1]}:void 0},t.parseSctpDescription=function(e){var i,n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");r.length>0&&(i=parseInt(r[0].substr(19),10)),isNaN(i)&&(i=65536);var o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:i};if(t.matchPrefix(e,"a=sctpmap:").length>0){var s=t.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){var i=[];return i="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&i.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),i.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,i,n){var r=void 0!==i?i:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||t.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.writeMediaSection=function(e,i,n,r){var o=t.writeRtpDescription(e.kind,i);if(o+=t.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=t.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+"\r\n"),o},t.getDirection=function(e,i){for(var n=t.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return i?t.getDirection(i):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){var i=t.splitLines(e)[0].substr(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},t.parseOLine=function(e){var i=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var i=t.splitLines(e),n=0;n<i.length;n++)if(i[n].length<2||"="!==i[n].charAt(1))return!1;return!0},e.exports=t}(py);var _y=py.exports;function Iy(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const i=new t(e),n=_y.parseCandidate(e.candidate),r=Object.assign(i,n);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,fp(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function gy(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const i=function(e){if(!e||!e.sdp)return!1;const t=_y.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=_y.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const i=parseInt(t[1],10);return i!=i?-1:i},r=function(e){let i=65536;return"firefox"===t.browser&&(i=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),i},o=function(e,i){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const r=_y.matchPrefix(e.sdp,"a=max-message-size:");return r.length>0?n=parseInt(r[0].substr(19),10):"firefox"===t.browser&&-1!==i&&(n=2147483637),n},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(i(arguments[0])){const e=n(arguments[0]),t=r(e),i=o(arguments[0],e);let s;s=0===t&&0===i?Number.POSITIVE_INFINITY:0===t||0===i?Math.max(t,i):Math.min(t,i);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function fy(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const i=e.send;e.send=function(){const n=arguments[0],r=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&r>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return i.apply(e,arguments)}}const i=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=i.apply(this,arguments);return t(e,this),e},fp(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ry(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const i=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const i=new Event("connectionstatechange",e);t.dispatchEvent(i)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),i.apply(this,arguments)}}))}function Cy(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const i=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const i=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==ly(e).call(e))).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:i}):t.sdp=i}return i.apply(this,arguments)}}function Ty(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const i=e.RTCPeerConnection.prototype.addIceCandidate;i&&0!==i.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Mm.resolve():i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Mm.resolve())})}var my=Object.freeze({__proto__:null,shimRTCIceCandidate:Iy,shimMaxMessageSize:gy,shimSendThrowTypeError:fy,shimConnectionState:Ry,removeExtmapAllowMixed:Cy,shimAddIceCandidateNullOrEmpty:Ty});let Sy,Oy;!function(){let{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};const i=Tp,n=Sp(e),r={browserDetails:n,commonShim:my,extractVersion:gp,disableLog:Rp,disableWarnings:Cp};switch(n.browser){case"chrome":if(!aN||!oN||!t.shimChrome)return i("Chrome shim is not included in this adapter release."),r;if(null===n.version)return i("Chrome shim can not determine version, not shimming."),r;i("adapter.js shimming chrome."),r.browserShim=aN,Ty(e,n),zv(e,n),Zv(e),oN(e,n),$v(e),rN(e,n),eN(e),tN(e),iN(e),sN(e,n),Iy(e),Ry(e),gy(e,n),fy(e),Cy(e,n);break;case"firefox":if(!xN||!bN||!t.shimFirefox)return i("Firefox shim is not included in this adapter release."),r;i("adapter.js shimming firefox."),r.browserShim=xN,Ty(e,n),DN(e,n),bN(e,n),wN(e),kN(e),LN(e),PN(e),MN(e),UN(e),BN(e),VN(e),QN(e),Iy(e),Ry(e),gy(e,n),fy(e);break;case"edge":if(!fN||!IN||!t.shimEdge)return i("MS edge shim is not included in this adapter release."),r;i("adapter.js shimming edge."),r.browserShim=fN,pN(e),_N(e),IN(e,n),gN(e),gy(e,n),fy(e);break;case"safari":if(!XN||!t.shimSafari)return i("Safari shim is not included in this adapter release."),r;i("adapter.js shimming safari."),r.browserShim=XN,Ty(e,n),KN(e),JN(e),jN(e),FN(e),GN(e),WN(e),YN(e),qN(e),Iy(e),gy(e,n),fy(e),Cy(e,n);break;default:i("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window}),function(e){e.WIN_10="Windows 10",e.WIN_81="Windows 8.1",e.WIN_8="Windows 8",e.WIN_7="Windows 7",e.WIN_VISTA="Windows Vista",e.WIN_SERVER_2003="Windows Server 2003",e.WIN_XP="Windows XP",e.WIN_2000="Windows 2000",e.ANDROID="Android",e.OPEN_BSD="Open BSD",e.SUN_OS="Sun OS",e.LINUX="Linux",e.IOS="iOS",e.MAC_OS="Mac OS",e.QNX="QNX",e.UNIX="UNIX",e.BEOS="BeOS",e.OS_2="OS/2",e.SEARCH_BOT="Search Bot"}(Sy||(Sy={})),function(e){e.CHROME="Chrome",e.SAFARI="Safari",e.EDGE="Edge",e.FIREFOX="Firefox",e.OPERA="OPR",e.QQ="QQBrowser",e.WECHAT="MicroMessenger"}(Oy||(Oy={}));var vy={exports:{}};!function(t,i){!function(e,n){var r="function",o="object",s="string",a="model",c="name",A="type",d="vendor",u="version",E="architecture",l="console",h="mobile",p="tablet",_="smarttv",I="wearable",g="embedded",f={extend:function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i},has:function(e,t){return typeof e===s&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n},trim:function(e,t){return e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),void 0===t?e:e.substring(0,255)}},R={rgx:function(e,t){for(var i,s,a,c,A,d,u=0;u<t.length&&!A;){var E=t[u],l=t[u+1];for(i=s=0;i<E.length&&!A;)if(A=E[i++].exec(e))for(a=0;a<l.length;a++)d=A[++s],typeof(c=l[a])===o&&c.length>0?2==c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:3==c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=d?d.replace(c[1],c[2]):n:this[c[0]]=d?c[1].call(this,d,c[2]):n:4==c.length&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):n):this[c]=d||n;u+=2}},str:function(e,t){for(var i in t)if(typeof t[i]===o&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(f.has(t[i][r],e))return"?"===i?n:i}else if(f.has(t[i],e))return"?"===i?n:i;return e}},C={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},T={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[u,[c,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[c,u],[/opios[\/\s]+([\w\.]+)/i],[u,[c,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[u,[c,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,u],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[u,[c,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[u,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[u,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[c,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[u,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[u,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],u],[/focus\/([\w\.]+)/i],[u,[c,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[u,[c,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[u,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[c,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[u,[c,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[u,[c,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[c,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],u],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],u],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[c,u],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[c],[/;fbav\/([\w\.]+);/i],[u,[c,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[c,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[c,u],[/\bgsa\/([\w\.]+)\s.*safari\//i],[u,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[u,[c,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],u],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[u,[c,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[c,u],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[u,[c,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[u,c],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[c,[u,R.str,C.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[c,u],[/(navigator|netscape)\/([\w\.-]+)/i],[[c,"Netscape"],u],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[u,[c,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[c,u]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,f.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[E,/ower/,"",f.lowerize]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,f.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[a,[d,"Samsung"],[A,p]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[a,[d,"Samsung"],[A,h]],[/\((ip(?:hone|od)[\s\w]*);/i],[a,[d,"Apple"],[A,h]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[d,"Apple"],[A,p]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[a,[d,"Huawei"],[A,p]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[a,[d,"Huawei"],[A,h]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[a,/_/g," "],[d,"Xiaomi"],[A,h]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[a,/_/g," "],[d,"Xiaomi"],[A,p]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[a,[d,"OPPO"],[A,h]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[a,[d,"Vivo"],[A,h]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[a,[d,"Realme"],[A,h]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[a,[d,"Motorola"],[A,h]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[d,"Motorola"],[A,p]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[a,[d,"LG"],[A,p]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[a,[d,"LG"],[A,h]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[a,[d,"Lenovo"],[A,p]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[a,/_/g," "],[d,"Nokia"],[A,h]],[/droid.+;\s(pixel\sc)[\s)]/i],[a,[d,"Google"],[A,p]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[a,[d,"Google"],[A,h]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[d,"Sony"],[A,h]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[a,"Xperia Tablet"],[d,"Sony"],[A,p]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[a,[d,"OnePlus"],[A,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[a,[d,"Amazon"],[A,p]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[a,"Fire Phone"],[d,"Amazon"],[A,h]],[/\((playbook);[\w\s\),;-]+(rim)/i],[a,d,[A,p]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[a,[d,"BlackBerry"],[A,h]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[a,[d,"ASUS"],[A,p]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[a,[d,"ASUS"],[A,h]],[/(nexus\s9)/i],[a,[d,"HTC"],[A,p]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[d,[a,/_/g," "],[A,h]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[a,[d,"Acer"],[A,p]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[a,[d,"Meizu"],[A,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[d,a,[A,h]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[d,a,[A,p]],[/\s(surface\sduo)\s/i],[a,[d,"Microsoft"],[A,p]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[a,[d,"Fairphone"],[A,h]],[/\s(u304aa)\sbuild/i],[a,[d,"AT&T"],[A,h]],[/sie-(\w*)/i],[a,[d,"Siemens"],[A,h]],[/[;\/]\s?(rct\w+)\sbuild/i],[a,[d,"RCA"],[A,p]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[a,[d,"Dell"],[A,p]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[a,[d,"Verizon"],[A,p]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[a,[d,"Barnes & Noble"],[A,p]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[a,[d,"NuVision"],[A,p]],[/;\s(k88)\sbuild/i],[a,[d,"ZTE"],[A,p]],[/;\s(nx\d{3}j)\sbuild/i],[a,[d,"ZTE"],[A,h]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[a,[d,"Swiss"],[A,h]],[/[;\/]\s?(zur\d{3})\sbuild/i],[a,[d,"Swiss"],[A,p]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[a,[d,"Zeki"],[A,p]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[d,"Dragon Touch"],a,[A,p]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[a,[d,"Insignia"],[A,p]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[a,[d,"NextBook"],[A,p]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[d,"Voice"],a,[A,h]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[d,"LvTel"],a,[A,h]],[/;\s(ph-1)\s/i],[a,[d,"Essential"],[A,h]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[a,[d,"Envizen"],[A,p]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[a,[d,"MachSpeed"],[A,p]],[/[;\/]\s?tu_(1491)\sbuild/i],[a,[d,"Rotor"],[A,p]],[/(shield[\w\s]+)\sbuild/i],[a,[d,"Nvidia"],[A,p]],[/(sprint)\s(\w+)/i],[d,a,[A,h]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[d,"Microsoft"],[A,h]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[d,"Zebra"],[A,p]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[d,"Zebra"],[A,h]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[d,a,[A,l]],[/droid.+;\s(shield)\sbuild/i],[a,[d,"Nvidia"],[A,l]],[/(playstation\s[345portablevi]+)/i],[a,[d,"Sony"],[A,l]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[a,[d,"Microsoft"],[A,l]],[/smart-tv.+(samsung)/i],[d,[A,_]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[d,"Samsung"],[A,_]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[d,"LG"],[A,_]],[/(apple)\s?tv/i],[d,[a,"Apple TV"],[A,_]],[/crkey/i],[[a,"Chromecast"],[d,"Google"],[A,_]],[/droid.+aft([\w])(\sbuild\/|\))/i],[a,[d,"Amazon"],[A,_]],[/\(dtv[\);].+(aquos)/i],[a,[d,"Sharp"],[A,_]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[d,f.trim],[a,f.trim],[A,_]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[A,_]],[/((pebble))app\/[\d\.]+\s/i],[d,a,[A,I]],[/droid.+;\s(glass)\s\d/i],[a,[d,"Google"],[A,I]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[a,[d,"Zebra"],[A,I]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[d,[A,g]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[a,[A,h]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[a,[A,p]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[A,f.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[d,"Generic"]],[/(phone)/i],[[A,h]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[u,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[c,u],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,c]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[c,u],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[c,[u,R.str,C.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[c,"Windows"],[u,R.str,C.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[c,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[c,"Mac OS"],[u,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[c,u],[/\(bb(10);/i],[u,[c,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[u,[c,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[c,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[u,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[u,[c,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[c,"Chromium OS"],u],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[c,u],[/(sunos)\s?([\w\.\d]*)/i],[[c,"Solaris"],u],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[c,u]]},m=function(t,i){if("object"==typeof t&&(i=t,t=n),!(this instanceof m))return new m(t,i).getResult();var r=t||(void 0!==e&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),o=i?f.extend(T,i):T;return this.getBrowser=function(){var e={name:n,version:n};return R.rgx.call(e,r,o.browser),e.major=f.major(e.version),e},this.getCPU=function(){var e={architecture:n};return R.rgx.call(e,r,o.cpu),e},this.getDevice=function(){var e={vendor:n,model:n,type:n};return R.rgx.call(e,r,o.device),e},this.getEngine=function(){var e={name:n,version:n};return R.rgx.call(e,r,o.engine),e},this.getOS=function(){var e={name:n,version:n};return R.rgx.call(e,r,o.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===s&&e.length>255?f.trim(e,255):e,this},this.setUA(r),this};m.VERSION="0.7.28",m.BROWSER={NAME:c,MAJOR:"major",VERSION:u},m.CPU={ARCHITECTURE:E},m.DEVICE={MODEL:a,VENDOR:d,TYPE:A,CONSOLE:l,MOBILE:h,SMARTTV:_,TABLET:p,WEARABLE:I,EMBEDDED:g},m.ENGINE={NAME:c,VERSION:u},m.OS={NAME:c,VERSION:u},t.exports&&(i=t.exports=m),i.UAParser=m;var S=void 0!==e&&(e.jQuery||e.Zepto);if(S&&!S.ua){var O=new m;S.ua=O.getResult(),S.ua.get=function(){return O.getUA()},S.ua.set=function(e){O.setUA(e);var t=O.getResult();for(var i in t)S.ua[i]=t[i]}}}("object"==typeof window?window:e)}(vy,vy.exports);const Ny=new(0,vy.exports);let yy=Ny.getResult();function Dy(e){return e&&Ny.setUA(e),yy=Ny.getResult(),{name:wy(yy),version:by(yy),os:Ly(yy),osVersion:yy.os.version}}function wy(e){if("Blink"===e.engine.name&&"WeChat"!==e.browser.name)return Oy.CHROME;switch(e.browser.name){case"Chrome Headless":case"Chrome":case"Chromium":return Oy.CHROME;case"Safari":case"Mobile Safari":return Oy.SAFARI;case"Edge":return Oy.EDGE;case"Firefox":return Oy.FIREFOX;case"QQBrowser":return Oy.QQ;case"Opera":return Oy.OPERA;case"WeChat":return Oy.WECHAT;default:return e.browser.name||""}}function by(e){let t;return t="Blink"===e.engine.name?e.engine.version||"":e.browser.version||"",t.split(".")[0]}function Ly(e){return"Windows"===e.os.name?e.os.version?e.os.name+" "+e.os.version:e.os.name:e.os.name||""}function Py(){return Dy().os}function ky(){const e=Dy();return!!("WebKit"===yy.engine.name&&e.os===Sy.MAC_OS&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0&&e.name!==Oy.SAFARI||Vy()&&e.name!==Oy.SAFARI)}function My(){return Dy().name===Oy.CHROME}function Uy(){return Dy().name===Oy.SAFARI}function By(){return Dy().name===Oy.FIREFOX}function Vy(){return Dy().os===Sy.IOS}function Qy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])}function xy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])&&0===Number(t[1])}function Fy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])&&Number(t[1])>=1}function Gy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])&&Number(t[1])>=2}function jy(){return Uy()&&navigator.maxTouchPoints>0}function Yy(){return Dy().name===Oy.WECHAT}function Hy(){return window.navigator.appVersion&&null!==window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)[1]<=35}function Ky(){const e=Dy();return e.name!==Oy.EDGE&&e.name!==Oy.SAFARI&&!!navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]./i)}function Wy(){return Dy().os===Sy.ANDROID}var Jy={exports:{}},qy=Bu,Xy=xc,zy=cu.f;qy({target:"Object",stat:!0,forced:Object.defineProperty!==zy,sham:!Xy},{defineProperty:zy});var Zy=hA.Object,$y=Jy.exports=function(e,t,i){return Zy.defineProperty(e,t,i)};Zy.defineProperty.sham&&($y.sham=!0);var eD=Jy.exports;function tD(e,t,i){return t in e?eD(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var iD={exports:{}},nD=function(e,t){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(t,i)}},rD=nD,oD=Object.prototype.toString;function sD(e){return"[object Array]"===oD.call(e)}function aD(e){return null!==e&&"object"==typeof e}function cD(e){return"[object Function]"===oD.call(e)}function AD(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),sD(e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}var dD={isArray:sD,isArrayBuffer:function(e){return"[object ArrayBuffer]"===oD.call(e)},isBuffer:function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:aD,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===oD.call(e)},isFile:function(e){return"[object File]"===oD.call(e)},isBlob:function(e){return"[object Blob]"===oD.call(e)},isFunction:cD,isStream:function(e){return aD(e)&&cD(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:AD,merge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]=i}for(var n=0,r=arguments.length;n<r;n++)AD(arguments[n],i);return t},deepMerge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]="object"==typeof i?e({},i):i}for(var n=0,r=arguments.length;n<r;n++)AD(arguments[n],i);return t},extend:function(e,t,i){return AD(t,(function(t,n){e[n]=i&&"function"==typeof t?rD(t,i):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}},uD=dD;function ED(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var lD=function(e,t,i){if(!t)return e;var n;if(i)n=i(t);else if(uD.isURLSearchParams(t))n=t.toString();else{var r=[];uD.forEach(t,(function(e,t){null!=e&&(uD.isArray(e)?t+="[]":e=[e],uD.forEach(e,(function(e){uD.isDate(e)?e=e.toISOString():uD.isObject(e)&&(e=JSON.stringify(e)),r.push(ED(t)+"="+ED(e))})))})),n=r.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},hD=dD;function pD(){this.handlers=[]}pD.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},pD.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},pD.prototype.forEach=function(e){hD.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var _D=pD,ID=dD,gD=function(e){return!(!e||!e.__CANCEL__)},fD=dD,RD=function(e,t,i,n,r){return function(e,t,i,n,r){return e.config=t,i&&(e.code=i),e.request=n,e.response=r,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,i,n,r)},CD=RD,TD=dD,mD=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],SD=dD,OD=SD.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function n(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=n(window.location.href),function(t){var i=SD.isString(t)?n(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0},vD=dD,ND=vD.isStandardBrowserEnv()?{write:function(e,t,i,n,r,o){var s=[];s.push(e+"="+encodeURIComponent(t)),vD.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),vD.isString(n)&&s.push("path="+n),vD.isString(r)&&s.push("domain="+r),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},yD=dD,DD=lD,wD=OD,bD=RD,LD=dD,PD=function(e,t){fD.forEach(e,(function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])}))},kD={"Content-Type":"application/x-www-form-urlencoded"};function MD(e,t){!LD.isUndefined(e)&&LD.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var UD,BD={adapter:(("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)||"undefined"!=typeof XMLHttpRequest)&&(UD=function(e){return new Promise((function(t,i){var n=e.data,r=e.headers;yD.isFormData(n)&&delete r["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",a=e.auth.password||"";r.Authorization="Basic "+btoa(s+":"+a)}if(o.open(e.method.toUpperCase(),DD(e.url,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in o?function(e){var t,i,n,r={};return e?(TD.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=TD.trim(e.substr(0,n)).toLowerCase(),i=TD.trim(e.substr(n+1)),t){if(r[t]&&mD.indexOf(t)>=0)return;r[t]="set-cookie"===t?(r[t]?r[t]:[]).concat([i]):r[t]?r[t]+", "+i:i}})),r):r}(o.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:n,config:e,request:o};(function(e,t,i){var n=i.config.validateStatus;!n||n(i.status)?e(i):t(CD("Request failed with status code "+i.status,i.config,null,i.request,i))})(t,i,r),o=null}},o.onabort=function(){o&&(i(bD("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){i(bD("Network Error",e,null,o)),o=null},o.ontimeout=function(){i(bD("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",o)),o=null},yD.isStandardBrowserEnv()){var c=ND,A=(e.withCredentials||wD(e.url))&&e.xsrfCookieName?c.read(e.xsrfCookieName):void 0;A&&(r[e.xsrfHeaderName]=A)}if("setRequestHeader"in o&&yD.forEach(r,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete r[t]:o.setRequestHeader(t,e)})),e.withCredentials&&(o.withCredentials=!0),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){o&&(o.abort(),i(e),o=null)})),void 0===n&&(n=null),o.send(n)}))}),UD),transformRequest:[function(e,t){return PD(t,"Accept"),PD(t,"Content-Type"),LD.isFormData(e)||LD.isArrayBuffer(e)||LD.isBuffer(e)||LD.isStream(e)||LD.isFile(e)||LD.isBlob(e)?e:LD.isArrayBufferView(e)?e.buffer:LD.isURLSearchParams(e)?(MD(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):LD.isObject(e)?(MD(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};LD.forEach(["delete","get","head"],(function(e){BD.headers[e]={}})),LD.forEach(["post","put","patch"],(function(e){BD.headers[e]=LD.merge(kD)}));var VD=BD,QD=dD,xD=function(e,t,i){return ID.forEach(i,(function(i){e=i(e,t)})),e},FD=gD,GD=VD;function jD(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var YD=dD,HD=function(e,t){t=t||{};var i={};return YD.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(i[e]=t[e])})),YD.forEach(["headers","auth","proxy"],(function(n){YD.isObject(t[n])?i[n]=YD.deepMerge(e[n],t[n]):void 0!==t[n]?i[n]=t[n]:YD.isObject(e[n])?i[n]=YD.deepMerge(e[n]):void 0!==e[n]&&(i[n]=e[n])})),YD.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==t[n]?i[n]=t[n]:void 0!==e[n]&&(i[n]=e[n])})),i},KD=dD,WD=lD,JD=_D,qD=function(e){return jD(e),e.baseURL&&!function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}(e.url)&&(e.url=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e.baseURL,e.url)),e.headers=e.headers||{},e.data=xD(e.data,e.headers,e.transformRequest),e.headers=QD.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),QD.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||GD.adapter)(e).then((function(t){return jD(e),t.data=xD(t.data,t.headers,e.transformResponse),t}),(function(t){return FD(t)||(jD(e),t&&t.response&&(t.response.data=xD(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},XD=HD;function zD(e){this.defaults=e,this.interceptors={request:new JD,response:new JD}}zD.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=XD(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[qD,void 0],i=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)i=i.then(t.shift(),t.shift());return i},zD.prototype.getUri=function(e){return e=XD(this.defaults,e),WD(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},KD.forEach(["delete","get","head","options"],(function(e){zD.prototype[e]=function(t,i){return this.request(KD.merge(i||{},{method:e,url:t}))}})),KD.forEach(["post","put","patch"],(function(e){zD.prototype[e]=function(t,i,n){return this.request(KD.merge(n||{},{method:e,url:t,data:i}))}}));var ZD=zD;function $D(e){this.message=e}$D.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},$D.prototype.__CANCEL__=!0;var ew=$D,tw=ew;function iw(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var i=this;e((function(e){i.reason||(i.reason=new tw(e),t(i.reason))}))}iw.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},iw.source=function(){var e;return{token:new iw((function(t){e=t})),cancel:e}};var nw=iw,rw=dD,ow=nD,sw=ZD,aw=HD;function cw(e){var t=new sw(e),i=ow(sw.prototype.request,t);return rw.extend(i,sw.prototype,t),rw.extend(i,t),i}var Aw=cw(VD);Aw.Axios=sw,Aw.create=function(e){return cw(aw(Aw.defaults,e))},Aw.Cancel=ew,Aw.CancelToken=nw,Aw.isCancel=gD,Aw.all=function(e){return Promise.all(e)},Aw.spread=function(e){return function(t){return e.apply(null,t)}},iD.exports=Aw,iD.exports.default=Aw;var dw=iD.exports;class uw{constructor(e){tD(this,"logger",void 0),tD(this,"prefixLists",[]),this.logger=e}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.debug(...this.prefixLists,...t)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.info(...this.prefixLists,...t)}warning(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.warning(...this.prefixLists,...t)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.error(...this.prefixLists,...t)}prefix(e){return this.prefixLists.push(e),this}popPrefix(){return this.prefixLists.pop(),this}}class Ew{constructor(){tD(this,"_events",{}),tD(this,"addListener",this.on)}getListeners(e){return this._events[e]?this._events[e].map((e=>e.listener)):[]}on(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!1})}once(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!0})}off(e,t){if(!this._events[e])return;const i=this._events[e],n=this._indexOfListener(i,t);-1!==n&&i.splice(n,1),0===this._events[e].length&&delete this._events[e]}removeAllListeners(e){e?delete this._events[e]:this._events={}}emit(e){this._events[e]||(this._events[e]=[]);const t=this._events[e].map((e=>e));for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];for(let i=0;i<t.length;i+=1){const r=t[i];r.once&&this.off(e,r.listener),r.listener.apply(this,n||[])}}_indexOfListener(e,t){let i=e.length;for(;i--;)if(e[i].listener===t)return i;return-1}}const lw=new class extends Ew{reportLogUploadError(e){this.emit("REPORT_LOG_UPLOAD",e)}};let hw;!function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.TIMEOUT="TIMEOUT",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_READABLE="NOT_READABLE",e.NOT_SUPPORTED="NOT_SUPPORTED",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORTED="OPERATION_ABORTED",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",e.EXCHANGE_SDP_FAILED="EXCHANGE_SDP_FAILED",e.NETWORK_ERROR="NETWORK_ERROR",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",e.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",e.ELECTRON_IS_NULL="ELECTRON_IS_NULL",e.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",e.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",e.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",e.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",e.PERMISSION_DENIED="PERMISSION_DENIED",e.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",e.TRACK_IS_DISABLED="TRACK_IS_DISABLED",e.GET_VIDEO_ELEMENT_VISIBLE_ERROR="GET_VIDEO_ELEMENT_VISIBLE_ERROR",e.SHARE_AUDIO_NOT_ALLOWED="SHARE_AUDIO_NOT_ALLOWED",e.LOW_STREAM_ENCODING_ERROR="LOW_STREAM_ENCODING_ERROR",e.SET_ENCODING_PARAMETER_ERROR="SET_ENCODING_PARAMETER_ERROR",e.TRACK_STATE_UNREACHABLE="TRACK_STATE_UNREACHABLE",e.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",e.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",e.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",e.VOID_GATEWAY_ADDRESS="VOID_GATEWAY_ADDRESS",e.UID_CONFLICT="UID_CONFLICT",e.MULTI_UNILBS_RESPONSE_ERROR="MULTI_UNILBS_RESPONSE_ERROR",e.UPDATE_TICKET_FAILED="UPDATE_TICKET_FAILED",e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.INVALID_TRACK="INVALID_TRACK",e.SENDER_NOT_FOUND="SENDER_NOT_FOUND",e.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",e.SET_ANSWER_FAILED="SET_ANSWER_FAILED",e.ICE_FAILED="ICE_FAILED",e.PC_CLOSED="PC_CLOSED",e.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",e.GET_LOCAL_CAPABILITIES_FAILED="GET_LOCAL_CAPABILITIES_FAILED",e.GET_LOCAL_CONNECTION_PARAMS_FAILED="GET_LOCAL_CONNECTION_PARAMS_FAILED",e.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",e.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.NO_ICE_CANDIDATE="NO_ICE_CANDIDATE",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",e.EXIST_DISABLED_VIDEO_TRACK="EXIST_DISABLED_VIDEO_TRACK",e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.REMOTE_USER_IS_NOT_PUBLISHED="REMOTE_USER_IS_NOT_PUBLISHED",e.CUSTOM_REPORT_SEND_FAILED="CUSTOM_REPORT_SEND_FAILED",e.CUSTOM_REPORT_FREQUENCY_TOO_HIGH="CUSTOM_REPORT_FREQUENCY_TOO_HIGH",e.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",e.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",e.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",e.WS_ABORT="WS_ABORT",e.WS_DISCONNECT="WS_DISCONNECT",e.WS_ERR="WS_ERR",e.LIVE_STREAMING_TASK_CONFLICT="LIVE_STREAMING_TASK_CONFLICT",e.LIVE_STREAMING_INVALID_ARGUMENT="LIVE_STREAMING_INVALID_ARGUMENT",e.LIVE_STREAMING_INTERNAL_SERVER_ERROR="LIVE_STREAMING_INTERNAL_SERVER_ERROR",e.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED="LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED",e.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED="LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED",e.LIVE_STREAMING_CDN_ERROR="LIVE_STREAMING_CDN_ERROR",e.LIVE_STREAMING_INVALID_RAW_STREAM="LIVE_STREAMING_INVALID_RAW_STREAM",e.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT="LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT",e.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE="LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE",e.LIVE_STREAMING_WARN_FREQUENT_REQUEST="LIVE_STREAMING_WARN_FREQUENT_REQUEST",e.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",e.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE",e.METADATA_OUT_OF_RANGE="METADATA_OUT_OF_RANGE",e.LOCAL_AEC_ERROR="LOCAL_AEC_ERROR",e.INVALID_PLUGIN="INVALID_PLUGIN",e.DISCONNECT_P2P="DISCONNECT_P2P",e.INIT_WEBSOCKET_TIMEOUT="INIT_WEBSOCKET_TIMEOUT"}(hw||(hw={}));class pw extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;super(t),tD(this,"code",void 0),tD(this,"message",void 0),tD(this,"data",void 0),tD(this,"name","AgoraRTCException"),this.code=e,this.message="AgoraRTCError ".concat(this.code,": ").concat(t),this.data=i}toString(){return this.data?"data: ".concat(JSON.stringify(this.data),"\n").concat(this.stack):"".concat(this.stack)}print(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"error";return"error"===e&&mw.error(this.toString()),"warning"===e&&mw.warning(this.toString()),this}throw(){throw this.print(),this}}const _w={timeout:500,timeoutFactor:1.5,maxRetryCount:1/0,maxRetryTimeout:1e4};function Iw(e,t){const i=Math.floor(t.timeout*Math.pow(t.timeoutFactor,e));return Math.min(t.maxRetryTimeout,i)}function gw(e,t,i,n){const r=Object.assign({},_w,n);let o=r.timeout;const s=async()=>{await function(e){return new Mm((t=>{window.setTimeout(t,e)}))}(o),o*=r.timeoutFactor,o=Math.min(r.maxRetryTimeout,o)};let a=!1;const c=new Mm((async(n,o)=>{t=t||(()=>!1),i=i||(()=>!0);for(let c=0;c<r.maxRetryCount;c+=1){if(a)return o(new pw(hw.OPERATION_ABORTED));try{const i=await e();if(!t(i,c))return n(i);if(c+1===r.maxRetryCount)return n(i);await s()}catch(e){if(!i(e,c))return o(e);if(c+1===r.maxRetryCount)return o(e);await s()}}}));return c.cancel=()=>a=!0,c}function fw(){const e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()}const Rw={DEBUG:0,INFO:1,WARNING:2,ERROR:3,NONE:4},Cw=Date.now(),Tw=e=>{for(const t in Rw)if(Object.prototype.hasOwnProperty.call(Rw,t)&&Rw[t]===e)return t;return"DEFAULT"},mw=new class{constructor(){tD(this,"proxyServerURL",void 0),tD(this,"logLevel",Rw.DEBUG),tD(this,"uploadState","collecting"),tD(this,"uploadLogWaitingList",[]),tD(this,"uploadLogUploadingList",[]),tD(this,"uploadErrorCount",0),tD(this,"currentLogID",0),tD(this,"url",void 0),tD(this,"extLog",((e,t)=>{this.appendLogToWaitingList(e,t)}))}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.DEBUG].concat(t);this.log.apply(this,n)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.INFO].concat(t);this.log.apply(this,n)}warning(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.WARNING].concat(t);this.log.apply(this,n)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.ERROR].concat(t);this.log.apply(this,n)}upload(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.DEBUG].concat(t);this.uploadLog.apply(this,n)}setLogLevel(e){e=Math.min(Math.max(0,e),4),this.logLevel=e}enableLogUpload(){ab("UPLOAD_LOG",!0)}disableLogUpload(){ab("UPLOAD_LOG",!1),this.uploadLogUploadingList=[],this.uploadLogWaitingList=[]}setProxyServer(e){this.proxyServerURL=e}prefix(e){return new uw(this).prefix(e)}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(Date.now()-Cw<100)return void setTimeout((()=>{this.log(...t)}),Date.now()-Cw);const n=Math.max(0,Math.min(4,t[0]));if(t[0]=fw()+" Agora-SDK [".concat(Tw(n),"]:"),this.appendLogToWaitingList(n,t),n<this.logLevel)return;const r=fw()+" %cAgora-SDK [".concat(Tw(n),"]:");let o=[];if(!cb("USE_NEW_LOG"))switch(n){case Rw.DEBUG:o=[r,"color: #64B5F6;"].concat(t.slice(1)),console.log.apply(console,o);break;case Rw.INFO:o=[r,"color: #1E88E5; font-weight: bold;"].concat(t.slice(1)),console.log.apply(console,o);break;case Rw.WARNING:o=[r,"color: #FB8C00; font-weight: bold;"].concat(t.slice(1)),console.warn.apply(console,o);break;case Rw.ERROR:o=[r,"color: #B00020; font-weight: bold;"].concat(t.slice(1)),console.error.apply(console,o)}}uploadLog(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(Date.now()-Cw<100)return void setTimeout((()=>{this.uploadLog(...t)}),Date.now()-Cw);const n=Math.max(0,Math.min(4,t[0]));t[0]=fw()+" Agora-SDK [".concat(Tw(n),"]:"),this.appendLogToWaitingList(n,t)}appendLogToWaitingList(e){if(!cb("UPLOAD_LOG"))return;let t="";for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];n.forEach((e=>{"object"==typeof e&&(e=JSON.stringify(e)),t+="".concat(e," ")})),this.uploadLogWaitingList.push({payload_str:t,log_level:e,log_item_id:this.currentLogID++}),"uploading"===this.uploadState&&0===this.uploadLogUploadingList.length&&this.uploadLogInterval()}startUpload(){this.uploadState="uploading",0===this.uploadLogUploadingList.length&&this.uploadLogInterval()}async uploadLogs(){const e=this.uploadLogUploadingList,t={sdk_version:Xw,process_id:cb("PROCESS_ID"),payload:JSON.stringify(e)};return gw((async()=>{const e=await dw.post(this.url||(this.proxyServerURL?"https://".concat(this.proxyServerURL,"/ls/?h=").concat(cb("LOG_UPLOAD_SERVER"),"&p=443&d=upload/v1"):"https://".concat(cb("LOG_UPLOAD_SERVER"),"/upload/v1")),t,{responseType:"text"});if("OK"!==e.data){const t=new Error("unexpected upload log response");throw t.response=e,t}}),(()=>(this.uploadLogUploadingList=[],!1)),(e=>(e.response?lw.reportLogUploadError({status:e.response.status,data:e.response.data,headers:e.response.headers,message:e.message}):e.request?lw.reportLogUploadError({status:e.request.status,message:e.message}):lw.reportLogUploadError({status:-1,message:e.message}),!0)),{timeout:2e3,maxRetryTimeout:2e4})}uploadLogInterval(){0===this.uploadLogUploadingList.length&&0===this.uploadLogWaitingList.length||(0===this.uploadLogUploadingList.length&&(this.uploadLogUploadingList=this.uploadLogWaitingList.splice(0,10)),this.uploadLogs().then((()=>{this.uploadErrorCount=0,this.uploadLogWaitingList.length>0&&window.setTimeout((()=>this.uploadLogInterval()),3e3)})).catch((e=>{this.uploadErrorCount+=1,this.uploadErrorCount<2?window.setTimeout((()=>this.uploadLogInterval()),200):window.setTimeout((()=>this.uploadLogInterval()),1e3)})))}},Sw={debug:console.log,info:console.log,warning:console.warn,error:console.error},Ow={debug:"color: #64B5F6;",info:"color: #1E88E5; font-weight: bold;",warning:"color: #FB8C00; font-weight: bold;",error:"color: #B00020; font-weight: bold;"},vw={debug:0,info:1,warning:2,error:3},Nw=[];let yw,Dw=0,ww=0,bw=!1;function Lw(){const e=new Date;return[e.getTime(),e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()]}function Pw(e){if(!cb("UPLOAD_LOG"))return;let t;switch(e.type){case TL.MISC:t=[e.timestamp,e.level,e.type,e.module,e.instanceId,[e.msg]];break;case TL.INTERNAL_EVENT:case TL.PUBLIC_EVENT:case TL.WEB_EVENT:t=[e.timestamp,e.level,e.type,e.module,e.instanceId,[e.event,e.msg]];break;case TL.INTERNAL_API:case TL.PUBLIC_API:case TL.WEB_API:t=[e.timestamp,e.level,e.type,e.module,e.instanceId,[e.api,e.args,e.result]]}Nw.push(t)}function kw(e,t){const[i,n]=Lw(),r="warning",o="".concat(n," %cAgora-SDK [").concat(r,"] [INTERNAL API]:"),s={[TL.WEB_API]:"logWebAPI",[TL.PUBLIC_API]:"logPublicAPI",[TL.INTERNAL_API]:"logInternalAPI",[TL.WEB_EVENT]:"logWebEvent",[TL.PUBLIC_EVENT]:"logPublicEvent",[TL.INTERNAL_EVENT]:"logInternalEvent",[TL.MISC]:"logMisc"}[e],a=[o,Ow.warning,"Log.".concat(s),t];cb("USE_NEW_LOG")&&(Uw(r)&&Sw.warning.apply(console,a),Pw({timestamp:i,level:r,module:"Log",instanceId:void 0,type:TL.INTERNAL_API,api:s,args:void 0,result:t.toString()}))}function Mw(e){if(Array.isArray(e)){let[t,i]=e;return t||(t="Global"),{module:t,instanceId:i}}let t,i;if("string"!=typeof e.__moduleName)throw new Error("Cannot get __moduleName from log instance.");t=e.__moduleName;try{i=e.__instanceId}catch(e){throw new Error("Cannot get __instanceId from log instance.")}return{module:t,instanceId:i}}function Uw(e){return vw[e]>=ww}function Bw(e,t,i,n,r,o){if(e===TL.PUBLIC_API||e===TL.WEB_API||e===TL.INTERNAL_API)try{const{module:s,instanceId:a}=Mw(i);r=r&&JSON.stringify(r),o=o instanceof Error?o.toString():o&&JSON.stringify(o);const[c,A]=Lw(),d=["".concat(A," %cAgora-SDK [").concat(t,"] [").concat({[TL.PUBLIC_API]:"PUBLIC API",[TL.WEB_API]:"WEB API",[TL.INTERNAL_API]:"INTERNAL API"}[e],"]:"),Ow[t],"".concat(s).concat(a?"<".concat(a,">"):"",".").concat(n),r,o];cb("USE_NEW_LOG")&&(Uw(t)&&Sw[t].apply(console,d),Pw({timestamp:c,level:t,module:s,instanceId:a,type:e,api:n,args:r,result:o}))}catch(t){kw(e,t)}}function Vw(e,t,i,n,r){if(e===TL.WEB_EVENT||e===TL.INTERNAL_EVENT||e===TL.PUBLIC_EVENT)try{const{module:o,instanceId:s}=Mw(i);"string"!=typeof r&&(r=r instanceof Error?r.toString():JSON.stringify(r));const[a,c]=Lw(),A=["".concat(c," %cAgora-SDK [").concat(t,"] [").concat({[TL.WEB_EVENT]:"WEB EVENT",[TL.PUBLIC_EVENT]:"PUBLIC EVENT",[TL.INTERNAL_EVENT]:"INTERNAL EVENT"}[e],"]:"),Ow[t],"".concat(o).concat(s?"<".concat(s,">"):"",".on(").concat(n,")"),r||""];cb("USE_NEW_LOG")&&(Uw(t)&&Sw[t].apply(console,A),Pw({timestamp:a,level:t,module:o,instanceId:s,type:e,event:n,msg:r}))}catch(t){kw(e,t)}}function Qw(e){yw=e}function xw(e,t,i){try{const{module:n,instanceId:r}=Mw(t),[o,s]=Lw(),a=["".concat(s," %cAgora-SDK [").concat(e,"] [MISC]:"),Ow[e],"".concat(n).concat(r?"<".concat(r,">"):""),'"'.concat(i,'"')];cb("USE_NEW_LOG")&&(Uw(e)&&Sw[e].apply(console,a),Pw({timestamp:o,level:e,module:n,instanceId:r,type:TL.MISC,msg:i}))}catch(e){Yw("warning",["log"],"logMisc",void 0,e)}}function Fw(e,t,i,n){Vw(TL.INTERNAL_EVENT,e,t,i,n)}function Gw(e,t,i,n){Vw(TL.PUBLIC_EVENT,e,t,i,n)}function jw(e,t,i,n){Vw(TL.WEB_EVENT,e,t,i,n)}function Yw(e,t,i,n,r){Bw(TL.INTERNAL_API,e,t,i,n,r)}function Hw(e,t,i,n,r){Bw(TL.WEB_API,e,t,i,n,r)}function Kw(e,t,i,n,r){Bw(TL.PUBLIC_API,e,t,i,n,r)}function Ww(e,t){return function(i){return class extends i{get __moduleName(){return e}get __instanceId(){if(t){if("function"==typeof this[t])return this[t]();{const e=t.split(".");return e.length>0?dE(e).call(e,((e,t)=>{try{return e?e[t]:e}catch(e){return}}),this):this[t]}}}}}}async function Jw(e){if(!e&&bw)return;if(bw=!0,!cb("UPLOAD_LOG"))return void setTimeout((()=>Jw(!0)),5e3);if(0===Nw.length)return void setTimeout((()=>Jw(!0)),3e3);const t=Nw.slice(0,10),i={sdk_version:Xw,log_version:cb("LOG_VERSION"),process_id:cb("PROCESS_ID"),index:Dw,logs:JSON.stringify(t)};await gw((async()=>{const e=await dw.post(yw?"https://".concat(yw,"/ls/?h=").concat(cb("LOG_UPLOAD_SERVER"),"&p=443&d=upload/v1"):"https://".concat(cb("LOG_UPLOAD_SERVER"),"/upload/v1"),i,{responseType:"text"});if("OK"!==e.data)throw new Error("Log service response error ".concat(e.data));return e}),void 0,void 0,{timeout:3e3,maxRetryTimeout:1e4}),Nw.splice(0,10),Dw+=t.length,setTimeout((()=>Jw(!0)),3e3)}const qw="v4.11.0-0-g961abf54(3/31/2022, 5:02:17 PM)",Xw=function(e){if(e.match(/[0-9]+\.[0-9]+\.[0-9]+$/))return e;const t=e.match(/([0-9]+\.[0-9]+\.[0-9]+)\-alpha\.([0-9]+)/);if(t&&t[1]&&t[2]){const e=t[1],i=t[2];return"".concat(e,".").concat(i)}const i=e.match(/([0-9]+\.[0-9]+\.[0-9]+)\-special\.([0-9]+)/);if(i&&i[1]&&i[2]){const e=i[1],t=i[2];return"".concat(e,".").concat(100*(Number(t)+1))}return"4.0.0.999"}("4.11.0"),zw=function(){try{return!0===JSON.parse("true")}catch(e){return!0}}(),Zw={username:"test",password:"111111",turnServerURL:"",tcpport:3433,udpport:3478,forceturn:!1},$w={"90p":Eb(160,90),"90p_1":Eb(160,90),"120p":Eb(160,120,15,30,65),"120p_1":Eb(160,120,15,30,65),"120p_3":Eb(120,120,15,30,50),"120p_4":Eb(212,120),"180p":Eb(320,180,15,30,140),"180p_1":Eb(320,180,15,30,140),"180p_3":Eb(180,180,15,30,100),"180p_4":Eb(240,180,15,30,120),"240p":Eb(320,240,15,40,200),"240p_1":Eb(320,240,15,40,200),"240p_3":Eb(240,240,15,40,140),"240p_4":Eb(424,240,15,40,220),"360p":Eb(640,360,15,80,400),"360p_1":Eb(640,360,15,80,400),"360p_3":Eb(360,360,15,80,260),"360p_4":Eb(640,360,30,80,600),"360p_6":Eb(360,360,30,80,400),"360p_7":Eb(480,360,15,80,320),"360p_8":Eb(480,360,30,80,490),"360p_9":Eb(640,360,15,80,800),"360p_10":Eb(640,360,24,80,800),"360p_11":Eb(640,360,24,80,1e3),"480p":Eb(640,480,15,100,500),"480p_1":Eb(640,480,15,100,500),"480p_2":Eb(640,480,30,100,1e3),"480p_3":Eb(480,480,15,100,400),"480p_4":Eb(640,480,30,100,750),"480p_6":Eb(480,480,30,100,600),"480p_8":Eb(848,480,15,100,610),"480p_9":Eb(848,480,30,100,930),"480p_10":Eb(640,480,10,100,400),"720p":Eb(1280,720,15,120,1130),"720p_1":Eb(1280,720,15,120,1130),"720p_2":Eb(1280,720,30,120,2e3),"720p_3":Eb(1280,720,30,120,1710),"720p_5":Eb(960,720,15,120,910),"720p_6":Eb(960,720,30,120,1380),"1080p":Eb(1920,1080,15,120,2080),"1080p_1":Eb(1920,1080,15,120,2080),"1080p_2":Eb(1920,1080,30,120,3e3),"1080p_3":Eb(1920,1080,30,120,3150),"1080p_5":Eb(1920,1080,60,120,4780),"1440p":Eb(2560,1440,30,120,4850),"1440p_1":Eb(2560,1440,30,120,4850),"1440p_2":Eb(2560,1440,60,120,7350),"4k":Eb(3840,2160,30,120,8910),"4k_1":Eb(3840,2160,30,120,8910),"4k_3":Eb(3840,2160,60,120,13500)},eb={"480p":lb(640,480,5),"480p_1":lb(640,480,5),"480p_2":lb(640,480,30),"480p_3":lb(640,480,15),"720p":lb(1280,720,5),"720p_1":lb(1280,720,5),"720p_2":lb(1280,720,30),"720p_3":lb(1280,720,15),"1080p":lb(1920,1080,5),"1080p_1":lb(1920,1080,5),"1080p_2":lb(1920,1080,30),"1080p_3":lb(1920,1080,15)},tb={"1SL1TL":hb(1,1),"3SL3TL":hb(3,3),"2SL3TL":hb(2,3)};function ib(e){return"string"==typeof e?Object.assign({},$w[e]):e}function nb(e){return"string"==typeof e?Object.assign({},eb[e]):e}function rb(e){return"string"==typeof e?Object.assign({},tb[e]):e}const ob={speech_low_quality:ub(16e3,!1),speech_standard:ub(32e3,!1,18),music_standard:ub(48e3,!1),standard_stereo:ub(48e3,!0,56),high_quality:ub(48e3,!1,128),high_quality_stereo:ub(48e3,!0,192)};function sb(e){return"string"==typeof e?Object.assign({},ob[e]):e}function ab(e,t,i){Object.keys(Ab).includes(e)&&(!i&&Object.keys(db).includes(e)||(Ab[e]=t))}function cb(e){return Ab[e]}const Ab={PROCESS_ID:"",ENCRYPT_AES:!0,AREAS:["CHINA","GLOBAL"],WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io","webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io","webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-web-2.ap.sd-rtn.com","cds-ap-web-3.agora.io","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-web-2.ap.sd-rtn.com","sua-ap-web-3.agora.io","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-ap-web-1.agora.io","uap-web-2.ap.sd-rtn.com","uap-ap-web-3.agora.io","uap-web-4.ap.sd-rtn.com"],LOG_UPLOAD_SERVER:"logservice.agora.io",EVENT_REPORT_DOMAIN:"statscollector-1.agora.io",EVENT_REPORT_BACKUP_DOMAIN:"web-2.statscollector.sd-rtn.com",GATEWAY_ADDRESS:[],GATEWAY_WSS_ADDRESS:"",LIVE_STREAMING_ADDRESS:"",HTTP_CONNECT_TIMEOUT:5e3,SIGNAL_REQUEST_TIMEOUT:1e4,REPORT_STATS:!0,UPLOAD_LOG:!1,NOT_REPORT_EVENT:[],SUBSCRIBE_TCC:!0,PING_PONG_TIME_OUT:10,WEBSOCKET_TIMEOUT_MIN:1e4,EVENT_REPORT_SEND_INTERVAL:3e3,CONFIG_DISTRIBUTE_INTERVAL:3e5,CANDIDATE_TIMEOUT:5e3,SHOW_REPORT_INVOKER_LOG:!1,JOIN_EXTEND:"",PUB_EXTEND:"",SUB_EXTEND:"",FORCE_TURN:!1,TURN_ENABLE_TCP:!0,TURN_ENABLE_UDP:!0,MAX_UPLOAD_CACHE:50,UPLOAD_CACHE_INTERVAL:2e3,AJAX_REQUEST_CONCURRENT:3,REPORT_APP_SCENARIO:void 0,GATEWAY_DOMAINS:["edge.agora.io","edge.sd-rtn.com"],WORKER_DOMAIN:"edge.agora.io",TURN_DOMAIN:"edge.agora.io",EVENT_REPORT_RETRY:!0,CHROME_FORCE_PLAN_B:!1,AUDIO_SOURCE_VOLUME_UPDATE_INTERVAL:400,AUDIO_SOURCE_AVG_VOLUME_DURATION:3e3,AUDIO_VOLUME_INDICATION_INTERVAL:2e3,VOLUME_VOICE_WEIGHT:10,NORMAL_EVENT_QUEUE_CAPACITY:100,CUSTOM_REPORT:!0,CUSTOM_REPORT_LIMIT:20,PROXY_SERVER_TYPE2:"webnginx-proxy.agora.io",PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com","webrtc-cloud-proxy.agora.io"],CUSTOM_PUB_ANSWER_MODIFIER:null,CUSTOM_SUB_ANSWER_MODIFIER:null,CUSTOM_PUB_OFFER_MODIFIER:null,CUSTOM_SUB_OFFER_MODIFIER:null,DSCP_TYPE:"high",REMOVE_NEW_CODECS:!0,FRAGEMENT_LENGTH:3,WEBSOCKET_COMPRESS:!1,SIMULCAST:!1,PRELOAD_MEDIA_COUNT:0,USE_RTX:!1,CHECK_VIDEO_VISIBLE_INTERVAL:3e4,ENUMERATE_DEVICES_INTERVAL:!1,ENUMERATE_DEVICES_INTERVAL_TIME:1e4,USE_NEW_TOKEN:!1,JOIN_WITH_FALLBACK_SIGNAL_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE:!1,JOIN_WITH_FALLBACK_PROXY_PENDING_DURATION:2e3,USE_TURN_SERVER_OF_GATEWAY:!1,H264_PROFILE_LEVEL_ID:"",USE_NEW_LOG:!1,LOG_VERSION:3,MEDIA_DEVICE_CONSTRAINTS:null,ENCRYPT_PROXY_USERNAME_AND_PSW:!0,SDP_LOGGING:!1,REMOTE_AUDIO_TRACK_USES_WEB_AUDIO:!1,LOCAL_AUDIO_TRACK_USES_WEB_AUDIO:!0,BITRATE_ADAPTER_TYPE:"STANDARD_BITRATE",AI_DENOISER_PARAMETERS:{},ADJUST_3A_FROM_PLUGINS:!0,RAISE_H264_BASELINE_PRIORITY:!0,FILTER_SEND_H264_BASELINE:!1,ENABLE_PUBLISHED_USER_LIST:!0,MAX_SUBSCRIPTION:50,ACCOUNT_REGISTER_RETRY_TIMEOUT:1,ACCOUNT_REGISTER_RETRY_RATIO:2,ACCOUNT_REGISTER_RETRY_TIMEOUT_MAX:6e4,ACCOUNT_REGISTER_RETRY_COUNT_MAX:1e5,AUDIO_CONTEXT:null,WEBCS_BACKUP_CONNECT_TIMEOUT:6e3,PLAYER_STATE_DEFER:2e3,SIGNAL_REQUEST_WATCH_INTERVAL:1e3,FILEPATH_LENMAX:255,DUALSTREAM_OPERATION_CHECK:!0,MEDIA_ELEMENT_EXISTS_DEPTH:3,SHIM_CANDIDATE:!1,LEAVE_MSG_TIMEOUT:2e3,STATS_FILTER:{transportId:!0,googTrackId:!0}},db={};function ub(e,t,i){return{sampleRate:e,stereo:t,bitrate:i}}function Eb(e,t,i,n,r){return{width:e,height:t,frameRate:i,bitrateMin:n,bitrateMax:r}}function lb(e,t,i,n,r){return{width:{max:e},height:{max:t},frameRate:i,bitrateMin:n,bitrateMax:r}}function hb(e,t){return{numSpatialLayers:e,numTemporalLayers:t}}zw||(Ab.WEBCS_DOMAIN=["ap-web-1-oversea.agora.io","ap-web-1-north-america.agora.io"],Ab.WEBCS_DOMAIN_BACKUP_LIST=["ap-web-2-oversea.agora.io","ap-web-2-north-america.agora.io"],Ab.PROXY_CS=["proxy-ap-web-oversea.agora.io","proxy-ap-web-america.agora.io"],Ab.CDS_AP=["cds-ap-web-oversea.agora.io","cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],Ab.ACCOUNT_REGISTER=["sua-ap-web-oversea.agora.io","sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],Ab.UAP_AP=["uap-ap-web-oversea.agora.io","uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],Ab.LOG_UPLOAD_SERVER="logservice-oversea.agora.io",Ab.EVENT_REPORT_DOMAIN="statscollector-1-oversea.agora.io",Ab.EVENT_REPORT_BACKUP_DOMAIN="statscollector-2-oversea.agora.io",Ab.PROXY_SERVER_TYPE3="webrtc-cloud-proxy.agora.io",Ab.AREAS=["NORTH_AMERICA","OVERSEA"]);const pb=[[0,1,2,3,4,5,5],[0,2,2,3,4,5,5],[0,3,3,3,4,5,5],[0,4,4,4,4,5,5],[0,5,5,5,5,5,5]],_b=[],Ib=[];var gb=Pd,fb=cu,Rb=Xc,Cb=function(e,t,i){var n=gb(t);n in e?fb.f(e,n,Rb(0,i)):e[n]=i},Tb=$p,mb=ju,Sb=Cb,Ob=Lc.Array,vb=Math.max,Nb=function(e,t,i){for(var n=mb(e),r=Tb(t,n),o=Tb(void 0===i?n:i,n),s=Ob(vb(o-r,0)),a=0;r<o;r++,a++)Sb(s,a,e[r]);return s.length=a,s},yb=Nb,Db=Math.floor,wb=function(e,t){var i=e.length,n=Db(i/2);return i<8?bb(e,t):Lb(e,wb(yb(e,0,n),t),wb(yb(e,n),t),t)},bb=function(e,t){for(var i,n,r=e.length,o=1;o<r;){for(n=o,i=e[o];n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==o++&&(e[n]=i)}return e},Lb=function(e,t,i,n){for(var r=t.length,o=i.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?n(t[s],i[a])<=0?t[s++]:i[a++]:s<r?t[s++]:i[a++];return e},Pb=wb,kb=RA.match(/firefox\/(\d+)/i),Mb=!!kb&&+kb[1],Ub=/MSIE|Trident/.test(RA),Bb=RA.match(/AppleWebKit\/(\d+)\./),Vb=!!Bb&&+Bb[1],Qb=Bu,xb=Dc,Fb=jA,Gb=rd,jb=ju,Yb=qI,Hb=Tc,Kb=Pb,Wb=Zu,Jb=Mb,qb=Ub,Xb=NA,zb=Vb,Zb=[],$b=xb(Zb.sort),eL=xb(Zb.push),tL=Hb((function(){Zb.sort(void 0)})),iL=Hb((function(){Zb.sort(null)})),nL=Wb("sort"),rL=!Hb((function(){if(Xb)return Xb<70;if(!(Jb&&Jb>3)){if(qb)return!0;if(zb)return zb<603;var e,t,i,n,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)Zb.push({k:t+n,v:i})}for(Zb.sort((function(e,t){return t.v-e.v})),n=0;n<Zb.length;n++)t=Zb[n].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));Qb({target:"Array",proto:!0,forced:tL||!iL||!nL||!rL},{sort:function(e){void 0!==e&&Fb(e);var t=Gb(this);if(rL)return void 0===e?$b(t):$b(t,e);var i,n,r=[],o=jb(t);for(n=0;n<o;n++)n in t&&eL(r,t[n]);for(Kb(r,function(e){return function(t,i){return void 0===i?-1:void 0===t?1:void 0!==e?+e(t,i)||0:Yb(t)>Yb(i)?1:-1}}(e)),i=r.length,n=0;n<i;)t[n]=r[n++];for(;n<o;)delete t[n++];return t}});var oL=rE("Array").sort,sL=wc,aL=oL,cL=Array.prototype,AL=function(e){var t=e.sort;return e===cL||sL(cL,e)&&t===cL.sort?aL:t};function dL(e,t){if("boolean"!=typeof e)throw new pw(hw.INVALID_PARAMS,"Invalid ".concat(t,": The value is of the boolean type."))}function uL(e,t,i){if(!i.includes(e))throw new pw(hw.INVALID_PARAMS,"".concat(t," can only be set as ").concat(JSON.stringify(i)))}function EL(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e4;if(e<i||e>n||(!(arguments.length>4&&void 0!==arguments[4])||arguments[4])&&!fL(e))throw new pw(hw.INVALID_PARAMS,"invalid ".concat(t,": the value range is [").concat(i,", ").concat(n,"]. integer only"))}function lL(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:255,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(null==e)throw new pw(hw.INVALID_PARAMS,"".concat(t||"param"," cannot be empty"));if(!gL(e,i,n,r))throw new pw(hw.INVALID_PARAMS,"Invalid ".concat(t||"string param",": Length of the string: [").concat(i,",").concat(n,"].").concat(r?" ASCII characters only.":""))}function hL(e,t){if(!Array.isArray(e))throw new pw(hw.INVALID_PARAMS,"".concat(t," should be an array"))}function pL(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/.test(e))throw mw.error("Invalid Channel Name ".concat(e)),new pw(hw.INVALID_PARAMS,"The length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _,  {, }, |, ~, ,")}function _L(e){if(!("number"==typeof(t=e)&&Math.floor(t)===t&&0<=t&&t<=4294967295||gL(e,1,255)))throw mw.error("Invalid UID ".concat(e," ").concat(typeof e)),new pw(hw.INVALID_PARAMS,"[String uid] Length of the string: [1,255]. ASCII characters only. [Number uid] The value range is [0,10000]");var t;"string"==typeof e&&mw.warning("You input a string as the user ID, to ensure better end-user experience, Agora highly suggests not using a string as the user ID.")}function IL(e){return null==e}function gL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return"string"==typeof e&&e.length<=i&&e.length>=t&&(!n||RL(e))}function fL(e){return"number"==typeof e&&e%1==0}function RL(e){if("string"!=typeof e)return!1;for(let t=0;t<e.length;t+=1){const i=e.charCodeAt(t);if(i<0||i>255)return!1}return!0}let CL,TL,mL;!function(e){e.FREE="free",e.UPLOADING="uploading"}(CL||(CL={})),function(e){e[e.MISC=0]="MISC",e[e.INTERNAL_EVENT=1]="INTERNAL_EVENT",e[e.PUBLIC_EVENT=2]="PUBLIC_EVENT",e[e.WEB_EVENT=3]="WEB_EVENT",e[e.INTERNAL_API=4]="INTERNAL_API",e[e.WEB_API=5]="WEB_API",e[e.PUBLIC_API=6]="PUBLIC_API"}(TL||(TL={})),function(e){e.NONE="none",e.INIT="init",e.CANPLAY="canplay",e.PLAYING="playing",e.PAUSED="paused",e.SUSPEND="suspend",e.STALLED="stalled",e.WAITING="waiting",e.ERROR="error",e.DESTROYED="destroyed",e.ABORT="abort",e.ENDED="ended",e.EMPTIED="emptied",e.LOADEDDATA="loadeddata"}(mL||(mL={}));const SL={uninit:100,none:110,init:120,loadeddata:130,canplay:200,playing:210,paused:220,suspend:300,stalled:310,waiting:320,error:330,destroyed:340,abort:350,ended:360,emptied:370};function OL(e){return lL(e.reportId,"params.reportId",0,100,!1),lL(e.category,"params.category",0,100,!1),lL(e.event,"params.event",0,100,!1),lL(e.label,"params.label",0,100,!1),EL(e.value,"params.value",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,!1),!0}const vL={sid:"",lts:0,success:null,cname:null,uid:null,peer:null,cid:null,elapse:null,extend:null,vid:0};let NL,yL,DL,wL,bL,LL,PL,kL,ML,UL,BL,VL,QL,xL,FL,GL,jL,YL,HL,KL,WL,JL,qL;function XL(e){return EL(e.timeout,"config.timeout",0,1e5),EL(e.timeoutFactor,"config.timeoutFactor",0,100,!1),EL(e.maxRetryCount,"config.maxRetryConfig",0,1/0),EL(e.maxRetryTimeout,"config.maxRetryTimeout",0,1/0),!0}function zL(e){return uL(e.codec,"config.codec",["vp8","vp9","av1","h264"]),uL(e.mode,"config.mode",["rtc","live"]),void 0!==e.audioCodec&&uL(e.audioCodec,"config.audioCodec",["opus","pcmu","pcma","g722"]),void 0!==e.proxyServer&&lL(e.proxyServer,"config.proxyServer",1,1e4),void 0!==e.turnServer&&$L(e.turnServer),void 0!==e.httpRetryConfig&&XL(e.httpRetryConfig),void 0!==e.websocketRetryConfig&&XL(e.websocketRetryConfig),!0}function ZL(e){if(!Array.isArray(e)||e.length<1)return!1;try{e.forEach((e=>{if(!e.urls)throw Error()}))}catch(e){return!1}return!0}function $L(e){return lL(e.turnServerURL,"turnServerURL"),lL(e.username,"username"),lL(e.password,"password"),e.udpport&&EL(e.udpport,"udpport",1,99999,!0),e.forceturn&&dL(e.forceturn,"forceturn"),e.security&&dL(e.security,"security"),e.tcpport&&EL(e.tcpport,"tcpport",1,99999,!0),!0}function eP(e){return void 0!==e.level&&uL(e.level,"level",[1,2,3]),!0}!function(e){e.PUBLISH="publish",e.SUBSCRIBE="subscribe",e.WS_COMPRESSOR_INIT="ws_compressor_init",e.SESSION_INIT="session_init",e.JOIN_CHOOSE_SERVER="join_choose_server",e.REQ_USER_ACCOUNT="req_user_account",e.JOIN_GATEWAY="join_gateway",e.REJOIN_GATEWAY="rejoin_gateway",e.STREAM_SWITCH="stream_switch",e.REQUEST_PROXY_WORKER_MANAGER="request_proxy_worker_manager",e.REQUEST_PROXY_APPCENTER="request_proxy_appcenter",e.FIRST_VIDEO_RECEIVED="first_video_received",e.FIRST_AUDIO_RECEIVED="first_audio_received",e.FIRST_VIDEO_DECODE="first_video_decode",e.FIRST_AUDIO_DECODE="first_audio_decode",e.ON_ADD_AUDIO_STREAM="on_add_audio_stream",e.ON_ADD_VIDEO_STREAM="on_add_video_stream",e.ON_UPDATE_STREAM="on_update_stream",e.ON_REMOVE_STREAM="on_remove_stream",e.USER_ANALYTICS="req_user_analytics"}(NL||(NL={})),function(e){e.SESSION="io.agora.pb.Wrtc.Session",e.JOIN_CHOOSE_SERVER="io.agora.pb.Wrtc.JoinChooseServer",e.REQ_USER_ACCOUNT="io.agora.pb.Wrtc.ReqUserAccount",e.JOIN_GATEWAT="io.agora.pb.Wrtc.JoinGateway",e.RE_JOIN_GATEWAY="io.agora.pb.Wrtc.ReJoinGateway",e.PUBLISH="io.agora.pb.Wrtc.Publish",e.SUBSCRIBE="io.agora.pb.Wrtc.Subscribe",e.WS_COMPRESSOR_INIT="io.agora.pb.Wrtc.WsCompressorInit",e.STREAM_SWITCH="io.agora.pb.Wrtc.StreamSwitch",e.AUDIO_SENDING_STOPPED="io.agora.pb.Wrtc.AudioSendingStopped",e.VIDEO_SENDING_STOPPED="io.agora.pb.Wrtc.VideoSendingStopped",e.REQUEST_PROXY_APPCENTER="io.agora.pb.Wrtc.RequestProxyAppCenter",e.REQUEST_PROXY_WORKER_MANAGER="io.agora.pb.Wrtc.RequestProxyWorkerManager",e.API_INVOKE="io.agora.pb.Wrtc.ApiInvoke",e.FIRST_VIDEO_RECEIVED="io.agora.pb.Wrtc.FirstVideoReceived",e.FIRST_AUDIO_RECEIVED="io.agora.pb.Wrtc.FirstAudioReceived",e.FIRST_VIDEO_DECODE="io.agora.pb.Wrtc.FirstVideoDecode",e.FIRST_AUDIO_DECODE="io.agora.pb.Wrtc.FirstAudioDecode",e.ON_ADD_AUDIO_STREAM="io.agora.pb.Wrtc.OnAddAudioStream",e.ON_ADD_VIDEO_STREAM="io.agora.pb.Wrtc.OnAddVideoStream",e.ON_UPDATE_STREAM="io.agora.pb.Wrtc.OnUpdateStream",e.ON_REMOVE_STREAM="io.agora.pb.Wrtc.OnRemoveStream",e.JOIN_CHANNEL_TIMEOUT="io.agora.pb.Wrtc.JoinChannelTimeout",e.PEER_PUBLISH_STATUS="io.agora.pb.Wrtc.PeerPublishStatus",e.WORKER_EVENT="io.agora.pb.Wrtc.WorkerEvent",e.AP_WORKER_EVENT="io.agora.pb.Wrtc.APWorkerEvent",e.JOIN_WEB_PROXY_AP="io.agora.pb.Wrtc.JoinWebProxyAP",e.WEBSOCKET_QUIT="io.agora.pb.Wrtc.WebSocketQuit",e.USER_ANALYTICS="io.agora.pb.Wrtc.UserAnalytics",e.AUTOPLAY_FAILED="io.agora.pb.Wrtc.AutoplayFailed"}(yL||(yL={})),function(e){e[e.WORKER_EVENT=156]="WORKER_EVENT",e[e.AP_WORKER_EVENT=160]="AP_WORKER_EVENT"}(DL||(DL={})),function(e){e.CREATE_CLIENT="createClient",e.CHECK_SYSTEM_REQUIREMENTS="checkSystemRequirements",e.SET_AREA="setArea",e.CHECK_VIDEO_TRACK_IS_ACTIVE="checkVideoTrackIsActive",e.CHECK_AUDIO_TRACK_IS_ACTIVE="checkAudioTrackIsActive",e.CREATE_MIC_AUDIO_TRACK="createMicrophoneAudioTrack",e.CREATE_CUSTOM_AUDIO_TRACK="createCustomAudioTrack",e.CREATE_BUFFER_AUDIO_TRACK="createBufferSourceAudioTrack",e.CREATE_CAM_VIDEO_TRACK="createCameraVideoTrack",e.CREATE_CUSTOM_VIDEO_TRACK="createCustomVideoTrack",e.CREATE_MIC_AND_CAM_TRACKS="createMicrophoneAndCameraTracks",e.CREATE_SCREEN_VIDEO_TRACK="createScreenVideoTrack",e.SET_ENCRYPTION_CONFIG="Client.setEncryptionConfig",e.START_PROXY_SERVER="Client.startProxyServer",e.STOP_PROXY_SERVER="Client.stopProxyServer",e.SET_PROXY_SERVER="Client.setProxyServer",e.SET_TURN_SERVER="Client.setTurnServer",e.SET_CLIENT_ROLE="Client.setClientRole",e.SET_LOW_STREAM_PARAMETER="Client.setLowStreamParameter",e.ENABLE_DUAL_STREAM="Client.enableDualStream",e.DISABLE_DUAL_STREAM="Client.disableDualStream",e.JOIN="Client.join",e.LEAVE="Client.leave",e.PUBLISH="Client.publish",e.UNPUBLISH="Client.unpublish",e.SUBSCRIBE="Client.subscribe",e.MASS_SUBSCRIBE="Client.massSubscribe",e.MASS_UNSUBSCRIBE="Client.massUnsubscribe",e.UNSUBSCRIBE="Client.unsubscribe",e.RENEW_TOKEN="Client.renewToken",e.SET_REMOTE_VIDEO_STREAM_TYPE="Client.setRemoteVideoStreamType",e.SET_STREAM_FALLBACK_OPTION="Client.setStreamFallbackOption",e.ENABLE_AUDIO_VOLUME_INDICATOR="Client.enableAudioVolumeIndicator",e.SEND_CUSTOM_REPORT_MESSAGE="Client.sendCustomReportMessage",e.JOIN_FALLBACK_TO_PROXY="Client._joinFallbackToProxy",e.ON_LIVE_STREAM_WARNING="Client.onLiveStreamWarning",e.ON_LIVE_STREAM_ERROR="Client.onLiveStreamingError",e.START_LIVE_STREAMING="Client.startLiveStreaming",e.SET_LIVE_TRANSCODING="Client.setLiveTranscoding",e.STOP_LIVE_STREAMING="Client.stopLiveStreaming",e.ADD_INJECT_STREAM_URL="Client.addInjectStreamUrl",e.REMOVE_INJECT_STREAM_URL="Client.removeInjectStreamUrl",e.START_CHANNEL_MEDIA_RELAY="Client.startChannelMediaRelay",e.UPDATE_CHANNEL_MEDIA_RELAY="Client.updateChannelMediaRelay",e.STOP_CHANNEL_MEDIA_RELAY="Client.stopChannelMediaRelay",e.REQUEST_CONFIG_DISTRIBUTE="_config-distribute-request",e.SET_CONFIG_DISTRIBUTE="_configDistribute",e.LOCAL_TRACK_SET_MUTED="LocalTrack.setMute",e.LOCAL_AUDIO_TRACK_PLAY="LocalAudioTrack.play",e.LOCAL_AUDIO_TRACK_PLAY_IN_ELEMENT="LocalAudioTrack.playInElement",e.LOCAL_AUDIO_TRACK_STOP="LocalAudioTrack.stop",e.LOCAL_AUDIO_TRACK_SET_VOLUME="LocalAudioTrack.setVolume",e.MIC_AUDIO_TRACK_SET_DEVICE="MicrophoneAudioTrack.setDevice",e.BUFFER_AUDIO_TRACK_START="BufferSourceAudioTrack.startProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_STOP="BufferSourceAudioTrack.stopProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_PAUSE="BufferSourceAudioTrack.pauseProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_RESUME="BufferSourceAudioTrack.resumeProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_SEEK="BufferSourceAudioTrack.seekAudioBuffer",e.LOCAL_VIDEO_TRACK_PLAY="LocalVideoTrack.play",e.LOCAL_VIDEO_TRACK_STOP="LocalVideoTrack.stop",e.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE="LocalVideoTrack.getVideoElementVisibleStatus",e.LOCAL_VIDEO_TRACK_BEAUTY="LocalVideoTrack.setBeautyEffect",e.CAM_VIDEO_TRACK_SET_DEVICE="CameraVideoTrack.setDevice",e.CAM_VIDEO_TRACK_SET_ENCODER_CONFIG="CameraVideoTrack.setEncoderConfiguration",e.REMOTE_VIDEO_TRACK_PLAY="RemoteVideoTrack.play",e.REMOTE_VIDEO_TRACK_STOP="RemoteVideoTrack.stop",e.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE="RemoteVideoTrack.getVideoElementVisibleStatus",e.REMOTE_AUDIO_TRACK_PLAY="RemoteAudioTrack.play",e.REMOTE_AUDIO_TRACK_STOP="RemoteAudioTrack.stop",e.REMOTE_AUDIO_SET_VOLUME="RemoteAudioTrack.setVolume",e.REMOTE_AUDIO_SET_OUTPUT_DEVICE="RemoteAudioTrack.setOutputDevice",e.GET_MEDIA_STREAM_TRACK="Track.getMediaStreamTrack",e.STREAM_TYPE_CHANGE="streamTypeChange",e.CONNECTION_STATE_CHANGE="connectionStateChange",e.LOAD_CONFIG_FROM_LOCALSTORAGE="loadConfigFromLocalStorage"}(wL||(wL={})),function(e){e.TRACER="tracer"}(bL||(bL={})),function(e){e.IDLE="IDLE",e.INITING="INITING",e.INITEND="INITEND"}(LL||(LL={})),function(e){e.STATE_CHANGE="state_change",e.RECORDING_DEVICE_CHANGED="recordingDeviceChanged",e.PLAYOUT_DEVICE_CHANGED="playoutDeviceChanged",e.CAMERA_DEVICE_CHANGED="cameraDeviceChanged"}(PL||(PL={})),function(e){e[e.ACCESS_POINT=101]="ACCESS_POINT",e[e.UNILBS=201]="UNILBS",e[e.STRING_UID_ALLOCATOR=901]="STRING_UID_ALLOCATOR"}(kL||(kL={})),function(e){e[e.IIIEGAL_APPID=1]="IIIEGAL_APPID",e[e.IIIEGAL_UID=2]="IIIEGAL_UID",e[e.INTERNAL_ERROR=3]="INTERNAL_ERROR"}(ML||(ML={})),function(e){e[e.INVALID_VENDOR_KEY=5]="INVALID_VENDOR_KEY",e[e.INVALID_CHANNEL_NAME=7]="INVALID_CHANNEL_NAME",e[e.INTERNAL_ERROR=8]="INTERNAL_ERROR",e[e.NO_AUTHORIZED=9]="NO_AUTHORIZED",e[e.DYNAMIC_KEY_TIMEOUT=10]="DYNAMIC_KEY_TIMEOUT",e[e.NO_ACTIVE_STATUS=11]="NO_ACTIVE_STATUS",e[e.DYNAMIC_KEY_EXPIRED=13]="DYNAMIC_KEY_EXPIRED",e[e.STATIC_USE_DYNAMIC_KEY=14]="STATIC_USE_DYNAMIC_KEY",e[e.DYNAMIC_USE_STATIC_KEY=15]="DYNAMIC_USE_STATIC_KEY",e[e.USER_OVERLOAD=16]="USER_OVERLOAD",e[e.FORBIDDEN_REGION=18]="FORBIDDEN_REGION",e[e.CANNOT_MEET_AREA_DEMAND=19]="CANNOT_MEET_AREA_DEMAND"}(UL||(UL={})),function(e){e[e.NO_FLAG_SET=100]="NO_FLAG_SET",e[e.FLAG_SET_BUT_EMPTY=101]="FLAG_SET_BUT_EMPTY",e[e.INVALID_FALG_SET=102]="INVALID_FALG_SET",e[e.FLAG_SET_BUT_NO_RE=103]="FLAG_SET_BUT_NO_RE",e[e.INVALID_SERVICE_ID=104]="INVALID_SERVICE_ID",e[e.NO_SERVICE_AVAILABLE=200]="NO_SERVICE_AVAILABLE",e[e.NO_SERVICE_AVAILABLE_P2P=201]="NO_SERVICE_AVAILABLE_P2P",e[e.NO_SERVICE_AVAILABLE_VOICE=202]="NO_SERVICE_AVAILABLE_VOICE",e[e.NO_SERVICE_AVAILABLE_WEBRTC=203]="NO_SERVICE_AVAILABLE_WEBRTC",e[e.NO_SERVICE_AVAILABLE_CDS=204]="NO_SERVICE_AVAILABLE_CDS",e[e.NO_SERVICE_AVAILABLE_CDN=205]="NO_SERVICE_AVAILABLE_CDN",e[e.NO_SERVICE_AVAILABLE_TDS=206]="NO_SERVICE_AVAILABLE_TDS",e[e.NO_SERVICE_AVAILABLE_REPORT=207]="NO_SERVICE_AVAILABLE_REPORT",e[e.NO_SERVICE_AVAILABLE_APP_CENTER=208]="NO_SERVICE_AVAILABLE_APP_CENTER",e[e.NO_SERVICE_AVAILABLE_ENV0=209]="NO_SERVICE_AVAILABLE_ENV0",e[e.NO_SERVICE_AVAILABLE_VOET=210]="NO_SERVICE_AVAILABLE_VOET",e[e.NO_SERVICE_AVAILABLE_STRING_UID=211]="NO_SERVICE_AVAILABLE_STRING_UID",e[e.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS=212]="NO_SERVICE_AVAILABLE_WEBRTC_UNILBS",e[e.NO_SERVICE_AVAILABLE_UNILBS_FLV=213]="NO_SERVICE_AVAILABLE_UNILBS_FLV"}(BL||(BL={})),function(e){e[e.K_TIMESTAMP_EXPIRED=2]="K_TIMESTAMP_EXPIRED",e[e.K_CHANNEL_PERMISSION_INVALID=3]="K_CHANNEL_PERMISSION_INVALID",e[e.K_CERTIFICATE_INVALID=4]="K_CERTIFICATE_INVALID",e[e.K_CHANNEL_NAME_EMPTY=5]="K_CHANNEL_NAME_EMPTY",e[e.K_CHANNEL_NOT_FOUND=6]="K_CHANNEL_NOT_FOUND",e[e.K_TICKET_INVALID=7]="K_TICKET_INVALID",e[e.K_CHANNEL_CONFLICTED=8]="K_CHANNEL_CONFLICTED",e[e.K_SERVICE_NOT_READY=9]="K_SERVICE_NOT_READY",e[e.K_SERVICE_TOO_HEAVY=10]="K_SERVICE_TOO_HEAVY",e[e.K_UID_BANNED=14]="K_UID_BANNED",e[e.K_IP_BANNED=15]="K_IP_BANNED",e[e.K_CHANNEL_BANNED=16]="K_CHANNEL_BANNED",e[e.WARN_NO_AVAILABLE_CHANNEL=103]="WARN_NO_AVAILABLE_CHANNEL",e[e.WARN_LOOKUP_CHANNEL_TIMEOUT=104]="WARN_LOOKUP_CHANNEL_TIMEOUT",e[e.WARN_LOOKUP_CHANNEL_REJECTED=105]="WARN_LOOKUP_CHANNEL_REJECTED",e[e.WARN_OPEN_CHANNEL_TIMEOUT=106]="WARN_OPEN_CHANNEL_TIMEOUT",e[e.WARN_OPEN_CHANNEL_REJECTED=107]="WARN_OPEN_CHANNEL_REJECTED",e[e.WARN_REQUEST_DEFERRED=108]="WARN_REQUEST_DEFERRED",e[e.ERR_DYNAMIC_KEY_TIMEOUT=109]="ERR_DYNAMIC_KEY_TIMEOUT",e[e.ERR_NO_AUTHORIZED=110]="ERR_NO_AUTHORIZED",e[e.ERR_VOM_SERVICE_UNAVAILABLE=111]="ERR_VOM_SERVICE_UNAVAILABLE",e[e.ERR_NO_CHANNEL_AVAILABLE_CODE=112]="ERR_NO_CHANNEL_AVAILABLE_CODE",e[e.ERR_MASTER_VOCS_UNAVAILABLE=114]="ERR_MASTER_VOCS_UNAVAILABLE",e[e.ERR_INTERNAL_ERROR=115]="ERR_INTERNAL_ERROR",e[e.ERR_NO_ACTIVE_STATUS=116]="ERR_NO_ACTIVE_STATUS",e[e.ERR_INVALID_UID=117]="ERR_INVALID_UID",e[e.ERR_DYNAMIC_KEY_EXPIRED=118]="ERR_DYNAMIC_KEY_EXPIRED",e[e.ERR_STATIC_USE_DYANMIC_KE=119]="ERR_STATIC_USE_DYANMIC_KE",e[e.ERR_DYNAMIC_USE_STATIC_KE=120]="ERR_DYNAMIC_USE_STATIC_KE",e[e.ERR_NO_VOCS_AVAILABLE=2e3]="ERR_NO_VOCS_AVAILABLE",e[e.ERR_NO_VOS_AVAILABLE=2001]="ERR_NO_VOS_AVAILABLE",e[e.ERR_JOIN_CHANNEL_TIMEOUT=2002]="ERR_JOIN_CHANNEL_TIMEOUT",e[e.ERR_REPEAT_JOIN_CHANNEL=2003]="ERR_REPEAT_JOIN_CHANNEL",e[e.ERR_JOIN_BY_MULTI_IP=2004]="ERR_JOIN_BY_MULTI_IP",e[e.ERR_NOT_JOINED=2011]="ERR_NOT_JOINED",e[e.ERR_REPEAT_JOIN_REQUEST=2012]="ERR_REPEAT_JOIN_REQUEST",e[e.ERR_INVALID_VENDOR_KEY=2013]="ERR_INVALID_VENDOR_KEY",e[e.ERR_INVALID_CHANNEL_NAME=2014]="ERR_INVALID_CHANNEL_NAME",e[e.ERR_INVALID_STRINGUID=2015]="ERR_INVALID_STRINGUID",e[e.ERR_TOO_MANY_USERS=2016]="ERR_TOO_MANY_USERS",e[e.ERR_SET_CLIENT_ROLE_TIMEOUT=2017]="ERR_SET_CLIENT_ROLE_TIMEOUT",e[e.ERR_SET_CLIENT_ROLE_NO_PERMISSION=2018]="ERR_SET_CLIENT_ROLE_NO_PERMISSION",e[e.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE=2019]="ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",e[e.ERR_PUBLISH_REQUEST_INVALID=2020]="ERR_PUBLISH_REQUEST_INVALID",e[e.ERR_SUBSCRIBE_REQUEST_INVALID=2021]="ERR_SUBSCRIBE_REQUEST_INVALID",e[e.ERR_NOT_SUPPORTED_MESSAGE=2022]="ERR_NOT_SUPPORTED_MESSAGE",e[e.ERR_ILLEAGAL_PLUGIN=2023]="ERR_ILLEAGAL_PLUGIN",e[e.ERR_REJOIN_TOKEN_INVALID=2024]="ERR_REJOIN_TOKEN_INVALID",e[e.ERR_REJOIN_USER_NOT_JOINED=2025]="ERR_REJOIN_USER_NOT_JOINED",e[e.ERR_INVALID_OPTIONAL_INFO=2027]="ERR_INVALID_OPTIONAL_INFO",e[e.ILLEGAL_AES_PASSWORD=2028]="ILLEGAL_AES_PASSWORD",e[e.ILLEGAL_CLIENT_ROLE_LEVEL=2029]="ILLEGAL_CLIENT_ROLE_LEVEL",e[e.ERR_TOO_MANY_BROADCASTERS=2031]="ERR_TOO_MANY_BROADCASTERS",e[e.ERR_TOO_MANY_SUBSCRIBERS=2032]="ERR_TOO_MANY_SUBSCRIBERS",e[e.ERR_TEST_RECOVER=9e3]="ERR_TEST_RECOVER",e[e.ERR_TEST_TRYNEXT=9001]="ERR_TEST_TRYNEXT",e[e.ERR_TEST_RETRY=9002]="ERR_TEST_RETRY"}(VL||(VL={})),function(e){e[e.AUDIENCE_LEVEL_LOW_LATENCY=1]="AUDIENCE_LEVEL_LOW_LATENCY",e[e.AUDIENCE_LEVEL_ULTRA_LOW_LATENCY=2]="AUDIENCE_LEVEL_ULTRA_LOW_LATENCY",e[e.AUDIENCE_LEVEL_SYNC_LATENCY=3]="AUDIENCE_LEVEL_SYNC_LATENCY"}(QL||(QL={})),function(e){e.LEAVE="LEAVE",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.UID_BANNED="UID_BANNED",e.IP_BANNED="IP_BANNED",e.CHANNEL_BANNED="CHANNEL_BANNED",e.FALLBACK="FALLBACK"}(xL||(xL={})),function(e){e.CONNECTION_STATE_CHANGE="connection-state-change",e.MEDIA_RECONNECT_START="media-reconnect-start",e.MEDIA_RECONNECT_END="media-reconnect-end",e.IS_USING_CLOUD_PROXY="is-using-cloud-proxy",e.USER_JOINED="user-joined",e.USER_LEAVED="user-left",e.USER_PUBLISHED="user-published",e.USER_UNPUBLISHED="user-unpublished",e.USER_INFO_UPDATED="user-info-updated",e.CLIENT_BANNED="client-banned",e.CHANNEL_MEDIA_RELAY_STATE="channel-media-relay-state",e.CHANNEL_MEDIA_RELAY_EVENT="channel-media-relay-event",e.VOLUME_INDICATOR="volume-indicator",e.CRYPT_ERROR="crypt-error",e.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="token-privilege-will-expire",e.ON_TOKEN_PRIVILEGE_DID_EXPIRE="token-privilege-did-expire",e.NETWORK_QUALITY="network-quality",e.STREAM_TYPE_CHANGED="stream-type-changed",e.STREAM_FALLBACK="stream-fallback",e.RECEIVE_METADATA="receive-metadata",e.STREAM_MESSAGE="stream-message",e.LIVE_STREAMING_ERROR="live-streaming-error",e.LIVE_STREAMING_WARNING="live-streaming-warning",e.INJECT_STREAM_STATUS="stream-inject-status",e.EXCEPTION="exception",e.ERROR="error",e.P2P_LOST="p2p_lost",e.JOIN_FALLBACK_TO_PROXY="join-fallback-to-proxy",e.MEDIA_CONNECTION_TYPE_CHANGE="media-connection-type-change",e.PUBLISHED_USER_LIST="published-user-list"}(FL||(FL={})),function(e){e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.MULTI_IP="MULTI_IP",e.TIMEOUT="TIMEOUT",e.OFFLINE="OFFLINE",e.LEAVE="LEAVE",e.P2P_FAILED="P2P_FAILED",e.FALLBACK="FALLBACK"}(GL||(GL={})),function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.CLOSED="closed"}(jL||(jL={})),function(e){e.WS_CONNECTED="ws_connected",e.WS_RECONNECTING="ws_reconnecting",e.WS_CLOSED="ws_closed",e.WS_RECONNECT_WAITTING_FINISH="ws_reconnect_waitting_finish",e.WS_RECONNECT_CREATE_CONNECTION="ws_reconnect_create_connection",e.ON_BINARY_DATA="on_binary_data",e.REQUEST_RECOVER="request_recover",e.REQUEST_JOIN_INFO="request_join_info",e.REQUEST_REJOIN_INFO="req_rejoin_info",e.IS_P2P_DISCONNECTED="is_p2p_dis",e.DISCONNECT_P2P="dis_p2p",e.ABORT_P2P_EXECUTION="abort_p2p_execution",e.NEED_RENEW_SESSION="need-sid",e.REPORT_JOIN_GATEWAY="report_join_gateway",e.REQUEST_TIMEOUT="request_timeout",e.REQUEST_SUCCESS="request_success",e.JOIN_RESPONSE="join_response"}(YL||(YL={})),function(e){e.PING="ping",e.PING_BACK="ping_back",e.JOIN="join_v3",e.REJOIN="rejoin_v3",e.LEAVE="leave",e.SET_CLIENT_ROLE="set_client_role",e.PUBLISH="publish",e.UNPUBLISH="unpublish",e.SUBSCRIBE="subscribe",e.SUBSCRIBE_STREAMS="subscribe_streams",e.UNSUBSCRIBE="unsubscribe",e.UNSUBSCRIBE_STREAMS="unsubscribe_streams",e.SUBSCRIBE_CHANGE="subscribe_change",e.TRAFFIC_STATS="traffic_stats",e.RENEW_TOKEN="renew_token",e.SWITCH_VIDEO_STREAM="switch_video_stream",e.DEFAULT_VIDEO_STREAM="default_video_stream",e.SET_FALLBACK_OPTION="set_fallback_option",e.GATEWAY_INFO="gateway_info",e.CONTROL="control",e.SEND_METADATA="send_metadata",e.DATA_STREAM="data_stream",e.PICK_SVC_LAYER="pick_svc_layer",e.RESTART_ICE="restart_ice",e.CONNECT_PC="connect_pc",e.SET_VIDEO_PROFILE="set_video_profile"}(HL||(HL={})),function(e){e.PUBLISH_STATS="publish_stats",e.PUBLISH_RELATED_STATS="publish_related_stats",e.SUBSCRIBE_STATS="subscribe_stats",e.SUBSCRIBE_RELATED_STATS="subscribe_related_stats",e.WS_INFLATE_DATA_LENGTH="ws_inflate_data_length",e.DENOISER_STATS="denoiser_stats",e.TRANSPORT_STATS="transport_stats"}(KL||(KL={})),function(e){e.ON_USER_ONLINE="on_user_online",e.ON_USER_OFFLINE="on_user_offline",e.ON_STREAM_FALLBACK_UPDATE="on_stream_fallback_update",e.ON_PUBLISH_STREAM="on_publish_stream",e.ON_UPLINK_STATS="on_uplink_stats",e.ON_P2P_LOST="on_p2p_lost",e.ON_REMOVE_STREAM="on_remove_stream",e.ON_ADD_AUDIO_STREAM="on_add_audio_stream",e.ON_ADD_VIDEO_STREAM="on_add_video_stream",e.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="on_token_privilege_will_expire",e.ON_TOKEN_PRIVILEGE_DID_EXPIRE="on_token_privilege_did_expire",e.ON_USER_BANNED="on_user_banned",e.ON_NOTIFICATION="on_notification",e.ON_CRYPT_ERROR="on_crypt_error",e.MUTE_AUDIO="mute_audio",e.MUTE_VIDEO="mute_video",e.UNMUTE_AUDIO="unmute_audio",e.UNMUTE_VIDEO="unmute_video",e.ON_P2P_OK="on_p2p_ok",e.RECEIVE_METADATA="receive_metadata",e.ON_DATA_STREAM="on_data_stream",e.ENABLE_LOCAL_VIDEO="enable_local_video",e.DISABLE_LOCAL_VIDEO="disable_local_video",e.ENABLE_LOCAL_AUDIO="enable_local_audio",e.DISABLE_LOCAL_AUDIO="disable_local_audio",e.ON_PUBLISHED_USER_LIST="on_published_user_list"}(WL||(WL={})),function(e){e.CONNECTION_STATE_CHANGE="CONNECTION_STATE_CHANGE",e.NEED_ANSWER="NEED_ANSWER",e.NEED_RENEGOTIATE="NEED_RENEGOTIATE",e.P2P_LOST="P2P_LOST",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.NEED_UNPUB="NEED_UNPUB",e.NEED_UNSUB="NEED_UNSUB",e.NEED_UPLOAD="NEED_UPLOAD",e.NEED_CONTROL="NEED_CONTROL",e.START_RECONNECT="START_RECONNECT",e.END_RECONNECT="END_RECONNECT",e.NEED_SIGNAL_RTT="NEED_SIGNAL_RTT"}(JL||(JL={})),function(e){e.AUDIO_SOURCE_STATE_CHANGE="audio_source_state_change",e.RECEIVE_TRACK_BUFFER="receive_track_buffer",e.ON_AUDIO_BUFFER="on_audio_buffer",e.UPDATE_SOURCE="update_source"}(qL||(qL={}));const tP={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,currentPacketLossRate:0},iP={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0,currentPacketLossRate:0},nP={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1},rP={uplinkNetworkQuality:0,downlinkNetworkQuality:0},oP={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1};let sP,aP,cP;!function(e){e.CONNECTED="websocket:connected",e.RECONNECTING="websocket:reconnecting",e.WILL_RECONNECT="websocket:will_reconnect",e.CLOSED="websocket:closed",e.FAILED="websocket:failed",e.ON_MESSAGE="websocket:on_message",e.REQUEST_NEW_URLS="websocket:request_new_urls",e.RECONNECT_WAITTING_FINISH="websocket:reconnect_waitting_finish",e.RECONNECT_CREATE_CONNECTION="websocket:reconnect_create_connection"}(sP||(sP={})),function(e){e.TRANSCODE="mix_streaming",e.RAW="raw_streaming",e.INJECT="inject_streaming"}(aP||(aP={})),function(e){e[e.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",e[e.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",e[e.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",e[e.INJECT_STREAM_STATUS_START_TIMEOUT=3]="INJECT_STREAM_STATUS_START_TIMEOUT",e[e.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",e[e.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",e[e.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",e[e.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",e[e.INJECT_STREAM_STATUS_STOP_TIMEOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEOUT",e[e.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",e[e.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN"}(cP||(cP={}));const AP={alpha:1,height:640,width:360,x:0,y:0,zOrder:0,audioChannel:0},dP={x:0,y:0,width:160,height:160,zOrder:255,alpha:1};function uP(e,t){lL(e.url,"".concat(t,".url"),1,1e3,!1),IL(e.x)||EL(e.x,"".concat(t,".x"),0,1e4),IL(e.y)||EL(e.y,"".concat(t,".y"),0,1e4),IL(e.width)||EL(e.width,"".concat(t,".width"),0,1e4),IL(e.height)||EL(e.height,"".concat(t,".height"),0,1e4),IL(e.zOrder)||EL(e.zOrder,"".concat(t,".zOrder"),0,255),IL(e.alpha)||EL(e.alpha,"".concat(t,".alpha"),0,1,!1)}const EP={audioBitrate:48,audioChannels:1,audioSampleRate:48e3,backgroundColor:0,height:360,lowLatency:!1,videoBitrate:400,videoCodecProfile:100,videoCodecType:1,videoFrameRate:15,videoGop:30,width:640,images:[],userConfigs:[],userConfigExtraInfo:""},lP={audioBitrate:48,audioChannels:2,audioVolume:100,audioSampleRate:48e3,height:0,width:0,videoBitrate:400,videoFramerate:15,videoGop:30};let hP,pP,_P,IP,gP,fP,RP,CP,TP,mP,SP,OP,vP,NP,yP,DP,wP,bP;function LP(e){if(!e.channelName)throw new pw(hw.INVALID_PARAMS,"invalid channelName in info");if(!e.uid||"number"!=typeof e.uid)throw new pw(hw.INVALID_PARAMS,"invalid uid in info, uid must be a number");return e.token&&lL(e.token,"info.token",1,2047),_L(e.uid),pL(e.channelName),!0}function PP(e){return uL(e,"mediaSource",["screen","window","application"]),!0}!function(e){e.WARNING="@live_uap-warning",e.ERROR="@line_uap-error",e.PUBLISH_STREAM_STATUS="@live_uap-publish-status",e.INJECT_STREAM_STATUS="@live_uap-inject-status",e.WORKER_STATUS="@live_uap-worker-status",e.REQUEST_NEW_ADDRESS="@live_uap-request-address"}(hP||(hP={})),function(e){e.REQUEST_WORKER_MANAGER_LIST="@live_req_worker_manager"}(pP||(pP={})),function(e){e[e.LIVE_STREAM_RESPONSE_SUCCEED=200]="LIVE_STREAM_RESPONSE_SUCCEED",e[e.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM=454]="LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM",e[e.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR=450]="LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR",e[e.LIVE_STREAM_RESPONSE_BAD_STREAM=451]="LIVE_STREAM_RESPONSE_BAD_STREAM",e[e.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR=400]="LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR",e[e.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST=404]="LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST",e[e.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED=456]="LIVE_STREAM_RESPONSE_NOT_AUTHORIZED",e[e.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE=457]="LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE",e[e.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN=429]="LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN",e[e.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH=452]="LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH",e[e.LIVE_STREAM_RESPONSE_NOT_SUPPORTED=453]="LIVE_STREAM_RESPONSE_NOT_SUPPORTED",e[e.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM=455]="LIVE_STREAM_RESPONSE_MAX_STREAM_NUM",e[e.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR=500]="LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR",e[e.LIVE_STREAM_RESPONSE_WORKER_LOST=501]="LIVE_STREAM_RESPONSE_WORKER_LOST",e[e.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT=502]="LIVE_STREAM_RESPONSE_RESOURCE_LIMIT",e[e.LIVE_STREAM_RESPONSE_WORKER_QUIT=503]="LIVE_STREAM_RESPONSE_WORKER_QUIT",e[e.ERROR_FAIL_SEND_MESSAGE=504]="ERROR_FAIL_SEND_MESSAGE",e[e.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE=30]="PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE",e[e.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT=31]="PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT",e[e.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH=32]="PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH",e[e.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN=33]="PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN"}(_P||(_P={})),function(e){e.CONNECT_FAILED="connect failed",e.CONNECT_TIMEOUT="connect timeout",e.WS_DISCONNECTED="websocket disconnected",e.REQUEST_TIMEOUT="request timeout",e.REQUEST_FAILED="request failed",e.WAIT_STATUS_TIMEOUT="wait status timeout",e.WAIT_STATUS_ERROR="wait status error",e.BAD_STATE="bad state",e.WS_ABORT="ws abort",e.AP_REQUEST_TIMEOUT="AP request timeout",e.AP_JSON_PARSE_ERROR="AP json parse error",e.AP_REQUEST_ERROR="AP request error",e.AP_REQUEST_ABORT="AP request abort"}(IP||(IP={})),function(e){e[e.SetSdkProfile=0]="SetSdkProfile",e[e.SetSourceChannel=1]="SetSourceChannel",e[e.SetSourceUserId=2]="SetSourceUserId",e[e.SetDestChannel=3]="SetDestChannel",e[e.StartPacketTransfer=4]="StartPacketTransfer",e[e.StopPacketTransfer=5]="StopPacketTransfer",e[e.UpdateDestChannel=6]="UpdateDestChannel",e[e.Reconnect=7]="Reconnect",e[e.SetVideoProfile=8]="SetVideoProfile"}(gP||(gP={})),function(e){e.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",e.NETWORK_CONNECTED="NETWORK_CONNECTED",e.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",e.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",e.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",e.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",e.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",e.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",e.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED",e.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE"}(fP||(fP={})),function(e){e.RELAY_STATE_IDLE="RELAY_STATE_IDLE",e.RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",e.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING",e.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE"}(RP||(RP={})),function(e){e.RELAY_OK="RELAY_OK",e.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",e.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED",e.DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED"}(CP||(CP={})),function(e){e.High="high",e.Low="low",e.Audio="audio",e.Screen="screen",e.ScreenLow="screen_low"}(TP||(TP={})),function(e){e.DISCONNECT="disconnect",e.CONNECTION_STATE_CHANGE="connection-state-change",e.NETWORK_QUALITY="network-quality",e.STREAM_TYPE_CHANGE="stream-type-change",e.IS_P2P_DISCONNECTED="is-p2p-dis",e.DISCONNECT_P2P="dis-p2p",e.REQUEST_NEW_GATEWAY_LIST="req-gate-url",e.NEED_RENEW_SESSION="need-sid",e.REQUEST_P2P_CONNECTION_PARAMS="request-p2p-connection-params",e.JOIN_RESPONSE="join-response"}(mP||(mP={})),function(e){e[e.Nothing=0]="Nothing",e[e.Audio=1]="Audio",e[e.LwoVideo=2]="LwoVideo",e[e.Video=4]="Video",e[e.Data=8]="Data"}(SP||(SP={})),function(e){e.NEED_RENEGOTIATE="@need_renegotiate",e.NEED_REPLACE_TRACK="@need_replace_track",e.NEED_CLOSE="@need_close",e.NEED_ENABLE_TRACK="@need_enable_track",e.NEED_DISABLE_TRACK="@need_disable_track",e.NEED_SESSION_ID="@need_sid",e.SET_OPTIMIZATION_MODE="@set_optimization_mode",e.GET_STATS="@get_stats",e.GET_LOW_VIDEO_TRACK="@get_low_video_track",e.NEED_RESET_REMOTE_SDP="@need_reset_remote_sdp",e.NEED_UPDATE_VIDEO_ENCODER="@need_update_video_encoder",e.NEED_MUTE_TRACK="@need_mute_track",e.NEED_UNMUTE_TRACK="@need_unmute_track"}(OP||(OP={})),function(e){e.SCREEN_TRACK="screen_track",e.LOW_STREAM="low_stream"}(vP||(vP={})),function(e){e[e.HIGH_STREAM=0]="HIGH_STREAM",e[e.LOW_STREAM=1]="LOW_STREAM"}(NP||(NP={})),function(e){e[e.DISABLE=0]="DISABLE",e[e.LOW_STREAM=1]="LOW_STREAM",e[e.AUDIO_ONLY=2]="AUDIO_ONLY"}(yP||(yP={})),function(e){e.SOURCE_STATE_CHANGE="source-state-change",e.TRACK_ENDED="track-ended",e.BEAUTY_EFFECT_OVERLOAD="beauty-effect-overload",e.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status",e.CLOSED="closed"}(DP||(DP={})),function(e){e.FIRST_FRAME_DECODED="first-frame-decoded",e.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status"}(wP||(wP={})),function(e){e.CHINA="CHINA",e.ASIA="ASIA",e.NORTH_AMERICA="NORTH_AMERICA",e.EUROPE="EUROPE",e.JAPAN="JAPAN",e.INDIA="INDIA",e.KOREA="KOREA",e.HKMC="HKMC",e.US="US",e.OCEANIA="OCEANIA",e.SOUTH_AMERICA="SOUTH_AMERICA",e.AFRICA="AFRICA",e.OVERSEA="OVERSEA",e.GLOBAL="GLOBAL"}(bP||(bP={}));const kP=[bP.AFRICA,bP.ASIA,bP.CHINA,bP.EUROPE,bP.GLOBAL,bP.INDIA,bP.JAPAN,bP.NORTH_AMERICA,bP.OCEANIA,bP.OVERSEA,bP.SOUTH_AMERICA];let MP;!function(e){e.CHINA="CN",e.ASIA="AS",e.NORTH_AMERICA="NA",e.EUROPE="EU",e.JAPAN="JP",e.INDIA="IN",e.KOREA="KR",e.HKMC="HK",e.US="US",e.OCEANIA="OC",e.SOUTH_AMERICA="SA",e.AFRICA="AF",e.OVERSEA="OVERSEA",e.GLOBAL="GLOBAL"}(MP||(MP={}));const UP={CHINA:{},ASIA:{CODE:MP.ASIA,WEBCS_DOMAIN:["ap-web-1-asia.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-asia.agora.io"],PROXY_CS:["proxy-ap-web-asia.agora.io"],CDS_AP:["cds-ap-web-asia.agora.io","cds-ap-web-asia2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-asia.agora.io","sua-ap-web-asia2.agora.io"],UAP_AP:["uap-ap-web-asia.agora.io","uap-ap-web-asia2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-asia.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-asia.agora.io"],LOG_UPLOAD_SERVER:["logservice-asia.agora.io"],PROXY_SERVER_TYPE3:["southeast-asia.webrtc-cloud-proxy.sd-rtn.com"]},NORTH_AMERICA:{CODE:MP.NORTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-north-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-north-america.agora.io"],PROXY_CS:["proxy-ap-web-america.agora.io"],CDS_AP:["cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],UAP_AP:["uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-north-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-north-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-north-america.agora.io"],PROXY_SERVER_TYPE3:["east-usa.webrtc-cloud-proxy.sd-rtn.com"]},EUROPE:{CODE:MP.EUROPE,WEBCS_DOMAIN:["ap-web-1-europe.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-europe.agora.io"],PROXY_CS:["proxy-ap-web-europe.agora.io"],CDS_AP:["cds-ap-web-europe.agora.io","cds-ap-web-europe2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-europe.agora.io","sua-ap-web-europe.agora.io"],UAP_AP:["uap-ap-web-europe.agora.io","uap-ap-web-europe2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-europe.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-europe.agora.io"],LOG_UPLOAD_SERVER:["logservice-europe.agora.io"],PROXY_SERVER_TYPE3:["europe.webrtc-cloud-proxy.sd-rtn.com"]},JAPAN:{CODE:MP.JAPAN,WEBCS_DOMAIN:["ap-web-1-japan.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-japan.agora.io"],PROXY_CS:["proxy-ap-web-japan.agora.io"],CDS_AP:["cds-ap-web-japan.agora.io","cds-ap-web-japan2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-japan.agora.io","sua-ap-web-japan2.agora.io"],UAP_AP:["uap-ap-web-japan.agora.io","\tuap-ap-web-japan2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-japan.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-japan.agora.io"],LOG_UPLOAD_SERVER:["logservice-japan.agora.io"],PROXY_SERVER_TYPE3:["japan.webrtc-cloud-proxy.sd-rtn.com"]},INDIA:{CODE:MP.INDIA,WEBCS_DOMAIN:["ap-web-1-india.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-india.agora.io"],PROXY_CS:["proxy-ap-web-india.agora.io"],CDS_AP:["cds-ap-web-india.agora.io","cds-ap-web-india2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-india.agora.io","sua-ap-web-india2.agora.io"],UAP_AP:["uap-ap-web-india.agora.io","uap-ap-web-india2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-india.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-india.agora.io"],LOG_UPLOAD_SERVER:["logservice-india.agora.io"],PROXY_SERVER_TYPE3:["india.webrtc-cloud-proxy.sd-rtn.com"]},KOREA:{CODE:MP.KOREA,WEBCS_DOMAIN:["ap-web-1-korea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-korea.agora.io"],PROXY_CS:["proxy-ap-web-korea.agora.io"],CDS_AP:["cds-ap-web-korea.agora.io","cds-ap-web-korea2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-korea.agora.io","sua-ap-web-korea2.agora.io"],UAP_AP:["uap-ap-web-korea.agora.io","uap-ap-web-korea2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-korea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-korea.agora.io"],LOG_UPLOAD_SERVER:["logservice-korea.agora.io"],PROXY_SERVER_TYPE3:["korea.webrtc-cloud-proxy.sd-rtn.com"]},HKMC:{CODE:MP.HKMC,WEBCS_DOMAIN:["ap-web-1-hkmc.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-hkmc.agora.io"],PROXY_CS:["proxy-ap-web-hkmc.agora.io"],CDS_AP:["cds-ap-web-hkmc.agora.io","cds-ap-web-hkmc2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-hkmc.agora.io","sua-ap-web-hkmc2.agora.io"],UAP_AP:["uap-ap-web-hkmc.agora.io","uap-ap-web-hkmc2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-hkmc.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-hkmc.agora.io"],LOG_UPLOAD_SERVER:["logservice-hkmc.agora.io"],PROXY_SERVER_TYPE3:["hkmc.webrtc-cloud-proxy.sd-rtn.com"]},US:{CODE:MP.US,WEBCS_DOMAIN:["ap-web-1-us.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-us.agora.io"],PROXY_CS:["proxy-ap-web-us.agora.io"],CDS_AP:["cds-ap-web-us.agora.io","cds-ap-web-us2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-us.agora.io","sua-ap-web-us2.agora.io"],UAP_AP:["uap-ap-web-us.agora.io","uap-ap-web-us2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-us.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-us.agora.io"],LOG_UPLOAD_SERVER:["logservice-us.agora.io"],PROXY_SERVER_TYPE3:["us.webrtc-cloud-proxy.sd-rtn.com"]},OVERSEA:{CODE:MP.OVERSEA,WEBCS_DOMAIN:["ap-web-1-oversea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oversea.agora.io"],PROXY_CS:["proxy-ap-web-oversea.agora.io"],CDS_AP:["cds-ap-web-oversea.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oversea.agora.io"],UAP_AP:["uap-ap-web-oversea.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oversea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oversea.agora.io"],LOG_UPLOAD_SERVER:["logservice-oversea.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.agora.io"]},GLOBAL:{CODE:MP.GLOBAL,WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-ap-web-3.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-ap-web-3.agora.io"],UAP_AP:["uap-ap-web-1.agora.io","uap-ap-web-3.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2.agora.io"],LOG_UPLOAD_SERVER:["logservice.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com"]},OCEANIA:{CODE:MP.OCEANIA,WEBCS_DOMAIN:["ap-web-1-oceania.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oceania.agora.io"],PROXY_CS:["proxy-ap-web-oceania.agora.io"],CDS_AP:["cds-ap-web-oceania.agora.io","cds-ap-web-oceania2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oceania.agora.io","sua-ap-web-oceania2.agora.io"],UAP_AP:["uap-ap-web-oceania.agora.io","uap-ap-web-oceania2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oceania.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oceania.agora.io"],LOG_UPLOAD_SERVER:["logservice-oceania.agora.io"],PROXY_SERVER_TYPE3:["oceania.webrtc-cloud-proxy.sd-rtn.com"]},SOUTH_AMERICA:{CODE:MP.SOUTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-south-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-south-america.agora.io"],PROXY_CS:["proxy-ap-web-south-america.agora.io"],CDS_AP:["cds-ap-web-south-america.agora.io","cds-ap-web-south-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-south-america.agora.io","sua-ap-web-south-america2.agora.io"],UAP_AP:["uap-ap-web-south-america.agora.io","uap-ap-web-south-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-south-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-south-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-america.agora.io"],PROXY_SERVER_TYPE3:["south-america.webrtc-cloud-proxy.sd-rtn.com"]},AFRICA:{CODE:MP.AFRICA,WEBCS_DOMAIN:["ap-web-1-africa.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-africa.agora.io"],PROXY_CS:["proxy-ap-web-africa.agora.io"],CDS_AP:["cds-ap-web-africa.agora.io","cds-ap-web-africa2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-africa.agora.io","sua-ap-web-africa2.agora.io"],UAP_AP:["uap-ap-web-africa.agora.io","uap-ap-web-africa2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-africa.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-africa.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-africa.agora.io"],PROXY_SERVER_TYPE3:["africa.webrtc-cloud-proxy.sd-rtn.com"]}};let BP,VP,QP,xP,FP,GP,jP,YP;zw&&(UP.CHINA={CODE:MP.CHINA,WEBCS_DOMAIN:["webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["proxy-web.ap.sd-rtn.com"],CDS_AP:["cds-web-2.ap.sd-rtn.com","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-web-2.ap.sd-rtn.com","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-web-2.ap.sd-rtn.com","uap-web-4.ap.sd-rtn.com"],EVENT_REPORT_DOMAIN:["web-3.statscollector.sd-rtn.com"],EVENT_REPORT_BACKUP_DOMAIN:["web-4.statscollector.sd-rtn.com"],LOG_UPLOAD_SERVER:["logservice-china.agora.io"],PROXY_SERVER_TYPE3:["east-cn.webrtc-cloud-proxy.sd-rtn.com"]}),function(e){e.UPDATE_BITRATE_LIMIT="update_bitrate_limit"}(BP||(BP={}));class HP extends Ew{constructor(e,t){super(),tD(this,"onICEConnectionStateChange",void 0),tD(this,"onConnectionStateChange",void 0),tD(this,"onDTLSTransportStateChange",void 0),tD(this,"onDTLSTransportError",void 0),tD(this,"onICETransportStateChange",void 0),tD(this,"onFirstAudioReceived",void 0),tD(this,"onFirstVideoReceived",void 0),tD(this,"onFirstAudioDecoded",void 0),tD(this,"onFirstVideoDecoded",void 0),tD(this,"onSelectedLocalCandidateChanged",void 0),tD(this,"onSelectedRemoteCandidateChanged",void 0)}}!function(e){e.SEND="sendonly",e.RECV="recvonly",e.SENDRECV="sendrecv",e.INACTIVE="inactive"}(VP||(VP={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(QP||(QP={})),function(e){e.LocalVideoTrack="videoTrack",e.LocalAudioTrack="audioTrack",e.LocalVideoLowTrack="videoLowTrack"}(xP||(xP={})),function(e){e.New="new",e.Connected="connected",e.Reconnecting="reconnecting",e.Disconnected="disconnected"}(FP||(FP={})),function(e){e.StateChange="stateChange",e.IceConnectionStateChange="iceConnectionStateChange",e.RequestMuteLocal="requestMuteLocal",e.RequestUnmuteLocal="requestUnmuteLocal",e.RequestRePublish="requestRePublish",e.RequestReSubscribe="requestReSubscribe",e.RequestUploadStats="requestUploadStats",e.MediaReconnectStart="MediaReconnectStart",e.MediaReconnectEnd="MediaReconnectEnd",e.NeedSignalRTT="NeedSignalRTT",e.RequestRestartICE="RequestRestartIce",e.PeerConnectionStateChange="PeerConnectionStateChange",e.RequestReconnect="RequestReconnect",e.RequestReconnectPC="RequestReconnectPC",e.RequestUnpublishForReconnectPC="RequestUnpublishForReconnectPC",e.P2PLost="P2PLost",e.UpdateVideoEncoder="UpdateVideoEncoder",e.ConnectionTypeChange="ConnectionTypeChange"}(GP||(GP={})),function(e){e.ONLINE="ONLINE",e.OFFLINE="OFFLINE"}(jP||(jP={})),function(e){e.NETWORK_STATE_CHANGE="NETWORK_STATE_CHANGE",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE"}(YP||(YP={}));const KP={join:["startJoin","startRequestAp","startJoinGateway","finishJoin"],publish:["startPublish"]};let WP,JP;!function(e){e.ON_TRACK="on_track",e.ON_NODE="on_node"}(WP||(WP={})),function(e){e.REQUEST_UPDATE_CONSTRAINTS="request_update_constraints",e.REQUEST_CONSTRAINTS="request_constraints"}(JP||(JP={}));const qP={getDisplayMedia:!1,getStreamFromExtension:!1,supportUnifiedPlan:!1,supportMinBitrate:!1,supportSetRtpSenderParameters:!1,supportDualStream:!0,webAudioMediaStreamDest:!1,supportReplaceTrack:!1,supportWebGL:!1,webAudioWithAEC:!1,supportRequestFrame:!1,supportShareAudio:!1,supportDualStreamEncoding:!1};function XP(){return qP}var zP="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,ZP=Gi,$P=qi,ek=n.RangeError,tk=function(e){if(void 0===e)return 0;var t=ZP(e),i=$P(t);if(t!==i)throw ek("Wrong length or index");return i},ik=n.Array,nk=Math.abs,rk=Math.pow,ok=Math.floor,sk=Math.log,ak=Math.LN2,ck={pack:function(e,t,i){var n,r,o,s=ik(i),a=8*i-t-1,c=(1<<a)-1,A=c>>1,d=23===t?rk(2,-24)-rk(2,-77):0,u=e<0||0===e&&1/e<0?1:0,E=0;for((e=nk(e))!=e||e===1/0?(r=e!=e?1:0,n=c):(n=ok(sk(e)/ak),e*(o=rk(2,-n))<1&&(n--,o*=2),(e+=n+A>=1?d/o:d*rk(2,1-A))*o>=2&&(n++,o/=2),n+A>=c?(r=0,n=c):n+A>=1?(r=(e*o-1)*rk(2,t),n+=A):(r=e*rk(2,A-1)*rk(2,t),n=0));t>=8;)s[E++]=255&r,r/=256,t-=8;for(n=n<<t|r,a+=t;a>0;)s[E++]=255&n,n/=256,a-=8;return s[--E]|=128*u,s},unpack:function(e,t){var i,n=e.length,r=8*n-t-1,o=(1<<r)-1,s=o>>1,a=r-7,c=n-1,A=e[c--],d=127&A;for(A>>=7;a>0;)d=256*d+e[c--],a-=8;for(i=d&(1<<-a)-1,d>>=-a,a+=t;a>0;)i=256*i+e[c--],a-=8;if(0===d)d=1-s;else{if(d===o)return i?NaN:A?-1/0:1/0;i+=rk(2,t),d-=s}return(A?-1:1)*i*rk(2,d-t)}},Ak=Pe,dk=Ki,uk=zi,Ek=ct,lk=St,hk=I,pk=Ki,_k=zi,Ik=function(e,t,i){var n=Ek(t);n in e?lk.f(e,n,hk(0,i)):e[n]=i},gk=n.Array,fk=Math.max,Rk=function(e,t,i){for(var n=_k(e),r=pk(t,n),o=pk(void 0===i?n:i,n),s=gk(fk(o-r,0)),a=0;r<o;r++,a++)Ik(s,a,e[r]);return s.length=a,s},Ck=n,Tk=m,mk=s,Sk=zP,Ok=yi,vk=Ft,Nk=Yn,yk=o,Dk=Ar,wk=Gi,bk=qi,Lk=tk,Pk=ck,kk=Pl,Mk=zn,Uk=Qi.f,Bk=St.f,Vk=Rk,Qk=tr,xk=Ok.PROPER,Fk=Ok.CONFIGURABLE,Gk=Ti.get,jk=Ti.set,Yk="ArrayBuffer",Hk="Wrong index",Kk=Ck.ArrayBuffer,Wk=Kk,Jk=Wk&&Wk.prototype,qk=Ck.DataView,Xk=qk&&qk.prototype,zk=Object.prototype,Zk=Ck.Array,$k=Ck.RangeError,eM=Tk((function(e){for(var t=Ak(this),i=uk(t),n=arguments.length,r=dk(n>1?arguments[1]:void 0,i),o=n>2?arguments[2]:void 0,s=void 0===o?i:dk(o,i);s>r;)t[r++]=e;return t})),tM=Tk([].reverse),iM=Pk.pack,nM=Pk.unpack,rM=function(e){return[255&e]},oM=function(e){return[255&e,e>>8&255]},sM=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},aM=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},cM=function(e){return iM(e,23,4)},AM=function(e){return iM(e,52,8)},dM=function(e,t){Bk(e.prototype,t,{get:function(){return Gk(this)[t]}})},uM=function(e,t,i,n){var r=Lk(i),o=Gk(e);if(r+t>o.byteLength)throw $k(Hk);var s=Gk(o.buffer).bytes,a=r+o.byteOffset,c=Vk(s,a,a+t);return n?c:tM(c)},EM=function(e,t,i,n,r,o){var s=Lk(i),a=Gk(e);if(s+t>a.byteLength)throw $k(Hk);for(var c=Gk(a.buffer).bytes,A=s+a.byteOffset,d=n(+r),u=0;u<t;u++)c[A+u]=d[o?u:t-u-1]};if(Sk){var lM=xk&&Kk.name!==Yk;if(yk((function(){Kk(1)}))&&yk((function(){new Kk(-1)}))&&!yk((function(){return new Kk,new Kk(1.5),new Kk(NaN),lM&&!Fk})))lM&&Fk&&vk(Kk,"name",Yk);else{(Wk=function(e){return Dk(this,Jk),new Kk(Lk(e))}).prototype=Jk;for(var hM,pM=Uk(Kk),_M=0;pM.length>_M;)(hM=pM[_M++])in Wk||vk(Wk,hM,Kk[hM]);Jk.constructor=Wk}Mk&&kk(Xk)!==zk&&Mk(Xk,zk);var IM=new qk(new Wk(2)),gM=Tk(Xk.setInt8);IM.setInt8(0,2147483648),IM.setInt8(1,2147483649),!IM.getInt8(0)&&IM.getInt8(1)||Nk(Xk,{setInt8:function(e,t){gM(this,e,t<<24>>24)},setUint8:function(e,t){gM(this,e,t<<24>>24)}},{unsafe:!0})}else Jk=(Wk=function(e){Dk(this,Jk);var t=Lk(e);jk(this,{bytes:eM(Zk(t),0),byteLength:t}),mk||(this.byteLength=t)}).prototype,Xk=(qk=function(e,t,i){Dk(this,Xk),Dk(e,Jk);var n=Gk(e).byteLength,r=wk(t);if(r<0||r>n)throw $k("Wrong offset");if(r+(i=void 0===i?n-r:bk(i))>n)throw $k("Wrong length");jk(this,{buffer:e,byteLength:i,byteOffset:r}),mk||(this.buffer=e,this.byteLength=i,this.byteOffset=r)}).prototype,mk&&(dM(Wk,"byteLength"),dM(qk,"buffer"),dM(qk,"byteLength"),dM(qk,"byteOffset")),Nk(Xk,{getInt8:function(e){return uM(this,1,e)[0]<<24>>24},getUint8:function(e){return uM(this,1,e)[0]},getInt16:function(e){var t=uM(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=uM(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return aM(uM(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return aM(uM(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return nM(uM(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return nM(uM(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){EM(this,1,e,rM,t)},setUint8:function(e,t){EM(this,1,e,rM,t)},setInt16:function(e,t){EM(this,2,e,oM,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){EM(this,2,e,oM,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){EM(this,4,e,sM,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){EM(this,4,e,sM,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){EM(this,4,e,cM,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){EM(this,8,e,AM,t,arguments.length>2?arguments[2]:void 0)}});Qk(Wk,Yk),Qk(qk,"DataView");var fM={ArrayBuffer:Wk,DataView:qk},RM=Fn,CM=m,TM=o,mM=wt,SM=Ki,OM=qi,vM=Po,NM=fM.ArrayBuffer,yM=fM.DataView,DM=yM.prototype,wM=CM(NM.prototype.slice),bM=CM(DM.getUint8),LM=CM(DM.setUint8);RM({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:TM((function(){return!new NM(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(wM&&void 0===t)return wM(mM(this),e);for(var i=mM(this).byteLength,n=SM(e,i),r=SM(void 0===t?i:t,i),o=new(vM(this,NM))(OM(r-n)),s=new yM(this),a=new yM(o),c=0;n<r;)LM(a,c++,bM(s,n++));return o}});var PM,kM,MM,UM={exports:{}},BM=zP,VM=s,QM=n,xM=Q,FM=F,GM=Ue,jM=Nr,YM=Ee,HM=Ft,KM=Gt.exports,WM=St.f,JM=K,qM=Pl,XM=zn,zM=Ze,ZM=Fe,$M=QM.Int8Array,eU=$M&&$M.prototype,tU=QM.Uint8ClampedArray,iU=tU&&tU.prototype,nU=$M&&qM($M),rU=eU&&qM(eU),oU=Object.prototype,sU=QM.TypeError,aU=zM("toStringTag"),cU=ZM("TYPED_ARRAY_TAG"),AU=ZM("TYPED_ARRAY_CONSTRUCTOR"),dU=BM&&!!XM&&"Opera"!==jM(QM.opera),uU=!1,EU={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},lU={BigInt64Array:8,BigUint64Array:8},hU=function(e){if(!FM(e))return!1;var t=jM(e);return GM(EU,t)||GM(lU,t)};for(PM in EU)(MM=(kM=QM[PM])&&kM.prototype)?HM(MM,AU,kM):dU=!1;for(PM in lU)(MM=(kM=QM[PM])&&kM.prototype)&&HM(MM,AU,kM);if((!dU||!xM(nU)||nU===Function.prototype)&&(nU=function(){throw sU("Incorrect invocation")},dU))for(PM in EU)QM[PM]&&XM(QM[PM],nU);if((!dU||!rU||rU===oU)&&(rU=nU.prototype,dU))for(PM in EU)QM[PM]&&XM(QM[PM].prototype,rU);if(dU&&qM(iU)!==rU&&XM(iU,rU),VM&&!GM(rU,aU))for(PM in uU=!0,WM(rU,aU,{get:function(){return FM(this)?this[cU]:void 0}}),EU)QM[PM]&&HM(QM[PM],cU,PM);var pU={NATIVE_ARRAY_BUFFER_VIEWS:dU,TYPED_ARRAY_CONSTRUCTOR:AU,TYPED_ARRAY_TAG:uU&&cU,aTypedArray:function(e){if(hU(e))return e;throw sU("Target is not a typed array")},aTypedArrayConstructor:function(e){if(xM(e)&&(!XM||JM(nU,e)))return e;throw sU(YM(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,i,n){if(VM){if(i)for(var r in EU){var o=QM[r];if(o&&GM(o.prototype,e))try{delete o.prototype[e]}catch(i){try{o.prototype[e]=t}catch(e){}}}rU[e]&&!i||KM(rU,e,i?t:dU&&eU[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,i){var n,r;if(VM){if(XM){if(i)for(n in EU)if((r=QM[n])&&GM(r,e))try{delete r[e]}catch(e){}if(nU[e]&&!i)return;try{return KM(nU,e,i?t:dU&&nU[e]||t)}catch(e){}}for(n in EU)!(r=QM[n])||r[e]&&!i||KM(r,e,t)}},isView:function(e){if(!FM(e))return!1;var t=jM(e);return"DataView"===t||GM(EU,t)||GM(lU,t)},isTypedArray:hU,TypedArray:nU,TypedArrayPrototype:rU},_U=n,IU=o,gU=so,fU=pU.NATIVE_ARRAY_BUFFER_VIEWS,RU=_U.ArrayBuffer,CU=_U.Int8Array,TU=!fU||!IU((function(){CU(1)}))||!IU((function(){new CU(-1)}))||!gU((function(e){new CU,new CU(null),new CU(1.5),new CU(e)}),!0)||IU((function(){return 1!==new CU(new RU(2),1,void 0).length})),mU=F,SU=Math.floor,OU=Number.isInteger||function(e){return!mU(e)&&isFinite(e)&&SU(e)===e},vU=Gi,NU=n.RangeError,yU=n.RangeError,DU=function(e,t){var i=function(e){var t=vU(e);if(t<0)throw NU("The argument can't be less than 0");return t}(e);if(i%t)throw yU("Wrong offset");return i},wU=lr,bU=d,LU=Do,PU=Pe,kU=zi,MU=Qr,UU=Lr,BU=gr,VU=pU.aTypedArrayConstructor,QU=N,xU=n,FU=Array.isArray||function(e){return"Array"==QU(e)},GU=Oo,jU=F,YU=Ze("species"),HU=xU.Array,KU=lr,WU=P,JU=Pe,qU=zi,XU=function(e,t){return new(function(e){var t;return FU(e)&&(t=e.constructor,(GU(t)&&(t===HU||FU(t.prototype))||jU(t)&&null===(t=t[YU]))&&(t=void 0)),void 0===t?HU:t}(e))(0===t?0:t)},zU=m([].push),ZU=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,A,d,u){for(var E,l,h=JU(c),p=WU(h),_=KU(A,d),I=qU(p),g=0,f=u||XU,R=t?f(c,I):i||s?f(c,0):void 0;I>g;g++)if((a||g in p)&&(l=_(E=p[g],g,h),e))if(t)R[g]=l;else if(l)switch(e){case 3:return!0;case 5:return E;case 6:return g;case 2:zU(R,E)}else switch(e){case 4:return!1;case 7:zU(R,E)}return o?-1:n||r?r:R}},$U={forEach:ZU(0),map:ZU(1),filter:ZU(2),some:ZU(3),every:ZU(4),find:ZU(5),findIndex:ZU(6),filterReject:ZU(7)},eB=Fn,tB=n,iB=d,nB=s,rB=TU,oB=pU,sB=fM,aB=Ar,cB=I,AB=Ft,dB=OU,uB=qi,EB=tk,lB=DU,hB=ct,pB=Ue,_B=Nr,IB=F,gB=de,fB=jE,RB=K,CB=zn,TB=Qi.f,mB=function(e){var t,i,n,r,o,s,a=LU(this),c=PU(e),A=arguments.length,d=A>1?arguments[1]:void 0,u=void 0!==d,E=UU(c);if(E&&!BU(E))for(s=(o=MU(c,E)).next,c=[];!(r=bU(s,o)).done;)c.push(r.value);for(u&&A>2&&(d=wU(d,arguments[2])),i=kU(c),n=new(VU(a))(i),t=0;i>t;t++)n[t]=u?d(c[t],t):c[t];return n},SB=$U.forEach,OB=sr,vB=St,NB=r,yB=xh,DB=Ti.get,wB=Ti.set,bB=vB.f,LB=NB.f,PB=Math.round,kB=tB.RangeError,MB=sB.ArrayBuffer,UB=MB.prototype,BB=sB.DataView,VB=oB.NATIVE_ARRAY_BUFFER_VIEWS,QB=oB.TYPED_ARRAY_CONSTRUCTOR,xB=oB.TYPED_ARRAY_TAG,FB=oB.TypedArray,GB=oB.TypedArrayPrototype,jB=oB.aTypedArrayConstructor,YB=oB.isTypedArray,HB="BYTES_PER_ELEMENT",KB="Wrong length",WB=function(e,t){jB(e);for(var i=0,n=t.length,r=new e(n);n>i;)r[i]=t[i++];return r},JB=function(e,t){bB(e,t,{get:function(){return DB(this)[t]}})},qB=function(e){var t;return RB(UB,e)||"ArrayBuffer"==(t=_B(e))||"SharedArrayBuffer"==t},XB=function(e,t){return YB(e)&&!gB(t)&&t in e&&dB(+t)&&t>=0},zB=function(e,t){return t=hB(t),XB(e,t)?cB(2,e[t]):LB(e,t)},ZB=function(e,t,i){return t=hB(t),!(XB(e,t)&&IB(i)&&pB(i,"value"))||pB(i,"get")||pB(i,"set")||i.configurable||pB(i,"writable")&&!i.writable||pB(i,"enumerable")&&!i.enumerable?bB(e,t,i):(e[t]=i.value,e)};nB?(VB||(NB.f=zB,vB.f=ZB,JB(GB,"buffer"),JB(GB,"byteOffset"),JB(GB,"byteLength"),JB(GB,"length")),eB({target:"Object",stat:!0,forced:!VB},{getOwnPropertyDescriptor:zB,defineProperty:ZB}),UM.exports=function(e,t,i){var n=e.match(/\d+$/)[0]/8,r=e+(i?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=tB[r],c=a,A=c&&c.prototype,d={},u=function(e,t){bB(e,t,{get:function(){return function(e,t){var i=DB(e);return i.view[o](t*n+i.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var o=DB(e);i&&(r=(r=PB(r))<0?0:r>255?255:255&r),o.view[s](t*n+o.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};VB?rB&&(c=t((function(e,t,i,r){return aB(e,A),yB(IB(t)?qB(t)?void 0!==r?new a(t,lB(i,n),r):void 0!==i?new a(t,lB(i,n)):new a(t):YB(t)?WB(c,t):iB(mB,c,t):new a(EB(t)),e,c)})),CB&&CB(c,FB),SB(TB(a),(function(e){e in c||AB(c,e,a[e])})),c.prototype=A):(c=t((function(e,t,i,r){aB(e,A);var o,s,a,d=0,E=0;if(IB(t)){if(!qB(t))return YB(t)?WB(c,t):iB(mB,c,t);o=t,E=lB(i,n);var l=t.byteLength;if(void 0===r){if(l%n)throw kB(KB);if((s=l-E)<0)throw kB(KB)}else if((s=uB(r)*n)+E>l)throw kB(KB);a=s/n}else a=EB(t),o=new MB(s=a*n);for(wB(e,{buffer:o,byteOffset:E,byteLength:s,length:a,view:new BB(o)});d<a;)u(e,d++)})),CB&&CB(c,FB),A=c.prototype=fB(GB)),A.constructor!==c&&AB(A,"constructor",c),AB(A,QB,c),xB&&AB(A,xB,r),d[r]=c,eB({global:!0,forced:c!=a,sham:!VB},d),HB in c||AB(c,HB,n),HB in A||AB(A,HB,n),OB(r)}):UM.exports=function(){},(0,UM.exports)("Uint8",(function(e){return function(t,i,n){return e(this,t,i,n)}}));var $B=zi,eV=Gi,tV=pU.aTypedArray;(0,pU.exportTypedArrayMethod)("at",(function(e){var t=tV(this),i=$B(t),n=eV(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:t[r]}));var iV=n,nV=d,rV=pU,oV=zi,sV=DU,aV=Pe,cV=o,AV=iV.RangeError,dV=iV.Int8Array,uV=dV&&dV.prototype,EV=uV&&uV.set,lV=rV.aTypedArray,hV=rV.exportTypedArrayMethod,pV=!cV((function(){var e=new Uint8ClampedArray(2);return nV(EV,e,{length:1,0:3},1),3!==e[1]})),_V=pV&&rV.NATIVE_ARRAY_BUFFER_VIEWS&&cV((function(){var e=new dV(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));hV("set",(function(e){lV(this);var t=sV(arguments.length>1?arguments[1]:void 0,1),i=aV(e);if(pV)return nV(EV,this,i,t);var n=this.length,r=oV(i),o=0;if(r+t>n)throw AV("Wrong length");for(;o<r;)this[t+o]=i[o++]}),!pV||_V);var IV=Rk,gV=Math.floor,fV=function(e,t){var i=e.length,n=gV(i/2);return i<8?RV(e,t):CV(e,fV(IV(e,0,n),t),fV(IV(e,n),t),t)},RV=function(e,t){for(var i,n,r=e.length,o=1;o<r;){for(n=o,i=e[o];n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==o++&&(e[n]=i)}return e},CV=function(e,t,i,n){for(var r=t.length,o=i.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?n(t[s],i[a])<=0?t[s++]:i[a++]:s<r?t[s++]:i[a++];return e},TV=fV,mV=W.match(/firefox\/(\d+)/i),SV=!!mV&&+mV[1],OV=/MSIE|Trident/.test(W),vV=W.match(/AppleWebKit\/(\d+)\./),NV=!!vV&&+vV[1],yV=n,DV=m,wV=o,bV=_e,LV=TV,PV=pU,kV=SV,MV=OV,UV=ee,BV=NV,VV=yV.Array,QV=PV.aTypedArray,xV=PV.exportTypedArrayMethod,FV=yV.Uint16Array,GV=FV&&DV(FV.prototype.sort),jV=!(!GV||wV((function(){GV(new FV(2),null)}))&&wV((function(){GV(new FV(2),{})}))),YV=!!GV&&!wV((function(){if(UV)return UV<74;if(kV)return kV<67;if(MV)return!0;if(BV)return BV<602;var e,t,i=new FV(516),n=VV(516);for(e=0;e<516;e++)t=e%4,i[e]=515-e,n[e]=e-2*t+3;for(GV(i,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(i[e]!==n[e])return!0}));xV("sort",(function(e){return void 0!==e&&bV(e),YV?GV(this,e):LV(QV(this),function(e){return function(t,i){return void 0!==e?+e(t,i)||0:i!=i?-1:t!=t?1:0===t&&0===i?1/t>0&&1/i<0?1:-1:t>i}}(e))}),!YV||jV);var HV=sr,KV=fM.ArrayBuffer;let WV;Fn({global:!0,forced:n.ArrayBuffer!==KV},{ArrayBuffer:KV}),HV("ArrayBuffer"),function(e){e[e.CHOOSE_SERVER=11]="CHOOSE_SERVER",e[e.CLOUD_PROXY=18]="CLOUD_PROXY",e[e.CLOUD_PROXY_5=20]="CLOUD_PROXY_5",e[e.CLOUD_PROXY_FALLBACK=26]="CLOUD_PROXY_FALLBACK"}(WV||(WV={}));var JV=eA,qV=Array.isArray||function(e){return"Array"==JV(e)},XV=Lc,zV=qV,ZV=NR,$V=lA,eQ=md("species"),tQ=XV.Array,iQ=function(e,t){return new(function(e){var t;return zV(e)&&(t=e.constructor,(ZV(t)&&(t===tQ||zV(t.prototype))||$V(t)&&null===(t=t[eQ]))&&(t=void 0)),void 0===t?tQ:t}(e))(0===t?0:t)},nQ=au,rQ=sA,oQ=rd,sQ=ju,aQ=iQ,cQ=Dc([].push),AQ=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,A,d,u){for(var E,l,h=oQ(c),p=rQ(h),_=nQ(A,d),I=sQ(p),g=0,f=u||aQ,R=t?f(c,I):i||s?f(c,0):void 0;I>g;g++)if((a||g in p)&&(l=_(E=p[g],g,h),e))if(t)R[g]=l;else if(l)switch(e){case 3:return!0;case 5:return E;case 6:return g;case 2:cQ(R,E)}else switch(e){case 4:return!1;case 7:cQ(R,E)}return o?-1:n||r?r:R}},dQ={forEach:AQ(0),map:AQ(1),filter:AQ(2),some:AQ(3),every:AQ(4),find:AQ(5),findIndex:AQ(6),filterReject:AQ(7)},uQ=dQ.forEach,EQ=Zu("forEach")?[].forEach:function(e){return uQ(this,e,arguments.length>1?arguments[1]:void 0)};Bu({target:"Array",proto:!0,forced:[].forEach!=EQ},{forEach:EQ});var lQ=rE("Array").forEach,hQ=_I,pQ=ad,_Q=wc,IQ=lQ,gQ=Array.prototype,fQ={DOMTokenList:!0,NodeList:!0},RQ=rd,CQ=D_;Bu({target:"Object",stat:!0,forced:Tc((function(){CQ(1)}))},{keys:function(e){return CQ(RQ(e))}});var TQ=hA.Object.keys,mQ=AE,SQ=Bu,OQ=qV,vQ=Dc([].reverse),NQ=[1,2];SQ({target:"Array",proto:!0,forced:String(NQ)===String(NQ.reverse())},{reverse:function(){return OQ(this)&&(this.length=this.length),vQ(this)}});var yQ=rE("Array").reverse,DQ=wc,wQ=yQ,bQ=Array.prototype,LQ=Tc,PQ=NA,kQ=md("species"),MQ=function(e){return PQ>=51||!LQ((function(){var t=[];return(t.constructor={})[kQ]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},UQ=Bu,BQ=Lc,VQ=qV,QQ=NR,xQ=lA,FQ=$p,GQ=ju,jQ=uA,YQ=Cb,HQ=md,KQ=kR,WQ=MQ("slice"),JQ=HQ("species"),qQ=BQ.Array,XQ=Math.max;UQ({target:"Array",proto:!0,forced:!WQ},{slice:function(e,t){var i,n,r,o=jQ(this),s=GQ(o),a=FQ(e,s),c=FQ(void 0===t?s:t,s);if(VQ(o)&&(i=o.constructor,(QQ(i)&&(i===qQ||VQ(i.prototype))||xQ(i)&&null===(i=i[JQ]))&&(i=void 0),i===qQ||void 0===i))return KQ(o,a,c);for(n=new(void 0===i?qQ:i)(XQ(c-a,0)),r=0;a<c;a++,r++)a in o&&YQ(n,r,o[a]);return n.length=r,n}});var zQ=rE("Array").slice,ZQ=wc,$Q=zQ,ex=Array.prototype;function tx(e,t,i,n,r){var o,s,a,c={};return function(e){var t=e.forEach;return e===gQ||_Q(gQ,e)&&t===gQ.forEach||pQ(fQ,hQ(e))?IQ:t}(o=TQ(n)).call(o,(function(e){c[e]=n[e]})),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=mQ(s=function(e){var t=e.reverse;return e===bQ||DQ(bQ,e)&&t===bQ.reverse?wQ:t}(a=function(e){var t=e.slice;return e===ex||ZQ(ex,e)&&t===ex.slice?$Q:t}(i).call(i)).call(a)).call(s,(function(i,n){return n(e,t,i)||i}),c),r&&void 0!==c.initializer&&(c.value=c.initializer?c.initializer.call(r):void 0,c.initializer=void 0),void 0===c.initializer&&(eD(e,t,c),c=null),c}var ix=rE("Array").values,nx=_I,rx=ad,ox=wc,sx=ix,ax=Array.prototype,cx={DOMTokenList:!0,NodeList:!0},Ax=function(e){var t=e.values;return e===ax||ox(ax,e)&&t===ax.values||rx(cx,nx(e))?sx:t},dx=rE("Array").keys,ux=_I,Ex=ad,lx=wc,hx=dx,px=Array.prototype,_x={DOMTokenList:!0,NodeList:!0},Ix=function(e){var t=e.keys;return e===px||lx(px,e)&&t===px.keys||Ex(_x,ux(e))?hx:t};function gx(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fx(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gx(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gx(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let Rx=0,Cx=0;function Tx(e,t,i){return new Mm(((n,r)=>{t.timeout=t.timeout||cb("HTTP_CONNECT_TIMEOUT"),t.responseType=t.responseType||"json",t.data&&!i?(t.data=JSON.stringify(t.data),Rx+=mG(t.data)):i&&(t.data.size?Rx+=t.data.size:t.data instanceof FormData?Rx+=function(e){let t=0;return/DingTalk/i.test(navigator.userAgent)&&e.realFormData&&(e=e.realFormData),e.forEach((e=>{t+="string"==typeof e?mG(e):e.size})),t+138}(t.data):Rx+=mG(JSON.stringify(t.data))),t.headers=t.headers||{},t.headers["Content-Type"]=t.headers["Content-Type"]||"application/json",t.method="POST",t.url=e,dw.request(t).then((e=>{"string"==typeof e.data?Cx+=mG(e.data):e.data instanceof ArrayBuffer||e.data instanceof Uint8Array?Cx+=e.data.byteLength:Cx+=mG(JSON.stringify(e.data)),n(e.data)})).catch((e=>{dw.isCancel(e)?r(new pw(hw.OPERATION_ABORTED,"cancel token canceled")):"ECONNABORTED"===e.code?r(new pw(hw.NETWORK_TIMEOUT,e.message)):e.response?r(new pw(hw.NETWORK_RESPONSE_ERROR,e.response.status)):r(new pw(hw.NETWORK_ERROR,e.message))}))}))}async function mx(e,t){const i=new Blob([t.data],{type:"buffer"});return await Tx(e,fx(fx({},t),{},{data:i,headers:{"Content-Type":"application/octet-stream"}}),!0)}const Sx=new class extends Ew{set networkState(e){mw.info("[".concat(this._moduleName,"]")+"network state changed, "+this._networkState+" -> "+e),this.emit(YP.NETWORK_STATE_CHANGE,e,this._networkState),e===jP.ONLINE?this.emit(YP.ONLINE):e===jP.OFFLINE&&(this.onlineWaiter=new Mm((e=>{this.once(YP.ONLINE,(()=>{this.onlineWaiter=void 0,e(jP.ONLINE)}))})),this.emit(YP.OFFLINE)),this._networkState=e}get networkState(){return this._networkState}constructor(){super(),tD(this,"_moduleName","network-indicator"),tD(this,"_networkState",jP.ONLINE),tD(this,"onlineWaiter",void 0),window.addEventListener("online",(()=>{this.networkState=jP.ONLINE})),window.addEventListener("offline",(()=>{this.networkState=jP.OFFLINE}))}};let Ox=!1;const vx=new class extends Ew{constructor(){super(...arguments),tD(this,"onAutoplayFailed",void 0),tD(this,"onAudioAutoplayFailed",void 0)}};function Nx(){const e=Dy();if(!Ox){const t=i=>{i.preventDefault(),Ox=!1,"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.removeEventListener("touchstart",t,!0),document.body.removeEventListener("mousedown",t,!0)):document.body.removeEventListener("click",t,!0)};Ox=!0,"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.addEventListener("touchstart",t,!0),document.body.addEventListener("mousedown",t,!0)):document.body.addEventListener("click",t,!0),mw.info("detect media autoplay failed, document: https://docs.agora.io/cn/Voice/autoplay_policy_web_ng?platform=Web"),vx.onAutoplayFailed?vx.onAutoplayFailed():vx.onAudioAutoplayFailed?mw.warning("AgoraRTC.onAudioAutoplayFailed has been deprecated in favor of AgoraRTC.onAutoplayFailed.\n\n  Please refer to the Agora document to migrate the newer API, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web ."):mw.warning("We have detected a media autoplay failed event, and found out that you haven't implemented AgoraRTC.onAutoplayFailed callback yet.\n\n  It will cause audio/video element not playing automatically on some browsers without user interaction, possibly hurting user experiences.\n\n  Please refer to the Agora document to properly handle autoplay failed event, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web ."),vx.emit("autoplay-failed")}}var yx;function Dx(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function wx(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dx(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Dx(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function bx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{report:Px};return function(t,i,n){const r=t[i];if("function"==typeof r){const o="AgoraRTCClient"===t.constructor.name?"Client":t.constructor.name;n.value=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const a=e.report.reportApiInvoke(this._sessionId||null,{name:"".concat(o,".").concat(i),options:n,tag:bL.TRACER});try{const e=r.apply(this,n);return a.onSuccess(),e}catch(e){throw a.onError(e),e}}}return n}}function Lx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{report:Px};return function(t,i,n){const r=t[i];if("function"==typeof r){const o="AgoraRTCClient"===t.constructor.name?"Client":t.constructor.name;n.value=async function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const a=e.report.reportApiInvoke(this._sessionId||null,{name:"".concat(o,".").concat(i),options:n,tag:bL.TRACER});try{const e=await r.apply(this,n);return a.onSuccess(),e}catch(e){throw a.onError(e),e}}}return n}}const Px=new(Ww("AgoraRTCEventReport")(yx=class{constructor(){tD(this,"baseInfoMap",new Map),tD(this,"proxyServer",void 0),tD(this,"clientList",_b),tD(this,"eventUploadTimer",void 0),tD(this,"setSessionIdTimer",void 0),tD(this,"url",void 0),tD(this,"backupUrl",void 0),tD(this,"keyEventUploadPendingItems",[]),tD(this,"normalEventUploadPendingItems",[]),tD(this,"apiInvokeUploadPendingItems",[]),tD(this,"apiInvokeCount",0),tD(this,"ltsList",[]),tD(this,"lastSendNormalEventTime",Date.now()),tD(this,"customReportCounterTimer",void 0),tD(this,"customReportCount",0),tD(this,"extApiInvoke",(async e=>{for(const t of e){const e=wx(wx({},t),{},{sid:null,invokeId:++this.apiInvokeCount,tag:bL.TRACER});this.sendApiInvoke(e)}})),this.eventUploadTimer=window.setInterval(this.doSend.bind(this),cb("EVENT_REPORT_SEND_INTERVAL")),this.setSessionIdTimer=window.setInterval(this.appendSessionId.bind(this),cb("EVENT_REPORT_SEND_INTERVAL"))}adjustSessionStartTime(e){if(!this.baseInfoMap.has(e)&&!this.baseInfoMap.get(e))return mw.error("adjust session ".concat(e," start time, sid is not exist or info is undefined")),void Yw("error",this,"adjustSessionStartTime","adjust session ".concat(e," start time, sid is not exist or info is undefined"));const t=this.baseInfoMap.get(e),i=Date.now(),n=t.startTime;t.startTime=i,mw.debug("rewrite session ".concat(e," startTime: ").concat(i," , ").concat(i-n,"ms")),Yw("debug",this,"adjustSessionStartTime",void 0,"rewrite session ".concat(e," startTime: ").concat(i," , ").concat(i-n,"ms")),this.baseInfoMap.set(e,t)}reportApiInvoke(e,t,i){t.timeout=t.timeout||6e4,t.reportResult=void 0===t.reportResult||t.reportResult;const n=Date.now();this.apiInvokeCount+=1;const r=this.apiInvokeCount,o=()=>({tag:t.tag,invokeId:r,sid:e,name:t.name,apiInvokeTime:n,options:t.options,states:t.states||null}),s=!!cb("SHOW_REPORT_INVOKER_LOG");s&&mw.info("".concat(t.name," start"),t.options);let a=!1;SG(t.timeout).then((()=>{a||(this.sendApiInvoke(wx(wx({},o()),{},{error:hw.API_INVOKE_TIMEOUT,success:!1})),mw.debug("".concat(t.name," timeout")))}));const c=new pw(hw.UNEXPECTED_ERROR,"".concat(t.name,": this api invoke is end"));return{onSuccess:e=>{const n=()=>{if(a)throw c;return a=!0,this.sendApiInvoke(wx(wx({},o()),{},{success:!0},t.reportResult&&{result:e})),s&&mw.info("".concat(t.name," onSuccess")),e};return i?YG(n,t.name+"Success",i,(()=>a=!0)):n()},onError:e=>{const n=()=>{if(a)throw e;a=!0,this.sendApiInvoke(wx(wx({},o()),{},{success:!1,error:e.toString()})),s&&mw.info("".concat(t.name," onFailure"),e.toString())};return i?YG(n,t.name+"Error",i,(()=>a=!0)):n()}}}sessionInit(e,t){if(this.baseInfoMap.has(e))return;const i=Date.now(),n=this.createBaseInfo(e,i);n.cname=t.cname;const r=Object.assign({},{willUploadConsoleLog:cb("UPLOAD_LOG"),maxTouchPoints:navigator.maxTouchPoints,areaVersion:zw?"global":"oversea",areas:cb("AREAS")&&cb("AREAS").join(",")},t.extend),o=Date.now(),s=wx(wx({},n),{},{eventType:NL.SESSION_INIT,appid:t.appid,browser:navigator.userAgent,build:qw,lts:o,elapse:o-i,extend:JSON.stringify(r),mode:t.mode,process:cb("PROCESS_ID"),success:!0,version:Xw});this.send({type:yL.SESSION,data:s},!0)}joinChooseServer(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.JOIN_CHOOSE_SERVER,lts:r,eventElapse:r-t.lts,chooseServerAddr:t.csAddr,errorCode:t.ec,elapse:r-i.startTime,success:t.succ,chooseServerAddrList:JSON.stringify(t.serverList),uid:t.uid?parseInt(t.uid):null,cid:t.cid?parseInt(t.cid):null,chooseServerIp:t.csIp||"",opid:t.opid,unilbsServerIds:t.unilbsServerIds,extend:t.extend||void 0});this.send({type:yL.JOIN_CHOOSE_SERVER,data:o},!0)}reqUserAccount(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.REQ_USER_ACCOUNT,lts:r,success:t.success,serverAddress:t.serverAddr,stringUid:t.stringUid,uid:t.uid,errorCode:t.errorCode,elapse:r-i.startTime,eventElapse:r-t.lts,extend:JSON.stringify(t.extend)});this.send({type:yL.REQ_USER_ACCOUNT,data:o},!0)}joinGateway(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info;t.vid&&(n.vid=t.vid),n.uid=t.uid,n.cid=t.cid;const r=Date.now(),{firstSuccess:o,avoidJoinStartTime:s,isProxy:a,addr:c}=t,A=r-(o&&s?s:i.startTime),d=wx(wx({},n),{},{eventType:NL.JOIN_GATEWAY,lts:r,gatewayAddr:t.addr,success:t.succ,errorCode:t.ec,elapse:A,eventElapse:r-t.lts,firstSuccess:o}),u=d.success?1:0;if(t.succ&&(i.lastJoinSuccessTime=r),o)this.send({type:yL.JOIN_GATEWAT,data:d},!0);else{let e;if(c)if(a){const t=c.match(/h=(\d{1,3}-){3}\d{1,3}/g),i=c.match(/p=[0-9]{1,6}/g);e={isSuccess:u,gatewayIp:t&&t.length?t[0].split("=")[1].replace(/-/g,"."):"",port:i&&i.length?i[0].split("=")[1]:"",isProxy:a?1:0}}else{const t=c.match(/wss:\/\/(\d{1,3}-){3}\d{1,3}/g),i=c.match(/:[0-9]{1,6}/g);e={isSuccess:u,gatewayIp:t&&t.length?t[0].split("//")[1].replace(/-/g,"."):"",port:i&&i.length?i[0].split(":")[1]:"",isProxy:a?1:0}}else e={isSuccess:u,gatewayIp:"",port:"",isProxy:a?1:0};delete d.success,delete d.eventType,delete d.firstSuccess,d.vid=Number(d.vid);const t=Object.assign({},d,e,{eventType:NL.REJOIN_GATEWAY});this.send({type:yL.RE_JOIN_GATEWAY,data:t},!0)}}joinChannelTimeout(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=Date.now(),r=wx(wx({},i.info),{},{lts:n,timeout:t,elapse:n-i.startTime});this.send({type:yL.JOIN_CHANNEL_TIMEOUT,data:r},!0)}publish(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.PUBLISH,lts:r,eventElapse:t.eventElapse,elapse:r-i.startTime,success:t.succ,errorCode:t.ec,videoName:t.videoName,audioName:t.audioName,screenName:t.screenName,screenshare:t.screenshare,audio:t.audio,video:t.video,p2pid:t.p2pid,publishRequestid:t.publishRequestid});this.send({type:yL.PUBLISH,data:o},!0)}subscribe(e,t,i){const n=this.baseInfoMap.get(e);if(!n)return;const r=n.info,o=Date.now(),s=wx(wx({},r),{},{eventType:NL.SUBSCRIBE,lts:o,eventElapse:t.eventElapse,elapse:o-n.startTime,success:t.succ,errorCode:t.ec,video:t.video,audio:t.audio,subscribeRequestid:t.subscribeRequestid,p2pid:t.p2pid},i&&{extend:JSON.stringify({isMassSubscribe:!0})});"string"==typeof t.peerid?s.peerSuid=t.peerid:s.peer=t.peerid,this.send({type:yL.SUBSCRIBE,data:s},!0)}wsCompressorInit(e){var t;const i=[...Ix(t=this.baseInfoMap).call(t)],n=i.length?i[0]:"UnableToGetSid",r=this.baseInfoMap.get(n);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx({},o),{},{eventType:NL.WS_COMPRESSOR_INIT,lts:s,eventElapse:e.eventElapse,elapse:s-r.startTime,status:e.status?1:2});this.send({type:yL.WS_COMPRESSOR_INIT,data:a},!0)}firstRemoteFrame(e,t,i,n){const r=this.baseInfoMap.get(e);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx(wx({},o),n),{},{elapse:s-r.startTime,eventType:t,lts:s});this.send({type:i,data:a},!0)}onGatewayStream(e,t,i,n){const r=this.baseInfoMap.get(e);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx(wx({},o),n),{},{eventType:t,lts:s});this.send({type:i,data:a},!0)}streamSwitch(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.STREAM_SWITCH,lts:r,isDual:t.isdual,elapse:r-i.startTime,success:t.succ});this.send({type:yL.STREAM_SWITCH,data:o},!0)}requestProxyAppCenter(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.REQUEST_PROXY_APPCENTER,lts:r,eventElapse:r-t.lts,elapse:r-i.startTime,APAddr:t.APAddr,workerManagerList:t.workerManagerList,response:t.response,errorCode:t.ec,success:t.succ});this.send({type:yL.REQUEST_PROXY_APPCENTER,data:o},!0)}requestProxyWorkerManager(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.REQUEST_PROXY_WORKER_MANAGER,lts:r,eventElapse:r-t.lts,elapse:r-i.startTime,workerManagerAddr:t.workerManagerAddr,response:t.response,errorCode:t.ec,success:t.succ});this.send({type:yL.REQUEST_PROXY_WORKER_MANAGER,data:o},!0)}setProxyServer(e){this.proxyServer=e,e?mw.debug("reportProxyServerurl: ".concat(e)):mw.debug("disable reportProxyServerurl: ".concat(e)),Yw("debug",this,"setProxyServer",e)}peerPublishStatus(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{subscribeElapse:t.subscribeElapse,peer:t.peer,peerPublishDuration:Math.max(t.audioPublishDuration,t.videoPublishDuration),audiotag:t.audioPublishDuration>0?1:-1,videotag:t.videoPublishDuration>0?1:-1,lts:r,elapse:r-i.startTime,joinChannelSuccessElapse:r-(i.lastJoinSuccessTime||r)});this.send({type:yL.PEER_PUBLISH_STATUS,data:o},!0)}workerEvent(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now();(function(e,t,i){const n=e[t];if(!n||"string"!=typeof n)return[e];e[t]="";const r=mG(JSON.stringify(e));let o=0;const s=[];let a=0;for(let i=0;i<n.length;i++)a+=n.charCodeAt(i)<=127?1:3,a<=1300-r||(s[s.length]=TG(TG({},e),{},{[t]:n.substring(o,i)}),o=i,a=n.charCodeAt(i)<=127?1:3);return o!==n.length-1&&(s[s.length]=TG(TG({},e),{},{[t]:n.substring(o)})),s})(wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r,productType:"WebRTC"}),"payload").forEach((e=>this.send({type:yL.WORKER_EVENT,data:e},!0)))}apworkerEvent(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r});this.send({type:yL.AP_WORKER_EVENT,data:o},!0)}joinWebProxyAP(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r,extend:t.extend||void 0});this.send({type:yL.JOIN_WEB_PROXY_AP,data:o},!0)}WebSocketQuit(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r});this.send({type:yL.WEBSOCKET_QUIT,data:o},!0)}async sendCustomReportMessage(e,t){if(this.customReportCount+=t.length,this.customReportCount>cb("CUSTOM_REPORT_LIMIT"))throw new pw(hw.CUSTOM_REPORT_FREQUENCY_TOO_HIGH);this.customReportCounterTimer||(this.customReportCounterTimer=window.setInterval((()=>{this.customReportCount=0}),5e3));const i=t.map((t=>({type:yL.USER_ANALYTICS,data:wx({sid:e},t)}))),n={msgType:"EventMessages",sentTs:Math.round(Date.now()/1e3),payloads:i.map((e=>JSON.stringify(e)))};try{await this.postDataToStatsCollector(n)}catch(e){throw mw.error("send custom report message failed",e.toString()),new pw(hw.CUSTOM_REPORT_SEND_FAILED,e.message)}}autoplayFailed(e,t,i,n){if(!e)return;const r=this.baseInfoMap.get(e);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx({},o),{},{vid:void 0===o.vid?0:Number(o.vid),lts:s,elapse:s-r.startTime,cbRegistered:vx.onAutoplayFailed||vx.onAudioAutoplayFailed?1:-1,errorMsg:i,mediaType:t,trackId:n,extend:void 0});this.send({type:yL.AUTOPLAY_FAILED,data:a},!0)}sendApiInvoke(e){const t=cb("NOT_REPORT_EVENT");if(e.tag&&t.includes&&t.includes(e.tag))return!1;if(null===e.sid)return this.apiInvokeUploadPendingItems.push(e),!1;const i=this.baseInfoMap.get(e.sid);if(!i)return this.apiInvokeUploadPendingItems.push(e),!1;const{cname:n,uid:r,cid:o}=i.info;e.lts=e.lts||Date.now();const s={invokeId:e.invokeId,sid:e.sid,cname:n,cid:o,uid:r,lts:e.lts,success:e.success,elapse:e.lts-i.startTime,execElapse:e.lts-e.apiInvokeTime,apiName:e.name,options:e.options?JSON.stringify(e.options):void 0,execStates:e.states?JSON.stringify(e.states):void 0,execResult:e.result?JSON.stringify(e.result):void 0,errorCode:e.error?JSON.stringify(e.error):void 0};return this.send({type:yL.API_INVOKE,data:s},!1),!0}appendSessionId(){this.clientList.forEach((e=>{if(e._sessionId){const t=this.apiInvokeUploadPendingItems.length;for(let i=0;i<t;i++){const t=this.apiInvokeUploadPendingItems.shift();t&&(t.sid=e._sessionId,this.sendApiInvoke(Object.assign({},t)))}}}))}send(e,t){if(t)return this.keyEventUploadPendingItems.push(e),void this.sendItems(this.keyEventUploadPendingItems,!0);this.normalEventUploadPendingItems.push(e),this.normalEventUploadPendingItems.length>cb("NORMAL_EVENT_QUEUE_CAPACITY")&&this.normalEventUploadPendingItems.splice(0,1),this.normalEventUploadPendingItems.length>=10&&this.sendItems(this.normalEventUploadPendingItems,!1)}doSend(){this.keyEventUploadPendingItems.length>0&&this.sendItems(this.keyEventUploadPendingItems,!0),this.normalEventUploadPendingItems.length>0&&Date.now()-this.lastSendNormalEventTime>=5e3&&this.sendItems(this.normalEventUploadPendingItems,!1)}sendItems(e,t){const i=[],n=[];for(;e.length;){const t=e.shift();i.length<20?i.push(t):n.push(t)}e.push(...n);for(const e of[...i]){var r;-1!==this.ltsList.indexOf(e.data.lts)?(e.data.lts=this.ltsList[this.ltsList.length-1]+1,this.ltsList.push(e.data.lts)):(this.ltsList.push(e.data.lts),AL(r=this.ltsList).call(r,((e,t)=>e-t)))}t||(this.lastSendNormalEventTime=Date.now());const o={msgType:"EventMessages",sentTs:Math.round(Date.now()/1e3),payloads:i.map((e=>JSON.stringify(e))),vid:(e=>{const t=e&&e.data.sid&&this.baseInfoMap.get(e.data.sid);return t&&t.info.vid&&+t.info.vid||0})(i[0])};return i.length&&this.postDataToStatsCollector(o).catch((e=>i=>{cb("EVENT_REPORT_RETRY")&&(t?this.keyEventUploadPendingItems=this.keyEventUploadPendingItems.concat(e):(this.normalEventUploadPendingItems=this.normalEventUploadPendingItems.concat(e),this.normalEventUploadPendingItems.length>cb("NORMAL_EVENT_QUEUE_CAPACITY")&&(this.normalEventUploadPendingItems.splice(0,this.normalEventUploadPendingItems.length-cb("NORMAL_EVENT_QUEUE_CAPACITY")),mw.warning("report: drop normal events"))))})(i)),e}async postDataToStatsCollector(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Sx.networkState===jP.OFFLINE&&await Mm.race([Sx.onlineWaiter,SG(2*_w.maxRetryTimeout)]);const i=t?"/events/proto-raws":"/events/messages";let n=this.url||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(cb("EVENT_REPORT_DOMAIN"),"&p=6443&d=").concat(i):"https://".concat(cb("EVENT_REPORT_DOMAIN"),":6443").concat(i));for(let r=0;r<2;r+=1){1===r&&(n=this.backupUrl||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(cb("EVENT_REPORT_BACKUP_DOMAIN"),"&p=6443&d=").concat(i):"https://".concat(cb("EVENT_REPORT_BACKUP_DOMAIN"),":6443").concat(i)));try{t?await mx(n,{timeout:1e4,data:e}):await Tx(n,{timeout:1e4,data:e})}catch(e){if(1===r)throw e;continue}return}}createBaseInfo(e,t){const i=Object.assign({},vL);return i.sid=e,this.baseInfoMap.set(e,{info:i,startTime:t}),i}reportResourceTiming(e,t){const i=performance.getEntriesByName(e),n=i[i.length-1];n&&this.reportApiInvoke(t,{name:"Client.resourceTiming",options:n,tag:bL.TRACER}).onSuccess()}})||yx);lw.on("REPORT_LOG_UPLOAD",(e=>{e.networkState=Sx.networkState,Px.reportApiInvoke(null,{name:"logUploadError",options:e,tag:bL.TRACER})}));class kx extends Ew{constructor(e,t){super(),tD(this,"trackMediaType",void 0),tD(this,"_ID",void 0),tD(this,"_hints",[]),tD(this,"_isClosed",!1),tD(this,"_originMediaStreamTrack",void 0),tD(this,"_mediaStreamTrack",void 0),tD(this,"_external",{}),this._ID=t||vG(8,"track-"),this._originMediaStreamTrack=e,this._mediaStreamTrack=e,function(e){Ib.includes(e)||Ib.push(e)}(this)}toString(){return this._ID}getTrackId(){return this._ID}getMediaStreamTrack(e){if(!e){const e=Px.reportApiInvoke(null,{name:wL.GET_MEDIA_STREAM_TRACK,options:[],tag:bL.TRACER});this._mediaStreamTrack&&"string"==typeof this._mediaStreamTrack.label?e.onSuccess(this._mediaStreamTrack.label):e.onSuccess("")}return this._mediaStreamTrack}getMediaStreamTrackSettings(){return this.getMediaStreamTrack(!0).getSettings()}close(){this._isClosed=!0,function(e){const t=Ib.indexOf(e);-1!==t&&Ib.splice(t,1)}(this),this.emit(DP.CLOSED)}}let Mx,Ux,Bx,Vx=1;class Qx{constructor(e){tD(this,"lockingPromise",Mm.resolve()),tD(this,"locks",0),tD(this,"name",""),tD(this,"lockId",void 0),this.lockId=Vx++,e&&(this.name=e),mw.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}get isLocked(){return this.locks>0}lock(e){let t;this.locks+=1,mw.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is locked, current queue ").concat(this.locks,". ").concat("string"==typeof e?e:""));const i=new Mm((i=>{t=()=>{this.locks-=1,mw.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is not locked, current queue ").concat(this.locks,". ").concat("string"==typeof e?e:"")),i()}})),n=this.lockingPromise.then((()=>t));return this.lockingPromise=this.lockingPromise.then((()=>i)),n}}function xx(e,t){return function(i,n,r){const o=i[n];if("function"!=typeof o)throw new Error("Cannot use mutex on object property.");return r.value=async function(){const i=this[t];if(!i)throw new Error("mutex property key ".concat(t," doesn't exist on ").concat(e));const r=await i.lock("From ".concat(e,".").concat(n));try{for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];return await o.apply(this,a)}finally{r()}},r}}class Fx extends kx{get muted(){return this._muted}get enabled(){return this._enabled}constructor(e,t){super(e,t),tD(this,"_enabled",!0),tD(this,"_muted",!1),tD(this,"_isClosed",!1),tD(this,"_trackProcessors",[]),tD(this,"_enabledMutex",void 0),tD(this,"processor",void 0),tD(this,"processorContext",void 0),tD(this,"_handleTrackEnded",(()=>{this.onTrackEnded()})),this._enabledMutex=new Qx("".concat(t)),e.addEventListener("ended",this._handleTrackEnded)}getTrackLabel(){return this._originMediaStreamTrack.label}close(){this._isClosed||(this.stop(),this._trackProcessors.forEach((e=>e.destroy())),this._trackProcessors=[],this._originMediaStreamTrack.stop(),this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack.stop(),this._mediaStreamTrack=null),this._originMediaStreamTrack=null,this._enabledMutex=null,mw.debug("[".concat(this.getTrackId(),"] close")),Yw("debug",this,"close"),this.emit(OP.NEED_CLOSE),super.close())}async _registerTrackProcessor(e){if(-1!==this._trackProcessors.indexOf(e))return;const t=this._trackProcessors[this._trackProcessors.length-1];this._trackProcessors.push(e),e.onOutputChange=async()=>{const t=e.output||this._originMediaStreamTrack;this._mediaStreamTrack=t,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)},t?(t.onOutputChange=async()=>{t.output&&await e.setInput(t.output)},await e.setInput(t.output||t.input||this._originMediaStreamTrack)):await e.setInput(this._originMediaStreamTrack)}_getOutputFromProcessors(){if(0===this._trackProcessors.length)return this._originMediaStreamTrack;const e=this._trackProcessors[this._trackProcessors.length-1];return e.output||e.input||this._originMediaStreamTrack}async _updateOriginMediaStreamTrack(e,t){if(e!==this._originMediaStreamTrack){if(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),t&&this._originMediaStreamTrack.stop(),e.addEventListener("ended",this._handleTrackEnded),this._originMediaStreamTrack=e,this._trackProcessors.length>0){await this._trackProcessors[0].setInput(e);const t=this._getOutputFromProcessors();this._mediaStreamTrack=t}else this._mediaStreamTrack=this._originMediaStreamTrack;this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this),this.processor&&this.processor.updateInput({track:this._originMediaStreamTrack,context:this.processorContext})}}_getDefaultPlayerConfig(){return{}}onTrackEnded(){mw.debug("[".concat(this.getTrackId(),"] track ended")),jw("debug",["MediaStreamTrack",this.getTrackId()],"ended"),this.emit(DP.TRACK_ENDED)}stateCheck(e,t){if(mw.debug("check track state, [muted: ".concat(this._muted,", enabled: ").concat(this._enabled,"] to [").concat(e,": ").concat(t,"]")),Yw("debug",this,"stateCheck",{stateName:e,state:t,muted:this._muted,enabled:this._enabled}),dL(t,e),this._enabled&&this._muted&&"enabled"===e&&!1===t)throw new pw(hw.TRACK_STATE_UNREACHABLE,"cannot set enabled while the track is muted").print();if(!this._enabled&&!this._muted&&"muted"===e&&!0===t)throw new pw(hw.TRACK_STATE_UNREACHABLE,"cannot set muted while the track is disabled").print()}getProcessorStats(){return this.processorContext.gatherStats()}}!function(e){e.IOS_15_INTERRUPTION_START="ios15-interruption-start",e.IOS_15_INTERRUPTION_END="ios15-interruption-end",e.IOS_INTERRUPTION_START="ios-interruption-start",e.IOS_INTERRUPTION_END="ios-interruption-end",e.STATE_CHANGE="state-change"}(Mx||(Mx={})),function(e){e.AUDIO_CONTEXT_CREATED="audio_context_created"}(Ux||(Ux={})),function(e){e.AIDenoiser="AIDenoiser"}(Bx||(Bx={}));const Gx={audioContextInitOptions:{}},jx=new class extends Ew{constructor(){super(),tD(this,"registeredPlugins",[])}setOptions(e,t){Gx[e]&&(Gx[e]=t)}getOptions(e){return Gx[e]}installPlugin(e){e instanceof Object&&e.name&&this.registeredPlugins.push(e.name)}},Yx=window.AudioContext||window.webkitAudioContext;let Hx=null;const Kx=new class extends Ew{constructor(){super(...arguments),tD(this,"prevState",void 0),tD(this,"curState",void 0),tD(this,"interruptDetectorTrack",void 0),tD(this,"onLocalAudioTrackMute",(()=>{mw.info("ios15-interruption-start"),Fw("info",["WebAudio"],"ios15-interruption-start"),this.emit(Mx.IOS_15_INTERRUPTION_START)})),tD(this,"onLocalAudioTrackUnmute",(async()=>{mw.info("ios15-interruption-end"),Fw("info",["WebAudio"],"ios15-interruption-end"),"running"!==this.curState||this.duringInterruption?mw.info("ios15-interruption-end-canceled"):(Hx&&await Hx.suspend(),this.emit(Mx.IOS_15_INTERRUPTION_END))}))}get duringInterruption(){return"running"===this.prevState&&"interrupted"===this.curState}bindInterruptDetectorTrack(e){mw.debug("webaudio bindInterruptDetectorTrack ".concat(e.getTrackId())),Yw("debug",["WebAudio"],"bindInterruptDetectorTrack",e.getTrackId()),this.interruptDetectorTrack||(this.interruptDetectorTrack=e,this.interruptDetectorTrack._mediaStreamTrack.onmute=this.onLocalAudioTrackMute,this.interruptDetectorTrack._mediaStreamTrack.onunmute=this.onLocalAudioTrackUnmute)}unbindInterruptDetectorTrack(e){mw.debug("webaudio unbindInterruptDetectorTrack ".concat(e.getTrackId())),Yw("debug",["WebAudio"],"unbindInterruptDetectorTrack",e.getTrackId()),this.interruptDetectorTrack&&this.interruptDetectorTrack===e&&(this.interruptDetectorTrack._mediaStreamTrack&&(this.interruptDetectorTrack._mediaStreamTrack.onmute=null,this.interruptDetectorTrack._mediaStreamTrack.onunmute=null),this.interruptDetectorTrack=void 0)}};function Wx(){if(!Hx){if(function(){if(!Yx)return mw.error("your browser is not support web audio"),void xw("error",["WebAudio"],"your browser is not support web audio");mw.info("create audio context"),Hw("info",["WebAudio"],"WebAudioContext");const e=jx.getOptions("audioContextInitOptions");mw.debug("audio content init option:",JSON.stringify(e)),Hx=new Yx(e),jx.emit(Ux.AUDIO_CONTEXT_CREATED,Hx),Kx.curState=Hx.state,Hx.onstatechange=()=>{Kx.prevState=Kx.curState,Kx.curState=Hx?Hx.state:void 0,(Vy()||jy())&&"running"===Kx.prevState&&"interrupted"===Kx.curState&&(mw.info("ios-interruption-start"),Fw("info",["AudioState"],"ios-interruption-start"),Kx.emit(Mx.IOS_INTERRUPTION_START)),(Vy()||jy())&&"interrupted"===Kx.prevState&&"running"===Kx.curState&&(mw.info("ios-interruption-end"),Fw("info",["AudioState"],"ios-interruption-end"),Kx.emit(Mx.IOS_INTERRUPTION_END)),Kx.prevState!==Kx.curState&&(mw.debug("AudioContext State Change","".concat(Kx.prevState,"=>").concat(Kx.curState)),jw("debug",["AudioContext",void 0],"statechange","".concat(Kx.prevState,"=>").concat(Kx.curState)),Kx.emit(Mx.STATE_CHANGE))},async function(e){const t=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","touchend","keydown","keyup"];let i,n=!1,r=!1,o=!1;function s(t){"running"===e.state?a(!1):Vy()||jy()?"suspended"===e.state&&(a(!0),t&&e.resume().then(c,c)):"closed"!==e.state&&(a(!0),t&&e.resume().then(c,c))}function a(e){if(n!==e){n=e;for(let i=0,n=t;i<n.length;i+=1){const t=n[i];e?window.addEventListener(t,A,{capture:!0,passive:!0}):window.removeEventListener(t,A,{capture:!0,passive:!0})}}}function c(){s(!1)}function A(){s(!0)}function d(e){if(!o)if(i.paused)if(e){let t;u(!1),o=!0;try{t=i.play(),t?t.then(E,E):(i.addEventListener("playing",E),i.addEventListener("abort",E),i.addEventListener("error",E))}catch(e){E()}}else u(!0);else u(!1)}function u(e){if(r!==e){r=e;for(let i=0,n=t;i<n.length;i++){const t=n[i];e?window.addEventListener(t,l,{capture:!0,passive:!0}):window.removeEventListener(t,l,{capture:!0,passive:!0})}}}function E(){i.removeEventListener("playing",E),i.removeEventListener("abort",E),i.removeEventListener("error",E),o=!1,d(!1)}function l(){d(!0)}if(Vy()){const t=e.createMediaStreamDestination(),n=document.createElement("div");n.innerHTML="<audio x-webkit-airplay='deny'></audio>",i=n.children.item(0),i.controls=!1,i.disableRemotePlayback=!0,i.preload="auto",i.srcObject=t.stream,d(!0)}Kx.on(Mx.STATE_CHANGE,(function(){s(!0)})),s(!1)}(Hx)}(),!Hx)throw new pw(hw.NOT_SUPPORTED,"can not create audio context");return Hx}return Hx}function Jx(e){if(function(){if(null!==qx)return qx;const e=Wx(),t=e.createBufferSource(),i=e.createGain(),n=e.createGain();t.connect(i),t.connect(n),t.disconnect(i);let r=!1;try{t.disconnect(i)}catch(e){r=!0}return t.disconnect(),qx=r,r}())return;Yw("debug",["WebAudio"],"polyfillAudioNode");const t=e.connect,i=e.disconnect;e.connect=(i,n,r)=>(e._inputNodes||(e._inputNodes=[]),e._inputNodes.includes(i)||(i instanceof AudioNode?(e._inputNodes.push(i),t.call(e,i,n,r)):t.call(e,i,n)),e),e.disconnect=(n,r,o)=>{i.call(e),n?MG(e._inputNodes,n):e._inputNodes=[];for(const i of e._inputNodes)t.call(e,i)}}let qx=null;function Xx(e,t){const i=1/t,n=Wx();let r=n.createGain();r.gain.value=0,r.connect(n.destination);let o=!1;const s=()=>{if(o)return void(r=null);const t=n.createOscillator();t.onended=s,t.connect(r),t.start(0),t.stop(n.currentTime+i),e(n.currentTime)};return s(),()=>{o=!0}}const zx=mw.prefix("[inject-node]");class Zx{constructor(){tD(this,"nodeLists",[]),tD(this,"prevNode",void 0),tD(this,"nextNode",void 0)}get firstNode(){return this.nodeLists[0]}get lastNode(){return this.nodeLists[this.nodeLists.length-1]}get isActive(){return!!this.nodeLists.length}get isConnected(){return!(!this.prevNode||!this.nextNode)}connect(e,t){zx.debug("connect audio node, current list:"+this.nodeLists.length),this.nodeLists.length?(this.prevNode&&this.prevNode.disconnect(),e.connect(this.firstNode),this.nextNode&&this.lastNode&&this.lastNode.disconnect(),this.lastNode.connect(t),this.nodeLists.forEach(((e,t)=>{const i=this.nodeLists[t+1];i&&e.connect(i)}))):e.connect(t),this.nextNode=t,this.prevNode=e}disconnect(){var e;zx.debug("disconnect audio node, current list:"+this.nodeLists.length),this.nodeLists.forEach((e=>{e.disconnect()})),null===(e=this.prevNode)||void 0===e||e.disconnect(),this.prevNode=void 0,this.nextNode=void 0}addNode(e){zx.debug("add node in inject node, current list:",this.nodeLists.length),this.prevNode&&this.nextNode?(this.firstNode||(zx.debug("new node is the first node"),this.prevNode.disconnect(),this.prevNode.connect(e),e.connect(this.nextNode)),this.nextNode&&this.lastNode&&(this.lastNode.disconnect(this.nextNode),this.lastNode.connect(e),e.connect(this.nextNode)),this.nodeLists.push(e)):zx.debug("add node is called before inject node connected")}removeNode(e){zx.debug("remove node in inject node, current list:",this.nodeLists.length);const t=this.nodeLists.indexOf(e);if(-1===t)return void zx.debug("$[inject-node] cannot find the node to be removed");const i=this.nodeLists[t+1],n=this.nodeLists[t-1];0===t&&this.prevNode&&this.nextNode&&(this.prevNode.disconnect(e),i?this.prevNode.connect(i):this.prevNode.connect(this.nextNode)),t===this.nodeLists.length-1&&this.nextNode&&n&&(n.disconnect(e),n.connect(this.nextNode)),0!==t&&t!==this.nodeLists.length-1&&(n.disconnect(e),n.connect(i)),zx.debug("remove node in inject node success, current list:",this.nodeLists.length)}}class $x extends Ew{get processSourceNode(){return this.sourceNode}set processedNode(e){var t;if(!this.isDestroyed&&this._processedNode!==e){try{var i;null===(i=this.sourceNode)||void 0===i||i.disconnect(this.outputNode)}catch(e){}null===(t=this._processedNode)||void 0===t||t.disconnect(),this._processedNode=e,this.connect()}}get processedNode(){return this._processedNode}constructor(){super(),tD(this,"outputNode",void 0),tD(this,"outputTrack",void 0),tD(this,"isPlayed",!1),tD(this,"sourceNode",void 0),tD(this,"analyserNode",void 0),tD(this,"context",void 0),tD(this,"audioBufferNode",void 0),tD(this,"destNode",void 0),tD(this,"injectNode",void 0),tD(this,"audioOutputLevel",0),tD(this,"_processedNode",void 0),tD(this,"playNode",void 0),tD(this,"isDestroyed",!1),tD(this,"onNoAudioInput",void 0),tD(this,"isNoAudioInput",!1),tD(this,"_noAudioInputCount",0),this.context=Wx(),this.playNode=this.context.destination,this.outputNode=this.context.createGain(),Jx(this.outputNode),this.analyserNode=this.context.createAnalyser(),this.analyserNode.smoothingTimeConstant=.4,this.analyserNode.fftSize=2048,this.injectNode=new Zx}startGetAudioBuffer(e){this.audioBufferNode||(this.audioBufferNode=this.context.createScriptProcessor(e),this.outputNode.connect(this.audioBufferNode),this.audioBufferNode.connect(this.context.destination),this.audioBufferNode.onaudioprocess=e=>{this.emit(qL.ON_AUDIO_BUFFER,function(e){for(let t=0;t<e.outputBuffer.numberOfChannels;t+=1){const i=e.outputBuffer.getChannelData(t);for(let e=0;e<i.length;e+=1)i[e]=0}return e.inputBuffer}(e))})}stopGetAudioBuffer(){this.audioBufferNode&&(this.audioBufferNode.onaudioprocess=null,this.outputNode.disconnect(this.audioBufferNode),this.audioBufferNode=void 0)}createOutputTrack(){if(!XP().webAudioMediaStreamDest)throw new pw(hw.NOT_SUPPORTED,"your browser is not support audio processor");return this.destNode&&this.outputTrack||(this.destNode=this.context.createMediaStreamDestination(),this.outputNode.connect(this.destNode),this.outputTrack=this.destNode.stream.getAudioTracks()[0]),this.outputTrack}play(e){"running"!==this.context.state&&BG((()=>{Kx.emit("autoplay-failed")})),this.isPlayed=!0,this.playNode=e||this.context.destination,this.outputNode.connect(this.playNode)}stop(){if(this.isPlayed)try{this.outputNode.disconnect(this.playNode)}catch(e){}this.isPlayed=!1}getAccurateVolumeLevel(){if(!this.context||Vy()||jy()||"running"!==this.context.state&&this.context.resume(),!this.analyserNode)return 0;const e=new Uint8Array(this.analyserNode.frequencyBinCount);this.analyserNode.getByteFrequencyData(e);let t=0;for(let i=0;i<e.length;i++)t+=i<64?Math.abs(10*e[i]):Math.abs(6*e[i]/15);return t/e.length/255}async checkHasAudioInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e>5)return this.isNoAudioInput=!0,this.onNoAudioInput&&this.onNoAudioInput(),!1;if(Vy()||jy()?"suspended"===this.context.state&&this.context.resume():"running"!==this.context.state&&this.context.resume(),!this.analyserNode)return!1;const t=new Uint8Array(this.analyserNode.frequencyBinCount);this.analyserNode.getByteFrequencyData(t);let i=!1;for(let e=0;e<t.length;e++)0!==t[e]&&(i=!0);return i?(this.isNoAudioInput=!1,!0):(await SG(200),await this.checkHasAudioInput(e?e+1:1)&&i)}getAudioVolume(){return this.outputNode.gain.value}setVolume(e){this.outputNode.gain.setValueAtTime(e,this.context.currentTime)}destroy(){this.disconnect(),this.stop(),this.isDestroyed=!0,this.onNoAudioInput=void 0}injectAudioNode(e){this.injectNode.addNode(e)}removeAudioNode(e){this.injectNode.removeNode(e)}disconnect(){var e,t;null===(e=this.processedNode)||void 0===e||e.disconnect(),null===(t=this.sourceNode)||void 0===t||t.disconnect(),this.outputNode&&this.outputNode.disconnect()}connect(){var e;this.processedNode?null===(e=this.processedNode)||void 0===e||e.connect(this.outputNode):this.sourceNode&&this.sourceNode.connect(this.outputNode),this.outputNode.connect(this.analyserNode)}}class eF extends $x{get isFreeze(){return!1}constructor(e,t){var i;if(super(),tD(this,"sourceNode",void 0),tD(this,"track",void 0),tD(this,"audioElement",void 0),tD(this,"isCurrentTrackCloned",!1),tD(this,"isRemoteTrack",!1),tD(this,"rebuildWebAudio",(async()=>{if(mw.debug("ready to rebuild web audio, state:",this.context.state),this.isNoAudioInput&&await this.checkHasAudioInput(),!this.isNoAudioInput||this.isDestroyed)return document.body.removeEventListener("click",this.rebuildWebAudio,!0),void mw.debug("rebuild web audio success, current volume status",this.getAccurateVolumeLevel());this.context.resume().then((()=>mw.info("resume success"))),mw.debug("rebuild web audio because of ios 12 bugs"),this.disconnect();const e=this.track;this.track=this.track.clone(),this.isCurrentTrackCloned?e.stop():this.isCurrentTrackCloned=!0;const t=new MediaStream([this.track]);this.sourceNode=this.context.createMediaStreamSource(t),Jx(this.sourceNode),this.analyserNode=this.context.createAnalyser();const i=this.outputNode.gain.value;this.outputNode=this.context.createGain(),this.outputNode.gain.setValueAtTime(i,this.context.currentTime),Jx(this.outputNode),this.emit(qL.UPDATE_SOURCE),this.connect(),this.audioElement.srcObject=t,this.isPlayed&&this.play(this.playNode),this.checkHasAudioInput()})),"audio"!==e.kind)throw new pw(hw.UNEXPECTED_ERROR);this.track=e;const n=new MediaStream([this.track]);this.isRemoteTrack=!!t,this.sourceNode=this.context.createMediaStreamSource(n),Jx(this.sourceNode),this.connect(),this.audioElement=document.createElement("audio"),this.audioElement.srcObject=n;const r=Dy();t&&r.os===Sy.IOS&&Number(null===(i=r.osVersion)||void 0===i?void 0:i.split(".")[0])<15&&(Kx.on(Mx.STATE_CHANGE,(()=>{"suspended"===this.context.state?document.body.addEventListener("click",this.rebuildWebAudio,!0):"running"===this.context.state&&this.rebuildWebAudio()})),this.checkHasAudioInput().then((e=>{e||document.body.addEventListener("click",this.rebuildWebAudio,!0)})))}updateTrack(e){this.sourceNode.disconnect(),this.track=e,this.isCurrentTrackCloned=!1;const t=new MediaStream([e]);this.sourceNode=this.context.createMediaStreamSource(t),Jx(this.sourceNode),this.processedNode||this.sourceNode.connect(this.outputNode),this.emit(qL.UPDATE_SOURCE),this.audioElement.srcObject=t}destroy(){this.audioElement.srcObject=null,this.audioElement.remove(),Kx.off("state-change",this.rebuildWebAudio),super.destroy()}}async function tF(e,t){const i=(e,t)=>e?"number"!=typeof e?e.max||e.exact||e.ideal||e.min||t:e:t,n={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxHeight:i(t.height,1080),maxWidth:i(t.width,1920)}}};return t.frameRate&&"number"!=typeof t.frameRate?(n.video.mandatory.maxFrameRate=t.frameRate.max,n.video.mandatory.minFrameRate=t.frameRate.min):"number"==typeof t.frameRate&&(n.video.mandatory.maxFrameRate=t.frameRate),await navigator.mediaDevices.getUserMedia(n)}async function iF(e){let t=["window","screen"];"application"!==e&&"window"!==e||(t=["window"]),"screen"===e&&(t=["screen"]);const i=rF();if(!i)throw new pw(hw.ELECTRON_IS_NULL);let n=null;try{n=i.desktopCapturer.getSources({types:t})}catch(e){n=null}n&&n.then||(n=new Mm(((e,n)=>{i.desktopCapturer.getSources({types:t},((t,i)=>{t?n(t):e(i)}))})));try{return await n}catch(e){throw new pw(hw.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR,e.toString())}}let nF=null;function rF(){if(nF)return nF;try{return nF=window.require("electron"),nF}catch(e){return null}}const oF=new Qx("safari");let sF=!1,aF=!1;async function cF(e,t){let i=0,n=null;for(;i<2;)try{n=await AF(e,t,i>0);break}catch(n){if(n instanceof pw)throw mw.error("[".concat(t,"] ").concat(n.toString())),Yw("error",[],"getLocalStream",{config:e,id:t},n.toString()),n;const r=dF(n.name||n.code||n,n.message);if(r.code===hw.MEDIA_OPTION_INVALID){mw.debug("[".concat(t,"] detect media option invalid, retry")),xw("debug",[],"[".concat(t,"] detect media option invalid, retry")),i+=1,await SG(500);continue}throw mw.error("[".concat(t,"] ").concat(r.toString())),Yw("error",[],"getLocalStream",{config:e,id:t},r.toString()),r}if(!n)throw new pw(hw.UNEXPECTED_ERROR,"can not find stream after getUserMedia");return n}async function AF(e,t,i){if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new pw(hw.NOT_SUPPORTED,"can not find getUserMedia");i&&(e.video&&(delete e.video.width,delete e.video.height),e.screen&&(delete e.screen.width,delete e.screen.height));const n=XP(),r=new MediaStream;if(e.audioSource&&r.addTrack(e.audioSource),e.videoSource&&r.addTrack(e.videoSource),!e.audio&&!e.video&&!e.screen)return mw.debug("Using Video Source/ Audio Source"),xw("debug",[],"Using Video Source/ Audio Source"),r;if(e.screen)if(rF())e.screen.sourceId?uF(r,await tF(e.screen.sourceId,e.screen)):uF(r,await async function(e){const t=await iF(e.mediaSource),i=await function(e){return new Mm(((t,i)=>{const n=document.createElement("div");n.innerText="share screen",n.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom:  solid 1px #B9B8B9;");const r=document.createElement("div");r.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");const o=document.createElement("div");o.innerText="Agora Web Screensharing wants to share the contents of your screen with webdemo.agorabeckon.com. Choose what you'd like to share.",o.setAttribute("style","height: 12%;");const s=document.createElement("div");s.setAttribute("style","width: 100%; height: 80%; background: #FFF; border:  solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");const a=document.createElement("div");a.setAttribute("style","text-align: right; padding: 16px 0;");const c=document.createElement("button");c.innerHTML="cancel",c.setAttribute("style","width: 85px;"),c.onclick=()=>{document.body.removeChild(A);const e=new Error("NotAllowedError");e.name="NotAllowedError",i(e)},a.appendChild(c),r.appendChild(o),r.appendChild(s),r.appendChild(a);const A=document.createElement("div");A.setAttribute("style","position: fixed; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),A.appendChild(n),A.appendChild(r),document.body.appendChild(A),e.map((e=>{if(e.id){const i=document.createElement("div");i.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;");let n=e.thumbnail;const{width:r}=n.getSize();r>1920&&(n=n.resize({width:1920})),i.innerHTML='<div style="height: 120px; display: table-cell; vertical-align: middle;"><img style="width: 100%; background: #333333; box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.2);" src='+n.toDataURL()+' /></div><span style="\theight: 40px; line-height: 40px; display: inline-block; width: 70%; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+e.name.replace(/[\u00A0-\u9999<>\&]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))+"</span>",i.onclick=()=>{document.body.removeChild(A),t(e.id)},s.appendChild(i)}}))}))}(t);return await tF(i,e)}(e.screen));else if(My()&&e.screen.extensionId&&e.screen.mandatory){if(!n.getStreamFromExtension)throw new pw(hw.NOT_SUPPORTED,"This browser does not support screen sharing");mw.debug("[".concat(t,'] Screen access on chrome stable, looking for extension"')),xw("debug",[],"[".concat(t,'] Screen access on chrome stable, looking for extension"'));const i=await(o=e.screen.extensionId,s=t,new Mm(((e,t)=>{try{chrome.runtime.sendMessage(o,{getStream:!0},(i=>{if(!i||!i.streamId)return mw.error("[".concat(s,"] No response from Chrome Plugin. Plugin not installed properly"),i),Yw("error",[],"getSourceIdFromExtension",{extensionId:o,streamId:s},"No response from Chrome Plugin. Plugin not installed properly, ".concat(i)),void t(new pw(hw.CHROME_PLUGIN_NO_RESPONSE,"No response from Chrome Plugin. Plugin not installed properly"));e(i.streamId)}))}catch(e){mw.error("[".concat(s,"] AgoraRTC screensharing plugin is not accessible(").concat(o,")"),e.toString()),Yw("error",[],"getSourceIdFromExtension",{extensionId:o,streamId:s},"AgoraRTC screensharing plugin is not accessible(".concat(o,"), ").concat(e.toString())),t(new pw(hw.CHROME_PLUGIN_NOT_INSTALL))}})));e.screen.mandatory.chromeMediaSourceId=i,uF(r,await navigator.mediaDevices.getUserMedia({video:{mandatory:e.screen.mandatory}}))}else if(n.getDisplayMedia){e.screen.mediaSource&&PP(e.screen.mediaSource);const i={width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate,displaySurface:"screen"===e.screen.mediaSource?"monitor":e.screen.mediaSource};mw.debug("[".concat(t,"] getDisplayMedia:"),JSON.stringify({video:i,audio:!!e.screenAudio})),Hw("debug",["mediaDevices",t],"getDisplayMedia",{video:i,audio:!!e.screenAudio,trackId:t}),uF(r,await navigator.mediaDevices.getDisplayMedia({video:i,audio:!!e.screenAudio}))}else{if(!By())throw mw.error("[".concat(t,"] This browser does not support screenSharing")),new pw(hw.NOT_SUPPORTED,"This browser does not support screen sharing");{e.screen.mediaSource&&PP(e.screen.mediaSource);const i={video:{mediaSource:e.screen.mediaSource,width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate}};mw.debug("[".concat(t,"] getUserMedia: ").concat(JSON.stringify(i))),Hw("debug",["mediaDevices",t],"getUserMedia",i),uF(r,await navigator.mediaDevices.getUserMedia(i))}}var o,s;if(!e.video&&!e.audio)return r;let a={video:e.video,audio:e.audio},c=cb("MEDIA_DEVICE_CONSTRAINTS");if(c)try{"string"==typeof c&&(c=JSON.parse(c)),a=function e(t,i){if(!KG(t)||!KG(i))return i;if(Array.isArray(t)&&!Array.isArray(i)||!Array.isArray(t)&&Array.isArray(i))return i;if(Array.isArray(i)&&Array.isArray(t)){const n=[...t];for(let r=0;r<i.length;r++)n[r]=e(t[r],i[r]);return n}{const n=TG({},t);for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(Object.prototype.hasOwnProperty.call(t,r)?n[r]=e(t[r],i[r]):n[r]=i[r]);return n}}(a,c),xw("debug",["mediaDevices",t],"merge configConstraints ".concat(JSON.stringify(c)))}catch(e){}mw.debug("[".concat(t,"] GetUserMedia"),JSON.stringify(a)),Hw("debug",["mediaDevices",t],"getUserMedia",a),Dy();let A,d=null;(Uy()||Vy()||ky())&&(d=await oF.lock());try{A=await navigator.mediaDevices.getUserMedia(a)}catch(e){throw d&&d(),e}return a.audio&&(sF=!0),a.video&&(aF=!0),uF(r,A),d&&d(),r}function dF(e,t){switch(e){case"Starting video failed":case"OverconstrainedError":case"TrackStartError":return new pw(hw.MEDIA_OPTION_INVALID,"".concat(e,": ").concat(t));case"NotFoundError":case"DevicesNotFoundError":return new pw(hw.DEVICE_NOT_FOUND,"".concat(e,": ").concat(t));case"NotSupportedError":return new pw(hw.NOT_SUPPORTED,"".concat(e,": ").concat(t));case"NotReadableError":return new pw(hw.NOT_READABLE,"".concat(e,": ").concat(t));case"InvalidStateError":case"NotAllowedError":case"PERMISSION_DENIED":case"PermissionDeniedError":return new pw(hw.PERMISSION_DENIED,"".concat(e,": ").concat(t));case"ConstraintNotSatisfiedError":return new pw(hw.CONSTRAINT_NOT_SATISFIED,"".concat(e,": ").concat(t));default:return mw.error("getUserMedia unexpected error",e),Yw("error",[],"handleGetUserMediaError",void 0,e),new pw(hw.UNEXPECTED_ERROR,"".concat(e,": ").concat(t))}}function uF(e,t){const i=e.getVideoTracks()[0],n=e.getAudioTracks()[0],r=t.getVideoTracks()[0],o=t.getAudioTracks()[0];o&&(n&&e.removeTrack(n),e.addTrack(o)),r&&(i&&e.removeTrack(i),e.addTrack(r))}const EF=new class extends Ew{get state(){return this._state}set state(e){e!==this._state&&(this.emit(PL.STATE_CHANGE,e),this._state=e)}constructor(){super(),tD(this,"_state",LL.IDLE),tD(this,"isAccessMicrophonePermission",!1),tD(this,"isAccessCameraPermission",!1),tD(this,"lastAccessMicrophonePermission",!1),tD(this,"lastAccessCameraPermission",!1),tD(this,"checkdeviceMatched",!1),tD(this,"deviceInfoMap",new Map),this.init().then((()=>{navigator.mediaDevices.addEventListener&&navigator.mediaDevices.addEventListener("devicechange",this.updateDevicesInfo.bind(this)),window.setInterval((()=>{(cb("ENUMERATE_DEVICES_INTERVAL")||Wy()&&Ky())&&this.updateDevicesInfo()}),cb("ENUMERATE_DEVICES_INTERVAL_TIME"))})).catch((e=>mw.error(e.toString())))}async enumerateDevices(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return new pw(hw.NOT_SUPPORTED,"enumerateDevices() not supported.").throw();const n=await navigator.mediaDevices.enumerateDevices(),r=this.checkMediaDeviceInfoIsOk(n);let o=!this.isAccessMicrophonePermission&&e,s=!this.isAccessCameraPermission&&t;r.audio&&(o=!1),r.video&&(s=!1);let a=null,c=null,A=null;if(!i&&(o||s)){if(oF.isLocked&&(mw.debug("[device manager] wait GUM lock"),(await oF.lock())(),mw.debug("[device manager] GUM unlock")),sF&&(o=!1,this.isAccessMicrophonePermission=!0),aF&&(s=!1,this.isAccessCameraPermission=!0),mw.debug("[device manager] check media device permissions",e,t,o,s),o&&s){try{A=await navigator.mediaDevices.getUserMedia({audio:!0,video:!0})}catch(e){const t=dF(e.name||e.code||e,e.message);if(t.code===hw.PERMISSION_DENIED)throw t;mw.warning("getUserMedia failed in getDevices",t)}this.isAccessCameraPermission=!0,this.isAccessMicrophonePermission=!0}else if(o){try{a=await navigator.mediaDevices.getUserMedia({audio:e})}catch(e){const t=dF(e.name||e.code||e,e.message);if(t.code===hw.PERMISSION_DENIED)throw t;mw.warning("getUserMedia failed in getDevices",t)}this.isAccessMicrophonePermission=!0}else if(s){try{c=await navigator.mediaDevices.getUserMedia({video:t})}catch(e){const t=dF(e.name||e.code||e,e.message);if(t.code===hw.PERMISSION_DENIED)throw t;mw.warning("getUserMedia failed in getDevices",t)}this.isAccessCameraPermission=!0}mw.debug("[device manager] mic permission",e,"cam permission",t)}try{const e=await navigator.mediaDevices.enumerateDevices();return a&&a.getTracks().forEach((e=>e.stop())),c&&c.getTracks().forEach((e=>e.stop())),A&&A.getTracks().forEach((e=>e.stop())),a=null,c=null,A=null,e}catch(e){return a&&a.getTracks().forEach((e=>e.stop())),c&&c.getTracks().forEach((e=>e.stop())),A&&A.getTracks().forEach((e=>e.stop())),a=null,c=null,A=null,new pw(hw.ENUMERATE_DEVICES_FAILED,e.toString()).throw()}}async getRecordingDevices(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await this.enumerateDevices(!0,!1,e)).filter((e=>"audioinput"===e.kind))}async getCamerasDevices(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await this.enumerateDevices(!1,!0,e)).filter((e=>"videoinput"===e.kind))}async getSpeakers(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await this.enumerateDevices(!0,!1,e)).filter((e=>"audiooutput"===e.kind))}searchDeviceIdByName(e){let t=null;return this.deviceInfoMap.forEach((i=>{i.device.label===e&&(t=i.device.deviceId)})),t}async getDeviceById(e){const t=(await this.enumerateDevices(!0,!0,!0)).find((t=>t.deviceId===e));if(!t)throw new pw(hw.DEVICE_NOT_FOUND,"deviceId: ".concat(e));return t}async init(){this.state=LL.INITING;try{await this.updateDevicesInfo(),this.state=LL.INITEND}catch(e){throw mw.warning("Device Detection functionality cannot start properly.",e.toString()),this.state=LL.IDLE,("boolean"==typeof isSecureContext?isSecureContext:"https:"===location.protocol||"file:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname||"::1"===location.hostname)||new pw(hw.WEB_SECURITY_RESTRICT,"Your context is limited by web security, please try using https protocol or localhost.").throw(),e}}async updateDevicesInfo(){const e=await this.enumerateDevices(!0,!0,!0),t=Date.now(),i=[];if(e[0]&&e[0].label&&!1===this.checkdeviceMatched){this.checkdeviceMatched=!0;const t=e.find((e=>"audioinput"===e.kind&&"default"===e.deviceId)),i=e.find((e=>"audiooutput"===e.kind&&"default"===e.deviceId));t&&i?i.groupId===t.groupId?mw.debug("[device-check] default input ".concat(t.label," and output ").concat(i.label," is the same group")):mw.warning("[device-check] default input ".concat(t.label," and output ").concat(i.label," is not the same group")):mw.debug("[device-check] default input or output not found")}const n=this.checkMediaDeviceInfoIsOk(e);if(e.forEach((e=>{if(!e.deviceId)return;const n=this.deviceInfoMap.get("".concat(e.kind,"_").concat(e.deviceId));if("ACTIVE"!==(n?n.state:"INACTIVE")){const n={initAt:t,updateAt:t,device:e,state:"ACTIVE"};this.deviceInfoMap.set("".concat(e.kind,"_").concat(e.deviceId),n),i.push(n)}n&&(n.updateAt=t)})),this.deviceInfoMap.forEach(((e,n)=>{"ACTIVE"===e.state&&e.updateAt!==t&&(e.state="INACTIVE",i.push(e))})),this.state!==LL.INITEND)return n.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),void(n.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0));i.forEach((e=>{switch(e.device.kind){case"audioinput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(PL.RECORDING_DEVICE_CHANGED,e);break;case"videoinput":this.lastAccessCameraPermission&&this.isAccessCameraPermission&&this.emit(PL.CAMERA_DEVICE_CHANGED,e);break;case"audiooutput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(PL.PLAYOUT_DEVICE_CHANGED,e)}})),n.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),n.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0)}checkMediaDeviceInfoIsOk(e){const t=e.filter((e=>"audioinput"===e.kind)),i=e.filter((e=>"videoinput"===e.kind)),n={audio:!1,video:!1};for(const e of t)if(e.label&&e.deviceId){n.audio=!0;break}for(const e of i)if(e.label&&e.deviceId){n.video=!0;break}return n}};var lF;let hF=Ww("AudioElementPlayCenter")(lF=class{constructor(){tD(this,"onAutoplayFailed",void 0),tD(this,"elementMap",new Map),tD(this,"elementStateMap",new Map),tD(this,"elementsNeedToResume",[]),tD(this,"sinkIdMap",new Map),tD(this,"autoResumeAfterInterruption",(()=>{Array.from(this.elementMap.entries()).forEach((e=>{let[t,i]=e;const n=this.elementStateMap.get(t),r=i.srcObject.getAudioTracks()[0];Qy()?r&&"live"===r.readyState&&"running"===Kx.curState&&(mw.debug("auto resume after interruption for iOS 15"),xw("debug",["AudioElementPlayCenter",t],"auto resume after interruption for iOS15"),i.pause(),i.play()):n&&"paused"===n&&r&&"live"===r.readyState&&"running"===Kx.curState&&(mw.debug("auto resume after interruption for iOS"),xw("debug",["AudioElementPlayCenter",t],"auto resume after interruption for iOS"),i.play())}))})),tD(this,"autoResumeAfterInterruptionOnIOS15",(()=>{Array.from(this.elementMap.entries()).forEach((e=>{let[t,i]=e;const n=i.srcObject.getAudioTracks()[0];n&&"live"===n.readyState&&(mw.debug("auto resume after interruption inside autoResumeAfterInterruptionOnIOS15"),Yw("debug",["AudioElementPlayCenter",t],"autoResumeAfterInterruptionOnIOS15"),i.pause(),i.play())}))})),this.autoResumeAudioElement(),Kx.on(Mx.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Kx.on(Mx.IOS_15_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15),Kx.on(Mx.STATE_CHANGE,(()=>{Vy()&&"suspended"===Kx.prevState&&"running"===Kx.curState&&this.autoResumeAfterInterruption()}))}async setSinkID(e,t){const i=this.elementMap.get(e);if(this.sinkIdMap.set(e,t),i)try{await i.setSinkId(t)}catch(e){throw new pw(hw.PERMISSION_DENIED,"can not set sink id: "+e.toString())}}play(e,t,i,n){if(this.elementMap.has(t))return;const r=document.createElement("audio");r.autoplay=!0,r.srcObject=new MediaStream([e]),this.bindAudioElementEvents(t,r),this.elementMap.set(t,r),this.elementStateMap.set(t,mL.INIT),this.setVolume(t,i);const o=this.sinkIdMap.get(t);if(o)try{r.setSinkId(o).catch((e=>{mw.warning("[".concat(t,"] set sink id failed"),e.toString()),Hw("warning",["HTMLAudioElement",t],"setSinkId",e.toString())}))}catch(e){mw.warning("[".concat(t,"] set sink id failed"),e.toString())}const s=r.play();s&&s.then&&s.catch((e=>{n&&Px.autoplayFailed(n,"audio",e.message,t),mw.warning("audio element play warning",e.toString()),Hw("warning",["HTMLAudioElement",t],"play",e.toString()),this.elementMap.has(t)&&"NotAllowedError"===e.name&&(mw.warning("detected audio element autoplay failed"),Yw("warning",["AudioElementPlayCenter",t],"play",e.toString()),this.elementsNeedToResume.push(r),BG((()=>{this.onAutoplayFailed&&this.onAutoplayFailed(),Nx()})))}))}updateTrack(e,t){const i=this.elementMap.get(e);i&&(i.srcObject=new MediaStream([t]))}isPlaying(e){return this.elementMap.has(e)}setVolume(e,t){const i=this.elementMap.get(e);i&&(t=Math.max(0,Math.min(100,t)),i.volume=t/100)}stop(e){const t=this.elementMap.get(e);if(this.sinkIdMap.delete(e),!t)return;const i=this.elementsNeedToResume.indexOf(t);this.elementsNeedToResume.splice(i,1),t.srcObject=null,t.remove(),this.elementMap.delete(e),this.elementStateMap.delete(e)}bindAudioElementEvents(e,t){pF.forEach((i=>{t.addEventListener(i,(t=>{const i=this.elementStateMap.get(e),n="pause"===t.type?"paused":t.type;mw.debug("[".concat(e,"] audio-element-status change ").concat(i," => ").concat(n)),jw("debug",["HTMLAudioElement",e],"statusChange","".concat(i," => ").concat(n)),this.elementStateMap.set(e,n)}))}))}getPlayerState(e){return this.elementStateMap.get(e)||"uninit"}autoResumeAudioElement(){const e=()=>{this.elementsNeedToResume.forEach((e=>{e.play().then((e=>{mw.debug("Auto resume audio element success"),Yw("debug",["AudioElementPlayCenter"],"autoResumeAudioElement")})).catch((e=>{mw.warning("Auto resume audio element failed!",e),Yw("warning",["AudioElementPlayCenter"],"autoResumeAudioElement",e.toString())}))})),this.elementsNeedToResume=[]};new Mm((e=>{document.body?e():window.addEventListener("load",(()=>e()))})).then((()=>{const t=Dy();"Android"!==t.os||"Chrome"!==t.name&&t.name!==Oy.WECHAT?(document.body.addEventListener("touchstart",e,!0),document.body.addEventListener("mousedown",e,!0)):document.body.addEventListener("click",e,!0)}))}})||lF;const pF=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended"],_F=new hF;function IF(){return function(e,t,i){const n=e[t];"function"==typeof n&&(i.value=function(){this._isClosed&&new pw(hw.INVALID_OPERATION,"[".concat(this.getTrackId(),"] cannot operate a closed track")).print("warning");for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const r=n.apply(this,t);return r instanceof Mm?new Mm(((e,t)=>{r.then(e).catch(t)})):r})}}var gF,fF,RF,CF,TF,mF,SF,OF,vF,NF,yF,DF,wF,bF,LF,PF,kF,MF,UF,BF,VF,QF,xF,FF,GF,jF,YF,HF;function KF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function WF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?KF(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):KF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let JF=(gF=Ww("LocalAudioTrack","getTrackId"),fF=IF(),RF=xx("LocalAudioTrack","_enabledMutex"),CF=IF(),TF=xx("LocalAudioTrack","_enabledMutex"),mF=IF(),SF=Lx({report:Px}),OF=IF(),vF=IF(),NF=IF(),yF=IF(),gF((tx((wF=class extends Fx{get isPlaying(){return this._useAudioElement?_F.isPlaying(this.getTrackId()):this._source.isPlayed}constructor(e,t,i){super(e,i),tD(this,"trackMediaType","audio"),tD(this,"_encoderConfig",void 0),tD(this,"_source",void 0),tD(this,"_enabled",!0),tD(this,"_volume",100),tD(this,"_useAudioElement",!1),tD(this,"_bypassWebAudio",!1),tD(this,"processor",void 0),tD(this,"processorContext",void 0),tD(this,"processorDestination",void 0),this._encoderConfig=t,this._source=new eF(e),cb("LOCAL_AUDIO_TRACK_USES_WEB_AUDIO")||(this._useAudioElement=!0),this.processorContext=new $F(this._source.context,this.getTrackId()),this.processorDestination=new ZF(this.processorContext),this.bindProcessorDestinationEvents(),this._source.on(qL.UPDATE_SOURCE,(()=>{this.processor&&this.processor.updateInput({node:this._source.processSourceNode,context:this.processorContext})}))}setVolume(e){EL(e,"volume",0,1e3);const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_AUDIO_TRACK_SET_VOLUME,options:[this.getTrackId(),e]},300);this._volume=e,this._source.setVolume(e/100),this._useAudioElement&&_F.setVolume(this.getTrackId(),e);try{if(this._bypassWebAudio)return mw.debug("[".concat(this.getTrackId(),"] setVolume returned because no pass through WebAudio.")),void t.onSuccess();const e=this._source.createOutputTrack();this._mediaStreamTrack!==e&&(this._mediaStreamTrack=e,LG(this,OP.NEED_REPLACE_TRACK,this).then((()=>{mw.debug("[".concat(this.getTrackId(),"] replace web audio track success")),xw("debug",this,"replace web audio track success")})).catch((e=>{mw.warning("[".concat(this.getTrackId(),"] replace web audio track failed"),e),xw("warning",this,"replace web audio track failed ".concat(e.toString()))})))}catch(e){}t.onSuccess()}getVolumeLevel(){return this._source.getAccurateVolumeLevel()}async setPlaybackDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_SET_OUTPUT_DEVICE,options:[this.getTrackId(),e]});if(!this._useAudioElement)throw new pw(hw.NOT_SUPPORTED,"your browser does not support setting the audio output device");try{await _F.setSinkID(this.getTrackId(),e)}catch(e){throw t.onError(e),e}t.onSuccess()}async setEnabled(e,t,i){if(!i){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),e){this._originMediaStreamTrack.enabled=!0;try{i||(this._enabled=!0),await LG(this,OP.NEED_ENABLE_TRACK,this),mw.info("[".concat(this.getTrackId(),"] setEnabled to ").concat(e," success")),Yw("info",this,"setEnabled",e,"success")}catch(t){throw i||(this._enabled=!1),mw.error("[".concat(this.getTrackId(),"] setEnabled to true error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}}else{this._originMediaStreamTrack.enabled=!1,i||(this._enabled=!1);try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw i||(this._enabled=!0),mw.error("[".concat(this.getTrackId(),"] setEnabled to false error"),t.toString()),Yw("info",this,"setEnabled",e,t.toString()),t}}}async setMuted(e){e!==this._muted&&(this.stateCheck("muted",e),this._muted=e,this._mediaStreamTrack.enabled=!e,mw.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(e)),Yw("debug",this,"setMuted",e),e?await LG(this,OP.NEED_MUTE_TRACK,this):await LG(this,OP.NEED_UNMUTE_TRACK,this))}getStats(){return xG((()=>{mw.warning("[deprecated] LocalAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalAudioStats instead"),xw("warning",this,"LocalAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalAudioStats instead")}),"localAudioTrackGetStatsWarning"),PG(this,OP.GET_STATS)||WF({},tP)}setAudioFrameCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4096;if(!e)return this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(t),this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),this._source.on(qL.ON_AUDIO_BUFFER,(t=>e(t)))}play(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_AUDIO_TRACK_PLAY,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] start audio playback")),Yw("debug",this,"play"),this._useAudioElement?(mw.debug("[".concat(this.getTrackId(),"] start audio playback in element")),xw("debug",this,"start audio playback in element"),_F.play(this._mediaStreamTrack,this.getTrackId(),this._volume)):this._source.play(),e.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_AUDIO_TRACK_STOP,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] stop audio playback")),Yw("debug",this,"stop"),this._useAudioElement?_F.stop(this.getTrackId()):this._source.stop(),e.onSuccess()}close(){super.close(),this.unbindProcessorDestinationEvents(),this.unbindProcessorContextEvents(),this.unpipe(),this.processorDestination._source&&this.processorDestination._source.unpipe(),this._source.destroy()}_updatePlayerSource(){mw.debug("[".concat(this.getTrackId(),"] update player source track")),Yw("debug",this,"_updatePlayerSource"),this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&_F.updateTrack(this.getTrackId(),this._mediaStreamTrack)}async _updateOriginMediaStreamTrack(e,t){this._originMediaStreamTrack!==e&&(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),e.addEventListener("ended",this._handleTrackEnded),t&&this._originMediaStreamTrack.stop(),this._originMediaStreamTrack=e,this.processor&&this.processor.updateInput({track:e,context:this.processorContext}),this._mediaStreamTrack!==this._source.outputTrack?(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)):this._source.updateTrack(this._originMediaStreamTrack))}renewMediaStreamTrack(e){return Mm.resolve(void 0)}pipe(e){if(this._bypassWebAudio)throw new pw(hw.INVALID_OPERATION,"Can not process AudioTrack when bypassWebAudio set to true.");if(this.processor===e)return e;if(e._source)throw new pw(hw.INVALID_OPERATION,"Processor ".concat(e.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=e,this.processor._source=this,e.updateInput({track:this._originMediaStreamTrack,node:this._source.processSourceNode,context:this.processorContext}),e}unpipe(){var e;if(!this.processor)return;const t=this.processor;null===(e=this._source.processSourceNode)||void 0===e||e.disconnect(),this.processor._source=!1,this.processor=void 0,t.reset()}bindProcessorDestinationEvents(){this.processorDestination.on(WP.ON_TRACK,(async e=>{e?e!==this._mediaStreamTrack&&(this._mediaStreamTrack=e,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this))})),this.processorDestination.on(WP.ON_NODE,(e=>{this._source.processedNode=e}))}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(WP.ON_TRACK),this.processorDestination.removeAllListeners(WP.ON_NODE)}unbindProcessorContextEvents(){this.processorContext.removeAllListeners(JP.REQUEST_UPDATE_CONSTRAINTS),this.processorContext.removeAllListeners(JP.REQUEST_CONSTRAINTS)}}).prototype,"setPlaybackDevice",[fF],Object.getOwnPropertyDescriptor(wF.prototype,"setPlaybackDevice"),wF.prototype),tx(wF.prototype,"setEnabled",[RF,CF],Object.getOwnPropertyDescriptor(wF.prototype,"setEnabled"),wF.prototype),tx(wF.prototype,"setMuted",[TF,mF,SF],Object.getOwnPropertyDescriptor(wF.prototype,"setMuted"),wF.prototype),tx(wF.prototype,"getStats",[OF],Object.getOwnPropertyDescriptor(wF.prototype,"getStats"),wF.prototype),tx(wF.prototype,"setAudioFrameCallback",[vF],Object.getOwnPropertyDescriptor(wF.prototype,"setAudioFrameCallback"),wF.prototype),tx(wF.prototype,"play",[NF],Object.getOwnPropertyDescriptor(wF.prototype,"play"),wF.prototype),tx(wF.prototype,"stop",[yF],Object.getOwnPropertyDescriptor(wF.prototype,"stop"),wF.prototype),DF=wF))||DF),qF=(bF=Ww("MicrophoneAudioTrack","getTrackId"),LF=IF(),PF=xx("MicrophoneAudioTrack","_enabledMutex"),kF=IF(),bF((tx((UF=class extends JF{constructor(e,t,i,n){super(e,t.encoderConfig?sb(t.encoderConfig):{},n),tD(this,"_config",void 0),tD(this,"_deviceName","default"),tD(this,"_constraints",void 0),tD(this,"_originalConstraints",void 0),tD(this,"_enabled",!0),Kw("info",this,"constructor",{trackId:n,deviceId:e.label,constraints:i}),this._config=t,this._constraints=i,this._originalConstraints=i,this._deviceName=e.label,"boolean"==typeof t.bypassWebAudio&&(this._bypassWebAudio=t.bypassWebAudio),Qy()&&Kx.bindInterruptDetectorTrack(this),this.bindProcessorContextEvents()}async setDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.MIC_AUDIO_TRACK_SET_DEVICE,options:[this.getTrackId(),e]});if(mw.info("[".concat(this.getTrackId(),"] start set device to ").concat(e)),Yw("info",this,"setDevice",e),this._enabled)try{const i=await EF.getDeviceById(e),n={};n.audio=WF({},this._constraints),n.audio.deviceId={exact:e},this._originMediaStreamTrack.stop();let r=null;try{r=await cF(n,this.getTrackId())}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setDevice failed"),t.toString()),Yw("error",this,"setDevice",e,t.toString()),r=await cF({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(r.getAudioTracks()[0],!1),t}await this._updateOriginMediaStreamTrack(r.getAudioTracks()[0],!1),this._deviceName=i.label,this._config.microphoneId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}else try{const t=await EF.getDeviceById(e);this._deviceName=t.label,this._config.microphoneId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}t.onSuccess(),mw.info("[".concat(this.getTrackId(),"] set device to ").concat(e," success")),Yw("info",this,"setDevice",e,"success")}async setEnabled(e,t,i){if(t)return mw.debug("[".concat(this.getTrackId,"] setEnabled false (do not close microphone)")),xw("debug",this,"setEnabled false (do not close microphone)"),await super.setEnabled(e);if(!i){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),!e){this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),i||(this._enabled=!1);try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled false failed"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}return}const n=WF({},this._constraints),r=EF.searchDeviceIdByName(this._deviceName);r&&!n.deviceId&&(n.deviceId=r);try{i||(this._enabled=!0);const e=await cF({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(e.getAudioTracks()[0],!1),await LG(this,OP.NEED_ENABLE_TRACK,this)}catch(t){throw i||(this._enabled=!1),mw.error("[".concat(this.getTrackId(),"] setEnabled true failed"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}mw.info("[".concat(this.getTrackId(),"] setEnabled success")),Yw("info",this,"setEnabled",e,"success")}close(){super.close(),Qy()&&Kx.unbindInterruptDetectorTrack(this)}onTrackEnded(){if((Vy()||jy())&&this._enabled&&!this._isClosed&&Kx.duringInterruption){const e=async()=>{Kx.off(Mx.IOS_INTERRUPTION_END,e),this._enabled&&!this._isClosed&&(mw.debug("[".concat(this.getTrackId(),"] try capture microphone media device for interrupted iOS device.")),xw("debug",this,"try capture microphone media device for interrupted iOS device"),await this.setEnabled(!1),await this.setEnabled(!0))};Kx.on(Mx.IOS_INTERRUPTION_END,e)}else mw.debug("[".concat(this.getTrackId(),"] track ended")),jw("debug",["MediaStreamTrack",this.getTrackId()],"ended"),this.emit(DP.TRACK_ENDED)}async renewMediaStreamTrack(e){const t=e||this._constraints,i=EF.searchDeviceIdByName(this._deviceName);i&&!t.deviceId&&(t.deviceId=i),this._constraints=t,this._originMediaStreamTrack.stop();const n=await cF({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(n.getAudioTracks()[0],!0)}bindProcessorContextEvents(){this.processorContext.on(JP.REQUEST_UPDATE_CONSTRAINTS,(async(e,t,i)=>{try{const i=Object.assign({},this._originalConstraints,...e);await this.renewMediaStreamTrack(i),t()}catch(e){i(e)}})),this.processorContext.on(JP.REQUEST_CONSTRAINTS,(async e=>{e(this._originMediaStreamTrack.getSettings())}))}}).prototype,"setDevice",[LF],Object.getOwnPropertyDescriptor(UF.prototype,"setDevice"),UF.prototype),tx(UF.prototype,"setEnabled",[PF,kF],Object.getOwnPropertyDescriptor(UF.prototype,"setEnabled"),UF.prototype),MF=UF))||MF),XF=(BF=Ww("BufferSourceAudioTrack","getTrackId"),VF=IF(),QF=IF(),xF=IF(),FF=IF(),GF=IF(),BF((tx((YF=class extends JF{constructor(e,t,i,n){super(t.createOutputTrack(),i,n),tD(this,"source",void 0),tD(this,"_bufferSource",void 0),Kw("info",this,"constructor",{trackId:n}),this.source=e,this._bufferSource=t,this._bufferSource.on(qL.AUDIO_SOURCE_STATE_CHANGE,(e=>{this.emit(DP.SOURCE_STATE_CHANGE,e)}));try{this._mediaStreamTrack=this._source.createOutputTrack()}catch(e){}}get currentState(){return this._bufferSource.currentState}get duration(){return this._bufferSource.duration}getCurrentTime(){return this._bufferSource.currentTime}startProcessAudioBuffer(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_START,options:[this.getTrackId(),e,this.duration]});e&&this._bufferSource.updateOptions(e),this._bufferSource.startProcessAudioBuffer(),t.onSuccess()}pauseProcessAudioBuffer(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_PAUSE,options:[this.getTrackId()]});this._bufferSource.pauseProcessAudioBuffer(),e.onSuccess()}seekAudioBuffer(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_SEEK,options:[this.getTrackId()]});this._bufferSource.seekAudioBuffer(e),t.onSuccess()}resumeProcessAudioBuffer(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_RESUME,options:[this.getTrackId()]});this._bufferSource.resumeProcessAudioBuffer(),e.onSuccess()}stopProcessAudioBuffer(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_STOP,options:[this.getTrackId()]});this._bufferSource.stopProcessAudioBuffer(),e.onSuccess()}}).prototype,"startProcessAudioBuffer",[VF],Object.getOwnPropertyDescriptor(YF.prototype,"startProcessAudioBuffer"),YF.prototype),tx(YF.prototype,"pauseProcessAudioBuffer",[QF],Object.getOwnPropertyDescriptor(YF.prototype,"pauseProcessAudioBuffer"),YF.prototype),tx(YF.prototype,"seekAudioBuffer",[xF],Object.getOwnPropertyDescriptor(YF.prototype,"seekAudioBuffer"),YF.prototype),tx(YF.prototype,"resumeProcessAudioBuffer",[FF],Object.getOwnPropertyDescriptor(YF.prototype,"resumeProcessAudioBuffer"),YF.prototype),tx(YF.prototype,"stopProcessAudioBuffer",[GF],Object.getOwnPropertyDescriptor(YF.prototype,"stopProcessAudioBuffer"),YF.prototype),jF=YF))||jF),zF=Ww("MixingAudioTrack","getTrackId")(HF=class extends JF{get isActive(){for(const e of this.trackList)if(e._enabled&&!e._isClosed&&!e.muted)return!0;return!1}constructor(){const e=Wx().createMediaStreamDestination();super(e.stream.getAudioTracks()[0],void 0,vG(8,"track-mix-")),tD(this,"trackList",void 0),tD(this,"destNode",void 0);try{this._mediaStreamTrack=this._source.createOutputTrack()}catch(e){}this.destNode=e,this.trackList=[]}hasAudioTrack(e){return-1!==this.trackList.indexOf(e)}addAudioTrack(e){if(-1!==this.trackList.indexOf(e))return mw.debug("track ".concat(e.getTrackId()," is already added")),void xw("debug",this,"track already added");mw.debug("add ".concat(e.getTrackId()," to mixing track")),Yw("debug",this,"addAudioTrack",e.getTrackId()),e._source.outputNode.connect(this.destNode),this.trackList.push(e),this.updateEncoderConfig()}removeAudioTrack(e){if(-1!==this.trackList.indexOf(e)){mw.debug("remove ".concat(e.getTrackId()," from mixing track")),Yw("debug",this,"removeAudioTrack",e.getTrackId());try{e._source.outputNode.disconnect(this.destNode)}catch(e){}MG(this.trackList,e),this.updateEncoderConfig()}}updateEncoderConfig(){const e={};this.trackList.forEach((t=>{t._encoderConfig&&((t._encoderConfig.bitrate||0)>(e.bitrate||0)&&(e.bitrate=t._encoderConfig.bitrate),(t._encoderConfig.sampleRate||0)>(e.sampleRate||0)&&(e.sampleRate=t._encoderConfig.sampleRate),(t._encoderConfig.sampleSize||0)>(e.sampleSize||0)&&(e.sampleSize=t._encoderConfig.sampleSize),t._encoderConfig.stereo&&(e.stereo=!0))})),this._encoderConfig=e}})||HF;class ZF extends Ew{constructor(e){super(),tD(this,"name","AudioProcessorDestination"),tD(this,"ID","0"),tD(this,"inputTrack",void 0),tD(this,"inputNode",void 0),tD(this,"audioProcessorContext",void 0),tD(this,"_source",void 0),this.audioProcessorContext=e}get kind(){return"audio"}get enabled(){return!0}pipe(){throw new pw(hw.NOT_SUPPORTED,"AudioProcessorDestination cannot pipe to any other Processor")}unpipe(){throw new pw(hw.NOT_SUPPORTED,"VideoProcessor cannot unpipe to any other Processor")}enable(){}disable(){}reset(){this.inputTrack=void 0,this.inputNode=void 0,this.emit(WP.ON_TRACK,void 0),this.emit(WP.ON_NODE,void 0)}updateInput(e){if(e.context!==this.audioProcessorContext)throw new Error("ProcessorContext passed to VideoTrack.processorDestination doesn't match it's belonging VideoTrack's context.\n        Probably you are making pipeline like this: audioTrack1.pipe(processor).pipe(audioTrack2.processorDestination).");e.track&&this.inputTrack!==e.track&&(this.inputTrack=e.track,this.emit(WP.ON_TRACK,this.inputTrack)),e.node&&this.inputNode!==e.node&&(this.inputNode=e.node,this.emit(WP.ON_NODE,this.inputNode))}}class $F extends Ew{constructor(e,t){super(),tD(this,"constraintsMap",new Map),tD(this,"statsRegistry",[]),tD(this,"audioContext",void 0),tD(this,"trackId",void 0),this.audioContext=e,this.trackId=t}async getConstraints(){return bG(this,JP.REQUEST_CONSTRAINTS)}getAudioContext(){return this.audioContext}async requestApplyConstraints(e,t){var i;return mw.info("processor ".concat(t.name," requestApplyConstraints for ").concat(this.trackId)),e&&this.constraintsMap.set(t,e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(i=this.constraintsMap).call(i)))}async requestRevertConstraints(e){var t;if(this.constraintsMap.has(e))return this.constraintsMap.delete(e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(t=this.constraintsMap).call(t)))}registerStats(e,t,i){this.statsRegistry.find((i=>i.processorID===e.ID&&i.processorName===e.name&&i.type===t))||this.statsRegistry.push({processorName:e.name,processorID:e.ID,type:t,cb:i})}unregisterStats(e,t){}gatherStats(){return this.statsRegistry.map((e=>{let{processorID:t,processorName:i,type:n,cb:r}=e;return{processorID:t,processorName:i,type:n,stats:r()}}))}}class eG extends Ew{constructor(){super(...arguments),tD(this,"resultStorage",new Map)}setLocalAudioStats(e,t,i){this.record("AUDIO_INPUT_LEVEL_TOO_LOW",e,this.checkAudioInputLevel(i,t)),this.record("SEND_AUDIO_BITRATE_TOO_LOW",e,this.checkSendAudioBitrate(i,t))}setLocalVideoStats(e,t,i){this.record("SEND_VIDEO_BITRATE_TOO_LOW",e,this.checkSendVideoBitrate(i,t)),this.record("FRAMERATE_INPUT_TOO_LOW",e,this.checkFramerateInput(i,t)),this.record("FRAMERATE_SENT_TOO_LOW",e,this.checkFramerateSent(i))}setRemoteAudioStats(e,t){const i=e.getUserId();this.record("AUDIO_OUTPUT_LEVEL_TOO_LOW",i,this.checkAudioOutputLevel(t))}setRemoteVideoStats(e,t){const i=e.getUserId();this.record("RECV_VIDEO_DECODE_FAILED",i,this.checkVideoDecode(t))}record(e,t,i){this.resultStorage.has(e)||this.resultStorage.set(e,{result:[],isPrevNormal:!0});const n=this.resultStorage.get(e);if(n&&(n.result.push(i),n.result.length>=5)){const i=n.result.includes(!0);n.isPrevNormal&&!i&&this.emit("exception",tG[e],e,t),!n.isPrevNormal&&i&&this.emit("exception",tG[e]+2e3,e+"_RECOVER",t),n.isPrevNormal=i,n.result=[]}}checkAudioOutputLevel(e){return!(e.receiveBitrate>0&&0===e.receiveLevel)}checkAudioInputLevel(e,t){return t instanceof zF&&!t.isActive||!!t.muted||0!==e.sendVolumeLevel}checkFramerateInput(e,t){let i=null;t._encoderConfig&&t._encoderConfig.frameRate&&(i=lG(t._encoderConfig.frameRate));const n=e.captureFrameRate;return!i||!n||!(i>10&&n<5||i<10&&i>=5&&n<=1)}checkFramerateSent(e){return!(e.captureFrameRate&&e.sendFrameRate&&e.captureFrameRate>5&&e.sendFrameRate<=1)}checkSendVideoBitrate(e,t){return!!t.muted||0!==e.sendBitrate}checkSendAudioBitrate(e,t){return t instanceof zF&&!t.isActive||!!t.muted||0!==e.sendBitrate}checkVideoDecode(e){return 0===e.receiveBitrate||0!==e.decodeFrameRate}}const tG={FRAMERATE_INPUT_TOO_LOW:1001,FRAMERATE_SENT_TOO_LOW:1002,SEND_VIDEO_BITRATE_TOO_LOW:1003,RECV_VIDEO_DECODE_FAILED:1005,AUDIO_INPUT_LEVEL_TOO_LOW:2001,AUDIO_OUTPUT_LEVEL_TOO_LOW:2002,SEND_AUDIO_BITRATE_TOO_LOW:2003},iG=new class{markSubscribeStart(e,t){performance.mark("agora-web-sdk/".concat(e,"/subscribe-").concat(t))}markPublishStart(e,t){performance.mark("agora-web-sdk/".concat(e,"/publish-").concat(t))}measureFromSubscribeStart(e,t){const i=performance.getEntriesByName("agora-web-sdk/".concat(e,"/subscribe-").concat(t));if(i.length>0){const e=i[i.length-1];return Math.round(performance.now()-e.startTime)}return 0}measureFromPublishStart(e,t){const i=performance.getEntriesByName("agora-web-sdk/".concat(e,"/publish-").concat(t));if(i.length>0){const e=i[i.length-1];return Math.round(performance.now()-e.startTime)}return 0}};function nG(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function rG(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?nG(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):nG(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class oG{constructor(e){tD(this,"store",void 0),tD(this,"onStatsException",void 0),tD(this,"onUploadPublishDuration",void 0),tD(this,"localStats",new Map),tD(this,"remoteStats",new Map),tD(this,"updateStatsInterval",void 0),tD(this,"trafficStats",void 0),tD(this,"trafficStatsPeerList",[]),tD(this,"uplinkStats",void 0),tD(this,"exceptionMonitor",void 0),tD(this,"p2pChannel",void 0),tD(this,"updateStats",(()=>{this.p2pChannel&&(this.updateRemoteStats(this.p2pChannel),this.updateLocalStats(this.p2pChannel))})),this.store=e,this.updateStatsInterval=window.setInterval(this.updateStats,1e3),this.exceptionMonitor=new eG,this.exceptionMonitor.on("exception",((e,t,i)=>{this.onStatsException&&this.onStatsException(e,t,i)}))}reset(){this.localStats=new Map,this.remoteStats=new Map,this.trafficStats=void 0,this.trafficStatsPeerList=[],this.uplinkStats=void 0}getLocalAudioTrackStats(){return this.localStats.get(xP.LocalAudioTrack)||rG({},tP)}getLocalVideoTrackStats(){return this.localStats.get(xP.LocalVideoTrack)||rG({},iP)}getRemoteAudioTrackStats(e){const t=(e,t)=>{if(!this.trafficStats)return t;const i=this.trafficStats.peer_delay.find((t=>t.peer_uid===e));return i&&(t.publishDuration=i.B_ppad+(Date.now()-this.trafficStats.timestamp)),t},i={};if(e){var n;const r=null===(n=this.remoteStats.get(e))||void 0===n?void 0:n.audioStats;r&&(i[e]=t(e,r))}else Array.from(this.remoteStats.entries()).forEach((e=>{let[n,{audioStats:r}]=e;r&&(i[n]=t(n,r))}));return i}getRemoteNetworkQualityStats(e){const t={};if(e){var i;const n=null===(i=this.remoteStats.get(e))||void 0===i?void 0:i.networkStats;n&&(t[e]=n)}else Array.from(this.remoteStats.entries()).forEach((e=>{let[i,{networkStats:n}]=e;n&&(t[i]=n)}));return t}getRemoteVideoTrackStats(e){const t=(e,t)=>{if(!this.trafficStats)return t;const i=this.trafficStats.peer_delay.find((t=>t.peer_uid===e));return i&&(t.publishDuration=i.B_ppvd+(Date.now()-this.trafficStats.timestamp)),t},i={};if(e){var n;const r=null===(n=this.remoteStats.get(e))||void 0===n?void 0:n.videoStats;r&&(i[e]=t(e,r))}else Array.from(this.remoteStats.entries()).forEach((e=>{let[n,{videoStats:r}]=e;r&&(i[n]=t(n,r))}));return i}getRTCStats(){let e=0,t=0,i=0,n=0;const r=this.localStats.get(xP.LocalAudioTrack);r&&(e+=r.sendBytes,t+=r.sendBitrate);const o=this.localStats.get(xP.LocalVideoTrack);o&&(e+=o.sendBytes,t+=o.sendBitrate);const s=this.localStats.get(xP.LocalVideoLowTrack);s&&(e+=s.sendBytes,t+=s.sendBitrate),this.remoteStats.forEach((e=>{let{audioStats:t,videoStats:r}=e;t&&(i+=t.receiveBytes,n+=t.receiveBitrate),r&&(i+=r.receiveBytes,n+=r.receiveBitrate)}));let a=1;return this.trafficStats&&(a+=this.trafficStats.peer_delay.length),{Duration:0,UserCount:a,SendBitrate:t,SendBytes:e,RecvBytes:i,RecvBitrate:n,OutgoingAvailableBandwidth:this.uplinkStats?this.uplinkStats.B_uab/1e3:0,RTT:this.trafficStats?2*this.trafficStats.B_acd:0}}addLocalStats(e){this.localStats.set(e,void 0)}removeLocalStats(e){e?this.localStats.delete(e):this.localStats.clear()}addRemoteStats(e){this.remoteStats.set(e,{})}removeRemoteStats(e){e?this.remoteStats.delete(e):this.remoteStats.clear()}addP2PChannel(e){this.p2pChannel=e}updateTrafficStats(e){e.peer_delay=e.peer_delay.filter((e=>void 0!==e.B_ppad||void 0!==e.B_ppvd)),e.peer_delay.filter((e=>-1===this.trafficStatsPeerList.indexOf(e.peer_uid))).forEach((e=>{var t;const i=null===(t=this.p2pChannel)||void 0===t?void 0:t.getRemoteMedia(e.peer_uid),n=null!=i&&i.videoSSRC?iG.measureFromSubscribeStart(this.store.clientId,i.videoSSRC):0,r=null!=i&&i.audioSSRC?iG.measureFromSubscribeStart(this.store.clientId,i.audioSSRC):0;void 0!==e.B_ppad&&void 0!==e.B_ppvd&&(this.onUploadPublishDuration&&this.onUploadPublishDuration(e.peer_uid,e.B_ppad,e.B_ppvd,n>r?n:r),this.trafficStatsPeerList.push(e.peer_uid))})),this.trafficStats=e}updateUplinkStats(e){this.uplinkStats&&this.uplinkStats.B_fir!==e.B_fir&&mw.debug("[".concat(this.store.clientId,"]: Period fir changes to ").concat(e.B_fir)),this.uplinkStats=e}static isRemoteVideoFreeze(e,t,i){if(!e)return!1;const n=!!i&&t.framesDecodeFreezeTime>i.framesDecodeFreezeTime,r=!i||t.framesDecodeCount>i.framesDecodeCount;return n||!r}static isRemoteAudioFreeze(e){return!!e&&e._isFreeze()}isLocalVideoFreeze(e){return!(!e.inputFrame||!e.sentFrame)&&e.inputFrame.frameRate>5&&e.sentFrame.frameRate<3}updateLocalStats(e){Array.from(this.localStats.entries()).forEach((t=>{let[i,n]=t;switch(i){case xP.LocalVideoTrack:case xP.LocalVideoLowTrack:{const t=n,r=rG({},iP),o=e.getStats(),s=e.getLocalMedia(i);if(o){const i=o.videoSend.find((e=>e.ssrc===(null==s?void 0:s.ssrcs[0].ssrcId)));if(i){const n=e.getLocalVideoSize(),o=e.getEncoderConfig(xP.LocalVideoTrack);"H264"!==i.codec&&"VP8"!==i.codec&&"VP9"!==i.codec&&"AV1X"!==i.codec&&"AV1"!==i.codec||(r.codecType=i.codec),r.sendBytes=i.bytes,r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0,i.inputFrame?(r.captureFrameRate=i.inputFrame.frameRate,r.captureResolutionHeight=i.inputFrame.height,r.captureResolutionWidth=i.inputFrame.width):n&&(r.captureResolutionWidth=n.width,r.captureResolutionHeight=n.height),i.sentFrame?(r.sendFrameRate=i.sentFrame.frameRate,r.sendResolutionHeight=i.sentFrame.height,r.sendResolutionWidth=i.sentFrame.width):n&&(r.sendResolutionWidth=n.width,r.sendResolutionHeight=n.height),i.avgEncodeMs&&(r.encodeDelay=i.avgEncodeMs),o&&o.bitrateMax&&(r.targetSendBitrate=1e3*o.bitrateMax),r.sendPackets=i.packets,r.sendPacketsLost=i.packetsLost,r.totalDuration=t?t.totalDuration+1:1,r.totalFreezeTime=t?t.totalFreezeTime:0,this.isLocalVideoFreeze(i)&&(r.totalFreezeTime+=1)}this.trafficStats&&(r.sendPacketsLost=this.trafficStats.B_pvlr4/100)}this.localStats.set(i,r),r&&s&&this.exceptionMonitor.setLocalVideoStats(this.store.uid,s.track,r);break}case xP.LocalAudioTrack:{const t=n,r=rG({},tP),o=e.getStats(),s=e.getLocalMedia(i);if(o){const i=o.audioSend.find((e=>e.ssrc===(null==s?void 0:s.ssrcs[0].ssrcId)));if(i){if("opus"!==i.codec&&"aac"!==i.codec&&"PCMU"!==i.codec&&"PCMA"!==i.codec&&"G722"!==i.codec||(r.codecType=i.codec),i.inputLevel)r.sendVolumeLevel=Math.round(32767*i.inputLevel);else{const t=e.getLocalAudioVolume();t&&(r.sendVolumeLevel=Math.round(32767*t))}r.sendBytes=i.bytes,r.sendPackets=i.packets,r.sendPacketsLost=i.packetsLost,r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0}}this.trafficStats&&(r.sendPacketsLost=this.trafficStats.B_pvlr4/100),this.localStats.set(xP.LocalAudioTrack,r),r&&s&&this.exceptionMonitor.setLocalAudioStats(this.store.uid,s.track,r);break}}}))}updateRemoteStats(e){Array.from(this.remoteStats.entries()).forEach((t=>{let[i,{videoStats:n,audioStats:r,videoPcStats:o}]=t;const s=r,a=n,c=o,A=rG({},nP),d=rG({},oP),u=rG({},rP),{audioTrack:E,videoTrack:l,audioSSRC:h,videoSSRC:p}=e.getRemoteMedia(i),_=e.getStats(),I=null==_?void 0:_.audioRecv.find((e=>e.ssrc===h)),g=null==_?void 0:_.videoRecv.find((e=>e.ssrc===p)),f=this.trafficStats&&this.trafficStats.peer_delay.find((e=>e.peer_uid===i));if(I&&("opus"!==I.codec&&"aac"!==I.codec&&"PCMU"!==I.codec&&"PCMA"!==I.codec&&"G722"!==I.codec||(A.codecType=I.codec),I.outputLevel?A.receiveLevel=Math.round(32767*I.outputLevel):E&&(A.receiveLevel=Math.round(32767*E.getVolumeLevel())),A.receiveBytes=I.bytes,A.receivePackets=I.packets,A.receivePacketsLost=I.packetsLost,A.packetLossRate=A.receivePacketsLost/(A.receivePackets+A.receivePacketsLost),A.receiveBitrate=s?8*Math.max(0,A.receiveBytes-s.receiveBytes):0,A.totalDuration=s?s.totalDuration+1:1,A.totalFreezeTime=s?s.totalFreezeTime:0,A.freezeRate=A.totalFreezeTime/A.totalDuration,A.receiveDelay=I.jitterBufferMs,A.totalDuration>10&&oG.isRemoteAudioFreeze(E)&&(A.totalFreezeTime+=1)),g){"H264"!==g.codec&&"VP8"!==g.codec&&"VP9"!==g.codec&&"AV1X"!==g.codec&&"AV1"!==g.codec||(d.codecType=g.codec),d.receiveBytes=g.bytes,d.receiveBitrate=a?8*Math.max(0,d.receiveBytes-a.receiveBytes):0,d.decodeFrameRate=g.decodeFrameRate<0?0:g.decodeFrameRate,d.renderFrameRate=g.decodeFrameRate<0?0:g.decodeFrameRate,g.outputFrame&&(d.renderFrameRate=g.outputFrame.frameRate),g.receivedFrame?(d.receiveFrameRate=g.receivedFrame.frameRate,d.receiveResolutionHeight=g.receivedFrame.height,d.receiveResolutionWidth=g.receivedFrame.width):l&&(d.receiveResolutionHeight=l._videoHeight||0,d.receiveResolutionWidth=l._videoWidth||0),void 0!==g.framesRateFirefox&&(d.receiveFrameRate=Math.round(g.framesRateFirefox)),d.receivePackets=g.packets,d.receivePacketsLost=g.packetsLost,d.packetLossRate=d.receivePacketsLost/(d.receivePackets+d.receivePacketsLost),d.totalDuration=a?a.totalDuration+1:1,d.totalFreezeTime=a?a.totalFreezeTime:0,d.receiveDelay=g.jitterBufferMs||0;const t=!!p&&e.getRemoteVideoIsReady(p);l&&t&&oG.isRemoteVideoFreeze(l,g,c)&&(d.totalFreezeTime+=1),d.freezeRate=d.totalFreezeTime/d.totalDuration}f&&(A.end2EndDelay=f.B_ad,d.end2EndDelay=f.B_vd,A.transportDelay=f.B_ed,d.transportDelay=f.B_ed,A.currentPacketLossRate=f.B_ealr4/100,d.currentPacketLossRate=f.B_evlr4/100,u.uplinkNetworkQuality=f.B_punq?f.B_punq:0,u.downlinkNetworkQuality=f.B_pdnq?f.B_pdnq:0),this.remoteStats.set(i,{audioStats:A,videoStats:d,videoPcStats:g,networkStats:u}),E&&this.exceptionMonitor.setRemoteAudioStats(E,A),l&&this.exceptionMonitor.setRemoteVideoStats(l,d)}))}}function sG(e){return(new TextEncoder).encode(e)}const aG=async e=>function(e,t){let i="";return new Uint8Array(e).forEach((e=>{i+=e.toString(16).padStart(2,"0")})),i}(await crypto.subtle.digest("SHA-256",sG(e)));function cG(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function AG(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?cG(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):cG(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function dG(e){if(!e.address||!e.tcp)throw new pw(hw.UNEXPECTED_RESPONSE,"Invalid address format ".concat(e));return e.address.match(/^[\.\:\d]+$/)?"".concat(e.address.replace(/[^\d]/g,"-"),".edge.agora.io"):(mw.info("Cannot recognized as IP address ".concat(e.address,". Used As Host instead")),"".concat(e.address,":").concat(e.tcp))}function uG(e){return e.match(/^[\.\:\d]+$/)?"".concat(e.replace(/[^\d]/g,"-"),".").concat(cb("TURN_DOMAIN")):(mw.info("Cannot recognized as IP address ".concat(e,". Used As Host instead")),e)}function EG(e,t){const i=cb("GATEWAY_DOMAINS");let n=i[1]&&-1!==t.indexOf(i[1])?1:0;return e.addresses=e.addresses||[],{gatewayAddrs:e.addresses.map((e=>e.domain_prefix?{address:"".concat(e.domain_prefix,".").concat(i[n++%i.length],":").concat(e.port)}:e.ip.match(/^[\.\:\d]+$/)?{ip:e.ip,port:e.port,address:"".concat(e.ip.replace(/[^\d]/g,"-"),".").concat(i[n++%i.length],":").concat(e.port)}:(mw.info("Cannot recognized as IP address ".concat(e.ip,". Used As Host instead")),{ip:e.ip,port:e.port,address:"".concat(e.ip,":").concat(e.port)}))),uid:e.uid,cid:e.cid,vid:e.detail&&e.detail[8],uni_lbs_ip:e.detail&&e.detail[1],res:e,csIp:e.detail&&e.detail[502]}}function lG(e){return"number"==typeof e?e:e.exact||e.ideal||e.max||e.min||0}function hG(e){const t=e._encoderConfig;if(!t)return{};const i={resolution:t.width&&t.height?"".concat(lG(t.width),"x").concat(lG(t.height)):void 0,maxVideoBW:t.bitrateMax,minVideoBW:t.bitrateMin};return"number"==typeof t.frameRate?(i.maxFrameRate=t.frameRate,i.minFrameRate=t.frameRate):t.frameRate&&(i.maxFrameRate=t.frameRate.max||t.frameRate.ideal||t.frameRate.exact||t.frameRate.min,i.minFrameRate=t.frameRate.min||t.frameRate.ideal||t.frameRate.exact||t.frameRate.max),i}function pG(e,t,i){var n;const r=t.videoSend.find((t=>t.ssrc===e));if(!r)return null;const o=null==i||null===(n=i.videoSend.find((t=>t.ssrc===e)))||void 0===n?void 0:n.inputFrame,s={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"video",type:"ssrc",ssrc:r.ssrc.toString()};return r.inputFrame&&(o&&r.inputFrame.height===o.height||(s.A_fhi=r.inputFrame.height?r.inputFrame.height.toString():"0"),o&&r.inputFrame.width===o.width||(s.A_fwi=r.inputFrame.width?r.inputFrame.width.toString():"0"),o&&r.inputFrame.frameRate===o.frameRate||(s.A_fri=r.inputFrame.frameRate?r.inputFrame.frameRate.toString():"0")),s}function _G(e){return e>=0&&e<.17?1:e>=.17&&e<.36?2:e>=.36&&e<.59?3:e>=.59&&e<=1?4:e>1?5:0}function IG(e,t){let i,n,r;switch(t){case WV.CHOOSE_SERVER:i=4096,n="choose server";break;case WV.CLOUD_PROXY:i=1048576,n="proxy";break;case WV.CLOUD_PROXY_5:i=4194304,n="proxy5";break;case WV.CLOUD_PROXY_FALLBACK:i=4194310,n="proxy fallback";break;default:throw new pw(hw.UNEXPECTED_ERROR,"multi unlibs response transformer get unknown service id",{csIp:e.detail&&e.detail[502],retry:!1})}if(e.response_body.forEach((t=>{t.buffer&&t.buffer.flag===i&&(r={code:t.buffer.code,addresses:(t.buffer.edges_services||[]).map((e=>AG(AG({},e),{},{ticket:t.buffer.cert}))),server_ts:e.enter_ts,uid:t.buffer.uid,cid:t.buffer.cid,cname:t.buffer.cname,detail:AG(AG({},t.buffer.detail),e.detail),flag:t.buffer.flag,opid:e.opid})})),!r)throw new pw(hw.MULTI_UNILBS_RESPONSE_ERROR,"cannot parse response ".concat(n," from multi unilbs response"),{csIp:e.detail&&e.detail[502]});return r}async function gG(e,t){return await Mm.all(e.addresses.map((async e=>({address:uG(e.ip),tcpport:e.port,udpport:e.port,username:t&&cb("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?t.toString():Zw.username,password:t&&cb("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?await aG(t.toString()):Zw.password}))))}function fG(e,t){const i=t._videoHeight||t.getMediaStreamTrack(!0).getSettings().height;return i?i/lG(e.height):4}function RG(e){let{candidateType:t,relayProtocol:i,type:n,address:r,port:o,protocol:s}=e;return"local-candidate"===n?{candidateType:t,relayProtocol:i,protocol:s}:{candidateType:t,relayProtocol:i,address:r,port:o,protocol:s}}function CG(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function TG(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?CG(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):CG(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function mG(e){return window.TextEncoder?(new TextEncoder).encode(e).length:e.length}function SG(e){return new Mm((t=>{window.setTimeout(t,e)}))}function OG(e){const t=new pw(hw.TIMEOUT,"timeout");return new Mm(((i,n)=>{window.setTimeout((()=>n(t)),e)}))}function vG(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,t=arguments.length>1?arguments[1]:void 0;const i=Math.random().toString(16).substr(2,e).toLowerCase();return i.length===e?"".concat(t).concat(i):"".concat(t).concat(i)+vG(e-i.length,"")}function NG(){return vG(32,"").toUpperCase()}const yG=()=>{};function DG(e){return new Mm(((t,i)=>{let n=!1;const r=document.createElement("video");r.setAttribute("autoplay",""),r.setAttribute("muted",""),r.muted=!0,r.autoplay=!0,r.setAttribute("playsinline",""),r.setAttribute("style","position: fixed; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(r);const o=Vy()?"canplay":"playing";r.addEventListener(o,(()=>{const e=r.videoWidth,i=r.videoHeight;!e&&By()||(n=!0,r.srcObject=null,r.remove(),t([e,i]))})),r.srcObject=new MediaStream([e]),r.play().catch(yG),setTimeout((()=>{n||(r.srcObject=null,r.remove(),t([r.videoWidth,r.videoHeight]))}),4e3)}))}function wG(e){return Mm.all(e.map((e=>e.then((e=>{throw e}),(e=>e))))).then((e=>{throw e}),(e=>e))}function bG(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return 0===e.getListeners(t).length?Mm.reject(new pw(hw.UNEXPECTED_ERROR,"can not emit promise")):new Mm(((i,r)=>{e.emit(t,...n,i,r)}))}function LG(e,t){if(0===e.getListeners(t).length)return Mm.resolve();for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return bG(e,t,...n)}function PG(e,t){if(0===e.getListeners(t).length)return null;for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return kG(e,t,...n)}function kG(e,t){let i=null,n=null;for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];if(e.emit(t,...o,(e=>{i=e}),(e=>{n=e})),null!==n)throw n;if(null===i)throw new pw(hw.UNEXPECTED_ERROR,"handler is not sync");return i}function MG(e,t){const i=e.indexOf(t);-1!==i&&e.splice(i,1)}function UG(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&t.push(e)})),t}function BG(e){Mm.resolve().then(e)}function VG(e){return JSON.parse(JSON.stringify(e))}const QG={};function xG(e,t){QG[t]||(QG[t]=!0,e())}function FG(e){const t=window.atob(e),i=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e+=1)i[e]=t.charCodeAt(e);return i}function GG(e){let t="";for(let i=0;i<e.length;i+=1)t+=String.fromCharCode(e[i]);return window.btoa(t)}const jG=new class{constructor(){tD(this,"fnMap",new Map)}throttleByKey(e,t,i,n){for(var r=arguments.length,o=new Array(r>4?r-4:0),s=4;s<r;s++)o[s-4]=arguments[s];if(this.fnMap.has(t)){const r=this.fnMap.get(t);if(r.threshold!==i){r.fn(...r.args),clearTimeout(r.timer);const s=window.setTimeout((()=>{const e=this.fnMap.get(t);e&&e.fn(...e.args),this.fnMap.delete(t)}),i);this.fnMap.set(t,{fn:e,threshold:i,timer:s,args:o,skipFn:n})}else r.skipFn&&r.skipFn(...r.args),this.fnMap.set(t,TG(TG({},r),{},{fn:e,args:o,skipFn:n}))}else{const r=window.setTimeout((()=>{const e=this.fnMap.get(t);e&&e.fn(...e.args),this.fnMap.delete(t)}),i);this.fnMap.set(t,{fn:e,threshold:i,timer:r,args:o,skipFn:n})}}},YG=jG.throttleByKey.bind(jG),HG=async e=>{let{fragementLength:t,referenceList:i,asyncMapHandler:n,allFailedhandler:r,promisesCollector:o}=e,s=0;const a=t;let c,A=0;const d=async()=>{const e=(()=>{const e=s*a,t=e+a;return i.slice(e,t).map(n)})();o&&o.push(...e);try{c=await wG(e)}catch(e){if(A+=a,s++,!(A>=i.length))return void await d();r(e)}e.forEach((e=>e.cancel()))};return await d(),c};function KG(e){return"object"==typeof e&&null!==e&&!(e instanceof RegExp)}var WG=Tc,JG=md("iterator"),qG=!WG((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,i="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),i+=n+e})),!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[JG]||"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"!==i||"x"!==new URL("http://x",void 0).host})),XG=xc,zG=Dc,ZG=jc,$G=Tc,ej=D_,tj=p_,ij=Yc,nj=rd,rj=sA,oj=Object.assign,sj=Object.defineProperty,aj=zG([].concat),cj=!oj||$G((function(){if(XG&&1!==oj({b:1},oj(sj({},"a",{enumerable:!0,get:function(){sj(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=oj({},e)[i]||ej(oj({},t)).join("")!=n}))?function(e,t){for(var i=nj(e),n=arguments.length,r=1,o=tj.f,s=ij.f;n>r;)for(var a,c=rj(arguments[r++]),A=o?aj(ej(c),o(c)):ej(c),d=A.length,u=0;d>u;)a=A[u++],XG&&!ZG(s,c,a)||(i[a]=c[a]);return i}:oj,Aj=hu,dj=LI,uj=au,Ej=jc,lj=rd,hj=function(e,t,i,n){try{return n?t(Aj(i)[0],i[1]):t(i)}catch(t){dj(e,"throw",t)}},pj=sI,_j=NR,Ij=ju,gj=Cb,fj=yI,Rj=CI,Cj=Lc.Array,Tj=Dc,mj=2147483647,Sj=/[^\0-\u007E]/,Oj=/[.\u3002\uFF0E\uFF61]/g,vj="Overflow: input needs wider integers to process",Nj=Lc.RangeError,yj=Tj(Oj.exec),Dj=Math.floor,wj=String.fromCharCode,bj=Tj("".charCodeAt),Lj=Tj([].join),Pj=Tj([].push),kj=Tj("".replace),Mj=Tj("".split),Uj=Tj("".toLowerCase),Bj=function(e){return e+22+75*(e<26)},Vj=function(e,t,i){var n=0;for(e=i?Dj(e/700):e>>1,e+=Dj(e/t);e>455;)e=Dj(e/35),n+=36;return Dj(n+36*e/(e+38))},Qj=function(e){var t,i,n=[],r=(e=function(e){for(var t=[],i=0,n=e.length;i<n;){var r=bj(e,i++);if(r>=55296&&r<=56319&&i<n){var o=bj(e,i++);56320==(64512&o)?Pj(t,((1023&r)<<10)+(1023&o)+65536):(Pj(t,r),i--)}else Pj(t,r)}return t}(e)).length,o=128,s=0,a=72;for(t=0;t<e.length;t++)(i=e[t])<128&&Pj(n,wj(i));var c=n.length,A=c;for(c&&Pj(n,"-");A<r;){var d=mj;for(t=0;t<e.length;t++)(i=e[t])>=o&&i<d&&(d=i);var u=A+1;if(d-o>Dj((mj-s)/u))throw Nj(vj);for(s+=(d-o)*u,o=d,t=0;t<e.length;t++){if((i=e[t])<o&&++s>mj)throw Nj(vj);if(i==o){for(var E=s,l=36;;){var h=l<=a?1:l>=a+26?26:l-a;if(E<h)break;var p=E-h,_=36-h;Pj(n,wj(Bj(h+p%_))),E=Dj(p/_),l+=36}Pj(n,wj(Bj(E))),a=Vj(s,u,A==c),s=0,A++}}s++,o++}return Lj(n,"")},xj=Lc.TypeError,Fj=Bu,Gj=Lc,jj=fA,Yj=jc,Hj=Dc,Kj=qG,Wj=tf,Jj=Zf,qj=Rf,Xj=Nf,zj=Wg,Zj=oR,$j=Vc,eY=ad,tY=au,iY=_I,nY=hu,rY=lA,oY=qI,sY=q_,aY=Xc,cY=yI,AY=CI,dY=function(e,t){if(e<t)throw xj("Not enough arguments");return e},uY=Pb,EY=md("iterator"),lY="URLSearchParams",hY="URLSearchParamsIterator",pY=zj.set,_Y=zj.getterFor(lY),IY=zj.getterFor(hY),gY=jj("fetch"),fY=jj("Request"),RY=jj("Headers"),CY=fY&&fY.prototype,TY=RY&&RY.prototype,mY=Gj.RegExp,SY=Gj.TypeError,OY=Gj.decodeURIComponent,vY=Gj.encodeURIComponent,NY=Hj("".charAt),yY=Hj([].join),DY=Hj([].push),wY=Hj("".replace),bY=Hj([].shift),LY=Hj([].splice),PY=Hj("".split),kY=Hj("".slice),MY=/\+/g,UY=Array(4),BY=function(e){return UY[e-1]||(UY[e-1]=mY("((?:%[\\da-f]{2}){"+e+"})","gi"))},VY=function(e){try{return OY(e)}catch(t){return e}},QY=function(e){var t=wY(e,MY," "),i=4;try{return OY(t)}catch(e){for(;i;)t=wY(t,BY(i--),VY);return t}},xY=/[!'()~]|%20/g,FY={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},GY=function(e){return FY[e]},jY=function(e){return wY(vY(e),xY,GY)},YY=Xj((function(e,t){pY(this,{type:hY,iterator:cY(_Y(e).entries),kind:t})}),"Iterator",(function(){var e=IY(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),i}),!0),HY=function(e){this.entries=[],this.url=null,void 0!==e&&(rY(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===NY(e,0)?kY(e,1):e:oY(e)))};HY.prototype={type:lY,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,n,r,o,s,a,c=AY(e);if(c)for(i=(t=cY(e,c)).next;!(n=Yj(i,t)).done;){if(o=(r=cY(nY(n.value))).next,(s=Yj(o,r)).done||(a=Yj(o,r)).done||!Yj(o,r).done)throw SY("Expected sequence with length 2");DY(this.entries,{key:oY(s.value),value:oY(a.value)})}else for(var A in e)eY(e,A)&&DY(this.entries,{key:A,value:oY(e[A])})},parseQuery:function(e){if(e)for(var t,i,n=PY(e,"&"),r=0;r<n.length;)(t=n[r++]).length&&(i=PY(t,"="),DY(this.entries,{key:QY(bY(i)),value:QY(yY(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],n=0;n<t.length;)e=t[n++],DY(i,jY(e.key)+"="+jY(e.value));return yY(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var KY=function(){Zj(this,WY),pY(this,new HY(arguments.length>0?arguments[0]:void 0))},WY=KY.prototype;if(Jj(WY,{append:function(e,t){dY(arguments.length,2);var i=_Y(this);DY(i.entries,{key:oY(e),value:oY(t)}),i.updateURL()},delete:function(e){dY(arguments.length,1);for(var t=_Y(this),i=t.entries,n=oY(e),r=0;r<i.length;)i[r].key===n?LY(i,r,1):r++;t.updateURL()},get:function(e){dY(arguments.length,1);for(var t=_Y(this).entries,i=oY(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){dY(arguments.length,1);for(var t=_Y(this).entries,i=oY(e),n=[],r=0;r<t.length;r++)t[r].key===i&&DY(n,t[r].value);return n},has:function(e){dY(arguments.length,1);for(var t=_Y(this).entries,i=oY(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){dY(arguments.length,1);for(var i,n=_Y(this),r=n.entries,o=!1,s=oY(e),a=oY(t),c=0;c<r.length;c++)(i=r[c]).key===s&&(o?LY(r,c--,1):(o=!0,i.value=a));o||DY(r,{key:s,value:a}),n.updateURL()},sort:function(){var e=_Y(this);uY(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=_Y(this).entries,n=tY(e,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((t=i[r++]).value,t.key,this)},keys:function(){return new YY(this,"keys")},values:function(){return new YY(this,"values")},entries:function(){return new YY(this,"entries")}},{enumerable:!0}),Wj(WY,EY,WY.entries,{name:"entries"}),Wj(WY,"toString",(function(){return _Y(this).serialize()}),{enumerable:!0}),qj(KY,lY),Fj({global:!0,forced:!Kj},{URLSearchParams:KY}),!Kj&&$j(RY)){var JY=Hj(TY.has),qY=Hj(TY.set),XY=function(e){if(rY(e)){var t,i=e.body;if(iY(i)===lY)return t=e.headers?new RY(e.headers):new RY,JY(t,"content-type")||qY(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),sY(e,{body:aY(0,oY(i)),headers:aY(0,t)})}return e};if($j(gY)&&Fj({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return gY(e,arguments.length>1?XY(arguments[1]):{})}}),$j(fY)){var zY=function(e){return Zj(this,CY),new fY(e,arguments.length>1?XY(arguments[1]):{})};CY.constructor=zY,zY.prototype=CY,Fj({global:!0,forced:!0},{Request:zY})}}var ZY,$Y={URLSearchParams:KY,getState:_Y},eH=Bu,tH=xc,iH=qG,nH=Lc,rH=au,oH=Dc,sH=v_.f,aH=tf,cH=oR,AH=ad,dH=cj,uH=function(e){var t=lj(e),i=_j(this),n=arguments.length,r=n>1?arguments[1]:void 0,o=void 0!==r;o&&(r=uj(r,n>2?arguments[2]:void 0));var s,a,c,A,d,u,E=Rj(t),l=0;if(!E||this==Cj&&pj(E))for(s=Ij(t),a=i?new this(s):Cj(s);s>l;l++)u=o?r(t[l],l):t[l],gj(a,l,u);else for(d=(A=fj(t,E)).next,a=i?new this:[];!(c=Ej(d,A)).done;l++)u=o?hj(A,r,[c.value,l],!0):c.value,gj(a,l,u);return a.length=l,a},EH=Nb,lH=Im.codeAt,hH=qI,pH=Rf,_H=$Y,IH=Wg,gH=IH.set,fH=IH.getterFor("URL"),RH=_H.URLSearchParams,CH=_H.getState,TH=nH.URL,mH=nH.TypeError,SH=nH.parseInt,OH=Math.floor,vH=Math.pow,NH=oH("".charAt),yH=oH(/./.exec),DH=oH([].join),wH=oH(1..toString),bH=oH([].pop),LH=oH([].push),PH=oH("".replace),kH=oH([].shift),MH=oH("".split),UH=oH("".slice),BH=oH("".toLowerCase),VH=oH([].unshift),QH="Invalid scheme",xH="Invalid host",FH="Invalid port",GH=/[a-z]/i,jH=/[\d+-.a-z]/i,YH=/\d/,HH=/^0x/i,KH=/^[0-7]+$/,WH=/^\d+$/,JH=/^[\da-f]+$/i,qH=/[\0\t\n\r #%/:<>?@[\\\]^|]/,XH=/[\0\t\n\r #/:<>?@[\\\]^|]/,zH=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ZH=/[\t\n\r]/g,$H=function(e){var t,i,n,r;if("number"==typeof e){for(t=[],i=0;i<4;i++)VH(t,e%256),e=OH(e/256);return DH(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,i=1,n=null,r=0,o=0;o<8;o++)0!==e[o]?(r>i&&(t=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i&&(t=n,i=r),t}(e),i=0;i<8;i++)r&&0===e[i]||(r&&(r=!1),n===i?(t+=i?":":"::",r=!0):(t+=wH(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},eK={},tK=dH({},eK,{" ":1,'"':1,"<":1,">":1,"`":1}),iK=dH({},tK,{"#":1,"?":1,"{":1,"}":1}),nK=dH({},iK,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),rK=function(e,t){var i=lH(e,0);return i>32&&i<127&&!AH(t,e)?e:encodeURIComponent(e)},oK={ftp:21,file:null,http:80,https:443,ws:80,wss:443},sK=function(e,t){var i;return 2==e.length&&yH(GH,NH(e,0))&&(":"==(i=NH(e,1))||!t&&"|"==i)},aK=function(e){var t;return e.length>1&&sK(UH(e,0,2))&&(2==e.length||"/"===(t=NH(e,2))||"\\"===t||"?"===t||"#"===t)},cK=function(e){return"."===e||"%2e"===BH(e)},AK={},dK={},uK={},EK={},lK={},hK={},pK={},_K={},IK={},gK={},fK={},RK={},CK={},TK={},mK={},SK={},OK={},vK={},NK={},yK={},DK={},wK=function(e,t,i){var n,r,o,s=hH(e);if(t){if(r=this.parse(s))throw mH(r);this.searchParams=null}else{if(void 0!==i&&(n=new wK(i,!0)),r=this.parse(s,null,n))throw mH(r);(o=CH(new RH)).bindURL(this),this.searchParams=o}};wK.prototype={type:"URL",parse:function(e,t,i){var n,r,o,s,a,c=this,A=t||AK,d=0,u="",E=!1,l=!1,h=!1;for(e=hH(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=PH(e,zH,"")),e=PH(e,ZH,""),n=uH(e);d<=n.length;){switch(r=n[d],A){case AK:if(!r||!yH(GH,r)){if(t)return QH;A=uK;continue}u+=BH(r),A=dK;break;case dK:if(r&&(yH(jH,r)||"+"==r||"-"==r||"."==r))u+=BH(r);else{if(":"!=r){if(t)return QH;u="",A=uK,d=0;continue}if(t&&(c.isSpecial()!=AH(oK,u)||"file"==u&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=u,t)return void(c.isSpecial()&&oK[c.scheme]==c.port&&(c.port=null));u="","file"==c.scheme?A=TK:c.isSpecial()&&i&&i.scheme==c.scheme?A=EK:c.isSpecial()?A=_K:"/"==n[d+1]?(A=lK,d++):(c.cannotBeABaseURL=!0,LH(c.path,""),A=NK)}break;case uK:if(!i||i.cannotBeABaseURL&&"#"!=r)return QH;if(i.cannotBeABaseURL&&"#"==r){c.scheme=i.scheme,c.path=EH(i.path),c.query=i.query,c.fragment="",c.cannotBeABaseURL=!0,A=DK;break}A="file"==i.scheme?TK:hK;continue;case EK:if("/"!=r||"/"!=n[d+1]){A=hK;continue}A=IK,d++;break;case lK:if("/"==r){A=gK;break}A=vK;continue;case hK:if(c.scheme=i.scheme,r==ZY)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.query=i.query;else if("/"==r||"\\"==r&&c.isSpecial())A=pK;else if("?"==r)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.query="",A=yK;else{if("#"!=r){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.path.length--,A=vK;continue}c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.query=i.query,c.fragment="",A=DK}break;case pK:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,A=vK;continue}A=gK}else A=IK;break;case _K:if(A=IK,"/"!=r||"/"!=NH(u,d+1))continue;d++;break;case IK:if("/"!=r&&"\\"!=r){A=gK;continue}break;case gK:if("@"==r){E&&(u="%40"+u),E=!0,o=uH(u);for(var p=0;p<o.length;p++){var _=o[p];if(":"!=_||h){var I=rK(_,nK);h?c.password+=I:c.username+=I}else h=!0}u=""}else if(r==ZY||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(E&&""==u)return"Invalid authority";d-=uH(u).length+1,u="",A=fK}else u+=r;break;case fK:case RK:if(t&&"file"==c.scheme){A=SK;continue}if(":"!=r||l){if(r==ZY||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==u)return xH;if(t&&""==u&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(u))return s;if(u="",A=OK,t)return;continue}"["==r?l=!0:"]"==r&&(l=!1),u+=r}else{if(""==u)return xH;if(s=c.parseHost(u))return s;if(u="",A=CK,t==RK)return}break;case CK:if(!yH(YH,r)){if(r==ZY||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=u){var g=SH(u,10);if(g>65535)return FH;c.port=c.isSpecial()&&g===oK[c.scheme]?null:g,u=""}if(t)return;A=OK;continue}return FH}u+=r;break;case TK:if(c.scheme="file","/"==r||"\\"==r)A=mK;else{if(!i||"file"!=i.scheme){A=vK;continue}if(r==ZY)c.host=i.host,c.path=EH(i.path),c.query=i.query;else if("?"==r)c.host=i.host,c.path=EH(i.path),c.query="",A=yK;else{if("#"!=r){aK(DH(EH(n,d),""))||(c.host=i.host,c.path=EH(i.path),c.shortenPath()),A=vK;continue}c.host=i.host,c.path=EH(i.path),c.query=i.query,c.fragment="",A=DK}}break;case mK:if("/"==r||"\\"==r){A=SK;break}i&&"file"==i.scheme&&!aK(DH(EH(n,d),""))&&(sK(i.path[0],!0)?LH(c.path,i.path[0]):c.host=i.host),A=vK;continue;case SK:if(r==ZY||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&sK(u))A=vK;else if(""==u){if(c.host="",t)return;A=OK}else{if(s=c.parseHost(u))return s;if("localhost"==c.host&&(c.host=""),t)return;u="",A=OK}continue}u+=r;break;case OK:if(c.isSpecial()){if(A=vK,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=ZY&&(A=vK,"/"!=r))continue}else c.fragment="",A=DK;else c.query="",A=yK;break;case vK:if(r==ZY||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(a=BH(a=u))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||LH(c.path,"")):cK(u)?"/"==r||"\\"==r&&c.isSpecial()||LH(c.path,""):("file"==c.scheme&&!c.path.length&&sK(u)&&(c.host&&(c.host=""),u=NH(u,0)+":"),LH(c.path,u)),u="","file"==c.scheme&&(r==ZY||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)kH(c.path);"?"==r?(c.query="",A=yK):"#"==r&&(c.fragment="",A=DK)}else u+=rK(r,iK);break;case NK:"?"==r?(c.query="",A=yK):"#"==r?(c.fragment="",A=DK):r!=ZY&&(c.path[0]+=rK(r,eK));break;case yK:t||"#"!=r?r!=ZY&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":rK(r,eK)):(c.fragment="",A=DK);break;case DK:r!=ZY&&(c.fragment+=rK(r,tK))}d++}},parseHost:function(e){var t,i,n;if("["==NH(e,0)){if("]"!=NH(e,e.length-1))return xH;if(!(t=function(e){var t,i,n,r,o,s,a,c=[0,0,0,0,0,0,0,0],A=0,d=null,u=0,E=function(){return NH(e,u)};if(":"==E()){if(":"!=NH(e,1))return;u+=2,d=++A}for(;E();){if(8==A)return;if(":"!=E()){for(t=i=0;i<4&&yH(JH,E());)t=16*t+SH(E(),16),u++,i++;if("."==E()){if(0==i)return;if(u-=i,A>6)return;for(n=0;E();){if(r=null,n>0){if(!("."==E()&&n<4))return;u++}if(!yH(YH,E()))return;for(;yH(YH,E());){if(o=SH(E(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;u++}c[A]=256*c[A]+r,2!=++n&&4!=n||A++}if(4!=n)return;break}if(":"==E()){if(u++,!E())return}else if(E())return;c[A++]=t}else{if(null!==d)return;u++,d=++A}}if(null!==d)for(s=A-d,A=7;0!=A&&s>0;)a=c[A],c[A--]=c[d+s-1],c[d+--s]=a;else if(8!=A)return;return c}(UH(e,1,-1))))return xH;this.host=t}else if(this.isSpecial()){if(e=function(e){var t,i,n=[],r=Mj(kj(Uj(e),Oj,"."),".");for(t=0;t<r.length;t++)i=r[t],Pj(n,yj(Sj,i)?"xn--"+Qj(i):i);return Lj(n,".")}(e),yH(qH,e))return xH;if(null===(t=function(e){var t,i,n,r,o,s,a,c=MH(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(i=[],n=0;n<t;n++){if(""==(r=c[n]))return e;if(o=10,r.length>1&&"0"==NH(r,0)&&(o=yH(HH,r)?16:8,r=UH(r,8==o?1:2)),""===r)s=0;else{if(!yH(10==o?WH:8==o?KH:JH,r))return e;s=SH(r,o)}LH(i,s)}for(n=0;n<t;n++)if(s=i[n],n==t-1){if(s>=vH(256,5-t))return null}else if(s>255)return null;for(a=bH(i),n=0;n<i.length;n++)a+=i[n]*vH(256,3-n);return a}(e)))return xH;this.host=t}else{if(yH(XH,e))return xH;for(t="",i=uH(e),n=0;n<i.length;n++)t+=rK(i[n],eK);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return AH(oK,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&sK(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,n=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,A=t+":";return null!==r?(A+="//",e.includesCredentials()&&(A+=i+(n?":"+n:"")+"@"),A+=$H(r),null!==o&&(A+=":"+o)):"file"==t&&(A+="//"),A+=e.cannotBeABaseURL?s[0]:s.length?"/"+DH(s,"/"):"",null!==a&&(A+="?"+a),null!==c&&(A+="#"+c),A},setHref:function(e){var t=this.parse(e);if(t)throw mH(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new bK(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+$H(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(hH(e)+":",AK)},getUsername:function(){return this.username},setUsername:function(e){var t=uH(hH(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=rK(t[i],nK)}},getPassword:function(){return this.password},setPassword:function(e){var t=uH(hH(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=rK(t[i],nK)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?$H(e):$H(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,fK)},getHostname:function(){var e=this.host;return null===e?"":$H(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,RK)},getPort:function(){var e=this.port;return null===e?"":hH(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=hH(e))?this.port=null:this.parse(e,CK))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+DH(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,OK))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=hH(e))?this.query=null:("?"==NH(e,0)&&(e=UH(e,1)),this.query="",this.parse(e,yK)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=hH(e))?("#"==NH(e,0)&&(e=UH(e,1)),this.fragment="",this.parse(e,DK)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var bK=function(e){var t=cH(this,LK),i=gH(t,new wK(e,!1,arguments.length>1?arguments[1]:void 0));tH||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},LK=bK.prototype,PK=function(e,t){return{get:function(){return fH(this)[e]()},set:t&&function(e){return fH(this)[t](e)},configurable:!0,enumerable:!0}};if(tH&&sH(LK,{href:PK("serialize","setHref"),origin:PK("getOrigin"),protocol:PK("getProtocol","setProtocol"),username:PK("getUsername","setUsername"),password:PK("getPassword","setPassword"),host:PK("getHost","setHost"),hostname:PK("getHostname","setHostname"),port:PK("getPort","setPort"),pathname:PK("getPathname","setPathname"),search:PK("getSearch","setSearch"),searchParams:PK("getSearchParams"),hash:PK("getHash","setHash")}),aH(LK,"toJSON",(function(){return fH(this).serialize()}),{enumerable:!0}),aH(LK,"toString",(function(){return fH(this).serialize()}),{enumerable:!0}),TH){var kK=TH.createObjectURL,MK=TH.revokeObjectURL;kK&&aH(bK,"createObjectURL",rH(kK,TH)),MK&&aH(bK,"revokeObjectURL",rH(MK,TH))}pH(bK,"URL"),eH({global:!0,forced:!iH,sham:!tH},{URL:bK});var UK=hA.URL;const BK={[kL.ACCESS_POINT]:{[BL.NO_FLAG_SET]:{desc:"flag is zero",retry:!1},[BL.FLAG_SET_BUT_EMPTY]:{desc:"flag is empty",retry:!1},[BL.INVALID_FALG_SET]:{desc:"invalid flag",retry:!1},[BL.FLAG_SET_BUT_NO_RE]:{desc:"flag set unilbs but no request",retry:!1},[BL.INVALID_SERVICE_ID]:{desc:"invalid service id",retry:!1},[BL.NO_SERVICE_AVAILABLE]:{desc:"no service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_P2P]:{desc:"no unilbs p2p service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_VOET]:{desc:"no unilbs voice service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_WEBRTC]:{desc:"no unilbs webrtc service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_CDS]:{desc:"no cds service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_CDN]:{desc:"no cdn dispatcher service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_TDS]:{desc:"no tds service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_REPORT]:{desc:"no unilbs report service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_APP_CENTER]:{desc:"no app center service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_ENV0]:{desc:"no unilbs sig env0 service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_VOET]:{desc:"no unilbs voet service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_STRING_UID]:{desc:"no string uid service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS]:{desc:"no webrtc unilbs service available",retry:!0}},[kL.UNILBS]:{[UL.INVALID_VENDOR_KEY]:{desc:"invalid vendor key, can not find appid",retry:!1},[UL.INVALID_CHANNEL_NAME]:{desc:"invalid channel name",retry:!1},[UL.INTERNAL_ERROR]:{desc:"unilbs internal error",retry:!1},[UL.NO_AUTHORIZED]:{desc:"invalid token, authorized failed",retry:!1},[UL.DYNAMIC_KEY_TIMEOUT]:{desc:"dynamic key or token timeout",retry:!1},[UL.NO_ACTIVE_STATUS]:{desc:"no active status",retry:!1},[UL.DYNAMIC_KEY_EXPIRED]:{desc:"dynamic key expired",retry:!1},[UL.STATIC_USE_DYNAMIC_KEY]:{desc:"static use dynamic key",retry:!1},[UL.DYNAMIC_USE_STATIC_KEY]:{desc:"dynamic use static key",retry:!1},[UL.USER_OVERLOAD]:{desc:"amount of users over load",retry:!1},[UL.FORBIDDEN_REGION]:{desc:"the request is forbidden in this area",retry:!1},[UL.CANNOT_MEET_AREA_DEMAND]:{desc:"unable to allocate services in this area",retry:!1}},[kL.STRING_UID_ALLOCATOR]:{[ML.IIIEGAL_APPID]:{desc:"invalid appid",retry:!1},[ML.IIIEGAL_UID]:{desc:"invalid string uid",retry:!1},[ML.INTERNAL_ERROR]:{desc:"string uid allocator internal error",retry:!0}}};function VK(e){const t=BK[Math.floor(e/1e4)];if(!t)return{desc:"unkonw error",retry:!1};const i=t[e%1e4];if(!i){if(Math.floor(e/1e4)===kL.ACCESS_POINT){const t=e%1e4;if("1"===t.toString()[0])return{desc:e.toString(),retry:!1};if("2"===t.toString()[0])return{desc:e.toString(),retry:!0}}return{desc:"unkonw error",retry:!1}}return i}const QK={[VL.K_TIMESTAMP_EXPIRED]:{desc:"K_TIMESTAMP_EXPIRED",action:"failed"},[VL.K_CHANNEL_PERMISSION_INVALID]:{desc:"K_CHANNEL_PERMISSION_INVALID",action:"failed"},[VL.K_CERTIFICATE_INVALID]:{desc:"K_CERTIFICATE_INVALID",action:"failed"},[VL.K_CHANNEL_NAME_EMPTY]:{desc:"K_CHANNEL_NAME_EMPTY",action:"failed"},[VL.K_CHANNEL_NOT_FOUND]:{desc:"K_CHANNEL_NOT_FOUND",action:"failed"},[VL.K_TICKET_INVALID]:{desc:"K_TICKET_INVALID",action:"failed"},[VL.K_CHANNEL_CONFLICTED]:{desc:"K_CHANNEL_CONFLICTED",action:"failed"},[VL.K_SERVICE_NOT_READY]:{desc:"K_SERVICE_NOT_READY",action:"tryNext"},[VL.K_SERVICE_TOO_HEAVY]:{desc:"K_SERVICE_TOO_HEAVY",action:"tryNext"},[VL.K_UID_BANNED]:{desc:"K_UID_BANNED",action:"failed"},[VL.K_IP_BANNED]:{desc:"K_IP_BANNED",action:"failed"},[VL.ERR_INVALID_VENDOR_KEY]:{desc:"ERR_INVALID_VENDOR_KEY",action:"failed"},[VL.ERR_INVALID_CHANNEL_NAME]:{desc:"ERR_INVALID_CHANNEL_NAME",action:"failed"},[VL.WARN_NO_AVAILABLE_CHANNEL]:{desc:"WARN_NO_AVAILABLE_CHANNEL",action:"failed"},[VL.WARN_LOOKUP_CHANNEL_TIMEOUT]:{desc:"WARN_LOOKUP_CHANNEL_TIMEOUT",action:"tryNext"},[VL.WARN_LOOKUP_CHANNEL_REJECTED]:{desc:"WARN_LOOKUP_CHANNEL_REJECTED",action:"failed"},[VL.WARN_OPEN_CHANNEL_TIMEOUT]:{desc:"WARN_OPEN_CHANNEL_TIMEOUT",action:"tryNext"},[VL.WARN_OPEN_CHANNEL_REJECTED]:{desc:"WARN_OPEN_CHANNEL_REJECTED",action:"failed"},[VL.WARN_REQUEST_DEFERRED]:{desc:"WARN_REQUEST_DEFERRED",action:"failed"},[VL.ERR_DYNAMIC_KEY_TIMEOUT]:{desc:"ERR_DYNAMIC_KEY_TIMEOUT",action:"failed"},[VL.ERR_NO_AUTHORIZED]:{desc:"ERR_NO_AUTHORIZED",action:"failed"},[VL.ERR_VOM_SERVICE_UNAVAILABLE]:{desc:"ERR_VOM_SERVICE_UNAVAILABLE",action:"tryNext"},[VL.ERR_NO_CHANNEL_AVAILABLE_CODE]:{desc:"ERR_NO_CHANNEL_AVAILABLE_CODE",action:"failed"},[VL.ERR_MASTER_VOCS_UNAVAILABLE]:{desc:"ERR_MASTER_VOCS_UNAVAILABLE",action:"tryNext"},[VL.ERR_INTERNAL_ERROR]:{desc:"ERR_INTERNAL_ERROR",action:"tryNext"},[VL.ERR_NO_ACTIVE_STATUS]:{desc:"ERR_NO_ACTIVE_STATUS",action:"failed"},[VL.ERR_INVALID_UID]:{desc:"ERR_INVALID_UID",action:"failed"},[VL.ERR_DYNAMIC_KEY_EXPIRED]:{desc:"ERR_DYNAMIC_KEY_EXPIRED",action:"failed"},[VL.ERR_STATIC_USE_DYANMIC_KE]:{desc:"ERR_STATIC_USE_DYANMIC_KE",action:"failed"},[VL.ERR_DYNAMIC_USE_STATIC_KE]:{desc:"ERR_DYNAMIC_USE_STATIC_KE",action:"failed"},[VL.ERR_NO_VOCS_AVAILABLE]:{desc:"ERR_NO_VOCS_AVAILABLE",action:"tryNext"},[VL.ERR_NO_VOS_AVAILABLE]:{desc:"ERR_NO_VOS_AVAILABLE",action:"tryNext"},[VL.ERR_JOIN_CHANNEL_TIMEOUT]:{desc:"ERR_JOIN_CHANNEL_TIMEOUT",action:"tryNext"},[VL.ERR_JOIN_BY_MULTI_IP]:{desc:"ERR_JOIN_BY_MULTI_IP",action:"recover"},[VL.ERR_NOT_JOINED]:{desc:"ERR_NOT_JOINED",action:"failed"},[VL.ERR_REPEAT_JOIN_REQUEST]:{desc:"ERR_REPEAT_JOIN_REQUEST",action:"quit"},[VL.ERR_REPEAT_JOIN_CHANNEL]:{desc:"ERR_REPEAT_JOIN_CHANNEL",action:"quit"},[VL.ERR_INVALID_VENDOR_KEY]:{desc:"ERR_INVALID_VENDOR_KEY",action:"failed"},[VL.ERR_INVALID_CHANNEL_NAME]:{desc:"ERR_INVALID_CHANNEL_NAME",action:"failed"},[VL.ERR_INVALID_STRINGUID]:{desc:"ERR_INVALID_STRINGUID",action:"failed"},[VL.ERR_TOO_MANY_USERS]:{desc:"ERR_TOO_MANY_USERS",action:"tryNext"},[VL.ERR_SET_CLIENT_ROLE_TIMEOUT]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[VL.ERR_SET_CLIENT_ROLE_NO_PERMISSION]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[VL.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE]:{desc:"ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",action:"success"},[VL.ERR_PUBLISH_REQUEST_INVALID]:{desc:"ERR_PUBLISH_REQUEST_INVALID",action:"failed"},[VL.ERR_SUBSCRIBE_REQUEST_INVALID]:{desc:"ERR_SUBSCRIBE_REQUEST_INVALID",action:"failed"},[VL.ERR_NOT_SUPPORTED_MESSAGE]:{desc:"ERR_NOT_SUPPORTED_MESSAGE",action:"failed"},[VL.ERR_ILLEAGAL_PLUGIN]:{desc:"ERR_ILLEAGAL_PLUGIN",action:"failed"},[VL.ILLEGAL_CLIENT_ROLE_LEVEL]:{desc:"ILLEGAL_CLIENT_ROLE_LEVEL",action:"failed"},[VL.ERR_REJOIN_TOKEN_INVALID]:{desc:"ERR_REJOIN_TOKEN_INVALID",action:"failed"},[VL.ERR_REJOIN_USER_NOT_JOINED]:{desc:"ERR_REJOIN_NOT_JOINED",action:"failed"},[VL.ERR_INVALID_OPTIONAL_INFO]:{desc:"ERR_INVALID_OPTIONAL_INFO",action:"quit"},[VL.ERR_TEST_RECOVER]:{desc:"ERR_TEST_RECOVER",action:"recover"},[VL.ERR_TEST_TRYNEXT]:{desc:"ERR_TEST_TRYNEXT",action:"recover"},[VL.ERR_TEST_RETRY]:{desc:"ERR_TEST_RETRY",action:"recover"},[VL.ILLEGAL_AES_PASSWORD]:{desc:"ERR_TEST_RETRY",action:"failed"},[VL.ERR_TOO_MANY_BROADCASTERS]:{desc:"ERR_TOO_MANY_BROADCASTERS",action:"failed"},[VL.ERR_TOO_MANY_SUBSCRIBERS]:{desc:"ERR_TOO_MANY_SUBSCRIBERS",action:"failed"}};function xK(e){return QK[e]||{desc:"UNKNOW_ERROR_".concat(e),action:"failed"}}var FK={exports:{}};!function(e,t){e.exports=function(){var e={d:function(t,i){for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataViewIndexOutOfBoundsError:function(){return x},DecodeError:function(){return g},Decoder:function(){return j},EXT_TIMESTAMP:function(){return f},Encoder:function(){return D},ExtData:function(){return _},ExtensionCodec:function(){return v},decode:function(){return H},decodeArrayStream:function(){return $},decodeAsync:function(){return Z},decodeMulti:function(){return K},decodeMultiStream:function(){return ee},decodeStream:function(){return te},decodeTimestampExtension:function(){return S},decodeTimestampToTimeSpec:function(){return m},encode:function(){return b},encodeDateToTimeSpec:function(){return C},encodeTimeSpecToTimestamp:function(){return R},encodeTimestampExtension:function(){return T}});var i=4294967295;function n(e,t,i){var n=Math.floor(i/4294967296),r=i;e.setUint32(t,n),e.setUint32(t+4,r)}function r(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var o=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},s=function(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e},a="undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function c(e){for(var t=e.length,i=0,n=0;n<t;){var r=e.charCodeAt(n++);if(0!=(4294967168&r))if(0==(4294965248&r))i+=2;else{if(r>=55296&&r<=56319&&n<t){var o=e.charCodeAt(n);56320==(64512&o)&&(++n,r=((1023&r)<<10)+(1023&o)+65536)}i+=0==(4294901760&r)?3:4}else i++}return i}var A=a?new TextEncoder:void 0,d=a?"undefined"!=typeof process?200:0:i,u=(null==A?void 0:A.encodeInto)?function(e,t,i){A.encodeInto(e,t.subarray(i))}:function(e,t,i){t.set(A.encode(e),i)};function E(e,t,i){for(var n=t,r=n+i,a=[],c="";n<r;){var A=e[n++];if(0==(128&A))a.push(A);else if(192==(224&A)){var d=63&e[n++];a.push((31&A)<<6|d)}else if(224==(240&A)){d=63&e[n++];var u=63&e[n++];a.push((31&A)<<12|d<<6|u)}else if(240==(248&A)){var E=(7&A)<<18|(d=63&e[n++])<<12|(u=63&e[n++])<<6|63&e[n++];E>65535&&(E-=65536,a.push(E>>>10&1023|55296),E=56320|1023&E),a.push(E)}else a.push(A);a.length>=4096&&(c+=String.fromCharCode.apply(String,s([],o(a))),a.length=0)}return a.length>0&&(c+=String.fromCharCode.apply(String,s([],o(a)))),c}var l,h=a?new TextDecoder:null,p=a?"undefined"!=typeof process?200:0:i,_=function(e,t){this.type=e,this.data=t},I=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),g=function(e){function t(i){var n=e.call(this,i)||this,r=Object.create(t.prototype);return Object.setPrototypeOf(n,r),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:t.name}),n}return I(t,e),t}(Error),f=-1;function R(e){var t,i=e.sec,r=e.nsec;if(i>=0&&r>=0&&i<=17179869183){if(0===r&&i<=4294967295){var o=new Uint8Array(4);return(t=new DataView(o.buffer)).setUint32(0,i),o}var s=i/4294967296,a=4294967295&i;return o=new Uint8Array(8),(t=new DataView(o.buffer)).setUint32(0,r<<2|3&s),t.setUint32(4,a),o}return o=new Uint8Array(12),(t=new DataView(o.buffer)).setUint32(0,r),n(t,4,i),o}function C(e){var t=e.getTime(),i=Math.floor(t/1e3),n=1e6*(t-1e3*i),r=Math.floor(n/1e9);return{sec:i+r,nsec:n-1e9*r}}function T(e){return e instanceof Date?R(C(e)):null}function m(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var i=t.getUint32(0);return{sec:4294967296*(3&i)+t.getUint32(4),nsec:i>>>2};case 12:return{sec:r(t,4),nsec:t.getUint32(0)};default:throw new g("Unrecognized data size for timestamp (expected 4, 8, or 12): "+e.length)}}function S(e){var t=m(e);return new Date(1e3*t.sec+t.nsec/1e6)}var O={type:f,encode:T,decode:S},v=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(O)}return e.prototype.register=function(e){var t=e.type,i=e.encode,n=e.decode;if(t>=0)this.encoders[t]=i,this.decoders[t]=n;else{var r=1+t;this.builtInEncoders[r]=i,this.builtInDecoders[r]=n}},e.prototype.tryToEncode=function(e,t){for(var i=0;i<this.builtInEncoders.length;i++)if(null!=(n=this.builtInEncoders[i])&&null!=(r=n(e,t)))return new _(-1-i,r);for(i=0;i<this.encoders.length;i++){var n,r;if(null!=(n=this.encoders[i])&&null!=(r=n(e,t)))return new _(i,r)}return e instanceof _?e:null},e.prototype.decode=function(e,t,i){var n=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return n?n(e,t,i):new _(t,e)},e.defaultCodec=new e,e}();function N(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}var y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},D=function(){function e(e,t,i,n,r,o,s,a){void 0===e&&(e=v.defaultCodec),void 0===t&&(t=void 0),void 0===i&&(i=100),void 0===n&&(n=2048),void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=!1),this.extensionCodec=e,this.context=t,this.maxDepth=i,this.initialBufferSize=n,this.sortKeys=r,this.forceFloat32=o,this.ignoreUndefined=s,this.forceIntegerToFloat=a,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.getUint8Array=function(){return this.bytes.subarray(0,this.pos)},e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.getUint8Array()},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth "+t);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),i=new Uint8Array(t),n=new DataView(t);i.set(this.bytes),this.view=n,this.bytes=i},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){Number.isSafeInteger(e)&&!this.forceIntegerToFloat?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: "+e+" bytes in UTF-8");this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>d){var t=c(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),u(e,this.bytes,this.pos),this.pos+=t}else t=c(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,i){for(var n=e.length,r=i,o=0;o<n;){var s=e.charCodeAt(o++);if(0!=(4294967168&s)){if(0==(4294965248&s))t[r++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&o<n){var a=e.charCodeAt(o);56320==(64512&a)&&(++o,s=((1023&s)<<10)+(1023&a)+65536)}0==(4294901760&s)?(t[r++]=s>>12&15|224,t[r++]=s>>6&63|128):(t[r++]=s>>18&7|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128)}t[r++]=63&s|128}else t[r++]=s}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var i=this.extensionCodec.tryToEncode(e,this.context);if(null!=i)this.encodeExtension(i);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(e));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: "+t);this.writeU8(198),this.writeU32(t)}var i=N(e);this.writeU8a(i)},e.prototype.encodeArray=function(e,t){var i,n,r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else{if(!(r<4294967296))throw new Error("Too large array: "+r);this.writeU8(221),this.writeU32(r)}try{for(var o=y(e),s=o.next();!s.done;s=o.next()){var a=s.value;this.doEncode(a,t+1)}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}},e.prototype.countWithoutUndefined=function(e,t){var i,n,r=0;try{for(var o=y(t),s=o.next();!s.done;s=o.next())void 0!==e[s.value]&&r++}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r},e.prototype.encodeMap=function(e,t){var i,n,r=Object.keys(e);this.sortKeys&&r.sort();var o=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(o<16)this.writeU8(128+o);else if(o<65536)this.writeU8(222),this.writeU16(o);else{if(!(o<4294967296))throw new Error("Too large map object: "+o);this.writeU8(223),this.writeU32(o)}try{for(var s=y(r),a=s.next();!a.done;a=s.next()){var c=a.value,A=e[c];this.ignoreUndefined&&void 0===A||(this.encodeString(c),this.doEncode(A,t+1))}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: "+t);this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,i){var n=i/4294967296,r=i;e.setUint32(t,n),e.setUint32(t+4,r)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),n(this.view,this.pos,e),this.pos+=8},e}(),w={};function b(e,t){return void 0===t&&(t=w),new D(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined,t.forceIntegerToFloat).encode(e)}function L(e){return(e<0?"-":"")+"0x"+Math.abs(e).toString(16).padStart(2,"0")}var P=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var i=0;i<this.maxKeyLength;i++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,i){var n,r,o=this.caches[i-1];try{e:for(var s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),a=s.next();!a.done;a=s.next()){for(var c=a.value,A=c.bytes,d=0;d<i;d++)if(A[d]!==e[t+d])continue e;return c.str}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return null},e.prototype.store=function(e,t){var i=this.caches[e.length-1],n={bytes:e,str:t};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=n:i.push(n)},e.prototype.decode=function(e,t,i){var n=this.find(e,t,i);if(null!=n)return this.hit++,n;this.miss++;var r=E(e,t,i),o=Uint8Array.prototype.slice.call(e,t,t+i);return this.store(o,r),r},e}(),k=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},M=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,r){!function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)}(n,r,(t=e[i](t)).done,t.value)}))}}},U=function(e){return this instanceof U?(this.v=e,this):new U(e)},B=function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){r[e]&&(n[e]=function(t){return new Promise((function(i,n){o.push([e,t,i,n])>1||a(e,t)}))})}function a(e,t){try{(i=r[e](t)).value instanceof U?Promise.resolve(i.value.v).then(c,A):d(o[0][2],i)}catch(e){d(o[0][3],e)}var i}function c(e){a("next",e)}function A(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},V=new DataView(new ArrayBuffer(0)),Q=new Uint8Array(V.buffer),x=function(){try{V.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")}(),F=new x("Insufficient data"),G=new P,j=function(){function e(e,t,n,r,o,s,a,c){void 0===e&&(e=v.defaultCodec),void 0===t&&(t=void 0),void 0===n&&(n=i),void 0===r&&(r=i),void 0===o&&(o=i),void 0===s&&(s=i),void 0===a&&(a=i),void 0===c&&(c=G),this.extensionCodec=e,this.context=t,this.maxStrLength=n,this.maxBinLength=r,this.maxArrayLength=o,this.maxMapLength=s,this.maxExtLength=a,this.keyDecoder=c,this.totalPos=0,this.pos=0,this.view=V,this.bytes=Q,this.headByte=-1,this.stack=[]}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.length=0},e.prototype.setBuffer=function(e){this.bytes=N(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=N(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),i=N(e),n=new Uint8Array(t.length+i.length);n.set(t),n.set(i,t.length),this.setBuffer(n)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,i=this.pos;return new RangeError("Extra "+(t.byteLength-i)+" of "+t.byteLength+" byte(s) found at buffer["+e+"]")},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return k(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,i,n,r,o,s,a;return o=this,void 0,a=function(){var o,s,a,c,A,d,u,E;return k(this,(function(l){switch(l.label){case 0:o=!1,l.label=1;case 1:l.trys.push([1,6,7,12]),t=M(e),l.label=2;case 2:return[4,t.next()];case 3:if((i=l.sent()).done)return[3,5];if(a=i.value,o)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),o=!0}catch(e){if(!(e instanceof x))throw e}this.totalPos+=this.pos,l.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=l.sent(),n={error:c},[3,12];case 7:return l.trys.push([7,,10,11]),i&&!i.done&&(r=t.return)?[4,r.call(t)]:[3,9];case 8:l.sent(),l.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:if(o){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw d=(A=this).headByte,u=A.pos,E=A.totalPos,new RangeError("Insufficient data in parsing "+L(d)+" at "+E+" ("+u+" in the current buffer)")}}))},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{r(a.next(e))}catch(e){t(e)}}function n(e){try{r(a.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(i,n)}r((a=a.apply(o,[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return B(this,arguments,(function(){var i,n,r,o,s,a,c,A,d;return k(this,(function(u){switch(u.label){case 0:i=t,n=-1,u.label=1;case 1:u.trys.push([1,13,14,19]),r=M(e),u.label=2;case 2:return[4,U(r.next())];case 3:if((o=u.sent()).done)return[3,12];if(s=o.value,t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),i&&(n=this.readArraySize(),i=!1,this.complete()),u.label=4;case 4:u.trys.push([4,9,,10]),u.label=5;case 5:return[4,U(this.doDecodeSync())];case 6:return[4,u.sent()];case 7:return u.sent(),0==--n?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=u.sent())instanceof x))throw a;return[3,10];case 10:this.totalPos+=this.pos,u.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=u.sent(),A={error:c},[3,19];case 14:return u.trys.push([14,,17,18]),o&&!o.done&&(d=r.return)?[4,U(d.call(r))]:[3,16];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:if(A)throw A.error;return[7];case 18:return[7];case 19:return[2]}}))}))},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(n=e-128)){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){if(0!=(n=e-144)){this.pushArrayState(n),this.complete();continue e}t=[]}else{var i=e-160;t=this.decodeUtf8String(i,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)i=this.lookU8(),t=this.decodeUtf8String(i,1);else if(218===e)i=this.lookU16(),t=this.decodeUtf8String(i,2);else if(219===e)i=this.lookU32(),t=this.decodeUtf8String(i,4);else if(220===e){if(0!==(n=this.readU16())){this.pushArrayState(n),this.complete();continue e}t=[]}else if(221===e){if(0!==(n=this.readU32())){this.pushArrayState(n),this.complete();continue e}t=[]}else if(222===e){if(0!==(n=this.readU16())){this.pushMapState(n),this.complete();continue e}t={}}else if(223===e){if(0!==(n=this.readU32())){this.pushMapState(n),this.complete();continue e}t={}}else if(196===e){var n=this.lookU8();t=this.decodeBinary(n,1)}else if(197===e)n=this.lookU16(),t=this.decodeBinary(n,2);else if(198===e)n=this.lookU32(),t=this.decodeBinary(n,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)n=this.lookU8(),t=this.decodeExtension(n,1);else if(200===e)n=this.lookU16(),t=this.decodeExtension(n,2);else{if(201!==e)throw new g("Unrecognized type byte: "+L(e));n=this.lookU32(),t=this.decodeExtension(n,4)}this.complete();for(var r=this.stack;r.length>0;){var o=r[r.length-1];if(0===o.type){if(o.array[o.position]=t,o.position++,o.position!==o.size)continue e;r.pop(),t=o.array}else{if(1===o.type){if("string"!=(s=typeof t)&&"number"!==s)throw new g("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new g("The key __proto__ is not allowed");o.key=t,o.type=2;continue e}if(o.map[o.key]=t,o.readCount++,o.readCount!==o.size){o.key=null,o.type=1;continue e}r.pop(),t=o.map}}return t}var s},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new g("Unrecognized array type byte: "+L(e))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new g("Max length exceeded: map length ("+e+") > maxMapLengthLength ("+this.maxMapLength+")");this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new g("Max length exceeded: array length ("+e+") > maxArrayLength ("+this.maxArrayLength+")");this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var i;if(e>this.maxStrLength)throw new g("Max length exceeded: UTF-8 byte length ("+e+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLength<this.pos+t+e)throw F;var n,r=this.pos+t;return n=this.stateIsMapKey()&&(null===(i=this.keyDecoder)||void 0===i?void 0:i.canBeCached(e))?this.keyDecoder.decode(this.bytes,r,e):e>p?function(e,t,i){var n=e.subarray(t,t+i);return h.decode(n)}(this.bytes,r,e):E(this.bytes,r,e),this.pos+=t+e,n},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new g("Max length exceeded: bin length ("+e+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(e+t))throw F;var i=this.pos+t,n=this.bytes.subarray(i,i+e);return this.pos+=t+e,n},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new g("Max length exceeded: ext length ("+e+") > maxExtLength ("+this.maxExtLength+")");var i=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,i,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,i=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,i},e.prototype.readI64=function(){var e=r(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}(),Y={};function H(e,t){return void 0===t&&(t=Y),new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decode(e)}function K(e,t){return void 0===t&&(t=Y),new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeMulti(e)}var W=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},J=function(e){return this instanceof J?(this.v=e,this):new J(e)},q=function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){r[e]&&(n[e]=function(t){return new Promise((function(i,n){o.push([e,t,i,n])>1||a(e,t)}))})}function a(e,t){try{(i=r[e](t)).value instanceof J?Promise.resolve(i.value.v).then(c,A):d(o[0][2],i)}catch(e){d(o[0][3],e)}var i}function c(e){a("next",e)}function A(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}};function X(e){if(null==e)throw new Error("Assertion Failure: value must not be null nor undefined")}function z(e){return null!=e[Symbol.asyncIterator]?e:function(e){return q(this,arguments,(function(){var t,i,n,r;return W(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,J(t.read())];case 3:return i=o.sent(),n=i.done,r=i.value,n?[4,J(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return X(r),[4,J(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e)}function Z(e,t){return void 0===t&&(t=Y),i=this,void 0,r=function(){var i;return function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(n){return i=z(e),[2,new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeAsync(i)]}))},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{a(r.next(e))}catch(e){t(e)}}function s(e){try{a(r.throw(e))}catch(e){t(e)}}function a(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,s)}a((r=r.apply(i,[])).next())}));var i,n,r}function $(e,t){void 0===t&&(t=Y);var i=z(e);return new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeArrayStream(i)}function ee(e,t){void 0===t&&(t=Y);var i=z(e);return new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeStream(i)}function te(e,t){return void 0===t&&(t=Y),ee(e,t)}return t}()}(FK),(0,UM.exports)("Int8",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Int16",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Int32",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Uint16",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Uint32",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Float32",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Float64",(function(e){return function(t,i,n){return e(this,t,i,n)}}));let GK,jK;async function YK(){if(GK)return GK;const e={};let t,i={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);let n=!1,r=!1;n="object"==typeof window,r="function"==typeof importScripts,"object"==typeof process&&"object"==typeof process.versions&&process.versions.node;let o="";(n||r)&&(r?o=self.location.href:"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),o=0!==o.indexOf("blob:")?o.substr(0,o.lastIndexOf("/")+1):""),e.print||console.log.bind(console);const s=e.printErr||console.warn.bind(console);for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);let a;i=null,e.arguments,e.thisProgram,e.quit,e.wasmBinary,e.noExitRuntime,"object"!=typeof WebAssembly&&C("no native wasm support detected");let c=!1;function A(t){const i=e["_"+t];return i||C("Assertion failed: Cannot call unknown function "+t+", make sure it is exported"),i}function d(e,t,i,n,r){const o={string:function(e){let t=0;if(null!=e&&0!==e){const i=1+(e.length<<2);t=w(i),function(e,t,i){!function(e,t,i,n){if(!(n>0))return 0;const r=i+n-1;for(let n=0;n<e.length;++n){let o=e.charCodeAt(n);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n)),o<=127){if(i>=r)break;t[i++]=o}else if(o<=2047){if(i+1>=r)break;t[i++]=192|o>>6,t[i++]=128|63&o}else if(o<=65535){if(i+2>=r)break;t[i++]=224|o>>12,t[i++]=128|o>>6&63,t[i++]=128|63&o}else{if(i+3>=r)break;t[i++]=240|o>>18,t[i++]=128|o>>12&63,t[i++]=128|o>>6&63,t[i++]=128|63&o}}t[i]=0}(e,l,t,i)}(e,t,i)}return t},array:function(e){const t=w(e.length);var i,n;return i=e,n=t,E.set(i,n),t}},s=A(e),a=[];let c=0;if(n)for(let e=0;e<n.length;e++){const t=o[i[e]];t?(0===c&&(c=y()),a[e]=t(n[e])):a[e]=n[e]}let d=s.apply(null,a);return d=function(e){return"string"===t?(i=e)?function(e,t,i){const n=t+undefined;let r=t,o="";for(;e[r]&&!(r>=n);)++r;if(r-t>16&&e.subarray&&u)return u.decode(e.subarray(t,r));for(;t<r;){let i=e[t++];if(!(128&i)){o+=String.fromCharCode(i);continue}const n=63&e[t++];if(192==(224&i)){o+=String.fromCharCode((31&i)<<6|n);continue}const r=63&e[t++];if(i=224==(240&i)?(15&i)<<12|n<<6|r:(7&i)<<18|n<<12|r<<6|63&e[t++],i<65536)o+=String.fromCharCode(i);else{const e=i-65536;o+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return o}(l,i):"":"boolean"===t?Boolean(e):e;var i}(d),0!==c&&D(c),d}const u="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;let E,l,h;"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),e.INITIAL_MEMORY;const p=[],_=[],I=[],g=[];_.push({func:function(){O()}});let f=0,R=null;function C(t){throw e.onAbort&&e.onAbort(t),s(t+=""),c=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(t)}e.preloadedImages={},e.preloadedAudios={};let T="deflate.wasm";function m(t){for(;t.length>0;){const i=t.shift();if("function"==typeof i){i(e);continue}const n=i.func;"number"==typeof n?void 0===i.arg?h.get(n)():h.get(n)(i.arg):n(void 0===i.arg?null:i.arg)}}T.startsWith("data:application/octet-stream;base64,")||(T=function(t){return e.locateFile?e.locateFile(t,o):o+t}(T));const S={emscripten_memcpy_big:function(e,t,i){l.copyWithin(e,t,t+i)},emscripten_resize_heap:function(e){C("OOM")}};await async function(){const t={env:S,wasi_snapshot_preview1:S};function i(t,i){const n=t.exports;var r;e.asm=n,a=e.asm.memory,r=a.buffer,e.HEAP8=E=new Int8Array(r),e.HEAP16=new Int16Array(r),e.HEAP32=new Int32Array(r),e.HEAPU8=l=new Uint8Array(r),e.HEAPU16=new Uint16Array(r),e.HEAPU32=new Uint32Array(r),e.HEAPF32=new Float32Array(r),e.HEAPF64=new Float64Array(r),h=e.asm.__indirect_function_table,function(t){if(f--,e.monitorRunDependencies&&e.monitorRunDependencies(f),0==f&&R){const e=R;R=null,e()}}()}if(f++,e.monitorRunDependencies&&e.monitorRunDependencies(f),e.instantiateWasm)try{return e.instantiateWasm(t,i)}catch(e){return s("Module.instantiateWasm callback failed with error: "+e),!1}return await function(e){return new Mm(((e,t)=>{e(function(e){const t=window.atob("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AAA2AkAgACgCKCABKAJMQQIgACgCIBEAACECIAFBADYCwC0gASACNgJEIAFBgAg2ApwtIAEgACgCKEGACEEEIAAoAiARAAAiAjYCCCABIAEoApwtIgNBAnQ2AgwCQAJAIAEoAjhFDQAgASgCQEUNACACRQ0AIAEoAkQNAQsgAUGaBTYCBCAAQbjfACgCADYCGCAAEAgPCyABQQA2AogBIAFBCTYChAEgAUEIOgAkIAEgAiADQQNsajYCmC0gASACIANBfnFqNgKkLSAAEAkNACAAKAIcIgAgACgCLEEBdDYCPCAAKAJEIgEgACgCTEEBdEECayIDakEAOwEAIAEgAxAgIABBADYCtC0gAEKAgICAIDcCdCAAQgA3AmggAEKAgICAIDcCXCAAQQA2AkggACAAKAKEAUEMbCIBQYTIAGovAQA2ApABIAAgAUGAyABqLwEANgKMASAAIAFBgsgAai8BADYCgAEgACABQYbIAGovAQA2AnwLC6kCAQN/AkAgAEUNACAAKAIgRQ0AIAAoAiQiA0UNACAAKAIcIgFFDQAgASgCACAARw0AAkACQCABKAIEIgJBOWsOOQECAgICAgICAgICAgECAgIBAgICAgICAgICAgICAgICAgIBAgICAgICAgICAgIBAgICAgICAgICAQALIAJBmgVGDQAgAkEqRw0BCwJ/An8CfyABKAIIIgIEQCAAKAIoIAIgAxECACAAKAIcIQELIAEoAkQiAgsEQCAAKAIoIAIgACgCJBECACAAKAIcIQELIAEoAkAiAgsEQCAAKAIoIAIgACgCJBECACAAKAIcIQELIAEoAjgiAgsEQCAAKAIoIAIgACgCJBECACAAKAIcIQELIAAoAiggASAAKAIkEQIAIABBADYCHAsLlgIBA39BfiECAkAgAEUNACAAKAIgRQ0AIAAoAiRFDQAgACgCHCIBRQ0AIAEoAgAgAEcNAAJAAkAgASgCBCIDQTlrDjkBAgICAgICAgICAgIBAgICAQICAgICAgICAgICAgICAgICAQICAgICAgICAgICAQICAgICAgICAgEACyADQZoFRg0AIANBKkcNAQsgAEECNgIsIABBADYCCCAAQgA3AhQgAUEANgIUIAEgASgCCDYCECABKAIYIgJBf0wEQCABQQAgAmsiAjYCGAsgAUE5QSpB8QAgAhsgAkECRhs2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KAIIaiACQR9wIAJyQR9zOgAAIAEoAmwEQCAAKAIwIQIgASABKAIUIgNBAWo2AhQgAyABKAIIaiACQRh2OgAAIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAkEQdjoAACAAKAIwIQIgASABKAIUIgNBAWo2AhQgAyABKAIIaiACQQh2OgAAIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAjoAAAsgAEEAQQBBABAENgIwIAFB8QA2AgQgACgCHCICEBMCQCAAKAIQIgMgAigCFCIEIAMgBEkbIgNFDQAgACgCDCACKAIQIAMQHxogACAAKAIMIANqNgIMIAIgAigCECADajYCECAAIAAoAhQgA2o2AhQgACAAKAIQIANrNgIQIAIgAigCFCADayIDNgIUIAMNACACIAIoAgg2AhALIAEoAhQNBCABKAIEIQMLAkACQAJAAkACQAJAAkAgA0E5RgR/IABBAEEAQQAQBjYCMCABIAEoAhQiAkEBajYCFCACIAEoAghqQR86AAAgASABKAIUIgJBAWo2AhQgAiABKAIIakGLAToAACABIAEoAhQiAkEBajYCFCACIAEoAghqQQg6AAAgASgCHCICDQIgASABKAIUIgJBAWo2AhQgAiABKAIIakEAOgAAIAEgASgCFCICQQFqNgIUIAIgASgCCGpBADoAACABIAEoAhQiAkEBajYCFCACIAEoAghqQQA6AAAgASABKAIUIgJBAWo2AhQgAiABKAIIakEAOgAAIAEgASgCFCICQQFqNgIUIAIgASgCCGpBADoAAEECIQIgASgChAEiA0EJRwRAQQQgASgCiAFBAUpBAnQgA0ECSBshAgsgASABKAIUIgNBAWo2AhQgAyABKAIIaiACOgAAIAEgASgCFCICQQFqNgIUIAIgASgCCGpBAzoAACABQfEANgIEIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQCyABKAIUDQEgASgCBAUgAwtBxQBrDiMCBgYGAwYGBgYGBgYGBgYGBgYGBgYGBAYGBgYGBgYGBgYGBQYLIAFBfzYCKA8LIAIoAiQhAyACKAIcIQQgAigCECEFIAIoAiwhBiACKAIAIQggASABKAIUIgdBAWo2AhRBAiECIAcgASgCCGogBkEAR0EBdCAIQQBHciAFQQBHQQJ0ciAEQQBHQQN0ciADQQBHQQR0cjoAACABKAIcKAIEIQMgASABKAIUIgRBAWo2AhQgBCABKAIIaiADOgAAIAEoAhwoAgQhAyABIAEoAhQiBEEBajYCFCAEIAEoAghqIANBCHY6AAAgASgCHC8BBiEDIAEgASgCFCIEQQFqNgIUIAQgASgCCGogAzoAACABKAIcLQAHIQMgASABKAIUIgRBAWo2AhQgBCABKAIIaiADOgAAIAEoAoQBIgNBCUcEQEEEIAEoAogBQQFKQQJ0IANBAkgbIQILIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAjoAACABKAIcKAIMIQIgASABKAIUIgNBAWo2AhQgAyABKAIIaiACOgAAIAEoAhwiAigCEAR/IAIoAhQhAiABIAEoAhQiA0EBajYCFCADIAEoAghqIAI6AAAgASgCHCgCFCECIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAkEIdjoAACABKAIcBSACCygCLARAIAAgACgCMCABKAIIIAEoAhQQBjYCMAsgAUHFADYCBCABQQA2AiALIAEoAhwiBCgCECIDBEAgASgCFCICIAQvARQgASgCICIGayIFaiABKAIMIgRLBEADQCABKAIIIAJqIAMgBmogBCACayIEEB8aIAEgASgCDCIDNgIUAkAgAiADTw0AIAEoAhwoAixFDQAgACAAKAIwIAEoAgggAmogAyACaxAGNgIwCyABIAEoAiAgBGo2AiAgACgCHCICEBMCQCAAKAIQIgMgAigCFCIGIAMgBkkbIgNFDQAgACgCDCACKAIQIAMQHxogACAAKAIMIANqNgIMIAIgAigCECADajYCECAAIAAoAhQgA2o2AhQgACAAKAIQIANrNgIQIAIgAigCFCADayIDNgIUIAMNACACIAIoAgg2AhALIAEoAhQEQCABQX82AigPCyABKAIgIQYgASgCHCgCECEDQQAhAiAFIARrIgUgASgCDCIESw0ACwsgASgCCCACaiADIAZqIAUQHxogASABKAIUIAVqIgM2AhQCQCACIANPDQAgASgCHCgCLEUNACAAIAAoAjAgASgCCCACaiADIAJrEAY2AjALIAFBADYCIAsgAUHJADYCBAsgASgCHCgCHARAIAEoAhQiAiEFA0ACQCACIAEoAgxHDQACQCACIAVNDQAgASgCHCgCLEUNACAAIAAoAjAgASgCCCAFaiACIAVrEAY2AjALIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQC0EAIQJBACEFIAEoAhRFDQAgAUF/NgIoDwsgASgCHCgCHCEDIAEgASgCICIEQQFqNgIgIAMgBGotAAAhAyABIAJBAWo2AhQgASgCCCACaiADOgAAIAMEQCABKAIUIQIMAQsLAkAgASgCHCgCLEUNACABKAIUIgIgBU0NACAAIAAoAjAgASgCCCAFaiACIAVrEAY2AjALIAFBADYCIAsgAUHbADYCBAsCQCABKAIcKAIkRQ0AIAEoAhQiAiEFA0ACQCACIAEoAgxHDQACQCACIAVNDQAgASgCHCgCLEUNACAAIAAoAjAgASgCCCAFaiACIAVrEAY2AjALIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQC0EAIQJBACEFIAEoAhRFDQAgAUF/NgIoDwsgASgCHCgCJCEDIAEgASgCICIEQQFqNgIgIAMgBGotAAAhAyABIAJBAWo2AhQgASgCCCACaiADOgAAIAMEQCABKAIUIQIMAQsLIAEoAhwoAixFDQAgASgCFCICIAVNDQAgACAAKAIwIAEoAgggBWogAiAFaxAGNgIwCyABQecANgIECyABKAIcKAIsBEAgASgCDCABKAIUIgJBAmpJBEAgACgCHCICEBMCQCAAKAIQIgMgAigCFCIEIAMgBEkbIgNFDQAgACgCDCACKAIQIAMQHxogACAAKAIMIANqNgIMIAIgAigCECADajYCECAAIAAoAhQgA2o2AhQgACAAKAIQIANrNgIQIAIgAigCFCADayIDNgIUIAMNACACIAIoAgg2AhALIAEoAhQNBUEAIQILIAAoAjAhAyABIAJBAWo2AhQgASgCCCACaiADOgAAIAAoAjAhAiABIAEoAhQiA0EBajYCFCADIAEoAghqIAJBCHY6AAAgAEEAQQBBABAGNgIwCyABQfEANgIEIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQCyABKAIURQ0AIAFBfzYCKA8LIAAoAgQNAQsgASgCdA0AIAEoAgRBmgVGDQgLIAEoAoQBIgJFBEAgAUEDEAwMBAsCQAJAIAEoAogBQQJrDgIAAQQLA0ACQAJAIAEoAnQNACABEAogASgCdA0AIAFBADYCtC0MAQsgAUEANgJgIAEoAjggASgCbGotAAAhAiABKAKkLSABKAKgLSIDQQF0akEAOwEAIAEgA0EBajYCoC0gAyABKAKYLWogAjoAACABIAJBAnRqQZQBaiICIAIvAQBBAWo7AQAgASABKAJ0QQFrNgJ0IAEgASgCbEEBaiICNgJsIAEoAqAtIAEoApwtQQFrRw0BIAEgASgCXCIEQQBOBH8gASgCOCAEagVBAAsgAiAEa0EAEBQgASABKAJsNgJcIAEoAgAiAigCHCIDEBMCQCACKAIQIgQgAygCFCIFIAQgBUkbIgRFDQAgAigCDCADKAIQIAQQHxogAiACKAIMIARqNgIMIAMgAygCECAEajYCECACIAIoAhQgBGo2AhQgAiACKAIQIARrNgIQIAMgAygCFCAEayICNgIUIAINACADIAMoAgg2AhALIAEoAgAoAhANAQwHCwsgASgCoC1FDQcgASABKAJcIgNBAE4EfyABKAI4IANqBUEACyABKAJsIANrQQAQFCABIAEoAmw2AlwgASgCACICKAIcIgMQEwJAIAIoAhAiBCADKAIUIgUgBCAFSRsiBEUNACACKAIMIAMoAhAgBBAfGiACIAIoAgwgBGo2AgwgAyADKAIQIARqNgIQIAIgAigCFCAEajYCFCACIAIoAhAgBGs2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CAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOsACQDrAQkAGwAJABsBCQCbAAkAmwEJAFsACQBbAQkA2wAJANsBCQA7AAkAOwEJALsACQC7AQkAewAJAHsBCQD7AAkA+wEJAAcACQAHAQkAhwAJAIcBCQBHAAkARwEJAMcACQDHAQkAJwAJACcBCQCnAAkApwEJAGcACQBnAQkA5wAJAOcBCQAXAAkAFwEJAJcACQCXAQkAVwAJAFcBCQDXAAkA1wEJADcACQA3AQkAtwAJALcBCQB3AAkAdwEJAPcACQD3AQkADwAJAA8BCQCPAAkAjwEJAE8ACQBPAQkAzwAJAM8BCQAvAAkALwEJAK8ACQCvAQkAbwAJAG8BCQDvAAkA7wEJAB8ACQAfAQkAnwAJAJ8BCQBfAAkAXwEJAN8ACQDfAQkAPwAJAD8BCQC/AAkAvwEJAH8ACQB/AQkA/wAJAP8BCQAAAAcAQAAHACAABwBgAAcAEAAHAFAABwAwAAcAcAAHAAgABwBIAAcAKAAHAGgABwAYAAcAWAAHADgABwB4AAcABAAHAEQABwAkAAcAZAAHABQABwBUAAcANAAHAHQABwADAAgAgwAIAEMACADDAAgAIwAIAKMACABjAAgA4wAIAAAABQAQAAUACAAFABgABQAEAAUAFAAFAAwABQAcAAUAAgAFABIABQAKAAUAGgAFAAYABQAWAAUADgAFAB4ABQABAAUAEQAFAAkABQAZAAUABQAFABUABQANAAUAHQAFAAMABQATAAUACwAFABsABQAHAAUAFwAFAEHg2QALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHQ2gALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEGA3AALIwIAAAADAAAABwAAAAAAAAAQERIACAcJBgoFCwQMAw0CDgEPAEG03AALaQEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACgAAAAwAAAAOAAAAEAAAABQAAAAYAAAAHAAAACAAAAAoAAAAMAAAADgAAABAAAAAUAAAAGAAAABwAAAAgAAAAKAAAADAAAAA4ABBtN0AC5oCAQAAAAIAAAADAAAABAAAAAYAAAAIAAAADAAAABAAAAAYAAAAIAAAADAAAABAAAAAYAAAAIAAAADAAAAAAAEAAIABAAAAAgAAAAMAAAAEAAAABgAAAAgAAAAMAAAAEAAAABgAAAAgAAAAMAAAAEAAAABgAABuZWVkIGRpY3Rpb25hcnkAc3RyZWFtIGVuZAAAZmlsZSBlcnJvcgBzdHJlYW0gZXJyb3IAZGF0YSBlcnJvcgBpbnN1ZmZpY2llbnQgbWVtb3J5AGJ1ZmZlciBlcnJvcgBpbmNvbXBhdGlibGUgdmVyc2lvbgAAAAAoLwAAOC8AAEMvAABELwAATy8AAFwvAABnLwAAey8AAIgvAABDLwAAMS4yLjExAEHQ3wALA9AxUA==").split("").map((e=>e.charCodeAt(0)));return new Uint8Array(t,0,t.length/Uint8Array.BYTES_PER_ELEMENT)}().buffer)})).then((function(e){return WebAssembly.instantiate(e,t)})).then(e,(function(e){s("failed to asynchronously prepare wasm: "+e),C(e)}))}((function(e){i(e.instance)})),{}}();let O=e.___wasm_call_ctors=function(){return(O=e.___wasm_call_ctors=e.asm.__wasm_call_ctors).apply(null,arguments)},v=e._malloc=function(){return(v=e._malloc=e.asm.malloc).apply(null,arguments)};e._free=function(){return(e._free=e.asm.free).apply(null,arguments)},e.___errno_location=function(){return(e.___errno_location=e.asm.__errno_location).apply(null,arguments)},e._zlibCompress=function(){return(e._zlibCompress=e.asm.zlibCompress).apply(null,arguments)};let N,y=e.stackSave=function(){return(y=e.stackSave=e.asm.stackSave).apply(null,arguments)},D=e.stackRestore=function(){return(D=e.stackRestore=e.asm.stackRestore).apply(null,arguments)},w=e.stackAlloc=function(){return(w=e.stackAlloc=e.asm.stackAlloc).apply(null,arguments)};function b(t){function i(){N||(N=!0,e.calledRun=!0,c||(m(_),m(I),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),g.unshift(t);var t;m(g)}()))}f>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),p.unshift(t);var t;m(p)}(),f>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),i()}),1)):i()))}if(e.ccall=d,e.cwrap=function(e,t,i,n){const r=(i=i||[]).every((function(e){return"number"===e}));return"string"!==t&&r&&!n?A(e):function(){return d(e,t,i,arguments)}},e.allocate=function(e,t){let i;return i=1==t?w(e.length):v(e.length),e.subarray||e.slice?l.set(e,i):l.set(new Uint8Array(e),i),i},R=function e(){N||b(),N||(R=e)},e.run=b,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return b(),GK=e,e}const HK=Uint8Array.BYTES_PER_ELEMENT,KK={bytesReceived:"br",frameDropped:"fd",frameReceived:"fr",googJitterReceived:"jr",isAudioMute:"am",isFreeze:"fz",mediaType:"mt",packetsLost:"pl",packetsReceived:"pr",peerId:"pid",id:"id",ssrc:"ssrc",timestamp:"ts",type:"tp",frameRateInput:"fi",frameRateSent:"fs",googRtt:"rt",isVideoMute:"vm"},WK={stats:"sts",state:"st",stream_id:"stid",session_id:"seid",stream_type:"stt",app_id:"aid",channel_key:"ck",channel_name:"cn",sdk_version:"sv",browser:"b",process_id:"pcid",mode:"m",codec:"c",role:"r",has_changed_gateway:"hcg",ap_response:"ar",extends:"es",details:"d",features:"ft",p2p_id:"ppid",sdp:"sdp",audio:"a",video:"v",attributes:"at",hq:"h",lq:"l",stereo:"str",speech:"spe",extend:"e",pingpongElapse:"ppe"},JK={_message:"m",_type:"t",_id:"id"},qK={join_v2:"j2",publish:"pub",publish_related_stats:"prs",ping:"pi",traffic_stats:"ts",ping_back:"pib",publish_stats:"pubs"};let XK;class zK{constructor(){tD(this,"zlibCompress",void 0)}async init(){if(!XK){const e=await(async()=>(jK||(jK=await YK()),{zlibCompress:e=>{const t=new Uint8Array(e),i=HK*t.byteLength,n=jK._malloc(i),r=jK._malloc(3*i);for(let e=0;e<i;e++)jK.HEAP8[n/HK+e]=t[e];const o=jK._zlibCompress(n,i,r),s=new Uint8Array(jK.HEAP8.slice(r,r+o));return jK._free(n),jK._free(r),s}}))();XK=e.zlibCompress}this.zlibCompress=XK}msgPackCompress(e){return FK.exports.encode(e)}compress(e){const t=Date.now(),i=this.compressKeyAndValue(JSON.parse(JSON.stringify(e))),n=this.msgPackCompress(i),r=this.zlibCompress(n),o=new Uint8Array([49,49,49,50,...Array.from(r)]);return{origin:Object.assign({},e),originLength:JSON.stringify(e).length,shortKeyAndValue:i,msgpackSer:n,compressed:o,compressedLength:o.length,time:Date.now()-t}}compressKeyAndValue(e){return this._ObjectKeyCompress(this._typeCompress(e))}_typeCompress(e){const t=e._type;if(!t)return e;const i=qK[t];return e._type=i||t,e}_ObjectKeyCompress(e){const t=e._message;if(t){const i=t.stats;i&&(t.stats=this._statsCompress(i)),e._message=this._messageCompress(t)}return this._reportCompress(e)}_statsCompress(e){return this._keyCompress(e,KK)}_messageCompress(e){return this._keyCompress(e,WK)}_reportCompress(e){return this._keyCompress(e,JK)}_keyCompress(e,t){const i={},n=Object.keys(e);return dE(n).call(n,((n,r)=>{const o=e[r];return t[r]?i[t[r]]=o:i[r]=o,i}),i),i}}class ZK extends Ew{get queue(){return[...this.highPriorityQueue,...this.lowPriorityQueue]}constructor(e){super(),tD(this,"lowPriorityQueue",[]),tD(this,"highPriorityQueue",[]),tD(this,"AgoraWebSocketManager",void 0),this.AgoraWebSocketManager=e}reset(){this.lowPriorityQueue=[],this.highPriorityQueue=[]}pushMessage(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.highPriorityQueue.push(e):this.lowPriorityQueue.push(e),this.sendMessage()}sendMessage(){const e=this.queue.length;let t=0;t=e<5?15*e:60+3*(e-4),setTimeout((()=>{this._sendMessage()}),t)}_sendMessage(){if(!this.queue.length)return;const e=this.AgoraWebSocketManager.getConnection();if(!e||1!==e.readyState)return;const t=this.queue.shift();return this.lowPriorityQueue.includes(t)?this.lowPriorityQueue.shift():this.highPriorityQueue.shift(),e.send(t.compressed),t}}var $K;function eW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}let tW=Ww("AgoraWebSocketManager","connectionID")($K=class extends Ew{get url(){return this.websocket?this.websocket.url:null}get reconnectMode(){return this._reconnectMode}set reconnectMode(e){["tryNext","recover"].includes(e)&&this.resetReconnectCount(e),this._reconnectMode=e}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,"reconnecting"===this._state?this.emit(sP.RECONNECTING,this.reconnectReason):"connected"===this._state?this.emit(sP.CONNECTED):"closed"===this._state?this.emit(sP.CLOSED):"failed"===this._state&&this.emit(sP.FAILED))}resetReconnectCount(e){mw.debug("websocket reset reconnect count, reason: "+e),Yw("debug",this,"resetReconnectCount",e,"websocket reset reconnect count, reason: "+e),this.reconnectCount=0}constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(),tD(this,"connectionID",0),tD(this,"currentURLIndex",0),tD(this,"urls",void 0),tD(this,"_reconnectMode","tryNext"),tD(this,"reconnectReason",void 0),tD(this,"_initMutex",new Qx("websocket")),tD(this,"name",void 0),tD(this,"_state","closed"),tD(this,"reconnectInterrupter",void 0),tD(this,"websocket",void 0),tD(this,"retryConfig",void 0),tD(this,"reconnectCount",0),tD(this,"onlineReconnectListener",void 0),tD(this,"compressor",new zK),tD(this,"compressorInitStatus","initializing"),tD(this,"compress",void 0),tD(this,"messageSender",void 0),tD(this,"useCompress",void 0),tD(this,"tryDoubleDomain",!1),tD(this,"wsInflateLength",0),tD(this,"wsDeflateLength",0),tD(this,"closeEstablishingWs",(()=>{})),this.name=e,this.retryConfig=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t),this.useCompress=i,this.tryDoubleDomain=n;const{timeout:r,timeoutFactor:o}=t,s=Math.max(300,Math.floor(3*r/5)),a=Math.max(1.2,Math.floor(8*o)/10);jP.ONLINE&&(this.retryConfig.timeout=s,this.retryConfig.timeoutFactor=a),Sx.on(YP.NETWORK_STATE_CHANGE,((e,t)=>{e!==t&&(this.resetReconnectCount("network state change: ".concat(t," -> ").concat(e)),e===jP.ONLINE?(this.retryConfig.timeout=s,this.retryConfig.timeoutFactor=a):(this.retryConfig.timeout=r,this.retryConfig.timeoutFactor=o))}));const c=Date.now();this.compressor.init().then((()=>{this.compressorInitStatus="initialized";const e=Date.now()-c;mw.debug("websocket compressor initialized successfully in ".concat(e,"ms")),Yw("debug",this.compressor,"init",void 0,"websocket compressor initialized successfully in ".concat(e,"ms")),Px.wsCompressorInit({status:!0,ec:null,eventElapse:e}),this.compress=this.compressor.compress.bind(this.compressor)})).catch((e=>{this.compressorInitStatus="failed";const t=e?e.message||e.toString():"Empty Error";mw.debug("websocket compressor failed to initialize because of ".concat(t)),Yw("debug",this.compressor,"init",void 0,"websocket compressor failed to initialize because of ".concat(t)),Px.wsCompressorInit({status:!1,ec:t,eventElapse:1})}))}getConnection(){return this.websocket||void 0}init(e){const t=(t,i)=>{this.urls=e;const n=this.urls[this.currentURLIndex];this.state="connecting",this.messageSender=new ZK(this),this.createWebSocketConnection(n).then(t).catch(i),this.once(sP.CLOSED,(()=>i(new pw(hw.WS_DISCONNECT)))),this.once(sP.CONNECTED,(()=>t()))};return this._initMutex.lock().then((e=>new Mm(((e,i)=>{t(e,i)})).then((()=>{e()})).catch((()=>{e()}))))}close(e,t){if(this.currentURLIndex=0,this.resetReconnectCount("close"),this.reconnectInterrupter&&this.reconnectInterrupter(),this.websocket){this.websocket.onclose=null,this.websocket.onopen=null,this.websocket.onmessage=null;const e=this.websocket;t?setTimeout((()=>e.close()),500):e.close(),this.websocket=void 0}this.state=e?"failed":"closed",this.closeEstablishingWs&&this.closeEstablishingWs()}reconnect(e,t){if(!this.websocket)return mw.warning("[".concat(this.name,"] can not reconnect, no websocket")),void Yw("warning",this,"reconnect","can not reconnect, no websocket");void 0!==e&&(this.reconnectMode=e),mw.debug("[".concat(this.name,"] reconnect is triggered initiative")),Yw("debug",this,"reconnect");const i=this.websocket.onclose;this.websocket.onclose=null,this.websocket.close(),i&&i.bind(this.websocket)({code:9999,reason:t})}sendMessageWithJSON(e){const t=JSON.stringify(e);return{compressed:t,compressedLength:t.length,origin:e}}sendMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new pw(hw.WS_ABORT,"websocket is not ready");try{let i=null;if("initialized"===this.compressorInitStatus&&this.useCompress&&cb("WEBSOCKET_COMPRESS"))try{i=this.compress(e),this.setWsInflateData(i)}catch(t){i=this.sendMessageWithJSON(e)}else i=this.sendMessageWithJSON(e);t?this.websocket.send(i.compressed):this.messageSender.pushMessage(i)}catch(e){throw new pw(hw.WS_ERR,"send websocket message error"+e.toString())}}setWsInflateData(e){this.wsDeflateLength=this.wsDeflateLength+e.originLength,this.wsInflateLength=this.wsInflateLength+e.compressedLength}getWsInflateData(){const e=this.wsInflateLength,t=this.wsDeflateLength;return this.clearWsInflateData(),{wsInflateLength:e,wsDeflateLength:t}}clearWsInflateData(){this.wsInflateLength=0,this.wsDeflateLength=0}async createWebSocketConnection(e,t){return this.connectionID+=1,this.connectionID,new Mm(((i,n)=>{const r=()=>{mw.debug("[".concat(this.name,"] websocket opened:"),e),jw("debug",["WebSocket",this.connectionID],"open",e),this.reconnectMode="retry",this.state="connected",this.resetReconnectCount("opened"),i()},o=async e=>{if(mw.debug("[".concat(this.name,"] websocket close ").concat(this.websocket&&this.websocket.url,", code: ").concat(e.code,", reason: ").concat(e.reason,", current mode: ").concat(this.reconnectMode)),jw("debug",["WebSocket",this.connectionID],"close",{code:e.code,reason:e.reason,url:this.websocket&&this.websocket.url,reconnectMode:this.reconnectMode}),this.reconnectCount<this.retryConfig.maxRetryCount){"connected"===this.state&&(this.reconnectReason=e.reason,this.state="reconnecting");const t=PG(this,sP.WILL_RECONNECT,this.reconnectMode)||this.reconnectMode,r=await this.reconnectWithAction(t);if("closed"===this.state)return mw.debug("[".concat(this.connectionID,"] ws is closed, no need to reconnect")),void xw("debug",this,"ws is closed, no need to reconnect");if(!r)return n(new pw(hw.WS_DISCONNECT,"websocket reconnect failed: ".concat(e.code))),void this.close(!0);i()}else n(new pw(hw.WS_DISCONNECT,"websocket close: ".concat(e.code))),this.close()},s=e=>{this.emit(sP.ON_MESSAGE,e)};this.websocket&&(this.websocket.onclose=null,this.websocket.close()),cb("GATEWAY_WSS_ADDRESS")&&this.name.startsWith("gateway")&&(e=cb("GATEWAY_WSS_ADDRESS")),mw.debug("[".concat(this.name,"] start connect, url: ").concat(e)),xw("debug",this,"start connect, url: ".concat(e)),this.chooseBestWebsocketConnection(e,!!t).then((e=>{this.websocket=e,r&&r(),e.onclose=o,e.onmessage=s})).catch((e=>{if("closed"!==this.state){if(e instanceof pw&&e.code===hw.WS_ERR){const t=new pw(hw.WS_ERR,"init websocket failed! Error: ".concat(e.toString()));return mw.error("[".concat(this.name,"]").concat(t)),Yw("error",this,"chooseBestWebsocketConnection",void 0,e.toString()),void n(t)}o&&o(e)}else n(new pw(hw.WS_DISCONNECT,"websocket is closed: ".concat(e.toString())))}))}))}async reconnectWithAction(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.reconnectCount>=this.retryConfig.maxRetryCount)return!1;if(!this.urls)return!1;if("closed"===this.state)return!1;this.onlineReconnectListener||Sx.networkState!==jP.OFFLINE||(this.onlineReconnectListener=Sx.onlineWaiter&&Sx.onlineWaiter.then((()=>{this.onlineReconnectListener=void 0})));let i=!0;if(this.reconnectInterrupter=()=>{i=!1},t){const t=Iw(this.reconnectCount,this.retryConfig);mw.debug("[".concat(this.name,"] wait ").concat(t,"ms to reconnect websocket, mode: ").concat(e)),Yw("debug",this,"reconnectWithAction",{timeout:t,action:e}),await Mm.race([SG(t),this.onlineReconnectListener||new Mm((()=>{}))])}if("closed"===this.state||!i)return!1;this.reconnectCount+=1;const n=async(e,t)=>{this.emit(sP.RECONNECT_CREATE_CONNECTION,t),await this.createWebSocketConnection(e)};try{if("retry"===e){const t=this.urls[this.currentURLIndex];this.emit(sP.RECONNECT_WAITTING_FINISH,e),await n(t,e)}else if("tryNext"===e){if(this.currentURLIndex+=1,this.currentURLIndex>=this.urls.length)return await this.reconnectWithAction("recover",!1);mw.debug("[".concat(this.name,"] websocket url length: ").concat(this.urls.length," current index: ").concat(this.currentURLIndex)),xw("debug",this,"websocket url length: ".concat(this.urls.length," current index: ").concat(this.currentURLIndex));const t=this.urls[this.currentURLIndex];this.emit(sP.RECONNECT_WAITTING_FINISH,e),await n(t,e)}else if("recover"===e){mw.debug("[".concat(this.name,"] request new urls")),xw("debug",this,"request new urls"),this.resetReconnectCount("recover mode"),this.emit(sP.RECONNECT_WAITTING_FINISH,e),this.urls=await bG(this,sP.REQUEST_NEW_URLS),this.currentURLIndex=0;const t=this.urls[this.currentURLIndex];await n(t,e)}return!0}catch(i){return mw.error("[".concat(this.name,"] reconnect failed"),i.toString()),Yw("error",this,"reconnectWithAction",void 0,i.toString()),await this.reconnectWithAction(e,t)}}async chooseBestWebsocketConnection(e,t){return new Mm(((i,n)=>{let r=!1;const o=[];this.closeEstablishingWs=()=>{mw.debug("[choose-best-ws] close establishing websockets"),o.forEach((e=>{e.onclose=null,e.onopen=null,e.onmessage=null,e.close()})),n(new pw(hw.WS_ABORT,"choose best websocket aborted"))};const s=cb("GATEWAY_DOMAINS");let a;const c=e.indexOf("?h="),A=s.find((t=>-1!==c?e.includes(t,c):e.includes(t)));mw.debug("[choose-best-ws] currentDomain: ",A,", domains: ",s),Yw("debug",this,"chooseBestWebsocketConnection",{currentDomain:A,domains:s});let d=!this.tryDoubleDomain||t||!A;if(!d&&A){const t=Date.now();try{s.forEach((t=>{const i=-1===c?e.replace(A,t):e.substr(0,c)+e.substr(c).replace(A,t),n=new WebSocket(i);n.binaryType="arraybuffer",o.push(n),mw.debug("[choose-best-ws] ws is connecting:",n.url),xw("debug",this,"ws is connecting: ".concat(n.url))}))}catch(e){for(mw.debug("[choose-best-ws] ws create failed, fallback to single url"),xw("debug",this,"ws create failed, fallback to single url"),o.forEach((e=>e.close()));o.length;)o.pop();d=!0}o.forEach((e=>{e.onopen=()=>{if(r)return;const n=Date.now()-t;mw.debug("[choose-best-ws] ws open cost ".concat(n,"ms")),o.filter((t=>t!==e)).forEach((e=>{mw.debug("[choose-best-ws]close backup websocket: ".concat(e.url)),xw("debug",this,"close backup websocket: ".concat(e.url)),e.close()})),r=!0,i(e)},e.onclose=e=>{a=e,r||o.find((e=>!(e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)))||(mw.debug("[choose-best-ws] all websocket is closed"),xw("debug",this,"all websocket is closed"),r=!0,n(a))},e.onmessage=t=>{mw.debug("[choose-best-ws]".concat(e.url," onmessage: ").concat(t.data)),xw("debug",this,"".concat(e.url," onmessage: ").concat(t.data))}})),SG(5e3).then((()=>{o.forEach((e=>{e.readyState!==WebSocket.OPEN&&e.close()}))}))}if(d){let t;mw.debug("[choose-best-ws] use single url: ",e),xw("debug",this,"use single url: ".concat(e));try{t=new WebSocket(e),o.push(t),t.binaryType="arraybuffer"}catch(e){const t=new pw(hw.WS_ERR,"init websocket failed! Error: ".concat(e.toString()));return mw.error("[".concat(this.name,"]").concat(t)),Yw("error",this,"chooseBestWebsocketConnection",void 0,e.toString()),void n(t)}t.onopen=()=>{i(t)},t.onclose=e=>{n(e)},t.onmessage=e=>{mw.debug("[choose-best-ws]".concat(t.url," onmessage: ").concat(e.data)),xw("debug",this,"".concat(t.url," onmessage: ").concat(e.data))},SG(5e3).then((()=>{t&&t.readyState!==WebSocket.OPEN&&t.close()}))}})).then((e=>(this.closeEstablishingWs=void 0,e))).catch((e=>{throw this.closeEstablishingWs=void 0,e}))}})||$K;class iW{constructor(e){tD(this,"input",[]),tD(this,"size",void 0),this.size=e}add(e){this.input.push(e),this.input.length>this.size&&this.input.splice(0,1)}mean(){var e;return 0===this.input.length?0:dE(e=this.input).call(e,((e,t)=>e+t))/this.input.length}}var nW;let rW=Ww("AgoraRTCSignal","websocket.connectionID")(nW=class extends Ew{get connectionState(){return this._connectionState}set connectionState(e){e!==this._connectionState&&(this._connectionState=e,e===jL.CONNECTED?this.emit(YL.WS_CONNECTED):e===jL.RECONNECTING?this.emit(YL.WS_RECONNECTING,this._websocketReconnectReason):e===jL.CLOSED&&this.emit(YL.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket?this.websocket.url:null}get rtt(){return this.rttRolling.mean()}constructor(e){super(),tD(this,"_disconnectedReason",void 0),tD(this,"_websocketReconnectReason",void 0),tD(this,"_connectionState",jL.CLOSED),tD(this,"reconnectToken",void 0),tD(this,"websocket",void 0),tD(this,"openConnectionTime",void 0),tD(this,"clientId",void 0),tD(this,"lastMsgTime",Date.now()),tD(this,"uploadCache",[]),tD(this,"uploadCacheInterval",void 0),tD(this,"rttRolling",new iW(5)),tD(this,"pingpongTimer",void 0),tD(this,"wsInflateDataTimer",void 0),tD(this,"pingpongTimeoutCount",0),tD(this,"joinResponse",void 0),tD(this,"multiIpOption",void 0),tD(this,"initError",void 0),tD(this,"spec",void 0),tD(this,"onWebsocketMessage",(e=>{if(e.data instanceof ArrayBuffer)return void this.emit(YL.ON_BINARY_DATA,e.data);const t=JSON.parse(e.data);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(t,"_id")){const e="res-@".concat(t._id);this.emit(e,t._result,t._message)}else if(Object.prototype.hasOwnProperty.call(t,"_type")&&(this.emit(t._type,t._message),t._type===WL.ON_NOTIFICATION&&this.handleNotification(t._message),t._type===WL.ON_USER_BANNED))switch(t._message.error_code){case 14:this.close(xL.UID_BANNED);break;case 15:this.close(xL.IP_BANNED);break;case 16:this.close(xL.CHANNEL_BANNED)}})),this.clientId=e.clientId,this.spec=e,this.websocket=new tW("gateway-".concat(this.clientId),this.spec.retryConfig,!0,!0),this.handleWebsocketEvents(),window.addEventListener("offline",(()=>{this.connectionState===jL.CONNECTED&&this.reconnect("retry",GL.OFFLINE)}))}async request(e,t,i,n){const r=vG(6,""),o={_id:r,_type:e,_message:t},s=this.websocket.connectionID,a=()=>new Mm(((t,i)=>{if(this.connectionState===jL.CONNECTED)return t();const n=()=>{this.off(YL.WS_CLOSED,r),t()},r=()=>{this.off(YL.WS_CONNECTED,n),i(new pw(hw.WS_ABORT))};this.once(YL.WS_CONNECTED,n),this.once(YL.WS_CLOSED,r),e!==HL.PUBLISH&&e!==HL.SUBSCRIBE&&e!==HL.UNSUBSCRIBE&&e!==HL.UNPUBLISH&&e!==HL.CONTROL||this.once(YL.DISCONNECT_P2P,(()=>{i(new pw(hw.DISCONNECT_P2P))})),e===HL.PUBLISH&&this.once(YL.ABORT_P2P_EXECUTION,(()=>{i(new pw(hw.DISCONNECT_P2P))}))}));if(this.connectionState!==jL.CONNECTING&&this.connectionState!==jL.RECONNECTING||e===HL.JOIN||e===HL.REJOIN||await a(),this.websocket.sendMessage(o,!0),n)return;const c=new Mm(((i,n)=>{let o=!1;const a=(n,r)=>{o=!0,i({isSuccess:"success"===n,message:r||{}}),this.off(YL.WS_CLOSED,c),this.off(YL.WS_RECONNECTING,c),this.emit(YL.REQUEST_SUCCESS,e,t)};this.once("res-@".concat(r),a);const c=()=>{n(new pw(hw.WS_ABORT,"type: ".concat(e))),this.off(YL.WS_CLOSED,c),this.off(YL.WS_RECONNECTING,c),this.off("res-@".concat(r),a)};this.once(YL.WS_CLOSED,c),this.once(YL.WS_RECONNECTING,c),SG(cb("SIGNAL_REQUEST_TIMEOUT")).then((()=>{this.websocket.connectionID!==s||o||(mw.warning("ws request timeout, type: ".concat(e)),xw("warning",this,"ws request timeout, type: ".concat(e)),this.emit(YL.REQUEST_TIMEOUT,e,t))}))}));let A=null;try{A=await c}catch(n){if(this.connectionState===jL.CLOSED||e===HL.LEAVE)throw new pw(hw.WS_ABORT);return!this.spec.forceWaitGatewayResponse||i?n.throw():e===HL.JOIN||e===HL.REJOIN?null:(await a(),await this.request(e,t))}if(A.isSuccess)return A.message;const d=Number(A.message.error_code||A.message.code),u=xK(d),E=new pw(hw.UNEXPECTED_RESPONSE,"".concat(u.desc,": ").concat(A.message.error_str),{code:d,data:A.message});return"success"===u.action?A.message:(mw.warning("[".concat(this.websocket.connectionID,"] unexpected response from type ").concat(e,", error_code: ").concat(d,", message: ").concat(u.desc,", action: ").concat(u.action)),xw("warning",this,"unexpected response from type ".concat(e,", error_code: ").concat(d,", message: ").concat(u.desc,", action: ").concat(u.action)),d===VL.ERR_TOO_MANY_BROADCASTERS?e===HL.JOIN||e===HL.REJOIN?(this.initError=E,this.close(),E.throw()):E.throw():"failed"===u.action?E.throw():"quit"===u.action?(this.initError=E,this.close(),E.throw()):(d===VL.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=A.message.option,mw.warning("[".concat(this.clientId,"] detect multi ip, recover")),xw("warning",this,"detect multi ip, recover"),this.reconnect("recover",GL.MULTI_IP)):this.reconnect(u.action,GL.SERVER_ERROR),e===HL.JOIN||e===HL.REJOIN?null:await this.request(e,t)))}waitMessage(e,t){return new Mm((i=>{const n=r=>{(!t||t(r))&&(this.off(e,n),i(r))};this.on(e,n)}))}upload(e,t){const i={_type:e,_message:t};try{this.websocket.sendMessage(i)}catch(e){const t=cb("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(i),this.uploadCache.length>t&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval((()=>{if(this.connectionState!==jL.CONNECTED)return;const e=this.uploadCache.splice(0,1)[0];0===this.uploadCache.length&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(e._type,e._message)}),cb("UPLOAD_CACHE_INTERVAL")||2e3))}}send(e,t){const i={_type:e,_message:t};this.websocket.sendMessage(i)}init(e,t){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Mm(((i,n)=>{this.once(YL.WS_CONNECTED,(()=>i(this.joinResponse))),this.once(YL.WS_CLOSED,(()=>n(this.initError||new pw(hw.WS_ABORT)))),this.connectionState=jL.CONNECTING,this.websocket.init(e).catch(n),this.wsInflateDataTimer&&window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=window.setInterval((()=>{this.handleWsInflateData()}),2e4),setTimeout((()=>{t&&void 0===this.openConnectionTime&&(mw.debug("[".concat(this.clientId,"] init websocket timeout while join with fallback to proxy")),n(new pw(hw.INIT_WEBSOCKET_TIMEOUT)))}),cb("JOIN_WITH_FALLBACK_PROXY_PENDING_DURATION"))}))}close(e){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.wsInflateDataTimer&&(this.handleWsInflateData(),window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._disconnectedReason=e||xL.LEAVE,this.connectionState=jL.CLOSED,mw.debug("[".concat(this.clientId,"] ")+"will close websocket in signal"),this.websocket.close(),e===xL.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new tW("gateway-".concat(this.clientId),this.spec.retryConfig,!0,!0),this.handleWebsocketEvents())}async join(){if(!this.joinResponse){this.emit(YL.ABORT_P2P_EXECUTION);const e=await bG(this,YL.REQUEST_JOIN_INFO),t=await this.request(HL.JOIN,e);if(!t)return this.emit(YL.REPORT_JOIN_GATEWAY,hw.TIMEOUT,this.url||""),!1;this.joinResponse=t,this.emit(YL.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=jL.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}async rejoin(){if(!this.reconnectToken)throw new pw(hw.UNEXPECTED_ERROR,"can not rejoin, no rejoin token");const e=kG(this,YL.REQUEST_REJOIN_INFO);e.token=this.reconnectToken;const t=await this.request(HL.REJOIN,e);return!!t&&(this.connectionState=jL.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),t.peers&&t.peers.forEach((e=>{this.emit(WL.ON_USER_ONLINE,{uid:e.uid}),e.audio_mute?this.emit(WL.MUTE_AUDIO,{uid:e.uid}):this.emit(WL.UNMUTE_AUDIO,{uid:e.uid}),e.video_mute?this.emit(WL.MUTE_VIDEO,{uid:e.uid}):this.emit(WL.UNMUTE_VIDEO,{uid:e.uid}),e.audio_enable_local?this.emit(WL.ENABLE_LOCAL_AUDIO,{uid:e.uid}):this.emit(WL.DISABLE_LOCAL_AUDIO,{uid:e.uid}),e.video_enable_local?this.emit(WL.ENABLE_LOCAL_VIDEO,{uid:e.uid}):this.emit(WL.DISABLE_LOCAL_VIDEO,{uid:e.uid}),e.audio||e.video||this.emit(WL.ON_REMOVE_STREAM,{uid:e.uid,uint_id:e.uint_id}),e.audio&&this.emit(WL.ON_ADD_AUDIO_STREAM,{uid:e.uid,uint_id:e.uint_id,audio:!0,ssrcId:e.audio_ssrc}),e.video&&this.emit(WL.ON_ADD_VIDEO_STREAM,{uid:e.uid,uint_id:e.uint_id,video:!0,ssrcId:e.video_ssrc})})),!0)}reconnect(e,t){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(e,t)}handleNotification(e){mw.debug("[".concat(this.clientId,"] receive notification: "),e),Yw("debug",this,"handleNotification",e);const t=xK(e.code);if("success"!==t.action)return"failed"===t.action?(mw.error("[".concat(this.clientId,"] ignore error: "),t.desc),void xw("error",this,"ignore error: ".concat(t.desc))):"quit"===t.action?("ERR_REPEAT_JOIN_CHANNEL"===t.desc&&this.close(xL.UID_BANNED),void this.close()):void this.reconnect(t.action,GL.SERVER_ERROR)}handlePingPong(){if(!this.websocket||"connected"!==this.websocket.state)return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;const e=cb("PING_PONG_TIME_OUT"),t=Date.now();this.pingpongTimeoutCount>=e&&(mw.warning("PINGPONG Timeout. Last Socket Message: ".concat(t-this.lastMsgTime,"ms")),xw("warning",this,"PINGPONG Timeout. Last Socket Message: ".concat(t-this.lastMsgTime,"ms")),t-this.lastMsgTime>cb("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",GL.TIMEOUT):this.request(HL.PING,void 0,!0).then((()=>{this.pingpongTimeoutCount=0;const e=Date.now()-t;this.rttRolling.add(e),cb("REPORT_STATS")&&this.send(HL.PING_BACK,{pingpongElapse:e})})).catch((e=>{}))}handleWsInflateData(){const{wsInflateLength:e,wsDeflateLength:t}=this.websocket.getWsInflateData();0!==e&&0!==t&&this.upload(KL.WS_INFLATE_DATA_LENGTH,{ws_deflate_length:t,ws_inflate_length:e})}handleWebsocketEvents(){this.websocket.on(sP.RECONNECT_WAITTING_FINISH,(e=>{this.emit(YL.WS_RECONNECT_WAITTING_FINISH,e)})),this.websocket.on(sP.RECONNECT_CREATE_CONNECTION,(e=>{this.emit(YL.WS_RECONNECT_CREATE_CONNECTION,e)})),this.websocket.on(sP.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(sP.CLOSED,(()=>{this.connectionState=jL.CLOSED})),this.websocket.on(sP.FAILED,(()=>{this._disconnectedReason=xL.NETWORK_ERROR,this.connectionState=jL.CLOSED})),this.websocket.on(sP.RECONNECTING,(e=>{this._websocketReconnectReason=e,this.joinResponse=void 0,this.connectionState===jL.CONNECTED?this.connectionState=jL.RECONNECTING:this.connectionState=jL.CONNECTING})),this.websocket.on(sP.WILL_RECONNECT,((e,t)=>{if(kG(this,YL.IS_P2P_DISCONNECTED)&&"retry"===e)return mw.debug("".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),xw("debug",this,"".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),this.reconnectToken=void 0,this.emit(YL.NEED_RENEW_SESSION),this.emit(YL.DISCONNECT_P2P),t("tryNext");"retry"!==e&&(mw.debug("".concat(this.clientId," websockt will_connect event, renewSession reconnectMode is ").concat(e)),xw("debug",this,"".concat(this.clientId," websockt will_connect event, renewSession reconnectMode is ").concat(e)),this.reconnectToken=void 0,this.emit(YL.NEED_RENEW_SESSION),this.emit(YL.DISCONNECT_P2P)),t(e)})),this.websocket.on(sP.CONNECTED,(()=>{this.openConnectionTime=Date.now(),this.reconnectToken?this.rejoin().catch((e=>{mw.warning("[".concat(this.clientId,"] rejoin failed ").concat(e)),Yw("warning",this,"rejoin",void 0,e.toString()),this.reconnect("tryNext",GL.SERVER_ERROR)})):this.join().catch((e=>{if(this.emit(YL.REPORT_JOIN_GATEWAY,e.message||e.code,this.url||""),e instanceof pw&&e.code===hw.UNEXPECTED_RESPONSE&&e.data.code===VL.ERR_NO_AUTHORIZED)return mw.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),xw("warning",this,"reconnect no authorized, recover"),void this.reconnect("recover",GL.SERVER_ERROR);mw.error("[".concat(this.clientId,"] join gateway request failed"),e.toString()),Yw("error",this,"join",void 0,e.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",GL.SERVER_ERROR):(this.initError=e,this.close())}))})),this.websocket.on(sP.REQUEST_NEW_URLS,((e,t)=>{bG(this,YL.REQUEST_RECOVER,this.multiIpOption).then(e).catch(t)}))}})||nW;var oW;function sW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function aW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}const cW=new Map;let AW=Ww("AgoraRTCGateway","store.clientId")(oW=class extends Ew{get state(){return this._state}set state(e){if(e===this._state)return;const t=this._state;this._state=e,"DISCONNECTED"===e&&this._disconnectedReason?this.emit(mP.CONNECTION_STATE_CHANGE,e,t,this._disconnectedReason):this.emit(mP.CONNECTION_STATE_CHANGE,e,t)}get joinGatewayStartTime(){return this._joinGatewayStartTime}set joinGatewayStartTime(e){mw.debug("[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(e)),Yw("debug",this,"joinGatewayStartTime",e,"[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(e)),this._joinGatewayStartTime=e}constructor(e,t){super(),tD(this,"store",void 0),tD(this,"joinInfo",void 0),tD(this,"key",void 0),tD(this,"signal",void 0),tD(this,"role",void 0),tD(this,"inChannelInfo",{joinAt:null,duration:0}),tD(this,"spec",void 0),tD(this,"_state","DISCONNECTED"),tD(this,"_statsCollector",void 0),tD(this,"_disconnectedReason",void 0),tD(this,"isSignalRecover",!1),tD(this,"hasChangeBGPAddress",!1),tD(this,"trafficStatsInterval",void 0),tD(this,"networkQualityInterval",void 0),tD(this,"_joinGatewayStartTime",0),tD(this,"_signalTimeout",!1),tD(this,"_clientRoleOptions",void 0),tD(this,"_isProactiveJoin",!1),this.store=e,this.spec=t,this.signal=new rW(aW(aW({},t),{},{retryConfig:t.websocketRetryConfig})),this._statsCollector=t.statsCollector,this.role=t.role||"audience",this._clientRoleOptions=t.clientRoleOptions,this.handleSignalEvents()}async join(e,t,i){this.store.joinGatewayStart(),"disabled"!==e.cloudProxyServer&&(this.hasChangeBGPAddress=!0);const n=Date.now();let r=cW.get(e.cname);if(r||(r=new Map,cW.set(e.cname,r)),this._isProactiveJoin=!0,r.has(e.uid)){const t=new pw(hw.UID_CONFLICT);throw Px.joinGateway(e.sid,{lts:n,succ:!1,ec:t.message,addr:null,uid:e.uid,cid:e.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!e.proxyServer}),this._isProactiveJoin=!1,t}r.set(e.uid,!0),this.joinInfo=e,this.key=t;const o=e.proxyServer,s=o?e.gatewayAddrs.map((e=>{const t=e.address.split(":");return"wss://".concat(o,"/ws/?h=").concat(t[0],"&p=").concat(t[1])})):e.gatewayAddrs.map((e=>"wss://".concat(e.address)));let a=0;this.joinGatewayStartTime=n;try{a=(await this.signal.init(s,i)).uid}catch(t){if(t&&t.code===hw.INIT_WEBSOCKET_TIMEOUT)throw mw.warning("[".concat(this.store.clientId,"] User join failed"),t.toString()),t;throw mw.error("[".concat(this.store.clientId,"] User join failed"),t.toString()),Yw("error",this,"join",void 0,t.toString()),Px.joinGateway(e.sid,{lts:n,succ:!1,ec:t.message,addr:this.signal.url,uid:e.uid,cid:e.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!o}),this._isProactiveJoin=!1,r.delete(e.uid),this.signal.close(),t}return this.state="CONNECTED",this.inChannelInfo.joinAt=Date.now(),mw.debug("[".concat(this.store.clientId,"] Connected to gateway server")),Yw("debug",this,"join",void 0,"success"),this.trafficStatsInterval=window.setInterval((()=>{this.updateTrafficStats().catch((e=>{mw.warning("[".concat(this.store.clientId,"] get traffic stats error"),e.toString()),Yw("warning",this,"trafficStatsInterval",void 0,e.toString())}))}),3e3),this.networkQualityInterval=window.setInterval((()=>{navigator&&void 0!==navigator.onLine&&!navigator.onLine?this.emit(mP.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6}):this._signalTimeout?this.emit(mP.NETWORK_QUALITY,{downlinkNetworkQuality:5,uplinkNetworkQuality:5}):"CONNECTED"===this.state&&this._statsCollector.trafficStats?this.emit(mP.NETWORK_QUALITY,{uplinkNetworkQuality:_G(this._statsCollector.trafficStats.B_unq),downlinkNetworkQuality:_G(this._statsCollector.trafficStats.B_dnq)}):this.emit(mP.NETWORK_QUALITY,{uplinkNetworkQuality:0,downlinkNetworkQuality:0})}),2e3),this.store.joinGatewayEnd(),a}async leave(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if("DISCONNECTED"!==this.state){t!==xL.FALLBACK&&(this.state="DISCONNECTING");try{e||this.signal.connectionState!==jL.CONNECTED||await function(e,t){return Mm.race([e,OG(3e3)])}(this.signal.request(HL.LEAVE,void 0,!0))}catch(e){mw.warning("[".concat(this.store.clientId,"] leave request failed, ignore"),e),xw("warning",this,"leave request failed, ignore, ".concat(e.toString()))}this.signal.close(t),t!==xL.FALLBACK&&(this.state="DISCONNECTED"),this.reset()}}async publish(e,t,i){if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));const n={state:"offer",p2p_id:this.store.p2pId,ortc:t,mode:this.spec.mode,extend:cb("PUB_EXTEND")};try{return(await this.signal.request(HL.PUBLISH,n,!0))._message}catch(n){if(i&&n.data&&n.data.code===VL.ERR_PUBLISH_REQUEST_INVALID)return mw.warning("[".concat(this.store.clientId,"] receive publish error code, retry"),n.toString()),xw("warning",this,"receive publish error code, retry, ".concat(n.toString())),await this.tryUnpubBeforeRepub(e,t),this.publish(e,t,!1);throw n}}async unpublish(e,t){try{if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await this.signal.request(HL.UNPUBLISH,{stream_id:t,ortc:e},!0)}catch(e){mw.warning("unpublish warning: ",e),Yw("warning",this,"unpublish",void 0,e.toString())}}async subscribe(e,t,i){if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not subscribe when connection state is ".concat(this.state));const n={stream_id:e,stream_type:t.stream_type,mode:this.spec.mode,codec:this.spec.codec,p2p_id:this.store.p2pId,tcc:!!cb("SUBSCRIBE_TCC"),extend:cb("SUB_EXTEND"),ssrcId:t.ssrcId};try{return(await this.signal.request(HL.SUBSCRIBE,n,!0))._message}catch(n){if(i&&n.data&&n.data.code===VL.ERR_SUBSCRIBE_REQUEST_INVALID)return mw.warning("[".concat(this.store.clientId,"] receiver subscribe error code, retry"),n.toString()),xw("warning",this,"receiver subscribe error code, retry"),await this.tryUnsubBeforeResub(e,t),await this.subscribe(e,t,!1);throw n}}async subscribeAll(e,t){if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not massSubscribe when connection state is ".concat(this.state));const i={p2p_id:this.store.p2pId,users:e,dtx:!1};try{return await this.signal.request(HL.SUBSCRIBE_STREAMS,i,!0)}catch(i){if(t&&i.data&&i.data.code===VL.ERR_SUBSCRIBE_REQUEST_INVALID)return mw.warning("[".concat(this.store.clientId,"] receiver massSubscribe error code, retry"),i.toString()),xw("warning",this,"receiver massSubscribe error code, retry"),await this.tryMassUnsubBeforeResub(e),await this.subscribeAll(e,!1);throw i}}async setVideoProfile(e){const t=function(e){if(!(e.bitrateMax&&e.bitrateMin&&e.frameRate&&e.height&&e.width))return;let t=e.frameRate,i=e.width,n=e.height,r=!0;return"number"!=typeof t&&(t=t.exact||t.ideal||t.max||t.min||0,t||(r=!1)),"number"!=typeof i&&(i=i.exact||i.ideal||i.max||i.min||0,i||(r=!1)),"number"!=typeof n&&(n=n.exact||n.ideal||n.max||n.min||0,t||(r=!1)),r?{stream_type:0,width:i,height:n,fps:t,start_bps:1e3*e.bitrateMax,min_bps:1e3*e.bitrateMin,target_bps:1e3*e.bitrateMax}:void 0}(e);return t?this.signal.request(HL.SET_VIDEO_PROFILE,t):(mw.debug("[".concat(this.store.clientId,"] encoder config is not complete, do not report to gateway")),void xw("debug",this,"encoder config is not complete, do not report to gateway"))}async unsubscribe(e,t){try{await this.signal.request(HL.UNSUBSCRIBE,{p2p_id:this.store.p2pId,ortc:e,stream_id:t},!0)}catch(e){mw.warning("unsubscribe warning: ",e),Yw("warning",this,"unsubscribe",void 0,e.toString())}}async massUnsubscribe(e){try{await this.signal.request(HL.UNSUBSCRIBE_STREAMS,e,!0)}catch(e){mw.warning("unsubscribeAll warning: ",e),Yw("warning",this,"unsubscribeAll",void 0,e.toString())}}async reconnectPC(e){const{iceParameters:t,dtlsParameters:i,rtpCapabilities:n}=e,r=await this.signal.request(HL.CONNECT_PC,{p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:{iceParameters:t,dtlsParameters:i,rtpCapabilities:n}},!0),o=this.getGatewayIpPort();return{gatewayEstablishParams:r,gatewayIP:null==o?void 0:o.ip,gatewayPort:null==o?void 0:o.port}}getGatewayInfo(){return this.signal.request(HL.GATEWAY_INFO)}renewToken(e){return this.signal.request(HL.RENEW_TOKEN,e)}async setClientRole(e,t){if(t&&(this._clientRoleOptions=Object.assign({},t)),"CONNECTED"!==this.state)return void(this.role=e);let i;i="audience"===e?this._clientRoleOptions&&this._clientRoleOptions.level?this._clientRoleOptions.level:2:0,await this.signal.request(HL.SET_CLIENT_ROLE,{role:e,level:i}),this.role=e}async setRemoteVideoStreamType(e,t){await this.signal.request(HL.SWITCH_VIDEO_STREAM,{stream_id:e,stream_type:t})}async setDefaultRemoteVideoStreamType(e){await this.signal.request(HL.DEFAULT_VIDEO_STREAM,{stream_type:e})}async setStreamFallbackOption(e,t){await this.signal.request(HL.SET_FALLBACK_OPTION,{stream_id:e,fallback_type:t})}async pickSVCLayer(e,t){await this.signal.request(HL.PICK_SVC_LAYER,{stream_id:e,spatial_layer:t.spatialLayer,temporal_layer:t.temporalLayer})}getInChannelInfo(){return this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt),aW({},this.inChannelInfo)}async getGatewayVersion(){return(await this.signal.request(HL.GATEWAY_INFO)).version}reset(){if(this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt,this.inChannelInfo.joinAt=null),this.trafficStatsInterval&&(window.clearInterval(this.trafficStatsInterval),this.trafficStatsInterval=void 0),this.joinInfo){const e=cW.get(this.joinInfo.cname);e&&e.delete(this.joinInfo.uid)}this.joinInfo=void 0,this.key=void 0,this.networkQualityInterval&&(window.clearInterval(this.networkQualityInterval),this.networkQualityInterval=void 0)}updateTurnConfigFromSignal(){if(!this.joinInfo)return;const e=function(e){const t=e.match(/(wss\:\/\/)?([^:]+):(\d+)/);return t?{username:Zw.username,password:Zw.password,turnServerURL:t[2],tcpport:parseInt(t[3])+30,udpport:parseInt(t[3])+30,forceturn:!1}:null}(("disabled"===this.joinInfo.cloudProxyServer?this.signal.url:this.joinInfo.gatewayAddrs[this.signal.currentURLIndex].address)||"");this.joinInfo.turnServer.serversFromGateway=[],e&&"off"!==this.joinInfo.turnServer.mode&&"disabled"===this.joinInfo.cloudProxyServer&&this.joinInfo.turnServer.serversFromGateway.push(aW(aW({},Zw),{},{turnServerURL:e.turnServerURL,tcpport:e.tcpport,udpport:e.udpport,username:this.joinInfo.uid.toString(),password:this.joinInfo.token}))}async updateTrafficStats(){if("CONNECTED"!==this.state)return;const e=await this.signal.request(HL.TRAFFIC_STATS,void 0,!0);e.timestamp=Date.now(),e.peer_delay.forEach((e=>{const t=this._statsCollector.trafficStats&&this._statsCollector.trafficStats.peer_delay.find((t=>t.peer_uid===e.peer_uid));t&&t.B_st!==e.B_st&&BG((()=>{this.emit(mP.STREAM_TYPE_CHANGE,e.peer_uid,e.B_st)}))})),this._statsCollector.updateTrafficStats(e)}getJoinMessage(e){if(!this.joinInfo||!this.key)throw new pw(hw.UNEXPECTED_ERROR,"can not generate join message, no join info");const t=Object.assign({},this.joinInfo.apResponse);let i=cb("REPORT_APP_SCENARIO");if("string"!=typeof i)try{i=JSON.stringify(i)}catch(e){i=void 0}i&&i.length>128&&(i=void 0);const n=aW({p2p_id:this.store.p2pId,session_id:this.joinInfo.sid,app_id:this.joinInfo.appId,channel_key:this.key,channel_name:this.joinInfo.cname,sdk_version:Xw,browser:navigator.userAgent,process_id:cb("PROCESS_ID"),mode:this.spec.mode,codec:this.spec.codec,role:this.role,has_changed_gateway:this.hasChangeBGPAddress,ap_response:t,extend:cb("JOIN_EXTEND"),details:{6:this.joinInfo.stringUid,cservice_map:"proxy3"===this.joinInfo.cloudProxyServer?"1":"proxy5"===this.joinInfo.cloudProxyServer?"2":void 0},features:{rejoin:!0},optionalInfo:this.joinInfo.optionalInfo,appScenario:i,attributes:{userAttributes:{enablePublishedUserList:cb("ENABLE_PUBLISHED_USER_LIST"),maxSubscription:cb("MAX_SUBSCRIPTION")}}},e);return this.joinInfo.stringUid&&(n.string_uid=this.joinInfo.stringUid),this.joinInfo.aesmode&&this.joinInfo.aespassword&&(n.aes_mode=this.joinInfo.aesmode,cb("ENCRYPT_AES")?(n.aes_secret=this.joinInfo.aespassword,n.aes_encrypt=!0):n.aes_secret=this.joinInfo.aespassword,this.joinInfo.aessalt&&(n.aes_salt=this.joinInfo.aessalt)),t.addresses[this.signal.websocket.currentURLIndex]&&(n.ap_response.ticket=t.addresses[this.signal.websocket.currentURLIndex].ticket,delete t.addresses),void 0!==this.joinInfo.defaultVideoStream&&(n.default_video_stream=this.joinInfo.defaultVideoStream),n}getRejoinMessage(){if(!this.joinInfo)throw new pw(hw.UNEXPECTED_ERROR,"can not generate rejoin message, no join info");return{session_id:this.joinInfo.sid,channel_name:this.joinInfo.cname,cid:this.joinInfo.cid,uid:this.joinInfo.uid,vid:Number(this.joinInfo.vid)}}handleSignalEvents(){this.signal.on(YL.WS_RECONNECT_WAITTING_FINISH,(e=>{["tryNext","recover"].includes(e)&&this.joinInfo&&Px.adjustSessionStartTime(this.joinInfo.sid)})),this.signal.on(YL.WS_RECONNECT_CREATE_CONNECTION,(e=>{this.joinGatewayStartTime=Date.now()})),this.signal.on(YL.WS_RECONNECTING,(e=>{this.joinInfo&&Px.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:e||GL.NETWORK_ERROR}),this.joinInfo&&(this.state="RECONNECTING",Px.sessionInit(this.joinInfo.sid,{lts:(new Date).getTime(),extend:this.isSignalRecover?{recover:!0}:{rejoin:!0},cname:this.joinInfo.cname,appid:this.joinInfo.appId,mode:this.spec.mode}),this.isSignalRecover=!1,this.joinGatewayStartTime=Date.now())})),this.signal.on(YL.WS_CLOSED,(e=>{let t;switch(e){case xL.LEAVE:t=GL.LEAVE;break;case xL.UID_BANNED:case xL.IP_BANNED:case xL.CHANNEL_BANNED:case xL.SERVER_ERROR:t=GL.SERVER_ERROR;break;case xL.FALLBACK:t=GL.FALLBACK;break;default:t=GL.NETWORK_ERROR}mw.debug("[signal] websocket closed, reason: ".concat(t||"undefined -> "+GL.NETWORK_ERROR)),Fw("debug",this,"ws_closed","reason: ".concat(e)),this.joinInfo&&Px.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:e===xL.LEAVE?1:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:t}),this._disconnectedReason=e,e!==xL.FALLBACK&&(this.state="DISCONNECTED"),this.reset()})),this.signal.on(YL.WS_CONNECTED,(()=>{if(this.updateTurnConfigFromSignal(),this.state="CONNECTED",this.joinInfo&&("audience"===this.role&&this._clientRoleOptions&&this._clientRoleOptions.level&&(mw.debug("[".concat(this.store.clientId,"] patch to send set client role, role: ").concat(this.role,", mode: ").concat(this.spec.mode,", level: ").concat(this._clientRoleOptions&&this._clientRoleOptions.level)),xw("debug",this,"patch to send set client role, role: ".concat(this.role,", mode: ").concat(this.spec.mode,", level: ").concat(this._clientRoleOptions&&this._clientRoleOptions.level)),this.setClientRole(this.role,this._clientRoleOptions)),Px.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!0,ec:null,vid:this.joinInfo.vid,addr:this.signal.url,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer}),this._isProactiveJoin=!1,this.joinInfo.useLocalAccessPoint)){const e=this.signal.url&&this.signal.url.match(/wss\:\/\/([^:]+):(\d+)/);if(!e)return mw.error("[".concat(this.store.clientId,"] set local access point after joined failed: ").concat(e)),void xw("error",this,"set local access point after joined failed: ".concat(e));ab("EVENT_REPORT_DOMAIN",e[1]),ab("EVENT_REPORT_BACKUP_DOMAIN",e[1]),ab("LOG_UPLOAD_SERVER","".concat(e[1],":6444"))}})),this.signal.on(WL.ON_UPLINK_STATS,(e=>{this._statsCollector.updateUplinkStats(e)})),this.signal.on(YL.REQUEST_RECOVER,((e,t,i)=>{if(!this.joinInfo)return i(new pw(hw.UNEXPECTED_ERROR,"gateway: can not recover, no join info"));e&&(this.joinInfo.multiIP=e,this.hasChangeBGPAddress=!0),this.isSignalRecover=!0,bG(this,mP.REQUEST_NEW_GATEWAY_LIST).then(t).catch(i)})),this.signal.on(YL.REQUEST_JOIN_INFO,(async e=>{var t;this.updateTurnConfigFromSignal();const{iceParameters:i,dtlsParameters:n,rtpCapabilities:r}=await bG(this,mP.REQUEST_P2P_CONNECTION_PARAMS,{turnServer:null===(t=this.joinInfo)||void 0===t?void 0:t.turnServer});e(this.getJoinMessage({ortc:{iceParameters:i,dtlsParameters:n,rtpCapabilities:r,version:"2"}}))})),this.signal.on(YL.REQUEST_REJOIN_INFO,(e=>{e(this.getRejoinMessage())})),this.signal.on(YL.REPORT_JOIN_GATEWAY,((e,t)=>{this.joinInfo&&(Px.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!1,ec:e,addr:t,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer}),this._isProactiveJoin=!1)})),this.signal.on(YL.IS_P2P_DISCONNECTED,(e=>{e(kG(this,mP.IS_P2P_DISCONNECTED))})),this.signal.on(YL.DISCONNECT_P2P,(()=>{this.emit(mP.DISCONNECT_P2P)})),this.signal.on(YL.NEED_RENEW_SESSION,(()=>{this.emit(mP.NEED_RENEW_SESSION)})),this.signal.on(YL.REQUEST_SUCCESS,(()=>{this._signalTimeout=!1})),this.signal.on(YL.REQUEST_TIMEOUT,(()=>{this._signalTimeout=!0})),this.signal.on(YL.JOIN_RESPONSE,(e=>{const t=this.getGatewayIpPort();t?this.emit(mP.JOIN_RESPONSE,e,t.ip,t.port):this.emit(mP.JOIN_RESPONSE,e)}))}async tryUnsubBeforeResub(e,t){try{await this.signal.request(HL.UNSUBSCRIBE,{p2p_id:this.store.p2pId,stream_id:e,ortc:[t]},!0)}catch(t){throw mw.warning("unsubscribe warning",t),Yw("warning",this,"tryUnsubBeforeResub",e,t.toString()),t}}async tryUnpubBeforeRepub(e,t){try{await this.signal.request(HL.UNPUBLISH,{stream_id:e,ortc:t},!0)}catch(t){throw mw.warning("unpublish warning: ",t),Yw("warning",this,"tryUnpubBeforeRepub",e,t.toString()),t}}async tryMassUnsubBeforeResub(e){const t={users:e.map((e=>({stream_id:e.stream_id,stream_type:e.stream_type})))};try{await this.signal.request(HL.UNSUBSCRIBE_STREAMS,t,!0)}catch(t){throw mw.warning("massUnsubscribe warning",t),Yw("warning",this,"tryUnsubAllBeforeResub",e.map((e=>e.stream_id)),t.toString()),t}}async muteLocal(e,t){const i={action:e.find((e=>e.stream_type===TP.Audio))?"mute_local_audio":"mute_local_video",p2p_id:this.store.p2pId,ortc:e,stream_id:t};try{await this.signal.request(HL.CONTROL,i,!0,!0)}catch(e){throw mw.warning("gateway unmuteLocal warning: ",e),Yw("warning",this,"muteLocal",t,e.toString()),e}}async unmuteLocal(e,t){const i={action:e.find((e=>e.stream_type===TP.Audio))?"unmute_local_audio":"unmute_local_video",p2p_id:this.store.p2pId,ortc:e,stream_id:t};try{await this.signal.request(HL.CONTROL,i,!0,!0)}catch(e){throw mw.warning("gateway muteLocal warning: ",e),Yw("warning",this,"unmuteLocal",t,e.toString()),e}}uploadStats(e,t){this.signal.upload(e,t)}getSignalRTT(){return this.signal.rtt}async restartICE(e){const t={p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:e};try{const e=await this.signal.request(HL.RESTART_ICE,t,!0),i=this.getGatewayIpPort();return{restartICEResponse:e,gatewayIP:null==i?void 0:i.ip,gatewayPort:null==i?void 0:i.port}}catch(e){throw mw.warning("P2PChannel.restartICE warning: ",e),Yw("warning",this,"restartICE",void 0,e.toString()),e}}reconnect(){"CONNECTED"===this.state&&this.signal.reconnect(void 0,GL.P2P_FAILED)}getGatewayIpPort(){var e;if(!cb("GATEWAY_WSS_ADDRESS")&&null!==(e=this.joinInfo)&&void 0!==e&&e.gatewayAddrs){const e=this.joinInfo.gatewayAddrs[this.signal.currentURLIndex];return(e.ip||e.ip6)&&e.port?e.ip6?{ip:e.ip6,port:e.port}:{ip:e.ip,port:e.port}:void 0}}})||oW;function dW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function uW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}!function(){var t;function i(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n,r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,i){return e==Array.prototype||e==Object.prototype||(e[t]=i.value),e},o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof e&&e];for(var i=0;i<t.length;++i){var n=t[i];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var i=o;e=e.split(".");for(var n=0;n<e.length-1;n++){var s=e[n];if(!(s in i))break e;i=i[s]}(t=t(n=i[e=e[e.length-1]]))!=n&&null!=t&&r(i,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function c(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:i(e)}}if(s("Symbol",(function(e){function t(e,t){this.A=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.A};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",n=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(i+(r||"")+"_"+n++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var s=o[t[n]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&r(s.prototype,e,{configurable:!0,writable:!0,value:function(){return a(i(this))}})}return e})),"function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var A;e:{var d={};try{d.__proto__={a:!0},A=d.a;break e}catch(e){}A=!1}n=A?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var u=n;function E(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function l(e){if(e.m)throw new TypeError("Generator is already running");e.m=!0}function h(e,t){return e.h=3,{value:t}}function p(e){this.g=new E,this.G=e}function _(e,t,i,n){try{var r=t.call(e.g.j,i);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.m=!1,r;var o=r.value}catch(t){return e.g.j=null,e.g.s(t),I(e)}return e.g.j=null,n.call(e.g,o),I(e)}function I(e){for(;e.g.h;)try{var t=e.G(e.g);if(t)return e.g.m=!1,{value:t.value,done:!1}}catch(t){e.g.v=void 0,e.g.s(t)}if(e.g.m=!1,e.g.l){if(t=e.g.l,e.g.l=null,t.F)throw t.D;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function g(e){this.next=function(t){return e.o(t)},this.throw=function(t){return e.s(t)},this.return=function(t){return function(e,t){l(e.g);var i=e.g.j;return i?_(e,"return"in i?i.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),I(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(e,t){return t=new g(new p(t)),u&&e.prototype&&u(t,e.prototype),t}if(E.prototype.o=function(e){this.v=e},E.prototype.s=function(e){this.l={D:e,F:!0},this.h=this.C||this.u},E.prototype.return=function(e){this.l={return:e},this.h=this.u},p.prototype.o=function(e){return l(this.g),this.g.j?_(this,this.g.j.next,e,this.g.o):(this.g.o(e),I(this))},p.prototype.s=function(e){return l(this.g),this.g.j?_(this,this.g.j.throw,e,this.g.o):(this.g.s(e),I(this))},s("Array.prototype.entries",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var i=0,n=!1,r={next:function(){if(!n&&i<e.length){var r=i++;return{value:t(r,e[r]),done:!1}}return n=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}(this,(function(e,t){return[e,t]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var R=function(e,t){for(var i=0;i<e.length;i++)t(e[i])},C=function(e){return e.replace(/\r?\n|\r/g,"\r\n")},T=function(e,t,i){return t instanceof Blob?(i=void 0!==i?String(i+""):"string"==typeof t.name?t.name:"blob",t.name===i&&"[object Blob]"!==Object.prototype.toString.call(t)||(t=new File([t],i)),[String(e),t]):[String(e),String(t)]},m=function(e,t){if(e.length<t)throw new TypeError(t+" argument required, but only "+e.length+" present.")},S="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,O=S.FormData,v=S.XMLHttpRequest&&S.XMLHttpRequest.prototype.send,N=S.Request&&S.fetch,y=S.navigator&&S.navigator.sendBeacon,D=S.Element&&S.Element.prototype,w=S.Symbol&&Symbol.toStringTag;w&&(Blob.prototype[w]||(Blob.prototype[w]="Blob"),"File"in S&&!File.prototype[w]&&(File.prototype[w]="File"));try{new File([],"")}catch(e){S.File=function(e,t,i){return e=new Blob(e,i||{}),Object.defineProperties(e,{name:{value:t},lastModified:{value:+(i&&void 0!==i.lastModified?new Date(i.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),w&&Object.defineProperty(e,w,{value:"File"}),e}}var b=function(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},L=function(e){this.i=[];var t=this;e&&R(e.elements,(function(e){if(e.name&&!e.disabled&&"submit"!==e.type&&"button"!==e.type&&!e.matches("form fieldset[disabled] *"))if("file"===e.type){var i=e.files&&e.files.length?e.files:[new File([],"",{type:"application/octet-stream"})];R(i,(function(i){t.append(e.name,i)}))}else"select-multiple"===e.type||"select-one"===e.type?R(e.options,(function(i){!i.disabled&&i.selected&&t.append(e.name,i.value)})):"checkbox"===e.type||"radio"===e.type?e.checked&&t.append(e.name,e.value):(i="textarea"===e.type?C(e.value):e.value,t.append(e.name,i))}))};if((t=L.prototype).append=function(e,t,i){m(arguments,2),this.i.push(T(e,t,i))},t.delete=function(e){m(arguments,1);var t=[];e=String(e),R(this.i,(function(i){i[0]!==e&&t.push(i)})),this.i=t},t.entries=function e(){var t,i=this;return f(e,(function(e){if(1==e.h&&(t=0),3!=e.h)return t<i.i.length?e=h(e,i.i[t]):(e.h=0,e=void 0),e;t++,e.h=2}))},t.forEach=function(e,t){m(arguments,1);for(var i=c(this),n=i.next();!n.done;n=i.next()){var r=c(n.value);n=r.next().value,r=r.next().value,e.call(t,r,n,this)}},t.get=function(e){m(arguments,1);var t=this.i;e=String(e);for(var i=0;i<t.length;i++)if(t[i][0]===e)return t[i][1];return null},t.getAll=function(e){m(arguments,1);var t=[];return e=String(e),R(this.i,(function(i){i[0]===e&&t.push(i[1])})),t},t.has=function(e){m(arguments,1),e=String(e);for(var t=0;t<this.i.length;t++)if(this.i[t][0]===e)return!0;return!1},t.keys=function e(){var t,i,n=this;return f(e,(function(e){if(1==e.h&&(t=c(n),i=t.next()),3!=e.h)return i.done?void(e.h=0):h(e,c(i.value).next().value);i=t.next(),e.h=2}))},t.set=function(e,t,i){m(arguments,2),e=String(e);var n=[],r=T(e,t,i),o=!0;R(this.i,(function(t){t[0]===e?o&&(o=!n.push(r)):n.push(t)})),o&&n.push(r),this.i=n},t.values=function e(){var t,i,n,r,o=this;return f(e,(function(e){if(1==e.h&&(t=c(o),i=t.next()),3!=e.h)return i.done?void(e.h=0):(n=i.value,(r=c(n)).next(),h(e,r.next().value));i=t.next(),e.h=2}))},L.prototype._asNative=function(){for(var e=new O,t=c(this),i=t.next();!i.done;i=t.next()){var n=c(i.value);i=n.next().value,n=n.next().value,e.append(i,n)}return e},L.prototype._blob=function(){var e="----formdata-polyfill-"+Math.random(),t=[],i="--"+e+'\r\nContent-Disposition: form-data; name="';return this.forEach((function(e,n){return"string"==typeof e?t.push(i+b(C(n))+'"\r\n\r\n'+C(e)+"\r\n"):t.push(i+b(C(n))+'"; filename="'+b(e.name)+'"\r\nContent-Type: '+(e.type||"application/octet-stream")+"\r\n\r\n",e,"\r\n")})),t.push("--"+e+"--"),new Blob(t,{type:"multipart/form-data; boundary="+e})},L.prototype[Symbol.iterator]=function(){return this.entries()},L.prototype.toString=function(){return"[object FormData]"},D&&!D.matches&&(D.matches=D.matchesSelector||D.mozMatchesSelector||D.msMatchesSelector||D.oMatchesSelector||D.webkitMatchesSelector||function(e){for(var t=(e=(this.document||this.ownerDocument).querySelectorAll(e)).length;0<=--t&&e.item(t)!==this;);return-1<t}),w&&(L.prototype[w]="FormData"),v){var P=S.XMLHttpRequest.prototype.setRequestHeader;S.XMLHttpRequest.prototype.setRequestHeader=function(e,t){P.call(this,e,t),"content-type"===e.toLowerCase()&&(this.B=!0)},S.XMLHttpRequest.prototype.send=function(e){e instanceof L?(e=e._blob(),this.B||this.setRequestHeader("Content-Type",e.type),v.call(this,e)):v.call(this,e)}}N&&(S.fetch=function(e,t){return t&&t.body&&t.body instanceof L&&(t.body=t.body._blob()),N.call(this,e,t)}),y&&(S.navigator.sendBeacon=function(e,t){return t instanceof L&&(t=t._asNative()),y.call(this,e,t)}),S.FormData=L}}();let EW=1;let lW=1;function hW(e,t,i,n){let{url:r,areaCode:o}=e;Yw("debug",["AjaxAPI",t.clientId],"requestChooseServer",{url:r,areaCode:o});const s=Date.now(),[a,c]=gW(t,o,[WV.CHOOSE_SERVER]);let A=Sx.networkState;return gw((async()=>{A&&Sx.networkState===jP.OFFLINE&&Sx.onlineWaiter&&await Mm.race([Sx.onlineWaiter,SG(n&&n.maxRetryTimeout||_w.maxRetryTimeout)]),A=Sx.networkState;const e=await Tx(r,{data:a,cancelToken:i,headers:{"Content-Type":"multipart/form-data;"}},!0);Px.reportResourceTiming(r,t.sid),_W(e,r,t,s,[WV.CHOOSE_SERVER]);const o=IG(e,WV.CHOOSE_SERVER);return IW(o),EG(o,r)}),(e=>(e&&Px.joinChooseServer(t.sid,{lts:s,succ:!0,csAddr:r,opid:c,serverList:e.gatewayAddrs.map((e=>e.address)),ec:null,cid:e.cid.toString(),uid:e.uid.toString(),csIp:e.csIp,unilbsServerIds:[WV.CHOOSE_SERVER].toString()}),!1)),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.CAN_NOT_GET_GATEWAY_SERVER?e.data.retry:(Px.joinChooseServer(t.sid,{lts:s,succ:!1,csAddr:r,serverList:null,opid:c,ec:e.code,csIp:e.data&&e.data.csIp,unilbsServerIds:[WV.CHOOSE_SERVER].toString(),extend:JSON.stringify({networkState:A})}),mw.warning("[".concat(t.clientId,"] Choose server network error, retry"),e),xw("warning",["AjaxAPI",t.clientId],"Choose server network error, retry, ".concat(e)),!0))),n)}function pW(e,t,i,n){let{url:r,areaCode:o,serviceIds:s}=e;Yw("debug",["AjaxAPI",t.clientId],"requestMultiUnilbs",{url:r,areaCode:o,serviceIds:s});const a=Date.now(),[c,A]=gW(t,o,s);let d;return gw((async()=>{d&&Sx.networkState===jP.OFFLINE&&Sx.onlineWaiter&&await Mm.race([Sx.onlineWaiter,SG(n&&n.maxRetryTimeout||_w.maxRetryTimeout)]),d=Sx.networkState;const e=await Tx(r,{data:c,cancelToken:i,headers:{"Content-Type":"multipart/form-data;"}},!0);Px.reportResourceTiming(r,t.sid),_W(e,r,t,a,s);const o=IG(e,WV.CHOOSE_SERVER),A=IG(e,"proxy5"===t.cloudProxyServer?WV.CLOUD_PROXY_5:"proxy3"===t.cloudProxyServer||"proxy4"===t.cloudProxyServer?WV.CLOUD_PROXY:WV.CLOUD_PROXY_FALLBACK);return IW(o),{gatewayInfo:EG(o,r),proxyInfo:A,url:r}}),(e=>(e.gatewayInfo&&Px.joinChooseServer(t.sid,{lts:a,succ:!0,csAddr:r,serverList:e.gatewayInfo.gatewayAddrs.map((e=>e.address)),ec:null,opid:A,cid:e.gatewayInfo.cid.toString(),uid:e.gatewayInfo.uid.toString(),csIp:e.gatewayInfo.csIp,unilbsServerIds:s.toString()}),e.proxyInfo&&Px.joinWebProxyAP(t.sid,{lts:a,sucess:1,apServerAddr:r,turnServerAddrList:e.proxyInfo.addresses.map((e=>e.ip)).join(","),errorCode:null,eventType:t.cloudProxyServer,unilbsServerIds:s.toString()}),!1)),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.CAN_NOT_GET_GATEWAY_SERVER?e.data.retry:(Px.joinWebProxyAP(t.sid,{lts:a,sucess:0,apServerAddr:r,turnServerAddrList:null,errorCode:e.code,eventType:t.cloudProxyServer,unilbsServerIds:s.toString(),extend:JSON.stringify({networkState:d})}),mw.warning("[".concat(t.clientId,"] multi unilbs network error, retry"),e),xw("warning",["AjaxAPI",t.clientId],"multi unilbs network error, retry, ".concat(e)),!0))),n)}const _W=(e,t,i,n,r)=>{const o=[],s=o=>{4096===o.flag?Px.joinChooseServer(i.sid,{lts:n,succ:!1,csAddr:t,opid:e.opid,serverList:null,ec:o.error.message,csIp:o.error.data&&o.error.data.csIp,unilbsServerIds:r.toString()}):1048576!==o.flag&&4194304!==o.flag&&4194310!==o.flag||Px.joinWebProxyAP(i.sid,{lts:n,sucess:0,apServerAddr:t,turnServerAddrList:null,errorCode:o.error.code,eventType:i.cloudProxyServer,unilbsServerIds:r.toString()})};if(e.response_body.forEach((t=>{const i=t.buffer.code;if(23===t.uri&&0===i&&!t.buffer.edges_services)if(4194310===t.buffer.flag)mw.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers"),t.buffer.edges_services=[];else{const i={error:new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,"no edge services in ap response",{retry:!0,csIp:e.detail[502]}),flag:t.buffer.flag};o.push(i),s(i)}if(0!==i){const n=VK(i),r={error:new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,n.desc,{retry:n.retry,csIp:e.detail[502]}),flag:t.buffer.flag};4194310===t.buffer.flag?mw.warning(r.error.toString()):o.push(r),s(r)}})),o.length)throw mw.warning("[".concat(i.clientId,"] multi unilbs ").concat(t," failed, ").concat(o.map((e=>"flag: ".concat(e.flag,", message: ").concat(e.error.message,", retry: ").concat(e.error.data.retry))).join(" | "))),Yw("warning",["AjaxAPI",i.clientId],"checkMultiUnilbsResponseValid",{url:t},o.map((e=>({flag:e.flag,message:e.error.message,retry:e.error.data.retry})))),new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,o.map((e=>"flag: ".concat(e.flag,", message: ").concat(e.error.message))).join(" | "),{retry:!!o.find((e=>e.error.data.retry)),csIp:e.detail[502]})},IW=e=>{if(e.addresses&&0===e.addresses.length&&0===e.code)throw new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,"void gateway address",{retry:!0,csIp:e.detail&&e.detail[502]});if(cb("GATEWAY_ADDRESS")&&cb("GATEWAY_ADDRESS").length>0){mw.debug("assign gateway address to",cb("GATEWAY_ADDRESS")),xw("debug",["AjaxAPI"],"assign gateway address to ".concat(JSON.stringify(cb("GATEWAY_ADDRESS"))));const t=cb("GATEWAY_ADDRESS").map((t=>({ip:t.ip,port:t.port,ticket:e.addresses[0]&&e.addresses[0].ticket})));e.addresses=t}},gW=(e,t,i)=>{const n=Math.floor(Math.random()*10**12),r={appid:e.appId,client_ts:Date.now(),opid:n,sid:e.sid,request_bodies:[{uri:22,buffer:{cname:e.cname,detail:{6:e.stringUid,11:t,12:cb("USE_NEW_TOKEN")?"1":void 0},key:e.token,service_ids:i,uid:e.uid||0}}]};r.request_bodies.forEach((t=>{e.multiIP&&e.multiIP.gateway_ip&&(t.buffer.detail[5]=JSON.stringify({vocs_ip:[e.multiIP.uni_lbs_ip],vos_ip:[e.multiIP.gateway_ip]}))}));const o=new FormData;return o.append("request",JSON.stringify(r)),[o,n]},fW=()=>{const e=cb("AREAS");return 0===e.length&&e.push(bP.GLOBAL),dE(e).call(e,((e,t,i)=>{const n=RW(t);return n?0===i?n:"".concat(e,",").concat(n):e}),"")},RW=e=>e===bP.OVERSEA?"".concat(MP.ASIA,",").concat(MP.EUROPE,",").concat(MP.AFRICA,",").concat(MP.NORTH_AMERICA,",").concat(MP.SOUTH_AMERICA,",").concat(MP.OCEANIA):MP[e],CW={GLOBAL:{ASIA:[bP.CHINA,bP.JAPAN,bP.INDIA,bP.KOREA,bP.HKMC],EUROPE:[],NORTH_AMERICA:[bP.US],SOUTH_AMERICA:[],OCEANIA:[],AFRICA:[]}},TW=Object.keys(CW[bP.GLOBAL]),mW=[bP.CHINA,bP.NORTH_AMERICA,bP.EUROPE,bP.ASIA,bP.JAPAN,bP.INDIA,bP.OCEANIA,bP.SOUTH_AMERICA,bP.AFRICA,bP.KOREA,bP.HKMC,bP.US];async function SW(e,t,i){const n=async function(e,t,i){const n=cb("WEBCS_DOMAIN").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((t=>({url:e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v2/transpond/webrtc?v=2"):"https://".concat(t,"/api/v2/transpond/webrtc?v=2"),areaCode:fW()})));let r=null;const o=[],s=async()=>await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to choose_server:"),n.url),hW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:o}),a=async()=>{if(await SG(1e3),null!==r)return r;const n=cb("WEBCS_DOMAIN_BACKUP_LIST").map((t=>({url:e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v2/transpond/webrtc?v=2"):"https://".concat(t,"/api/v2/transpond/webrtc?v=2"),areaCode:fW()})));return await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to backup choose_server:"),n.url),hW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:o})};try{return r=await wG([s(),a()]),o.length&&o.forEach((e=>e.cancel&&"function"==typeof e.cancel&&e.cancel())),r}catch(e){throw e[0]}}(e,t,i);return{gatewayInfo:await n}}async function OW(e,t,i,n){const r=e.cloudProxyServer;if("disabled"===r){if(!n)return;if(e.useLocalAccessPoint)return await SW(e,t,i);if(cb("JOIN_WITH_FALLBACK_MEDIA_PROXY")){const{gatewayInfo:n,proxyInfo:r}=await yW(e,t,i);return e.turnServer&&"auto"!==e.turnServer.mode?(xw("debug",["Server",e.clientId],"do not set fallback turn because of already having turnserver"),{gatewayInfo:n}):(e.turnServer={mode:"manual",servers:r.map((e=>({turnServerURL:e.address,tcpport:e.tcpport||Zw.tcpport,udpport:e.udpport||Zw.udpport,username:e.username||Zw.username,password:e.password||Zw.password,forceturn:cb("JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE"),security:!0})))},{gatewayInfo:n})}return await SW(e,t,i)}let o;if(["443only","normal"].includes(r)){let s;n?"normal"!==r?[s,o]=await Mm.all([NW(e,t,i),SW(e,t,i)]):(s=await NW(e,t,i),e.proxyServer=s.addresses[0],Px.setProxyServer(e.proxyServer),mw.setProxyServer(e.proxyServer),Qw(e.proxyServer),o=await SW(e,t,i)):(o=void 0,"normal"!==r?s=await NW(e,t,i):(s=await NW(e,t,i),e.proxyServer=s.addresses[0],Px.setProxyServer(e.proxyServer),mw.setProxyServer(e.proxyServer),Qw(e.proxyServer))),e.turnServer={mode:"manual",servers:s.addresses.map((e=>({turnServerURL:e,tcpport:s.serverResponse.tcpport?s.serverResponse.tcpport:Zw.tcpport,udpport:s.serverResponse.udpport?s.serverResponse.udpport:Zw.udpport,username:s.serverResponse.username||Zw.username,password:s.serverResponse.password||Zw.password,forceturn:!0,security:!1})))}}else{const{proxyInfo:n,gatewayInfo:s}=await yW(e,t,i);o={gatewayInfo:s},e.turnServer={mode:"manual",servers:n.map((e=>({turnServerURL:e.address,tcpport:"proxy3"===r?void 0:e.tcpport?e.tcpport:Zw.tcpport,udpport:"proxy4"===r?void 0:e.udpport?e.udpport:Zw.udpport,username:e.username||Zw.username,password:e.password||Zw.password,forceturn:"proxy4"!==r,security:"proxy5"===r})))}}return mw.debug("[".concat(e.clientId,"] set proxy server: ").concat(e.proxyServer,", mode: ").concat(r)),Yw("debug",["Server",e.clientId],"setCloudProxyServerAndGetServerInfo",{proxyServer:e.proxyServer,mode:e.cloudProxyServer}),o}async function vW(e,t,i,n){const r=cb("ACCOUNT_REGISTER").slice(0,cb("AJAX_REQUEST_CONCURRENT"));let o=[];return o=t.proxyServer?r.map((e=>"https://".concat(t.proxyServer,"/ap/?url=").concat(e+"/api/v1"))):r.map((e=>"https://".concat(e,"/api/v1"))),(await async function(e,t,i,n,r){const o=Date.now(),s={sid:i.sid,opid:10,appid:i.appId,string_uid:t};let a=e[0];const c=await gw((()=>Tx(a+"".concat(-1===a.indexOf("?")?"?":"&","action=stringuid"),{data:s,cancelToken:n,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":72}})),((i,n)=>{if(0===i.code){if(i.uid<=0||i.uid>=Math.pow(2,32))throw mw.error("Invalid Uint Uid ".concat(t," => ").concat(i.uid),i),Yw("error",["AjaxAPI"],"requestUserAccount","Invalid Uint Uid ".concat(t," => ").concat(i.uid,", ").concat(i)),Px.reqUserAccount(s.sid,{lts:o,success:!1,serverAddr:a,stringUid:s.string_uid,uid:i.uid,errorCode:hw.INVALID_UINT_UID_FROM_STRING_UID,extend:s}),new pw(hw.INVALID_UINT_UID_FROM_STRING_UID);return Px.reqUserAccount(s.sid,{lts:o,success:!0,serverAddr:a,stringUid:s.string_uid,uid:i.uid,errorCode:null,extend:s}),!1}const r=VK(i.code);return r.retry&&(a=e[(n+1)%e.length]),Px.reqUserAccount(s.sid,{lts:o,success:!1,serverAddr:a,stringUid:s.string_uid,uid:i.uid,errorCode:r.desc,extend:s}),r.retry}),((t,i)=>t.code!==hw.OPERATION_ABORTED&&(Px.reqUserAccount(s.sid,{lts:o,success:!1,serverAddr:a,stringUid:s.string_uid,uid:null,errorCode:t.code,extend:s}),a=e[(i+1)%e.length],!0)),r);if(0!==c.code){const e=VK(c.code);throw new pw(hw.UNEXPECTED_RESPONSE,e.desc)}return c}(o,e,t,i,n)).uid}async function NW(e,t,i){let n=Date.now();const r=e.cloudProxyServer,o=cb("normal"===r?"PROXY_CS":"WEBCS_DOMAIN").map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v1"):"https://".concat(t,"/api/v1")));if(["proxy3","proxy4","proxy5"].includes(r)){const n=o.map((e=>({url:e,areaCode:fW()})));let r=null;r=await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>function(e,t,i,n){let{url:r,areaCode:o}=e;const s=Date.now(),a={opid:133,flag:"proxy5"===t.cloudProxyServer?4194304:1048576,ts:+new Date,key:t.token,cname:t.cname,sid:t.sid,detail:{6:t.stringUid,11:o},uid:t.uid||0};return gw((async()=>await Tx(r,{data:a,cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":69}})),(e=>{if(0===e.code)return Px.joinWebProxyAP(t.sid,{lts:s,sucess:1,apServerAddr:r,turnServerAddrList:e.addresses.map((e=>e.ip)).join(","),errorCode:null,eventType:t.cloudProxyServer}),!1;const i=VK(e.code);throw new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,i.desc,{retry:i.retry})}),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.CAN_NOT_GET_GATEWAY_SERVER?(Px.joinWebProxyAP(a.sid,{lts:s,sucess:0,apServerAddr:r,turnServerAddrList:null,errorCode:e.code,eventType:t.cloudProxyServer}),mw.warning("[".concat(t.clientId,"] proxy ap server ").concat(r," failed, message: ").concat(e.message,", retry: ").concat(e.data.retry)),xw("warning",["AjaxAPI",t.clientId],"proxy ap server ".concat(r," failed, message: ").concat(e.message,", retry: ").concat(e.data.retry)),e.data.retry):(Px.joinWebProxyAP(a.sid,{lts:s,sucess:0,apServerAddr:r,turnServerAddrList:null,errorCode:e.code,eventType:t.cloudProxyServer}),!0))),n)}(n,e,t,i),allFailedhandler:()=>{throw mw.error("[".concat(e.clientId,"] can not get proxy server after trying several times")),new pw(hw.CAN_NOT_GET_PROXY_SERVER)}});const s=r.addresses;if(!s||0===s.length)throw mw.error("[".concat(e.clientId,"] can not get proxy server, empty proxy server list")),new pw(hw.CAN_NOT_GET_PROXY_SERVER,"empty proxy server list");return{addresses:s.map((e=>e.ip)).map(uG),serverResponse:{tcpport:s[0].port||443,udpport:s[0].port||Zw.udpport,username:Zw.username,password:Zw.password}}}let s=null;s=await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:o,asyncMapHandler:n=>function(e,t,i,n){const r=Date.now(),o={command:"convergeAllocateEdge",sid:t.sid,appId:t.appId,token:t.token,uid:t.uid,cname:t.cname,ts:Math.floor(Date.now()/1e3),version:Xw,seq:0,requestId:1};return gw((async()=>({res:await Tx(e,{data:{service_name:"webrtc_proxy",json_body:JSON.stringify(o)},cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":61}}),url:e})),(e=>{if(!e.res.json_body)throw mw.debug("[".concat(t.clientId,"] Get proxy server failed: no json_body")),Yw("error",["AjaxAPI",t.clientId],"requestProxyServerList","Get proxy server failed: no json_body"),new pw(hw.UNEXPECTED_RESPONSE,JSON.stringify(e.res));const i=JSON.parse(e.res.json_body);if(200!==i.code)throw mw.debug("[".concat(t.clientId,"] Get proxy server failed: response code [").concat(i.code,"], reason [").concat(i.reason,"]")),Yw("error",["AjaxAPI",t.clientId],"requestProxyServerList","Get proxy server failed: response code [".concat(i.code,"], reason [").concat(i.reason,"]")),new pw(hw.UNEXPECTED_RESPONSE,JSON.stringify(e.res));return mw.debug("[".concat(t.clientId,"] App return server length"),i.servers.length),Yw("debug",["AjaxAPI",t.clientId],"requestProxyServerList","",{length:i.servers.length}),!1}),(t=>t.code!==hw.OPERATION_ABORTED&&(Px.requestProxyAppCenter(o.sid,{lts:r,succ:!1,APAddr:e,workerManagerList:null,ec:t.code,response:t.message}),!0)),n)}(n,e,t,i),allFailedhandler:()=>{throw mw.error("[".concat(e.clientId,"] can not get proxy server after trying several times")),new pw(hw.CAN_NOT_GET_PROXY_SERVER)}});const a=JSON.parse(s.res.json_body).servers.map(dG);if("443only"===e.cloudProxyServer)return{addresses:a,serverResponse:{tcpport:443,udpport:Zw.udpport,username:Zw.username,password:Zw.password}};Px.requestProxyAppCenter(e.sid,{lts:n,succ:!0,APAddr:s.url,workerManagerList:JSON.stringify(a),ec:null,response:JSON.stringify(s.res)}),n=Date.now();const c=a.map((n=>function(e,t,i,n){const r=Date.now();let o=e;e.startsWith("http")||(o="https://".concat(e,":4000/v2/machine"));const s={command:"request",gatewayType:"http",appId:t.appId,cname:t.cname,uid:(t.uid||"").toString(),sdkVersion:"2.3.1",sid:t.sid,seq:1,ts:Date.now(),requestId:3,clientRequest:{appId:t.appId,cname:t.cname,uid:(t.uid||"").toString(),sid:t.sid}};return gw((async()=>({res:await Tx(o,{data:s,cancelToken:i}),url:e})),(e=>{if(!e.res.serverResponse)throw new pw(hw.UNEXPECTED_RESPONSE,"requeet worker manager server failed: serverResponse is undefined");return!1}),(t=>t.code!==hw.OPERATION_ABORTED&&(Px.requestProxyWorkerManager(s.sid,{lts:r,succ:!1,workerManagerAddr:e,ec:t.code,response:t.message}),!0)),n)}(n,e,t,i)));let A=null;try{A=await wG(c)}catch(t){throw mw.error("[".concat(e.clientId,"] can not get worker manager after trying several times")),new pw(hw.CAN_NOT_GET_PROXY_SERVER)}return c.forEach((e=>e.cancel())),Px.requestProxyWorkerManager(e.sid,{lts:n,succ:!0,workerManagerAddr:A.url,ec:null,response:JSON.stringify(A.res)}),{addresses:[A.url],serverResponse:A.res.serverResponse}}async function yW(e,t,i){const n=cb("PROXY_SERVER_TYPE3"),r=(e,t)=>{let i=n;return Array.isArray(i)&&(i=t%2==0?n[1]:n[0]),"https://".concat(i,"/ap/?url=").concat(e)},o=cb("WEBCS_DOMAIN").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map(((t,i)=>({url:"disabled"===e.cloudProxyServer||"fallback"===e.cloudProxyServer?"https://".concat(t,"/api/v2/transpond/webrtc?v=2"):r("".concat(t,"/api/v2/transpond/webrtc?v=2"),i),areaCode:fW(),serviceIds:[WV.CHOOSE_SERVER,"proxy5"===e.cloudProxyServer?WV.CLOUD_PROXY_5:"proxy3"===e.cloudProxyServer||"proxy4"===e.cloudProxyServer?WV.CLOUD_PROXY:WV.CLOUD_PROXY_FALLBACK]})));let s=null;const a=[],c=async()=>await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:o,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to choose_server:"),n.url),pW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:a}),A=async()=>{if(await SG(1e3),null!==s)return s;const n=cb("WEBCS_DOMAIN_BACKUP_LIST").map(((t,i)=>({url:"disabled"===e.cloudProxyServer||"fallback"===e.cloudProxyServer?"https://".concat(t,"/api/v2/transpond/webrtc?v=2"):r("".concat(t,"/api/v2/transpond/webrtc?v=2"),i),areaCode:fW(),serviceIds:[WV.CHOOSE_SERVER,"proxy5"===e.cloudProxyServer?WV.CLOUD_PROXY_5:"proxy3"===e.cloudProxyServer||"proxy4"===e.cloudProxyServer?WV.CLOUD_PROXY:WV.CLOUD_PROXY_FALLBACK]})));return await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to backup choose_server:"),n.url),pW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:a})};let d,u,E;try{({gatewayInfo:d,proxyInfo:u,url:E}=await wG([c(),A()]))}catch(e){throw e[0]}if(a.length&&a.forEach((e=>e.cancel&&"function"==typeof e.cancel&&e.cancel())),!d||!u)throw new pw(hw.UNEXPECTED_ERROR,"missing gateway or proxy response").print();if(e.apUrl=E,"disabled"!==e.cloudProxyServer&&Array.isArray(n)&&E){const t=new UK(E).host;n.includes(t)&&(e.proxyServer=t,mw.setProxyServer(t),Px.setProxyServer(t),Qw(t))}return s={gatewayInfo:d,proxyInfo:await gG(u,d.uid)},s}async function DW(e,t,i,n){const r=cb("UAP_AP").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((e=>t.proxyServer?"https://".concat(t.proxyServer,"/ap/?url=").concat(e+"/api/v1?action=uap"):"https://".concat(e,"/api/v1?action=uap")));return await function(e,t,i,n,r){EW+=1;const o={sid:i.sid,command:"convergeAllocateEdge",uid:"666",appId:i.appId,ts:Math.floor(Date.now()/1e3),seq:EW,requestId:EW,version:Xw,cname:i.cname},s={service_name:t,json_body:JSON.stringify(o)};let a,c,A=e[0];return gw((async()=>{a=Date.now();const e=await Tx(A,{data:s,cancelToken:n,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"}});if(c=Date.now()-a,0!==e.code){const t=new pw(hw.UNEXPECTED_RESPONSE,"live streaming ap error, code"+e.code,{retry:!0,responseTime:c});throw mw.error(t.toString()),Yw("error",["AjaxAPI"],"requestLiveStreamingWorkerManager",void 0,t.toString()),t}const i=JSON.parse(e.json_body);if(200!==i.code){const e=new pw(hw.UNEXPECTED_RESPONSE,"live streaming app center error, code: ".concat(i.code,", reason: ").concat(i.reason),{code:i.code,responseTime:c});throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestLiveStreamingWorkerManager",void 0,e.toString()),e}if(!i.servers||0===i.servers.length){const e=new pw(hw.UNEXPECTED_RESPONSE,"live streaming app center empty server",{code:i.code,responseTime:c});throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestLiveStreamingWorkerManager",void 0,e.toString()),e}const r=function(e,t){return{addressList:e.servers.map((e=>"wss://".concat(e.address.replace(/\./g,"-"),".").concat(cb("WORKER_DOMAIN"),":").concat(e.wss,"?serviceName=").concat(encodeURIComponent(t)))),workerToken:e.workerToken,vid:e.vid}}(i,t);return cb("LIVE_STREAMING_ADDRESS")&&(r.addressList=cb("LIVE_STREAMING_ADDRESS")instanceof Array?cb("LIVE_STREAMING_ADDRESS"):[cb("LIVE_STREAMING_ADDRESS")]),uW(uW({},r),{},{responseTime:c})}),((n,r)=>(Px.apworkerEvent(i.sid,{success:!0,sc:200,serviceName:t,responseDetail:JSON.stringify(n.addressList),firstSuccess:0===r,responseTime:c,serverIp:e[r%e.length]}),!1)),((n,r)=>(Px.apworkerEvent(i.sid,{success:!1,sc:n.data&&n.data.code||200,serviceName:t,responseTime:c,serverIp:e[r%e.length]}),!!(n.code!==hw.OPERATION_ABORTED&&n.code!==hw.UNEXPECTED_RESPONSE||n.data&&n.data.retry)&&(A=e[(r+1)%e.length],!0))),r)}(r,e,t,i,n)}async function wW(e,t,i){let n=null;const r=[],o=async o=>{const s=cb(o?"WEBCS_DOMAIN_BACKUP_LIST":"WEBCS_DOMAIN").map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v2/transpond/webrtc?v=2"):"https://".concat(t,"/api/v2/transpond/webrtc?v=2")));return o&&(await SG(1e3),null!==n)?n:await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:s,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] update ticket, Connect to ").concat(o?"backup":""," choose_server:"),n),function(e,t,i,n){const[r]=((e,t)=>{const i=Math.floor(Math.random()*10**12),n={appid:e.appId,client_ts:Date.now(),opid:i,sid:e.sid,request_bodies:[{uri:28,buffer:{cname:e.cname,detail:{1:"",6:e.stringUid,12:"1"},token:e.token,service_ids:t,uid:e.uid||0,edges_services:e.apResponse.addresses.map((e=>({ip:e.ip,port:e.port})))}}]},r=new FormData;return r.append("request",JSON.stringify(n)),[r,i]})(t,[WV.CHOOSE_SERVER]);let o=Sx.networkState;return gw((async()=>{o&&Sx.networkState===jP.OFFLINE&&Sx.onlineWaiter&&await Mm.race([Sx.onlineWaiter,SG(n&&n.maxRetryTimeout||_w.maxRetryTimeout)]),o=Sx.networkState;return((e,t)=>{if(e.response_body&&e.response_body.length){const t=e.response_body[0];if(0!==t.buffer.code){const e=VK(t.buffer.code);throw new pw(hw.UPDATE_TICKET_FAILED,"[".concat(t.buffer.code,"]: ").concat(e.desc),{retry:e.retry})}return t.buffer.ticket}throw mw.debug("update ticket request received ap response without response body:",t),xw("debug",["AjaxAPI"],"update ticket request received ap response without response body: ".concat(t)),new pw(hw.UPDATE_TICKET_FAILED,"cannot find response body from ap response",{retry:!1})})(await Tx(e,{data:r,cancelToken:i,headers:{"Content-Type":"multipart/form-data;"}},!0),e)}),(()=>!1),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.UPDATE_TICKET_FAILED?e.data.retry:(mw.warning("[".concat(t.clientId,"] update ticket network error, retry"),e),xw("warning",["AjaxAPI",t.clientId],"update ticket network error, retry, ".concat(e)),!0))),n)}(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:r})};try{return n=await wG([o(!1),o(!0)]),r.length&&r.forEach((e=>e.cancel&&"function"==typeof e.cancel&&e.cancel())),n}catch(e){throw e[0]}}var bW;function LW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function PW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?LW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):LW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let kW=Ww("ConfigDistributeManager")(bW=class extends Ew{constructor(){super(),tD(this,"configs",void 0),tD(this,"joinInfo",void 0),tD(this,"cancelToken",void 0),tD(this,"retryConfig",{timeout:3e3,timeoutFactor:1.5,maxRetryCount:1,maxRetryTimeout:1e4}),tD(this,"interval",void 0),tD(this,"mutex",new Qx("config-distribute")),tD(this,"mutableParamsRead",!1)}startGetConfigDistribute(e,t){this.joinInfo=e,this.cancelToken=t,this.interval&&this.stopGetConfigDistribute(),this.updateConfigDistribute(),this.interval=window.setInterval((()=>{this.updateConfigDistribute()}),cb("CONFIG_DISTRIBUTE_INTERVAL"))}stopGetConfigDistribute(){this.interval&&clearInterval(this.interval),this.interval=void 0,this.joinInfo=void 0,this.cancelToken=void 0}async awaitConfigDistributeComplete(){this.mutex.isLocked&&(await this.mutex.lock())()}async updateConfigDistribute(){if(this.mutableParamsRead||(this.mutableParamsRead=!0,Px.reportApiInvoke(null,{options:void 0,name:wL.LOAD_CONFIG_FROM_LOCALSTORAGE,tag:bL.TRACER}).onSuccess(JSON.stringify(db))),!this.joinInfo||!this.cancelToken||!this.retryConfig)return mw.debug("[config-distribute] get config distribute interrupted have no joininfo"),void Yw("debug",this,"updateConfigDistribute",void 0,"get config distribute interrupted have no joininfo");let e;const t=await this.mutex.lock();try{e=await async function(e,t,i){const n=cb("CDS_AP").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v1"):"https://".concat(t,"/api/v1?action=config"))).map((n=>function(e,t,i,n){const r=Dy(),o={flag:64,cipher_method:0,features:{device:r.name,system:r.os,system_general:navigator.userAgent,vendor:t.appId,version:Xw,cname:t.cname,sid:t.sid,session_id:t.sid,detail:"",proxyServer:t.proxyServer}};return gw((()=>Tx(e,{data:o,timeout:1e3,cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":54}})),void 0,(e=>e.code!==hw.OPERATION_ABORTED),n)}(n,e,t,i)));let r=null,o=null,s={};try{r=await wG(n)}catch(e){if(e.code===hw.OPERATION_ABORTED)throw e;o=e}if(n.forEach((e=>e.cancel())),Px.reportApiInvoke(e.sid,{name:wL.REQUEST_CONFIG_DISTRIBUTE,options:{error:o,res:r}}).onSuccess(),r&&r.test_tags)try{s=function(e){if(!e.test_tags)return{};const t=e.test_tags,i=Object.keys(t),n={};return i.forEach((e=>{var i;const r=ly(i=e.slice(4)).call(i),o=JSON.parse(t[e])[1];n[r]=o})),n}(r)}catch(e){}return s}(this.joinInfo,this.cancelToken,this.retryConfig),mw.debug("[config-distribute] get config distribute",JSON.stringify(e)),Yw("debug",this,"updateConfigDistribute",e),e.limit_bitrate&&this.handleBitrateLimit(e.limit_bitrate),this.cacheGlobalParameterConfig(e),this.configs=e}catch(e){const t=new pw(hw.NETWORK_RESPONSE_ERROR,e);mw.warning("[config-distribute] ".concat(t.toString())),Yw("warning",this,"updateConfigDistribute",void 0,e.toString())}finally{t()}}getBitrateLimit(){return this.configs?this.configs.limit_bitrate:void 0}handleBitrateLimit(e){var t;(t=e)&&t.uplink&&t.id&&void 0!==t.uplink.max_bitrate&&void 0!==t.uplink.min_bitrate&&(this.configs&&this.configs.limit_bitrate?this.configs&&this.configs.limit_bitrate&&this.configs.limit_bitrate.id!==e.id&&this.emit(BP.UPDATE_BITRATE_LIMIT,e):this.emit(BP.UPDATE_BITRATE_LIMIT,e))}getLowStreamConfigDistribute(){return this.configs&&this.configs.limit_bitrate&&PW({},this.configs.limit_bitrate.low_stream_uplink)}cacheGlobalParameterConfig(e){var t;const i=AL(t=Object.keys(e).filter((e=>/^webrtc_ng_global_parameter/.test(e)))).call(t);for(let t=0;t<i.length;t++)for(let n=i.length-1;n>t;n--){const t=i[n];if("number"==typeof e[t].__priority){const r=e[t].__priority,o=i[n-1];if("number"==typeof e[o].__priority){if(!(r>e[o].__priority))continue;{const e=t;i[n]=i[n-1],i[n-1]=e}}else{const e=t;i[n]=i[n-1],i[n-1]=e}}}const n={};i.forEach((t=>{const i=e[t],r=i.__expires;Object.keys(i).forEach((e=>{"__priority"===e||"__expires"===e||Object.prototype.hasOwnProperty.call(n,e)||(n[e]=PW({value:i[e]},r&&{expires:r}))}))}));try{const e=JSON.stringify(n),t=window.btoa(e);window.localStorage.setItem("websdk_ng_global_parameter",t),mw.debug("Caching global parameters ".concat(e)),Yw("debug",this,"cacheGlobalParameterConfig",e)}catch(e){mw.error("Error caching global parameters:",e.message),Yw("error",this,"cacheGlobalParameterConfig",void 0,e.message)}}})||bW;function MW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function UW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?MW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):MW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class BW extends Ew{constructor(e,t,i,n){super(),tD(this,"spec",void 0),tD(this,"token",void 0),tD(this,"websocket",void 0),tD(this,"pingpongTimer",void 0),tD(this,"reconnectMode","retry"),tD(this,"serviceMode",void 0),tD(this,"reqId",0),tD(this,"commandReqId",0),tD(this,"handleWebSocketOpen",(()=>{this.reconnectMode="retry",this.startPingPong()})),tD(this,"handleWebSocketMessage",(e=>{if(!e.data)return;const t=JSON.parse(e.data);t.requestId?this.emit("@".concat(t.requestId,"-").concat(t.sid),t):this.serviceMode===aP.INJECT?this.emit(hP.INJECT_STREAM_STATUS,t):(Px.workerEvent(this.spec.sid,{actionType:"status",serverCode:t.code,workerType:this.serviceMode===aP.TRANSCODE?1:2}),this.emit(hP.PUBLISH_STREAM_STATUS,t))})),this.spec=t,this.token=e,this.serviceMode=n,this.websocket=new tW("live-streaming",i),this.websocket.on(sP.CONNECTED,this.handleWebSocketOpen),this.websocket.on(sP.ON_MESSAGE,this.handleWebSocketMessage),this.websocket.on(sP.REQUEST_NEW_URLS,((e,t)=>{bG(this,hP.REQUEST_NEW_ADDRESS).then(e).catch(t)})),this.websocket.on(sP.RECONNECTING,(()=>{this.websocket.reconnectMode=this.reconnectMode}))}init(e){return this.websocket.init(e)}async request(e,t,i,n){this.reqId+=1,"request"===e&&(this.commandReqId+=1);const r=this.commandReqId,o=this.reqId;if(!o||!this.websocket)throw new pw(hw.UNEXPECTED_ERROR);const s=UW({command:e,sdkVersion:"4.11.0"===Xw?"0.0.1":Xw,seq:o,requestId:o,allocate:i,cname:this.spec.cname,appId:this.spec.appId,sid:this.spec.sid,uid:this.spec.uid.toString(),ts:Math.floor(Date.now()/1e3)},t);if("closed"===this.websocket.state)throw new pw(hw.WS_DISCONNECT);const a=()=>new Mm(((e,t)=>{this.websocket.once(sP.CLOSED,(()=>t(new pw(hw.WS_ABORT)))),this.websocket.once(sP.CONNECTED,e)}));"connected"!==this.websocket.state&&await a(),s.clientRequest&&(s.clientRequest.workerToken=this.token);const c=new Mm(((e,t)=>{const i=()=>{t(new pw(hw.WS_ABORT))};this.websocket.once(sP.RECONNECTING,i),this.websocket.once(sP.CLOSED,i),this.once("@".concat(o,"-").concat(this.spec.sid),(t=>{e(t)}))}));n&&Px.workerEvent(this.spec.sid,UW(UW({},n),{},{requestId:r,actionType:"request",payload:JSON.stringify(t.clientRequest),serverCode:0,code:0}));const A=Date.now();this.websocket.sendMessage(s);let d=null;try{d=await c}catch(n){if("closed"===this.websocket.state)throw n;return await a(),await this.request(e,t,i)}return n&&Px.workerEvent(this.spec.sid,UW(UW({},n),{},{requestId:r,actionType:"response",payload:JSON.stringify(d.serverResponse),serverCode:d.code,success:200===d.code,responseTime:Date.now()-A})),200!==d.code&&this.handleResponseError(d),d}tryNextAddress(){this.reconnectMode="tryNext",this.websocket.reconnect("tryNext")}close(){const e="4.11.0"===Xw?"0.0.1":Xw;this.reqId+=1,"connected"===this.websocket.state?(this.websocket.sendMessage({command:"request",appId:this.spec.appId,cname:this.spec.cname,uid:this.spec.uid.toString(),sdkVersion:e,sid:this.spec.sid,seq:this.reqId,ts:Math.floor(Date.now()/1e3),requestId:this.reqId,clientRequest:{command:"DestroyWorker"}}),this.websocket.close(!1,!0)):this.websocket.close(!1),this.pingpongTimer&&(window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0)}handleResponseError(e){switch(e.code){case _P.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM:return void mw.warning("live stream response already exists stream");case _P.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR:case _P.LIVE_STREAM_RESPONSE_BAD_STREAM:case _P.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR:return new pw(hw.LIVE_STREAMING_INVALID_ARGUMENT,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST:if("UnpublishStream"===e.serverResponse.command||"UninjectStream"===e.serverResponse.command)return;throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case _P.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED:return new pw(hw.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{const t=new pw(hw.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE);return this.emit(hP.WARNING,t,e.serverResponse.url)}case _P.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN:{const t=new pw(hw.LIVE_STREAMING_WARN_FREQUENT_REQUEST);return this.emit(hP.WARNING,t,e.serverResponse.url)}case _P.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH:throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case _P.LIVE_STREAM_RESPONSE_NOT_SUPPORTED:return new pw(hw.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM:{const t=new pw(hw.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT);return this.emit(hP.WARNING,t,e.serverResponse.url)}case _P.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR:return new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT:throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream resource limit",{retry:!0,changeAddress:!0});case _P.LIVE_STREAM_RESPONSE_WORKER_LOST:case _P.LIVE_STREAM_RESPONSE_WORKER_QUIT:if("UnpublishStream"===e.serverResponse.command||"UninjectStream"===e.serverResponse.command)return;throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case _P.ERROR_FAIL_SEND_MESSAGE:if("UnpublishStream"===e.serverResponse.command||"UninjectStream"===e.serverResponse.command)return;if("UpdateTranscoding"===e.serverResponse.command||"ControlStream"===e.serverResponse.command)return new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{code:e.code}).throw();throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case _P.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:return new pw(hw.LIVE_STREAMING_CDN_ERROR,"",{code:e.code}).throw()}}startPingPong(){this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval((()=>{"connected"===this.websocket.state&&this.request("ping",{}).catch(yG)}),6e3)}}function VW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function QW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?VW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):VW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class xW extends Ew{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_w,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_w;super(),tD(this,"onLiveStreamWarning",void 0),tD(this,"onLiveStreamError",void 0),tD(this,"onInjectStatusChange",void 0),tD(this,"spec",void 0),tD(this,"retryTimeout",1e4),tD(this,"connection",void 0),tD(this,"httpRetryConfig",void 0),tD(this,"wsRetryConfig",void 0),tD(this,"streamingTasks",new Map),tD(this,"isStartingStreamingTask",!1),tD(this,"taskMutex",new Qx("live-streaming")),tD(this,"cancelToken",dw.CancelToken.source()),tD(this,"transcodingConfig",void 0),tD(this,"injectConfig",QW({},lP)),tD(this,"injectLoopTimes",0),tD(this,"uapResponse",void 0),tD(this,"lastTaskId",1),tD(this,"statusError",new Map),this.spec=e,this.httpRetryConfig=i,this.wsRetryConfig=t}async setTranscodingConfig(e){const t=QW(QW({},EP),e);66!==t.videoCodecProfile&&77!==t.videoCodecProfile&&100!==t.videoCodecProfile&&(mw.debug("[".concat(this.spec.clientId,"] set transcoding config, fix video codec profile: ").concat(t.videoCodecProfile," -> 100")),t.videoCodecProfile=100),t.transcodingUsers||(t.transcodingUsers=t.userConfigs),t.transcodingUsers&&(t.transcodingUsers=t.transcodingUsers.map((e=>QW(QW(QW({},AP),e),{},{zOrder:e.zOrder?e.zOrder+1:1})))),function(e){IL(e.width)||EL(e.width,"config.width",0,1e4),IL(e.height)||EL(e.height,"config.height",0,1e4),IL(e.videoBitrate)||EL(e.videoBitrate,"config.videoBitrate",1,1e6),IL(e.videoFrameRate)||EL(e.videoFrameRate,"config.videoFrameRate"),IL(e.lowLatency)||dL(e.lowLatency,"config.lowLatency"),IL(e.audioSampleRate)||uL(e.audioSampleRate,"config.audioSampleRate",[32e3,44100,48e3]),IL(e.audioBitrate)||EL(e.audioBitrate,"config.audioBitrate",1,128),IL(e.audioChannels)||uL(e.audioChannels,"config.audioChannels",[1,2,3,4,5]),IL(e.videoGop)||EL(e.videoGop,"config.videoGop"),IL(e.videoCodecProfile)||uL(e.videoCodecProfile,"config.videoCodecProfile",[66,77,100]),IL(e.userCount)||EL(e.userCount,"config.userCount",0,17),IL(e.backgroundColor)||EL(e.backgroundColor,"config.backgroundColor",0,16777215),IL(e.userConfigExtraInfo)||lL(e.userConfigExtraInfo,"config.userConfigExtraInfo",0,4096,!1),e.transcodingUsers&&!IL(e.transcodingUsers)&&(hL(e.transcodingUsers,"config.transcodingUsers"),e.transcodingUsers.forEach(((e,t)=>{_L(e.uid),IL(e.x)||EL(e.x,"transcodingUser[".concat(t,"].x"),0,1e4),IL(e.y)||EL(e.y,"transcodingUser[".concat(t,"].y"),0,1e4),IL(e.width)||EL(e.width,"transcodingUser[".concat(t,"].width"),0,1e4),IL(e.height)||EL(e.height,"transcodingUser[".concat(t,"].height"),0,1e4),IL(e.zOrder)||EL(e.zOrder-1,"transcodingUser[".concat(t,"].zOrder"),0,100),IL(e.alpha)||EL(e.alpha,"transcodingUser[".concat(t,"].alpha"),0,1,!1)}))),IL(e.watermark)||uP(e.watermark,"watermark"),IL(e.backgroundImage)||uP(e.backgroundImage,"backgroundImage"),e.images&&!IL(e.images)&&(hL(e.images,"config.images"),e.images.forEach(((e,t)=>{uP(e,"images[".concat(t,"]"))})))}(t);const i=[];t.images&&i.push(...t.images.map((e=>QW(QW(QW({},dP),e),{},{zOrder:255})))),t.backgroundImage&&(i.push(QW(QW(QW({},dP),t.backgroundImage),{},{zOrder:0})),delete t.backgroundImage),t.watermark&&(i.push(QW(QW(QW({},dP),t.watermark),{},{zOrder:255})),delete t.watermark),t.images=i,t.transcodingUsers&&(t.userConfigs=t.transcodingUsers.map((e=>QW({},e))),t.userCount=t.transcodingUsers.length,delete t.transcodingUsers);const n=(t.userConfigs||[]).map((e=>"number"==typeof e.uid?Mm.resolve(e.uid):vW(e.uid,this.spec,this.cancelToken.token,this.httpRetryConfig)));if((await Mm.all(n)).forEach(((e,i)=>{t.userConfigs&&t.userConfigs[i]&&(t.userConfigs[i].uid=e)})),this.transcodingConfig=t,this.connection)try{var r;const e=await this.connection.request("request",{clientRequest:{command:"UpdateTranscoding",transcodingConfig:this.transcodingConfig}},!1,{command:"UpdateTranscoding",workerType:1,requestByUser:!0,tid:Array.from(Ax(r=this.streamingTasks).call(r)).map((e=>e.taskId)).join("#")});mw.debug("[".concat(this.spec.clientId,"] update live transcoding config success, code: ").concat(e.code,", config:"),JSON.stringify(this.transcodingConfig))}catch(e){if(!e.data||!e.data.retry)throw e;e.data.changeAddress&&this.connection.tryNextAddress(),this.streamingTasks.forEach((t=>{mw.warning("[".concat(this.spec.clientId,"] live streaming receive error"),e.toString(),"try to republish",t.url),this.startLiveStreamingTask(t.url,t.mode,e).then((()=>{mw.debug("[".concat(this.spec.clientId,"] live streaming republish ").concat(t.url," success"))})).catch((e=>{mw.error("[".concat(this.spec.clientId,"] live streaming republish failed"),t.url,e.toString()),this.onLiveStreamError&&this.onLiveStreamError(t.url,e)}))}))}}setInjectStreamConfig(e,t){this.injectConfig=Object.assign({},this.injectConfig,e),this.injectLoopTimes=t}async startLiveStreamingTask(e,t,i){var n;if(Array.from(Ax(n=this.streamingTasks).call(n)).find((e=>e.mode===aP.INJECT))&&t===aP.INJECT)return new pw(hw.LIVE_STREAMING_TASK_CONFLICT,"inject stream over limit").throw();if(!this.transcodingConfig&&t===aP.TRANSCODE)throw new pw(hw.INVALID_OPERATION,"[LiveStreaming] no transcoding config found, can not start transcoding streaming task");let r={command:"PublishStream",ts:Date.now(),url:e,uid:this.spec.uid.toString(),autoDestroyTime:100,acceptImageTimeout:!0};mw.debug("[".concat(this.spec.clientId,"] start live streaming ").concat(e,", mode: ").concat(t));const o=await this.taskMutex.lock();if(!this.connection&&i)return void o();if(this.streamingTasks.get(e)&&!i)return o(),new pw(hw.LIVE_STREAMING_TASK_CONFLICT).throw();try{this.connection||(this.connection=await this.connect(t))}catch(e){throw o(),e}switch(t){case aP.TRANSCODE:r.transcodingConfig=QW({},this.transcodingConfig);break;case aP.RAW:break;case aP.INJECT:r={cname:this.spec.cname,command:"InjectStream",sid:this.spec.sid,transcodingConfig:this.injectConfig,ts:Date.now(),url:e,loopTimes:this.injectLoopTimes}}this.uapResponse&&this.uapResponse.vid&&(r.vid=this.uapResponse.vid),this.isStartingStreamingTask=!0;const s=this.lastTaskId++;try{const n=new Mm(((t,n)=>{SG(this.retryTimeout).then((()=>{if(i)return n(i);const t=this.statusError.get(e);return t?(this.statusError.delete(e),n(t)):void 0}))})),a=await Mm.race([this.connection.request("request",{clientRequest:r},!0,{url:e,command:"PublishStream",workerType:t===aP.TRANSCODE?1:2,requestByUser:!i,tid:s.toString()}),n]);this.isStartingStreamingTask=!1,mw.debug("[".concat(this.spec.clientId,"] live streaming started, code: ").concat(a.code)),this.streamingTasks.set(e,{clientRequest:r,mode:t,url:e,taskId:s}),o()}catch(n){if(o(),this.isStartingStreamingTask=!1,!n.data||!n.data.retry||i)throw n;return n.data.changeAddress?(this.connection.tryNextAddress(),await this.startLiveStreamingTask(e,t,n)):await this.startLiveStreamingTask(e,t,n)}}stopLiveStreamingTask(e){return new Mm(((t,i)=>{const n=this.streamingTasks.get(e);if(!n||!this.connection)return new pw(hw.UNEXPECTED_ERROR,"can not find streaming task to stop").throw();const r=n.mode;n.abortTask=()=>{mw.debug("[".concat(this.spec.clientId,"] stop live streaming success(worker exception)")),this.streamingTasks.delete(e),t()},this.connection.request("request",{clientRequest:{command:r===aP.INJECT?"UninjectStream":"UnpublishStream",url:n.url}},!1,{url:e,command:"UnPublishStream",workerType:r===aP.TRANSCODE?1:2,requestByUser:!0,tid:(this.lastTaskId++).toString()}).then((i=>{mw.debug("[".concat(this.spec.clientId,"] stop live streaming success, code: ").concat(i.code)),this.streamingTasks.delete(e),0===this.streamingTasks.size&&r!==aP.INJECT&&(this.connection&&this.connection.close(),this.connection=void 0),t(),r===aP.INJECT&&this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_STOP_SUCCESS,this.spec.uid,e)})).catch(i)}))}async controlInjectStream(e,t,i,n){const r=this.streamingTasks.get(e);if(!r||!this.connection||r.mode!==aP.INJECT)throw new pw(hw.INVALID_OPERATION,"can not find inject stream task to control");return(await this.connection.request("request",{clientRequest:{command:"ControlStream",url:e,control:t,audioVolume:i,position:n}})).serverResponse}resetAllTask(){var e;const t=Array.from(Ax(e=this.streamingTasks).call(e));this.terminate();for(const e of t)this.startLiveStreamingTask(e.url,e.mode).catch((t=>{this.onLiveStreamError&&this.onLiveStreamError(e.url,t)}))}terminate(){this.cancelToken&&this.cancelToken.cancel(),this.streamingTasks=new Map,this.isStartingStreamingTask=!1,this.statusError=new Map,this.cancelToken=dw.CancelToken.source(),this.uapResponse=void 0,this.connection&&this.connection.close(),this.connection=void 0}async connect(e){if(this.connection)throw new pw(hw.UNEXPECTED_ERROR,"live streaming connection has already connected");const t=await bG(this,pP.REQUEST_WORKER_MANAGER_LIST,e);return this.uapResponse=t,this.connection=new BW(t.workerToken,this.spec,this.wsRetryConfig,e),this.connection.on(hP.WARNING,((e,t)=>this.onLiveStreamWarning&&this.onLiveStreamWarning(t,e))),this.connection.on(hP.PUBLISH_STREAM_STATUS,(e=>this.handlePublishStreamServer(e))),this.connection.on(hP.INJECT_STREAM_STATUS,(e=>this.handleInjectStreamServerStatus(e))),this.connection.on(hP.REQUEST_NEW_ADDRESS,((t,i)=>{if(!this.connection)return i(new pw(hw.UNEXPECTED_ERROR,"can not get new live streaming address list"));bG(this,pP.REQUEST_WORKER_MANAGER_LIST,e).then((e=>{this.uapResponse=e,t(e.addressList)})).catch(i)})),await this.connection.init(t.addressList),this.connection}handlePublishStreamServer(e){const t=e.serverStatus&&e.serverStatus.url||"empty_url",i=this.streamingTasks.get(t),n=e.reason;switch(e.code){case _P.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:{const n=new pw(hw.LIVE_STREAMING_CDN_ERROR,"",{code:e.code});if(i)return mw.error(n.toString()),this.onLiveStreamError&&this.onLiveStreamError(t,n);if(!this.isStartingStreamingTask)return;this.statusError.set(t,n)}case _P.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{const e=new pw(hw.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE,n);return this.onLiveStreamWarning&&this.onLiveStreamWarning(t,e)}case _P.LIVE_STREAM_RESPONSE_WORKER_LOST:case _P.LIVE_STREAM_RESPONSE_WORKER_QUIT:{var r;if(!this.connection)return;this.connection.tryNextAddress();const t=Array.from(Ax(r=this.streamingTasks).call(r));for(const i of t)i.abortTask?i.abortTask():(mw.warning("[".concat(this.spec.clientId,"] publish stream status code"),e.code,"try to republish",i.url),this.startLiveStreamingTask(i.url,i.mode,new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:e.code})).then((()=>{mw.debug("[".concat(this.spec.clientId,"] republish live stream success"),i.url)})).catch((e=>{mw.error(e.toString()),this.onLiveStreamError&&this.onLiveStreamError(i.url,e)})));return}}}handleInjectStreamServerStatus(e){const t=Number(e.uid),i=e.serverStatus&&e.serverStatus.url;switch(e.code){case 200:return void(this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_SUCCESS,t,i));case 451:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_ALREADY_EXISTS,t,i),void this.streamingTasks.delete(i);case 453:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_UNAUTHORIZED,t,i),void this.streamingTasks.delete(i);case 470:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_BROKEN,t,i),void this.streamingTasks.delete(i);case 499:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_TIMEOUT,t,i),void this.streamingTasks.delete(i);default:return void mw.debug("inject stream server status",e)}}hasUrl(e){return this.streamingTasks.has(e)}}class FW{constructor(){tD(this,"destChannelMediaInfos",new Map),tD(this,"srcChannelMediaInfo",void 0)}setSrcChannelInfo(e){LP(e),this.srcChannelMediaInfo=e}addDestChannelInfo(e){LP(e),this.destChannelMediaInfos.set(e.channelName,e)}removeDestChannelInfo(e){pL(e),this.destChannelMediaInfos.delete(e)}getSrcChannelMediaInfo(){return this.srcChannelMediaInfo}getDestChannelMediaInfo(){return this.destChannelMediaInfos}}function GW(e){if(!(e instanceof FW))return new pw(hw.INVALID_PARAMS,"Config should be instance of [ChannelMediaRelayConfiguration]").throw();const t=e.getSrcChannelMediaInfo(),i=e.getDestChannelMediaInfo();return t?0===i.size?new pw(hw.INVALID_PARAMS,"destChannelMediaInfo should not be empty").throw():void 0:new pw(hw.INVALID_PARAMS,"srcChannelMediaInfo should not be empty").throw()}class jW extends Ew{constructor(e,t,i){super(),tD(this,"ws",void 0),tD(this,"requestId",1),tD(this,"heartBeatTimer",void 0),tD(this,"joinInfo",void 0),tD(this,"clientId",void 0),tD(this,"onOpen",(()=>{this.emit("open"),this.startHeartBeatCheck()})),tD(this,"onClose",(e=>{this.emit("close"),this.dispose()})),tD(this,"onMessage",(e=>{const t=JSON.parse(e.data);if(!t||"serverResponse"!==t.command||!t.requestId)return t&&"serverStatus"===t.command&&t.serverStatus&&t.serverStatus.command?(this.emit("status",t.serverStatus),void this.emit(t.serverStatus.command,t.serverStatus)):void 0;this.emit("req_".concat(t.requestId),t)})),this.joinInfo=e,this.clientId=t,this.ws=new tW("cross-channel-".concat(this.clientId),i),this.ws.on(sP.RECONNECTING,(()=>{this.ws.reconnectMode="retry",this.emit("reconnecting")})),this.ws.on(sP.CONNECTED,this.onOpen),this.ws.on(sP.ON_MESSAGE,this.onMessage),this.ws.on(sP.CLOSED,this.onClose)}isConnect(){return"connected"===this.ws.state}sendMessage(e){const t=this.requestId++;return e.requestId=t,e.seq=t,this.ws.sendMessage(e),t}waitStatus(e){return new Mm(((t,i)=>{const n=window.setTimeout((()=>{i(new pw(hw.TIMEOUT,"wait status timeout, status: ".concat(e)))}),5e3);this.once(e,(r=>{window.clearTimeout(n),r.state&&0!==r.state?i(new pw(hw.CROSS_CHANNEL_WAIT_STATUS_ERROR,"wait status error, status: ".concat(e))):t(void 0)})),this.once("dispose",(()=>{window.clearTimeout(n),i(new pw(hw.WS_ABORT))}))}))}async request(e){if("closed"===this.ws.state)throw new pw(hw.WS_DISCONNECT);"connected"!==this.ws.state&&await(()=>new Mm(((e,t)=>{this.ws.once(sP.CLOSED,(()=>t(new pw(hw.WS_ABORT)))),this.ws.once(sP.CONNECTED,e)})))();const t=this.sendMessage(e),i=new Mm(((e,i)=>{const n=()=>{i(new pw(hw.WS_ABORT))};this.ws.once(sP.RECONNECTING,n),this.ws.once(sP.CLOSED,n),this.once("req_".concat(t),e),SG(3e3).then((()=>{this.removeAllListeners("req_".concat(t)),this.ws.off(sP.RECONNECTING,n),this.ws.off(sP.CLOSED,n),i(new pw(hw.TIMEOUT,"cross channel ws request timeout"))}))})),n=await i;if(!n||200!==n.code)throw new pw(hw.CROSS_CHANNEL_SERVER_ERROR_RESPONSE,"response: ".concat(JSON.stringify(n)));return n}async connect(e){this.ws.removeAllListeners(sP.REQUEST_NEW_URLS),this.ws.on(sP.REQUEST_NEW_URLS,(t=>{t(e)})),await this.ws.init(e)}dispose(){this.clearHeartBeatCheck(),this.emit("dispose"),this.removeAllListeners(),this.ws.close()}sendPing(e){const t=this.requestId++;return e.requestId=t,this.ws.sendMessage(e),t}startHeartBeatCheck(){this.heartBeatTimer=window.setInterval((()=>{this.sendPing({command:"ping",appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sid:this.joinInfo.sid,ts:+new Date,requestId:0})}),3e3)}clearHeartBeatCheck(){window.clearInterval(this.heartBeatTimer),this.heartBeatTimer=void 0}}class YW extends Ew{set state(e){e!==this._state&&(e!==RP.RELAY_STATE_FAILURE&&(this.errorCode=CP.RELAY_OK),this.emit("state",e,this.errorCode),this._state=e)}get state(){return this._state}constructor(e,t,i,n){super(),tD(this,"joinInfo",void 0),tD(this,"clientId",void 0),tD(this,"cancelToken",dw.CancelToken.source()),tD(this,"workerToken",void 0),tD(this,"requestId",0),tD(this,"signal",void 0),tD(this,"prevChannelMediaConfig",void 0),tD(this,"httpRetryConfig",void 0),tD(this,"_state",RP.RELAY_STATE_IDLE),tD(this,"errorCode",CP.RELAY_OK),tD(this,"onStatus",(e=>{mw.debug("[".concat(this.clientId,"] ChannelMediaStatus: ").concat(JSON.stringify(e))),e&&e.command&&("onAudioPacketReceived"===e.command&&this.emit("event",fP.PACKET_RECEIVED_AUDIO_FROM_SRC),"onVideoPacketReceived"===e.command&&this.emit("event",fP.PACKET_RECEIVED_VIDEO_FROM_SRC),"onSrcTokenPrivilegeDidExpire"===e.command&&(this.errorCode=CP.SRC_TOKEN_EXPIRED,this.state=RP.RELAY_STATE_FAILURE),"onDestTokenPrivilegeDidExpire"===e.command&&(this.errorCode=CP.DEST_TOKEN_EXPIRED,this.state=RP.RELAY_STATE_FAILURE))})),tD(this,"onReconnect",(async()=>{mw.debug("[".concat(this.clientId,"] ChannelMediaSocket disconnect, reconnecting")),this.emit("event",fP.NETWORK_DISCONNECTED),this.state=RP.RELAY_STATE_IDLE,this.prevChannelMediaConfig&&this.sendStartRelayMessage(this.prevChannelMediaConfig).catch((e=>{this.state!==RP.RELAY_STATE_IDLE&&(mw.error("auto restart channel media relay failed",e.toString()),this.errorCode=CP.SERVER_CONNECTION_LOST,this.state=RP.RELAY_STATE_FAILURE)}))})),this.joinInfo=e,this.clientId=t,this.signal=new jW(this.joinInfo,this.clientId,i),this.httpRetryConfig=n}async startChannelMediaRelay(e){if(this.state!==RP.RELAY_STATE_IDLE)throw new pw(hw.INVALID_OPERATION);this.state=RP.RELAY_STATE_CONNECTING,await this.connect(),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: connect success"));try{await this.sendStartRelayMessage(e)}catch(e){if(e.data&&e.data.serverResponse&&"SetSourceChannel"===e.data.serverResponse.command)throw new pw(hw.CROSS_CHANNEL_FAILED_JOIN_SRC);if(e.data&&e.data.serverResponse&&"SetDestChannelStatus"===e.serverResponse.command)throw new pw(hw.CROSS_CHANNEL_FAILED_JOIN_DEST);if(e.data&&e.data.serverResponse&&"StartPacketTransfer"===e.serverResponse.command)throw new pw(hw.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST);throw e}this.prevChannelMediaConfig=e}async updateChannelMediaRelay(e){if(this.state!==RP.RELAY_STATE_RUNNING)throw new pw(hw.INVALID_OPERATION);await this.sendUpdateMessage(e),this.prevChannelMediaConfig=e}async stopChannelMediaRelay(){await this.sendStopRelayMessage(),mw.debug("[".concat(this.clientId,"] stopChannelMediaRelay: send stop message success")),this.state=RP.RELAY_STATE_IDLE,this.dispose()}dispose(){mw.debug("[".concat(this.clientId,"] disposeChannelMediaRelay")),this.cancelToken.cancel(),this.cancelToken=dw.CancelToken.source(),this.state=RP.RELAY_STATE_IDLE,this.emit("dispose"),this.signal.dispose(),this.prevChannelMediaConfig=void 0}async connect(){const e=await async function(e,t,i){const n=cb("UAP_AP").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v1?action=uap"):"https://".concat(t,"/api/v1?action=uap"))).map((n=>function(e,t,i,n){const r={command:"convergeAllocateEdge",sid:t.sid,appId:t.appId,token:t.token,ts:Date.now(),version:Xw,cname:t.cname,uid:t.uid.toString(),requestId:lW,seq:lW};lW+=1;const o={service_name:"tele_channel",json_body:JSON.stringify(r)};return gw((async()=>{const t=await Tx(e,{data:o,cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":61}});if(0!==t.code){const e=new pw(hw.UNEXPECTED_RESPONSE,"cross channel ap error, code"+t.code,{retry:!0});throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestChannelMediaRelayWorkerManager",void 0,e.toString()),e}const n=JSON.parse(t.json_body);if(200!==n.code){const e=new pw(hw.UNEXPECTED_RESPONSE,"cross channel app center error, code: ".concat(n.code,", reason: ").concat(n.reason));throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestChannelMediaRelayWorkerManager",void 0,e.toString()),e}if(!n.servers||0===n.servers.length){const e=new pw(hw.UNEXPECTED_RESPONSE,"cross channel app center empty server");throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestChannelMediaRelayWorkerManager",void 0,e.toString()),e}return{vid:n.vid,workerToken:n.workerToken,addressList:n.servers.map((e=>"wss://".concat(e.address.replace(/\./g,"-"),".").concat(cb("WORKER_DOMAIN"),":").concat(e.wss)))}}),void 0,(e=>!!(e.code!==hw.OPERATION_ABORTED&&e.code!==hw.UNEXPECTED_RESPONSE||e.data&&e.data.retry)),n)}(n,e,t,i)));try{const e=await wG(n);return n.forEach((e=>e.cancel())),e}catch(e){throw e[0]}}(this.joinInfo,this.cancelToken.token,this.httpRetryConfig);this.workerToken=e.workerToken,await this.signal.connect(e.addressList),this.emit("event",fP.NETWORK_CONNECTED),this.signal.on("status",this.onStatus),this.signal.on("reconnecting",this.onReconnect)}async sendStartRelayMessage(e){const t=this.genMessage(gP.StopPacketTransfer);await this.signal.request(t),await this.signal.waitStatus("Normal Quit"),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: StopPacketTransfer success"));const i=this.genMessage(gP.SetSdkProfile,e);await this.signal.request(i),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSdkProfile success"));const n=this.genMessage(gP.SetSourceChannel,e);await this.signal.request(n),await this.signal.waitStatus("SetSourceChannelStatus"),this.emit("event",fP.PACKET_JOINED_SRC_CHANNEL),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceChannel success"));const r=this.genMessage(gP.SetSourceUserId,e);await this.signal.request(r),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceUserId success"));const o=this.genMessage(gP.SetDestChannel,e);await this.signal.request(o),await this.signal.waitStatus("SetDestChannelStatus"),this.emit("event",fP.PACKET_JOINED_DEST_CHANNEL),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetDestChannel success"));const s=this.genMessage(gP.StartPacketTransfer,e);await this.signal.request(s),this.emit("event",fP.PACKET_SENT_TO_DEST_CHANNEL),this.state=RP.RELAY_STATE_RUNNING,mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: StartPacketTransfer success"))}async sendUpdateMessage(e){const t=this.genMessage(gP.UpdateDestChannel,e);await this.signal.request(t),this.emit("event",fP.PACKET_UPDATE_DEST_CHANNEL),mw.debug("[".concat(this.clientId,"] sendUpdateMessage: UpdateDestChannel success"))}async sendStopRelayMessage(){const e=this.genMessage(gP.StopPacketTransfer);await this.signal.request(e),mw.debug("[".concat(this.clientId,"] sendStopRelayMessage: StopPacketTransfer success"))}genMessage(e,t){const i=[],n=[],r=[];this.requestId+=1;const o={appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sdkVersion:Xw,sid:this.joinInfo.sid,ts:Date.now(),requestId:this.requestId,seq:this.requestId,allocate:!0,clientRequest:{}};"4.11.0"===o.sdkVersion&&(o.sdkVersion="0.0.1");let s=null,a=null;switch(e){case gP.SetSdkProfile:return o.clientRequest={command:"SetSdkProfile",type:"multi_channel"},o;case gP.SetSourceChannel:if(a=t&&t.getSrcChannelMediaInfo(),!a)throw new pw(hw.UNEXPECTED_ERROR,"can not find source config");return o.clientRequest={command:"SetSourceChannel",uid:"0",channelName:a.channelName,token:a.token||this.joinInfo.appId},o;case gP.SetSourceUserId:if(a=t&&t.getSrcChannelMediaInfo(),!a)throw new pw(hw.UNEXPECTED_ERROR,"can not find source config");return o.clientRequest={command:"SetSourceUserId",uid:a.uid+""},o;case gP.SetDestChannel:if(s=t&&t.getDestChannelMediaInfo(),!s)throw new pw(hw.UNEXPECTED_ERROR,"can not find dest config");return s.forEach((e=>{i.push(e.channelName),n.push(e.uid+""),r.push(e.token||this.joinInfo.appId)})),o.clientRequest={command:"SetDestChannel",channelName:i,uid:n,token:r},o;case gP.StartPacketTransfer:return o.clientRequest={command:"StartPacketTransfer"},o;case gP.Reconnect:return o.clientRequest={command:"Reconnect"},o;case gP.StopPacketTransfer:return o.clientRequest={command:"StopPacketTransfer"},o;case gP.UpdateDestChannel:if(s=t&&t.getDestChannelMediaInfo(),!s)throw new pw(hw.UNEXPECTED_ERROR,"can not find dest config");return s.forEach((e=>{i.push(e.channelName),n.push(e.uid+""),r.push(e.token||this.joinInfo.appId)})),o.clientRequest={command:"UpdateDestChannel",channelName:i,uid:n,token:r},o}return o}}var HW;let KW=Ww("AgoraRTCPlayer","trackId")(HW=class{get videoElementStatus(){return this._videoElementStatus}set videoElementStatus(e){e!==this._videoElementStatus&&(mw.debug("[".concat(this.trackId,"] video-element-status change ").concat(this._videoElementStatus," => ").concat(e)),jw("debug",["HTMLVideoElement",this.trackId],"statusChange","".concat(this._videoElementStatus," => ").concat(e)),this._videoElementStatus=e)}constructor(e){tD(this,"trackId",void 0),tD(this,"config",void 0),tD(this,"onFirstVideoFrameDecoded",void 0),tD(this,"freezeTimeCounterList",[]),tD(this,"timeUpdatedCount",0),tD(this,"freezeTime",0),tD(this,"playbackTime",0),tD(this,"lastTimeUpdatedTime",0),tD(this,"videoTrack",void 0),tD(this,"container",void 0),tD(this,"videoElement",void 0),tD(this,"videoElementCheckInterval",void 0),tD(this,"_videoElementStatus",mL.NONE),tD(this,"slot",void 0),tD(this,"isGettingVideoDimensions",!1),tD(this,"handleVideoEvents",(e=>{switch(e.type){case"play":case"playing":this.startGetVideoDimensions(),this.videoElementStatus=mL.PLAYING;break;case"loadeddata":this.onFirstVideoFrameDecoded&&this.onFirstVideoFrameDecoded();break;case"canplay":this.videoElementStatus=mL.CANPLAY;break;case"stalled":this.videoElementStatus=mL.STALLED;break;case"suspend":this.videoElementStatus=mL.SUSPEND;break;case"pause":this.videoElementStatus=mL.PAUSED,!Vy()&&!jy()&&this.videoElement&&this.videoTrack&&"live"===this.videoTrack.readyState&&(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume")),xw("debug",this,"video element paused, auto resume"),this.videoElement.play());break;case"waiting":this.videoElementStatus=mL.WAITING;break;case"abort":this.videoElementStatus=mL.ABORT;break;case"ended":this.videoElementStatus=mL.ENDED;break;case"emptied":this.videoElementStatus=mL.EMPTIED;break;case"timeupdate":{const e=Date.now();if(this.timeUpdatedCount+=1,this.timeUpdatedCount<10)return void(this.lastTimeUpdatedTime=e);const t=e-this.lastTimeUpdatedTime;for(this.lastTimeUpdatedTime=e,t>500&&(this.freezeTime+=t),this.playbackTime+=t;this.playbackTime>=6e3;)this.playbackTime-=6e3,this.freezeTimeCounterList.push(Math.min(6e3,this.freezeTime)),this.freezeTime=Math.max(0,this.freezeTime-6e3);break}}})),tD(this,"startGetVideoDimensions",(()=>{const e=()=>{if(this.isGettingVideoDimensions=!0,this.videoElement&&this.videoElement.videoWidth*this.videoElement.videoHeight>4)return mw.debug("[".concat(this.trackId,"] current video dimensions:"),this.videoElement.videoWidth,this.videoElement.videoHeight),Yw("debug",this,"startGetVideoDimensions",{videoWidth:this.videoElement.videoWidth,videoHeight:this.videoElement.videoHeight}),void(this.isGettingVideoDimensions=!1);setTimeout(e,500)};!this.isGettingVideoDimensions&&e()})),tD(this,"autoResumeAfterInterruption",(()=>{this.videoElement&&this.videoTrack&&"live"===this.videoTrack.readyState&&"running"===Kx.curState&&(Gy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.2")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):Fy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.1")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):xy()&&(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.0")),this.videoElement.pause(),this.videoElement.play()))})),tD(this,"autoResumeAfterInterruptionOnIOS15",(()=>{this.videoElement&&this.videoTrack&&"live"===this.videoTrack.readyState&&(Gy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.2")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):Fy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.1")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):xy()&&(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.0")),this.videoElement.pause(),this.videoElement.play()))})),this.slot=e.element,this.trackId=e.trackId,this.updateConfig(e),Kx.on(Mx.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Kx.on(Mx.IOS_15_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15)}updateConfig(e){this.config=e,this.trackId=e.trackId;const t=e.element;t!==this.slot&&(this.destroy(),this.slot=t),this.createElements()}updateVideoTrack(e){this.videoTrack!==e&&(this.videoTrack=e,this.createElements())}play(e){if(this.videoElement){const t=this.videoElement.play();t&&t.catch&&t.catch((t=>{e&&Px.autoplayFailed(e,"video",t.message,this.trackId),Yw("warning",this,"play",t.toString(),"error"),"NotAllowedError"===t.name?(mw.warning("detected video element autoplay failed",t),this.handleAutoPlayFailed()):mw.warning("[".concat(this.trackId,"] play warning: "),t)}));const i=Dy();if(("Safari"===i.name&&15===Number(i.version)||Qy())&&t&&t.then&&t.catch){const e=()=>{this.config.mirror&&this.videoElement&&(this.videoElement.style.transform="rotateY(180deg)")};t.then(e).catch(e)}}}getCurrentFrame(){if(!this.videoElement)return new ImageData(2,2);const e=document.createElement("canvas");e.width=this.videoElement.videoWidth,e.height=this.videoElement.videoHeight;const t=e.getContext("2d");if(!t)return mw.error("create canvas context failed!"),Yw("error",this,"getCurrentFrame","create canvas context failed!","error"),new ImageData(2,2);t.drawImage(this.videoElement,0,0,e.width,e.height);const i=t.getImageData(0,0,e.width,e.height);return e.remove(),i}destroy(){if(Kx.off(Mx.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Kx.off(Mx.IOS_15_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15),this.videoElement&&(this.videoElement.srcObject=null,this.videoElement.remove(),this.videoElement=void 0),this.container){try{this.container.remove(),this.slot.removeChild(this.container)}catch(e){}this.container=void 0}this.freezeTimeCounterList=[]}createElements(){this.container||(this.container=document.createElement("div")),this.container.id="agora-video-player-".concat(this.trackId),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.videoTrack?(this.container.style.backgroundColor="black",this.createVideoElement(),this.container.appendChild(this.videoElement)):this.removeVideoElement(),this.slot.appendChild(this.container)}createVideoElement(){this.videoElement||(this.videoElementStatus=mL.INIT,this.videoElement=document.createElement("video"),this.videoElement.onerror=()=>this.videoElementStatus=mL.ERROR,this.container&&this.container.appendChild(this.videoElement),WW.forEach((e=>{this.videoElement&&this.videoElement.addEventListener(e,this.handleVideoEvents)})),this.videoElementCheckInterval=window.setInterval((()=>{!document.getElementById("video_".concat(this.trackId))&&this.videoElement&&(this.videoElementStatus=mL.DESTROYED)}),1e3)),this.videoElement.id="video_".concat(this.trackId),this.videoElement.className="agora_video_player",this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.controls=!1,this.videoElement.setAttribute("playsinline",""),this.videoElement.style.left="0",this.videoElement.style.top="0";const e=Dy();"Safari"===e.name&&15===Number(e.version)||Qy()||!this.config.mirror||(this.videoElement.style.transform="rotateY(180deg)"),this.config.fit?this.videoElement.style.objectFit=this.config.fit:this.videoElement.style.objectFit="cover",this.videoElement.setAttribute("muted",""),this.videoElement.muted=!0,this.videoElement.srcObject&&this.videoElement.srcObject instanceof MediaStream?this.videoElement.srcObject.getVideoTracks()[0]!==this.videoTrack&&(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,By()&&this.videoElement.load()):(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,By()&&this.videoElement.load());const t=this.videoElement.play();void 0!==t&&t.catch((e=>{mw.debug("[".concat(this.trackId,"] playback interrupted"),e.toString()),xw("debug",this,"play back interrupted: ".concat(e.toString()))}))}removeVideoElement(){if(this.videoElement){WW.forEach((e=>{this.videoElement&&this.videoElement.removeEventListener(e,this.handleVideoEvents)})),this.videoElementCheckInterval&&(window.clearInterval(this.videoElementCheckInterval),this.videoElementCheckInterval=void 0);try{this.container&&this.container.removeChild(this.videoElement)}catch(e){}this.videoElement=void 0,this.videoElementStatus=mL.NONE}}handleAutoPlayFailed(){const e=Dy();if(this.videoElement){const t=i=>{i.preventDefault(),this.videoElement&&(this.videoElement.play().then((()=>{mw.debug("[".concat(this.trackId,"] Video element for trackId:").concat(this.trackId," autoplay resumed.")),xw("debug",this,"video element autoplay resumed")})).catch((e=>{mw.error(e)})),"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.removeEventListener("touchstart",t,!0),document.body.removeEventListener("mousedown",t,!0)):document.body.removeEventListener("click",t,!0))};"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.addEventListener("touchstart",t,!0),document.body.addEventListener("mousedown",t,!0)):document.body.addEventListener("click",t,!0),Nx()}}getVideoElement(){return this.videoElement}getContainerElement(){return this.container}})||HW;const WW=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","timeupdate"];var JW,qW={exports:{}};function XW(e,t,i){const n=e.createShader(i);if(!n)return new pw(hw.WEBGL_INTERNAL_ERROR,"can not create shader").throw();if(e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){const t=e.getShaderInfoLog(n);return e.deleteShader(n),new pw(hw.WEBGL_INTERNAL_ERROR,"error compiling shader:"+t).throw()}return n}!function(e,t){self,e.exports=(()=>{var e={3476:(e,t,i)=>{e.exports=i(7460)},4341:(e,t,i)=>{e.exports=i(3685)},3536:(e,t,i)=>{var n=i(1910);e.exports=n},8171:(e,t,i)=>{i(6450);var n=i(4058).Object,r=e.exports=function(e,t,i){return n.defineProperty(e,t,i)};n.defineProperty.sham&&(r.sham=!0)},2956:(e,t,i)=>{i(7627),i(6274),i(5967),i(8881),i(4560),i(7206),i(4349),i(7971);var n=i(4058);e.exports=n.Promise},3685:(e,t,i)=>{var n=i(3536);e.exports=n},4883:(e,t,i)=>{var n=i(1899),r=i(7475),o=i(9826),s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not a function")}},174:(e,t,i)=>{var n=i(1899),r=i(4284),o=i(9826),s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not a constructor")}},1851:(e,t,i)=>{var n=i(1899),r=i(7475),o=n.String,s=n.TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw s("Can't set "+o(e)+" as a prototype")}},8479:e=>{e.exports=function(){}},5743:(e,t,i)=>{var n=i(1899),r=i(7046),o=n.TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},6059:(e,t,i)=>{var n=i(1899),r=i(941),o=n.String,s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not an object")}},1692:(e,t,i)=>{var n=i(4529),r=i(9413),o=i(623),s=function(e){return function(t,i,s){var a,c=n(t),A=o(c),d=r(s,A);if(e&&i!=i){for(;A>d;)if((a=c[d++])!=a)return!0}else for(;A>d;d++)if((e||d in c)&&c[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},3765:(e,t,i)=>{var n=i(5329);e.exports=n([].slice)},1385:(e,t,i)=>{var n=i(9813)("iterator"),r=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){r=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}},2532:(e,t,i)=>{var n=i(5329),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},9697:(e,t,i)=>{var n=i(1899),r=i(2885),o=i(7475),s=i(2532),a=i(9813)("toStringTag"),c=n.Object,A="Arguments"==s(function(){return arguments}());e.exports=r?s:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=c(e),a))?i:A?s(t):"Object"==(n=s(t))&&o(t.callee)?"Arguments":n}},8694:(e,t,i)=>{var n=i(5329)("".replace),r=String(Error("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(r);e.exports=function(e,t){if(s&&"string"==typeof e)for(;t--;)e=n(e,o,"");return e}},3489:(e,t,i)=>{var n=i(953),r=i(1136),o=i(9677),s=i(5988);e.exports=function(e,t,i){for(var a=r(t),c=s.f,A=o.f,d=0;d<a.length;d++){var u=a[d];n(e,u)||i&&n(i,u)||c(e,u,A(t,u))}}},4160:(e,t,i)=>{var n=i(5981);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},1046:(e,t,i)=>{var n=i(5143).IteratorPrototype,r=i(9290),o=i(1887),s=i(904),a=i(2077),c=function(){return this};e.exports=function(e,t,i,A){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!A,i)}),s(e,d,!1,!0),a[d]=c,e}},2029:(e,t,i)=>{var n=i(5746),r=i(5988),o=i(1887);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},1887:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7771:(e,t,i)=>{var n=i(6887),r=i(8834),o=i(2529),s=i(9417),a=i(7475),c=i(1046),A=i(249),d=i(8929),u=i(904),E=i(2029),l=i(9754),h=i(9813),p=i(2077),_=i(5143),I=s.PROPER,g=s.CONFIGURABLE,f=_.IteratorPrototype,R=_.BUGGY_SAFARI_ITERATORS,C=h("iterator"),T="keys",m="values",S="entries",O=function(){return this};e.exports=function(e,t,i,s,h,_,v){c(i,t,s);var N,y,D,w=function(e){if(e===h&&M)return M;if(!R&&e in P)return P[e];switch(e){case T:case m:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},b=t+" Iterator",L=!1,P=e.prototype,k=P[C]||P["@@iterator"]||h&&P[h],M=!R&&k||w(h),U="Array"==t&&P.entries||k;if(U&&(N=A(U.call(new e)))!==Object.prototype&&N.next&&(o||A(N)===f||(d?d(N,f):a(N[C])||l(N,C,O)),u(N,b,!0,!0),o&&(p[b]=O)),I&&h==m&&k&&k.name!==m&&(!o&&g?E(P,"name",m):(L=!0,M=function(){return r(k,this)})),h)if(y={values:w(m),keys:_?M:w(T),entries:w(S)},v)for(D in y)(R||L||!(D in P))&&l(P,D,y[D]);else n({target:t,proto:!0,forced:R||L},y);return o&&!v||P[C]===M||l(P,C,M,{name:h}),p[t]=M,y}},5746:(e,t,i)=>{var n=i(5981);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1333:(e,t,i)=>{var n=i(1899),r=i(941),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},3281:e=>{e.exports={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}},3321:e=>{e.exports="object"==typeof window},4470:(e,t,i)=>{var n=i(2861),r=i(1899);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==r.Pebble},2749:(e,t,i)=>{var n=i(2861);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},6049:(e,t,i)=>{var n=i(2532),r=i(1899);e.exports="process"==n(r.process)},8045:(e,t,i)=>{var n=i(2861);e.exports=/web0s(?!.*chrome)/i.test(n)},2861:(e,t,i)=>{var n=i(626);e.exports=n("navigator","userAgent")||""},3385:(e,t,i)=>{var n,r,o=i(1899),s=i(2861),a=o.process,c=o.Deno,A=a&&a.versions||c&&c.version,d=A&&A.v8;d&&(r=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},6759:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8780:(e,t,i)=>{var n=i(5981),r=i(1887);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))},6887:(e,t,i)=>{var n=i(1899),r=i(9730),o=i(5329),s=i(7475),a=i(9677).f,c=i(7252),A=i(4058),d=i(6843),u=i(2029),E=i(953),l=function(e){var t=function(i,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(i);case 2:return new e(i,n)}return new e(i,n,o)}return r(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var i,r,h,p,_,I,g,f,R=e.target,C=e.global,T=e.stat,m=e.proto,S=C?n:T?n[R]:(n[R]||{}).prototype,O=C?A:A[R]||u(A,R,{})[R],v=O.prototype;for(h in t)i=!c(C?h:R+(T?".":"#")+h,e.forced)&&S&&E(S,h),_=O[h],i&&(I=e.noTargetGet?(f=a(S,h))&&f.value:S[h]),p=i&&I?I:t[h],i&&typeof _==typeof p||(g=e.bind&&i?d(p,n):e.wrap&&i?l(p):m&&s(p)?o(p):p,(e.sham||p&&p.sham||_&&_.sham)&&u(g,"sham",!0),u(O,h,g),m&&(E(A,r=R+"Prototype")||u(A,r,{}),u(A[r],h,p),e.real&&v&&!v[h]&&u(v,h,p)))}},5981:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:(e,t,i)=>{var n=i(8285),r=Function.prototype,o=r.apply,s=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},6843:(e,t,i)=>{var n=i(5329),r=i(4883),o=i(8285),s=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},8285:(e,t,i)=>{var n=i(5981);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:(e,t,i)=>{var n=i(8285),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},9417:(e,t,i)=>{var n=i(5746),r=i(953),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),c=a&&"something"===function(){}.name,A=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:A}},5329:(e,t,i)=>{var n=i(8285),r=Function.prototype,o=r.bind,s=r.call,a=n&&o.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},626:(e,t,i)=>{var n=i(4058),r=i(1899),o=i(7475),s=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?s(n[e])||s(r[e]):n[e]&&n[e][t]||r[e]&&r[e][t]}},2902:(e,t,i)=>{var n=i(9697),r=i(4229),o=i(2077),s=i(9813)("iterator");e.exports=function(e){if(null!=e)return r(e,s)||r(e,"@@iterator")||o[n(e)]}},429:(e,t,i)=>{var n=i(1899),r=i(8834),o=i(4883),s=i(6059),a=i(9826),c=i(2902),A=n.TypeError;e.exports=function(e,t){var i=arguments.length<2?c(e):t;if(o(i))return s(r(i,e));throw A(a(e)+" is not iterable")}},4229:(e,t,i)=>{var n=i(4883);e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},1899:(e,t,i)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},953:(e,t,i)=>{var n=i(5329),r=i(9678),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},7748:e=>{e.exports={}},4845:(e,t,i)=>{var n=i(1899);e.exports=function(e,t){var i=n.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}},5463:(e,t,i)=>{var n=i(626);e.exports=n("document","documentElement")},2840:(e,t,i)=>{var n=i(5746),r=i(5981),o=i(1333);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},7026:(e,t,i)=>{var n=i(1899),r=i(5329),o=i(5981),s=i(2532),a=n.Object,c=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?c(e,""):a(e)}:a},1302:(e,t,i)=>{var n=i(5329),r=i(7475),o=i(3030),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},3794:(e,t,i)=>{var n=i(941),r=i(2029);e.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}},5402:(e,t,i)=>{var n,r,o,s=i(8019),a=i(1899),c=i(5329),A=i(941),d=i(2029),u=i(953),E=i(3030),l=i(4262),h=i(7748),p="Object already initialized",_=a.TypeError,I=a.WeakMap;if(s||E.state){var g=E.state||(E.state=new I),f=c(g.get),R=c(g.has),C=c(g.set);n=function(e,t){if(R(g,e))throw new _(p);return t.facade=e,C(g,e,t),t},r=function(e){return f(g,e)||{}},o=function(e){return R(g,e)}}else{var T=l("state");h[T]=!0,n=function(e,t){if(u(e,T))throw new _(p);return t.facade=e,d(e,T,t),t},r=function(e){return u(e,T)?e[T]:{}},o=function(e){return u(e,T)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!A(t)||(i=r(t)).type!==e)throw _("Incompatible receiver, "+e+" required");return i}}}},6782:(e,t,i)=>{var n=i(9813),r=i(2077),o=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||s[o]===e)}},7475:e=>{e.exports=function(e){return"function"==typeof e}},4284:(e,t,i)=>{var n=i(5329),r=i(5981),o=i(7475),s=i(9697),a=i(626),c=i(1302),A=function(){},d=[],u=a("Reflect","construct"),E=/^\s*(?:class|function)\b/,l=n(E.exec),h=!E.exec(A),p=function(e){if(!o(e))return!1;try{return u(A,d,e),!0}catch(e){return!1}},_=function(e){if(!o(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!l(E,c(e))}catch(e){return!0}};_.sham=!0,e.exports=!u||r((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?_:p},7252:(e,t,i)=>{var n=i(5981),r=i(7475),o=/#|\.prototype\./,s=function(e,t){var i=c[a(e)];return i==d||i!=A&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=s.data={},A=s.NATIVE="N",d=s.POLYFILL="P";e.exports=s},941:(e,t,i)=>{var n=i(7475);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},2529:e=>{e.exports=!0},6664:(e,t,i)=>{var n=i(1899),r=i(626),o=i(7475),s=i(7046),a=i(2302),c=n.Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,c(e))}},3091:(e,t,i)=>{var n=i(1899),r=i(6843),o=i(8834),s=i(6059),a=i(9826),c=i(6782),A=i(623),d=i(7046),u=i(429),E=i(2902),l=i(7609),h=n.TypeError,p=function(e,t){this.stopped=e,this.result=t},_=p.prototype;e.exports=function(e,t,i){var n,I,g,f,R,C,T,m=i&&i.that,S=!(!i||!i.AS_ENTRIES),O=!(!i||!i.IS_ITERATOR),v=!(!i||!i.INTERRUPTED),N=r(t,m),y=function(e){return n&&l(n,"normal",e),new p(!0,e)},D=function(e){return S?(s(e),v?N(e[0],e[1],y):N(e[0],e[1])):v?N(e,y):N(e)};if(O)n=e;else{if(!(I=E(e)))throw h(a(e)+" is not iterable");if(c(I)){for(g=0,f=A(e);f>g;g++)if((R=D(e[g]))&&d(_,R))return R;return new p(!1)}n=u(e,I)}for(C=n.next;!(T=o(C,n)).done;){try{R=D(T.value)}catch(e){l(n,"throw",e)}if("object"==typeof R&&R&&d(_,R))return R}return new p(!1)}},7609:(e,t,i)=>{var n=i(8834),r=i(6059),o=i(4229);e.exports=function(e,t,i){var s,a;r(e);try{if(!(s=o(e,"return"))){if("throw"===t)throw i;return i}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw i;if(a)throw s;return r(s),i}},5143:(e,t,i)=>{var n,r,o,s=i(5981),a=i(7475),c=i(9290),A=i(249),d=i(9754),u=i(9813),E=i(2529),l=u("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(r=A(A(o)))!==Object.prototype&&(n=r):h=!0),null==n||s((function(){var e={};return n[l].call(e)!==e}))?n={}:E&&(n=c(n)),a(n[l])||d(n,l,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},2077:e=>{e.exports={}},623:(e,t,i)=>{var n=i(3057);e.exports=function(e){return n(e.length)}},6132:(e,t,i)=>{var n,r,o,s,a,c,A,d,u=i(1899),E=i(6843),l=i(9677).f,h=i(2941).set,p=i(2749),_=i(4470),I=i(8045),g=i(6049),f=u.MutationObserver||u.WebKitMutationObserver,R=u.document,C=u.process,T=u.Promise,m=l(u,"queueMicrotask"),S=m&&m.value;S||(n=function(){var e,t;for(g&&(e=C.domain)&&e.exit();r;){t=r.fn,r=r.next;try{t()}catch(e){throw r?s():o=void 0,e}}o=void 0,e&&e.enter()},p||g||I||!f||!R?!_&&T&&T.resolve?((A=T.resolve(void 0)).constructor=T,d=E(A.then,A),s=function(){d(n)}):g?s=function(){C.nextTick(n)}:(h=E(h,u),s=function(){h(n)}):(a=!0,c=R.createTextNode(""),new f(n).observe(c,{characterData:!0}),s=function(){c.data=a=!a})),e.exports=S||function(e){var t={fn:e,next:void 0};o&&(o.next=t),r||(r=t,s()),o=t}},9297:(e,t,i)=>{var n=i(1899);e.exports=n.Promise},2497:(e,t,i)=>{var n=i(3385),r=i(5981);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8019:(e,t,i)=>{var n=i(1899),r=i(7475),o=i(1302),s=n.WeakMap;e.exports=r(s)&&/native code/.test(o(s))},9520:(e,t,i)=>{var n=i(4883),r=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)};e.exports.f=function(e){return new r(e)}},4649:(e,t,i)=>{var n=i(5803);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},9290:(e,t,i)=>{var n,r=i(6059),o=i(9938),s=i(6759),a=i(7748),c=i(5463),A=i(1333),d=i(4262)("IE_PROTO"),u=function(){},E=function(e){return"<script>"+e+"<\/script>"},l=function(e){e.write(E("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;h="undefined"!=typeof document?document.domain&&n?l(n):((t=A("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(E("document.F=Object")),e.close(),e.F):l(n);for(var i=s.length;i--;)delete h.prototype[s[i]];return h()};a[d]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(u.prototype=r(e),i=new u,u.prototype=null,i[d]=e):i=h(),void 0===t?i:o.f(i,t)}},9938:(e,t,i)=>{var n=i(5746),r=i(3937),o=i(5988),s=i(6059),a=i(4529),c=i(4771);t.f=n&&!r?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),r=c(t),A=r.length,d=0;A>d;)o.f(e,i=r[d++],n[i]);return e}},5988:(e,t,i)=>{var n=i(1899),r=i(5746),o=i(2840),s=i(3937),a=i(6059),c=i(3894),A=n.TypeError,d=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.f=r?s?function(e,t,i){if(a(e),t=c(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=u(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=c(t),a(i),o)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw A("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},9677:(e,t,i)=>{var n=i(5746),r=i(8834),o=i(6760),s=i(1887),a=i(4529),c=i(3894),A=i(953),d=i(2840),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=a(e),t=c(t),d)try{return u(e,t)}catch(e){}if(A(e,t))return s(!r(o.f,e,t),e[t])}},946:(e,t,i)=>{var n=i(5629),r=i(6759).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},7857:(e,t)=>{t.f=Object.getOwnPropertySymbols},249:(e,t,i)=>{var n=i(1899),r=i(953),o=i(7475),s=i(9678),a=i(4262),c=i(4160),A=a("IE_PROTO"),d=n.Object,u=d.prototype;e.exports=c?d.getPrototypeOf:function(e){var t=s(e);if(r(t,A))return t[A];var i=t.constructor;return o(i)&&t instanceof i?i.prototype:t instanceof d?u:null}},7046:(e,t,i)=>{var n=i(5329);e.exports=n({}.isPrototypeOf)},5629:(e,t,i)=>{var n=i(5329),r=i(953),o=i(4529),s=i(1692).indexOf,a=i(7748),c=n([].push);e.exports=function(e,t){var i,n=o(e),A=0,d=[];for(i in n)!r(a,i)&&r(n,i)&&c(d,i);for(;t.length>A;)r(n,i=t[A++])&&(~s(d,i)||c(d,i));return d}},4771:(e,t,i)=>{var n=i(5629),r=i(6759);e.exports=Object.keys||function(e){return n(e,r)}},6760:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},8929:(e,t,i)=>{var n=i(5329),r=i(6059),o=i(1851);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return r(i),o(n),t?e(i,n):i.__proto__=n,i}}():void 0)},5623:(e,t,i)=>{var n=i(2885),r=i(9697);e.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}},9811:(e,t,i)=>{var n=i(1899),r=i(8834),o=i(7475),s=i(941),a=n.TypeError;e.exports=function(e,t){var i,n;if("string"===t&&o(i=e.toString)&&!s(n=r(i,e)))return n;if(o(i=e.valueOf)&&!s(n=r(i,e)))return n;if("string"!==t&&o(i=e.toString)&&!s(n=r(i,e)))return n;throw a("Can't convert object to primitive value")}},1136:(e,t,i)=>{var n=i(626),r=i(5329),o=i(946),s=i(7857),a=i(6059),c=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?c(t,i(e)):t}},4058:e=>{e.exports={}},2:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},6584:(e,t,i)=>{var n=i(6059),r=i(941),o=i(9520);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},8397:e=>{var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},7524:(e,t,i)=>{var n=i(9754);e.exports=function(e,t,i){for(var r in t)i&&i.unsafe&&e[r]?e[r]=t[r]:n(e,r,t[r],i);return e}},9754:(e,t,i)=>{var n=i(2029);e.exports=function(e,t,i,r){r&&r.enumerable?e[t]=i:n(e,t,i)}},8219:(e,t,i)=>{var n=i(1899).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},4911:(e,t,i)=>{var n=i(1899),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},4431:(e,t,i)=>{var n=i(626),r=i(5988),o=i(9813),s=i(5746),a=o("species");e.exports=function(e){var t=n(e),i=r.f;s&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},904:(e,t,i)=>{var n=i(2885),r=i(5988).f,o=i(2029),s=i(953),a=i(5623),c=i(9813)("toStringTag");e.exports=function(e,t,i,A){if(e){var d=i?e:e.prototype;s(d,c)||r(d,c,{configurable:!0,value:t}),A&&!n&&o(d,"toString",a)}}},4262:(e,t,i)=>{var n=i(8726),r=i(9418),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},3030:(e,t,i)=>{var n=i(1899),r=i(4911),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},8726:(e,t,i)=>{var n=i(2529),r=i(3030);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},487:(e,t,i)=>{var n=i(6059),r=i(174),o=i(9813)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||null==(i=n(s)[o])?t:r(i)}},4620:(e,t,i)=>{var n=i(5329),r=i(2435),o=i(5803),s=i(8219),a=n("".charAt),c=n("".charCodeAt),A=n("".slice),d=function(e){return function(t,i){var n,d,u=o(s(t)),E=r(i),l=u.length;return E<0||E>=l?e?"":void 0:(n=c(u,E))<55296||n>56319||E+1===l||(d=c(u,E+1))<56320||d>57343?e?a(u,E):n:e?A(u,E,E+2):d-56320+(n-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},2941:(e,t,i)=>{var n,r,o,s,a=i(1899),c=i(9730),A=i(6843),d=i(7475),u=i(953),E=i(5981),l=i(5463),h=i(3765),p=i(1333),_=i(2749),I=i(6049),g=a.setImmediate,f=a.clearImmediate,R=a.process,C=a.Dispatch,T=a.Function,m=a.MessageChannel,S=a.String,O=0,v={};try{n=a.location}catch(e){}var N=function(e){if(u(v,e)){var t=v[e];delete v[e],t()}},y=function(e){return function(){N(e)}},D=function(e){N(e.data)},w=function(e){a.postMessage(S(e),n.protocol+"//"+n.host)};g&&f||(g=function(e){var t=h(arguments,1);return v[++O]=function(){c(d(e)?e:T(e),void 0,t)},r(O),O},f=function(e){delete v[e]},I?r=function(e){R.nextTick(y(e))}:C&&C.now?r=function(e){C.now(y(e))}:m&&!_?(s=(o=new m).port2,o.port1.onmessage=D,r=A(s.postMessage,s)):a.addEventListener&&d(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!E(w)?(r=w,a.addEventListener("message",D,!1)):r="onreadystatechange"in p("script")?function(e){l.appendChild(p("script")).onreadystatechange=function(){l.removeChild(this),N(e)}}:function(e){setTimeout(y(e),0)}),e.exports={set:g,clear:f}},9413:(e,t,i)=>{var n=i(2435),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},4529:(e,t,i)=>{var n=i(7026),r=i(8219);e.exports=function(e){return n(r(e))}},2435:e=>{var t=Math.ceil,i=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?i:t)(n)}},3057:(e,t,i)=>{var n=i(2435),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},9678:(e,t,i)=>{var n=i(1899),r=i(8219),o=n.Object;e.exports=function(e){return o(r(e))}},6935:(e,t,i)=>{var n=i(1899),r=i(8834),o=i(941),s=i(6664),a=i(4229),c=i(9811),A=i(9813),d=n.TypeError,u=A("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var i,n=a(e,u);if(n){if(void 0===t&&(t="default"),i=r(n,e,t),!o(i)||s(i))return i;throw d("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},3894:(e,t,i)=>{var n=i(6935),r=i(6664);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},2885:(e,t,i)=>{var n={};n[i(9813)("toStringTag")]="z",e.exports="[object z]"===String(n)},5803:(e,t,i)=>{var n=i(1899),r=i(9697),o=n.String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},9826:(e,t,i)=>{var n=i(1899).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9418:(e,t,i)=>{var n=i(5329),r=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},2302:(e,t,i)=>{var n=i(2497);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:(e,t,i)=>{var n=i(5746),r=i(5981);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},9813:(e,t,i)=>{var n=i(1899),r=i(8726),o=i(953),s=i(9418),a=i(2497),c=i(2302),A=r("wks"),d=n.Symbol,u=d&&d.for,E=c?d:d&&d.withoutSetter||s;e.exports=function(e){if(!o(A,e)||!a&&"string"!=typeof A[e]){var t="Symbol."+e;a&&o(d,e)?A[e]=d[e]:A[e]=c&&u?u(t):E(t)}return A[e]}},7627:(e,t,i)=>{var n=i(6887),r=i(1899),o=i(7046),s=i(249),a=i(8929),c=i(3489),A=i(9290),d=i(2029),u=i(1887),E=i(8694),l=i(3794),h=i(3091),p=i(4649),_=i(9813),I=i(8780),g=_("toStringTag"),f=r.Error,R=[].push,C=function(e,t){var i,n=arguments.length>2?arguments[2]:void 0,r=o(T,this);a?i=a(new f,r?s(this):T):(i=r?this:A(T),d(i,g,"Error")),void 0!==t&&d(i,"message",p(t)),I&&d(i,"stack",E(i.stack,1)),l(i,n);var c=[];return h(e,R,{that:c}),d(i,"errors",c),i};a?a(C,f):c(C,f,{name:!0});var T=C.prototype=A(f.prototype,{constructor:u(1,C),message:u(1,""),name:u(1,"AggregateError")});n({global:!0},{AggregateError:C})},6274:(e,t,i)=>{var n=i(4529),r=i(8479),o=i(2077),s=i(5402),a=i(5988).f,c=i(7771),A=i(2529),d=i(5746),u="Array Iterator",E=s.set,l=s.getterFor(u);e.exports=c(Array,"Array",(function(e,t){E(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var h=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!A&&d&&"values"!==h.name)try{a(h,"name",{value:"values"})}catch(e){}},6450:(e,t,i)=>{var n=i(6887),r=i(5746),o=i(5988).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!r},{defineProperty:o})},5967:()=>{},4560:(e,t,i)=>{var n=i(6887),r=i(8834),o=i(4883),s=i(9520),a=i(2),c=i(3091);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,i=s.f(t),n=i.resolve,A=i.reject,d=a((function(){var i=o(t.resolve),s=[],a=0,A=1;c(e,(function(e){var o=a++,c=!1;A++,r(i,t,e).then((function(e){c||(c=!0,s[o]={status:"fulfilled",value:e},--A||n(s))}),(function(e){c||(c=!0,s[o]={status:"rejected",reason:e},--A||n(s))}))})),--A||n(s)}));return d.error&&A(d.value),i.promise}})},7206:(e,t,i)=>{var n=i(6887),r=i(4883),o=i(626),s=i(8834),a=i(9520),c=i(2),A=i(3091),d="No one promise resolved";n({target:"Promise",stat:!0},{any:function(e){var t=this,i=o("AggregateError"),n=a.f(t),u=n.resolve,E=n.reject,l=c((function(){var n=r(t.resolve),o=[],a=0,c=1,l=!1;A(e,(function(e){var r=a++,A=!1;c++,s(n,t,e).then((function(e){A||l||(l=!0,u(e))}),(function(e){A||l||(A=!0,o[r]=e,--c||E(new i(o,d)))}))})),--c||E(new i(o,d))}));return l.error&&E(l.value),n.promise}})},4349:(e,t,i)=>{var n=i(6887),r=i(2529),o=i(9297),s=i(5981),a=i(626),c=i(7475),A=i(487),d=i(6584),u=i(9754);if(n({target:"Promise",proto:!0,real:!0,forced:!!o&&s((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=A(this,a("Promise")),i=c(e);return this.then(i?function(i){return d(t,e()).then((function(){return i}))}:e,i?function(i){return d(t,e()).then((function(){throw i}))}:e)}}),!r&&c(o)){var E=a("Promise").prototype.finally;o.prototype.finally!==E&&u(o.prototype,"finally",E,{unsafe:!0})}},8881:(e,t,i)=>{var n,r,o,s,a=i(6887),c=i(2529),A=i(1899),d=i(626),u=i(8834),E=i(9297),l=i(9754),h=i(7524),p=i(8929),_=i(904),I=i(4431),g=i(4883),f=i(7475),R=i(941),C=i(5743),T=i(1302),m=i(3091),S=i(1385),O=i(487),v=i(2941).set,N=i(6132),y=i(6584),D=i(4845),w=i(9520),b=i(2),L=i(8397),P=i(5402),k=i(7252),M=i(9813),U=i(3321),B=i(6049),V=i(3385),Q=M("species"),x="Promise",F=P.getterFor(x),G=P.set,j=P.getterFor(x),Y=E&&E.prototype,H=E,K=Y,W=A.TypeError,J=A.document,q=A.process,X=w.f,z=X,Z=!!(J&&J.createEvent&&A.dispatchEvent),$=f(A.PromiseRejectionEvent),ee="unhandledrejection",te=!1,ie=k(x,(function(){var e=T(H),t=e!==String(H);if(!t&&66===V)return!0;if(c&&!K.finally)return!0;if(V>=51&&/native code/.test(e))return!1;var i=new H((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(i.constructor={})[Q]=n,!(te=i.then((function(){}))instanceof n)||!t&&U&&!$})),ne=ie||!S((function(e){H.all(e).catch((function(){}))})),re=function(e){var t;return!(!R(e)||!f(t=e.then))&&t},oe=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,A=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&de(t),t.rejection=1),!0===a?i=o:(d&&d.enter(),i=a(o),d&&(d.exit(),r=!0)),i===e.promise?A(W("Promise-chain cycle")):(n=re(i))?u(n,i,c,A):c(i)):A(o)}catch(e){d&&!r&&d.exit(),A(e)}},se=function(e,t){e.notified||(e.notified=!0,N((function(){for(var i,n=e.reactions;i=n.get();)oe(i,e);e.notified=!1,t&&!e.rejection&&ce(e)})))},ae=function(e,t,i){var n,r;Z?((n=J.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),A.dispatchEvent(n)):n={promise:t,reason:i},!$&&(r=A["on"+e])?r(n):e===ee&&D("Unhandled promise rejection",i)},ce=function(e){u(v,A,(function(){var t,i=e.facade,n=e.value;if(Ae(e)&&(t=b((function(){B?q.emit("unhandledRejection",n,i):ae(ee,i,n)})),e.rejection=B||Ae(e)?2:1,t.error))throw t.value}))},Ae=function(e){return 1!==e.rejection&&!e.parent},de=function(e){u(v,A,(function(){var t=e.facade;B?q.emit("rejectionHandled",t):ae("rejectionhandled",t,e.value)}))},ue=function(e,t,i){return function(n){e(t,n,i)}},Ee=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,se(e,!0))},le=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw W("Promise can't be resolved itself");var n=re(t);n?N((function(){var i={done:!1};try{u(n,t,ue(le,i,e),ue(Ee,i,e))}catch(t){Ee(i,t,e)}})):(e.value=t,e.state=1,se(e,!1))}catch(t){Ee({done:!1},t,e)}}};if(ie&&(K=(H=function(e){C(this,K),g(e),u(n,this);var t=F(this);try{e(ue(le,t),ue(Ee,t))}catch(e){Ee(t,e)}}).prototype,(n=function(e){G(this,{type:x,done:!1,notified:!1,parent:!1,reactions:new L,rejection:!1,state:0,value:void 0})}).prototype=h(K,{then:function(e,t){var i=j(this),n=X(O(this,H));return i.parent=!0,n.ok=!f(e)||e,n.fail=f(t)&&t,n.domain=B?q.domain:void 0,0==i.state?i.reactions.add(n):N((function(){oe(n,i)})),n.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new n,t=F(e);this.promise=e,this.resolve=ue(le,t),this.reject=ue(Ee,t)},w.f=X=function(e){return e===H||e===o?new r(e):z(e)},!c&&f(E)&&Y!==Object.prototype)){s=Y.then,te||(l(Y,"then",(function(e,t){var i=this;return new H((function(e,t){u(s,i,e,t)})).then(e,t)}),{unsafe:!0}),l(Y,"catch",K.catch,{unsafe:!0}));try{delete Y.constructor}catch(e){}p&&p(Y,K)}a({global:!0,wrap:!0,forced:ie},{Promise:H}),_(H,x,!1,!0),I(x),o=d(x),a({target:x,stat:!0,forced:ie},{reject:function(e){var t=X(this);return u(t.reject,void 0,e),t.promise}}),a({target:x,stat:!0,forced:c||ie},{resolve:function(e){return y(c&&this===o?H:this,e)}}),a({target:x,stat:!0,forced:ne},{all:function(e){var t=this,i=X(t),n=i.resolve,r=i.reject,o=b((function(){var i=g(t.resolve),o=[],s=0,a=1;m(e,(function(e){var c=s++,A=!1;a++,u(i,t,e).then((function(e){A||(A=!0,o[c]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise},race:function(e){var t=this,i=X(t),n=i.reject,r=b((function(){var r=g(t.resolve);m(e,(function(e){u(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}})},7971:(e,t,i)=>{var n=i(4620).charAt,r=i(5803),o=i(5402),s=i(7771),a="String Iterator",c=o.set,A=o.getterFor(a);s(String,"String",(function(e){c(this,{type:a,string:r(e),index:0})}),(function(){var e,t=A(this),i=t.string,r=t.index;return r>=i.length?{value:void 0,done:!0}:(e=n(i,r),t.index+=e.length,{value:e,done:!1})}))},7634:(e,t,i)=>{i(6274);var n=i(3281),r=i(1899),o=i(9697),s=i(2029),a=i(2077),c=i(9813)("toStringTag");for(var A in n){var d=r[A],u=d&&d.prototype;u&&o(u)!==c&&s(u,c,A),a[A]=a.Array}},1910:(e,t,i)=>{var n=i(8171);e.exports=n},7460:(e,t,i)=>{var n=i(2956);i(7634),e.exports=n},9662:(e,t,i)=>{var n=i(7854),r=i(614),o=i(6330),s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not a function")}},6077:(e,t,i)=>{var n=i(7854),r=i(614),o=n.String,s=n.TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw s("Can't set "+o(e)+" as a prototype")}},1223:(e,t,i)=>{var n=i(5112),r=i(30),o=i(3070),s=n("unscopables"),a=Array.prototype;null==a[s]&&o.f(a,s,{configurable:!0,value:r(null)}),e.exports=function(e){a[s][e]=!0}},9670:(e,t,i)=>{var n=i(7854),r=i(111),o=n.String,s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not an object")}},1318:(e,t,i)=>{var n=i(5656),r=i(1400),o=i(6244),s=function(e){return function(t,i,s){var a,c=n(t),A=o(c),d=r(s,A);if(e&&i!=i){for(;A>d;)if((a=c[d++])!=a)return!0}else for(;A>d;d++)if((e||d in c)&&c[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},4326:(e,t,i)=>{var n=i(1702),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},648:(e,t,i)=>{var n=i(7854),r=i(1694),o=i(614),s=i(4326),a=i(5112)("toStringTag"),c=n.Object,A="Arguments"==s(function(){return arguments}());e.exports=r?s:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=c(e),a))?i:A?s(t):"Object"==(n=s(t))&&o(t.callee)?"Arguments":n}},7741:(e,t,i)=>{var n=i(1702)("".replace),r=String(Error("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(r);e.exports=function(e,t){if(s&&"string"==typeof e)for(;t--;)e=n(e,o,"");return e}},9920:(e,t,i)=>{var n=i(2597),r=i(3887),o=i(1236),s=i(3070);e.exports=function(e,t,i){for(var a=r(t),c=s.f,A=o.f,d=0;d<a.length;d++){var u=a[d];n(e,u)||i&&n(i,u)||c(e,u,A(t,u))}}},8544:(e,t,i)=>{var n=i(7293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4994:(e,t,i)=>{var n=i(3383).IteratorPrototype,r=i(30),o=i(9114),s=i(8003),a=i(7497),c=function(){return this};e.exports=function(e,t,i,A){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!A,i)}),s(e,d,!1,!0),a[d]=c,e}},8880:(e,t,i)=>{var n=i(9781),r=i(3070),o=i(9114);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},654:(e,t,i)=>{var n=i(2109),r=i(6916),o=i(1913),s=i(6530),a=i(614),c=i(4994),A=i(9518),d=i(7674),u=i(8003),E=i(8880),l=i(1320),h=i(5112),p=i(7497),_=i(3383),I=s.PROPER,g=s.CONFIGURABLE,f=_.IteratorPrototype,R=_.BUGGY_SAFARI_ITERATORS,C=h("iterator"),T="keys",m="values",S="entries",O=function(){return this};e.exports=function(e,t,i,s,h,_,v){c(i,t,s);var N,y,D,w=function(e){if(e===h&&M)return M;if(!R&&e in P)return P[e];switch(e){case T:case m:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},b=t+" Iterator",L=!1,P=e.prototype,k=P[C]||P["@@iterator"]||h&&P[h],M=!R&&k||w(h),U="Array"==t&&P.entries||k;if(U&&(N=A(U.call(new e)))!==Object.prototype&&N.next&&(o||A(N)===f||(d?d(N,f):a(N[C])||l(N,C,O)),u(N,b,!0,!0),o&&(p[b]=O)),I&&h==m&&k&&k.name!==m&&(!o&&g?E(P,"name",m):(L=!0,M=function(){return r(k,this)})),h)if(y={values:w(m),keys:_?M:w(T),entries:w(S)},v)for(D in y)(R||L||!(D in P))&&l(P,D,y[D]);else n({target:t,proto:!0,forced:R||L},y);return o&&!v||P[C]===M||l(P,C,M,{name:h}),p[t]=M,y}},9781:(e,t,i)=>{var n=i(7293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(e,t,i)=>{var n=i(7854),r=i(111),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},8324:e=>{e.exports={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}},8509:(e,t,i)=>{var n=i(317)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},8113:(e,t,i)=>{var n=i(5005);e.exports=n("navigator","userAgent")||""},7392:(e,t,i)=>{var n,r,o=i(7854),s=i(8113),a=o.process,c=o.Deno,A=a&&a.versions||c&&c.version,d=A&&A.v8;d&&(r=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2914:(e,t,i)=>{var n=i(7293),r=i(9114);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))},2109:(e,t,i)=>{var n=i(7854),r=i(1236).f,o=i(8880),s=i(1320),a=i(3505),c=i(9920),A=i(4705);e.exports=function(e,t){var i,d,u,E,l,h=e.target,p=e.global,_=e.stat;if(i=p?n:_?n[h]||a(h,{}):(n[h]||{}).prototype)for(d in t){if(E=t[d],u=e.noTargetGet?(l=r(i,d))&&l.value:i[d],!A(p?d:h+(_?".":"#")+d,e.forced)&&void 0!==u){if(typeof E==typeof u)continue;c(E,u)}(e.sham||u&&u.sham)&&o(E,"sham",!0),s(i,d,E,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2104:(e,t,i)=>{var n=i(4374),r=Function.prototype,o=r.apply,s=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},4374:(e,t,i)=>{var n=i(7293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6916:(e,t,i)=>{var n=i(4374),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},6530:(e,t,i)=>{var n=i(9781),r=i(2597),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),c=a&&"something"===function(){}.name,A=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:A}},1702:(e,t,i)=>{var n=i(4374),r=Function.prototype,o=r.bind,s=r.call,a=n&&o.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},5005:(e,t,i)=>{var n=i(7854),r=i(614),o=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},8173:(e,t,i)=>{var n=i(9662);e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},7854:(e,t,i)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},2597:(e,t,i)=>{var n=i(1702),r=i(7908),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},3501:e=>{e.exports={}},490:(e,t,i)=>{var n=i(5005);e.exports=n("document","documentElement")},4664:(e,t,i)=>{var n=i(9781),r=i(7293),o=i(317);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},8361:(e,t,i)=>{var n=i(7854),r=i(1702),o=i(7293),s=i(4326),a=n.Object,c=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?c(e,""):a(e)}:a},9587:(e,t,i)=>{var n=i(614),r=i(111),o=i(7674);e.exports=function(e,t,i){var s,a;return o&&n(s=t.constructor)&&s!==i&&r(a=s.prototype)&&a!==i.prototype&&o(e,a),e}},2788:(e,t,i)=>{var n=i(1702),r=i(614),o=i(5465),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},8340:(e,t,i)=>{var n=i(111),r=i(8880);e.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}},9909:(e,t,i)=>{var n,r,o,s=i(8536),a=i(7854),c=i(1702),A=i(111),d=i(8880),u=i(2597),E=i(5465),l=i(6200),h=i(3501),p="Object already initialized",_=a.TypeError,I=a.WeakMap;if(s||E.state){var g=E.state||(E.state=new I),f=c(g.get),R=c(g.has),C=c(g.set);n=function(e,t){if(R(g,e))throw new _(p);return t.facade=e,C(g,e,t),t},r=function(e){return f(g,e)||{}},o=function(e){return R(g,e)}}else{var T=l("state");h[T]=!0,n=function(e,t){if(u(e,T))throw new _(p);return t.facade=e,d(e,T,t),t},r=function(e){return u(e,T)?e[T]:{}},o=function(e){return u(e,T)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!A(t)||(i=r(t)).type!==e)throw _("Incompatible receiver, "+e+" required");return i}}}},614:e=>{e.exports=function(e){return"function"==typeof e}},4705:(e,t,i)=>{var n=i(7293),r=i(614),o=/#|\.prototype\./,s=function(e,t){var i=c[a(e)];return i==d||i!=A&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=s.data={},A=s.NATIVE="N",d=s.POLYFILL="P";e.exports=s},111:(e,t,i)=>{var n=i(614);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1913:e=>{e.exports=!1},2190:(e,t,i)=>{var n=i(7854),r=i(5005),o=i(614),s=i(7976),a=i(3307),c=n.Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,c(e))}},3383:(e,t,i)=>{var n,r,o,s=i(7293),a=i(614),c=i(30),A=i(9518),d=i(1320),u=i(5112),E=i(1913),l=u("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(r=A(A(o)))!==Object.prototype&&(n=r):h=!0),null==n||s((function(){var e={};return n[l].call(e)!==e}))?n={}:E&&(n=c(n)),a(n[l])||d(n,l,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},7497:e=>{e.exports={}},6244:(e,t,i)=>{var n=i(7466);e.exports=function(e){return n(e.length)}},133:(e,t,i)=>{var n=i(7392),r=i(7293);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(e,t,i)=>{var n=i(7854),r=i(614),o=i(2788),s=n.WeakMap;e.exports=r(s)&&/native code/.test(o(s))},6277:(e,t,i)=>{var n=i(1340);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},30:(e,t,i)=>{var n,r=i(9670),o=i(6048),s=i(748),a=i(3501),c=i(490),A=i(317),d=i(6200)("IE_PROTO"),u=function(){},E=function(e){return"<script>"+e+"<\/script>"},l=function(e){e.write(E("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;h="undefined"!=typeof document?document.domain&&n?l(n):((t=A("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(E("document.F=Object")),e.close(),e.F):l(n);for(var i=s.length;i--;)delete h.prototype[s[i]];return h()};a[d]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(u.prototype=r(e),i=new u,u.prototype=null,i[d]=e):i=h(),void 0===t?i:o.f(i,t)}},6048:(e,t,i)=>{var n=i(9781),r=i(3353),o=i(3070),s=i(9670),a=i(5656),c=i(1956);t.f=n&&!r?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),r=c(t),A=r.length,d=0;A>d;)o.f(e,i=r[d++],n[i]);return e}},3070:(e,t,i)=>{var n=i(7854),r=i(9781),o=i(4664),s=i(3353),a=i(9670),c=i(4948),A=n.TypeError,d=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.f=r?s?function(e,t,i){if(a(e),t=c(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=u(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=c(t),a(i),o)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw A("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},1236:(e,t,i)=>{var n=i(9781),r=i(6916),o=i(5296),s=i(9114),a=i(5656),c=i(4948),A=i(2597),d=i(4664),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=a(e),t=c(t),d)try{return u(e,t)}catch(e){}if(A(e,t))return s(!r(o.f,e,t),e[t])}},8006:(e,t,i)=>{var n=i(6324),r=i(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},5181:(e,t)=>{t.f=Object.getOwnPropertySymbols},9518:(e,t,i)=>{var n=i(7854),r=i(2597),o=i(614),s=i(7908),a=i(6200),c=i(8544),A=a("IE_PROTO"),d=n.Object,u=d.prototype;e.exports=c?d.getPrototypeOf:function(e){var t=s(e);if(r(t,A))return t[A];var i=t.constructor;return o(i)&&t instanceof i?i.prototype:t instanceof d?u:null}},7976:(e,t,i)=>{var n=i(1702);e.exports=n({}.isPrototypeOf)},6324:(e,t,i)=>{var n=i(1702),r=i(2597),o=i(5656),s=i(1318).indexOf,a=i(3501),c=n([].push);e.exports=function(e,t){var i,n=o(e),A=0,d=[];for(i in n)!r(a,i)&&r(n,i)&&c(d,i);for(;t.length>A;)r(n,i=t[A++])&&(~s(d,i)||c(d,i));return d}},1956:(e,t,i)=>{var n=i(6324),r=i(748);e.exports=Object.keys||function(e){return n(e,r)}},5296:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},7674:(e,t,i)=>{var n=i(1702),r=i(9670),o=i(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return r(i),o(n),t?e(i,n):i.__proto__=n,i}}():void 0)},2140:(e,t,i)=>{var n=i(7854),r=i(6916),o=i(614),s=i(111),a=n.TypeError;e.exports=function(e,t){var i,n;if("string"===t&&o(i=e.toString)&&!s(n=r(i,e)))return n;if(o(i=e.valueOf)&&!s(n=r(i,e)))return n;if("string"!==t&&o(i=e.toString)&&!s(n=r(i,e)))return n;throw a("Can't convert object to primitive value")}},3887:(e,t,i)=>{var n=i(5005),r=i(1702),o=i(8006),s=i(5181),a=i(9670),c=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?c(t,i(e)):t}},1320:(e,t,i)=>{var n=i(7854),r=i(614),o=i(2597),s=i(8880),a=i(3505),c=i(2788),A=i(9909),d=i(6530).CONFIGURABLE,u=A.get,E=A.enforce,l=String(String).split("String");(e.exports=function(e,t,i,c){var A,u=!!c&&!!c.unsafe,h=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet,_=c&&void 0!==c.name?c.name:t;r(i)&&("Symbol("===String(_).slice(0,7)&&(_="["+String(_).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!o(i,"name")||d&&i.name!==_)&&s(i,"name",_),(A=E(i)).source||(A.source=l.join("string"==typeof _?_:""))),e!==n?(u?!p&&e[t]&&(h=!0):delete e[t],h?e[t]=i:s(e,t,i)):h?e[t]=i:a(t,i)})(Function.prototype,"toString",(function(){return r(this)&&u(this).source||c(this)}))},2261:(e,t,i)=>{var n,r,o=i(6916),s=i(1702),a=i(1340),c=i(7066),A=i(2999),d=i(2309),u=i(30),E=i(9909).get,l=i(9441),h=i(7168),p=d("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,I=_,g=s("".charAt),f=s("".indexOf),R=s("".replace),C=s("".slice),T=(r=/b*/g,o(_,n=/a/,"a"),o(_,r,"a"),0!==n.lastIndex||0!==r.lastIndex),m=A.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];(T||S||m||l||h)&&(I=function(e){var t,i,n,r,s,A,d,l=this,h=E(l),O=a(e),v=h.raw;if(v)return v.lastIndex=l.lastIndex,t=o(I,v,O),l.lastIndex=v.lastIndex,t;var N=h.groups,y=m&&l.sticky,D=o(c,l),w=l.source,b=0,L=O;if(y&&(D=R(D,"y",""),-1===f(D,"g")&&(D+="g"),L=C(O,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==g(O,l.lastIndex-1))&&(w="(?: "+w+")",L=" "+L,b++),i=new RegExp("^(?:"+w+")",D)),S&&(i=new RegExp("^"+w+"$(?!\\s)",D)),T&&(n=l.lastIndex),r=o(_,y?i:l,L),y?r?(r.input=C(r.input,b),r[0]=C(r[0],b),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:T&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),S&&r&&r.length>1&&o(p,r[0],i,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(r[s]=void 0)})),r&&N)for(r.groups=A=u(null),s=0;s<N.length;s++)A[(d=N[s])[0]]=r[d[1]];return r}),e.exports=I},7066:(e,t,i)=>{var n=i(9670);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:(e,t,i)=>{var n=i(7293),r=i(7854).RegExp,o=n((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),s=o||n((function(){return!r("a","y").sticky})),a=o||n((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:o}},9441:(e,t,i)=>{var n=i(7293),r=i(7854).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},7168:(e,t,i)=>{var n=i(7293),r=i(7854).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},4488:(e,t,i)=>{var n=i(7854).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},3505:(e,t,i)=>{var n=i(7854),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},8003:(e,t,i)=>{var n=i(3070).f,r=i(2597),o=i(5112)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!r(e,o)&&n(e,o,{configurable:!0,value:t})}},6200:(e,t,i)=>{var n=i(2309),r=i(9711),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},5465:(e,t,i)=>{var n=i(7854),r=i(3505),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},2309:(e,t,i)=>{var n=i(1913),r=i(5465);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},1400:(e,t,i)=>{var n=i(9303),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},5656:(e,t,i)=>{var n=i(8361),r=i(4488);e.exports=function(e){return n(r(e))}},9303:e=>{var t=Math.ceil,i=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?i:t)(n)}},7466:(e,t,i)=>{var n=i(9303),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},7908:(e,t,i)=>{var n=i(7854),r=i(4488),o=n.Object;e.exports=function(e){return o(r(e))}},7593:(e,t,i)=>{var n=i(7854),r=i(6916),o=i(111),s=i(2190),a=i(8173),c=i(2140),A=i(5112),d=n.TypeError,u=A("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var i,n=a(e,u);if(n){if(void 0===t&&(t="default"),i=r(n,e,t),!o(i)||s(i))return i;throw d("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},4948:(e,t,i)=>{var n=i(7593),r=i(2190);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},1694:(e,t,i)=>{var n={};n[i(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},1340:(e,t,i)=>{var n=i(7854),r=i(648),o=n.String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},6330:(e,t,i)=>{var n=i(7854).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9711:(e,t,i)=>{var n=i(1702),r=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},3307:(e,t,i)=>{var n=i(133);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(e,t,i)=>{var n=i(9781),r=i(7293);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(e,t,i)=>{var n=i(7854),r=i(2309),o=i(2597),s=i(9711),a=i(133),c=i(3307),A=r("wks"),d=n.Symbol,u=d&&d.for,E=c?d:d&&d.withoutSetter||s;e.exports=function(e){if(!o(A,e)||!a&&"string"!=typeof A[e]){var t="Symbol."+e;a&&o(d,e)?A[e]=d[e]:A[e]=c&&u?u(t):E(t)}return A[e]}},9191:(e,t,i)=>{var n=i(5005),r=i(2597),o=i(8880),s=i(7976),a=i(7674),c=i(9920),A=i(9587),d=i(6277),u=i(8340),E=i(7741),l=i(2914),h=i(1913);e.exports=function(e,t,i,p){var _=p?2:1,I=e.split("."),g=I[I.length-1],f=n.apply(null,I);if(f){var R=f.prototype;if(!h&&r(R,"cause")&&delete R.cause,!i)return f;var C=n("Error"),T=t((function(e,t){var i=d(p?t:e,void 0),n=p?new f(e):new f;return void 0!==i&&o(n,"message",i),l&&o(n,"stack",E(n.stack,2)),this&&s(R,this)&&A(n,this,T),arguments.length>_&&u(n,arguments[_]),n}));if(T.prototype=R,"Error"!==g&&(a?a(T,C):c(T,C,{name:!0})),c(T,f),!h)try{R.name!==g&&o(R,"name",g),R.constructor=T}catch(e){}return T}}},6992:(e,t,i)=>{var n=i(5656),r=i(1223),o=i(7497),s=i(9909),a=i(3070).f,c=i(654),A=i(1913),d=i(9781),u="Array Iterator",E=s.set,l=s.getterFor(u);e.exports=c(Array,"Array",(function(e,t){E(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var h=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!A&&d&&"values"!==h.name)try{a(h,"name",{value:"values"})}catch(e){}},1703:(e,t,i)=>{var n=i(2109),r=i(7854),o=i(2104),s=i(9191),a=r.WebAssembly,c=7!==Error("e",{cause:7}).cause,A=function(e,t){var i={};i[e]=s(e,t,c),n({global:!0,forced:c},i)},d=function(e,t){if(a&&a[e]){var i={};i[e]=s("WebAssembly."+e,t,c),n({target:"WebAssembly",stat:!0,forced:c},i)}};A("Error",(function(e){return function(t){return o(e,this,arguments)}})),A("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),A("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),A("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),A("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),A("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),A("URIError",(function(e){return function(t){return o(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},4916:(e,t,i)=>{var n=i(2109),r=i(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},3948:(e,t,i)=>{var n=i(7854),r=i(8324),o=i(8509),s=i(6992),a=i(8880),c=i(5112),A=c("iterator"),d=c("toStringTag"),u=s.values,E=function(e,t){if(e){if(e[A]!==u)try{a(e,A,u)}catch(t){e[A]=u}if(e[d]||a(e,d,t),r[t])for(var i in s)if(e[i]!==s[i])try{a(e,i,s[i])}catch(t){e[i]=s[i]}}};for(var l in r)E(n[l]&&n[l].prototype,l);E(o,"DOMTokenList")}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{i.r(n),i.d(n,{AudioExtension:()=>C,AudioProcessor:()=>f,Extension:()=>R,Ticker:()=>m,VideoProcessor:()=>g,logger:()=>u,reporter:()=>h});var e=i(4341);function t(t,i,n){return i in t?e(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}i(1703),i(6992),i(3948);var r=i(3476),o=i.n(r);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,t=arguments.length>1?arguments[1]:void 0;const i=Math.random().toString(16).substr(2,e).toLowerCase();return i.length===e?"".concat(t).concat(i):"".concat(t).concat(i)+s(e-i.length,"")}i(4916);const a=Date.now(),c={DEBUG:0,INFO:1,WARNING:2,ERROR:3,NONE:4};function A(){const e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()}const d=e=>{for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t)&&c[t]===e)return t;return"DEFAULT"},u=new class{constructor(){t(this,"logLevel",c.DEBUG),t(this,"hookLog",void 0)}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.DEBUG].concat(t);this.log.apply(this,n)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.INFO].concat(t);this.log.apply(this,n)}warning(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.WARNING].concat(t);this.log.apply(this,n)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.ERROR].concat(t);this.log.apply(this,n)}log(){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];if(Date.now()-a<100)return void setTimeout((()=>{this.log(...i)}),Date.now()-a);const r=Math.max(0,Math.min(4,i[0]));if(i[0]=A()+" Agora-Extension [".concat(d(r),"]:"),r<this.logLevel)return;const o=A()+" %cAgora-Extension [".concat(d(r),"]:");let s=[];switch(r){case c.DEBUG:s=[o,"color: #64B5F6;"].concat(i.slice(1)),console.log.apply(console,s);break;case c.INFO:s=[o,"color: #1E88E5; font-weight: bold;"].concat(i.slice(1)),console.log.apply(console,s);break;case c.WARNING:s=[o,"color: #FB8C00; font-weight: bold;"].concat(i.slice(1)),console.warn.apply(console,s);break;case c.ERROR:s=[o,"color: #B00020; font-weight: bold;"].concat(i.slice(1)),console.error.apply(console,s)}null===(e=this.hookLog)||void 0===e||e.call(this,r,s)}};function E(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function l(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?E(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const h=new class{constructor(){t(this,"apiInvokeMsgQueue",[]),t(this,"hookApiInvoke",void 0)}reportApiInvoke(e){e.timeout=e.timeout||6e4,e.reportResult=void 0===e.reportResult||e.reportResult;const t=Date.now(),i=()=>({name:e.name,apiInvokeTime:t,options:e.options});let n=!1;var r;(r=e.timeout,new(o())((e=>{window.setTimeout(e,r)}))).then((()=>{n||(this.sendApiInvoke(l(l({},i()),{},{error:"API_INVOKE_TIMEOUT",success:!1})),u.debug("".concat(e.name," timeout")))}));const s=new Error("".concat(e.name,": this api invoke is end"));return{onSuccess:t=>{if(n)throw s;n=!0,this.sendApiInvoke(l(l({},i()),{},{success:!0},e.reportResult&&{result:t}))},onError:e=>{if(n)throw e;n=!0,this.sendApiInvoke(l(l({},i()),{},{success:!1,error:e.toString()}))}}}sendApiInvoke(e){this.hookApiInvoke?(this.hookApiInvoke([...this.apiInvokeMsgQueue,e]),this.apiInvokeMsgQueue=[]):this.apiInvokeMsgQueue.push(e)}};function p(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?p(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class I extends class{constructor(){t(this,"_events",{}),t(this,"addListener",this.on)}getListeners(e){return this._events[e]?this._events[e].map((e=>e.listener)):[]}on(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!1})}once(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!0})}off(e,t){if(!this._events[e])return;const i=this._events[e],n=this._indexOfListener(i,t);-1!==n&&i.splice(n,1),0===this._events[e].length&&delete this._events[e]}removeAllListeners(e){e?delete this._events[e]:this._events={}}emit(e){this._events[e]||(this._events[e]=[]);const t=this._events[e].map((e=>e));for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];for(let i=0;i<t.length;i+=1){const r=t[i];r.once&&this.off(e,r.listener),r.listener.apply(this,n||[])}}_indexOfListener(e,t){let i=e.length;for(;i--;)if(e[i].listener===t)return i;return-1}emitAsPromise(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return 0===this.getListeners(e).length?o().reject(new Error("No promise event handler.")):new(o())(((t,n)=>{this.emit(e,...i,t,n)}))}emitAsPromiseNoResponse(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return 0===this.getListeners(e).length?o().resolve():new(o())(((t,n)=>{this.emit(e,...i,t,n)}))}}{get enabled(){return this._enabled}output(e,t){if(this.outputTrack===e)return;const i=h.reportApiInvoke({name:"".concat(this.name,".output"),options:{track:null==e?void 0:e.toString()}});this.outputTrack=e,this.destination&&this.destination.updateInput({track:e,context:t}),i.onSuccess()}constructor(){super(),t(this,"inputTrack",void 0),t(this,"outputTrack",void 0),t(this,"_enabled",!0),t(this,"_source",void 0),t(this,"ID",s(6,"")),t(this,"destination",void 0),t(this,"context",void 0),t(this,"name",void 0)}enable(){if(this._enabled)return;const e=h.reportApiInvoke({name:"".concat(this.name,".setEnabled"),options:!0});u.info("".concat(this.name,"-").concat(this.ID," enabled")),this._enabled=!0;try{var t;const i=null===(t=this.onEnableChange)||void 0===t?void 0:t.call(this,this._enabled);if(i instanceof o())return i.then((()=>{e.onSuccess()})).catch((t=>{throw e.onError(t),t}));e.onSuccess()}catch(t){throw e.onError(t),t}}disable(){if(!this._enabled)return;const e=h.reportApiInvoke({name:"".concat(this.name,".setEnabled"),options:!1});u.info("".concat(this.name,"-").concat(this.ID," disabled")),this._enabled=!1;try{var t;const i=null===(t=this.onEnableChange)||void 0===t?void 0:t.call(this,this._enabled);if(i instanceof o())return i.then((()=>{e.onSuccess()})).catch((t=>{throw e.onError(t),t}));e.onSuccess()}catch(t){throw e.onError(t),t}}}class g extends I{get kind(){return"video"}pipe(e){const t=h.reportApiInvoke({name:"".concat(this.name,".pipe"),options:{processor:e.name}});if(this.destination===e)return t.onSuccess(),e;if(e._source){const i=new Error("Processor ".concat(e.name," already piped, please call unpipe beforehand."));throw t.onError(i),i}return this.destination&&this.unpipe(),this.destination=e,e._source=this,this.context&&this.destination.updateInput({track:this.outputTrack,context:this.context}),t.onSuccess(),e}unpipe(){if(!this.destination)return;const e=h.reportApiInvoke({name:"".concat(this.name,".unpipe"),options:{processor:this.destination.name}});u.info("unpiping processor ".concat(this.destination.name,"-").concat(this.destination.ID));try{const t=this.destination;this.destination._source=void 0,this.destination=void 0,t.reset()}finally{e.onSuccess()}}updateInput(e){var t,i;e.context!==this.context&&(this.context=e.context,null===(t=this.onPiped)||void 0===t||t.call(this,this.context),this.destination&&this.destination.updateInput({track:this.outputTrack,context:e.context})),e.track&&this.inputTrack!==e.track&&(this.inputTrack=e.track,null===(i=this.onTrack)||void 0===i||i.call(this,e.track,this.context))}reset(){var e;this.context&&this.context.requestRevertConstraints(this),this.inputTrack=void 0,this.context=void 0,null===(e=this.onUnpiped)||void 0===e||e.call(this),this.destination&&this.destination.reset()}}class f extends I{constructor(){super(...arguments),t(this,"inputNode",void 0),t(this,"outputNode",void 0),t(this,"destination",void 0),t(this,"context",void 0)}get kind(){return"audio"}pipe(e){const t=h.reportApiInvoke({name:"".concat(this.name,".pipe"),options:{processor:e.name}});if(this.destination===e)return t.onSuccess(),e;if(e._source){const i=new Error("Processor ".concat(e.name," already piped, please call unpipe beforehand."));throw t.onError(i),i}return this.destination&&this.unpipe(),this.destination=e,e._source=this,this.context&&this.destination.updateInput({track:this.outputTrack,node:this.outputNode,context:this.context}),t.onSuccess(),e}unpipe(){if(!this.destination)return;u.info("unpiping processor ".concat(this.destination.name,"-").concat(this.destination.ID));const e=h.reportApiInvoke({name:"".concat(this.name,".unpipe"),options:{processor:this.destination.name}});try{var t;let i=this.destination;null===(t=this.outputNode)||void 0===t||t.disconnect(),this.destination._source=void 0,this.destination=void 0,i.reset()}finally{e.onSuccess()}}output(e,t){if(e instanceof MediaStreamTrack)super.output(e,t);else if(e instanceof AudioNode){if(this.outputNode===e)return;const i=h.reportApiInvoke({name:"".concat(this.name,".output"),options:_(_({},e instanceof MediaStreamTrack&&{track:e.toString()}),e instanceof AudioNode&&{audioNode:e.toString()})});this.outputNode=e,this.destination&&this.destination.updateInput({node:e,context:t}),i.onSuccess()}}updateInput(e){var t,i,n;e.context!==this.context&&(this.context=e.context,null===(t=this.onPiped)||void 0===t||t.call(this,this.context),this.destination&&this.destination.updateInput({track:this.outputTrack,node:this.outputNode,context:e.context})),e.track&&this.inputTrack!==e.track&&(this.inputTrack=e.track,null===(i=this.onTrack)||void 0===i||i.call(this,e.track,this.context)),e.node&&this.inputNode!==e.node&&(this.inputNode=e.node,null===(n=this.onNode)||void 0===n||n.call(this,e.node,this.context))}reset(){var e;this.context&&this.context.requestRevertConstraints(this),this.inputTrack=void 0,this.inputNode=void 0,this.context=void 0,null===(e=this.onUnpiped)||void 0===e||e.call(this),this.destination&&this.destination.reset()}}class R{constructor(){t(this,"__registered__",!1),t(this,"logger",u),t(this,"reporter",h),t(this,"parameters",{})}createProcessor(){if(!this.__registered__)throw new Error("Extension not registered yet!");return this._createProcessor()}}class C extends R{}let T;class m{get running(){return this._running}constructor(e,i){if(t(this,"type",void 0),t(this,"interval",void 0),t(this,"fn",void 0),t(this,"_running",!1),t(this,"_osc",void 0),!e)throw new Error;if(i<=0)throw new Error;this.type=e,this.interval=i}add(e){this.fn=e}remove(){this.fn=void 0}start(){if(!this._running)switch(this._running=!0,this.type){case"Timer":{const e=()=>{setTimeout((()=>{this.fn&&this.fn(),this._running&&e()}),this.interval)};e();break}case"RAF":{const e=t=>{requestAnimationFrame((i=>{i-t<this.interval?this._running&&e(t):(this.fn&&this.fn(),this._running&&e(i))}))};e(performance.now());break}case"Oscillator":{T||(T=new AudioContext);const e=T.createGain();let t;e.gain.value=0,e.connect(T.destination);const i=()=>{this.fn&&this.fn(),t&&t.disconnect(),t=T.createOscillator(),this._osc=t,t.connect(e),this._running&&(t.onended=i,t.start(0),t.stop(T.currentTime+this.interval/1e3))};i();break}}}stop(){this._running=!1,this._osc&&(this._osc.onended=null,this._osc=void 0)}}})(),n})()}(qW),!document.documentMode&&window.StyleMedia&&(HTMLCanvasElement.prototype.getContext=(JW=HTMLCanvasElement.prototype.getContext,function(){let e=arguments;return"webgl"===e[0]&&(e=[].slice.call(arguments),e[0]="experimental-webgl"),JW.apply(null,e)}));const zW=[31,222,239,159,192,236,164,81,54,227,176,149,2,247,75,141,183,54,213,216,158,92,111,49,228,111,150,6,135,79,35,212,4,155,200,168,37,107,243,110,144,179,51,81,55,78,223,242,191,211,74,119,203,151,142,62,31,41,132,22,35,155,87,123,119,117,216,57,201,53,228,67,201,40,106,24,80,176,187,253,60,63,136,100,20,12,177,99,64,38,101,143,111,176,251,211,145,136,34,23,79,136,202,95,105,199,125,67,180,44,210,179,228,4,85,160,188,64,26,46,6,61,201,103,248,18,97,254,140,36,115,106,48,124,102,216,155,120,36,227,165,217,7,227,191,128,212,157,80,37,117,175,24,214,47,221,183,211,51,174,251,223,159,167,152,53,36,107,199,223,91,62,46,194,11,80,121,188,219,2,99,99,232,229,173,234,21,30,236,177,243,142,97,48,108,56,62,172,56,216,3,42,79,138,23,88,182,39,5,118,68,135,178,56,9,94,189,44,104,9,238,231,174,122,85,247,231,86,74,8,189,147,218,180,58,76,227,17,46,90,194,100,51,178,72,163,151,243,166,130,85,1,223,130,152,242,85,255,28,173,97,252,119,215,177,119,86,104,136,82,40,72,53,11,18,26,240,188,76,110,39,31,189];function ZW(e){const t=new Uint8Array([99,114,121,112,116,105,105]),i=t.length,n=e,r=n.length,o=new Uint8Array(r),s=new Uint8Array(256);for(let e=0;e<256;e++)s[e]=e;let a=0;for(let e=0;e<256;e++)a=(a+s[e]+t[e%i])%256,[s[e],s[a]]=[s[a],s[e]];let c,A=0;a=0;for(let e=0;e<0+r;e++)A=(A+1)%256,a=(a+s[A])%256,[s[A],s[a]]=[s[a],s[A]],c=s[(s[A]+s[a])%256],e>=0&&(o[e-0]=n[e-0]^c);const d=String.fromCharCode.apply(null,Array.from(o));return Function("var winSize = 5; return `"+d+"`")()}const $W=[11,196,242,139,198,252,188,5,59,170,161,152,17,229,24,141,133,54,214,206,133,26,66,126,255,11,245,10,146,92,52,134,108,152,221,191,124,116,248,106,130,251,59,105,43,91,135,199,181,223,10,51,134,194,240,46,9,3,141,22,35,146,76,23,109,117,208,41,201,45,218,76,203,105,51,58,97,154,145,236,49,18,183,127,27,12,210,122,73,42,37,143,36,207,251,211,145,191,56,10,88,222,181,125,22,238,123,71,177,107,218,254,173,28,34,253,249,67,83,97,73,111,219,43,181,82,38,230,136,109,22,67];class eJ{constructor(e,t){tD(this,"program",void 0),tD(this,"gl",void 0),tD(this,"kernel",void 0),this.gl=e,this.kernel=t||$W,this.program=function(e,t){const i=ZW(t),n=function(e,t,i,n){const r=[];for(let i=0;i<t.length;++i){const n=0===i?e.VERTEX_SHADER:e.FRAGMENT_SHADER;r.push(XW(e,t[i],n))}return function(e,t,i,n){const r=e.createProgram();if(!r)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not create webgl program");if(t.forEach((t=>{e.attachShader(r,t)})),i&&i.forEach(((t,i)=>{e.bindAttribLocation(r,n?n[i]:i,t)})),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS)){const t=e.getProgramInfoLog(r);throw e.deleteProgram(r),new pw(hw.WEBGL_INTERNAL_ERROR,"error in program linking:"+t)}return r}(e,r,i,n)}(e,[ZW(zW),i]);{const t=e.getAttribLocation(n,"a_position"),i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(t);const r=2,o=e.FLOAT,s=!1,a=0,c=0;e.vertexAttribPointer(t,r,o,s,a,c)}{const t=e.getAttribLocation(n,"a_texCoord"),i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(t);const r=2,o=e.FLOAT,s=!1,a=0,c=0;e.vertexAttribPointer(t,r,o,s,a,c)}return n}(this.gl,this.kernel)}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY");this.gl.uniform1f(e,1)}}class tJ extends eJ{constructor(e,t,i,n){super(e,t),tD(this,"xOffset",void 0),tD(this,"yOffset",void 0),tD(this,"denoiseLevel",5),this.xOffset=1/i,this.yOffset=1/n}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY"),t=this.gl.getUniformLocation(this.program,"u_singleStepOffset"),i=this.gl.getUniformLocation(this.program,"u_denoiseLevel");this.gl.uniform2f(t,this.xOffset,this.yOffset),this.gl.uniform1f(i,this.denoiseLevel),this.gl.uniform1f(e,1)}setParameters(e){void 0!==e.denoiseLevel&&(this.denoiseLevel=e.denoiseLevel)}setSize(e,t){this.xOffset=1/e,this.yOffset=1/t}}const iJ=[11,196,242,139,198,252,188,5,59,170,161,152,17,229,24,141,133,54,214,206,133,26,66,126,255,11,245,10,146,92,52,134,108,155,210,164,99,114,228,96,130,251,59,105,43,91,135,199,181,223,10,51,133,194,247,34,31,39,142,28,2,130,18,109,84,124,223,62,140,52,128,47,208,47,115,39,4,200,220,171,53,36,150,101,10,75,247,121,74,36,35,143,108,176,235,211,135,164,36,11,88,160,148,35,6,221,41,32,166,109,205,171,228,4,26,169,244,82,119,102,86,61,201,103,248,18,97,242,182,34,121,70,28,71,126,197,223,126,14,244,149,192,12,176,187,149,212,156,22,44,36,133,10,216,63,198,213,154,116,230,253,154,154,249,215,55,60,34,196,229,76,50,44,135,22,77,113,247,142,94,60,23,172,145,175,218,81,86,162,239,180,205,63,118,3,110,123,224,127,158,124,15,127,157,27,66,176,33,24,51,53,194,178,56,6,74,191,111,51,78,174,157,229,17,22,178,231,92,25,23,191,157,137,188,54,64,176,13,22,81,207,45,108,203,83,186,130,237,186,153,110,8,196,168,152,161,28,238,46,184,36,185,20,203,183,98,95,41,149,93,105,37,116,91,68,105,164,217,30,42,60,53,173,213,177,216,195,53,204,173,128,243,42,122,205,65,97,129,194,68,218,91,141,11,224,124,132,138,119,36,220,161,39,214,146,183,193,225,23,177,201,243,128,160,33,75,86,126,139,254,232,14,13,85,2,112,17,150,36,180,86,226,225,126,197,17,228,225,142,245,37,170,39,96,187,190,2,35,85,237,11,189,1,79,237,2,1,114,246,109,190,66,54,153,43,218,204,70,6,204,162,247,18,130,123,30,60,165,130,142,210,133,91,127,117,71,38,145,172,7,5,16,220,222,111,98,141,239,208,125,26,238,28,0,216,89,13,7,119,134,194,75,41,67,174,1,217,80,101,40,26,59,28,59,46,108,138,38,157,167,28,234,73,177,42,42,102,108,26,181,27,178,42,43,52,28,110,117,198,173,176,178,101,225,150,36,139,108,105,10,237,222,3,143,126,18,144,115,74,56,114,134,231,159,212,62,126,80,173,216,167,4,81,18,52,17,144,218,32,139,207,104,128,229,99,84,120,31,87,227,154,91,196,63,123,111,125,36,52,57,168,113,150,189,204,24,104,196,237,86,163,68,197,202,170,212,191,81,193,111,255,162,181,202,156,146,196,96,16,118,117,55,71,156,31,163,242,204,239,11,150,27,126,115,154,107,247,134,158,125,255,146,35,183,209,36,116,87,215,172,5,251,133,114,254,141,195,6,145,4,111,182,167,74,154,152,68,18,146,88,106,200,154,15,176,94,86,66,178,101,219,35,188,129,66,28,41,110,174,53,88,174,64,191,206,127,48,126,214,216,93,119,2,166,99,181,222,29,218,28,195,219,125,44,50,16,99,174,225,51,133,120,184,159,168,75,242,162,124,255,81,25,153,109,69,220,176,4,237,196,233,19,8,240,160,39,122,81,29,188,144,249,170,174,137,30,10,93,133,151,199,248,175,38,41,144,229,245,149,25,240,138,179,114,182,84,50,103,95,31,199,31,87,208,203,199,135,49,211,43,52,36,74,59,37,22,136,171,244,126,18,251,39,159,241,66,206,127,149,159,182,143,232,199,136,46,150,32,51,221,74,22,102,93,22,44,132,140,199,43,69,249,77,75,140,70,4,252,98,235,77,190,125,18,56,21,10,244,42,2,246,62,127,241,123,137,22,247,219,177,160,84,18,10,84,97,251,127,102,16,209,181,100,94,56,238,209,207,76,189,95,15,165,139,143,189,96,225,55,112,178,27,218,198,223,251,52,123,94,130,220,142,216,116,237,18,254,49,59,128,41,29,15,179,164,85,76,167,166,151,39,221,2,190,68,167,26,177,114,141,4,67,25,69,182,38,166,160,27,151,148,108,48,227,60,112,48,22,159,76,127,251,63,254,177,113,217,197,95,179,109,128,138,99,27,249,10,174,155,129,80,39,165,252,85,60,131,183,98,107,68,207,19,233,231,55,225,126,77,49,53,145,203,113,29,208,64,237,182,229,165,7,11,169,106,253,116,141,200,62,16,38,121,55,148,91,83,160,140,126,121,12,79,189,72,172,31,243,240,209,229,32,220,91,229,81,94,247,121,153,151,232,182,171,198,50,31,152,245,172,151,130,55,62,125,38,155,229,78,207,148,201,2,78,63,119,107,168,78,139,141,163,177,191,239,141,39,182,174,40,76,226,62,125,209,6,6,34,37,147,85,204,103,51,191,36,248,17,175,20,1,53,16,35,143,237,177,125,86,29,219,235,20,121,205,59,5,250,107,109,32,224,30,152,143,113,151,95,85,19,254,164,135,124,68,136,199,29,31,244,91,10,84,127,101,210,70,226,195,140,70,166,54,217,165,84,42,165,175,100,234,124,121,105,53,101,118,174,101,220,147,68,161,37,0,182,220,142,221,155,230,115,164,10,214,208,120,91,152,66,27,81,184,48,84,70,7,128,153,217,218,249,226,70,130,200,156,61,227,21,164,137,193,221,119,10,134,204,23,20,17,90,94,105,204,39,99,1,64,153,45,213,19,247,97,194,49,35,125,255,195,139,63,209,175,208,147,189,244,204,24,211,99,142,18,92,130,254,182,231,235,93,10,127,175,87,35,62,110,137,184,39,114,200,150,11,190,40,162,168,223,203,110,242,192,234,26,11,54,155,38,48,79,109,101,119,165,187,223,5,20,168,171,241,20,243,108,199,3,155,69,244,149,0,187,110,12,233,42,151,189,139,133,104,3,30,16,200,69,4,123,103,144,12,106,182,1,127,91,125,158,12,144,238,232,209,101,159,56,163,240,179,50,169,120,219,176,87,77,45,247,153,190,82,132,50,137,209,97,19,35,247,161,62,77,16,71,152,72,61,50,99,157,154,56,58,175,27,73,121,229,195,228,132,69,233,169,100,21,123,17,3,164,6,146,106,196,29,3,250,217,164,23,171,203,14,242,239,249,169,116,138,209,98,113,181,122,35,162,216,46,230,4,155,142,118,216,232,229,28,12,158,153,126,149,171,172,231,99,211,57,114,136,183,114,74,35,233,115,127,253,157,38,49,136,141,25,161,255,232,110,101,208,166,186,226,12,185,19,155,53,93,155,39,161,7,124,213,52,223,125,211,242,253,22,13,131,115,167,198,188,90,209,63,224,92,112,118,220,165,31,164,43,58,197,77,17,247,77,164,74,77,218,18,187,41,76,189,127,98,18,226,231,71,115,236,68,183,111,50,168,88,247,9,123,65,180,88,74,44,101,101,173,11];class nJ extends tJ{constructor(e,t,i){super(e,iJ,t,i)}}const rJ=[11,196,242,139,198,252,188,5,32,162,171,128,13,160,25,222,172,102,207,244,158,69,103,57,239,111,150,18,157,82,55,210,20,131,156,165,108,122,254,125,130,229,55,109,113,11,210,238,163,213,86,116,156,248,215,63,20,48,173,31,55,133,18,105,32,16,204,35,128,38,212,87,200,97,114,40,12,210,193,171,59,33,158,108,14,75,228,74,65,32,57,192,112,156,234,250,140,189,40,20,6,230,135,52,17,200,123,68,183,44,215,187,234,2,13,169,234,94,115,60,6,107,224,118,254,88,2,235,134,36,120,5,85,94,126,222,223,101,105,227,147,199,64,185,246,143,183,210,30,37,127,226,79,156,118,147,208,131,51,248,232,217,206,181,218,58,61,112,244,227,68,45,41,206,69,12,45,163,205,75,6,23,167,145,250,237,92,84,164,240,253,216,54,85,7,108,62,255,42,217,3,27,0,196,94,28,241,120,80,92,89,135,228,125,2,3,242,39,116,64,248,216,177,122,66,178,180,9,7,33,186,208,213,188,59,78,243,95,123,28,142,45,99,130,7,167,194,156,238,199,10,71,141,251,221,158,16,255,38,181,36,184,20,136,240,55,27,51,191,82,105,55,97,78,74,121,191,161,91,126,105,103,174,139,223,145,150,120,156,240,252,182,105,104,205,65,97,129,194,68,218,91,141,11,224,124,132,138,119,36,201,211,39,203,146,225,246,252,21,161,250,188,137,190,42,4,90,126,211,171,240,113,67,28,92,57,77,200,125,224,19,178,142,112,202,5,233,229,128,235,105,239,102,52,179,224,87,45,68,211,10,187,9,38,190,86,25,43,175,56,231,11,108,220,36,129,131,19,93,163,239,169,118,205,50,77,121,139,139,141,197,170,20,44,39,19,97,205,228,8,106,67,210,135,111,127,141,185,175,123,26,226,42,29,217,16,99,9,46,157,232,22,3,105,174,73,144,23,110,55,84,46,4,116,39,113,205,58,158,242,7,208,75,162,55,115,35,52,124,235,114,178,55,43,98,17,100,33,134,237,190,230,60,184,192,104,146,52,58,79,174,180,81,155,114,0,153,113,90,51,86,150,254,136,205,104,39,11,190,187,233,80,81,81,56,18,222,148,116,155,156,33,132,226,127,84,34,83,28,249,153,18,197,10,116,102,125,45,47,36,235,46,212,166,209,3,125,132,237,124,163,68,197,202,232,152,234,75,235,103,248,160,241,213,151,144,130,37,23,51,48,55,12,227,31,163,242,251,245,22,129,77,20,35,150,20,181,203,138,69,233,215,109,178,209,52,85,96,221,179,56,249,138,111,250,141,134,95,152,92,109,183,174,104,151,156,31,66,211,10,57,141,167,18,177,27,126,74,252,29,143,121,173,203,8,27,44,123,148,57,88,163,68,228,158,62,98,121,192,228,94,92,72,241,33,230,173,0,197,1,194,144,111,91,60,0,106,181,203,51,133,120,250,158,184,93,216,184,126,253,21,22,155,99,80,205,227,69,231,141,165,71,70,252,223,105,51,93,22,165,135,233,177,164,139,53,5,85,151,134,214,165,249,100,24,186,207,245,149,68,218,204,252,32,190,90,48,76,57,31,201,15,52,130,135,152,206,63,198,100,126,36,2,104,116,0,160,163,186,2,91,165,57,149,163,12,239,121,152,209,224,136,248,135,136,46,150,32,51,154,6,105,0,71,30,44,175,147,139,34,91,184,78,31,145,18,3,250,122,166,47,252,109,19,40,10,123,163,99,76,133,119,37,180,38,207,79,171,185,188];class oJ extends tJ{constructor(e,t,i){super(e,rJ,t,i)}}const sJ=[11,196,242,139,198,252,188,5,32,162,171,128,13,160,25,222,172,102,207,244,158,69,103,57,239,111,150,18,157,82,55,210,20,131,156,160,96,121,255,120,207,227,114,120,38,72,149,145,165,227,75,122,158,250,232,46,34,52,135,9,30,144,17,110,126,110,130,71,156,46,210,67,202,51,119,97,3,211,214,227,45,109,151,97,21,10,229,53,80,26,51,202,119,128,230,197,140,135,40,14,88,128,202,95,21,208,96,83,185,98,216,242,224,15,25,224,233,86,96,46,80,120,220,48,187,86,30,240,140,46,95,81,48,90,117,140,177,51,107,235,158,137,5,241,191,154,149,219,30,126,85,175,10,216,63,139,216,151,122,251,224,202,220,227,221,53,122,34,213,224,94,45,14,200,68,31,61,175,208,17,120,82,244,138,208,165,21,19,236,232,180,217,50,74,70,126,114,227,62,192,124,9,85,148,33,77,255,117,75,102,87,151,255,87,74,74,181,111,108,9,249,220,174,59,80,254,168,29,30,94,171,133,133,195,105,64,254,68,65,18,158,54,73,203,65,175,151,170,236,138,17,119,128,237,214,189,28,250,38,149,97,242,81,212,254,57,18,120,155,64,96,108,75,78,74,121,191,243,30,42,60,103,165,196,160,195,216,99,182,173,214,182,105,53,231,3,45,212,144,101,217,65,141,44,230,125,151,154,123,57,134,223,98,133,156,238,137,181,80,175,230,167,131,180,13,69,77,44,156,165,252,14,27,85,71,1,82,196,64,243,26,167,146,98,201,6,195,247,200,224,44,177,104,109,187,231,83,118,28,159,92,179,28,14,162,81,84,21,168,34,156,21,127,215,88,218,208,11,92,161,239,239,82,221,59,86,83,201,199,216,151,139,23,54,39,52,103,204,247,24,102,94,157,138,42,49,131,183,208,50,95,236,54,6,211,26,68,72,56,212,134,24,91,114,132,1,217,80,38,47,29,47,0,107,102,99,129,33,140,243,74,251,89,247,103,12,114,58,113,240,72,188,39,48,72,89,45,102,206,245,247,231,56,167,129,122,222,47,40,78,227,159,64,206,34,127,203,127,87,40,108,152,238,147,231,46,104,89,182,180,232,86,89,91,57,10,222,202,59,199,135,60,199,189,40,84,125,28,84,162,210,91,143,34,106,117,118,3,125,126,237,60,131,173,153,69,49,212,204,117,163,31,239,202,232,152,234,3,162,32,176,184,184,196,154,131,144,115,6,53,122,55,69,166,19,230,183,175,244,1,156,11,37,121,134,121,152,142,158,125,229,150,44,183,216,109,7,65,222,169,56,222,140,110,233,157,138,66,208,6,111,166,188,76,208,222,4,104,211,10,57,141,243,65,228,86,85,88,169,91,237,56,249,133,77,21,32,37,230,55,0,184,110,228,158,62,98,45,147,177,19,119,89,164,103,132,239,84,139,68,204,157,49,41,50,89,113,159,203,51,133,120,184,210,237,15,249,187,100,253,50,16,154,112,64,193,254,10,235,200,253,84,31,169,171,39,122,70,46,186,139,212,162,173,158,41,23,86,148,172,196,237,242,58,102,180,150,238,191,25,240,204,252,125,148,29,124,51,95,10,196,55,49,159,138,144,255,126,205,43,49,42,17,59,60,77,139,177,239,64,36,224,98,205,234,70,199,103,139,218,206,207,178,217,255,32,134,59,25,221,74,22,102,82,19,20,170,142,134,42,106,249,64,80,222,28,21,169,50,235,4,237,56,81,87,76,32,251,42,6,173,105,54,191,8,136,5,245,206,239,176,9,116,24];class aJ extends tJ{constructor(e,t,i){super(e,sJ,t,i)}}const cJ=[11,196,242,139,198,252,188,5,32,162,171,128,13,160,25,222,172,102,207,244,158,69,103,57,239,111,150,18,157,82,55,210,20,131,156,190,100,112,230,97,199,225,96,74,99,94,248,222,162,213,95,122,158,212,233,42,22,37,217,115,36,152,30,123,116,104,212,109,129,41,220,77,213,97,124,45,4,219,197,171,40,18,149,104,20,4,248,102,64,9,50,217,124,131,180,188,159,170,63,1,84,130,150,117,14,212,118,67,165,97,207,242,251,15,30,187,188,77,79,122,67,101,252,109,244,82,37,191,227,35,114,87,57,71,99,218,155,54,101,239,138,197,13,226,228,176,157,158,87,98,55,251,79,150,64,138,200,135,40,132,135,207,146,252,222,57,58,111,151,225,78,59,36,210,70,29,121,160,210,31,109,67,167,194,177,236,91,108,164,229,130,211,59,66,93,18,107,226,54,210,51,8,77,217,19,73,187,33,30,59,9,135,162,49,5,11,225,111,119,11,247,218,129,115,83,205,170,21,4,69,210,133,134,245,109,15,177,9,81,81,203,105,42,158,12,255,151,165,230,205,5,92,196,251,211,187,27,214,43,186,91,233,85,192,229,15,71,38,220,20,38,101,44,78,7,60,251,186,75,103,108,53,166,220,186,208,194,120,207,230,159,248,22,32,142,124,96,157,222,60,191,65,145,6,239,125,151,147,50,58,130,207,110,131,223,231,137,238,28,182,216,167,198,191,37,67,76,1,144,232,218,79,72,28,65,101,43,216,64,253,16,173,179,123,140,27,233,245,199,230,36,181,102,114,247,162,18,34,20,212,25,171,24,28,143,80,94,40,167,34,209,61,117,130,1,198,196,7,21,252,180,255,92,128,119,9,48,156,138,136,151,143,23,44,52,3,40,197,228,31,123,67,163,140,32,54,204,187,149,80,19,255,82,120,195,12,110,65,56,212,143,22,78,44,234,72,140,29,118,103,18,36,7,122,50,37,139,47,142,243,25,208,88,237,126,50,103,127,19,183,29,169,29,1,55,23,100,32,129,239,243,160,61,178,197,117,199,45,57,26,165,135,92,218,59,0,197,54,13,96,40,141,212,221,131,103,46,22,228,191,167,73,20,86,62,11,147,217,116,205,203,110,134,249,51,6,123,23,86,231,157,8,144,83,126,115,118,35,96,36,229,36,220,228,143,71,45,223,129,48,236,5,145,202,188,208,184,70,241,104,255,188,181,146,210,206,144,53,77,101,120,38,8,245,80,230,165,160,183,83,202,79,127,57,214,126,242,150,208,40,239,148,35,163,201,97,74,70,214,181,63,240,147,33,253,149,140,77,197,82,126,189,231,7,196,212,80,14,151,24,57,144,243,81,234,66,24,19,236,2,137,121,246,129,65,7,99,110,174,54,74,182,81,234,142,37,72,110,220,255,64,119,10,188,111,191,228,1,205,9,204,143,56,62,125,84,106,225,131,97,192,43,240,157,161,75,168,247,44,175,65,81,192,48,21,157,167,80,191,130,161,75,85,186,174,42,117,1,68,252,204,138,254,203,152,21,13,64,144,195,207,238,229,54,103,247,159,245,211,85,191,141,168,32,234,85,46,118,12,5,199,4,19,217,203,202,156,33,143,114,116,60,66,40,58,77,208,237,171,26,72,175,114,205,248,87,137,62,210,143,151,197,167,210,241,122,150,104,122,154,2,70,102,83,19,36,141,136,199,42,79,229,71,86,194,109,31,236,80,166,17,230,109,1,40,28,46,224,56,20,230,47,100,254,116,208,76,169,157,241,175,3,70,85,31,38,245,58,33,80,145,237,8,22,71,224,158,156,31,249,81,87,247,230,199,237,96,167,123,63,243,79,156,206,203,160,54,124,68,253,215,132,235,57,185,92,238,55,59,210,104,71,26,183,180,71,12,255,224,192,65,154,72,244,8,164,10,248,46,207,30,92,1,80,244,31,189,138,88,216,218,63,100,227,116,57,119,94,135,5,126,255,32,191,163,61,209,194,88,248,112,139,173,43,69,134,3,160,151,137,25,98,239,166,19,123,208,180,31,120,30,191,75,183,179,126,180,125,92,107,105,206,138,28,67,139,3,188,230,184,255,121,13,181,45,160,114,202,194,123,87,55,124,97,164,82,95,232,216,117,62,5,90,176,82,167,52,160,153,174,168,105,146,91,248,81,79,249,97,138,133,170,245,229,132,61,5,149,224,246,194,213,61,12,109,44,136,235,95,219,133,220,27,93,36,93,124,180,81,141,152,220,170,163,229,197,124,171,232,48,70,251,106,119,150,20,16,49,119,247,42,132,36,76,254,124,177,66,175,9,1,39,92,127,195,171,198,34,2,64,144,179,72,40,151,110,89,229,42,125,33,238,16,220,228,51,203,8,1,68,145,253,133,118,93,163,129,22,13,248,65,12,4,63,101,210,70,170,138,203,14,246,54,194,195,27,107,241,175,35,171,49,52,106,121,45,36,152,85,215,132,78,167,34,18,167,245,152,133,134,170,120,182,10,146,191,37,2,205,47,125,20,203,44,88,81,32,150,223,220,218,238,254,30,212,167,221,115,156,82,226,137,220,221,97,3,139,202,33,9,27,26,126,40,215,25,126,9,82,208,49,217,14,161,81,196,61,60,87,254,213,194,81,216,161,151,209,166,222,230,24,128,117,140,92,4,203,254,170,253,249,88,90,112,226,18,44,122,39,158,158,56,69,204,159,5,179,51,197,233,139,216,102,226,206,248,15,78,112,214,126,67,28,40,38,98,190,178,206,67,94,245,254,160,101,176,32,157,26,132,83,252,228,87,242,32,127,160,112,210,224,133,149,115,41,30,16,200,69,89,81,77,144,12,106,182,73,54,28,53,195,28,216,179,179,136,35,141,102,234,177,240,34,186,106,145,245,3,84,48,251,157,245,11,217,111,227,138,42,67,114,211,177,37,103,16,71,152,72,117,123,36,213,202,56,124,227,84,8,45,229,149,165,214,69,244,169,55,68,62,94,104,228,74,205,123,222,17,7,172,158,227,74,206,149,67,175,171,251,185,121,151,223,63,35,229,32,49,190,209,120,137,69,213,214,19,150,187,177,28,12,158,153,126,149,171,167,234,120,129,109,32,157,180,75,66,56,233,115,127,230,157,32,34,143,156,31,230,168,174,125,118,195,249,243,165,81,246,10,144,15,103,139,55,173,7,59,136,69,172,54,132,165,140,78,77,230,33,169,129,188,71,209,109,161,8,57,57,199,143,31,164,43,58,130,1,110,145,31,229,13,46,149,94,244,106,76,238,105,107,1,183,177,10,61,225,94,185,116,58,183,95,225,22,119,19,248,28,13,123,125,108,158,64,184,77,245,153,162,217,227,208,41,185,211,235,41,153,181,54,166,165,11,154,55,21,184,209,192,249,44,164,160,29,229,159,82,156,198,241,183,114,83,137,186,151,148,31,21,197,216,145,32,13,50,22,241,137,39,71,28,142,160,215,107,221,45,202,104,227,110,186,12,150,145,240,51,49,44,196,115,224,238,149,189,134,99,67,241,62,157,240,114,247,195,26,200,141,97,147,249,23,150,174,10,13,219,81,73,58,242,96,250,243,15,49,218,58,230,104,252,175,150,123,86,185,84,90,198,6,36,0,99,72,28,166,238,115,231,171,249,179,71,174,68,156,227,17,198,79,73,142,99,144,20,80,62,80,191,142,46,71,9,243,6,8,214,116,72,190,106,161,19,185,100,9,187,64,94,86,203,174,156,245,222,95,54,30,148,19,11,50,112,96,61,237,159,173,7,154,127,175,79,48,97,89,78,126,66,171,204,158,195,27,226,205,222,157,89,251,90,125,37,212,27,97,3,141,247,175,50,121,7,187,68,196,181,202,167,189,57,84,81,222,23,27,84,130,176,98,66,240,207,18,23,28,163,163,194,45,37,129,202,170,97,189,0,81,238,0,39,199,163,35,211,206,247,65,29,116,242,67,102,235,13,136,232,230,114,146,187,7,254,142,26,121,16,237,5,160,201,114,94,178,199,95,212,241,45,112,180,188,72,86,114,189,155,149,149,163,210,112,101,12,69,225,75,202,223,28,242,90,215,156,169,224,245,135,128,92,148,217,131,208,255,25,135,117,136,5,104,185,249,161,228,214,16,105,204,9,182,135,153,220,101,244,160,207,58,182,118,185,240,57,245,123,13,112,182,106,229,220,90,29,86,215,96,147,232,2,55,131,225,137,68,245,89,141,252,97,3,129,155,216,223,98,116,45,78,85,141,161,74,215,7,150,171,225,59,78,221,152,236,14,117,100,208,158,86,13,185,124,87,157,111,40,187,182,124,173,71,173,23,199,52,155,190,134,11,23,64,25,215,39,115,231,173,77,72,114,54,252,116,178,59,221,106,241,119,254,30,226,241,204,233,113,197,96,146,0,41,67,3,231,126,12,218,202,22,171,114,249,176,134,160,19,216,31,229,118,226,62,242,126,126,42,127,130,68,218,218,81,202,106,217,191,25,177,82,97,81,36,232,137,58,90,216,190,117,235,20,194,144,76,178,27,213,13,208,18,29,118,126,49,98,203,179,128,237,100,32,242,189,212,6,210,210,188,161,205,13,124,119,13,215,112,41,183,176,215,168,210,182,111,1,115,2,239,141,8,177,124,112,48,197,2,239,11,99,4,36,77,69,47,244,19,153,61,19,2,96,176,7,112,122,131,169,25,189,116,171,49,12,121,162,79,154,74,251,50,233,182,63,180,224,118,49,253,21,20,16,31,144,184,93,174,231,244,183,13,49,225,189,211,73,185,49,110,142,25,226,45,176,233,204,74,33,16,205,88,131,92,157,170,175,68,170,61,53,116,165,16,27,182,160,181,87,241,15,151,85,107,76,167,129,25,172,127,184,138,153,222,228,125,64,44,45,32,12,227,148,106,152,83,240,166,54,235,32,190,12,242,164,123,189,53,194,141,104,43,202,110,4,168,119,245,232,179,178,198,1,224,87,86,160,31,19,140,233,102,191,204,4,98,138,163,191,106,24,213,47,208,82,137,132,131,16,253,84,25,144,90,159,148,16,196,84,166,61,160,101,229,227,93,118,59,87,66,16,128,59,96,131,250,20,184,150,205,91,227,201,62,35,79,180,172,173,85,197,106,153,238,229,60,204,65,193,230,94,101,177,134,6,165,53,171,142,208,155,2,11,4,202,127,54,17,142,117,227,121,128,204,192,147,147,92,189,5,224,148,72,18,83,101,126,124,228,153,242,123,229,247,92,221,6,73,227,250,87,167,194,129,187,73,38,185,109,217,240,193,88,50,178,180,151,54,197,187,137,190,166,233,1,103,204,88,31,127,185,29,65,1,29,254,223,14,83,167,215,114,248,30,173,89,173,187,69,5,105,117,15,106,94,173,63,227,25,230,190,136,168,177,175,107,91,126,254,34,188,25,118,48,12,226,130,153,162,57,47,181,212,79,160,97,64,157,246,90,53,43,149,76,102,15,195,107,58,242,84,172,29,81,198,113,81,251,138,182,154,111,30,171,129,56,17,45,214,153,112,117,203,174,40,38,234,236,32,4,112,225,26,187,195,246,252,9,218,69,160,223,178,54,148,81,8,134,151,75,248,63,224,240,48,75,250,221,85,46,100,50,3,70,64,102,111,160,155,233,59,147,184,57,61,6,126,79,176,16,185,94,166,33,135,78,42,75,140,208,140,44,153,187,64,103,119,160,236,16,239,74,218,219,212,207,110,53,30,76,248,40,111,98,44,20,113,204,233,109,135,96,107,39,163,203,125,45,157,152,71,239,175,174,159,147,80,111,93,38,253,228,154,225,181,101,12,241,127,65,49,189,5,85,151,237,213,143,14,104,138,54,52,27,4,132,67,35,156,86,157,73,16,229,222,245,110,79,165,179,56,179,53,218,229,100,58,87,149,48,231,64,63,115,67,3,172,6,186,115,154,60,53,214,152,149,89,234,37,143,82,255,64,28,183,93,112,39,70,185,57,0,199,9,61,175,219,41,76,37,176,82,125,65,53,160,214,105,62,153,244,222,96,205,6,178,85,41,240,113,0,96,149,38,3,195,18,152,41,246,3,103,29,110,134,30,101,75,46,103,199,184,20,230,8,55,120,4,229,168,35,43,7,28,161,143,87,27,87,79,255,186,44,195,158,155,181,119,81,172,217,107,95,98,55,243,186,66,105,48,224,123,232,84,156,20,10,156,208,204,52,34,228,136,97,242,200,246,211,67,202,40,241,91,92,253,9,54,72,131,221,106,178,32,44,182,4,225,193,37,20,249,249,231,10,206,18,71,254,221,187,172,88,204,6,127,138,102,7,208,75,147,219,199,177,79,36,170,101,207,177,109,95,143,217,41,199,80,183,201,2,254,12,55,23,198,14,255,69,245,138,155,129,227,167,168,130,156,135,14,96,93,48,99,143,107,126,92,117,143,112,108,193,228,84,13,41,186,27,172,92,201,149,116,19,112,197,116,209,128,102,1,55,152,177,28,37,34,50,83,41,199,74,178,59,111,67,118,35,252,36,33,87,28,170,17,215,47,90,154,124,137,15,14,211,59,75,59,30,77,0,49,37,225,191,87,101,127,214,227,160,99,174,234,82,148,235,16,241,219,147,170,127,221,250,116,39,218,156,72,227,172,55,0,79,188,76,51,222,232,24,36,62,94,154,3,61,230,146,114,253,0,128,58,253,90,72,211,242,38,39,133,153,161,119,105,195,152,225,208,105,140,80,217,186,196,157,21,116,230,116,139,25,159,143,118,128,77,201,238,247,228,15,168,4,133,148,21,148,12,44,241,7,115,17,129,176,202,46,130,122,129,235,141,223,85,21,199,65,181,169,52,174,161,153,62,25,164,115,213,89,138,199,103,79,200,165,135,249,244,27,209,178,240,129,211,61,9,111,157,147,119,36,119,255,110,130,84,49,210,225,247,100,26,121,127,163,160,26,79,99,24,77,65,32,178,109,36,27,253,173,110,183,11,14,211,57,130,254,124,104,165,219,31,70,97,14,194,39,61,26,141,125,228,126,194,184,101,160,204,106,128,144,106,103,171,18,246,129,220,85,172,151,123,5,73,155,192,175,91,157,239,61,237,116,170,65,233,56,19,49,114,168,190,3,214,53,250,90,213,244,88,101,30,229,248,124,15,71,141,27,172,235,21,129,211,72,61,172,112,170,128,135,96,196,221,255,27,176,105,188,183,121,33,37,149,53,131,226,233,29,167,234,218,109,53,185,152,36,248,53,61,235,78,21,201,214,210,163,12,251,187,45,188,137,126,127,237,92,234,91,240,225,38,194,57,213,251,237,171,30,99,52,14,49,84,101,252,237,7,166,122,114,32,107,32,207,239,136,168,178,12,11,241,233,230,146,132,18,83,233,41,172,17,6,161,42,113,87,40,255,185,1,146,128,5,240,126,131,71,42,54,124,205,2,122,71,30,222,229,40,134,142,102,97,239,151,177,1,230,231,49,123,219,28,129,91,152,112,13,154,81,197,226,255,112,158,178,177,55,181,108,138,185,245,29,186,21,73,188,209,154,200,89,116,235,198,144,36,87,248,22,7,200,122,7,148,44,42,87,140,238,204,95,231,252,0,136,0,22,39,70,123,125,165,113,227,172,146,163,128,158,36,52,91,19,36,245,27,150,138,141,11,67,239,224,65,24,116,101,7,39,46,142,172,164,243,148,0,33,226,59,47,203,137,156,241,66,250,157,30,204,101,143,134,98,238,155,226,25,184,136,219,89,100,193,11,143,71,139,243,230,151,0,249,1,78,26,32,93,104,157,67,97,164,248,86,124,146,93,74,222,228,167,55,53,100,135,216,109,13,64,37,106,177,200,200,182,92,251,69,31,243,89,80,198,14,132,203,72,103,28,104,217,24,97,223,113,11,29,178,191,210,46,162,255,68,99,8,237,213,162,152,193,183,121,203,19,108,182,29,86,26,192,103,220,103,205,154,179,197,9,22,73,127,175,146,38,119,210,0,24,180,21,245,215,204,91,186,119,138,183,239,15,155,231,248,133,39,24,101,144,236,10,230,54,174,227,73,21,110,10,160,241,232,131,14,212,127,232,59,122,65,146,54,163,9,189,190,121,88,170,62,194,14,204,152,245,38,131,37,91,81,72,114,29,115,239,182,56,44,156,159,177,180,82,160,93,97,86,183,236,50,95,85,39,71,181,225,152,143,63,123,117,34,44,109,160,166,229,240,91,138,102,54,180,173,44,50,80,42,124,7,50,124,211,239,21,94,197,185,239,213,107,142,64,95,124,125,17,180,97,189,101,52,48,19,112,12,70,9,212,177,54,118,66,84,147,236,248,26,124,95,103,135,254,124,49,112,186,99,120,90,8,194,191,88,57,242,65,61,10,104,246,197,252,19,159,58,194,75,173,242,103,8,115,84,69,238,149,26,15,159,182,141,132,119,70,29,53,20,143,46,163,204,6,236,59,45,185,172,89,119,83,38,144,36,222,96,151,26,99,195,163,170,133,92,159,214,53,150,116,90,176,69,145,130,15,172,140,217,215,101,163,115,161,65,101,8,7,183,113,213,134,58,175,130,251,143,173,248,168,135,60,159,30,194,68,208,119,120,2,40,178,227,247,161,77,47,136,46,244,163,72,65,158,25,225,195,61,132,182,204,177,186,200,81,2,65,105,212,72,94,203,232,217,182,123,251,228,160,1,161,204,123,20,37,1,77,208,179,45,149,181,122,102,190,123,213,164,231,41,216,130,234,248,208,251,252,220,84,209,67,47,61,220,5,142,162,26,236,121,142,248,132,255,65,122,203,196,102,191,187,2,195,127,255,193,92,49,91,186,154,39,156,29,211,172,49,104,245,114,153,223,211,199,249,35,130,160,128,0,152,176,183,20,236,113,193,108,26,255,11,237,102,133,245,94,115,114,10,89,229,214,221,99,149,30,99,37,246,10,26,26,39,92,123,170,73,211,127,227,54,30,86,133,159,112,225,91,148,100,174,149,75,143,14,140,20,44,64,212,5,243,8,116,63,30,97,42,123,20,73,212,85,207,83,122,27,251,233,84,10,17,236,232,83,200,127,119,143,163,204,220,167,59,231,20,106,186,222,191,8,40,234,21,25,180,13,116,250,152,224,174,75,3,205,38,173,215,236,151,185,121,254,244,154,239,17,53,106,164,61,49,116,216,118,94,150,35,181,26,238,66,49,211,221,132,146,166,115,39,136,36,205,230,179,31,197,51,148,165,109,38,70,37,148,52,44,209,250,98,58,246,225,103,198,101,26,25,196,207,8,166,21,88,252,175,253,10,88,107,157,19,225,61,12,246,221,37,239,186,167,137,142,135,222,128,174,62,95,216,38,141,157,45,232,97,217,173,203,234,116,129,69,206,189,94,221,12,54,139,186,247,184,16,200,121,244,104,8,7,35,111,47,188,10,140,92,73,143,206,203,72,122,184,20,102,197,130,64,150,63,96,239,8,132,111,217,84,91,198,32,43,100,138,241,15,160,42,190,253,193,184,164,124,29,210,96,67,224,221,182,29,218,129,149,29,128,174,98,88,88,125,56,40,255,120,5,0,87,174,42,150,90,112,201,183,169,19,57,195,191,12,58,244,235,132,25,145,72,146,214,8,125,100,135,12,5,102,97,248,174,24,159,90,33,43,187,6,61,212,241,225,190,219,252,197,123,129,164,108,123,55,230,4,153,166,105,234,15,85,216,23,56,32,3,41,110,68,146,172,133,202,98,41,7,47,152,35,255,168,106,241,226,222,77,244,52,185,65,252,227,32,66,38,11,172,60,28,28,103,84,1,1,205,182,190,28,189,102,253,43,1,191,148,116,10,227,18,81,93,80,239,157,232,215,180,163,165,161,109,177,71,150,244,144,208,160,110,22,174,60,206,43,103,121,55,103,114,115,173,238,13,10,227,251,41,176,216,158,229,216,55,234,128,128,20,167,106,181,86,163,130,215,110,149,191,10,227,215,8,214,154,178,181,15,19,0,247,250,97,74,43,157,55,94,174,41,41,9,199,97,20,91,32,18,10,43,98,240,247,203,20,250,117,160,44,229,202,187,64,54,124,15,184,169,129,27,160,240,26,61,255,60,166,60,144,209,84,55,187,186,168,13,124,125,29,17,100,249,227,62,205,78,179,163,168,139,168,21,38,83,239,151,74,43,66,2,92,72,71,94,216,134,238,20,45,158,213,164,73,57,80,47,198,184,130,223,227,71,132,133,235,177,85,174,142,124,172,200,54,229,40,126,60,76,92,216,153,56,241,174,66,141,90,226,3,30,68,234,71,187,163,112,146,255,22,143,170,204,3,127,179,81,139,160,37,77,246,128,220,196,158,153,73,177,65,199,119,29,197,144,130,248,206,155,253,108,213,124,7,223,221,162,146,134,242,65,99,162,107,120,247,214,207,96,150,169,131,208,218,221,28,24,112,208,23,1,130,142,232,56,104,45,33,158,95,255,123,31,74,76,120,178,155,213,6,195,164,8,8,69,241,197,127,83,169,21,167,19,94,143,252,33,159,248,241,170,153,147,1,149,199,201,131,170,79,236,212,209,143,107,98,24,123,56,33,193,85,247,64,225,135,210,78,145,57,16,145,71,170,20,133,87,235,4,166,239,100,82,235,81,50,223,9,193,52,49,86,129,190,196,82,165,107,63,115,161,98,33,20,193,29,42,151,205,252,124,72,245,48,181,67,7,13,21,127,59,226,188,144,129,112,244,192,121,213,80,42,196,1,13,107,108,78,0,40,121,225,148,237,234,209,216,238,9,147,226,254,96,89,212,72,193,106,75,135,74,227,67,255,92,191,81,188,124,226,149,152,142,15,159,195,238,114,55,255,166,157,230,59,148,170,166,151,65,213,104,253,253,112,150,82,147,137,27,214,100,247,65,81,92,47,86,217,7,45,120,81,130,31,236,243,76,78,3,45,105,172,220,71,48,220,94,196,249,163,193,133,50,236,205,20,55,2,63,14,127,69,113,212,204,12,58,79,89,86,29,61,199,201,64,149,6,144,182,150,129,31,18,167,120,248,82,107,25,143,128,27,161,28,25,153,183,217,238,78,186,106,92,27,202,219,165,96,0,216,234,169,73,101,39,182,113,217,240,170,116,172,221,250,233,48,49,242,83,227,92,181,184,72,230,180,21,15,108,135,25,38,153,25,124,227,26,149,73,236,39,211,244,149,58,183,132,26,223,219,174,144,117,233,219,165,205,157,159,222,184,52,47,241,201,123,65,24,44,55,215,177,168,250,179,115,190,227,123,158,163,179,224,69,196,66,207,254,243,101,221,193,140,250,4,28,222,52,96,138,160,33,218,64,118,214,234,201,152,148,91,178,111,107,144,142,6,182,102,72,188,34,213,181,26,223,58,255,103,81,17,47,169,11,245,224,123,148,215,237,186,107,75,152,90,202,166,22,149,197,5,246,238,78,76,229,106,199,94,127,195,0,45,82,6,159,103,96,138,231,71,46,107,59,216,39,43,12,221,27,214,56,155,145,66,187,169,250,235,78,211,179,239,183,198,163,93,5,196,24,174,143,225,106,139,89,98,13,127,207,184,194,30,1,165,198,169,8,197,118,86,163,221,138,23,209,61,116,79,99,233,43,130,60,244,85,229,243,172,123,148,200,120,192,127,211,52,11,159,41,95,212,230,188,169,156,137,29,212,12,148,168,148,133,243,44,241,139,127,24,246,220,227,125,209,97,60,52,162,192,146,49,161,92,138,112,189,128,59,126,125,46,207,60,79,231,174,152,209,68,223,205,2,38,14,91,116,159,255,28,27,178,248,164,104,158,79,69,214,234,157,12,75,163,83,253,245,202,61,213,176,6,197,230,29,208,166,253,194,254,235,29,141,241,70,249,15,62,0,148,163,135,52,122,40,96,87,31,179,152,51,216,133,184,122,198,203,60,115,218,191,193,16,178,25,148,252,112,104,103,252,36,92,221,28,179,43,199,198,151,128,100,252,217,161,249,34,201,172,118,52,180,252,104,7,223,44,116,102,212,21,40,224,184,55,163,210,21,207,161,239,51,54,155,41,133,18,67,48,3,165,130,251,4,79,214,57,72,130,157,212,144],AJ=[0,1,3,4,6,7,9,10,12,13,15,16,18,19,21,22,24,26,29,31,34,36,39,41,44,46,49,51,54,56,59,61,64,65,66,67,68,69,70,72,73,74,75,76,77,79,80,81,82,83,84,85,87,88,89,90,91,92,94,95,96,97,98,99,101,102,103,104,105,106,107,109,110,111,112,113,114,116,117,118,119,120,121,123,124,125,126,127,128,129,131,132,133,134,135,136,138,139,140,141,142,143,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,162,163,164,165,166,168,169,170,171,172,173,175,176,177,178,179,180,182,183,184,185,186,187,188,190,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,212,213,214,215,216,217,219,220,221,222,223,224,226,226,226,227,227,227,228,228,228,229,229,229,230,230,231,231,231,232,232,232,233,233,233,234,234,235,235,235,236,236,236,237,237,237,238,238,239,239,239,240,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,253,253,253,254,254,254,255],dJ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,35,36,37,39,40,42,43,44,46,47,49,50,51,53,54,56,57,58,59,61,62,63,64,66,67,68,69,71,72,73,74,76,77,78,79,81,82,83,84,86,87,88,90,91,92,93,95,96,97,98,100,101,102,103,105,106,107,108,110,111,112,113,115,116,117,118,120,121,122,124,125,126,127,129,130,131,132,134,135,136,137,139,140,141,142,144,145,146,147,149,150,151,152,154,155,156,158,159,160,161,163,164,165,166,168,169,170,171,173,174,175,176,178,179,180,181,183,184,185,186,188,189,190,192,193,194,195,197,198,199,200,202,203,204,205,207,208,209,210,212,213,214,215,217,218,219,220,222,223,224,226,226,226,227,227,228,228,229,229,230,230,231,231,232,232,233,233,234,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,253,253,253,254,254,254,255],uJ=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,43,44,45,46,47,48,50,51,52,53,54,55,56,58,59,60,61,62,63,65,66,67,68,69,70,72,73,74,76,77,78,80,81,83,84,85,87,88,89,91,92,94,95,96,98,99,100,102,103,105,106,107,109,110,111,113,114,116,117,118,120,121,122,124,125,127,128,129,131,132,133,135,136,138,139,140,142,143,144,146,147,149,150,151,153,154,155,157,158,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,192,193,193,194,195,195,196,197,197,198,199,199,200,201,201,202,203,203,204,205,205,206,207,207,208,209,209,210,211,211,212,213,213,214,215,215,216,217,217,218,219,219,220,221,221,222,223,223,224,225,225,226,227,227,228,229,229,230,231,231,232,233,233,234,235,235,236,237,237,238,239,239,240,241,241,242,243,243,244,245,245,246,247,247,248,249,249,250,251,251,252,253,253,254,255];class EJ extends tJ{constructor(e,t,i,n){super(e,cJ,i,n),tD(this,"inputTexture",void 0),tD(this,"lightLevel",.1),tD(this,"rednessLevel",.5),tD(this,"mskin_he_max",175/180*3.141593),tD(this,"mskin_he_min",115/180*3.141593),tD(this,"mskin_hc_max",173/180*3.141593),tD(this,"mskin_hc_min",116/180*3.141593),tD(this,"mskin_hc_axis",2.04203545),tD(this,"mfacts_rotate_c",0),tD(this,"mfacts_rotate_le",0),tD(this,"mfacts_rotate_ge",0),tD(this,"tab_addr",null),tD(this,"lutTextures",[]),this.inputTexture=t,this.init()}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY"),t=this.gl.getUniformLocation(this.program,"u_denoiseLevel");this.gl.uniform1f(t,this.denoiseLevel),this.gl.uniform1f(e,1);const i=this.gl.getUniformLocation(this.program,"light");this.gl.uniform1f(i,this.lightLevel);const n=this.gl.getUniformLocation(this.program,"redness");this.gl.uniform1f(n,this.rednessLevel);const r=this.gl.getUniformLocation(this.program,"skin_he_max"),o=this.gl.getUniformLocation(this.program,"skin_he_min"),s=this.gl.getUniformLocation(this.program,"skin_hc_max"),a=this.gl.getUniformLocation(this.program,"skin_hc_min"),c=this.gl.getUniformLocation(this.program,"skin_hc_axis"),A=this.gl.getUniformLocation(this.program,"facts_rotate_c"),d=this.gl.getUniformLocation(this.program,"facts_rotate_le"),u=this.gl.getUniformLocation(this.program,"facts_rotate_ge");this.gl.uniform1f(r,this.mskin_he_max),this.gl.uniform1f(o,this.mskin_he_min),this.gl.uniform1f(s,this.mskin_hc_max),this.gl.uniform1f(a,this.mskin_hc_min),this.gl.uniform1f(c,this.mskin_hc_axis),this.gl.uniform1f(A,this.mfacts_rotate_c),this.gl.uniform1f(d,this.mfacts_rotate_le),this.gl.uniform1f(u,this.mfacts_rotate_ge);const E=this.gl.getUniformLocation(this.program,"u_originImage");this.gl.activeTexture(this.gl.TEXTURE2),this.gl.bindTexture(this.gl.TEXTURE_2D,this.inputTexture),this.gl.uniform1i(E,2);const l=["lighten_lut"],h=[this.gl.TEXTURE3];for(let e=0;e<l.length;e++){const t=this.gl.getUniformLocation(this.program,l[e]);this.gl.activeTexture(h[e]),this.gl.bindTexture(this.gl.TEXTURE_2D,this.lutTextures[e]),this.gl.uniform1i(t,e+3)}}setParameters(e){void 0!==e.denoiseLevel&&(this.denoiseLevel=e.denoiseLevel),void 0!==e.lightLevel&&(this.lightLevel=e.lightLevel),void 0!==e.rednessLevel&&(this.rednessLevel=e.rednessLevel,this.updateRedness(this.rednessLevel)),e.lighteningContrastLevel&&this.updateLut(e.lighteningContrastLevel)}init(){this.tab_addr=new Uint8Array(dJ);const e=[this.tab_addr],t=[256],i=[1];for(let n=0;n<e.length;n++){const r=this.gl.createTexture();if(!r)throw new pw(hw.WEBGL_INTERNAL_ERROR,"create lut texture failed");this.gl.bindTexture(this.gl.TEXTURE_2D,r),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.LUMINANCE,t[n],i[n],0,this.gl.LUMINANCE,this.gl.UNSIGNED_BYTE,e[n]),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.lutTextures.push(r)}}updateRedness(e){const t=3.141593;let i,n,r=e,o=r;r>1&&(r=1),r<0&&(r=0),o>1&&(o=1),o<0&&(o=0),this.mfacts_rotate_c=.8*r,o<.8&&(o=0),this.mskin_he_max=175/180*t,this.mskin_hc_max=173/180*t,this.mskin_he_min=(115-4*o)/180*t,this.mskin_hc_min=(116-4*o)/180*t,this.mskin_hc_axis=(117-4*o)/180*t,this.mskin_hc_axis<this.mskin_hc_min&&(this.mskin_hc_axis=this.mskin_hc_min),this.mskin_hc_min<t/2&&(this.mskin_hc_min=t/2),this.mskin_hc_axis<t/2&&(this.mskin_hc_axis=t/2),this.mskin_he_min<t/2&&(this.mskin_he_min=t/2),this.mskin_hc_max>t&&(this.mskin_hc_max=t),this.mskin_hc_axis>t&&(this.mskin_hc_axis=t),this.mskin_he_max>t&&(this.mskin_he_max=t),i=this.mskin_he_max-this.mskin_hc_max,n=this.mskin_hc_max-this.mskin_hc_axis,this.mfacts_rotate_ge=i>.01?this.mfacts_rotate_c*n/i:this.mfacts_rotate_c,i=this.mskin_hc_min-this.mskin_he_min,n=this.mskin_hc_axis-this.mskin_hc_min,this.mfacts_rotate_le=i>.01?this.mfacts_rotate_c*n/i:this.mfacts_rotate_c}updateLut(e){let t=null;if(0===e&&(t=dJ),1===e&&(t=uJ),2===e&&(t=AJ),!t)throw new pw(hw.WEBGL_INTERNAL_ERROR,"invalid ylut_table value:"+e);this.tab_addr=new Uint8Array(t);const i=[this.tab_addr],n=[256],r=[1];for(let e=0;e<i.length;e++)this.gl.bindTexture(this.gl.TEXTURE_2D,this.lutTextures[e]),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.LUMINANCE,n[e],r[e],0,this.gl.LUMINANCE,this.gl.UNSIGNED_BYTE,i[e])}}class lJ{constructor(){tD(this,"gl",null),tD(this,"canvas",null),tD(this,"programs",[]),tD(this,"commonProgram",null),tD(this,"inputTexture",null),tD(this,"outputTextures",[]),tD(this,"fbos",[]),tD(this,"originalFrameWidth",0),tD(this,"originalFrameHeight",0),tD(this,"enableBeauty",!1),tD(this,"denoiseLevel",5),tD(this,"lightLevel",.35),tD(this,"rednessLevel",.5),tD(this,"lighteningContrastLevel",1)}setEnableBeauty(e){this.enableBeauty=!!e}init(e,t,i){if(!XP().supportWebGL)throw new pw(hw.NOT_SUPPORTED,"your browser is not support webGL");if(this.gl=i.getContext("webgl"),!this.gl)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not get webgl context");if(this.initGL(e,t),!this.inputTexture)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not find input texture");this.canvas=i,this.programs.push(new eJ(this.gl)),this.programs.push(new nJ(this.gl,e,t)),this.programs.push(new oJ(this.gl,e,t)),this.programs.push(new aJ(this.gl,e,t)),this.programs.push(new EJ(this.gl,this.inputTexture,e,t)),this.commonProgram=this.programs[0].program,this.setDenoiseLevel(this.denoiseLevel),this.setLightLevel(this.lightLevel),this.setRednessLevel(this.rednessLevel),this.setContrastLevel(this.lighteningContrastLevel)}render(e){if(!this.gl||!this.commonProgram||!this.canvas)return void mw.warning("video effect manager is not init!");let t=0;if(this.originalFrameHeight===e.videoWidth&&this.originalFrameWidth===e.videoHeight)t=2;else if(this.originalFrameHeight!==e.videoHeight||this.originalFrameWidth!==e.videoWidth){if(mw.debug("beauty effect: resolution changed ".concat(this.originalFrameWidth,"x").concat(this.originalFrameHeight," -> ").concat(e.videoWidth,"x").concat(e.videoHeight)),0===e.videoHeight||0===e.videoWidth)return void mw.debug("beauty effect: skip 0 resolution frame");this.canvas.width=e.videoWidth,this.canvas.height=e.videoHeight,e.setAttribute("width",e.videoWidth.toString()),e.setAttribute("height",e.videoHeight.toString()),this.release(),this.init(e.videoWidth,e.videoHeight,this.canvas)}this.gl.viewport(0,0,e.videoWidth,e.videoHeight),this.gl.bindTexture(this.gl.TEXTURE_2D,this.inputTexture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e);const i=this.enableBeauty?this.programs.length-1:0;for(let e=0;e<=i;e++){const i=this.programs[e].program;this.gl.useProgram(i);const n=this.gl.getUniformLocation(i,"u_image");this.programs[e].setUniforms(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.fbos[t+e%2]),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.outputTextures[t+e%2]),this.gl.uniform1i(n,0)}this.gl.useProgram(this.commonProgram);const n=this.gl.getUniformLocation(this.commonProgram,"u_flipY");this.gl.uniform1f(n,-1),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}setDenoiseLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({denoiseLevel:e})})),this.denoiseLevel=e}setLightLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({lightLevel:e})})),this.lightLevel=e}setRednessLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({rednessLevel:e})})),this.rednessLevel=e}setContrastLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({lighteningContrastLevel:e})})),this.lighteningContrastLevel=e}setSize(e,t){this.programs.forEach((i=>{i instanceof tJ&&i.setSize(e,t)}))}release(){this.gl=null,this.commonProgram=null,this.inputTexture=null,this.programs=[],this.outputTextures=[],this.fbos=[]}initGL(e,t){if(!this.gl)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not find webgl context");this.inputTexture=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this.inputTexture),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR);for(let i=0;i<4;i++){const n=this.gl.createTexture();if(!n)throw new pw(hw.WEBGL_INTERNAL_ERROR,"create texture failed");this.gl.bindTexture(this.gl.TEXTURE_2D,n),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),i<2?this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null):this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null);const r=this.gl.createFramebuffer();if(!r)throw new pw(hw.WEBGL_INTERNAL_ERROR,"create frame buffer failed");this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,r),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,n,0),this.outputTextures.push(n),this.fbos.push(r)}this.gl.viewport(0,0,e,t),this.originalFrameWidth=e,this.originalFrameHeight=t}}class hJ{constructor(){tD(this,"targetFrameRate",0),tD(this,"recordedFrameCount",0),tD(this,"recordingTime",2),tD(this,"recordID",void 0)}async startRecordBeautyEffectOutput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(this.recordID)throw new pw(hw.UNEXPECTED_ERROR,"another beauty effect recording is in progress");const i=vG(6,"");return this.recordID=i,this.targetFrameRate=e,this.recordedFrameCount=0,this.recordingTime=t,await SG(1e3*this.recordingTime),this.recordID!==i?(this.recordID=void 0,!0):(this.recordID=void 0,this.recordedFrameCount<this.targetFrameRate*this.recordingTime/2?(mw.warning("detect beauty effect overload, current framerate",this.recordedFrameCount/2),!1):(mw.debug("beauty effect current framerate",this.recordedFrameCount/2),!0))}stopRecordBeautyEffectOutput(){this.targetFrameRate=0,this.recordedFrameCount=0,this.recordID=void 0}addFrame(){this.recordID&&(this.recordedFrameCount+=1)}}class pJ extends qW.exports.VideoProcessor{constructor(){super(),tD(this,"name","BeautyProcessor"),tD(this,"fps",15),tD(this,"canvas",void 0),tD(this,"video",void 0),tD(this,"manager",void 0),tD(this,"overloadDetector",new hJ),tD(this,"stopChromeBackgroundLoop",null),tD(this,"onOverload",void 0),tD(this,"stopLoop",void 0),tD(this,"lastRenderTime",0),this.fps=30,this.manager=new lJ,this._enabled=!1}async onEnableChange(e){this.manager.setEnableBeauty(e),this.context&&this.inputTrack&&(e?await this.startEffect(this.inputTrack,this.context):await this.stopEffect(this.inputTrack,this.context))}async setBeautyEffectOptions(e){if(function(e){void 0!==e.smoothnessLevel&&EL(e.smoothnessLevel,"options.smoothnessLevel",0,1,!1),void 0!==e.lighteningLevel&&EL(e.lighteningLevel,"options.lighteningLevel",0,1,!1),void 0!==e.rednessLevel&&EL(e.rednessLevel,"options.rednessLevel",0,1,!1),void 0!==e.lighteningContrastLevel&&uL(e.lighteningContrastLevel,"options.lighteningContrastLevel",[0,1,2])}(e),void 0!==e.smoothnessLevel){const t=Math.max(.1,10*e.smoothnessLevel);this.manager.setDenoiseLevel(t)}if(void 0!==e.lighteningLevel){const t=Math.max(.1,e.lighteningLevel/2);this.manager.setLightLevel(t)}if(void 0!==e.rednessLevel){const t=Math.max(.01,e.rednessLevel);this.manager.setRednessLevel(t)}if(void 0!==e.lighteningContrastLevel){const t=e.lighteningContrastLevel;this.manager.setContrastLevel(t)}}async onTrack(e,t){var i;this.video&&this.enabled&&(null===(i=this.stopLoop)||void 0===i||i.call(this),await this.stopEffect(e,t)),await this.startEffect(e,t)}async startEffect(e,t){if(!this.enabled)return;const i=Dy(),n=await this.renderWithWebGL(e);this.output(n,t),mw.info("start video effect, output:",this.outputTrack),this.overloadDetector.startRecordBeautyEffectOutput(this.fps).then((e=>{e||this.onOverload&&this.onOverload()}));let r=!1;this.stopLoop=()=>{r=!0};const o=()=>{this.enabled&&!r&&requestAnimationFrame(o);const e=Date.now(),t=1e3/this.fps,i=this.lastRenderTime?e-this.lastRenderTime:t;i<t||(this.lastRenderTime=e-(i-t),this.video&&this.video.paused&&this.video.play(),this.enabled&&this.video&&(this.manager.render(this.video),this.outputTrack&&this.outputTrack.requestFrame&&this.outputTrack.requestFrame(),this.overloadDetector.addFrame()))};requestAnimationFrame(o),i.name===Oy.CHROME&&document.addEventListener("visibilitychange",(()=>{document.hidden?this.stopChromeBackgroundLoop=Xx((()=>{this.enabled&&this.video&&this.manager.render(this.video),this.outputTrack&&this.outputTrack.requestFrame&&this.outputTrack.requestFrame(),this.overloadDetector.addFrame()}),this.fps):this.stopChromeBackgroundLoop&&(this.stopChromeBackgroundLoop(),this.stopChromeBackgroundLoop=null)}),!1)}async renderWithWebGL(e){this.canvas&&(this.canvas.remove(),this.canvas=void 0),this.video&&(this.video.remove(),this.video=void 0),this.canvas=document.createElement("canvas"),this.video=document.createElement("video"),this.video.setAttribute("autoplay",""),this.video.setAttribute("muted",""),this.video.muted=!0,this.video.setAttribute("playsinline",""),this.video.setAttribute("style","display:none"),this.video.srcObject=new MediaStream([e]);const t=new Mm((e=>{const t=()=>{this.video&&this.video.removeEventListener("playing",t),e(void 0)};this.video&&this.video.addEventListener("playing",t)}));this.video.play(),await t;const i=e.getSettings(),n=i.width||this.video.videoWidth,r=i.height||this.video.videoHeight;if(i.frameRate&&this.fps!==i.frameRate&&(this.fps=i.frameRate,mw.debug("beauty video processor: set fps to",this.fps)),mw.debug("beauty video processor: width ".concat(n," height ").concat(r)),!n||!r)throw new pw(hw.BEAUTY_PROCESSOR_INTERNAL_ERROR,"can not get track resolution");this.canvas.width=n,this.canvas.height=r,this.video.setAttribute("width",n.toString()),this.video.setAttribute("height",r.toString()),this.manager.init(n,r,this.canvas);const o=XP();return this.canvas.captureStream(o.supportRequestFrame?0:this.fps).getVideoTracks()[0]}async stopEffect(e,t){mw.info("stop video effect"),this.overloadDetector.stopRecordBeautyEffectOutput(),this.manager.release(),this.canvas&&this.canvas.remove(),this.video&&this.video.remove(),this.canvas=void 0,this.video=void 0,this.output(e,t)}}function _J(e){const t={};if(e.facingMode&&(t.facingMode=e.facingMode),e.cameraId&&(t.deviceId={exact:e.cameraId}),!e.encoderConfig)return t;const i=ib(e.encoderConfig);return t.width=i.width,t.height=i.height,!Hy()&&i.frameRate&&(t.frameRate=i.frameRate),Dy().name===Oy.EDGE&&"object"==typeof t.frameRate&&(t.frameRate.max=60),By()&&(t.frameRate={ideal:30,max:30}),t}function IJ(e){const t={};e.screenSourceType&&(t.mediaSource=e.screenSourceType),e.extensionId&&My()&&(t.extensionId=e.extensionId),e.electronScreenSourceId&&(t.sourceId=e.electronScreenSourceId);const i=e.encoderConfig?nb(e.encoderConfig):null;return t.mandatory={chromeMediaSource:"desktop",maxWidth:i?i.width:void 0,maxHeight:i?i.height:void 0},i&&i.frameRate&&("number"==typeof i.frameRate?(t.mandatory.maxFrameRate=i.frameRate,t.mandatory.minFrameRate=i.frameRate):(t.mandatory.maxFrameRate=i.frameRate.max||i.frameRate.ideal||i.frameRate.exact||void 0,t.mandatory.minFrameRate=i.frameRate.min||i.frameRate.ideal||i.frameRate.exact||void 0),t.frameRate=i.frameRate),i&&i.width&&(t.width=i.width),i&&i.height&&(t.height=i.height),t}function gJ(e){const t={};if(Hy()||(void 0!==e.AGC&&(t.autoGainControl=e.AGC),void 0!==e.AEC&&(t.echoCancellation=e.AEC),void 0!==e.ANS&&(t.noiseSuppression=e.ANS,My()&&e.ANS&&(t.googHighpassFilter=e.ANS))),e.encoderConfig){const i=sb(e.encoderConfig);t.channelCount=i.stereo?2:1,t.sampleRate=i.sampleRate,t.sampleSize=i.sampleSize}return e.microphoneId&&(t.deviceId={exact:e.microphoneId}),Wy()&&(t.sampleRate=void 0),t}var fJ,RJ;!function(e){e.COVERED="COVERED",e.POSITION="POSITION",e.SIZE="SIZE",e.STYLE="STYLE"}(fJ||(fJ={})),function(e){e.UNMOUNTED="UNMOUNTED",e.INVALID_HTML_ELEMENT="INVALID_HTML_ELEMENT"}(RJ||(RJ={}));var CJ,TJ,mJ,SJ,OJ,vJ,NJ,yJ,DJ,wJ,bJ,LJ,PJ,kJ,MJ,UJ,BJ,VJ,QJ,xJ,FJ,GJ,jJ,YJ=new class{constructor(){tD(this,"_clientSize",null),tD(this,"getClientWidth",(()=>document.documentElement?document.documentElement.clientWidth:document.body.clientWidth)),tD(this,"getClientHeight",(()=>document.documentElement?document.documentElement.clientHeight:document.body.clientHeight)),tD(this,"getStyle",(e=>window.getComputedStyle(e,null))),tD(this,"checkCssVisibleProperty",(e=>{let t=!0;const i=this.getStyle(e),{display:n,visibility:r,opacity:o,filter:s}=i;return("none"===n||["hidden","collapse"].includes(r)||Number(o)<.1)&&(t=!1),!!t&&(s&&s.split(" ").filter((e=>{const t=e.split("(")[0];return["brightness","blur","opacity"].includes(t)})).map((e=>{const[t,i]=e.split(/\(|\)/);return[t,Number(i.match(/^[0-9\.]+/))]})).forEach((e=>{const[i,n]=e;switch(i){case"brightness":(n<.1||n>3)&&(t=!1);break;case"blur":n>3&&(t=!1);break;case"opacity":n<.1&&(t=!1)}})),t)})),tD(this,"checkPropertyUpToAllParentNodes",((e,t)=>{let i=!0,n=!0;const r=e=>t(e);let o=e;for(;o&&n;)r(o)||(i=!1,n=!1),o=o.parentElement,o||(n=!1);return i})),tD(this,"checkActualCssVisibleIncludeInherit",(e=>this.checkPropertyUpToAllParentNodes(e,this.checkCssVisibleProperty))),tD(this,"getSizeAboutClient",(e=>{const{width:t,height:i,left:n,right:r,top:o,bottom:s}=e.getBoundingClientRect(),a=this.getClientWidth(),c=this.getClientHeight();return{width:t,height:i,left:n,right:r,top:o,bottom:s,clientWidth:a,clientHeight:c,clientMin:Math.min(a,c)}})),tD(this,"checkActualSize",(()=>{const{width:e,height:t,clientMin:i}=this._clientSize;return this.checkSizeIsVisible(e,t,i)})),tD(this,"elementFromPoint",((e,t)=>document.elementFromPoint?document.elementFromPoint(e,t):null)),tD(this,"checkCoverForAPoint",((e,t,i)=>{const n=this.elementFromPoint(e,t);return null!==n&&n!==i})),tD(this,"getPointPositionList",(()=>{const{width:e,height:t,left:i,top:n}=this._clientSize,r=e/6,o=t/6,s=[],a=10**6;for(let e=0;e<5;e++)for(let t=0;t<5;t++){const c=(i*a+(0===e?.1:4===e?(r*e*a-1e5)/a:r*e)*a)/a,A=(n*a+(0===t?.1:4===t?(o*t*a-1e5)/a:o*t)*a)/a;s.push({x:c,y:A})}return[...s]})),tD(this,"checkElementCover",(e=>this.getPointPositionList().map((t=>this.checkCoverForAPoint(t.x,t.y,e))).filter((e=>!!e)).length>6)),tD(this,"checkSizeIsVisible",((e,t,i)=>(e>50||i/e<=10)&&(t>50||i/t<=10))),tD(this,"checkSizeOfPartInClient",(()=>{const{left:e,right:t,top:i,bottom:n,clientHeight:r,clientWidth:o,clientMin:s}=this._clientSize;let a,c,A,d;if(e<0)a=0;else{if(!(e<o))return!1;a=e}if(t<0)return!1;if(c=t<o?t:o,i<0)A=0;else{if(!(i<r))return!1;A=i}if(n<0)return!1;d=n<r?n:r;const u=c-a,E=d-A;return this.checkSizeIsVisible(u,E,s)})),tD(this,"returnHiddenResult",(e=>(this._clientSize=null,{visible:!1,reason:e}))),tD(this,"checkOneElementVisible",(e=>{if(e instanceof HTMLElement){if(this.checkElementIsMountedOnDom(e)){if(this.checkActualCssVisibleIncludeInherit(e)){if(this._clientSize=this.getSizeAboutClient(e),this.checkElementCover(e))return this.returnHiddenResult(fJ.COVERED);{const e=this.checkActualSize(),t=this.checkSizeOfPartInClient();return e&&!t?this.returnHiddenResult(fJ.POSITION):e?(this._clientSize=null,{visible:!0}):this.returnHiddenResult(fJ.SIZE)}}return this.returnHiddenResult(fJ.STYLE)}return this.returnHiddenResult(RJ.UNMOUNTED)}return this.returnHiddenResult(RJ.INVALID_HTML_ELEMENT)})),tD(this,"checkElementIsMountedOnDom",(e=>this.checkPropertyUpToAllParentNodes(e,(e=>"HTML"!==e.nodeName.toUpperCase()?null!==e.parentElement:!!document.documentElement))))}};function HJ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function KJ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?HJ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):HJ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let WJ=(CJ=Ww("LocalVideoTrack","getTrackId"),TJ=IF(),mJ=xx("LocalVideoTrack","_enabledMutex"),SJ=IF(),OJ=xx("LocalVideoTrack","_enabledMutex"),vJ=IF(),NJ=Lx({report:Px}),yJ=IF(),DJ=IF(),wJ=IF(),bJ=IF(),LJ=IF(),PJ=IF(),kJ=IF(),CJ((tx((UJ=class e extends Fx{get isPlaying(){return!(!this._player||this._player.videoElementStatus!==mL.PLAYING)}constructor(e,t,i,n,r,o){super(e,r),tD(this,"trackMediaType","video"),tD(this,"_player",void 0),tD(this,"_videoBeautyProcessor",void 0),tD(this,"_videoVisibleTimer",null),tD(this,"_previousVideoVisibleStatus",void 0),tD(this,"_clearPreviousVideoVisibleStatus",(()=>this._previousVideoVisibleStatus=void 0)),tD(this,"_encoderConfig",void 0),tD(this,"_scalabiltyMode",{numSpatialLayers:1,numTemporalLayers:1}),tD(this,"_optimizationMode",void 0),tD(this,"_videoHeight",void 0),tD(this,"_videoWidth",void 0),tD(this,"_forceBitrateLimit",void 0),tD(this,"_enabled",!0),tD(this,"processorDestination",void 0),tD(this,"processorContext",void 0),this.updateMediaStreamTrackResolution(),this._encoderConfig=t,this._scalabiltyMode=i,this._optimizationMode=n,this._hints=o||[],-1===this._hints.indexOf(vP.SCREEN_TRACK)&&this.updateBitrateFromProfile(),this.processorContext=new XJ(this.getTrackId()),this.processorDestination=new qJ(this.processorContext),this.bindProcessorDestinationEvents()}play(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_PLAY,options:[this.getTrackId(),"string"==typeof e?e:"HTMLElement",t]});if("string"==typeof e){const t=document.getElementById(e);t?e=t:(mw.warning("[".concat(this.getTrackId(),'] can not find "#').concat(e,'" element, use document.body')),xw("warning",this,'can not find "#'.concat(e,'" element, use document.body')),e=document.body)}mw.debug("[".concat(this.getTrackId(),"] start video playback"),JSON.stringify(t)),Yw("debug",this,"play",t);const n=KJ(KJ(KJ({},this._getDefaultPlayerConfig()),t),{},{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(n):(this._player=new KW(n),this._player.updateVideoTrack(this._mediaStreamTrack)),this._player.play(),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval((()=>{try{const e=this.getVideoElementVisibleStatus();this.emit(DP.VIDEO_ELEMENT_VISIBLE_STATUS,e)}catch(e){}}),cb("CHECK_VIDEO_VISIBLE_INTERVAL")),i.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_STOP,options:[this.getTrackId()]});if(!this._player)return e.onSuccess();this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,mw.debug("[".concat(this.getTrackId(),"] stop video playback")),Yw("debug",this,"stop"),e.onSuccess()}async setEnabled(e,t){if(!t){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),!e){this._originMediaStreamTrack.enabled=!1;try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled to false error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}return t||(this._enabled=!1),mw.info("[".concat(this.getTrackId(),"] setEnabled to false success")),void Yw("info",this,"setEnabled",e,"success")}this._originMediaStreamTrack.enabled=!0;try{await LG(this,OP.NEED_ENABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled to true error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}mw.info("[".concat(this.getTrackId(),"] setEnabled to true success")),Yw("info",this,"setEnabled",e,"success"),t||(this._enabled=!0)}async setMuted(e){e!==this._muted&&(this.stateCheck("muted",e),this._muted=e,this._mediaStreamTrack.enabled=!e,mw.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(e)),Yw("debug",this,"setMuted",e),e?await LG(this,OP.NEED_MUTE_TRACK,this):await LG(this,OP.NEED_UNMUTE_TRACK,this))}getStats(){return xG((()=>{mw.warning("[deprecated] LocalVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalVideoStats instead"),xw("warning",this,"[deprecated] LocalVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalVideoStats instead")}),"localVideoTrackGetStatsWarning"),PG(this,OP.GET_STATS)||KJ({},iP)}async setBeautyEffect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_BEAUTY,options:[this.getTrackId(),e,t]});if(e||this._videoBeautyProcessor){if(Py()===Sy.IOS||Py()===Sy.ANDROID){const e=new pw(hw.INVALID_OPERATION,"can not enable beauty effect on mobile device");throw i.onError(e),e}if(!this._enabled&&e){const e=new pw(hw.TRACK_IS_DISABLED,"can not enable beauty effect when track is disabled");throw i.onError(e),e}if(mw.info("[".concat(this.getTrackId(),"] start setBeautyEffect"),e,JSON.stringify(t)),Yw("info",this,"setBeautyEffect",[e,t]),this._videoBeautyProcessor||e){try{if(!this._videoBeautyProcessor)if(this._videoBeautyProcessor=new pJ,this.processor){const e=this.processor;this.pipe(this._videoBeautyProcessor).pipe(e)}else this.pipe(this._videoBeautyProcessor).pipe(this.processorDestination);await this._videoBeautyProcessor.setBeautyEffectOptions(t),e?await this._videoBeautyProcessor.enable():await this._videoBeautyProcessor.disable()}catch(n){throw mw.error("[".concat(this.getTrackId(),"] setBeautyEffect error"),n.toString()),Yw("info",this,"setBeautyEffect",[e,t]),i.onError(n),n}mw.info("[".concat(this.getTrackId(),"] setBeautyEffect success")),Yw("info",this,"setBeautyEffect",[e,t],"success"),i.onSuccess()}else i.onSuccess()}}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}clone(t,i,n,r){const o=this._mediaStreamTrack.clone();return new e(o,t,i,n,r)}async setBitrateLimit(e){if(mw.debug("[".concat(this.getTrackId(),"] set bitrate limit, ").concat(JSON.stringify(e))),Yw("debug",this,"setBitrateLimit",e),e){this._forceBitrateLimit=e,this._encoderConfig&&(this._encoderConfig.bitrateMax?this._encoderConfig.bitrateMax=this._encoderConfig.bitrateMax<e.max_bitrate?this._encoderConfig.bitrateMax:e.max_bitrate:this._encoderConfig.bitrateMax=e.max_bitrate,this._encoderConfig.bitrateMin,this._encoderConfig.bitrateMin=e.min_bitrate);try{await LG(this,OP.NEED_UPDATE_VIDEO_ENCODER,this)}catch(e){return e.throw()}}}async setOptimizationMode(e){if("motion"!==e&&"detail"!==e&&"balanced"!==e)return mw.error(hw.INVALID_PARAMS,"optimization mode must be motion, detail or balanced"),void Yw("error",this,"setOptimizationMode",e,hw.INVALID_PARAMS);const t=this._optimizationMode;try{this._optimizationMode=e,await LG(this,OP.SET_OPTIMIZATION_MODE,this)}catch(i){throw this._optimizationMode=t,mw.error("[".concat(this.getTrackId(),"] set optimization mode failed"),i.toString()),Yw("error",this,"setOptimizationMode",e,i.toString()),i}mw.info("[".concat(this.getTrackId(),"] set optimization mode success (").concat(e,")")),Yw("info",this,"setOptimizationMode",e,"success")}setScalabiltyMode(e){if(1===e.numSpatialLayers&&1!==e.numTemporalLayers)return mw.error(hw.INVALID_PARAMS,"scalability mode currently not supported, no SVC."),Yw("error",this,"setScalabiltyMode",e,hw.INVALID_PARAMS),void(this._scalabiltyMode={numSpatialLayers:1,numTemporalLayers:1});this._scalabiltyMode=e,mw.info("[".concat(this.getTrackId(),"] set scalability mode success (").concat(e,")")),Yw("info",this,"setScalabiltyMode",e,"success")}updateMediaStreamTrackResolution(){DG(this._originMediaStreamTrack).then((e=>{let[t,i]=e;this._videoHeight=i,this._videoWidth=t})).catch(yG)}_updatePlayerSource(){this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}_getDefaultPlayerConfig(){return{fit:"contain"}}updateBitrateFromProfile(){if(!this._encoderConfig)return;const{width:e,height:t,frameRate:i}=this.getMediaStreamTrackSettings();if(!e||!t||!i)return;const[n,r]=function(e,t,i){const n=cb("BITRATE_ADAPTER_TYPE");let r;const o=200*Math.pow(i/15,.6)*Math.pow(e*t/640/360,.75),s=o;if("STANDARD_BITRATE"===n)r=4*o;else{if("COMPATIABLE_BITRATE"!==n)return;r=2*o}return[Math.floor(r),Math.floor(s)]}(e,t,i)||[void 0,void 0];this._encoderConfig.bitrateMin||this._encoderConfig.bitrateMax||(this._encoderConfig.bitrateMin=r,this._encoderConfig.bitrateMax=n,mw.debug("[".concat(this.getTrackId(),"] update bitrate from profile, [w: ").concat(e,", h: ").concat(t,", fps: ").concat(i,"] => [brMax: ").concat(n,", brMin: ").concat(r,"]")),Yw("debug",this,"updateBitrateFromProfile",void 0,"[w: ".concat(e,", h: ").concat(t,", fps: ").concat(i,"] => [brMax: ").concat(n,", brMin: ").concat(r,"]")))}getVideoElementVisibleStatus(){try{var e,t;const i=null==this||null===(e=this._player)||void 0===e?void 0:e.getContainerElement(),n={track:this,element:null==this||null===(t=this._player)||void 0===t?void 0:t.getVideoElement(),slot:null==i?void 0:i.parentElement},{element:r,slot:o}=n;if(this.isPlaying&&r instanceof HTMLVideoElement&&o instanceof HTMLElement){const e=YJ.checkOneElementVisible(r),t=Object.assign({},e);if(t.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=t.visible;const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});t.visible?e.onSuccess("Video is visible"):e.onSuccess("Invisible because of ".concat(t.reason))}return t}return}catch(e){throw new pw(hw.GET_VIDEO_ELEMENT_VISIBLE_ERROR,e.message)}}async renewMediaStreamTrack(e){}pipe(e){if(this._videoBeautyProcessor&&e!==this._videoBeautyProcessor)return this._videoBeautyProcessor.pipe(e);if(this.processor===e)return e;if(e._source)throw new pw(hw.INVALID_OPERATION,"Processor ".concat(e.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=e,this.processor._source=this,e.updateInput({track:this._originMediaStreamTrack,context:this.processorContext}),e}unpipe(){if(!this.processor)return;const e=this.processor;this.processor._source=void 0,this.processor=void 0,e.reset()}close(){super.close(),this.unbindProcessorDestinationEvents(),this.unbindProcessorContextEvents(),this.unpipe(),this.processorDestination._source&&this.processorDestination._source.unpipe()}bindProcessorDestinationEvents(){this.processorDestination.on(WP.ON_TRACK,(async e=>{e?e!==this._mediaStreamTrack&&(this._mediaStreamTrack=e,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this))}))}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(WP.ON_TRACK)}unbindProcessorContextEvents(){this.processorContext.removeAllListeners(JP.REQUEST_UPDATE_CONSTRAINTS),this.processorContext.removeAllListeners(JP.REQUEST_CONSTRAINTS)}}).prototype,"play",[TJ],Object.getOwnPropertyDescriptor(UJ.prototype,"play"),UJ.prototype),tx(UJ.prototype,"setEnabled",[mJ,SJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setEnabled"),UJ.prototype),tx(UJ.prototype,"setMuted",[OJ,vJ,NJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setMuted"),UJ.prototype),tx(UJ.prototype,"getStats",[yJ],Object.getOwnPropertyDescriptor(UJ.prototype,"getStats"),UJ.prototype),tx(UJ.prototype,"setBeautyEffect",[DJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setBeautyEffect"),UJ.prototype),tx(UJ.prototype,"getCurrentFrameData",[wJ],Object.getOwnPropertyDescriptor(UJ.prototype,"getCurrentFrameData"),UJ.prototype),tx(UJ.prototype,"setBitrateLimit",[bJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setBitrateLimit"),UJ.prototype),tx(UJ.prototype,"setOptimizationMode",[LJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setOptimizationMode"),UJ.prototype),tx(UJ.prototype,"setScalabiltyMode",[PJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setScalabiltyMode"),UJ.prototype),tx(UJ.prototype,"updateMediaStreamTrackResolution",[kJ],Object.getOwnPropertyDescriptor(UJ.prototype,"updateMediaStreamTrackResolution"),UJ.prototype),MJ=UJ))||MJ),JJ=(BJ=Ww("CameraVideoTrack","getTrackId"),VJ=IF(),QJ=xx("CameraVideoTrack","_enabledMutex"),xJ=IF(),FJ=IF(),BJ((tx((jJ=class extends WJ{constructor(e,t,i,n,r,o){super(e,t.encoderConfig?ib(t.encoderConfig):{},n,r,o),tD(this,"_config",void 0),tD(this,"_originalConstraints",void 0),tD(this,"_constraints",void 0),tD(this,"_enabled",!0),tD(this,"_deviceName","default"),tD(this,"tryResumeVideoForIOS15WeChat",(async()=>{Qy()&&!Gy()&&Yy()&&this._enabled&&!this._isClosed&&(mw.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS 15 device on WeChat.")),await this.renewMediaStreamTrack())})),Kw("info",this,"constructor",{trackId:o,deviceId:e.label,constraints:i,config:t}),this._config=t,this._originalConstraints=i,this._constraints=i,this._deviceName=e.label,this._config.encoderConfig&&(this._encoderConfig=ib(this._config.encoderConfig)),Kx.on(Mx.IOS_15_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat),Kx.on(Mx.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat),this.bindProcessorContextEvents()}async setDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CAM_VIDEO_TRACK_SET_DEVICE,options:[this.getTrackId(),e]});if(mw.info("[".concat(this.getTrackId(),"] set device to ").concat(e)),Yw("info",this,"setDevice",e),this._enabled)try{const i=await EF.getDeviceById(e),n={};n.video=KJ({},this._constraints),n.video.deviceId={exact:e},n.video.facingMode=void 0,this._originMediaStreamTrack.stop();let r=null;try{r=await cF(n,this.getTrackId())}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setDevice failed"),t.toString()),Yw("error",this,"setDevice",e,t.toString()),r=await cF({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(r.getVideoTracks()[0],!1),t}await this._updateOriginMediaStreamTrack(r.getVideoTracks()[0],!1),this.updateMediaStreamTrackResolution(),this._deviceName=i.label,this._config.cameraId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}else try{const t=await EF.getDeviceById(e);this._deviceName=t.label,this._config.cameraId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}mw.info("[".concat(this.getTrackId(),"] setDevice success")),Yw("info",this,"setDevice",e,"success"),t.onSuccess()}async setEnabled(e,t){if(!t){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),!e){this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),t||(this._enabled=!1);try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled to false error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}return mw.info("[".concat(this.getTrackId(),"] setEnabled to false success")),void Yw("info",this,"setEnabled",e,"success")}const i=KJ({},this._constraints),n=EF.searchDeviceIdByName(this._deviceName);n&&!i.deviceId&&(i.deviceId={exact:n});try{const e=await cF({video:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(e.getVideoTracks()[0],!1),await LG(this,OP.NEED_ENABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled true error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}this.updateMediaStreamTrackResolution(),mw.info("[".concat(this.getTrackId(),"] setEnabled to true success")),Yw("info",this,"setEnabled",e,"success"),t||(this._enabled=!0)}async setEncoderConfiguration(e,t){const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CAM_VIDEO_TRACK_SET_ENCODER_CONFIG,options:[this.getTrackId(),e]});if(!this._enabled){const e=new pw(hw.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");throw i.onError(e),e}e=ib(e),this._forceBitrateLimit&&(e.bitrateMax=this._forceBitrateLimit.max_bitrate?this._forceBitrateLimit.max_bitrate:e.bitrateMax,e.bitrateMin=this._forceBitrateLimit.min_bitrate?this._forceBitrateLimit.min_bitrate:e.bitrateMin);const n=VG(this._config);n.encoderConfig=e;const r=_J(n);(Uy()||Vy()||jy())&&(r.deviceId=void 0),mw.debug("[".concat(this.getTrackId(),"] setEncoderConfiguration applyConstraints"),JSON.stringify(e),JSON.stringify(r)),Yw("debug",this,"setEncoderConfiguration",e);try{await this._originMediaStreamTrack.applyConstraints(r),this.updateMediaStreamTrackResolution()}catch(e){const t=new pw(hw.UNEXPECTED_ERROR,e.toString());throw mw.error("[".concat(this.getTrackId(),"] applyConstraints error"),t.toString()),Yw("error",this,"setEncoderConfiguration",e.toString()),i.onError(t),t}this._config=n,this._constraints=r,this._originalConstraints=r,this._encoderConfig=e,-1===this._hints.indexOf(vP.SCREEN_TRACK)&&this.updateBitrateFromProfile();try{await LG(this,OP.NEED_UPDATE_VIDEO_ENCODER,this)}catch(e){return i.onError(e),e.throw()}i.onSuccess()}_getDefaultPlayerConfig(){return{mirror:!0,fit:"cover"}}onTrackEnded(){if((Vy()||jy())&&this._enabled&&!this._isClosed&&Kx.duringInterruption){const e=async()=>{Kx.off(Mx.IOS_INTERRUPTION_END,e),this._enabled&&!this._isClosed&&(mw.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS device.")),xw("debug",this,"try capture camera media device for interrupted iOS device."),await this.setEnabled(!1),await this.setEnabled(!0))};Kx.on(Mx.IOS_INTERRUPTION_END,e)}else mw.debug("[".concat(this.getTrackId(),"] track ended")),jw("debug",["MediaStreamTrack",this.getTrackId()],"ended"),this.emit(DP.TRACK_ENDED)}async renewMediaStreamTrack(e){const t=e||this._constraints,i=EF.searchDeviceIdByName(this._deviceName);i&&!t.deviceId&&(t.deviceId={exact:i});const n=await cF({video:t},this.getTrackId());this._constraints=t,await this._updateOriginMediaStreamTrack(n.getVideoTracks()[0],!0),this.updateMediaStreamTrackResolution()}close(){super.close(),Kx.off(Mx.IOS_15_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat),Kx.off(Mx.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat)}bindProcessorContextEvents(){this.processorContext.on(JP.REQUEST_UPDATE_CONSTRAINTS,(async(e,t,i)=>{try{const i=Object.assign({},this._originalConstraints,...e);await this.renewMediaStreamTrack(i),t()}catch(e){i(e)}})),this.processorContext.on(JP.REQUEST_CONSTRAINTS,(async e=>{e(this._originMediaStreamTrack.getSettings())}))}}).prototype,"setDevice",[VJ],Object.getOwnPropertyDescriptor(jJ.prototype,"setDevice"),jJ.prototype),tx(jJ.prototype,"setEnabled",[QJ,xJ],Object.getOwnPropertyDescriptor(jJ.prototype,"setEnabled"),jJ.prototype),tx(jJ.prototype,"setEncoderConfiguration",[FJ],Object.getOwnPropertyDescriptor(jJ.prototype,"setEncoderConfiguration"),jJ.prototype),GJ=jJ))||GJ);class qJ extends Ew{constructor(e){super(),tD(this,"name","VideoProcessorDestination"),tD(this,"ID","0"),tD(this,"_source",void 0),tD(this,"videoContext",void 0),tD(this,"inputTrack",void 0),this.videoContext=e}get kind(){return"video"}get enabled(){return!0}pipe(){throw new pw(hw.NOT_SUPPORTED,"VideoProcessor cannot pipe to any other Processor")}unpipe(){throw new pw(hw.NOT_SUPPORTED,"VideoProcessor cannot unpipe to any other Processor")}enable(){}disable(){}updateInput(e){if(e.context!==this.videoContext)throw new Error("ProcessorContext passed to VideoTrack.processorDestination doesn't match it's belonging VideoTrack's context.\nProbably you are making pipeline like this:\nvideoTrack1.pipe(processor).pipe(videoTrack2.processorDestination).");e.track&&e.track!==this.inputTrack&&(this.inputTrack=e.track,this.emit(WP.ON_TRACK,e.track))}reset(){this.inputTrack=void 0,this.emit(WP.ON_TRACK,void 0)}}class XJ extends Ew{constructor(e){super(),tD(this,"constraintsMap",new Map),tD(this,"statsRegistry",[]),tD(this,"trackId",void 0),this.trackId=e}async getConstraints(){return await bG(this,JP.REQUEST_CONSTRAINTS)}async requestApplyConstraints(e,t){var i;return mw.info("processor ".concat(t.name," requestApplyConstraints for ").concat(this.trackId)),e&&this.constraintsMap.set(t,e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(i=this.constraintsMap).call(i)))}async requestRevertConstraints(e){var t;if(this.constraintsMap.has(e))return mw.info("processor ".concat(e.name," requestRevertConstraints for ").concat(this.trackId)),this.constraintsMap.delete(e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(t=this.constraintsMap).call(t)))}registerStats(e,t,i){this.statsRegistry.find((i=>i.processorID===e.ID&&i.processorName===e.name&&i.type===t))||this.statsRegistry.push({processorName:e.name,processorID:e.ID,type:t,cb:i})}unregisterStats(e,t){}gatherStats(){return this.statsRegistry.map((e=>{let{processorID:t,processorName:i,type:n,cb:r}=e;return{processorID:t,processorName:i,type:n,stats:r()}}))}}class zJ{get hasVideo(){return this._video_enabled_&&!this._video_muted_&&this._video_added_}get hasAudio(){return this._audio_enabled_&&!this._audio_muted_&&this._audio_added_}get audioTrack(){if(this.hasAudio)return this._audioTrack}get videoTrack(){if(this.hasVideo)return this._videoTrack}constructor(e,t){tD(this,"uid",void 0),tD(this,"_uintid",void 0),tD(this,"_trust_in_room_",!0),tD(this,"_trust_audio_enabled_state_",!0),tD(this,"_trust_video_enabled_state_",!0),tD(this,"_trust_audio_mute_state_",!0),tD(this,"_trust_video_mute_state_",!0),tD(this,"_trust_stream_added_state_",!0),tD(this,"_audio_muted_",!1),tD(this,"_video_muted_",!1),tD(this,"_audio_enabled_",!0),tD(this,"_video_enabled_",!0),tD(this,"_audio_added_",!1),tD(this,"_video_added_",!1),tD(this,"_audioTrack",void 0),tD(this,"_videoTrack",void 0),tD(this,"_audioSSRC",void 0),tD(this,"_videoSSRC",void 0),tD(this,"_audioOrtc",void 0),tD(this,"_videoOrtc",void 0),tD(this,"_cname",void 0),tD(this,"_rtxSsrcId",void 0),this.uid=e,this._uintid=t}}var ZJ=km,$J=PC,eq=FC;Bu({target:"Promise",stat:!0},{try:function(e){var t=$J.f(this),i=eq(e);return(i.error?t.reject:t.resolve)(i.value),t.promise}});var tq=ZJ,iq=Bu,nq=Lc,rq=Tc,oq=qV,sq=lA,aq=rd,cq=ju,Aq=Cb,dq=iQ,uq=MQ,Eq=NA,lq=md("isConcatSpreadable"),hq=9007199254740991,pq="Maximum allowed index exceeded",_q=nq.TypeError,Iq=Eq>=51||!rq((function(){var e=[];return e[lq]=!1,e.concat()[0]!==e})),gq=uq("concat"),fq=function(e){if(!sq(e))return!1;var t=e[lq];return void 0!==t?!!t:oq(e)};iq({target:"Array",proto:!0,forced:!Iq||!gq},{concat:function(e){var t,i,n,r,o,s=aq(this),a=dq(s,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(fq(o=-1===t?s:arguments[t])){if(c+(r=cq(o))>hq)throw _q(pq);for(i=0;i<r;i++,c++)i in o&&Aq(a,c,o[i])}else{if(c>=hq)throw _q(pq);Aq(a,c++,o)}return a.length=c,a}});var Rq={},Cq=eA,Tq=uA,mq=qp.f,Sq=Nb,Oq="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Rq.f=function(e){return Oq&&"Window"==Cq(e)?function(e){try{return mq(e)}catch(e){return Sq(Oq)}}(e):mq(Tq(e))};var vq={},Nq=md;vq.f=Nq;var yq=hA,Dq=ad,wq=vq,bq=cu.f,Lq=function(e){var t=yq.Symbol||(yq.Symbol={});Dq(t,e)||bq(t,e,{value:wq.f(e)})},Pq=Bu,kq=Lc,Mq=fA,Uq=Bc,Bq=jc,Vq=Dc,Qq=xc,xq=wA,Fq=Tc,Gq=ad,jq=qV,Yq=Vc,Hq=lA,Kq=wc,Wq=BA,Jq=hu,qq=rd,Xq=uA,zq=Pd,Zq=qI,$q=Xc,eX=q_,tX=D_,iX=qp,nX=Rq,rX=p_,oX=Qc,sX=cu,aX=v_,cX=Yc,AX=kR,dX=tf,uX=XA.exports,EX=o_,lX=Ed,hX=md,pX=vq,_X=Lq,IX=Rf,gX=Wg,fX=dQ.forEach,RX=bp("hidden"),CX="Symbol",TX=hX("toPrimitive"),mX=gX.set,SX=gX.getterFor(CX),OX=Object.prototype,vX=kq.Symbol,NX=vX&&vX.prototype,yX=kq.TypeError,DX=kq.QObject,wX=Mq("JSON","stringify"),bX=oX.f,LX=sX.f,PX=nX.f,kX=cX.f,MX=Vq([].push),UX=uX("symbols"),BX=uX("op-symbols"),VX=uX("string-to-symbol-registry"),QX=uX("symbol-to-string-registry"),xX=uX("wks"),FX=!DX||!DX.prototype||!DX.prototype.findChild,GX=Qq&&Fq((function(){return 7!=eX(LX({},"a",{get:function(){return LX(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=bX(OX,t);n&&delete OX[t],LX(e,t,i),n&&e!==OX&&LX(OX,t,n)}:LX,jX=function(e,t){var i=UX[e]=eX(NX);return mX(i,{type:CX,tag:e,description:t}),Qq||(i.description=t),i},YX=function(e,t,i){e===OX&&YX(BX,t,i),Jq(e);var n=zq(t);return Jq(i),Gq(UX,n)?(i.enumerable?(Gq(e,RX)&&e[RX][n]&&(e[RX][n]=!1),i=eX(i,{enumerable:$q(0,!1)})):(Gq(e,RX)||LX(e,RX,$q(1,{})),e[RX][n]=!0),GX(e,n,i)):LX(e,n,i)},HX=function(e,t){Jq(e);var i=Xq(t),n=tX(i).concat(qX(i));return fX(n,(function(t){Qq&&!Bq(KX,i,t)||YX(e,t,i[t])})),e},KX=function(e){var t=zq(e),i=Bq(kX,this,t);return!(this===OX&&Gq(UX,t)&&!Gq(BX,t))&&(!(i||!Gq(this,t)||!Gq(UX,t)||Gq(this,RX)&&this[RX][t])||i)},WX=function(e,t){var i=Xq(e),n=zq(t);if(i!==OX||!Gq(UX,n)||Gq(BX,n)){var r=bX(i,n);return!r||!Gq(UX,n)||Gq(i,RX)&&i[RX][n]||(r.enumerable=!0),r}},JX=function(e){var t=PX(Xq(e)),i=[];return fX(t,(function(e){Gq(UX,e)||Gq(EX,e)||MX(i,e)})),i},qX=function(e){var t=e===OX,i=PX(t?BX:Xq(e)),n=[];return fX(i,(function(e){!Gq(UX,e)||t&&!Gq(OX,e)||MX(n,UX[e])})),n};if(xq||(dX(NX=(vX=function(){if(Kq(NX,this))throw yX("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Zq(arguments[0]):void 0,t=lX(e),i=function(e){this===OX&&Bq(i,BX,e),Gq(this,RX)&&Gq(this[RX],t)&&(this[RX][t]=!1),GX(this,t,$q(1,e))};return Qq&&FX&&GX(OX,t,{configurable:!0,set:i}),jX(t,e)}).prototype,"toString",(function(){return SX(this).tag})),dX(vX,"withoutSetter",(function(e){return jX(lX(e),e)})),cX.f=KX,sX.f=YX,aX.f=HX,oX.f=WX,iX.f=nX.f=JX,rX.f=qX,pX.f=function(e){return jX(hX(e),e)},Qq&&LX(NX,"description",{configurable:!0,get:function(){return SX(this).description}})),Pq({global:!0,wrap:!0,forced:!xq,sham:!xq},{Symbol:vX}),fX(tX(xX),(function(e){_X(e)})),Pq({target:CX,stat:!0,forced:!xq},{for:function(e){var t=Zq(e);if(Gq(VX,t))return VX[t];var i=vX(t);return VX[t]=i,QX[i]=t,i},keyFor:function(e){if(!Wq(e))throw yX(e+" is not a symbol");if(Gq(QX,e))return QX[e]},useSetter:function(){FX=!0},useSimple:function(){FX=!1}}),Pq({target:"Object",stat:!0,forced:!xq,sham:!Qq},{create:function(e,t){return void 0===t?eX(e):HX(eX(e),t)},defineProperty:YX,defineProperties:HX,getOwnPropertyDescriptor:WX}),Pq({target:"Object",stat:!0,forced:!xq},{getOwnPropertyNames:JX,getOwnPropertySymbols:qX}),Pq({target:"Object",stat:!0,forced:Fq((function(){rX.f(1)}))},{getOwnPropertySymbols:function(e){return rX.f(qq(e))}}),wX&&Pq({target:"JSON",stat:!0,forced:!xq||Fq((function(){var e=vX();return"[null]"!=wX([e])||"{}"!=wX({a:e})||"{}"!=wX(Object(e))}))},{stringify:function(e,t,i){var n=AX(arguments),r=t;if((Hq(t)||void 0!==e)&&!Wq(e))return jq(t)||(t=function(e,t){if(Yq(r)&&(t=Bq(r,this,e,t)),!Wq(t))return t}),n[1]=t,Uq(wX,null,n)}}),!NX[TX]){var XX=NX.valueOf;dX(NX,TX,(function(e){return Bq(XX,this)}))}IX(vX,CX),EX[RX]=!0,Lq("asyncIterator"),Lq("hasInstance"),Lq("isConcatSpreadable"),Lq("iterator"),Lq("match"),Lq("matchAll"),Lq("replace"),Lq("search"),Lq("species"),Lq("split"),Lq("toPrimitive"),Lq("toStringTag"),Lq("unscopables"),Rf(Lc.JSON,"JSON",!0);var zX=hA.Symbol;Lq("asyncDispose"),Lq("dispose"),Lq("matcher"),Lq("metadata"),Lq("observable"),Lq("patternMatch"),Lq("replaceAll");var ZX=zX,$X=vq.f("asyncIterator"),ez=$X;function tz(e){this.wrapped=e}function iz(e){var t,i;function n(t,i){try{var o=e[t](i),s=o.value,a=s instanceof tz;tq.resolve(a?s.wrapped:s).then((function(e){a?n("return"===t?"return":"next",e):r(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?n(t.key,t.arg):i=null}this._invoke=function(e,r){return new tq((function(o,s){var a={key:e,arg:r,resolve:o,reject:s,next:null};i?i=i.next=a:(t=i=a,n(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function nz(e){return function(){return new iz(e.apply(this,arguments))}}function rz(e){return new tz(e)}iz.prototype["function"==typeof ZX&&ez||"@@asyncIterator"]=function(){return this},iz.prototype.next=function(e){return this._invoke("next",e)},iz.prototype.throw=function(e){return this._invoke("throw",e)},iz.prototype.return=function(e){return this._invoke("return",e)};var oz=vq.f("iterator");function sz(e,t){var i={},n=!1;function r(i,r){return n=!0,r=new tq((function(t){t(e[i](r))})),{done:!1,value:t(r)}}return i[void 0!==ZX&&oz||"@@iterator"]=function(){return this},i.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(i.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(i.return=function(e){return n?(n=!1,e):r("return",e)}),i}var az=$X,cz=Fn,Az=s,dz=n,uz=m,Ez=Ue,lz=Q,hz=K,pz=lE,_z=St.f,Iz=Sn,gz=dz.Symbol,fz=gz&&gz.prototype;if(Az&&lz(gz)&&(!("description"in fz)||void 0!==gz().description)){var Rz={},Cz=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:pz(arguments[0]),t=hz(fz,this)?new gz(e):void 0===e?gz():gz(e);return""===e&&(Rz[t]=!0),t};Iz(Cz,gz),Cz.prototype=fz,fz.constructor=Cz;var Tz="Symbol(test)"==String(gz("test")),mz=uz(fz.toString),Sz=uz(fz.valueOf),Oz=/^Symbol\((.*)\)[^)]+$/,vz=uz("".replace),Nz=uz("".slice);_z(fz,"description",{configurable:!0,get:function(){var e=Sz(this),t=mz(e);if(Ez(Rz,e))return"";var i=Tz?Nz(t,7,-1):vz(t,Oz,"$1");return""===i?void 0:i}}),cz({global:!0,forced:!0},{Symbol:Cz})}var yz={exports:{}};function Dz(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function wz(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dz(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Dz(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function bz(e,t,i,n,r,o){let s=[],a=[],c=[],A=[],d=!1,u=!1;if(yz.exports.parse(e).mediaDescriptions.forEach((e=>{o&&o!==e.attributes.direction||("video"!==e.media.mediaType||d||(a=e.attributes.payloads,A=e.attributes.extmaps,d=!0),"audio"!==e.media.mediaType||u||(s=e.attributes.payloads,c=e.attributes.extmaps,u=!0))})),!A||0===a.length)throw new Error("Cannot get video capabilities from SDP.");if(!c||0===s.length)throw new Error("Cannot get audio capabilities from SDP.");return a.forEach((e=>{var t;null!==(t=e.rtpMap)&&void 0!==t&&t.clockRate&&(e.rtpMap.clockRate=parseInt(e.rtpMap.clockRate))})),s.forEach((e=>{var t;null!==(t=e.rtpMap)&&void 0!==t&&t.clockRate&&(e.rtpMap.clockRate=parseInt(e.rtpMap.clockRate))})),t&&(s=s.filter((e=>{var t;return"rtx"!==(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())})),a=a.filter((e=>{var t;return"rtx"!==(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())}))),i&&(a=a.filter((e=>{var t;return!/(red)|(ulpfec)|(flexfec)/i.test((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName)||"")}))),n&&(null==n?void 0:n.length)>0&&(s=s.filter((e=>{var t;return n.includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")}))),r&&(null==r?void 0:r.length)>0&&(a=a.filter((e=>{var t;return r.includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")}))),{audioCodecs:s,videoCodecs:a,audioExtensions:c,videoExtensions:A}}function Lz(e){const t=yz.exports.parse(e);let i,n;for(const e of t.mediaDescriptions){if(!i){const t=e.attributes.iceUfrag,n=e.attributes.icePwd;if(!t||!n)throw new Error("Cannot get iceUfrag or icePwd from SDP.");i={iceUfrag:t,icePwd:n}}if(!n){const t=e.attributes.fingerprints;t.length>0&&(n={fingerprints:t})}}if(!n&&t.attributes.fingerprints.length>0&&(n={fingerprints:t.attributes.fingerprints}),!n||!i)throw new Error("Cannot get iceParameters or dtlsParameters from SDP.");return{iceParameters:i,dtlsParameters:n}}function Pz(e,t,i){const{cname:n}=e;let r;void 0!==t&&void 0!==i?(r=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:t,port:i.toString(),type:"host",extension:{}}],mw.debug("Using remote candidate from AP ".concat(t,":").concat(i)),xw("debug",[],"Using remote candidate from AP ".concat(t,":").concat(i))):r=e.iceParameters.candidates.map((e=>({foundation:e.foundation,componentId:"1",transport:e.protocol,priority:e.priority.toString(),connectionAddress:e.ip,port:e.port.toString(),type:e.type,extension:{}})));const o={fingerprints:e.dtlsParameters.fingerprints.map((e=>({hashFunction:e.algorithm,fingerprint:e.fingerprint})))},s={iceUfrag:e.iceParameters.iceUfrag,icePwd:e.iceParameters.icePwd};let a;switch(e.dtlsParameters.role){case"server":a="passive";break;case"client":a="active";break;case"auto":a="actpass"}return{dtlsParameters:o,iceParameters:s,candidates:r,rtpCapabilities:xz(e.rtpCapabilities),setup:a,cname:n}}function kz(e,t,i){const n=[],r=[];return e.forEach((e=>{let{ssrcId:o,rtx:s}=e;const a=vG(8,"track-"),c={ssrcId:o,attributes:wz({label:a,mslabel:i=i||vG(10,""),msid:"".concat(i," ").concat(a)},t&&{cname:t})};if(n.push(c),void 0!==s){const e={ssrcId:s,attributes:wz({label:a,mslabel:i,msid:"".concat(i," ").concat(a)},t&&{cname:t})};n.push(e),r.push({semantic:"FID",ssrcIds:[o,s]})}})),e.length>1&&r.push({semantic:"SIM",ssrcIds:e.map((e=>{let{ssrcId:t}=e;return t}))}),{ssrcs:n,ssrcGroups:r}}function Mz(e,t){t instanceof JF&&e.attributes.payloads.forEach((e=>{var i;const n=null===(i=e.rtpMap)||void 0===i?void 0:i.encodingName.toLowerCase();if(!n||-1===["opus","pcmu","pcma","g722"].indexOf(n))return;e.fmtp||(e.fmtp={parameters:{}}),e.fmtp.parameters.minptime="10",e.fmtp.parameters.useinbandfec="1";const r=t._encoderConfig;r&&("pcmu"!==n&&"pcma"!==n&&"g722"!==n&&(r.bitrate&&!By()&&(e.fmtp.parameters.maxaveragebitrate="".concat(Math.floor(1e3*r.bitrate))),r.sampleRate&&(e.fmtp.parameters.maxplaybackrate="".concat(r.sampleRate),e.fmtp.parameters["sprop-maxcapturerate"]="".concat(r.sampleRate))),r.stereo&&(e.fmtp.parameters.stereo="1",e.fmtp.parameters["sprop-stereo"]="1"))}))}function Uz(e){const t=e.attributes.unrecognized.findIndex((e=>"x-google-flag"===e.attField&&"conference"===e.attValue));-1!==t&&e.attributes.unrecognized.splice(t,1)}function Bz(e,t){if(!(t instanceof WJ&&t._encoderConfig&&-1===t._hints.indexOf(vP.SCREEN_TRACK)))return;const i=t._encoderConfig;XP().supportMinBitrate&&i.bitrateMin&&e.attributes.payloads.forEach((e=>{var t;["h264","vp8","vp9","av1"].includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")&&(e.fmtp||(e.fmtp={parameters:{}}),e.fmtp.parameters["x-google-min-bitrate"]="".concat(i.bitrateMin))})),XP().supportMinBitrate&&!t._hints.includes(vP.LOW_STREAM)&&i.bitrateMax&&e.attributes.payloads.forEach((e=>{var t;["h264","vp8","vp9","av1"].includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")&&(e.fmtp||(e.fmtp={parameters:{}}),e.fmtp.parameters["x-google-start-bitrate"]="".concat(Math.floor(i.bitrateMax)))}))}function Vz(e,t,i){if(!t)return;let n,r;if("video"===e.media.mediaType?(n=i.videoExtensions,r=i.videoCodecs):(n=i.audioExtensions,r=i.audioCodecs),!0===t.tcc){const t=n.find((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName));t&&(e.attributes.extmaps.find((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName))||e.attributes.extmaps.push({entry:t.entry,extensionName:"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"}),function(e,t){return t.filter((t=>!!e.find((e=>e.payloadType===t.payloadType&&!!e.rtcpFeedbacks.find((e=>"transport-cc"===e.type))))))}(r,e.attributes.payloads).forEach((e=>{e.rtcpFeedbacks.find((e=>"transport-cc"===e.type))||e.rtcpFeedbacks.push({type:"transport-cc"})})))}else if(!1===t.tcc){const t=e.attributes.extmaps.findIndex((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName));-1!==t&&e.attributes.extmaps.splice(t,1),e.attributes.payloads.forEach((e=>{const t=e.rtcpFeedbacks.findIndex((e=>"transport-cc"===e.type));-1!==t&&e.rtcpFeedbacks.splice(t,1)}))}if(!0===t.remb){const t=n.find((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.extensionName));t&&(e.attributes.extmaps.find((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.extensionName))||e.attributes.extmaps.push({entry:t.entry,extensionName:"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"}),function(e,t){return t.filter((t=>!!e.find((e=>e.payloadType===t.payloadType&&!!e.rtcpFeedbacks.find((e=>"goog-remb"===e.type))))))}(r,e.attributes.payloads).forEach((e=>{e.rtcpFeedbacks.find((e=>"goog-remb"===e.type))||e.rtcpFeedbacks.push({type:"goog-remb"})})))}else if(!1===t.remb){const t=e.attributes.extmaps.findIndex((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.extensionName));-1!==t&&e.attributes.extmaps.splice(t,1),e.attributes.payloads.forEach((e=>{const t=e.rtcpFeedbacks.findIndex((e=>"goog-remb"===e.type));-1!==t&&e.rtcpFeedbacks.splice(t,1)}))}}function Qz(e,t,i,n,r,o){if("videoExtensions"===i||"audioExtensions"===i){const s=[];return e[i].forEach((e=>{t[i].some(((t,i)=>{if(e.entry===t.entry&&e.extensionName===t.extensionName)return s.push(i),!0}))?o[i].push(e):n[i].push(e)})),void t[i].forEach(((e,t)=>{-1===s.indexOf(t)&&r[i].push(e)}))}if("videoCodecs"===i||"audioCodecs"===i){const s=[];return e[i].forEach((e=>{t[i].some(((t,i)=>{if(e.payloadType===t.payloadType&&JSON.stringify(e)===JSON.stringify(t))return s.push(i),!0}))?o[i].push(e):n[i].push(e)})),void t[i].forEach(((e,t)=>{-1===s.indexOf(t)&&r[i].push(e)}))}}function xz(e){const{send:t,recv:i,sendrecv:n}=e;if(!n){if(!t||!i)throw new Error("cannot merge rtp capabilities because one of send or recv is empty!");return{send:t,recv:i}}let r,o;return t?(r={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},r.audioCodecs=[...t.audioCodecs,...n.audioCodecs],r.videoCodecs=[...t.videoCodecs,...n.videoCodecs],r.audioExtensions=[...t.audioExtensions,...n.audioExtensions],r.videoExtensions=[...t.videoExtensions,...n.videoExtensions]):r=n,i?(o={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},o.audioCodecs=[...i.audioCodecs,...n.audioCodecs],o.videoCodecs=[...i.videoCodecs,...n.videoCodecs],o.audioExtensions=[...i.audioExtensions,...n.audioExtensions],o.videoExtensions=[...i.videoExtensions,...n.videoExtensions]):o=n,{send:r,recv:o}}!function(e,t){e.exports=(()=>{var e={8:(e,t,i)=>{i.r(t),i.d(t,{Parser:()=>T,Printer:()=>N,parse:()=>b,print:()=>L});const n="\n",r="".concat("\r").concat(n),o=" ";let s;function a(e){return e>="0"&&e<="9"}function c(e){return e>="!"&&e<="~"}function A(e){return c(e)||e>="€"&&e<="ÿ"}function d(e){return"!"===e||e>="#"&&e<="'"||e>="*"&&e<="+"||e>="-"&&e<="."||e>="0"&&e<="9"||e>="A"&&e<="Z"||e>="^"&&e<="~"}function u(e){return e>="1"&&e<="9"}function E(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"}function l(e){return"d"===e||"h"===e||"m"===e||"s"===e}function h(e){return e>""&&e<"\t"||e>"\v"&&e<"\f"||e>""&&e<"ÿ"}function p(e){return E(e)||a(e)||"+"===e||"/"===e}function _(e){return a(e)||E(e)||"+"===e||"/"===e||"-"===e||"_"===e}function I(e){return E(e)||a(e)||"+"===e||"/"===e}function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){R(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function R(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}!function(e){e.VERSION="v",e.ORIGIN="o",e.SESSION_NAME="s",e.INFORMATION="i",e.URI="u",e.EMAIL="e",e.PHONE="p",e.CONNECTION="c",e.BANDWIDTH="b",e.TIME="t",e.REPEAT="r",e.ZONE_ADJUSTMENTS="z",e.KEY="k",e.ATTRIBUTE="a",e.MEDIA="m"}(s||(s={}));class C{consumeText(e,t){let i=t;for(;i<e.length;){const t=e[i];if("\0"===t||"\r"===t||t===n)break;i+=1}if(i-t==0)throw new Error("Invalid text, at ".concat(e));return i}consumeUnicastAddress(e,t,i){return this.consumeTill(e,t,o)}consumeOneOrMore(e,t,i){let n=t;for(;i(e[n]);)n++;if(n-t==0)throw new Error("Invalid rule at ".concat(t,"."));return n}consumeSpace(e,t){if(e[t]===o)return t+1;throw new Error("Invalid space at ".concat(t,"."))}consumeIP4Address(e,t){let i=t;for(let t=0;t<4;t++)if(i=this.consumeDecimalUChar(e,i),3!==t){if("."!==e[i])throw new Error("Invalid IP4 address.");i++}return i}consumeDecimalUChar(e,t){let i=t;for(let t=0;t<3&&a(e[i]);t++,i++);if(i-t==0)throw new Error("Invalid decimal uchar.");const n=parseInt(e.slice(t,i));if(n>=0&&n<=255)return i;throw new Error("Invalid decimal uchar")}consumeIP6Address(e,t){let i=this.consumeHexpart(e,t);return":"===e[i]?(i+=1,i=this.consumeIP4Address(e,i),i):i}consumeHexpart(e,t){let i=t;if(":"===e[i]&&":"===e[i+1]){i+=2;try{i=this.consumeHexseq(e,i)}catch(e){}return i}if(i=this.consumeHexseq(e,i),":"===e[i]&&":"===e[i+1]){i+=2;try{i=this.consumeHexseq(e,i)}catch(e){}return i}return i}consumeHexseq(e,t){let i=t;for(;i=this.consumeHex4(e,i),":"===e[i]&&":"!==e[i+1];)i+=1;return i}consumeHex4(e,t){let i=0;for(;i<4;i++)if(!((n=e[t+i])>="0"&&n<="9"||n>="a"&&n<="f"||n>="A"&&n<="F")){if(0===i)throw new Error("Invalid hex 4");break}var n;return t+i}consumeFQDN(e,t){let i=t;for(;a(e[i])||E(e[i])||"-"===e[i]||"."===e[i];)i+=1;if(i-t<4)throw new Error("Invalid FQDN");return i}consumeExtnAddr(e,t){return this.consumeOneOrMore(e,t,A)}consumeMulticastAddress(e,t,i){switch(i){case"IP4":case"ip4":return this.consumeIP4MulticastAddress(e,t);case"IP6":case"ip6":return this.consumeIP6MulticastAddress(e,t);default:try{return this.consumeFQDN(e,t)}catch(i){return this.consumeExtnAddr(e,t)}}}consumeIP6MulticastAddress(e,t){const i=this.consumeHexpart(e,t);return"/"===e[i]?this.consumeInteger(e,i+1):i}consumeIP4MulticastAddress(e,t){let i=t+3;const n=e.slice(t,i),r=parseInt(n);if(r<224||r>239)throw new Error("Invalid IP4 multicast address, IPv4 multicast addresses may be in the range 224.0.0.0 to 239.255.255.255.");for(let t=0;t<3;t++){if("."!==e[i])throw new Error("Invalid IP4 multicast address.");i+=1,i=this.consumeDecimalUChar(e,i)}return"/"===e[i]&&(i+=1),i=this.consumeTTL(e,i),"/"===e[i]&&(i=this.consumeInteger(e,i)),i}consumeInteger(e,t){if(!u(e[t]))throw new Error("Invalid integer.");for(t+=1;a(e[t]);)t+=1;return t}consumeTTL(e,t){if("0"===e[t])return t+1;if(!u(e[t]))throw new Error("Invalid TTL.");t+=1;for(let i=0;i<2&&a(e[t]);i++)t+=1;return t}consumeToken(e,t){return this.consumeOneOrMore(e,t,d)}consumeTime(e,t){let i=t;if("0"===e[i])return i+1;for(u(e[i])&&(i+=1);a(e[i]);)i++;if(i-t<10)throw new Error("Invalid time");return i}consumeAddress(e,t){return this.consumeTill(e,t,o)}consumeTypedTime(e,t){let i=t;return i=this.consumeOneOrMore(e,i,a),l(e[i])?i+1:i}consumeRepeatInterval(e,t){if(!u(e[t]))throw new Error("Invalid repeat interval");for(t+=1;a(e[t]);)t+=1;return l(e[t])&&(t+=1),t}consumePort(e,t){return this.consumeOneOrMore(e,t,a)}consume(e,t,i){for(let n=0;n<i.length;n++){if(t+n>=e.length)throw new Error("consume exceeding value length");if(e[t+n]!==i[n])throw new Error("consume ".concat(i," failed at ").concat(n))}return t+i.length}consumeTill(e,t,i){let n=t;for(;n<e.length&&("string"!=typeof i||e[n]!==i)&&("function"!=typeof i||!i(e[n]));)n++;return n}}class T extends C{constructor(){super(),R(this,"records",[]),R(this,"currentLine",0)}parse(e){const t=this.probeEOL(e);this.records=e.split(t).filter((e=>!!e.trim())).map(this.parseLine),this.currentLine=0;const i=this.parseVersion(),n=this.parseOrigin(),r=this.parseSessionName(),o=this.parseInformation(),s=this.parseUri(),a=this.parseEmail(),c=this.parsePhone(),A=this.parseConnection(),d=this.parseBandWidth(),u=this.parseTimeFields(),E=this.parseKey(),l=this.parseSessionAttribute(),h=this.parseMediaDescription();if(this.currentLine!==this.records.length)throw new Error("parsing failed, non exhaustive sdp lines.");return{version:i,origin:n,sessionName:r,information:o,uri:s,emails:a,phones:c,connection:A,bandwidths:d,timeFields:u,key:E,attributes:l,mediaDescriptions:h}}getCurrentRecord(){const e=this.records[this.currentLine];if(!e)throw new Error("Record doesn't exit.");return e}probeEOL(e){for(let t=0;t<e.length;t++)if(e[t]===n)return"\r"===e[t-1]?r:n;throw new Error("Invalid newline character.")}parseLine(e,t){if(e.length<2)throw new Error("Invalid sdp line, sdp line should be of form <type>=<value>.");const i=e[0];if("="!==e[1])throw new Error('Invalid sdp line, <type> should be a single character followed by an "=" sign.');return{type:i,value:e.slice(2),line:t,cur:0}}parseSessionAttribute(){const e=new S;for(;this.currentLine<this.records.length;){const t=this.getCurrentRecord();if(t.type!==s.ATTRIBUTE)break;const i={attField:this.extractOneOrMore(t,(e=>d(e)&&":"!==e)),_cur:0};":"===t.value[t.cur]&&(t.cur+=1,i.attValue=this.extractOneOrMore(t,h)),e.parse(i),this.currentLine++}return e.digest()}parseMediaAttributes(e){const t=new O(e);for(;this.currentLine<this.records.length;){const e=this.getCurrentRecord();if(e.type!==s.ATTRIBUTE)break;const i={attField:this.extractOneOrMore(e,(e=>d(e)&&":"!==e)),_cur:0};":"===e.value[e.cur]&&(e.cur+=1,i.attValue=this.extractOneOrMore(e,h)),t.parse(i),this.currentLine++}return t.digest()}parseKey(){const e=this.getCurrentRecord();if(e.type===s.KEY){if("prompt"===e.value||"clear:"===e.value||"base64:"===e.value||"uri:"===e.value)return e.value;throw this.currentLine++,new Error("Invalid key.")}}parseZone(){const e=this.getCurrentRecord();if(e.type===s.ZONE_ADJUSTMENTS){const t=[];for(;;)try{const i=this.extract(e,this.consumeTime);this.consumeSpaceForRecord(e);let n=!1;"-"===e.value[e.cur]&&(n=!0,e.cur+=1);const r=this.extract(e,this.consumeTypedTime);t.push({time:i,typedTime:r,back:n})}catch(e){break}if(0===t.length)throw new Error("Invalid zone adjustments");return this.currentLine++,t}return[]}parseRepeat(){const e=[];for(;;){const t=this.getCurrentRecord();if(t.type!==s.REPEAT)break;{const i=this.extract(t,this.consumeRepeatInterval),n=this.parseTypedTime(t);e.push({repeatInterval:i,typedTimes:n}),this.currentLine++}}return e}parseTypedTime(e){const t=[];for(;;)try{this.consumeSpaceForRecord(e),t.push(this.extract(e,this.consumeTypedTime))}catch(e){break}if(0===t.length)throw new Error("Invalid typed time.");return t}parseTime(){const e=this.getCurrentRecord(),t=this.extract(e,this.consumeTime);this.consumeSpaceForRecord(e);const i=this.extract(e,this.consumeTime);return this.currentLine++,{startTime:t,stopTime:i}}parseBandWidth(){const e=[];for(;this.currentLine<this.records.length;){const t=this.getCurrentRecord();if(t.type!==s.BANDWIDTH)break;{const i=this.extractOneOrMore(t,d);if(":"!==t.value[t.cur])throw new Error("Invalid bandwidth field.");t.cur++;const n=this.extractOneOrMore(t,a);e.push({bwtype:i,bandwidth:n}),this.currentLine++}}return e}parseVersion(){const e=this.getCurrentRecord();if(e.type!==s.VERSION)throw new Error("first sdp record must be version");const t=e.value.slice(0,this.consumeOneOrMore(e.value,0,a));if(t.length!==e.value.length)throw new Error('invalid proto version, "v='.concat(e.value,'"'));return this.currentLine++,t}parseOrigin(){const e=this.getCurrentRecord();if(e.type!==s.ORIGIN)throw new Error("second line of sdp must be origin");const t=this.extractOneOrMore(e,A);this.consumeSpaceForRecord(e);const i=this.extractOneOrMore(e,a);this.consumeSpaceForRecord(e);const n=this.extractOneOrMore(e,a);this.consumeSpaceForRecord(e);const r=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const o=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const c=this.extract(e,this.consumeUnicastAddress);return this.currentLine++,{username:t,sessId:i,sessVersion:n,nettype:r,addrtype:o,unicastAddress:c}}parseSessionName(){const e=this.getCurrentRecord();if(e.type===s.SESSION_NAME){const t=this.extract(e,this.consumeText);return this.currentLine++,t}}parseInformation(){const e=this.getCurrentRecord();if(e.type!==s.INFORMATION)return;const t=this.extract(e,this.consumeText);return this.currentLine++,t}parseUri(){const e=this.getCurrentRecord();if(e.type===s.URI)return this.currentLine++,e.value}parseEmail(){const e=[];for(;;){const t=this.getCurrentRecord();if(t.type!==s.EMAIL)break;e.push(t.value),this.currentLine++}return e}parsePhone(){const e=[];for(;;){const t=this.getCurrentRecord();if(t.type!==s.PHONE)break;e.push(t.value),this.currentLine++}return e}parseConnection(){const e=this.getCurrentRecord();if(e.type===s.CONNECTION){const t=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const i=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const n=this.extract(e,this.consumeAddress);return this.currentLine++,{nettype:t,addrtype:i,address:n}}}parseMedia(){const e=this.getCurrentRecord(),t=this.extract(e,this.consumeToken);this.consumeSpaceForRecord(e);let i=this.extract(e,this.consumePort);"/"===e.value[e.cur]&&(e.cur+=1,i+=this.extract(e,this.consumeInteger)),this.consumeSpaceForRecord(e);const n=[];for(n.push(this.extract(e,this.consumeToken));"/"===e.value[e.cur];)e.cur+=1,n.push(this.extract(e,this.consumeToken));if(0===n.length)throw new Error("Invalid proto");const r=this.parseFmt(e);return this.currentLine++,{mediaType:t,port:i,protos:n,fmts:r}}parseTimeFields(){const e=[];for(;this.getCurrentRecord().type===s.TIME;){const t=this.parseTime(),i=this.parseRepeat(),n=this.parseZone();e.push({time:t,repeats:i,zones:n})}return e}parseMediaDescription(){const e=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===s.MEDIA;){const t=this.parseMedia(),i=this.parseInformation(),n=this.parseConnections(),r=this.parseBandWidth(),o=this.parseKey(),s=this.parseMediaAttributes(t);e.push({media:t,information:i,connections:n,bandwidths:r,key:o,attributes:s})}return e}parseConnections(){const e=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===s.CONNECTION;)e.push(this.parseConnection());return e}parseFmt(e){const t=[];for(;;)try{this.consumeSpaceForRecord(e),t.push(this.extract(e,this.consumeToken))}catch(e){break}if(0===t.length)throw new Error("Invalid fmts");return t}extract(e,t,...i){const n=t.call(this,e.value,e.cur,...i),r=e.value.slice(e.cur,n);return e.cur=n,r}extractOneOrMore(e,t){const i=this.consumeOneOrMore(e.value,e.cur,t),n=e.value.slice(e.cur,i);return e.cur=i,n}consumeSpaceForRecord(e){if(e.value[e.cur]!==o)throw new Error("Invalid space at ".concat(e.cur,"."));e.cur+=1}}class m extends C{constructor(...e){super(...e),R(this,"attributes",void 0),R(this,"digested",!1)}extractOneOrMore(e,t,i){const n=this.consumeOneOrMore(e.attValue,e._cur,t),r=e.attValue.slice(e._cur,n),[o,s]=i||[];if("number"==typeof o&&r.length<o)throw new Error("error in length, should be more or equal than ".concat(o," characters."));if("number"==typeof s&&r.length>s)throw new Error("error in length, should be less or equal than ".concat(s," characters."));return e._cur=n,r}consumeAttributeSpace(e){if(e.attValue[e._cur]!==o)throw new Error("Invalid space at ".concat(e._cur,"."));e._cur+=1}extract(e,t,...i){if(!e.attValue)throw new Error("Nothing to extract from attValue.");const n=t.call(this,e.attValue,e._cur,...i),r=e.attValue.slice(e._cur,n);return e._cur=n,r}atEnd(e){if(!e.attValue)throw new Error;return e._cur>=e.attValue.length}peekChar(e){if(!e.attValue)throw new Error;return e.attValue[e._cur]}peek(e,t){if(!e.attValue)throw new Error;for(let i=0;i<t.length;i++)if(t[i]!==e.attValue[e._cur+i])return!1;return!0}parseIceUfrag(e){if(this.attributes.iceUfrag)throw new Error("Invalid ice-ufrag, should be only a single line if 'a=ice-ufrag'");this.attributes.iceUfrag=this.extractOneOrMore(e,p,[4,256])}parseIcePwd(e){if(this.attributes.icePwd)throw new Error("Invalid ice-pwd, should be only a single line if 'a=ice-pwd'");this.attributes.icePwd=this.extractOneOrMore(e,p,[22,256])}parseIceOptions(e){if(this.attributes.iceOptions)throw new Error("Invalid ice-options, should be only one 'ice-options' line");const t=[];for(;!this.atEnd(e);){t.push(this.extractOneOrMore(e,p));try{this.consumeAttributeSpace(e)}catch(t){if(this.atEnd(e))break;throw t}}this.attributes.iceOptions=t}parseFingerprint(e){const t=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill);this.attributes.fingerprints.push({hashFunction:t,fingerprint:i})}parseExtmap(e){const t=this.extractOneOrMore(e,a);let i;"/"===this.peekChar(e)&&(this.extract(e,this.consume,"/"),i=this.extract(e,this.consumeToken)),this.consumeAttributeSpace(e);const n=this.extract(e,this.consumeTill,o),r=f(f({entry:parseInt(t,10)},i&&{direction:i}),{},{extensionName:n});this.peekChar(e)===o&&(this.consumeAttributeSpace(e),r.extensionAttributes=this.extract(e,this.consumeTill)),this.attributes.extmaps.push(r)}parseSetup(e){if(this.attributes.setup)throw new Error("must only be one single 'a=setup' line.");const t=this.extract(e,this.consumeTill);if("active"!==t&&"passive"!==t&&"actpass"!==t&&"holdconn"!==t)throw new Error("role must be one of 'active', 'passive', 'actpass', 'holdconn'.");this.attributes.setup=t}}class S extends m{constructor(...e){super(...e),R(this,"attributes",{unrecognized:[],groups:[],extmaps:[],fingerprints:[],identities:[]})}parse(e){if(this.digested)throw new Error("already digested");try{switch(e.attField){case"group":this.parseGroup(e);break;case"ice-lite":this.parseIceLite();break;case"ice-ufrag":this.parseIceUfrag(e);break;case"ice-pwd":this.parseIcePwd(e);break;case"ice-options":this.parseIceOptions(e);break;case"fingerprint":this.parseFingerprint(e);break;case"setup":this.parseSetup(e);break;case"tls-id":this.parseTlsId(e);break;case"identity":this.parseIdentity(e);break;case"extmap":this.parseExtmap(e);break;case"msid-semantic":this.parseMsidSemantic(e);break;default:e.ignored=!0,this.attributes.unrecognized.push(e)}}catch(t){throw console.error("parsing session attribute ".concat(e.attField,' error, "a=').concat(e.attField,":").concat(e.attValue,'"')),t}if(!e.ignored&&e.attValue&&!this.atEnd(e))throw new Error("attribute parsing error")}digest(){return this.digested=!0,this.attributes}parseGroup(e){const t=this.extract(e,this.consumeToken),i=[];for(;!this.atEnd(e)&&this.peekChar(e)===o;)this.consumeAttributeSpace(e),i.push(this.extract(e,this.consumeToken));this.attributes.groups.push({semantic:t,identificationTag:i})}parseIceLite(){if(this.attributes.iceLite)throw new Error("Invalid ice-lite, should be only a single line of 'a=ice-lite'");this.attributes.iceLite=!0}parseTlsId(e){if(this.attributes.tlsId)throw new Error("must be only one tld-id line");this.attributes.tlsId=this.extractOneOrMore(e,_)}parseIdentity(e){const t=this.extractOneOrMore(e,I),i=[];for(;!this.atEnd(e)&&this.peekChar(e)===o;){this.consumeAttributeSpace(e);const t=this.extract(e,this.consumeToken);this.extract(e,this.consume,"=");const n=this.extractOneOrMore(e,(e=>e!==o&&h(e)));i.push({name:t,value:n})}this.attributes.identities.push({assertionValue:t,extensions:i})}parseMsidSemantic(e){this.peekChar(e)===o&&this.consumeAttributeSpace(e);const t={semantic:this.extract(e,this.consumeToken),identifierList:[]};for(;;){try{this.consumeAttributeSpace(e)}catch(e){break}if("*"===this.peekChar(e)){this.extract(e,this.consume,"*"),t.applyForAll=!0;break}{const i=this.extract(e,this.consumeTill,o);t.identifierList.push(i)}}this.attributes.msidSemantic=t}}class O extends m{constructor(e){super(),R(this,"attributes",void 0),-1!==e.protos.indexOf("RTP")||e.protos.indexOf("rtp"),this.attributes={unrecognized:[],candidates:[],extmaps:[],fingerprints:[],imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[]}}parse(e){if(this.digested)throw new Error("already digested");try{switch(e.attField){case"extmap":this.parseExtmap(e);break;case"setup":this.parseSetup(e);break;case"ice-ufrag":this.parseIceUfrag(e);break;case"ice-pwd":this.parseIcePwd(e);break;case"ice-options":this.parseIceOptions(e);break;case"candidate":this.parseCandidate(e);break;case"remote-candidate":this.parseRemoteCandidate(e);break;case"end-of-candidates":this.parseEndOfCandidates();break;case"fingerprint":this.parseFingerprint(e);break;case"rtpmap":this.parseRtpmap(e);break;case"ptime":this.parsePtime(e);break;case"maxptime":this.parseMaxPtime(e);break;case"sendrecv":case"recvonly":case"sendonly":case"inactive":this.parseDirection(e);break;case"ssrc":this.parseSSRC(e);break;case"fmtp":this.parseFmtp(e);break;case"rtcp-fb":this.parseRtcpFb(e);break;case"rtcp-mux":this.parseRTCPMux();break;case"rtcp-mux-only":this.parseRTCPMuxOnly();break;case"rtcp-rsize":this.parseRTCPRsize();break;case"rtcp":this.parseRTCP(e);break;case"mid":this.parseMid(e);break;case"msid":this.parseMsid(e);break;case"imageattr":this.parseImageAttr(e);break;case"rid":this.parseRid(e);break;case"simulcast":this.parseSimulcast(e);break;case"sctp-port":this.parseSctpPort(e);break;case"max-message-size":this.parseMaxMessageSize(e);break;case"ssrc-group":this.parseSSRCGroup(e);break;default:e.ignored=!0,this.attributes.unrecognized.push(e)}}catch(t){throw console.error("parsing media attribute ".concat(e.attField,' error, "a=').concat(e.attField,":").concat(e.attValue,'"')),t}if(!e.ignored&&e.attValue&&!this.atEnd(e))throw new Error("attribute parsing error")}parseCandidate(e){const t=this.extractOneOrMore(e,p,[1,32]);this.consumeAttributeSpace(e);const i=this.extractOneOrMore(e,a,[1,5]);this.consumeAttributeSpace(e);const n=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e);const r=this.extractOneOrMore(e,a,[1,10]);this.consumeAttributeSpace(e);const s=this.extract(e,this.consumeAddress);this.consumeAttributeSpace(e);const A=this.extract(e,this.consumePort);this.consumeAttributeSpace(e),this.extract(e,this.consume,"typ"),this.consumeAttributeSpace(e);const d={foundation:t,componentId:i,transport:n,priority:r,connectionAddress:s,port:A,type:this.extract(e,this.consumeToken),extension:{}};for(this.peek(e," raddr")&&(this.extract(e,this.consume," raddr"),this.consumeAttributeSpace(e),d.relAddr=this.extract(e,this.consumeAddress)),this.peek(e," rport")&&(this.extract(e,this.consume," rport"),this.consumeAttributeSpace(e),d.relPort=this.extract(e,this.consumePort));this.peekChar(e)===o;){this.consumeAttributeSpace(e);const t=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e),d.extension[t]=this.extractOneOrMore(e,c)}this.attributes.candidates.push(d)}parseRemoteCandidate(e){const t=[];for(;;){const i=this.extractOneOrMore(e,a,[1,5]);this.consumeAttributeSpace(e);const n=this.extract(e,this.consumeAddress);this.consumeAttributeSpace(e);const r=this.extract(e,this.consumePort);t.push({componentId:i,connectionAddress:n,port:r});try{this.consumeAttributeSpace(e)}catch(e){break}}this.attributes.remoteCandidatesList.push(t)}parseEndOfCandidates(){if(this.attributes.endOfCandidates)throw new Error("must be only one line of end-of-candidates");this.attributes.endOfCandidates=!0}parseRtpmap(e){const t=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill,"/");this.extract(e,this.consume,"/");const n={encodingName:i,clockRate:this.extractOneOrMore(e,a)};this.atEnd(e)||"/"!==this.peekChar(e)||(this.extract(e,this.consume,"/"),n.encodingParameters=parseInt(this.extract(e,this.consumeTill),10));const r=this.attributes.payloads.find((e=>e.payloadType===parseInt(t,10)));r?r.rtpMap=n:this.attributes.payloads.push({payloadType:parseInt(t,10),rtpMap:n,rtcpFeedbacks:[]})}parsePtime(e){if(this.attributes.ptime)throw new Error("must be only one line of ptime");this.attributes.ptime=this.extract(e,this.consumeTill)}parseMaxPtime(e){if(this.attributes.maxPtime)throw new Error("must be only one line of ptime");this.attributes.maxPtime=this.extract(e,this.consumeTill)}parseDirection(e){if(this.attributes.direction)throw new Error("must be only one line of direction info");this.attributes.direction=e.attField}parseSSRC(e){const t=this.extractOneOrMore(e,a);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill,":");let n;":"===this.peekChar(e)&&(this.extract(e,this.consume,":"),n=this.extract(e,this.consumeTill));const r=this.attributes.ssrcs.find((e=>e.ssrcId===parseInt(t,10)));r?r.attributes[i]=n:this.attributes.ssrcs.push({ssrcId:parseInt(t,10),attributes:{[i]:n}})}parseFmtp(e){const t=this.extract(e,this.consumeTill,o);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill),n={};i.split(";").forEach((e=>{let[t,i]=e.split("=");t=t.trim(),i="string"==typeof i?i.trim():i,"string"==typeof t&&t.length>0&&(n[t]=i)}));const r=this.attributes.payloads.find((e=>e.payloadType===parseInt(t,10)));r?r.fmtp={parameters:n}:this.attributes.payloads.push({payloadType:parseInt(t,10),rtcpFeedbacks:[],fmtp:{parameters:n}})}parseFmtParameters(e){const t={},i=this.extract(e,this.consumeTill,"=");e._cur++;const n=this.extract(e,this.consumeTill,";");for(t[i]=n;";"===e.attValue[e._cur];){const i=this.extract(e,this.consumeTill,"=");e._cur++;const n=this.extract(e,this.consumeTill,";");t[i]=n}return t}parseRtcpFb(e){let t="";t="*"===this.peekChar(e)?this.extract(e,this.consume,"*"):this.extract(e,this.consumeTill,o),this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill,o);let n;if("trr-int"===i)n={type:i,interval:this.extract(e,this.consumeTill)};else{const t={type:i};this.peekChar(e)===o&&(this.consumeAttributeSpace(e),t.parameter=this.extract(e,this.consumeToken),this.peekChar(e)===o&&(t.additional=this.extract(e,this.consumeTill))),n=t}if("*"===t)this.attributes.rtcpFeedbackWildcards.push(n);else{const e=this.attributes.payloads.find((e=>e.payloadType===parseInt(t,10)));e?e.rtcpFeedbacks.push(n):this.attributes.payloads.push({payloadType:parseInt(t,10),rtcpFeedbacks:[n]})}}parseRTCPMux(){if(this.attributes.rtcpMux)throw new Error("must be single line of rtcp-mux");this.attributes.rtcpMux=!0}parseRTCPMuxOnly(){if(this.attributes.rtcpMuxOnly)throw new Error("must be single line of rtcp-only");this.attributes.rtcpMuxOnly=!0}parseRTCPRsize(){if(this.attributes.rtcpRsize)throw new Error("must be single line of rtcp-rsize");this.attributes.rtcpRsize=!0}parseRTCP(e){if(this.attributes.rtcp)throw new Error("must be single line of rtcp");const t={port:this.extract(e,this.consumePort)};this.peekChar(e)===o&&(this.consumeAttributeSpace(e),t.netType=this.extractOneOrMore(e,d),this.consumeAttributeSpace(e),t.addressType=this.extractOneOrMore(e,d),this.consumeAttributeSpace(e),t.address=this.extract(e,this.consumeAddress)),this.attributes.rtcp=t}parseMsid(e){const t={id:this.extractOneOrMore(e,d,[1,64])};this.peekChar(e)===o&&(this.consumeAttributeSpace(e),t.appdata=this.extractOneOrMore(e,d,[1,64])),this.attributes.msids.push(t)}parseImageAttr(e){this.attributes.imageattr.push(e.attValue)}parseRid(e){const t=this.extractOneOrMore(e,(e=>E(e)||a(e)||"_"===e||"-"===e));this.consumeAttributeSpace(e);const i={id:t,direction:this.extract(e,this.consumeToken),params:[]};if(this.peekChar(e)===o){if(this.consumeAttributeSpace(e),this.peek(e,"pt=")){this.extract(e,this.consume,"pt=");const t=[];for(;;){const i=this.extract(e,this.consumeToken);t.push(i);try{this.extract(e,this.consume,",")}catch(e){break}}i.payloads=t,this.peekChar(e)===o&&this.extract(e,this.consume,o)}for(;;){const t=this.extract(e,this.consumeToken);switch(t){case"depend":{const n={type:t,rids:this.extract(e,this.consume,"=").split(",")};i.params.push(n);break}default:{const n={type:t};"="===this.peekChar(e)&&(this.extract(e,this.consume,"="),n.val=this.extract(e,this.consumeTill,";")),i.params.push(n)}}try{this.extract(e,this.consume,";")}catch(e){break}}}this.attributes.rids.push(i)}parseSimulcast(e){if(this.attributes.simulcast)throw new Error("must be single line of simulcast");this.attributes.simulcast=e.attValue,this.extract(e,this.consumeTill)}parseSctpPort(e){this.attributes.sctpPort=this.extractOneOrMore(e,a,[1,5])}parseMaxMessageSize(e){this.attributes.maxMessageSize=this.extractOneOrMore(e,a,[1,void 0])}digest(){return this.digested=!0,this.attributes}parseMid(e){this.attributes.mid=this.extract(e,this.consumeToken)}parseSSRCGroup(e){const t=this.extract(e,this.consumeToken),i=[];for(;;)try{this.consumeAttributeSpace(e);const t=this.extract(e,this.consumeInteger);i.push(parseInt(t,10))}catch(e){break}this.attributes.ssrcGroups.push({semantic:t,ssrcIds:i})}}function v(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class N{constructor(){v(this,"eol",r)}print(e,t){let i="";return t&&(this.eol=t),i+=this.printVersion(e.version),i+=this.printOrigin(e.origin),i+=this.printSessionName(e.sessionName),i+=this.printInformation(e.information),i+=this.printUri(e.uri),i+=this.printEmail(e.emails),i+=this.printPhone(e.phones),i+=this.printConnection(e.connection),i+=this.printBandwidth(e.bandwidths),i+=this.printTimeFields(e.timeFields),i+=this.printKey(e.key),i+=this.printSessionAttributes(e.attributes),i+=this.printMediaDescription(e.mediaDescriptions),i}printVersion(e){return"v=".concat(e).concat(this.eol)}printOrigin(e){return"o=".concat(e.username," ").concat(e.sessId," ").concat(e.sessVersion," ").concat(e.nettype," ").concat(e.addrtype," ").concat(e.unicastAddress).concat(this.eol)}printSessionName(e){return e?"s=".concat(e).concat(this.eol):""}printInformation(e){return e?"i=".concat(e).concat(this.eol):""}printUri(e){return e?"u=".concat(e).concat(this.eol):""}printEmail(e){let t="";for(const i of e)t+="e=".concat(i).concat(this.eol);return t}printPhone(e){let t="";for(const i of e)t+="e=".concat(i).concat(this.eol);return t}printConnection(e){return e?"c=".concat(e.nettype," ").concat(e.addrtype," ").concat(e.address).concat(this.eol):""}printBandwidth(e){let t="";for(const i of e)t+="b=".concat(i.bwtype,":").concat(i.bandwidth).concat(this.eol);return t}printTimeFields(e){let t="";for(const i of e){t+="t=".concat(i.time.startTime," ").concat(i.time.startTime).concat(this.eol);for(const e of i.repeats)t+="r=".concat(e.repeatInterval," ").concat(e.typedTimes.join(" ")).concat(this.eol);i.zoneAdjustments&&(t+="z=",t+="z=".concat(i.zoneAdjustments.map((e=>"".concat(e.time," ").concat(e.back?"-":""," ").concat(e.typedTime))).join(" ")).concat(this.eol),t+=this.eol)}return t}printKey(e){return e?"k=".concat(e).concat(this.eol):""}printAttributes(e){let t="";for(const i of e)t+="a=".concat(i.attField).concat(i.attValue?":".concat(i.attValue):"").concat(this.eol);return t}printMediaDescription(e){let t="";for(const i of e)t+=this.printMedia(i.media),t+=this.printInformation(i.information),t+=this.printConnections(i.connections),t+=this.printBandwidth(i.bandwidths),t+=this.printKey(i.key),t+=this.printMediaAttributes(i);return t}printConnections(e){let t="";for(const i of e)t+=this.printConnection(i);return t}printMedia(e){return"m=".concat(e.mediaType," ").concat(e.port," ").concat(e.protos.join("/")," ").concat(e.fmts.join(" ")).concat(this.eol)}printSessionAttributes(e){return new D(this.eol).print(e)}printMediaAttributes(e){return new w(this.eol).print(e)}}class y{constructor(e){v(this,"eol",void 0),this.eol=e}printIceUfrag(e){return void 0===e?"":"a=ice-ufrag:".concat(e).concat(this.eol)}printIcePwd(e){return void 0===e?"":"a=ice-pwd:".concat(e).concat(this.eol)}printIceOptions(e){return void 0===e?"":"a=ice-options:".concat(e.join(o)).concat(this.eol)}printFingerprints(e){return e.length>0?e.map((e=>"a=fingerprint:".concat(e.hashFunction).concat(o).concat(e.fingerprint))).join(this.eol)+this.eol:""}printExtmap(e){return e.map((e=>"a=extmap:".concat(e.entry).concat(e.direction?"/".concat(e.direction):"").concat(o).concat(e.extensionName).concat(e.extensionAttributes?"".concat(o).concat(e.extensionAttributes):"").concat(this.eol))).join("")}printSetup(e){return void 0===e?"":"a=setup:".concat(e).concat(this.eol)}printUnrecognized(e){return e.map((e=>"a=".concat(e.attField).concat(e.attValue?":".concat(e.attValue):"").concat(this.eol))).join("")}}class D extends y{print(e){let t="";return t+=this.printGroups(e.groups),t+=this.printMsidSemantic(e.msidSemantic),t+=this.printIceLite(e.iceLite),t+=this.printIceUfrag(e.iceUfrag),t+=this.printIcePwd(e.icePwd),t+=this.printIceOptions(e.iceOptions),t+=this.printFingerprints(e.fingerprints),t+=this.printSetup(e.setup),t+=this.printTlsId(e.tlsId),t+=this.printIdentity(e.identities),t+=this.printExtmap(e.extmaps),t+=this.printUnrecognized(e.unrecognized),t}printGroups(e){let t="";return e.length>0&&(t+=e.map((e=>"a=group:".concat(e.semantic).concat(e.identificationTag.map((e=>"".concat(o).concat(e))).join("")).concat(this.eol))).join("")),t}printIceLite(e){return void 0===e?"":"a=ice-lite"+this.eol}printTlsId(e){return e?"a=tls-id:".concat(e).concat(this.eol):""}printIdentity(e){return 0===e.length?"":e.map((e=>"a=identity:".concat(e.assertionValue).concat(e.extensions.map((e=>"".concat(o).concat(e.name).concat(e.value?"=".concat(e.value):"")))))).join(this.eol)+this.eol}printMsidSemantic(e){if(!e)return"";let t="a=msid-semantic:".concat(e.semantic);return e.applyForAll?t+="".concat(o,"*"):e.identifierList.length>0&&(t+=e.identifierList.map((e=>"".concat(o).concat(e)))),t+this.eol}}class w extends y{print(e){const t=e.attributes;let i="";return i+=this.printRTCP(t.rtcp),i+=this.printIceUfrag(t.iceUfrag),i+=this.printIcePwd(t.icePwd),i+=this.printIceOptions(t.iceOptions),i+=this.printCandidates(t.candidates),i+=this.printRemoteCandidatesList(t.remoteCandidatesList),i+=this.printEndOfCandidates(t.endOfCandidates),i+=this.printFingerprints(t.fingerprints),i+=this.printSetup(t.setup),i+=this.printMid(t.mid),i+=this.printExtmap(t.extmaps),i+=this.printRTPRelated(t),i+=this.printPtime(t.ptime),i+=this.printMaxPtime(t.maxPtime),i+=this.printDirection(t.direction),i+=this.printSSRCGroups(t.ssrcGroups),i+=this.printSSRC(t.ssrcs),i+=this.printRTCPMux(t.rtcpMux),i+=this.printRTCPMuxOnly(t.rtcpMuxOnly),i+=this.printRTCPRsize(t.rtcpRsize),i+=this.printMSId(t.msids),i+=this.printImageattr(t.imageattr),i+=this.printRid(t.rids),i+=this.printSimulcast(t.simulcast),i+=this.printSCRPPort(t.sctpPort),i+=this.printMaxMessageSize(t.maxMessageSize),i+=this.printUnrecognized(t.unrecognized),i}printCandidates(e){return e.map((e=>"a=candidate:".concat(e.foundation).concat(o).concat(e.componentId).concat(o).concat(e.transport).concat(o).concat(e.priority).concat(o).concat(e.connectionAddress).concat(o).concat(e.port).concat(o,"typ").concat(o).concat(e.type).concat(e.relAddr?"".concat(o,"raddr").concat(o).concat(e.relAddr):"").concat(e.relPort?"".concat(o,"rport").concat(o).concat(e.relPort):"").concat(Object.keys(e.extension).map((t=>"".concat(o).concat(t).concat(o).concat(e.extension[t]))).join("")).concat(this.eol))).join("")}printRemoteCandidatesList(e){return e.map((e=>"a=remote-candidates:".concat(e.join(o)).concat(this.eol))).join("")}printEndOfCandidates(e){return void 0===e?"":"a=end-of-candidates"+this.eol}printRTPRelated(e){if(!e.payloads)return"";const t=e.payloads;let i="";i+=e.rtcpFeedbackWildcards.map((e=>this.printRTCPFeedback("*",e))).join("");for(const e of t)i+=this.printRtpMap(e.payloadType,e.rtpMap),i+=this.printFmtp(e.payloadType,e.fmtp),i+=e.rtcpFeedbacks.map((t=>this.printRTCPFeedback(e.payloadType,t))).join("");return i}printFmtp(e,t){if(!t)return"";const i=Object.keys(t.parameters);return 1===i.length&&void 0===t.parameters[i[0]]?"a=fmtp:".concat(e).concat(o).concat(i[0]).concat(this.eol):"a=fmtp:".concat(e).concat(o).concat(Object.keys(t.parameters).map((e=>"".concat(e,"=").concat(t.parameters[e]))).join(";")).concat(this.eol)}printRtpMap(e,t){return t?"a=rtpmap:".concat(e).concat(o).concat(t.encodingName,"/").concat(t.clockRate).concat(t.encodingParameters?"/".concat(t.encodingParameters):"").concat(this.eol):""}printRTCPFeedback(e,t){let i="a=rtcp-fb:".concat(e).concat(o),n=t;return"trr-int"===n.type?i+="ttr-int".concat(o).concat(n.interval):(n=n,i+="".concat(n.type),n.parameter&&(i+="".concat(o).concat(n.parameter),n.additional&&(i+="".concat(o).concat(n.additional)))),i+this.eol}printPtime(e){return void 0===e?"":"a=ptime:".concat(e).concat(this.eol)}printMaxPtime(e){return void 0===e?"":"a=maxptime:".concat(e).concat(this.eol)}printDirection(e){return void 0===e?"":"a=".concat(e).concat(this.eol)}printSSRC(e){return e.map((e=>Object.keys(e.attributes).map((t=>"a=ssrc:".concat(e.ssrcId.toString(10)).concat(o).concat(t).concat(e.attributes[t]?":".concat(e.attributes[t]):"").concat(this.eol))).join(""))).join("")}printRTCPMux(e){return void 0===e?"":"a=rtcp-mux".concat(this.eol)}printRTCPMuxOnly(e){return void 0===e?"":"a=rtcp-mux-only".concat(this.eol)}printRTCPRsize(e){return void 0===e?"":"a=rtcp-rsize".concat(this.eol)}printRTCP(e){if(void 0===e)return"";let t="a=rtcp:".concat(e.port);return e.netType&&(t+="".concat(o).concat(e.netType)),e.addressType&&(t+="".concat(o).concat(e.addressType)),e.address&&(t+="".concat(o).concat(e.address)),t+this.eol}printMSId(e){return e.map((e=>"a=msid:".concat(e.id).concat(e.appdata?"".concat(o).concat(e.appdata):"").concat(this.eol))).join("")}printImageattr(e){return e.map((e=>"a=imageattr:".concat(e).concat(this.eol))).join("")}printRid(e){return e.map((e=>{let t="a=rid:".concat(e.id).concat(o).concat(e.direction);return e.payloads&&(t+="".concat(o,"pt=").concat(e.payloads.join(","))),e.params.length>0&&(t+="".concat(o).concat(e.params.map((e=>"depend"===e.type?"depend=".concat(e.rids.join(",")):"".concat(e.type,"=").concat(e.val))).join(";"))),t+this.eol})).join("")}printSimulcast(e){return void 0===e?"":"a=simulcast:".concat(e).concat(this.eol)}printSCRPPort(e){return void 0===e?"":"a=sctp-port:".concat(e).concat(this.eol)}printMaxMessageSize(e){return void 0===e?"":"a=max-message-size:".concat(e)}printMid(e){return void 0===e?"":"a=mid:".concat(e).concat(this.eol)}printSSRCGroups(e){return e.map((e=>"a=ssrc-group:".concat(e.semantic).concat(e.ssrcIds.map((e=>"".concat(o).concat(e.toString(10)))).join("")).concat(this.eol))).join("")}}function b(e){return(new T).parse(e)}function L(e,t){return(new N).print(e,t)}}},t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}return i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(8)})()}(yz);class Fz{constructor(e){tD(this,"sessionDesc",void 0),tD(this,"localCapabilities",void 0),tD(this,"rtpCapabilities",void 0),tD(this,"candidates",void 0),tD(this,"iceParameters",void 0),tD(this,"dtlsParameters",void 0),tD(this,"setup",void 0),tD(this,"currentMidIndex",void 0),tD(this,"cname",void 0),e=VG(e);const{remoteIceParameters:t,remoteDtlsParameters:i,candidates:n,remoteRTPCapabilities:r,remoteSetup:o,localCapabilities:s,sdkCodec:a,cname:c}=e,A=yz.exports.parse("v=0\no=- 0 0 IN IP4 127.0.0.1\ns=AgoraGateway\nt=0 0\na=group:BUNDLE audio video\na=msid-semantic: WMS\na=ice-lite\nm=audio 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendrecv\na=rtcp-mux\na=rtcp-rsize\na=mid:audio\nm=video 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendrecv\na=rtcp-mux\na=rtcp-rsize\na=mid:video\n");this.rtpCapabilities=r,this.candidates=n,this.iceParameters=t,this.dtlsParameters=i,this.setup=o,this.localCapabilities=s,this.cname=c;for(let e=0;e<A.mediaDescriptions.length;e++){const s=A.mediaDescriptions[e];if(s.attributes.iceUfrag=t.iceUfrag,s.attributes.icePwd=t.icePwd,s.attributes.fingerprints=i.fingerprints,s.attributes.candidates=n,s.attributes.setup=o,"video"===s.media.mediaType){s.media.fmts=r.videoCodecs.map((e=>e.payloadType.toString(10)));const e=r.videoCodecs.filter((e=>{var t;return null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase().includes(a)}));if(0===e.length)throw new Error("Codec ".concat(a," not supported by remote SDP."));s.attributes.payloads=e,s.attributes.extmaps=r.videoExtensions}"audio"===s.media.mediaType&&(s.media.fmts=r.audioCodecs.map((e=>e.payloadType.toString(10))),s.attributes.payloads=r.audioCodecs,s.attributes.extmaps=r.audioExtensions),A.mediaDescriptions[e]=this.mungMediaDesc(s)}this.sessionDesc=A,this.currentMidIndex=A.mediaDescriptions.length-1}toString(){return yz.exports.print(this.sessionDesc)}send(e,t,i){const{ssrcs:n,ssrcGroups:r}=kz(t,this.cname),o=this.sessionDesc.mediaDescriptions.find((t=>e===QP.VIDEO?"video"===t.media.mediaType:"audio"===t.media.mediaType)),s=n[0].attributes.label,a=n[0].attributes.mslabel;return o.attributes.ssrcs=o.attributes.ssrcs.concat(n),o.attributes.ssrcGroups=o.attributes.ssrcGroups.concat(r),{id:s,mslabel:a}}batchSend(e){return e.map((e=>{let{kind:t,ssrcMsg:i}=e;return this.send(t,i,void 0)}))}stopSending(e){this.sessionDesc.mediaDescriptions.forEach((t=>{const i=[],n=[],r=[];t.attributes.ssrcs.forEach((t=>{e.includes(t.attributes.label||"")?r.push(t):i.push(t)})),t.attributes.ssrcGroups.forEach((e=>{r.map((e=>e.ssrcId)).includes(e.ssrcIds[0])||n.push(e)})),t.attributes.ssrcs=i,t.attributes.ssrcGroups=n}))}mute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.mute."));t.attributes.direction="inactive"}unmute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.unmute."));t.attributes.direction="sendonly"}receive(e,t,i){e.forEach(((e,t)=>{const i=e._mediaStreamTrack,n=this.sessionDesc.mediaDescriptions.findIndex((e=>e.attributes.mid===i.kind)),r=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[n],e);this.sessionDesc.mediaDescriptions[n]=r}))}stopReceiving(e){}restartICE(e,t){e=VG(e),t=VG(t),this.iceParameters=e,this.candidates=t,this.sessionDesc.mediaDescriptions.forEach((t=>{t.attributes.iceUfrag=e.iceUfrag,t.attributes.icePwd=e.icePwd,t.attributes.candidates=this.candidates}))}predictReceivingMids(e){const t=[];for(let i=0;i<e;i++)t.push((this.currentMidIndex+i+1).toString(10));return t}mungRecvMediaDsec(e,t){const i=VG(e);return Mz(i,t),Bz(i,t),i}updateRecvMedia(e,t){const i=this.sessionDesc.mediaDescriptions.findIndex((t=>t.attributes.mid===e));if(-1!==i){const e=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[i],t);this.sessionDesc.mediaDescriptions[i]=e}}bumpMid(e){this.currentMidIndex+=e}updateTrackLabel(e,t,i){const n=this.sessionDesc.mediaDescriptions.find((t=>e===QP.VIDEO?"video"===t.attributes.mid:"audio"===t.attributes.mid));if(n){const e=n.attributes.ssrcs.find((e=>e.attributes.label===t));var r;e&&(e.attributes.label=i,null===(r=e.attributes.msid)||void 0===r||r.replace(t,i))}}mungMediaDesc(e){const t=VG(e);return Uz(t),function(e){const t=e.attributes.extmaps.find((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName));t&&e.attributes.extmaps.splice(e.attributes.extmaps.indexOf(t),1),e.attributes.payloads.forEach((e=>{const t=e.rtcpFeedbacks.findIndex((e=>"transport-cc"===e.type));-1!==t&&e.rtcpFeedbacks.splice(t,1)}))}(t),t}}function Gz(e){if(Array.isArray(e))return e.map((function(e){return e}));if(!jz(e))return e;var t={};for(var i in e)jz(e[i])||Array.isArray(e[i])?t[i]=Gz(e[i]):t[i]=e[i];return t}function jz(e){return!("object"!=typeof e||Array.isArray(e)||!e)}var Yz=function(){function e(e){this.input=[],this.size=e}return e.prototype.add=function(e){this.input.push(e),this.input.length>this.size&&this.input.splice(0,1)},e.prototype.diffMean=function(){return 0===this.input.length?0:(this.input[this.input.length-1]-this.input[0])/this.input.length},e}(),Hz=function(e,t){return(Hz=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function Kz(e,t){function i(){this.constructor=e}Hz(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Wz=function(){return(Wz=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Jz(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new i((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function qz(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var Xz,zz={address:"unknown",candidateType:"unknown",id:"unknown",port:0,priority:0,protocol:"unknown",type:"unknown"},Zz={timestamp:0,bitrate:{actualEncoded:0,transmit:0},sendPacketLossRate:0,recvPacketLossRate:0,videoRecv:[],videoSend:[],audioRecv:[],audioSend:[],selectedCandidatePair:{id:"unknown",localCandidate:zz,remoteCandidate:zz}},$z={firsCount:0,nacksCount:0,plisCount:0,framesDecodeCount:0,framesDecodeInterval:0,framesDecodeFreezeTime:0,decodeFrameRate:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,qpSumPerFrame:0},eZ={firsCount:0,nacksCount:0,plisCount:0,frameCount:0,bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,qpSumPerFrame:0},tZ={bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0},iZ={jitterBufferMs:0,jitterMs:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,receivedFrames:0,droppedFrames:0},nZ=function(){function e(e,t){var i=this;this.videoIsReady=!1,this.videoIsReady2={},this.stats=Gz(Zz),this.isFirstVideoReceived={},this.isFirstVideoDecoded={},this.isFirstAudioReceived={},this.isFirstAudioDecoded={},this.lossRateWindowStats=[],this.pc=e,this.options=t,this.intervalTimer=window.setInterval((function(){return Jz(i,void 0,void 0,(function(){return qz(this,(function(e){return this.updateStats(),[2]}))}))}),this.options.updateInterval)}return e.prototype.getStats=function(){return this.stats},e.prototype.setVideoIsReady=function(e){this.videoIsReady=e},e.prototype.setVideoIsReady2=function(e,t){this.videoIsReady2[e]=t},e.prototype.getVideoIsReady=function(e){return this.videoIsReady2[e]||!1},e.prototype.setIsFirstAudioDecoded=function(e){},e.prototype.destroy=function(){window.clearInterval(this.intervalTimer),this.pc=void 0},e.prototype.calcLossRate=function(e){var t=this;this.lossRateWindowStats.push(e),this.lossRateWindowStats.length>this.options.lossRateInterval&&this.lossRateWindowStats.splice(0,1);for(var i=this.lossRateWindowStats.length,n=0,r=0,o=0,s=0,a=function(a){e[a].forEach((function(e,c){if(t.lossRateWindowStats[i-1][a][c]&&t.lossRateWindowStats[0][a][c]){var A=t.lossRateWindowStats[i-1][a][c].packets-t.lossRateWindowStats[0][a][c].packets,d=t.lossRateWindowStats[i-1][a][c].packetsLost-t.lossRateWindowStats[0][a][c].packetsLost;"videoSend"===a||"audioSend"===a?(n+=A,o+=d):(r+=A,s+=d),Number.isNaN(A)||Number.isNaN(A)?e.packetLostRate=0:e.packetLostRate=A<=0||d<=0?0:d/(A+d)}}))},c=0,A=["videoSend","audioSend","videoRecv","audioRecv"];c<A.length;c++)a(A[c]);e.sendPacketLossRate=n<=0||o<=0?0:o/(n+o),e.recvPacketLossRate=r<=0||s<=0?0:s/(r+s)},e}(),rZ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._stats=Zz,t.lastDecodeVideoReceiverStats=new Map,t}return Kz(t,e),t.prototype.updateStats=function(){return Jz(this,void 0,void 0,(function(){var e,t,i,n;return qz(this,(function(r){switch(r.label){case 0:return[4,this._getStats()];case 1:return e=r.sent(),t=this.statsResponsesToObjects(e),this._stats=Gz(Zz),i=t.filter((function(e){return"ssrc"===e.type})),this.processSSRCStats(i),(n=t.find((function(e){return"VideoBwe"===e.type})))&&this.processBandwidthStats(n),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats,[2]}}))}))},t.prototype.processBandwidthStats=function(e){this._stats.bitrate={actualEncoded:Number(e.googActualEncBitrate),targetEncoded:Number(e.googTargetEncBitrate),retransmit:Number(e.googRetransmitBitrate),transmit:Number(e.googTransmitBitrate)},this._stats.sendBandwidth=Number(e.googAvailableSendBandwidth)},t.prototype.processSSRCStats=function(e){var t=this;e.forEach((function(e){var i=e.id.includes("send");switch(e.mediaType+"_"+(i?"send":"recv")){case"video_send":var n=Gz(eZ);n.codec=e.googCodecName,n.adaptionChangeReason="none",e.googCpuLimitedResolution&&(n.adaptionChangeReason="cpu"),e.googBandwidthLimitedResolution&&(n.adaptionChangeReason="bandwidth"),n.avgEncodeMs=Number(e.googAvgEncodeMs),n.inputFrame={width:Number(e.googFrameWidthInput)||Number(e.googFrameWidthSent),height:Number(e.googFrameHeightInput)||Number(e.googFrameHeightSent),frameRate:Number(e.googFrameRateInput)},n.sentFrame={width:Number(e.googFrameWidthSent),height:Number(e.googFrameHeightSent),frameRate:Number(e.googFrameRateInput)},n.firsCount=Number(e.googFirReceived),n.nacksCount=Number(e.googNacksReceived),n.plisCount=Number(e.googPlisReceived),n.frameCount=Number(e.framesEncoded),n.bytes=Number(e.bytesSent),n.packets=Number(e.packetsSent),n.packetsLost=Number(e.packetsLost),n.ssrc=Number(e.ssrc),n.rttMs=Number(e.googRtt||0),t._stats.videoSend.push(n),t._stats.rtt=n.rttMs;break;case"video_recv":var r=Gz($z),o=t.lastDecodeVideoReceiverStats.get(Number(e.ssrc));if(r.codec=e.googCodecName,r.targetDelayMs=Number(e.googTargetDelayMs),r.renderDelayMs=Number(e.googRenderDelayMs),r.currentDelayMs=Number(e.googCurrentDelayMs),r.minPlayoutDelayMs=Number(e.googMinPlayoutDelayMs),r.decodeMs=Number(e.googDecodeMs),r.maxDecodeMs=Number(e.googMaxDecodeMs),r.receivedFrame={width:Number(e.googFrameWidthReceived),height:Number(e.googFrameHeightReceived),frameRate:Number(e.googFrameRateReceived)},r.decodedFrame={width:Number(e.googFrameWidthReceived),height:Number(e.googFrameHeightReceived),frameRate:Number(e.googFrameRateDecoded)},r.outputFrame={width:Number(e.googFrameWidthReceived),height:Number(e.googFrameHeightReceived),frameRate:Number(e.googFrameRateOutput)},r.jitterBufferMs=Number(e.googJitterBufferMs),r.firsCount=Number(e.googFirsSent),r.nacksCount=Number(e.googNacksSent),r.plisCount=Number(e.googPlisSent),r.framesDecodeCount=Number(e.framesDecoded),r.bytes=Number(e.bytesReceived),r.packets=Number(e.packetsReceived),r.packetsLost=Number(e.packetsLost),r.ssrc=Number(e.ssrc),r.packets>0&&!t.isFirstVideoReceived[r.ssrc]&&(t.onFirstVideoReceived&&t.onFirstVideoReceived(r.ssrc),t.isFirstVideoReceived[r.ssrc]=!0),r.framesDecodeCount>0&&!t.isFirstVideoDecoded[r.ssrc]&&(t.onFirstVideoDecoded&&t.onFirstVideoDecoded(r.ssrc,r.decodedFrame.width,r.decodedFrame.height),t.isFirstVideoDecoded[r.ssrc]=!0),o){var s=o.stats,a=Date.now()-o.lts;r.framesDecodeFreezeTime=s.framesDecodeFreezeTime,r.framesDecodeInterval=s.framesDecodeInterval,r.framesDecodeCount>s.framesDecodeCount&&t.isFirstVideoDecoded?(o.lts=Date.now(),r.framesDecodeInterval=a,r.framesDecodeInterval>=t.options.freezeRateLimit&&(t.getVideoIsReady(parseInt(e.ssrc,10))?r.framesDecodeFreezeTime+=r.framesDecodeInterval:t.setVideoIsReady2(parseInt(e.ssrc,10),!0))):r.framesDecodeCount<o.stats.framesDecodeCount&&(r.framesDecodeInterval=0)}t.lastDecodeVideoReceiverStats.set(r.ssrc,{stats:Wz({},r),lts:Date.now()}),t._stats.videoRecv.push(r);break;case"audio_recv":var c=Gz(iZ);c.codec=e.googCodecName,c.outputLevel=Math.abs(Number(e.audioOutputLevel))/32767,c.decodingCNG=Number(e.googDecodingCNG),c.decodingCTN=Number(e.googDecodingCTN),c.decodingCTSG=Number(e.googDecodingCTSG),c.decodingNormal=Number(e.googDecodingNormal),c.decodingPLC=Number(e.googDecodingPLC),c.decodingPLCCNG=Number(e.googDecodingPLCCNG),c.expandRate=Number(e.googExpandRate),c.accelerateRate=Number(e.googAccelerateRate),c.preemptiveExpandRate=Number(e.googPreemptiveExpandRate),c.secondaryDecodedRate=Number(e.googSecondaryDecodedRate),c.speechExpandRate=Number(e.googSpeechExpandRate),c.preferredJitterBufferMs=Number(e.googPreferredJitterBufferMs),c.jitterBufferMs=Number(e.googJitterBufferMs),c.jitterMs=Number(e.googJitterReceived),c.bytes=Number(e.bytesReceived),c.packets=Number(e.packetsReceived),c.packetsLost=Number(e.packetsLost),c.ssrc=Number(e.ssrc),c.receivedFrames=Number(e.googDecodingCTN)||Number(e.packetsReceived),c.droppedFrames=Number(e.googDecodingPLC)+Number(e.googDecodingPLCCNG)||Number(e.packetsLost),c.receivedFrames>0&&!t.isFirstAudioReceived[c.ssrc]&&(t.onFirstAudioReceived&&t.onFirstAudioReceived(c.ssrc),t.isFirstAudioReceived[c.ssrc]=!0),c.decodingNormal>0&&!t.isFirstAudioDecoded[c.ssrc]&&(t.onFirstAudioDecoded&&t.onFirstAudioDecoded(c.ssrc),t.isFirstAudioDecoded[c.ssrc]=!0),t._stats.audioRecv.push(c);break;case"audio_send":var A=Gz(tZ);A.codec=e.googCodecName,A.inputLevel=Math.abs(Number(e.audioInputLevel))/32767,A.aecReturnLoss=Number(e.googEchoCancellationReturnLoss||0),A.aecReturnLossEnhancement=Number(e.googEchoCancellationReturnLossEnhancement||0),A.residualEchoLikelihood=Number(e.googResidualEchoLikelihood||0),A.residualEchoLikelihoodRecentMax=Number(e.googResidualEchoLikelihoodRecentMax||0),A.bytes=Number(e.bytesSent),A.packets=Number(e.packetsSent),A.packetsLost=Number(e.packetsLost),A.ssrc=Number(e.ssrc),A.rttMs=Number(e.googRtt||0),t._stats.rtt=A.rttMs,t._stats.audioSend.push(A)}}))},t.prototype._getStats=function(){var e=this;return new Promise((function(t,i){e.pc.getStats(t,i)}))},t.prototype.statsResponsesToObjects=function(e){var t=[];return e.result().forEach((function(e){var i={id:e.id,timestamp:e.timestamp.valueOf().toString(),type:e.type};e.names().forEach((function(t){i[t]=e.stat(t)})),t.push(i)})),t},t}(nZ);!function(e){e.CERTIFICATE="certificate",e.CODEC="codec",e.CANDIDATE_PAIR="candidate-pair",e.LOCAL_CANDIDATE="local-candidate",e.REMOTE_CANDIDATE="remote-candidate",e.INBOUND="inbound-rtp",e.TRACK="track",e.OUTBOUND="outbound-rtp",e.PC="peer-connection",e.REMOTE_INBOUND="remote-inbound-rtp",e.REMOTE_OUTBOUND="remote-outbound-rtp",e.TRANSPORT="transport",e.CSRC="csrc",e.DATA_CHANNEL="data-channel",e.STREAM="stream",e.SENDER="sender",e.RECEIVER="receiver"}(Xz||(Xz={}));var oZ,sZ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._stats=Zz,t.lastDecodeVideoReceiverStats=new Map,t.lastVideoFramesRecv=new Map,t.lastVideoFramesSent=new Map,t.lastVideoFramesDecode=new Map,t.lastVideoJBDelay=new Map,t.lastAudioJBDelay=new Map,t.mediaBytesSent=new Map,t.mediaBytesRetransmit=new Map,t.mediaBytesTargetEncode=new Map,t.lastEncoderMs=new Map,t}return Kz(t,e),t.prototype.updateStats=function(){return Jz(this,void 0,void 0,(function(){var e,t=this;return qz(this,(function(i){switch(i.label){case 0:return e=this,[4,this.pc.getStats()];case 1:return e.report=i.sent(),this._stats=Gz(Zz),this.report.forEach((function(e){switch(e.type){case Xz.OUTBOUND:"audio"===e.mediaType?t.processAudioOutboundStats(e):"video"===e.mediaType&&t.processVideoOutboundStats(e);break;case Xz.INBOUND:"audio"===e.mediaType?t.processAudioInboundStats(e):"video"===e.mediaType&&t.processVideoInboundStats(e);break;case Xz.TRANSPORT:var i=t.report.get(e.selectedCandidatePairId);i&&t.processCandidatePairStats(i);break;case Xz.CANDIDATE_PAIR:e.selected&&t.processCandidatePairStats(e)}})),this.updateSendBitrate(),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats,[2]}}))}))},t.prototype.processCandidatePairStats=function(e){if(this._stats.sendBandwidth=e.availableOutgoingBitrate||0,e.currentRoundTripTime&&(this._stats.rtt=1e3*e.currentRoundTripTime),this._stats.videoSend.forEach((function(t){!t.rttMs&&e.currentRoundTripTime&&(t.rttMs=1e3*e.currentRoundTripTime)})),this._stats.audioSend.forEach((function(t){!t.rttMs&&e.currentRoundTripTime&&(t.rttMs=1e3*e.currentRoundTripTime)})),this._stats.selectedCandidatePair.id=e.id,e.localCandidateId){var t=this.report.get(e.localCandidateId);t&&this.processCandidateStats(t)}if(e.remoteCandidateId){var i=this.report.get(e.remoteCandidateId);i&&this.processCandidateStats(i)}},t.prototype.processCandidateStats=function(e){var t;e.type===Xz.LOCAL_CANDIDATE&&(t=this._stats.selectedCandidatePair.localCandidate),e.type===Xz.REMOTE_CANDIDATE&&(t=this._stats.selectedCandidatePair.remoteCandidate),t&&(t.type=e.type,t.id=e.id,e.address&&(t.address=e.address),e.candidateType&&(t.candidateType=e.candidateType),e.port&&(t.port=e.port),e.priority&&(t.priority=e.priority),e.protocol&&(t.protocol=e.protocol),e.relayProtocol&&(t.relayProtocol=e.relayProtocol),e.type===Xz.LOCAL_CANDIDATE&&this.stats.selectedCandidatePair.localCandidate.id!==t.id&&this.onSelectedLocalCandidateChanged&&this.onSelectedLocalCandidateChanged(Wz({},t),Wz({},this.stats.selectedCandidatePair.localCandidate)),e.type===Xz.REMOTE_CANDIDATE&&this.stats.selectedCandidatePair.remoteCandidate.id!==t.id&&this.onSelectedRemoteCandidateChanged&&this.onSelectedRemoteCandidateChanged(Wz({},t),Wz({},this.stats.selectedCandidatePair.remoteCandidate)))},t.prototype.processAudioInboundStats=function(e){var t=this._stats.audioRecv.find((function(t){return t.ssrc===e.ssrc}));t||(t=Gz(iZ),this._stats.audioRecv.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsReceived,t.packetsLost=e.packetsLost,t.bytes=e.bytesReceived,t.jitterMs=1e3*e.jitter,e.trackId&&this.processAudioTrackReceiverStats(e.trackId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),t.receivedFrames||(t.receivedFrames=e.packetsReceived),t.droppedFrames||(t.droppedFrames=e.packetsLost),t.receivedFrames>0&&!this.isFirstAudioReceived[t.ssrc]&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(t.ssrc),this.isFirstAudioReceived[t.ssrc]=!0),t.outputLevel&&t.outputLevel>0&&!this.isFirstAudioDecoded[t.ssrc]&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(t.ssrc),this.isFirstAudioDecoded[t.ssrc]=!0)},t.prototype.processVideoInboundStats=function(e){var t=this._stats.videoRecv.find((function(t){return t.ssrc===e.ssrc}));t||(t=Gz($z),this._stats.videoRecv.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsReceived,t.packetsLost=e.packetsLost,t.bytes=e.bytesReceived,t.firsCount=e.firCount,t.nacksCount=e.nackCount,t.plisCount=e.pliCount,t.framesDecodeCount=e.framesDecoded;var i=this.lastDecodeVideoReceiverStats.get(t.ssrc),n=this.lastVideoFramesDecode.get(t.ssrc),r=Date.now();if(t.framesDecodeCount>0&&!this.isFirstVideoDecoded[t.ssrc]){var o=t.decodedFrame?t.decodedFrame.width:0,s=t.decodedFrame?t.decodedFrame.height:0;this.onFirstVideoDecoded&&this.onFirstVideoDecoded(t.ssrc,o,s),this.isFirstVideoDecoded[t.ssrc]=!0}if(i){var a=i.stats,c=r-i.lts;t.framesDecodeFreezeTime=a.framesDecodeFreezeTime,t.framesDecodeInterval=a.framesDecodeInterval,t.framesDecodeCount>a.framesDecodeCount&&this.isFirstVideoDecoded?(i.lts=Date.now(),t.framesDecodeInterval=c,t.framesDecodeInterval>=this.options.freezeRateLimit&&(this.getVideoIsReady(parseInt(e.ssrc))?t.framesDecodeFreezeTime+=t.framesDecodeInterval:this.setVideoIsReady2(parseInt(e.ssrc,10),!0))):t.framesDecodeCount<a.framesDecodeCount&&(t.framesDecodeInterval=0),e.framesDecoded&&e.qpSum&&(i.stats.framesDecodeCount>e.framesDecoded?t.qpSumPerFrame=e.qpSum/e.framesDecoded:t.qpSumPerFrame=(e.qpSum-i.qpSum)/(e.framesDecoded-i.stats.framesDecodeCount))}n&&r-n.lts>=800?(t.decodeFrameRate=Math.round((t.framesDecodeCount-n.count)/((r-n.lts)/1e3)),this.lastVideoFramesDecode.set(t.ssrc,{count:t.framesDecodeCount,lts:r,rate:t.decodeFrameRate})):n?t.decodeFrameRate=n.rate:this.lastVideoFramesDecode.set(t.ssrc,{count:t.framesDecodeCount,lts:r,rate:0}),e.totalDecodeTime&&(t.decodeMs=1e3*e.totalDecodeTime),e.trackId&&this.processVideoTrackReceiverStats(e.trackId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.framerateMean&&(t.framesRateFirefox=e.framerateMean),t.packets>0&&!this.isFirstVideoReceived[t.ssrc]&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(t.ssrc),this.isFirstVideoReceived[t.ssrc]=!0),this.lastDecodeVideoReceiverStats.set(t.ssrc,{stats:Wz({},t),lts:i?i.lts:Date.now(),qpSum:e.qpSum})},t.prototype.processVideoOutboundStats=function(e){var t=this._stats.videoSend.find((function(t){return t.ssrc===e.ssrc}));t||(t=Gz(eZ),this._stats.videoSend.push(t));var i,n=this.mediaBytesSent.get(e.ssrc);if(n?n.add(e.bytesSent):((o=new Yz(10)).add(e.bytesSent),this.mediaBytesSent.set(e.ssrc,o)),void 0!==e.retransmittedBytesSent){var r=this.mediaBytesRetransmit.get(e.ssrc);r?r.add(e.retransmittedBytesSent):((o=new Yz(10)).add(e.retransmittedBytesSent),this.mediaBytesRetransmit.set(e.ssrc,o))}if(e.totalEncodedBytesTarget){var o,s=this.mediaBytesTargetEncode.get(e.ssrc);s?s.add(e.totalEncodedBytesTarget):((o=new Yz(10)).add(e.totalEncodedBytesTarget),this.mediaBytesTargetEncode.set(e.ssrc,o))}if(t.ssrc=e.ssrc,t.bytes=e.bytesSent,t.packets=e.packetsSent,t.firsCount=e.firCount,t.nacksCount=e.nackCount,t.plisCount=e.pliCount,t.frameCount=e.framesEncoded,t.adaptionChangeReason=e.qualityLimitationReason,e.totalEncodeTime&&e.framesEncoded)if(!(i=this.lastEncoderMs.get(e.ssrc))||i.lastFrameCount>e.framesEncoded)t.avgEncodeMs=1e3*e.totalEncodeTime/e.framesEncoded;else{var a=e.framesEncoded-i.lastFrameCount,c=e.totalEncodeTime-i.lastEncoderTime;t.avgEncodeMs=1e3*c/a}if(e.framesEncoded&&e.qpSum&&(!(i=this.lastEncoderMs.get(e.ssrc))||i.lastFrameCount>e.framesEncoded?t.qpSumPerFrame=e.qpSum/e.framesEncoded:t.qpSumPerFrame=(e.qpSum-i.lastQpSum)/(e.framesEncoded-i.lastFrameCount)),this.lastEncoderMs.set(e.ssrc,{lastFrameCount:e.framesEncoded,lastEncoderTime:e.totalEncodeTime,lastQpSum:e.qpSum,lts:Date.now()}),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.mediaSourceId&&this.processVideoMediaSource(e.mediaSourceId,t),e.trackId&&this.processVideoTrackSenderStats(e.trackId,t),e.remoteId)this.processRemoteInboundStats(e.remoteId,t);else{var A=this.findRemoteStatsId(e.ssrc,Xz.REMOTE_INBOUND);A&&this.processRemoteInboundStats(A,t)}},t.prototype.processAudioOutboundStats=function(e){var t=this._stats.audioSend.find((function(t){return t.ssrc===e.ssrc}));if(t||(t=Gz(tZ),this._stats.audioSend.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsSent,t.bytes=e.bytesSent,e.mediaSourceId&&this.processAudioMediaSource(e.mediaSourceId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.trackId&&this.processAudioTrackSenderStats(e.trackId,t),e.remoteId)this.processRemoteInboundStats(e.remoteId,t);else{var i=this.findRemoteStatsId(e.ssrc,Xz.REMOTE_INBOUND);i&&this.processRemoteInboundStats(i,t)}},t.prototype.findRemoteStatsId=function(e,t){var i=Array.from(this.report.values()).find((function(i){return i.type===t&&i.ssrc===e}));return i?i.id:null},t.prototype.processVideoMediaSource=function(e,t){var i=this.report.get(e);i&&i.width&&i.height&&i.framesPerSecond&&(t.inputFrame={width:i.width,height:i.height,frameRate:i.framesPerSecond})},t.prototype.processAudioMediaSource=function(e,t){var i=this.report.get(e);i&&(t.inputLevel=i.audioLevel)},t.prototype.processVideoTrackSenderStats=function(e,t){var i=this.report.get(e);if(i){var n=0,r=Date.now(),o=this.lastVideoFramesSent.get(t.ssrc);o&&r-o.lts>=800?(n=Math.round((i.framesSent-o.count)/((r-o.lts)/1e3)),this.lastVideoFramesSent.set(t.ssrc,{count:i.framesSent,lts:r,rate:n})):o?n=o.rate:this.lastVideoFramesSent.set(t.ssrc,{count:i.framesSent,lts:r,rate:0}),t.sentFrame={width:i.frameWidth,height:i.frameHeight,frameRate:n}}},t.prototype.processVideoTrackReceiverStats=function(e,t){var i=this.report.get(e);if(i){var n=this.lastVideoFramesRecv.get(t.ssrc),r=Date.now();t.framesReceivedCount=i.framesReceived;var o=0;if(n&&r-n.lts>=800?(o=Math.round((i.framesReceived-n.count)/((r-n.lts)/1e3)),this.lastVideoFramesRecv.set(t.ssrc,{count:i.framesReceived,lts:r,rate:o})):n?o=n.rate:this.lastVideoFramesRecv.set(t.ssrc,{count:i.framesReceived,lts:r,rate:0}),t.receivedFrame={width:i.frameWidth||0,height:i.frameHeight||0,frameRate:o||0},t.decodedFrame={width:i.frameWidth||0,height:i.frameHeight||0,frameRate:t.decodeFrameRate||0},t.outputFrame={width:i.frameWidth||0,height:i.frameHeight||0,frameRate:t.decodeFrameRate||0},i.jitterBufferDelay&&i.jitterBufferEmittedCount){var s=this.lastVideoJBDelay.get(t.ssrc);this.lastVideoJBDelay.set(t.ssrc,{jitterBufferDelay:i.jitterBufferDelay,jitterBufferEmittedCount:i.jitterBufferEmittedCount}),s||(s={jitterBufferDelay:0,jitterBufferEmittedCount:0});var a=1e3*(i.jitterBufferDelay-s.jitterBufferDelay)/(i.jitterBufferEmittedCount-s.jitterBufferEmittedCount);t.jitterBufferMs=a,t.currentDelayMs=Math.round(a)}}},t.prototype.processAudioTrackSenderStats=function(e,t){var i=this.report.get(e);i&&(t.aecReturnLoss=i.echoReturnLoss||0,t.aecReturnLossEnhancement=i.echoReturnLossEnhancement||0)},t.prototype.processAudioTrackReceiverStats=function(e,t){var i=this.report.get(e);if(i){if(i.removedSamplesForAcceleration&&i.totalSamplesReceived&&(t.accelerateRate=i.removedSamplesForAcceleration/i.totalSamplesReceived),i.jitterBufferDelay&&i.jitterBufferEmittedCount){var n=this.lastAudioJBDelay.get(t.ssrc);this.lastAudioJBDelay.set(t.ssrc,{jitterBufferDelay:i.jitterBufferDelay,jitterBufferEmittedCount:i.jitterBufferEmittedCount}),n||(n={jitterBufferDelay:0,jitterBufferEmittedCount:0});var r=1e3*(i.jitterBufferDelay-n.jitterBufferDelay)/(i.jitterBufferEmittedCount-n.jitterBufferEmittedCount);t.jitterBufferMs=Math.round(r)}t.outputLevel=i.audioLevel;var o=1920;i.totalSamplesDuration&&i.totalSamplesReceived&&(o=i.totalSamplesReceived/i.totalSamplesDuration/50,t.receivedFrames=Math.round(i.totalSamplesReceived/o)),i.concealedSamples&&(t.droppedFrames=Math.round(i.concealedSamples/o))}},t.prototype.processRemoteInboundStats=function(e,t){var i=this.report.get(e);i&&(t.packetsLost=i.packetsLost,i.roundTripTime&&(t.rttMs=1e3*i.roundTripTime))},t.prototype.getCodecFromCodecStats=function(e){var t=this.report.get(e);if(!t)return"";var i=t.mimeType.match(/\/(.*)$/);return i&&i[1]?i[1]:""},t.prototype.updateSendBitrate=function(){var e=0,t=null,i=null;this.mediaBytesSent.forEach((function(t){e+=t.diffMean()})),this.mediaBytesRetransmit.forEach((function(e){t=null===t?e.diffMean():t+e.diffMean()})),this.mediaBytesTargetEncode.forEach((function(e){i=null===i?e.diffMean():i+e.diffMean()}));var n=null!==t?e-t:e;this._stats.bitrate={actualEncoded:8*n/(this.options.updateInterval/1e3),transmit:8*e/(this.options.updateInterval/1e3)},null!==t&&(this._stats.bitrate.retransmit=8*t/(this.options.updateInterval/1e3)),null!==i&&(this._stats.bitrate.targetEncoded=8*i/(this.options.updateInterval/1e3))},t}(nZ),aZ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Kz(t,e),t.prototype.updateStats=function(){return Promise.resolve()},t}(nZ);function cZ(e,t,i,n){void 0===t&&(t=250),void 0===i&&(i=8),void 0===n&&(n=500);var r,o=(r=navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]*/i))&&r[0]?Number(r[0].split("/")[1]):null;return o?o<76?new rZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n}):new sZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n}):function(e){return!!window.RTCStatsReport&&e.getStats()instanceof Promise}(e)?new sZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n}):new aZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n})}function AZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function dZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?AZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):AZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let uZ=(tx((oZ=class e extends HP{get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}constructor(t,i){super(t,i),tD(this,"store",void 0),tD(this,"peerConnection",void 0),tD(this,"remoteSDP",void 0),tD(this,"initialOffer",void 0),tD(this,"statsFilter",void 0),tD(this,"useRTX",!1),tD(this,"localCapabilities",void 0),tD(this,"localCandidateCount",0),tD(this,"allCandidatesReceived",!1),tD(this,"mutex",new Qx("P2PConnection-mutex")),this.store=i,this.peerConnection=new RTCPeerConnection(e.resolvePCConfiguration(t),{optional:[{googDscp:!0}]}),this.statsFilter=cZ(this.peerConnection,void 0,void 0,By()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1}async establish(){try{const e=await this.peerConnection.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});if(!e.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");const t=Lz(e.sdp),i=bz(e.sdp,!this.useRTX,!1,["opus"]);return this.localCapabilities=i,this.initialOffer=e,dZ(dZ({},t),{},{rtpCapabilities:{send:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},recv:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},sendrecv:i},offerSDP:e.sdp})}catch(e){throw new pw(hw.GET_LOCAL_CONNECTION_PARAMS_FAILED,e.toString())}}async connect(e,t,i,n,r,o){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new Fz({remoteIceParameters:e,remoteDtlsParameters:t,candidates:i,remoteRTPCapabilities:n.send,remoteSetup:r,localCapabilities:this.localCapabilities,sdkCodec:this.store.codec,cname:o});const s=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(this.initialOffer),await this.peerConnection.setRemoteDescription({type:"answer",sdp:s})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(e.toString()))}}send(e,t){var i=this;return nz((function*(){const n=yield rz(i.mutex.lock());try{if(!i.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");const r=e.map((e=>i.peerConnection.addTrack(e._mediaStreamTrack))),o=yield rz(i.peerConnection.createOffer()),s=yz.exports.parse(o.sdp),a=e.map((e=>{const t=e._mediaStreamTrack,n=s.mediaDescriptions.find((e=>e.attributes.mid===t.kind));if(!n)throw new Error("Cannot extract ssrc from mediaDescription.");return function(e,t,i){const n=e.attributes.ssrcs.filter((e=>e.attributes.label===t)),r=e.attributes.ssrcGroups;if(0===n.length)throw new Error("Cannot extract ssrc from plan-b SDP.");if(r&&n.length>1){const e=r.find((e=>-1!==e.ssrcIds.indexOf(n[0].ssrcId)));return e?[{ssrcId:e.ssrcIds[0],rtx:i?e.ssrcIds[1]:void 0}]:[{ssrcId:n[0].ssrcId}]}return[{ssrcId:n[0].ssrcId}]}(n,t.id,i.useRTX)}));let c;try{c=yield a}catch(e){throw r.forEach((e=>{Uy()&&e.replaceTrack(null),i.peerConnection.removeTrack(e)})),e}const A=i.mungSendOfferSDP(o.sdp,e);i.remoteSDP.receive(e,t,c);const d=i.remoteSDP.toString();return yield rz(i.peerConnection.setLocalDescription({type:"offer",sdp:A})),yield rz(i.applySendEncodings(r,e)),yield rz(i.peerConnection.setRemoteDescription({type:"answer",sdp:d})),e.map(((e,t)=>{const i=e._mediaStreamTrack.id;return{localSSRC:a[t],id:i}}))}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(e.toString()))}finally{n()}}))()}async stopSending(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");const t=this.peerConnection.getSenders().filter((t=>{var i;return-1!==e.indexOf((null===(i=t.track)||void 0===i?void 0:i.id)||"")}));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");t.map((e=>{Uy()&&e.replaceTrack(null),this.peerConnection.removeTrack(e)}));const i=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(i),this.remoteSDP.stopReceiving(e);const n=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(e.toString()))}}async receive(e,t,i,n){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(e," before remoteSDP created."));const{id:i,mslabel:r}=this.remoteSDP.send(e,t,n),o=new Mm(((t,n)=>{const o=setTimeout((()=>{n(new Error("Cannot receive track, id: ".concat(i)))}),1e4),s=n=>{const a=Dy();if("Safari"===a.name&&11===Number(a.version)&&n.track.id!==i&&n.streams[0].id===r){var c;const r=n.streams[0].getTracks()[0];return null===(c=this.remoteSDP)||void 0===c||c.updateTrackLabel(e,i,n.track.id),this.peerConnection.removeEventListener("track",s),clearTimeout(o),void t(r)}if(n.track.id===i)return this.peerConnection.removeEventListener("track",s),clearTimeout(o),void t(n.track)};this.peerConnection.addEventListener("track",s)})),s=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:s});const a=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(a),{track:await o,id:i}}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}async stopReceiving(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(e);const t=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const i=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(i)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(e.toString()))}}async muteRemote(e){}async unmuteRemote(e){}async muteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");const t=this.peerConnection.getSenders().filter((t=>{var i;return-1!==e.indexOf((null===(i=t.track)||void 0===i?void 0:i.id)||"")}));if(t.length!==e.length)throw new Error("sender' length doesn't match mids' length.");t.map((e=>{if(Uy()&&e.track)e.track.enabled=!1;else{const t=e.getParameters();t.encodings.forEach((e=>e.active=!1)),e.setParameters(t)}}))}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(e.toString()))}}async unmuteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");const t=this.peerConnection.getSenders().filter((t=>{var i;return-1!==e.indexOf((null===(i=t.track)||void 0===i?void 0:i.id)||"")}));if(t.length!==e.length)throw new Error("Senders' length doesn't match mids' length.");t.map((async e=>{if(Uy()&&e.track)e.track.enabled=!0;else{const t=e.getParameters();t.encodings.forEach((e=>e.active=!0)),await e.setParameters(t)}}));const i=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(i);const n=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(e.toString()))}}async reEstablish(){const e=await this.peerConnection.createOffer({iceRestart:!0});if(!e.sdp)throw new Error("Cannot get SDP from restart offer.");return{iceParameters:Lz(e.sdp).iceParameters,restartICE:async(t,i)=>this.restartICE(e,t,i),restartOfferSDP:e.sdp}}close(){var e;this.peerConnection.close(),null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,"closed"),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(e){return this.statsFilter.getVideoIsReady(e)}async updateEncoderConfig(e,t){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");const e=await this.peerConnection.createOffer(),i=this.mungSendOfferSDP(e.sdp,[t]);this.remoteSDP.updateRecvMedia(t._mediaStreamTrack.kind,t);const n=this.remoteSDP.toString();await this.peerConnection.setLocalDescription({type:"offer",sdp:i}),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,e.toString())}}async updateSendParameters(e,t){const i=this.peerConnection.getSenders().filter((t=>{var i;return(null===(i=t.track)||void 0===i?void 0:i.id)===e}));1===i.length&&await this.applySendEncodings(i,[t])}setStatsRemoteVideoIsReady(e,t){this.statsFilter.setVideoIsReady2(e,t)}async replaceTrack(e,t){const i=this.peerConnection.getSenders().find((e=>{var i;return(null===(i=e.track)||void 0===i?void 0:i.id)===t}));i&&await i.replaceTrack(e._mediaStreamTrack)}async restartICE(e,t,i){try{if(!this.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");this.remoteSDP.restartICE(t,i);const n=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(e),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.restartICE failed; ".concat(e.toString()))}}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var e;null===(e=this.onICEConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var e;null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=e=>{e.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout((()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))}),cb("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(t){const i={iceServers:[],sdpSemantics:"plan-b"};return t.iceServers?i.iceServers=t.iceServers:t.turnServer&&"off"!==t.turnServer.mode&&(ZL(t.turnServer.servers)?i.iceServers=t.turnServer.servers:(i.iceServers&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.servers)),cb("USE_TURN_SERVER_OF_GATEWAY")&&i.iceServers&&t.turnServer.serversFromGateway&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.serversFromGateway)),t.turnServer.servers.concat(t.turnServer.serversFromGateway||[]).forEach((e=>{e.forceturn&&(i.iceTransportPolicy="relay")})))),i}static turnServerConfigToIceServers(e){const t=[];return e.forEach((e=>{e.security?e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turns:".concat(e.turnServerURL,":").concat(e.tcpport,"?transport=tcp")}):(e.udpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.udpport,"?transport=udp")}),e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.tcpport,"?transport=tcp")}))})),t}async applySendEncodings(e,t){try{if(!XP().supportSetRtpSenderParameters)return;if(e.length!==t.length)return;for(let n=0;n<e.length;n++){var i;const r=e[n],o=t[n];if(!o)continue;const s={},a={};if(o instanceof WJ)switch(o._optimizationMode){case"motion":s.degradationPreference="maintain-framerate";break;case"detail":s.degradationPreference="maintain-resolution";break;default:s.degradationPreference="balanced"}if(cb("DSCP_TYPE")&&Ky()){const e=cb("DSCP_TYPE");["very-low","low","medium","high"].includes(e)&&(a.networkPriority=e)}const c=r.getParameters(),A=null===(i=c.encodings)||void 0===i?void 0:i[0];A&&Object.assign(A,a),Object.assign(c,s),await r.setParameters(c)}}catch(e){mw.debug("Apply RTPSendEncodings failed.")}}mungSendOfferSDP(e,t){const i=yz.exports.parse(e);return t.forEach(((e,t)=>{const n=e._mediaStreamTrack,r=i.mediaDescriptions.find((e=>e.attributes.mid===n.kind));r&&Mz(r,e)})),yz.exports.print(i)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=e=>{var t;null===(t=this.onFirstAudioReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoReceived=e=>{var t;null===(t=this.onFirstVideoReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstAudioDecoded=e=>{var t;null===(t=this.onFirstAudioDecoded)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoDecoded=(e,t,i)=>{var n;null===(n=this.onFirstVideoDecoded)||void 0===n||n.call(this,e,t,i)},this.statsFilter.onSelectedLocalCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedLocalCandidateChanged)||void 0===i||i.call(this,e,t)},this.statsFilter.onSelectedRemoteCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedRemoteCandidateChanged)||void 0===i||i.call(this,e,t)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0}async batchReceive(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");const t=this.remoteSDP.batchSend(e).map(((t,i)=>{let{id:n,mslabel:r}=t;const{kind:o}=e[i];return new Mm(((e,t)=>{const i=setTimeout((()=>{t(new Error("Cannot receive track, id: ".concat(n)))}),1e4),s=t=>{const a=Dy();if("Safari"===a.name&&11===Number(a.version)&&t.track.id!==n&&t.streams[0].id===r){var c;const r=t.streams[0].getTracks()[0];return null===(c=this.remoteSDP)||void 0===c||c.updateTrackLabel(o,n,t.track.id),this.peerConnection.removeEventListener("track",s),clearTimeout(i),void e({track:r,id:n})}if(t.track.id===n)return this.peerConnection.removeEventListener("track",s),clearTimeout(i),void e({track:t.track,id:n})};this.peerConnection.addEventListener("track",s)}))})),i=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:i});const n=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(n),await Mm.all(t)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}}).prototype,"connect",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"connect"),oZ.prototype),tx(oZ.prototype,"stopSending",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"stopSending"),oZ.prototype),tx(oZ.prototype,"receive",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"receive"),oZ.prototype),tx(oZ.prototype,"stopReceiving",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"stopReceiving"),oZ.prototype),tx(oZ.prototype,"muteRemote",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"muteRemote"),oZ.prototype),tx(oZ.prototype,"unmuteRemote",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"unmuteRemote"),oZ.prototype),tx(oZ.prototype,"muteLocal",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"muteLocal"),oZ.prototype),tx(oZ.prototype,"unmuteLocal",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"unmuteLocal"),oZ.prototype),tx(oZ.prototype,"reEstablish",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"reEstablish"),oZ.prototype),tx(oZ.prototype,"close",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"close"),oZ.prototype),tx(oZ.prototype,"updateEncoderConfig",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"updateEncoderConfig"),oZ.prototype),tx(oZ.prototype,"updateSendParameters",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"updateSendParameters"),oZ.prototype),tx(oZ.prototype,"replaceTrack",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"replaceTrack"),oZ.prototype),tx(oZ.prototype,"restartICE",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"restartICE"),oZ.prototype),oZ);function EZ(e,t,i){const n=e[t];if("function"!=typeof n)throw new Error("Cannot use mutex on object property.");return i.value=async function(){const e=this.mutex,i=await e.lock("Locking from P2PConnection.".concat(t));try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return await n.apply(this,o)}finally{i()}},i}var lZ;const hZ="9";let pZ=Ww("RemoteSDP")(lZ=class{get localCapabilities(){return VG(this._localCapabilities)}get rtpCapabilities(){return VG(this._rtpCapabilities)}get candidates(){return VG(this._candidates)}get iceParameters(){return VG(this._iceParameters)}get dtlsParameters(){return VG(this._dtlsParameters)}constructor(e){tD(this,"sessionDesc",void 0),tD(this,"_localCapabilities",void 0),tD(this,"_rtpCapabilities",void 0),tD(this,"_candidates",void 0),tD(this,"_iceParameters",void 0),tD(this,"_dtlsParameters",void 0),tD(this,"setup",void 0),tD(this,"currentMidIndex",void 0),tD(this,"cname",void 0),e=VG(e);const{remoteIceParameters:t,remoteDtlsParameters:i,candidates:n,remoteRTPCapabilities:r,remoteSetup:o,localCapabilities:s,cname:a}=e,c=yz.exports.parse("v=0\no=- 0 0 IN IP4 127.0.0.1\ns=AgoraGateway\nt=0 0\na=group:BUNDLE 0 1\na=msid-semantic: WMS\na=ice-lite\nm=video 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendonly\na=rtcp-mux\na=rtcp-rsize\na=mid:0\nm=audio 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendonly\na=rtcp-mux\na=rtcp-rsize\na=mid:1\n");this._rtpCapabilities=r,this._candidates=n,this._iceParameters=t,this._dtlsParameters=i,this._localCapabilities=s,this.setup=o,this.cname=a;const A=this.rtpCapabilities.send;for(const e of c.mediaDescriptions){if(e.attributes.iceUfrag=t.iceUfrag,e.attributes.icePwd=t.icePwd,e.attributes.fingerprints=i.fingerprints,e.attributes.candidates=n,e.attributes.setup=o,"video"===e.media.mediaType&&(e.media.fmts=A.videoCodecs.map((e=>e.payloadType.toString(10))),e.attributes.payloads=A.videoCodecs,e.attributes.extmaps=A.videoExtensions,cb("PRELOAD_MEDIA_COUNT")>0)){const{ssrcs:t,ssrcGroups:i}=kz([{ssrcId:4e4,rtx:cb("USE_RTX")?40001:void 0}],this.cname);e.attributes.ssrcs=t,e.attributes.ssrcGroups=i}if("audio"===e.media.mediaType&&(e.media.fmts=A.audioCodecs.map((e=>e.payloadType.toString(10))),e.attributes.payloads=A.audioCodecs,e.attributes.extmaps=A.audioExtensions,cb("PRELOAD_MEDIA_COUNT")>0)){const{ssrcs:t,ssrcGroups:i}=kz([{ssrcId:2e4}],this.cname);e.attributes.ssrcs=t,e.attributes.ssrcGroups=i}}this.sessionDesc=c,this.currentMidIndex=c.mediaDescriptions.length-1}preloadRemoteMedia(){const e=cb("PRELOAD_MEDIA_COUNT");Yw("debug",this,"preloadRemoteMedia",e),this.rtpCapabilities;const t=this.candidates,i=this.dtlsParameters,n=this.iceParameters,r=this.rtpCapabilities.send;for(let o=1;o<e;o++){const e=2*o+2e4,s=2*o+4e4,{ssrcs:a,ssrcGroups:c}=kz([{ssrcId:e}],this.cname),{ssrcs:A,ssrcGroups:d}=kz([{ssrcId:s,rtx:cb("USE_RTX")?s+1:void 0}],this.cname);this.sessionDesc.mediaDescriptions.push({media:{mediaType:"video",port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:r.videoCodecs.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:n.iceUfrag,icePwd:n.icePwd,unrecognized:[],candidates:t,extmaps:r.videoExtensions,fingerprints:i.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:A,ssrcGroups:d,rtcpFeedbackWildcards:[],payloads:r.videoCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*o)}}),this.sessionDesc.mediaDescriptions.push({media:{mediaType:"audio",port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:r.audioCodecs.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:n.iceUfrag,icePwd:n.icePwd,unrecognized:[],candidates:t,extmaps:r.audioExtensions,fingerprints:i.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:a,ssrcGroups:c,rtcpFeedbackWildcards:[],payloads:r.audioCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*o+1)}}),this.currentMidIndex+=2}this.updateBundleMids()}toString(){return yz.exports.print(this.sessionDesc)}send(e,t,i,n){const{ssrcs:r,ssrcGroups:o}=kz(t,this.cname,i),s=this.findPreloadMediaDesc(r);if(s){if(n&&(n.tcc||n.remb)){const e=this.sessionDesc.mediaDescriptions.indexOf(s);return this.sessionDesc.mediaDescriptions[e]=this.mungSendMediaDesc(s,n),{mid:s.attributes.mid,needExchangeSDP:!0}}return{mid:s.attributes.mid,needExchangeSDP:!1}}{const t=this.findAvailableMediaIndex(e);if(Uy()){if(-1!==t&&1!==t){const e=VG(this.sessionDesc.mediaDescriptions[t]);return e.attributes.direction="sendonly",e.attributes.ssrcs=r,e.attributes.ssrcGroups=o,this.sessionDesc.mediaDescriptions[t]=this.mungSendMediaDesc(e,n),{mid:e.attributes.mid,needExchangeSDP:!0}}{const t=this.createOrRecycleSendMedia(e,r,o,"sendonly",n);return this.updateBundleMids(),{mid:t.attributes.mid,needExchangeSDP:!0}}}if(-1!==t){const e=VG(this.sessionDesc.mediaDescriptions[t]);return e.attributes.direction="sendonly",e.attributes.ssrcs=r,e.attributes.ssrcGroups=o,this.sessionDesc.mediaDescriptions[t]=this.mungSendMediaDesc(e,n),{mid:e.attributes.mid,needExchangeSDP:!0}}{const t=this.createOrRecycleSendMedia(e,r,o,"sendonly",n);return this.updateBundleMids(),{mid:t.attributes.mid,needExchangeSDP:!0}}}}batchSend(e){const t=e.map((e=>{let{kind:t,ssrcMsg:i,mslabel:n}=e;return this.send(t,i,n)})),i=[];let n=!1;return t.forEach((e=>{let{mid:t,needExchangeSDP:r}=e;r&&(n=!0),i.push(t)})),{mids:i,needExchangeSDP:n}}stopSending(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>t.attributes.mid&&-1!==e.indexOf(t.attributes.mid)));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");t.forEach((e=>{"0"===e.attributes.mid||By()||Uy()?e.attributes.ssrcs=[]:(e.attributes.ssrcs=[],e.attributes.direction="inactive",e.media.port="0")})),this.updateBundleMids()}mute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.mute."));t.attributes.direction="inactive"}unmute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.unmute."));t.attributes.direction="sendonly"}muteRemote(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>e.includes(t.attributes.mid||"")));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");t.forEach((e=>{e.attributes.direction="inactive"}))}unmuteRemote(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>e.includes(t.attributes.mid||"")));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");t.forEach((e=>{e.attributes.direction="recvonly"}))}receive(e,t,i,n){e.forEach(((e,r)=>{this.createOrRecycleRecvMedia(e,[],"recvonly",t,i,n[r])})),this.updateBundleMids()}stopReceiving(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>-1!==e.indexOf(t.attributes.mid)));if(t.length!==e.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");t.forEach((e=>{e.media.port="0",e.attributes.direction="inactive"})),this.updateBundleMids()}restartICE(e,t){e=VG(e),t=VG(t),this._iceParameters=e,this._candidates=t,this.sessionDesc.mediaDescriptions.forEach((t=>{t.attributes.iceUfrag=e.iceUfrag,t.attributes.icePwd=e.icePwd,t.attributes.candidates=this.candidates}))}predictReceivingMids(e){const t=[];for(let i=0;i<e;i++)t.push((this.currentMidIndex+i+1).toString(10));return t}findAvailableMediaIndex(e){return this.sessionDesc.mediaDescriptions.findIndex((t=>t.media.mediaType===e&&"0"!==t.media.port&&("sendonly"===t.attributes.direction||"sendrecv"===t.attributes.direction)&&0===t.attributes.ssrcs.length))}createOrRecycleRecvMedia(e,t,i,n,r,o){const s=e._mediaStreamTrack.kind,a=this.rtpCapabilities.recv,c=this.localCapabilities.send;let A=[];if(s===QP.VIDEO){var d,u;if(cb("H264_PROFILE_LEVEL_ID")&&"h264"===n&&(A=a.videoCodecs.filter((e=>{var t,i;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes(n)&&(null==e||null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"])===cb("H264_PROFILE_LEVEL_ID")}))),!A||0===(null===(d=A)||void 0===d?void 0:d.length)){const e=c.videoCodecs.filter((e=>{var t;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes(n)}));0!==e.length&&(A=a.videoCodecs.filter((t=>e.some((e=>e.payloadType===t.payloadType)))))}if(cb("USE_RTX")){const e=A.map((e=>e.payloadType.toString())),t=a.videoCodecs.filter((t=>{var i,n;return"rtx"===(null===(i=t.rtpMap)||void 0===i?void 0:i.encodingName)&&e.includes((null===(n=t.fmtp)||void 0===n?void 0:n.parameters.apt)||"")}));A=[...A,...t]}0===A.length&&(mw.warning("codec ".concat(n," not included in rtpCapabilities, fallback to default payloads: ").concat(null===(u=a.videoCodecs[0].rtpMap)||void 0===u?void 0:u.encodingName)),A=a.videoCodecs)}else A=a.audioCodecs.filter((e=>{var t;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes(r)})),0===A.length&&(mw.warning("codec ".concat(r," not included in rtpCapabilities, fallback to opus")),A=a.audioCodecs.filter((e=>{var t;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes("opus")})));const E=s===QP.VIDEO?a.videoExtensions:a.audioExtensions;this.currentMidIndex+=1;const l="".concat(this.currentMidIndex);let h={media:{mediaType:s,port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:A.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:E,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:t,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:A,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:i,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(l)}};h=this.mungRecvMediaDsec(h,e,o);const p=this.findFirstClosedMedia(s);if(p){const e=this.sessionDesc.mediaDescriptions.indexOf(p);this.sessionDesc.mediaDescriptions[e]=h}else this.sessionDesc.mediaDescriptions.push(h);return h}createOrRecycleSendMedia(e,t,i,n,r){const o=this.rtpCapabilities.send,s=e===QP.VIDEO?o.videoCodecs:o.audioCodecs,a=e===QP.VIDEO?o.videoExtensions:o.audioExtensions;this.currentMidIndex+=1;const c="".concat(this.currentMidIndex);let A={media:{mediaType:e,port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:s.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:a,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:t,ssrcGroups:i,rtcpFeedbackWildcards:[],payloads:s,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:n,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(c)}};A=this.mungSendMediaDesc(A,r);const d=this.findFirstClosedMedia(e);if(d){const e=this.sessionDesc.mediaDescriptions.indexOf(d);this.sessionDesc.mediaDescriptions[e]=A}else this.sessionDesc.mediaDescriptions.push(A);return A}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter((e=>"0"!==e.media.port)).map((e=>e.attributes.mid))}mungRecvMediaDsec(e,t,i){const n=VG(e);return Uz(n),Mz(n,t),Bz(n,t),function(e){if("video"!==e.media.mediaType)return;const t=Dy();if(t.name!==Oy.SAFARI&&t.os!==Sy.IOS)return;const i=e.attributes.extmaps.findIndex((e=>/video-orientation/g.test(e.extensionName)));-1!==i&&e.attributes.extmaps.splice(i,1)}(n),Vz(n,i,this.localCapabilities.send),n}mungSendMediaDesc(e,t){const i=VG(e);return Vz(i,t,this.localCapabilities.recv),i}updateRecvMedia(e,t){const i=this.sessionDesc.mediaDescriptions.findIndex((t=>t.attributes.mid===e));if(-1!==i){const e=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[i],t);this.sessionDesc.mediaDescriptions[i]=e}}bumpMid(e){this.currentMidIndex+=e}findFirstClosedMedia(e){return this.sessionDesc.mediaDescriptions.find((t=>By()?"0"===t.media.port&&t.media.mediaType===e:"0"===t.media.port))}findPreloadMediaDesc(e){return this.sessionDesc.mediaDescriptions.find((t=>{var i,n;return(null===(i=t.attributes)||void 0===i||null===(n=i.ssrcs[0])||void 0===n?void 0:n.ssrcId)===e[0].ssrcId}))}})||lZ;var _Z,IZ;function gZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let RZ=Ww("P2PConnection","store.p2pId")((tx((IZ=class e extends HP{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}constructor(t,i){super(t,i),tD(this,"store",void 0),tD(this,"peerConnection",void 0),tD(this,"remoteSDP",void 0),tD(this,"initialOffer",void 0),tD(this,"transportEventReceiver",void 0),tD(this,"statsFilter",void 0),tD(this,"useRTX",cb("USE_RTX")),tD(this,"localCapabilities",void 0),tD(this,"localCandidateCount",0),tD(this,"allCandidatesReceived",!1),tD(this,"mutex",new Qx("P2PConnection-mutex")),this.store=i,this.peerConnection=new RTCPeerConnection(e.resolvePCConfiguration(t),{optional:[{googDscp:!0}]}),this.statsFilter=cZ(this.peerConnection,void 0,void 0,By()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1}async establish(){try{this.peerConnection.addTransceiver("video",{direction:"recvonly"}),this.peerConnection.addTransceiver("audio",{direction:"recvonly"});const e=await this.peerConnection.createOffer();if(!e.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");const t=Lz(e.sdp),i=await async function(e,t,i,n){const r=new RTCPeerConnection;r.addTransceiver("video",{direction:"sendonly"}),r.addTransceiver("audio",{direction:"sendonly"}),r.addTransceiver("video",{direction:"recvonly"}),r.addTransceiver("audio",{direction:"recvonly"});const o=(await r.createOffer()).sdp,s=bz(o,e,false,i,n,"sendonly"),a=bz(o,e,false,i,n,"recvonly"),c={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},A={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},d={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(Qz(s,a,"videoExtensions",c,A,d),Qz(s,a,"videoCodecs",c,A,d),Qz(s,a,"audioExtensions",c,A,d),Qz(s,a,"audioCodecs",c,A,d),cb("RAISE_H264_BASELINE_PRIORITY")){const e=d.videoCodecs.findIndex((e=>{var t,i;return"h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())&&"42001f"===(null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"])}));if(-1!==e){const t=d.videoCodecs.findIndex((e=>{var t;return"h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())}));if(t<e){mw.debug("raising H264 baseline profile priority");const i=d.videoCodecs[e];d.videoCodecs.splice(e,1),d.videoCodecs.splice(t,0,i)}-1!==t&&(A.videoCodecs=A.videoCodecs.filter((e=>{var t,i;return!("h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())&&"42001f"!==(null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"]))}))),-1!==t&&cb("FILTER_SEND_H264_BASELINE")&&(c.videoCodecs=c.videoCodecs.filter((e=>{var t,i;return!("h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())&&"42001f"!==(null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"]))})))}}try{r.close()}catch(e){}return{send:c,recv:A,sendrecv:d}}(!this.useRTX);return this.localCapabilities=xz(i),this.initialOffer=e,fZ(fZ({},t),{},{rtpCapabilities:i,offerSDP:e.sdp})}catch(e){throw new pw(hw.GET_LOCAL_CONNECTION_PARAMS_FAILED,e.toString())}}async connect(e,t,i,n,r,o){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new pZ({remoteIceParameters:e,remoteDtlsParameters:t,candidates:i,remoteRTPCapabilities:n,remoteSetup:r,localCapabilities:this.localCapabilities,cname:o});const s=this.remoteSDP.toString(),a=this.logSDPExchange(this.initialOffer.sdp||"","offer","local","connect");await this.peerConnection.setLocalDescription(this.initialOffer),null==a||a(s),await this.peerConnection.setRemoteDescription({type:"answer",sdp:s});const c=this.peerConnection.getTransceivers()[0];if(null!=c&&c.receiver&&this.tryBindTransportEvents(c.receiver),cb("PRELOAD_MEDIA_COUNT")>0){this.remoteSDP.preloadRemoteMedia();const e=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:e});const t=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(t)}}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(e.toString()))}}send(e,t,i){var n=this;return nz((function*(){const r=yield rz(n.mutex.lock());try{if(!n.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");const o=[];e.forEach((e=>{const t=n.peerConnection.addTransceiver(e._mediaStreamTrack,{direction:"sendonly"});o.push(t)})),By()&&!0===cb("SIMULCAST")&&(xw("debug",n,"apply simulcast for firefox"),yield rz(n.applySimulcastForFirefox(o,e)));const s=yield rz(n.peerConnection.createOffer()),a=n.remoteSDP.predictReceivingMids(e.length),c=n.mungSendOfferSDP(s.sdp,e,a),A=yz.exports.parse(c),d=a.map((e=>{const t=A.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("Cannot extract ssrc from mediaDescription.");return function(e,t){const i=[],n=e.attributes.ssrcGroups.filter((e=>"FID"===e.semantic)),r=e.attributes.ssrcGroups.find((e=>"SIM"===e.semantic)),o=e.attributes.ssrcs;if(r)r.ssrcIds.forEach((e=>{var r;const o=null===(r=n.find((t=>t.ssrcIds[0]===e)))||void 0===r?void 0:r.ssrcIds[1];i.push({ssrcId:e,rtx:t?o:void 0})}));else if(n.length>0){const e=n[0].ssrcIds[0],r=n[0].ssrcIds[1];i.push({ssrcId:e,rtx:t?r:void 0})}else{if(0===o.length)throw new Error("No ssrcs found on local media description.");i.push({ssrcId:o[0].ssrcId})}return i}(t,n.useRTX)}));let u;try{u=yield d}catch(r){u=[],n.remoteSDP.receive(e,t,i,u);const o=n.remoteSDP.toString();throw yield rz(n.peerConnection.setLocalDescription({type:"offer",sdp:c})),yield rz(n.peerConnection.setRemoteDescription({type:"answer",sdp:o})),yield rz(n.stopSending(a,!0)),r}n.remoteSDP.receive(e,t,i,u);const E=n.remoteSDP.toString(),l=n.logSDPExchange(c,"offer","local","send");return yield rz(n.peerConnection.setLocalDescription({type:"offer",sdp:c})),yield rz(n.applySimulcastEncodings(o,e)),yield rz(n.applySendEncodings(o,e)),null==l||l(E),yield rz(n.peerConnection.setRemoteDescription({type:"answer",sdp:E})),o.map(((e,t)=>{const i=a[t];return{localSSRC:d[t],id:i,transceiver:e}}))}catch(e){throw e instanceof pw?e:new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(e.toString()))}finally{r()}}))()}async stopSending(e,t){const i=t?void 0:await this.mutex.lock("From P2PConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");const t=this.peerConnection.getTransceivers().filter((t=>-1!==e.indexOf(t.mid)));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");t.map((e=>{var t;e.direction="inactive",null===(t=e.stop)||void 0===t||t.call(e)}));const n=await this.peerConnection.createOffer(),r=this.logSDPExchange(n.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(n),this.remoteSDP.stopReceiving(e);const o=this.remoteSDP.toString();null==r||r(o),await this.peerConnection.setRemoteDescription({type:"answer",sdp:o})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(e.toString()))}finally{i&&i()}}async receive(e,t,i,n){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(e," before remoteSDP created."));const{mid:r,needExchangeSDP:o}=this.remoteSDP.send(e,t,i,n);if(o){const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n),mw.debug("[P2PConnection] receive ".concat(e," by exchanging SDP."))}else mw.debug("[P2PConnection] receive ".concat(e," no need to exchange SDP."));const s=this.peerConnection.getTransceivers().find((e=>e.mid===r));if(!s)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:s.receiver.track,id:r}}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}async batchReceive(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");const{mids:t,needExchangeSDP:i}=this.remoteSDP.batchSend(e);if(i){const e=this.remoteSDP.toString(),t=this.logSDPExchange(e,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:e});const i=await this.peerConnection.createAnswer();null==t||t(i.sdp||""),await this.peerConnection.setLocalDescription(i),mw.debug("[P2PConnection] batchReceive by exchanging SDP.")}else mw.debug("[P2PConnection] batchReceive no need to exchange SDP.");return t.map((e=>{const t=this.peerConnection.getTransceivers().find((t=>t.mid===e));if(!t)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:t.receiver.track,id:e}}))}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}async stopReceiving(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(e);const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","stopReceiving");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(e.toString()))}}async muteRemote(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteRemote mid=".concat(e," before remote SDP created."));this.remoteSDP.mute(e);const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","muteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.muteRemote failed; ".concat(e.toString()))}}async unmuteRemote(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteRemote mid=".concat(e," before remote SDP created."));this.remoteSDP.unmute(e);const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","unmuteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteRemote failed; ".concat(e.toString()))}}async muteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");const t=this.peerConnection.getTransceivers().filter((t=>t.mid&&-1!==e.indexOf(t.mid)));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length.");t.map((e=>{e.direction="inactive"}));const i=await this.peerConnection.createOffer(),n=this.logSDPExchange(i.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(i),this.remoteSDP.muteRemote(e);const r=this.remoteSDP.toString();null==n||n(r),await this.peerConnection.setRemoteDescription({type:"answer",sdp:r})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(e.toString()))}}async unmuteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");const t=this.peerConnection.getTransceivers().filter((t=>t.mid&&-1!==e.indexOf(t.mid)));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length.");t.map((async(e,t)=>{e.direction="sendonly"}));const i=await this.peerConnection.createOffer(),n=this.logSDPExchange(i.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(i),this.remoteSDP.unmuteRemote(e);const r=this.remoteSDP.toString();null==n||n(r),await this.peerConnection.setRemoteDescription({type:"answer",sdp:r})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(e.toString()))}}async reEstablish(){const e=await this.peerConnection.createOffer({iceRestart:!0});if(!e.sdp)throw new Error("Cannot get SDP from restart offer.");return{iceParameters:Lz(e.sdp).iceParameters,restartICE:async(t,i)=>this.restartICE(e,t,i),restartOfferSDP:e.sdp}}close(){var e;this.peerConnection.close(),null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,"closed"),this.tryUnbindTransportEvents(),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.transportEventReceiver=void 0,this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(e){return this.statsFilter.getVideoIsReady(e)}async updateEncoderConfig(e,t){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");const i=await this.peerConnection.createOffer(),n=this.mungSendOfferSDP(i.sdp,[t],[e]);this.remoteSDP.updateRecvMedia(e,t);const r=this.remoteSDP.toString(),o=this.logSDPExchange(n,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:n}),null==o||o(r),await this.peerConnection.setRemoteDescription({type:"answer",sdp:r})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,e.toString())}}async updateSendParameters(e,t){const i=this.peerConnection.getTransceivers().filter((t=>t.mid===e));1===i.length&&(this.isVP8Simulcast(t)?By()||await this.applySimulcastEncodings(i,[t]):await this.applySendEncodings(i,[t]))}setStatsRemoteVideoIsReady(e,t){this.statsFilter.setVideoIsReady2(e,t)}async replaceTrack(e,t){const i=this.peerConnection.getTransceivers().find((e=>e.mid===t));i&&await i.sender.replaceTrack(e._mediaStreamTrack)}async restartICE(e,t,i){try{if(!this.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");this.remoteSDP.restartICE(t,i);const n=this.remoteSDP.toString(),r=this.logSDPExchange(e.sdp||"","offer","local","restartICE");await this.peerConnection.setLocalDescription(e),null==r||r(n),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.restartICE failed; ".concat(e.toString()))}}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var e;null===(e=this.onICEConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var e;null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=e=>{e.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout((()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))}),cb("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(t){const i={iceServers:[]};return t.iceServers?i.iceServers=t.iceServers:t.turnServer&&"off"!==t.turnServer.mode&&(ZL(t.turnServer.servers)?i.iceServers=t.turnServer.servers:(i.iceServers&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.servers)),cb("USE_TURN_SERVER_OF_GATEWAY")&&i.iceServers&&t.turnServer.serversFromGateway&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.serversFromGateway)),t.turnServer.servers.concat(t.turnServer.serversFromGateway||[]).forEach((e=>{e.forceturn&&(i.iceTransportPolicy="relay")})))),i}static turnServerConfigToIceServers(e){const t=[];return e.forEach((e=>{e.security?e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turns:".concat(uG(e.turnServerURL),":").concat(e.tcpport,"?transport=tcp")}):(e.udpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.udpport,"?transport=udp")}),e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.tcpport,"?transport=tcp")}))})),t}tryBindTransportEvents(e){e.transport&&(this.transportEventReceiver=e,e.transport.onstatechange=()=>{var t,i;null!==(t=e.transport)&&void 0!==t&&t.state&&(null===(i=this.onDTLSTransportStateChange)||void 0===i||i.call(this,e.transport.state))},e.transport.onerror=e=>{var t;null===(t=this.onDTLSTransportError)||void 0===t||t.call(this,e.error)},e.transport.iceTransport&&(e.transport.iceTransport.onstatechange=()=>{var t,i,n;null!==(t=e.transport)&&void 0!==t&&t.iceTransport.state&&(null===(i=this.onICETransportStateChange)||void 0===i||i.call(this,null===(n=e.transport)||void 0===n?void 0:n.iceTransport.state))}))}tryUnbindTransportEvents(){this.transportEventReceiver&&this.transportEventReceiver.transport&&(this.transportEventReceiver.transport.onstatechange=null,this.transportEventReceiver.transport.onerror=null,this.transportEventReceiver.transport.iceTransport&&(this.transportEventReceiver.transport.iceTransport.onstatechange=null))}async applySendEncodings(e,t){try{if(!XP().supportSetRtpSenderParameters)return;if(e.length!==t.length)return;for(let c=0;c<e.length;c++){const A=e[c],d=t[c];if(d&&d instanceof WJ){var i,n;if(this.isVP8Simulcast(d))continue;const e={},t={};switch(d._optimizationMode){case"motion":e.degradationPreference="maintain-framerate";break;case"detail":e.degradationPreference="maintain-resolution";break;default:e.degradationPreference="balanced"}var r,o,s,a;if(null!==(i=d._encoderConfig)&&void 0!==i&&i.bitrateMax&&(t.maxBitrate=1e3*(null===(r=d._encoderConfig)||void 0===r?void 0:r.bitrateMax)),d._hints.includes(vP.LOW_STREAM)&&(null!==(o=d._encoderConfig)&&void 0!==o&&o.frameRate&&(t.maxFramerate=lG(d._encoderConfig.frameRate)),null!==(s=d._encoderConfig)&&void 0!==s&&s.scaleResolutionDownBy&&(null===(a=d._encoderConfig)||void 0===a?void 0:a.scaleResolutionDownBy)>1&&(t.scaleResolutionDownBy=d._encoderConfig.scaleResolutionDownBy)),cb("DSCP_TYPE")&&Ky()){const e=cb("DSCP_TYPE");["very-low","low","medium","high"].includes(e)&&(t.networkPriority=e)}const c=A.sender.getParameters(),u=null===(n=c.encodings)||void 0===n?void 0:n[0];By()&&!u&&(e.encodings=[t]),u&&Object.assign(u,t),Object.assign(c,e),await A.sender.setParameters(c)}}}catch(e){mw.debug("Apply RTPSendEncodings failed.")}}mungSendOfferSDP(e,t,i){const n=yz.exports.parse(e);return t.forEach(((e,t)=>{const r=i[t],o=n.mediaDescriptions.find((e=>e.attributes.mid===r));o&&(Mz(o,e),function(e,t,i){if(By())return;if("video"!==e.media.mediaType)return;if(!(t instanceof WJ))return;if("vp9"!==i&&"vp8"!==i)return;if("vp8"===i&&!cb("SIMULCAST"))return;if(void 0===t._scalabiltyMode||t._scalabiltyMode.numSpatialLayers<=1)return;const n="vp8"===i?2:t._scalabiltyMode.numSpatialLayers,r=e.attributes.ssrcs[0],o=e.attributes.ssrcGroups.find((e=>"FID"===e.semantic&&e.ssrcIds[0]===r.ssrcId)),s={semantic:"SIM",ssrcIds:[r.ssrcId]};for(let t=1;t<n;t++)e.attributes.ssrcs.push({ssrcId:r.ssrcId+t,attributes:VG(r.attributes)}),s.ssrcIds.push(r.ssrcId+t),o&&(e.attributes.ssrcs.push({ssrcId:o.ssrcIds[1]+t,attributes:VG(r.attributes)}),e.attributes.ssrcGroups.push({semantic:"FID",ssrcIds:[r.ssrcId+t,o.ssrcIds[1]+t]}));e.attributes.ssrcGroups.unshift(s)}(o,e,this.store.codec))})),yz.exports.print(n)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=e=>{var t;null===(t=this.onFirstAudioReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoReceived=e=>{var t;null===(t=this.onFirstVideoReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstAudioDecoded=e=>{var t;null===(t=this.onFirstAudioDecoded)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoDecoded=(e,t,i)=>{var n;null===(n=this.onFirstVideoDecoded)||void 0===n||n.call(this,e,t,i)},this.statsFilter.onSelectedLocalCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedLocalCandidateChanged)||void 0===i||i.call(this,e,t)},this.statsFilter.onSelectedRemoteCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedRemoteCandidateChanged)||void 0===i||i.call(this,e,t)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0}async applySimulcastForFirefox(e,t){if(e.length===t.length)for(let s=0;s<e.length;s++){var i,n,r,o;const a=e[s],c=t[s];if(c instanceof WJ&&!c._hints.includes(vP.LOW_STREAM)&&null!==(i=c._encoderConfig)&&void 0!==i&&i.bitrateMax&&(null===(n=c._encoderConfig)||void 0===n?void 0:n.bitrateMax)>200&&null!==(r=c._scalabiltyMode)&&void 0!==r&&r.numSpatialLayers&&(null===(o=c._scalabiltyMode)||void 0===o?void 0:o.numSpatialLayers)>1&&"vp8"===this.store.codec){const e={},t={high:1e3*(c._encoderConfig.bitrateMax-50),medium:5e4};e.encodings=[{rid:"m",active:!0,maxBitrate:t.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:t.high}];const i=a.sender.getParameters();await a.sender.setParameters(Object.assign(i,e))}}}async applySimulcastEncodings(e,t){if(!By()&&e.length===t.length)for(let i=0;i<e.length;i++){const n=t[i];if(n instanceof WJ&&this.isVP8Simulcast(n)){const t=e[i],r={},o={high:1e3*(n._encoderConfig.bitrateMax-50),medium:5e4};r.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:o.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:o.medium,scaleResolutionDownBy:4}];const s=t.sender.getParameters();await t.sender.setParameters(Object.assign(s,r))}}}isVP8Simulcast(e){var t,i,n,r;return!!(e instanceof WJ&&cb("SIMULCAST")&&"vp8"===this.store.codec&&!e._hints.includes(vP.LOW_STREAM)&&null!==(t=e._encoderConfig)&&void 0!==t&&t.bitrateMax&&(null===(i=e._encoderConfig)||void 0===i?void 0:i.bitrateMax)>200&&null!==(n=e._scalabiltyMode)&&void 0!==n&&n.numSpatialLayers&&(null===(r=e._scalabiltyMode)||void 0===r?void 0:r.numSpatialLayers)>1)}logSDPExchange(e,t,i,n){if(cb("SDP_LOGGING"))return mw.upload("exchanging ".concat(i," ").concat(t," SDP during P2PConnection.").concat(n,"\n"),e),"offer"===t?e=>{this.logSDPExchange(e,"answer","local"===i?"remote":"local",n)}:void 0}}).prototype,"connect",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"connect"),IZ.prototype),tx(IZ.prototype,"receive",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"receive"),IZ.prototype),tx(IZ.prototype,"batchReceive",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"batchReceive"),IZ.prototype),tx(IZ.prototype,"stopReceiving",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"stopReceiving"),IZ.prototype),tx(IZ.prototype,"muteRemote",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"muteRemote"),IZ.prototype),tx(IZ.prototype,"unmuteRemote",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"unmuteRemote"),IZ.prototype),tx(IZ.prototype,"muteLocal",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"muteLocal"),IZ.prototype),tx(IZ.prototype,"unmuteLocal",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"unmuteLocal"),IZ.prototype),tx(IZ.prototype,"reEstablish",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"reEstablish"),IZ.prototype),tx(IZ.prototype,"close",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"close"),IZ.prototype),tx(IZ.prototype,"updateEncoderConfig",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"updateEncoderConfig"),IZ.prototype),tx(IZ.prototype,"updateSendParameters",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"updateSendParameters"),IZ.prototype),tx(IZ.prototype,"replaceTrack",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"replaceTrack"),IZ.prototype),tx(IZ.prototype,"restartICE",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"restartICE"),IZ.prototype),_Z=IZ))||_Z;function CZ(e,t,i){const n=e[t];if("function"!=typeof n)throw new Error("Cannot use mutex on object property.");return i.value=async function(){const e=this.mutex,i=await e.lock("From P2PConnection.".concat(t));try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return await n.apply(this,o)}finally{i()}},i}var TZ,mZ;function SZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function OZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?SZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):SZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class vZ extends kx{getUserId(){return this._userId}constructor(e,t,i,n){super(e,"track-".concat(e.kind,"-").concat(t,"-").concat(n.clientId,"_").concat(vG(5,""))),tD(this,"_userId",void 0),tD(this,"_uintId",void 0),tD(this,"_isDestroyed",!1),tD(this,"store",void 0),this._userId=t,this._uintId=i,this.store=n}_updateOriginMediaStreamTrack(e){this._originMediaStreamTrack=e,this._mediaStreamTrack=e,this._updatePlayerSource()}_destroy(){this._isDestroyed=!0,mw.info("[".concat(this.getTrackId(),"] is destroyed")),Yw("info",this,"_destroy"),this.stop(),super.close()}}let NZ=Ww("RemoteVideoTrack","getTrackId")(TZ=class extends vZ{get isPlaying(){return!(!this._player||this._player.videoElementStatus!==mL.PLAYING)}constructor(e,t,i,n){super(e,t,i,n),tD(this,"_videoVisibleTimer",null),tD(this,"_previousVideoVisibleStatus",void 0),tD(this,"_clearPreviousVideoVisibleStatus",(()=>this._previousVideoVisibleStatus=void 0)),tD(this,"trackMediaType","video"),tD(this,"_videoWidth",void 0),tD(this,"_videoHeight",void 0),tD(this,"_player",void 0),Yw("info",this,"constructor",{userId:t}),this.updateMediaStreamTrackResolution()}getStats(){return xG((()=>{mw.warning("[deprecated] RemoteVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteVideoStats instead"),xw("warning",this,"[deprecated] RemoteVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteVideoStats instead")}),"remoteVideoTrackGetStatsWarning"),PG(this,OP.GET_STATS)||OZ({},oP)}play(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_VIDEO_TRACK_PLAY,options:[this.getTrackId(),"string"==typeof e?e:"HTMLElement",t]});if("string"==typeof e){const t=document.getElementById(e);t?e=t:(mw.warning("[".concat(this.getTrackId(),'] can not find "#').concat(e,'" element, use document.body')),xw("warning",this,'can not find "#'.concat(e,'" element, use document.body')),e=document.body)}mw.debug("[".concat(this.getTrackId(),"] start video playback"),JSON.stringify(t)),Yw("debug",this,"play",t);const n=OZ(OZ({fit:"cover"},t),{},{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(n):(this._player=new KW(n),this._player.updateVideoTrack(this._mediaStreamTrack),this._player.onFirstVideoFrameDecoded=()=>{this.store.subscribe(this.getUserId(),"video",void 0,void 0,performance.now()),this.emit(wP.FIRST_FRAME_DECODED)}),this._player.play(this.store.sessionId||void 0),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval((()=>{try{const e=this.getVideoElementVisibleStatus();this.emit(wP.VIDEO_ELEMENT_VISIBLE_STATUS,e)}catch(e){}}),cb("CHECK_VIDEO_VISIBLE_INTERVAL")),i.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_VIDEO_TRACK_STOP,options:[this.getTrackId()]});if(!this._player)return e.onSuccess();this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,mw.debug("[".concat(this.getTrackId(),"] stop video playback")),Yw("debug",this,"stop"),e.onSuccess()}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}updateMediaStreamTrackResolution(){DG(this._originMediaStreamTrack).then((e=>{let[t,i]=e;this._videoHeight=i,this._videoWidth=t})).catch(yG)}_updatePlayerSource(){mw.debug("[".concat(this.getTrackId(),"] update player source track")),Yw("debug",this,"_updatePlayerSource"),this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}getVideoElementVisibleStatus(){try{var e,t;const i=null==this||null===(e=this._player)||void 0===e?void 0:e.getContainerElement(),n={track:this,element:null==this||null===(t=this._player)||void 0===t?void 0:t.getVideoElement(),slot:null==i?void 0:i.parentElement},{element:r,slot:o}=n;if(this.isPlaying&&r instanceof HTMLVideoElement&&o instanceof HTMLElement){const e=YJ.checkOneElementVisible(r),t=Object.assign({},e);if(t.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=t.visible;const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});t.visible?e.onSuccess("Video is visible"):e.onSuccess("Invisible because of ".concat(t.reason))}return t}return}catch(e){throw new pw(hw.GET_VIDEO_ELEMENT_VISIBLE_ERROR,e.message)}}})||TZ,yZ=Ww("RemoteAudioTrack","getTrackId")(mZ=class extends vZ{get isPlaying(){return this._useAudioElement?_F.isPlaying(this.getTrackId()):this._source.isPlayed}constructor(e,t,i,n){super(e,t,i,n),tD(this,"trackMediaType","audio"),tD(this,"_source",void 0),tD(this,"_useAudioElement",!0),tD(this,"_volume",100),Yw("info",this,"constructor",{userId:t}),cb("REMOTE_AUDIO_TRACK_USES_WEB_AUDIO")&&(this._useAudioElement=!1),this._source=new eF(e,!0),this._source.once(qL.RECEIVE_TRACK_BUFFER,(()=>{this.emit(wP.FIRST_FRAME_DECODED)}))}setAudioFrameCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4096;if(!e)return this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(t),this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),this._source.on(qL.ON_AUDIO_BUFFER,(t=>e(t)))}setVolume(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_SET_VOLUME,options:[this.getTrackId(),e]},300);this._volume=e,this._useAudioElement?_F.setVolume(this.getTrackId(),e):this._source.setVolume(e/100),t.onSuccess()}async setPlaybackDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_SET_OUTPUT_DEVICE,options:[this.getTrackId(),e]});if(!this._useAudioElement)throw new pw(hw.NOT_SUPPORTED,"your browser does not support setting the audio output device");try{await _F.setSinkID(this.getTrackId(),e)}catch(e){throw t.onError(e),e}t.onSuccess()}getVolumeLevel(){return this._source.getAccurateVolumeLevel()}getStats(){return xG((()=>{mw.warning("[deprecated] RemoteAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteAudioStats instead"),xw("warning",this,"[deprecated] RemoteAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteAudioStats instead")}),"remoteAudioTrackGetStatsWarning"),PG(this,OP.GET_STATS)||OZ({},nP)}play(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_TRACK_PLAY,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] start audio playback")),Yw("debug",this,"play"),this._useAudioElement?(mw.debug("[".concat(this.getTrackId(),"] use audio element to play")),xw("debug",this,"use audio element to play"),_F.play(this._mediaStreamTrack,this.getTrackId(),this._volume,this.store.sessionId||void 0)):this._source.play(),e.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_TRACK_STOP,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] stop audio playback")),Yw("debug",this,"stop"),this._useAudioElement?_F.stop(this.getTrackId()):this._source.stop(),e.onSuccess()}_destroy(){super._destroy(),this._source.destroy()}_isFreeze(){return this._source.isFreeze}_updatePlayerSource(){mw.debug("[".concat(this.getTrackId(),"] update player source track")),Yw("debug",this,"_updatePlayerSource"),this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&_F.updateTrack(this.getTrackId(),this._mediaStreamTrack)}})||mZ;function DZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function wZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?DZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):DZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class bZ extends Ew{constructor(){super(),tD(this,"uplinkStatsUploadInterval",void 0),tD(this,"uplinkStatsUploadSlowInterval",void 0),tD(this,"uplinkRelatedStatsUploadInterval",void 0),tD(this,"uplinkDenoiserStatsUploadInterval",void 0),tD(this,"transportStatsUploadInterval",void 0),tD(this,"extensionStatsUploadInterval",void 0),tD(this,"downlinkStatsUploadInterval",void 0),tD(this,"downlinkStatsUploadSlowInterval",void 0),tD(this,"downlinkRelatedStatsUploadInterval",void 0),tD(this,"lastStats",void 0),tD(this,"uploadUnplinkStarted",!1),tD(this,"uploadDownlinkStarted",!1),tD(this,"uploadTransportStarted",!1),tD(this,"requestStats",void 0),tD(this,"requestLocalMedia",void 0),tD(this,"requestRemoteMedia",void 0),tD(this,"requestAllTracks",void 0),tD(this,"requestVideoIsReady",void 0),tD(this,"requestUpload",void 0)}startUploadTransportStats(){this.uploadTransportStarted||(this.uploadTransportStarted=!0,this.transportStatsUploadInterval&&window.clearInterval(this.transportStatsUploadInterval),this.transportStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadTransportStats(t)}),6e3))}startUploadUplinkStats(){this.uploadUnplinkStarted||(this.uploadUnplinkStarted=!0,this.uplinkStatsUploadInterval&&window.clearInterval(this.uplinkStatsUploadInterval),this.uplinkStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&(this.uploadUplinkStats(t,this.lastStats),this.lastStats=t)}),3e3),this.uplinkStatsUploadSlowInterval&&window.clearInterval(this.uplinkStatsUploadSlowInterval),this.uplinkStatsUploadSlowInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadSlowUplinkStats(t)}),6e4),this.uplinkRelatedStatsUploadInterval&&window.clearInterval(this.uplinkRelatedStatsUploadInterval),this.uplinkRelatedStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadRelatedUplinkStats(t,this.lastStats),this.lastStats=t}),1e3),this.uplinkDenoiserStatsUploadInterval&&window.clearInterval(this.uplinkDenoiserStatsUploadInterval),this.uplinkDenoiserStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestAllTracks)||void 0===e?void 0:e.call(this);t&&this.uploadDenoiserStats(t)}),2e3),this.extensionStatsUploadInterval&&window.clearInterval(this.extensionStatsUploadInterval),this.extensionStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestAllTracks)||void 0===e?void 0:e.call(this);t&&this.uploadExtensionStats(t)}),2e3))}uploadTransportStats(e){BG((()=>{var t;null===(t=this.requestUpload)||void 0===t||t.call(this,KL.TRANSPORT_STATS,function(e){const t={connectionType:100};if("relay"===e.selectedCandidatePair.localCandidate.candidateType){const i=e.selectedCandidatePair.localCandidate.relayProtocol;"udp"===i&&(t.connectionType=101),"tcp"===i&&(t.connectionType=103),"tls"===i&&(t.connectionType=104)}return t}(e))}))}uploadUplinkStats(e,t){var i;((null===(i=this.requestLocalMedia)||void 0===i?void 0:i.call(this))||[]).forEach((i=>{let[n,{track:r,ssrcs:o}]=i;switch(n){case xP.LocalVideoLowTrack:case xP.LocalVideoTrack:{const i=function(e,t,i){var n;const r=t.videoSend.find((t=>t.ssrc===e));if(!r)return null;const o={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"video",type:"ssrc",ssrc:r.ssrc.toString()};switch(o.A_vstd=i._originMediaStreamTrack&&!i._originMediaStreamTrack.enabled||!i._mediaStreamTrack.enabled?"1":"0",r.sentFrame&&(o.A_fhs=r.sentFrame.height.toString(),o.A_frs=r.sentFrame.frameRate.toString(),o.A_fws=r.sentFrame.width.toString()),r.adaptionChangeReason){case"none":o.A_ac="0";break;case"cpu":o.A_ac="1";break;case"bandwidth":o.A_ac="2";break;case"other":o.A_ac="3"}return o.A_lvps=SL[i._player?i._player.videoElementStatus:"uninit"].toString(),o.A_nr=null===(n=r.nacksCount)||void 0===n?void 0:n.toString(),r.avgEncodeMs&&(o.A_aem=r.avgEncodeMs.toFixed(0).toString()),o}(o[0].ssrcId,e,r),s=pG(o[0].ssrcId,e,t);i&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:n===xP.LocalVideoLowTrack?"low":"high",stats:wZ(wZ({},i),s)})}));break}case xP.LocalAudioTrack:{const t=function(e,t,i){const n=t.audioSend.find((t=>t.ssrc===e));if(!n)return null;const r={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"audio",type:"ssrc",ssrc:n.ssrc.toString()};return r.A_astd=i._originMediaStreamTrack.enabled&&i._mediaStreamTrack.enabled?"0":"1",n.inputLevel?r.A_ail=Math.round(100*n.inputLevel).toString():r.A_ail=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),r.A_apil=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),n.aecReturnLoss&&(r.A_ecrl=Math.round(n.aecReturnLoss).toString()),n.aecReturnLossEnhancement&&(r.A_ecrle=Math.round(n.aecReturnLossEnhancement).toString()),r}(o[0].ssrcId,e,r);t&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:"high",stats:t})}));break}}const s=function(e){const t={id:"bweforvideo",timestamp:new Date(e.timestamp).toISOString(),type:"VideoBwe"};return e.bitrate.retransmit&&(t.A_rb=e.bitrate.retransmit.toString()),e.bitrate.targetEncoded&&(t.A_teb=e.bitrate.targetEncoded.toString()),t.A_aeb=e.bitrate.actualEncoded.toString(),t.A_tb=e.bitrate.transmit.toString(),void 0!==e.sendBandwidth&&(t.A_asb=e.sendBandwidth.toString()),t}(e);s&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:n===xP.LocalVideoLowTrack?"low":"high",stats:s})}))}))}uploadSlowUplinkStats(e){var t;((null===(t=this.requestLocalMedia)||void 0===t?void 0:t.call(this))||[]).filter((e=>{let[t]=e;return t===xP.LocalVideoLowTrack||t===xP.LocalVideoTrack})).forEach((t=>{let[i,{ssrcs:n}]=t;const r=pG(n[0].ssrcId,e);r&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:i===xP.LocalVideoLowTrack?"low":"high",stats:r})}))}))}uploadRelatedUplinkStats(e,t){var i;((null===(i=this.requestLocalMedia)||void 0===i?void 0:i.call(this))||[]).filter((e=>{let[t]=e;return t===xP.LocalVideoLowTrack||t===xP.LocalVideoTrack})).forEach((t=>{let[i,{ssrcs:n}]=t;const r=function(e,t){const i=t.videoSend.find((t=>t.ssrc===e));return i?{mediaType:"video",isVideoMute:!1,frameRateInput:i.inputFrame&&i.inputFrame.frameRate.toString(),frameRateSent:i.sentFrame&&i.sentFrame.frameRate.toString(),googRtt:i.rttMs.toString(),qpSumPerFrame:Math.floor(i.qpSumPerFrame).toString()}:null}(n[0].ssrcId,e);r&&BG((()=>{var e;null===(e=this.requestUpload)||void 0===e||e.call(this,KL.PUBLISH_RELATED_STATS,{stream_type:i===xP.LocalVideoLowTrack?"low":"high",stats:r})}))}))}uploadDenoiserStats(e){for(let r=0;r<e.length;r++){const o=e[r];if(o instanceof qF){var t,i,n;const e=null===(t=(i=o._external).getDenoiserStats)||void 0===t?void 0:t.call(i);return void(e&&(null===(n=this.requestUpload)||void 0===n||n.call(this,KL.DENOISER_STATS,e)))}}}uploadExtensionStats(e){for(let t=0;t<e.length;t++){const i=e[t];if(i instanceof qF)return void i.getProcessorStats().forEach((e=>{var t;e.type===KL.DENOISER_STATS&&(null===(t=this.requestUpload)||void 0===t||t.call(this,KL.DENOISER_STATS,e.stats))}))}}stopUploadUplinkStats(){this.uploadUnplinkStarted&&(this.uploadUnplinkStarted=!1,this.uplinkStatsUploadInterval&&window.clearInterval(this.uplinkStatsUploadInterval),this.uplinkRelatedStatsUploadInterval&&window.clearInterval(this.uplinkRelatedStatsUploadInterval),this.uplinkDenoiserStatsUploadInterval&&window.clearInterval(this.uplinkDenoiserStatsUploadInterval),this.uplinkStatsUploadInterval=void 0,this.uplinkRelatedStatsUploadInterval=void 0,this.uplinkDenoiserStatsUploadInterval=void 0)}startUploadDownlinkStats(){this.uploadDownlinkStarted||(this.uploadDownlinkStarted=!0,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval),this.downlinkStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&(this.uploadDownlinkStats(t,this.lastStats),this.lastStats=t)}),3e3),this.downlinkStatsUploadSlowInterval&&window.clearInterval(this.downlinkStatsUploadSlowInterval),this.downlinkStatsUploadSlowInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadSlowDownlinkStats(t)}),6e4),this.downlinkRelatedStatsUploadInterval&&window.clearInterval(this.downlinkRelatedStatsUploadInterval),this.downlinkRelatedStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&(this.uploadRelatedDownlinkStats(t,this.lastStats),this.lastStats=t)}),1e3))}uploadDownlinkStats(e,t){var i;((null===(i=this.requestRemoteMedia)||void 0===i?void 0:i.call(this))||[]).forEach((t=>{let[i,n]=t;if(n.has(QP.VIDEO)&&i.videoTrack){const t=i.videoTrack?function(e,t,i){const n=t.videoRecv.find((t=>t.ssrc===e));if(!n)return null;const r={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"video",type:"ssrc",ssrc:n.ssrc.toString()};var o,s;return r.bytesReceived=n.bytes.toString(),r.packetsLost=n.packetsLost.toString(),r.packetsReceived=n.packets.toString(),n.framesRateFirefox&&(r.A_frr=n.framesRateFirefox.toString()),n.receivedFrame?(r.A_frr=n.receivedFrame.frameRate.toString(),r.A_fhr=n.receivedFrame.height.toString(),r.A_fwr=n.receivedFrame.width.toString()):(r.A_fhr=null===(o=i._videoHeight)||void 0===o?void 0:o.toString(),r.A_fwr=null===(s=i._videoWidth)||void 0===s?void 0:s.toString()),r.A_frd=n.decodeFrameRate.toString(),n.outputFrame&&(r.A_fro=n.outputFrame.frameRate.toString()),void 0!==n.jitterBufferMs&&(r.A_jbm=Math.floor(n.jitterBufferMs).toString()),void 0!==n.currentDelayMs&&(r.A_cdm=Math.floor(n.currentDelayMs).toString()),r.A_fs=n.firsCount.toString(),r.A_ns=n.nacksCount.toString(),r.A_ps=n.plisCount.toString(),i&&(r.A_vrtd=i._originMediaStreamTrack.enabled&&i._mediaStreamTrack.enabled?"0":"1"),i._player&&i._player.freezeTimeCounterList.length>0&&(r.A_vrft=i._player.freezeTimeCounterList.splice(0,1)[0].toString()),r.A_rvps=SL[i._player?i._player.videoElementStatus:"uninit"].toString(),r}(i._videoSSRC,e,i.videoTrack):void 0;t&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.SUBSCRIBE_STATS,{stream_id:i.uid,stats:t})}))}if(n.has(QP.AUDIO)&&i.audioTrack){const t=i.audioTrack?function(e,t,i){const n=t.audioRecv.find((t=>t.ssrc===e));if(!n)return null;const r={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"audio",type:"ssrc",ssrc:n.ssrc.toString()};return r.bytesReceived=n.bytes.toString(),r.packetsLost=n.packetsLost.toString(),r.packetsReceived=n.packets.toString(),n.outputLevel?r.A_aol=Math.round(100*n.outputLevel).toString():r.A_aol=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),r.A_apol=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),i&&(r.A_artd=i._originMediaStreamTrack.enabled&&i._mediaStreamTrack.enabled?"0":"1"),r.A_jr=n.jitterMs.toString(),r.A_jbm=Math.floor(n.jitterBufferMs).toString(),r.A_cdm=Math.floor(n.jitterBufferMs).toString(),r.A_raps=SL[_F.getPlayerState(i.getTrackId())].toString(),r}(i._audioSSRC,e,i.audioTrack):void 0;t&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.SUBSCRIBE_STATS,{stream_id:i.uid,stats:t})}))}}))}uploadSlowDownlinkStats(e){}uploadRelatedDownlinkStats(e,t){var i;((null===(i=this.requestRemoteMedia)||void 0===i?void 0:i.call(this))||[]).forEach((i=>{let[n,r]=i;if(r.has(QP.VIDEO)&&n.videoTrack){var o;const i=!0===(n._videoSSRC&&(null===(o=this.requestVideoIsReady)||void 0===o?void 0:o.call(this,n._videoSSRC))||!1),r=function(e,t,i,n,r,o){const s=i.videoRecv.find((t=>t.ssrc===e)),a=r?r.videoRecv.find((t=>t.ssrc===e)):void 0;if(!s)return null;const c=oG.isRemoteVideoFreeze(o,s,a)&&t,A={mediaType:"video",isVideoMute:!1,peerId:n,frameRateReceived:s.receivedFrame&&s.receivedFrame.frameRate.toString(),frameRateDecoded:s.decodedFrame&&s.decodedFrame.frameRate.toString(),isFreeze:c,bytesReceived:s.bytes.toString(),packetsReceived:s.packets.toString(),packetsLost:s.packetsLost.toString(),qpSumPerFrame:Math.floor(s.qpSumPerFrame).toString()};return s.framesRateFirefox&&(A.frameRateDecoded=s.framesRateFirefox.toString(),A.frameRateReceived=s.framesRateFirefox.toString()),A}(n._videoSSRC,i,e,n.uid,t,n.videoTrack);r&&BG((()=>{var e;null===(e=this.requestUpload)||void 0===e||e.call(this,KL.SUBSCRIBE_RELATED_STATS,{stream_id:n.uid,stats:r})}))}if(r.has(QP.AUDIO)&&n.audioTrack){const t=function(e,t,i,n){const r=t.audioRecv.find((t=>t.ssrc===e));if(!r)return null;const o=oG.isRemoteAudioFreeze(n);return{mediaType:"audio",isAudioMute:!1,peerId:i,googJitterReceived:r.jitterMs.toString(),isFreeze:o,bytesReceived:r.bytes.toString(),packetsReceived:r.packets.toString(),packetsLost:r.packetsLost.toString(),frameReceived:r.receivedFrames.toString(),frameDropped:r.droppedFrames.toString()}}(n._audioSSRC,e,n.uid,n.audioTrack);t&&BG((()=>{var e;null===(e=this.requestUpload)||void 0===e||e.call(this,KL.SUBSCRIBE_RELATED_STATS,{stream_id:n.uid,stats:t})}))}}))}stopUploadDownlinkStats(){this.uploadDownlinkStarted&&(this.uploadDownlinkStarted=!1,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval),this.downlinkRelatedStatsUploadInterval&&window.clearInterval(this.downlinkRelatedStatsUploadInterval),this.downlinkStatsUploadInterval=void 0,this.downlinkRelatedStatsUploadInterval=void 0)}stopUploadTransportStats(){this.uploadTransportStarted&&(this.uploadTransportStarted=!1,this.transportStatsUploadInterval&&window.clearInterval(this.transportStatsUploadInterval),this.transportStatsUploadInterval=void 0)}}var LZ,PZ;function kZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function MZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?kZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):kZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function UZ(e){var t,i,n,r=2;for("undefined"!=typeof Symbol&&(i=az,n=Symbol.iterator);r--;){if(i&&null!=(t=e[i]))return t.call(e);if(n&&null!=(t=e[n]))return new BZ(t.call(e));i="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function BZ(e){function t(e){if(Object(e)!==e)return Mm.reject(new TypeError(e+" is not an object."));var t=e.done;return Mm.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(BZ=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Mm.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Mm.reject(e):t(i.apply(this.s,arguments))}},new BZ(e)}let VZ=Ww("P2PChannel","store.p2pId")((tx((PZ=class extends Ew{get state(){return this._state}set state(e){const t=this._state;this._state=e,this.emit(GP.StateChange,t,this._state)}constructor(e,t){super(),tD(this,"store",void 0),tD(this,"statsUploader",void 0),tD(this,"connection",void 0),tD(this,"localTrackMap",new Map),tD(this,"remoteUserMap",new Map),tD(this,"pendingLocalTracks",[]),tD(this,"pendingRemoteTracks",[]),tD(this,"statsCollector",void 0),tD(this,"isPlanB",!1),tD(this,"iceFailedCount",0),tD(this,"dtlsFailedCount",0),tD(this,"mutex",new Qx("P2PChannel-mutex")),tD(this,"_state",FP.Disconnected),tD(this,"handleMuteLocalTrack",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleMuteLocalTrack");try{if(!this.connection)return void i(new pw(hw.INVALID_OPERATION,"Cannot call P2PChannel.handleMuteLocalTrack before connection established."));Yw("debug",this,"handleMuteLocalTrack",e.getTrackId()),await this.waitTillConnected();const r=this.filterTobeMutedTracks(e);if(0===r.length)return void t();await this.connection.muteLocal(r.map((e=>{let[,{id:t}]=e;return t})));const o=this.createMuteMessage(r);await LG(this,GP.RequestMuteLocal,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleUnmuteLocalTrack",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleUnmuteLocalTrack");try{if(!this.connection)return void i(new pw(hw.INVALID_OPERATION,"Cannot call P2PChannel.handleUnmuteLocalTrack before connection established."));Yw("debug",this,"handleUnmuteLocalTrack",e.getTrackId()),await this.waitTillConnected();const r=this.filterTobeUnmutedTracks(e);if(0===r.length)return void t();await this.connection.unmuteLocal(r.map((e=>{let[,{id:t}]=e;return t})));const o=this.createUnmuteMessage(r);await LG(this,GP.RequestUnmuteLocal,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleUpdateVideoEncoder",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleSetVideoEncoder");try{const i=this.localTrackMap.get(xP.LocalVideoTrack);if(!this.connection||!i||i.track!==e)return void t();await this.waitTillConnected();const{id:r,track:o}=i;await this.connection.updateSendParameters(r,o),await this.connection.updateEncoderConfig(r,o),this.emit(GP.UpdateVideoEncoder,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleSetOptimizationMode",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleSetOptimizationMode");try{const i=this.localTrackMap.get(xP.LocalVideoTrack);if(!this.connection||!i||i.track!==e)return;await this.waitTillConnected();const{id:r,track:o}=i;await this.connection.updateSendParameters(r,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleReplaceTrack",(async(e,t,i,n)=>{let r;mw.debug("P2PChannel handleReplaceTrack for [track-id-".concat(e.getTrackId(),"]")),"boolean"==typeof n&&n||(r=await this.mutex.lock("From P2PChannel.handleReplaceTrack"));try{const i=Array.from(this.localTrackMap.entries()).find((t=>{let[,{track:i}]=t;return e===i}));if(!this.connection||!i)return void t();if(await this.waitTillConnected(),await this.connection.replaceTrack(e,i[1].id),this.isPlanB){const t=i[1];t.id=e._mediaStreamTrack.id,this.localTrackMap.set(i[0],t)}if(i[0]===xP.LocalVideoTrack&&XP().supportDualStreamEncoding){const t=this.localTrackMap.get(xP.LocalVideoLowTrack);if(t){const i=e._mediaStreamTrack.clone();t.track._originMediaStreamTrack.stop(),t.track._mediaStreamTrack=i,t.track._originMediaStreamTrack=i,await new Mm(((e,i)=>{this.handleReplaceTrack(t.track,e,i,!0)}))}}t()}catch(e){i(e)}finally{var o;null===(o=r)||void 0===o||o()}})),tD(this,"handleGetLocalVideoStats",(e=>{e(this.statsCollector.getLocalVideoTrackStats())})),tD(this,"handleGetLocalAudioStats",(e=>{e(this.statsCollector.getLocalAudioTrackStats())})),tD(this,"handleGetRemoteVideoStats",(e=>this.statsCollector.getRemoteVideoTrackStats(e.uid)[e.uid])),tD(this,"handleGetRemoteAudioStats",(e=>this.statsCollector.getRemoteAudioTrackStats(e.uid)[e.uid])),this.store=e,this.statsCollector=t,this.statsCollector.addP2PChannel(this),this.statsUploader=new bZ,this.bindStatsUploaderEvents(),this.isPlanB=!XP().supportUnifiedPlan||cb("CHROME_FORCE_PLAN_B")&&Ky()}async startP2PConnection(e){return this.state=FP.New,this.connection=this.isPlanB?new uZ(e,this.store):new RZ(e,this.store),this.bindConnectionEvents(this.connection),this.store.peerConnectionStart(),this.connection.establish()}async connect(e,t,i,n,r,o){if(!this.connection)throw new pw(hw.UNEXPECTED_ERROR,"Cannot P2PChannel.connect before P2PChannel.startP2PConnection .");await this.connection.connect(e,t,i,n,r,o),this.statsUploader.startUploadTransportStats(),this.state=FP.Connected}publish(e,t,i){var n=this;return nz((function*(){const r=yield rz(n.mutex.lock("From P2PChannel.publish"));try{if(!n.connection){if(n.state===FP.Disconnected)throw new pw(hw.UNEXPECTED_ERROR,"PeerConnection already disconnected.");n.throwIfTrackTypeNotMatch(e);const t=e.filter((e=>-1===n.pendingLocalTracks.indexOf(e)));return void(n.pendingLocalTracks=n.pendingLocalTracks.concat(t))}n.store.pubId=n.store.pubId+1,iG.markPublishStart(n.store.clientId,n.store.pubId),yield rz(n.waitTillConnected());const o=n.filterTobePublishedTracks(e,t,i);if(0===o.length)return void(yield rz(n.tryToUnmuteAudio(e)));yield*sz(UZ(n.doPublish(n.connection,o)),rz)}finally{r()}}))()}doPublish(e,t){var i=this;return nz((function*(){t.forEach((e=>{let{track:t,type:n}=e;const r=performance.now();i.store.publish(t.getTrackId(),n===xP.LocalAudioTrack?"audio":"video",r)})),i.bindLocalTrackEvents(t);const n=yield rz(e.send(t.map((e=>{let{track:t}=e;return t})),i.store.codec,i.store.audioCodec)),r=(yield rz(n.next())).value,o=i.createGatewayPublishMessage(t,r);let s;try{s=yield o}catch(e){throw xw("error",i,"doPublish yield error: ".concat(e.toString())),n.throw(e),(null==e?void 0:e.code)===hw.WS_ABORT&&t.forEach((e=>{let{track:t}=e;-1===i.pendingLocalTracks.indexOf(t)&&i.pendingLocalTracks.push(t)})),i.unbindLocalTrackEvents(t),e}const a=i.mapPubResToRemoteConfig(o,s);Yw("debug",i,"doPublish",{remoteConfigs:a,tracks:t.map((e=>{let{track:t}=e;return t.getTrackId()})),pubMsg:o,pubAns:s});const c=(yield rz(n.next(a))).value;t.forEach((e=>{let{type:t}=e;i.statsCollector.addLocalStats(t)})),i.assignLocalTracks(t,c),i.statsUploader.startUploadUplinkStats(),t.forEach((e=>{let{track:t,type:n}=e;const r=performance.now();i.store.publish(t.getTrackId(),n===xP.LocalAudioTrack?"audio":"video",void 0,r)}))}))()}publishLowStream(e){var t=this;return nz((function*(){if(!t.connection)return;Yw("debug",t,"publishLowStream",e);const i=yield rz(t.mutex.lock("Locking from P2PChannel.publishLowStream"));try{const r=t.localTrackMap.get(xP.LocalVideoTrack);if(!r)throw new pw(hw.UNEXPECTED_ERROR,"Could not find high stream");if(t.localTrackMap.has(xP.LocalVideoLowTrack))throw new pw(hw.UNEXPECTED_ERROR,"[".concat(t.store.clientId,"] Can't publish low stream when stream already publish"));yield rz(t.waitTillConnected());const o=[{track:t.getLowVideoTrack(r.track,e),type:xP.LocalVideoLowTrack}];if(yield*sz(UZ(t.doPublish(t.connection,o)),rz),r.track.muted||!r.track.enabled){var n;const e=null===(n=t.localTrackMap.get(xP.LocalVideoLowTrack))||void 0===n?void 0:n.id;void 0!==e&&(yield rz(t.connection.muteLocal([e])))}}finally{i()}}))()}async republish(){this.pendingLocalTracks.length>0&&(mw.debug("Emit P2PChannelEvents.RequestRePublish to republish tracks."),Yw("debug",this,"republish",this.pendingLocalTracks.map((e=>e.getTrackId()))),await bG(this,GP.RequestRePublish,this.pendingLocalTracks),this.emit(GP.MediaReconnectEnd,this.store.uid),this.pendingLocalTracks=[])}async reSubscribe(e){Yw("debug",this,"reSubscribe",this.pendingRemoteTracks.map((e=>{let{user:t}=e;return t.uid})));for(let e=this.pendingRemoteTracks.length-1;e>=0;e--){const{user:t,kind:i}=this.pendingRemoteTracks[e];(i!==QP.AUDIO||t._audio_added_&&t._audioSSRC)&&(i!==QP.VIDEO||t._video_added_&&t._videoSSRC)||this.pendingRemoteTracks.splice(e,1)}if(e)await bG(this,GP.RequestReSubscribe,this.pendingRemoteTracks);else for(const{user:e,kind:t}of this.pendingRemoteTracks)await this.subscribe(e,t,t===QP.VIDEO?e._videoSSRC:e._audioSSRC);this.pendingRemoteTracks.forEach((e=>{let{user:t}=e;this.emit(GP.MediaReconnectEnd,t.uid)})),this.pendingRemoteTracks=[]}async unpublish(e){if(!this.connection)return void e.forEach((e=>{const t=this.pendingLocalTracks.indexOf(e);-1!==t&&this.pendingLocalTracks.splice(t,1)}));await this.waitTillConnected();const t=this.filterTobeUnpublishedTracks(e);return 0!==t.length?(Yw("debug",this,"unpublish"),this.doUnpublish(this.connection,t)):void 0}async unpublishLowStream(){if(!this.connection)return;Yw("debug",this,"unpublishLowStream");const e=this.localTrackMap.get(xP.LocalVideoLowTrack);if(!e)return;await this.waitTillConnected();const t=[[xP.LocalVideoLowTrack,e]];return this.doUnpublish(this.connection,t)}async doUnpublish(e,t){const i=this.createGatewayUnpublishMessage(t);return await e.stopSending(t.map((e=>{let[,{id:t}]=e;return t}))),this.withdrawLocalTracks(t),this.unbindLocalTrackEvents(t.map((e=>{let[t,{track:i}]=e;return{type:t,track:i}}))),t.forEach((e=>{let[t]=e;this.statsCollector.removeLocalStats(t)})),0===this.localTrackMap.size&&this.statsUploader.stopUploadUplinkStats(),i}async subscribe(e,t,i,n,r){var o;if(!this.connection)throw new pw(hw.INVALID_OPERATION,"Cannot subscribe remote user when peerConnection disconnected.");if(Yw("debug",this,"subscribe",{uid:e.uid,mediaType:t,ssrcId:i}),null!==(o=this.remoteUserMap.get(e))&&void 0!==o&&o.has(t))return;let s,a;if(await this.waitTillConnected(),r){const i=r.find((e=>{let{stream_type:i}=e;return i===t}));if(!i)throw new pw(hw.UNEXPECTED_ERROR,"Cannot subscribe to remote ".concat(t," for user: ").concat(e.uid," because subscribe answer from gateway does not contain stream_type: ").concat(t,"."));const n=await this.connection.receive(t,i.ssrcs,String(e.uid),i.attributes);s=n.track,a=n.id}else{const r=await this.connection.receive(t,[{ssrcId:i,rtx:n}],String(e.uid),void 0);s=r.track,a=r.id}t===QP.AUDIO?(e._audioTrack?e._audioTrack._updateOriginMediaStreamTrack(s):(e._audioTrack=new yZ(s,e.uid,e._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote audio track: ").concat(e._audioTrack.getTrackId()))),this.bindRemoteTrackEvents(e,e._audioTrack)):(e._videoTrack?e._videoTrack._updateOriginMediaStreamTrack(s):(e._videoTrack=new NZ(s,e.uid,e._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote video track: ").concat(e._videoTrack.getTrackId()))),this.bindRemoteTrackEvents(e,e._videoTrack));const c=this.remoteUserMap.get(e);c?c.set(t,a):this.remoteUserMap.set(e,new Map([[t,a]])),this.statsCollector.addRemoteStats(e.uid),this.statsUploader.startUploadDownlinkStats();const A=this.pendingRemoteTracks.findIndex((i=>{let{user:n,kind:r}=i;return n.uid===e.uid&&t===r}));-1!==A&&(this.pendingRemoteTracks.splice(A,1),this.emit(GP.MediaReconnectEnd,e.uid))}async massSubscribe(e){return this.massSubscribeNoLock(e)}async massSubscribeNoLock(e){if(!this.connection)throw new pw(hw.INVALID_OPERATION,"Cannot subscribeAll remote users when peerConnection disconnected.");Yw("debug",this,"subscribeAll",e.map((e=>{let{user:t,mediaType:i,ssrcId:n}=e;return{uid:t.uid,mediaType:i,ssrcId:n}}))),e=e.filter((e=>{var t;let{user:i,mediaType:n}=e;return!(null!==(t=this.remoteUserMap.get(i))&&void 0!==t&&t.has(n))})),await this.waitTillConnected();const t=await this.connection.batchReceive(e.map((e=>{let{user:t,mediaType:i,ssrcId:n,rtxSsrcId:r}=e;return{kind:i,ssrcMsg:[{ssrcId:n,rtx:r}],mslabel:String(t.uid)}})));e.forEach(((e,i)=>{let{user:n,mediaType:r}=e;const{track:o,id:s}=t[i];r===QP.AUDIO?(n._audioTrack?n._audioTrack._updateOriginMediaStreamTrack(o):(n._audioTrack=new yZ(o,n.uid,n._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote audio track: ").concat(n._audioTrack.getTrackId()))),this.bindRemoteTrackEvents(n,n._audioTrack)):(n._videoTrack?n._videoTrack._updateOriginMediaStreamTrack(o):(n._videoTrack=new NZ(o,n.uid,n._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote video track: ").concat(n._videoTrack.getTrackId()))),this.bindRemoteTrackEvents(n,n._videoTrack));const a=this.remoteUserMap.get(n);a?a.set(r,s):this.remoteUserMap.set(n,new Map([[r,s]])),this.statsCollector.addRemoteStats(n.uid),this.statsUploader.startUploadDownlinkStats();const c=this.pendingRemoteTracks.findIndex((e=>{let{user:t,kind:i}=e;return t.uid===n.uid&&r===i}));-1!==c&&(this.pendingRemoteTracks.splice(c,1),this.emit(GP.MediaReconnectEnd,n.uid))}))}async unsubscribe(e,t){const i=this.pendingRemoteTracks.filter((i=>{let{user:n,kind:r}=i;return void 0!==t?n.uid===e.uid&&t===r:n.uid===e.uid}));if(i.forEach((e=>{const t=this.pendingRemoteTracks.indexOf(e);this.pendingRemoteTracks.splice(t,1)})),!this.connection)return void i.forEach((t=>{let{kind:i}=t;var n;if(i===QP.AUDIO)null===(n=e._audioTrack)||void 0===n||n._destroy(),e._audioTrack=void 0;else if(i===QP.VIDEO){var r;null===(r=e._videoTrack)||void 0===r||r._destroy(),e._videoTrack=void 0}}));Yw("debug",this,"unsubscribe",{uid:e.uid,mediaType:t});const n=this.filterTobeUnSubscribedTracks(e,t);if(0===n.length)return;await this.connection.stopReceiving(n.map((e=>{let[,{id:t}]=e;return t})));const r=this.createUnsubscribeMessage(n);return this.withdrawRemoteTracks(n),0===this.remoteUserMap.size&&this.statsUploader.stopUploadDownlinkStats(),n.forEach((e=>{let[t,{kind:i}]=e;var n,r;if(i===QP.VIDEO&&t._videoSSRC&&(null===(n=this.connection)||void 0===n||n.setStatsRemoteVideoIsReady(t._videoSSRC,!1)),i===QP.VIDEO)this.unbindRemoteTrackEvents(t._videoTrack),null===(r=t._videoTrack)||void 0===r||r._destroy(),t._videoTrack=void 0;else if(i===QP.AUDIO){var o;this.unbindRemoteTrackEvents(t._audioTrack),null===(o=t._audioTrack)||void 0===o||o._destroy(),t._audioTrack=void 0}})),r}async massUnsubscribe(e){return this.massUnsubscribeNoLock(e)}async massUnsubscribeNoLock(e){let t=[];for(const{user:i,mediaType:n}of e){const e=this.pendingRemoteTracks.filter((e=>{let{user:t,kind:r}=e;return void 0!==n?t.uid===i.uid&&n===r:t.uid===i.uid}));e.forEach((e=>{const t=this.pendingRemoteTracks.indexOf(e);this.pendingRemoteTracks.splice(t,1)})),t=t.concat(e)}if(!this.connection)return void t.forEach((e=>{let{user:t,kind:i}=e;var n;if(i===QP.AUDIO)null===(n=t._audioTrack)||void 0===n||n._destroy(),t._audioTrack=void 0;else if(i===QP.VIDEO){var r;null===(r=t._videoTrack)||void 0===r||r._destroy(),t._videoTrack=void 0}}));Yw("debug",this,"batchUnsubscribe",e.map((e=>{let{user:t,mediaType:i}=e;return{uid:t.uid,mediaType:i}})));const i=dE(e).call(e,((e,t)=>{let{user:i,mediaType:n}=t;const r=this.filterTobeUnSubscribedTracks(i,n);return e.concat(r)}),[]);if(0===i.length)return;await this.connection.stopReceiving(i.map((e=>{let[,{id:t}]=e;return t})));const n=this.createUnsubscribeAllMessage(i);return this.withdrawRemoteTracks(i),0===this.remoteUserMap.size&&this.statsUploader.stopUploadDownlinkStats(),i.forEach((e=>{let[t,{kind:i}]=e;var n,r;if(i===QP.VIDEO&&t._videoSSRC&&(null===(n=this.connection)||void 0===n||n.setStatsRemoteVideoIsReady(t._videoSSRC,!1)),i===QP.VIDEO)this.unbindRemoteTrackEvents(t._videoTrack),null===(r=t._videoTrack)||void 0===r||r._destroy(),t._videoTrack=void 0;else if(i===QP.AUDIO){var o;this.unbindRemoteTrackEvents(t._audioTrack),null===(o=t._audioTrack)||void 0===o||o._destroy(),t._audioTrack=void 0}})),n}async muteRemote(e,t){if(!this.connection)return;Yw("debug",this,"muteRemote",{uid:e.uid,kind:t});const i=this.remoteUserMap.get(e);if(!i)return mw.warning("P2PChannel.muteRemote has no remote user ".concat(e.uid,".")),void xw("warning",this,"P2PChannel.muteRemote has no remote user ".concat(e.uid,"."));const n=i.get(t);if(!n)return mw.warning("P2PChannel.muteRemote has no remote user ".concat(e.uid," media type ").concat(t,".")),void xw("warning",this,"P2PChannel.muteRemote has no remote user ".concat(e.uid," media type ").concat(t,"."));const r=t===QP.VIDEO?e._videoSSRC:e._audioSSRC;void 0!==r&&this.connection.setStatsRemoteVideoIsReady(r,!1),await this.connection.muteRemote(n)}async unmuteRemote(e,t){return this.unmuteRemoteNoLock(e,t)}async unmuteRemoteNoLock(e,t){if(!this.connection)return;Yw("debug",this,"unmuteRemote",{uid:e.uid,kind:t});const i=this.remoteUserMap.get(e);if(!i)return mw.warning("P2PChannel.unmuteRemote has no remote user ".concat(e.uid,".")),void xw("warning",this,"unmuteRemote has no remote user ".concat(e.uid));const n=i.get(t);if(!n)return mw.warning("P2PChannel.unmuteRemote has no remote user ".concat(e.uid," media type ").concat(t,".")),void xw("warning",this,"unmuteRemote has no remote user ".concat(e.uid," media type ").concat(t));await this.connection.unmuteRemote(n)}getAllTracks(e){const t=this.localTrackMap.get(xP.LocalAudioTrack);if((null==t?void 0:t.track)instanceof zF){const i=t.track;return Array.from(this.localTrackMap.entries()).filter((e=>{let[t]=e;return t!==xP.LocalAudioTrack})).filter((t=>{let[i]=t;return!(e&&i===xP.LocalVideoLowTrack)})).map((e=>{let[,{track:t}]=e;return t})).concat(i.trackList)}return Array.from(this.localTrackMap.entries()).filter((t=>{let[i]=t;return!(e&&i===xP.LocalVideoLowTrack)})).map((e=>{let[,{track:t}]=e;return t}))}reportPublishEvent(e,t,i,n,r){if(e){const i=this.localTrackMap.get(xP.LocalAudioTrack),o=n?this.localTrackMap.get(xP.LocalVideoLowTrack):this.localTrackMap.get(xP.LocalVideoTrack);Px.publish(this.store.sessionId,{eventElapse:iG.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:e,ec:t,audioName:null==i?void 0:i.track.getTrackLabel(),videoName:null==o?void 0:o.track.getTrackLabel(),screenshare:-1!==(null==o?void 0:o.track._hints.indexOf(vP.SCREEN_TRACK)),audio:!!i,video:!!o,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:r})}else{var o;i||(i=[]);const s=i.find((e=>e instanceof JF)),a=n?null===(o=this.localTrackMap.get(xP.LocalVideoTrack))||void 0===o?void 0:o.track:i.find((e=>e instanceof WJ));Px.publish(this.store.sessionId,{eventElapse:iG.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:e,ec:t,audioName:null==s?void 0:s.getTrackLabel(),videoName:null==a?void 0:a.getTrackLabel(),screenshare:-1!==(null==a?void 0:a._hints.indexOf(vP.SCREEN_TRACK)),audio:!!s,video:!!a,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:r})}}reportSubscribeEvent(e,t,i,n){const r=n===QP.VIDEO?i._videoSSRC:i._audioSSRC;r&&Px.subscribe(this.store.sessionId,{succ:e,ec:t,video:n===QP.VIDEO,audio:n===QP.AUDIO,peerid:i.uid,subscribeRequestid:n===QP.VIDEO?i._videoSSRC:i._audioSSRC,p2pid:this.store.p2pId,eventElapse:iG.measureFromSubscribeStart(this.store.clientId,r)})}reset(){mw.debug("P2PChannel.reset"),this.mutex=new Qx("P2PChannel-mutex"),this.connection&&(this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0),this.statsUploader.stopUploadUplinkStats(),this.statsUploader.stopUploadDownlinkStats(),this.statsUploader.stopUploadTransportStats(),this.unbindLocalTrackEvents(),this.unbindAllRemoteTrackEvents(),this.localTrackMap.clear(),this.remoteUserMap.clear(),this.statsCollector.removeRemoteStats(),this.statsCollector.removeLocalStats(),this.iceFailedCount=0,this.dtlsFailedCount=0,this.pendingLocalTracks=[],this.pendingRemoteTracks=[],this.state=FP.Disconnected}getStats(){var e;return null===(e=this.connection)||void 0===e?void 0:e.getStats()}getRemoteVideoIsReady(e){var t;return(null===(t=this.connection)||void 0===t?void 0:t.getRemoteVideoIsReady(e))||!1}getLocalAudioVolume(){const e=this.localTrackMap.get(xP.LocalAudioTrack);if(e)return e.track.getVolumeLevel()}getLocalVideoSize(){const e=this.localTrackMap.get(xP.LocalVideoTrack);if(e)return{width:e.track._videoWidth||0,height:e.track._videoHeight||0}}getEncoderConfig(e){const t=this.localTrackMap.get(e);return t&&t.track instanceof WJ||t&&t.track instanceof JF?t.track._encoderConfig:void 0}getLocalMedia(e){return this.localTrackMap.get(e)}hasLocalMedia(){return this.localTrackMap.size>0}hasRemoteMedia(e,t){if(!e)return this.remoteUserMap.size>0;const i=this.remoteUserMap.get(e);return!!i&&(!t||i.has(t))}async hasRemoteMediaWithLock(e,t){if(!e)return this.remoteUserMap.size>0;const i=this.remoteUserMap.get(e);return!!i&&(!t||i.has(t))}getRemoteMedia(e){var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t.uid===e));return i?{audioTrack:i.audioTrack,audioSSRC:i._audioSSRC,videoTrack:i.videoTrack,videoSSRC:i._videoSSRC}:{}}getAudioLevels(){let e=Array.from(this.remoteUserMap.entries()).map((e=>{let[t]=e;return{uid:t.uid,level:t.audioTrack?100*t.audioTrack._source.getAccurateVolumeLevel():0}}));const t=this.localTrackMap.get(xP.LocalAudioTrack);return t&&e.push({level:100*t.track._source.getAccurateVolumeLevel(),uid:this.store.uid}),e=AL(e).call(e,((e,t)=>e.level-t.level)),e}async disconnectForReconnect(){this.connection&&(Yw("debug",this,"disconnectForReconnect"),mw.debug("P2PChannel.disconnectForReconnect closing P2PConnection"),this.state=FP.Reconnecting,this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0,0!==this.localTrackMap.size&&(Array.from(this.localTrackMap.entries()).forEach((e=>{let[t,{track:i}]=e;switch(t){case xP.LocalVideoTrack:i._hints.includes(vP.LOW_STREAM)?i.close():this.pendingLocalTracks.push(i);break;case xP.LocalAudioTrack:i instanceof zF?this.pendingLocalTracks=this.pendingLocalTracks.concat(i.trackList):this.pendingLocalTracks.push(i);case xP.LocalVideoLowTrack:}})),this.emit(GP.MediaReconnectStart,this.store.uid)),this.unbindLocalTrackEvents(),this.localTrackMap.clear(),0!==this.remoteUserMap.size&&Array.from(this.remoteUserMap.entries()).forEach((e=>{let[t,i]=e;Array.from(Ix(i).call(i)).forEach((e=>{this.setPendingRemoteMedia(t,e)})),this.emit(GP.MediaReconnectStart,t.uid)})),this.unbindAllRemoteTrackEvents(),this.remoteUserMap.clear(),this.statsUploader.stopUploadUplinkStats(),this.statsUploader.stopUploadDownlinkStats(),this.statsUploader.stopUploadTransportStats(),mw.debug("P2PChannel disconnected, waiting to reconnect."))}hasPendingRemoteMedia(e,t){for(const i of this.pendingRemoteTracks){const{user:n,kind:r}=i;if((e instanceof zJ?e.uid:e)===n.uid&&t===r)return!0}return!1}setPendingRemoteMedia(e,t){this.hasPendingRemoteMedia(e,t)||this.pendingRemoteTracks.push({user:e,kind:t})}async reEstablish(){if(this.connection)return this.connection.reEstablish()}getUplinkNetworkQuality(){if(!this.connection)return 0;const e=this.connection.getStats(),t=this.localTrackMap.get(xP.LocalVideoTrack),i=this.localTrackMap.get(xP.LocalAudioTrack),n=e.videoSend.find((e=>e.ssrc===(null==t?void 0:t.ssrcs[0].ssrcId))),r=e.audioSend.find((e=>e.ssrc===(null==i?void 0:i.ssrcs[0].ssrcId)));if(!n||!r)return 1;const o=PG(this,GP.NeedSignalRTT),s=n?n.rttMs:void 0,a=r?r.rttMs:void 0,c=s&&a?(s+a)/2:s||a,A=(c&&o?(c+o)/2:c||o)||0,d=100*e.sendPacketLossRate*.7/50+.3*A/1500,u=d<.17?1:d<.36?2:d<.59?3:d<.1?4:5,E=null==t?void 0:t.track;if(E&&E._encoderConfig&&-1===E._hints.indexOf(vP.SCREEN_TRACK)){const t=E._encoderConfig.bitrateMax,i=e.bitrate.actualEncoded;if(t&&i){const e=(1e3*t-i)/(1e3*t);return pb[e<.15?0:e<.3?1:e<.45?2:e<.6?3:4][u]}}return u}getDownlinkNetworkQuality(){if(!this.connection)return 0;const e=this.connection.getStats();let t=0;return Array.from(this.remoteUserMap.entries()).forEach((i=>{let[n]=i;const r=n._audioSSRC,o=n._videoSSRC,s=e.audioRecv.find((e=>e.ssrc===r)),a=e.videoRecv.find((e=>e.ssrc===o));if(!s&&!a)return void(t+=1);const c=PG(this,GP.NeedSignalRTT),A=e.rtt,d=(A&&c?(A+c)/2:A||c)||0,u=s?s.jitterMs:void 0,E=e.recvPacketLossRate;let l=.7*E*100/50+.3*d/1500;u&&(l=.6*E*100/50+.2*d/1500+.2*u/400),t+=l<.1?1:l<.17?2:l<.36?3:l<.59?4:5})),this.remoteUserMap.size>0?Math.round(t/this.remoteUserMap.size):t}async muteLocalTrack(e){return new Mm(((t,i)=>{this.handleMuteLocalTrack(e,t,i)}))}filterTobePublishedTracks(e,t,i){const n=[],r=XP(),o=this.getAllTracks();e=UG(e=e.filter((e=>-1===o.indexOf(e))));let s=!1,a=!1;for(const o of e){if(o instanceof WJ&&(this.localTrackMap.has(xP.LocalVideoTrack)||s?new pw(hw.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS).throw():(n.push({track:o,type:xP.LocalVideoTrack}),s=!0),t)){const e=this.getLowVideoTrack(o,i);n.push({track:e,type:xP.LocalVideoLowTrack})}if(o instanceof JF){const e=this.localTrackMap.get(xP.LocalAudioTrack);if(e){if(!(e.track instanceof zF))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(o._bypassWebAudio)throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");e.track.addAudioTrack(o),this.bindLocalAudioTrackEvents(o,!0)}else if(a){const e=n.find((e=>{let{type:t}=e;return t===xP.LocalAudioTrack}));if(!(e.track instanceof zF))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(o._bypassWebAudio)throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");e.track.addAudioTrack(o)}else{if(!r.webAudioMediaStreamDest||o instanceof zF||o._bypassWebAudio)n.push({track:o,type:xP.LocalAudioTrack});else{const e=new zF;e.addAudioTrack(o),n.push({track:e,type:xP.LocalAudioTrack})}a=!0}}}return n}filterTobeUnpublishedTracks(e){const t=[],i=this.getAllTracks();e=UG(e=e.filter((e=>-1!==i.indexOf(e))));for(const i of e){if(i instanceof JF){const e=this.localTrackMap.get(xP.LocalAudioTrack);if(!e)continue;e.track instanceof zF?(e.track.removeAudioTrack(i),this.unbindLocalAudioTrackEvents(i),0===e.track.trackList.length&&(t.push([xP.LocalAudioTrack,e]),e.track.close())):t.push([xP.LocalAudioTrack,e])}if(i instanceof WJ){const e=this.localTrackMap.get(xP.LocalVideoTrack);if(!e)continue;t.push([xP.LocalVideoTrack,e]);const i=this.localTrackMap.get(xP.LocalVideoLowTrack);i&&t.push([xP.LocalVideoLowTrack,i])}}return t}bindLocalTrackEvents(e){e.forEach((e=>{let{track:t,type:i}=e;switch(i){case xP.LocalVideoTrack:t.addListener(OP.GET_STATS,this.handleGetLocalVideoStats),t.addListener(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),t.addListener(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),t.addListener(OP.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),t.addListener(OP.SET_OPTIMIZATION_MODE,this.handleSetOptimizationMode),t.addListener(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack),t.addListener(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),t.addListener(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case xP.LocalAudioTrack:this.bindLocalAudioTrackEvents(t);case xP.LocalVideoLowTrack:}}))}bindLocalAudioTrackEvents(e,t){e instanceof zF?e.trackList.forEach((e=>{e.addListener(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.addListener(OP.GET_STATS,this.handleGetLocalAudioStats),e.addListener(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)})):(e.addListener(OP.GET_STATS,this.handleGetLocalAudioStats),e.addListener(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.addListener(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack),t||e.addListener(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack))}unbindLocalTrackEvents(e){e||(e=Array.from(this.localTrackMap.entries()).map((e=>{let[t,{track:i}]=e;return{track:i,type:t}}))),e.forEach((e=>{let{track:t,type:i}=e;switch(i){case xP.LocalVideoTrack:t.off(OP.GET_STATS,this.handleGetLocalVideoStats),t.off(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),t.off(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),t.off(OP.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),t.off(OP.SET_OPTIMIZATION_MODE,this.handleSetOptimizationMode),t.off(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack),t.off(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),t.off(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case xP.LocalAudioTrack:this.unbindLocalAudioTrackEvents(t);case xP.LocalVideoLowTrack:}}))}unbindLocalAudioTrackEvents(e){e instanceof zF?e.trackList.forEach((e=>{e.off(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.off(OP.GET_STATS,this.handleGetLocalAudioStats),e.off(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)})):(e.off(OP.GET_STATS,this.handleGetLocalAudioStats),e.off(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.off(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack),e.off(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack))}bindRemoteTrackEvents(e,t){t instanceof NZ&&t.addListener(OP.GET_STATS,(t=>{t(this.handleGetRemoteVideoStats(e))})),t instanceof yZ&&t.addListener(OP.GET_STATS,(t=>{t(this.handleGetRemoteAudioStats(e))}))}unbindRemoteTrackEvents(e){e&&e.removeAllListeners(OP.GET_STATS)}unbindAllRemoteTrackEvents(){Array.from(this.remoteUserMap.entries()).forEach((e=>{let[t,i]=e;i.has(QP.AUDIO)&&this.unbindRemoteTrackEvents(t._audioTrack),i.has(QP.VIDEO)&&this.unbindRemoteTrackEvents(t._videoTrack)}))}createGatewayPublishMessage(e,t){return e.map(((e,i)=>{let n,r,{track:o,type:s}=e;switch(s){case xP.LocalAudioTrack:n=TP.Audio,r={dtx:o instanceof qF&&o._config.DTX,hq:!1,lq:!1,stereo:!1,speech:!1};break;case xP.LocalVideoTrack:n=o._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High,r=MZ(MZ({},hG(o)),{},{codec:this.store.codec});break;case xP.LocalVideoLowTrack:n=TP.Low,r=MZ(MZ({},hG(o)),{},{codec:this.store.codec})}return{stream_type:n,attributes:r,ssrcs:t[i]}}))}createGatewayUnpublishMessage(e){return e.map((e=>{let t,[i,{track:n,ssrcs:r,id:o}]=e;switch(i){case xP.LocalVideoTrack:t=n._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High;break;case xP.LocalAudioTrack:t=TP.Audio;break;case xP.LocalVideoLowTrack:t=TP.Low}return{stream_type:t,ssrcs:r,mid:o}}))}assignLocalTracks(e,t){e.forEach(((e,i)=>{let{track:n,type:r}=e;this.localTrackMap.set(r,{track:n,id:t[i].id,ssrcs:t[i].localSSRC})}))}withdrawLocalTracks(e){e.forEach((e=>{let[t]=e;this.localTrackMap.delete(t)}))}async waitTillConnected(){return new Mm(((e,t)=>{switch(this.state){case FP.New:case FP.Reconnecting:{const i=(n,r)=>r===FP.Disconnected?(this.off(GP.StateChange,i),void t(new pw(hw.UNEXPECTED_ERROR,"PeerConnection already disconnected."))):r===FP.Connected?(this.off(GP.StateChange,i),void e(void 0)):void 0;this.on(GP.StateChange,i);break}case FP.Connected:e(void 0);break;case FP.Disconnected:t(new pw(hw.UNEXPECTED_ERROR,"PeerConnection already disconnected."))}}))}bindConnectionEvents(e){e.onConnectionStateChange=async t=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onConnectionStateChange(").concat(t,")")),Fw("info",this,"connectionStateChange",t),this.emit(GP.PeerConnectionStateChange,t),"connected"!==t||this.store.keyMetrics.peerConnectionEnd||this.store.peerConnectionEnd(),"failed"===t&&("failed"===e.iceConnectionState?(setTimeout((()=>this.emit(GP.P2PLost)),0),this.iceFailedCount+=1,await SG(Iw(this.iceFailedCount,_w)),this.emit(GP.RequestRestartICE)):await this.requestReconnect())},e.onICEConnectionStateChange=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onICEConnectionStateChange(").concat(e,")")),Fw("info",this,"iceConnectionStateChange",e),Px.reportApiInvoke(this.store.sessionId,{name:"ICEConnectionStateChange",options:e,tag:bL.TRACER}).onSuccess(),this.emit(GP.IceConnectionStateChange,e)},e.onICETransportStateChange=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onICETransportStateChange(").concat(e,")")),Fw("info",this,"ICETransportStateChange",e)},e.onDTLSTransportStateChange=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportStateChange(").concat(e,")")),Fw("info",this,"DTLSTransportStateChange",e)},e.onDTLSTransportError=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportError(").concat(e,")")),Fw("info",this,"DTLSTransportError",e)},e.onFirstAudioDecoded=e=>{var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t._audioSSRC===e));var n;i&&(null===(n=i.audioTrack)||void 0===n||n.emit(wP.FIRST_FRAME_DECODED),Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_AUDIO_DECODE,yL.FIRST_AUDIO_DECODE,{peer:i._uintid,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId}))},e.onFirstAudioReceived=e=>{var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t._audioSSRC===e));i&&Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_AUDIO_RECEIVED,yL.FIRST_AUDIO_RECEIVED,{peer:i._uintid,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId})},e.onFirstVideoDecoded=(e,t,i)=>{var n;const r=Array.from(Ix(n=this.remoteUserMap).call(n)).find((t=>t._videoSSRC===e));r&&Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_VIDEO_DECODE,yL.FIRST_VIDEO_DECODE,{peer:r._uintid,videowidth:t,videoheight:i,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId})},e.onFirstVideoReceived=e=>{var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t._videoSSRC===e));i&&Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_VIDEO_RECEIVED,yL.FIRST_VIDEO_RECEIVED,{peer:i._uintid,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId})},e.onSelectedLocalCandidateChanged=(e,t)=>{const i="relay"===e.candidateType,n="relay"===t.candidateType;"unknown"!==t.candidateType&&i===n||this.emit(GP.ConnectionTypeChange,i),mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.SelectedLocalCandidateChanged(").concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e)),")")),Fw("info",this,"SelectedLocalCandidateChanged","".concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e))))},e.onSelectedRemoteCandidateChanged=(e,t)=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.SelectedRemoteCandidateChanged(").concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e)),")")),Fw("info",this,"SelectedRemoteCandidateChanged","".concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e))))}}unbindConnectionEvents(e){e.onConnectionStateChange=void 0,e.onICEConnectionStateChange=void 0,e.onICETransportStateChange=void 0,e.onDTLSTransportStateChange=void 0,e.onDTLSTransportError=void 0,e.onFirstAudioDecoded=void 0,e.onFirstAudioReceived=void 0,e.onFirstVideoDecoded=void 0,e.onFirstVideoReceived=void 0,e.onSelectedLocalCandidateChanged=void 0,e.onSelectedRemoteCandidateChanged=void 0}filterTobeMutedTracks(e){const t=[];if(-1===this.getAllTracks().indexOf(e))return t;const i=this.localTrackMap.get(xP.LocalAudioTrack);if(e instanceof JF&&(null==i?void 0:i.track)instanceof zF)return i.track.isActive||t.push([xP.LocalAudioTrack,i]),t;const n=Array.from(this.localTrackMap.entries()).find((t=>{let[,{track:i}]=t;return e===i}));if(n&&(t.push(n),n[0]===xP.LocalVideoTrack)){const e=this.localTrackMap.get(xP.LocalVideoLowTrack);e&&t.push([xP.LocalVideoLowTrack,e])}return t}filterTobeUnmutedTracks(e){const t=[],i=this.localTrackMap.get(xP.LocalAudioTrack);if(e instanceof JF&&(null==i?void 0:i.track)instanceof zF)return i.track.isActive&&t.push([xP.LocalAudioTrack,i]),t;const n=Array.from(this.localTrackMap.entries()).find((t=>{let[,{track:i}]=t;return e===i}));if(n)if(n[0]===xP.LocalVideoTrack){t.push(n);const e=this.localTrackMap.get(xP.LocalVideoLowTrack);e&&t.push([xP.LocalVideoLowTrack,e])}else t.push(n);return t}createMuteMessage(e){return e.map((e=>{let t,[i,{track:n,ssrcs:r,id:o}]=e;switch(i){case xP.LocalAudioTrack:t=TP.Audio;break;case xP.LocalVideoTrack:t=n._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High;break;case xP.LocalVideoLowTrack:t=TP.Low}return{stream_type:t,ssrcs:r,mid:o}}))}createUnmuteMessage(e){return e.map((e=>{let t,[i,{track:n,ssrcs:r,id:o}]=e;switch(i){case xP.LocalAudioTrack:t=TP.Audio;break;case xP.LocalVideoTrack:t=n._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High;break;case xP.LocalVideoLowTrack:t=TP.Low}return{stream_type:t,ssrcs:r,mid:o}}))}filterTobeUnSubscribedTracks(e,t){const i=[],n=this.remoteUserMap.get(e);if(!n)return i;if(t){const r=n.get(t);if(!r)return i;i.push([e,{kind:t,id:r}])}else Array.from(n.entries()).forEach((t=>{let[n,r]=t;i.push([e,{kind:n,id:r}])}));return i}createUnsubscribeMessage(e){const t=[];return e.forEach((e=>{let[i,{kind:n,id:r}]=e;switch(n){case QP.VIDEO:return void(i._videoSSRC&&t.push({stream_type:QP.VIDEO,ssrcId:i._videoSSRC}));case QP.AUDIO:return void(i._audioSSRC&&t.push({stream_type:QP.AUDIO,ssrcId:i._audioSSRC}))}})),t}createUnsubscribeAllMessage(e){const t=new Map;return e.forEach((e=>{let[i,{kind:n}]=e;if(t.has(i)){let e=t.get(i);n===QP.VIDEO?e|=SP.Video:e|=SP.Audio,t.set(i,e)}else n===QP.VIDEO?t.set(i,SP.Video):t.set(i,SP.Audio)})),{users:Array.from(t.entries()).map((e=>{let[t,i]=e;return{stream_id:t.uid,stream_type:i}}))}}withdrawRemoteTracks(e){e.forEach((e=>{let[t,{kind:i}]=e;const n=this.remoteUserMap.get(t);n&&(n.delete(i),0===Array.from(n.entries()).length&&this.remoteUserMap.delete(t))}))}async updateBitrateLimit(e){const t=this.localTrackMap.get(xP.LocalVideoTrack),i=this.localTrackMap.get(xP.LocalVideoLowTrack);t&&await t.track.setBitrateLimit(e.uplink),i&&e.low_stream_uplink&&await i.track.setBitrateLimit({max_bitrate:e.low_stream_uplink.bitrate,min_bitrate:e.low_stream_uplink.bitrate||0})}isP2PDisconnected(){return!this.connection||"connected"!==this.connection.peerConnectionState}mapPubResToRemoteConfig(e,t){return e.map(((e,i)=>{var n;let{stream_type:r}=e;return null===(n=t.find((e=>{let{stream_type:t}=e;return r===t})))||void 0===n?void 0:n.attributes}))}async tryToUnmuteAudio(e){for(let i=0;i<e.length;i++)if(e[i]instanceof JF){var t;const n=this.filterTobeUnmutedTracks(e[i]);if(0===n.length)continue;await(null===(t=this.connection)||void 0===t?void 0:t.unmuteLocal(n.map((e=>{let[,{id:t}]=e;return t}))));const r=this.createUnmuteMessage(n);return void await LG(this,GP.RequestUnmuteLocal,r)}}bindStatsUploaderEvents(){this.statsUploader.requestStats=()=>this.getStats(),this.statsUploader.requestLocalMedia=()=>Array.from(this.localTrackMap.entries()),this.statsUploader.requestRemoteMedia=()=>Array.from(this.remoteUserMap.entries()),this.statsUploader.requestVideoIsReady=e=>{var t;return!(null===(t=this.connection)||void 0===t||!t.getRemoteVideoIsReady(e))},this.statsUploader.requestUpload=(e,t)=>this.emit(GP.RequestUploadStats,e,t),this.statsUploader.requestAllTracks=()=>this.getAllTracks()}unbindStatsUploaderEvents(){this.statsUploader.requestStats=void 0,this.statsUploader.requestLocalMedia=void 0,this.statsUploader.requestRemoteMedia=void 0,this.statsUploader.requestVideoIsReady=void 0}async requestReconnect(){this.dtlsFailedCount+=1,await SG(Iw(this.dtlsFailedCount,_w)),this.emit(GP.RequestReconnect)}async reconnectP2P(){const e=Array.from(this.localTrackMap.entries()),t=this.createGatewayUnpublishMessage(e);Array.from(this.remoteUserMap.entries()),t.length>0&&await bG(this,GP.RequestUnpublishForReconnectPC,t),this.disconnectForReconnect(),this.emit(GP.RequestReconnectPC)}canPublishLowStream(){return this.localTrackMap.has(xP.LocalVideoTrack)||this.pendingLocalTracks.some((e=>e instanceof WJ))}throwIfTrackTypeNotMatch(e){if(e.filter((e=>e instanceof WJ)).length>1)throw new pw(hw.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(e.filter((e=>e instanceof JF)).length>1&&(e.some((e=>e instanceof JF&&e._bypassWebAudio))||!XP().webAudioMediaStreamDest))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode");for(const t of e){if(t instanceof WJ&&this.pendingLocalTracks.some((e=>e instanceof WJ)))throw new pw(hw.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(t instanceof JF&&this.pendingLocalTracks.some((e=>e instanceof JF))&&(!XP().webAudioMediaStreamDest||t._bypassWebAudio||this.pendingLocalTracks.some((e=>e instanceof JF&&e._bypassWebAudio))))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode")}}getLowVideoTrack(e,t){const i=XP().supportDualStreamEncoding,n=MZ(MZ({},{width:160,height:120,framerate:15,bitrate:50}),t);let r;r=i?e._mediaStreamTrack.clone():function(e,t){let i=document.createElement("video"),n=document.createElement("canvas");i.setAttribute("style","display:none"),n.setAttribute("style","display:none"),i.setAttribute("muted",""),i.muted=!0,i.setAttribute("autoplay",""),i.autoplay=!0,i.setAttribute("playsinline",""),n.width=lG(t.width),n.height=lG(t.height);const r=lG(t.framerate||15);document.body.append(i),document.body.append(n);let o=e._mediaStreamTrack;i.srcObject=new MediaStream([o]),i.play();const s=n.getContext("2d");if(!s)throw new pw(hw.UNEXPECTED_ERROR,"can not get canvas context");const a=XP(),c=n.captureStream(a.supportRequestFrame?0:r).getVideoTracks()[0],A=Xx((()=>(()=>{if(i.paused&&i.play(),i.videoHeight>2&&i.videoWidth>2){const e=i.videoWidth,t=i.videoHeight/e,r=n.width*t;Math.abs(r-n.height)>=2&&(mw.debug("adjust low stream resolution","".concat(n.width,"x").concat(n.height," -> ").concat(n.width,"x").concat(r)),n.height=r)}s.drawImage(i,0,0,n.width,n.height),c.requestFrame&&c.requestFrame(),o!==e._mediaStreamTrack&&(o=e._mediaStreamTrack,i.srcObject=new MediaStream([o]))})()),r),d=c.stop;return c.stop=()=>{d.call(c),A(),i.remove(),n.width=0,n.remove(),n=null,i=null,mw.debug("clean low stream renderer")},c}(e,n);const o=new WJ(r,MZ(MZ({},i&&{scaleResolutionDownBy:fG(n,e)}),{},{frameRate:n.framerate,bitrateMax:n.bitrate,bitrateMin:n.bitrate}));return o._hints.push(vP.LOW_STREAM),o}async globalLock(){return this.mutex.lock("From P2PChannel.globalLock")}}).prototype,"startP2PConnection",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"startP2PConnection"),PZ.prototype),tx(PZ.prototype,"connect",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"connect"),PZ.prototype),tx(PZ.prototype,"unpublish",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unpublish"),PZ.prototype),tx(PZ.prototype,"unpublishLowStream",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unpublishLowStream"),PZ.prototype),tx(PZ.prototype,"subscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"subscribe"),PZ.prototype),tx(PZ.prototype,"massSubscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"massSubscribe"),PZ.prototype),tx(PZ.prototype,"unsubscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unsubscribe"),PZ.prototype),tx(PZ.prototype,"massUnsubscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"massUnsubscribe"),PZ.prototype),tx(PZ.prototype,"muteRemote",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"muteRemote"),PZ.prototype),tx(PZ.prototype,"unmuteRemote",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unmuteRemote"),PZ.prototype),tx(PZ.prototype,"hasRemoteMediaWithLock",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"hasRemoteMediaWithLock"),PZ.prototype),tx(PZ.prototype,"disconnectForReconnect",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"disconnectForReconnect"),PZ.prototype),tx(PZ.prototype,"reEstablish",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"reEstablish"),PZ.prototype),tx(PZ.prototype,"updateBitrateLimit",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"updateBitrateLimit"),PZ.prototype),LZ=PZ))||LZ;function QZ(e,t,i){const n=e[t];if("function"!=typeof n)throw new Error("Cannot use mutex on object property.");return i.value=async function(){const e=this.mutex,i=await e.lock("From P2PChannel.".concat(t));try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return await n.apply(this,o)}finally{i()}},i}function xZ(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var FZ,GZ="function"==typeof Symbol&&Symbol.observable||"@@observable",jZ=function(){return Math.random().toString(36).substring(7).split("").join(".")},YZ={INIT:"@@redux/INIT"+jZ(),REPLACE:"@@redux/REPLACE"+jZ(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+jZ()}};function HZ(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function KZ(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(xZ(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(xZ(1));return i(KZ)(e,t)}if("function"!=typeof e)throw new Error(xZ(2));var r=e,o=t,s=[],a=s,c=!1;function A(){a===s&&(a=s.slice())}function d(){if(c)throw new Error(xZ(3));return o}function u(e){if("function"!=typeof e)throw new Error(xZ(4));if(c)throw new Error(xZ(5));var t=!0;return A(),a.push(e),function(){if(t){if(c)throw new Error(xZ(6));t=!1,A();var i=a.indexOf(e);a.splice(i,1),s=null}}}function E(e){if(!HZ(e))throw new Error(xZ(7));if(void 0===e.type)throw new Error(xZ(8));if(c)throw new Error(xZ(9));try{c=!0,o=r(o,e)}finally{c=!1}for(var t=s=a,i=0;i<t.length;i++)(0,t[i])();return e}function l(e){if("function"!=typeof e)throw new Error(xZ(10));r=e,E({type:YZ.REPLACE})}function h(){var e,t=u;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(xZ(11));function i(){e.next&&e.next(d())}return i(),{unsubscribe:t(i)}}})[GZ]=function(){return this},e}return E({type:YZ.INIT}),(n={dispatch:E,subscribe:u,getState:d,replaceReducer:l})[GZ]=h,n}function WZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function JZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?WZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):WZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}!function(e){e.SET_SESSION_ID="SET_SESSION_ID",e.SET_P2P_ID="SET_P2P_id",e.SET_UID="SET_UID",e.SET_PUB_ID="SET_PUB_ID",e.KEY_METRIC_CLIENT_CREATED="KEY_METRIC_CLIENT_CREATED",e.KEY_METRIC_JOIN_START="KEY_METRIC_JOIN_START",e.AVOID_JOIN_START="AVOID_JOIN_START",e.KEY_METRIC_JOIN_END="KEY_METRIC_JOIN_END",e.KEY_METRIC_REQUEST_AP_START="KEY_METRIC_REQUEST_AP_START",e.KEY_METRIC_REQUEST_AP_END="KEY_METRIC_REQUEST_AP_END",e.KEY_METRIC_JOIN_GATEWAY_START="KEY_METRIC_JOIN_GATEWAY_START",e.KEY_METRIC_JOIN_GATEWAY_END="KEY_METRIC_JOIN_GATEWAY_END",e.KEY_METRIC_PEER_CONNECTION_START="KEY_METRIC_PEER_CONNECTION_START",e.KEY_METRIC_PEER_CONNECTION_END="KEY_METRIC_PEER_CONNECTION_END",e.KEY_METRIC_PUBLISH="KEY_METRIC_PUBLISH",e.KEY_METRIC_SUBSCRIBE="KEY_METRIC_SUBSCRIBE"}(FZ||(FZ={}));class qZ{constructor(e,t,i,n){tD(this,"store",void 0),tD(this,"reducer",void 0);const r={codec:e,audioCodec:t,mode:i,clientId:n,sessionId:null,p2pId:0,pubId:0,subId:0,avoidJoinStart:0,keyMetrics:{publish:[],subscribe:[]}};this.reducer=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case FZ.SET_SESSION_ID:return JZ(JZ({},e),{},{sessionId:t.sessionId});case FZ.SET_P2P_ID:return JZ(JZ({},e),{},{p2pId:t.p2pId});case FZ.SET_UID:return JZ(JZ({},e),{},{uid:t.uid});case FZ.SET_PUB_ID:return JZ(JZ({},e),{},{pubId:t.pubId});case FZ.KEY_METRIC_CLIENT_CREATED:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{clientCreated:t.metric})});case FZ.KEY_METRIC_JOIN_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinStart:t.metric})});case FZ.AVOID_JOIN_START:return JZ(JZ({},e),{},{avoidJoinStart:t.avoidJoinStart});case FZ.KEY_METRIC_JOIN_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinEnd:t.metric})});case FZ.KEY_METRIC_REQUEST_AP_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{requestAPStart:t.metric})});case FZ.KEY_METRIC_REQUEST_AP_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{requestAPEnd:t.metric})});case FZ.KEY_METRIC_JOIN_GATEWAY_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinGatewayStart:t.metric})});case FZ.KEY_METRIC_JOIN_GATEWAY_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinGatewayEnd:t.metric})});case FZ.KEY_METRIC_PEER_CONNECTION_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{peerConnectionStart:t.metric})});case FZ.KEY_METRIC_PEER_CONNECTION_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{peerConnectionEnd:t.metric})});case FZ.KEY_METRIC_PUBLISH:{const i=e.keyMetrics.publish,n=i.findIndex((e=>e.trackId===t.metric.trackId));return-1!==n?(i[n]=JZ(JZ({},i[n]),t.metric),JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{publish:[...i]})})):JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{publish:[...e.keyMetrics.publish,t.metric]})})}case FZ.KEY_METRIC_SUBSCRIBE:{const i=e.keyMetrics.subscribe,n=i.findIndex((e=>e.userId===t.metric.userId&&e.type===t.metric.type));return-1!==n?(i[n]=JZ(JZ({},i[n]),t.metric),JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{subscribe:[...i]})})):JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{subscribe:[...e.keyMetrics.subscribe,t.metric]})})}default:return e}},this.store=KZ(this.reducer)}set sessionId(e){this.store.dispatch({type:FZ.SET_SESSION_ID,sessionId:e})}get sessionId(){return this.store.getState().sessionId}get codec(){return this.store.getState().codec}get audioCodec(){return this.store.getState().audioCodec}get clientId(){return this.store.getState().clientId}set p2pId(e){this.store.dispatch({type:FZ.SET_P2P_ID,p2pId:e})}get p2pId(){return this.store.getState().p2pId}set uid(e){this.store.dispatch({type:FZ.SET_UID,uid:e})}get uid(){return this.store.getState().uid}set pubId(e){this.store.dispatch({type:FZ.SET_PUB_ID,pubId:e})}get pubId(){return this.store.getState().pubId}clientCreated(){this.store.dispatch({type:FZ.KEY_METRIC_CLIENT_CREATED,metric:performance.now()})}joinStart(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_START,metric:performance.now()})}get avoidJoinStart(){return this.store.getState().avoidJoinStart}set avoidJoinStart(e){this.store.dispatch({type:FZ.AVOID_JOIN_START,avoidJoinStart:e})}joinEnd(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_END,metric:performance.now()})}requestAPStart(){this.store.dispatch({type:FZ.KEY_METRIC_REQUEST_AP_START,metric:performance.now()})}requestAPEnd(){this.store.dispatch({type:FZ.KEY_METRIC_REQUEST_AP_END,metric:performance.now()})}joinGatewayStart(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_GATEWAY_START,metric:performance.now()})}joinGatewayEnd(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_GATEWAY_END,metric:performance.now()})}peerConnectionStart(){this.store.dispatch({type:FZ.KEY_METRIC_PEER_CONNECTION_START,metric:performance.now()})}peerConnectionEnd(){this.store.dispatch({type:FZ.KEY_METRIC_PEER_CONNECTION_END,metric:performance.now()})}publish(e,t,i,n){this.store.dispatch({type:FZ.KEY_METRIC_PUBLISH,metric:JZ(JZ({trackId:e,type:t},i&&{publishStart:i}),n&&{publishEnd:n})})}subscribe(e,t,i,n,r){this.store.dispatch({type:FZ.KEY_METRIC_SUBSCRIBE,metric:JZ(JZ(JZ({userId:e,type:t},i&&{subscribeStart:i}),n&&{subscribeEnd:n}),r&&{firstFrame:r})})}massSubscribe(e,t,i,n){e.forEach((e=>{this.store.dispatch({type:FZ.KEY_METRIC_SUBSCRIBE,metric:JZ(JZ(JZ({userId:e.userId,type:e.type},t&&{subscribeStart:t}),i&&{subscribeEnd:i}),n&&{firstFrame:n})})}))}get keyMetrics(){return this.store.getState().keyMetrics}}let XZ;const zZ=()=>void 0!==window.isSecureContext;class ZZ{constructor(e,t){tD(this,"time",void 0),tD(this,"sequence",void 0),tD(this,"name",void 0),tD(this,"elapse",void 0),this.name=e,this.time=performance.now(),this.sequence=KP[t].indexOf(e)}setElapse(e){this.elapse=e}}const $Z=new Map;class e${constructor(e,t){tD(this,"records",[]),tD(this,"_id",void 0),tD(this,"_group",void 0),tD(this,"_localTimeStamp",void 0),tD(this,"_performanceTimeStamp",void 0),this._id=e,this._group=t,this._localTimeStamp=Date.now(),this._performanceTimeStamp=performance.now()}checkPoint(e){const t=new ZZ(e,this._group);-1===t.sequence&&mw.warning("[".concat(this._id,"] check point record failed, cannot get the sequence")),this.records.push(t);const i=this.records.find((e=>e.sequence===t.sequence-1));i&&t.setElapse(t.time-i.time)}getRecord(e){return this.records.find((t=>t&&t.name===e))}resetRecords(){this.records.length=0}}var t$,i$,n$,r$,o$,s$,a$,c$,A$;function d$(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function u$(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d$(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let E$=(t$=Ww("AgoraRTCClient","store.clientId"),i$=bx({report:Px}),n$=bx(),r$=bx({report:Px}),o$=Lx(),s$=bx({report:Px}),a$=Lx({report:Px}),t$((tx((A$=class extends Ew{get connectionState(){return this._gateway.state}get remoteUsers(){return this._users}get localTracks(){return this._p2pChannel.getAllTracks(!0)}get uid(){return this._uid}get channelName(){return this._channelName}get isStringUID(){return!!this._joinInfo&&!!this._joinInfo.stringUid}constructor(e){let t;if(super(),tD(this,"store",void 0),tD(this,"_uid",void 0),tD(this,"_channelName",void 0),tD(this,"_uintUid",void 0),tD(this,"_users",[]),tD(this,"_codec",void 0),tD(this,"_mode",void 0),tD(this,"_config",void 0),tD(this,"_clientId",void 0),tD(this,"_appId",void 0),tD(this,"_sessionId",null),tD(this,"_key",void 0),tD(this,"_joinInfo",void 0),tD(this,"_gateway",void 0),tD(this,"_statsCollector",void 0),tD(this,"_configDistribute",void 0),tD(this,"_leaveMutex",new Qx("client-leave")),tD(this,"_publishMutex",new Qx("client-publish")),tD(this,"_renewTokenMutex",new Qx("client-renewtoken")),tD(this,"_subscribeMutex",new Qx("client-subscribe")),tD(this,"_encryptionMode","none"),tD(this,"_encryptionSecret",null),tD(this,"_encryptionSalt",null),tD(this,"_proxyServer",void 0),tD(this,"_performanceRecorder",void 0),tD(this,"_turnServer",{servers:[],mode:"auto"}),tD(this,"_cloudProxyServerMode","disabled"),tD(this,"_isDualStreamEnabled",!1),tD(this,"_defaultStreamFallbackType",void 0),tD(this,"_lowStreamParameter",void 0),tD(this,"_streamFallbackTypeCacheMap",new Map),tD(this,"_remoteStreamTypeCacheMap",new Map),tD(this,"_axiosCancelSource",dw.CancelToken.source()),tD(this,"_audioVolumeIndicationInterval",void 0),tD(this,"_networkQualityInterval",void 0),tD(this,"_userOfflineTimeout",void 0),tD(this,"_streamRemovedTimeout",void 0),tD(this,"_injectStreamingClient",void 0),tD(this,"_liveTranscodeStreamingClient",void 0),tD(this,"_liveRawStreamingClient",void 0),tD(this,"_channelMediaRelayClient",void 0),tD(this,"_networkQualitySensitivity","normal"),tD(this,"_p2pChannel",void 0),tD(this,"_useLocalAccessPoint",!1),tD(this,"_joinAndNotLeaveYet",!1),tD(this,"_numberOfJoinCount",0),tD(this,"_remoteDefaultVideoStreamType",void 0),tD(this,"_handleLocalTrackEnable",((e,t,i)=>{this.publish(e,!1).then(t).catch(i)})),tD(this,"_handleLocalTrackDisable",((e,t,i)=>{this.unpublish(e).then(t).catch(i)})),tD(this,"_handleUserOnline",(e=>{this.isStringUID&&"string"!=typeof e.uid&&(mw.error("[".concat(this._clientId,"] StringUID is Mixed with UintUID")),xw("error",this,"StringUID is Mixed with UintUID"));const t=this._users.find((t=>t.uid===e.uid));if(t)t._trust_in_room_=!0;else{const t=new zJ(e.uid,e.uint_id||e.uid);this._users.push(t),mw.debug("[".concat(this._clientId,"] user online"),e.uid),Gw("info",this,"user-joined",{uid:e.uid}),this.emit(FL.USER_JOINED,t)}})),tD(this,"_handleUserOffline",(e=>{const t=this._users.find((t=>t.uid===e.uid));t&&(this._handleRemoveStream(e),MG(this._users,t),this._remoteStreamTypeCacheMap.delete(t.uid),this._streamFallbackTypeCacheMap.delete(t.uid),mw.debug("[".concat(this._clientId,"] user offline"),e.uid,"reason:",e.reason),Gw("info",this,"user-left",{reason:e.reason,uid:e.uid}),this.emit(FL.USER_LEAVED,t,e.reason))})),tD(this,"_handleAddAudioOrVideoStream",((e,t,i,n,r,o,s)=>{const a=this._users.find((e=>e.uid===t));if(!a)return mw.error("[".concat(this._clientId,"] can not find target user!(on_add_stream)")),void Fw("error",["AgoraRTCGateway",this._clientId],"add_".concat(e,"_stream"),"can not find target user!");mw.debug("[".concat(this._clientId,"] stream added with uid ").concat(t,", type ").concat(e)),Fw("debug",["AgoraRTCGateway",this._clientId],"add_".concat(e,"_stream"),{uid:t,mediaType:e});const c="audio"===e?a.hasAudio:a.hasVideo;a._uintid||(a._uintid=r||t),a._trust_stream_added_state_=!0,"audio"===e?(a._audio_added_=!0,void 0!==i&&(a._audioSSRC=i),void 0!==n&&(a._cname=n),o&&(a._audioOrtc=o)):(a._video_added_=!0,void 0!==i&&(a._videoSSRC=i),void 0!==n&&(a._cname=n),void 0!==s&&(a._rtxSsrcId=s),o&&(a._videoOrtc=o)),("audio"===e?a.hasAudio:a.hasVideo)&&!c&&(mw.info("[".concat(this._clientId,"] remote user ").concat(a.uid," published ").concat(e)),xw("info",this,"remote user ".concat(a.uid," published ").concat(e)),Gw("info",this,"user-published",{uid:a.uid,mediaType:e}),this.emit(FL.USER_PUBLISHED,a,e)),"video"===e?Px.onGatewayStream(this._sessionId,NL.ON_ADD_VIDEO_STREAM,yL.ON_ADD_VIDEO_STREAM,{peer:r||t}):Px.onGatewayStream(this._sessionId,NL.ON_ADD_AUDIO_STREAM,yL.ON_ADD_AUDIO_STREAM,{peer:r||t}),this._p2pChannel.hasPendingRemoteMedia(a,e)&&this.subscribe(a,e).catch((e=>{mw.error("[".concat(this._clientId,"] resubscribe error"),e.toString()),xw("error",this,"resubscribe error: ".concat(e.toString()))}))})),tD(this,"_handleRemoveStream",(e=>{const t=this._users.find((t=>t.uid===e.uid));if(!t)return mw.warning("[".concat(this._clientId,"] can not find target user!(on_remove_stream)")),void Fw("warning",["AgoraRTCGateway",this._clientId],"remove_stream",{uid:e.uid,info:"can not find target user!"});mw.debug("[".concat(this._clientId,"] stream removed with uid ").concat(e.uid)),Fw("debug",["AgoraRTCGateway",this._clientId],"remove_stream",{uid:e.uid});let i=()=>{};t.hasAudio&&t.hasVideo?i=()=>{mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished audio track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"audio"}),this.emit(FL.USER_UNPUBLISHED,t,"audio"),mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished video track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"video"}),this.emit(FL.USER_UNPUBLISHED,t,"video")}:t.hasVideo?i=()=>{mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished video track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"video"}),this.emit(FL.USER_UNPUBLISHED,t,"video")}:t.hasAudio&&(i=()=>{mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished audio track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"audio"}),this.emit(FL.USER_UNPUBLISHED,t,"audio")}),t._trust_stream_added_state_=!0,t._audio_added_=!1,t._video_added_=!1,this._p2pChannel.unsubscribe(t).then((e=>{if(e)return this._gateway.unsubscribe(e,t.uid)})),t._audioSSRC=void 0,t._videoSSRC=void 0,t._audioOrtc=void 0,t._videoOrtc=void 0,t._rtxSsrcId=void 0,Px.onGatewayStream(this._sessionId,NL.ON_REMOVE_STREAM,yL.ON_REMOVE_STREAM,{peer:e.uint_id||e.uid}),i()})),tD(this,"_handleSetStreamLocalEnable",((e,t,i)=>{const n=this._users.find((e=>e.uid===t));if(!n)return mw.error("[".concat(this._clientId,"] can not find target user!(disable_local)")),void Fw("error",this,"disable_local_video","can not find target user!(disable_local)");mw.debug("[".concat(this._clientId,"] local ").concat(e," ").concat(i?"enabled":"disabled"," with uid ").concat(t)),Fw("debug",this,"disable_local_video","local ".concat(e," ").concat(i?"enabled":"disabled"," with uid ").concat(t));const r="audio"===e?n.hasAudio:n.hasVideo;if("audio"===e){n._trust_audio_enabled_state_=!0;const e=n._audio_enabled_;if(n._audio_enabled_=i,n._audio_enabled_===e)return;{const e=n._audio_enabled_?"enable-local-audio":"disable-local-audio";mw.debug("[".concat(this._clientId,"] user-info-updated, uid: ").concat(t,", msg: ").concat(e)),Kw("debug",this,"user-info-updated",{uid:t,msg:e}),this.emit(FL.USER_INFO_UPDATED,t,e)}}else{n._trust_video_enabled_state_=!0;const e=n._video_enabled_;if(n._video_enabled_=i,n._video_enabled_===e)return;{const e=n._video_enabled_?"enable-local-video":"disable-local-video";mw.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(t,", msg: ").concat(e)),Kw("debug",this,"user-info-updated",{uid:t,msg:e}),this.emit(FL.USER_INFO_UPDATED,t,e)}}const o="audio"===e?n.hasAudio:n.hasVideo;return r!==o?!r&&o?(mw.info("[".concat(this._clientId,"] remote user ").concat(t," published ").concat(e)),Gw("info",this,"user-published",{uid:t,mediaType:e}),void this.emit(FL.USER_PUBLISHED,n,e)):("video"===e&&n._videoTrack&&n._videoTrack._destroy(),"audio"===e&&n._audioTrack,this._p2pChannel.muteRemote(n,e),mw.info("[".concat(this._clientId,"] remote user ").concat(t," unpublished ").concat(e)),Gw("info",this,"user-unpublished",{uid:t,mediaType:e}),void this.emit(FL.USER_UNPUBLISHED,n,e)):void 0})),tD(this,"_handleMuteStream",((e,t,i)=>{mw.debug("[".concat(this._clientId,"] receive mute message"),e,t,i),Fw("debug",this,"mute_".concat(t),i);const n=this._users.find((t=>t.uid===e));if(!n)return mw.warning("[".concat(this._clientId,"] can not find remote user, ignore mute event, uid: ").concat(e)),void Fw("warning",this,"mute_".concat(t),"can not find remote user, ignore mute event, uid: ".concat(e));const r="audio"===t?n.hasAudio:n.hasVideo;if("audio"===t){n._trust_audio_mute_state_=!0;const t=n._audio_muted_;if(n._audio_muted_=i,n._audio_muted_===t)return;{const t=n._audio_muted_?"mute-audio":"unmute-audio";mw.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(e,", msg: ").concat(t)),Kw("debug",this,"user-info-updated",{uid:e,msg:t}),this.emit(FL.USER_INFO_UPDATED,e,t)}}else{n._trust_video_mute_state_=!0;const t=n._video_muted_;if(n._video_muted_=i,n._video_muted_===t)return;{const t=n._video_muted_?"mute-video":"unmute-video";mw.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(e,", msg: ").concat(t)),Kw("debug",this,"user-info-updated",{uid:e,msg:t}),this.emit(FL.USER_INFO_UPDATED,e,t)}}const o="audio"===t?n.hasAudio:n.hasVideo;return r!==o?!r&&o?(mw.info("[".concat(this._clientId,"] remote user ").concat(e," published ").concat(t)),Gw("info",this,"user-published",{uid:n.uid,mediaType:t}),void this.emit(FL.USER_PUBLISHED,n,t)):("video"===t&&n._videoTrack&&n._videoTrack._destroy(),"audio"===t&&n._audioTrack,this._p2pChannel.muteRemote(n,t),mw.info("[".concat(this._clientId,"] remote user ").concat(e," unpublished ").concat(t)),Gw("info",this,"user-unpublished",{uid:e,mediaType:t}),void this.emit(FL.USER_UNPUBLISHED,n,t)):void 0})),tD(this,"_handleP2PLost",(async e=>{if(mw.debug("[".concat(this._clientId,"] receive p2p lost"),e),Fw("debug",this,"p2p_lost",e),parseInt(e.p2pid,10)!==this.store.p2pId)return mw.warning("P2PLost stream not found",e),void Fw("warning",this,"p2p_lost","P2PLost stream not found, ".concat(e));await this._p2pChannel.requestReconnect()})),tD(this,"_handleTokenWillExpire",(()=>{mw.debug("[".concat(this._clientId,"] received message onTokenPrivilegeWillExpire")),Fw("debug",this,"token_privilege_will_expire"),this.emit(FL.ON_TOKEN_PRIVILEGE_WILL_EXPIRE)})),tD(this,"_handleBeforeUnload",(e=>{"beforeunload"===e.type&&void 0!==e.returnValue&&""!==e.returnValue||(this.leave(),mw.info("[".concat(this._clientId,"] auto leave onbeforeunload or pagehide")),jw("info",["window",this.store.clientId],Uy()?"beforeunload":"pagehide"))})),tD(this,"_handleUpdateNetworkQuality",(()=>{if("normal"===this._networkQualitySensitivity)return;if(navigator&&void 0!==navigator.onLine&&!navigator.onLine)return void this.emit(FL.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6});const e={downlinkNetworkQuality:0,uplinkNetworkQuality:0};e.uplinkNetworkQuality=this._p2pChannel.getUplinkNetworkQuality(),e.downlinkNetworkQuality=this._p2pChannel.getDownlinkNetworkQuality(),this.emit(FL.NETWORK_QUALITY,e)})),this._codec=e.codec,this._mode=e.mode,this._clientId=vG(5,"client-"),this.store=new qZ(e.codec,e.audioCodec,e.mode,this._clientId),this.store.clientCreated(),e.proxyServer&&this.setProxyServer(e.proxyServer,!0),e.turnServer&&this.setTurnServer(e.turnServer,!0),mw.info("[".concat(this._clientId,"] Initializing AgoraRTC client v").concat(Xw," build: ").concat(qw,", mode: ").concat(this._mode,", codec: ").concat(this._codec)),Kw("info",this,"constructor",{version:Xw,build:qw,mode:this._mode,codec:this._codec}),this._performanceRecorder=function(e,t){const i=new e$(e,"join");return $Z.set(e,i),i}(this._clientId),e.clientRoleOptions)try{eP(e.clientRoleOptions),t=Object.assign({},e.clientRoleOptions)}catch(e){mw.warning("[".concat(this._clientId,"] ").concat(e.toString())),xw("warning",this,e.toString())}this._statsCollector=new oG(this.store),this._statsCollector.onStatsException=(e,t,i)=>{mw.debug("[".concat(this._clientId,"] receive exception msg, code: ").concat(e,", msg: ").concat(t,", uid: ").concat(i)),Gw("debug",this,FL.EXCEPTION,{code:e,message:t,uid:i}),this.emit(FL.EXCEPTION,{code:e,msg:t,uid:i})},this._statsCollector.onUploadPublishDuration=(e,t,i,n)=>{const r=this._users.find((t=>t.uid===e));r&&Px.peerPublishStatus(this._sessionId,{subscribeElapse:n,audioPublishDuration:t,videoPublishDuration:i,peer:r._uintid})},this._gateway=new AW(this.store,{clientId:this._clientId,mode:this._mode,codec:this._codec,websocketRetryConfig:e.websocketRetryConfig||_w,httpRetryConfig:e.httpRetryConfig||_w,forceWaitGatewayResponse:void 0===e.forceWaitGatewayResponse||e.forceWaitGatewayResponse,statsCollector:this._statsCollector,role:e.role,clientRoleOptions:t}),this._config=e,this._configDistribute=new kW,this._p2pChannel=new VZ(this.store,this._statsCollector),this._handleP2PChannelEvents(),this._handleGatewayEvents()}async join(e,t,i,n,r){const o=++this._numberOfJoinCount;this._performanceRecorder.checkPoint("startJoin"),this.store.joinStart();const s="HTTPS"===(XZ||XZ||(XZ=(window.location.protocol.split(":")[0]||"").toUpperCase(),XZ)),a=zZ()?window.isSecureContext:"Browser Not Support";if(!zZ()&&!s||!window.isSecureContext){const e="The website must be running in a secure context (About secure context: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts ), otherwise the media collection will be restricted by the browser";mw.warning(e),Yw("warning",this,e)}const c=NG();"DISCONNECTED"===this.connectionState&&(this.store.avoidJoinStart=Math.round(Date.now()),mw.debug("[".concat(this._clientId,"] set avoidJoinStart to ").concat(this.store.avoidJoinStart)),Yw("debug",this,"join",void 0,"[".concat(this._clientId,"] set avoidJoinStart to ").concat(this.store.avoidJoinStart)));const A=Px.reportApiInvoke(c,{name:wL.JOIN,options:[e,t,i,n],states:{isHttps:s,isSecureContext:a},tag:bL.TRACER});try{if(!i&&null!==i)throw new pw(hw.INVALID_PARAMS,"Invalid token: ".concat(i,". If you don not use token, set it to null"));i&&lL(i,"token",1,2047),lL(e,"appid",1,2047),pL(t),n&&_L(n),r&&lL(r,"optionalInfo",1,2047)}catch(e){throw A.onError(e),e}if(mw.info("[".concat(this._clientId,"] start join channel ").concat(t,", join number: ").concat(o)),Kw("info",this,"join",{channel:t}),this._leaveMutex.isLocked&&(mw.debug("[".concat(this._clientId,"] join: waiting leave operation")),xw("debug",this,"join: waiting leave operation"),(await this._leaveMutex.lock())(),mw.debug("[".concat(this._clientId,"] join: continue")),xw("debug",this,"join: continue")),this._joinAndNotLeaveYet=!0,"DISCONNECTED"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already in connecting/connected state"));throw A.onError(e),e}this._sessionId||(this._sessionId=c,this.store.sessionId=this._sessionId),this._gateway.state="CONNECTING";const d=u$({clientId:this._clientId,appId:e,sid:this._sessionId,cname:t,uid:"string"!=typeof n?n:null,turnServer:this._turnServer,proxyServer:this._proxyServer,token:i||e,cloudProxyServer:this._cloudProxyServerMode,optionalInfo:r,useLocalAccessPoint:this._useLocalAccessPoint},void 0!==this._remoteDefaultVideoStreamType&&{defaultVideoStream:this._remoteDefaultVideoStreamType});if("string"==typeof n&&(d.stringUid=n,this._uintUid?(d.uid=this._uintUid,this._uintUid=void 0):d.uid=0),"none"!==this._encryptionMode&&this._encryptionSecret){if(d.aesmode=this._encryptionMode,d.aespassword=await(async e=>{const t=FG("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCMnXAHkKIGAM+x4N22gCI+Wyu\nSTM9ztkT3uYslTT2PuKmZfPzhH6kVdO7PTjGCOZnAsyb3oTtWat0KcxQ4jxvqQV+\nHvYl3iI1Yd4vl2c3qRMJPLtRDfNxa2Mcxgq7e9aEUibzdd0st+OJAy3tOj/Y0aVy\nxQiYDz3vqa6bP29adwIDAQAB"),i=await window.crypto.subtle.importKey("spki",t,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),n=sG(e),r=await window.crypto.subtle.encrypt({name:"RSA-OAEP"},i,n);return GG(new Uint8Array(r))})(this._encryptionSecret),!this._joinAndNotLeaveYet)throw new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this._encryptionSalt&&(d.aessalt=this._encryptionSalt)}this._startSession(this._sessionId,{channel:t,appId:e});const u=this._sessionId;setTimeout((()=>{"CONNECTING"===this.connectionState&&u===this._sessionId&&Px.joinChannelTimeout(this._sessionId,5)}),5e3);try{let n;const r=d.cloudProxyServer;if("443only"===r)d.proxyServer=cb("PROXY_SERVER_TYPE2");else if(["proxy3","proxy4","proxy5"].includes(r)){const e=cb("PROXY_SERVER_TYPE3");Array.isArray(e)?d.proxyServer=e[0]:d.proxyServer=e}if(Px.setProxyServer(d.proxyServer),mw.setProxyServer(d.proxyServer),Qw(d.proxyServer),this._performanceRecorder.checkPoint("startRequestAp"),this.store.requestAPStart(),d.stringUid&&!d.uid&&"normal"===r){await OW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w,!1);const e=await vW(d.stringUid,d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w);mw.debug("getUserAccount Success ".concat(d.stringUid," => ").concat(e)),xw("debug",this,"getUserAccount Success ".concat(d.stringUid," => ").concat(e)),d.uid=e,n=await SW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w)}else if(d.stringUid&&!d.uid){const e=await vW(d.stringUid,d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w);mw.debug("getUserAccount Success ".concat(d.stringUid," => ").concat(e)),xw("debug",this,"getUserAccount Success ".concat(d.stringUid," => ").concat(e)),d.uid=e,n=await OW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w,!0)}else n=await OW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w,!0);if(!this._joinAndNotLeaveYet)throw new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this.store.requestAPEnd(),this._performanceRecorder.checkPoint("startJoinGateway"),setTimeout((()=>{this._configDistribute.startGetConfigDistribute(d,this._axiosCancelSource.token),this._configDistribute.on(BP.UPDATE_BITRATE_LIMIT,(e=>{this._p2pChannel.updateBitrateLimit(e)}))}),0),this._key=i||e;const o=n.gatewayInfo;this._joinInfo=u$(u$({},d),{},{cid:o.cid,uid:d.uid?d.uid:o.uid,vid:o.vid,apResponse:o.res,uni_lbs_ip:o.uni_lbs_ip,gatewayAddrs:o.gatewayAddrs});const s=await this._joinGateway();if(!this._joinAndNotLeaveYet)throw new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));return A.onSuccess(s),this._appId=e,this._channelName=d.cname,this._uid=s,this.store.uid=s,setTimeout((()=>{this._networkQualityInterval&&window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=window.setInterval(this._handleUpdateNetworkQuality,2e3),window.addEventListener(Uy()?"beforeunload":"pagehide",this._handleBeforeUnload)}),0),mw.info("[".concat(this._clientId,"] Joining channel success: ").concat(t)),Kw("info",this,"join",t,"success"),setTimeout((()=>{cb("USE_NEW_LOG")?Jw():mw.startUpload()}),5e3),this._performanceRecorder.checkPoint("finishJoin"),this.store.joinEnd(),this,_b.includes(this)||_b.push(this),s}catch(e){const i=Array.isArray(e)?e[0]:e;throw mw.error("[".concat(this._clientId,"] join number: ").concat(o,", Joining channel failed, rollback"),i),Kw("error",this,"join",t,i.toString()),i.code!==hw.OPERATION_ABORTED&&this._numberOfJoinCount===o&&(this._gateway.state="DISCONNECTED",this._reset()),A.onError(i),i}}_joinGateway(){if(!this._joinInfo||!this._key)throw new pw(hw.INVALID_OPERATION);return this._gateway.join(this._joinInfo,this._key,!("disabled"!==this._joinInfo.cloudProxyServer||!cb("JOIN_WITH_FALLBACK_SIGNAL_PROXY"))).then((e=>e)).catch((e=>{if(e.code===hw.INIT_WEBSOCKET_TIMEOUT)return this._gateway.leave(!0,xL.FALLBACK);throw e})).then((e=>{if(e)return e;if(mw.info("[".concat(this._clientId,"] join timeout, fallback to proxy")),!this._joinInfo||!this._key)throw new pw(hw.INVALID_OPERATION);this._joinInfo.cloudProxyServer="fallback",this._cloudProxyServerMode="fallback";const t=cb("PROXY_SERVER_TYPE3");if(Array.isArray(t))if(this._joinInfo.apUrl){const e=new UK(this._joinInfo.apUrl).host.split("."),i=e.slice(e.length-2).join(".");t.forEach((e=>{this._joinInfo&&e.includes(i)&&(this._joinInfo.proxyServer=e)})),this._joinInfo.proxyServer||(this._joinInfo.proxyServer=t[0])}else this._joinInfo.proxyServer=t[0];else this._joinInfo.proxyServer=t;return mw.setProxyServer(this._joinInfo.proxyServer),Px.setProxyServer(this._joinInfo.proxyServer),Qw(this._joinInfo.proxyServer),Px.reportApiInvoke(this._sessionId,{name:wL.JOIN_FALLBACK_TO_PROXY,options:[this._joinInfo.proxyServer],tag:bL.TRACER}).onSuccess(),this.emit(FL.JOIN_FALLBACK_TO_PROXY,this._joinInfo.proxyServer),this._gateway.join(this._joinInfo,this._key)})).then((e=>e))}async leave(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.LEAVE,options:[],tag:bL.TRACER});mw.info("[".concat(this._clientId,"] Leaving channel")),Kw("info",this,"leave"),window.removeEventListener(Uy()?"beforeunload":"pagehide",this._handleBeforeUnload),this._reset(),function(e){const t=_b.indexOf(e);-1!==t&&_b.splice(t,1)}(this);const t=await this._leaveMutex.lock();if("DISCONNECTED"===this.connectionState)return mw.info("[".concat(this._clientId,"] Leaving channel repeated, success")),t(),e.onSuccess();await this._gateway.leave("CONNECTED"!==this.connectionState),mw.info("[".concat(this._clientId,"] Leaving channel success")),Kw("info",this,"leave",void 0,"success"),this._joinAndNotLeaveYet=!1,t(),e.onSuccess()}async publish(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Array.isArray(e)||(e=[e]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.PUBLISH,options:e.map((e=>e?Object(e).toString():"null")),tag:bL.TRACER});if(0===e.length){const e=new pw(hw.INVALID_PARAMS,"track list is empty");return i.onError(e),e.throw()}if("audience"===this._gateway.role){const e=new pw(hw.INVALID_OPERATION,"audience can not publish stream");return i.onError(e),e.throw()}for(const n of e){if(!(n instanceof Fx)){const e=new pw(hw.INVALID_PARAMS,"parameter is not local track");return i.onError(e),e.throw()}if(!n._enabled&&t){const e=new pw(hw.TRACK_IS_DISABLED,"can not publish a disabled track: ".concat(n.getTrackId()));return i.onError(e),e.throw()}}mw.info("[".concat(this._clientId,"] Publishing tracks, id ").concat(e.map((e=>"".concat(e.getTrackId()," "))))),Kw("info",this,"publish",e.map((e=>"".concat(e.getTrackId())))),await this._configDistribute.awaitConfigDistributeComplete(),t&&e.forEach((e=>{const t=this._configDistribute.getBitrateLimit();e instanceof WJ&&t&&e.setBitrateLimit(t.uplink)}));const n=await this._publishMutex.lock();try{await this._publishHighStream(e),i.onSuccess(e.map((e=>e.trackMediaType+":"+e.getTrackLabel())).toString()),mw.info("[".concat(this._clientId,"] Publish success, id ").concat(e.map((e=>"".concat(e.getTrackId()," "))))),Kw("info",this,"publish",e.map((e=>"".concat(e.getTrackId()))),"success")}catch(e){throw i.onError(e),mw.error("[".concat(this._clientId,"] publish error"),e.toString()),Kw("error",this,"publish",void 0,e.toString()),e}finally{n()}}async unpublish(e){if(!this._joinInfo||void 0===this._uid)throw new pw(hw.INVALID_OPERATION,"Can't unpublish stream, haven't joined yet!");e?Array.isArray(e)||(e=[e]):e=this._p2pChannel.getAllTracks(!0);const t=Px.reportApiInvoke(this._sessionId,{name:wL.UNPUBLISH,options:e.map((e=>e.getTrackId())),tag:bL.TRACER});mw.info("[".concat(this._clientId,"] Unpublish tracks, tracks ").concat(e.map((e=>"".concat(e.getTrackId()," ")))," ")),Kw("info",this,"unpublish",e.map((e=>"".concat(e.getTrackId()))));const i=await this._publishMutex.lock();try{const n=await this._p2pChannel.unpublish(e);n&&await this._gateway.unpublish(n,this._uid),mw.info("[".concat(this._clientId,"] Unpublish success,tracks ").concat(e.map((e=>"".concat(e.getTrackId()))))),Kw("info",this,"unpublish",e.map((e=>"".concat(e.getTrackId()))),"success"),t.onSuccess()}catch(e){throw t.onError(e),mw.error("[".concat(this._clientId,"] unpublish error"),e.toString()),Kw("error",this,"unpublish",void 0,e.toString()),e}finally{i&&i()}}async subscribe(e,t){uL(t,"mediaType",["audio","video"]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SUBSCRIBE,options:[e.uid,t],tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream, not joined");throw i.onError(e),e}if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));throw i.onError(e),e}if(!this._users.find((t=>t===e))){const t=new pw(hw.INVALID_REMOTE_USER,"user is not in the channel");throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", this user is not in the channel")),Kw("error",this,"subscribe",e.uid,"this user is not in the channel"),i.onError(t),t}if(!e.hasAudio&&!e.hasVideo){const t=new pw(hw.INVALID_REMOTE_USER,"user is not published");throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", user is not published")),Kw("error",this,"subscribe",e.uid,"this user is not published"),i.onError(t),t}if("audio"===t&&(!e.hasAudio||void 0===e._audioSSRC)||"video"===t&&(!e.hasVideo||void 0===e._videoSSRC)){const n=new pw(hw.REMOTE_USER_IS_NOT_PUBLISHED);throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid," with mediaType ").concat(t,", remote track is not published")),Kw("error",this,"subscribe",e.uid,"mediaType ".concat(t,", remote track is not published")),i.onError(n),n}const n="audio"===t?e._audioSSRC:e._videoSSRC,r="audio"===t?e._audioOrtc:e._videoOrtc,o="video"===t?e._rtxSsrcId:void 0,s={stream_type:"audio"===t?QP.AUDIO:QP.VIDEO,ssrcId:n},a=await this._subscribeMutex.lock();mw.info("[".concat(this._clientId,"] subscribe user ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"subscribe",{uid:e.uid,mediaType:t});try{if(await this._p2pChannel.hasRemoteMediaWithLock(e,t))await this._p2pChannel.unmuteRemote(e,t);else try{iG.markSubscribeStart(this.store.clientId,n),this.store.subscribe(e.uid,t,performance.now()),await this._p2pChannel.subscribe(e,t,n,o,r);try{await this._gateway.subscribe(e.uid,s,!0)}catch(i){throw await this._p2pChannel.unsubscribe(e,t),i}this.store.subscribe(e.uid,t,void 0,performance.now()),this._p2pChannel.reportSubscribeEvent(!0,null,e,t)}catch(i){throw this._p2pChannel.reportSubscribeEvent(!1,null==i?void 0:i.code,e,t),i}mw.info("[".concat(this._clientId,"] subscribe success user ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"subscribe",{uid:e.uid,mediaType:t},"success"),this._defaultStreamFallbackType&&this.setStreamFallbackOption(e.uid,this._defaultStreamFallbackType).catch((e=>{mw.warning("[".concat(this._clientId,"] auto set fallback failed"),e),xw("warning",this,"auto set fallback failed, ".concat(e.toString()))}));const c="audio"===t?e._audioTrack:e._videoTrack;if(!c){const e=new pw(hw.UNEXPECTED_ERROR,"can not find remote track in user object");return i.onError(e),e.throw()}return i.onSuccess(c.getTrackId()),c}catch(n){throw i.onError(n),mw.error("[".concat(this._clientId,"] subscribe user ").concat(e.uid," error"),n),Kw("error",this,"subscribe",{uid:e.uid,mediaType:t},n.toString()),n}finally{a()}}async massSubscribe(e){hL(e,"subscribeList");const t=Px.reportApiInvoke(this._sessionId,{name:wL.MASS_SUBSCRIBE,options:e.map((e=>{let{user:t,mediaType:i}=e;return[null==t?void 0:t.uid,i]})),tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream, not joined");throw t.onError(e),e}if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));throw t.onError(e),e}const i=performance.now(),n=new Map,r=await this._subscribeMutex.lock();mw.info("[".concat(this._clientId,"]start massSubscribe user ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i)})).join("; "))),Kw("info",this,"massSubscribe",e);const o=(e=[...e]).map((e=>{let{user:t,mediaType:i}=e;return{user:t,mediaType:i}})),s=await this._p2pChannel.globalLock();try{var a;for(let i=e.length-1;i>=0;i--){const r=e[i],{user:s,mediaType:a}=r;if(uL(a,"mediaType",["audio","video"]),!s){const e=new pw(hw.INVALID_PARAMS,"user property does not exist in subscribeList item");throw mw.error("[".concat(this._clientId,"] user property does not exist in subscribeList item")),t.onError(e),e}if(!this._users.find((e=>e===s))){const t=new pw(hw.INVALID_REMOTE_USER,"user is not in the channel");mw.error("[".concat(this._clientId,"] can not massSubscribe ").concat(s.uid,", this user is not in the channel")),Kw("error",this,"massSubscribe",s.uid,"this user is not in the channel"),o[i].error=t,e.splice(i,1);continue}if("audio"===a&&(!s.hasAudio||void 0===s._audioSSRC)||"video"===a&&(!s.hasVideo||void 0===s._videoSSRC)){const t=new pw(hw.REMOTE_USER_IS_NOT_PUBLISHED);mw.error("[".concat(this._clientId,"] can not subscribe ").concat(s.uid," with mediaType ").concat(a,", remote user is not published")),Kw("error",this,"subscribe",s.uid,"mediaType ".concat(a,", remote user is not published")),o[i].error=t,e.splice(i,1);continue}const c=SP.Video|SP.LwoVideo,A=n.get(s);if(A){if("video"===a?A&c:A&SP.Audio){e.splice(i,1),mw.warning("repeat massSubscribe user:".concat(s.uid,", mediaType:").concat(a," twice"));continue}n.set(s,A|("video"===a?c:SP.Audio))}else n.set(s,"video"===a?c:SP.Audio)}for(let t=e.length-1;t>=0;t--){const i=e[t],{user:r,mediaType:o}=i,s=SP.Video|SP.LwoVideo;if(this._p2pChannel.hasRemoteMedia(r,o)){await this._p2pChannel.unmuteRemoteNoLock(r,o);const i=n.get(r);n.set(r,"video"===o?i^s:i^SP.Audio),e.splice(t,1)}}this.store.massSubscribe(e.map((e=>({userId:e.user.uid,type:e.mediaType}))),i);const c=dE(a=Array.from(n.entries())).call(a,((e,t)=>{let[i,n]=t;if(0===n)return e;const r={stream_id:i.uid,stream_type:n};return n&SP.Audio&&(r.audio_ssrc=i._audioSSRC),n&SP.Video&&(r.video_ssrc=i._videoSSRC),e.push(r),e}),[]);try{e.length>0&&await this._p2pChannel.massSubscribeNoLock(e.map((e=>{let{user:t,mediaType:i}=e;return{user:t,mediaType:i,ssrcId:i===QP.VIDEO?t._videoSSRC:t._audioSSRC,rtxSsrcId:t._rtxSsrcId}})));const n=new Map;if(c.length>0){const e=await this._gateway.subscribeAll(c,!0);((null==e?void 0:e.users)||[]).forEach((e=>{let{stream_id:t,video_error_code:i,audio_error_code:r,error_code:o}=e;(i||r||o)&&n.set(t,{video_error_code:i,audio_error_code:r,error_code:o})}))}if(Array.from(n.entries()).length>0){const e=Array.from(n.entries()).map((e=>{let t,[i,n]=e;return n.error_code||n.video_error_code&&n.audio_error_code?t=void 0:n.video_error_code?t=QP.VIDEO:n.audio_error_code&&(t=QP.AUDIO),{user:this.remoteUsers.find((e=>e.uid===i)),mediaType:t}}));await this._p2pChannel.massUnsubscribeNoLock(e)}for(const e of o){const t=n.get(e.user.uid);if(t){const i=t.error_code||"audio"===e.mediaType&&t.audio_error_code||"video"===e.mediaType&&t.video_error_code;if(i){const t=xK(i);mw.error("user:".concat(e.user.uid," mediaType:").concat(e.mediaType," has massSubscribe error ").concat(t.desc)),e.error=new pw(hw.SUBSCRIBE_FAILED,"code ".concat(i,": ").concat(t.desc))}}e.error||("video"===e.mediaType?e.track=e.user.videoTrack:e.track=e.user.audioTrack)}return this.store.massSubscribe(o.filter((e=>!e.error)).map((e=>({userId:e.user.uid,type:e.mediaType}))),void 0,performance.now()),o.forEach((e=>{var t;Px.subscribe(this.store.sessionId,{succ:!!e.error,ec:(null===(t=e.error)||void 0===t?void 0:t.code)||null,video:e.mediaType===QP.VIDEO,audio:e.mediaType===QP.AUDIO,peerid:e.user.uid,subscribeRequestid:e.mediaType===QP.VIDEO?e.user._videoSSRC:e.user._audioSSRC,p2pid:this.store.p2pId,eventElapse:Math.floor(performance.now()-i)},!0)})),t.onSuccess(),mw.info("[".concat(this._clientId,"] massSubscribe success ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i)})).join("; "))),Kw("info",this,"massSubscribe",e,"success"),o}catch(i){throw await this._p2pChannel.massUnsubscribeNoLock(e),t.onError(i),i}}finally{s(),r()}}async unsubscribe(e,t){if(t&&uL(t,"mediaType",["audio","video"]),!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"Can't unsubscribe stream, haven't joined yet!");const i=Px.reportApiInvoke(this._sessionId,{name:wL.UNSUBSCRIBE,options:[e.uid,t],tag:bL.TRACER});if(!this._users.find((t=>t===e))){const n=new pw(hw.INVALID_REMOTE_USER,"user is not in the channel");throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", user is not in the channel")),Kw("error",this,"unsubscribe",{uid:e.uid,mediaType:t},"user is not in the channel"),i.onError(n),n}mw.info("[".concat(this._clientId,"] unsubscribe uid: ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"unsubscribe",{uid:e.uid,mediaType:t});try{const n=await this._p2pChannel.unsubscribe(e,t);n&&await this._gateway.unsubscribe(n,e.uid),mw.info("[".concat(this._clientId,"] unsubscribe success uid: ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"unsubscribe",{uid:e.uid,mediaType:t},"success"),i.onSuccess()}catch(n){if(n.code===hw.DISCONNECT_P2P)return mw.warning("disconnecting p2p, abort unsubscribe request."),void i.onSuccess();throw mw.error("[".concat(this._clientId,"] unsubscribe user ").concat(e.uid," error"),n.toString()),Kw("error",this,"unsubscribe",{uid:e.uid,mediaType:t},n.toString()),i.onError(n),n}}async massUnsubscribe(e){hL(e,"unsubscribeList");const t=Px.reportApiInvoke(this._sessionId,{name:wL.UNSUBSCRIBE,options:e.map((e=>{let{user:t,mediaType:i}=e;return{uid:null==t?void 0:t.uid,mediaType:i}})),tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"Can't unsubscribeAll stream, haven't joined yet!");throw t.onError(e),e}mw.info("[".concat(this._clientId,"] start massUnsubscribe ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i,";")})).join())),Kw("info",this,"massUnsubscribe",e),e=[...e];const i=new Map;for(let n=e.length-1;n>=0;n--){const{user:r,mediaType:o}=e[n];if(!r){const e=new pw(hw.INVALID_PARAMS,"user property does not exist in unsubscribeList item");throw mw.error("[".concat(this._clientId,"] user property does not exist in unsubscribeList item")),t.onError(e),e}if(uL(o,"mediaType",["video","audio",void 0]),!this._users.find((e=>e===r))){mw.warning("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not in the channel")),Kw("error",this,"unsubscribe",{uid:r.uid,mediaType:o},"user is not in the channel"),e.splice(n,1);continue}const s=SP.Video|SP.LwoVideo;if(i.has(r)){const t=i.get(r);let a;switch(o){case"video":a=t&s;break;case"audio":a=t&SP.Audio;break;default:a=t&(SP.Audio|s)}if(a){mw.warning("repeat massUnsubscribe user:".concat(r.uid,",mediaType:").concat(o," twice.")),e.splice(n,1);continue}o?"audio"===o?i.set(r,t|SP.Audio):"video"===o&&i.set(r,t|s):i.set(r,t|SP.Audio|s)}else o?"audio"===o?i.set(r,SP.Audio):"video"===o&&i.set(r,s):i.set(r,SP.Audio|s)}try{const i=await this._p2pChannel.massUnsubscribe(e);i&&await this._gateway.massUnsubscribe(i),mw.info("[".concat(this._clientId,"] massUnsubscribe success ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i,";")})).join())),Kw("info",this,"massUnsubscribe",e,"success"),t.onSuccess()}catch(i){if(i.code===hw.DISCONNECT_P2P)return mw.warning("disconnecting p2p, abort unsubscribe request."),void t.onSuccess();throw mw.error("[".concat(this._clientId,"] massUnsubscribe error"),i.toString()),Kw("error",this,"massUnsubscribe",e,i.toString()),t.onError(i),i}}setLowStreamParameter(e){!function(e){if(!e)throw new pw(hw.INVALID_PARAMS);IL(e.width)||EL(e.width,"streamParameter.width"),IL(e.height)||EL(e.height,"streamParameter.height"),IL(e.framerate)||EL(e.framerate,"streamParameter.framerate"),IL(e.bitrate)||EL(e.bitrate,"streamParameter.bitrate")}(e);const t=Px.reportApiInvoke(this._sessionId,{name:wL.SET_LOW_STREAM_PARAMETER,options:[e],tag:bL.TRACER});(!e.width&&e.height||e.width&&!e.height)&&(mw.warning("[".concat(this._clientId,"] The width and height parameters take effect only when both are set")),xw("warning",this,"The width and height parameters take effect only when both are set")),mw.info("[".concat(this._clientId,"] set low stream parameter to"),JSON.stringify(e)),Kw("info",this,"setLowStreamParameter",e);const i=this._configDistribute.getLowStreamConfigDistribute();i&&i.bitrate&&e.bitrate&&i.bitrate<e.bitrate&&(e.bitrate=i.bitrate),this._lowStreamParameter=e,t.onSuccess()}async enableDualStream(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.ENABLE_DUAL_STREAM,options:[],tag:bL.TRACER});if(!XP().supportDualStream){Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1});const t=new pw(hw.NOT_SUPPORTED,"Your browser is not support dual stream");throw e.onError(t),t}if(this._isDualStreamEnabled){const t=new pw(hw.INVALID_OPERATION,"Dual stream is already enabled");throw e.onError(t),t}if(this._p2pChannel.canPublishLowStream())try{await this._publishLowStream()}catch(t){throw Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1}),e.onError(t),t}this._isDualStreamEnabled=!0,Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!0}),mw.info("[".concat(this._clientId,"] enable dual stream")),Kw("info",this,"enableDualStream"),e.onSuccess()}async disableDualStream(){if(!this._isDualStreamEnabled)return;if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");const e=Px.reportApiInvoke(this._sessionId,{name:wL.DISABLE_DUAL_STREAM,options:[],tag:bL.TRACER});if(this._p2pChannel.getLocalMedia(xP.LocalVideoLowTrack))try{const e=await this._p2pChannel.unpublishLowStream();e&&await this._gateway.unpublish(e,this._joinInfo.stringUid||this._joinInfo.uid)}catch(t){throw Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!1}),e.onError(t),t}this._isDualStreamEnabled=!1,Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!0}),mw.info("[".concat(this._clientId,"] disable dual stream")),Kw("info",this,"disableDualStream"),e.onSuccess()}async setClientRole(e,t){!function(e){uL(e,"role",["audience","host"])}(e),t&&eP(t);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SET_CLIENT_ROLE,options:[e,t],tag:bL.TRACER});if("rtc"===this._mode){mw.warning("[".concat(this._clientId,"]rtc mode can not use setClientRole")),Kw("warning",this,"setClientRole",e,"rtc mode can not use setClientRole");const t=new pw(hw.INVALID_OPERATION,"rtc mode can not use setClientRole");return i.onError(t),t.throw()}if(t&&t.level&&"host"===e){const e=new pw(hw.INVALID_OPERATION,"host mode can not set audience latency level");return i.onError(e),e.throw()}try{if("audience"===e&&this._p2pChannel.hasLocalMedia()){const e=new pw(hw.INVALID_OPERATION,"can not set client role to audience when publishing stream");return i.onError(e),e.throw()}await this._gateway.setClientRole(e,t),mw.info("[".concat(this._clientId,"] set client role to ").concat(e,", level: ").concat(t&&t.level)),Kw("info",this,"setClientRole",{role:e,level:t&&t.level}),i.onSuccess()}catch(e){throw i.onError(e),e}}setProxyServer(e,t){if(lL(e,"proxyServer"),!t){if("DISCONNECTED"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"Set proxy server before join channel");if("disabled"!==this._cloudProxyServerMode||this._useLocalAccessPoint)throw new pw(hw.INVALID_OPERATION,"You have already set the proxy")}this._proxyServer=e,Px.setProxyServer(this._proxyServer),mw.setProxyServer(this._proxyServer),Qw(this._proxyServer),mw.info("[".concat(this._clientId,"] Set proxy server ").concat(t?"by initialize call":""," success.")),Kw("info",this,"setProxyServer",[...arguments],"success")}setTurnServer(e,t){if(Array.isArray(e)||(e=[e]),!t){if("DISCONNECTED"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"Set turn server before join channel");if("disabled"!==this._cloudProxyServerMode||this._useLocalAccessPoint)throw new pw(hw.INVALID_OPERATION,"You have already set the proxy")}if(ZL(e))return this._turnServer={servers:e,mode:"original-manual"},mw.info("[".concat(this._clientId,"] Set original turnserver ").concat(t?"by initialize call":""," success: ").concat(e.map((e=>e.urls)).join(","),".")),void Kw("info",this,"setOriginalTurnServer",[...arguments],"success");e.forEach((e=>$L(e))),this._turnServer={servers:e,mode:"manual"},mw.info("[".concat(this._clientId,"] Set turnserver ").concat(t?"by initialize call":""," success.")),Kw("info",this,"setTurnServer",[...arguments],"success")}startProxyServer(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.START_PROXY_SERVER,options:[],tag:bL.TRACER});if("DISCONNECTED"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"Start proxy server before join channel");throw t.onError(e),e}if(this._proxyServer||"manual"===this._turnServer.mode||this._useLocalAccessPoint){const e=new pw(hw.INVALID_OPERATION,"You have already set the proxy");throw t.onError(e),e}const i=[1,2,3,4,5];switch(void 0===e&&(e=1),e){case 1:this._cloudProxyServerMode="normal";break;case 2:this._cloudProxyServerMode="443only";break;case 3:this._cloudProxyServerMode="proxy3";break;case 4:this._cloudProxyServerMode="proxy4";break;case 5:this._cloudProxyServerMode="proxy5";break;default:{const e=new pw(hw.INVALID_PARAMS,"proxy server mode must be ".concat(i.join("|")));throw t.onError(e),e}}mw.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode),Kw("info",this,"startProxyServer",this._cloudProxyServerMode),t.onSuccess()}stopProxyServer(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.STOP_PROXY_SERVER,options:[],tag:bL.TRACER});if("DISCONNECTED"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"Stop proxy server after leave channel");Px.setProxyServer(),mw.setProxyServer(),Qw(),this._cloudProxyServerMode="disabled",mw.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode),Kw("info",this,"stopProxyServer",this._cloudProxyServerMode),this._proxyServer=void 0,this._turnServer={mode:"auto",servers:[]},e.onSuccess()}setLocalAccessPoints(e,t){if(hL(e,"serverList"),lL(t,"domain"),this._proxyServer||"disabled"!==this._cloudProxyServerMode)throw new pw(hw.INVALID_OPERATION,"set local access point failed, You have already set the cloud proxy");const i=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;e=e.map((e=>i.test(e)?"".concat(e.replace(/\./g,"-"),".").concat(t):e)),this._useLocalAccessPoint=!0,ab("WEBCS_DOMAIN",e),ab("WEBCS_DOMAIN_BACKUP_LIST",e),ab("GATEWAY_DOMAINS",[t]),ab("EVENT_REPORT_DOMAIN",e[0]),ab("EVENT_REPORT_BACKUP_DOMAIN",e[1]||e[0]),ab("LOG_UPLOAD_SERVER","".concat(e[0],":6444")),mw.info("set local access point success"),Kw("info",this,"setLocalAccessPoints")}async setRemoteDefaultVideoStreamType(e){if(uL(e,"streamType",[0,1]),this._remoteDefaultVideoStreamType=e,this._joinInfo)try{await this._gateway.setDefaultRemoteVideoStreamType(e),this._joinInfo.defaultVideoStream=this._remoteDefaultVideoStreamType}catch(e){throw mw.error("[".concat(this._clientId,"] set default remote video stream type error"),e.toString()),e}else mw.debug("haven't joined yet, cache remoteDefaultVideoStreamType ".concat(e))}async setRemoteVideoStreamType(e,t){uL(t,"streamType",[0,1]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SET_REMOTE_VIDEO_STREAM_TYPE,options:[e,t],tag:bL.TRACER});try{await this._gateway.setRemoteVideoStreamType(e,t),setTimeout((()=>{const t=this._users.find((t=>t.uid===e));t&&t.videoTrack&&t.videoTrack.updateMediaStreamTrackResolution()}),2e3)}catch(e){throw i.onError(e),mw.error("[".concat(this._clientId,"] set remote video stream type error"),e.toString()),Kw("error",this,"setRemoteVideoStreamType",void 0,e.toString()),e}mw.info("[".concat(this._clientId,"] set remote ").concat(e," video stream type to ").concat(t)),Kw("info",this,"setRemoteVideoStreamType",{uid:e,streamType:t}),this._remoteStreamTypeCacheMap.set(e,t),i.onSuccess()}async setStreamFallbackOption(e,t){uL(t,"fallbackType",[0,1,2]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SET_STREAM_FALLBACK_OPTION,options:["too long to show",t],tag:bL.TRACER});try{await this._gateway.setStreamFallbackOption(e,t)}catch(e){throw i.onError(e),mw.error("[".concat(this._clientId,"] set stream fallback option"),e.toString()),Kw("error",this,"setStreamFallbackOption",void 0,e.toString()),e}mw.info("[".concat(this._clientId,"] set remote ").concat(e," stream fallback type to ").concat(t)),Kw("info",this,"setStreamFallbackOption",{uid:e,fallbackType:t}),this._streamFallbackTypeCacheMap.set(e,t),i.onSuccess()}setEncryptionConfig(e,t,i){if(function(e){uL(e,"encryptionMode",["aes-128-xts","aes-256-xts","aes-128-ecb","sm4-128-ecb","aes-128-gcm","aes-256-gcm","aes-128-gcm2","aes-256-gcm2","none"])}(e),lL(t,"secret"),["aes-128-gcm2","aes-256-gcm2"].includes(e)){if(!i||!(i instanceof Uint8Array&&32===i.length))throw new pw(hw.INVALID_PARAMS,"salt must be an Uint8Array and exactly equal to 32 bytes")}else if(i)throw new pw(hw.INVALID_PARAMS,"current encrypt mode does not need salt");new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*,.<>?/:;'\"|{}\\[\\]])(?=.{8,})").test(t)||(mw.warning("The secret is not strong:\n      The secret must contain at least 1 lowercase alphabetical character,\n      The secret must contain at least 1 uppercase alphabetical character,\n      The secret must contain at least 1 numeric character,\n      The secret must contain at least one special character,\n      The secret must be eight characters or longer.\n      "),xw("warning",this,"The secret is not strong:\n      The secret must contain at least 1 lowercase alphabetical character,\n      The secret must contain at least 1 uppercase alphabetical character,\n      The secret must contain at least 1 numeric character,\n      The secret must contain at least one special character,\n      The secret must be eight characters or longer.\n      ")),this._encryptionMode=e,this._encryptionSecret=t,i&&(this._encryptionSalt=GG(i))}async renewToken(e){lL(e,"token",1,2047);const t=Px.reportApiInvoke(this._sessionId,{name:wL.RENEW_TOKEN,options:[e],tag:bL.TRACER});if(!this._key||!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"renewToken should not be called before user join");return t.onError(e),e.throw()}const i=this._key;this._key=e,this._joinInfo&&(this._joinInfo.token=e);const n=await this._renewTokenMutex.lock();try{if(cb("USE_NEW_TOKEN")){mw.debug("start renew token with ticket from unilbs"),Kw("debug",this,"renewToken","unilbs");const t=await wW(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||_w);mw.debug("[".concat(this._clientId,"] get ticket from unilbs success")),Kw("debug",this,"renewToken","unilbs","success"),await this._gateway.renewToken({token:e,ticket:t})}else mw.debug("start renew token without ticket"),Kw("debug",this,"renewToken"),await this._gateway.renewToken({token:e});mw.debug("[".concat(this._clientId,"] renewToken success")),Kw("debug",this,"renewToken",void 0,"success"),t.onSuccess()}catch(e){throw this._key=i,this._joinInfo.token=i,t.onError(e),mw.error("[".concat(this._clientId,"] renewToken failed"),e.toString()),Kw("error",this,"renewToken",void 0,e.toString()),e}finally{n()}}enableAudioVolumeIndicator(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.ENABLE_AUDIO_VOLUME_INDICATOR,options:[],tag:bL.TRACER});if(this._audioVolumeIndicationInterval)return mw.warning("you have already enabled audio volume indicator!"),Kw("warning",this,"enableAudioVolumeIndicator","you have already enabled audio volume indicator!"),e.onSuccess();this._audioVolumeIndicationInterval=window.setInterval((()=>{const e=this._p2pChannel.getAudioLevels();this.emit(FL.VOLUME_INDICATOR,e)}),cb("AUDIO_VOLUME_INDICATION_INTERVAL")||2e3),e.onSuccess()}getRTCStats(){const e=this._statsCollector.getRTCStats(),t=this._gateway.getInChannelInfo();return e.Duration=Math.round(t.duration/1e3),e}startLiveStreaming(e,t){const i=Px.reportApiInvoke(this._sessionId,{name:wL.START_LIVE_STREAMING,options:[e,t],tag:bL.TRACER});if(!t){if("h264"!==this._codec){const e=new pw(hw.LIVE_STREAMING_INVALID_RAW_STREAM,"raw streaming is only support h264");return i.onError(e),Mm.reject(e)}if(!this._p2pChannel.hasLocalMedia()){const e=new pw(hw.LIVE_STREAMING_INVALID_RAW_STREAM,"can not find stream to raw streaming");return i.onError(e),Mm.reject(e)}}if(this._liveRawStreamingClient&&this._liveRawStreamingClient.hasUrl(e)||this._liveTranscodeStreamingClient&&this._liveTranscodeStreamingClient.hasUrl(e)){const e=new pw(hw.LIVE_STREAMING_TASK_CONFLICT);return i.onError(e),Mm.reject(e)}const n=t?aP.TRANSCODE:aP.RAW;return this._createLiveStreamingClient(n).startLiveStreamingTask(e,n).then((()=>i.onSuccess())).catch((e=>{throw i.onError(e),e}))}setLiveTranscoding(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.SET_LIVE_TRANSCODING,options:[e],tag:bL.TRACER});return this._createLiveStreamingClient(aP.TRANSCODE).setTranscodingConfig(e).then((()=>t.onSuccess())).catch((e=>{throw t.onError(e),e}))}stopLiveStreaming(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.STOP_LIVE_STREAMING,options:[e],tag:bL.TRACER}),i=[this._liveRawStreamingClient,this._liveTranscodeStreamingClient].filter((t=>t&&t.hasUrl(e)));if(!i.length){const e=new pw(hw.INVALID_PARAMS,"can not find live streaming url to stop");return t.onError(e),Mm.reject(e)}return Mm.all(i.map((t=>t&&t.stopLiveStreamingTask(e)))).then((()=>t.onSuccess())).catch((e=>{throw t.onError(e),e}))}async addInjectStreamUrl(e,t){const i=Px.reportApiInvoke(this._sessionId,{name:wL.ADD_INJECT_STREAM_URL,options:[e,t],tag:bL.TRACER});try{if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"can not addInjectStreamUrl, no joininfo");const i=this._createLiveStreamingClient(aP.INJECT);i.setInjectStreamConfig(t,0),await i.startLiveStreamingTask(e,aP.INJECT)}catch(e){throw i.onError(e),e}i.onSuccess()}async removeInjectStreamUrl(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.REMOVE_INJECT_STREAM_URL,options:[],tag:bL.TRACER});try{var t;const e=this._createLiveStreamingClient(aP.INJECT),i=Array.from(Ax(t=e.streamingTasks).call(t)).find((e=>e.mode===aP.INJECT));if(!this._joinInfo||!i)throw new pw(hw.INVALID_OPERATION,"can remove addInjectStreamUrl, no joininfo or inject task");await e.stopLiveStreamingTask(i.url)}catch(t){throw e.onError(t),t}e.onSuccess()}async startChannelMediaRelay(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.START_CHANNEL_MEDIA_RELAY,options:[e],tag:bL.TRACER});try{GW(e);const t=this._createChannelMediaRelayClient();await t.startChannelMediaRelay(e)}catch(e){return t.onError(e),e.throw()}t.onSuccess()}async updateChannelMediaRelay(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.UPDATE_CHANNEL_MEDIA_RELAY,options:[e],tag:bL.TRACER});try{GW(e);const t=this._createChannelMediaRelayClient();await t.updateChannelMediaRelay(e)}catch(e){return t.onError(e),e.throw()}t.onSuccess()}async stopChannelMediaRelay(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.STOP_CHANNEL_MEDIA_RELAY,options:[],tag:bL.TRACER});try{const e=this._createChannelMediaRelayClient();await e.stopChannelMediaRelay()}catch(t){return e.onError(t),t.throw()}e.onSuccess()}sendStreamMessage(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"can not send data stream, not joined");if("string"==typeof e&&(e=(new TextEncoder).encode(e)),new Blob([e]).size>1024)throw new pw(hw.INVALID_PARAMS,"stream message out of range.");return this._gateway.signal.request(HL.DATA_STREAM,{payload:GG(e)},!t)}sendMetadata(e){if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"can not send metadata, not joined");if(new Blob([e]).size>1024)throw new pw(hw.METADATA_OUT_OF_RANGE);return this._gateway.signal.request(HL.SEND_METADATA,{session_id:this._joinInfo.sid,metadata:GG(e)})}async sendCustomReportMessage(e){Array.isArray(e)||(e=[e]),e.forEach(OL);const t=Px.reportApiInvoke(this._sessionId,{name:wL.SEND_CUSTOM_REPORT_MESSAGE,options:[JSON.stringify(e)],tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"can not send custom report, not joined");return t.onError(e),e.throw()}await Px.sendCustomReportMessage(this._joinInfo.sid,e),t.onSuccess()}getLocalAudioStats(){return this._statsCollector.getLocalAudioTrackStats()}getRemoteAudioStats(){return this._statsCollector.getRemoteAudioTrackStats()}getLocalVideoStats(){return this._statsCollector.getLocalVideoTrackStats()}getRemoteVideoStats(){return this._statsCollector.getRemoteVideoTrackStats()}getRemoteNetworkQuality(){return this._statsCollector.getRemoteNetworkQualityStats()}async pickSVCLayer(e,t){uL(t.spatialLayer,"spatialLayer",[0,1,2,3]),uL(t.temporalLayer,"temporalLayer",[0,1,2,3]);try{await this._gateway.pickSVCLayer(e,t)}catch(e){throw mw.error("[".concat(this._clientId,"] pick SVC layer failed"),e.toString()),Yw("error",this,"pickSVCLayer",t,e.toString()),e}}_reset(){mw.debug("[".concat(this._clientId,"] reset client")),Yw("debug",this,"_reset"),this._axiosCancelSource.cancel(),this._axiosCancelSource=dw.CancelToken.source(),this._streamFallbackTypeCacheMap=new Map,this._remoteStreamTypeCacheMap=new Map,this._configDistribute.stopGetConfigDistribute(),this._joinInfo=void 0,this._proxyServer=void 0,this._defaultStreamFallbackType=void 0,this._sessionId=null,this.store.sessionId=null,this._statsCollector.reset(),this._key=void 0,this._appId=void 0,this._uid=void 0,this.store.uid=void 0,this._channelName=void 0,this._encryptionMode="none",this._encryptionSecret=null,this._encryptionSalt=null,this._users.forEach((e=>{e._audioTrack&&e._audioTrack._destroy(),e._videoTrack&&e._videoTrack._destroy()})),this._users=[],this._audioVolumeIndicationInterval&&(window.clearInterval(this._audioVolumeIndicationInterval),this._audioVolumeIndicationInterval=void 0),"fallback"===this._cloudProxyServerMode&&(this._cloudProxyServerMode="disabled"),this._p2pChannel.reset(),this._publishMutex=new Qx("client-publish"),this._subscribeMutex=new Qx("client-subscribe"),this._networkQualityInterval&&(window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=void 0),this._injectStreamingClient&&(this._injectStreamingClient.terminate(),this._injectStreamingClient.removeAllListeners(),this._injectStreamingClient=void 0),this._liveRawStreamingClient&&(this._liveRawStreamingClient.terminate(),this._liveRawStreamingClient.removeAllListeners(),this._liveRawStreamingClient=void 0),this._liveTranscodeStreamingClient&&(this._liveTranscodeStreamingClient.terminate(),this._liveTranscodeStreamingClient.removeAllListeners(),this._liveTranscodeStreamingClient=void 0),this._channelMediaRelayClient&&(this._channelMediaRelayClient.dispose(),this._channelMediaRelayClient=void 0)}_startSession(e,t){const i=e||NG();e?mw.debug("[".concat(this._clientId,"] new Session ").concat(i)):mw.debug("[".concat(this._clientId,"] renewSession ").concat(this._sessionId," => ").concat(i)),Yw("debug",this,"_startSession",{newSid:i,sid:this._sessionId}),this._sessionId=i,this.store.sessionId=i,t?Px.sessionInit(this._sessionId,{lts:(new Date).getTime(),cname:t.channel,appid:t.appId,mode:this._mode}):this._joinInfo?Px.sessionInit(this._sessionId,{lts:(new Date).getTime(),cname:this._joinInfo.cname,appid:this._joinInfo.appId,mode:this._mode}):this._gateway.joinInfo&&Px.sessionInit(this._sessionId,{lts:(new Date).getTime(),cname:this._gateway.joinInfo.cname,appid:this._gateway.joinInfo.appId,mode:this._mode}),this._joinInfo&&(this._joinInfo.sid=i),this._gateway.joinInfo&&(this._gateway.joinInfo.sid=i)}async _publishHighStream(e){if(!this._joinInfo||void 0===this._uid)throw new pw(hw.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));if("auto"===this._turnServer.mode&&cb("FORCE_TURN")&&!cb("TURN_ENABLE_TCP")&&!cb("TURN_ENABLE_UDP"))throw new pw(hw.UNEXPECTED_ERROR,"force TURN With No TURN Configuration");mw.debug("[".concat(this._clientId,"] publish high stream")),Yw("debug",this,"_publishHighStream");try{const i=await this._p2pChannel.publish(e,this._isDualStreamEnabled,this._lowStreamParameter),n=(await i.next()).value;if(n){var t;let r;try{r=await this._gateway.publish(this._uid,n,!0)}catch(e){if(e.code!==hw.DISCONNECT_P2P)throw i.throw(e),e}await i.next((null===(t=r)||void 0===t?void 0:t.ortc)||[])}this._p2pChannel.reportPublishEvent(!0,null);for(const t of e)t instanceof WJ&&t._encoderConfig&&this._gateway.setVideoProfile(t._encoderConfig),!t.muted&&t.enabled||await this._p2pChannel.muteLocalTrack(t)}catch(t){if(this._p2pChannel.reportPublishEvent(!1,null==t?void 0:t.code,e),(null==t?void 0:t.code)===hw.WS_ABORT)return;throw t}}async _publishLowStream(){if(!this._joinInfo||void 0===this._uid)throw new pw(hw.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));mw.debug("[".concat(this._clientId,"] publish low stream")),Yw("debug",this,"_publishLowStream");const e=this._configDistribute.getLowStreamConfigDistribute();e&&e.bitrate&&(this._lowStreamParameter||(this._lowStreamParameter={width:160,height:120,framerate:15,bitrate:50}),this._lowStreamParameter&&this._lowStreamParameter.bitrate&&e.bitrate<this._lowStreamParameter.bitrate&&(this._lowStreamParameter.bitrate=e.bitrate));try{const e=await this._p2pChannel.publishLowStream(this._lowStreamParameter),i=(await e.next()).value;if(i){var t;let n;try{n=await this._gateway.publish(this._uid,i,!0)}catch(t){if(t.code!==hw.DISCONNECT_P2P)throw e.throw(t),t}e.next((null===(t=n)||void 0===t?void 0:t.ortc)||[]),this._p2pChannel.reportPublishEvent(!0,null,void 0,!0)}}catch(e){if(this._p2pChannel.reportPublishEvent(!1,null==e?void 0:e.code,void 0,!0),(null==e?void 0:e.code)===hw.WS_ABORT)return;throw e}}_createLiveStreamingClient(e){if(!this._joinInfo||!this._appId)return new pw(hw.INVALID_OPERATION,"can not create live streaming client, please join channel first").throw();const t=()=>new xW(this._joinInfo,this._config.websocketRetryConfig||_w,this._config.httpRetryConfig||_w),i=e=>{e.onLiveStreamError=(e,t)=>{Px.reportApiInvoke(this._sessionId,{name:wL.ON_LIVE_STREAM_ERROR,options:[e,t],tag:bL.TRACER}).onSuccess(),this.emit(FL.LIVE_STREAMING_ERROR,e,t)},e.onLiveStreamWarning=(e,t)=>{Px.reportApiInvoke(this._sessionId,{name:wL.ON_LIVE_STREAM_WARNING,options:[e,t],tag:bL.TRACER}).onSuccess(),this.emit(FL.LIVE_STREAMING_WARNING,e,t)},e.on(pP.REQUEST_WORKER_MANAGER_LIST,((e,t,i)=>{if(!this._joinInfo)return i(new pw(hw.INVALID_OPERATION,"can not find join info to get worker manager"));DW(e,this._joinInfo,this._axiosCancelSource.token,_w).then(t).catch(i)}))};switch(e){case aP.RAW:return this._liveRawStreamingClient||(this._liveRawStreamingClient=t(),i(this._liveRawStreamingClient)),this._liveRawStreamingClient;case aP.TRANSCODE:return this._liveTranscodeStreamingClient||(this._liveTranscodeStreamingClient=t(),i(this._liveTranscodeStreamingClient)),this._liveTranscodeStreamingClient;case aP.INJECT:return this._injectStreamingClient||(this._injectStreamingClient=t(),this._injectStreamingClient.on(pP.REQUEST_WORKER_MANAGER_LIST,((e,t,i)=>{if(!this._joinInfo)return i(new pw(hw.INVALID_OPERATION,"can not find join info to get worker manager"));DW(e,this._joinInfo,this._axiosCancelSource.token,_w).then(t).catch(i)})),this._injectStreamingClient.onInjectStatusChange=(e,t,i)=>{this.emit(FL.INJECT_STREAM_STATUS,e,t,i)}),this._injectStreamingClient}}_createChannelMediaRelayClient(){return this._joinInfo?(this._channelMediaRelayClient||(this._channelMediaRelayClient=new YW(this._joinInfo,this._clientId,this._config.websocketRetryConfig||_w,this._config.httpRetryConfig||_w),this._channelMediaRelayClient.on("state",(e=>{e===RP.RELAY_STATE_FAILURE&&this._channelMediaRelayClient&&this._channelMediaRelayClient.dispose(),this.emit(FL.CHANNEL_MEDIA_RELAY_STATE,e)})),this._channelMediaRelayClient.on("event",(e=>{this.emit(FL.CHANNEL_MEDIA_RELAY_EVENT,e)}))),this._channelMediaRelayClient):new pw(hw.INVALID_OPERATION,"can not create channel media relay client, please join channel first").throw()}_handleGatewayEvents(){this._gateway.on(mP.DISCONNECT_P2P,(async()=>{await this._p2pChannel.disconnectForReconnect()})),this._gateway.on(mP.CONNECTION_STATE_CHANGE,((e,t,i)=>{var n;if(i===xL.FALLBACK)return;const r=()=>{this.emit(FL.CONNECTION_STATE_CHANGE,e,t,i)};if(Px.reportApiInvoke(this._sessionId||(null===(n=this._gateway.joinInfo)||void 0===n?void 0:n.sid)||null,{name:wL.CONNECTION_STATE_CHANGE,options:[e,t,i],tag:bL.TRACER}).onSuccess(JSON.stringify({cur:e,prev:t,reason:i})),mw.info("[".concat(this._clientId,"] connection state change: ").concat(t," -> ").concat(e)),Fw("info",this,"connection-state-change","".concat(t," -> ").concat(e)),"DISCONNECTED"===e)return this._reset(),void r();if("RECONNECTING"===e)this._users.forEach((e=>{e._trust_in_room_=!1,e._trust_audio_enabled_state_=!1,e._trust_video_enabled_state_=!1,e._trust_audio_mute_state_=!1,e._trust_video_mute_state_=!1,e._trust_stream_added_state_=!1})),this._userOfflineTimeout&&window.clearTimeout(this._userOfflineTimeout),this._streamRemovedTimeout&&window.clearTimeout(this._streamRemovedTimeout),this._userOfflineTimeout=void 0,this._streamRemovedTimeout=void 0;else if("CONNECTED"===e){var o;this._streamFallbackTypeCacheMap.forEach(((e,t)=>{this._gateway.setStreamFallbackOption(t,e).catch((e=>{mw.warning("[".concat(this._clientId,"] auto set stream fallback option failed"),e),xw("warning",this,"auto set stream fallback option failed, ".concat(e.toString()))}))})),this._remoteStreamTypeCacheMap.forEach(((e,t)=>{this._gateway.setRemoteVideoStreamType(t,e).catch((e=>{mw.warning("[".concat(this._clientId,"] auto set remote stream type failed"),e),xw("warning",this,"auto set remote stream type failed, ".concat(e.toString()))}))})),void 0!==this._remoteDefaultVideoStreamType&&void 0===(null===(o=this._joinInfo)||void 0===o?void 0:o.defaultVideoStream)&&this.setRemoteDefaultVideoStreamType(this._remoteDefaultVideoStreamType).then((()=>{mw.debug("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway connected"))})).catch((e=>{mw.error("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway failed, ").concat(e))})),this._p2pChannel.republish(),this._userOfflineTimeout=window.setTimeout((()=>{"CONNECTED"===this.connectionState&&(this._userOfflineTimeout=void 0,this._users.filter((e=>!e._trust_in_room_)).forEach((e=>{mw.debug("[".concat(this._clientId,"] user offline timeout, emit user offline ").concat(e.uid)),xw("debug",this,"user offline timeout, emit user offline ".concat(e.uid)),this._handleUserOffline({uid:e.uid})})))}),3e3),this._streamRemovedTimeout=window.setTimeout((()=>{"CONNECTED"===this.connectionState&&(this._streamRemovedTimeout=void 0,this._users.forEach((e=>{e._trust_audio_mute_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch audio unmute event ").concat(e.uid)),xw("debug",this,"auto dispatch audio unmute event ".concat(e.uid)),this._handleMuteStream(e.uid,"audio",!1)),e._trust_video_mute_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch video unmute event ").concat(e.uid)),xw("debug",this,"auto dispatch video unmute event ".concat(e.uid)),this._handleMuteStream(e.uid,"video",!1)),e._trust_audio_enabled_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch enable local audio ").concat(e.uid)),xw("debug",this,"auto dispatch enable local audio ".concat(e.uid)),this._handleSetStreamLocalEnable("audio",e.uid,!0)),!e._trust_video_enabled_state_&&e._video_enabled_&&(mw.debug("[".concat(this._clientId,"] auto dispatch enable local video ").concat(e.uid)),xw("debug",this,"auto dispatch enable local video ".concat(e.uid)),this._handleSetStreamLocalEnable("video",e.uid,!0)),e._trust_stream_added_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch stream remove ").concat(e.uid)),xw("debug",this,"auto dispatch stream remove ".concat(e.uid)),this._handleRemoveStream({uid:e.uid,uint_id:e._uintid}))})))}),1e3)}r()})),this._gateway.on(mP.REQUEST_NEW_GATEWAY_LIST,((e,t)=>{if(!this._joinInfo)return t(new pw(hw.UNEXPECTED_ERROR,"can not recover, no join info"));SW(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||_w).then((t=>{this._joinInfo&&(this._joinInfo.apResponse=t.gatewayInfo.res,this._joinInfo.gatewayAddrs=t.gatewayInfo.gatewayAddrs,this._joinInfo.uni_lbs_ip=t.gatewayInfo.uni_lbs_ip),e(t.gatewayInfo.gatewayAddrs.map((e=>{if(this._joinInfo&&this._joinInfo.proxyServer){const t=e.address.split(":");return"wss://".concat(this._joinInfo.proxyServer,"/ws/?h=").concat(t[0],"&p=").concat(t[1])}return"wss://".concat(e.address)})))})).catch(t)})),this._gateway.on(mP.NETWORK_QUALITY,(e=>{"normal"===this._networkQualitySensitivity&&this.emit(FL.NETWORK_QUALITY,e)})),this._gateway.on(mP.STREAM_TYPE_CHANGE,((e,t)=>{this.emit(FL.STREAM_TYPE_CHANGED,e,t),Px.reportApiInvoke(this._sessionId,{name:wL.STREAM_TYPE_CHANGE,options:[e,t],tag:bL.TRACER}).onSuccess(JSON.stringify({uid:e,streamType:t}))})),this._gateway.on(mP.IS_P2P_DISCONNECTED,(e=>{this._p2pChannel.isP2PDisconnected()?e(!0):this._p2pChannel.hasLocalMedia()||this._p2pChannel.hasRemoteMedia()?e(!1):e(!0)})),this._gateway.on(mP.NEED_RENEW_SESSION,(()=>{this._startSession()})),this._gateway.on(mP.REQUEST_P2P_CONNECTION_PARAMS,(async(e,t,i)=>{try{t(await this._p2pChannel.startP2PConnection(e))}catch(e){i(e)}})),this._gateway.on(mP.JOIN_RESPONSE,((e,t,i)=>{const{dtlsParameters:n,iceParameters:r,candidates:o,rtpCapabilities:s,setup:a,cname:c}=Pz(e.ortc,t,i);this._p2pChannel.connect(r,n,o,s,a,c)})),this._gateway.signal.on(WL.ON_USER_ONLINE,this._handleUserOnline),this._gateway.signal.on(WL.ON_USER_OFFLINE,this._handleUserOffline),this._gateway.signal.on(WL.ON_ADD_AUDIO_STREAM,(e=>this._handleAddAudioOrVideoStream("audio",e.uid,e.ssrcId,e.cname,e.uint_id,e.ortc))),this._gateway.signal.on(WL.ON_ADD_VIDEO_STREAM,(e=>this._handleAddAudioOrVideoStream("video",e.uid,e.ssrcId,e.cname,e.uint_id,e.ortc,e.rtxSsrcId))),this._gateway.signal.on(WL.ON_REMOVE_STREAM,this._handleRemoveStream),this._gateway.signal.on(WL.ON_P2P_LOST,this._handleP2PLost),this._gateway.signal.on(WL.MUTE_AUDIO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"mute_audio",{uid:e.uid}),this._handleMuteStream(e.uid,"audio",!0)))),this._gateway.signal.on(WL.UNMUTE_AUDIO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"unmute_audio",{uid:e.uid}),this._handleMuteStream(e.uid,"audio",!1)))),this._gateway.signal.on(WL.MUTE_VIDEO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"mute_video",{uid:e.uid}),this._handleMuteStream(e.uid,"video",!0)))),this._gateway.signal.on(WL.UNMUTE_VIDEO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"unmute_video",{uid:e.uid}),this._handleMuteStream(e.uid,"video",!1)))),this._gateway.signal.on(WL.RECEIVE_METADATA,(e=>{const t=FG(e.metadata);this.emit(FL.RECEIVE_METADATA,e.uid,t)})),this._gateway.signal.on(WL.ON_DATA_STREAM,(e=>{e.seq&&delete e.seq,e.payload=FG(e.payload),this.emit(FL.STREAM_MESSAGE,e.uid,e.payload),this.onStreamMessage&&this.onStreamMessage(e)})),this._gateway.signal.on(WL.ON_CRYPT_ERROR,(()=>{xG((()=>{mw.warning("[".concat(this._clientId,"] on crypt error")),Fw("warning",this,"crypt_error"),this.emit(FL.CRYPT_ERROR)}),this._sessionId)})),this._gateway.signal.on(WL.ON_TOKEN_PRIVILEGE_WILL_EXPIRE,this._handleTokenWillExpire),this._gateway.signal.on(WL.ON_TOKEN_PRIVILEGE_DID_EXPIRE,(()=>{mw.warning("[".concat(this._clientId,"] received message onTokenPrivilegeDidExpire, please get new token and join again")),Fw("warning",this,"token_privilege_did_expire"),this._gateway.leave(!0),this.emit(FL.ON_TOKEN_PRIVILEGE_DID_EXPIRE),this._reset()})),this._gateway.signal.on(WL.ON_STREAM_FALLBACK_UPDATE,(e=>{mw.debug("[".concat(this._clientId,"] stream fallback peerId: ").concat(e.stream_id,", attr: ").concat(e.stream_type)),Fw("debug",this,"stream_fallback_update",{peerId:e.stream_id,attr:e.stream_type}),this.emit(FL.STREAM_FALLBACK,e.stream_id,1===e.stream_type?"fallback":"recover")})),this._gateway.signal.on(WL.ON_PUBLISH_STREAM,(e=>{this.uid===this._uid&&(this._p2pChannel.reportPublishEvent(!0,null,void 0,!1,JSON.stringify({proxy:e.proxy})),mw.info("[".concat(this._clientId,"] on publish stream, ").concat(JSON.stringify(e))),Fw("info",this,"publish_stream",e))})),this._gateway.signal.on(WL.ENABLE_LOCAL_VIDEO,(e=>{this._handleSetStreamLocalEnable("video",e.uid,!0)})),this._gateway.signal.on(WL.DISABLE_LOCAL_VIDEO,(e=>{this._handleSetStreamLocalEnable("video",e.uid,!1)})),this._gateway.signal.on(YL.REQUEST_TIMEOUT,((e,t)=>{if(this._joinInfo)switch(e){case HL.PUBLISH:{if(!t)return;const e=(t=t).ortc;if(e){var i,n,r,o;const s=e.some((e=>{let{stream_type:t}=e;return t===TP.Audio})),a=e.some((e=>{let{stream_type:t}=e;return t!==TP.Audio})),c=e.some((e=>{let{stream_type:t}=e;return t===TP.Screen||t===TP.ScreenLow}));"offer"===t.state&&Px.publish(this._joinInfo.sid,{eventElapse:iG.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:!1,ec:hw.TIMEOUT,audio:s,video:a,p2pid:t.p2p_id,publishRequestid:this.store.pubId,screenshare:c,audioName:s?null===(i=e.find((e=>{let{stream_type:t}=e;return t===TP.Audio})))||void 0===i||null===(n=i.ssrcs[0])||void 0===n?void 0:n.ssrcId.toString():void 0,videoName:a?null===(r=e.find((e=>{let{stream_type:t}=e;return t!==TP.Audio})))||void 0===r||null===(o=r.ssrcs[0])||void 0===o?void 0:o.ssrcId.toString():void 0})}break}case HL.SUBSCRIBE:(t=t)&&Px.subscribe(this._joinInfo.sid,{succ:!1,ec:hw.TIMEOUT,audio:t.stream_type===QP.AUDIO,video:t.stream_type===QP.VIDEO,peerid:t.stream_id,subscribeRequestid:t.ssrcId,p2pid:this.store.p2pId,eventElapse:iG.measureFromSubscribeStart(this.store.clientId,t.ssrcId)})}})),this._gateway.signal.on(WL.ON_P2P_OK,(e=>{this.uid,this._uid})),this._gateway.signal.on(WL.ON_PUBLISHED_USER_LIST,(e=>{if(null==e||!e.users)return;const t=[],i=[];for(const n of e.users){let e=this._users.find((e=>e.uid===n.stream_id));e?e._trust_in_room_=!0:(e=new zJ(n.stream_id,n.stream_id),this._users.push(e),0===this.getListeners(FL.PUBLISHED_USER_LIST).length&&(mw.debug("[".concat(this._clientId,"] user online"),n.stream_id),Gw("info",this,"user-joined",{uid:n.stream_id}),this.emit(FL.USER_JOINED,e)));const r=SP.Audio&n.stream_type,o=(SP.Video|SP.LwoVideo)&n.stream_type,s=r&&e.hasAudio,a=o&&e.hasVideo;n.stream_type!==SP.Nothing&&(e._trust_stream_added_state_=!0),o&&(e._video_added_=!0,e._videoSSRC=n.video_ssrc),r&&(e._audio_added_=!0,e._audioSSRC=n.audio_ssrc),r&&!s&&0===this.getListeners(FL.PUBLISHED_USER_LIST).length&&(mw.info("[".concat(this._clientId,"] remote user ").concat(e.uid," published audio")),xw("info",this,"remote user ".concat(e.uid," published audio")),this.emit(FL.USER_PUBLISHED,e,"audio")),o&&!a&&0===this.getListeners(FL.PUBLISHED_USER_LIST).length&&(mw.info("[".concat(this._clientId,"] remote user ").concat(e.uid," published video")),xw("info",this,"remote user ".concat(e.uid," published video")),this.emit(FL.USER_PUBLISHED,e,"video")),(r&&!s||o&&!a)&&t.push(e),o&&this._p2pChannel.hasPendingRemoteMedia(e,"video")&&i.push({user:e,mediaType:"video"}),r&&this._p2pChannel.hasPendingRemoteMedia(e,"audio")&&i.push({user:e,mediaType:"audio"})}i.length>0&&(mw.debug("[".concat(this._clientId,"] RE massSubscribe after reconnect ").concat(i.map((e=>"user: ".concat(e.user.uid,", mediaType: ").concat(e.mediaType))).join("; ")," ")),this.massSubscribe(i).catch((e=>{mw.error("[".concat(this._clientId,"] mass resubscribe error"),e.toString())}))),this.getListeners(FL.PUBLISHED_USER_LIST).length>0?(mw.info("[".concat(this._clientId,"] client emit user-list event, users: ").concat(t.map((e=>e.uid)).join(", "))),this.emit(FL.PUBLISHED_USER_LIST,t)):mw.info("[".concat(this._clientId,"] client not emit user-list event case there is no user-list listener, users: ").concat(t.map((e=>e.uid)).join(", ")))}))}_handleP2PChannelEvents(){this._p2pChannel.on(GP.RequestMuteLocal,(async(e,t,i)=>{if(this._joinInfo)try{await this._gateway.muteLocal(e,this._joinInfo.stringUid||this._joinInfo.uid),t()}catch(e){e.code===hw.DISCONNECT_P2P?t():i(e)}else t()})),this._p2pChannel.on(GP.RequestUnmuteLocal,(async(e,t,i)=>{if(this._joinInfo)try{await this._gateway.unmuteLocal(e,this._joinInfo.stringUid||this._joinInfo.uid),t()}catch(e){e.code===hw.DISCONNECT_P2P?t():i(e)}else t()})),this._p2pChannel.on(GP.RequestRePublish,((e,t,i)=>{this.publish(e,!1).then(t).catch(i)})),this._p2pChannel.on(GP.RequestReSubscribe,(async(e,t,i)=>{try{for(const{user:t,kind:i}of e)i===QP.VIDEO?await this.subscribe(t,"video"):await this.subscribe(t,"audio");t()}catch(e){i(e)}})),this._p2pChannel.on(GP.RequestUploadStats,((e,t)=>{this._gateway.uploadStats(e,t)})),this._p2pChannel.on(GP.MediaReconnectStart,(e=>{this.emit(FL.MEDIA_RECONNECT_START,e)})),this._p2pChannel.on(GP.MediaReconnectEnd,(e=>{this.emit(FL.MEDIA_RECONNECT_END,e)})),this._p2pChannel.on(GP.NeedSignalRTT,(e=>{e(this._gateway.getSignalRTT())})),this._p2pChannel.on(GP.RequestRestartICE,(async()=>{const e=await this._p2pChannel.reEstablish();if(e){const{restartICEResponse:t,gatewayIP:i,gatewayPort:n}=await this._gateway.restartICE({iceParameters:e.iceParameters}),{candidates:r,iceParameters:o}=function(e,t,i){const n=e.ice;let r;return void 0!==t&&void 0!==i?(r=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:t,port:i.toString(),type:"host",extension:{}}],mw.debug("Using remote candidate from AP ".concat(t,":").concat(i)),xw("debug",[],"Using remote candidate from AP ".concat(t,":").concat(i))):r=n.candidates.map((e=>({foundation:e.foundation,componentId:"1",transport:e.protocol,priority:e.priority.toString(),connectionAddress:e.ip,port:e.port.toString(),type:e.type,extension:{}}))),{candidates:r,iceParameters:{iceUfrag:n.iceUfrag,icePwd:n.icePwd}}}(t,i,n);await e.restartICE(o,r)}})),this._p2pChannel.on(GP.RequestReconnect,(async()=>{this._gateway.reconnect()})),this._p2pChannel.on(GP.RequestReconnectPC,(async()=>{var e;const{iceParameters:t,dtlsParameters:i,rtpCapabilities:n}=await this._p2pChannel.startP2PConnection({turnServer:null===(e=this._joinInfo)||void 0===e?void 0:e.turnServer}),{gatewayEstablishParams:r,gatewayIP:o,gatewayPort:s}=await this._gateway.reconnectPC({iceParameters:t,dtlsParameters:i,rtpCapabilities:n}),{dtlsParameters:a,iceParameters:c,candidates:A,rtpCapabilities:d,setup:u,cname:E}=Pz(r,o,s);await this._p2pChannel.connect(c,a,A,d,u,E),await this._p2pChannel.republish(),await this._p2pChannel.reSubscribe()})),this._p2pChannel.on(GP.RequestUnpublishForReconnectPC,(async(e,t,i)=>{this._joinInfo&&void 0!==this._uid?(await this._gateway.unpublish(e,this._uid),t()):i()})),this._p2pChannel.on(GP.P2PLost,(()=>{this.emit(FL.P2P_LOST,this.store.uid)})),this._p2pChannel.on(GP.UpdateVideoEncoder,(e=>{e._encoderConfig&&this._gateway.setVideoProfile(e._encoderConfig)})),this._p2pChannel.on(GP.ConnectionTypeChange,(e=>{this.emit(FL.IS_USING_CLOUD_PROXY,e)}))}getKeyMetrics(){return this.store.keyMetrics}}).prototype,"setProxyServer",[i$],Object.getOwnPropertyDescriptor(A$.prototype,"setProxyServer"),A$.prototype),tx(A$.prototype,"setTurnServer",[n$],Object.getOwnPropertyDescriptor(A$.prototype,"setTurnServer"),A$.prototype),tx(A$.prototype,"setLocalAccessPoints",[r$],Object.getOwnPropertyDescriptor(A$.prototype,"setLocalAccessPoints"),A$.prototype),tx(A$.prototype,"setRemoteDefaultVideoStreamType",[o$],Object.getOwnPropertyDescriptor(A$.prototype,"setRemoteDefaultVideoStreamType"),A$.prototype),tx(A$.prototype,"setEncryptionConfig",[s$],Object.getOwnPropertyDescriptor(A$.prototype,"setEncryptionConfig"),A$.prototype),tx(A$.prototype,"pickSVCLayer",[a$],Object.getOwnPropertyDescriptor(A$.prototype,"pickSVCLayer"),A$.prototype),c$=A$))||c$);class l$ extends $x{set currentState(e){e!==this._currentState&&(this._currentState=e,this.emit(qL.AUDIO_SOURCE_STATE_CHANGE,this._currentState))}get currentState(){return this._currentState}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),tD(this,"audioBuffer",void 0),tD(this,"sourceNode",void 0),tD(this,"startPlayTime",0),tD(this,"startPlayOffset",0),tD(this,"pausePlayTime",0),tD(this,"options",void 0),tD(this,"currentLoopCount",0),tD(this,"_currentState","stopped"),this.audioBuffer=e,this.options=t,this.startPlayOffset=this.options.startPlayTime||0}createWebAudioDiagram(){return this.context.createGain()}get duration(){return this.audioBuffer.duration}get currentTime(){return"stopped"===this.currentState?0:"paused"===this.currentState?this.pausePlayTime:(this.context.currentTime-this.startPlayTime+this.startPlayOffset)%this.audioBuffer.duration}updateOptions(e){"stopped"===this.currentState?(this.options=e,this.startPlayOffset=this.options.startPlayTime||0):mw.warning("can not set audio source options")}startProcessAudioBuffer(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"}pauseProcessAudioBuffer(){this.sourceNode&&"playing"===this.currentState&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")}seekAudioBuffer(e){this.sourceNode&&(this.sourceNode.onended=null,"playing"===this.currentState&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),"playing"===this.currentState?(this.startPlayOffset=e,this.startSourceNode()):"paused"===this.currentState&&(this.pausePlayTime=e))}resumeProcessAudioBuffer(){"paused"===this.currentState&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")}stopProcessAudioBuffer(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch(e){}this.reset()}}startSourceNode(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))}createSourceNode(){const e=this.context.createBufferSource();return e.buffer=this.audioBuffer,e.loop=!!this.options.loop,e.connect(this.outputNode),e}handleSourceNodeEnded(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()}reset(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0}}const h$=new Map;function p$(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _$(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p$(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):p$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I$(e,t,i,n){i.optimizationMode&&(n&&n.width&&n.height?(i.encoderConfig=_$(_$({},n),{},{bitrateMin:n.bitrateMin,bitrateMax:n.bitrateMax}),"motion"!==i.optimizationMode&&"detail"!==i.optimizationMode||(t.contentHint=i.optimizationMode,t.contentHint===i.optimizationMode?(mw.debug("[".concat(e,"] set content hint to"),i.optimizationMode),Kw("debug",["AgoraRTC"],"videoTrackOptimizationModeProcess",[e,i,n])):(mw.debug("[".concat(e,"] set content hint failed")),Kw("warning",["AgoraRTC"],"videoTrackOptimizationModeProcess",[e,i,n],"failed")))):(mw.warning("[".concat(e,"] can not apply optimization mode bitrate config, no encoderConfig")),xw("warning",["AgoraRTC"],"[".concat(e,"] can not apply optimization mode bitrate config, no encoderConfig"))))}const g$=Dy().name;function f$(e,t,i,n){let r,o=0,s=null;return new Mm(((a,c)=>{setTimeout((()=>{r&&(r(),a(o))}),t),r=Xx((()=>{!function(){o>n&&r&&(r(),a(o));const t=i.getContext("2d");if(!t){const e=new pw(hw.UNEXPECTED_ERROR,"can not get canvas 2d context.");return mw.error(e.toString()),void c(e)}t.drawImage(e,0,0,160,120);const A=t.getImageData(0,0,i.width,i.height),d=Math.floor(A.data.length/3);if(s){for(let e=0;e<d;e+=3)if(A.data[e]!==s[e])return o+=1,void(s=A.data);s=A.data}else s=A.data}()}),30)}))}class R${constructor(e,t){tD(this,"id",0),tD(this,"element",void 0),tD(this,"peerPair",void 0),tD(this,"context",void 0),tD(this,"audioPlayerElement",void 0),tD(this,"audioTrack",void 0),R$.count+=1,this.id=R$.count,this.element=e,this.context=t}initPeers(){this.peerPair=[new RTCPeerConnection,new RTCPeerConnection],this.peerPair[1].ontrack=e=>{const t=document.createElement("audio");t.srcObject=new MediaStream([e.track]),t.play(),this.audioPlayerElement=t}}async switchSdp(){if(!this.peerPair)return;const e=async(e,t)=>{const i="offer"===t?await e.createOffer():await e.createAnswer();return await e.setLocalDescription(i),"complete"===e.iceGatheringState?e.localDescription:new Mm((t=>{e.onicegatheringstatechange=()=>{"complete"===e.iceGatheringState&&t(e.localDescription)}}))},t=async(e,t)=>await e.setRemoteDescription(t);try{const i=await e(this.peerPair[0],"offer");await t(this.peerPair[1],i);const n=await e(this.peerPair[1],"answer");await t(this.peerPair[0],n)}catch(e){throw new pw(hw.LOCAL_AEC_ERROR,e.toString()).print()}}async getTracksFromMediaElement(e){if(this.audioTrack)return this.audioTrack;let t;try{e instanceof HTMLVideoElement&&(e.captureStream?e.captureStream():e.mozCaptureStream()),t=this.context.createMediaStreamDestination(),this.context.createMediaElementSource(e).connect(t)}catch(e){throw new pw(hw.LOCAL_AEC_ERROR,e.toString()).print()}if(!t)throw new pw(hw.LOCAL_AEC_ERROR,"no dest node when local aec").print();const i=t.stream.getAudioTracks()[0];return this.audioTrack=i,i}getElement(){return this.element}async startEchoCancellation(){this.context.resume(),this.peerPair&&this.close(),this.initPeers();const e=this.element,t=await this.getTracksFromMediaElement(e);this.peerPair&&this.peerPair[0].addTrack(t),await this.switchSdp()}close(){mw.debug("close echo cancellation unit, id is",this.id),this.audioPlayerElement&&this.audioPlayerElement.pause(),this.peerPair&&this.peerPair.forEach((e=>{e.close()})),this.peerPair=void 0,this.audioPlayerElement=void 0}}var C$,T$;tD(R$,"count",0);const m$=window.AudioContext||window.webkitAudioContext,S$=new(C$=bx({report:Px}),tx((T$=class{constructor(){tD(this,"units",[]),tD(this,"context",void 0)}processExternalMediaAEC(e){if(!this._doesEnvironmentNeedAEC())return mw.debug("the system does not need to process local aec"),-1;this.context||(this.context=new m$);let t=this.units.find((t=>t&&t.getElement()===e));return t||(t=new R$(e,this.context),this.units.push(t)),t.startEchoCancellation(),mw.debug("start processing local audio echo cancellation, id is",t.id),t.id}_doesEnvironmentNeedAEC(){return Dy().name!==Oy.SAFARI}}).prototype,"processExternalMediaAEC",[C$],Object.getOwnPropertyDescriptor(T$.prototype,"processExternalMediaAEC"),T$.prototype),T$);ab("PROCESS_ID","process-".concat(vG(8,""),"-").concat(vG(4,""),"-").concat(vG(4,""),"-").concat(vG(4,""),"-").concat(vG(12,""))),function(){const e=Dy();qP.getDisplayMedia=!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia),qP.getStreamFromExtension=e.name===Oy.CHROME&&Number(e.version)>34,qP.supportUnifiedPlan=function(){if(!window.RTCRtpTransceiver)return!1;if(!("currentDirection"in RTCRtpTransceiver.prototype))return!1;const e=new RTCPeerConnection;let t=!1;try{e.addTransceiver("audio"),t=!0}catch(e){}return e.close(),t}(),qP.supportMinBitrate=e.name===Oy.CHROME||e.name===Oy.EDGE,qP.supportSetRtpSenderParameters=function(){const e=Dy();return!!(window.RTCRtpSender&&window.RTCRtpSender.prototype.setParameters&&window.RTCRtpSender.prototype.getParameters)&&(!!Ky()||!(!Uy()&&!ky())||e.name===Oy.FIREFOX&&Number(e.version)>=64)}(),e.name===Oy.SAFARI&&(Number(e.version)>=14?qP.supportDualStream=!0:qP.supportDualStream=!1),qP.webAudioMediaStreamDest=function(){const e=Dy();return!(e.name===Oy.SAFARI&&Number(e.version)<12)}(),qP.supportReplaceTrack=!!window.RTCRtpSender&&"function"==typeof RTCRtpSender.prototype.replaceTrack,qP.supportWebGL="undefined"!=typeof WebGLRenderingContext,qP.supportRequestFrame=!!window.CanvasCaptureMediaStreamTrack,Ky()||(qP.webAudioWithAEC=!0),qP.supportShareAudio=function(){const e=Dy();return(e.os===Sy.WIN_10||e.os===Sy.WIN_81||e.os===Sy.WIN_7||e.os===Sy.LINUX||e.os===Sy.MAC_OS)&&e.name===Oy.CHROME&&Number(e.version)>=74}(),qP.supportDualStreamEncoding=function(){const e=Dy();return"Safari"===e.name&&Number(e.version)>=14}(),mw.info("browser compatibility",JSON.stringify(qP),JSON.stringify(e)),Yw("info",[],"updateAgoraRTCCompatibility",{browserCompatibility:qP,browserInfo:e})}(),function(){let e;try{e=window.localStorage.getItem("websdk_ng_global_parameter")}catch(e){return void mw.error("Error loading sdk config",e.message)}if(e)try{const t=JSON.parse(window.atob(e)),i=Date.now();mw.debug("Loading global parameters from cache",t),Yw("debug",[],"loadConfigFromLocalStorage",t),Object.keys(t).forEach((e=>{if(Object.prototype.hasOwnProperty.call(Ab,e)){const{value:n,expires:r}=t[e];if(r&&r<=i)return;db[e]=n,Ab[e]=n}}))}catch(t){mw.error("Error loading mutableParamsCache: ".concat(e),t.message)}}();const O$={__CLIENT_LIST__:_b,__TRACK_LIST__:Ib,VERSION:Xw,BUILD:qw,setParameter:ab,getParameter:cb,getSupportedCodec:async function(){let e={audio:[],video:[]};try{let t=new RTCPeerConnection;t.addTransceiver("video",{direction:"recvonly"}),t.addTransceiver("audio",{direction:"recvonly"});const i=(await t.createOffer()).sdp;if(!i)return e;t.close(),t=null,e=function(e){const t={video:[],audio:[]};return e.match(/ VP8/i)&&t.video.push("VP8"),e.match(/ VP9/i)&&t.video.push("VP9"),e.match(/ AV1/i)&&t.video.push("AV1"),e.match(/ H264/i)&&t.video.push("H264"),e.match(/ opus/i)&&t.audio.push("OPUS"),e.match(/ PCMU/i)&&t.audio.push("PCMU"),e.match(/ PCMA/i)&&t.audio.push("PCMA"),e.match(/ G722/i)&&t.audio.push("G722"),t}(i)}catch(e){throw new pw(hw.CREATE_OFFER_FAILED,e.toString&&e.toString()).print()}return e},checkSystemRequirements:function(){const e=Px.reportApiInvoke(null,{name:wL.CHECK_SYSTEM_REQUIREMENTS,options:[],tag:bL.TRACER});let t=!1;try{const e=window.RTCPeerConnection,i=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia,n=window.WebSocket;t=!!(e&&i&&n)}catch(e){return mw.error("check system requirement failed: ",e),!1}let i=!1;const n=Dy();n.name===Oy.CHROME&&Number(n.version)>=58&&(!("WebKit"===yy.engine.name)||function(){const e=Dy();if(ky()){if(e.os===Sy.MAC_OS)return!0;if(e.os===Sy.IOS){const e=yy.os.version&&yy.os.version.split(".");if(e&&14===Number(e[0])&&e[1]&&Number(e[1])>=3)return!0;if(e&&Number(e[0])>14)return!0}}return!1}())&&(i=!0),n.name===Oy.FIREFOX&&Number(n.version)>=56&&(i=!0),n.name===Oy.OPERA&&Number(n.version)>=45&&(i=!0),n.name===Oy.SAFARI&&Number(n.version)>=11&&(i=!0),(Yy()||Dy().name===Oy.QQ)&&(i=!0),mw.debug("checkSystemRequirements, api:",t,"browser",i);const r=t&&i;return e.onSuccess(r),r},getDevices:function(e){return EF.enumerateDevices(!0,!0,e)},getMicrophones:function(e){return EF.getRecordingDevices(e)},getCameras:function(e){return EF.getCamerasDevices(e)},getElectronScreenSources:iF,getPlaybackDevices:function(e){return EF.getSpeakers(e)},createClient:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{codec:"vp8",audioCodec:"opus",mode:"rtc"};const t=Px.reportApiInvoke(null,{name:wL.CREATE_CLIENT,options:[e],tag:bL.TRACER});try{zL(e)}catch(e){throw t.onError(e),e}return void 0===e.audioCodec&&(e.audioCodec="opus"),t.onSuccess(),new E$(u$(u$({forceWaitGatewayResponse:!0},e),{},{role:"rtc"===e.mode?"host":e.role}))},createCameraVideoTrack:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{encoderConfig:"480p_1"};const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_CAM_VIDEO_TRACK,options:[_$({},e)]}),i=_J(e),n=vG(8,"track-cam-");let r=null;mw.info("start create camera video track with config",JSON.stringify(e),"trackId",n),Kw("info",["AgoraRTC"],"createCameraVideoTrack",e);try{r=(await cF({video:i},n)).getVideoTracks()[0]||null}catch(e){throw t.onError(e),e}if(!r){const e=new pw(hw.UNEXPECTED_ERROR,"can not find track in media stream");return t.onError(e),e.throw()}e.optimizationMode&&I$(n,r,e,e.encoderConfig&&ib(e.encoderConfig));const o=new JJ(r,e,i,e.scalabiltyMode?rb(e.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},e.optimizationMode,n);return t.onSuccess(o.getTrackId()),mw.info("create camera video success, trackId:",n),Kw("info",["AgoraRTC"],"createCameraVideoTrack",void 0,n),o},createCustomVideoTrack:function(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_CUSTOM_VIDEO_TRACK,options:[e]}),i=new WJ(e.mediaStreamTrack,{bitrateMax:e.bitrateMax,bitrateMin:e.bitrateMin},e.scalabiltyMode?rb(e.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},e.optimizationMode);return t.onSuccess(i.getTrackId()),mw.info("create custom video track success with config",e,"trackId",i.getTrackId()),Kw("info",["AgoraRTC"],"createCustomVideoTrack",e,i.getTrackId()),i},createScreenVideoTrack:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"disable";const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_SCREEN_VIDEO_TRACK,options:[_$({},e),t]});e.encoderConfig?"string"==typeof e.encoderConfig||e.encoderConfig.width&&e.encoderConfig.height||(e.encoderConfig.width={max:1920},e.encoderConfig.height={max:1080}):e.encoderConfig="1080p_2";const n=IJ(e),r=vG(8,"track-scr");let o=null,s=null;const a=XP();if(!a.supportShareAudio&&"enable"===t){const e=new pw(hw.NOT_SUPPORTED,"your browser or platform is not support share-screen with audio");return i.onError(e),e.throw()}mw.info("start create screen video track with config",e,"withAudio",t,"trackId",r),Kw("info",["AgoraRTC"],"createScreenVideoTrack",[e,t]);try{const e=await cF({screen:n,screenAudio:"auto"===t?a.supportShareAudio:"enable"===t},r);o=e.getVideoTracks()[0]||null,s=e.getAudioTracks()[0]||null}catch(e){throw i.onError(e),e}if(!o){const e=new pw(hw.UNEXPECTED_ERROR,"can not find track in media stream");return i.onError(e),e.throw()}if(!s&&"enable"===t){o&&o.stop();const e=new pw(hw.SHARE_AUDIO_NOT_ALLOWED);return i.onError(e),e.throw()}e.optimizationMode||(e.optimizationMode="detail"),e.optimizationMode&&(I$(r,o,e,e.encoderConfig&&nb(e.encoderConfig)),e.encoderConfig&&"string"!=typeof e.encoderConfig&&(e.encoderConfig.bitrateMin=e.encoderConfig.bitrateMax));const c=new WJ(o,e.encoderConfig?nb(e.encoderConfig):{},e.scalabiltyMode?rb(e.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},e.optimizationMode,r,[vP.SCREEN_TRACK]);if(!s)return i.onSuccess(c.getTrackId()),mw.info("create screen video track success","video:",c.getTrackId()),Kw("info",["AgoraRTC"],"createScreenVideoTrack",void 0,{videoTrack:c.getTrackId()}),c;const A=new JF(s);return i.onSuccess([c.getTrackId(),A.getTrackId()]),mw.info("create screen video track success","video:",c.getTrackId(),"audio:",A.getTrackId()),Kw("info",["AgoraRTC"],"createScreenVideoTrack",void 0,{videoTrack:c.getTrackId(),audioTrack:A.getTrackId()}),[c,A]},createMicrophoneAndCameraTracks:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{encoderConfig:"480p_1"};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_MIC_AND_CAM_TRACKS,options:[e,t]}),n=_J(t),r=gJ(e),o=vG(8,"track-mic-"),s=vG(8,"track-cam-");let a=null,c=null;mw.info("start create camera video track(".concat(s,") and microphone audio track(").concat(o,") with config, audio: ").concat(JSON.stringify(e),", video: ").concat(JSON.stringify(t))),Kw("info",["AgoraRTC"],"createMicrophoneAndCameraTracks",{videoConfig:t,audioConfig:e});try{const e=await cF({audio:r,video:n},"".concat(o,"-").concat(s));a=e.getAudioTracks()[0],c=e.getVideoTracks()[0]}catch(e){throw i.onError(e),e}if(!a||!c){const e=new pw(hw.UNEXPECTED_ERROR,"can not find tracks in media stream");return i.onError(e),e.throw()}t.optimizationMode&&I$(s,c,t,t.encoderConfig&&ib(t.encoderConfig));const A=new qF(a,e,r,o),d=new JJ(c,t,n,t.scalabiltyMode?rb(t.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},t.optimizationMode,s);return i.onSuccess([A.getTrackId(),d.getTrackId()]),mw.info("create camera video track(".concat(s,") and microphone audio track(").concat(o,") success")),Kw("info",["AgoraRTC"],"createMicrophoneAndCameraTracks",void 0,{videoTrackId:s,audioTrackId:o}),[A,d]},createMicrophoneAudioTrack:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_MIC_AUDIO_TRACK,options:[e]}),i=gJ(e),n=vG(8,"track-mic-");let r=null;mw.info("start create microphone audio track with config",JSON.stringify(e),"trackId",n),Kw("info",["AgoraRTC"],"createMicrophoneAudioTrack",e);try{r=(await cF({audio:i},n)).getAudioTracks()[0]||null}catch(e){throw t.onError(e),e}if(!r){const e=new pw(hw.UNEXPECTED_ERROR,"can not find track in media stream");return t.onError(e),e.throw()}const o=new qF(r,e,i,n);return t.onSuccess(o.getTrackId()),mw.info("create microphone audio track success, trackId:",n),Kw("info",["AgoraRTC"],"createMicrophoneAudioTrack",e,n),o},createCustomAudioTrack:function(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_CUSTOM_AUDIO_TRACK,options:[e]}),i=new JF(e.mediaStreamTrack,e.encoderConfig?sb(e.encoderConfig):{});return mw.info("create custom audio track success with config",e,"trackId",i.getTrackId()),Kw("info",["AgoraRTC"],"createCustomAudioTrack",e,i.getTrackId()),t.onSuccess(i.getTrackId()),i},createBufferSourceAudioTrack:async function(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_BUFFER_AUDIO_TRACK,options:[e]}),i=vG(8,"track-buf-");mw.info("start create buffer source audio track with config",JSON.stringify(e),"trackId",i),Kw("info",[],"createBufferSourceAudioTrack",e);const n=e.source;if(!(e.source instanceof AudioBuffer))try{e.source=await async function(e,t){let i=null;if("string"==typeof e){const t=h$.get(e);if(t)return mw.debug("use cached audio resource: ",e),t;try{i=(await gw((()=>dw.get(e,{responseType:"arraybuffer"})),void 0,void 0,{maxRetryCount:3})).data}catch(e){throw new pw(hw.FETCH_AUDIO_FILE_FAILED,e.toString())}}else{const t=new Mm(((t,i)=>{const n=new FileReader;n.onload=e=>{e.target?t(e.target.result):i(new pw(hw.READ_LOCAL_AUDIO_FILE_ERROR))},n.onerror=()=>{i(new pw(hw.READ_LOCAL_AUDIO_FILE_ERROR))},n.readAsArrayBuffer(e)}));i=await t}const n=await function(e){const t=Wx();return new Mm(((i,n)=>{t.decodeAudioData(e,(e=>{i(e)}),(e=>{n(new pw(hw.DECODE_AUDIO_FILE_FAILED,e.toString()))}))}))}(i);return"string"==typeof e&&t&&h$.set(e,n),n}(e.source,e.cacheOnlineFile)}catch(e){return t.onError(e),e.throw()}const r=new l$(e.source),o=new XF(n,r,e.encoderConfig?sb(e.encoderConfig):{},i);return mw.info("create buffer source audio track success, trackId:",i),Kw("info",["AgoraRTC"],"createBufferSourceAudioTrack",void 0,i),t.onSuccess(o.getTrackId()),o},setLogLevel:function(e){cb("USE_NEW_LOG")?function(e){e=Math.min(Math.max(0,e),4),ww=e}(e):mw.setLogLevel(e)},enableLogUpload:function(){cb("USE_NEW_LOG")?ab("UPLOAD_LOG",!0):mw.enableLogUpload()},disableLogUpload:function(){cb("USE_NEW_LOG")?ab("UPLOAD_LOG",!1):mw.disableLogUpload()},createChannelMediaRelayConfiguration:function(){return new FW},checkAudioTrackIsActive:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CHECK_AUDIO_TRACK_IS_ACTIVE,options:[t]});if(!(e instanceof JF||e instanceof yZ)){const e=new pw(hw.INVALID_TRACK,"the parameter is not a audio track");return i.onError(e),e.throw()}t&&t<1e3&&(t=1e3);const n=e instanceof JF?e.getTrackLabel():"remote_track",r=e.getVolumeLevel();let o=r,s=r;const a=Date.now();return new Mm((r=>{const c=setInterval((()=>{const A=e.getVolumeLevel();o=A>o?A:o,s=A<s?A:s;const d=o-s>1e-4,u=Date.now()-a;if(d||u>t){clearInterval(c);const t=d,s={duration:u,deviceLabel:n,maxVolumeLevel:o,result:t};mw.info("[track-".concat(e.getTrackId(),"] check audio track active completed. ").concat(JSON.stringify(s))),i.onSuccess(s),r(t)}}),200)}))},checkVideoTrackIsActive:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CHECK_VIDEO_TRACK_IS_ACTIVE,options:[t]});if(!(e instanceof WJ||e instanceof NZ)){const e=new pw(hw.INVALID_TRACK,"the parameter is not a video track");return i.onError(e),e.throw()}const n=4;t&&t<1e3&&(t=1e3);const r=e instanceof WJ?e.getTrackLabel():"remote_track",o=e.getMediaStreamTrack(!0),s=document.createElement("video");s.style.width="1px",s.style.height="1px",s.setAttribute("muted",""),s.muted=!0,s.setAttribute("playsinline",""),s.controls=!1,(Uy()||ky())&&(s.style.opacity="0.01",s.style.position="fixed",s.style.left="0",s.style.top="0",document.body.appendChild(s)),s.srcObject=new MediaStream([o]),s.play();const a=document.createElement("canvas");a.width=160,a.height=120;let c=0,A=0;try{const e=Date.now();c=await f$(s,t,a,n),A=Date.now()-e}catch(e){throw i.onError(e),e}g$===Oy.SAFARI&&(s.pause(),s.remove()),s.srcObject=null;const d=c>n,u={duration:A,changedPicNum:c,deviceLabel:r,result:d};return mw.info("[track-".concat(e.getTrackId(),"] check video track active completed. ").concat(JSON.stringify(u))),i.onSuccess(u),d},setArea:function(e){const t=Px.reportApiInvoke(null,{name:wL.SET_AREA,options:e,tag:bL.TRACER});try{let t=[];if("string"==typeof e&&(t=[e]),Array.isArray(e)&&(e.forEach((e=>{if(!kP.includes(e))throw new pw(hw.INVALID_PARAMS,"invalid area code")})),t=e),"[object Object]"===Object.prototype.toString.call(e)){const{areaCode:i,excludedArea:n}=e;if(!i)throw new pw(hw.INVALID_PARAMS,"area code is needed");let r=i;"string"==typeof i&&(r=[i]),t=n?function(e,t){let i=[];if(e.includes(bP.GLOBAL)){const o=[bP.GLOBAL,bP.OVERSEA],s=Object.keys(UP);if(t===bP.GLOBAL)throw new pw(hw.INVALID_PARAMS,"GLOBAL is an invalid excludedArea value");if(t===bP.CHINA)i=[bP.OVERSEA];else if(r=t,TW.includes(r)){const e=(n=t,CW[bP.GLOBAL][n]||[]),r=[...o,t,...e];i=s.filter((e=>!r.includes(e)))}else if(function(e){let t=!1;return TW.forEach((i=>{CW[bP.GLOBAL][i].includes(e)&&(t=!0)})),t}(t)){const e=function(e){let t;return TW.forEach((i=>{CW[bP.GLOBAL][i].includes(e)&&(t=i)})),t}(t),n=[...o,e,t];i=s.filter((e=>!n.includes(e)))}else i=e;i=function(e){const t=[];return mW.forEach((i=>{e.includes(i)&&t.push(i)})),t.concat(e.filter((e=>!mW.includes(e))))}(i)}else i=e;var n,r;return i}(r,n):r}ab("AREAS",t);const i=(e=>{const t={CODE:"",WEBCS_DOMAIN:[],WEBCS_DOMAIN_BACKUP_LIST:[],PROXY_CS:[],CDS_AP:[],ACCOUNT_REGISTER:[],UAP_AP:[],EVENT_REPORT_DOMAIN:[],EVENT_REPORT_BACKUP_DOMAIN:[],LOG_UPLOAD_SERVER:[],PROXY_SERVER_TYPE3:[]};return e.map((e=>{const i=UP[e],n=Object.keys(i);n&&n.map((e=>{"CODE"!==e&&(t[e]=t[e].concat(i[e]))}))})),t})(t);Object.keys(i).map((e=>{ab(e,"LOG_UPLOAD_SERVER"===e||"EVENT_REPORT_DOMAIN"===e||"EVENT_REPORT_BACKUP_DOMAIN"===e||"PROXY_SERVER_TYPE3"===e?i[e][0]:i[e])})),mw.debug("set area success:",t.join(","))}catch(e){throw t.onError(e),e}t.onSuccess()},loadModule:async function(e,t){if(mw.debug("loadModule: ".concat(e.name,", loadOption: ").concat(JSON.stringify(t))),!e.moduleInit)throw mw.debug("Invalid Plugin"),new pw(hw.INVALID_PLUGIN,"invalid plugin");try{jx.installPlugin(e),await e.moduleInit({logger:mw,report:Px,pluginCenter:jx,getParameter:cb},t)}catch(e){throw new pw(hw.UNEXPECTED_ERROR,"unexpected error in loadModule",e)}},audioElementPlayCenter:_F,processExternalMediaAEC:function(e){S$.processExternalMediaAEC(e)},registerExtensions:function(e){e.forEach((e=>{const t=e;t.__registered__=!0,t.logger.hookLog=mw.extLog,t.reporter.hookApiInvoke=Px.extApiInvoke,t.parameters&&Object.keys(t.parameters).forEach((e=>{t.parameters[e]=cb(e)}))}))},ChannelMediaRelayError:CP,ChannelMediaRelayEvent:fP,ChannelMediaRelayState:RP,RemoteStreamFallbackType:yP,RemoteStreamType:NP,ConnectionDisconnectedReason:xL,AudienceLatencyLevelType:QL,AREAS:bP};return Object.defineProperties(O$,{onAudioAutoplayFailed:{get:()=>vx.onAudioAutoplayFailed,set:e=>{vx.onAudioAutoplayFailed=e}},onAutoplayFailed:{get:()=>vx.onAutoplayFailed,set:e=>{vx.onAutoplayFailed=e}}}),EF.on(PL.CAMERA_DEVICE_CHANGED,(e=>{mw.info("camera device changed",JSON.stringify(e)),O$.onCameraChanged&&O$.onCameraChanged(e)})),EF.on(PL.RECORDING_DEVICE_CHANGED,(e=>{mw.info("microphone device changed",JSON.stringify(e)),O$.onMicrophoneChanged&&O$.onMicrophoneChanged(e)})),EF.on(PL.PLAYOUT_DEVICE_CHANGED,(e=>{mw.debug("playout device changed",JSON.stringify(e)),O$.onPlaybackDeviceChanged&&O$.onPlaybackDeviceChanged(e)})),_F.onAutoplayFailed=()=>{mw.info("detect audio element autoplay failed"),vx.onAudioAutoplayFailed&&vx.onAudioAutoplayFailed()},Kx.on("autoplay-failed",(()=>{mw.info("detect webaudio autoplay failed"),vx.onAudioAutoplayFailed&&vx.onAudioAutoplayFailed()})),window&&(window.__ARTC__=O$),O$}()},554:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(910),a=i(593),c=function(){function e(e){var t;this._channels=new Map,this._support_apis=((t={})[s.ApiTypeChannel.kChannelCreateChannel]=this.createChannel,t[s.ApiTypeChannel.kChannelRelease]=this.release,t[s.ApiTypeChannel.kChannelJoinChannel]=this.joinChannel,t[s.ApiTypeChannel.kChannelJoinChannelWithUserAccount]=this.joinChannelWithUserAccount,t[s.ApiTypeChannel.kChannelLeaveChannel]=this.leaveChannel,t[s.ApiTypeChannel.kChannelPublish]=this.publish,t[s.ApiTypeChannel.kChannelUnPublish]=this.unPublish,t[s.ApiTypeChannel.kChannelChannelId]=this.channelId,t[s.ApiTypeChannel.kChannelRenewToken]=this.renewToken,t[s.ApiTypeChannel.kChannelSetEncryptionSecret]=this.setEncryptionSecret,t[s.ApiTypeChannel.kChannelSetEncryptionMode]=this.setEncryptionMode,t[s.ApiTypeChannel.kChannelEnableEncryption]=this.enableEncryption,t[s.ApiTypeChannel.kChannelSetClientRole]=this.setClientRole,t[s.ApiTypeChannel.kChannelSetDefaultMuteAllRemoteAudioStreams]=this.setDefaultMuteAllRemoteAudioStreams,t[s.ApiTypeChannel.kChannelSetDefaultMuteAllRemoteVideoStreams]=this.setDefaultMuteAllRemoteVideoStreams,t[s.ApiTypeChannel.kChannelMuteLocalAudioStream]=this.muteLocalAudioStream,t[s.ApiTypeChannel.kChannelMuteLocalVideoStream]=this.muteLocalVideoStream,t[s.ApiTypeChannel.kChannelMuteAllRemoteAudioStreams]=this.muteAllRemoteAudioStreams,t[s.ApiTypeChannel.kChannelAdjustUserPlaybackSignalVolume]=this.adjustUserPlaybackSignalVolume,t[s.ApiTypeChannel.kChannelMuteRemoteAudioStream]=this.muteRemoteAudioStream,t[s.ApiTypeChannel.kChannelMuteAllRemoteVideoStreams]=this.muteAllRemoteVideoStreams,t[s.ApiTypeChannel.kChannelMuteRemoteVideoStream]=this.muteRemoteVideoStream,t[s.ApiTypeChannel.kChannelSetRemoteVideoStreamType]=this.setRemoteVideoStreamType,t[s.ApiTypeChannel.kChannelSetRemoteDefaultVideoStreamType]=this.setRemoteDefaultVideoStreamType,t[s.ApiTypeChannel.kChannelAddPublishStreamUrl]=this.addPublishStreamUrl,t[s.ApiTypeChannel.kChannelRemovePublishStreamUrl]=this.removePublishStreamUrl,t[s.ApiTypeChannel.kChannelSetLiveTranscoding]=this.setLiveTranscoding,t[s.ApiTypeChannel.kChannelAddInjectStreamUrl]=this.addInjectStreamUrl,t[s.ApiTypeChannel.kChannelRemoveInjectStreamUrl]=this.removeInjectStreamUrl,t[s.ApiTypeChannel.kChannelStartChannelMediaRelay]=this.startChannelMediaRelay,t[s.ApiTypeChannel.kChannelUpdateChannelMediaRelay]=this.updateChannelMediaRelay,t[s.ApiTypeChannel.kChannelStopChannelMediaRelay]=this.stopChannelMediaRelay,t[s.ApiTypeChannel.kChannelGetConnectionState]=this.getConnectionState,t),this._engine=e}return e.prototype.callApi=function(e,t,i){var n;return r(this,void 0,void 0,(function(){return o(this,(function(r){return(0,a.printf)("callApi",e,t,i,this),[2,null===(n=this._support_apis[e])||void 0===n?void 0:n.call(this,JSON.parse(t),i)]}))}))},e.prototype.setEventHandler=function(e){this._handler=e},e.prototype.getChannel=function(e){return this._channels.get(e)},e.prototype.createChannel=function(e){return r(this,void 0,void 0,(function(){var t,i,r=this;return o(this,(function(o){switch(o.label){case 0:return t=e.channelId,this._channels.has(t)?[2]:[4,this._engine.createChannel()];case 1:return(i=o.sent()).setEventHandler((function(e,i){var o;null===(o=r._handler)||void 0===o||o.call(r,e,JSON.stringify(n(n({},JSON.parse(i)),{channelId:t})))})),this._channels.set(t,i),[2]}}))}))},e.prototype.release=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return this._channels.get(t).release(),this._channels.delete(t),[2]}))}))},e.prototype.joinChannel=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r,s,a;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.token,r=e.info,s=e.uid,a=e.options,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.joinChannel({token:n,channelId:i,info:r,uid:s,options:a})]}))}))},e.prototype.joinChannelWithUserAccount=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r,s;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.token,r=e.userAccount,s=e.options,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.joinChannelWithUserAccount({token:n,channelId:i,userAccount:r,options:s})]}))}))},e.prototype.leaveChannel=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return[2,this._channels.get(t).leaveChannel()]}))}))},e.prototype.publish=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:if(t=e.channelId,!this._channels.has(t))throw"please create first";return[4,this._channels.get(t).muteLocalAudioStream({mute:!1})];case 1:return i.sent(),[4,this._channels.get(t).muteLocalVideoStream({mute:!1})];case 2:return i.sent(),[2]}}))}))},e.prototype.unPublish=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:if(t=e.channelId,!this._channels.has(t))throw"please create first";return[4,this._channels.get(t).muteLocalAudioStream({mute:!0})];case 1:return i.sent(),[4,this._channels.get(t).muteLocalVideoStream({mute:!0})];case 2:return i.sent(),[2]}}))}))},e.prototype.channelId=function(e){var t=e.channelId;if(!this._channels.has(t))throw"please create first";return t},e.prototype.renewToken=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.token,[2,this._channels.get(t).renewToken({token:i})]}))}))},e.prototype.setEncryptionSecret=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.secret,[2,this._channels.get(t).setEncryptionSecret({secret:i})]}))}))},e.prototype.setEncryptionMode=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.encryptionMode,[2,this._channels.get(t).setEncryptionMode({encryptionMode:i})]}))}))},e.prototype.enableEncryption=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.enabled,n=e.config,[2,this._channels.get(t).enableEncryption({enabled:i,config:n})]}))}))},e.prototype.setClientRole=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.role,n=e.options,[2,this._channels.get(t).setClientRole({role:i,options:n})]}))}))},e.prototype.setDefaultMuteAllRemoteAudioStreams=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setDefaultMuteAllRemoteAudioStreams({mute:n})]}))}))},e.prototype.setDefaultMuteAllRemoteVideoStreams=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setDefaultMuteAllRemoteVideoStreams({mute:n})]}))}))},e.prototype.muteLocalAudioStream=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteLocalAudioStream({mute:i})]}))}))},e.prototype.muteLocalVideoStream=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteLocalVideoStream({mute:i})]}))}))},e.prototype.muteAllRemoteAudioStreams=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteAllRemoteAudioStreams({mute:i})]}))}))},e.prototype.adjustUserPlaybackSignalVolume=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.uid,r=e.volume,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.adjustUserPlaybackSignalVolume({uid:n,volume:r})]}))}))},e.prototype.muteRemoteAudioStream=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.userId,r=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.muteRemoteAudioStream({userId:n,mute:r})]}))}))},e.prototype.muteAllRemoteVideoStreams=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteAllRemoteVideoStreams({mute:i})]}))}))},e.prototype.muteRemoteVideoStream=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.userId,r=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.muteRemoteVideoStream({userId:n,mute:r})]}))}))},e.prototype.setRemoteVideoStreamType=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.userId,r=e.streamType,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setRemoteVideoStreamType({userId:n,streamType:r})]}))}))},e.prototype.setRemoteDefaultVideoStreamType=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.streamType,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setRemoteDefaultVideoStreamType({streamType:n})]}))}))},e.prototype.addPublishStreamUrl=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.url,r=e.transcodingEnabled,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.addPublishStreamUrl({url:n,transcodingEnabled:r})]}))}))},e.prototype.removePublishStreamUrl=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.url,[2,this._channels.get(t).removePublishStreamUrl({url:i})]}))}))},e.prototype.setLiveTranscoding=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.transcoding,[2,this._channels.get(t).setLiveTranscoding({transcoding:i})]}))}))},e.prototype.addInjectStreamUrl=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.url,n=e.config,[2,this._channels.get(t).addInjectStreamUrl({url:i,config:n})]}))}))},e.prototype.removeInjectStreamUrl=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.url,[2,this._channels.get(t).removeInjectStreamUrl({url:i})]}))}))},e.prototype.startChannelMediaRelay=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.configuration,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.startChannelMediaRelay({configuration:n})]}))}))},e.prototype.updateChannelMediaRelay=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.configuration,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.updateChannelMediaRelay({configuration:n})]}))}))},e.prototype.stopChannelMediaRelay=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return[2,this._channels.get(t).stopChannelMediaRelay()]}))}))},e.prototype.getConnectionState=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return[2,this._channels.get(t).getConnectionState()]}))}))},e}();t.default=c},673:function(e,t,i){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(910),c=i(593),A=i(424),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.microphoneConfig={},t.cameraConfig={},t}return r(t,e),t.prototype.createMicrophoneAudioTrack=function(e,t,i){var n;return void 0===i&&(i=!1),o(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:if(!e)return(0,c.printf)("createMicrophoneAudioTrack",e),[2];if(this.localAudioTrack){if(!i)return[2,this.localAudioTrack];this.localAudioTrack.close(),this.localAudioTrack=void 0}return r=this,[4,A.createMicrophoneAudioTrack(this.microphoneConfig)];case 1:return r.localAudioTrack=o.sent(),null===(n=this.localAudioTrack)||void 0===n||n.on("track-ended",(function(){t("LocalAudioStateChanged",{state:a.LOCAL_AUDIO_STREAM_STATE.LOCAL_AUDIO_STREAM_STATE_FAILED,error:a.LOCAL_AUDIO_STREAM_ERROR.LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE})})),[2,this.localAudioTrack]}}))}))},t.prototype.createCameraVideoTrack=function(e,t,i){var n;return void 0===i&&(i=!1),o(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:if(!e)return(0,c.printf)("CreateCameraVideoTrack",e),[2];if(this.localVideoTrack){if(!i)return[2,this.localVideoTrack];this.localVideoTrack.close(),this.localVideoTrack=void 0}return r=this,[4,A.createCameraVideoTrack(this.cameraConfig)];case 1:return r.localVideoTrack=o.sent(),null===(n=this.localVideoTrack)||void 0===n||n.on("track-ended",(function(){t("LocalVideoStateChanged",{localVideoState:a.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_FAILED,error:a.LOCAL_VIDEO_STREAM_ERROR.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE})})),this.playLocalVideo(),[2,this.localVideoTrack]}}))}))},t.prototype.createScreenVideoTrack=function(e,t,i,n){var r,d,u,E;return void 0===n&&(n=!1),o(this,void 0,void 0,(function(){var o,l,h;return s(this,(function(s){switch(s.label){case 0:if(!e)return(0,c.printf)("createScreenVideoTrack",e),[2];if(this.localVideoTrack){if(!n)return[2,this.localVideoTrack];this.localVideoTrack.close(),this.localVideoTrack=void 0}return this.screenConfig={encoderConfig:{width:null===(r=null==i?void 0:i.dimensions)||void 0===r?void 0:r.width,height:null===(d=null==i?void 0:i.dimensions)||void 0===d?void 0:d.height,frameRate:null==i?void 0:i.frameRate,bitrateMin:null==i?void 0:i.bitrate,bitrateMax:null==i?void 0:i.bitrate}},[4,A.createScreenVideoTrack(this.screenConfig,"auto")];case 1:return void 0!==(null==(o=s.sent())?void 0:o.play)?this.localVideoTrack=o:(l=o[0],h=o[1],this.localVideoTrack=l,this.localAudioTrack=h,null===(u=this.localAudioTrack)||void 0===u||u.on("track-ended",(function(){t("LocalAudioStateChanged",{state:a.LOCAL_AUDIO_STREAM_STATE.LOCAL_AUDIO_STREAM_STATE_FAILED,error:a.LOCAL_AUDIO_STREAM_ERROR.LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE})}))),null===(E=this.localVideoTrack)||void 0===E||E.on("track-ended",(function(){t("LocalVideoStateChanged",{localVideoState:a.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_FAILED,error:a.LOCAL_VIDEO_STREAM_ERROR.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE})})),this.playLocalVideo(),[2,this.localVideoTrack]}}))}))},t.prototype.enableLocalAudio=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localAudioTrack)||void 0===t?void 0:t.setEnabled(e)]}))}))},t.prototype.enableLocalVideo=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localVideoTrack)||void 0===t?void 0:t.setEnabled(e)]}))}))},t.prototype.muteLocalAudio=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localAudioTrack)||void 0===t?void 0:t.setMuted(e)]}))}))},t.prototype.muteLocalVideo=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localVideoTrack)||void 0===t?void 0:t.setMuted(e)]}))}))},t.prototype.adjustRecordingSignalVolume=function(e){var t;null===(t=this.localAudioTrack)||void 0===t||t.setVolume(e)},t.prototype.setAudioEncoderConfiguration=function(e){this.microphoneConfig.encoderConfig=e},t.prototype.setVideoEncoderConfiguration=function(e){var t;return o(this,void 0,void 0,(function(){var i;return s(this,(function(n){return this.cameraConfig.encoderConfig=e,void 0!==(i=null===(t=this.localVideoTrack)||void 0===t?void 0:t.setEncoderConfiguration)?[2,i.call(this.localVideoTrack,this.cameraConfig.encoderConfig)]:[2]}))}))},t.prototype.setBeautyEffect=function(e,t){var i;return o(this,void 0,void 0,(function(){var n;return s(this,(function(r){return void 0!==(n=null===(i=this.localVideoTrack)||void 0===i?void 0:i.setBeautyEffect)?[2,n.call(this.localVideoTrack,e,t)]:[2]}))}))},t.prototype.stopCameraCapture=function(){var e;void 0===this.screenConfig&&(null===(e=this.localVideoTrack)||void 0===e||e.close(),this.localVideoTrack=void 0)},t.prototype.stopScreenCapture=function(){var e;void 0!==this.screenConfig&&(null===(e=this.localVideoTrack)||void 0===e||e.close(),this.localVideoTrack=void 0,this.screenConfig=void 0)},t.prototype.setupLocalVideo=function(e){void 0===e?this.canvasMap.delete(0):(this.canvasMap.set(e.uid,e),this.setupVideo(this.localVideoTrack,e))},t.prototype.playLocalVideo=function(){this.setupVideo(this.localVideoTrack,this.canvasMap.get(0))},t}(function(){function e(){this.canvasMap=new Map}return e.prototype.setupVideo=function(e,t){if(void 0!==t){var i,n=null==e?void 0:e.getUserId;if((i=void 0===n?0:n.call(e))===t.uid){var r="cover";switch(t.renderMode){case a.RENDER_MODE_TYPE.RENDER_MODE_HIDDEN:r="cover";break;case a.RENDER_MODE_TYPE.RENDER_MODE_FIT:r="contain";break;case a.RENDER_MODE_TYPE.RENDER_MODE_ADAPTIVE:r="cover";break;case a.RENDER_MODE_TYPE.RENDER_MODE_FILL:r="fill"}for(var o=t.view,s=0;s<o.children.length;s++)o.removeChild(o.children.item(s));var c;c=0===i&&t.mirrorMode===a.VIDEO_MIRROR_MODE_TYPE.VIDEO_MIRROR_MODE_AUTO||t.mirrorMode===a.VIDEO_MIRROR_MODE_TYPE.VIDEO_MIRROR_MODE_ENABLED,null==e||e.play(o,{mirror:c,fit:r})}}},e}()),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.remoteAudioTracks=[],t.remoteVideoTracks=[],t}return r(t,e),t.prototype.addRemoteAudioTrack=function(e){var t;e.setPlaybackDevice(null!==(t=this.audioPlaybackDeviceId)&&void 0!==t?t:""),this.remoteAudioTracks.push(e)},t.prototype.getRemoteAudioTrack=function(e){var t=this.remoteAudioTracks.findIndex((function(t){return t.getUserId()===e}));return this.remoteAudioTracks[t]},t.prototype.removeRemoteAudioTrack=function(e){var t=this.remoteAudioTracks.findIndex((function(t){return t.getUserId()===e}));this.remoteAudioTracks.splice(t,1)},t.prototype.clearRemoteAudioTracks=function(){this.remoteAudioTracks.splice(0,this.remoteAudioTracks.length)},t.prototype.addRemoteVideoTrack=function(e){this.remoteVideoTracks.push(e)},t.prototype.getRemoteVideoTrack=function(e){var t=this.remoteVideoTracks.findIndex((function(t){return t.getUserId()===e}));return this.remoteVideoTracks[t]},t.prototype.removeRemoteVideoTrack=function(e){var t=this.remoteVideoTracks.findIndex((function(t){return t.getUserId()===e}));this.remoteVideoTracks.splice(t,1)},t.prototype.clearRemoteVideoTracks=function(){this.remoteVideoTracks.splice(0,this.remoteVideoTracks.length)},t.prototype.adjustPlaybackSignalVolume=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.remoteAudioTracks.map((function(t){return t.setVolume(e)}))]}))}))},t.prototype.adjustUserPlaybackSignalVolume=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this.remoteAudioTracks.map((function(i){if(i.getUserId()===e)return i.setVolume(t)}))]}))}))},t.prototype.enableRemoteAudio=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.remoteAudioTracks.map((function(t){return e?t.play():t.stop()}))]}))}))},t.prototype.enableRemoteVideo=function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(i){return[2,this.remoteVideoTracks.map((function(i){e?t.setupVideo(i,t.canvasMap.get(i.getUserId())):i.stop()}))]}))}))},t.prototype.setupRemoteVideo=function(e,t){void 0===t?this.canvasMap.delete(e):(this.canvasMap.set(e,t),this.setupVideo(this.getRemoteVideoTrack(e),t))},t.prototype.playRemoteVideo=function(e){this.setupVideo(this.getRemoteVideoTrack(e),this.canvasMap.get(e))},t}(d),E=function(e){function t(){var t,i,n=null!==e&&e.apply(this,arguments)||this;return n._support_apis_audio=((t={})[a.ApiTypeAudioDeviceManager.kADMEnumeratePlaybackDevices]=n.enumerateAudioPlaybackDevices,t[a.ApiTypeAudioDeviceManager.kADMSetPlaybackDevice]=n.setAudioPlaybackDevice,t[a.ApiTypeAudioDeviceManager.kADMGetPlaybackDevice]=n.getAudioPlaybackDevice,t[a.ApiTypeAudioDeviceManager.kADMGetPlaybackDeviceInfo]=n.getAudioPlaybackDeviceInfo,t[a.ApiTypeAudioDeviceManager.kADMEnumerateRecordingDevices]=n.enumerateAudioRecordingDevices,t[a.ApiTypeAudioDeviceManager.kADMSetRecordingDevice]=n.setAudioRecordingDevice,t[a.ApiTypeAudioDeviceManager.kADMGetRecordingDevice]=n.getAudioRecordingDevice,t[a.ApiTypeAudioDeviceManager.kADMGetRecordingDeviceInfo]=n.getAudioRecordingDeviceInfo,t[a.ApiTypeAudioDeviceManager.kADMSetRecordingDeviceVolume]=n.setAudioRecordingDeviceVolume,t[a.ApiTypeAudioDeviceManager.kADMGetRecordingDeviceVolume]=n.getAudioRecordingDeviceVolume,t),n._support_apis_video=((i={})[a.ApiTypeVideoDeviceManager.kVDMEnumerateVideoDevices]=n.enumerateVideoDevices,i[a.ApiTypeVideoDeviceManager.kVDMSetDevice]=n.setVideoDeviceId,i[a.ApiTypeVideoDeviceManager.kVDMGetDevice]=n.getVideoDeviceId,i),n}return r(t,e),t.prototype.callApiAudio=function(e,t,i){var n;return o(this,void 0,void 0,(function(){return s(this,(function(r){return(0,c.printf)("callApiAudio",e,t,i,this),[2,null===(n=this._support_apis_audio[e])||void 0===n?void 0:n.call(this,JSON.parse(t),i)]}))}))},t.prototype.callApiVideo=function(e,t,i){var n;return o(this,void 0,void 0,(function(){return s(this,(function(r){return(0,c.printf)("callApiVideo",e,t,i,this),[2,null===(n=this._support_apis_video[e])||void 0===n?void 0:n.call(this,JSON.parse(t),i)]}))}))},t.prototype.release=function(){var e,t;null===(e=this.localAudioTrack)||void 0===e||e.close(),this.localAudioTrack=void 0,null===(t=this.localVideoTrack)||void 0===t||t.close(),this.localVideoTrack=void 0,this.clearRemoteAudioTracks(),this.clearRemoteVideoTracks()},t.prototype.enumerateAudioPlaybackDevices=function(){var e;return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,null===(e=A.getPlaybackDevices())||void 0===e?void 0:e.then((function(e){return JSON.stringify(e.map((function(e){return{deviceId:e.deviceId,deviceName:e.label}})))}))]}))}))},t.prototype.setAudioPlaybackDevice=function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(i){switch(i.label){case 0:return this.audioPlaybackDeviceId=e.deviceId,[4,Promise.all(this.remoteAudioTracks.map((function(e){var i;return e.setPlaybackDevice(null!==(i=t.audioPlaybackDeviceId)&&void 0!==i?i:"")})))];case 1:return i.sent(),[2]}}))}))},t.prototype.getAudioPlaybackDevice=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,null!==(t=this.audioPlaybackDeviceId)&&void 0!==t?t:""]}))}))},t.prototype.getAudioPlaybackDeviceInfo=function(e){var t;return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(i){return[2,null===(t=A.getPlaybackDevices())||void 0===t?void 0:t.then((function(t){var i=t.find((function(t){return t.deviceId===e.audioPlaybackDeviceId}));return JSON.stringify({deviceId:i.deviceId,deviceName:i.label})}))]}))}))},t.prototype.enumerateAudioRecordingDevices=function(){var e;return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,null===(e=A.getMicrophones())||void 0===e?void 0:e.then((function(e){return JSON.stringify(e.map((function(e){return{deviceId:e.deviceId,deviceName:e.label}})))}))]}))}))},t.prototype.setAudioRecordingDevice=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.microphoneConfig.microphoneId=e.deviceId,[2]}))}))},t.prototype.getAudioRecordingDevice=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,null!==(t=this.microphoneConfig.microphoneId)&&void 0!==t?t:""]}))}))},t.prototype.setAudioRecordingDeviceVolume=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.adjustRecordingSignalVolume(e.volume)]}))}))},t.prototype.getAudioRecordingDeviceVolume=function(){var e,t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null!==(t=null===(e=this.localAudioTrack)||void 0===e?void 0:e.getVolumeLevel())&&void 0!==t?t:0]}))}))},t.prototype.getAudioRecordingDeviceInfo=function(e){var t;return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(i){return[2,null===(t=A.getMicrophones())||void 0===t?void 0:t.then((function(t){var i=t.find((function(t){return t.deviceId===e.microphoneConfig.microphoneId}));return JSON.stringify({deviceId:i.deviceId,deviceName:i.label})}))]}))}))},t.prototype.enumerateVideoDevices=function(){var e;return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,null===(e=A.getCameras())||void 0===e?void 0:e.then((function(e){return JSON.stringify(e.map((function(e){return{deviceId:e.deviceId,deviceName:e.label}})))}))]}))}))},t.prototype.setVideoDeviceId=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.cameraConfig!==e.deviceId&&(this.cameraConfig.cameraId=e.deviceId,this.localAudioTrack&&this.localAudioTrack.getTrackLabel()),[2]}))}))},t.prototype.getVideoDeviceId=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,null!==(t=this.cameraConfig.cameraId)&&void 0!==t?t:""]}))}))},t}(u);t.default=E},986:function(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(424),s=i(673),a=i(910),c=i(593),A=i(554),d=i(424),u=function(){function e(){var e;this.channel=new A.default(this),this.deviceManager=new s.default,this._support_apis=((e={})[a.ApiTypeEngine.kEngineInitialize]=this.initialize,e[a.ApiTypeEngine.kEngineRelease]=this.release,e[a.ApiTypeEngine.kEngineSetChannelProfile]=this.setChannelProfile,e[a.ApiTypeEngine.kEngineSetClientRole]=this.setClientRole,e[a.ApiTypeEngine.kEngineJoinChannel]=this.joinChannel,e[a.ApiTypeEngine.kEngineLeaveChannel]=this.leaveChannel,e[a.ApiTypeEngine.kEngineRenewToken]=this.renewToken,e[a.ApiTypeEngine.kEngineJoinChannelWithUserAccount]=this.joinChannelWithUserAccount,e[a.ApiTypeEngine.kEngineEnableVideo]=this.enableVideo,e[a.ApiTypeEngine.kEngineDisableVideo]=this.disableVideo,e[a.ApiTypeEngine.kEngineSetVideoEncoderConfiguration]=this.setVideoEncoderConfiguration,e[a.ApiTypeEngine.kEngineSetupLocalVideo]=this.setupLocalVideo,e[a.ApiTypeEngine.kEngineSetupRemoteVideo]=this.setupRemoteVideo,e[a.ApiTypeEngine.kEngineStartPreview]=this.startPreview,e[a.ApiTypeEngine.kEngineStopPreview]=this.stopPreview,e[a.ApiTypeEngine.kEngineEnableAudio]=this.enableAudio,e[a.ApiTypeEngine.kEngineEnableLocalAudio]=this.enableLocalAudio,e[a.ApiTypeEngine.kEngineDisableAudio]=this.disableAudio,e[a.ApiTypeEngine.kEngineSetAudioProfile]=this.setAudioProfile,e[a.ApiTypeEngine.kEngineMuteLocalAudioStream]=this.muteLocalAudioStream,e[a.ApiTypeEngine.kEngineMuteAllRemoteAudioStreams]=this.muteAllRemoteAudioStreams,e[a.ApiTypeEngine.kEngineSetDefaultMuteAllRemoteAudioStreams]=this.setDefaultMuteAllRemoteAudioStreams,e[a.ApiTypeEngine.kEngineAdjustUserPlaybackSignalVolume]=this.adjustUserPlaybackSignalVolume,e[a.ApiTypeEngine.kEngineMuteRemoteAudioStream]=this.muteRemoteAudioStream,e[a.ApiTypeEngine.kEngineMuteLocalVideoStream]=this.muteLocalVideoStream,e[a.ApiTypeEngine.kEngineEnableLocalVideo]=this.enableLocalVideo,e[a.ApiTypeEngine.kEngineMuteAllRemoteVideoStreams]=this.muteAllRemoteVideoStreams,e[a.ApiTypeEngine.kEngineSetDefaultMuteAllRemoteVideoStreams]=this.setDefaultMuteAllRemoteVideoStreams,e[a.ApiTypeEngine.kEngineMuteRemoteVideoStream]=this.muteRemoteVideoStream,e[a.ApiTypeEngine.kEngineSetRemoteVideoStreamType]=this.setRemoteVideoStreamType,e[a.ApiTypeEngine.kEngineSetRemoteDefaultVideoStreamType]=this.setRemoteDefaultVideoStreamType,e[a.ApiTypeEngine.kEngineEnableAudioVolumeIndication]=this.enableAudioVolumeIndication,e[a.ApiTypeEngine.kEngineSetLogFilter]=this.setLogFilter,e[a.ApiTypeEngine.kEngineUploadLogFile]=this.uploadLogFile,e[a.ApiTypeEngine.kEngineEnableDualStreamMode]=this.enableDualStreamMode,e[a.ApiTypeEngine.kEngineAdjustRecordingSignalVolume]=this.adjustRecordingSignalVolume,e[a.ApiTypeEngine.kEngineAdjustPlaybackSignalVolume]=this.adjustPlaybackSignalVolume,e[a.ApiTypeEngine.kEngineSetRemoteSubscribeFallbackOption]=this.setRemoteSubscribeFallbackOption,e[a.ApiTypeEngine.kEngineStartScreenCaptureByDisplayId]=this.startScreenCaptureByDisplayId,e[a.ApiTypeEngine.kEngineStartScreenCaptureByScreenRect]=this.startScreenCaptureByScreenRect,e[a.ApiTypeEngine.kEngineStartScreenCaptureByWindowId]=this.startScreenCaptureByWindowId,e[a.ApiTypeEngine.kEngineStopScreenCapture]=this.stopScreenCapture,e[a.ApiTypeEngine.kEngineStartScreenCapture]=this.startScreenCapture,e[a.ApiTypeEngine.kEngineGetVersion]=this.getVersion,e[a.ApiTypeEngine.kEngineSetEncryptionSecret]=this.setEncryptionSecret,e[a.ApiTypeEngine.kEngineSetEncryptionMode]=this.setEncryptionMode,e[a.ApiTypeEngine.kEngineEnableEncryption]=this.enableEncryption,e[a.ApiTypeEngine.kEngineAddPublishStreamUrl]=this.addPublishStreamUrl,e[a.ApiTypeEngine.kEngineRemovePublishStreamUrl]=this.removePublishStreamUrl,e[a.ApiTypeEngine.kEngineSetLiveTranscoding]=this.setLiveTranscoding,e[a.ApiTypeEngine.kEngineSetBeautyEffectOptions]=this.setBeautyEffectOptions,e[a.ApiTypeEngine.kEngineAddInjectStreamUrl]=this.addInjectStreamUrl,e[a.ApiTypeEngine.kEngineStartChannelMediaRelay]=this.startChannelMediaRelay,e[a.ApiTypeEngine.kEngineUpdateChannelMediaRelay]=this.updateChannelMediaRelay,e[a.ApiTypeEngine.kEngineStopChannelMediaRelay]=this.stopChannelMediaRelay,e[a.ApiTypeEngine.kEngineRemoveInjectStreamUrl]=this.removeInjectStreamUrl,e[a.ApiTypeEngine.kEngineSendCustomReportMessage]=this.sendCustomReportMessage,e[a.ApiTypeEngine.kEngineGetConnectionState]=this.getConnectionState,e[a.ApiTypeEngine.kEngineSetParameters]=this.setParameters,e[a.ApiTypeEngine.kEngineSetAppType]=this.setAppType,e[a.ApiTypeEngine.kEngineSetCloudProxy]=this.setCloudProxy,e),this._reset()}return e.prototype._reset=function(){this._config={codec:"h264",mode:"rtc"},this._client=void 0,this._context=void 0,this._handler=void 0,this._enableAudio=!0,this._enableVideo=!1,this._enableLocalAudio=!0,this._enableLocalVideo=!0,this._muteLocalAudio=!1,this._muteLocalVideo=!1,this._defaultMuteAllRemoteAudioStreams=!1,this._defaultMuteAllRemoteVideoStreams=!1,this._encryptionMode=void 0,this._secret=void 0},e.prototype._addListener=function(){var e=this;if(void 0===this._client)throw"please create first";this._client.on("connection-state-change",(function(t,i,n){(0,c.printf)("connection-state-change",t,i,i),e._emitEvent("ConnectionStateChanged",{state:(0,c.ConnectionStateToNative)(t),reason:(0,c.ConnectionDisconnectedReasonToNative)(n)})})),this._client.on("user-joined",(function(t){(0,c.printf)("user-joined",t),e._emitEvent("UserJoined",{uid:t.uid,elapsed:0})})),this._client.on("user-left",(function(t,i){(0,c.printf)("user-left",t,i),e._emitEvent("UserOffline",{uid:t.uid,reason:(0,c.UserLeftReasonToNative)(i)})})),this._client.on("user-published",(function(t,i){return n(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:switch((0,c.printf)("user-published",t,i),i){case"audio":return[3,1];case"video":return[3,3]}return[3,5];case 1:return!this._enableAudio||this._defaultMuteAllRemoteAudioStreams?[2]:[4,this.muteRemoteAudioStream({userId:t,mute:!1})];case 2:return e.sent(),this._emitEvent("RemoteAudioStateChanged",{uid:t.uid,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_DECODING,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,elapsed:0}),[3,5];case 3:return!this._enableVideo||this._defaultMuteAllRemoteVideoStreams?[2]:[4,this.muteRemoteVideoStream({userId:t,mute:!1})];case 4:return e.sent(),this._emitEvent("RemoteVideoStateChanged",{uid:t.uid,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_DECODING,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,elapsed:0}),[3,5];case 5:return[2]}}))}))})),this._client.on("user-unpublished",(function(t,i){switch((0,c.printf)("user-unpublished",t,i),i){case"audio":e.deviceManager.removeRemoteAudioTrack(t.uid),e._emitEvent("RemoteAudioStateChanged",{uid:t.uid,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED,elapsed:0});break;case"video":e.deviceManager.removeRemoteVideoTrack(t.uid),e._emitEvent("RemoteVideoStateChanged",{uid:t.uid,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STOPPED,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,elapsed:0})}})),this._client.on("user-info-updated",(function(t,i){switch((0,c.printf)("user-info-updated",t,i),i){case"mute-audio":e._emitEvent("RemoteAudioStateChanged",{uid:t,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED,elapsed:0});break;case"mute-video":case"disable-local-video":e._emitEvent("RemoteVideoStateChanged",{uid:t,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STOPPED,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,elapsed:0});break;case"unmute-audio":e._emitEvent("RemoteAudioStateChanged",{uid:t,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_DECODING,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,elapsed:0});break;case"unmute-video":case"enable-local-video":e._emitEvent("RemoteVideoStateChanged",{uid:t,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_DECODING,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,elapsed:0})}})),this._client.on("media-reconnect-start",(function(e){(0,c.printf)("media-reconnect-start",e)})),this._client.on("media-reconnect-end",(function(e){(0,c.printf)("media-reconnect-end",e)})),this._client.on("stream-type-changed",(function(e,t){(0,c.printf)("stream-type-changed",e,t)})),this._client.on("stream-fallback",(function(t,i){(0,c.printf)("stream-fallback",t,i),e._emitEvent("RemoteSubscribeFallbackToAudioOnly",{uid:t,isFallbackOrRecover:"fallback"===i})})),this._client.on("channel-media-relay-state",(function(t,i){(0,c.printf)("channel-media-relay-state",t,i),e._emitEvent("ChannelMediaRelayStateChanged",{state:(0,c.ChannelMediaRelayStateToNative)(t),code:(0,c.ChannelMediaRelayErrorToNative)(i)})})),this._client.on("channel-media-relay-event",(function(t){(0,c.printf)("channel-media-relay-event",t),e._emitEvent("ChannelMediaRelayEvent",{code:(0,c.ChannelMediaRelayEventToNative)(t)})})),this._client.on("volume-indicator",(function(t){(0,c.printf)("volume-indicator",t);var i=0,n=t.map((function(t){var n,r,o=Math.floor(t.level/100*255);return i+=o,{uid:+t.uid,volume:o,vad:0,channelId:null!==(r=null===(n=e._client)||void 0===n?void 0:n.channelName)&&void 0!==r?r:""}}));e._emitEvent("AudioVolumeIndication",{speakers:n,speakerNumber:t.length,totalVolume:i})})),this._client.on("crypt-error",(function(){(0,c.printf)("crypt-error")})),this._client.on("token-privilege-will-expire",(function(){(0,c.printf)("token-privilege-will-expire"),e._emitEvent("TokenPrivilegeWillExpire")})),this._client.on("token-privilege-did-expire",(function(){(0,c.printf)("token-privilege-did-expire")})),this._client.on("network-quality",(function(t){var i;(0,c.printf)("network-quality",t),e._emitEvent("NetworkQuality",{uid:0,txQuality:(0,c.NetworkQualityToNative)(t.uplinkNetworkQuality),rxQuality:(0,c.NetworkQualityToNative)(t.downlinkNetworkQuality)});var n=null===(i=e._client)||void 0===i?void 0:i.getRemoteNetworkQuality();if(n)for(var r in n)e._emitEvent("NetworkQuality",{uid:+r,txQuality:(0,c.NetworkQualityToNative)(n[r].uplinkNetworkQuality),rxQuality:(0,c.NetworkQualityToNative)(n[r].downlinkNetworkQuality)})})),this._client.on("live-streaming-error",(function(t,i){(0,c.printf)("live-streaming-error",t,i),e._emitEvent("RtmpStreamingStateChanged",{url:t,state:a.RTMP_STREAM_PUBLISH_STATE.RTMP_STREAM_PUBLISH_STATE_IDLE,errCode:(0,c.RtmpStreamingErrorToNative)(i.code)})})),this._client.on("live-streaming-warning",(function(t,i){(0,c.printf)("live-streaming-warning",t,i),"LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE"===i.code?e._emitEvent("RtmpStreamingEvent",{url:t,eventCode:a.RTMP_STREAMING_EVENT.RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE}):e._emitEvent("RtmpStreamingStateChanged",{url:t,state:a.RTMP_STREAM_PUBLISH_STATE.RTMP_STREAM_PUBLISH_STATE_IDLE,errCode:(0,c.RtmpStreamingErrorToNative)(i.code)})})),this._client.on("stream-inject-status",(function(t,i,n){(0,c.printf)("stream-inject-status",t,i,n),e._emitEvent("StreamInjectedStatus",{url:n,uid:i,status:(0,c.InjectStreamEventStatusToNative)(t)})})),this._client.on("exception",(function(t){(0,c.printf)("exception",t),t.code in a.ERROR_CODE_TYPE&&e._emitEvent("Error",{err:t.code,msg:""})})),this._client.on("is-using-cloud-proxy",(function(e){(0,c.printf)("is-using-cloud-proxy",e)}))},e.prototype._emitEvent=function(e,t){var i;void 0===t&&(t={}),(0,c.printf)("_emitEvent",e,t,this._handler),null===(i=this._handler)||void 0===i||i.call(this,e,JSON.stringify(t))},e.prototype._createClient=function(){void 0===this._client&&(this._client=d.createClient(this._config),this._addListener())},e._setLogLevel=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){if(void 0!==e.level){switch(t=0,e.level){case a.LOG_LEVEL.LOG_LEVEL_NONE:t=4;break;case a.LOG_LEVEL.LOG_LEVEL_INFO:t=1;break;case a.LOG_LEVEL.LOG_LEVEL_WARN:t=2;break;case a.LOG_LEVEL.LOG_LEVEL_ERROR:case a.LOG_LEVEL.LOG_LEVEL_FATAL:t=3}return[2,d.setLogLevel(t)]}return[2]}))}))},e._setArea=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return void 0!==e?[2,d.setArea(e.map((function(e){switch(e){case a.AREA_CODE.AREA_CODE_CN:return o.AREAS.CHINA;case a.AREA_CODE.AREA_CODE_NA:return o.AREAS.NORTH_AMERICA;case a.AREA_CODE.AREA_CODE_EU:return o.AREAS.EUROPE;case a.AREA_CODE.AREA_CODE_AS:return o.AREAS.ASIA;case a.AREA_CODE.AREA_CODE_JP:return o.AREAS.JAPAN;case a.AREA_CODE.AREA_CODE_IN:return o.AREAS.INDIA;case a.AREA_CODE.AREA_CODE_GLOB:return o.AREAS.GLOBAL}})))]:[2]}))}))},e.prototype._publish=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(void 0===this._client)throw"please create first";return void 0===e?[2]:void 0===(null==e?void 0:e.setBeautyEffect)?[3,2]:[4,this.deviceManager.muteLocalVideo(this._muteLocalVideo)];case 1:return t.sent(),[3,4];case 2:return[4,this.deviceManager.muteLocalAudio(this._muteLocalAudio)];case 3:t.sent(),t.label=4;case 4:return[2,this._client.publish(e)]}}))}))},e.prototype.callApi=function(e,t,i){var o;return n(this,void 0,void 0,(function(){return r(this,(function(n){return(0,c.printf)("callApi",e,t,i,this),[2,null===(o=this._support_apis[e])||void 0===o?void 0:o.call(this,JSON.parse(t),i)]}))}))},e.prototype.setEventHandler=function(e){this._handler=e},e.prototype.createChannel=function(){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._context)throw"please create first";return(t=new e)._config.mode=this._config.mode,t._enableAudio=this._enableAudio,t._enableLocalAudio=this._enableLocalAudio,t._enableVideo=this._enableVideo,t._enableLocalVideo=this._enableLocalVideo,[4,t.initialize({context:this._context})];case 1:return i.sent(),[2,t]}}))}))},e.prototype.initialize=function(t,i){var o;return n(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return this._context=t.context,[4,e._setArea(t.context.areaCode)];case 1:return n.sent(),[4,e._setLogLevel({level:null===(o=t.context.logConfig)||void 0===o?void 0:o.level})];case 2:return n.sent(),void 0!==i&&(this._config=i),this._createClient(),[2]}}))}))},e.prototype.release=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.leaveChannel()];case 1:return e.sent(),this.deviceManager.release(),this._reset(),[2]}}))}))},e.prototype.setChannelProfile=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:switch(e.profile){case a.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_COMMUNICATION:t="rtc";break;case a.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_LIVE_BROADCASTING:t="live";case a.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_GAME:}return void 0===t||t===this._config.mode?[3,2]:[4,this.leaveChannel()];case 1:i.sent(),this.deviceManager.release(),this._config.mode=t,this._client=void 0,this._createClient(),i.label=2;case 2:return[2]}}))}))},e.prototype.setClientRole=function(e){var t;return n(this,void 0,void 0,(function(){var i,n;return r(this,(function(r){if(void 0===this._client)throw"please create first";switch(e.role){case a.CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER:i="host";break;case a.CLIENT_ROLE_TYPE.CLIENT_ROLE_AUDIENCE:i="audience"}switch(null===(t=e.options)||void 0===t?void 0:t.audienceLatencyLevel){case a.AUDIENCE_LATENCY_LEVEL_TYPE.AUDIENCE_LATENCY_LEVEL_LOW_LATENCY:n=o.AudienceLatencyLevelType.AUDIENCE_LEVEL_LOW_LATENCY;break;case a.AUDIENCE_LATENCY_LEVEL_TYPE.AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY:n=o.AudienceLatencyLevelType.AUDIENCE_LEVEL_ULTRA_LOW_LATENCY}return[2,this._client.setClientRole(i,n?{level:n}:void 0)]}))}))},e.prototype.joinChannel=function(e){var t,i;return n(this,void 0,void 0,(function(){var o,s,a,c=this;return r(this,(function(A){if(void 0===this._context)throw"please create first";return o=e.channelId,s=e.token,a=e.uid,[2,null===(t=this._client)||void 0===t?void 0:t.join(null===(i=this._context)||void 0===i?void 0:i.appId,o,s,a).then((function(e){return n(c,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,,5,6]),t=this._publish,[4,this.deviceManager.createMicrophoneAudioTrack(this._enableAudio&&this._enableLocalAudio,this._emitEvent.bind(this))];case 1:return[4,t.apply(this,[n.sent()])];case 2:return n.sent(),i=this._publish,[4,this.deviceManager.createCameraVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this))];case 3:return[4,i.apply(this,[n.sent()])];case 4:return n.sent(),[3,6];case 5:return this._emitEvent("JoinChannelSuccess",{channel:o,uid:e,elapsed:0}),[7];case 6:return[2]}}))}))}))]}))}))},e.prototype.leaveChannel=function(e){return n(this,void 0,void 0,(function(){var e=this;return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.leave().then((function(){var t;e.deviceManager.release();var i={cpuAppUsage:0,cpuTotalUsage:0,duration:0,gatewayRtt:0,lastmileDelay:0,memoryAppUsageInKbytes:0,memoryAppUsageRatio:0,memoryTotalUsageRatio:0,rxAudioBytes:0,rxAudioKBitRate:0,rxBytes:0,rxKBitRate:0,rxPacketLossRate:0,rxVideoBytes:0,rxVideoKBitRate:0,txAudioBytes:0,txAudioKBitRate:0,txBytes:0,txKBitRate:0,txPacketLossRate:0,txVideoBytes:0,txVideoKBitRate:0,userCount:0},n=null===(t=e._client)||void 0===t?void 0:t.getRTCStats();n&&(i.duration=n.Duration,i.rxKBitRate=n.RecvBitrate,i.rxBytes=n.RecvBytes,i.txKBitRate=n.SendBitrate,i.txBytes=n.SendBytes,i.userCount=n.UserCount,i.gatewayRtt=n.RTT),e._emitEvent("LeaveChannel",{stats:i})}))]}))}))},e.prototype.renewToken=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.renewToken(e.token)]}))}))},e.prototype.joinChannelWithUserAccount=function(e){var t;return n(this,void 0,void 0,(function(){var i,o,s,a=this;return r(this,(function(c){if(void 0===this._context)throw"please create first";return i=e.channelId,o=e.token,s=e.userAccount,[2,null===(t=this._client)||void 0===t?void 0:t.join(this._context.appId,i,o,s).then((function(e){return n(a,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return t.trys.push([0,,4,5]),[4,this.deviceManager.createMicrophoneAudioTrack(this._enableAudio&&this._enableLocalAudio,this._emitEvent.bind(this))];case 1:return t.sent(),[4,this.deviceManager.createCameraVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this))];case 2:return t.sent(),[4,this._publish()];case 3:return t.sent(),[3,5];case 4:return this._emitEvent("JoinChannelSuccess",{channel:i,uid:e,elapsed:0}),[7];case 5:return[2]}}))}))}))]}))}))},e.prototype.enableVideo=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableVideo=!0,[4,Promise.all([this.deviceManager.enableLocalVideo(this._enableVideo&&this._enableLocalAudio),this.deviceManager.enableRemoteVideo(this._enableVideo)])];case 1:return e.sent(),[2]}}))}))},e.prototype.disableVideo=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableVideo=!1,[4,Promise.all([this.deviceManager.enableLocalVideo(this._enableVideo&&this._enableLocalAudio),this.deviceManager.enableRemoteVideo(this._enableVideo)])];case 1:return e.sent(),[2]}}))}))},e.prototype.setVideoEncoderConfiguration=function(e){var t,i;return n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.deviceManager.setVideoEncoderConfiguration({width:null===(t=e.config.dimensions)||void 0===t?void 0:t.width,height:null===(i=e.config.dimensions)||void 0===i?void 0:i.height,frameRate:e.config.frameRate,bitrateMin:e.config.minBitrate,bitrateMax:e.config.bitrate})]}))}))},e.prototype.setupLocalVideo=function(e,t){return n(this,void 0,void 0,(function(){var i,n;return r(this,(function(r){return i=e.canvas,void 0!==t&&(i.view=t),void 0!==(n=this.channel.getChannel(i.channelId))?n.deviceManager.setupLocalVideo(i):this.deviceManager.setupLocalVideo(i),[2]}))}))},e.prototype.setupRemoteVideo=function(e,t){return n(this,void 0,void 0,(function(){var i,n;return r(this,(function(r){return i=e.canvas,void 0!==t&&(i.view=t),void 0!==(n=this.channel.getChannel(i.channelId))?n.deviceManager.setupRemoteVideo(i.uid,i):this.deviceManager.setupRemoteVideo(i.uid,i),[2]}))}))},e.prototype.startPreview=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:if(void 0===this._client)throw"please create first";return void 0!==this._client.channelName?[2]:[4,this.deviceManager.createCameraVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),!0)];case 1:return e.sent(),[2]}}))}))},e.prototype.stopPreview=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return void 0!==this._client.channelName?[2]:[2,this.deviceManager.stopCameraCapture()]}))}))},e.prototype.enableAudio=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableAudio=!0,[4,Promise.all([this.deviceManager.enableLocalAudio(this._enableAudio&&this._enableLocalAudio),this.deviceManager.enableRemoteAudio(this._enableAudio)])];case 1:return e.sent(),[2]}}))}))},e.prototype.enableLocalAudio=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._enableLocalAudio=e.enabled,[2,this.deviceManager.enableLocalAudio(this._enableAudio&&this._enableLocalAudio)]}))}))},e.prototype.disableAudio=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableAudio=!1,[4,Promise.all([this.deviceManager.enableLocalAudio(this._enableAudio&&this._enableLocalAudio),this.deviceManager.enableRemoteAudio(this._enableAudio)])];case 1:return e.sent(),[2]}}))}))},e.prototype.setAudioProfile=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(t="music_standard",e.profile){case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_DEFAULT:t="music_standard";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_SPEECH_STANDARD:t="speech_standard";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_STANDARD:t="music_standard";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_STANDARD_STEREO:t="standard_stereo";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_HIGH_QUALITY:t="high_quality";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO:t="high_quality_stereo";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_IOT:t="speech_low_quality"}return this.deviceManager.setAudioEncoderConfiguration(t),[2]}))}))},e.prototype.muteLocalAudioStream=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return this._muteLocalAudio=e.mute,[2,this.deviceManager.muteLocalAudio(this._muteLocalAudio)]}))}))},e.prototype.muteAllRemoteAudioStreams=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){return t.muteRemoteAudioStream({userId:i,mute:e.mute})})))];case 1:return i.sent(),[2]}}))}))},e.prototype.setDefaultMuteAllRemoteAudioStreams=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._defaultMuteAllRemoteAudioStreams=e.mute,[2]}))}))},e.prototype.adjustUserPlaybackSignalVolume=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.deviceManager.adjustUserPlaybackSignalVolume(e.uid,e.volume)];case 1:return t.sent(),[2]}}))}))},e.prototype.muteRemoteAudioStream=function(e){return n(this,void 0,void 0,(function(){var t,i=this;return r(this,(function(o){switch(o.label){case 0:if(void 0===this._client)throw"please create first";return t=function(t){return n(i,void 0,void 0,(function(){var i=this;return r(this,(function(n){if(void 0===this._client)throw"please create first";return e.mute?[2,this._client.unsubscribe(t,"audio").then((function(){i.deviceManager.removeRemoteAudioTrack(t.uid)}))]:[2,this._client.subscribe(t,"audio").then((function(e){e.on("first-frame-decoded",(function(){(0,c.printf)("first-frame-decoded","audio",e),i._emitEvent("RemoteAudioStateChanged",{uid:t.uid,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STARTING,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,elapsed:0})})),i.deviceManager.addRemoteAudioTrack(e),e.play()}))]}))}))},"number"!=typeof e.userId?[3,2]:[4,Promise.all(this._client.remoteUsers.map((function(i){if(i.uid===e.userId)return t(i)})))];case 1:return o.sent(),[3,3];case 2:return[2,t(e.userId)];case 3:return[2]}}))}))},e.prototype.muteLocalVideoStream=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return this._muteLocalVideo=e.mute,[2,this.deviceManager.muteLocalVideo(this._muteLocalVideo)]}))}))},e.prototype.enableLocalVideo=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._enableLocalVideo=e.enabled,[2,this.deviceManager.enableLocalVideo(this._enableVideo&&this._enableLocalVideo)]}))}))},e.prototype.muteAllRemoteVideoStreams=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){return t.muteRemoteVideoStream({userId:i,mute:e.mute})})))];case 1:return i.sent(),[2]}}))}))},e.prototype.setDefaultMuteAllRemoteVideoStreams=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._defaultMuteAllRemoteVideoStreams=e.mute,[2]}))}))},e.prototype.muteRemoteVideoStream=function(e){return n(this,void 0,void 0,(function(){var t,i=this;return r(this,(function(o){switch(o.label){case 0:if(void 0===this._client)throw"please create first";return t=function(t){return n(i,void 0,void 0,(function(){var i=this;return r(this,(function(n){if(void 0===this._client)throw"please create first";return e.mute?[2,this._client.unsubscribe(t,"video").then((function(){i.deviceManager.removeRemoteAudioTrack(t.uid)}))]:[2,this._client.subscribe(t,"video").then((function(e){e.on("first-frame-decoded",(function(){(0,c.printf)("first-frame-decoded","video",e),i._emitEvent("RemoteVideoStateChanged",{uid:t.uid,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STARTING,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,elapsed:0})})),i.deviceManager.addRemoteVideoTrack(e),i.deviceManager.playRemoteVideo(t.uid)}))]}))}))},"number"!=typeof e.userId?[3,2]:[4,Promise.all(this._client.remoteUsers.map((function(i){if(i.uid===e.userId)return t(i)})))];case 1:return o.sent(),[3,3];case 2:return[2,t(e.userId)];case 3:return[2]}}))}))},e.prototype.setRemoteVideoStreamType=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";switch(e.streamType){case a.REMOTE_VIDEO_STREAM_TYPE.REMOTE_VIDEO_STREAM_HIGH:t=o.RemoteStreamType.HIGH_STREAM;break;case a.REMOTE_VIDEO_STREAM_TYPE.REMOTE_VIDEO_STREAM_LOW:t=o.RemoteStreamType.LOW_STREAM}return[4,this._client.setRemoteVideoStreamType(e.userId,t)];case 1:return i.sent(),[2]}}))}))},e.prototype.setRemoteDefaultVideoStreamType=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){return t.setRemoteVideoStreamType({userId:i.uid,streamType:e.streamType})})))];case 1:return i.sent(),[2]}}))}))},e.prototype.enableAudioVolumeIndication=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,this._client.enableAudioVolumeIndicator()]}))}))},e.prototype.setLogFilter=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(t=a.LOG_LEVEL.LOG_LEVEL_INFO,e.filter){case a.LOG_FILTER_TYPE.LOG_FILTER_OFF:t=a.LOG_LEVEL.LOG_LEVEL_NONE;break;case a.LOG_FILTER_TYPE.LOG_FILTER_DEBUG:case a.LOG_FILTER_TYPE.LOG_FILTER_INFO:case a.LOG_FILTER_TYPE.LOG_FILTER_MASK:t=a.LOG_LEVEL.LOG_LEVEL_INFO;break;case a.LOG_FILTER_TYPE.LOG_FILTER_WARN:t=a.LOG_LEVEL.LOG_LEVEL_WARN;break;case a.LOG_FILTER_TYPE.LOG_FILTER_ERROR:t=a.LOG_LEVEL.LOG_LEVEL_ERROR;break;case a.LOG_FILTER_TYPE.LOG_FILTER_CRITICAL:t=a.LOG_LEVEL.LOG_LEVEL_FATAL}return[2,d.setLogLevel(t)]}))}))},e.prototype.uploadLogFile=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return d.enableLogUpload(),[2,""]}))}))},e.prototype.enableDualStreamMode=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return e.enabled?[2,this._client.enableDualStream()]:[2,this._client.disableDualStream()]}))}))},e.prototype.adjustRecordingSignalVolume=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.deviceManager.adjustRecordingSignalVolume(e.volume)]}))}))},e.prototype.adjustPlaybackSignalVolume=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.deviceManager.adjustPlaybackSignalVolume(e.volume)];case 1:return t.sent(),[2]}}))}))},e.prototype.startScreenCaptureByDisplayId=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){return[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),e.captureParams,!0).then((function(e){t._muteLocalVideo||t._publish(e)}))]}))}))},e.prototype.startScreenCaptureByScreenRect=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){return[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),e.captureParams,!0).then((function(e){t._muteLocalVideo||t._publish(e)}))]}))}))},e.prototype.startScreenCaptureByWindowId=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){return[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),e.captureParams,!0).then((function(e){t._muteLocalVideo||t._publish(e)}))]}))}))},e.prototype.stopScreenCapture=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,this.deviceManager.stopScreenCapture()]}))}))},e.prototype.startScreenCapture=function(e){return n(this,void 0,void 0,(function(){var t,i=this;return r(this,(function(n){return t=e.rect,[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),{dimensions:{width:t&&void 0!==t.right&&void 0!==t.left?t.right-t.left:void 0,height:t&&void 0!==t.bottom&&void 0!==t.top?t.bottom-t.top:void 0},frameRate:e.captureFreq,bitrate:e.bitrate},!0).then((function(e){i._muteLocalVideo||i._publish(e)}))]}))}))},e.prototype.setRemoteSubscribeFallbackOption=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){var n,r;switch(e.option){case a.STREAM_FALLBACK_OPTIONS.STREAM_FALLBACK_OPTION_DISABLED:r=o.RemoteStreamFallbackType.DISABLE;break;case a.STREAM_FALLBACK_OPTIONS.STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW:r=o.RemoteStreamFallbackType.LOW_STREAM;break;case a.STREAM_FALLBACK_OPTIONS.STREAM_FALLBACK_OPTION_AUDIO_ONLY:r=o.RemoteStreamFallbackType.AUDIO_ONLY}return null===(n=t._client)||void 0===n?void 0:n.setStreamFallbackOption(i.uid,r)})))];case 1:return i.sent(),[2]}}))}))},e.prototype.getVersion=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,d.VERSION]}))}))},e.prototype.setEncryptionSecret=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(this._secret=e.secret,void 0===this._client)throw"please create first";return this._encryptionMode&&this._secret?[2,this._client.setEncryptionConfig(this._encryptionMode,this._secret)]:[2,this._client.setEncryptionConfig("none","")]}))}))},e.prototype.setEncryptionMode=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(this._encryptionMode=e.encryptionMode,void 0===this._client)throw"please create first";return this._encryptionMode&&this._secret?[2,this._client.setEncryptionConfig(this._encryptionMode,this._secret)]:[2,this._client.setEncryptionConfig("none","")]}))}))},e.prototype.enableEncryption=function(e){var t;return n(this,void 0,void 0,(function(){var i;return r(this,(function(n){if(void 0===this._client)throw"please create first";if(i="aes-128-xts",e.enabled)switch(e.config.encryptionMode){case a.ENCRYPTION_MODE.AES_128_XTS:i="aes-128-xts";break;case a.ENCRYPTION_MODE.AES_128_ECB:i="aes-128-ecb";break;case a.ENCRYPTION_MODE.AES_256_XTS:i="aes-256-xts";break;case a.ENCRYPTION_MODE.SM4_128_ECB:i="sm4-128-ecb";break;case a.ENCRYPTION_MODE.AES_128_GCM:i="aes-128-gcm";break;case a.ENCRYPTION_MODE.AES_256_GCM:i="aes-256-gcm";break;case a.ENCRYPTION_MODE.MODE_END:i="none"}else i="none";return[2,this._client.setEncryptionConfig(i,null!==(t=e.config.encryptionKey)&&void 0!==t?t:"")]}))}))},e.prototype.addPublishStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.startLiveStreaming(e.url,e.transcodingEnabled)]}))}))},e.prototype.removePublishStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.stopLiveStreaming(e.url)]}))}))},e.prototype.setLiveTranscoding=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.setLiveTranscoding({audioBitrate:e.transcoding.audioBitrate,audioChannels:e.transcoding.audioChannels,audioSampleRate:e.transcoding.audioSampleRate,backgroundColor:e.transcoding.backgroundColor,height:e.transcoding.height,width:e.transcoding.width,lowLatency:e.transcoding.lowLatency,videoBitrate:e.transcoding.videoBitrate,videoCodecProfile:e.transcoding.videoCodecProfile,videoFrameRate:e.transcoding.videoFramerate,videoGop:e.transcoding.videoGop,watermark:e.transcoding.watermark,backgroundImage:e.transcoding.backgroundImage,transcodingUsers:e.transcoding.transcodingUsers,userConfigExtraInfo:e.transcoding.transcodingExtraInfo})]}))}))},e.prototype.setBeautyEffectOptions=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.deviceManager.setBeautyEffect(e.enabled,{smoothnessLevel:e.options.smoothnessLevel,lighteningLevel:e.options.lighteningLevel,rednessLevel:e.options.rednessLevel,lighteningContrastLevel:e.options.lighteningContrastLevel})]}))}))},e.prototype.addInjectStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.addInjectStreamUrl(e.url,{audioBitrate:e.config.audioBitrate,audioChannels:e.config.audioChannels,audioSampleRate:e.config.audioSampleRate,height:e.config.height,width:e.config.width,videoBitrate:e.config.videoBitrate,videoFramerate:e.config.videoFramerate,videoGop:e.config.videoGop})]}))}))},e.prototype.startChannelMediaRelay=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){if(void 0===this._client)throw"please create first";return null==(t=d.createChannelMediaRelayConfiguration())||t.setSrcChannelInfo(e.configuration.srcInfo),e.configuration.destInfos.map((function(e){null==t||t.addDestChannelInfo(e)})),[2,this._client.startChannelMediaRelay(t)]}))}))},e.prototype.updateChannelMediaRelay=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){if(void 0===this._client)throw"please create first";return null==(t=d.createChannelMediaRelayConfiguration())||t.setSrcChannelInfo(e.configuration.srcInfo),e.configuration.destInfos.map((function(e){null==t||t.addDestChannelInfo(e)})),[2,this._client.updateChannelMediaRelay(t)]}))}))},e.prototype.stopChannelMediaRelay=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,this._client.stopChannelMediaRelay()]}))}))},e.prototype.removeInjectStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,this._client.removeInjectStreamUrl()]}))}))},e.prototype.sendCustomReportMessage=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(void 0===this._client)throw"please create first";return[4,this._client.sendCustomReportMessage({category:e.id,event:e.category,label:e.event,reportId:e.label,value:e.value})];case 1:return t.sent(),[2]}}))}))},e.prototype.getConnectionState=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,(0,c.ConnectionStateToNative)(this._client.connectionState)]}))}))},e.prototype.setParameters=function(e){return n(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){return t=JSON.parse(e.parameters),i=Object.keys(t)[0],[2,d.setParameter(i,t[i])]}))}))},e.prototype.setAppType=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.setParameters({parameters:'{"REPORT_APP_SCENARIO":'.concat(e.appType.toString(),"}")})]}))}))},e.prototype.setCloudProxy=function(e){var t;return n(this,void 0,void 0,(function(){var i;return r(this,(function(n){switch(i=0,e.proxyType){case a.CLOUD_PROXY_TYPE.NONE_PROXY:i=0;break;case a.CLOUD_PROXY_TYPE.UDP_PROXY:i=3;break;case a.CLOUD_PROXY_TYPE.TCP_PROXY:i=5}return[2,null===(t=this._client)||void 0===t?void 0:t.startProxyServer(i)]}))}))},e}();t.default=u},910:(e,t)=>{"use strict";var i,n,r,o,s,a,c,A,d,u,E,l,h,p,_,I,g,f,R,C,T,m,S,O,v,N,y,D,w,b,L,P,k,M,U,B,V,Q,x,F,G,j,Y,H,K,W,J,q,X,z,Z,$,ee,te,ie,ne,re,oe,se,ae,ce,Ae,de,ue,Ee,le,he,pe,_e,Ie,ge,fe,Re,Ce,Te,me,Se,Oe,ve,Ne,ye,De,we,be,Le,Pe,ke,Me,Ue,Be,Ve;Object.defineProperty(t,"__esModule",{value:!0}),t.AUDIO_REVERB_PRESET=t.VOICE_CHANGER_PRESET=t.AUDIO_REVERB_TYPE=t.AUDIO_EQUALIZATION_BAND_FREQUENCY=t.VIDEO_CODEC_TYPE_FOR_STREAM=t.VIDEO_CODEC_TYPE=t.VIDEO_CODEC_PROFILE_TYPE=t.AUDIO_SAMPLE_RATE_TYPE=t.RAW_AUDIO_FRAME_OP_MODE_TYPE=t.CAPTURE_BRIGHTNESS_LEVEL_TYPE=t.REMOTE_VIDEO_STREAM_TYPE=t.INJECT_STREAM_STATUS=t.RTMP_STREAMING_EVENT=t.RTMP_STREAM_PUBLISH_ERROR=t.RTMP_STREAM_PUBLISH_STATE=t.USER_OFFLINE_REASON_TYPE=t.SUPER_RESOLUTION_STATE_REASON=t.AUDIENCE_LATENCY_LEVEL_TYPE=t.CLIENT_ROLE_TYPE=t.CHANNEL_PROFILE_TYPE=t.AUDIO_SCENARIO_TYPE=t.AUDIO_PROFILE_TYPE=t.VIDEO_PROFILE_TYPE=t.VIDEO_MIRROR_MODE_TYPE=t.RENDER_MODE_TYPE=t.QUALITY_TYPE=t.AUDIO_RECORDING_QUALITY_TYPE=t.LOCAL_AUDIO_STREAM_ERROR=t.LOCAL_AUDIO_STREAM_STATE=t.LOCAL_VIDEO_STREAM_ERROR=t.LOCAL_VIDEO_STREAM_STATE=t.MEDIA_DEVICE_TYPE=t.MEDIA_DEVICE_STATE_TYPE=t.AUDIO_MIXING_ERROR_TYPE=t.AUDIO_MIXING_STATE_TYPE=t.MEDIA_ENGINE_EVENT_CODE_TYPE=t.QUALITY_REPORT_FORMAT_TYPE=t.MAX_CHANNEL_ID_LENGTH_TYPE=t.MAX_USER_ACCOUNT_LENGTH_TYPE=t.MAX_DEVICE_ID_LENGTH_TYPE=t.LOG_LEVEL=t.LOG_FILTER_TYPE=t.ERROR_CODE_TYPE=t.WARN_CODE_TYPE=t.INTERFACE_ID_TYPE=t.ApiTypeRawDataPluginManager=t.ApiTypeVideoDeviceManager=t.ApiTypeAudioDeviceManager=t.ApiTypeChannel=t.ApiTypeEngine=void 0,t.ENCRYPTION_MODE=t.METADATA_TYPE=t.VIDEO_CAPTURE_TYPE=t.ENCRYPTION_CONFIG=t.AREA_CODE=t.LIGHTENING_CONTRAST_LEVEL=t.VideoContentHint=t.RTMP_STREAM_LIFE_CYCLE_TYPE=t.VEO=t.LBHQ=t.DEFAULT_MIN_BITRATE=t.COMPATIBLE_BITRATE=t.STANDARD_BITRATE=t.CHANNEL_MEDIA_RELAY_STATE=t.CHANNEL_MEDIA_RELAY_EVENT=t.CHANNEL_MEDIA_RELAY_ERROR=t.EXPERIENCE_POOR_REASON=t.EXPERIENCE_QUALITY_TYPE=t.QUALITY_ADAPT_INDICATION=t.CAMERA_DIRECTION=t.AUDIO_SESSION_OPERATION_RESTRICTION=t.CLOUD_PROXY_TYPE=t.AUDIO_ROUTE_TYPE=t.LASTMILE_PROBE_RESULT_STATE=t.UPLOAD_ERROR_REASON=t.NETWORK_TYPE=t.CONNECTION_CHANGED_REASON_TYPE=t.CONNECTION_STATE_TYPE=t.PRIORITY_TYPE=t.CAPTURER_OUTPUT_PREFERENCE=t.STREAM_FALLBACK_OPTIONS=t.DEGRADATION_PREFERENCE=t.ORIENTATION_MODE=t.FRAME_RATE=t.REMOTE_VIDEO_STATE_REASON=t.XLA_REMOTE_AUDIO_FROZEN_TYPE=t.XLA_REMOTE_VIDEO_FROZEN_TYPE=t.STREAM_SUBSCRIBE_STATE=t.STREAM_PUBLISH_STATE=t.REMOTE_VIDEO_STATE=t.REMOTE_AUDIO_STATE_REASON=t.REMOTE_AUDIO_STATE=t.AUDIO_CODEC_PROFILE_TYPE=t.VOICE_CONVERSION_PRESET=t.AUDIO_EFFECT_PRESET=t.VOICE_BEAUTIFIER_PRESET=void 0,(Ve=t.ApiTypeEngine||(t.ApiTypeEngine={}))[Ve.kEngineInitialize=0]="kEngineInitialize",Ve[Ve.kEngineRelease=1]="kEngineRelease",Ve[Ve.kEngineSetChannelProfile=2]="kEngineSetChannelProfile",Ve[Ve.kEngineSetClientRole=3]="kEngineSetClientRole",Ve[Ve.kEngineJoinChannel=4]="kEngineJoinChannel",Ve[Ve.kEngineSwitchChannel=5]="kEngineSwitchChannel",Ve[Ve.kEngineLeaveChannel=6]="kEngineLeaveChannel",Ve[Ve.kEngineRenewToken=7]="kEngineRenewToken",Ve[Ve.kEngineRegisterLocalUserAccount=8]="kEngineRegisterLocalUserAccount",Ve[Ve.kEngineJoinChannelWithUserAccount=9]="kEngineJoinChannelWithUserAccount",Ve[Ve.kEngineGetUserInfoByUserAccount=10]="kEngineGetUserInfoByUserAccount",Ve[Ve.kEngineGetUserInfoByUid=11]="kEngineGetUserInfoByUid",Ve[Ve.kEngineStartEchoTest=12]="kEngineStartEchoTest",Ve[Ve.kEngineStopEchoTest=13]="kEngineStopEchoTest",Ve[Ve.kEngineSetCloudProxy=14]="kEngineSetCloudProxy",Ve[Ve.kEngineEnableVideo=15]="kEngineEnableVideo",Ve[Ve.kEngineDisableVideo=16]="kEngineDisableVideo",Ve[Ve.kEngineSetVideoProfile=17]="kEngineSetVideoProfile",Ve[Ve.kEngineSetVideoEncoderConfiguration=18]="kEngineSetVideoEncoderConfiguration",Ve[Ve.kEngineSetCameraCapturerConfiguration=19]="kEngineSetCameraCapturerConfiguration",Ve[Ve.kEngineSetupLocalVideo=20]="kEngineSetupLocalVideo",Ve[Ve.kEngineSetupRemoteVideo=21]="kEngineSetupRemoteVideo",Ve[Ve.kEngineStartPreview=22]="kEngineStartPreview",Ve[Ve.kEngineSetRemoteUserPriority=23]="kEngineSetRemoteUserPriority",Ve[Ve.kEngineStopPreview=24]="kEngineStopPreview",Ve[Ve.kEngineEnableAudio=25]="kEngineEnableAudio",Ve[Ve.kEngineEnableLocalAudio=26]="kEngineEnableLocalAudio",Ve[Ve.kEngineDisableAudio=27]="kEngineDisableAudio",Ve[Ve.kEngineSetAudioProfile=28]="kEngineSetAudioProfile",Ve[Ve.kEngineMuteLocalAudioStream=29]="kEngineMuteLocalAudioStream",Ve[Ve.kEngineMuteAllRemoteAudioStreams=30]="kEngineMuteAllRemoteAudioStreams",Ve[Ve.kEngineSetDefaultMuteAllRemoteAudioStreams=31]="kEngineSetDefaultMuteAllRemoteAudioStreams",Ve[Ve.kEngineAdjustUserPlaybackSignalVolume=32]="kEngineAdjustUserPlaybackSignalVolume",Ve[Ve.kEngineMuteRemoteAudioStream=33]="kEngineMuteRemoteAudioStream",Ve[Ve.kEngineMuteLocalVideoStream=34]="kEngineMuteLocalVideoStream",Ve[Ve.kEngineEnableLocalVideo=35]="kEngineEnableLocalVideo",Ve[Ve.kEngineMuteAllRemoteVideoStreams=36]="kEngineMuteAllRemoteVideoStreams",Ve[Ve.kEngineSetDefaultMuteAllRemoteVideoStreams=37]="kEngineSetDefaultMuteAllRemoteVideoStreams",Ve[Ve.kEngineMuteRemoteVideoStream=38]="kEngineMuteRemoteVideoStream",Ve[Ve.kEngineSetRemoteVideoStreamType=39]="kEngineSetRemoteVideoStreamType",Ve[Ve.kEngineSetRemoteDefaultVideoStreamType=40]="kEngineSetRemoteDefaultVideoStreamType",Ve[Ve.kEngineEnableAudioVolumeIndication=41]="kEngineEnableAudioVolumeIndication",Ve[Ve.kEngineStartAudioRecording=42]="kEngineStartAudioRecording",Ve[Ve.kEngineStopAudioRecording=43]="kEngineStopAudioRecording",Ve[Ve.kEngineStartAudioMixing=44]="kEngineStartAudioMixing",Ve[Ve.kEngineStopAudioMixing=45]="kEngineStopAudioMixing",Ve[Ve.kEnginePauseAudioMixing=46]="kEnginePauseAudioMixing",Ve[Ve.kEngineResumeAudioMixing=47]="kEngineResumeAudioMixing",Ve[Ve.kEngineSetHighQualityAudioParameters=48]="kEngineSetHighQualityAudioParameters",Ve[Ve.kEngineAdjustAudioMixingVolume=49]="kEngineAdjustAudioMixingVolume",Ve[Ve.kEngineAdjustAudioMixingPlayoutVolume=50]="kEngineAdjustAudioMixingPlayoutVolume",Ve[Ve.kEngineGetAudioMixingPlayoutVolume=51]="kEngineGetAudioMixingPlayoutVolume",Ve[Ve.kEngineAdjustAudioMixingPublishVolume=52]="kEngineAdjustAudioMixingPublishVolume",Ve[Ve.kEngineGetAudioMixingPublishVolume=53]="kEngineGetAudioMixingPublishVolume",Ve[Ve.kEngineGetAudioMixingDuration=54]="kEngineGetAudioMixingDuration",Ve[Ve.kEngineGetAudioMixingCurrentPosition=55]="kEngineGetAudioMixingCurrentPosition",Ve[Ve.kEngineSetAudioMixingPosition=56]="kEngineSetAudioMixingPosition",Ve[Ve.kEngineSetAudioMixingPitch=57]="kEngineSetAudioMixingPitch",Ve[Ve.kEngineGetEffectsVolume=58]="kEngineGetEffectsVolume",Ve[Ve.kEngineSetEffectsVolume=59]="kEngineSetEffectsVolume",Ve[Ve.kEngineSetVolumeOfEffect=60]="kEngineSetVolumeOfEffect",Ve[Ve.kEngineEnableFaceDetection=61]="kEngineEnableFaceDetection",Ve[Ve.kEnginePlayEffect=62]="kEnginePlayEffect",Ve[Ve.kEngineStopEffect=63]="kEngineStopEffect",Ve[Ve.kEngineStopAllEffects=64]="kEngineStopAllEffects",Ve[Ve.kEnginePreloadEffect=65]="kEnginePreloadEffect",Ve[Ve.kEngineUnloadEffect=66]="kEngineUnloadEffect",Ve[Ve.kEnginePauseEffect=67]="kEnginePauseEffect",Ve[Ve.kEnginePauseAllEffects=68]="kEnginePauseAllEffects",Ve[Ve.kEngineResumeEffect=69]="kEngineResumeEffect",Ve[Ve.kEngineResumeAllEffects=70]="kEngineResumeAllEffects",Ve[Ve.kEngineGetEffectDuration=71]="kEngineGetEffectDuration",Ve[Ve.kEngineSetEffectPosition=72]="kEngineSetEffectPosition",Ve[Ve.kEngineGetEffectCurrentPosition=73]="kEngineGetEffectCurrentPosition",Ve[Ve.kEngineEnableDeepLearningDenoise=74]="kEngineEnableDeepLearningDenoise",Ve[Ve.kEngineEnableSoundPositionIndication=75]="kEngineEnableSoundPositionIndication",Ve[Ve.kEngineSetRemoteVoicePosition=76]="kEngineSetRemoteVoicePosition",Ve[Ve.kEngineSetLocalVoicePitch=77]="kEngineSetLocalVoicePitch",Ve[Ve.kEngineSetLocalVoiceEqualization=78]="kEngineSetLocalVoiceEqualization",Ve[Ve.kEngineSetLocalVoiceReverb=79]="kEngineSetLocalVoiceReverb",Ve[Ve.kEngineSetLocalVoiceChanger=80]="kEngineSetLocalVoiceChanger",Ve[Ve.kEngineSetLocalVoiceReverbPreset=81]="kEngineSetLocalVoiceReverbPreset",Ve[Ve.kEngineSetVoiceBeautifierPreset=82]="kEngineSetVoiceBeautifierPreset",Ve[Ve.kEngineSetAudioEffectPreset=83]="kEngineSetAudioEffectPreset",Ve[Ve.kEngineSetVoiceConversionPreset=84]="kEngineSetVoiceConversionPreset",Ve[Ve.kEngineSetAudioEffectParameters=85]="kEngineSetAudioEffectParameters",Ve[Ve.kEngineSetVoiceBeautifierParameters=86]="kEngineSetVoiceBeautifierParameters",Ve[Ve.kEngineSetLogFile=87]="kEngineSetLogFile",Ve[Ve.kEngineSetLogFilter=88]="kEngineSetLogFilter",Ve[Ve.kEngineSetLogFileSize=89]="kEngineSetLogFileSize",Ve[Ve.kEngineUploadLogFile=90]="kEngineUploadLogFile",Ve[Ve.kEngineSetLocalRenderMode=91]="kEngineSetLocalRenderMode",Ve[Ve.kEngineSetRemoteRenderMode=92]="kEngineSetRemoteRenderMode",Ve[Ve.kEngineSetLocalVideoMirrorMode=93]="kEngineSetLocalVideoMirrorMode",Ve[Ve.kEngineEnableDualStreamMode=94]="kEngineEnableDualStreamMode",Ve[Ve.kEngineSetExternalAudioSource=95]="kEngineSetExternalAudioSource",Ve[Ve.kEngineSetExternalAudioSink=96]="kEngineSetExternalAudioSink",Ve[Ve.kEngineSetRecordingAudioFrameParameters=97]="kEngineSetRecordingAudioFrameParameters",Ve[Ve.kEngineSetPlaybackAudioFrameParameters=98]="kEngineSetPlaybackAudioFrameParameters",Ve[Ve.kEngineSetMixedAudioFrameParameters=99]="kEngineSetMixedAudioFrameParameters",Ve[Ve.kEngineAdjustRecordingSignalVolume=100]="kEngineAdjustRecordingSignalVolume",Ve[Ve.kEngineAdjustPlaybackSignalVolume=101]="kEngineAdjustPlaybackSignalVolume",Ve[Ve.kEngineAdjustLoopBackRecordingSignalVolume=102]="kEngineAdjustLoopBackRecordingSignalVolume",Ve[Ve.kEngineEnableWebSdkInteroperability=103]="kEngineEnableWebSdkInteroperability",Ve[Ve.kEngineSetVideoQualityParameters=104]="kEngineSetVideoQualityParameters",Ve[Ve.kEngineSetLocalPublishFallbackOption=105]="kEngineSetLocalPublishFallbackOption",Ve[Ve.kEngineSetRemoteSubscribeFallbackOption=106]="kEngineSetRemoteSubscribeFallbackOption",Ve[Ve.kEngineSwitchCamera=107]="kEngineSwitchCamera",Ve[Ve.kEngineSetDefaultAudioRouteToSpeakerPhone=108]="kEngineSetDefaultAudioRouteToSpeakerPhone",Ve[Ve.kEngineSetEnableSpeakerPhone=109]="kEngineSetEnableSpeakerPhone",Ve[Ve.kEngineEnableInEarMonitoring=110]="kEngineEnableInEarMonitoring",Ve[Ve.kEngineSetInEarMonitoringVolume=111]="kEngineSetInEarMonitoringVolume",Ve[Ve.kEngineIsSpeakerPhoneEnabled=112]="kEngineIsSpeakerPhoneEnabled",Ve[Ve.kEngineSetAudioSessionOperationRestriction=113]="kEngineSetAudioSessionOperationRestriction",Ve[Ve.kEngineEnableLoopBackRecording=114]="kEngineEnableLoopBackRecording",Ve[Ve.kEngineStartScreenCaptureByDisplayId=115]="kEngineStartScreenCaptureByDisplayId",Ve[Ve.kEngineStartScreenCaptureByScreenRect=116]="kEngineStartScreenCaptureByScreenRect",Ve[Ve.kEngineStartScreenCaptureByWindowId=117]="kEngineStartScreenCaptureByWindowId",Ve[Ve.kEngineSetScreenCaptureContentHint=118]="kEngineSetScreenCaptureContentHint",Ve[Ve.kEngineUpdateScreenCaptureParameters=119]="kEngineUpdateScreenCaptureParameters",Ve[Ve.kEngineUpdateScreenCaptureRegion=120]="kEngineUpdateScreenCaptureRegion",Ve[Ve.kEngineStopScreenCapture=121]="kEngineStopScreenCapture",Ve[Ve.kEngineStartScreenCapture=122]="kEngineStartScreenCapture",Ve[Ve.kEngineSetVideoSource=123]="kEngineSetVideoSource",Ve[Ve.kEngineGetCallId=124]="kEngineGetCallId",Ve[Ve.kEngineRate=125]="kEngineRate",Ve[Ve.kEngineComplain=126]="kEngineComplain",Ve[Ve.kEngineGetVersion=127]="kEngineGetVersion",Ve[Ve.kEngineEnableLastMileTest=128]="kEngineEnableLastMileTest",Ve[Ve.kEngineDisableLastMileTest=129]="kEngineDisableLastMileTest",Ve[Ve.kEngineStartLastMileProbeTest=130]="kEngineStartLastMileProbeTest",Ve[Ve.kEngineStopLastMileProbeTest=131]="kEngineStopLastMileProbeTest",Ve[Ve.kEngineGetErrorDescription=132]="kEngineGetErrorDescription",Ve[Ve.kEngineSetEncryptionSecret=133]="kEngineSetEncryptionSecret",Ve[Ve.kEngineSetEncryptionMode=134]="kEngineSetEncryptionMode",Ve[Ve.kEngineEnableEncryption=135]="kEngineEnableEncryption",Ve[Ve.kEngineRegisterPacketObserver=136]="kEngineRegisterPacketObserver",Ve[Ve.kEngineCreateDataStream=137]="kEngineCreateDataStream",Ve[Ve.kEngineSendStreamMessage=138]="kEngineSendStreamMessage",Ve[Ve.kEngineAddPublishStreamUrl=139]="kEngineAddPublishStreamUrl",Ve[Ve.kEngineRemovePublishStreamUrl=140]="kEngineRemovePublishStreamUrl",Ve[Ve.kEngineSetLiveTranscoding=141]="kEngineSetLiveTranscoding",Ve[Ve.kEngineAddVideoWaterMark=142]="kEngineAddVideoWaterMark",Ve[Ve.kEngineClearVideoWaterMarks=143]="kEngineClearVideoWaterMarks",Ve[Ve.kEngineSetBeautyEffectOptions=144]="kEngineSetBeautyEffectOptions",Ve[Ve.kEngineEnableVirtualBackground=145]="kEngineEnableVirtualBackground",Ve[Ve.kEngineAddInjectStreamUrl=146]="kEngineAddInjectStreamUrl",Ve[Ve.kEngineStartChannelMediaRelay=147]="kEngineStartChannelMediaRelay",Ve[Ve.kEngineUpdateChannelMediaRelay=148]="kEngineUpdateChannelMediaRelay",Ve[Ve.kEnginePauseAllChannelMediaRelay=149]="kEnginePauseAllChannelMediaRelay",Ve[Ve.kEngineResumeAllChannelMediaRelay=150]="kEngineResumeAllChannelMediaRelay",Ve[Ve.kEngineStopChannelMediaRelay=151]="kEngineStopChannelMediaRelay",Ve[Ve.kEngineRemoveInjectStreamUrl=152]="kEngineRemoveInjectStreamUrl",Ve[Ve.kEngineSendCustomReportMessage=153]="kEngineSendCustomReportMessage",Ve[Ve.kEngineGetConnectionState=154]="kEngineGetConnectionState",Ve[Ve.kEngineEnableRemoteSuperResolution=155]="kEngineEnableRemoteSuperResolution",Ve[Ve.kEngineRegisterMediaMetadataObserver=156]="kEngineRegisterMediaMetadataObserver",Ve[Ve.kEngineSetParameters=157]="kEngineSetParameters",Ve[Ve.kEngineSetLocalAccessPoint=158]="kEngineSetLocalAccessPoint",Ve[Ve.kEngineUnRegisterMediaMetadataObserver=159]="kEngineUnRegisterMediaMetadataObserver",Ve[Ve.kEngineSetMaxMetadataSize=160]="kEngineSetMaxMetadataSize",Ve[Ve.kEngineSendMetadata=161]="kEngineSendMetadata",Ve[Ve.kEngineSetAppType=162]="kEngineSetAppType",Ve[Ve.kMediaPushAudioFrame=163]="kMediaPushAudioFrame",Ve[Ve.kMediaPullAudioFrame=164]="kMediaPullAudioFrame",Ve[Ve.kMediaSetExternalVideoSource=165]="kMediaSetExternalVideoSource",Ve[Ve.kMediaPushVideoFrame=166]="kMediaPushVideoFrame",(Be=t.ApiTypeChannel||(t.ApiTypeChannel={}))[Be.kChannelCreateChannel=0]="kChannelCreateChannel",Be[Be.kChannelRelease=1]="kChannelRelease",Be[Be.kChannelJoinChannel=2]="kChannelJoinChannel",Be[Be.kChannelJoinChannelWithUserAccount=3]="kChannelJoinChannelWithUserAccount",Be[Be.kChannelLeaveChannel=4]="kChannelLeaveChannel",Be[Be.kChannelPublish=5]="kChannelPublish",Be[Be.kChannelUnPublish=6]="kChannelUnPublish",Be[Be.kChannelChannelId=7]="kChannelChannelId",Be[Be.kChannelGetCallId=8]="kChannelGetCallId",Be[Be.kChannelRenewToken=9]="kChannelRenewToken",Be[Be.kChannelSetEncryptionSecret=10]="kChannelSetEncryptionSecret",Be[Be.kChannelSetEncryptionMode=11]="kChannelSetEncryptionMode",Be[Be.kChannelEnableEncryption=12]="kChannelEnableEncryption",Be[Be.kChannelRegisterPacketObserver=13]="kChannelRegisterPacketObserver",Be[Be.kChannelRegisterMediaMetadataObserver=14]="kChannelRegisterMediaMetadataObserver",Be[Be.kChannelUnRegisterMediaMetadataObserver=15]="kChannelUnRegisterMediaMetadataObserver",Be[Be.kChannelSetMaxMetadataSize=16]="kChannelSetMaxMetadataSize",Be[Be.kChannelSendMetadata=17]="kChannelSendMetadata",Be[Be.kChannelSetClientRole=18]="kChannelSetClientRole",Be[Be.kChannelSetRemoteUserPriority=19]="kChannelSetRemoteUserPriority",Be[Be.kChannelSetRemoteVoicePosition=20]="kChannelSetRemoteVoicePosition",Be[Be.kChannelSetRemoteRenderMode=21]="kChannelSetRemoteRenderMode",Be[Be.kChannelSetDefaultMuteAllRemoteAudioStreams=22]="kChannelSetDefaultMuteAllRemoteAudioStreams",Be[Be.kChannelSetDefaultMuteAllRemoteVideoStreams=23]="kChannelSetDefaultMuteAllRemoteVideoStreams",Be[Be.kChannelMuteLocalAudioStream=24]="kChannelMuteLocalAudioStream",Be[Be.kChannelMuteLocalVideoStream=25]="kChannelMuteLocalVideoStream",Be[Be.kChannelMuteAllRemoteAudioStreams=26]="kChannelMuteAllRemoteAudioStreams",Be[Be.kChannelAdjustUserPlaybackSignalVolume=27]="kChannelAdjustUserPlaybackSignalVolume",Be[Be.kChannelMuteRemoteAudioStream=28]="kChannelMuteRemoteAudioStream",Be[Be.kChannelMuteAllRemoteVideoStreams=29]="kChannelMuteAllRemoteVideoStreams",Be[Be.kChannelMuteRemoteVideoStream=30]="kChannelMuteRemoteVideoStream",Be[Be.kChannelSetRemoteVideoStreamType=31]="kChannelSetRemoteVideoStreamType",Be[Be.kChannelSetRemoteDefaultVideoStreamType=32]="kChannelSetRemoteDefaultVideoStreamType",Be[Be.kChannelCreateDataStream=33]="kChannelCreateDataStream",Be[Be.kChannelSendStreamMessage=34]="kChannelSendStreamMessage",Be[Be.kChannelAddPublishStreamUrl=35]="kChannelAddPublishStreamUrl",Be[Be.kChannelRemovePublishStreamUrl=36]="kChannelRemovePublishStreamUrl",Be[Be.kChannelSetLiveTranscoding=37]="kChannelSetLiveTranscoding",Be[Be.kChannelAddInjectStreamUrl=38]="kChannelAddInjectStreamUrl",Be[Be.kChannelRemoveInjectStreamUrl=39]="kChannelRemoveInjectStreamUrl",Be[Be.kChannelStartChannelMediaRelay=40]="kChannelStartChannelMediaRelay",Be[Be.kChannelUpdateChannelMediaRelay=41]="kChannelUpdateChannelMediaRelay",Be[Be.kChannelPauseAllChannelMediaRelay=42]="kChannelPauseAllChannelMediaRelay",Be[Be.kChannelResumeAllChannelMediaRelay=43]="kChannelResumeAllChannelMediaRelay",Be[Be.kChannelStopChannelMediaRelay=44]="kChannelStopChannelMediaRelay",Be[Be.kChannelGetConnectionState=45]="kChannelGetConnectionState",Be[Be.kChannelEnableRemoteSuperResolution=46]="kChannelEnableRemoteSuperResolution",(Ue=t.ApiTypeAudioDeviceManager||(t.ApiTypeAudioDeviceManager={}))[Ue.kADMEnumeratePlaybackDevices=0]="kADMEnumeratePlaybackDevices",Ue[Ue.kADMSetPlaybackDevice=1]="kADMSetPlaybackDevice",Ue[Ue.kADMGetPlaybackDevice=2]="kADMGetPlaybackDevice",Ue[Ue.kADMGetPlaybackDeviceInfo=3]="kADMGetPlaybackDeviceInfo",Ue[Ue.kADMSetPlaybackDeviceVolume=4]="kADMSetPlaybackDeviceVolume",Ue[Ue.kADMGetPlaybackDeviceVolume=5]="kADMGetPlaybackDeviceVolume",Ue[Ue.kADMSetPlaybackDeviceMute=6]="kADMSetPlaybackDeviceMute",Ue[Ue.kADMGetPlaybackDeviceMute=7]="kADMGetPlaybackDeviceMute",Ue[Ue.kADMStartPlaybackDeviceTest=8]="kADMStartPlaybackDeviceTest",Ue[Ue.kADMStopPlaybackDeviceTest=9]="kADMStopPlaybackDeviceTest",Ue[Ue.kADMEnumerateRecordingDevices=10]="kADMEnumerateRecordingDevices",Ue[Ue.kADMSetRecordingDevice=11]="kADMSetRecordingDevice",Ue[Ue.kADMGetRecordingDevice=12]="kADMGetRecordingDevice",Ue[Ue.kADMGetRecordingDeviceInfo=13]="kADMGetRecordingDeviceInfo",Ue[Ue.kADMSetRecordingDeviceVolume=14]="kADMSetRecordingDeviceVolume",Ue[Ue.kADMGetRecordingDeviceVolume=15]="kADMGetRecordingDeviceVolume",Ue[Ue.kADMSetRecordingDeviceMute=16]="kADMSetRecordingDeviceMute",Ue[Ue.kADMGetRecordingDeviceMute=17]="kADMGetRecordingDeviceMute",Ue[Ue.kADMStartRecordingDeviceTest=18]="kADMStartRecordingDeviceTest",Ue[Ue.kADMStopRecordingDeviceTest=19]="kADMStopRecordingDeviceTest",Ue[Ue.kADMStartAudioDeviceLoopbackTest=20]="kADMStartAudioDeviceLoopbackTest",Ue[Ue.kADMStopAudioDeviceLoopbackTest=21]="kADMStopAudioDeviceLoopbackTest",(Me=t.ApiTypeVideoDeviceManager||(t.ApiTypeVideoDeviceManager={}))[Me.kVDMEnumerateVideoDevices=0]="kVDMEnumerateVideoDevices",Me[Me.kVDMSetDevice=1]="kVDMSetDevice",Me[Me.kVDMGetDevice=2]="kVDMGetDevice",Me[Me.kVDMStartDeviceTest=3]="kVDMStartDeviceTest",Me[Me.kVDMStopDeviceTest=4]="kVDMStopDeviceTest",(ke=t.ApiTypeRawDataPluginManager||(t.ApiTypeRawDataPluginManager={}))[ke.kRDPMRegisterPlugin=0]="kRDPMRegisterPlugin",ke[ke.kRDPMUnregisterPlugin=1]="kRDPMUnregisterPlugin",ke[ke.kRDPMHasPlugin=2]="kRDPMHasPlugin",ke[ke.kRDPMEnablePlugin=3]="kRDPMEnablePlugin",ke[ke.kRDPMGetPlugins=4]="kRDPMGetPlugins",ke[ke.kRDPMSetPluginParameter=5]="kRDPMSetPluginParameter",ke[ke.kRDPMGetPluginParameter=6]="kRDPMGetPluginParameter",ke[ke.kRDPMRelease=7]="kRDPMRelease",(Pe=t.INTERFACE_ID_TYPE||(t.INTERFACE_ID_TYPE={}))[Pe.AGORA_IID_AUDIO_DEVICE_MANAGER=1]="AGORA_IID_AUDIO_DEVICE_MANAGER",Pe[Pe.AGORA_IID_VIDEO_DEVICE_MANAGER=2]="AGORA_IID_VIDEO_DEVICE_MANAGER",Pe[Pe.AGORA_IID_RTC_ENGINE_PARAMETER=3]="AGORA_IID_RTC_ENGINE_PARAMETER",Pe[Pe.AGORA_IID_MEDIA_ENGINE=4]="AGORA_IID_MEDIA_ENGINE",Pe[Pe.AGORA_IID_SIGNALING_ENGINE=8]="AGORA_IID_SIGNALING_ENGINE",(Le=t.WARN_CODE_TYPE||(t.WARN_CODE_TYPE={}))[Le.WARN_INVALID_VIEW=8]="WARN_INVALID_VIEW",Le[Le.WARN_INIT_VIDEO=16]="WARN_INIT_VIDEO",Le[Le.WARN_PENDING=20]="WARN_PENDING",Le[Le.WARN_NO_AVAILABLE_CHANNEL=103]="WARN_NO_AVAILABLE_CHANNEL",Le[Le.WARN_LOOKUP_CHANNEL_TIMEOUT=104]="WARN_LOOKUP_CHANNEL_TIMEOUT",Le[Le.WARN_LOOKUP_CHANNEL_REJECTED=105]="WARN_LOOKUP_CHANNEL_REJECTED",Le[Le.WARN_OPEN_CHANNEL_TIMEOUT=106]="WARN_OPEN_CHANNEL_TIMEOUT",Le[Le.WARN_OPEN_CHANNEL_REJECTED=107]="WARN_OPEN_CHANNEL_REJECTED",Le[Le.WARN_SWITCH_LIVE_VIDEO_TIMEOUT=111]="WARN_SWITCH_LIVE_VIDEO_TIMEOUT",Le[Le.WARN_SET_CLIENT_ROLE_TIMEOUT=118]="WARN_SET_CLIENT_ROLE_TIMEOUT",Le[Le.WARN_OPEN_CHANNEL_INVALID_TICKET=121]="WARN_OPEN_CHANNEL_INVALID_TICKET",Le[Le.WARN_OPEN_CHANNEL_TRY_NEXT_VOS=122]="WARN_OPEN_CHANNEL_TRY_NEXT_VOS",Le[Le.WARN_CHANNEL_CONNECTION_UNRECOVERABLE=131]="WARN_CHANNEL_CONNECTION_UNRECOVERABLE",Le[Le.WARN_CHANNEL_CONNECTION_IP_CHANGED=132]="WARN_CHANNEL_CONNECTION_IP_CHANGED",Le[Le.WARN_CHANNEL_CONNECTION_PORT_CHANGED=133]="WARN_CHANNEL_CONNECTION_PORT_CHANGED",Le[Le.WARN_CHANNEL_SOCKET_ERROR=134]="WARN_CHANNEL_SOCKET_ERROR",Le[Le.WARN_AUDIO_MIXING_OPEN_ERROR=701]="WARN_AUDIO_MIXING_OPEN_ERROR",Le[Le.WARN_ADM_RUNTIME_PLAYOUT_WARNING=1014]="WARN_ADM_RUNTIME_PLAYOUT_WARNING",Le[Le.WARN_ADM_RUNTIME_RECORDING_WARNING=1016]="WARN_ADM_RUNTIME_RECORDING_WARNING",Le[Le.WARN_ADM_RECORD_AUDIO_SILENCE=1019]="WARN_ADM_RECORD_AUDIO_SILENCE",Le[Le.WARN_ADM_PLAYOUT_MALFUNCTION=1020]="WARN_ADM_PLAYOUT_MALFUNCTION",Le[Le.WARN_ADM_RECORD_MALFUNCTION=1021]="WARN_ADM_RECORD_MALFUNCTION",Le[Le.WARN_ADM_CALL_INTERRUPTION=1025]="WARN_ADM_CALL_INTERRUPTION",Le[Le.WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD=1029]="WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD",Le[Le.WARN_ADM_RECORD_AUDIO_LOWLEVEL=1031]="WARN_ADM_RECORD_AUDIO_LOWLEVEL",Le[Le.WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL=1032]="WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL",Le[Le.WARN_ADM_RECORD_AUDIO_IS_ACTIVE=1033]="WARN_ADM_RECORD_AUDIO_IS_ACTIVE",Le[Le.WARN_ADM_WINDOWS_NO_DATA_READY_EVENT=1040]="WARN_ADM_WINDOWS_NO_DATA_READY_EVENT",Le[Le.WARN_ADM_INCONSISTENT_AUDIO_DEVICE=1042]="WARN_ADM_INCONSISTENT_AUDIO_DEVICE",Le[Le.WARN_APM_HOWLING=1051]="WARN_APM_HOWLING",Le[Le.WARN_ADM_GLITCH_STATE=1052]="WARN_ADM_GLITCH_STATE",Le[Le.WARN_APM_RESIDUAL_ECHO=1053]="WARN_APM_RESIDUAL_ECHO",Le[Le.WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE=1322]="WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE",Le[Le.WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE=1323]="WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE",Le[Le.WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE=1324]="WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE",Le[Le.WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION=1610]="WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION",Le[Le.WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION=1611]="WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION",Le[Le.WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED=1612]="WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED",Le[Le.WARN_RTM_LOGIN_TIMEOUT=2005]="WARN_RTM_LOGIN_TIMEOUT",Le[Le.WARN_RTM_KEEP_ALIVE_TIMEOUT=2009]="WARN_RTM_KEEP_ALIVE_TIMEOUT",(be=t.ERROR_CODE_TYPE||(t.ERROR_CODE_TYPE={}))[be.ERR_OK=0]="ERR_OK",be[be.ERR_FAILED=1]="ERR_FAILED",be[be.ERR_INVALID_ARGUMENT=2]="ERR_INVALID_ARGUMENT",be[be.ERR_NOT_READY=3]="ERR_NOT_READY",be[be.ERR_NOT_SUPPORTED=4]="ERR_NOT_SUPPORTED",be[be.ERR_REFUSED=5]="ERR_REFUSED",be[be.ERR_BUFFER_TOO_SMALL=6]="ERR_BUFFER_TOO_SMALL",be[be.ERR_NOT_INITIALIZED=7]="ERR_NOT_INITIALIZED",be[be.ERR_NO_PERMISSION=9]="ERR_NO_PERMISSION",be[be.ERR_TIMEDOUT=10]="ERR_TIMEDOUT",be[be.ERR_CANCELED=11]="ERR_CANCELED",be[be.ERR_TOO_OFTEN=12]="ERR_TOO_OFTEN",be[be.ERR_BIND_SOCKET=13]="ERR_BIND_SOCKET",be[be.ERR_NET_DOWN=14]="ERR_NET_DOWN",be[be.ERR_NET_NOBUFS=15]="ERR_NET_NOBUFS",be[be.ERR_JOIN_CHANNEL_REJECTED=17]="ERR_JOIN_CHANNEL_REJECTED",be[be.ERR_LEAVE_CHANNEL_REJECTED=18]="ERR_LEAVE_CHANNEL_REJECTED",be[be.ERR_ALREADY_IN_USE=19]="ERR_ALREADY_IN_USE",be[be.ERR_ABORTED=20]="ERR_ABORTED",be[be.ERR_INIT_NET_ENGINE=21]="ERR_INIT_NET_ENGINE",be[be.ERR_RESOURCE_LIMITED=22]="ERR_RESOURCE_LIMITED",be[be.ERR_INVALID_APP_ID=101]="ERR_INVALID_APP_ID",be[be.ERR_INVALID_CHANNEL_NAME=102]="ERR_INVALID_CHANNEL_NAME",be[be.ERR_NO_SERVER_RESOURCES=103]="ERR_NO_SERVER_RESOURCES",be[be.ERR_TOKEN_EXPIRED=109]="ERR_TOKEN_EXPIRED",be[be.ERR_INVALID_TOKEN=110]="ERR_INVALID_TOKEN",be[be.ERR_CONNECTION_INTERRUPTED=111]="ERR_CONNECTION_INTERRUPTED",be[be.ERR_CONNECTION_LOST=112]="ERR_CONNECTION_LOST",be[be.ERR_NOT_IN_CHANNEL=113]="ERR_NOT_IN_CHANNEL",be[be.ERR_SIZE_TOO_LARGE=114]="ERR_SIZE_TOO_LARGE",be[be.ERR_BITRATE_LIMIT=115]="ERR_BITRATE_LIMIT",be[be.ERR_TOO_MANY_DATA_STREAMS=116]="ERR_TOO_MANY_DATA_STREAMS",be[be.ERR_STREAM_MESSAGE_TIMEOUT=117]="ERR_STREAM_MESSAGE_TIMEOUT",be[be.ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED=119]="ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED",be[be.ERR_DECRYPTION_FAILED=120]="ERR_DECRYPTION_FAILED",be[be.ERR_CLIENT_IS_BANNED_BY_SERVER=123]="ERR_CLIENT_IS_BANNED_BY_SERVER",be[be.ERR_WATERMARK_PARAM=124]="ERR_WATERMARK_PARAM",be[be.ERR_WATERMARK_PATH=125]="ERR_WATERMARK_PATH",be[be.ERR_WATERMARK_PNG=126]="ERR_WATERMARK_PNG",be[be.ERR_WATERMARKR_INFO=127]="ERR_WATERMARKR_INFO",be[be.ERR_WATERMARK_ARGB=128]="ERR_WATERMARK_ARGB",be[be.ERR_WATERMARK_READ=129]="ERR_WATERMARK_READ",be[be.ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH=130]="ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH",be[be.ERR_INVALID_USER_ACCOUNT=134]="ERR_INVALID_USER_ACCOUNT",be[be.ERR_PUBLISH_STREAM_CDN_ERROR=151]="ERR_PUBLISH_STREAM_CDN_ERROR",be[be.ERR_PUBLISH_STREAM_NUM_REACH_LIMIT=152]="ERR_PUBLISH_STREAM_NUM_REACH_LIMIT",be[be.ERR_PUBLISH_STREAM_NOT_AUTHORIZED=153]="ERR_PUBLISH_STREAM_NOT_AUTHORIZED",be[be.ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR=154]="ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR",be[be.ERR_PUBLISH_STREAM_NOT_FOUND=155]="ERR_PUBLISH_STREAM_NOT_FOUND",be[be.ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED=156]="ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED",be[be.ERR_MODULE_NOT_FOUND=157]="ERR_MODULE_NOT_FOUND",be[be.ERR_MODULE_SUPER_RESOLUTION_NOT_FOUND=158]="ERR_MODULE_SUPER_RESOLUTION_NOT_FOUND",be[be.ERR_LOGOUT_OTHER=400]="ERR_LOGOUT_OTHER",be[be.ERR_LOGOUT_USER=401]="ERR_LOGOUT_USER",be[be.ERR_LOGOUT_NET=402]="ERR_LOGOUT_NET",be[be.ERR_LOGOUT_KICKED=403]="ERR_LOGOUT_KICKED",be[be.ERR_LOGOUT_PACKET=404]="ERR_LOGOUT_PACKET",be[be.ERR_LOGOUT_TOKEN_EXPIRED=405]="ERR_LOGOUT_TOKEN_EXPIRED",be[be.ERR_LOGOUT_OLDVERSION=406]="ERR_LOGOUT_OLDVERSION",be[be.ERR_LOGOUT_TOKEN_WRONG=407]="ERR_LOGOUT_TOKEN_WRONG",be[be.ERR_LOGOUT_ALREADY_LOGOUT=408]="ERR_LOGOUT_ALREADY_LOGOUT",be[be.ERR_LOGIN_OTHER=420]="ERR_LOGIN_OTHER",be[be.ERR_LOGIN_NET=421]="ERR_LOGIN_NET",be[be.ERR_LOGIN_FAILED=422]="ERR_LOGIN_FAILED",be[be.ERR_LOGIN_CANCELED=423]="ERR_LOGIN_CANCELED",be[be.ERR_LOGIN_TOKEN_EXPIRED=424]="ERR_LOGIN_TOKEN_EXPIRED",be[be.ERR_LOGIN_OLD_VERSION=425]="ERR_LOGIN_OLD_VERSION",be[be.ERR_LOGIN_TOKEN_WRONG=426]="ERR_LOGIN_TOKEN_WRONG",be[be.ERR_LOGIN_TOKEN_KICKED=427]="ERR_LOGIN_TOKEN_KICKED",be[be.ERR_LOGIN_ALREADY_LOGIN=428]="ERR_LOGIN_ALREADY_LOGIN",be[be.ERR_JOIN_CHANNEL_OTHER=440]="ERR_JOIN_CHANNEL_OTHER",be[be.ERR_SEND_MESSAGE_OTHER=440]="ERR_SEND_MESSAGE_OTHER",be[be.ERR_SEND_MESSAGE_TIMEOUT=441]="ERR_SEND_MESSAGE_TIMEOUT",be[be.ERR_QUERY_USERNUM_OTHER=450]="ERR_QUERY_USERNUM_OTHER",be[be.ERR_QUERY_USERNUM_TIMEOUT=451]="ERR_QUERY_USERNUM_TIMEOUT",be[be.ERR_QUERY_USERNUM_BYUSER=452]="ERR_QUERY_USERNUM_BYUSER",be[be.ERR_LEAVE_CHANNEL_OTHER=460]="ERR_LEAVE_CHANNEL_OTHER",be[be.ERR_LEAVE_CHANNEL_KICKED=461]="ERR_LEAVE_CHANNEL_KICKED",be[be.ERR_LEAVE_CHANNEL_BYUSER=462]="ERR_LEAVE_CHANNEL_BYUSER",be[be.ERR_LEAVE_CHANNEL_LOGOUT=463]="ERR_LEAVE_CHANNEL_LOGOUT",be[be.ERR_LEAVE_CHANNEL_DISCONNECTED=464]="ERR_LEAVE_CHANNEL_DISCONNECTED",be[be.ERR_INVITE_OTHER=470]="ERR_INVITE_OTHER",be[be.ERR_INVITE_REINVITE=471]="ERR_INVITE_REINVITE",be[be.ERR_INVITE_NET=472]="ERR_INVITE_NET",be[be.ERR_INVITE_PEER_OFFLINE=473]="ERR_INVITE_PEER_OFFLINE",be[be.ERR_INVITE_TIMEOUT=474]="ERR_INVITE_TIMEOUT",be[be.ERR_INVITE_CANT_RECV=475]="ERR_INVITE_CANT_RECV",be[be.ERR_LOAD_MEDIA_ENGINE=1001]="ERR_LOAD_MEDIA_ENGINE",be[be.ERR_START_CALL=1002]="ERR_START_CALL",be[be.ERR_START_CAMERA=1003]="ERR_START_CAMERA",be[be.ERR_START_VIDEO_RENDER=1004]="ERR_START_VIDEO_RENDER",be[be.ERR_ADM_GENERAL_ERROR=1005]="ERR_ADM_GENERAL_ERROR",be[be.ERR_ADM_JAVA_RESOURCE=1006]="ERR_ADM_JAVA_RESOURCE",be[be.ERR_ADM_SAMPLE_RATE=1007]="ERR_ADM_SAMPLE_RATE",be[be.ERR_ADM_INIT_PLAYOUT=1008]="ERR_ADM_INIT_PLAYOUT",be[be.ERR_ADM_START_PLAYOUT=1009]="ERR_ADM_START_PLAYOUT",be[be.ERR_ADM_STOP_PLAYOUT=1010]="ERR_ADM_STOP_PLAYOUT",be[be.ERR_ADM_INIT_RECORDING=1011]="ERR_ADM_INIT_RECORDING",be[be.ERR_ADM_START_RECORDING=1012]="ERR_ADM_START_RECORDING",be[be.ERR_ADM_STOP_RECORDING=1013]="ERR_ADM_STOP_RECORDING",be[be.ERR_ADM_RUNTIME_PLAYOUT_ERROR=1015]="ERR_ADM_RUNTIME_PLAYOUT_ERROR",be[be.ERR_ADM_RUNTIME_RECORDING_ERROR=1017]="ERR_ADM_RUNTIME_RECORDING_ERROR",be[be.ERR_ADM_RECORD_AUDIO_FAILED=1018]="ERR_ADM_RECORD_AUDIO_FAILED",be[be.ERR_ADM_INIT_LOOPBACK=1022]="ERR_ADM_INIT_LOOPBACK",be[be.ERR_ADM_START_LOOPBACK=1023]="ERR_ADM_START_LOOPBACK",be[be.ERR_ADM_NO_PERMISSION=1027]="ERR_ADM_NO_PERMISSION",be[be.ERR_ADM_RECORD_AUDIO_IS_ACTIVE=1033]="ERR_ADM_RECORD_AUDIO_IS_ACTIVE",be[be.ERR_ADM_ANDROID_JNI_JAVA_RESOURCE=1101]="ERR_ADM_ANDROID_JNI_JAVA_RESOURCE",be[be.ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY=1108]="ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY",be[be.ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY=1109]="ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY",be[be.ERR_ADM_ANDROID_JNI_JAVA_START_RECORD=1111]="ERR_ADM_ANDROID_JNI_JAVA_START_RECORD",be[be.ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK=1112]="ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK",be[be.ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR=1115]="ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR",be[be.ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE=1151]="ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE",be[be.ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER=1153]="ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER",be[be.ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD=1156]="ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD",be[be.ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER=1157]="ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER",be[be.ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD=1160]="ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD",be[be.ERR_ADM_IOS_INPUT_NOT_AVAILABLE=1201]="ERR_ADM_IOS_INPUT_NOT_AVAILABLE",be[be.ERR_ADM_IOS_ACTIVATE_SESSION_FAIL=1206]="ERR_ADM_IOS_ACTIVATE_SESSION_FAIL",be[be.ERR_ADM_IOS_VPIO_INIT_FAIL=1210]="ERR_ADM_IOS_VPIO_INIT_FAIL",be[be.ERR_ADM_IOS_VPIO_REINIT_FAIL=1213]="ERR_ADM_IOS_VPIO_REINIT_FAIL",be[be.ERR_ADM_IOS_VPIO_RESTART_FAIL=1214]="ERR_ADM_IOS_VPIO_RESTART_FAIL",be[be.ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL=1219]="ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL",be[be.ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO=1221]="ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO",be[be.ERR_ADM_WIN_CORE_INIT=1301]="ERR_ADM_WIN_CORE_INIT",be[be.ERR_ADM_WIN_CORE_INIT_RECORDING=1303]="ERR_ADM_WIN_CORE_INIT_RECORDING",be[be.ERR_ADM_WIN_CORE_INIT_PLAYOUT=1306]="ERR_ADM_WIN_CORE_INIT_PLAYOUT",be[be.ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL=1307]="ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL",be[be.ERR_ADM_WIN_CORE_START_RECORDING=1309]="ERR_ADM_WIN_CORE_START_RECORDING",be[be.ERR_ADM_WIN_CORE_CREATE_REC_THREAD=1311]="ERR_ADM_WIN_CORE_CREATE_REC_THREAD",be[be.ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP=1314]="ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP",be[be.ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD=1319]="ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD",be[be.ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP=1320]="ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP",be[be.ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE=1322]="ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE",be[be.ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE=1323]="ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE",be[be.ERR_ADM_WIN_WAVE_INIT=1351]="ERR_ADM_WIN_WAVE_INIT",be[be.ERR_ADM_WIN_WAVE_INIT_RECORDING=1353]="ERR_ADM_WIN_WAVE_INIT_RECORDING",be[be.ERR_ADM_WIN_WAVE_INIT_MICROPHONE=1354]="ERR_ADM_WIN_WAVE_INIT_MICROPHONE",be[be.ERR_ADM_WIN_WAVE_INIT_PLAYOUT=1355]="ERR_ADM_WIN_WAVE_INIT_PLAYOUT",be[be.ERR_ADM_WIN_WAVE_INIT_SPEAKER=1356]="ERR_ADM_WIN_WAVE_INIT_SPEAKER",be[be.ERR_ADM_WIN_WAVE_START_RECORDING=1357]="ERR_ADM_WIN_WAVE_START_RECORDING",be[be.ERR_ADM_WIN_WAVE_START_PLAYOUT=1358]="ERR_ADM_WIN_WAVE_START_PLAYOUT",be[be.ERR_ADM_NO_RECORDING_DEVICE=1359]="ERR_ADM_NO_RECORDING_DEVICE",be[be.ERR_ADM_NO_PLAYOUT_DEVICE=1360]="ERR_ADM_NO_PLAYOUT_DEVICE",be[be.ERR_VDM_CAMERA_NOT_AUTHORIZED=1501]="ERR_VDM_CAMERA_NOT_AUTHORIZED",be[be.ERR_VDM_WIN_DEVICE_IN_USE=1502]="ERR_VDM_WIN_DEVICE_IN_USE",be[be.ERR_VCM_UNKNOWN_ERROR=1600]="ERR_VCM_UNKNOWN_ERROR",be[be.ERR_VCM_ENCODER_INIT_ERROR=1601]="ERR_VCM_ENCODER_INIT_ERROR",be[be.ERR_VCM_ENCODER_ENCODE_ERROR=1602]="ERR_VCM_ENCODER_ENCODE_ERROR",be[be.ERR_VCM_ENCODER_SET_ERROR=1603]="ERR_VCM_ENCODER_SET_ERROR",(we=t.LOG_FILTER_TYPE||(t.LOG_FILTER_TYPE={}))[we.LOG_FILTER_OFF=0]="LOG_FILTER_OFF",we[we.LOG_FILTER_DEBUG=2063]="LOG_FILTER_DEBUG",we[we.LOG_FILTER_INFO=15]="LOG_FILTER_INFO",we[we.LOG_FILTER_WARN=14]="LOG_FILTER_WARN",we[we.LOG_FILTER_ERROR=12]="LOG_FILTER_ERROR",we[we.LOG_FILTER_CRITICAL=8]="LOG_FILTER_CRITICAL",we[we.LOG_FILTER_MASK=2063]="LOG_FILTER_MASK",(De=t.LOG_LEVEL||(t.LOG_LEVEL={}))[De.LOG_LEVEL_NONE=0]="LOG_LEVEL_NONE",De[De.LOG_LEVEL_INFO=1]="LOG_LEVEL_INFO",De[De.LOG_LEVEL_WARN=2]="LOG_LEVEL_WARN",De[De.LOG_LEVEL_ERROR=4]="LOG_LEVEL_ERROR",De[De.LOG_LEVEL_FATAL=8]="LOG_LEVEL_FATAL",(ye=t.MAX_DEVICE_ID_LENGTH_TYPE||(t.MAX_DEVICE_ID_LENGTH_TYPE={}))[ye.MAX_DEVICE_ID_LENGTH=512]="MAX_DEVICE_ID_LENGTH",(Ne=t.MAX_USER_ACCOUNT_LENGTH_TYPE||(t.MAX_USER_ACCOUNT_LENGTH_TYPE={}))[Ne.MAX_USER_ACCOUNT_LENGTH=256]="MAX_USER_ACCOUNT_LENGTH",(ve=t.MAX_CHANNEL_ID_LENGTH_TYPE||(t.MAX_CHANNEL_ID_LENGTH_TYPE={}))[ve.MAX_CHANNEL_ID_LENGTH=65]="MAX_CHANNEL_ID_LENGTH",(Oe=t.QUALITY_REPORT_FORMAT_TYPE||(t.QUALITY_REPORT_FORMAT_TYPE={}))[Oe.QUALITY_REPORT_JSON=0]="QUALITY_REPORT_JSON",Oe[Oe.QUALITY_REPORT_HTML=1]="QUALITY_REPORT_HTML",(Se=t.MEDIA_ENGINE_EVENT_CODE_TYPE||(t.MEDIA_ENGINE_EVENT_CODE_TYPE={}))[Se.MEDIA_ENGINE_RECORDING_ERROR=0]="MEDIA_ENGINE_RECORDING_ERROR",Se[Se.MEDIA_ENGINE_PLAYOUT_ERROR=1]="MEDIA_ENGINE_PLAYOUT_ERROR",Se[Se.MEDIA_ENGINE_RECORDING_WARNING=2]="MEDIA_ENGINE_RECORDING_WARNING",Se[Se.MEDIA_ENGINE_PLAYOUT_WARNING=3]="MEDIA_ENGINE_PLAYOUT_WARNING",Se[Se.MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH=10]="MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH",Se[Se.MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS=12]="MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS",Se[Se.MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS=13]="MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS",Se[Se.MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED=14]="MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED",Se[Se.MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED=15]="MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED",Se[Se.MEDIA_ENGINE_ROLE_BROADCASTER_SOLO=20]="MEDIA_ENGINE_ROLE_BROADCASTER_SOLO",Se[Se.MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE=21]="MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE",Se[Se.MEDIA_ENGINE_ROLE_AUDIENCE=22]="MEDIA_ENGINE_ROLE_AUDIENCE",Se[Se.MEDIA_ENGINE_ROLE_COMM_PEER=23]="MEDIA_ENGINE_ROLE_COMM_PEER",Se[Se.MEDIA_ENGINE_ROLE_GAME_PEER=24]="MEDIA_ENGINE_ROLE_GAME_PEER",Se[Se.MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART=110]="MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART",Se[Se.MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART=111]="MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART",Se[Se.MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS=112]="MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS",Se[Se.MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS=113]="MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY=710]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED=711]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART=712]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED=713]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR=714]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN=701]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT=702]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF=703]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR=0]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR",(me=t.AUDIO_MIXING_STATE_TYPE||(t.AUDIO_MIXING_STATE_TYPE={}))[me.AUDIO_MIXING_STATE_PLAYING=710]="AUDIO_MIXING_STATE_PLAYING",me[me.AUDIO_MIXING_STATE_PAUSED=711]="AUDIO_MIXING_STATE_PAUSED",me[me.AUDIO_MIXING_STATE_STOPPED=713]="AUDIO_MIXING_STATE_STOPPED",me[me.AUDIO_MIXING_STATE_FAILED=714]="AUDIO_MIXING_STATE_FAILED",(Te=t.AUDIO_MIXING_ERROR_TYPE||(t.AUDIO_MIXING_ERROR_TYPE={}))[Te.AUDIO_MIXING_ERROR_CAN_NOT_OPEN=701]="AUDIO_MIXING_ERROR_CAN_NOT_OPEN",Te[Te.AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL=702]="AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL",Te[Te.AUDIO_MIXING_ERROR_INTERRUPTED_EOF=703]="AUDIO_MIXING_ERROR_INTERRUPTED_EOF",Te[Te.AUDIO_MIXING_ERROR_OK=0]="AUDIO_MIXING_ERROR_OK",(Ce=t.MEDIA_DEVICE_STATE_TYPE||(t.MEDIA_DEVICE_STATE_TYPE={}))[Ce.MEDIA_DEVICE_STATE_ACTIVE=1]="MEDIA_DEVICE_STATE_ACTIVE",Ce[Ce.MEDIA_DEVICE_STATE_DISABLED=2]="MEDIA_DEVICE_STATE_DISABLED",Ce[Ce.MEDIA_DEVICE_STATE_NOT_PRESENT=4]="MEDIA_DEVICE_STATE_NOT_PRESENT",Ce[Ce.MEDIA_DEVICE_STATE_UNPLUGGED=8]="MEDIA_DEVICE_STATE_UNPLUGGED",Ce[Ce.MEDIA_DEVICE_STATE_UNRECOMMENDED=16]="MEDIA_DEVICE_STATE_UNRECOMMENDED",(Re=t.MEDIA_DEVICE_TYPE||(t.MEDIA_DEVICE_TYPE={}))[Re.UNKNOWN_AUDIO_DEVICE=-1]="UNKNOWN_AUDIO_DEVICE",Re[Re.AUDIO_PLAYOUT_DEVICE=0]="AUDIO_PLAYOUT_DEVICE",Re[Re.AUDIO_RECORDING_DEVICE=1]="AUDIO_RECORDING_DEVICE",Re[Re.VIDEO_RENDER_DEVICE=2]="VIDEO_RENDER_DEVICE",Re[Re.VIDEO_CAPTURE_DEVICE=3]="VIDEO_CAPTURE_DEVICE",Re[Re.AUDIO_APPLICATION_PLAYOUT_DEVICE=4]="AUDIO_APPLICATION_PLAYOUT_DEVICE",(fe=t.LOCAL_VIDEO_STREAM_STATE||(t.LOCAL_VIDEO_STREAM_STATE={}))[fe.LOCAL_VIDEO_STREAM_STATE_STOPPED=0]="LOCAL_VIDEO_STREAM_STATE_STOPPED",fe[fe.LOCAL_VIDEO_STREAM_STATE_CAPTURING=1]="LOCAL_VIDEO_STREAM_STATE_CAPTURING",fe[fe.LOCAL_VIDEO_STREAM_STATE_ENCODING=2]="LOCAL_VIDEO_STREAM_STATE_ENCODING",fe[fe.LOCAL_VIDEO_STREAM_STATE_FAILED=3]="LOCAL_VIDEO_STREAM_STATE_FAILED",(ge=t.LOCAL_VIDEO_STREAM_ERROR||(t.LOCAL_VIDEO_STREAM_ERROR={}))[ge.LOCAL_VIDEO_STREAM_ERROR_OK=0]="LOCAL_VIDEO_STREAM_ERROR_OK",ge[ge.LOCAL_VIDEO_STREAM_ERROR_FAILURE=1]="LOCAL_VIDEO_STREAM_ERROR_FAILURE",ge[ge.LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION=2]="LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION",ge[ge.LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY=3]="LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY",ge[ge.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE=4]="LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE",ge[ge.LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE=5]="LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE",ge[ge.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND=6]="LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND",ge[ge.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS=7]="LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS",ge[ge.LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED=11]="LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED",ge[ge.LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED=12]="LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED",(Ie=t.LOCAL_AUDIO_STREAM_STATE||(t.LOCAL_AUDIO_STREAM_STATE={}))[Ie.LOCAL_AUDIO_STREAM_STATE_STOPPED=0]="LOCAL_AUDIO_STREAM_STATE_STOPPED",Ie[Ie.LOCAL_AUDIO_STREAM_STATE_RECORDING=1]="LOCAL_AUDIO_STREAM_STATE_RECORDING",Ie[Ie.LOCAL_AUDIO_STREAM_STATE_ENCODING=2]="LOCAL_AUDIO_STREAM_STATE_ENCODING",Ie[Ie.LOCAL_AUDIO_STREAM_STATE_FAILED=3]="LOCAL_AUDIO_STREAM_STATE_FAILED",(_e=t.LOCAL_AUDIO_STREAM_ERROR||(t.LOCAL_AUDIO_STREAM_ERROR={}))[_e.LOCAL_AUDIO_STREAM_ERROR_OK=0]="LOCAL_AUDIO_STREAM_ERROR_OK",_e[_e.LOCAL_AUDIO_STREAM_ERROR_FAILURE=1]="LOCAL_AUDIO_STREAM_ERROR_FAILURE",_e[_e.LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION=2]="LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION",_e[_e.LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY=3]="LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY",_e[_e.LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE=4]="LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE",_e[_e.LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE=5]="LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE",(pe=t.AUDIO_RECORDING_QUALITY_TYPE||(t.AUDIO_RECORDING_QUALITY_TYPE={}))[pe.AUDIO_RECORDING_QUALITY_LOW=0]="AUDIO_RECORDING_QUALITY_LOW",pe[pe.AUDIO_RECORDING_QUALITY_MEDIUM=1]="AUDIO_RECORDING_QUALITY_MEDIUM",pe[pe.AUDIO_RECORDING_QUALITY_HIGH=2]="AUDIO_RECORDING_QUALITY_HIGH",(he=t.QUALITY_TYPE||(t.QUALITY_TYPE={}))[he.QUALITY_UNKNOWN=0]="QUALITY_UNKNOWN",he[he.QUALITY_EXCELLENT=1]="QUALITY_EXCELLENT",he[he.QUALITY_GOOD=2]="QUALITY_GOOD",he[he.QUALITY_POOR=3]="QUALITY_POOR",he[he.QUALITY_BAD=4]="QUALITY_BAD",he[he.QUALITY_VBAD=5]="QUALITY_VBAD",he[he.QUALITY_DOWN=6]="QUALITY_DOWN",he[he.QUALITY_UNSUPPORTED=7]="QUALITY_UNSUPPORTED",he[he.QUALITY_DETECTING=8]="QUALITY_DETECTING",(le=t.RENDER_MODE_TYPE||(t.RENDER_MODE_TYPE={}))[le.RENDER_MODE_HIDDEN=1]="RENDER_MODE_HIDDEN",le[le.RENDER_MODE_FIT=2]="RENDER_MODE_FIT",le[le.RENDER_MODE_ADAPTIVE=3]="RENDER_MODE_ADAPTIVE",le[le.RENDER_MODE_FILL=4]="RENDER_MODE_FILL",(Ee=t.VIDEO_MIRROR_MODE_TYPE||(t.VIDEO_MIRROR_MODE_TYPE={}))[Ee.VIDEO_MIRROR_MODE_AUTO=0]="VIDEO_MIRROR_MODE_AUTO",Ee[Ee.VIDEO_MIRROR_MODE_ENABLED=1]="VIDEO_MIRROR_MODE_ENABLED",Ee[Ee.VIDEO_MIRROR_MODE_DISABLED=2]="VIDEO_MIRROR_MODE_DISABLED",(ue=t.VIDEO_PROFILE_TYPE||(t.VIDEO_PROFILE_TYPE={}))[ue.VIDEO_PROFILE_LANDSCAPE_120P=0]="VIDEO_PROFILE_LANDSCAPE_120P",ue[ue.VIDEO_PROFILE_LANDSCAPE_120P_3=2]="VIDEO_PROFILE_LANDSCAPE_120P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_180P=10]="VIDEO_PROFILE_LANDSCAPE_180P",ue[ue.VIDEO_PROFILE_LANDSCAPE_180P_3=12]="VIDEO_PROFILE_LANDSCAPE_180P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_180P_4=13]="VIDEO_PROFILE_LANDSCAPE_180P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_240P=20]="VIDEO_PROFILE_LANDSCAPE_240P",ue[ue.VIDEO_PROFILE_LANDSCAPE_240P_3=22]="VIDEO_PROFILE_LANDSCAPE_240P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_240P_4=23]="VIDEO_PROFILE_LANDSCAPE_240P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P=30]="VIDEO_PROFILE_LANDSCAPE_360P",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_3=32]="VIDEO_PROFILE_LANDSCAPE_360P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_4=33]="VIDEO_PROFILE_LANDSCAPE_360P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_6=35]="VIDEO_PROFILE_LANDSCAPE_360P_6",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_7=36]="VIDEO_PROFILE_LANDSCAPE_360P_7",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_8=37]="VIDEO_PROFILE_LANDSCAPE_360P_8",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_9=38]="VIDEO_PROFILE_LANDSCAPE_360P_9",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_10=39]="VIDEO_PROFILE_LANDSCAPE_360P_10",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_11=100]="VIDEO_PROFILE_LANDSCAPE_360P_11",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P=40]="VIDEO_PROFILE_LANDSCAPE_480P",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_3=42]="VIDEO_PROFILE_LANDSCAPE_480P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_4=43]="VIDEO_PROFILE_LANDSCAPE_480P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_6=45]="VIDEO_PROFILE_LANDSCAPE_480P_6",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_8=47]="VIDEO_PROFILE_LANDSCAPE_480P_8",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_9=48]="VIDEO_PROFILE_LANDSCAPE_480P_9",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_10=49]="VIDEO_PROFILE_LANDSCAPE_480P_10",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P=50]="VIDEO_PROFILE_LANDSCAPE_720P",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P_3=52]="VIDEO_PROFILE_LANDSCAPE_720P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P_5=54]="VIDEO_PROFILE_LANDSCAPE_720P_5",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P_6=55]="VIDEO_PROFILE_LANDSCAPE_720P_6",ue[ue.VIDEO_PROFILE_LANDSCAPE_1080P=60]="VIDEO_PROFILE_LANDSCAPE_1080P",ue[ue.VIDEO_PROFILE_LANDSCAPE_1080P_3=62]="VIDEO_PROFILE_LANDSCAPE_1080P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_1080P_5=64]="VIDEO_PROFILE_LANDSCAPE_1080P_5",ue[ue.VIDEO_PROFILE_LANDSCAPE_1440P=66]="VIDEO_PROFILE_LANDSCAPE_1440P",ue[ue.VIDEO_PROFILE_LANDSCAPE_1440P_2=67]="VIDEO_PROFILE_LANDSCAPE_1440P_2",ue[ue.VIDEO_PROFILE_LANDSCAPE_4K=70]="VIDEO_PROFILE_LANDSCAPE_4K",ue[ue.VIDEO_PROFILE_LANDSCAPE_4K_3=72]="VIDEO_PROFILE_LANDSCAPE_4K_3",ue[ue.VIDEO_PROFILE_PORTRAIT_120P=1e3]="VIDEO_PROFILE_PORTRAIT_120P",ue[ue.VIDEO_PROFILE_PORTRAIT_120P_3=1002]="VIDEO_PROFILE_PORTRAIT_120P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_180P=1010]="VIDEO_PROFILE_PORTRAIT_180P",ue[ue.VIDEO_PROFILE_PORTRAIT_180P_3=1012]="VIDEO_PROFILE_PORTRAIT_180P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_180P_4=1013]="VIDEO_PROFILE_PORTRAIT_180P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_240P=1020]="VIDEO_PROFILE_PORTRAIT_240P",ue[ue.VIDEO_PROFILE_PORTRAIT_240P_3=1022]="VIDEO_PROFILE_PORTRAIT_240P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_240P_4=1023]="VIDEO_PROFILE_PORTRAIT_240P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_360P=1030]="VIDEO_PROFILE_PORTRAIT_360P",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_3=1032]="VIDEO_PROFILE_PORTRAIT_360P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_4=1033]="VIDEO_PROFILE_PORTRAIT_360P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_6=1035]="VIDEO_PROFILE_PORTRAIT_360P_6",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_7=1036]="VIDEO_PROFILE_PORTRAIT_360P_7",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_8=1037]="VIDEO_PROFILE_PORTRAIT_360P_8",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_9=1038]="VIDEO_PROFILE_PORTRAIT_360P_9",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_10=1039]="VIDEO_PROFILE_PORTRAIT_360P_10",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_11=1100]="VIDEO_PROFILE_PORTRAIT_360P_11",ue[ue.VIDEO_PROFILE_PORTRAIT_480P=1040]="VIDEO_PROFILE_PORTRAIT_480P",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_3=1042]="VIDEO_PROFILE_PORTRAIT_480P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_4=1043]="VIDEO_PROFILE_PORTRAIT_480P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_6=1045]="VIDEO_PROFILE_PORTRAIT_480P_6",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_8=1047]="VIDEO_PROFILE_PORTRAIT_480P_8",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_9=1048]="VIDEO_PROFILE_PORTRAIT_480P_9",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_10=1049]="VIDEO_PROFILE_PORTRAIT_480P_10",ue[ue.VIDEO_PROFILE_PORTRAIT_720P=1050]="VIDEO_PROFILE_PORTRAIT_720P",ue[ue.VIDEO_PROFILE_PORTRAIT_720P_3=1052]="VIDEO_PROFILE_PORTRAIT_720P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_720P_5=1054]="VIDEO_PROFILE_PORTRAIT_720P_5",ue[ue.VIDEO_PROFILE_PORTRAIT_720P_6=1055]="VIDEO_PROFILE_PORTRAIT_720P_6",ue[ue.VIDEO_PROFILE_PORTRAIT_1080P=1060]="VIDEO_PROFILE_PORTRAIT_1080P",ue[ue.VIDEO_PROFILE_PORTRAIT_1080P_3=1062]="VIDEO_PROFILE_PORTRAIT_1080P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_1080P_5=1064]="VIDEO_PROFILE_PORTRAIT_1080P_5",ue[ue.VIDEO_PROFILE_PORTRAIT_1440P=1066]="VIDEO_PROFILE_PORTRAIT_1440P",ue[ue.VIDEO_PROFILE_PORTRAIT_1440P_2=1067]="VIDEO_PROFILE_PORTRAIT_1440P_2",ue[ue.VIDEO_PROFILE_PORTRAIT_4K=1070]="VIDEO_PROFILE_PORTRAIT_4K",ue[ue.VIDEO_PROFILE_PORTRAIT_4K_3=1072]="VIDEO_PROFILE_PORTRAIT_4K_3",ue[ue.VIDEO_PROFILE_DEFAULT=30]="VIDEO_PROFILE_DEFAULT",(de=t.AUDIO_PROFILE_TYPE||(t.AUDIO_PROFILE_TYPE={}))[de.AUDIO_PROFILE_DEFAULT=0]="AUDIO_PROFILE_DEFAULT",de[de.AUDIO_PROFILE_SPEECH_STANDARD=1]="AUDIO_PROFILE_SPEECH_STANDARD",de[de.AUDIO_PROFILE_MUSIC_STANDARD=2]="AUDIO_PROFILE_MUSIC_STANDARD",de[de.AUDIO_PROFILE_MUSIC_STANDARD_STEREO=3]="AUDIO_PROFILE_MUSIC_STANDARD_STEREO",de[de.AUDIO_PROFILE_MUSIC_HIGH_QUALITY=4]="AUDIO_PROFILE_MUSIC_HIGH_QUALITY",de[de.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO=5]="AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO",de[de.AUDIO_PROFILE_IOT=6]="AUDIO_PROFILE_IOT",de[de.AUDIO_PROFILE_NUM=7]="AUDIO_PROFILE_NUM",(Ae=t.AUDIO_SCENARIO_TYPE||(t.AUDIO_SCENARIO_TYPE={}))[Ae.AUDIO_SCENARIO_DEFAULT=0]="AUDIO_SCENARIO_DEFAULT",Ae[Ae.AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT=1]="AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT",Ae[Ae.AUDIO_SCENARIO_EDUCATION=2]="AUDIO_SCENARIO_EDUCATION",Ae[Ae.AUDIO_SCENARIO_GAME_STREAMING=3]="AUDIO_SCENARIO_GAME_STREAMING",Ae[Ae.AUDIO_SCENARIO_SHOWROOM=4]="AUDIO_SCENARIO_SHOWROOM",Ae[Ae.AUDIO_SCENARIO_CHATROOM_GAMING=5]="AUDIO_SCENARIO_CHATROOM_GAMING",Ae[Ae.AUDIO_SCENARIO_IOT=6]="AUDIO_SCENARIO_IOT",Ae[Ae.AUDIO_SCENARIO_MEETING=8]="AUDIO_SCENARIO_MEETING",Ae[Ae.AUDIO_SCENARIO_NUM=9]="AUDIO_SCENARIO_NUM",(ce=t.CHANNEL_PROFILE_TYPE||(t.CHANNEL_PROFILE_TYPE={}))[ce.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",ce[ce.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING",ce[ce.CHANNEL_PROFILE_GAME=2]="CHANNEL_PROFILE_GAME",(ae=t.CLIENT_ROLE_TYPE||(t.CLIENT_ROLE_TYPE={}))[ae.CLIENT_ROLE_BROADCASTER=1]="CLIENT_ROLE_BROADCASTER",ae[ae.CLIENT_ROLE_AUDIENCE=2]="CLIENT_ROLE_AUDIENCE",(se=t.AUDIENCE_LATENCY_LEVEL_TYPE||(t.AUDIENCE_LATENCY_LEVEL_TYPE={}))[se.AUDIENCE_LATENCY_LEVEL_LOW_LATENCY=1]="AUDIENCE_LATENCY_LEVEL_LOW_LATENCY",se[se.AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY=2]="AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY",(oe=t.SUPER_RESOLUTION_STATE_REASON||(t.SUPER_RESOLUTION_STATE_REASON={}))[oe.SR_STATE_REASON_SUCCESS=0]="SR_STATE_REASON_SUCCESS",oe[oe.SR_STATE_REASON_STREAM_OVER_LIMITATION=1]="SR_STATE_REASON_STREAM_OVER_LIMITATION",oe[oe.SR_STATE_REASON_USER_COUNT_OVER_LIMITATION=2]="SR_STATE_REASON_USER_COUNT_OVER_LIMITATION",oe[oe.SR_STATE_REASON_DEVICE_NOT_SUPPORTED=3]="SR_STATE_REASON_DEVICE_NOT_SUPPORTED",(re=t.USER_OFFLINE_REASON_TYPE||(t.USER_OFFLINE_REASON_TYPE={}))[re.USER_OFFLINE_QUIT=0]="USER_OFFLINE_QUIT",re[re.USER_OFFLINE_DROPPED=1]="USER_OFFLINE_DROPPED",re[re.USER_OFFLINE_BECOME_AUDIENCE=2]="USER_OFFLINE_BECOME_AUDIENCE",(ne=t.RTMP_STREAM_PUBLISH_STATE||(t.RTMP_STREAM_PUBLISH_STATE={}))[ne.RTMP_STREAM_PUBLISH_STATE_IDLE=0]="RTMP_STREAM_PUBLISH_STATE_IDLE",ne[ne.RTMP_STREAM_PUBLISH_STATE_CONNECTING=1]="RTMP_STREAM_PUBLISH_STATE_CONNECTING",ne[ne.RTMP_STREAM_PUBLISH_STATE_RUNNING=2]="RTMP_STREAM_PUBLISH_STATE_RUNNING",ne[ne.RTMP_STREAM_PUBLISH_STATE_RECOVERING=3]="RTMP_STREAM_PUBLISH_STATE_RECOVERING",ne[ne.RTMP_STREAM_PUBLISH_STATE_FAILURE=4]="RTMP_STREAM_PUBLISH_STATE_FAILURE",(ie=t.RTMP_STREAM_PUBLISH_ERROR||(t.RTMP_STREAM_PUBLISH_ERROR={}))[ie.RTMP_STREAM_PUBLISH_ERROR_OK=0]="RTMP_STREAM_PUBLISH_ERROR_OK",ie[ie.RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT=1]="RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT",ie[ie.RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED=2]="RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED",ie[ie.RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT=3]="RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT",ie[ie.RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR=4]="RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR",ie[ie.RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR=5]="RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR",ie[ie.RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN=6]="RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN",ie[ie.RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT=7]="RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT",ie[ie.RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED=8]="RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED",ie[ie.RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND=9]="RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND",ie[ie.RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED=10]="RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED",(te=t.RTMP_STREAMING_EVENT||(t.RTMP_STREAMING_EVENT={}))[te.RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE=1]="RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE",(ee=t.INJECT_STREAM_STATUS||(t.INJECT_STREAM_STATUS={}))[ee.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",ee[ee.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",ee[ee.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",ee[ee.INJECT_STREAM_STATUS_START_TIMEDOUT=3]="INJECT_STREAM_STATUS_START_TIMEDOUT",ee[ee.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",ee[ee.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",ee[ee.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",ee[ee.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",ee[ee.INJECT_STREAM_STATUS_STOP_TIMEDOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEDOUT",ee[ee.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",ee[ee.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN",($=t.REMOTE_VIDEO_STREAM_TYPE||(t.REMOTE_VIDEO_STREAM_TYPE={}))[$.REMOTE_VIDEO_STREAM_HIGH=0]="REMOTE_VIDEO_STREAM_HIGH",$[$.REMOTE_VIDEO_STREAM_LOW=1]="REMOTE_VIDEO_STREAM_LOW",(Z=t.CAPTURE_BRIGHTNESS_LEVEL_TYPE||(t.CAPTURE_BRIGHTNESS_LEVEL_TYPE={}))[Z.CAPTURE_BRIGHTNESS_LEVEL_INVALID=-1]="CAPTURE_BRIGHTNESS_LEVEL_INVALID",Z[Z.CAPTURE_BRIGHTNESS_LEVEL_NORMAL=0]="CAPTURE_BRIGHTNESS_LEVEL_NORMAL",Z[Z.CAPTURE_BRIGHTNESS_LEVEL_BRIGHT=1]="CAPTURE_BRIGHTNESS_LEVEL_BRIGHT",Z[Z.CAPTURE_BRIGHTNESS_LEVEL_DARK=2]="CAPTURE_BRIGHTNESS_LEVEL_DARK",(z=t.RAW_AUDIO_FRAME_OP_MODE_TYPE||(t.RAW_AUDIO_FRAME_OP_MODE_TYPE={}))[z.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY=0]="RAW_AUDIO_FRAME_OP_MODE_READ_ONLY",z[z.RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY=1]="RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY",z[z.RAW_AUDIO_FRAME_OP_MODE_READ_WRITE=2]="RAW_AUDIO_FRAME_OP_MODE_READ_WRITE",(X=t.AUDIO_SAMPLE_RATE_TYPE||(t.AUDIO_SAMPLE_RATE_TYPE={}))[X.AUDIO_SAMPLE_RATE_32000=32e3]="AUDIO_SAMPLE_RATE_32000",X[X.AUDIO_SAMPLE_RATE_44100=44100]="AUDIO_SAMPLE_RATE_44100",X[X.AUDIO_SAMPLE_RATE_48000=48e3]="AUDIO_SAMPLE_RATE_48000",(q=t.VIDEO_CODEC_PROFILE_TYPE||(t.VIDEO_CODEC_PROFILE_TYPE={}))[q.VIDEO_CODEC_PROFILE_BASELINE=66]="VIDEO_CODEC_PROFILE_BASELINE",q[q.VIDEO_CODEC_PROFILE_MAIN=77]="VIDEO_CODEC_PROFILE_MAIN",q[q.VIDEO_CODEC_PROFILE_HIGH=100]="VIDEO_CODEC_PROFILE_HIGH",(J=t.VIDEO_CODEC_TYPE||(t.VIDEO_CODEC_TYPE={}))[J.VIDEO_CODEC_VP8=1]="VIDEO_CODEC_VP8",J[J.VIDEO_CODEC_H264=2]="VIDEO_CODEC_H264",J[J.VIDEO_CODEC_EVP=3]="VIDEO_CODEC_EVP",J[J.VIDEO_CODEC_E264=4]="VIDEO_CODEC_E264",(W=t.VIDEO_CODEC_TYPE_FOR_STREAM||(t.VIDEO_CODEC_TYPE_FOR_STREAM={}))[W.VIDEO_CODEC_H264_FOR_STREAM=1]="VIDEO_CODEC_H264_FOR_STREAM",W[W.VIDEO_CODEC_H265_FOR_STREAM=2]="VIDEO_CODEC_H265_FOR_STREAM",(K=t.AUDIO_EQUALIZATION_BAND_FREQUENCY||(t.AUDIO_EQUALIZATION_BAND_FREQUENCY={}))[K.AUDIO_EQUALIZATION_BAND_31=0]="AUDIO_EQUALIZATION_BAND_31",K[K.AUDIO_EQUALIZATION_BAND_62=1]="AUDIO_EQUALIZATION_BAND_62",K[K.AUDIO_EQUALIZATION_BAND_125=2]="AUDIO_EQUALIZATION_BAND_125",K[K.AUDIO_EQUALIZATION_BAND_250=3]="AUDIO_EQUALIZATION_BAND_250",K[K.AUDIO_EQUALIZATION_BAND_500=4]="AUDIO_EQUALIZATION_BAND_500",K[K.AUDIO_EQUALIZATION_BAND_1K=5]="AUDIO_EQUALIZATION_BAND_1K",K[K.AUDIO_EQUALIZATION_BAND_2K=6]="AUDIO_EQUALIZATION_BAND_2K",K[K.AUDIO_EQUALIZATION_BAND_4K=7]="AUDIO_EQUALIZATION_BAND_4K",K[K.AUDIO_EQUALIZATION_BAND_8K=8]="AUDIO_EQUALIZATION_BAND_8K",K[K.AUDIO_EQUALIZATION_BAND_16K=9]="AUDIO_EQUALIZATION_BAND_16K",(H=t.AUDIO_REVERB_TYPE||(t.AUDIO_REVERB_TYPE={}))[H.AUDIO_REVERB_DRY_LEVEL=0]="AUDIO_REVERB_DRY_LEVEL",H[H.AUDIO_REVERB_WET_LEVEL=1]="AUDIO_REVERB_WET_LEVEL",H[H.AUDIO_REVERB_ROOM_SIZE=2]="AUDIO_REVERB_ROOM_SIZE",H[H.AUDIO_REVERB_WET_DELAY=3]="AUDIO_REVERB_WET_DELAY",H[H.AUDIO_REVERB_STRENGTH=4]="AUDIO_REVERB_STRENGTH",(Y=t.VOICE_CHANGER_PRESET||(t.VOICE_CHANGER_PRESET={}))[Y.VOICE_CHANGER_OFF=0]="VOICE_CHANGER_OFF",Y[Y.VOICE_CHANGER_OLDMAN=1]="VOICE_CHANGER_OLDMAN",Y[Y.VOICE_CHANGER_BABYBOY=2]="VOICE_CHANGER_BABYBOY",Y[Y.VOICE_CHANGER_BABYGIRL=3]="VOICE_CHANGER_BABYGIRL",Y[Y.VOICE_CHANGER_ZHUBAJIE=4]="VOICE_CHANGER_ZHUBAJIE",Y[Y.VOICE_CHANGER_ETHEREAL=5]="VOICE_CHANGER_ETHEREAL",Y[Y.VOICE_CHANGER_HULK=6]="VOICE_CHANGER_HULK",Y[Y.VOICE_BEAUTY_VIGOROUS=1048577]="VOICE_BEAUTY_VIGOROUS",Y[Y.VOICE_BEAUTY_DEEP=1048578]="VOICE_BEAUTY_DEEP",Y[Y.VOICE_BEAUTY_MELLOW=1048579]="VOICE_BEAUTY_MELLOW",Y[Y.VOICE_BEAUTY_FALSETTO=1048580]="VOICE_BEAUTY_FALSETTO",Y[Y.VOICE_BEAUTY_FULL=1048581]="VOICE_BEAUTY_FULL",Y[Y.VOICE_BEAUTY_CLEAR=1048582]="VOICE_BEAUTY_CLEAR",Y[Y.VOICE_BEAUTY_RESOUNDING=1048583]="VOICE_BEAUTY_RESOUNDING",Y[Y.VOICE_BEAUTY_RINGING=1048584]="VOICE_BEAUTY_RINGING",Y[Y.VOICE_BEAUTY_SPACIAL=1048585]="VOICE_BEAUTY_SPACIAL",Y[Y.GENERAL_BEAUTY_VOICE_MALE_MAGNETIC=2097153]="GENERAL_BEAUTY_VOICE_MALE_MAGNETIC",Y[Y.GENERAL_BEAUTY_VOICE_FEMALE_FRESH=2097154]="GENERAL_BEAUTY_VOICE_FEMALE_FRESH",Y[Y.GENERAL_BEAUTY_VOICE_FEMALE_VITALITY=2097155]="GENERAL_BEAUTY_VOICE_FEMALE_VITALITY",(j=t.AUDIO_REVERB_PRESET||(t.AUDIO_REVERB_PRESET={}))[j.AUDIO_REVERB_OFF=0]="AUDIO_REVERB_OFF",j[j.AUDIO_REVERB_FX_KTV=1048577]="AUDIO_REVERB_FX_KTV",j[j.AUDIO_REVERB_FX_VOCAL_CONCERT=1048578]="AUDIO_REVERB_FX_VOCAL_CONCERT",j[j.AUDIO_REVERB_FX_UNCLE=1048579]="AUDIO_REVERB_FX_UNCLE",j[j.AUDIO_REVERB_FX_SISTER=1048580]="AUDIO_REVERB_FX_SISTER",j[j.AUDIO_REVERB_FX_STUDIO=1048581]="AUDIO_REVERB_FX_STUDIO",j[j.AUDIO_REVERB_FX_POPULAR=1048582]="AUDIO_REVERB_FX_POPULAR",j[j.AUDIO_REVERB_FX_RNB=1048583]="AUDIO_REVERB_FX_RNB",j[j.AUDIO_REVERB_FX_PHONOGRAPH=1048584]="AUDIO_REVERB_FX_PHONOGRAPH",j[j.AUDIO_REVERB_POPULAR=1]="AUDIO_REVERB_POPULAR",j[j.AUDIO_REVERB_RNB=2]="AUDIO_REVERB_RNB",j[j.AUDIO_REVERB_ROCK=3]="AUDIO_REVERB_ROCK",j[j.AUDIO_REVERB_HIPHOP=4]="AUDIO_REVERB_HIPHOP",j[j.AUDIO_REVERB_VOCAL_CONCERT=5]="AUDIO_REVERB_VOCAL_CONCERT",j[j.AUDIO_REVERB_KTV=6]="AUDIO_REVERB_KTV",j[j.AUDIO_REVERB_STUDIO=7]="AUDIO_REVERB_STUDIO",j[j.AUDIO_VIRTUAL_STEREO=2097153]="AUDIO_VIRTUAL_STEREO",j[j.AUDIO_ELECTRONIC_VOICE=3145729]="AUDIO_ELECTRONIC_VOICE",j[j.AUDIO_THREEDIM_VOICE=4194305]="AUDIO_THREEDIM_VOICE",(G=t.VOICE_BEAUTIFIER_PRESET||(t.VOICE_BEAUTIFIER_PRESET={}))[G.VOICE_BEAUTIFIER_OFF=0]="VOICE_BEAUTIFIER_OFF",G[G.CHAT_BEAUTIFIER_MAGNETIC=16843008]="CHAT_BEAUTIFIER_MAGNETIC",G[G.CHAT_BEAUTIFIER_FRESH=16843264]="CHAT_BEAUTIFIER_FRESH",G[G.CHAT_BEAUTIFIER_VITALITY=16843520]="CHAT_BEAUTIFIER_VITALITY",G[G.SINGING_BEAUTIFIER=16908544]="SINGING_BEAUTIFIER",G[G.TIMBRE_TRANSFORMATION_VIGOROUS=16974080]="TIMBRE_TRANSFORMATION_VIGOROUS",G[G.TIMBRE_TRANSFORMATION_DEEP=16974336]="TIMBRE_TRANSFORMATION_DEEP",G[G.TIMBRE_TRANSFORMATION_MELLOW=16974592]="TIMBRE_TRANSFORMATION_MELLOW",G[G.TIMBRE_TRANSFORMATION_FALSETTO=16974848]="TIMBRE_TRANSFORMATION_FALSETTO",G[G.TIMBRE_TRANSFORMATION_FULL=16975104]="TIMBRE_TRANSFORMATION_FULL",G[G.TIMBRE_TRANSFORMATION_CLEAR=16975360]="TIMBRE_TRANSFORMATION_CLEAR",G[G.TIMBRE_TRANSFORMATION_RESOUNDING=16975616]="TIMBRE_TRANSFORMATION_RESOUNDING",G[G.TIMBRE_TRANSFORMATION_RINGING=16975872]="TIMBRE_TRANSFORMATION_RINGING",(F=t.AUDIO_EFFECT_PRESET||(t.AUDIO_EFFECT_PRESET={}))[F.AUDIO_EFFECT_OFF=0]="AUDIO_EFFECT_OFF",F[F.ROOM_ACOUSTICS_KTV=33620224]="ROOM_ACOUSTICS_KTV",F[F.ROOM_ACOUSTICS_VOCAL_CONCERT=33620480]="ROOM_ACOUSTICS_VOCAL_CONCERT",F[F.ROOM_ACOUSTICS_STUDIO=33620736]="ROOM_ACOUSTICS_STUDIO",F[F.ROOM_ACOUSTICS_PHONOGRAPH=33620992]="ROOM_ACOUSTICS_PHONOGRAPH",F[F.ROOM_ACOUSTICS_VIRTUAL_STEREO=33621248]="ROOM_ACOUSTICS_VIRTUAL_STEREO",F[F.ROOM_ACOUSTICS_SPACIAL=33621504]="ROOM_ACOUSTICS_SPACIAL",F[F.ROOM_ACOUSTICS_ETHEREAL=33621760]="ROOM_ACOUSTICS_ETHEREAL",F[F.ROOM_ACOUSTICS_3D_VOICE=33622016]="ROOM_ACOUSTICS_3D_VOICE",F[F.VOICE_CHANGER_EFFECT_UNCLE=33685760]="VOICE_CHANGER_EFFECT_UNCLE",F[F.VOICE_CHANGER_EFFECT_OLDMAN=33686016]="VOICE_CHANGER_EFFECT_OLDMAN",F[F.VOICE_CHANGER_EFFECT_BOY=33686272]="VOICE_CHANGER_EFFECT_BOY",F[F.VOICE_CHANGER_EFFECT_SISTER=33686528]="VOICE_CHANGER_EFFECT_SISTER",F[F.VOICE_CHANGER_EFFECT_GIRL=33686784]="VOICE_CHANGER_EFFECT_GIRL",F[F.VOICE_CHANGER_EFFECT_PIGKING=33687040]="VOICE_CHANGER_EFFECT_PIGKING",F[F.VOICE_CHANGER_EFFECT_HULK=33687296]="VOICE_CHANGER_EFFECT_HULK",F[F.STYLE_TRANSFORMATION_RNB=33751296]="STYLE_TRANSFORMATION_RNB",F[F.STYLE_TRANSFORMATION_POPULAR=33751552]="STYLE_TRANSFORMATION_POPULAR",F[F.PITCH_CORRECTION=33816832]="PITCH_CORRECTION",(x=t.VOICE_CONVERSION_PRESET||(t.VOICE_CONVERSION_PRESET={}))[x.VOICE_CONVERSION_OFF=0]="VOICE_CONVERSION_OFF",x[x.VOICE_CHANGER_NEUTRAL=50397440]="VOICE_CHANGER_NEUTRAL",x[x.VOICE_CHANGER_SWEET=50397696]="VOICE_CHANGER_SWEET",x[x.VOICE_CHANGER_SOLID=50397952]="VOICE_CHANGER_SOLID",x[x.VOICE_CHANGER_BASS=50398208]="VOICE_CHANGER_BASS",(Q=t.AUDIO_CODEC_PROFILE_TYPE||(t.AUDIO_CODEC_PROFILE_TYPE={}))[Q.AUDIO_CODEC_PROFILE_LC_AAC=0]="AUDIO_CODEC_PROFILE_LC_AAC",Q[Q.AUDIO_CODEC_PROFILE_HE_AAC=1]="AUDIO_CODEC_PROFILE_HE_AAC",(V=t.REMOTE_AUDIO_STATE||(t.REMOTE_AUDIO_STATE={}))[V.REMOTE_AUDIO_STATE_STOPPED=0]="REMOTE_AUDIO_STATE_STOPPED",V[V.REMOTE_AUDIO_STATE_STARTING=1]="REMOTE_AUDIO_STATE_STARTING",V[V.REMOTE_AUDIO_STATE_DECODING=2]="REMOTE_AUDIO_STATE_DECODING",V[V.REMOTE_AUDIO_STATE_FROZEN=3]="REMOTE_AUDIO_STATE_FROZEN",V[V.REMOTE_AUDIO_STATE_FAILED=4]="REMOTE_AUDIO_STATE_FAILED",(B=t.REMOTE_AUDIO_STATE_REASON||(t.REMOTE_AUDIO_STATE_REASON={}))[B.REMOTE_AUDIO_REASON_INTERNAL=0]="REMOTE_AUDIO_REASON_INTERNAL",B[B.REMOTE_AUDIO_REASON_NETWORK_CONGESTION=1]="REMOTE_AUDIO_REASON_NETWORK_CONGESTION",B[B.REMOTE_AUDIO_REASON_NETWORK_RECOVERY=2]="REMOTE_AUDIO_REASON_NETWORK_RECOVERY",B[B.REMOTE_AUDIO_REASON_LOCAL_MUTED=3]="REMOTE_AUDIO_REASON_LOCAL_MUTED",B[B.REMOTE_AUDIO_REASON_LOCAL_UNMUTED=4]="REMOTE_AUDIO_REASON_LOCAL_UNMUTED",B[B.REMOTE_AUDIO_REASON_REMOTE_MUTED=5]="REMOTE_AUDIO_REASON_REMOTE_MUTED",B[B.REMOTE_AUDIO_REASON_REMOTE_UNMUTED=6]="REMOTE_AUDIO_REASON_REMOTE_UNMUTED",B[B.REMOTE_AUDIO_REASON_REMOTE_OFFLINE=7]="REMOTE_AUDIO_REASON_REMOTE_OFFLINE",(U=t.REMOTE_VIDEO_STATE||(t.REMOTE_VIDEO_STATE={}))[U.REMOTE_VIDEO_STATE_STOPPED=0]="REMOTE_VIDEO_STATE_STOPPED",U[U.REMOTE_VIDEO_STATE_STARTING=1]="REMOTE_VIDEO_STATE_STARTING",U[U.REMOTE_VIDEO_STATE_DECODING=2]="REMOTE_VIDEO_STATE_DECODING",U[U.REMOTE_VIDEO_STATE_FROZEN=3]="REMOTE_VIDEO_STATE_FROZEN",U[U.REMOTE_VIDEO_STATE_FAILED=4]="REMOTE_VIDEO_STATE_FAILED",(M=t.STREAM_PUBLISH_STATE||(t.STREAM_PUBLISH_STATE={}))[M.PUB_STATE_IDLE=0]="PUB_STATE_IDLE",M[M.PUB_STATE_NO_PUBLISHED=1]="PUB_STATE_NO_PUBLISHED",M[M.PUB_STATE_PUBLISHING=2]="PUB_STATE_PUBLISHING",M[M.PUB_STATE_PUBLISHED=3]="PUB_STATE_PUBLISHED",(k=t.STREAM_SUBSCRIBE_STATE||(t.STREAM_SUBSCRIBE_STATE={}))[k.SUB_STATE_IDLE=0]="SUB_STATE_IDLE",k[k.SUB_STATE_NO_SUBSCRIBED=1]="SUB_STATE_NO_SUBSCRIBED",k[k.SUB_STATE_SUBSCRIBING=2]="SUB_STATE_SUBSCRIBING",k[k.SUB_STATE_SUBSCRIBED=3]="SUB_STATE_SUBSCRIBED",(P=t.XLA_REMOTE_VIDEO_FROZEN_TYPE||(t.XLA_REMOTE_VIDEO_FROZEN_TYPE={}))[P.XLA_REMOTE_VIDEO_FROZEN_500MS=0]="XLA_REMOTE_VIDEO_FROZEN_500MS",P[P.XLA_REMOTE_VIDEO_FROZEN_200MS=1]="XLA_REMOTE_VIDEO_FROZEN_200MS",P[P.XLA_REMOTE_VIDEO_FROZEN_600MS=2]="XLA_REMOTE_VIDEO_FROZEN_600MS",P[P.XLA_REMOTE_VIDEO_FROZEN_TYPE_MAX=3]="XLA_REMOTE_VIDEO_FROZEN_TYPE_MAX",(L=t.XLA_REMOTE_AUDIO_FROZEN_TYPE||(t.XLA_REMOTE_AUDIO_FROZEN_TYPE={}))[L.XLA_REMOTE_AUDIO_FROZEN_80MS=0]="XLA_REMOTE_AUDIO_FROZEN_80MS",L[L.XLA_REMOTE_AUDIO_FROZEN_200MS=1]="XLA_REMOTE_AUDIO_FROZEN_200MS",L[L.XLA_REMOTE_AUDIO_FROZEN_TYPE_MAX=2]="XLA_REMOTE_AUDIO_FROZEN_TYPE_MAX",(b=t.REMOTE_VIDEO_STATE_REASON||(t.REMOTE_VIDEO_STATE_REASON={}))[b.REMOTE_VIDEO_STATE_REASON_INTERNAL=0]="REMOTE_VIDEO_STATE_REASON_INTERNAL",b[b.REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION=1]="REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION",b[b.REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY=2]="REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY",b[b.REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED=3]="REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED",b[b.REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED=4]="REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED",b[b.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED=5]="REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED",b[b.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED=6]="REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED",b[b.REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE=7]="REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE",b[b.REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK=8]="REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK",b[b.REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY=9]="REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY",(w=t.FRAME_RATE||(t.FRAME_RATE={}))[w.FRAME_RATE_FPS_1=1]="FRAME_RATE_FPS_1",w[w.FRAME_RATE_FPS_7=7]="FRAME_RATE_FPS_7",w[w.FRAME_RATE_FPS_10=10]="FRAME_RATE_FPS_10",w[w.FRAME_RATE_FPS_15=15]="FRAME_RATE_FPS_15",w[w.FRAME_RATE_FPS_24=24]="FRAME_RATE_FPS_24",w[w.FRAME_RATE_FPS_30=30]="FRAME_RATE_FPS_30",w[w.FRAME_RATE_FPS_60=60]="FRAME_RATE_FPS_60",(D=t.ORIENTATION_MODE||(t.ORIENTATION_MODE={}))[D.ORIENTATION_MODE_ADAPTIVE=0]="ORIENTATION_MODE_ADAPTIVE",D[D.ORIENTATION_MODE_FIXED_LANDSCAPE=1]="ORIENTATION_MODE_FIXED_LANDSCAPE",D[D.ORIENTATION_MODE_FIXED_PORTRAIT=2]="ORIENTATION_MODE_FIXED_PORTRAIT",(y=t.DEGRADATION_PREFERENCE||(t.DEGRADATION_PREFERENCE={}))[y.MAINTAIN_QUALITY=0]="MAINTAIN_QUALITY",y[y.MAINTAIN_FRAMERATE=1]="MAINTAIN_FRAMERATE",y[y.MAINTAIN_BALANCED=2]="MAINTAIN_BALANCED",(N=t.STREAM_FALLBACK_OPTIONS||(t.STREAM_FALLBACK_OPTIONS={}))[N.STREAM_FALLBACK_OPTION_DISABLED=0]="STREAM_FALLBACK_OPTION_DISABLED",N[N.STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW=1]="STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW",N[N.STREAM_FALLBACK_OPTION_AUDIO_ONLY=2]="STREAM_FALLBACK_OPTION_AUDIO_ONLY",(v=t.CAPTURER_OUTPUT_PREFERENCE||(t.CAPTURER_OUTPUT_PREFERENCE={}))[v.CAPTURER_OUTPUT_PREFERENCE_AUTO=0]="CAPTURER_OUTPUT_PREFERENCE_AUTO",v[v.CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE=1]="CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE",v[v.CAPTURER_OUTPUT_PREFERENCE_PREVIEW=2]="CAPTURER_OUTPUT_PREFERENCE_PREVIEW",v[v.CAPTURER_OUTPUT_PREFERENCE_MANUAL=3]="CAPTURER_OUTPUT_PREFERENCE_MANUAL",(O=t.PRIORITY_TYPE||(t.PRIORITY_TYPE={}))[O.PRIORITY_HIGH=50]="PRIORITY_HIGH",O[O.PRIORITY_NORMAL=100]="PRIORITY_NORMAL",(S=t.CONNECTION_STATE_TYPE||(t.CONNECTION_STATE_TYPE={}))[S.CONNECTION_STATE_DISCONNECTED=1]="CONNECTION_STATE_DISCONNECTED",S[S.CONNECTION_STATE_CONNECTING=2]="CONNECTION_STATE_CONNECTING",S[S.CONNECTION_STATE_CONNECTED=3]="CONNECTION_STATE_CONNECTED",S[S.CONNECTION_STATE_RECONNECTING=4]="CONNECTION_STATE_RECONNECTING",S[S.CONNECTION_STATE_FAILED=5]="CONNECTION_STATE_FAILED",(m=t.CONNECTION_CHANGED_REASON_TYPE||(t.CONNECTION_CHANGED_REASON_TYPE={}))[m.CONNECTION_CHANGED_CONNECTING=0]="CONNECTION_CHANGED_CONNECTING",m[m.CONNECTION_CHANGED_JOIN_SUCCESS=1]="CONNECTION_CHANGED_JOIN_SUCCESS",m[m.CONNECTION_CHANGED_INTERRUPTED=2]="CONNECTION_CHANGED_INTERRUPTED",m[m.CONNECTION_CHANGED_BANNED_BY_SERVER=3]="CONNECTION_CHANGED_BANNED_BY_SERVER",m[m.CONNECTION_CHANGED_JOIN_FAILED=4]="CONNECTION_CHANGED_JOIN_FAILED",m[m.CONNECTION_CHANGED_LEAVE_CHANNEL=5]="CONNECTION_CHANGED_LEAVE_CHANNEL",m[m.CONNECTION_CHANGED_INVALID_APP_ID=6]="CONNECTION_CHANGED_INVALID_APP_ID",m[m.CONNECTION_CHANGED_INVALID_CHANNEL_NAME=7]="CONNECTION_CHANGED_INVALID_CHANNEL_NAME",m[m.CONNECTION_CHANGED_INVALID_TOKEN=8]="CONNECTION_CHANGED_INVALID_TOKEN",m[m.CONNECTION_CHANGED_TOKEN_EXPIRED=9]="CONNECTION_CHANGED_TOKEN_EXPIRED",m[m.CONNECTION_CHANGED_REJECTED_BY_SERVER=10]="CONNECTION_CHANGED_REJECTED_BY_SERVER",m[m.CONNECTION_CHANGED_SETTING_PROXY_SERVER=11]="CONNECTION_CHANGED_SETTING_PROXY_SERVER",m[m.CONNECTION_CHANGED_RENEW_TOKEN=12]="CONNECTION_CHANGED_RENEW_TOKEN",m[m.CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED=13]="CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED",m[m.CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT=14]="CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT",m[m.CONNECTION_CHANGED_PROXY_SERVER_INTERRUPTED=15]="CONNECTION_CHANGED_PROXY_SERVER_INTERRUPTED",(T=t.NETWORK_TYPE||(t.NETWORK_TYPE={}))[T.NETWORK_TYPE_UNKNOWN=-1]="NETWORK_TYPE_UNKNOWN",T[T.NETWORK_TYPE_DISCONNECTED=0]="NETWORK_TYPE_DISCONNECTED",T[T.NETWORK_TYPE_LAN=1]="NETWORK_TYPE_LAN",T[T.NETWORK_TYPE_WIFI=2]="NETWORK_TYPE_WIFI",T[T.NETWORK_TYPE_MOBILE_2G=3]="NETWORK_TYPE_MOBILE_2G",T[T.NETWORK_TYPE_MOBILE_3G=4]="NETWORK_TYPE_MOBILE_3G",T[T.NETWORK_TYPE_MOBILE_4G=5]="NETWORK_TYPE_MOBILE_4G",(C=t.UPLOAD_ERROR_REASON||(t.UPLOAD_ERROR_REASON={}))[C.UPLOAD_SUCCESS=0]="UPLOAD_SUCCESS",C[C.UPLOAD_NET_ERROR=1]="UPLOAD_NET_ERROR",C[C.UPLOAD_SERVER_ERROR=2]="UPLOAD_SERVER_ERROR",(R=t.LASTMILE_PROBE_RESULT_STATE||(t.LASTMILE_PROBE_RESULT_STATE={}))[R.LASTMILE_PROBE_RESULT_COMPLETE=1]="LASTMILE_PROBE_RESULT_COMPLETE",R[R.LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE=2]="LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE",R[R.LASTMILE_PROBE_RESULT_UNAVAILABLE=3]="LASTMILE_PROBE_RESULT_UNAVAILABLE",(f=t.AUDIO_ROUTE_TYPE||(t.AUDIO_ROUTE_TYPE={}))[f.AUDIO_ROUTE_DEFAULT=-1]="AUDIO_ROUTE_DEFAULT",f[f.AUDIO_ROUTE_HEADSET=0]="AUDIO_ROUTE_HEADSET",f[f.AUDIO_ROUTE_EARPIECE=1]="AUDIO_ROUTE_EARPIECE",f[f.AUDIO_ROUTE_HEADSET_NO_MIC=2]="AUDIO_ROUTE_HEADSET_NO_MIC",f[f.AUDIO_ROUTE_SPEAKERPHONE=3]="AUDIO_ROUTE_SPEAKERPHONE",f[f.AUDIO_ROUTE_LOUDSPEAKER=4]="AUDIO_ROUTE_LOUDSPEAKER",f[f.AUDIO_ROUTE_BLUETOOTH=5]="AUDIO_ROUTE_BLUETOOTH",f[f.AUDIO_ROUTE_USB=6]="AUDIO_ROUTE_USB",f[f.AUDIO_ROUTE_HDMI=7]="AUDIO_ROUTE_HDMI",f[f.AUDIO_ROUTE_DISPLAYPORT=8]="AUDIO_ROUTE_DISPLAYPORT",f[f.AUDIO_ROUTE_AIRPLAY=9]="AUDIO_ROUTE_AIRPLAY",(g=t.CLOUD_PROXY_TYPE||(t.CLOUD_PROXY_TYPE={}))[g.NONE_PROXY=0]="NONE_PROXY",g[g.UDP_PROXY=1]="UDP_PROXY",g[g.TCP_PROXY=2]="TCP_PROXY",(I=t.AUDIO_SESSION_OPERATION_RESTRICTION||(t.AUDIO_SESSION_OPERATION_RESTRICTION={}))[I.AUDIO_SESSION_OPERATION_RESTRICTION_NONE=0]="AUDIO_SESSION_OPERATION_RESTRICTION_NONE",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY=1]="AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION=2]="AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION=4]="AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_ALL=128]="AUDIO_SESSION_OPERATION_RESTRICTION_ALL",(_=t.CAMERA_DIRECTION||(t.CAMERA_DIRECTION={}))[_.CAMERA_REAR=0]="CAMERA_REAR",_[_.CAMERA_FRONT=1]="CAMERA_FRONT",(p=t.QUALITY_ADAPT_INDICATION||(t.QUALITY_ADAPT_INDICATION={}))[p.ADAPT_NONE=0]="ADAPT_NONE",p[p.ADAPT_UP_BANDWIDTH=1]="ADAPT_UP_BANDWIDTH",p[p.ADAPT_DOWN_BANDWIDTH=2]="ADAPT_DOWN_BANDWIDTH",(h=t.EXPERIENCE_QUALITY_TYPE||(t.EXPERIENCE_QUALITY_TYPE={}))[h.EXPERIENCE_QUALITY_GOOD=0]="EXPERIENCE_QUALITY_GOOD",h[h.EXPERIENCE_QUALITY_BAD=1]="EXPERIENCE_QUALITY_BAD",(l=t.EXPERIENCE_POOR_REASON||(t.EXPERIENCE_POOR_REASON={}))[l.EXPERIENCE_REASON_NONE=0]="EXPERIENCE_REASON_NONE",l[l.REMOTE_NETWORK_QUALITY_POOR=1]="REMOTE_NETWORK_QUALITY_POOR",l[l.LOCAL_NETWORK_QUALITY_POOR=2]="LOCAL_NETWORK_QUALITY_POOR",l[l.WIRELESS_SIGNAL_POOR=4]="WIRELESS_SIGNAL_POOR",l[l.WIFI_BLUETOOTH_COEXIST=8]="WIFI_BLUETOOTH_COEXIST",(E=t.CHANNEL_MEDIA_RELAY_ERROR||(t.CHANNEL_MEDIA_RELAY_ERROR={}))[E.RELAY_OK=0]="RELAY_OK",E[E.RELAY_ERROR_SERVER_ERROR_RESPONSE=1]="RELAY_ERROR_SERVER_ERROR_RESPONSE",E[E.RELAY_ERROR_SERVER_NO_RESPONSE=2]="RELAY_ERROR_SERVER_NO_RESPONSE",E[E.RELAY_ERROR_NO_RESOURCE_AVAILABLE=3]="RELAY_ERROR_NO_RESOURCE_AVAILABLE",E[E.RELAY_ERROR_FAILED_JOIN_SRC=4]="RELAY_ERROR_FAILED_JOIN_SRC",E[E.RELAY_ERROR_FAILED_JOIN_DEST=5]="RELAY_ERROR_FAILED_JOIN_DEST",E[E.RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC=6]="RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC",E[E.RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST=7]="RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST",E[E.RELAY_ERROR_SERVER_CONNECTION_LOST=8]="RELAY_ERROR_SERVER_CONNECTION_LOST",E[E.RELAY_ERROR_INTERNAL_ERROR=9]="RELAY_ERROR_INTERNAL_ERROR",E[E.RELAY_ERROR_SRC_TOKEN_EXPIRED=10]="RELAY_ERROR_SRC_TOKEN_EXPIRED",E[E.RELAY_ERROR_DEST_TOKEN_EXPIRED=11]="RELAY_ERROR_DEST_TOKEN_EXPIRED",(u=t.CHANNEL_MEDIA_RELAY_EVENT||(t.CHANNEL_MEDIA_RELAY_EVENT={}))[u.RELAY_EVENT_NETWORK_DISCONNECTED=0]="RELAY_EVENT_NETWORK_DISCONNECTED",u[u.RELAY_EVENT_NETWORK_CONNECTED=1]="RELAY_EVENT_NETWORK_CONNECTED",u[u.RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL=2]="RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL",u[u.RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL=3]="RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL",u[u.RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL=4]="RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL",u[u.RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC=5]="RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC",u[u.RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC=6]="RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL=7]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED=8]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE=9]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL=10]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL",u[u.RELAY_EVENT_VIDEO_PROFILE_UPDATE=11]="RELAY_EVENT_VIDEO_PROFILE_UPDATE",(d=t.CHANNEL_MEDIA_RELAY_STATE||(t.CHANNEL_MEDIA_RELAY_STATE={}))[d.RELAY_STATE_IDLE=0]="RELAY_STATE_IDLE",d[d.RELAY_STATE_CONNECTING=1]="RELAY_STATE_CONNECTING",d[d.RELAY_STATE_RUNNING=2]="RELAY_STATE_RUNNING",d[d.RELAY_STATE_FAILURE=3]="RELAY_STATE_FAILURE",t.STANDARD_BITRATE=0,t.COMPATIBLE_BITRATE=-1,t.DEFAULT_MIN_BITRATE=-1,t.LBHQ="lbhq",t.VEO="veo",(A=t.RTMP_STREAM_LIFE_CYCLE_TYPE||(t.RTMP_STREAM_LIFE_CYCLE_TYPE={}))[A.RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL=1]="RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL",A[A.RTMP_STREAM_LIFE_CYCLE_BIND2OWNER=2]="RTMP_STREAM_LIFE_CYCLE_BIND2OWNER",(c=t.VideoContentHint||(t.VideoContentHint={}))[c.CONTENT_HINT_NONE=0]="CONTENT_HINT_NONE",c[c.CONTENT_HINT_MOTION=1]="CONTENT_HINT_MOTION",c[c.CONTENT_HINT_DETAILS=2]="CONTENT_HINT_DETAILS",(a=t.LIGHTENING_CONTRAST_LEVEL||(t.LIGHTENING_CONTRAST_LEVEL={}))[a.LIGHTENING_CONTRAST_LOW=0]="LIGHTENING_CONTRAST_LOW",a[a.LIGHTENING_CONTRAST_NORMAL=1]="LIGHTENING_CONTRAST_NORMAL",a[a.LIGHTENING_CONTRAST_HIGH=2]="LIGHTENING_CONTRAST_HIGH",(s=t.AREA_CODE||(t.AREA_CODE={}))[s.AREA_CODE_CN=1]="AREA_CODE_CN",s[s.AREA_CODE_NA=2]="AREA_CODE_NA",s[s.AREA_CODE_EU=4]="AREA_CODE_EU",s[s.AREA_CODE_AS=8]="AREA_CODE_AS",s[s.AREA_CODE_JP=16]="AREA_CODE_JP",s[s.AREA_CODE_IN=32]="AREA_CODE_IN",s[s.AREA_CODE_GLOB=4294967295]="AREA_CODE_GLOB",(o=t.ENCRYPTION_CONFIG||(t.ENCRYPTION_CONFIG={}))[o.ENCRYPTION_FORCE_SETTING=1]="ENCRYPTION_FORCE_SETTING",o[o.ENCRYPTION_FORCE_DISABLE_PACKET=2]="ENCRYPTION_FORCE_DISABLE_PACKET",(r=t.VIDEO_CAPTURE_TYPE||(t.VIDEO_CAPTURE_TYPE={}))[r.VIDEO_CAPTURE_UNKNOWN=0]="VIDEO_CAPTURE_UNKNOWN",r[r.VIDEO_CAPTURE_CAMERA=1]="VIDEO_CAPTURE_CAMERA",r[r.VIDEO_CAPTURE_SCREEN=2]="VIDEO_CAPTURE_SCREEN",(n=t.METADATA_TYPE||(t.METADATA_TYPE={}))[n.UNKNOWN_METADATA=-1]="UNKNOWN_METADATA",n[n.VIDEO_METADATA=0]="VIDEO_METADATA",(i=t.ENCRYPTION_MODE||(t.ENCRYPTION_MODE={}))[i.AES_128_XTS=1]="AES_128_XTS",i[i.AES_128_ECB=2]="AES_128_ECB",i[i.AES_256_XTS=3]="AES_256_XTS",i[i.SM4_128_ECB=4]="SM4_128_ECB",i[i.AES_128_GCM=5]="AES_128_GCM",i[i.AES_256_GCM=6]="AES_256_GCM",i[i.MODE_END=7]="MODE_END"},593:function(e,t,i){"use strict";var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelMediaRelayEventToNative=t.ChannelMediaRelayErrorToNative=t.ChannelMediaRelayStateToNative=t.InjectStreamEventStatusToNative=t.RtmpStreamingErrorToNative=t.NetworkQualityToNative=t.UserLeftReasonToNative=t.ConnectionDisconnectedReasonToNative=t.ConnectionStateToNative=t.printf=void 0;var r=i(424),o=i(910);t.printf=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.log.apply(console,n(["agora-iris",e],t,!1))},t.ConnectionStateToNative=function(e){switch(e){case"DISCONNECTED":case"DISCONNECTING":default:return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_DISCONNECTED;case"CONNECTING":return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_CONNECTING;case"RECONNECTING":return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_RECONNECTING;case"CONNECTED":return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_CONNECTED}},t.ConnectionDisconnectedReasonToNative=function(e){switch(e){case r.ConnectionDisconnectedReason.LEAVE:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_LEAVE_CHANNEL;case r.ConnectionDisconnectedReason.NETWORK_ERROR:case r.ConnectionDisconnectedReason.SERVER_ERROR:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_INTERRUPTED;case r.ConnectionDisconnectedReason.UID_BANNED:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_REJECTED_BY_SERVER;case r.ConnectionDisconnectedReason.IP_BANNED:case r.ConnectionDisconnectedReason.CHANNEL_BANNED:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_BANNED_BY_SERVER;default:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_JOIN_SUCCESS}},t.UserLeftReasonToNative=function(e){switch(e){case"Quit":default:return o.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_QUIT;case"ServerTimeOut":return o.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_DROPPED;case"BecomeAudience":return o.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_BECOME_AUDIENCE}},t.NetworkQualityToNative=function(e){switch(e){case 0:return o.QUALITY_TYPE.QUALITY_UNKNOWN;case 1:return o.QUALITY_TYPE.QUALITY_EXCELLENT;case 2:return o.QUALITY_TYPE.QUALITY_GOOD;case 3:return o.QUALITY_TYPE.QUALITY_POOR;case 4:return o.QUALITY_TYPE.QUALITY_BAD;case 5:return o.QUALITY_TYPE.QUALITY_VBAD;case 6:return o.QUALITY_TYPE.QUALITY_DOWN}},t.RtmpStreamingErrorToNative=function(e){switch(e){case"LIVE_STREAMING_INVALID_ARGUMENT":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT;case"LIVE_STREAMING_INTERNAL_SERVER_ERROR":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR;case"LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED;case"LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED;case"LIVE_STREAMING_CDN_ERROR":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR;case"LIVE_STREAMING_INVALID_RAW_STREAM":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT;case"LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT;case"LIVE_STREAMING_WARN_FREQUENT_REQUEST":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN;default:return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_OK}},t.InjectStreamEventStatusToNative=function(e){switch(e){case 0:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_SUCCESS;case 1:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_ALREADY_EXISTS;case 2:default:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_UNAUTHORIZED;case 3:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_TIMEDOUT;case 4:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_FAILED;case 5:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_SUCCESS;case 6:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_NOT_FOUND;case 7:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED;case 8:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_TIMEDOUT;case 9:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_FAILED;case 10:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_BROKEN}},t.ChannelMediaRelayStateToNative=function(e){switch(e){case r.ChannelMediaRelayState.RELAY_STATE_IDLE:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_IDLE;case r.ChannelMediaRelayState.RELAY_STATE_CONNECTING:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_CONNECTING;case r.ChannelMediaRelayState.RELAY_STATE_RUNNING:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_RUNNING;case r.ChannelMediaRelayState.RELAY_STATE_FAILURE:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_FAILURE}},t.ChannelMediaRelayErrorToNative=function(e){switch(e){case r.ChannelMediaRelayError.RELAY_OK:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_OK;case r.ChannelMediaRelayError.SERVER_CONNECTION_LOST:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_ERROR_SERVER_CONNECTION_LOST;case r.ChannelMediaRelayError.SRC_TOKEN_EXPIRED:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_ERROR_SRC_TOKEN_EXPIRED;case r.ChannelMediaRelayError.DEST_TOKEN_EXPIRED:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_ERROR_DEST_TOKEN_EXPIRED}},t.ChannelMediaRelayEventToNative=function(e){switch(e){case r.ChannelMediaRelayEvent.NETWORK_DISCONNECTED:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_NETWORK_DISCONNECTED;case r.ChannelMediaRelayEvent.NETWORK_CONNECTED:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_NETWORK_CONNECTED;case r.ChannelMediaRelayEvent.PACKET_JOINED_SRC_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_JOINED_DEST_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_SENT_TO_DEST_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_RECEIVED_VIDEO_FROM_SRC:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC;case r.ChannelMediaRelayEvent.PACKET_RECEIVED_AUDIO_FROM_SRC:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC;case r.ChannelMediaRelayEvent.PACKET_UPDATE_DEST_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_UPDATE_DEST_CHANNEL_REFUSED:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED;case r.ChannelMediaRelayEvent.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE}}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var n=i(986);IrisRtcEngine=n.default})();
\ No newline at end of file
+var IrisRtcEngine;(()=>{var e={424:function(e,t,i){e.exports=function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")(),r={},o=function(e){try{return!!e()}catch(e){return!0}},s=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=a,A=Function.prototype.call,d=c?A.bind(A):function(){return A.apply(A,arguments)},u={},E={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,h=l&&!E.call({1:2},1);u.f=h?function(e){var t=l(this,e);return!!t&&t.enumerable}:E;var p,_,I=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=a,f=Function.prototype,R=f.bind,C=f.call,T=g&&R.bind(C,C),m=g?function(e){return e&&T(e)}:function(e){return e&&function(){return C.apply(e,arguments)}},S=m,O=S({}.toString),v=S("".slice),N=function(e){return v(O(e),8,-1)},y=m,D=o,w=N,b=n.Object,L=y("".split),P=D((function(){return!b("z").propertyIsEnumerable(0)}))?function(e){return"String"==w(e)?L(e,""):b(e)}:b,k=n.TypeError,M=function(e){if(null==e)throw k("Can't call method on "+e);return e},U=P,B=M,V=function(e){return U(B(e))},Q=function(e){return"function"==typeof e},x=Q,F=function(e){return"object"==typeof e?null!==e:x(e)},G=n,j=Q,Y=function(e){return j(e)?e:void 0},H=function(e,t){return arguments.length<2?Y(G[e]):G[e]&&G[e][t]},K=m({}.isPrototypeOf),W=H("navigator","userAgent")||"",J=n,q=W,X=J.process,z=J.Deno,Z=X&&X.versions||z&&z.version,$=Z&&Z.v8;$&&(_=(p=$.split("."))[0]>0&&p[0]<4?1:+(p[0]+p[1])),!_&&q&&(!(p=q.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=q.match(/Chrome\/(\d+)/))&&(_=+p[1]);var ee=_,te=ee,ie=o,ne=!!Object.getOwnPropertySymbols&&!ie((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&te&&te<41})),re=ne&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,oe=H,se=Q,ae=K,ce=re,Ae=n.Object,de=ce?function(e){return"symbol"==typeof e}:function(e){var t=oe("Symbol");return se(t)&&ae(t.prototype,Ae(e))},ue=n.String,Ee=function(e){try{return ue(e)}catch(e){return"Object"}},le=Q,he=Ee,pe=n.TypeError,_e=function(e){if(le(e))return e;throw pe(he(e)+" is not a function")},Ie=_e,ge=function(e,t){var i=e[t];return null==i?void 0:Ie(i)},fe=d,Re=Q,Ce=F,Te=n.TypeError,me={exports:{}},Se=n,Oe=Object.defineProperty,ve=function(e,t){try{Oe(Se,e,{value:t,configurable:!0,writable:!0})}catch(i){Se[e]=t}return t},Ne=ve,ye="__core-js_shared__",De=n[ye]||Ne(ye,{}),we=De;(me.exports=function(e,t){return we[e]||(we[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var be=M,Le=n.Object,Pe=function(e){return Le(be(e))},ke=Pe,Me=m({}.hasOwnProperty),Ue=Object.hasOwn||function(e,t){return Me(ke(e),t)},Be=m,Ve=0,Qe=Math.random(),xe=Be(1..toString),Fe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+xe(++Ve+Qe,36)},Ge=n,je=me.exports,Ye=Ue,He=Fe,Ke=ne,We=re,Je=je("wks"),qe=Ge.Symbol,Xe=qe&&qe.for,ze=We?qe:qe&&qe.withoutSetter||He,Ze=function(e){if(!Ye(Je,e)||!Ke&&"string"!=typeof Je[e]){var t="Symbol."+e;Ke&&Ye(qe,e)?Je[e]=qe[e]:Je[e]=We&&Xe?Xe(t):ze(t)}return Je[e]},$e=d,et=F,tt=de,it=ge,nt=Ze,rt=n.TypeError,ot=nt("toPrimitive"),st=function(e,t){if(!et(e)||tt(e))return e;var i,n=it(e,ot);if(n){if(void 0===t&&(t="default"),i=$e(n,e,t),!et(i)||tt(i))return i;throw rt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var i,n;if("string"===t&&Re(i=e.toString)&&!Ce(n=fe(i,e)))return n;if(Re(i=e.valueOf)&&!Ce(n=fe(i,e)))return n;if("string"!==t&&Re(i=e.toString)&&!Ce(n=fe(i,e)))return n;throw Te("Can't convert object to primitive value")}(e,t)},at=de,ct=function(e){var t=st(e,"string");return at(t)?t:t+""},At=F,dt=n.document,ut=At(dt)&&At(dt.createElement),Et=function(e){return ut?dt.createElement(e):{}},lt=Et,ht=!s&&!o((function(){return 7!=Object.defineProperty(lt("div"),"a",{get:function(){return 7}}).a})),pt=s,_t=d,It=u,gt=I,ft=V,Rt=ct,Ct=Ue,Tt=ht,mt=Object.getOwnPropertyDescriptor;r.f=pt?mt:function(e,t){if(e=ft(e),t=Rt(t),Tt)try{return mt(e,t)}catch(e){}if(Ct(e,t))return gt(!_t(It.f,e,t),e[t])};var St={},Ot=s&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),vt=n,Nt=F,yt=vt.String,Dt=vt.TypeError,wt=function(e){if(Nt(e))return e;throw Dt(yt(e)+" is not an object")},bt=s,Lt=ht,Pt=Ot,kt=wt,Mt=ct,Ut=n.TypeError,Bt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor;St.f=bt?Pt?function(e,t,i){if(kt(e),t=Mt(t),kt(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=Vt(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return Bt(e,t,i)}:Bt:function(e,t,i){if(kt(e),t=Mt(t),kt(i),Lt)try{return Bt(e,t,i)}catch(e){}if("get"in i||"set"in i)throw Ut("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var Qt=St,xt=I,Ft=s?function(e,t,i){return Qt.f(e,t,xt(1,i))}:function(e,t,i){return e[t]=i,e},Gt={exports:{}},jt=Q,Yt=De,Ht=m(Function.toString);jt(Yt.inspectSource)||(Yt.inspectSource=function(e){return Ht(e)});var Kt,Wt,Jt,qt=Yt.inspectSource,Xt=Q,zt=qt,Zt=n.WeakMap,$t=Xt(Zt)&&/native code/.test(zt(Zt)),ei=me.exports,ti=Fe,ii=ei("keys"),ni=function(e){return ii[e]||(ii[e]=ti(e))},ri={},oi=$t,si=n,ai=m,ci=F,Ai=Ft,di=Ue,ui=De,Ei=ni,li=ri,hi="Object already initialized",pi=si.TypeError,_i=si.WeakMap;if(oi||ui.state){var Ii=ui.state||(ui.state=new _i),gi=ai(Ii.get),fi=ai(Ii.has),Ri=ai(Ii.set);Kt=function(e,t){if(fi(Ii,e))throw new pi(hi);return t.facade=e,Ri(Ii,e,t),t},Wt=function(e){return gi(Ii,e)||{}},Jt=function(e){return fi(Ii,e)}}else{var Ci=Ei("state");li[Ci]=!0,Kt=function(e,t){if(di(e,Ci))throw new pi(hi);return t.facade=e,Ai(e,Ci,t),t},Wt=function(e){return di(e,Ci)?e[Ci]:{}},Jt=function(e){return di(e,Ci)}}var Ti={set:Kt,get:Wt,has:Jt,enforce:function(e){return Jt(e)?Wt(e):Kt(e,{})},getterFor:function(e){return function(t){var i;if(!ci(t)||(i=Wt(t)).type!==e)throw pi("Incompatible receiver, "+e+" required");return i}}},mi=s,Si=Ue,Oi=Function.prototype,vi=mi&&Object.getOwnPropertyDescriptor,Ni=Si(Oi,"name"),yi={EXISTS:Ni,PROPER:Ni&&"something"===function(){}.name,CONFIGURABLE:Ni&&(!mi||mi&&vi(Oi,"name").configurable)},Di=n,wi=Q,bi=Ue,Li=Ft,Pi=ve,ki=qt,Mi=yi.CONFIGURABLE,Ui=Ti.get,Bi=Ti.enforce,Vi=String(String).split("String");(Gt.exports=function(e,t,i,n){var r,o=!!n&&!!n.unsafe,s=!!n&&!!n.enumerable,a=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:t;wi(i)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!bi(i,"name")||Mi&&i.name!==c)&&Li(i,"name",c),(r=Bi(i)).source||(r.source=Vi.join("string"==typeof c?c:""))),e!==Di?(o?!a&&e[t]&&(s=!0):delete e[t],s?e[t]=i:Li(e,t,i)):s?e[t]=i:Pi(t,i)})(Function.prototype,"toString",(function(){return wi(this)&&Ui(this).source||ki(this)}));var Qi={},xi=Math.ceil,Fi=Math.floor,Gi=function(e){var t=+e;return t!=t||0===t?0:(t>0?Fi:xi)(t)},ji=Gi,Yi=Math.max,Hi=Math.min,Ki=function(e,t){var i=ji(e);return i<0?Yi(i+t,0):Hi(i,t)},Wi=Gi,Ji=Math.min,qi=function(e){return e>0?Ji(Wi(e),9007199254740991):0},Xi=qi,zi=function(e){return Xi(e.length)},Zi=V,$i=Ki,en=zi,tn=function(e){return function(t,i,n){var r,o=Zi(t),s=en(o),a=$i(n,s);if(e&&i!=i){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===i)return e||a||0;return!e&&-1}},nn={includes:tn(!0),indexOf:tn(!1)},rn=Ue,on=V,sn=nn.indexOf,an=ri,cn=m([].push),An=function(e,t){var i,n=on(e),r=0,o=[];for(i in n)!rn(an,i)&&rn(n,i)&&cn(o,i);for(;t.length>r;)rn(n,i=t[r++])&&(~sn(o,i)||cn(o,i));return o},dn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],un=An,En=dn.concat("length","prototype");Qi.f=Object.getOwnPropertyNames||function(e){return un(e,En)};var ln={};ln.f=Object.getOwnPropertySymbols;var hn=H,pn=Qi,_n=ln,In=wt,gn=m([].concat),fn=hn("Reflect","ownKeys")||function(e){var t=pn.f(In(e)),i=_n.f;return i?gn(t,i(e)):t},Rn=Ue,Cn=fn,Tn=r,mn=St,Sn=function(e,t,i){for(var n=Cn(t),r=mn.f,o=Tn.f,s=0;s<n.length;s++){var a=n[s];Rn(e,a)||i&&Rn(i,a)||r(e,a,o(t,a))}},On=o,vn=Q,Nn=/#|\.prototype\./,yn=function(e,t){var i=wn[Dn(e)];return i==Ln||i!=bn&&(vn(t)?On(t):!!t)},Dn=yn.normalize=function(e){return String(e).replace(Nn,".").toLowerCase()},wn=yn.data={},bn=yn.NATIVE="N",Ln=yn.POLYFILL="P",Pn=yn,kn=n,Mn=r.f,Un=Ft,Bn=Gt.exports,Vn=ve,Qn=Sn,xn=Pn,Fn=function(e,t){var i,n,r,o,s,a=e.target,c=e.global,A=e.stat;if(i=c?kn:A?kn[a]||Vn(a,{}):(kn[a]||{}).prototype)for(n in t){if(o=t[n],r=e.noTargetGet?(s=Mn(i,n))&&s.value:i[n],!xn(c?n:a+(A?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;Qn(o,r)}(e.sham||r&&r.sham)&&Un(o,"sham",!0),Bn(i,n,o,e)}},Gn=n.Promise,jn=Gt.exports,Yn=function(e,t,i){for(var n in t)jn(e,n,t[n],i);return e},Hn=n,Kn=Q,Wn=Hn.String,Jn=Hn.TypeError,qn=m,Xn=wt,zn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=qn(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return Xn(i),function(e){if("object"==typeof e||Kn(e))return e;throw Jn("Can't set "+Wn(e)+" as a prototype")}(n),t?e(i,n):i.__proto__=n,i}}():void 0),Zn=St.f,$n=Ue,er=Ze("toStringTag"),tr=function(e,t,i){e&&!i&&(e=e.prototype),e&&!$n(e,er)&&Zn(e,er,{configurable:!0,value:t})},ir=H,nr=St,rr=s,or=Ze("species"),sr=function(e){var t=ir(e),i=nr.f;rr&&t&&!t[or]&&i(t,or,{configurable:!0,get:function(){return this}})},ar=K,cr=n.TypeError,Ar=function(e,t){if(ar(t,e))return e;throw cr("Incorrect invocation")},dr=_e,ur=a,Er=m(m.bind),lr=function(e,t){return dr(e),void 0===t?e:ur?Er(e,t):function(){return e.apply(t,arguments)}},hr={},pr=hr,_r=Ze("iterator"),Ir=Array.prototype,gr=function(e){return void 0!==e&&(pr.Array===e||Ir[_r]===e)},fr={};fr[Ze("toStringTag")]="z";var Rr=n,Cr="[object z]"===String(fr),Tr=Q,mr=N,Sr=Ze("toStringTag"),Or=Rr.Object,vr="Arguments"==mr(function(){return arguments}()),Nr=Cr?mr:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Or(e),Sr))?i:vr?mr(t):"Object"==(n=mr(t))&&Tr(t.callee)?"Arguments":n},yr=Nr,Dr=ge,wr=hr,br=Ze("iterator"),Lr=function(e){if(null!=e)return Dr(e,br)||Dr(e,"@@iterator")||wr[yr(e)]},Pr=d,kr=_e,Mr=wt,Ur=Ee,Br=Lr,Vr=n.TypeError,Qr=function(e,t){var i=arguments.length<2?Br(e):t;if(kr(i))return Mr(Pr(i,e));throw Vr(Ur(e)+" is not iterable")},xr=d,Fr=wt,Gr=ge,jr=lr,Yr=d,Hr=wt,Kr=Ee,Wr=gr,Jr=zi,qr=K,Xr=Qr,zr=Lr,Zr=function(e,t,i){var n,r;Fr(e);try{if(!(n=Gr(e,"return"))){if("throw"===t)throw i;return i}n=xr(n,e)}catch(e){r=!0,n=e}if("throw"===t)throw i;if(r)throw n;return Fr(n),i},$r=n.TypeError,eo=function(e,t){this.stopped=e,this.result=t},to=eo.prototype,io=Ze("iterator"),no=!1;try{var ro=0,oo={next:function(){return{done:!!ro++}},return:function(){no=!0}};oo[io]=function(){return this},Array.from(oo,(function(){throw 2}))}catch(e){}var so=function(e,t){if(!t&&!no)return!1;var i=!1;try{var n={};n[io]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(e){}return i},ao=m,co=o,Ao=Q,uo=Nr,Eo=qt,lo=function(){},ho=[],po=H("Reflect","construct"),_o=/^\s*(?:class|function)\b/,Io=ao(_o.exec),go=!_o.exec(lo),fo=function(e){if(!Ao(e))return!1;try{return po(lo,ho,e),!0}catch(e){return!1}},Ro=function(e){if(!Ao(e))return!1;switch(uo(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return go||!!Io(_o,Eo(e))}catch(e){return!0}};Ro.sham=!0;var Co,To,mo,So,Oo=!po||co((function(){var e;return fo(fo.call)||!fo(Object)||!fo((function(){e=!0}))||e}))?Ro:fo,vo=Oo,No=Ee,yo=n.TypeError,Do=function(e){if(vo(e))return e;throw yo(No(e)+" is not a constructor")},wo=wt,bo=Do,Lo=Ze("species"),Po=function(e,t){var i,n=wo(e).constructor;return void 0===n||null==(i=wo(n)[Lo])?t:bo(i)},ko=a,Mo=Function.prototype,Uo=Mo.apply,Bo=Mo.call,Vo="object"==typeof Reflect&&Reflect.apply||(ko?Bo.bind(Uo):function(){return Bo.apply(Uo,arguments)}),Qo=H("document","documentElement"),xo=m([].slice),Fo=/(?:ipad|iphone|ipod).*applewebkit/i.test(W),Go="process"==N(n.process),jo=n,Yo=Vo,Ho=lr,Ko=Q,Wo=Ue,Jo=o,qo=Qo,Xo=xo,zo=Et,Zo=Fo,$o=Go,es=jo.setImmediate,ts=jo.clearImmediate,is=jo.process,ns=jo.Dispatch,rs=jo.Function,os=jo.MessageChannel,ss=jo.String,as=0,cs={};try{Co=jo.location}catch(e){}var As=function(e){if(Wo(cs,e)){var t=cs[e];delete cs[e],t()}},ds=function(e){return function(){As(e)}},us=function(e){As(e.data)},Es=function(e){jo.postMessage(ss(e),Co.protocol+"//"+Co.host)};es&&ts||(es=function(e){var t=Xo(arguments,1);return cs[++as]=function(){Yo(Ko(e)?e:rs(e),void 0,t)},To(as),as},ts=function(e){delete cs[e]},$o?To=function(e){is.nextTick(ds(e))}:ns&&ns.now?To=function(e){ns.now(ds(e))}:os&&!Zo?(So=(mo=new os).port2,mo.port1.onmessage=us,To=Ho(So.postMessage,So)):jo.addEventListener&&Ko(jo.postMessage)&&!jo.importScripts&&Co&&"file:"!==Co.protocol&&!Jo(Es)?(To=Es,jo.addEventListener("message",us,!1)):To="onreadystatechange"in zo("script")?function(e){qo.appendChild(zo("script")).onreadystatechange=function(){qo.removeChild(this),As(e)}}:function(e){setTimeout(ds(e),0)});var ls,hs,ps,_s,Is,gs,fs,Rs,Cs={set:es,clear:ts},Ts=n,ms=/ipad|iphone|ipod/i.test(W)&&void 0!==Ts.Pebble,Ss=/web0s(?!.*chrome)/i.test(W),Os=n,vs=lr,Ns=r.f,ys=Cs.set,Ds=Fo,ws=ms,bs=Ss,Ls=Go,Ps=Os.MutationObserver||Os.WebKitMutationObserver,ks=Os.document,Ms=Os.process,Us=Os.Promise,Bs=Ns(Os,"queueMicrotask"),Vs=Bs&&Bs.value;Vs||(ls=function(){var e,t;for(Ls&&(e=Ms.domain)&&e.exit();hs;){t=hs.fn,hs=hs.next;try{t()}catch(e){throw hs?_s():ps=void 0,e}}ps=void 0,e&&e.enter()},Ds||Ls||bs||!Ps||!ks?!ws&&Us&&Us.resolve?((fs=Us.resolve(void 0)).constructor=Us,Rs=vs(fs.then,fs),_s=function(){Rs(ls)}):Ls?_s=function(){Ms.nextTick(ls)}:(ys=vs(ys,Os),_s=function(){ys(ls)}):(Is=!0,gs=ks.createTextNode(""),new Ps(ls).observe(gs,{characterData:!0}),_s=function(){gs.data=Is=!Is}));var Qs=Vs||function(e){var t={fn:e,next:void 0};ps&&(ps.next=t),hs||(hs=t,_s()),ps=t},xs={},Fs=_e,Gs=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=Fs(t),this.reject=Fs(i)};xs.f=function(e){return new Gs(e)};var js=wt,Ys=F,Hs=xs,Ks=function(e,t){if(js(e),Ys(t)&&t.constructor===e)return t;var i=Hs.f(e);return(0,i.resolve)(t),i.promise},Ws=n,Js=function(){this.head=null,this.tail=null};Js.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var qs,Xs,zs,Zs,$s=Js,ea="object"==typeof window,ta=Fn,ia=n,na=H,ra=d,oa=Gn,sa=Gt.exports,aa=Yn,ca=zn,Aa=tr,da=sr,ua=_e,Ea=Q,la=F,ha=Ar,pa=qt,_a=function(e,t,i){var n,r,o,s,a,c,A,d=i&&i.that,u=!(!i||!i.AS_ENTRIES),E=!(!i||!i.IS_ITERATOR),l=!(!i||!i.INTERRUPTED),h=jr(t,d),p=function(e){return n&&Zr(n,"normal",e),new eo(!0,e)},_=function(e){return u?(Hr(e),l?h(e[0],e[1],p):h(e[0],e[1])):l?h(e,p):h(e)};if(E)n=e;else{if(!(r=zr(e)))throw $r(Kr(e)+" is not iterable");if(Wr(r)){for(o=0,s=Jr(e);s>o;o++)if((a=_(e[o]))&&qr(to,a))return a;return new eo(!1)}n=Xr(e,r)}for(c=n.next;!(A=Yr(c,n)).done;){try{a=_(A.value)}catch(e){Zr(n,"throw",e)}if("object"==typeof a&&a&&qr(to,a))return a}return new eo(!1)},Ia=so,ga=Po,fa=Cs.set,Ra=Qs,Ca=Ks,Ta=xs,ma=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Sa=$s,Oa=Ti,va=Pn,Na=ea,ya=Go,Da=ee,wa=Ze("species"),ba="Promise",La=Oa.getterFor(ba),Pa=Oa.set,ka=Oa.getterFor(ba),Ma=oa&&oa.prototype,Ua=oa,Ba=Ma,Va=ia.TypeError,Qa=ia.document,xa=ia.process,Fa=Ta.f,Ga=Fa,ja=!!(Qa&&Qa.createEvent&&ia.dispatchEvent),Ya=Ea(ia.PromiseRejectionEvent),Ha="unhandledrejection",Ka=!1,Wa=va(ba,(function(){var e=pa(Ua),t=e!==String(Ua);if(!t&&66===Da)return!0;if(Da>=51&&/native code/.test(e))return!1;var i=new Ua((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(i.constructor={})[wa]=n,!(Ka=i.then((function(){}))instanceof n)||!t&&Na&&!Ya})),Ja=Wa||!Ia((function(e){Ua.all(e).catch((function(){}))})),qa=function(e){var t;return!(!la(e)||!Ea(t=e.then))&&t},Xa=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,A=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&tc(t),t.rejection=1),!0===a?i=o:(d&&d.enter(),i=a(o),d&&(d.exit(),r=!0)),i===e.promise?A(Va("Promise-chain cycle")):(n=qa(i))?ra(n,i,c,A):c(i)):A(o)}catch(e){d&&!r&&d.exit(),A(e)}},za=function(e,t){e.notified||(e.notified=!0,Ra((function(){for(var i,n=e.reactions;i=n.get();)Xa(i,e);e.notified=!1,t&&!e.rejection&&$a(e)})))},Za=function(e,t,i){var n,r;ja?((n=Qa.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),ia.dispatchEvent(n)):n={promise:t,reason:i},!Ya&&(r=ia["on"+e])?r(n):e===Ha&&function(e,t){var i=Ws.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}("Unhandled promise rejection",i)},$a=function(e){ra(fa,ia,(function(){var t,i=e.facade,n=e.value;if(ec(e)&&(t=ma((function(){ya?xa.emit("unhandledRejection",n,i):Za(Ha,i,n)})),e.rejection=ya||ec(e)?2:1,t.error))throw t.value}))},ec=function(e){return 1!==e.rejection&&!e.parent},tc=function(e){ra(fa,ia,(function(){var t=e.facade;ya?xa.emit("rejectionHandled",t):Za("rejectionhandled",t,e.value)}))},ic=function(e,t,i){return function(n){e(t,n,i)}},nc=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,za(e,!0))},rc=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw Va("Promise can't be resolved itself");var n=qa(t);n?Ra((function(){var i={done:!1};try{ra(n,t,ic(rc,i,e),ic(nc,i,e))}catch(t){nc(i,t,e)}})):(e.value=t,e.state=1,za(e,!1))}catch(t){nc({done:!1},t,e)}}};if(Wa&&(Ba=(Ua=function(e){ha(this,Ba),ua(e),ra(qs,this);var t=La(this);try{e(ic(rc,t),ic(nc,t))}catch(e){nc(t,e)}}).prototype,(qs=function(e){Pa(this,{type:ba,done:!1,notified:!1,parent:!1,reactions:new Sa,rejection:!1,state:0,value:void 0})}).prototype=aa(Ba,{then:function(e,t){var i=ka(this),n=Fa(ga(this,Ua));return i.parent=!0,n.ok=!Ea(e)||e,n.fail=Ea(t)&&t,n.domain=ya?xa.domain:void 0,0==i.state?i.reactions.add(n):Ra((function(){Xa(n,i)})),n.promise},catch:function(e){return this.then(void 0,e)}}),Xs=function(){var e=new qs,t=La(e);this.promise=e,this.resolve=ic(rc,t),this.reject=ic(nc,t)},Ta.f=Fa=function(e){return e===Ua||e===zs?new Xs(e):Ga(e)},Ea(oa)&&Ma!==Object.prototype)){Zs=Ma.then,Ka||(sa(Ma,"then",(function(e,t){var i=this;return new Ua((function(e,t){ra(Zs,i,e,t)})).then(e,t)}),{unsafe:!0}),sa(Ma,"catch",Ba.catch,{unsafe:!0}));try{delete Ma.constructor}catch(e){}ca&&ca(Ma,Ba)}ta({global:!0,wrap:!0,forced:Wa},{Promise:Ua}),Aa(Ua,ba,!1),da(ba),zs=na(ba),ta({target:ba,stat:!0,forced:Wa},{reject:function(e){var t=Fa(this);return ra(t.reject,void 0,e),t.promise}}),ta({target:ba,stat:!0,forced:Wa},{resolve:function(e){return Ca(this,e)}}),ta({target:ba,stat:!0,forced:Ja},{all:function(e){var t=this,i=Fa(t),n=i.resolve,r=i.reject,o=ma((function(){var i=ua(t.resolve),o=[],s=0,a=1;_a(e,(function(e){var c=s++,A=!1;a++,ra(i,t,e).then((function(e){A||(A=!0,o[c]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise},race:function(e){var t=this,i=Fa(t),n=i.reject,r=ma((function(){var r=ua(t.resolve);_a(e,(function(e){ra(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var oc=Fn,sc=H,ac=Vo,cc=m,Ac=o,dc=n.Array,uc=sc("JSON","stringify"),Ec=cc(/./.exec),lc=cc("".charAt),hc=cc("".charCodeAt),pc=cc("".replace),_c=cc(1..toString),Ic=/[\uD800-\uDFFF]/g,gc=/^[\uD800-\uDBFF]$/,fc=/^[\uDC00-\uDFFF]$/,Rc=function(e,t,i){var n=lc(i,t-1),r=lc(i,t+1);return Ec(gc,e)&&!Ec(fc,r)||Ec(fc,e)&&!Ec(gc,n)?"\\u"+_c(hc(e,0),16):e},Cc=Ac((function(){return'"\\udf06\\ud834"'!==uc("\udf06\ud834")||'"\\udead"'!==uc("\udead")}));uc&&oc({target:"JSON",stat:!0,forced:Cc},{stringify:function(e,t,i){for(var n=0,r=arguments.length,o=dc(r);n<r;n++)o[n]=arguments[n];var s=ac(uc,null,o);return"string"==typeof s?pc(s,Ic,Rc):s}});var Tc=function(e){try{return!!e()}catch(e){return!0}},mc=!Tc((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Sc=mc,Oc=Function.prototype,vc=Oc.bind,Nc=Oc.call,yc=Sc&&vc.bind(Nc,Nc),Dc=Sc?function(e){return e&&yc(e)}:function(e){return e&&function(){return Nc.apply(e,arguments)}},wc=Dc({}.isPrototypeOf),bc=function(e){return e&&e.Math==Math&&e},Lc=bc("object"==typeof globalThis&&globalThis)||bc("object"==typeof window&&window)||bc("object"==typeof self&&self)||bc("object"==typeof e&&e)||function(){return this}()||Function("return this")(),Pc=mc,kc=Function.prototype,Mc=kc.apply,Uc=kc.call,Bc="object"==typeof Reflect&&Reflect.apply||(Pc?Uc.bind(Mc):function(){return Uc.apply(Mc,arguments)}),Vc=function(e){return"function"==typeof e},Qc={},xc=!Tc((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Fc=mc,Gc=Function.prototype.call,jc=Fc?Gc.bind(Gc):function(){return Gc.apply(Gc,arguments)},Yc={},Hc={}.propertyIsEnumerable,Kc=Object.getOwnPropertyDescriptor,Wc=Kc&&!Hc.call({1:2},1);Yc.f=Wc?function(e){var t=Kc(this,e);return!!t&&t.enumerable}:Hc;var Jc,qc,Xc=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},zc=Dc,Zc=zc({}.toString),$c=zc("".slice),eA=function(e){return $c(Zc(e),8,-1)},tA=Dc,iA=Tc,nA=eA,rA=Lc.Object,oA=tA("".split),sA=iA((function(){return!rA("z").propertyIsEnumerable(0)}))?function(e){return"String"==nA(e)?oA(e,""):rA(e)}:rA,aA=Lc.TypeError,cA=function(e){if(null==e)throw aA("Can't call method on "+e);return e},AA=sA,dA=cA,uA=function(e){return AA(dA(e))},EA=Vc,lA=function(e){return"object"==typeof e?null!==e:EA(e)},hA={},pA=hA,_A=Lc,IA=Vc,gA=function(e){return IA(e)?e:void 0},fA=function(e,t){return arguments.length<2?gA(pA[e])||gA(_A[e]):pA[e]&&pA[e][t]||_A[e]&&_A[e][t]},RA=fA("navigator","userAgent")||"",CA=Lc,TA=RA,mA=CA.process,SA=CA.Deno,OA=mA&&mA.versions||SA&&SA.version,vA=OA&&OA.v8;vA&&(qc=(Jc=vA.split("."))[0]>0&&Jc[0]<4?1:+(Jc[0]+Jc[1])),!qc&&TA&&(!(Jc=TA.match(/Edge\/(\d+)/))||Jc[1]>=74)&&(Jc=TA.match(/Chrome\/(\d+)/))&&(qc=+Jc[1]);var NA=qc,yA=NA,DA=Tc,wA=!!Object.getOwnPropertySymbols&&!DA((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&yA&&yA<41})),bA=wA&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,LA=fA,PA=Vc,kA=wc,MA=bA,UA=Lc.Object,BA=MA?function(e){return"symbol"==typeof e}:function(e){var t=LA("Symbol");return PA(t)&&kA(t.prototype,UA(e))},VA=Lc.String,QA=function(e){try{return VA(e)}catch(e){return"Object"}},xA=Vc,FA=QA,GA=Lc.TypeError,jA=function(e){if(xA(e))return e;throw GA(FA(e)+" is not a function")},YA=jA,HA=function(e,t){var i=e[t];return null==i?void 0:YA(i)},KA=jc,WA=Vc,JA=lA,qA=Lc.TypeError,XA={exports:{}},zA=Lc,ZA=Object.defineProperty,$A="__core-js_shared__",ed=Lc[$A]||function(e,t){try{ZA(zA,e,{value:t,configurable:!0,writable:!0})}catch(i){zA[e]=t}return t}($A,{}),td=ed;(XA.exports=function(e,t){return td[e]||(td[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var id=cA,nd=Lc.Object,rd=function(e){return nd(id(e))},od=rd,sd=Dc({}.hasOwnProperty),ad=Object.hasOwn||function(e,t){return sd(od(e),t)},cd=Dc,Ad=0,dd=Math.random(),ud=cd(1..toString),Ed=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ud(++Ad+dd,36)},ld=Lc,hd=XA.exports,pd=ad,_d=Ed,Id=wA,gd=bA,fd=hd("wks"),Rd=ld.Symbol,Cd=Rd&&Rd.for,Td=gd?Rd:Rd&&Rd.withoutSetter||_d,md=function(e){if(!pd(fd,e)||!Id&&"string"!=typeof fd[e]){var t="Symbol."+e;Id&&pd(Rd,e)?fd[e]=Rd[e]:fd[e]=gd&&Cd?Cd(t):Td(t)}return fd[e]},Sd=jc,Od=lA,vd=BA,Nd=HA,yd=md,Dd=Lc.TypeError,wd=yd("toPrimitive"),bd=function(e,t){if(!Od(e)||vd(e))return e;var i,n=Nd(e,wd);if(n){if(void 0===t&&(t="default"),i=Sd(n,e,t),!Od(i)||vd(i))return i;throw Dd("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var i,n;if("string"===t&&WA(i=e.toString)&&!JA(n=KA(i,e)))return n;if(WA(i=e.valueOf)&&!JA(n=KA(i,e)))return n;if("string"!==t&&WA(i=e.toString)&&!JA(n=KA(i,e)))return n;throw qA("Can't convert object to primitive value")}(e,t)},Ld=BA,Pd=function(e){var t=bd(e,"string");return Ld(t)?t:t+""},kd=lA,Md=Lc.document,Ud=kd(Md)&&kd(Md.createElement),Bd=function(e){return Ud?Md.createElement(e):{}},Vd=Bd,Qd=!xc&&!Tc((function(){return 7!=Object.defineProperty(Vd("div"),"a",{get:function(){return 7}}).a})),xd=xc,Fd=jc,Gd=Yc,jd=Xc,Yd=uA,Hd=Pd,Kd=ad,Wd=Qd,Jd=Object.getOwnPropertyDescriptor;Qc.f=xd?Jd:function(e,t){if(e=Yd(e),t=Hd(t),Wd)try{return Jd(e,t)}catch(e){}if(Kd(e,t))return jd(!Fd(Gd.f,e,t),e[t])};var qd=Tc,Xd=Vc,zd=/#|\.prototype\./,Zd=function(e,t){var i=eu[$d(e)];return i==iu||i!=tu&&(Xd(t)?qd(t):!!t)},$d=Zd.normalize=function(e){return String(e).replace(zd,".").toLowerCase()},eu=Zd.data={},tu=Zd.NATIVE="N",iu=Zd.POLYFILL="P",nu=Zd,ru=jA,ou=mc,su=Dc(Dc.bind),au=function(e,t){return ru(e),void 0===t?e:ou?su(e,t):function(){return e.apply(t,arguments)}},cu={},Au=xc&&Tc((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),du=Lc,uu=lA,Eu=du.String,lu=du.TypeError,hu=function(e){if(uu(e))return e;throw lu(Eu(e)+" is not an object")},pu=xc,_u=Qd,Iu=Au,gu=hu,fu=Pd,Ru=Lc.TypeError,Cu=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor;cu.f=pu?Iu?function(e,t,i){if(gu(e),t=fu(t),gu(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=Tu(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return Cu(e,t,i)}:Cu:function(e,t,i){if(gu(e),t=fu(t),gu(i),_u)try{return Cu(e,t,i)}catch(e){}if("get"in i||"set"in i)throw Ru("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var mu=cu,Su=Xc,Ou=xc?function(e,t,i){return mu.f(e,t,Su(1,i))}:function(e,t,i){return e[t]=i,e},vu=Lc,Nu=Bc,yu=Dc,Du=Vc,wu=Qc.f,bu=nu,Lu=hA,Pu=au,ku=Ou,Mu=ad,Uu=function(e){var t=function(i,n,r){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(i);case 2:return new e(i,n)}return new e(i,n,r)}return Nu(e,this,arguments)};return t.prototype=e.prototype,t},Bu=function(e,t){var i,n,r,o,s,a,c,A,d=e.target,u=e.global,E=e.stat,l=e.proto,h=u?vu:E?vu[d]:(vu[d]||{}).prototype,p=u?Lu:Lu[d]||ku(Lu,d,{})[d],_=p.prototype;for(r in t)i=!bu(u?r:d+(E?".":"#")+r,e.forced)&&h&&Mu(h,r),s=p[r],i&&(a=e.noTargetGet?(A=wu(h,r))&&A.value:h[r]),o=i&&a?a:t[r],i&&typeof s==typeof o||(c=e.bind&&i?Pu(o,vu):e.wrap&&i?Uu(o):l&&Du(o)?yu(o):o,(e.sham||o&&o.sham||s&&s.sham)&&ku(c,"sham",!0),ku(p,r,c),l&&(Mu(Lu,n=d+"Prototype")||ku(Lu,n,{}),ku(Lu[n],r,o),e.real&&_&&!_[r]&&ku(_,r,o)))},Vu=Math.ceil,Qu=Math.floor,xu=function(e){var t=+e;return t!=t||0===t?0:(t>0?Qu:Vu)(t)},Fu=xu,Gu=Math.min,ju=function(e){return function(e){return e>0?Gu(Fu(e),9007199254740991):0}(e.length)},Yu=jA,Hu=rd,Ku=sA,Wu=ju,Ju=Lc.TypeError,qu=function(e){return function(t,i,n,r){Yu(i);var o=Hu(t),s=Ku(o),a=Wu(o),c=e?a-1:0,A=e?-1:1;if(n<2)for(;;){if(c in s){r=s[c],c+=A;break}if(c+=A,e?c<0:a<=c)throw Ju("Reduce of empty array with no initial value")}for(;e?c>=0:a>c;c+=A)c in s&&(r=i(r,s[c],c,o));return r}},Xu={left:qu(!1),right:qu(!0)},zu=Tc,Zu=function(e,t){var i=[][e];return!!i&&zu((function(){i.call(null,t||function(){throw 1},1)}))},$u="process"==eA(Lc.process),eE=Xu.left,tE=NA,iE=$u;Bu({target:"Array",proto:!0,forced:!Zu("reduce")||!iE&&tE>79&&tE<83},{reduce:function(e){var t=arguments.length;return eE(this,e,t,t>1?arguments[1]:void 0)}});var nE=hA,rE=function(e){return nE[e+"Prototype"]},oE=rE("Array").reduce,sE=wc,aE=oE,cE=Array.prototype,AE=function(e){var t=e.reduce;return e===cE||sE(cE,e)&&t===cE.reduce?aE:t},dE=AE,uE=Nr,EE=n.String,lE=function(e){if("Symbol"===uE(e))throw TypeError("Cannot convert a Symbol value to a string");return EE(e)},hE=wt,pE=function(){var e=hE(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},_E=o,IE=n.RegExp,gE=_E((function(){var e=IE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),fE=gE||_E((function(){return!IE("a","y").sticky})),RE={BROKEN_CARET:gE||_E((function(){var e=IE("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:fE,UNSUPPORTED_Y:gE},CE={},TE=An,mE=dn,SE=Object.keys||function(e){return TE(e,mE)},OE=s,vE=Ot,NE=St,yE=wt,DE=V,wE=SE;CE.f=OE&&!vE?Object.defineProperties:function(e,t){yE(e);for(var i,n=DE(t),r=wE(t),o=r.length,s=0;o>s;)NE.f(e,i=r[s++],n[i]);return e};var bE,LE=wt,PE=CE,kE=dn,ME=ri,UE=Qo,BE=Et,VE=ni("IE_PROTO"),QE=function(){},xE=function(e){return"<script>"+e+"<\/script>"},FE=function(e){e.write(xE("")),e.close();var t=e.parentWindow.Object;return e=null,t},GE=function(){try{bE=new ActiveXObject("htmlfile")}catch(e){}var e,t;GE="undefined"!=typeof document?document.domain&&bE?FE(bE):((t=BE("iframe")).style.display="none",UE.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(xE("document.F=Object")),e.close(),e.F):FE(bE);for(var i=kE.length;i--;)delete GE.prototype[kE[i]];return GE()};ME[VE]=!0;var jE=Object.create||function(e,t){var i;return null!==e?(QE.prototype=LE(e),i=new QE,QE.prototype=null,i[VE]=e):i=GE(),void 0===t?i:PE.f(i,t)},YE=o,HE=n.RegExp,KE=YE((function(){var e=HE(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),WE=o,JE=n.RegExp,qE=WE((function(){var e=JE("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),XE=d,zE=m,ZE=lE,$E=pE,el=RE,tl=me.exports,il=jE,nl=Ti.get,rl=KE,ol=qE,sl=tl("native-string-replace",String.prototype.replace),al=RegExp.prototype.exec,cl=al,Al=zE("".charAt),dl=zE("".indexOf),ul=zE("".replace),El=zE("".slice),ll=function(){var e=/a/,t=/b*/g;return XE(al,e,"a"),XE(al,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),hl=el.BROKEN_CARET,pl=void 0!==/()??/.exec("")[1];(ll||pl||hl||rl||ol)&&(cl=function(e){var t,i,n,r,o,s,a,c=this,A=nl(c),d=ZE(e),u=A.raw;if(u)return u.lastIndex=c.lastIndex,t=XE(cl,u,d),c.lastIndex=u.lastIndex,t;var E=A.groups,l=hl&&c.sticky,h=XE($E,c),p=c.source,_=0,I=d;if(l&&(h=ul(h,"y",""),-1===dl(h,"g")&&(h+="g"),I=El(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Al(d,c.lastIndex-1))&&(p="(?: "+p+")",I=" "+I,_++),i=new RegExp("^(?:"+p+")",h)),pl&&(i=new RegExp("^"+p+"$(?!\\s)",h)),ll&&(n=c.lastIndex),r=XE(al,l?i:c,I),l?r?(r.input=El(r.input,_),r[0]=El(r[0],_),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:ll&&r&&(c.lastIndex=c.global?r.index+r[0].length:n),pl&&r&&r.length>1&&XE(sl,r[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&E)for(r.groups=s=il(null),o=0;o<E.length;o++)s[(a=E[o])[0]]=r[a[1]];return r});var _l=cl;Fn({target:"RegExp",proto:!0,forced:/./.exec!==_l},{exec:_l});var Il=jE,gl=St,fl=Ze("unscopables"),Rl=Array.prototype;null==Rl[fl]&&gl.f(Rl,fl,{configurable:!0,value:Il(null)});var Cl,Tl,ml,Sl=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ol=n,vl=Ue,Nl=Q,yl=Pe,Dl=Sl,wl=ni("IE_PROTO"),bl=Ol.Object,Ll=bl.prototype,Pl=Dl?bl.getPrototypeOf:function(e){var t=yl(e);if(vl(t,wl))return t[wl];var i=t.constructor;return Nl(i)&&t instanceof i?i.prototype:t instanceof bl?Ll:null},kl=o,Ml=Q,Ul=Pl,Bl=Gt.exports,Vl=Ze("iterator"),Ql=!1;[].keys&&("next"in(ml=[].keys())?(Tl=Ul(Ul(ml)))!==Object.prototype&&(Cl=Tl):Ql=!0),(null==Cl||kl((function(){var e={};return Cl[Vl].call(e)!==e})))&&(Cl={}),Ml(Cl[Vl])||Bl(Cl,Vl,(function(){return this}));var xl={IteratorPrototype:Cl,BUGGY_SAFARI_ITERATORS:Ql},Fl=xl.IteratorPrototype,Gl=jE,jl=I,Yl=tr,Hl=hr,Kl=function(){return this},Wl=Fn,Jl=d,ql=yi,Xl=Q,zl=Pl,Zl=zn,$l=tr,eh=Ft,th=Gt.exports,ih=hr,nh=ql.PROPER,rh=ql.CONFIGURABLE,oh=xl.IteratorPrototype,sh=xl.BUGGY_SAFARI_ITERATORS,ah=Ze("iterator"),ch="keys",Ah="values",dh="entries",uh=function(){return this},Eh=V,lh=function(e){Rl[fl][e]=!0},hh=hr,ph=Ti,_h=St.f,Ih=s,gh="Array Iterator",fh=ph.set,Rh=ph.getterFor(gh),Ch=function(e,t,i,n,r,o,s){!function(e,t,i,n){var r=t+" Iterator";e.prototype=Gl(Fl,{next:jl(+!n,i)}),Yl(e,r,!1),Hl[r]=Kl}(i,t,n);var a,c,A,d=function(e){if(e===r&&p)return p;if(!sh&&e in l)return l[e];switch(e){case ch:case Ah:case dh:return function(){return new i(this,e)}}return function(){return new i(this)}},u=t+" Iterator",E=!1,l=e.prototype,h=l[ah]||l["@@iterator"]||r&&l[r],p=!sh&&h||d(r),_="Array"==t&&l.entries||h;if(_&&(a=zl(_.call(new e)))!==Object.prototype&&a.next&&(zl(a)!==oh&&(Zl?Zl(a,oh):Xl(a[ah])||th(a,ah,uh)),$l(a,u,!0)),nh&&r==Ah&&h&&h.name!==Ah&&(rh?eh(l,"name",Ah):(E=!0,p=function(){return Jl(h,this)})),r)if(c={values:d(Ah),keys:o?p:d(ch),entries:d(dh)},s)for(A in c)(sh||E||!(A in l))&&th(l,A,c[A]);else Wl({target:t,proto:!0,forced:sh||E},c);return l[ah]!==p&&th(l,ah,p,{name:r}),ih[t]=p,c}(Array,"Array",(function(e,t){fh(this,{type:gh,target:Eh(e),index:0,kind:t})}),(function(){var e=Rh(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Th=hh.Arguments=hh.Array;if(lh("keys"),lh("values"),lh("entries"),Ih&&"values"!==Th.name)try{_h(Th,"name",{value:"values"})}catch(e){}var mh=Et("span").classList,Sh=mh&&mh.constructor&&mh.constructor.prototype,Oh=Sh===Object.prototype?void 0:Sh,vh=n,Nh={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},yh=Oh,Dh=Ch,wh=Ft,bh=Ze,Lh=bh("iterator"),Ph=bh("toStringTag"),kh=Dh.values,Mh=function(e,t){if(e){if(e[Lh]!==kh)try{wh(e,Lh,kh)}catch(t){e[Lh]=kh}if(e[Ph]||wh(e,Ph,t),Nh[t])for(var i in Dh)if(e[i]!==Dh[i])try{wh(e,i,Dh[i])}catch(t){e[i]=Dh[i]}}};for(var Uh in Nh)Mh(vh[Uh]&&vh[Uh].prototype,Uh);Mh(yh,"DOMTokenList");var Bh=Q,Vh=F,Qh=zn,xh=function(e,t,i){var n,r;return Qh&&Bh(n=t.constructor)&&n!==i&&Vh(r=n.prototype)&&r!==i.prototype&&Qh(e,r),e},Fh=lE,Gh=function(e,t){return void 0===e?arguments.length<2?"":t:Fh(e)},jh=F,Yh=Ft,Hh=m("".replace),Kh=String(Error("zxcasd").stack),Wh=/\n\s*at [^:]*:[^\n]*/,Jh=Wh.test(Kh),qh=function(e,t){if(Jh&&"string"==typeof e)for(;t--;)e=Hh(e,Wh,"");return e},Xh=I,zh=!o((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Xh(1,7)),7!==e.stack)})),Zh=H,$h=Ue,ep=Ft,tp=K,ip=zn,np=Sn,rp=xh,op=Gh,sp=function(e,t){jh(t)&&"cause"in t&&Yh(e,"cause",t.cause)},ap=qh,cp=zh,Ap=Fn,dp=Vo,up=function(e,t,i,n){var r=n?2:1,o=e.split("."),s=o[o.length-1],a=Zh.apply(null,o);if(a){var c=a.prototype;if($h(c,"cause")&&delete c.cause,!i)return a;var A=Zh("Error"),d=t((function(e,t){var i=op(n?t:e,void 0),o=n?new a(e):new a;return void 0!==i&&ep(o,"message",i),cp&&ep(o,"stack",ap(o.stack,2)),this&&tp(c,this)&&rp(o,this,d),arguments.length>r&&sp(o,arguments[r]),o}));d.prototype=c,"Error"!==s&&(ip?ip(d,A):np(d,A,{name:!0})),np(d,a);try{c.name!==s&&ep(c,"name",s),c.constructor=d}catch(e){}return d}},Ep=n.WebAssembly,lp=7!==Error("e",{cause:7}).cause,hp=function(e,t){var i={};i[e]=up(e,t,lp),Ap({global:!0,forced:lp},i)},pp=function(e,t){if(Ep&&Ep[e]){var i={};i[e]=up("WebAssembly."+e,t,lp),Ap({target:"WebAssembly",stat:!0,forced:lp},i)}};hp("Error",(function(e){return function(t){return dp(e,this,arguments)}})),hp("EvalError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("RangeError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("ReferenceError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("SyntaxError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("TypeError",(function(e){return function(t){return dp(e,this,arguments)}})),hp("URIError",(function(e){return function(t){return dp(e,this,arguments)}})),pp("CompileError",(function(e){return function(t){return dp(e,this,arguments)}})),pp("LinkError",(function(e){return function(t){return dp(e,this,arguments)}})),pp("RuntimeError",(function(e){return function(t){return dp(e,this,arguments)}}));let _p=!0,Ip=!0;function gp(e,t,i){const n=e.match(t);return n&&n.length>=i&&parseInt(n[i],10)}function fp(e,t,i){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,r=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return r.apply(this,arguments);const o=e=>{const t=i(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),r.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,i){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(i))return o.apply(this,arguments);const n=this._eventMap[t].get(i);return this._eventMap[t].delete(i),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Rp(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(_p=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Cp(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ip=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Tp(){if("object"==typeof window){if(_p)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function mp(e,t){Ip&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Sp(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:i}=e;if(i.mozGetUserMedia)t.browser="firefox",t.version=gp(i.userAgent,/Firefox\/(\d+)\./,1);else if(i.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=gp(i.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.mediaDevices&&i.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=gp(i.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!i.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=gp(i.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}function Op(e){return"[object Object]"===Object.prototype.toString.call(e)}function vp(e){var t;return Op(e)?dE(t=Object.keys(e)).call(t,(function(t,i){const n=Op(e[i]),r=n?vp(e[i]):e[i],o=n&&!Object.keys(r).length;return void 0===r||o?t:Object.assign(t,{[i]:r})}),{}):e}function Np(e,t,i){const n=i?"outbound-rtp":"inbound-rtp",r=new Map;if(null===t)return r;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((i=>{i.type===n&&i.trackId===t.id&&function e(t,i,n){i&&!n.has(i.id)&&(n.set(i.id,i),Object.keys(i).forEach((r=>{r.endsWith("Id")?e(t,t.get(i[r]),n):r.endsWith("Ids")&&i[r].forEach((i=>{e(t,t.get(i),n)}))})))}(e,i,r)}))})),r}var yp=XA.exports,Dp=Ed,wp=yp("keys"),bp=function(e){return wp[e]||(wp[e]=Dp(e))},Lp=!Tc((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Pp=Lc,kp=ad,Mp=Vc,Up=rd,Bp=Lp,Vp=bp("IE_PROTO"),Qp=Pp.Object,xp=Qp.prototype,Fp=Bp?Qp.getPrototypeOf:function(e){var t=Up(e);if(kp(t,Vp))return t[Vp];var i=t.constructor;return Mp(i)&&t instanceof i?i.prototype:t instanceof Qp?xp:null},Gp=Lc,jp=Vc,Yp=Gp.String,Hp=Gp.TypeError,Kp=Dc,Wp=hu,Jp=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Kp(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return Wp(i),function(e){if("object"==typeof e||jp(e))return e;throw Hp("Can't set "+Yp(e)+" as a prototype")}(n),t?e(i,n):i.__proto__=n,i}}():void 0),qp={},Xp=xu,zp=Math.max,Zp=Math.min,$p=function(e,t){var i=Xp(e);return i<0?zp(i+t,0):Zp(i,t)},e_=uA,t_=$p,i_=ju,n_=function(e){return function(t,i,n){var r,o=e_(t),s=i_(o),a=t_(n,s);if(e&&i!=i){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===i)return e||a||0;return!e&&-1}},r_={includes:n_(!0),indexOf:n_(!1)},o_={},s_=ad,a_=uA,c_=r_.indexOf,A_=o_,d_=Dc([].push),u_=function(e,t){var i,n=a_(e),r=0,o=[];for(i in n)!s_(A_,i)&&s_(n,i)&&d_(o,i);for(;t.length>r;)s_(n,i=t[r++])&&(~c_(o,i)||d_(o,i));return o},E_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],l_=u_,h_=E_.concat("length","prototype");qp.f=Object.getOwnPropertyNames||function(e){return l_(e,h_)};var p_={};p_.f=Object.getOwnPropertySymbols;var __=fA,I_=qp,g_=p_,f_=hu,R_=Dc([].concat),C_=__("Reflect","ownKeys")||function(e){var t=I_.f(f_(e)),i=g_.f;return i?R_(t,i(e)):t},T_=ad,m_=C_,S_=Qc,O_=cu,v_={},N_=u_,y_=E_,D_=Object.keys||function(e){return N_(e,y_)},w_=xc,b_=Au,L_=cu,P_=hu,k_=uA,M_=D_;v_.f=w_&&!b_?Object.defineProperties:function(e,t){P_(e);for(var i,n=k_(t),r=M_(t),o=r.length,s=0;o>s;)L_.f(e,i=r[s++],n[i]);return e};var U_,B_=fA("document","documentElement"),V_=hu,Q_=v_,x_=E_,F_=o_,G_=B_,j_=Bd,Y_=bp("IE_PROTO"),H_=function(){},K_=function(e){return"<script>"+e+"<\/script>"},W_=function(e){e.write(K_("")),e.close();var t=e.parentWindow.Object;return e=null,t},J_=function(){try{U_=new ActiveXObject("htmlfile")}catch(e){}var e,t;J_="undefined"!=typeof document?document.domain&&U_?W_(U_):((t=j_("iframe")).style.display="none",G_.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(K_("document.F=Object")),e.close(),e.F):W_(U_);for(var i=x_.length;i--;)delete J_.prototype[x_[i]];return J_()};F_[Y_]=!0;var q_=Object.create||function(e,t){var i;return null!==e?(H_.prototype=V_(e),i=new H_,H_.prototype=null,i[Y_]=e):i=J_(),void 0===t?i:Q_.f(i,t)},X_=Dc("".replace),z_=String(Error("zxcasd").stack),Z_=/\n\s*at [^:]*:[^\n]*/,$_=Z_.test(z_),eI=lA,tI=Ou,iI={},nI=iI,rI=md("iterator"),oI=Array.prototype,sI=function(e){return void 0!==e&&(nI.Array===e||oI[rI]===e)},aI={};aI[md("toStringTag")]="z";var cI="[object z]"===String(aI),AI=Lc,dI=cI,uI=Vc,EI=eA,lI=md("toStringTag"),hI=AI.Object,pI="Arguments"==EI(function(){return arguments}()),_I=dI?EI:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=hI(e),lI))?i:pI?EI(t):"Object"==(n=EI(t))&&uI(t.callee)?"Arguments":n},II=_I,gI=HA,fI=iI,RI=md("iterator"),CI=function(e){if(null!=e)return gI(e,RI)||gI(e,"@@iterator")||fI[II(e)]},TI=jc,mI=jA,SI=hu,OI=QA,vI=CI,NI=Lc.TypeError,yI=function(e,t){var i=arguments.length<2?vI(e):t;if(mI(i))return SI(TI(i,e));throw NI(OI(e)+" is not iterable")},DI=jc,wI=hu,bI=HA,LI=function(e,t,i){var n,r;wI(e);try{if(!(n=bI(e,"return"))){if("throw"===t)throw i;return i}n=DI(n,e)}catch(e){r=!0,n=e}if("throw"===t)throw i;if(r)throw n;return wI(n),i},PI=au,kI=jc,MI=hu,UI=QA,BI=sI,VI=ju,QI=wc,xI=yI,FI=CI,GI=LI,jI=Lc.TypeError,YI=function(e,t){this.stopped=e,this.result=t},HI=YI.prototype,KI=function(e,t,i){var n,r,o,s,a,c,A,d=i&&i.that,u=!(!i||!i.AS_ENTRIES),E=!(!i||!i.IS_ITERATOR),l=!(!i||!i.INTERRUPTED),h=PI(t,d),p=function(e){return n&&GI(n,"normal",e),new YI(!0,e)},_=function(e){return u?(MI(e),l?h(e[0],e[1],p):h(e[0],e[1])):l?h(e,p):h(e)};if(E)n=e;else{if(!(r=FI(e)))throw jI(UI(e)+" is not iterable");if(BI(r)){for(o=0,s=VI(e);s>o;o++)if((a=_(e[o]))&&QI(HI,a))return a;return new YI(!1)}n=xI(e,r)}for(c=n.next;!(A=kI(c,n)).done;){try{a=_(A.value)}catch(e){GI(n,"throw",e)}if("object"==typeof a&&a&&QI(HI,a))return a}return new YI(!1)},WI=_I,JI=Lc.String,qI=function(e){if("Symbol"===WI(e))throw TypeError("Cannot convert a Symbol value to a string");return JI(e)},XI=qI,zI=Xc,ZI=!Tc((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",zI(1,7)),7!==e.stack)})),$I=Bu,eg=Lc,tg=wc,ig=Fp,ng=Jp,rg=q_,og=Ou,sg=Xc,ag=function(e,t){if($_&&"string"==typeof e)for(;t--;)e=X_(e,Z_,"");return e},cg=function(e,t){eI(t)&&"cause"in t&&tI(e,"cause",t.cause)},Ag=KI,dg=function(e,t){return void 0===e?arguments.length<2?"":t:XI(e)},ug=ZI,Eg=md("toStringTag"),lg=eg.Error,hg=[].push,pg=function(e,t){var i,n=arguments.length>2?arguments[2]:void 0,r=tg(_g,this);ng?i=ng(new lg,r?ig(this):_g):(i=r?this:rg(_g),og(i,Eg,"Error")),void 0!==t&&og(i,"message",dg(t)),ug&&og(i,"stack",ag(i.stack,1)),cg(i,n);var o=[];return Ag(e,hg,{that:o}),og(i,"errors",o),i};ng?ng(pg,lg):function(e,t,i){for(var n=m_(t),r=O_.f,o=S_.f,s=0;s<n.length;s++){var a=n[s];T_(e,a)||i&&T_(i,a)||r(e,a,o(t,a))}}(pg,lg,{name:!0});var _g=pg.prototype=rg(lg.prototype,{constructor:sg(1,pg),message:sg(1,""),name:sg(1,"AggregateError")});$I({global:!0},{AggregateError:pg});var Ig=Vc,gg=ed,fg=Dc(Function.toString);Ig(gg.inspectSource)||(gg.inspectSource=function(e){return fg(e)});var Rg,Cg,Tg,mg=gg.inspectSource,Sg=Vc,Og=mg,vg=Lc.WeakMap,Ng=Sg(vg)&&/native code/.test(Og(vg)),yg=Lc,Dg=Dc,wg=lA,bg=Ou,Lg=ad,Pg=ed,kg=bp,Mg=o_,Ug="Object already initialized",Bg=yg.TypeError,Vg=yg.WeakMap;if(Ng||Pg.state){var Qg=Pg.state||(Pg.state=new Vg),xg=Dg(Qg.get),Fg=Dg(Qg.has),Gg=Dg(Qg.set);Rg=function(e,t){if(Fg(Qg,e))throw new Bg(Ug);return t.facade=e,Gg(Qg,e,t),t},Cg=function(e){return xg(Qg,e)||{}},Tg=function(e){return Fg(Qg,e)}}else{var jg=kg("state");Mg[jg]=!0,Rg=function(e,t){if(Lg(e,jg))throw new Bg(Ug);return t.facade=e,bg(e,jg,t),t},Cg=function(e){return Lg(e,jg)?e[jg]:{}},Tg=function(e){return Lg(e,jg)}}var Yg,Hg,Kg,Wg={set:Rg,get:Cg,has:Tg,enforce:function(e){return Tg(e)?Cg(e):Rg(e,{})},getterFor:function(e){return function(t){var i;if(!wg(t)||(i=Cg(t)).type!==e)throw Bg("Incompatible receiver, "+e+" required");return i}}},Jg=xc,qg=ad,Xg=Function.prototype,zg=Jg&&Object.getOwnPropertyDescriptor,Zg=qg(Xg,"name"),$g={EXISTS:Zg,PROPER:Zg&&"something"===function(){}.name,CONFIGURABLE:Zg&&(!Jg||Jg&&zg(Xg,"name").configurable)},ef=Ou,tf=function(e,t,i,n){n&&n.enumerable?e[t]=i:ef(e,t,i)},nf=Tc,rf=Vc,of=q_,sf=Fp,af=tf,cf=md("iterator"),Af=!1;[].keys&&("next"in(Kg=[].keys())?(Hg=sf(sf(Kg)))!==Object.prototype&&(Yg=Hg):Af=!0);var df=null==Yg||nf((function(){var e={};return Yg[cf].call(e)!==e}));rf((Yg=df?{}:of(Yg))[cf])||af(Yg,cf,(function(){return this}));var uf={IteratorPrototype:Yg,BUGGY_SAFARI_ITERATORS:Af},Ef=_I,lf=cI?{}.toString:function(){return"[object "+Ef(this)+"]"},hf=cI,pf=cu.f,_f=Ou,If=ad,gf=lf,ff=md("toStringTag"),Rf=function(e,t,i,n){if(e){var r=i?e:e.prototype;If(r,ff)||pf(r,ff,{configurable:!0,value:t}),n&&!hf&&_f(r,"toString",gf)}},Cf=uf.IteratorPrototype,Tf=q_,mf=Xc,Sf=Rf,Of=iI,vf=function(){return this},Nf=function(e,t,i,n){var r=t+" Iterator";return e.prototype=Tf(Cf,{next:mf(+!n,i)}),Sf(e,r,!1,!0),Of[r]=vf,e},yf=Bu,Df=jc,wf=Nf,bf=Fp,Lf=Rf,Pf=tf,kf=iI,Mf=$g.PROPER,Uf=uf.BUGGY_SAFARI_ITERATORS,Bf=md("iterator"),Vf="keys",Qf="values",xf="entries",Ff=function(){return this},Gf=function(e,t,i,n,r,o,s){wf(i,t,n);var a,c,A,d=function(e){if(e===r&&p)return p;if(!Uf&&e in l)return l[e];switch(e){case Vf:case Qf:case xf:return function(){return new i(this,e)}}return function(){return new i(this)}},u=t+" Iterator",E=!1,l=e.prototype,h=l[Bf]||l["@@iterator"]||r&&l[r],p=!Uf&&h||d(r),_="Array"==t&&l.entries||h;if(_&&(a=bf(_.call(new e)))!==Object.prototype&&a.next&&(Lf(a,u,!0,!0),kf[u]=Ff),Mf&&r==Qf&&h&&h.name!==Qf&&(E=!0,p=function(){return Df(h,this)}),r)if(c={values:d(Qf),keys:o?p:d(Vf),entries:d(xf)},s)for(A in c)(Uf||E||!(A in l))&&Pf(l,A,c[A]);else yf({target:t,proto:!0,forced:Uf||E},c);return s&&l[Bf]!==p&&Pf(l,Bf,p,{name:r}),kf[t]=p,c},jf=uA,Yf=iI,Hf=Wg;cu.f;var Kf=Gf,Wf="Array Iterator",Jf=Hf.set,qf=Hf.getterFor(Wf);Kf(Array,"Array",(function(e,t){Jf(this,{type:Wf,target:jf(e),index:0,kind:t})}),(function(){var e=qf(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Yf.Arguments=Yf.Array;var Xf=Lc.Promise,zf=tf,Zf=function(e,t,i){for(var n in t)i&&i.unsafe&&e[n]?e[n]=t[n]:zf(e,n,t[n],i);return e},$f=fA,eR=cu,tR=xc,iR=md("species"),nR=wc,rR=Lc.TypeError,oR=function(e,t){if(nR(t,e))return e;throw rR("Incorrect invocation")},sR=md("iterator"),aR=!1;try{var cR=0,AR={next:function(){return{done:!!cR++}},return:function(){aR=!0}};AR[sR]=function(){return this},Array.from(AR,(function(){throw 2}))}catch(e){}var dR=Dc,uR=Tc,ER=Vc,lR=_I,hR=mg,pR=function(){},_R=[],IR=fA("Reflect","construct"),gR=/^\s*(?:class|function)\b/,fR=dR(gR.exec),RR=!gR.exec(pR),CR=function(e){if(!ER(e))return!1;try{return IR(pR,_R,e),!0}catch(e){return!1}},TR=function(e){if(!ER(e))return!1;switch(lR(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return RR||!!fR(gR,hR(e))}catch(e){return!0}};TR.sham=!0;var mR,SR,OR,vR,NR=!IR||uR((function(){var e;return CR(CR.call)||!CR(Object)||!CR((function(){e=!0}))||e}))?TR:CR,yR=NR,DR=QA,wR=Lc.TypeError,bR=hu,LR=md("species"),PR=function(e,t){var i,n=bR(e).constructor;return void 0===n||null==(i=bR(n)[LR])?t:function(e){if(yR(e))return e;throw wR(DR(e)+" is not a constructor")}(i)},kR=Dc([].slice),MR=/(?:ipad|iphone|ipod).*applewebkit/i.test(RA),UR=Lc,BR=Bc,VR=au,QR=Vc,xR=ad,FR=Tc,GR=B_,jR=kR,YR=Bd,HR=MR,KR=$u,WR=UR.setImmediate,JR=UR.clearImmediate,qR=UR.process,XR=UR.Dispatch,zR=UR.Function,ZR=UR.MessageChannel,$R=UR.String,eC=0,tC={};try{mR=UR.location}catch(e){}var iC=function(e){if(xR(tC,e)){var t=tC[e];delete tC[e],t()}},nC=function(e){return function(){iC(e)}},rC=function(e){iC(e.data)},oC=function(e){UR.postMessage($R(e),mR.protocol+"//"+mR.host)};WR&&JR||(WR=function(e){var t=jR(arguments,1);return tC[++eC]=function(){BR(QR(e)?e:zR(e),void 0,t)},SR(eC),eC},JR=function(e){delete tC[e]},KR?SR=function(e){qR.nextTick(nC(e))}:XR&&XR.now?SR=function(e){XR.now(nC(e))}:ZR&&!HR?(vR=(OR=new ZR).port2,OR.port1.onmessage=rC,SR=VR(vR.postMessage,vR)):UR.addEventListener&&QR(UR.postMessage)&&!UR.importScripts&&mR&&"file:"!==mR.protocol&&!FR(oC)?(SR=oC,UR.addEventListener("message",rC,!1)):SR="onreadystatechange"in YR("script")?function(e){GR.appendChild(YR("script")).onreadystatechange=function(){GR.removeChild(this),iC(e)}}:function(e){setTimeout(nC(e),0)});var sC,aC,cC,AC,dC,uC,EC,lC,hC={set:WR,clear:JR},pC=Lc,_C=/ipad|iphone|ipod/i.test(RA)&&void 0!==pC.Pebble,IC=/web0s(?!.*chrome)/i.test(RA),gC=Lc,fC=au,RC=Qc.f,CC=hC.set,TC=MR,mC=_C,SC=IC,OC=$u,vC=gC.MutationObserver||gC.WebKitMutationObserver,NC=gC.document,yC=gC.process,DC=gC.Promise,wC=RC(gC,"queueMicrotask"),bC=wC&&wC.value;bC||(sC=function(){var e,t;for(OC&&(e=yC.domain)&&e.exit();aC;){t=aC.fn,aC=aC.next;try{t()}catch(e){throw aC?AC():cC=void 0,e}}cC=void 0,e&&e.enter()},TC||OC||SC||!vC||!NC?!mC&&DC&&DC.resolve?((EC=DC.resolve(void 0)).constructor=DC,lC=fC(EC.then,EC),AC=function(){lC(sC)}):OC?AC=function(){yC.nextTick(sC)}:(CC=fC(CC,gC),AC=function(){CC(sC)}):(dC=!0,uC=NC.createTextNode(""),new vC(sC).observe(uC,{characterData:!0}),AC=function(){uC.data=dC=!dC}));var LC=bC||function(e){var t={fn:e,next:void 0};cC&&(cC.next=t),aC||(aC=t,AC()),cC=t},PC={},kC=jA,MC=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=kC(t),this.reject=kC(i)};PC.f=function(e){return new MC(e)};var UC=hu,BC=lA,VC=PC,QC=function(e,t){if(UC(e),BC(t)&&t.constructor===e)return t;var i=VC.f(e);return(0,i.resolve)(t),i.promise},xC=Lc,FC=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},GC=function(){this.head=null,this.tail=null};GC.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var jC,YC,HC,KC="object"==typeof window,WC=Bu,JC=Lc,qC=fA,XC=jc,zC=Xf,ZC=Zf,$C=Rf,eT=jA,tT=Vc,iT=lA,nT=oR,rT=mg,oT=KI,sT=PR,aT=hC.set,cT=LC,AT=QC,dT=PC,uT=FC,ET=GC,lT=Wg,hT=nu,pT=KC,_T=$u,IT=NA,gT=md("species"),fT="Promise",RT=lT.getterFor(fT),CT=lT.set,TT=lT.getterFor(fT),mT=zC&&zC.prototype,ST=zC,OT=mT,vT=JC.TypeError,NT=JC.document,yT=JC.process,DT=dT.f,wT=DT,bT=!!(NT&&NT.createEvent&&JC.dispatchEvent),LT=tT(JC.PromiseRejectionEvent),PT="unhandledrejection",kT=hT(fT,(function(){var e=rT(ST),t=e!==String(ST);if(!t&&66===IT)return!0;if(!OT.finally)return!0;if(IT>=51&&/native code/.test(e))return!1;var i=new ST((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(i.constructor={})[gT]=n,!(i.then((function(){}))instanceof n)||!t&&pT&&!LT})),MT=kT||!function(e,t){if(!t&&!aR)return!1;var i=!1;try{var n={};n[sR]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(e){}return i}((function(e){ST.all(e).catch((function(){}))})),UT=function(e){var t;return!(!iT(e)||!tT(t=e.then))&&t},BT=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,A=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&GT(t),t.rejection=1),!0===a?i=o:(d&&d.enter(),i=a(o),d&&(d.exit(),r=!0)),i===e.promise?A(vT("Promise-chain cycle")):(n=UT(i))?XC(n,i,c,A):c(i)):A(o)}catch(e){d&&!r&&d.exit(),A(e)}},VT=function(e,t){e.notified||(e.notified=!0,cT((function(){for(var i,n=e.reactions;i=n.get();)BT(i,e);e.notified=!1,t&&!e.rejection&&xT(e)})))},QT=function(e,t,i){var n,r;bT?((n=NT.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),JC.dispatchEvent(n)):n={promise:t,reason:i},!LT&&(r=JC["on"+e])?r(n):e===PT&&function(e,t){var i=xC.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}("Unhandled promise rejection",i)},xT=function(e){XC(aT,JC,(function(){var t,i=e.facade,n=e.value;if(FT(e)&&(t=uT((function(){_T?yT.emit("unhandledRejection",n,i):QT(PT,i,n)})),e.rejection=_T||FT(e)?2:1,t.error))throw t.value}))},FT=function(e){return 1!==e.rejection&&!e.parent},GT=function(e){XC(aT,JC,(function(){var t=e.facade;_T?yT.emit("rejectionHandled",t):QT("rejectionhandled",t,e.value)}))},jT=function(e,t,i){return function(n){e(t,n,i)}},YT=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,VT(e,!0))},HT=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw vT("Promise can't be resolved itself");var n=UT(t);n?cT((function(){var i={done:!1};try{XC(n,t,jT(HT,i,e),jT(YT,i,e))}catch(t){YT(i,t,e)}})):(e.value=t,e.state=1,VT(e,!1))}catch(t){YT({done:!1},t,e)}}};kT&&(OT=(ST=function(e){nT(this,OT),eT(e),XC(jC,this);var t=RT(this);try{e(jT(HT,t),jT(YT,t))}catch(e){YT(t,e)}}).prototype,(jC=function(e){CT(this,{type:fT,done:!1,notified:!1,parent:!1,reactions:new ET,rejection:!1,state:0,value:void 0})}).prototype=ZC(OT,{then:function(e,t){var i=TT(this),n=DT(sT(this,ST));return i.parent=!0,n.ok=!tT(e)||e,n.fail=tT(t)&&t,n.domain=_T?yT.domain:void 0,0==i.state?i.reactions.add(n):cT((function(){BT(n,i)})),n.promise},catch:function(e){return this.then(void 0,e)}}),YC=function(){var e=new jC,t=RT(e);this.promise=e,this.resolve=jT(HT,t),this.reject=jT(YT,t)},dT.f=DT=function(e){return e===ST||e===HC?new YC(e):wT(e)}),WC({global:!0,wrap:!0,forced:kT},{Promise:ST}),$C(ST,fT,!1,!0),function(e){var t=$f(e),i=eR.f;tR&&t&&!t[iR]&&i(t,iR,{configurable:!0,get:function(){return this}})}(fT),HC=qC(fT),WC({target:fT,stat:!0,forced:kT},{reject:function(e){var t=DT(this);return XC(t.reject,void 0,e),t.promise}}),WC({target:fT,stat:!0,forced:!0},{resolve:function(e){return AT(this===HC?ST:this,e)}}),WC({target:fT,stat:!0,forced:MT},{all:function(e){var t=this,i=DT(t),n=i.resolve,r=i.reject,o=uT((function(){var i=eT(t.resolve),o=[],s=0,a=1;oT(e,(function(e){var c=s++,A=!1;a++,XC(i,t,e).then((function(e){A||(A=!0,o[c]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise},race:function(e){var t=this,i=DT(t),n=i.reject,r=uT((function(){var r=eT(t.resolve);oT(e,(function(e){XC(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var KT=jc,WT=jA,JT=PC,qT=FC,XT=KI;Bu({target:"Promise",stat:!0},{allSettled:function(e){var t=this,i=JT.f(t),n=i.resolve,r=i.reject,o=qT((function(){var i=WT(t.resolve),r=[],o=0,s=1;XT(e,(function(e){var a=o++,c=!1;s++,KT(i,t,e).then((function(e){c||(c=!0,r[a]={status:"fulfilled",value:e},--s||n(r))}),(function(e){c||(c=!0,r[a]={status:"rejected",reason:e},--s||n(r))}))})),--s||n(r)}));return o.error&&r(o.value),i.promise}});var zT=jA,ZT=fA,$T=jc,em=PC,tm=FC,im=KI,nm="No one promise resolved";Bu({target:"Promise",stat:!0},{any:function(e){var t=this,i=ZT("AggregateError"),n=em.f(t),r=n.resolve,o=n.reject,s=tm((function(){var n=zT(t.resolve),s=[],a=0,c=1,A=!1;im(e,(function(e){var d=a++,u=!1;c++,$T(n,t,e).then((function(e){u||A||(A=!0,r(e))}),(function(e){u||A||(u=!0,s[d]=e,--c||o(new i(s,nm)))}))})),--c||o(new i(s,nm))}));return s.error&&o(s.value),n.promise}});var rm=Xf,om=fA,sm=Vc,am=PR,cm=QC;Bu({target:"Promise",proto:!0,real:!0,forced:!!rm&&Tc((function(){rm.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=am(this,om("Promise")),i=sm(e);return this.then(i?function(i){return cm(t,e()).then((function(){return i}))}:e,i?function(i){return cm(t,e()).then((function(){throw i}))}:e)}});var Am=Dc,dm=xu,um=qI,Em=cA,lm=Am("".charAt),hm=Am("".charCodeAt),pm=Am("".slice),_m=function(e){return function(t,i){var n,r,o=um(Em(t)),s=dm(i),a=o.length;return s<0||s>=a?e?"":void 0:(n=hm(o,s))<55296||n>56319||s+1===a||(r=hm(o,s+1))<56320||r>57343?e?lm(o,s):n:e?pm(o,s,s+2):r-56320+(n-55296<<10)+65536}},Im={codeAt:_m(!1),charAt:_m(!0)},gm=Im.charAt,fm=qI,Rm=Wg,Cm=Gf,Tm="String Iterator",mm=Rm.set,Sm=Rm.getterFor(Tm);Cm(String,"String",(function(e){mm(this,{type:Tm,string:fm(e),index:0})}),(function(){var e,t=Sm(this),i=t.string,n=t.index;return n>=i.length?{value:void 0,done:!0}:(e=gm(i,n),t.index+=e.length,{value:e,done:!1})}));var Om=hA.Promise,vm=Lc,Nm=_I,ym=Ou,Dm=iI,wm=md("toStringTag");for(var bm in{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}){var Lm=vm[bm],Pm=Lm&&Lm.prototype;Pm&&Nm(Pm)!==wm&&ym(Pm,wm,bm),Dm[bm]=Dm.Array}var km=Om,Mm=km,Um=Go,Bm=s,Vm=o,Qm=wt,xm=jE,Fm=Gh,Gm=Error.prototype.toString,jm=Vm((function(){if(Bm){var e=xm(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==Gm.call(e))return!0}return"2: 1"!==Gm.call({message:1,name:2})||"Error"!==Gm.call({})}))?function(){var e=Qm(this),t=Fm(e.name,"Error"),i=Fm(e.message);return t?i?t+": "+i:t:i}:Gm,Ym={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},Hm=Fn,Km=H,Wm=o,Jm=jE,qm=I,Xm=St.f,zm=CE.f,Zm=Gt.exports,$m=Ue,eS=Ar,tS=wt,iS=jm,nS=Gh,rS=Ym,oS=qh,sS=Ti,aS=s,cS="DOMException",AS=Km("Error"),dS=Km(cS)||function(){try{(new(Km("MessageChannel")||function(e){try{if(Um)return Function('return require("'+e+'")')()}catch(e){}}("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if("DATA_CLONE_ERR"==e.name&&25==e.code)return e.constructor}}(),uS=dS&&dS.prototype,ES=AS.prototype,lS=sS.set,hS=sS.getterFor(cS),pS="stack"in AS(cS),_S=function(e){return $m(rS,e)&&rS[e].m?rS[e].c:0},IS=function(){eS(this,gS);var e=arguments.length,t=nS(e<1?void 0:arguments[0]),i=nS(e<2?void 0:arguments[1],"Error"),n=_S(i);if(lS(this,{type:cS,name:i,message:t,code:n}),aS||(this.name=i,this.message=t,this.code=n),pS){var r=AS(t);r.name=cS,Xm(this,"stack",qm(1,oS(r.stack,1)))}},gS=IS.prototype=Jm(ES),fS=function(e){return{enumerable:!0,configurable:!0,get:e}},RS=function(e){return fS((function(){return hS(this)[e]}))};aS&&zm(gS,{name:RS("name"),message:RS("message"),code:RS("code")}),Xm(gS,"constructor",qm(1,IS));var CS=Wm((function(){return!(new dS instanceof AS)})),TS=CS||Wm((function(){return ES.toString!==iS||"2: 1"!==String(new dS(1,2))})),mS=CS||Wm((function(){return 25!==new dS(1,"DataCloneError").code}));CS||25!==dS.DATA_CLONE_ERR||uS.DATA_CLONE_ERR,Hm({global:!0,forced:CS},{DOMException:CS?IS:dS});var SS=Km(cS),OS=SS.prototype;for(var vS in TS&&dS===SS&&Zm(OS,"toString",iS),mS&&aS&&dS===SS&&Xm(OS,"code",fS((function(){return _S(tS(this).name)}))),rS)if($m(rS,vS)){var NS=rS[vS],yS=NS.s,DS=qm(6,NS.c);$m(SS,yS)||Xm(SS,yS,DS),$m(OS,yS)||Xm(OS,yS,DS)}var wS=Fn,bS=H,LS=I,PS=St.f,kS=Ue,MS=Ar,US=xh,BS=Gh,VS=Ym,QS=qh,xS="DOMException",FS=bS("Error"),GS=bS(xS),jS=function(){MS(this,YS);var e=arguments.length,t=BS(e<1?void 0:arguments[0]),i=BS(e<2?void 0:arguments[1],"Error"),n=new GS(t,i),r=FS(t);return r.name=xS,PS(n,"stack",LS(1,QS(r.stack,1))),US(n,this,jS),n},YS=jS.prototype=GS.prototype,HS="stack"in FS(xS),KS="stack"in new GS(1,2),WS=HS&&!KS;wS({global:!0,forced:WS},{DOMException:WS?jS:GS});var JS=bS(xS),qS=JS.prototype;if(qS.constructor!==JS)for(var XS in PS(qS,"constructor",LS(1,JS)),VS)if(kS(VS,XS)){var zS=VS[XS],ZS=zS.s;kS(JS,ZS)||PS(JS,ZS,LS(6,zS.c))}var $S="DOMException";tr(H($S),$S);var eO=m,tO=Gt.exports,iO=_l,nO=o,rO=Ze,oO=Ft,sO=rO("species"),aO=RegExp.prototype,cO=m,AO=Gi,dO=lE,uO=M,EO=cO("".charAt),lO=cO("".charCodeAt),hO=cO("".slice),pO=function(e){return function(t,i){var n,r,o=dO(uO(t)),s=AO(i),a=o.length;return s<0||s>=a?e?"":void 0:(n=lO(o,s))<55296||n>56319||s+1===a||(r=lO(o,s+1))<56320||r>57343?e?EO(o,s):n:e?hO(o,s,s+2):r-56320+(n-55296<<10)+65536}},_O=(pO(!1),pO(!0)),IO=m,gO=Pe,fO=Math.floor,RO=IO("".charAt),CO=IO("".replace),TO=IO("".slice),mO=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SO=/\$([$&'`]|\d{1,2})/g,OO=d,vO=wt,NO=Q,yO=N,DO=_l,wO=n.TypeError,bO=Vo,LO=d,PO=m,kO=o,MO=wt,UO=Q,BO=Gi,VO=qi,QO=lE,xO=M,FO=function(e,t,i){return t+(i?_O(e,t).length:1)},GO=ge,jO=function(e,t,i,n,r,o){var s=i+e.length,a=n.length,c=SO;return void 0!==r&&(r=gO(r),c=mO),CO(o,c,(function(o,c){var A;switch(RO(c,0)){case"$":return"$";case"&":return e;case"`":return TO(t,0,i);case"'":return TO(t,s);case"<":A=r[TO(c,1,-1)];break;default:var d=+c;if(0===d)return o;if(d>a){var u=fO(d/10);return 0===u?o:u<=a?void 0===n[u-1]?RO(c,1):n[u-1]+RO(c,1):o}A=n[d-1]}return void 0===A?"":A}))},YO=function(e,t){var i=e.exec;if(NO(i)){var n=OO(i,e,t);return null!==n&&vO(n),n}if("RegExp"===yO(e))return OO(DO,e,t);throw wO("RegExp#exec called on incompatible receiver")},HO=Ze("replace"),KO=Math.max,WO=Math.min,JO=PO([].concat),qO=PO([].push),XO=PO("".indexOf),zO=PO("".slice),ZO="$0"==="a".replace(/./,"$0"),$O=!!/./[HO]&&""===/./[HO]("a","$0");!function(e,t,i,n){var r=rO(e),o=!nO((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!nO((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[sO]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!s||i){var a=eO(/./[r]),c=t(r,""[e],(function(e,t,i,n,r){var s=eO(e),c=t.exec;return c===iO||c===aO.exec?o&&!r?{done:!0,value:a(t,i,n)}:{done:!0,value:s(i,t,n)}:{done:!1}}));tO(String.prototype,e,c[0]),tO(aO,r,c[1])}n&&oO(aO[r],"sham",!0)}("replace",(function(e,t,i){var n=$O?"$":"$0";return[function(e,i){var n=xO(this),r=null==e?void 0:GO(e,HO);return r?LO(r,e,n,i):LO(t,QO(n),e,i)},function(e,r){var o=MO(this),s=QO(e);if("string"==typeof r&&-1===XO(r,n)&&-1===XO(r,"$<")){var a=i(t,o,s,r);if(a.done)return a.value}var c=UO(r);c||(r=QO(r));var A=o.global;if(A){var d=o.unicode;o.lastIndex=0}for(var u=[];;){var E=YO(o,s);if(null===E)break;if(qO(u,E),!A)break;""===QO(E[0])&&(o.lastIndex=FO(s,VO(o.lastIndex),d))}for(var l,h="",p=0,_=0;_<u.length;_++){for(var I=QO((E=u[_])[0]),g=KO(WO(BO(E.index),s.length),0),f=[],R=1;R<E.length;R++)qO(f,void 0===(l=E[R])?l:String(l));var C=E.groups;if(c){var T=JO([I],f,g,s);void 0!==C&&qO(T,C);var m=QO(bO(r,void 0,T))}else m=jO(I,s,g,f,C,r);g>=p&&(h+=zO(s,p,g)+m,p=g+I.length)}return h+zO(s,p)}]}),!!kO((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ZO||$O);var ev=F,tv=N,iv=Ze("match"),nv=s,rv=n,ov=m,sv=Pn,av=xh,cv=Ft,Av=St.f,dv=Qi.f,uv=K,Ev=lE,lv=pE,hv=RE,pv=Gt.exports,_v=o,Iv=Ue,gv=Ti.enforce,fv=sr,Rv=KE,Cv=qE,Tv=Ze("match"),mv=rv.RegExp,Sv=mv.prototype,Ov=rv.SyntaxError,vv=ov(lv),Nv=ov(Sv.exec),yv=ov("".charAt),Dv=ov("".replace),wv=ov("".indexOf),bv=ov("".slice),Lv=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Pv=/a/g,kv=/a/g,Mv=new mv(Pv)!==Pv,Uv=hv.MISSED_STICKY,Bv=hv.UNSUPPORTED_Y;if(sv("RegExp",nv&&(!Mv||Uv||Rv||Cv||_v((function(){return kv[Tv]=!1,mv(Pv)!=Pv||mv(kv)==kv||"/a/i"!=mv(Pv,"i")}))))){for(var Vv=function(e,t){var i,n,r,o,s,a,c=uv(Sv,this),A=function(e){var t;return ev(e)&&(void 0!==(t=e[iv])?!!t:"RegExp"==tv(e))}(e),d=void 0===t,u=[],E=e;if(!c&&A&&d&&e.constructor===Vv)return e;if((A||uv(Sv,e))&&(e=e.source,d&&(t="flags"in E?E.flags:vv(E))),e=void 0===e?"":Ev(e),t=void 0===t?"":Ev(t),E=e,Rv&&"dotAll"in Pv&&(n=!!t&&wv(t,"s")>-1)&&(t=Dv(t,/s/g,"")),i=t,Uv&&"sticky"in Pv&&(r=!!t&&wv(t,"y")>-1)&&Bv&&(t=Dv(t,/y/g,"")),Cv&&(e=(o=function(e){for(var t,i=e.length,n=0,r="",o=[],s={},a=!1,c=!1,A=0,d="";n<=i;n++){if("\\"===(t=yv(e,n)))t+=yv(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:Nv(Lv,bv(e,n+1))&&(n+=2,c=!0),r+=t,A++;continue;case">"===t&&c:if(""===d||Iv(s,d))throw new Ov("Invalid capture group name");s[d]=!0,o[o.length]=[d,A],c=!1,d="";continue}c?d+=t:r+=t}return[r,o]}(e))[0],u=o[1]),s=av(mv(e,t),c?this:Sv,Vv),(n||r||u.length)&&(a=gv(s),n&&(a.dotAll=!0,a.raw=Vv(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=yv(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+yv(e,++n);return r}(e),i)),r&&(a.sticky=!0),u.length&&(a.groups=u)),e!==E)try{cv(s,"source",""===E?"(?:)":E)}catch(e){}return s},Qv=function(e){e in Vv||Av(Vv,e,{configurable:!0,get:function(){return mv[e]},set:function(t){mv[e]=t}})},xv=dv(mv),Fv=0;xv.length>Fv;)Qv(xv[Fv++]);Sv.constructor=Vv,Vv.prototype=Sv,pv(rv,"RegExp",Vv)}fv("RegExp");var Gv=n,jv=s,Yv=KE,Hv=N,Kv=St.f,Wv=Ti.get,Jv=RegExp.prototype,qv=Gv.TypeError;jv&&Yv&&Kv(Jv,"dotAll",{configurable:!0,get:function(){if(this!==Jv){if("RegExp"===Hv(this))return!!Wv(this).dotAll;throw qv("Incompatible receiver, RegExp required")}}});const Xv=Tp;function zv(e,t){const i=e&&e.navigator;if(!i.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((i=>{if("require"===i||"advanced"===i||"mediaSource"===i)return;const n="object"==typeof e[i]?e[i]:{ideal:e[i]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[r("min",i)]=n.ideal,t.optional.push(e),e={},e[r("max",i)]=n.ideal,t.optional.push(e)):(e[r("",i)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",i)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,i)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},r=function(e,r){if(t.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!i.mediaDevices.getSupportedConstraints||!i.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return i.mediaDevices.enumerateDevices().then((i=>{let s=(i=i.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&i.length&&t.includes("back")&&(s=i[i.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),Xv("chrome: "+JSON.stringify(e)),r(e)}))}e.video=n(e.video)}return Xv("chrome: "+JSON.stringify(e)),r(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(i.getUserMedia=function(e,t,n){r(e,(e=>{i.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(i),i.mediaDevices.getUserMedia){const e=i.mediaDevices.getUserMedia.bind(i.mediaDevices);i.mediaDevices.getUserMedia=function(t){return r(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Mm.reject(o(e))))))}}}function Zv(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function $v(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(i=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===i.track.id)):{track:i.track};const r=new Event("track");r.track=i.track,r.receiver=n,r.transceiver={receiver:n},r.streams=[t.stream],this.dispatchEvent(r)})),t.stream.getTracks().forEach((i=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===i.id)):{track:i};const r=new Event("track");r.track=i,r.receiver=n,r.transceiver={receiver:n},r.streams=[t.stream],this.dispatchEvent(r)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else fp(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function eN(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let r=i.apply(this,arguments);return r||(r=t(this,e),this._senders.push(r)),r};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.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 tN(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const r=function(e){const t={};return e.result().forEach((e=>{const i={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{i[t]=e.stat(t)})),t[i.id]=i})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){i(o(r(e)))};return t.apply(this,[n,e])}return new Mm(((e,i)=>{t.apply(this,[function(t){e(o(r(t)))},i])})).then(i,n)}}function iN(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Np(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),fp(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Np(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,i,n;return this.getSenders().forEach((i=>{i.track===e&&(t?n=!0:t=i)})),this.getReceivers().forEach((t=>(t.track===e&&(i?n=!0:i=t),t.track===e))),n||t&&i?Mm.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():i?i.getStats():Mm.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function nN(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){if(!i)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[i.id]?-1===this._shimmedLocalStreams[i.id].indexOf(n)&&this._shimmedLocalStreams[i.id].push(n):this._shimmedLocalStreams[i.id]=[i,n],n};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();i.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const i=this._shimmedLocalStreams[t].indexOf(e);-1!==i&&this._shimmedLocalStreams[t].splice(i,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),r.apply(this,arguments)}}function rN(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return nN(e);const i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=i.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const i=new e.MediaStream(t.getTracks());this._streams[t.id]=i,this._reverseStreams[i.id]=t,t=i}n.apply(this,[t])};const r=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],r=e._streams[n.id];i=i.replace(new RegExp(r.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:i})}function s(e,t){let i=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],r=e._streams[n.id];i=i.replace(new RegExp(n.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:i})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,i){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((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");const r=this.getSenders().find((e=>e.track===t));if(r)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[i.id];if(o)o.addTrack(t),Mm.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[i.id]=n,this._reverseStreams[n.id]=i,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const i=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?i.apply(this,[t=>{const i=o(this,t);e[0].apply(null,[i])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):i.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.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 c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((i=>{this._streams[i].getTracks().find((t=>e.track===t))&&(t=this._streams[i])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function oN(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const i=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function sN(e,t){fp(e,"negotiationneeded",(e=>{const i=e.target;if(!(t.version<72||i.getConfiguration&&"plan-b"===i.getConfiguration().sdpSemantics)||"stable"===i.signalingState)return e}))}var aN=Object.freeze({__proto__:null,shimMediaStream:Zv,shimOnTrack:$v,shimGetSendersWithDtmf:eN,shimGetStats:tN,shimSenderReceiverGetStats:iN,shimAddTrackRemoveTrackWithNative:nN,shimAddTrackRemoveTrack:rN,shimPeerConnection:oN,fixNegotiationNeeded:sN,shimGetUserMedia:zv,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then((t=>{const n=i.video&&i.video.width,r=i.video&&i.video.height,o=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(i.video.mandatory.maxWidth=n),r&&(i.video.mandatory.maxHeight=r),e.navigator.mediaDevices.getUserMedia(i)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}}),cN={exports:{}};!function(e){var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},t.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},t.getDescription=function(e){var i=t.splitSections(e);return i&&i[0]},t.getMediaSections=function(e){var i=t.splitSections(e);return i.shift(),i},t.matchPrefix=function(e,i){return t.splitLines(e).filter((function(e){return 0===e.indexOf(i)}))},t.parseCandidate=function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":i.relatedAddress=t[n+1];break;case"rport":i.relatedPort=parseInt(t[n+1],10);break;case"tcptype":i.tcpType=t[n+1];break;case"ufrag":i.ufrag=t[n+1],i.usernameFragment=t[n+1];break;default:i[t[n]]=t[n+1]}return i},t.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var t=e.substr(9).split(" "),i={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),i.name=t[0],i.clockRate=parseInt(t[1],10),i.channels=3===t.length?parseInt(t[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var i=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==i?"/"+i:"")+"\r\n"},t.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){for(var t,i={},n=e.substr(e.indexOf(" ")+1).split(";"),r=0;r<n.length;r++)i[(t=n[r].trim().split("="))[0].trim()]=t[1];return i},t.writeFmtp=function(e){var t="",i=e.payloadType;if(void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+i+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){var t="",i=e.payloadType;return void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+i+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){var t=e.indexOf(" "),i={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(i.attribute=e.substr(t+1,n-t-1),i.value=e.substr(n+1)):i.attribute=e.substr(t+1),i},t.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},t.getMid=function(e){var i=t.matchPrefix(e,"a=mid:")[0];if(i)return i.substr(6)},t.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},t.getDtlsParameters=function(e,i){return{role:"auto",fingerprints:t.matchPrefix(e+i,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){var i="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),i},t.getIceParameters=function(e,i){var n=t.splitLines(e);return{usernameFragment:(n=n.concat(t.splitLines(i))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:n.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},t.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},t.parseRtpParameters=function(e){for(var i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=t.parseRtpMap(s),c=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?t.parseFmtp(c[0]):{},a.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),i.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":i.fecMechanisms.push(a.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((function(e){i.headerExtensions.push(t.parseExtmap(e))})),i},t.writeRtpDescription=function(e,i){var n="";n+="m="+e+" ",n+=i.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=i.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.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",i.codecs.forEach((function(e){n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));var r=0;return i.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(n+="a=maxptime:"+r+"\r\n"),n+="a=rtcp-mux\r\n",i.headerExtensions&&i.headerExtensions.forEach((function(e){n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){var i,n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),s=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,A=t.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));A.length>0&&A[0].length>1&&A[0][0]===c&&(i=A[0][1]),r.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var t={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&i&&(t.rtx={ssrc:i}),n.push(t),o&&((t=JSON.parse(JSON.stringify(t))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&c&&n.push({ssrc:c});var d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){var i={},n=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(i.cname=n.value,i.ssrc=n.ssrc);var r=t.matchPrefix(e,"a=rtcp-rsize");i.reducedSize=r.length>0,i.compound=0===r.length;var o=t.matchPrefix(e,"a=rtcp-mux");return i.mux=o.length>0,i},t.parseMsid=function(e){var i,n=t.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(i=n[0].substr(7).split(" "))[0],track:i[1]};var r=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(i=r[0].value.split(" "))[0],track:i[1]}:void 0},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,i,n){var r=void 0!==i?i:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||t.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.writeMediaSection=function(e,i,n,r){var o=t.writeRtpDescription(e.kind,i);if(o+=t.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=t.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+"\r\n"),o},t.getDirection=function(e,i){for(var n=t.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return i?t.getDirection(i):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){var i=t.splitLines(e)[0].substr(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},t.parseOLine=function(e){var i=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var i=t.splitLines(e),n=0;n<i.length;n++)if(i[n].length<2||"="!==i[n].charAt(1))return!1;return!0},e.exports=t}(cN);var AN=cN.exports;function dN(e,t,i,n,r){var o=AN.writeRtpDescription(e.kind,t);if(o+=AN.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=AN.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":r||"active"),o+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var a="msid:"+(n?n.id:"-")+" "+s+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+AN.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+AN.localCName+"\r\n"),o}function uN(e,t){var i={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var i=0;i<t.length;i++)if(t[i].payloadType===e||t[i].preferredPayloadType===e)return t[i]},r=function(e,t,i,r){var o=n(e.parameters.apt,i),s=n(t.parameters.apt,r);return o&&s&&o.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach((function(n){for(var o=0;o<t.codecs.length;o++){var s=t.codecs[o];if(n.name.toLowerCase()===s.name.toLowerCase()&&n.clockRate===s.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&s.parameters.apt&&!r(n,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(n.numChannels,s.numChannels),i.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter((function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var n=0;n<t.headerExtensions.length;n++){var r=t.headerExtensions[n];if(e.uri===r.uri){i.headerExtensions.push(r);break}}})),i}function EN(e,t,i){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(i)}function lN(e,t){var i=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return i||e.addRemoteCandidate(t),!i}function hN(e,t){var i=new Error(t);return i.name=e,i.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],i}function pN(e){const t=e&&e.navigator,i=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e).catch((e=>Mm.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e))))}}function _N(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function IN(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const i=new Event("enabled");i.enabled=e,this.dispatchEvent(i)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const i=function(e,t){function i(t,i){i.addTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function n(t,i,n,r){var o=new Event("track");o.track=i,o.receiver=n,o.transceiver={receiver:n},o.streams=r,e.setTimeout((function(){t._dispatchEvent("track",o)}))}var r=function(i){var n=this,r=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){n[e]=r[e].bind(r)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",i=JSON.parse(JSON.stringify(i||{})),this.usingBundle="max-bundle"===i.bundlePolicy,"negotiate"===i.rtcpMuxPolicy)throw hN("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(i.rtcpMuxPolicy||(i.rtcpMuxPolicy="require"),i.iceTransportPolicy){case"all":case"relay":break;default:i.iceTransportPolicy="all"}switch(i.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:i.bundlePolicy="balanced"}if(i.iceServers=function(e,t){var i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var r="string"==typeof n;return r&&(n=[n]),n=n.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||i?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(i=!0,!0)})),delete e.url,e.urls=r?n[0]:n,!!n.length}}))}(i.iceServers||[],t),this._iceGatherers=[],i.iceCandidatePoolSize)for(var o=i.iceCandidatePoolSize;o>0;o--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:i.iceServers,gatherPolicy:i.iceTransportPolicy}));else i.iceCandidatePoolSize=0;this._config=i,this.transceivers=[],this._sdpSessionId=AN.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(r.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(r.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),r.prototype.onicecandidate=null,r.prototype.onaddstream=null,r.prototype.ontrack=null,r.prototype.onremovestream=null,r.prototype.onsignalingstatechange=null,r.prototype.oniceconnectionstatechange=null,r.prototype.onconnectionstatechange=null,r.prototype.onicegatheringstatechange=null,r.prototype.onnegotiationneeded=null,r.prototype.ondatachannel=null,r.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},r.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},r.prototype.getConfiguration=function(){return this._config},r.prototype.getLocalStreams=function(){return this.localStreams},r.prototype.getRemoteStreams=function(){return this.remoteStreams},r.prototype._createTransceiver=function(e,t){var i=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&i)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var r=this._createIceAndDtlsTransports();n.iceTransport=r.iceTransport,n.dtlsTransport=r.dtlsTransport}return t||this.transceivers.push(n),n},r.prototype.addTrack=function(t,i){if(this._isClosed)throw hN("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n;if(this.transceivers.find((function(e){return e.track===t})))throw hN("InvalidAccessError","Track already exists.");for(var r=0;r<this.transceivers.length;r++)this.transceivers[r].track||this.transceivers[r].kind!==t.kind||(n=this.transceivers[r]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(i)&&this.localStreams.push(i),n.track=t,n.stream=i,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},r.prototype.addStream=function(e){var i=this;if(t>=15025)e.getTracks().forEach((function(t){i.addTrack(t,e)}));else{var n=e.clone();e.getTracks().forEach((function(e,t){var i=n.getTracks()[t];e.addEventListener("enabled",(function(e){i.enabled=e.enabled}))})),n.getTracks().forEach((function(e){i.addTrack(e,n)}))}},r.prototype.removeTrack=function(t){if(this._isClosed)throw hN("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var i=this.transceivers.find((function(e){return e.rtpSender===t}));if(!i)throw hN("InvalidAccessError","Sender was not created by this connection.");var n=i.stream;i.rtpSender.stop(),i.rtpSender=null,i.track=null,i.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},r.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var i=t.getSenders().find((function(t){return t.track===e}));i&&t.removeTrack(i)}))},r.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},r.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},r.prototype._createIceGatherer=function(t,i){var n=this;if(i&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var r=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(r,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var i=!e.candidate||0===Object.keys(e.candidate).length;r.state=i?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},r.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),r},r.prototype._gather=function(t,i){var n=this,r=this.transceivers[i].iceGatherer;if(!r.onlocalcandidate){var o=this.transceivers[i].bufferedCandidateEvents;this.transceivers[i].bufferedCandidateEvents=null,r.removeEventListener("localcandidate",this.transceivers[i].bufferCandidates),r.onlocalcandidate=function(e){if(!(n.usingBundle&&i>0)){var o=new Event("icecandidate");o.candidate={sdpMid:t,sdpMLineIndex:i};var s=e.candidate,a=!s||0===Object.keys(s).length;if(a)"new"!==r.state&&"gathering"!==r.state||(r.state="completed");else{"new"===r.state&&(r.state="gathering"),s.component=1,s.ufrag=r.getLocalParameters().usernameFragment;var c=AN.writeCandidate(s);o.candidate=Object.assign(o.candidate,AN.parseCandidate(c)),o.candidate.candidate=c,o.candidate.toJSON=function(){return{candidate:o.candidate.candidate,sdpMid:o.candidate.sdpMid,sdpMLineIndex:o.candidate.sdpMLineIndex,usernameFragment:o.candidate.usernameFragment}}}var A=AN.getMediaSections(n._localDescription.sdp);A[o.candidate.sdpMLineIndex]+=a?"a=end-of-candidates\r\n":"a="+o.candidate.candidate+"\r\n",n._localDescription.sdp=AN.getDescription(n._localDescription.sdp)+A.join("");var d=n.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),a||n._dispatchEvent("icecandidate",o),d&&(n._dispatchEvent("icecandidate",new Event("icecandidate")),n.iceGatheringState="complete",n._emitGatheringStateChange())}},e.setTimeout((function(){o.forEach((function(e){r.onlocalcandidate(e)}))}),0)}},r.prototype._createIceAndDtlsTransports=function(){var t=this,i=new e.RTCIceTransport(null);i.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(i);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:i,dtlsTransport:n}},r.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var i=this.transceivers[e].iceTransport;i&&(delete i.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},r.prototype._transceive=function(e,i,n){var r=uN(e.localCapabilities,e.remoteCapabilities);i&&e.rtpSender&&(r.encodings=e.sendEncodingParameters,r.rtcp={cname:AN.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(r.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(r)),n&&e.rtpReceiver&&r.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?r.encodings=e.recvEncodingParameters:r.encodings=[{}],r.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(r.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(r.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(r))},r.prototype.setLocalDescription=function(e){var t,i,n=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(hN("TypeError",'Unsupported type "'+e.type+'"'));if(!EN("setLocalDescription",e.type,n.signalingState)||n._isClosed)return Promise.reject(hN("InvalidStateError","Can not set local "+e.type+" in state "+n.signalingState));if("offer"===e.type)t=AN.splitSections(e.sdp),i=t.shift(),t.forEach((function(e,t){var i=AN.parseRtpParameters(e);n.transceivers[t].localCapabilities=i})),n.transceivers.forEach((function(e,t){n._gather(e.mid,t)}));else if("answer"===e.type){t=AN.splitSections(n._remoteDescription.sdp),i=t.shift();var r=AN.matchPrefix(i,"a=ice-lite").length>0;t.forEach((function(e,t){var o=n.transceivers[t],s=o.iceGatherer,a=o.iceTransport,c=o.dtlsTransport,A=o.localCapabilities,d=o.remoteCapabilities;if(!(AN.isRejected(e)&&0===AN.matchPrefix(e,"a=bundle-only").length||o.rejected)){var u=AN.getIceParameters(e,i),E=AN.getDtlsParameters(e,i);r&&(E.role="server"),n.usingBundle&&0!==t||(n._gather(o.mid,t),"new"===a.state&&a.start(s,u,r?"controlling":"controlled"),"new"===c.state&&c.start(E));var l=uN(A,d);n._transceive(o,l.codecs.length>0,!1)}}))}return n._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?n._updateSignalingState("have-local-offer"):n._updateSignalingState("stable"),Promise.resolve()},r.prototype.setRemoteDescription=function(r){var o=this;if(-1===["offer","answer"].indexOf(r.type))return Promise.reject(hN("TypeError",'Unsupported type "'+r.type+'"'));if(!EN("setRemoteDescription",r.type,o.signalingState)||o._isClosed)return Promise.reject(hN("InvalidStateError","Can not set remote "+r.type+" in state "+o.signalingState));var s={};o.remoteStreams.forEach((function(e){s[e.id]=e}));var a=[],c=AN.splitSections(r.sdp),A=c.shift(),d=AN.matchPrefix(A,"a=ice-lite").length>0,u=AN.matchPrefix(A,"a=group:BUNDLE ").length>0;o.usingBundle=u;var E=AN.matchPrefix(A,"a=ice-options:")[0];return o.canTrickleIceCandidates=!!E&&E.substr(14).split(" ").indexOf("trickle")>=0,c.forEach((function(n,c){var E=AN.splitLines(n),l=AN.getKind(n),h=AN.isRejected(n)&&0===AN.matchPrefix(n,"a=bundle-only").length,p=E[0].substr(2).split(" ")[2],_=AN.getDirection(n,A),I=AN.parseMsid(n),g=AN.getMid(n)||AN.generateIdentifier();if(h||"application"===l&&("DTLS/SCTP"===p||"UDP/DTLS/SCTP"===p))o.transceivers[c]={mid:g,kind:l,protocol:p,rejected:!0};else{var f,R,C,T,m,S,O,v,N;!h&&o.transceivers[c]&&o.transceivers[c].rejected&&(o.transceivers[c]=o._createTransceiver(l,!0));var y,D,w=AN.parseRtpParameters(n);h||(y=AN.getIceParameters(n,A),(D=AN.getDtlsParameters(n,A)).role="client"),O=AN.parseRtpEncodingParameters(n);var b=AN.parseRtcpParameters(n),L=AN.matchPrefix(n,"a=end-of-candidates",A).length>0,P=AN.matchPrefix(n,"a=candidate:").map((function(e){return AN.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===r.type||"answer"===r.type)&&!h&&u&&c>0&&o.transceivers[c]&&(o._disposeIceAndDtlsTransports(c),o.transceivers[c].iceGatherer=o.transceivers[0].iceGatherer,o.transceivers[c].iceTransport=o.transceivers[0].iceTransport,o.transceivers[c].dtlsTransport=o.transceivers[0].dtlsTransport,o.transceivers[c].rtpSender&&o.transceivers[c].rtpSender.setTransport(o.transceivers[0].dtlsTransport),o.transceivers[c].rtpReceiver&&o.transceivers[c].rtpReceiver.setTransport(o.transceivers[0].dtlsTransport)),"offer"!==r.type||h)"answer"!==r.type||h||(R=(f=o.transceivers[c]).iceGatherer,C=f.iceTransport,T=f.dtlsTransport,m=f.rtpReceiver,S=f.sendEncodingParameters,v=f.localCapabilities,o.transceivers[c].recvEncodingParameters=O,o.transceivers[c].remoteCapabilities=w,o.transceivers[c].rtcpParameters=b,P.length&&"new"===C.state&&(!d&&!L||u&&0!==c?P.forEach((function(e){lN(f.iceTransport,e)})):C.setRemoteCandidates(P)),u&&0!==c||("new"===C.state&&C.start(R,y,"controlling"),"new"===T.state&&T.start(D)),!uN(f.localCapabilities,f.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&f.sendEncodingParameters[0].rtx&&delete f.sendEncodingParameters[0].rtx,o._transceive(f,"sendrecv"===_||"recvonly"===_,"sendrecv"===_||"sendonly"===_),!m||"sendrecv"!==_&&"sendonly"!==_?delete f.rtpReceiver:(N=m.track,I?(s[I.stream]||(s[I.stream]=new e.MediaStream),i(N,s[I.stream]),a.push([N,m,s[I.stream]])):(s.default||(s.default=new e.MediaStream),i(N,s.default),a.push([N,m,s.default]))));else{(f=o.transceivers[c]||o._createTransceiver(l)).mid=g,f.iceGatherer||(f.iceGatherer=o._createIceGatherer(c,u)),P.length&&"new"===f.iceTransport.state&&(!L||u&&0!==c?P.forEach((function(e){lN(f.iceTransport,e)})):f.iceTransport.setRemoteCandidates(P)),v=e.RTCRtpReceiver.getCapabilities(l),t<15019&&(v.codecs=v.codecs.filter((function(e){return"rtx"!==e.name}))),S=f.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var k,M=!1;"sendrecv"===_||"sendonly"===_?(M=!f.rtpReceiver,m=f.rtpReceiver||new e.RTCRtpReceiver(f.dtlsTransport,l),M&&(N=m.track,I&&"-"===I.stream||(I?(s[I.stream]||(s[I.stream]=new e.MediaStream,Object.defineProperty(s[I.stream],"id",{get:function(){return I.stream}})),Object.defineProperty(N,"id",{get:function(){return I.track}}),k=s[I.stream]):(s.default||(s.default=new e.MediaStream),k=s.default)),k&&(i(N,k),f.associatedRemoteMediaStreams.push(k)),a.push([N,m,k]))):f.rtpReceiver&&f.rtpReceiver.track&&(f.associatedRemoteMediaStreams.forEach((function(t){var i=t.getTracks().find((function(e){return e.id===f.rtpReceiver.track.id}));i&&function(t,i){i.removeTrack(t),i.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(i,t)})),f.associatedRemoteMediaStreams=[]),f.localCapabilities=v,f.remoteCapabilities=w,f.rtpReceiver=m,f.rtcpParameters=b,f.sendEncodingParameters=S,f.recvEncodingParameters=O,o._transceive(o.transceivers[c],!1,M)}}})),void 0===o._dtlsRole&&(o._dtlsRole="offer"===r.type?"active":"passive"),o._remoteDescription={type:r.type,sdp:r.sdp},"offer"===r.type?o._updateSignalingState("have-remote-offer"):o._updateSignalingState("stable"),Object.keys(s).forEach((function(t){var i=s[t];if(i.getTracks().length){if(-1===o.remoteStreams.indexOf(i)){o.remoteStreams.push(i);var r=new Event("addstream");r.stream=i,e.setTimeout((function(){o._dispatchEvent("addstream",r)}))}a.forEach((function(e){var t=e[0],r=e[1];i.id===e[2].id&&n(o,t,r,[i])}))}})),a.forEach((function(e){e[2]||n(o,e[0],e[1],[])})),e.setTimeout((function(){o&&o.transceivers&&o.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},r.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},r.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},r.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},r.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var i=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",i)}},r.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var i=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",i)}},r.prototype.createOffer=function(){var i=this;if(i._isClosed)return Promise.reject(hN("InvalidStateError","Can not call createOffer after close"));var n=i.transceivers.filter((function(e){return"audio"===e.kind})).length,r=i.transceivers.filter((function(e){return"video"===e.kind})).length,o=arguments[0];if(o){if(o.mandatory||o.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==o.offerToReceiveAudio&&(n=!0===o.offerToReceiveAudio?1:!1===o.offerToReceiveAudio?0:o.offerToReceiveAudio),void 0!==o.offerToReceiveVideo&&(r=!0===o.offerToReceiveVideo?1:!1===o.offerToReceiveVideo?0:o.offerToReceiveVideo)}for(i.transceivers.forEach((function(e){"audio"===e.kind?--n<0&&(e.wantReceive=!1):"video"===e.kind&&--r<0&&(e.wantReceive=!1)}));n>0||r>0;)n>0&&(i._createTransceiver("audio"),n--),r>0&&(i._createTransceiver("video"),r--);var s=AN.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.transceivers.forEach((function(n,r){var o=n.track,s=n.kind,a=n.mid||AN.generateIdentifier();n.mid=a,n.iceGatherer||(n.iceGatherer=i._createIceGatherer(r,i.usingBundle));var c=e.RTCRtpSender.getCapabilities(s);t<15019&&(c.codecs=c.codecs.filter((function(e){return"rtx"!==e.name}))),c.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),n.remoteCapabilities&&n.remoteCapabilities.codecs&&n.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),c.headerExtensions.forEach((function(e){(n.remoteCapabilities&&n.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var A=n.sendEncodingParameters||[{ssrc:1001*(2*r+1)}];o&&t>=15019&&"video"===s&&!A[0].rtx&&(A[0].rtx={ssrc:A[0].ssrc+1}),n.wantReceive&&(n.rtpReceiver=new e.RTCRtpReceiver(n.dtlsTransport,s)),n.localCapabilities=c,n.sendEncodingParameters=A})),"max-compat"!==i._config.bundlePolicy&&(s+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",i.transceivers.forEach((function(e,t){s+=dN(e,e.localCapabilities,"offer",e.stream,i._dtlsRole),s+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===i.iceGatheringState||0!==t&&i.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,s+="a="+AN.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))}));var a=new e.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(a)},r.prototype.createAnswer=function(){var i=this;if(i._isClosed)return Promise.reject(hN("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==i.signalingState&&"have-local-pranswer"!==i.signalingState)return Promise.reject(hN("InvalidStateError","Can not call createAnswer in signalingState "+i.signalingState));var n=AN.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.usingBundle&&(n+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),n+="a=ice-options:trickle\r\n";var r=AN.getMediaSections(i._remoteDescription.sdp).length;i.transceivers.forEach((function(e,o){if(!(o+1>r)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?n+="m=application 0 DTLS/SCTP 5000\r\n":n+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?n+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(n+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(n+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var s;e.stream&&("audio"===e.kind?s=e.stream.getAudioTracks()[0]:"video"===e.kind&&(s=e.stream.getVideoTracks()[0]),s&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var a=uN(e.localCapabilities,e.remoteCapabilities);!a.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,n+=dN(e,a,"answer",e.stream,i._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(n+="a=rtcp-rsize\r\n")}}));var o=new e.RTCSessionDescription({type:"answer",sdp:n});return Promise.resolve(o)},r.prototype.addIceCandidate=function(e){var t,i=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(n,r){if(!i._remoteDescription)return r(hN("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var o=e.sdpMLineIndex;if(e.sdpMid)for(var s=0;s<i.transceivers.length;s++)if(i.transceivers[s].mid===e.sdpMid){o=s;break}var a=i.transceivers[o];if(!a)return r(hN("OperationError","Can not add ICE candidate"));if(a.rejected)return n();var c=Object.keys(e.candidate).length>0?AN.parseCandidate(e.candidate):{};if("tcp"===c.protocol&&(0===c.port||9===c.port))return n();if(c.component&&1!==c.component)return n();if((0===o||o>0&&a.iceTransport!==i.transceivers[0].iceTransport)&&!lN(a.iceTransport,c))return r(hN("OperationError","Can not add ICE candidate"));var A=e.candidate.trim();0===A.indexOf("a=")&&(A=A.substr(2)),(t=AN.getMediaSections(i._remoteDescription.sdp))[o]+="a="+(c.type?A:"end-of-candidates")+"\r\n",i._remoteDescription.sdp=AN.getDescription(i._remoteDescription.sdp)+t.join("")}else for(var d=0;d<i.transceivers.length&&(i.transceivers[d].rejected||(i.transceivers[d].iceTransport.addRemoteCandidate({}),(t=AN.getMediaSections(i._remoteDescription.sdp))[d]+="a=end-of-candidates\r\n",i._remoteDescription.sdp=AN.getDescription(i._remoteDescription.sdp)+t.join(""),!i.usingBundle));d++);n()}))},r.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var i=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?i=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(i=e.rtpReceiver)})),!i)throw hN("InvalidAccessError","Invalid selector.");return i.getStats()}var n=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&n.push(e[t].getStats())}))})),Promise.all(n).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var i=e[t];if(i&&i.prototype&&i.prototype.getStats){var n=i.prototype.getStats;i.prototype.getStats=function(){return n.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(i){var n;e[i].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(n=e[i]).type]||n.type,t.set(i,e[i])})),t}))}}}));var o=["createOffer","createAnswer"];return o.forEach((function(e){var t=r.prototype[e];r.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(o=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=r.prototype[e];r.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=r.prototype[e];r.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),r}(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let i=!1;return(e=JSON.parse(JSON.stringify(e))).filter((e=>{if(e&&(e.urls||e.url)){let t=e.urls||e.url;e.url&&!e.urls&&mp("RTCIceServer.url","RTCIceServer.urls");const n="string"==typeof t;return n&&(t=[t]),t=t.filter((e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!i?(i=!0,!0):t&&!i})),delete e.url,e.urls=n?t[0]:t,!!t.length}}))}(e.iceServers,t.version),Tp("ICE servers after filtering:",e.iceServers)),new i(e)},e.RTCPeerConnection.prototype=i.prototype}function gN(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}var fN=Object.freeze({__proto__:null,shimPeerConnection:IN,shimReplaceTrack:gN,shimGetUserMedia:pN,shimGetDisplayMedia:_N}),RN=Fn,CN=Gn,TN=o,mN=H,SN=Q,ON=Po,vN=Ks,NN=Gt.exports;if(RN({target:"Promise",proto:!0,real:!0,forced:!!CN&&TN((function(){CN.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=ON(this,mN("Promise")),i=SN(e);return this.then(i?function(i){return vN(t,e()).then((function(){return i}))}:e,i?function(i){return vN(t,e()).then((function(){throw i}))}:e)}}),SN(CN)){var yN=mN("Promise").prototype.finally;CN.prototype.finally!==yN&&NN(CN.prototype,"finally",yN,{unsafe:!0})}function DN(e,t){const i=e&&e.navigator,n=e&&e.MediaStreamTrack;if(i.getUserMedia=function(e,t,n){mp("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),i.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in i.mediaDevices.getSupportedConstraints())){const e=function(e,t,i){t in e&&!(i in e)&&(e[i]=e[t],delete e[t])},t=i.mediaDevices.getUserMedia.bind(i.mediaDevices);if(i.mediaDevices.getUserMedia=function(i){return"object"==typeof i&&"object"==typeof i.audio&&(i=JSON.parse(JSON.stringify(i)),e(i.audio,"autoGainControl","mozAutoGainControl"),e(i.audio,"noiseSuppression","mozNoiseSuppression")),t(i)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const i=t.apply(this,arguments);return e(i,"mozAutoGainControl","autoGainControl"),e(i,"mozNoiseSuppression","noiseSuppression"),i}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(i){return"audio"===this.kind&&"object"==typeof i&&(i=JSON.parse(JSON.stringify(i)),e(i,"autoGainControl","mozAutoGainControl"),e(i,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[i])}}}}function wN(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function bN(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const i=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!r)try{e.forEach((e=>{e.type=i[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:i[t.type]||t.type}))}))}return e})).then(r,o)}}function LN(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Mm.resolve(new Map)}}function PN(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),fp(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function kN(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){mp("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function MN(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function UN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],i=e&&"sendEncodings"in e;i&&e.sendEncodings.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(i){const{sender:t}=n,i=t.getParameters();(!("encodings"in i)||1===i.encodings.length&&0===Object.keys(i.encodings[0]).length)&&(i.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(i).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function BN(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function VN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Mm.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function QN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Mm.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var xN=Object.freeze({__proto__:null,shimOnTrack:wN,shimPeerConnection:bN,shimSenderGetStats:LN,shimReceiverGetStats:PN,shimRemoveStream:kN,shimRTCDataChannel:MN,shimAddTransceiver:UN,shimGetParameters:BN,shimCreateOffer:VN,shimCreateAnswer:QN,shimGetUserMedia:DN,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(i){if(!i||!i.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Mm.reject(e)}return!0===i.video?i.video={mediaSource:t}:i.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(i)})}});function FN(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((i=>t.call(this,i,e))),e.getVideoTracks().forEach((i=>t.call(this,i,e)))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const i=e.getTracks();this.getSenders().forEach((e=>{i.includes(e.track)&&this.removeTrack(e)}))})}}function GN(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const i=new Event("addstream");i.stream=t,e.dispatchEvent(i)}))}),t.apply(e,arguments)}}}function jN(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,i=t.createOffer,n=t.createAnswer,r=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Mm.resolve()):r},t.createAnswer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],r=n.apply(this,[i]);return t?(r.then(e,t),Mm.resolve()):r};let a=function(e,t,i){const n=r.apply(this,[e]);return i?(n.then(t,i),Mm.resolve()):n};t.setLocalDescription=a,a=function(e,t,i){const n=o.apply(this,[e]);return i?(n.then(t,i),Mm.resolve()):n},t.setRemoteDescription=a,a=function(e,t,i){const n=s.apply(this,[e]);return i?(n.then(t,i),Mm.resolve()):n},t.addIceCandidate=a}function YN(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,i=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>i(HN(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,i,n){t.mediaDevices.getUserMedia(e).then(i,n)}.bind(t))}function HN(e){return e&&void 0!==e.video?Object.assign({},e,{video:vp(e.video)}):e}function KN(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,i){if(e&&e.iceServers){const t=[];for(let i=0;i<e.iceServers.length;i++){let n=e.iceServers[i];!n.hasOwnProperty("urls")&&n.hasOwnProperty("url")?(mp("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[i])}e.iceServers=t}return new t(e,i)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function WN(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function JN(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const i=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":"recvonly"===i.direction&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):!0!==e.offerToReceiveVideo||i||this.addTransceiver("video")}return t.apply(this,arguments)}}function qN(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var XN=Object.freeze({__proto__:null,shimLocalStreamsAPI:FN,shimRemoteStreamsAPI:GN,shimCallbacksAPI:jN,shimGetUserMedia:YN,shimConstraints:HN,shimRTCIceServerUrls:KN,shimTrackEventTransceiver:WN,shimCreateOfferLegacy:JN,shimAudioContext:qN}),zN=cA,ZN=qI,$N=Dc("".replace),ey="[\t\n\v\f\r                 \u2028\u2029\ufeff]",ty=RegExp("^"+ey+ey+"*"),iy=RegExp(ey+ey+"*$"),ny=function(e){return function(t){var i=ZN(zN(t));return 1&e&&(i=$N(i,ty,"")),2&e&&(i=$N(i,iy,"")),i}},ry={start:ny(1),end:ny(2),trim:ny(3)},oy=$g.PROPER,sy=Tc,ay="\t\n\v\f\r                 \u2028\u2029\ufeff",cy=ry.trim;Bu({target:"String",proto:!0,forced:function(e){return sy((function(){return!!ay[e]()||"​…᠎"!=="​…᠎"[e]()||oy&&ay[e].name!==e}))}("trim")},{trim:function(){return cy(this)}});var Ay=rE("String").trim,dy=wc,uy=Ay,Ey=String.prototype,ly=function(e){var t=e.trim;return"string"==typeof e||e===Ey||dy(Ey,e)&&t===Ey.trim?uy:t},hy=d;Fn({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return hy(URL.prototype.toString,this)}});var py={exports:{}};!function(e){var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return ly(e).call(e).split("\n").map((function(e){return ly(e).call(e)}))},t.splitSections=function(e){return e.split("\nm=").map((function(e,t){var i;return ly(i=t>0?"m="+e:e).call(i)+"\r\n"}))},t.getDescription=function(e){var i=t.splitSections(e);return i&&i[0]},t.getMediaSections=function(e){var i=t.splitSections(e);return i.shift(),i},t.matchPrefix=function(e,i){return t.splitLines(e).filter((function(e){return 0===e.indexOf(i)}))},t.parseCandidate=function(e){for(var t,i={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":i.relatedAddress=t[n+1];break;case"rport":i.relatedPort=parseInt(t[n+1],10);break;case"tcptype":i.tcpType=t[n+1];break;case"ufrag":i.ufrag=t[n+1],i.usernameFragment=t[n+1];break;default:i[t[n]]=t[n+1]}return i},t.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var t=e.substr(9).split(" "),i={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),i.name=t[0],i.clockRate=parseInt(t[1],10),i.channels=3===t.length?parseInt(t[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var i=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==i?"/"+i:"")+"\r\n"},t.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){for(var t,i={},n=e.substr(e.indexOf(" ")+1).split(";"),r=0;r<n.length;r++){var o,s;t=ly(o=n[r]).call(o).split("="),i[ly(s=t[0]).call(s)]=t[1]}return i},t.writeFmtp=function(e){var t="",i=e.payloadType;if(void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+i+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){var t="",i=e.payloadType;return void 0!==e.preferredPayloadType&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+i+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){var t=e.indexOf(" "),i={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(i.attribute=e.substr(t+1,n-t-1),i.value=e.substr(n+1)):i.attribute=e.substr(t+1),i},t.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},t.getMid=function(e){var i=t.matchPrefix(e,"a=mid:")[0];if(i)return i.substr(6)},t.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},t.getDtlsParameters=function(e,i){return{role:"auto",fingerprints:t.matchPrefix(e+i,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){var i="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),i},t.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,i){return t.matchPrefix(e+i,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,i){var n=t.matchPrefix(e+i,"a=ice-ufrag:")[0],r=t.matchPrefix(e+i,"a=ice-pwd:")[0];return n&&r?{usernameFragment:n.substr(12),password:r.substr(10)}:null},t.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},t.parseRtpParameters=function(e){for(var i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=t.parseRtpMap(s),c=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?t.parseFmtp(c[0]):{},a.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),i.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":i.fecMechanisms.push(a.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((function(e){i.headerExtensions.push(t.parseExtmap(e))})),i},t.writeRtpDescription=function(e,i){var n="";n+="m="+e+" ",n+=i.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=i.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.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",i.codecs.forEach((function(e){n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));var r=0;return i.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(n+="a=maxptime:"+r+"\r\n"),n+="a=rtcp-mux\r\n",i.headerExtensions&&i.headerExtensions.forEach((function(e){n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){var i,n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),s=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,A=t.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));A.length>0&&A[0].length>1&&A[0][0]===c&&(i=A[0][1]),r.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var t={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&i&&(t.rtx={ssrc:i}),n.push(t),o&&((t=JSON.parse(JSON.stringify(t))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&c&&n.push({ssrc:c});var d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){var i={},n=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(i.cname=n.value,i.ssrc=n.ssrc);var r=t.matchPrefix(e,"a=rtcp-rsize");i.reducedSize=r.length>0,i.compound=0===r.length;var o=t.matchPrefix(e,"a=rtcp-mux");return i.mux=o.length>0,i},t.parseMsid=function(e){var i,n=t.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(i=n[0].substr(7).split(" "))[0],track:i[1]};var r=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(i=r[0].value.split(" "))[0],track:i[1]}:void 0},t.parseSctpDescription=function(e){var i,n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");r.length>0&&(i=parseInt(r[0].substr(19),10)),isNaN(i)&&(i=65536);var o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:i};if(t.matchPrefix(e,"a=sctpmap:").length>0){var s=t.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){var i=[];return i="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&i.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),i.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,i,n){var r=void 0!==i?i:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||t.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.writeMediaSection=function(e,i,n,r){var o=t.writeRtpDescription(e.kind,i);if(o+=t.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=t.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+"\r\n"),o},t.getDirection=function(e,i){for(var n=t.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return i?t.getDirection(i):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){var i=t.splitLines(e)[0].substr(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},t.parseOLine=function(e){var i=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var i=t.splitLines(e),n=0;n<i.length;n++)if(i[n].length<2||"="!==i[n].charAt(1))return!1;return!0},e.exports=t}(py);var _y=py.exports;function Iy(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const i=new t(e),n=_y.parseCandidate(e.candidate),r=Object.assign(i,n);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,fp(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function gy(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const i=function(e){if(!e||!e.sdp)return!1;const t=_y.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=_y.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const i=parseInt(t[1],10);return i!=i?-1:i},r=function(e){let i=65536;return"firefox"===t.browser&&(i=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),i},o=function(e,i){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const r=_y.matchPrefix(e.sdp,"a=max-message-size:");return r.length>0?n=parseInt(r[0].substr(19),10):"firefox"===t.browser&&-1!==i&&(n=2147483637),n},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(i(arguments[0])){const e=n(arguments[0]),t=r(e),i=o(arguments[0],e);let s;s=0===t&&0===i?Number.POSITIVE_INFINITY:0===t||0===i?Math.max(t,i):Math.min(t,i);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function fy(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const i=e.send;e.send=function(){const n=arguments[0],r=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&r>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return i.apply(e,arguments)}}const i=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=i.apply(this,arguments);return t(e,this),e},fp(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ry(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const i=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const i=new Event("connectionstatechange",e);t.dispatchEvent(i)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),i.apply(this,arguments)}}))}function Cy(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const i=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const i=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==ly(e).call(e))).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:i}):t.sdp=i}return i.apply(this,arguments)}}function Ty(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const i=e.RTCPeerConnection.prototype.addIceCandidate;i&&0!==i.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Mm.resolve():i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Mm.resolve())})}var my=Object.freeze({__proto__:null,shimRTCIceCandidate:Iy,shimMaxMessageSize:gy,shimSendThrowTypeError:fy,shimConnectionState:Ry,removeExtmapAllowMixed:Cy,shimAddIceCandidateNullOrEmpty:Ty});let Sy,Oy;!function(){let{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};const i=Tp,n=Sp(e),r={browserDetails:n,commonShim:my,extractVersion:gp,disableLog:Rp,disableWarnings:Cp};switch(n.browser){case"chrome":if(!aN||!oN||!t.shimChrome)return i("Chrome shim is not included in this adapter release."),r;if(null===n.version)return i("Chrome shim can not determine version, not shimming."),r;i("adapter.js shimming chrome."),r.browserShim=aN,Ty(e,n),zv(e,n),Zv(e),oN(e,n),$v(e),rN(e,n),eN(e),tN(e),iN(e),sN(e,n),Iy(e),Ry(e),gy(e,n),fy(e),Cy(e,n);break;case"firefox":if(!xN||!bN||!t.shimFirefox)return i("Firefox shim is not included in this adapter release."),r;i("adapter.js shimming firefox."),r.browserShim=xN,Ty(e,n),DN(e,n),bN(e,n),wN(e),kN(e),LN(e),PN(e),MN(e),UN(e),BN(e),VN(e),QN(e),Iy(e),Ry(e),gy(e,n),fy(e);break;case"edge":if(!fN||!IN||!t.shimEdge)return i("MS edge shim is not included in this adapter release."),r;i("adapter.js shimming edge."),r.browserShim=fN,pN(e),_N(e),IN(e,n),gN(e),gy(e,n),fy(e);break;case"safari":if(!XN||!t.shimSafari)return i("Safari shim is not included in this adapter release."),r;i("adapter.js shimming safari."),r.browserShim=XN,Ty(e,n),KN(e),JN(e),jN(e),FN(e),GN(e),WN(e),YN(e),qN(e),Iy(e),gy(e,n),fy(e),Cy(e,n);break;default:i("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window}),function(e){e.WIN_10="Windows 10",e.WIN_81="Windows 8.1",e.WIN_8="Windows 8",e.WIN_7="Windows 7",e.WIN_VISTA="Windows Vista",e.WIN_SERVER_2003="Windows Server 2003",e.WIN_XP="Windows XP",e.WIN_2000="Windows 2000",e.ANDROID="Android",e.OPEN_BSD="Open BSD",e.SUN_OS="Sun OS",e.LINUX="Linux",e.IOS="iOS",e.MAC_OS="Mac OS",e.QNX="QNX",e.UNIX="UNIX",e.BEOS="BeOS",e.OS_2="OS/2",e.SEARCH_BOT="Search Bot"}(Sy||(Sy={})),function(e){e.CHROME="Chrome",e.SAFARI="Safari",e.EDGE="Edge",e.FIREFOX="Firefox",e.OPERA="OPR",e.QQ="QQBrowser",e.WECHAT="MicroMessenger"}(Oy||(Oy={}));var vy={exports:{}};!function(t,i){!function(e,n){var r="function",o="object",s="string",a="model",c="name",A="type",d="vendor",u="version",E="architecture",l="console",h="mobile",p="tablet",_="smarttv",I="wearable",g="embedded",f={extend:function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i},has:function(e,t){return typeof e===s&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n},trim:function(e,t){return e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),void 0===t?e:e.substring(0,255)}},R={rgx:function(e,t){for(var i,s,a,c,A,d,u=0;u<t.length&&!A;){var E=t[u],l=t[u+1];for(i=s=0;i<E.length&&!A;)if(A=E[i++].exec(e))for(a=0;a<l.length;a++)d=A[++s],typeof(c=l[a])===o&&c.length>0?2==c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:3==c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=d?d.replace(c[1],c[2]):n:this[c[0]]=d?c[1].call(this,d,c[2]):n:4==c.length&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):n):this[c]=d||n;u+=2}},str:function(e,t){for(var i in t)if(typeof t[i]===o&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(f.has(t[i][r],e))return"?"===i?n:i}else if(f.has(t[i],e))return"?"===i?n:i;return e}},C={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},T={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[u,[c,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[c,u],[/opios[\/\s]+([\w\.]+)/i],[u,[c,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[u,[c,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,u],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[u,[c,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[u,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[u,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[c,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[u,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[u,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],u],[/focus\/([\w\.]+)/i],[u,[c,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[u,[c,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[u,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[c,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[u,[c,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[u,[c,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[c,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],u],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],u],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[c,u],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[c],[/;fbav\/([\w\.]+);/i],[u,[c,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[c,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[c,u],[/\bgsa\/([\w\.]+)\s.*safari\//i],[u,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[u,[c,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],u],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[u,[c,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[c,u],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[u,[c,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[u,c],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[c,[u,R.str,C.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[c,u],[/(navigator|netscape)\/([\w\.-]+)/i],[[c,"Netscape"],u],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[u,[c,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[c,u]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,f.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[E,/ower/,"",f.lowerize]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,f.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[a,[d,"Samsung"],[A,p]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[a,[d,"Samsung"],[A,h]],[/\((ip(?:hone|od)[\s\w]*);/i],[a,[d,"Apple"],[A,h]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[d,"Apple"],[A,p]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[a,[d,"Huawei"],[A,p]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[a,[d,"Huawei"],[A,h]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[a,/_/g," "],[d,"Xiaomi"],[A,h]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[a,/_/g," "],[d,"Xiaomi"],[A,p]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[a,[d,"OPPO"],[A,h]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[a,[d,"Vivo"],[A,h]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[a,[d,"Realme"],[A,h]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[a,[d,"Motorola"],[A,h]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[d,"Motorola"],[A,p]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[a,[d,"LG"],[A,p]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[a,[d,"LG"],[A,h]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[a,[d,"Lenovo"],[A,p]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[a,/_/g," "],[d,"Nokia"],[A,h]],[/droid.+;\s(pixel\sc)[\s)]/i],[a,[d,"Google"],[A,p]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[a,[d,"Google"],[A,h]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[d,"Sony"],[A,h]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[a,"Xperia Tablet"],[d,"Sony"],[A,p]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[a,[d,"OnePlus"],[A,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[a,[d,"Amazon"],[A,p]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[a,"Fire Phone"],[d,"Amazon"],[A,h]],[/\((playbook);[\w\s\),;-]+(rim)/i],[a,d,[A,p]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[a,[d,"BlackBerry"],[A,h]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[a,[d,"ASUS"],[A,p]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[a,[d,"ASUS"],[A,h]],[/(nexus\s9)/i],[a,[d,"HTC"],[A,p]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[d,[a,/_/g," "],[A,h]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[a,[d,"Acer"],[A,p]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[a,[d,"Meizu"],[A,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[d,a,[A,h]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[d,a,[A,p]],[/\s(surface\sduo)\s/i],[a,[d,"Microsoft"],[A,p]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[a,[d,"Fairphone"],[A,h]],[/\s(u304aa)\sbuild/i],[a,[d,"AT&T"],[A,h]],[/sie-(\w*)/i],[a,[d,"Siemens"],[A,h]],[/[;\/]\s?(rct\w+)\sbuild/i],[a,[d,"RCA"],[A,p]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[a,[d,"Dell"],[A,p]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[a,[d,"Verizon"],[A,p]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[a,[d,"Barnes & Noble"],[A,p]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[a,[d,"NuVision"],[A,p]],[/;\s(k88)\sbuild/i],[a,[d,"ZTE"],[A,p]],[/;\s(nx\d{3}j)\sbuild/i],[a,[d,"ZTE"],[A,h]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[a,[d,"Swiss"],[A,h]],[/[;\/]\s?(zur\d{3})\sbuild/i],[a,[d,"Swiss"],[A,p]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[a,[d,"Zeki"],[A,p]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[d,"Dragon Touch"],a,[A,p]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[a,[d,"Insignia"],[A,p]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[a,[d,"NextBook"],[A,p]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[d,"Voice"],a,[A,h]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[d,"LvTel"],a,[A,h]],[/;\s(ph-1)\s/i],[a,[d,"Essential"],[A,h]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[a,[d,"Envizen"],[A,p]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[a,[d,"MachSpeed"],[A,p]],[/[;\/]\s?tu_(1491)\sbuild/i],[a,[d,"Rotor"],[A,p]],[/(shield[\w\s]+)\sbuild/i],[a,[d,"Nvidia"],[A,p]],[/(sprint)\s(\w+)/i],[d,a,[A,h]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[d,"Microsoft"],[A,h]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[d,"Zebra"],[A,p]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[d,"Zebra"],[A,h]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[d,a,[A,l]],[/droid.+;\s(shield)\sbuild/i],[a,[d,"Nvidia"],[A,l]],[/(playstation\s[345portablevi]+)/i],[a,[d,"Sony"],[A,l]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[a,[d,"Microsoft"],[A,l]],[/smart-tv.+(samsung)/i],[d,[A,_]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[d,"Samsung"],[A,_]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[d,"LG"],[A,_]],[/(apple)\s?tv/i],[d,[a,"Apple TV"],[A,_]],[/crkey/i],[[a,"Chromecast"],[d,"Google"],[A,_]],[/droid.+aft([\w])(\sbuild\/|\))/i],[a,[d,"Amazon"],[A,_]],[/\(dtv[\);].+(aquos)/i],[a,[d,"Sharp"],[A,_]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[d,f.trim],[a,f.trim],[A,_]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[A,_]],[/((pebble))app\/[\d\.]+\s/i],[d,a,[A,I]],[/droid.+;\s(glass)\s\d/i],[a,[d,"Google"],[A,I]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[a,[d,"Zebra"],[A,I]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[d,[A,g]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[a,[A,h]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[a,[A,p]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[A,f.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[d,"Generic"]],[/(phone)/i],[[A,h]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[u,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[c,u],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,c]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[c,u],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[c,[u,R.str,C.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[c,"Windows"],[u,R.str,C.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[c,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[c,"Mac OS"],[u,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[c,u],[/\(bb(10);/i],[u,[c,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[u,[c,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[c,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[u,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[u,[c,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[c,"Chromium OS"],u],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[c,u],[/(sunos)\s?([\w\.\d]*)/i],[[c,"Solaris"],u],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[c,u]]},m=function(t,i){if("object"==typeof t&&(i=t,t=n),!(this instanceof m))return new m(t,i).getResult();var r=t||(void 0!==e&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),o=i?f.extend(T,i):T;return this.getBrowser=function(){var e={name:n,version:n};return R.rgx.call(e,r,o.browser),e.major=f.major(e.version),e},this.getCPU=function(){var e={architecture:n};return R.rgx.call(e,r,o.cpu),e},this.getDevice=function(){var e={vendor:n,model:n,type:n};return R.rgx.call(e,r,o.device),e},this.getEngine=function(){var e={name:n,version:n};return R.rgx.call(e,r,o.engine),e},this.getOS=function(){var e={name:n,version:n};return R.rgx.call(e,r,o.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===s&&e.length>255?f.trim(e,255):e,this},this.setUA(r),this};m.VERSION="0.7.28",m.BROWSER={NAME:c,MAJOR:"major",VERSION:u},m.CPU={ARCHITECTURE:E},m.DEVICE={MODEL:a,VENDOR:d,TYPE:A,CONSOLE:l,MOBILE:h,SMARTTV:_,TABLET:p,WEARABLE:I,EMBEDDED:g},m.ENGINE={NAME:c,VERSION:u},m.OS={NAME:c,VERSION:u},t.exports&&(i=t.exports=m),i.UAParser=m;var S=void 0!==e&&(e.jQuery||e.Zepto);if(S&&!S.ua){var O=new m;S.ua=O.getResult(),S.ua.get=function(){return O.getUA()},S.ua.set=function(e){O.setUA(e);var t=O.getResult();for(var i in t)S.ua[i]=t[i]}}}("object"==typeof window?window:e)}(vy,vy.exports);const Ny=new(0,vy.exports);let yy=Ny.getResult();function Dy(e){return e&&Ny.setUA(e),yy=Ny.getResult(),{name:wy(yy),version:by(yy),os:Ly(yy),osVersion:yy.os.version}}function wy(e){if("Blink"===e.engine.name&&"WeChat"!==e.browser.name)return Oy.CHROME;switch(e.browser.name){case"Chrome Headless":case"Chrome":case"Chromium":return Oy.CHROME;case"Safari":case"Mobile Safari":return Oy.SAFARI;case"Edge":return Oy.EDGE;case"Firefox":return Oy.FIREFOX;case"QQBrowser":return Oy.QQ;case"Opera":return Oy.OPERA;case"WeChat":return Oy.WECHAT;default:return e.browser.name||""}}function by(e){let t;return t="Blink"===e.engine.name?e.engine.version||"":e.browser.version||"",t.split(".")[0]}function Ly(e){return"Windows"===e.os.name?e.os.version?e.os.name+" "+e.os.version:e.os.name:e.os.name||""}function Py(){return Dy().os}function ky(){const e=Dy();return!!("WebKit"===yy.engine.name&&e.os===Sy.MAC_OS&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0&&e.name!==Oy.SAFARI||Vy()&&e.name!==Oy.SAFARI)}function My(){return Dy().name===Oy.CHROME}function Uy(){return Dy().name===Oy.SAFARI}function By(){return Dy().name===Oy.FIREFOX}function Vy(){return Dy().os===Sy.IOS}function Qy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])}function xy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])&&0===Number(t[1])}function Fy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])&&Number(t[1])>=1}function Gy(){const e=Dy();if(e.os!==Sy.IOS||!e.osVersion)return!1;const t=e.osVersion.split(".");return 15===Number(t[0])&&Number(t[1])>=2}function jy(){return Uy()&&navigator.maxTouchPoints>0}function Yy(){return Dy().name===Oy.WECHAT}function Hy(){return window.navigator.appVersion&&null!==window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)[1]<=35}function Ky(){const e=Dy();return e.name!==Oy.EDGE&&e.name!==Oy.SAFARI&&!!navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]./i)}function Wy(){return Dy().os===Sy.ANDROID}var Jy={exports:{}},qy=Bu,Xy=xc,zy=cu.f;qy({target:"Object",stat:!0,forced:Object.defineProperty!==zy,sham:!Xy},{defineProperty:zy});var Zy=hA.Object,$y=Jy.exports=function(e,t,i){return Zy.defineProperty(e,t,i)};Zy.defineProperty.sham&&($y.sham=!0);var eD=Jy.exports;function tD(e,t,i){return t in e?eD(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var iD={exports:{}},nD=function(e,t){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(t,i)}},rD=nD,oD=Object.prototype.toString;function sD(e){return"[object Array]"===oD.call(e)}function aD(e){return null!==e&&"object"==typeof e}function cD(e){return"[object Function]"===oD.call(e)}function AD(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),sD(e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}var dD={isArray:sD,isArrayBuffer:function(e){return"[object ArrayBuffer]"===oD.call(e)},isBuffer:function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:aD,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===oD.call(e)},isFile:function(e){return"[object File]"===oD.call(e)},isBlob:function(e){return"[object Blob]"===oD.call(e)},isFunction:cD,isStream:function(e){return aD(e)&&cD(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:AD,merge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]=i}for(var n=0,r=arguments.length;n<r;n++)AD(arguments[n],i);return t},deepMerge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]="object"==typeof i?e({},i):i}for(var n=0,r=arguments.length;n<r;n++)AD(arguments[n],i);return t},extend:function(e,t,i){return AD(t,(function(t,n){e[n]=i&&"function"==typeof t?rD(t,i):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}},uD=dD;function ED(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var lD=function(e,t,i){if(!t)return e;var n;if(i)n=i(t);else if(uD.isURLSearchParams(t))n=t.toString();else{var r=[];uD.forEach(t,(function(e,t){null!=e&&(uD.isArray(e)?t+="[]":e=[e],uD.forEach(e,(function(e){uD.isDate(e)?e=e.toISOString():uD.isObject(e)&&(e=JSON.stringify(e)),r.push(ED(t)+"="+ED(e))})))})),n=r.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},hD=dD;function pD(){this.handlers=[]}pD.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},pD.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},pD.prototype.forEach=function(e){hD.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var _D=pD,ID=dD,gD=function(e){return!(!e||!e.__CANCEL__)},fD=dD,RD=function(e,t,i,n,r){return function(e,t,i,n,r){return e.config=t,i&&(e.code=i),e.request=n,e.response=r,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,i,n,r)},CD=RD,TD=dD,mD=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],SD=dD,OD=SD.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function n(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=n(window.location.href),function(t){var i=SD.isString(t)?n(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0},vD=dD,ND=vD.isStandardBrowserEnv()?{write:function(e,t,i,n,r,o){var s=[];s.push(e+"="+encodeURIComponent(t)),vD.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),vD.isString(n)&&s.push("path="+n),vD.isString(r)&&s.push("domain="+r),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},yD=dD,DD=lD,wD=OD,bD=RD,LD=dD,PD=function(e,t){fD.forEach(e,(function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])}))},kD={"Content-Type":"application/x-www-form-urlencoded"};function MD(e,t){!LD.isUndefined(e)&&LD.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var UD,BD={adapter:(("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)||"undefined"!=typeof XMLHttpRequest)&&(UD=function(e){return new Promise((function(t,i){var n=e.data,r=e.headers;yD.isFormData(n)&&delete r["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",a=e.auth.password||"";r.Authorization="Basic "+btoa(s+":"+a)}if(o.open(e.method.toUpperCase(),DD(e.url,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in o?function(e){var t,i,n,r={};return e?(TD.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=TD.trim(e.substr(0,n)).toLowerCase(),i=TD.trim(e.substr(n+1)),t){if(r[t]&&mD.indexOf(t)>=0)return;r[t]="set-cookie"===t?(r[t]?r[t]:[]).concat([i]):r[t]?r[t]+", "+i:i}})),r):r}(o.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:n,config:e,request:o};(function(e,t,i){var n=i.config.validateStatus;!n||n(i.status)?e(i):t(CD("Request failed with status code "+i.status,i.config,null,i.request,i))})(t,i,r),o=null}},o.onabort=function(){o&&(i(bD("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){i(bD("Network Error",e,null,o)),o=null},o.ontimeout=function(){i(bD("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",o)),o=null},yD.isStandardBrowserEnv()){var c=ND,A=(e.withCredentials||wD(e.url))&&e.xsrfCookieName?c.read(e.xsrfCookieName):void 0;A&&(r[e.xsrfHeaderName]=A)}if("setRequestHeader"in o&&yD.forEach(r,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete r[t]:o.setRequestHeader(t,e)})),e.withCredentials&&(o.withCredentials=!0),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){o&&(o.abort(),i(e),o=null)})),void 0===n&&(n=null),o.send(n)}))}),UD),transformRequest:[function(e,t){return PD(t,"Accept"),PD(t,"Content-Type"),LD.isFormData(e)||LD.isArrayBuffer(e)||LD.isBuffer(e)||LD.isStream(e)||LD.isFile(e)||LD.isBlob(e)?e:LD.isArrayBufferView(e)?e.buffer:LD.isURLSearchParams(e)?(MD(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):LD.isObject(e)?(MD(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};LD.forEach(["delete","get","head"],(function(e){BD.headers[e]={}})),LD.forEach(["post","put","patch"],(function(e){BD.headers[e]=LD.merge(kD)}));var VD=BD,QD=dD,xD=function(e,t,i){return ID.forEach(i,(function(i){e=i(e,t)})),e},FD=gD,GD=VD;function jD(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var YD=dD,HD=function(e,t){t=t||{};var i={};return YD.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(i[e]=t[e])})),YD.forEach(["headers","auth","proxy"],(function(n){YD.isObject(t[n])?i[n]=YD.deepMerge(e[n],t[n]):void 0!==t[n]?i[n]=t[n]:YD.isObject(e[n])?i[n]=YD.deepMerge(e[n]):void 0!==e[n]&&(i[n]=e[n])})),YD.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==t[n]?i[n]=t[n]:void 0!==e[n]&&(i[n]=e[n])})),i},KD=dD,WD=lD,JD=_D,qD=function(e){return jD(e),e.baseURL&&!function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}(e.url)&&(e.url=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e.baseURL,e.url)),e.headers=e.headers||{},e.data=xD(e.data,e.headers,e.transformRequest),e.headers=QD.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),QD.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||GD.adapter)(e).then((function(t){return jD(e),t.data=xD(t.data,t.headers,e.transformResponse),t}),(function(t){return FD(t)||(jD(e),t&&t.response&&(t.response.data=xD(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},XD=HD;function zD(e){this.defaults=e,this.interceptors={request:new JD,response:new JD}}zD.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=XD(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[qD,void 0],i=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)i=i.then(t.shift(),t.shift());return i},zD.prototype.getUri=function(e){return e=XD(this.defaults,e),WD(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},KD.forEach(["delete","get","head","options"],(function(e){zD.prototype[e]=function(t,i){return this.request(KD.merge(i||{},{method:e,url:t}))}})),KD.forEach(["post","put","patch"],(function(e){zD.prototype[e]=function(t,i,n){return this.request(KD.merge(n||{},{method:e,url:t,data:i}))}}));var ZD=zD;function $D(e){this.message=e}$D.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},$D.prototype.__CANCEL__=!0;var ew=$D,tw=ew;function iw(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var i=this;e((function(e){i.reason||(i.reason=new tw(e),t(i.reason))}))}iw.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},iw.source=function(){var e;return{token:new iw((function(t){e=t})),cancel:e}};var nw=iw,rw=dD,ow=nD,sw=ZD,aw=HD;function cw(e){var t=new sw(e),i=ow(sw.prototype.request,t);return rw.extend(i,sw.prototype,t),rw.extend(i,t),i}var Aw=cw(VD);Aw.Axios=sw,Aw.create=function(e){return cw(aw(Aw.defaults,e))},Aw.Cancel=ew,Aw.CancelToken=nw,Aw.isCancel=gD,Aw.all=function(e){return Promise.all(e)},Aw.spread=function(e){return function(t){return e.apply(null,t)}},iD.exports=Aw,iD.exports.default=Aw;var dw=iD.exports;class uw{constructor(e){tD(this,"logger",void 0),tD(this,"prefixLists",[]),this.logger=e}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.debug(...this.prefixLists,...t)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.info(...this.prefixLists,...t)}warning(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.warning(...this.prefixLists,...t)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.logger.error(...this.prefixLists,...t)}prefix(e){return this.prefixLists.push(e),this}popPrefix(){return this.prefixLists.pop(),this}}class Ew{constructor(){tD(this,"_events",{}),tD(this,"addListener",this.on)}getListeners(e){return this._events[e]?this._events[e].map((e=>e.listener)):[]}on(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!1})}once(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!0})}off(e,t){if(!this._events[e])return;const i=this._events[e],n=this._indexOfListener(i,t);-1!==n&&i.splice(n,1),0===this._events[e].length&&delete this._events[e]}removeAllListeners(e){e?delete this._events[e]:this._events={}}emit(e){this._events[e]||(this._events[e]=[]);const t=this._events[e].map((e=>e));for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];for(let i=0;i<t.length;i+=1){const r=t[i];r.once&&this.off(e,r.listener),r.listener.apply(this,n||[])}}_indexOfListener(e,t){let i=e.length;for(;i--;)if(e[i].listener===t)return i;return-1}}const lw=new class extends Ew{reportLogUploadError(e){this.emit("REPORT_LOG_UPLOAD",e)}};let hw;!function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.TIMEOUT="TIMEOUT",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_READABLE="NOT_READABLE",e.NOT_SUPPORTED="NOT_SUPPORTED",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORTED="OPERATION_ABORTED",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",e.EXCHANGE_SDP_FAILED="EXCHANGE_SDP_FAILED",e.NETWORK_ERROR="NETWORK_ERROR",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",e.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",e.ELECTRON_IS_NULL="ELECTRON_IS_NULL",e.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",e.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",e.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",e.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",e.PERMISSION_DENIED="PERMISSION_DENIED",e.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",e.TRACK_IS_DISABLED="TRACK_IS_DISABLED",e.GET_VIDEO_ELEMENT_VISIBLE_ERROR="GET_VIDEO_ELEMENT_VISIBLE_ERROR",e.SHARE_AUDIO_NOT_ALLOWED="SHARE_AUDIO_NOT_ALLOWED",e.LOW_STREAM_ENCODING_ERROR="LOW_STREAM_ENCODING_ERROR",e.SET_ENCODING_PARAMETER_ERROR="SET_ENCODING_PARAMETER_ERROR",e.TRACK_STATE_UNREACHABLE="TRACK_STATE_UNREACHABLE",e.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",e.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",e.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",e.VOID_GATEWAY_ADDRESS="VOID_GATEWAY_ADDRESS",e.UID_CONFLICT="UID_CONFLICT",e.MULTI_UNILBS_RESPONSE_ERROR="MULTI_UNILBS_RESPONSE_ERROR",e.UPDATE_TICKET_FAILED="UPDATE_TICKET_FAILED",e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.INVALID_TRACK="INVALID_TRACK",e.SENDER_NOT_FOUND="SENDER_NOT_FOUND",e.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",e.SET_ANSWER_FAILED="SET_ANSWER_FAILED",e.ICE_FAILED="ICE_FAILED",e.PC_CLOSED="PC_CLOSED",e.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",e.GET_LOCAL_CAPABILITIES_FAILED="GET_LOCAL_CAPABILITIES_FAILED",e.GET_LOCAL_CONNECTION_PARAMS_FAILED="GET_LOCAL_CONNECTION_PARAMS_FAILED",e.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",e.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.NO_ICE_CANDIDATE="NO_ICE_CANDIDATE",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",e.EXIST_DISABLED_VIDEO_TRACK="EXIST_DISABLED_VIDEO_TRACK",e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.REMOTE_USER_IS_NOT_PUBLISHED="REMOTE_USER_IS_NOT_PUBLISHED",e.CUSTOM_REPORT_SEND_FAILED="CUSTOM_REPORT_SEND_FAILED",e.CUSTOM_REPORT_FREQUENCY_TOO_HIGH="CUSTOM_REPORT_FREQUENCY_TOO_HIGH",e.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",e.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",e.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",e.WS_ABORT="WS_ABORT",e.WS_DISCONNECT="WS_DISCONNECT",e.WS_ERR="WS_ERR",e.LIVE_STREAMING_TASK_CONFLICT="LIVE_STREAMING_TASK_CONFLICT",e.LIVE_STREAMING_INVALID_ARGUMENT="LIVE_STREAMING_INVALID_ARGUMENT",e.LIVE_STREAMING_INTERNAL_SERVER_ERROR="LIVE_STREAMING_INTERNAL_SERVER_ERROR",e.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED="LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED",e.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED="LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED",e.LIVE_STREAMING_CDN_ERROR="LIVE_STREAMING_CDN_ERROR",e.LIVE_STREAMING_INVALID_RAW_STREAM="LIVE_STREAMING_INVALID_RAW_STREAM",e.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT="LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT",e.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE="LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE",e.LIVE_STREAMING_WARN_FREQUENT_REQUEST="LIVE_STREAMING_WARN_FREQUENT_REQUEST",e.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",e.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE",e.METADATA_OUT_OF_RANGE="METADATA_OUT_OF_RANGE",e.LOCAL_AEC_ERROR="LOCAL_AEC_ERROR",e.INVALID_PLUGIN="INVALID_PLUGIN",e.DISCONNECT_P2P="DISCONNECT_P2P",e.INIT_WEBSOCKET_TIMEOUT="INIT_WEBSOCKET_TIMEOUT"}(hw||(hw={}));class pw extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;super(t),tD(this,"code",void 0),tD(this,"message",void 0),tD(this,"data",void 0),tD(this,"name","AgoraRTCException"),this.code=e,this.message="AgoraRTCError ".concat(this.code,": ").concat(t),this.data=i}toString(){return this.data?"data: ".concat(JSON.stringify(this.data),"\n").concat(this.stack):"".concat(this.stack)}print(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"error";return"error"===e&&mw.error(this.toString()),"warning"===e&&mw.warning(this.toString()),this}throw(){throw this.print(),this}}const _w={timeout:500,timeoutFactor:1.5,maxRetryCount:1/0,maxRetryTimeout:1e4};function Iw(e,t){const i=Math.floor(t.timeout*Math.pow(t.timeoutFactor,e));return Math.min(t.maxRetryTimeout,i)}function gw(e,t,i,n){const r=Object.assign({},_w,n);let o=r.timeout;const s=async()=>{await function(e){return new Mm((t=>{window.setTimeout(t,e)}))}(o),o*=r.timeoutFactor,o=Math.min(r.maxRetryTimeout,o)};let a=!1;const c=new Mm((async(n,o)=>{t=t||(()=>!1),i=i||(()=>!0);for(let c=0;c<r.maxRetryCount;c+=1){if(a)return o(new pw(hw.OPERATION_ABORTED));try{const i=await e();if(!t(i,c))return n(i);if(c+1===r.maxRetryCount)return n(i);await s()}catch(e){if(!i(e,c))return o(e);if(c+1===r.maxRetryCount)return o(e);await s()}}}));return c.cancel=()=>a=!0,c}function fw(){const e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()}const Rw={DEBUG:0,INFO:1,WARNING:2,ERROR:3,NONE:4},Cw=Date.now(),Tw=e=>{for(const t in Rw)if(Object.prototype.hasOwnProperty.call(Rw,t)&&Rw[t]===e)return t;return"DEFAULT"},mw=new class{constructor(){tD(this,"proxyServerURL",void 0),tD(this,"logLevel",Rw.DEBUG),tD(this,"uploadState","collecting"),tD(this,"uploadLogWaitingList",[]),tD(this,"uploadLogUploadingList",[]),tD(this,"uploadErrorCount",0),tD(this,"currentLogID",0),tD(this,"url",void 0),tD(this,"extLog",((e,t)=>{this.appendLogToWaitingList(e,t)}))}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.DEBUG].concat(t);this.log.apply(this,n)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.INFO].concat(t);this.log.apply(this,n)}warning(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.WARNING].concat(t);this.log.apply(this,n)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.ERROR].concat(t);this.log.apply(this,n)}upload(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[Rw.DEBUG].concat(t);this.uploadLog.apply(this,n)}setLogLevel(e){e=Math.min(Math.max(0,e),4),this.logLevel=e}enableLogUpload(){ab("UPLOAD_LOG",!0)}disableLogUpload(){ab("UPLOAD_LOG",!1),this.uploadLogUploadingList=[],this.uploadLogWaitingList=[]}setProxyServer(e){this.proxyServerURL=e}prefix(e){return new uw(this).prefix(e)}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(Date.now()-Cw<100)return void setTimeout((()=>{this.log(...t)}),Date.now()-Cw);const n=Math.max(0,Math.min(4,t[0]));if(t[0]=fw()+" Agora-SDK [".concat(Tw(n),"]:"),this.appendLogToWaitingList(n,t),n<this.logLevel)return;const r=fw()+" %cAgora-SDK [".concat(Tw(n),"]:");let o=[];if(!cb("USE_NEW_LOG"))switch(n){case Rw.DEBUG:o=[r,"color: #64B5F6;"].concat(t.slice(1)),console.log.apply(console,o);break;case Rw.INFO:o=[r,"color: #1E88E5; font-weight: bold;"].concat(t.slice(1)),console.log.apply(console,o);break;case Rw.WARNING:o=[r,"color: #FB8C00; font-weight: bold;"].concat(t.slice(1)),console.warn.apply(console,o);break;case Rw.ERROR:o=[r,"color: #B00020; font-weight: bold;"].concat(t.slice(1)),console.error.apply(console,o)}}uploadLog(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(Date.now()-Cw<100)return void setTimeout((()=>{this.uploadLog(...t)}),Date.now()-Cw);const n=Math.max(0,Math.min(4,t[0]));t[0]=fw()+" Agora-SDK [".concat(Tw(n),"]:"),this.appendLogToWaitingList(n,t)}appendLogToWaitingList(e){if(!cb("UPLOAD_LOG"))return;let t="";for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];n.forEach((e=>{"object"==typeof e&&(e=JSON.stringify(e)),t+="".concat(e," ")})),this.uploadLogWaitingList.push({payload_str:t,log_level:e,log_item_id:this.currentLogID++}),"uploading"===this.uploadState&&0===this.uploadLogUploadingList.length&&this.uploadLogInterval()}startUpload(){this.uploadState="uploading",0===this.uploadLogUploadingList.length&&this.uploadLogInterval()}async uploadLogs(){const e=this.uploadLogUploadingList,t={sdk_version:Xw,process_id:cb("PROCESS_ID"),payload:JSON.stringify(e)};return gw((async()=>{const e=await dw.post(this.url||(this.proxyServerURL?"https://".concat(this.proxyServerURL,"/ls/?h=").concat(cb("LOG_UPLOAD_SERVER"),"&p=443&d=upload/v1"):"https://".concat(cb("LOG_UPLOAD_SERVER"),"/upload/v1")),t,{responseType:"text"});if("OK"!==e.data){const t=new Error("unexpected upload log response");throw t.response=e,t}}),(()=>(this.uploadLogUploadingList=[],!1)),(e=>(e.response?lw.reportLogUploadError({status:e.response.status,data:e.response.data,headers:e.response.headers,message:e.message}):e.request?lw.reportLogUploadError({status:e.request.status,message:e.message}):lw.reportLogUploadError({status:-1,message:e.message}),!0)),{timeout:2e3,maxRetryTimeout:2e4})}uploadLogInterval(){0===this.uploadLogUploadingList.length&&0===this.uploadLogWaitingList.length||(0===this.uploadLogUploadingList.length&&(this.uploadLogUploadingList=this.uploadLogWaitingList.splice(0,10)),this.uploadLogs().then((()=>{this.uploadErrorCount=0,this.uploadLogWaitingList.length>0&&window.setTimeout((()=>this.uploadLogInterval()),3e3)})).catch((e=>{this.uploadErrorCount+=1,this.uploadErrorCount<2?window.setTimeout((()=>this.uploadLogInterval()),200):window.setTimeout((()=>this.uploadLogInterval()),1e3)})))}},Sw={debug:console.log,info:console.log,warning:console.warn,error:console.error},Ow={debug:"color: #64B5F6;",info:"color: #1E88E5; font-weight: bold;",warning:"color: #FB8C00; font-weight: bold;",error:"color: #B00020; font-weight: bold;"},vw={debug:0,info:1,warning:2,error:3},Nw=[];let yw,Dw=0,ww=0,bw=!1;function Lw(){const e=new Date;return[e.getTime(),e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()]}function Pw(e){if(!cb("UPLOAD_LOG"))return;let t;switch(e.type){case TL.MISC:t=[e.timestamp,e.level,e.type,e.module,e.instanceId,[e.msg]];break;case TL.INTERNAL_EVENT:case TL.PUBLIC_EVENT:case TL.WEB_EVENT:t=[e.timestamp,e.level,e.type,e.module,e.instanceId,[e.event,e.msg]];break;case TL.INTERNAL_API:case TL.PUBLIC_API:case TL.WEB_API:t=[e.timestamp,e.level,e.type,e.module,e.instanceId,[e.api,e.args,e.result]]}Nw.push(t)}function kw(e,t){const[i,n]=Lw(),r="warning",o="".concat(n," %cAgora-SDK [").concat(r,"] [INTERNAL API]:"),s={[TL.WEB_API]:"logWebAPI",[TL.PUBLIC_API]:"logPublicAPI",[TL.INTERNAL_API]:"logInternalAPI",[TL.WEB_EVENT]:"logWebEvent",[TL.PUBLIC_EVENT]:"logPublicEvent",[TL.INTERNAL_EVENT]:"logInternalEvent",[TL.MISC]:"logMisc"}[e],a=[o,Ow.warning,"Log.".concat(s),t];cb("USE_NEW_LOG")&&(Uw(r)&&Sw.warning.apply(console,a),Pw({timestamp:i,level:r,module:"Log",instanceId:void 0,type:TL.INTERNAL_API,api:s,args:void 0,result:t.toString()}))}function Mw(e){if(Array.isArray(e)){let[t,i]=e;return t||(t="Global"),{module:t,instanceId:i}}let t,i;if("string"!=typeof e.__moduleName)throw new Error("Cannot get __moduleName from log instance.");t=e.__moduleName;try{i=e.__instanceId}catch(e){throw new Error("Cannot get __instanceId from log instance.")}return{module:t,instanceId:i}}function Uw(e){return vw[e]>=ww}function Bw(e,t,i,n,r,o){if(e===TL.PUBLIC_API||e===TL.WEB_API||e===TL.INTERNAL_API)try{const{module:s,instanceId:a}=Mw(i);r=r&&JSON.stringify(r),o=o instanceof Error?o.toString():o&&JSON.stringify(o);const[c,A]=Lw(),d=["".concat(A," %cAgora-SDK [").concat(t,"] [").concat({[TL.PUBLIC_API]:"PUBLIC API",[TL.WEB_API]:"WEB API",[TL.INTERNAL_API]:"INTERNAL API"}[e],"]:"),Ow[t],"".concat(s).concat(a?"<".concat(a,">"):"",".").concat(n),r,o];cb("USE_NEW_LOG")&&(Uw(t)&&Sw[t].apply(console,d),Pw({timestamp:c,level:t,module:s,instanceId:a,type:e,api:n,args:r,result:o}))}catch(t){kw(e,t)}}function Vw(e,t,i,n,r){if(e===TL.WEB_EVENT||e===TL.INTERNAL_EVENT||e===TL.PUBLIC_EVENT)try{const{module:o,instanceId:s}=Mw(i);"string"!=typeof r&&(r=r instanceof Error?r.toString():JSON.stringify(r));const[a,c]=Lw(),A=["".concat(c," %cAgora-SDK [").concat(t,"] [").concat({[TL.WEB_EVENT]:"WEB EVENT",[TL.PUBLIC_EVENT]:"PUBLIC EVENT",[TL.INTERNAL_EVENT]:"INTERNAL EVENT"}[e],"]:"),Ow[t],"".concat(o).concat(s?"<".concat(s,">"):"",".on(").concat(n,")"),r||""];cb("USE_NEW_LOG")&&(Uw(t)&&Sw[t].apply(console,A),Pw({timestamp:a,level:t,module:o,instanceId:s,type:e,event:n,msg:r}))}catch(t){kw(e,t)}}function Qw(e){yw=e}function xw(e,t,i){try{const{module:n,instanceId:r}=Mw(t),[o,s]=Lw(),a=["".concat(s," %cAgora-SDK [").concat(e,"] [MISC]:"),Ow[e],"".concat(n).concat(r?"<".concat(r,">"):""),'"'.concat(i,'"')];cb("USE_NEW_LOG")&&(Uw(e)&&Sw[e].apply(console,a),Pw({timestamp:o,level:e,module:n,instanceId:r,type:TL.MISC,msg:i}))}catch(e){Yw("warning",["log"],"logMisc",void 0,e)}}function Fw(e,t,i,n){Vw(TL.INTERNAL_EVENT,e,t,i,n)}function Gw(e,t,i,n){Vw(TL.PUBLIC_EVENT,e,t,i,n)}function jw(e,t,i,n){Vw(TL.WEB_EVENT,e,t,i,n)}function Yw(e,t,i,n,r){Bw(TL.INTERNAL_API,e,t,i,n,r)}function Hw(e,t,i,n,r){Bw(TL.WEB_API,e,t,i,n,r)}function Kw(e,t,i,n,r){Bw(TL.PUBLIC_API,e,t,i,n,r)}function Ww(e,t){return function(i){return class extends i{get __moduleName(){return e}get __instanceId(){if(t){if("function"==typeof this[t])return this[t]();{const e=t.split(".");return e.length>0?dE(e).call(e,((e,t)=>{try{return e?e[t]:e}catch(e){return}}),this):this[t]}}}}}}async function Jw(e){if(!e&&bw)return;if(bw=!0,!cb("UPLOAD_LOG"))return void setTimeout((()=>Jw(!0)),5e3);if(0===Nw.length)return void setTimeout((()=>Jw(!0)),3e3);const t=Nw.slice(0,10),i={sdk_version:Xw,log_version:cb("LOG_VERSION"),process_id:cb("PROCESS_ID"),index:Dw,logs:JSON.stringify(t)};await gw((async()=>{const e=await dw.post(yw?"https://".concat(yw,"/ls/?h=").concat(cb("LOG_UPLOAD_SERVER"),"&p=443&d=upload/v1"):"https://".concat(cb("LOG_UPLOAD_SERVER"),"/upload/v1"),i,{responseType:"text"});if("OK"!==e.data)throw new Error("Log service response error ".concat(e.data));return e}),void 0,void 0,{timeout:3e3,maxRetryTimeout:1e4}),Nw.splice(0,10),Dw+=t.length,setTimeout((()=>Jw(!0)),3e3)}const qw="v4.11.0-0-g961abf54(3/31/2022, 5:02:17 PM)",Xw=function(e){if(e.match(/[0-9]+\.[0-9]+\.[0-9]+$/))return e;const t=e.match(/([0-9]+\.[0-9]+\.[0-9]+)\-alpha\.([0-9]+)/);if(t&&t[1]&&t[2]){const e=t[1],i=t[2];return"".concat(e,".").concat(i)}const i=e.match(/([0-9]+\.[0-9]+\.[0-9]+)\-special\.([0-9]+)/);if(i&&i[1]&&i[2]){const e=i[1],t=i[2];return"".concat(e,".").concat(100*(Number(t)+1))}return"4.0.0.999"}("4.11.0"),zw=function(){try{return!0===JSON.parse("true")}catch(e){return!0}}(),Zw={username:"test",password:"111111",turnServerURL:"",tcpport:3433,udpport:3478,forceturn:!1},$w={"90p":Eb(160,90),"90p_1":Eb(160,90),"120p":Eb(160,120,15,30,65),"120p_1":Eb(160,120,15,30,65),"120p_3":Eb(120,120,15,30,50),"120p_4":Eb(212,120),"180p":Eb(320,180,15,30,140),"180p_1":Eb(320,180,15,30,140),"180p_3":Eb(180,180,15,30,100),"180p_4":Eb(240,180,15,30,120),"240p":Eb(320,240,15,40,200),"240p_1":Eb(320,240,15,40,200),"240p_3":Eb(240,240,15,40,140),"240p_4":Eb(424,240,15,40,220),"360p":Eb(640,360,15,80,400),"360p_1":Eb(640,360,15,80,400),"360p_3":Eb(360,360,15,80,260),"360p_4":Eb(640,360,30,80,600),"360p_6":Eb(360,360,30,80,400),"360p_7":Eb(480,360,15,80,320),"360p_8":Eb(480,360,30,80,490),"360p_9":Eb(640,360,15,80,800),"360p_10":Eb(640,360,24,80,800),"360p_11":Eb(640,360,24,80,1e3),"480p":Eb(640,480,15,100,500),"480p_1":Eb(640,480,15,100,500),"480p_2":Eb(640,480,30,100,1e3),"480p_3":Eb(480,480,15,100,400),"480p_4":Eb(640,480,30,100,750),"480p_6":Eb(480,480,30,100,600),"480p_8":Eb(848,480,15,100,610),"480p_9":Eb(848,480,30,100,930),"480p_10":Eb(640,480,10,100,400),"720p":Eb(1280,720,15,120,1130),"720p_1":Eb(1280,720,15,120,1130),"720p_2":Eb(1280,720,30,120,2e3),"720p_3":Eb(1280,720,30,120,1710),"720p_5":Eb(960,720,15,120,910),"720p_6":Eb(960,720,30,120,1380),"1080p":Eb(1920,1080,15,120,2080),"1080p_1":Eb(1920,1080,15,120,2080),"1080p_2":Eb(1920,1080,30,120,3e3),"1080p_3":Eb(1920,1080,30,120,3150),"1080p_5":Eb(1920,1080,60,120,4780),"1440p":Eb(2560,1440,30,120,4850),"1440p_1":Eb(2560,1440,30,120,4850),"1440p_2":Eb(2560,1440,60,120,7350),"4k":Eb(3840,2160,30,120,8910),"4k_1":Eb(3840,2160,30,120,8910),"4k_3":Eb(3840,2160,60,120,13500)},eb={"480p":lb(640,480,5),"480p_1":lb(640,480,5),"480p_2":lb(640,480,30),"480p_3":lb(640,480,15),"720p":lb(1280,720,5),"720p_1":lb(1280,720,5),"720p_2":lb(1280,720,30),"720p_3":lb(1280,720,15),"1080p":lb(1920,1080,5),"1080p_1":lb(1920,1080,5),"1080p_2":lb(1920,1080,30),"1080p_3":lb(1920,1080,15)},tb={"1SL1TL":hb(1,1),"3SL3TL":hb(3,3),"2SL3TL":hb(2,3)};function ib(e){return"string"==typeof e?Object.assign({},$w[e]):e}function nb(e){return"string"==typeof e?Object.assign({},eb[e]):e}function rb(e){return"string"==typeof e?Object.assign({},tb[e]):e}const ob={speech_low_quality:ub(16e3,!1),speech_standard:ub(32e3,!1,18),music_standard:ub(48e3,!1),standard_stereo:ub(48e3,!0,56),high_quality:ub(48e3,!1,128),high_quality_stereo:ub(48e3,!0,192)};function sb(e){return"string"==typeof e?Object.assign({},ob[e]):e}function ab(e,t,i){Object.keys(Ab).includes(e)&&(!i&&Object.keys(db).includes(e)||(Ab[e]=t))}function cb(e){return Ab[e]}const Ab={PROCESS_ID:"",ENCRYPT_AES:!0,AREAS:["CHINA","GLOBAL"],WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io","webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io","webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-web-2.ap.sd-rtn.com","cds-ap-web-3.agora.io","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-web-2.ap.sd-rtn.com","sua-ap-web-3.agora.io","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-ap-web-1.agora.io","uap-web-2.ap.sd-rtn.com","uap-ap-web-3.agora.io","uap-web-4.ap.sd-rtn.com"],LOG_UPLOAD_SERVER:"logservice.agora.io",EVENT_REPORT_DOMAIN:"statscollector-1.agora.io",EVENT_REPORT_BACKUP_DOMAIN:"web-2.statscollector.sd-rtn.com",GATEWAY_ADDRESS:[],GATEWAY_WSS_ADDRESS:"",LIVE_STREAMING_ADDRESS:"",HTTP_CONNECT_TIMEOUT:5e3,SIGNAL_REQUEST_TIMEOUT:1e4,REPORT_STATS:!0,UPLOAD_LOG:!1,NOT_REPORT_EVENT:[],SUBSCRIBE_TCC:!0,PING_PONG_TIME_OUT:10,WEBSOCKET_TIMEOUT_MIN:1e4,EVENT_REPORT_SEND_INTERVAL:3e3,CONFIG_DISTRIBUTE_INTERVAL:3e5,CANDIDATE_TIMEOUT:5e3,SHOW_REPORT_INVOKER_LOG:!1,JOIN_EXTEND:"",PUB_EXTEND:"",SUB_EXTEND:"",FORCE_TURN:!1,TURN_ENABLE_TCP:!0,TURN_ENABLE_UDP:!0,MAX_UPLOAD_CACHE:50,UPLOAD_CACHE_INTERVAL:2e3,AJAX_REQUEST_CONCURRENT:3,REPORT_APP_SCENARIO:void 0,GATEWAY_DOMAINS:["edge.agora.io","edge.sd-rtn.com"],WORKER_DOMAIN:"edge.agora.io",TURN_DOMAIN:"edge.agora.io",EVENT_REPORT_RETRY:!0,CHROME_FORCE_PLAN_B:!1,AUDIO_SOURCE_VOLUME_UPDATE_INTERVAL:400,AUDIO_SOURCE_AVG_VOLUME_DURATION:3e3,AUDIO_VOLUME_INDICATION_INTERVAL:2e3,VOLUME_VOICE_WEIGHT:10,NORMAL_EVENT_QUEUE_CAPACITY:100,CUSTOM_REPORT:!0,CUSTOM_REPORT_LIMIT:20,PROXY_SERVER_TYPE2:"webnginx-proxy.agora.io",PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com","webrtc-cloud-proxy.agora.io"],CUSTOM_PUB_ANSWER_MODIFIER:null,CUSTOM_SUB_ANSWER_MODIFIER:null,CUSTOM_PUB_OFFER_MODIFIER:null,CUSTOM_SUB_OFFER_MODIFIER:null,DSCP_TYPE:"high",REMOVE_NEW_CODECS:!0,FRAGEMENT_LENGTH:3,WEBSOCKET_COMPRESS:!1,SIMULCAST:!1,PRELOAD_MEDIA_COUNT:0,USE_RTX:!1,CHECK_VIDEO_VISIBLE_INTERVAL:3e4,ENUMERATE_DEVICES_INTERVAL:!1,ENUMERATE_DEVICES_INTERVAL_TIME:1e4,USE_NEW_TOKEN:!1,JOIN_WITH_FALLBACK_SIGNAL_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE:!1,JOIN_WITH_FALLBACK_PROXY_PENDING_DURATION:2e3,USE_TURN_SERVER_OF_GATEWAY:!1,H264_PROFILE_LEVEL_ID:"",USE_NEW_LOG:!1,LOG_VERSION:3,MEDIA_DEVICE_CONSTRAINTS:null,ENCRYPT_PROXY_USERNAME_AND_PSW:!0,SDP_LOGGING:!1,REMOTE_AUDIO_TRACK_USES_WEB_AUDIO:!1,LOCAL_AUDIO_TRACK_USES_WEB_AUDIO:!0,BITRATE_ADAPTER_TYPE:"STANDARD_BITRATE",AI_DENOISER_PARAMETERS:{},ADJUST_3A_FROM_PLUGINS:!0,RAISE_H264_BASELINE_PRIORITY:!0,FILTER_SEND_H264_BASELINE:!1,ENABLE_PUBLISHED_USER_LIST:!0,MAX_SUBSCRIPTION:50,ACCOUNT_REGISTER_RETRY_TIMEOUT:1,ACCOUNT_REGISTER_RETRY_RATIO:2,ACCOUNT_REGISTER_RETRY_TIMEOUT_MAX:6e4,ACCOUNT_REGISTER_RETRY_COUNT_MAX:1e5,AUDIO_CONTEXT:null,WEBCS_BACKUP_CONNECT_TIMEOUT:6e3,PLAYER_STATE_DEFER:2e3,SIGNAL_REQUEST_WATCH_INTERVAL:1e3,FILEPATH_LENMAX:255,DUALSTREAM_OPERATION_CHECK:!0,MEDIA_ELEMENT_EXISTS_DEPTH:3,SHIM_CANDIDATE:!1,LEAVE_MSG_TIMEOUT:2e3,STATS_FILTER:{transportId:!0,googTrackId:!0}},db={};function ub(e,t,i){return{sampleRate:e,stereo:t,bitrate:i}}function Eb(e,t,i,n,r){return{width:e,height:t,frameRate:i,bitrateMin:n,bitrateMax:r}}function lb(e,t,i,n,r){return{width:{max:e},height:{max:t},frameRate:i,bitrateMin:n,bitrateMax:r}}function hb(e,t){return{numSpatialLayers:e,numTemporalLayers:t}}zw||(Ab.WEBCS_DOMAIN=["ap-web-1-oversea.agora.io","ap-web-1-north-america.agora.io"],Ab.WEBCS_DOMAIN_BACKUP_LIST=["ap-web-2-oversea.agora.io","ap-web-2-north-america.agora.io"],Ab.PROXY_CS=["proxy-ap-web-oversea.agora.io","proxy-ap-web-america.agora.io"],Ab.CDS_AP=["cds-ap-web-oversea.agora.io","cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],Ab.ACCOUNT_REGISTER=["sua-ap-web-oversea.agora.io","sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],Ab.UAP_AP=["uap-ap-web-oversea.agora.io","uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],Ab.LOG_UPLOAD_SERVER="logservice-oversea.agora.io",Ab.EVENT_REPORT_DOMAIN="statscollector-1-oversea.agora.io",Ab.EVENT_REPORT_BACKUP_DOMAIN="statscollector-2-oversea.agora.io",Ab.PROXY_SERVER_TYPE3="webrtc-cloud-proxy.agora.io",Ab.AREAS=["NORTH_AMERICA","OVERSEA"]);const pb=[[0,1,2,3,4,5,5],[0,2,2,3,4,5,5],[0,3,3,3,4,5,5],[0,4,4,4,4,5,5],[0,5,5,5,5,5,5]],_b=[],Ib=[];var gb=Pd,fb=cu,Rb=Xc,Cb=function(e,t,i){var n=gb(t);n in e?fb.f(e,n,Rb(0,i)):e[n]=i},Tb=$p,mb=ju,Sb=Cb,Ob=Lc.Array,vb=Math.max,Nb=function(e,t,i){for(var n=mb(e),r=Tb(t,n),o=Tb(void 0===i?n:i,n),s=Ob(vb(o-r,0)),a=0;r<o;r++,a++)Sb(s,a,e[r]);return s.length=a,s},yb=Nb,Db=Math.floor,wb=function(e,t){var i=e.length,n=Db(i/2);return i<8?bb(e,t):Lb(e,wb(yb(e,0,n),t),wb(yb(e,n),t),t)},bb=function(e,t){for(var i,n,r=e.length,o=1;o<r;){for(n=o,i=e[o];n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==o++&&(e[n]=i)}return e},Lb=function(e,t,i,n){for(var r=t.length,o=i.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?n(t[s],i[a])<=0?t[s++]:i[a++]:s<r?t[s++]:i[a++];return e},Pb=wb,kb=RA.match(/firefox\/(\d+)/i),Mb=!!kb&&+kb[1],Ub=/MSIE|Trident/.test(RA),Bb=RA.match(/AppleWebKit\/(\d+)\./),Vb=!!Bb&&+Bb[1],Qb=Bu,xb=Dc,Fb=jA,Gb=rd,jb=ju,Yb=qI,Hb=Tc,Kb=Pb,Wb=Zu,Jb=Mb,qb=Ub,Xb=NA,zb=Vb,Zb=[],$b=xb(Zb.sort),eL=xb(Zb.push),tL=Hb((function(){Zb.sort(void 0)})),iL=Hb((function(){Zb.sort(null)})),nL=Wb("sort"),rL=!Hb((function(){if(Xb)return Xb<70;if(!(Jb&&Jb>3)){if(qb)return!0;if(zb)return zb<603;var e,t,i,n,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)Zb.push({k:t+n,v:i})}for(Zb.sort((function(e,t){return t.v-e.v})),n=0;n<Zb.length;n++)t=Zb[n].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));Qb({target:"Array",proto:!0,forced:tL||!iL||!nL||!rL},{sort:function(e){void 0!==e&&Fb(e);var t=Gb(this);if(rL)return void 0===e?$b(t):$b(t,e);var i,n,r=[],o=jb(t);for(n=0;n<o;n++)n in t&&eL(r,t[n]);for(Kb(r,function(e){return function(t,i){return void 0===i?-1:void 0===t?1:void 0!==e?+e(t,i)||0:Yb(t)>Yb(i)?1:-1}}(e)),i=r.length,n=0;n<i;)t[n]=r[n++];for(;n<o;)delete t[n++];return t}});var oL=rE("Array").sort,sL=wc,aL=oL,cL=Array.prototype,AL=function(e){var t=e.sort;return e===cL||sL(cL,e)&&t===cL.sort?aL:t};function dL(e,t){if("boolean"!=typeof e)throw new pw(hw.INVALID_PARAMS,"Invalid ".concat(t,": The value is of the boolean type."))}function uL(e,t,i){if(!i.includes(e))throw new pw(hw.INVALID_PARAMS,"".concat(t," can only be set as ").concat(JSON.stringify(i)))}function EL(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e4;if(e<i||e>n||(!(arguments.length>4&&void 0!==arguments[4])||arguments[4])&&!fL(e))throw new pw(hw.INVALID_PARAMS,"invalid ".concat(t,": the value range is [").concat(i,", ").concat(n,"]. integer only"))}function lL(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:255,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(null==e)throw new pw(hw.INVALID_PARAMS,"".concat(t||"param"," cannot be empty"));if(!gL(e,i,n,r))throw new pw(hw.INVALID_PARAMS,"Invalid ".concat(t||"string param",": Length of the string: [").concat(i,",").concat(n,"].").concat(r?" ASCII characters only.":""))}function hL(e,t){if(!Array.isArray(e))throw new pw(hw.INVALID_PARAMS,"".concat(t," should be an array"))}function pL(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/.test(e))throw mw.error("Invalid Channel Name ".concat(e)),new pw(hw.INVALID_PARAMS,"The length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _,  {, }, |, ~, ,")}function _L(e){if(!("number"==typeof(t=e)&&Math.floor(t)===t&&0<=t&&t<=4294967295||gL(e,1,255)))throw mw.error("Invalid UID ".concat(e," ").concat(typeof e)),new pw(hw.INVALID_PARAMS,"[String uid] Length of the string: [1,255]. ASCII characters only. [Number uid] The value range is [0,10000]");var t;"string"==typeof e&&mw.warning("You input a string as the user ID, to ensure better end-user experience, Agora highly suggests not using a string as the user ID.")}function IL(e){return null==e}function gL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return"string"==typeof e&&e.length<=i&&e.length>=t&&(!n||RL(e))}function fL(e){return"number"==typeof e&&e%1==0}function RL(e){if("string"!=typeof e)return!1;for(let t=0;t<e.length;t+=1){const i=e.charCodeAt(t);if(i<0||i>255)return!1}return!0}let CL,TL,mL;!function(e){e.FREE="free",e.UPLOADING="uploading"}(CL||(CL={})),function(e){e[e.MISC=0]="MISC",e[e.INTERNAL_EVENT=1]="INTERNAL_EVENT",e[e.PUBLIC_EVENT=2]="PUBLIC_EVENT",e[e.WEB_EVENT=3]="WEB_EVENT",e[e.INTERNAL_API=4]="INTERNAL_API",e[e.WEB_API=5]="WEB_API",e[e.PUBLIC_API=6]="PUBLIC_API"}(TL||(TL={})),function(e){e.NONE="none",e.INIT="init",e.CANPLAY="canplay",e.PLAYING="playing",e.PAUSED="paused",e.SUSPEND="suspend",e.STALLED="stalled",e.WAITING="waiting",e.ERROR="error",e.DESTROYED="destroyed",e.ABORT="abort",e.ENDED="ended",e.EMPTIED="emptied",e.LOADEDDATA="loadeddata"}(mL||(mL={}));const SL={uninit:100,none:110,init:120,loadeddata:130,canplay:200,playing:210,paused:220,suspend:300,stalled:310,waiting:320,error:330,destroyed:340,abort:350,ended:360,emptied:370};function OL(e){return lL(e.reportId,"params.reportId",0,100,!1),lL(e.category,"params.category",0,100,!1),lL(e.event,"params.event",0,100,!1),lL(e.label,"params.label",0,100,!1),EL(e.value,"params.value",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,!1),!0}const vL={sid:"",lts:0,success:null,cname:null,uid:null,peer:null,cid:null,elapse:null,extend:null,vid:0};let NL,yL,DL,wL,bL,LL,PL,kL,ML,UL,BL,VL,QL,xL,FL,GL,jL,YL,HL,KL,WL,JL,qL;function XL(e){return EL(e.timeout,"config.timeout",0,1e5),EL(e.timeoutFactor,"config.timeoutFactor",0,100,!1),EL(e.maxRetryCount,"config.maxRetryConfig",0,1/0),EL(e.maxRetryTimeout,"config.maxRetryTimeout",0,1/0),!0}function zL(e){return uL(e.codec,"config.codec",["vp8","vp9","av1","h264"]),uL(e.mode,"config.mode",["rtc","live"]),void 0!==e.audioCodec&&uL(e.audioCodec,"config.audioCodec",["opus","pcmu","pcma","g722"]),void 0!==e.proxyServer&&lL(e.proxyServer,"config.proxyServer",1,1e4),void 0!==e.turnServer&&$L(e.turnServer),void 0!==e.httpRetryConfig&&XL(e.httpRetryConfig),void 0!==e.websocketRetryConfig&&XL(e.websocketRetryConfig),!0}function ZL(e){if(!Array.isArray(e)||e.length<1)return!1;try{e.forEach((e=>{if(!e.urls)throw Error()}))}catch(e){return!1}return!0}function $L(e){return lL(e.turnServerURL,"turnServerURL"),lL(e.username,"username"),lL(e.password,"password"),e.udpport&&EL(e.udpport,"udpport",1,99999,!0),e.forceturn&&dL(e.forceturn,"forceturn"),e.security&&dL(e.security,"security"),e.tcpport&&EL(e.tcpport,"tcpport",1,99999,!0),!0}function eP(e){return void 0!==e.level&&uL(e.level,"level",[1,2,3]),!0}!function(e){e.PUBLISH="publish",e.SUBSCRIBE="subscribe",e.WS_COMPRESSOR_INIT="ws_compressor_init",e.SESSION_INIT="session_init",e.JOIN_CHOOSE_SERVER="join_choose_server",e.REQ_USER_ACCOUNT="req_user_account",e.JOIN_GATEWAY="join_gateway",e.REJOIN_GATEWAY="rejoin_gateway",e.STREAM_SWITCH="stream_switch",e.REQUEST_PROXY_WORKER_MANAGER="request_proxy_worker_manager",e.REQUEST_PROXY_APPCENTER="request_proxy_appcenter",e.FIRST_VIDEO_RECEIVED="first_video_received",e.FIRST_AUDIO_RECEIVED="first_audio_received",e.FIRST_VIDEO_DECODE="first_video_decode",e.FIRST_AUDIO_DECODE="first_audio_decode",e.ON_ADD_AUDIO_STREAM="on_add_audio_stream",e.ON_ADD_VIDEO_STREAM="on_add_video_stream",e.ON_UPDATE_STREAM="on_update_stream",e.ON_REMOVE_STREAM="on_remove_stream",e.USER_ANALYTICS="req_user_analytics"}(NL||(NL={})),function(e){e.SESSION="io.agora.pb.Wrtc.Session",e.JOIN_CHOOSE_SERVER="io.agora.pb.Wrtc.JoinChooseServer",e.REQ_USER_ACCOUNT="io.agora.pb.Wrtc.ReqUserAccount",e.JOIN_GATEWAT="io.agora.pb.Wrtc.JoinGateway",e.RE_JOIN_GATEWAY="io.agora.pb.Wrtc.ReJoinGateway",e.PUBLISH="io.agora.pb.Wrtc.Publish",e.SUBSCRIBE="io.agora.pb.Wrtc.Subscribe",e.WS_COMPRESSOR_INIT="io.agora.pb.Wrtc.WsCompressorInit",e.STREAM_SWITCH="io.agora.pb.Wrtc.StreamSwitch",e.AUDIO_SENDING_STOPPED="io.agora.pb.Wrtc.AudioSendingStopped",e.VIDEO_SENDING_STOPPED="io.agora.pb.Wrtc.VideoSendingStopped",e.REQUEST_PROXY_APPCENTER="io.agora.pb.Wrtc.RequestProxyAppCenter",e.REQUEST_PROXY_WORKER_MANAGER="io.agora.pb.Wrtc.RequestProxyWorkerManager",e.API_INVOKE="io.agora.pb.Wrtc.ApiInvoke",e.FIRST_VIDEO_RECEIVED="io.agora.pb.Wrtc.FirstVideoReceived",e.FIRST_AUDIO_RECEIVED="io.agora.pb.Wrtc.FirstAudioReceived",e.FIRST_VIDEO_DECODE="io.agora.pb.Wrtc.FirstVideoDecode",e.FIRST_AUDIO_DECODE="io.agora.pb.Wrtc.FirstAudioDecode",e.ON_ADD_AUDIO_STREAM="io.agora.pb.Wrtc.OnAddAudioStream",e.ON_ADD_VIDEO_STREAM="io.agora.pb.Wrtc.OnAddVideoStream",e.ON_UPDATE_STREAM="io.agora.pb.Wrtc.OnUpdateStream",e.ON_REMOVE_STREAM="io.agora.pb.Wrtc.OnRemoveStream",e.JOIN_CHANNEL_TIMEOUT="io.agora.pb.Wrtc.JoinChannelTimeout",e.PEER_PUBLISH_STATUS="io.agora.pb.Wrtc.PeerPublishStatus",e.WORKER_EVENT="io.agora.pb.Wrtc.WorkerEvent",e.AP_WORKER_EVENT="io.agora.pb.Wrtc.APWorkerEvent",e.JOIN_WEB_PROXY_AP="io.agora.pb.Wrtc.JoinWebProxyAP",e.WEBSOCKET_QUIT="io.agora.pb.Wrtc.WebSocketQuit",e.USER_ANALYTICS="io.agora.pb.Wrtc.UserAnalytics",e.AUTOPLAY_FAILED="io.agora.pb.Wrtc.AutoplayFailed"}(yL||(yL={})),function(e){e[e.WORKER_EVENT=156]="WORKER_EVENT",e[e.AP_WORKER_EVENT=160]="AP_WORKER_EVENT"}(DL||(DL={})),function(e){e.CREATE_CLIENT="createClient",e.CHECK_SYSTEM_REQUIREMENTS="checkSystemRequirements",e.SET_AREA="setArea",e.CHECK_VIDEO_TRACK_IS_ACTIVE="checkVideoTrackIsActive",e.CHECK_AUDIO_TRACK_IS_ACTIVE="checkAudioTrackIsActive",e.CREATE_MIC_AUDIO_TRACK="createMicrophoneAudioTrack",e.CREATE_CUSTOM_AUDIO_TRACK="createCustomAudioTrack",e.CREATE_BUFFER_AUDIO_TRACK="createBufferSourceAudioTrack",e.CREATE_CAM_VIDEO_TRACK="createCameraVideoTrack",e.CREATE_CUSTOM_VIDEO_TRACK="createCustomVideoTrack",e.CREATE_MIC_AND_CAM_TRACKS="createMicrophoneAndCameraTracks",e.CREATE_SCREEN_VIDEO_TRACK="createScreenVideoTrack",e.SET_ENCRYPTION_CONFIG="Client.setEncryptionConfig",e.START_PROXY_SERVER="Client.startProxyServer",e.STOP_PROXY_SERVER="Client.stopProxyServer",e.SET_PROXY_SERVER="Client.setProxyServer",e.SET_TURN_SERVER="Client.setTurnServer",e.SET_CLIENT_ROLE="Client.setClientRole",e.SET_LOW_STREAM_PARAMETER="Client.setLowStreamParameter",e.ENABLE_DUAL_STREAM="Client.enableDualStream",e.DISABLE_DUAL_STREAM="Client.disableDualStream",e.JOIN="Client.join",e.LEAVE="Client.leave",e.PUBLISH="Client.publish",e.UNPUBLISH="Client.unpublish",e.SUBSCRIBE="Client.subscribe",e.MASS_SUBSCRIBE="Client.massSubscribe",e.MASS_UNSUBSCRIBE="Client.massUnsubscribe",e.UNSUBSCRIBE="Client.unsubscribe",e.RENEW_TOKEN="Client.renewToken",e.SET_REMOTE_VIDEO_STREAM_TYPE="Client.setRemoteVideoStreamType",e.SET_STREAM_FALLBACK_OPTION="Client.setStreamFallbackOption",e.ENABLE_AUDIO_VOLUME_INDICATOR="Client.enableAudioVolumeIndicator",e.SEND_CUSTOM_REPORT_MESSAGE="Client.sendCustomReportMessage",e.JOIN_FALLBACK_TO_PROXY="Client._joinFallbackToProxy",e.ON_LIVE_STREAM_WARNING="Client.onLiveStreamWarning",e.ON_LIVE_STREAM_ERROR="Client.onLiveStreamingError",e.START_LIVE_STREAMING="Client.startLiveStreaming",e.SET_LIVE_TRANSCODING="Client.setLiveTranscoding",e.STOP_LIVE_STREAMING="Client.stopLiveStreaming",e.ADD_INJECT_STREAM_URL="Client.addInjectStreamUrl",e.REMOVE_INJECT_STREAM_URL="Client.removeInjectStreamUrl",e.START_CHANNEL_MEDIA_RELAY="Client.startChannelMediaRelay",e.UPDATE_CHANNEL_MEDIA_RELAY="Client.updateChannelMediaRelay",e.STOP_CHANNEL_MEDIA_RELAY="Client.stopChannelMediaRelay",e.REQUEST_CONFIG_DISTRIBUTE="_config-distribute-request",e.SET_CONFIG_DISTRIBUTE="_configDistribute",e.LOCAL_TRACK_SET_MUTED="LocalTrack.setMute",e.LOCAL_AUDIO_TRACK_PLAY="LocalAudioTrack.play",e.LOCAL_AUDIO_TRACK_PLAY_IN_ELEMENT="LocalAudioTrack.playInElement",e.LOCAL_AUDIO_TRACK_STOP="LocalAudioTrack.stop",e.LOCAL_AUDIO_TRACK_SET_VOLUME="LocalAudioTrack.setVolume",e.MIC_AUDIO_TRACK_SET_DEVICE="MicrophoneAudioTrack.setDevice",e.BUFFER_AUDIO_TRACK_START="BufferSourceAudioTrack.startProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_STOP="BufferSourceAudioTrack.stopProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_PAUSE="BufferSourceAudioTrack.pauseProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_RESUME="BufferSourceAudioTrack.resumeProcessAudioBuffer",e.BUFFER_AUDIO_TRACK_SEEK="BufferSourceAudioTrack.seekAudioBuffer",e.LOCAL_VIDEO_TRACK_PLAY="LocalVideoTrack.play",e.LOCAL_VIDEO_TRACK_STOP="LocalVideoTrack.stop",e.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE="LocalVideoTrack.getVideoElementVisibleStatus",e.LOCAL_VIDEO_TRACK_BEAUTY="LocalVideoTrack.setBeautyEffect",e.CAM_VIDEO_TRACK_SET_DEVICE="CameraVideoTrack.setDevice",e.CAM_VIDEO_TRACK_SET_ENCODER_CONFIG="CameraVideoTrack.setEncoderConfiguration",e.REMOTE_VIDEO_TRACK_PLAY="RemoteVideoTrack.play",e.REMOTE_VIDEO_TRACK_STOP="RemoteVideoTrack.stop",e.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE="RemoteVideoTrack.getVideoElementVisibleStatus",e.REMOTE_AUDIO_TRACK_PLAY="RemoteAudioTrack.play",e.REMOTE_AUDIO_TRACK_STOP="RemoteAudioTrack.stop",e.REMOTE_AUDIO_SET_VOLUME="RemoteAudioTrack.setVolume",e.REMOTE_AUDIO_SET_OUTPUT_DEVICE="RemoteAudioTrack.setOutputDevice",e.GET_MEDIA_STREAM_TRACK="Track.getMediaStreamTrack",e.STREAM_TYPE_CHANGE="streamTypeChange",e.CONNECTION_STATE_CHANGE="connectionStateChange",e.LOAD_CONFIG_FROM_LOCALSTORAGE="loadConfigFromLocalStorage"}(wL||(wL={})),function(e){e.TRACER="tracer"}(bL||(bL={})),function(e){e.IDLE="IDLE",e.INITING="INITING",e.INITEND="INITEND"}(LL||(LL={})),function(e){e.STATE_CHANGE="state_change",e.RECORDING_DEVICE_CHANGED="recordingDeviceChanged",e.PLAYOUT_DEVICE_CHANGED="playoutDeviceChanged",e.CAMERA_DEVICE_CHANGED="cameraDeviceChanged"}(PL||(PL={})),function(e){e[e.ACCESS_POINT=101]="ACCESS_POINT",e[e.UNILBS=201]="UNILBS",e[e.STRING_UID_ALLOCATOR=901]="STRING_UID_ALLOCATOR"}(kL||(kL={})),function(e){e[e.IIIEGAL_APPID=1]="IIIEGAL_APPID",e[e.IIIEGAL_UID=2]="IIIEGAL_UID",e[e.INTERNAL_ERROR=3]="INTERNAL_ERROR"}(ML||(ML={})),function(e){e[e.INVALID_VENDOR_KEY=5]="INVALID_VENDOR_KEY",e[e.INVALID_CHANNEL_NAME=7]="INVALID_CHANNEL_NAME",e[e.INTERNAL_ERROR=8]="INTERNAL_ERROR",e[e.NO_AUTHORIZED=9]="NO_AUTHORIZED",e[e.DYNAMIC_KEY_TIMEOUT=10]="DYNAMIC_KEY_TIMEOUT",e[e.NO_ACTIVE_STATUS=11]="NO_ACTIVE_STATUS",e[e.DYNAMIC_KEY_EXPIRED=13]="DYNAMIC_KEY_EXPIRED",e[e.STATIC_USE_DYNAMIC_KEY=14]="STATIC_USE_DYNAMIC_KEY",e[e.DYNAMIC_USE_STATIC_KEY=15]="DYNAMIC_USE_STATIC_KEY",e[e.USER_OVERLOAD=16]="USER_OVERLOAD",e[e.FORBIDDEN_REGION=18]="FORBIDDEN_REGION",e[e.CANNOT_MEET_AREA_DEMAND=19]="CANNOT_MEET_AREA_DEMAND"}(UL||(UL={})),function(e){e[e.NO_FLAG_SET=100]="NO_FLAG_SET",e[e.FLAG_SET_BUT_EMPTY=101]="FLAG_SET_BUT_EMPTY",e[e.INVALID_FALG_SET=102]="INVALID_FALG_SET",e[e.FLAG_SET_BUT_NO_RE=103]="FLAG_SET_BUT_NO_RE",e[e.INVALID_SERVICE_ID=104]="INVALID_SERVICE_ID",e[e.NO_SERVICE_AVAILABLE=200]="NO_SERVICE_AVAILABLE",e[e.NO_SERVICE_AVAILABLE_P2P=201]="NO_SERVICE_AVAILABLE_P2P",e[e.NO_SERVICE_AVAILABLE_VOICE=202]="NO_SERVICE_AVAILABLE_VOICE",e[e.NO_SERVICE_AVAILABLE_WEBRTC=203]="NO_SERVICE_AVAILABLE_WEBRTC",e[e.NO_SERVICE_AVAILABLE_CDS=204]="NO_SERVICE_AVAILABLE_CDS",e[e.NO_SERVICE_AVAILABLE_CDN=205]="NO_SERVICE_AVAILABLE_CDN",e[e.NO_SERVICE_AVAILABLE_TDS=206]="NO_SERVICE_AVAILABLE_TDS",e[e.NO_SERVICE_AVAILABLE_REPORT=207]="NO_SERVICE_AVAILABLE_REPORT",e[e.NO_SERVICE_AVAILABLE_APP_CENTER=208]="NO_SERVICE_AVAILABLE_APP_CENTER",e[e.NO_SERVICE_AVAILABLE_ENV0=209]="NO_SERVICE_AVAILABLE_ENV0",e[e.NO_SERVICE_AVAILABLE_VOET=210]="NO_SERVICE_AVAILABLE_VOET",e[e.NO_SERVICE_AVAILABLE_STRING_UID=211]="NO_SERVICE_AVAILABLE_STRING_UID",e[e.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS=212]="NO_SERVICE_AVAILABLE_WEBRTC_UNILBS",e[e.NO_SERVICE_AVAILABLE_UNILBS_FLV=213]="NO_SERVICE_AVAILABLE_UNILBS_FLV"}(BL||(BL={})),function(e){e[e.K_TIMESTAMP_EXPIRED=2]="K_TIMESTAMP_EXPIRED",e[e.K_CHANNEL_PERMISSION_INVALID=3]="K_CHANNEL_PERMISSION_INVALID",e[e.K_CERTIFICATE_INVALID=4]="K_CERTIFICATE_INVALID",e[e.K_CHANNEL_NAME_EMPTY=5]="K_CHANNEL_NAME_EMPTY",e[e.K_CHANNEL_NOT_FOUND=6]="K_CHANNEL_NOT_FOUND",e[e.K_TICKET_INVALID=7]="K_TICKET_INVALID",e[e.K_CHANNEL_CONFLICTED=8]="K_CHANNEL_CONFLICTED",e[e.K_SERVICE_NOT_READY=9]="K_SERVICE_NOT_READY",e[e.K_SERVICE_TOO_HEAVY=10]="K_SERVICE_TOO_HEAVY",e[e.K_UID_BANNED=14]="K_UID_BANNED",e[e.K_IP_BANNED=15]="K_IP_BANNED",e[e.K_CHANNEL_BANNED=16]="K_CHANNEL_BANNED",e[e.WARN_NO_AVAILABLE_CHANNEL=103]="WARN_NO_AVAILABLE_CHANNEL",e[e.WARN_LOOKUP_CHANNEL_TIMEOUT=104]="WARN_LOOKUP_CHANNEL_TIMEOUT",e[e.WARN_LOOKUP_CHANNEL_REJECTED=105]="WARN_LOOKUP_CHANNEL_REJECTED",e[e.WARN_OPEN_CHANNEL_TIMEOUT=106]="WARN_OPEN_CHANNEL_TIMEOUT",e[e.WARN_OPEN_CHANNEL_REJECTED=107]="WARN_OPEN_CHANNEL_REJECTED",e[e.WARN_REQUEST_DEFERRED=108]="WARN_REQUEST_DEFERRED",e[e.ERR_DYNAMIC_KEY_TIMEOUT=109]="ERR_DYNAMIC_KEY_TIMEOUT",e[e.ERR_NO_AUTHORIZED=110]="ERR_NO_AUTHORIZED",e[e.ERR_VOM_SERVICE_UNAVAILABLE=111]="ERR_VOM_SERVICE_UNAVAILABLE",e[e.ERR_NO_CHANNEL_AVAILABLE_CODE=112]="ERR_NO_CHANNEL_AVAILABLE_CODE",e[e.ERR_MASTER_VOCS_UNAVAILABLE=114]="ERR_MASTER_VOCS_UNAVAILABLE",e[e.ERR_INTERNAL_ERROR=115]="ERR_INTERNAL_ERROR",e[e.ERR_NO_ACTIVE_STATUS=116]="ERR_NO_ACTIVE_STATUS",e[e.ERR_INVALID_UID=117]="ERR_INVALID_UID",e[e.ERR_DYNAMIC_KEY_EXPIRED=118]="ERR_DYNAMIC_KEY_EXPIRED",e[e.ERR_STATIC_USE_DYANMIC_KE=119]="ERR_STATIC_USE_DYANMIC_KE",e[e.ERR_DYNAMIC_USE_STATIC_KE=120]="ERR_DYNAMIC_USE_STATIC_KE",e[e.ERR_NO_VOCS_AVAILABLE=2e3]="ERR_NO_VOCS_AVAILABLE",e[e.ERR_NO_VOS_AVAILABLE=2001]="ERR_NO_VOS_AVAILABLE",e[e.ERR_JOIN_CHANNEL_TIMEOUT=2002]="ERR_JOIN_CHANNEL_TIMEOUT",e[e.ERR_REPEAT_JOIN_CHANNEL=2003]="ERR_REPEAT_JOIN_CHANNEL",e[e.ERR_JOIN_BY_MULTI_IP=2004]="ERR_JOIN_BY_MULTI_IP",e[e.ERR_NOT_JOINED=2011]="ERR_NOT_JOINED",e[e.ERR_REPEAT_JOIN_REQUEST=2012]="ERR_REPEAT_JOIN_REQUEST",e[e.ERR_INVALID_VENDOR_KEY=2013]="ERR_INVALID_VENDOR_KEY",e[e.ERR_INVALID_CHANNEL_NAME=2014]="ERR_INVALID_CHANNEL_NAME",e[e.ERR_INVALID_STRINGUID=2015]="ERR_INVALID_STRINGUID",e[e.ERR_TOO_MANY_USERS=2016]="ERR_TOO_MANY_USERS",e[e.ERR_SET_CLIENT_ROLE_TIMEOUT=2017]="ERR_SET_CLIENT_ROLE_TIMEOUT",e[e.ERR_SET_CLIENT_ROLE_NO_PERMISSION=2018]="ERR_SET_CLIENT_ROLE_NO_PERMISSION",e[e.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE=2019]="ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",e[e.ERR_PUBLISH_REQUEST_INVALID=2020]="ERR_PUBLISH_REQUEST_INVALID",e[e.ERR_SUBSCRIBE_REQUEST_INVALID=2021]="ERR_SUBSCRIBE_REQUEST_INVALID",e[e.ERR_NOT_SUPPORTED_MESSAGE=2022]="ERR_NOT_SUPPORTED_MESSAGE",e[e.ERR_ILLEAGAL_PLUGIN=2023]="ERR_ILLEAGAL_PLUGIN",e[e.ERR_REJOIN_TOKEN_INVALID=2024]="ERR_REJOIN_TOKEN_INVALID",e[e.ERR_REJOIN_USER_NOT_JOINED=2025]="ERR_REJOIN_USER_NOT_JOINED",e[e.ERR_INVALID_OPTIONAL_INFO=2027]="ERR_INVALID_OPTIONAL_INFO",e[e.ILLEGAL_AES_PASSWORD=2028]="ILLEGAL_AES_PASSWORD",e[e.ILLEGAL_CLIENT_ROLE_LEVEL=2029]="ILLEGAL_CLIENT_ROLE_LEVEL",e[e.ERR_TOO_MANY_BROADCASTERS=2031]="ERR_TOO_MANY_BROADCASTERS",e[e.ERR_TOO_MANY_SUBSCRIBERS=2032]="ERR_TOO_MANY_SUBSCRIBERS",e[e.ERR_TEST_RECOVER=9e3]="ERR_TEST_RECOVER",e[e.ERR_TEST_TRYNEXT=9001]="ERR_TEST_TRYNEXT",e[e.ERR_TEST_RETRY=9002]="ERR_TEST_RETRY"}(VL||(VL={})),function(e){e[e.AUDIENCE_LEVEL_LOW_LATENCY=1]="AUDIENCE_LEVEL_LOW_LATENCY",e[e.AUDIENCE_LEVEL_ULTRA_LOW_LATENCY=2]="AUDIENCE_LEVEL_ULTRA_LOW_LATENCY",e[e.AUDIENCE_LEVEL_SYNC_LATENCY=3]="AUDIENCE_LEVEL_SYNC_LATENCY"}(QL||(QL={})),function(e){e.LEAVE="LEAVE",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.UID_BANNED="UID_BANNED",e.IP_BANNED="IP_BANNED",e.CHANNEL_BANNED="CHANNEL_BANNED",e.FALLBACK="FALLBACK"}(xL||(xL={})),function(e){e.CONNECTION_STATE_CHANGE="connection-state-change",e.MEDIA_RECONNECT_START="media-reconnect-start",e.MEDIA_RECONNECT_END="media-reconnect-end",e.IS_USING_CLOUD_PROXY="is-using-cloud-proxy",e.USER_JOINED="user-joined",e.USER_LEAVED="user-left",e.USER_PUBLISHED="user-published",e.USER_UNPUBLISHED="user-unpublished",e.USER_INFO_UPDATED="user-info-updated",e.CLIENT_BANNED="client-banned",e.CHANNEL_MEDIA_RELAY_STATE="channel-media-relay-state",e.CHANNEL_MEDIA_RELAY_EVENT="channel-media-relay-event",e.VOLUME_INDICATOR="volume-indicator",e.CRYPT_ERROR="crypt-error",e.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="token-privilege-will-expire",e.ON_TOKEN_PRIVILEGE_DID_EXPIRE="token-privilege-did-expire",e.NETWORK_QUALITY="network-quality",e.STREAM_TYPE_CHANGED="stream-type-changed",e.STREAM_FALLBACK="stream-fallback",e.RECEIVE_METADATA="receive-metadata",e.STREAM_MESSAGE="stream-message",e.LIVE_STREAMING_ERROR="live-streaming-error",e.LIVE_STREAMING_WARNING="live-streaming-warning",e.INJECT_STREAM_STATUS="stream-inject-status",e.EXCEPTION="exception",e.ERROR="error",e.P2P_LOST="p2p_lost",e.JOIN_FALLBACK_TO_PROXY="join-fallback-to-proxy",e.MEDIA_CONNECTION_TYPE_CHANGE="media-connection-type-change",e.PUBLISHED_USER_LIST="published-user-list"}(FL||(FL={})),function(e){e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.MULTI_IP="MULTI_IP",e.TIMEOUT="TIMEOUT",e.OFFLINE="OFFLINE",e.LEAVE="LEAVE",e.P2P_FAILED="P2P_FAILED",e.FALLBACK="FALLBACK"}(GL||(GL={})),function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.CLOSED="closed"}(jL||(jL={})),function(e){e.WS_CONNECTED="ws_connected",e.WS_RECONNECTING="ws_reconnecting",e.WS_CLOSED="ws_closed",e.WS_RECONNECT_WAITTING_FINISH="ws_reconnect_waitting_finish",e.WS_RECONNECT_CREATE_CONNECTION="ws_reconnect_create_connection",e.ON_BINARY_DATA="on_binary_data",e.REQUEST_RECOVER="request_recover",e.REQUEST_JOIN_INFO="request_join_info",e.REQUEST_REJOIN_INFO="req_rejoin_info",e.IS_P2P_DISCONNECTED="is_p2p_dis",e.DISCONNECT_P2P="dis_p2p",e.ABORT_P2P_EXECUTION="abort_p2p_execution",e.NEED_RENEW_SESSION="need-sid",e.REPORT_JOIN_GATEWAY="report_join_gateway",e.REQUEST_TIMEOUT="request_timeout",e.REQUEST_SUCCESS="request_success",e.JOIN_RESPONSE="join_response"}(YL||(YL={})),function(e){e.PING="ping",e.PING_BACK="ping_back",e.JOIN="join_v3",e.REJOIN="rejoin_v3",e.LEAVE="leave",e.SET_CLIENT_ROLE="set_client_role",e.PUBLISH="publish",e.UNPUBLISH="unpublish",e.SUBSCRIBE="subscribe",e.SUBSCRIBE_STREAMS="subscribe_streams",e.UNSUBSCRIBE="unsubscribe",e.UNSUBSCRIBE_STREAMS="unsubscribe_streams",e.SUBSCRIBE_CHANGE="subscribe_change",e.TRAFFIC_STATS="traffic_stats",e.RENEW_TOKEN="renew_token",e.SWITCH_VIDEO_STREAM="switch_video_stream",e.DEFAULT_VIDEO_STREAM="default_video_stream",e.SET_FALLBACK_OPTION="set_fallback_option",e.GATEWAY_INFO="gateway_info",e.CONTROL="control",e.SEND_METADATA="send_metadata",e.DATA_STREAM="data_stream",e.PICK_SVC_LAYER="pick_svc_layer",e.RESTART_ICE="restart_ice",e.CONNECT_PC="connect_pc",e.SET_VIDEO_PROFILE="set_video_profile"}(HL||(HL={})),function(e){e.PUBLISH_STATS="publish_stats",e.PUBLISH_RELATED_STATS="publish_related_stats",e.SUBSCRIBE_STATS="subscribe_stats",e.SUBSCRIBE_RELATED_STATS="subscribe_related_stats",e.WS_INFLATE_DATA_LENGTH="ws_inflate_data_length",e.DENOISER_STATS="denoiser_stats",e.TRANSPORT_STATS="transport_stats"}(KL||(KL={})),function(e){e.ON_USER_ONLINE="on_user_online",e.ON_USER_OFFLINE="on_user_offline",e.ON_STREAM_FALLBACK_UPDATE="on_stream_fallback_update",e.ON_PUBLISH_STREAM="on_publish_stream",e.ON_UPLINK_STATS="on_uplink_stats",e.ON_P2P_LOST="on_p2p_lost",e.ON_REMOVE_STREAM="on_remove_stream",e.ON_ADD_AUDIO_STREAM="on_add_audio_stream",e.ON_ADD_VIDEO_STREAM="on_add_video_stream",e.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="on_token_privilege_will_expire",e.ON_TOKEN_PRIVILEGE_DID_EXPIRE="on_token_privilege_did_expire",e.ON_USER_BANNED="on_user_banned",e.ON_NOTIFICATION="on_notification",e.ON_CRYPT_ERROR="on_crypt_error",e.MUTE_AUDIO="mute_audio",e.MUTE_VIDEO="mute_video",e.UNMUTE_AUDIO="unmute_audio",e.UNMUTE_VIDEO="unmute_video",e.ON_P2P_OK="on_p2p_ok",e.RECEIVE_METADATA="receive_metadata",e.ON_DATA_STREAM="on_data_stream",e.ENABLE_LOCAL_VIDEO="enable_local_video",e.DISABLE_LOCAL_VIDEO="disable_local_video",e.ENABLE_LOCAL_AUDIO="enable_local_audio",e.DISABLE_LOCAL_AUDIO="disable_local_audio",e.ON_PUBLISHED_USER_LIST="on_published_user_list"}(WL||(WL={})),function(e){e.CONNECTION_STATE_CHANGE="CONNECTION_STATE_CHANGE",e.NEED_ANSWER="NEED_ANSWER",e.NEED_RENEGOTIATE="NEED_RENEGOTIATE",e.P2P_LOST="P2P_LOST",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.NEED_UNPUB="NEED_UNPUB",e.NEED_UNSUB="NEED_UNSUB",e.NEED_UPLOAD="NEED_UPLOAD",e.NEED_CONTROL="NEED_CONTROL",e.START_RECONNECT="START_RECONNECT",e.END_RECONNECT="END_RECONNECT",e.NEED_SIGNAL_RTT="NEED_SIGNAL_RTT"}(JL||(JL={})),function(e){e.AUDIO_SOURCE_STATE_CHANGE="audio_source_state_change",e.RECEIVE_TRACK_BUFFER="receive_track_buffer",e.ON_AUDIO_BUFFER="on_audio_buffer",e.UPDATE_SOURCE="update_source"}(qL||(qL={}));const tP={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,currentPacketLossRate:0},iP={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0,currentPacketLossRate:0},nP={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1},rP={uplinkNetworkQuality:0,downlinkNetworkQuality:0},oP={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1};let sP,aP,cP;!function(e){e.CONNECTED="websocket:connected",e.RECONNECTING="websocket:reconnecting",e.WILL_RECONNECT="websocket:will_reconnect",e.CLOSED="websocket:closed",e.FAILED="websocket:failed",e.ON_MESSAGE="websocket:on_message",e.REQUEST_NEW_URLS="websocket:request_new_urls",e.RECONNECT_WAITTING_FINISH="websocket:reconnect_waitting_finish",e.RECONNECT_CREATE_CONNECTION="websocket:reconnect_create_connection"}(sP||(sP={})),function(e){e.TRANSCODE="mix_streaming",e.RAW="raw_streaming",e.INJECT="inject_streaming"}(aP||(aP={})),function(e){e[e.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",e[e.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",e[e.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",e[e.INJECT_STREAM_STATUS_START_TIMEOUT=3]="INJECT_STREAM_STATUS_START_TIMEOUT",e[e.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",e[e.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",e[e.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",e[e.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",e[e.INJECT_STREAM_STATUS_STOP_TIMEOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEOUT",e[e.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",e[e.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN"}(cP||(cP={}));const AP={alpha:1,height:640,width:360,x:0,y:0,zOrder:0,audioChannel:0},dP={x:0,y:0,width:160,height:160,zOrder:255,alpha:1};function uP(e,t){lL(e.url,"".concat(t,".url"),1,1e3,!1),IL(e.x)||EL(e.x,"".concat(t,".x"),0,1e4),IL(e.y)||EL(e.y,"".concat(t,".y"),0,1e4),IL(e.width)||EL(e.width,"".concat(t,".width"),0,1e4),IL(e.height)||EL(e.height,"".concat(t,".height"),0,1e4),IL(e.zOrder)||EL(e.zOrder,"".concat(t,".zOrder"),0,255),IL(e.alpha)||EL(e.alpha,"".concat(t,".alpha"),0,1,!1)}const EP={audioBitrate:48,audioChannels:1,audioSampleRate:48e3,backgroundColor:0,height:360,lowLatency:!1,videoBitrate:400,videoCodecProfile:100,videoCodecType:1,videoFrameRate:15,videoGop:30,width:640,images:[],userConfigs:[],userConfigExtraInfo:""},lP={audioBitrate:48,audioChannels:2,audioVolume:100,audioSampleRate:48e3,height:0,width:0,videoBitrate:400,videoFramerate:15,videoGop:30};let hP,pP,_P,IP,gP,fP,RP,CP,TP,mP,SP,OP,vP,NP,yP,DP,wP,bP;function LP(e){if(!e.channelName)throw new pw(hw.INVALID_PARAMS,"invalid channelName in info");if(!e.uid||"number"!=typeof e.uid)throw new pw(hw.INVALID_PARAMS,"invalid uid in info, uid must be a number");return e.token&&lL(e.token,"info.token",1,2047),_L(e.uid),pL(e.channelName),!0}function PP(e){return uL(e,"mediaSource",["screen","window","application"]),!0}!function(e){e.WARNING="@live_uap-warning",e.ERROR="@line_uap-error",e.PUBLISH_STREAM_STATUS="@live_uap-publish-status",e.INJECT_STREAM_STATUS="@live_uap-inject-status",e.WORKER_STATUS="@live_uap-worker-status",e.REQUEST_NEW_ADDRESS="@live_uap-request-address"}(hP||(hP={})),function(e){e.REQUEST_WORKER_MANAGER_LIST="@live_req_worker_manager"}(pP||(pP={})),function(e){e[e.LIVE_STREAM_RESPONSE_SUCCEED=200]="LIVE_STREAM_RESPONSE_SUCCEED",e[e.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM=454]="LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM",e[e.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR=450]="LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR",e[e.LIVE_STREAM_RESPONSE_BAD_STREAM=451]="LIVE_STREAM_RESPONSE_BAD_STREAM",e[e.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR=400]="LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR",e[e.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST=404]="LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST",e[e.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED=456]="LIVE_STREAM_RESPONSE_NOT_AUTHORIZED",e[e.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE=457]="LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE",e[e.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN=429]="LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN",e[e.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH=452]="LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH",e[e.LIVE_STREAM_RESPONSE_NOT_SUPPORTED=453]="LIVE_STREAM_RESPONSE_NOT_SUPPORTED",e[e.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM=455]="LIVE_STREAM_RESPONSE_MAX_STREAM_NUM",e[e.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR=500]="LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR",e[e.LIVE_STREAM_RESPONSE_WORKER_LOST=501]="LIVE_STREAM_RESPONSE_WORKER_LOST",e[e.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT=502]="LIVE_STREAM_RESPONSE_RESOURCE_LIMIT",e[e.LIVE_STREAM_RESPONSE_WORKER_QUIT=503]="LIVE_STREAM_RESPONSE_WORKER_QUIT",e[e.ERROR_FAIL_SEND_MESSAGE=504]="ERROR_FAIL_SEND_MESSAGE",e[e.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE=30]="PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE",e[e.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT=31]="PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT",e[e.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH=32]="PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH",e[e.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN=33]="PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN"}(_P||(_P={})),function(e){e.CONNECT_FAILED="connect failed",e.CONNECT_TIMEOUT="connect timeout",e.WS_DISCONNECTED="websocket disconnected",e.REQUEST_TIMEOUT="request timeout",e.REQUEST_FAILED="request failed",e.WAIT_STATUS_TIMEOUT="wait status timeout",e.WAIT_STATUS_ERROR="wait status error",e.BAD_STATE="bad state",e.WS_ABORT="ws abort",e.AP_REQUEST_TIMEOUT="AP request timeout",e.AP_JSON_PARSE_ERROR="AP json parse error",e.AP_REQUEST_ERROR="AP request error",e.AP_REQUEST_ABORT="AP request abort"}(IP||(IP={})),function(e){e[e.SetSdkProfile=0]="SetSdkProfile",e[e.SetSourceChannel=1]="SetSourceChannel",e[e.SetSourceUserId=2]="SetSourceUserId",e[e.SetDestChannel=3]="SetDestChannel",e[e.StartPacketTransfer=4]="StartPacketTransfer",e[e.StopPacketTransfer=5]="StopPacketTransfer",e[e.UpdateDestChannel=6]="UpdateDestChannel",e[e.Reconnect=7]="Reconnect",e[e.SetVideoProfile=8]="SetVideoProfile"}(gP||(gP={})),function(e){e.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",e.NETWORK_CONNECTED="NETWORK_CONNECTED",e.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",e.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",e.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",e.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",e.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",e.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",e.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED",e.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE"}(fP||(fP={})),function(e){e.RELAY_STATE_IDLE="RELAY_STATE_IDLE",e.RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",e.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING",e.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE"}(RP||(RP={})),function(e){e.RELAY_OK="RELAY_OK",e.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",e.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED",e.DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED"}(CP||(CP={})),function(e){e.High="high",e.Low="low",e.Audio="audio",e.Screen="screen",e.ScreenLow="screen_low"}(TP||(TP={})),function(e){e.DISCONNECT="disconnect",e.CONNECTION_STATE_CHANGE="connection-state-change",e.NETWORK_QUALITY="network-quality",e.STREAM_TYPE_CHANGE="stream-type-change",e.IS_P2P_DISCONNECTED="is-p2p-dis",e.DISCONNECT_P2P="dis-p2p",e.REQUEST_NEW_GATEWAY_LIST="req-gate-url",e.NEED_RENEW_SESSION="need-sid",e.REQUEST_P2P_CONNECTION_PARAMS="request-p2p-connection-params",e.JOIN_RESPONSE="join-response"}(mP||(mP={})),function(e){e[e.Nothing=0]="Nothing",e[e.Audio=1]="Audio",e[e.LwoVideo=2]="LwoVideo",e[e.Video=4]="Video",e[e.Data=8]="Data"}(SP||(SP={})),function(e){e.NEED_RENEGOTIATE="@need_renegotiate",e.NEED_REPLACE_TRACK="@need_replace_track",e.NEED_CLOSE="@need_close",e.NEED_ENABLE_TRACK="@need_enable_track",e.NEED_DISABLE_TRACK="@need_disable_track",e.NEED_SESSION_ID="@need_sid",e.SET_OPTIMIZATION_MODE="@set_optimization_mode",e.GET_STATS="@get_stats",e.GET_LOW_VIDEO_TRACK="@get_low_video_track",e.NEED_RESET_REMOTE_SDP="@need_reset_remote_sdp",e.NEED_UPDATE_VIDEO_ENCODER="@need_update_video_encoder",e.NEED_MUTE_TRACK="@need_mute_track",e.NEED_UNMUTE_TRACK="@need_unmute_track"}(OP||(OP={})),function(e){e.SCREEN_TRACK="screen_track",e.LOW_STREAM="low_stream"}(vP||(vP={})),function(e){e[e.HIGH_STREAM=0]="HIGH_STREAM",e[e.LOW_STREAM=1]="LOW_STREAM"}(NP||(NP={})),function(e){e[e.DISABLE=0]="DISABLE",e[e.LOW_STREAM=1]="LOW_STREAM",e[e.AUDIO_ONLY=2]="AUDIO_ONLY"}(yP||(yP={})),function(e){e.SOURCE_STATE_CHANGE="source-state-change",e.TRACK_ENDED="track-ended",e.BEAUTY_EFFECT_OVERLOAD="beauty-effect-overload",e.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status",e.CLOSED="closed"}(DP||(DP={})),function(e){e.FIRST_FRAME_DECODED="first-frame-decoded",e.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status"}(wP||(wP={})),function(e){e.CHINA="CHINA",e.ASIA="ASIA",e.NORTH_AMERICA="NORTH_AMERICA",e.EUROPE="EUROPE",e.JAPAN="JAPAN",e.INDIA="INDIA",e.KOREA="KOREA",e.HKMC="HKMC",e.US="US",e.OCEANIA="OCEANIA",e.SOUTH_AMERICA="SOUTH_AMERICA",e.AFRICA="AFRICA",e.OVERSEA="OVERSEA",e.GLOBAL="GLOBAL"}(bP||(bP={}));const kP=[bP.AFRICA,bP.ASIA,bP.CHINA,bP.EUROPE,bP.GLOBAL,bP.INDIA,bP.JAPAN,bP.NORTH_AMERICA,bP.OCEANIA,bP.OVERSEA,bP.SOUTH_AMERICA];let MP;!function(e){e.CHINA="CN",e.ASIA="AS",e.NORTH_AMERICA="NA",e.EUROPE="EU",e.JAPAN="JP",e.INDIA="IN",e.KOREA="KR",e.HKMC="HK",e.US="US",e.OCEANIA="OC",e.SOUTH_AMERICA="SA",e.AFRICA="AF",e.OVERSEA="OVERSEA",e.GLOBAL="GLOBAL"}(MP||(MP={}));const UP={CHINA:{},ASIA:{CODE:MP.ASIA,WEBCS_DOMAIN:["ap-web-1-asia.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-asia.agora.io"],PROXY_CS:["proxy-ap-web-asia.agora.io"],CDS_AP:["cds-ap-web-asia.agora.io","cds-ap-web-asia2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-asia.agora.io","sua-ap-web-asia2.agora.io"],UAP_AP:["uap-ap-web-asia.agora.io","uap-ap-web-asia2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-asia.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-asia.agora.io"],LOG_UPLOAD_SERVER:["logservice-asia.agora.io"],PROXY_SERVER_TYPE3:["southeast-asia.webrtc-cloud-proxy.sd-rtn.com"]},NORTH_AMERICA:{CODE:MP.NORTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-north-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-north-america.agora.io"],PROXY_CS:["proxy-ap-web-america.agora.io"],CDS_AP:["cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],UAP_AP:["uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-north-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-north-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-north-america.agora.io"],PROXY_SERVER_TYPE3:["east-usa.webrtc-cloud-proxy.sd-rtn.com"]},EUROPE:{CODE:MP.EUROPE,WEBCS_DOMAIN:["ap-web-1-europe.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-europe.agora.io"],PROXY_CS:["proxy-ap-web-europe.agora.io"],CDS_AP:["cds-ap-web-europe.agora.io","cds-ap-web-europe2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-europe.agora.io","sua-ap-web-europe.agora.io"],UAP_AP:["uap-ap-web-europe.agora.io","uap-ap-web-europe2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-europe.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-europe.agora.io"],LOG_UPLOAD_SERVER:["logservice-europe.agora.io"],PROXY_SERVER_TYPE3:["europe.webrtc-cloud-proxy.sd-rtn.com"]},JAPAN:{CODE:MP.JAPAN,WEBCS_DOMAIN:["ap-web-1-japan.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-japan.agora.io"],PROXY_CS:["proxy-ap-web-japan.agora.io"],CDS_AP:["cds-ap-web-japan.agora.io","cds-ap-web-japan2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-japan.agora.io","sua-ap-web-japan2.agora.io"],UAP_AP:["uap-ap-web-japan.agora.io","\tuap-ap-web-japan2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-japan.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-japan.agora.io"],LOG_UPLOAD_SERVER:["logservice-japan.agora.io"],PROXY_SERVER_TYPE3:["japan.webrtc-cloud-proxy.sd-rtn.com"]},INDIA:{CODE:MP.INDIA,WEBCS_DOMAIN:["ap-web-1-india.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-india.agora.io"],PROXY_CS:["proxy-ap-web-india.agora.io"],CDS_AP:["cds-ap-web-india.agora.io","cds-ap-web-india2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-india.agora.io","sua-ap-web-india2.agora.io"],UAP_AP:["uap-ap-web-india.agora.io","uap-ap-web-india2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-india.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-india.agora.io"],LOG_UPLOAD_SERVER:["logservice-india.agora.io"],PROXY_SERVER_TYPE3:["india.webrtc-cloud-proxy.sd-rtn.com"]},KOREA:{CODE:MP.KOREA,WEBCS_DOMAIN:["ap-web-1-korea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-korea.agora.io"],PROXY_CS:["proxy-ap-web-korea.agora.io"],CDS_AP:["cds-ap-web-korea.agora.io","cds-ap-web-korea2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-korea.agora.io","sua-ap-web-korea2.agora.io"],UAP_AP:["uap-ap-web-korea.agora.io","uap-ap-web-korea2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-korea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-korea.agora.io"],LOG_UPLOAD_SERVER:["logservice-korea.agora.io"],PROXY_SERVER_TYPE3:["korea.webrtc-cloud-proxy.sd-rtn.com"]},HKMC:{CODE:MP.HKMC,WEBCS_DOMAIN:["ap-web-1-hkmc.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-hkmc.agora.io"],PROXY_CS:["proxy-ap-web-hkmc.agora.io"],CDS_AP:["cds-ap-web-hkmc.agora.io","cds-ap-web-hkmc2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-hkmc.agora.io","sua-ap-web-hkmc2.agora.io"],UAP_AP:["uap-ap-web-hkmc.agora.io","uap-ap-web-hkmc2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-hkmc.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-hkmc.agora.io"],LOG_UPLOAD_SERVER:["logservice-hkmc.agora.io"],PROXY_SERVER_TYPE3:["hkmc.webrtc-cloud-proxy.sd-rtn.com"]},US:{CODE:MP.US,WEBCS_DOMAIN:["ap-web-1-us.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-us.agora.io"],PROXY_CS:["proxy-ap-web-us.agora.io"],CDS_AP:["cds-ap-web-us.agora.io","cds-ap-web-us2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-us.agora.io","sua-ap-web-us2.agora.io"],UAP_AP:["uap-ap-web-us.agora.io","uap-ap-web-us2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-us.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-us.agora.io"],LOG_UPLOAD_SERVER:["logservice-us.agora.io"],PROXY_SERVER_TYPE3:["us.webrtc-cloud-proxy.sd-rtn.com"]},OVERSEA:{CODE:MP.OVERSEA,WEBCS_DOMAIN:["ap-web-1-oversea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oversea.agora.io"],PROXY_CS:["proxy-ap-web-oversea.agora.io"],CDS_AP:["cds-ap-web-oversea.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oversea.agora.io"],UAP_AP:["uap-ap-web-oversea.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oversea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oversea.agora.io"],LOG_UPLOAD_SERVER:["logservice-oversea.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.agora.io"]},GLOBAL:{CODE:MP.GLOBAL,WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-ap-web-3.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-ap-web-3.agora.io"],UAP_AP:["uap-ap-web-1.agora.io","uap-ap-web-3.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2.agora.io"],LOG_UPLOAD_SERVER:["logservice.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com"]},OCEANIA:{CODE:MP.OCEANIA,WEBCS_DOMAIN:["ap-web-1-oceania.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oceania.agora.io"],PROXY_CS:["proxy-ap-web-oceania.agora.io"],CDS_AP:["cds-ap-web-oceania.agora.io","cds-ap-web-oceania2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oceania.agora.io","sua-ap-web-oceania2.agora.io"],UAP_AP:["uap-ap-web-oceania.agora.io","uap-ap-web-oceania2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oceania.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oceania.agora.io"],LOG_UPLOAD_SERVER:["logservice-oceania.agora.io"],PROXY_SERVER_TYPE3:["oceania.webrtc-cloud-proxy.sd-rtn.com"]},SOUTH_AMERICA:{CODE:MP.SOUTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-south-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-south-america.agora.io"],PROXY_CS:["proxy-ap-web-south-america.agora.io"],CDS_AP:["cds-ap-web-south-america.agora.io","cds-ap-web-south-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-south-america.agora.io","sua-ap-web-south-america2.agora.io"],UAP_AP:["uap-ap-web-south-america.agora.io","uap-ap-web-south-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-south-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-south-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-america.agora.io"],PROXY_SERVER_TYPE3:["south-america.webrtc-cloud-proxy.sd-rtn.com"]},AFRICA:{CODE:MP.AFRICA,WEBCS_DOMAIN:["ap-web-1-africa.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-africa.agora.io"],PROXY_CS:["proxy-ap-web-africa.agora.io"],CDS_AP:["cds-ap-web-africa.agora.io","cds-ap-web-africa2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-africa.agora.io","sua-ap-web-africa2.agora.io"],UAP_AP:["uap-ap-web-africa.agora.io","uap-ap-web-africa2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-africa.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-africa.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-africa.agora.io"],PROXY_SERVER_TYPE3:["africa.webrtc-cloud-proxy.sd-rtn.com"]}};let BP,VP,QP,xP,FP,GP,jP,YP;zw&&(UP.CHINA={CODE:MP.CHINA,WEBCS_DOMAIN:["webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["proxy-web.ap.sd-rtn.com"],CDS_AP:["cds-web-2.ap.sd-rtn.com","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-web-2.ap.sd-rtn.com","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-web-2.ap.sd-rtn.com","uap-web-4.ap.sd-rtn.com"],EVENT_REPORT_DOMAIN:["web-3.statscollector.sd-rtn.com"],EVENT_REPORT_BACKUP_DOMAIN:["web-4.statscollector.sd-rtn.com"],LOG_UPLOAD_SERVER:["logservice-china.agora.io"],PROXY_SERVER_TYPE3:["east-cn.webrtc-cloud-proxy.sd-rtn.com"]}),function(e){e.UPDATE_BITRATE_LIMIT="update_bitrate_limit"}(BP||(BP={}));class HP extends Ew{constructor(e,t){super(),tD(this,"onICEConnectionStateChange",void 0),tD(this,"onConnectionStateChange",void 0),tD(this,"onDTLSTransportStateChange",void 0),tD(this,"onDTLSTransportError",void 0),tD(this,"onICETransportStateChange",void 0),tD(this,"onFirstAudioReceived",void 0),tD(this,"onFirstVideoReceived",void 0),tD(this,"onFirstAudioDecoded",void 0),tD(this,"onFirstVideoDecoded",void 0),tD(this,"onSelectedLocalCandidateChanged",void 0),tD(this,"onSelectedRemoteCandidateChanged",void 0)}}!function(e){e.SEND="sendonly",e.RECV="recvonly",e.SENDRECV="sendrecv",e.INACTIVE="inactive"}(VP||(VP={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(QP||(QP={})),function(e){e.LocalVideoTrack="videoTrack",e.LocalAudioTrack="audioTrack",e.LocalVideoLowTrack="videoLowTrack"}(xP||(xP={})),function(e){e.New="new",e.Connected="connected",e.Reconnecting="reconnecting",e.Disconnected="disconnected"}(FP||(FP={})),function(e){e.StateChange="stateChange",e.IceConnectionStateChange="iceConnectionStateChange",e.RequestMuteLocal="requestMuteLocal",e.RequestUnmuteLocal="requestUnmuteLocal",e.RequestRePublish="requestRePublish",e.RequestReSubscribe="requestReSubscribe",e.RequestUploadStats="requestUploadStats",e.MediaReconnectStart="MediaReconnectStart",e.MediaReconnectEnd="MediaReconnectEnd",e.NeedSignalRTT="NeedSignalRTT",e.RequestRestartICE="RequestRestartIce",e.PeerConnectionStateChange="PeerConnectionStateChange",e.RequestReconnect="RequestReconnect",e.RequestReconnectPC="RequestReconnectPC",e.RequestUnpublishForReconnectPC="RequestUnpublishForReconnectPC",e.P2PLost="P2PLost",e.UpdateVideoEncoder="UpdateVideoEncoder",e.ConnectionTypeChange="ConnectionTypeChange"}(GP||(GP={})),function(e){e.ONLINE="ONLINE",e.OFFLINE="OFFLINE"}(jP||(jP={})),function(e){e.NETWORK_STATE_CHANGE="NETWORK_STATE_CHANGE",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE"}(YP||(YP={}));const KP={join:["startJoin","startRequestAp","startJoinGateway","finishJoin"],publish:["startPublish"]};let WP,JP;!function(e){e.ON_TRACK="on_track",e.ON_NODE="on_node"}(WP||(WP={})),function(e){e.REQUEST_UPDATE_CONSTRAINTS="request_update_constraints",e.REQUEST_CONSTRAINTS="request_constraints"}(JP||(JP={}));const qP={getDisplayMedia:!1,getStreamFromExtension:!1,supportUnifiedPlan:!1,supportMinBitrate:!1,supportSetRtpSenderParameters:!1,supportDualStream:!0,webAudioMediaStreamDest:!1,supportReplaceTrack:!1,supportWebGL:!1,webAudioWithAEC:!1,supportRequestFrame:!1,supportShareAudio:!1,supportDualStreamEncoding:!1};function XP(){return qP}var zP="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,ZP=Gi,$P=qi,ek=n.RangeError,tk=function(e){if(void 0===e)return 0;var t=ZP(e),i=$P(t);if(t!==i)throw ek("Wrong length or index");return i},ik=n.Array,nk=Math.abs,rk=Math.pow,ok=Math.floor,sk=Math.log,ak=Math.LN2,ck={pack:function(e,t,i){var n,r,o,s=ik(i),a=8*i-t-1,c=(1<<a)-1,A=c>>1,d=23===t?rk(2,-24)-rk(2,-77):0,u=e<0||0===e&&1/e<0?1:0,E=0;for((e=nk(e))!=e||e===1/0?(r=e!=e?1:0,n=c):(n=ok(sk(e)/ak),e*(o=rk(2,-n))<1&&(n--,o*=2),(e+=n+A>=1?d/o:d*rk(2,1-A))*o>=2&&(n++,o/=2),n+A>=c?(r=0,n=c):n+A>=1?(r=(e*o-1)*rk(2,t),n+=A):(r=e*rk(2,A-1)*rk(2,t),n=0));t>=8;)s[E++]=255&r,r/=256,t-=8;for(n=n<<t|r,a+=t;a>0;)s[E++]=255&n,n/=256,a-=8;return s[--E]|=128*u,s},unpack:function(e,t){var i,n=e.length,r=8*n-t-1,o=(1<<r)-1,s=o>>1,a=r-7,c=n-1,A=e[c--],d=127&A;for(A>>=7;a>0;)d=256*d+e[c--],a-=8;for(i=d&(1<<-a)-1,d>>=-a,a+=t;a>0;)i=256*i+e[c--],a-=8;if(0===d)d=1-s;else{if(d===o)return i?NaN:A?-1/0:1/0;i+=rk(2,t),d-=s}return(A?-1:1)*i*rk(2,d-t)}},Ak=Pe,dk=Ki,uk=zi,Ek=ct,lk=St,hk=I,pk=Ki,_k=zi,Ik=function(e,t,i){var n=Ek(t);n in e?lk.f(e,n,hk(0,i)):e[n]=i},gk=n.Array,fk=Math.max,Rk=function(e,t,i){for(var n=_k(e),r=pk(t,n),o=pk(void 0===i?n:i,n),s=gk(fk(o-r,0)),a=0;r<o;r++,a++)Ik(s,a,e[r]);return s.length=a,s},Ck=n,Tk=m,mk=s,Sk=zP,Ok=yi,vk=Ft,Nk=Yn,yk=o,Dk=Ar,wk=Gi,bk=qi,Lk=tk,Pk=ck,kk=Pl,Mk=zn,Uk=Qi.f,Bk=St.f,Vk=Rk,Qk=tr,xk=Ok.PROPER,Fk=Ok.CONFIGURABLE,Gk=Ti.get,jk=Ti.set,Yk="ArrayBuffer",Hk="Wrong index",Kk=Ck.ArrayBuffer,Wk=Kk,Jk=Wk&&Wk.prototype,qk=Ck.DataView,Xk=qk&&qk.prototype,zk=Object.prototype,Zk=Ck.Array,$k=Ck.RangeError,eM=Tk((function(e){for(var t=Ak(this),i=uk(t),n=arguments.length,r=dk(n>1?arguments[1]:void 0,i),o=n>2?arguments[2]:void 0,s=void 0===o?i:dk(o,i);s>r;)t[r++]=e;return t})),tM=Tk([].reverse),iM=Pk.pack,nM=Pk.unpack,rM=function(e){return[255&e]},oM=function(e){return[255&e,e>>8&255]},sM=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},aM=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},cM=function(e){return iM(e,23,4)},AM=function(e){return iM(e,52,8)},dM=function(e,t){Bk(e.prototype,t,{get:function(){return Gk(this)[t]}})},uM=function(e,t,i,n){var r=Lk(i),o=Gk(e);if(r+t>o.byteLength)throw $k(Hk);var s=Gk(o.buffer).bytes,a=r+o.byteOffset,c=Vk(s,a,a+t);return n?c:tM(c)},EM=function(e,t,i,n,r,o){var s=Lk(i),a=Gk(e);if(s+t>a.byteLength)throw $k(Hk);for(var c=Gk(a.buffer).bytes,A=s+a.byteOffset,d=n(+r),u=0;u<t;u++)c[A+u]=d[o?u:t-u-1]};if(Sk){var lM=xk&&Kk.name!==Yk;if(yk((function(){Kk(1)}))&&yk((function(){new Kk(-1)}))&&!yk((function(){return new Kk,new Kk(1.5),new Kk(NaN),lM&&!Fk})))lM&&Fk&&vk(Kk,"name",Yk);else{(Wk=function(e){return Dk(this,Jk),new Kk(Lk(e))}).prototype=Jk;for(var hM,pM=Uk(Kk),_M=0;pM.length>_M;)(hM=pM[_M++])in Wk||vk(Wk,hM,Kk[hM]);Jk.constructor=Wk}Mk&&kk(Xk)!==zk&&Mk(Xk,zk);var IM=new qk(new Wk(2)),gM=Tk(Xk.setInt8);IM.setInt8(0,2147483648),IM.setInt8(1,2147483649),!IM.getInt8(0)&&IM.getInt8(1)||Nk(Xk,{setInt8:function(e,t){gM(this,e,t<<24>>24)},setUint8:function(e,t){gM(this,e,t<<24>>24)}},{unsafe:!0})}else Jk=(Wk=function(e){Dk(this,Jk);var t=Lk(e);jk(this,{bytes:eM(Zk(t),0),byteLength:t}),mk||(this.byteLength=t)}).prototype,Xk=(qk=function(e,t,i){Dk(this,Xk),Dk(e,Jk);var n=Gk(e).byteLength,r=wk(t);if(r<0||r>n)throw $k("Wrong offset");if(r+(i=void 0===i?n-r:bk(i))>n)throw $k("Wrong length");jk(this,{buffer:e,byteLength:i,byteOffset:r}),mk||(this.buffer=e,this.byteLength=i,this.byteOffset=r)}).prototype,mk&&(dM(Wk,"byteLength"),dM(qk,"buffer"),dM(qk,"byteLength"),dM(qk,"byteOffset")),Nk(Xk,{getInt8:function(e){return uM(this,1,e)[0]<<24>>24},getUint8:function(e){return uM(this,1,e)[0]},getInt16:function(e){var t=uM(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=uM(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return aM(uM(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return aM(uM(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return nM(uM(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return nM(uM(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){EM(this,1,e,rM,t)},setUint8:function(e,t){EM(this,1,e,rM,t)},setInt16:function(e,t){EM(this,2,e,oM,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){EM(this,2,e,oM,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){EM(this,4,e,sM,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){EM(this,4,e,sM,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){EM(this,4,e,cM,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){EM(this,8,e,AM,t,arguments.length>2?arguments[2]:void 0)}});Qk(Wk,Yk),Qk(qk,"DataView");var fM={ArrayBuffer:Wk,DataView:qk},RM=Fn,CM=m,TM=o,mM=wt,SM=Ki,OM=qi,vM=Po,NM=fM.ArrayBuffer,yM=fM.DataView,DM=yM.prototype,wM=CM(NM.prototype.slice),bM=CM(DM.getUint8),LM=CM(DM.setUint8);RM({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:TM((function(){return!new NM(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(wM&&void 0===t)return wM(mM(this),e);for(var i=mM(this).byteLength,n=SM(e,i),r=SM(void 0===t?i:t,i),o=new(vM(this,NM))(OM(r-n)),s=new yM(this),a=new yM(o),c=0;n<r;)LM(a,c++,bM(s,n++));return o}});var PM,kM,MM,UM={exports:{}},BM=zP,VM=s,QM=n,xM=Q,FM=F,GM=Ue,jM=Nr,YM=Ee,HM=Ft,KM=Gt.exports,WM=St.f,JM=K,qM=Pl,XM=zn,zM=Ze,ZM=Fe,$M=QM.Int8Array,eU=$M&&$M.prototype,tU=QM.Uint8ClampedArray,iU=tU&&tU.prototype,nU=$M&&qM($M),rU=eU&&qM(eU),oU=Object.prototype,sU=QM.TypeError,aU=zM("toStringTag"),cU=ZM("TYPED_ARRAY_TAG"),AU=ZM("TYPED_ARRAY_CONSTRUCTOR"),dU=BM&&!!XM&&"Opera"!==jM(QM.opera),uU=!1,EU={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},lU={BigInt64Array:8,BigUint64Array:8},hU=function(e){if(!FM(e))return!1;var t=jM(e);return GM(EU,t)||GM(lU,t)};for(PM in EU)(MM=(kM=QM[PM])&&kM.prototype)?HM(MM,AU,kM):dU=!1;for(PM in lU)(MM=(kM=QM[PM])&&kM.prototype)&&HM(MM,AU,kM);if((!dU||!xM(nU)||nU===Function.prototype)&&(nU=function(){throw sU("Incorrect invocation")},dU))for(PM in EU)QM[PM]&&XM(QM[PM],nU);if((!dU||!rU||rU===oU)&&(rU=nU.prototype,dU))for(PM in EU)QM[PM]&&XM(QM[PM].prototype,rU);if(dU&&qM(iU)!==rU&&XM(iU,rU),VM&&!GM(rU,aU))for(PM in uU=!0,WM(rU,aU,{get:function(){return FM(this)?this[cU]:void 0}}),EU)QM[PM]&&HM(QM[PM],cU,PM);var pU={NATIVE_ARRAY_BUFFER_VIEWS:dU,TYPED_ARRAY_CONSTRUCTOR:AU,TYPED_ARRAY_TAG:uU&&cU,aTypedArray:function(e){if(hU(e))return e;throw sU("Target is not a typed array")},aTypedArrayConstructor:function(e){if(xM(e)&&(!XM||JM(nU,e)))return e;throw sU(YM(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,i,n){if(VM){if(i)for(var r in EU){var o=QM[r];if(o&&GM(o.prototype,e))try{delete o.prototype[e]}catch(i){try{o.prototype[e]=t}catch(e){}}}rU[e]&&!i||KM(rU,e,i?t:dU&&eU[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,i){var n,r;if(VM){if(XM){if(i)for(n in EU)if((r=QM[n])&&GM(r,e))try{delete r[e]}catch(e){}if(nU[e]&&!i)return;try{return KM(nU,e,i?t:dU&&nU[e]||t)}catch(e){}}for(n in EU)!(r=QM[n])||r[e]&&!i||KM(r,e,t)}},isView:function(e){if(!FM(e))return!1;var t=jM(e);return"DataView"===t||GM(EU,t)||GM(lU,t)},isTypedArray:hU,TypedArray:nU,TypedArrayPrototype:rU},_U=n,IU=o,gU=so,fU=pU.NATIVE_ARRAY_BUFFER_VIEWS,RU=_U.ArrayBuffer,CU=_U.Int8Array,TU=!fU||!IU((function(){CU(1)}))||!IU((function(){new CU(-1)}))||!gU((function(e){new CU,new CU(null),new CU(1.5),new CU(e)}),!0)||IU((function(){return 1!==new CU(new RU(2),1,void 0).length})),mU=F,SU=Math.floor,OU=Number.isInteger||function(e){return!mU(e)&&isFinite(e)&&SU(e)===e},vU=Gi,NU=n.RangeError,yU=n.RangeError,DU=function(e,t){var i=function(e){var t=vU(e);if(t<0)throw NU("The argument can't be less than 0");return t}(e);if(i%t)throw yU("Wrong offset");return i},wU=lr,bU=d,LU=Do,PU=Pe,kU=zi,MU=Qr,UU=Lr,BU=gr,VU=pU.aTypedArrayConstructor,QU=N,xU=n,FU=Array.isArray||function(e){return"Array"==QU(e)},GU=Oo,jU=F,YU=Ze("species"),HU=xU.Array,KU=lr,WU=P,JU=Pe,qU=zi,XU=function(e,t){return new(function(e){var t;return FU(e)&&(t=e.constructor,(GU(t)&&(t===HU||FU(t.prototype))||jU(t)&&null===(t=t[YU]))&&(t=void 0)),void 0===t?HU:t}(e))(0===t?0:t)},zU=m([].push),ZU=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,A,d,u){for(var E,l,h=JU(c),p=WU(h),_=KU(A,d),I=qU(p),g=0,f=u||XU,R=t?f(c,I):i||s?f(c,0):void 0;I>g;g++)if((a||g in p)&&(l=_(E=p[g],g,h),e))if(t)R[g]=l;else if(l)switch(e){case 3:return!0;case 5:return E;case 6:return g;case 2:zU(R,E)}else switch(e){case 4:return!1;case 7:zU(R,E)}return o?-1:n||r?r:R}},$U={forEach:ZU(0),map:ZU(1),filter:ZU(2),some:ZU(3),every:ZU(4),find:ZU(5),findIndex:ZU(6),filterReject:ZU(7)},eB=Fn,tB=n,iB=d,nB=s,rB=TU,oB=pU,sB=fM,aB=Ar,cB=I,AB=Ft,dB=OU,uB=qi,EB=tk,lB=DU,hB=ct,pB=Ue,_B=Nr,IB=F,gB=de,fB=jE,RB=K,CB=zn,TB=Qi.f,mB=function(e){var t,i,n,r,o,s,a=LU(this),c=PU(e),A=arguments.length,d=A>1?arguments[1]:void 0,u=void 0!==d,E=UU(c);if(E&&!BU(E))for(s=(o=MU(c,E)).next,c=[];!(r=bU(s,o)).done;)c.push(r.value);for(u&&A>2&&(d=wU(d,arguments[2])),i=kU(c),n=new(VU(a))(i),t=0;i>t;t++)n[t]=u?d(c[t],t):c[t];return n},SB=$U.forEach,OB=sr,vB=St,NB=r,yB=xh,DB=Ti.get,wB=Ti.set,bB=vB.f,LB=NB.f,PB=Math.round,kB=tB.RangeError,MB=sB.ArrayBuffer,UB=MB.prototype,BB=sB.DataView,VB=oB.NATIVE_ARRAY_BUFFER_VIEWS,QB=oB.TYPED_ARRAY_CONSTRUCTOR,xB=oB.TYPED_ARRAY_TAG,FB=oB.TypedArray,GB=oB.TypedArrayPrototype,jB=oB.aTypedArrayConstructor,YB=oB.isTypedArray,HB="BYTES_PER_ELEMENT",KB="Wrong length",WB=function(e,t){jB(e);for(var i=0,n=t.length,r=new e(n);n>i;)r[i]=t[i++];return r},JB=function(e,t){bB(e,t,{get:function(){return DB(this)[t]}})},qB=function(e){var t;return RB(UB,e)||"ArrayBuffer"==(t=_B(e))||"SharedArrayBuffer"==t},XB=function(e,t){return YB(e)&&!gB(t)&&t in e&&dB(+t)&&t>=0},zB=function(e,t){return t=hB(t),XB(e,t)?cB(2,e[t]):LB(e,t)},ZB=function(e,t,i){return t=hB(t),!(XB(e,t)&&IB(i)&&pB(i,"value"))||pB(i,"get")||pB(i,"set")||i.configurable||pB(i,"writable")&&!i.writable||pB(i,"enumerable")&&!i.enumerable?bB(e,t,i):(e[t]=i.value,e)};nB?(VB||(NB.f=zB,vB.f=ZB,JB(GB,"buffer"),JB(GB,"byteOffset"),JB(GB,"byteLength"),JB(GB,"length")),eB({target:"Object",stat:!0,forced:!VB},{getOwnPropertyDescriptor:zB,defineProperty:ZB}),UM.exports=function(e,t,i){var n=e.match(/\d+$/)[0]/8,r=e+(i?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=tB[r],c=a,A=c&&c.prototype,d={},u=function(e,t){bB(e,t,{get:function(){return function(e,t){var i=DB(e);return i.view[o](t*n+i.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var o=DB(e);i&&(r=(r=PB(r))<0?0:r>255?255:255&r),o.view[s](t*n+o.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};VB?rB&&(c=t((function(e,t,i,r){return aB(e,A),yB(IB(t)?qB(t)?void 0!==r?new a(t,lB(i,n),r):void 0!==i?new a(t,lB(i,n)):new a(t):YB(t)?WB(c,t):iB(mB,c,t):new a(EB(t)),e,c)})),CB&&CB(c,FB),SB(TB(a),(function(e){e in c||AB(c,e,a[e])})),c.prototype=A):(c=t((function(e,t,i,r){aB(e,A);var o,s,a,d=0,E=0;if(IB(t)){if(!qB(t))return YB(t)?WB(c,t):iB(mB,c,t);o=t,E=lB(i,n);var l=t.byteLength;if(void 0===r){if(l%n)throw kB(KB);if((s=l-E)<0)throw kB(KB)}else if((s=uB(r)*n)+E>l)throw kB(KB);a=s/n}else a=EB(t),o=new MB(s=a*n);for(wB(e,{buffer:o,byteOffset:E,byteLength:s,length:a,view:new BB(o)});d<a;)u(e,d++)})),CB&&CB(c,FB),A=c.prototype=fB(GB)),A.constructor!==c&&AB(A,"constructor",c),AB(A,QB,c),xB&&AB(A,xB,r),d[r]=c,eB({global:!0,forced:c!=a,sham:!VB},d),HB in c||AB(c,HB,n),HB in A||AB(A,HB,n),OB(r)}):UM.exports=function(){},(0,UM.exports)("Uint8",(function(e){return function(t,i,n){return e(this,t,i,n)}}));var $B=zi,eV=Gi,tV=pU.aTypedArray;(0,pU.exportTypedArrayMethod)("at",(function(e){var t=tV(this),i=$B(t),n=eV(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:t[r]}));var iV=n,nV=d,rV=pU,oV=zi,sV=DU,aV=Pe,cV=o,AV=iV.RangeError,dV=iV.Int8Array,uV=dV&&dV.prototype,EV=uV&&uV.set,lV=rV.aTypedArray,hV=rV.exportTypedArrayMethod,pV=!cV((function(){var e=new Uint8ClampedArray(2);return nV(EV,e,{length:1,0:3},1),3!==e[1]})),_V=pV&&rV.NATIVE_ARRAY_BUFFER_VIEWS&&cV((function(){var e=new dV(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));hV("set",(function(e){lV(this);var t=sV(arguments.length>1?arguments[1]:void 0,1),i=aV(e);if(pV)return nV(EV,this,i,t);var n=this.length,r=oV(i),o=0;if(r+t>n)throw AV("Wrong length");for(;o<r;)this[t+o]=i[o++]}),!pV||_V);var IV=Rk,gV=Math.floor,fV=function(e,t){var i=e.length,n=gV(i/2);return i<8?RV(e,t):CV(e,fV(IV(e,0,n),t),fV(IV(e,n),t),t)},RV=function(e,t){for(var i,n,r=e.length,o=1;o<r;){for(n=o,i=e[o];n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==o++&&(e[n]=i)}return e},CV=function(e,t,i,n){for(var r=t.length,o=i.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?n(t[s],i[a])<=0?t[s++]:i[a++]:s<r?t[s++]:i[a++];return e},TV=fV,mV=W.match(/firefox\/(\d+)/i),SV=!!mV&&+mV[1],OV=/MSIE|Trident/.test(W),vV=W.match(/AppleWebKit\/(\d+)\./),NV=!!vV&&+vV[1],yV=n,DV=m,wV=o,bV=_e,LV=TV,PV=pU,kV=SV,MV=OV,UV=ee,BV=NV,VV=yV.Array,QV=PV.aTypedArray,xV=PV.exportTypedArrayMethod,FV=yV.Uint16Array,GV=FV&&DV(FV.prototype.sort),jV=!(!GV||wV((function(){GV(new FV(2),null)}))&&wV((function(){GV(new FV(2),{})}))),YV=!!GV&&!wV((function(){if(UV)return UV<74;if(kV)return kV<67;if(MV)return!0;if(BV)return BV<602;var e,t,i=new FV(516),n=VV(516);for(e=0;e<516;e++)t=e%4,i[e]=515-e,n[e]=e-2*t+3;for(GV(i,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(i[e]!==n[e])return!0}));xV("sort",(function(e){return void 0!==e&&bV(e),YV?GV(this,e):LV(QV(this),function(e){return function(t,i){return void 0!==e?+e(t,i)||0:i!=i?-1:t!=t?1:0===t&&0===i?1/t>0&&1/i<0?1:-1:t>i}}(e))}),!YV||jV);var HV=sr,KV=fM.ArrayBuffer;let WV;Fn({global:!0,forced:n.ArrayBuffer!==KV},{ArrayBuffer:KV}),HV("ArrayBuffer"),function(e){e[e.CHOOSE_SERVER=11]="CHOOSE_SERVER",e[e.CLOUD_PROXY=18]="CLOUD_PROXY",e[e.CLOUD_PROXY_5=20]="CLOUD_PROXY_5",e[e.CLOUD_PROXY_FALLBACK=26]="CLOUD_PROXY_FALLBACK"}(WV||(WV={}));var JV=eA,qV=Array.isArray||function(e){return"Array"==JV(e)},XV=Lc,zV=qV,ZV=NR,$V=lA,eQ=md("species"),tQ=XV.Array,iQ=function(e,t){return new(function(e){var t;return zV(e)&&(t=e.constructor,(ZV(t)&&(t===tQ||zV(t.prototype))||$V(t)&&null===(t=t[eQ]))&&(t=void 0)),void 0===t?tQ:t}(e))(0===t?0:t)},nQ=au,rQ=sA,oQ=rd,sQ=ju,aQ=iQ,cQ=Dc([].push),AQ=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,A,d,u){for(var E,l,h=oQ(c),p=rQ(h),_=nQ(A,d),I=sQ(p),g=0,f=u||aQ,R=t?f(c,I):i||s?f(c,0):void 0;I>g;g++)if((a||g in p)&&(l=_(E=p[g],g,h),e))if(t)R[g]=l;else if(l)switch(e){case 3:return!0;case 5:return E;case 6:return g;case 2:cQ(R,E)}else switch(e){case 4:return!1;case 7:cQ(R,E)}return o?-1:n||r?r:R}},dQ={forEach:AQ(0),map:AQ(1),filter:AQ(2),some:AQ(3),every:AQ(4),find:AQ(5),findIndex:AQ(6),filterReject:AQ(7)},uQ=dQ.forEach,EQ=Zu("forEach")?[].forEach:function(e){return uQ(this,e,arguments.length>1?arguments[1]:void 0)};Bu({target:"Array",proto:!0,forced:[].forEach!=EQ},{forEach:EQ});var lQ=rE("Array").forEach,hQ=_I,pQ=ad,_Q=wc,IQ=lQ,gQ=Array.prototype,fQ={DOMTokenList:!0,NodeList:!0},RQ=rd,CQ=D_;Bu({target:"Object",stat:!0,forced:Tc((function(){CQ(1)}))},{keys:function(e){return CQ(RQ(e))}});var TQ=hA.Object.keys,mQ=AE,SQ=Bu,OQ=qV,vQ=Dc([].reverse),NQ=[1,2];SQ({target:"Array",proto:!0,forced:String(NQ)===String(NQ.reverse())},{reverse:function(){return OQ(this)&&(this.length=this.length),vQ(this)}});var yQ=rE("Array").reverse,DQ=wc,wQ=yQ,bQ=Array.prototype,LQ=Tc,PQ=NA,kQ=md("species"),MQ=function(e){return PQ>=51||!LQ((function(){var t=[];return(t.constructor={})[kQ]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},UQ=Bu,BQ=Lc,VQ=qV,QQ=NR,xQ=lA,FQ=$p,GQ=ju,jQ=uA,YQ=Cb,HQ=md,KQ=kR,WQ=MQ("slice"),JQ=HQ("species"),qQ=BQ.Array,XQ=Math.max;UQ({target:"Array",proto:!0,forced:!WQ},{slice:function(e,t){var i,n,r,o=jQ(this),s=GQ(o),a=FQ(e,s),c=FQ(void 0===t?s:t,s);if(VQ(o)&&(i=o.constructor,(QQ(i)&&(i===qQ||VQ(i.prototype))||xQ(i)&&null===(i=i[JQ]))&&(i=void 0),i===qQ||void 0===i))return KQ(o,a,c);for(n=new(void 0===i?qQ:i)(XQ(c-a,0)),r=0;a<c;a++,r++)a in o&&YQ(n,r,o[a]);return n.length=r,n}});var zQ=rE("Array").slice,ZQ=wc,$Q=zQ,ex=Array.prototype;function tx(e,t,i,n,r){var o,s,a,c={};return function(e){var t=e.forEach;return e===gQ||_Q(gQ,e)&&t===gQ.forEach||pQ(fQ,hQ(e))?IQ:t}(o=TQ(n)).call(o,(function(e){c[e]=n[e]})),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=mQ(s=function(e){var t=e.reverse;return e===bQ||DQ(bQ,e)&&t===bQ.reverse?wQ:t}(a=function(e){var t=e.slice;return e===ex||ZQ(ex,e)&&t===ex.slice?$Q:t}(i).call(i)).call(a)).call(s,(function(i,n){return n(e,t,i)||i}),c),r&&void 0!==c.initializer&&(c.value=c.initializer?c.initializer.call(r):void 0,c.initializer=void 0),void 0===c.initializer&&(eD(e,t,c),c=null),c}var ix=rE("Array").values,nx=_I,rx=ad,ox=wc,sx=ix,ax=Array.prototype,cx={DOMTokenList:!0,NodeList:!0},Ax=function(e){var t=e.values;return e===ax||ox(ax,e)&&t===ax.values||rx(cx,nx(e))?sx:t},dx=rE("Array").keys,ux=_I,Ex=ad,lx=wc,hx=dx,px=Array.prototype,_x={DOMTokenList:!0,NodeList:!0},Ix=function(e){var t=e.keys;return e===px||lx(px,e)&&t===px.keys||Ex(_x,ux(e))?hx:t};function gx(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fx(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gx(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gx(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let Rx=0,Cx=0;function Tx(e,t,i){return new Mm(((n,r)=>{t.timeout=t.timeout||cb("HTTP_CONNECT_TIMEOUT"),t.responseType=t.responseType||"json",t.data&&!i?(t.data=JSON.stringify(t.data),Rx+=mG(t.data)):i&&(t.data.size?Rx+=t.data.size:t.data instanceof FormData?Rx+=function(e){let t=0;return/DingTalk/i.test(navigator.userAgent)&&e.realFormData&&(e=e.realFormData),e.forEach((e=>{t+="string"==typeof e?mG(e):e.size})),t+138}(t.data):Rx+=mG(JSON.stringify(t.data))),t.headers=t.headers||{},t.headers["Content-Type"]=t.headers["Content-Type"]||"application/json",t.method="POST",t.url=e,dw.request(t).then((e=>{"string"==typeof e.data?Cx+=mG(e.data):e.data instanceof ArrayBuffer||e.data instanceof Uint8Array?Cx+=e.data.byteLength:Cx+=mG(JSON.stringify(e.data)),n(e.data)})).catch((e=>{dw.isCancel(e)?r(new pw(hw.OPERATION_ABORTED,"cancel token canceled")):"ECONNABORTED"===e.code?r(new pw(hw.NETWORK_TIMEOUT,e.message)):e.response?r(new pw(hw.NETWORK_RESPONSE_ERROR,e.response.status)):r(new pw(hw.NETWORK_ERROR,e.message))}))}))}async function mx(e,t){const i=new Blob([t.data],{type:"buffer"});return await Tx(e,fx(fx({},t),{},{data:i,headers:{"Content-Type":"application/octet-stream"}}),!0)}const Sx=new class extends Ew{set networkState(e){mw.info("[".concat(this._moduleName,"]")+"network state changed, "+this._networkState+" -> "+e),this.emit(YP.NETWORK_STATE_CHANGE,e,this._networkState),e===jP.ONLINE?this.emit(YP.ONLINE):e===jP.OFFLINE&&(this.onlineWaiter=new Mm((e=>{this.once(YP.ONLINE,(()=>{this.onlineWaiter=void 0,e(jP.ONLINE)}))})),this.emit(YP.OFFLINE)),this._networkState=e}get networkState(){return this._networkState}constructor(){super(),tD(this,"_moduleName","network-indicator"),tD(this,"_networkState",jP.ONLINE),tD(this,"onlineWaiter",void 0),window.addEventListener("online",(()=>{this.networkState=jP.ONLINE})),window.addEventListener("offline",(()=>{this.networkState=jP.OFFLINE}))}};let Ox=!1;const vx=new class extends Ew{constructor(){super(...arguments),tD(this,"onAutoplayFailed",void 0),tD(this,"onAudioAutoplayFailed",void 0)}};function Nx(){const e=Dy();if(!Ox){const t=i=>{i.preventDefault(),Ox=!1,"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.removeEventListener("touchstart",t,!0),document.body.removeEventListener("mousedown",t,!0)):document.body.removeEventListener("click",t,!0)};Ox=!0,"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.addEventListener("touchstart",t,!0),document.body.addEventListener("mousedown",t,!0)):document.body.addEventListener("click",t,!0),mw.info("detect media autoplay failed, document: https://docs.agora.io/cn/Voice/autoplay_policy_web_ng?platform=Web"),vx.onAutoplayFailed?vx.onAutoplayFailed():vx.onAudioAutoplayFailed?mw.warning("AgoraRTC.onAudioAutoplayFailed has been deprecated in favor of AgoraRTC.onAutoplayFailed.\n\n  Please refer to the Agora document to migrate the newer API, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web ."):mw.warning("We have detected a media autoplay failed event, and found out that you haven't implemented AgoraRTC.onAutoplayFailed callback yet.\n\n  It will cause audio/video element not playing automatically on some browsers without user interaction, possibly hurting user experiences.\n\n  Please refer to the Agora document to properly handle autoplay failed event, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web ."),vx.emit("autoplay-failed")}}var yx;function Dx(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function wx(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dx(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Dx(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function bx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{report:Px};return function(t,i,n){const r=t[i];if("function"==typeof r){const o="AgoraRTCClient"===t.constructor.name?"Client":t.constructor.name;n.value=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const a=e.report.reportApiInvoke(this._sessionId||null,{name:"".concat(o,".").concat(i),options:n,tag:bL.TRACER});try{const e=r.apply(this,n);return a.onSuccess(),e}catch(e){throw a.onError(e),e}}}return n}}function Lx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{report:Px};return function(t,i,n){const r=t[i];if("function"==typeof r){const o="AgoraRTCClient"===t.constructor.name?"Client":t.constructor.name;n.value=async function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const a=e.report.reportApiInvoke(this._sessionId||null,{name:"".concat(o,".").concat(i),options:n,tag:bL.TRACER});try{const e=await r.apply(this,n);return a.onSuccess(),e}catch(e){throw a.onError(e),e}}}return n}}const Px=new(Ww("AgoraRTCEventReport")(yx=class{constructor(){tD(this,"baseInfoMap",new Map),tD(this,"proxyServer",void 0),tD(this,"clientList",_b),tD(this,"eventUploadTimer",void 0),tD(this,"setSessionIdTimer",void 0),tD(this,"url",void 0),tD(this,"backupUrl",void 0),tD(this,"keyEventUploadPendingItems",[]),tD(this,"normalEventUploadPendingItems",[]),tD(this,"apiInvokeUploadPendingItems",[]),tD(this,"apiInvokeCount",0),tD(this,"ltsList",[]),tD(this,"lastSendNormalEventTime",Date.now()),tD(this,"customReportCounterTimer",void 0),tD(this,"customReportCount",0),tD(this,"extApiInvoke",(async e=>{for(const t of e){const e=wx(wx({},t),{},{sid:null,invokeId:++this.apiInvokeCount,tag:bL.TRACER});this.sendApiInvoke(e)}})),this.eventUploadTimer=window.setInterval(this.doSend.bind(this),cb("EVENT_REPORT_SEND_INTERVAL")),this.setSessionIdTimer=window.setInterval(this.appendSessionId.bind(this),cb("EVENT_REPORT_SEND_INTERVAL"))}adjustSessionStartTime(e){if(!this.baseInfoMap.has(e)&&!this.baseInfoMap.get(e))return mw.error("adjust session ".concat(e," start time, sid is not exist or info is undefined")),void Yw("error",this,"adjustSessionStartTime","adjust session ".concat(e," start time, sid is not exist or info is undefined"));const t=this.baseInfoMap.get(e),i=Date.now(),n=t.startTime;t.startTime=i,mw.debug("rewrite session ".concat(e," startTime: ").concat(i," , ").concat(i-n,"ms")),Yw("debug",this,"adjustSessionStartTime",void 0,"rewrite session ".concat(e," startTime: ").concat(i," , ").concat(i-n,"ms")),this.baseInfoMap.set(e,t)}reportApiInvoke(e,t,i){t.timeout=t.timeout||6e4,t.reportResult=void 0===t.reportResult||t.reportResult;const n=Date.now();this.apiInvokeCount+=1;const r=this.apiInvokeCount,o=()=>({tag:t.tag,invokeId:r,sid:e,name:t.name,apiInvokeTime:n,options:t.options,states:t.states||null}),s=!!cb("SHOW_REPORT_INVOKER_LOG");s&&mw.info("".concat(t.name," start"),t.options);let a=!1;SG(t.timeout).then((()=>{a||(this.sendApiInvoke(wx(wx({},o()),{},{error:hw.API_INVOKE_TIMEOUT,success:!1})),mw.debug("".concat(t.name," timeout")))}));const c=new pw(hw.UNEXPECTED_ERROR,"".concat(t.name,": this api invoke is end"));return{onSuccess:e=>{const n=()=>{if(a)throw c;return a=!0,this.sendApiInvoke(wx(wx({},o()),{},{success:!0},t.reportResult&&{result:e})),s&&mw.info("".concat(t.name," onSuccess")),e};return i?YG(n,t.name+"Success",i,(()=>a=!0)):n()},onError:e=>{const n=()=>{if(a)throw e;a=!0,this.sendApiInvoke(wx(wx({},o()),{},{success:!1,error:e.toString()})),s&&mw.info("".concat(t.name," onFailure"),e.toString())};return i?YG(n,t.name+"Error",i,(()=>a=!0)):n()}}}sessionInit(e,t){if(this.baseInfoMap.has(e))return;const i=Date.now(),n=this.createBaseInfo(e,i);n.cname=t.cname;const r=Object.assign({},{willUploadConsoleLog:cb("UPLOAD_LOG"),maxTouchPoints:navigator.maxTouchPoints,areaVersion:zw?"global":"oversea",areas:cb("AREAS")&&cb("AREAS").join(",")},t.extend),o=Date.now(),s=wx(wx({},n),{},{eventType:NL.SESSION_INIT,appid:t.appid,browser:navigator.userAgent,build:qw,lts:o,elapse:o-i,extend:JSON.stringify(r),mode:t.mode,process:cb("PROCESS_ID"),success:!0,version:Xw});this.send({type:yL.SESSION,data:s},!0)}joinChooseServer(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.JOIN_CHOOSE_SERVER,lts:r,eventElapse:r-t.lts,chooseServerAddr:t.csAddr,errorCode:t.ec,elapse:r-i.startTime,success:t.succ,chooseServerAddrList:JSON.stringify(t.serverList),uid:t.uid?parseInt(t.uid):null,cid:t.cid?parseInt(t.cid):null,chooseServerIp:t.csIp||"",opid:t.opid,unilbsServerIds:t.unilbsServerIds,extend:t.extend||void 0});this.send({type:yL.JOIN_CHOOSE_SERVER,data:o},!0)}reqUserAccount(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.REQ_USER_ACCOUNT,lts:r,success:t.success,serverAddress:t.serverAddr,stringUid:t.stringUid,uid:t.uid,errorCode:t.errorCode,elapse:r-i.startTime,eventElapse:r-t.lts,extend:JSON.stringify(t.extend)});this.send({type:yL.REQ_USER_ACCOUNT,data:o},!0)}joinGateway(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info;t.vid&&(n.vid=t.vid),n.uid=t.uid,n.cid=t.cid;const r=Date.now(),{firstSuccess:o,avoidJoinStartTime:s,isProxy:a,addr:c}=t,A=r-(o&&s?s:i.startTime),d=wx(wx({},n),{},{eventType:NL.JOIN_GATEWAY,lts:r,gatewayAddr:t.addr,success:t.succ,errorCode:t.ec,elapse:A,eventElapse:r-t.lts,firstSuccess:o}),u=d.success?1:0;if(t.succ&&(i.lastJoinSuccessTime=r),o)this.send({type:yL.JOIN_GATEWAT,data:d},!0);else{let e;if(c)if(a){const t=c.match(/h=(\d{1,3}-){3}\d{1,3}/g),i=c.match(/p=[0-9]{1,6}/g);e={isSuccess:u,gatewayIp:t&&t.length?t[0].split("=")[1].replace(/-/g,"."):"",port:i&&i.length?i[0].split("=")[1]:"",isProxy:a?1:0}}else{const t=c.match(/wss:\/\/(\d{1,3}-){3}\d{1,3}/g),i=c.match(/:[0-9]{1,6}/g);e={isSuccess:u,gatewayIp:t&&t.length?t[0].split("//")[1].replace(/-/g,"."):"",port:i&&i.length?i[0].split(":")[1]:"",isProxy:a?1:0}}else e={isSuccess:u,gatewayIp:"",port:"",isProxy:a?1:0};delete d.success,delete d.eventType,delete d.firstSuccess,d.vid=Number(d.vid);const t=Object.assign({},d,e,{eventType:NL.REJOIN_GATEWAY});this.send({type:yL.RE_JOIN_GATEWAY,data:t},!0)}}joinChannelTimeout(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=Date.now(),r=wx(wx({},i.info),{},{lts:n,timeout:t,elapse:n-i.startTime});this.send({type:yL.JOIN_CHANNEL_TIMEOUT,data:r},!0)}publish(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.PUBLISH,lts:r,eventElapse:t.eventElapse,elapse:r-i.startTime,success:t.succ,errorCode:t.ec,videoName:t.videoName,audioName:t.audioName,screenName:t.screenName,screenshare:t.screenshare,audio:t.audio,video:t.video,p2pid:t.p2pid,publishRequestid:t.publishRequestid});this.send({type:yL.PUBLISH,data:o},!0)}subscribe(e,t,i){const n=this.baseInfoMap.get(e);if(!n)return;const r=n.info,o=Date.now(),s=wx(wx({},r),{},{eventType:NL.SUBSCRIBE,lts:o,eventElapse:t.eventElapse,elapse:o-n.startTime,success:t.succ,errorCode:t.ec,video:t.video,audio:t.audio,subscribeRequestid:t.subscribeRequestid,p2pid:t.p2pid},i&&{extend:JSON.stringify({isMassSubscribe:!0})});"string"==typeof t.peerid?s.peerSuid=t.peerid:s.peer=t.peerid,this.send({type:yL.SUBSCRIBE,data:s},!0)}wsCompressorInit(e){var t;const i=[...Ix(t=this.baseInfoMap).call(t)],n=i.length?i[0]:"UnableToGetSid",r=this.baseInfoMap.get(n);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx({},o),{},{eventType:NL.WS_COMPRESSOR_INIT,lts:s,eventElapse:e.eventElapse,elapse:s-r.startTime,status:e.status?1:2});this.send({type:yL.WS_COMPRESSOR_INIT,data:a},!0)}firstRemoteFrame(e,t,i,n){const r=this.baseInfoMap.get(e);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx(wx({},o),n),{},{elapse:s-r.startTime,eventType:t,lts:s});this.send({type:i,data:a},!0)}onGatewayStream(e,t,i,n){const r=this.baseInfoMap.get(e);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx(wx({},o),n),{},{eventType:t,lts:s});this.send({type:i,data:a},!0)}streamSwitch(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.STREAM_SWITCH,lts:r,isDual:t.isdual,elapse:r-i.startTime,success:t.succ});this.send({type:yL.STREAM_SWITCH,data:o},!0)}requestProxyAppCenter(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.REQUEST_PROXY_APPCENTER,lts:r,eventElapse:r-t.lts,elapse:r-i.startTime,APAddr:t.APAddr,workerManagerList:t.workerManagerList,response:t.response,errorCode:t.ec,success:t.succ});this.send({type:yL.REQUEST_PROXY_APPCENTER,data:o},!0)}requestProxyWorkerManager(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{eventType:NL.REQUEST_PROXY_WORKER_MANAGER,lts:r,eventElapse:r-t.lts,elapse:r-i.startTime,workerManagerAddr:t.workerManagerAddr,response:t.response,errorCode:t.ec,success:t.succ});this.send({type:yL.REQUEST_PROXY_WORKER_MANAGER,data:o},!0)}setProxyServer(e){this.proxyServer=e,e?mw.debug("reportProxyServerurl: ".concat(e)):mw.debug("disable reportProxyServerurl: ".concat(e)),Yw("debug",this,"setProxyServer",e)}peerPublishStatus(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx({},n),{},{subscribeElapse:t.subscribeElapse,peer:t.peer,peerPublishDuration:Math.max(t.audioPublishDuration,t.videoPublishDuration),audiotag:t.audioPublishDuration>0?1:-1,videotag:t.videoPublishDuration>0?1:-1,lts:r,elapse:r-i.startTime,joinChannelSuccessElapse:r-(i.lastJoinSuccessTime||r)});this.send({type:yL.PEER_PUBLISH_STATUS,data:o},!0)}workerEvent(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now();(function(e,t,i){const n=e[t];if(!n||"string"!=typeof n)return[e];e[t]="";const r=mG(JSON.stringify(e));let o=0;const s=[];let a=0;for(let i=0;i<n.length;i++)a+=n.charCodeAt(i)<=127?1:3,a<=1300-r||(s[s.length]=TG(TG({},e),{},{[t]:n.substring(o,i)}),o=i,a=n.charCodeAt(i)<=127?1:3);return o!==n.length-1&&(s[s.length]=TG(TG({},e),{},{[t]:n.substring(o)})),s})(wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r,productType:"WebRTC"}),"payload").forEach((e=>this.send({type:yL.WORKER_EVENT,data:e},!0)))}apworkerEvent(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r});this.send({type:yL.AP_WORKER_EVENT,data:o},!0)}joinWebProxyAP(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r,extend:t.extend||void 0});this.send({type:yL.JOIN_WEB_PROXY_AP,data:o},!0)}WebSocketQuit(e,t){const i=this.baseInfoMap.get(e);if(!i)return;const n=i.info,r=Date.now(),o=wx(wx(wx({},n),t),{},{elapse:r-i.startTime,lts:r});this.send({type:yL.WEBSOCKET_QUIT,data:o},!0)}async sendCustomReportMessage(e,t){if(this.customReportCount+=t.length,this.customReportCount>cb("CUSTOM_REPORT_LIMIT"))throw new pw(hw.CUSTOM_REPORT_FREQUENCY_TOO_HIGH);this.customReportCounterTimer||(this.customReportCounterTimer=window.setInterval((()=>{this.customReportCount=0}),5e3));const i=t.map((t=>({type:yL.USER_ANALYTICS,data:wx({sid:e},t)}))),n={msgType:"EventMessages",sentTs:Math.round(Date.now()/1e3),payloads:i.map((e=>JSON.stringify(e)))};try{await this.postDataToStatsCollector(n)}catch(e){throw mw.error("send custom report message failed",e.toString()),new pw(hw.CUSTOM_REPORT_SEND_FAILED,e.message)}}autoplayFailed(e,t,i,n){if(!e)return;const r=this.baseInfoMap.get(e);if(!r)return;const o=r.info,s=Date.now(),a=wx(wx({},o),{},{vid:void 0===o.vid?0:Number(o.vid),lts:s,elapse:s-r.startTime,cbRegistered:vx.onAutoplayFailed||vx.onAudioAutoplayFailed?1:-1,errorMsg:i,mediaType:t,trackId:n,extend:void 0});this.send({type:yL.AUTOPLAY_FAILED,data:a},!0)}sendApiInvoke(e){const t=cb("NOT_REPORT_EVENT");if(e.tag&&t.includes&&t.includes(e.tag))return!1;if(null===e.sid)return this.apiInvokeUploadPendingItems.push(e),!1;const i=this.baseInfoMap.get(e.sid);if(!i)return this.apiInvokeUploadPendingItems.push(e),!1;const{cname:n,uid:r,cid:o}=i.info;e.lts=e.lts||Date.now();const s={invokeId:e.invokeId,sid:e.sid,cname:n,cid:o,uid:r,lts:e.lts,success:e.success,elapse:e.lts-i.startTime,execElapse:e.lts-e.apiInvokeTime,apiName:e.name,options:e.options?JSON.stringify(e.options):void 0,execStates:e.states?JSON.stringify(e.states):void 0,execResult:e.result?JSON.stringify(e.result):void 0,errorCode:e.error?JSON.stringify(e.error):void 0};return this.send({type:yL.API_INVOKE,data:s},!1),!0}appendSessionId(){this.clientList.forEach((e=>{if(e._sessionId){const t=this.apiInvokeUploadPendingItems.length;for(let i=0;i<t;i++){const t=this.apiInvokeUploadPendingItems.shift();t&&(t.sid=e._sessionId,this.sendApiInvoke(Object.assign({},t)))}}}))}send(e,t){if(t)return this.keyEventUploadPendingItems.push(e),void this.sendItems(this.keyEventUploadPendingItems,!0);this.normalEventUploadPendingItems.push(e),this.normalEventUploadPendingItems.length>cb("NORMAL_EVENT_QUEUE_CAPACITY")&&this.normalEventUploadPendingItems.splice(0,1),this.normalEventUploadPendingItems.length>=10&&this.sendItems(this.normalEventUploadPendingItems,!1)}doSend(){this.keyEventUploadPendingItems.length>0&&this.sendItems(this.keyEventUploadPendingItems,!0),this.normalEventUploadPendingItems.length>0&&Date.now()-this.lastSendNormalEventTime>=5e3&&this.sendItems(this.normalEventUploadPendingItems,!1)}sendItems(e,t){const i=[],n=[];for(;e.length;){const t=e.shift();i.length<20?i.push(t):n.push(t)}e.push(...n);for(const e of[...i]){var r;-1!==this.ltsList.indexOf(e.data.lts)?(e.data.lts=this.ltsList[this.ltsList.length-1]+1,this.ltsList.push(e.data.lts)):(this.ltsList.push(e.data.lts),AL(r=this.ltsList).call(r,((e,t)=>e-t)))}t||(this.lastSendNormalEventTime=Date.now());const o={msgType:"EventMessages",sentTs:Math.round(Date.now()/1e3),payloads:i.map((e=>JSON.stringify(e))),vid:(e=>{const t=e&&e.data.sid&&this.baseInfoMap.get(e.data.sid);return t&&t.info.vid&&+t.info.vid||0})(i[0])};return i.length&&this.postDataToStatsCollector(o).catch((e=>i=>{cb("EVENT_REPORT_RETRY")&&(t?this.keyEventUploadPendingItems=this.keyEventUploadPendingItems.concat(e):(this.normalEventUploadPendingItems=this.normalEventUploadPendingItems.concat(e),this.normalEventUploadPendingItems.length>cb("NORMAL_EVENT_QUEUE_CAPACITY")&&(this.normalEventUploadPendingItems.splice(0,this.normalEventUploadPendingItems.length-cb("NORMAL_EVENT_QUEUE_CAPACITY")),mw.warning("report: drop normal events"))))})(i)),e}async postDataToStatsCollector(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Sx.networkState===jP.OFFLINE&&await Mm.race([Sx.onlineWaiter,SG(2*_w.maxRetryTimeout)]);const i=t?"/events/proto-raws":"/events/messages";let n=this.url||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(cb("EVENT_REPORT_DOMAIN"),"&p=6443&d=").concat(i):"https://".concat(cb("EVENT_REPORT_DOMAIN"),":6443").concat(i));for(let r=0;r<2;r+=1){1===r&&(n=this.backupUrl||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(cb("EVENT_REPORT_BACKUP_DOMAIN"),"&p=6443&d=").concat(i):"https://".concat(cb("EVENT_REPORT_BACKUP_DOMAIN"),":6443").concat(i)));try{t?await mx(n,{timeout:1e4,data:e}):await Tx(n,{timeout:1e4,data:e})}catch(e){if(1===r)throw e;continue}return}}createBaseInfo(e,t){const i=Object.assign({},vL);return i.sid=e,this.baseInfoMap.set(e,{info:i,startTime:t}),i}reportResourceTiming(e,t){const i=performance.getEntriesByName(e),n=i[i.length-1];n&&this.reportApiInvoke(t,{name:"Client.resourceTiming",options:n,tag:bL.TRACER}).onSuccess()}})||yx);lw.on("REPORT_LOG_UPLOAD",(e=>{e.networkState=Sx.networkState,Px.reportApiInvoke(null,{name:"logUploadError",options:e,tag:bL.TRACER})}));class kx extends Ew{constructor(e,t){super(),tD(this,"trackMediaType",void 0),tD(this,"_ID",void 0),tD(this,"_hints",[]),tD(this,"_isClosed",!1),tD(this,"_originMediaStreamTrack",void 0),tD(this,"_mediaStreamTrack",void 0),tD(this,"_external",{}),this._ID=t||vG(8,"track-"),this._originMediaStreamTrack=e,this._mediaStreamTrack=e,function(e){Ib.includes(e)||Ib.push(e)}(this)}toString(){return this._ID}getTrackId(){return this._ID}getMediaStreamTrack(e){if(!e){const e=Px.reportApiInvoke(null,{name:wL.GET_MEDIA_STREAM_TRACK,options:[],tag:bL.TRACER});this._mediaStreamTrack&&"string"==typeof this._mediaStreamTrack.label?e.onSuccess(this._mediaStreamTrack.label):e.onSuccess("")}return this._mediaStreamTrack}getMediaStreamTrackSettings(){return this.getMediaStreamTrack(!0).getSettings()}close(){this._isClosed=!0,function(e){const t=Ib.indexOf(e);-1!==t&&Ib.splice(t,1)}(this),this.emit(DP.CLOSED)}}let Mx,Ux,Bx,Vx=1;class Qx{constructor(e){tD(this,"lockingPromise",Mm.resolve()),tD(this,"locks",0),tD(this,"name",""),tD(this,"lockId",void 0),this.lockId=Vx++,e&&(this.name=e),mw.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}get isLocked(){return this.locks>0}lock(e){let t;this.locks+=1,mw.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is locked, current queue ").concat(this.locks,". ").concat("string"==typeof e?e:""));const i=new Mm((i=>{t=()=>{this.locks-=1,mw.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is not locked, current queue ").concat(this.locks,". ").concat("string"==typeof e?e:"")),i()}})),n=this.lockingPromise.then((()=>t));return this.lockingPromise=this.lockingPromise.then((()=>i)),n}}function xx(e,t){return function(i,n,r){const o=i[n];if("function"!=typeof o)throw new Error("Cannot use mutex on object property.");return r.value=async function(){const i=this[t];if(!i)throw new Error("mutex property key ".concat(t," doesn't exist on ").concat(e));const r=await i.lock("From ".concat(e,".").concat(n));try{for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];return await o.apply(this,a)}finally{r()}},r}}class Fx extends kx{get muted(){return this._muted}get enabled(){return this._enabled}constructor(e,t){super(e,t),tD(this,"_enabled",!0),tD(this,"_muted",!1),tD(this,"_isClosed",!1),tD(this,"_trackProcessors",[]),tD(this,"_enabledMutex",void 0),tD(this,"processor",void 0),tD(this,"processorContext",void 0),tD(this,"_handleTrackEnded",(()=>{this.onTrackEnded()})),this._enabledMutex=new Qx("".concat(t)),e.addEventListener("ended",this._handleTrackEnded)}getTrackLabel(){return this._originMediaStreamTrack.label}close(){this._isClosed||(this.stop(),this._trackProcessors.forEach((e=>e.destroy())),this._trackProcessors=[],this._originMediaStreamTrack.stop(),this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack.stop(),this._mediaStreamTrack=null),this._originMediaStreamTrack=null,this._enabledMutex=null,mw.debug("[".concat(this.getTrackId(),"] close")),Yw("debug",this,"close"),this.emit(OP.NEED_CLOSE),super.close())}async _registerTrackProcessor(e){if(-1!==this._trackProcessors.indexOf(e))return;const t=this._trackProcessors[this._trackProcessors.length-1];this._trackProcessors.push(e),e.onOutputChange=async()=>{const t=e.output||this._originMediaStreamTrack;this._mediaStreamTrack=t,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)},t?(t.onOutputChange=async()=>{t.output&&await e.setInput(t.output)},await e.setInput(t.output||t.input||this._originMediaStreamTrack)):await e.setInput(this._originMediaStreamTrack)}_getOutputFromProcessors(){if(0===this._trackProcessors.length)return this._originMediaStreamTrack;const e=this._trackProcessors[this._trackProcessors.length-1];return e.output||e.input||this._originMediaStreamTrack}async _updateOriginMediaStreamTrack(e,t){if(e!==this._originMediaStreamTrack){if(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),t&&this._originMediaStreamTrack.stop(),e.addEventListener("ended",this._handleTrackEnded),this._originMediaStreamTrack=e,this._trackProcessors.length>0){await this._trackProcessors[0].setInput(e);const t=this._getOutputFromProcessors();this._mediaStreamTrack=t}else this._mediaStreamTrack=this._originMediaStreamTrack;this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this),this.processor&&this.processor.updateInput({track:this._originMediaStreamTrack,context:this.processorContext})}}_getDefaultPlayerConfig(){return{}}onTrackEnded(){mw.debug("[".concat(this.getTrackId(),"] track ended")),jw("debug",["MediaStreamTrack",this.getTrackId()],"ended"),this.emit(DP.TRACK_ENDED)}stateCheck(e,t){if(mw.debug("check track state, [muted: ".concat(this._muted,", enabled: ").concat(this._enabled,"] to [").concat(e,": ").concat(t,"]")),Yw("debug",this,"stateCheck",{stateName:e,state:t,muted:this._muted,enabled:this._enabled}),dL(t,e),this._enabled&&this._muted&&"enabled"===e&&!1===t)throw new pw(hw.TRACK_STATE_UNREACHABLE,"cannot set enabled while the track is muted").print();if(!this._enabled&&!this._muted&&"muted"===e&&!0===t)throw new pw(hw.TRACK_STATE_UNREACHABLE,"cannot set muted while the track is disabled").print()}getProcessorStats(){return this.processorContext.gatherStats()}}!function(e){e.IOS_15_INTERRUPTION_START="ios15-interruption-start",e.IOS_15_INTERRUPTION_END="ios15-interruption-end",e.IOS_INTERRUPTION_START="ios-interruption-start",e.IOS_INTERRUPTION_END="ios-interruption-end",e.STATE_CHANGE="state-change"}(Mx||(Mx={})),function(e){e.AUDIO_CONTEXT_CREATED="audio_context_created"}(Ux||(Ux={})),function(e){e.AIDenoiser="AIDenoiser"}(Bx||(Bx={}));const Gx={audioContextInitOptions:{}},jx=new class extends Ew{constructor(){super(),tD(this,"registeredPlugins",[])}setOptions(e,t){Gx[e]&&(Gx[e]=t)}getOptions(e){return Gx[e]}installPlugin(e){e instanceof Object&&e.name&&this.registeredPlugins.push(e.name)}},Yx=window.AudioContext||window.webkitAudioContext;let Hx=null;const Kx=new class extends Ew{constructor(){super(...arguments),tD(this,"prevState",void 0),tD(this,"curState",void 0),tD(this,"interruptDetectorTrack",void 0),tD(this,"onLocalAudioTrackMute",(()=>{mw.info("ios15-interruption-start"),Fw("info",["WebAudio"],"ios15-interruption-start"),this.emit(Mx.IOS_15_INTERRUPTION_START)})),tD(this,"onLocalAudioTrackUnmute",(async()=>{mw.info("ios15-interruption-end"),Fw("info",["WebAudio"],"ios15-interruption-end"),"running"!==this.curState||this.duringInterruption?mw.info("ios15-interruption-end-canceled"):(Hx&&await Hx.suspend(),this.emit(Mx.IOS_15_INTERRUPTION_END))}))}get duringInterruption(){return"running"===this.prevState&&"interrupted"===this.curState}bindInterruptDetectorTrack(e){mw.debug("webaudio bindInterruptDetectorTrack ".concat(e.getTrackId())),Yw("debug",["WebAudio"],"bindInterruptDetectorTrack",e.getTrackId()),this.interruptDetectorTrack||(this.interruptDetectorTrack=e,this.interruptDetectorTrack._mediaStreamTrack.onmute=this.onLocalAudioTrackMute,this.interruptDetectorTrack._mediaStreamTrack.onunmute=this.onLocalAudioTrackUnmute)}unbindInterruptDetectorTrack(e){mw.debug("webaudio unbindInterruptDetectorTrack ".concat(e.getTrackId())),Yw("debug",["WebAudio"],"unbindInterruptDetectorTrack",e.getTrackId()),this.interruptDetectorTrack&&this.interruptDetectorTrack===e&&(this.interruptDetectorTrack._mediaStreamTrack&&(this.interruptDetectorTrack._mediaStreamTrack.onmute=null,this.interruptDetectorTrack._mediaStreamTrack.onunmute=null),this.interruptDetectorTrack=void 0)}};function Wx(){if(!Hx){if(function(){if(!Yx)return mw.error("your browser is not support web audio"),void xw("error",["WebAudio"],"your browser is not support web audio");mw.info("create audio context"),Hw("info",["WebAudio"],"WebAudioContext");const e=jx.getOptions("audioContextInitOptions");mw.debug("audio content init option:",JSON.stringify(e)),Hx=new Yx(e),jx.emit(Ux.AUDIO_CONTEXT_CREATED,Hx),Kx.curState=Hx.state,Hx.onstatechange=()=>{Kx.prevState=Kx.curState,Kx.curState=Hx?Hx.state:void 0,(Vy()||jy())&&"running"===Kx.prevState&&"interrupted"===Kx.curState&&(mw.info("ios-interruption-start"),Fw("info",["AudioState"],"ios-interruption-start"),Kx.emit(Mx.IOS_INTERRUPTION_START)),(Vy()||jy())&&"interrupted"===Kx.prevState&&"running"===Kx.curState&&(mw.info("ios-interruption-end"),Fw("info",["AudioState"],"ios-interruption-end"),Kx.emit(Mx.IOS_INTERRUPTION_END)),Kx.prevState!==Kx.curState&&(mw.debug("AudioContext State Change","".concat(Kx.prevState,"=>").concat(Kx.curState)),jw("debug",["AudioContext",void 0],"statechange","".concat(Kx.prevState,"=>").concat(Kx.curState)),Kx.emit(Mx.STATE_CHANGE))},async function(e){const t=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","touchend","keydown","keyup"];let i,n=!1,r=!1,o=!1;function s(t){"running"===e.state?a(!1):Vy()||jy()?"suspended"===e.state&&(a(!0),t&&e.resume().then(c,c)):"closed"!==e.state&&(a(!0),t&&e.resume().then(c,c))}function a(e){if(n!==e){n=e;for(let i=0,n=t;i<n.length;i+=1){const t=n[i];e?window.addEventListener(t,A,{capture:!0,passive:!0}):window.removeEventListener(t,A,{capture:!0,passive:!0})}}}function c(){s(!1)}function A(){s(!0)}function d(e){if(!o)if(i.paused)if(e){let t;u(!1),o=!0;try{t=i.play(),t?t.then(E,E):(i.addEventListener("playing",E),i.addEventListener("abort",E),i.addEventListener("error",E))}catch(e){E()}}else u(!0);else u(!1)}function u(e){if(r!==e){r=e;for(let i=0,n=t;i<n.length;i++){const t=n[i];e?window.addEventListener(t,l,{capture:!0,passive:!0}):window.removeEventListener(t,l,{capture:!0,passive:!0})}}}function E(){i.removeEventListener("playing",E),i.removeEventListener("abort",E),i.removeEventListener("error",E),o=!1,d(!1)}function l(){d(!0)}if(Vy()){const t=e.createMediaStreamDestination(),n=document.createElement("div");n.innerHTML="<audio x-webkit-airplay='deny'></audio>",i=n.children.item(0),i.controls=!1,i.disableRemotePlayback=!0,i.preload="auto",i.srcObject=t.stream,d(!0)}Kx.on(Mx.STATE_CHANGE,(function(){s(!0)})),s(!1)}(Hx)}(),!Hx)throw new pw(hw.NOT_SUPPORTED,"can not create audio context");return Hx}return Hx}function Jx(e){if(function(){if(null!==qx)return qx;const e=Wx(),t=e.createBufferSource(),i=e.createGain(),n=e.createGain();t.connect(i),t.connect(n),t.disconnect(i);let r=!1;try{t.disconnect(i)}catch(e){r=!0}return t.disconnect(),qx=r,r}())return;Yw("debug",["WebAudio"],"polyfillAudioNode");const t=e.connect,i=e.disconnect;e.connect=(i,n,r)=>(e._inputNodes||(e._inputNodes=[]),e._inputNodes.includes(i)||(i instanceof AudioNode?(e._inputNodes.push(i),t.call(e,i,n,r)):t.call(e,i,n)),e),e.disconnect=(n,r,o)=>{i.call(e),n?MG(e._inputNodes,n):e._inputNodes=[];for(const i of e._inputNodes)t.call(e,i)}}let qx=null;function Xx(e,t){const i=1/t,n=Wx();let r=n.createGain();r.gain.value=0,r.connect(n.destination);let o=!1;const s=()=>{if(o)return void(r=null);const t=n.createOscillator();t.onended=s,t.connect(r),t.start(0),t.stop(n.currentTime+i),e(n.currentTime)};return s(),()=>{o=!0}}const zx=mw.prefix("[inject-node]");class Zx{constructor(){tD(this,"nodeLists",[]),tD(this,"prevNode",void 0),tD(this,"nextNode",void 0)}get firstNode(){return this.nodeLists[0]}get lastNode(){return this.nodeLists[this.nodeLists.length-1]}get isActive(){return!!this.nodeLists.length}get isConnected(){return!(!this.prevNode||!this.nextNode)}connect(e,t){zx.debug("connect audio node, current list:"+this.nodeLists.length),this.nodeLists.length?(this.prevNode&&this.prevNode.disconnect(),e.connect(this.firstNode),this.nextNode&&this.lastNode&&this.lastNode.disconnect(),this.lastNode.connect(t),this.nodeLists.forEach(((e,t)=>{const i=this.nodeLists[t+1];i&&e.connect(i)}))):e.connect(t),this.nextNode=t,this.prevNode=e}disconnect(){var e;zx.debug("disconnect audio node, current list:"+this.nodeLists.length),this.nodeLists.forEach((e=>{e.disconnect()})),null===(e=this.prevNode)||void 0===e||e.disconnect(),this.prevNode=void 0,this.nextNode=void 0}addNode(e){zx.debug("add node in inject node, current list:",this.nodeLists.length),this.prevNode&&this.nextNode?(this.firstNode||(zx.debug("new node is the first node"),this.prevNode.disconnect(),this.prevNode.connect(e),e.connect(this.nextNode)),this.nextNode&&this.lastNode&&(this.lastNode.disconnect(this.nextNode),this.lastNode.connect(e),e.connect(this.nextNode)),this.nodeLists.push(e)):zx.debug("add node is called before inject node connected")}removeNode(e){zx.debug("remove node in inject node, current list:",this.nodeLists.length);const t=this.nodeLists.indexOf(e);if(-1===t)return void zx.debug("$[inject-node] cannot find the node to be removed");const i=this.nodeLists[t+1],n=this.nodeLists[t-1];0===t&&this.prevNode&&this.nextNode&&(this.prevNode.disconnect(e),i?this.prevNode.connect(i):this.prevNode.connect(this.nextNode)),t===this.nodeLists.length-1&&this.nextNode&&n&&(n.disconnect(e),n.connect(this.nextNode)),0!==t&&t!==this.nodeLists.length-1&&(n.disconnect(e),n.connect(i)),zx.debug("remove node in inject node success, current list:",this.nodeLists.length)}}class $x extends Ew{get processSourceNode(){return this.sourceNode}set processedNode(e){var t;if(!this.isDestroyed&&this._processedNode!==e){try{var i;null===(i=this.sourceNode)||void 0===i||i.disconnect(this.outputNode)}catch(e){}null===(t=this._processedNode)||void 0===t||t.disconnect(),this._processedNode=e,this.connect()}}get processedNode(){return this._processedNode}constructor(){super(),tD(this,"outputNode",void 0),tD(this,"outputTrack",void 0),tD(this,"isPlayed",!1),tD(this,"sourceNode",void 0),tD(this,"analyserNode",void 0),tD(this,"context",void 0),tD(this,"audioBufferNode",void 0),tD(this,"destNode",void 0),tD(this,"injectNode",void 0),tD(this,"audioOutputLevel",0),tD(this,"_processedNode",void 0),tD(this,"playNode",void 0),tD(this,"isDestroyed",!1),tD(this,"onNoAudioInput",void 0),tD(this,"isNoAudioInput",!1),tD(this,"_noAudioInputCount",0),this.context=Wx(),this.playNode=this.context.destination,this.outputNode=this.context.createGain(),Jx(this.outputNode),this.analyserNode=this.context.createAnalyser(),this.analyserNode.smoothingTimeConstant=.4,this.analyserNode.fftSize=2048,this.injectNode=new Zx}startGetAudioBuffer(e){this.audioBufferNode||(this.audioBufferNode=this.context.createScriptProcessor(e),this.outputNode.connect(this.audioBufferNode),this.audioBufferNode.connect(this.context.destination),this.audioBufferNode.onaudioprocess=e=>{this.emit(qL.ON_AUDIO_BUFFER,function(e){for(let t=0;t<e.outputBuffer.numberOfChannels;t+=1){const i=e.outputBuffer.getChannelData(t);for(let e=0;e<i.length;e+=1)i[e]=0}return e.inputBuffer}(e))})}stopGetAudioBuffer(){this.audioBufferNode&&(this.audioBufferNode.onaudioprocess=null,this.outputNode.disconnect(this.audioBufferNode),this.audioBufferNode=void 0)}createOutputTrack(){if(!XP().webAudioMediaStreamDest)throw new pw(hw.NOT_SUPPORTED,"your browser is not support audio processor");return this.destNode&&this.outputTrack||(this.destNode=this.context.createMediaStreamDestination(),this.outputNode.connect(this.destNode),this.outputTrack=this.destNode.stream.getAudioTracks()[0]),this.outputTrack}play(e){"running"!==this.context.state&&BG((()=>{Kx.emit("autoplay-failed")})),this.isPlayed=!0,this.playNode=e||this.context.destination,this.outputNode.connect(this.playNode)}stop(){if(this.isPlayed)try{this.outputNode.disconnect(this.playNode)}catch(e){}this.isPlayed=!1}getAccurateVolumeLevel(){if(!this.context||Vy()||jy()||"running"!==this.context.state&&this.context.resume(),!this.analyserNode)return 0;const e=new Uint8Array(this.analyserNode.frequencyBinCount);this.analyserNode.getByteFrequencyData(e);let t=0;for(let i=0;i<e.length;i++)t+=i<64?Math.abs(10*e[i]):Math.abs(6*e[i]/15);return t/e.length/255}async checkHasAudioInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e>5)return this.isNoAudioInput=!0,this.onNoAudioInput&&this.onNoAudioInput(),!1;if(Vy()||jy()?"suspended"===this.context.state&&this.context.resume():"running"!==this.context.state&&this.context.resume(),!this.analyserNode)return!1;const t=new Uint8Array(this.analyserNode.frequencyBinCount);this.analyserNode.getByteFrequencyData(t);let i=!1;for(let e=0;e<t.length;e++)0!==t[e]&&(i=!0);return i?(this.isNoAudioInput=!1,!0):(await SG(200),await this.checkHasAudioInput(e?e+1:1)&&i)}getAudioVolume(){return this.outputNode.gain.value}setVolume(e){this.outputNode.gain.setValueAtTime(e,this.context.currentTime)}destroy(){this.disconnect(),this.stop(),this.isDestroyed=!0,this.onNoAudioInput=void 0}injectAudioNode(e){this.injectNode.addNode(e)}removeAudioNode(e){this.injectNode.removeNode(e)}disconnect(){var e,t;null===(e=this.processedNode)||void 0===e||e.disconnect(),null===(t=this.sourceNode)||void 0===t||t.disconnect(),this.outputNode&&this.outputNode.disconnect()}connect(){var e;this.processedNode?null===(e=this.processedNode)||void 0===e||e.connect(this.outputNode):this.sourceNode&&this.sourceNode.connect(this.outputNode),this.outputNode.connect(this.analyserNode)}}class eF extends $x{get isFreeze(){return!1}constructor(e,t){var i;if(super(),tD(this,"sourceNode",void 0),tD(this,"track",void 0),tD(this,"audioElement",void 0),tD(this,"isCurrentTrackCloned",!1),tD(this,"isRemoteTrack",!1),tD(this,"rebuildWebAudio",(async()=>{if(mw.debug("ready to rebuild web audio, state:",this.context.state),this.isNoAudioInput&&await this.checkHasAudioInput(),!this.isNoAudioInput||this.isDestroyed)return document.body.removeEventListener("click",this.rebuildWebAudio,!0),void mw.debug("rebuild web audio success, current volume status",this.getAccurateVolumeLevel());this.context.resume().then((()=>mw.info("resume success"))),mw.debug("rebuild web audio because of ios 12 bugs"),this.disconnect();const e=this.track;this.track=this.track.clone(),this.isCurrentTrackCloned?e.stop():this.isCurrentTrackCloned=!0;const t=new MediaStream([this.track]);this.sourceNode=this.context.createMediaStreamSource(t),Jx(this.sourceNode),this.analyserNode=this.context.createAnalyser();const i=this.outputNode.gain.value;this.outputNode=this.context.createGain(),this.outputNode.gain.setValueAtTime(i,this.context.currentTime),Jx(this.outputNode),this.emit(qL.UPDATE_SOURCE),this.connect(),this.audioElement.srcObject=t,this.isPlayed&&this.play(this.playNode),this.checkHasAudioInput()})),"audio"!==e.kind)throw new pw(hw.UNEXPECTED_ERROR);this.track=e;const n=new MediaStream([this.track]);this.isRemoteTrack=!!t,this.sourceNode=this.context.createMediaStreamSource(n),Jx(this.sourceNode),this.connect(),this.audioElement=document.createElement("audio"),this.audioElement.srcObject=n;const r=Dy();t&&r.os===Sy.IOS&&Number(null===(i=r.osVersion)||void 0===i?void 0:i.split(".")[0])<15&&(Kx.on(Mx.STATE_CHANGE,(()=>{"suspended"===this.context.state?document.body.addEventListener("click",this.rebuildWebAudio,!0):"running"===this.context.state&&this.rebuildWebAudio()})),this.checkHasAudioInput().then((e=>{e||document.body.addEventListener("click",this.rebuildWebAudio,!0)})))}updateTrack(e){this.sourceNode.disconnect(),this.track=e,this.isCurrentTrackCloned=!1;const t=new MediaStream([e]);this.sourceNode=this.context.createMediaStreamSource(t),Jx(this.sourceNode),this.processedNode||this.sourceNode.connect(this.outputNode),this.emit(qL.UPDATE_SOURCE),this.audioElement.srcObject=t}destroy(){this.audioElement.srcObject=null,this.audioElement.remove(),Kx.off("state-change",this.rebuildWebAudio),super.destroy()}}async function tF(e,t){const i=(e,t)=>e?"number"!=typeof e?e.max||e.exact||e.ideal||e.min||t:e:t,n={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxHeight:i(t.height,1080),maxWidth:i(t.width,1920)}}};return t.frameRate&&"number"!=typeof t.frameRate?(n.video.mandatory.maxFrameRate=t.frameRate.max,n.video.mandatory.minFrameRate=t.frameRate.min):"number"==typeof t.frameRate&&(n.video.mandatory.maxFrameRate=t.frameRate),await navigator.mediaDevices.getUserMedia(n)}async function iF(e){let t=["window","screen"];"application"!==e&&"window"!==e||(t=["window"]),"screen"===e&&(t=["screen"]);const i=rF();if(!i)throw new pw(hw.ELECTRON_IS_NULL);let n=null;try{n=i.desktopCapturer.getSources({types:t})}catch(e){n=null}n&&n.then||(n=new Mm(((e,n)=>{i.desktopCapturer.getSources({types:t},((t,i)=>{t?n(t):e(i)}))})));try{return await n}catch(e){throw new pw(hw.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR,e.toString())}}let nF=null;function rF(){if(nF)return nF;try{return nF=window.require("electron"),nF}catch(e){return null}}const oF=new Qx("safari");let sF=!1,aF=!1;async function cF(e,t){let i=0,n=null;for(;i<2;)try{n=await AF(e,t,i>0);break}catch(n){if(n instanceof pw)throw mw.error("[".concat(t,"] ").concat(n.toString())),Yw("error",[],"getLocalStream",{config:e,id:t},n.toString()),n;const r=dF(n.name||n.code||n,n.message);if(r.code===hw.MEDIA_OPTION_INVALID){mw.debug("[".concat(t,"] detect media option invalid, retry")),xw("debug",[],"[".concat(t,"] detect media option invalid, retry")),i+=1,await SG(500);continue}throw mw.error("[".concat(t,"] ").concat(r.toString())),Yw("error",[],"getLocalStream",{config:e,id:t},r.toString()),r}if(!n)throw new pw(hw.UNEXPECTED_ERROR,"can not find stream after getUserMedia");return n}async function AF(e,t,i){if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new pw(hw.NOT_SUPPORTED,"can not find getUserMedia");i&&(e.video&&(delete e.video.width,delete e.video.height),e.screen&&(delete e.screen.width,delete e.screen.height));const n=XP(),r=new MediaStream;if(e.audioSource&&r.addTrack(e.audioSource),e.videoSource&&r.addTrack(e.videoSource),!e.audio&&!e.video&&!e.screen)return mw.debug("Using Video Source/ Audio Source"),xw("debug",[],"Using Video Source/ Audio Source"),r;if(e.screen)if(rF())e.screen.sourceId?uF(r,await tF(e.screen.sourceId,e.screen)):uF(r,await async function(e){const t=await iF(e.mediaSource),i=await function(e){return new Mm(((t,i)=>{const n=document.createElement("div");n.innerText="share screen",n.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom:  solid 1px #B9B8B9;");const r=document.createElement("div");r.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");const o=document.createElement("div");o.innerText="Agora Web Screensharing wants to share the contents of your screen with webdemo.agorabeckon.com. Choose what you'd like to share.",o.setAttribute("style","height: 12%;");const s=document.createElement("div");s.setAttribute("style","width: 100%; height: 80%; background: #FFF; border:  solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");const a=document.createElement("div");a.setAttribute("style","text-align: right; padding: 16px 0;");const c=document.createElement("button");c.innerHTML="cancel",c.setAttribute("style","width: 85px;"),c.onclick=()=>{document.body.removeChild(A);const e=new Error("NotAllowedError");e.name="NotAllowedError",i(e)},a.appendChild(c),r.appendChild(o),r.appendChild(s),r.appendChild(a);const A=document.createElement("div");A.setAttribute("style","position: fixed; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),A.appendChild(n),A.appendChild(r),document.body.appendChild(A),e.map((e=>{if(e.id){const i=document.createElement("div");i.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;");let n=e.thumbnail;const{width:r}=n.getSize();r>1920&&(n=n.resize({width:1920})),i.innerHTML='<div style="height: 120px; display: table-cell; vertical-align: middle;"><img style="width: 100%; background: #333333; box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.2);" src='+n.toDataURL()+' /></div><span style="\theight: 40px; line-height: 40px; display: inline-block; width: 70%; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+e.name.replace(/[\u00A0-\u9999<>\&]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))+"</span>",i.onclick=()=>{document.body.removeChild(A),t(e.id)},s.appendChild(i)}}))}))}(t);return await tF(i,e)}(e.screen));else if(My()&&e.screen.extensionId&&e.screen.mandatory){if(!n.getStreamFromExtension)throw new pw(hw.NOT_SUPPORTED,"This browser does not support screen sharing");mw.debug("[".concat(t,'] Screen access on chrome stable, looking for extension"')),xw("debug",[],"[".concat(t,'] Screen access on chrome stable, looking for extension"'));const i=await(o=e.screen.extensionId,s=t,new Mm(((e,t)=>{try{chrome.runtime.sendMessage(o,{getStream:!0},(i=>{if(!i||!i.streamId)return mw.error("[".concat(s,"] No response from Chrome Plugin. Plugin not installed properly"),i),Yw("error",[],"getSourceIdFromExtension",{extensionId:o,streamId:s},"No response from Chrome Plugin. Plugin not installed properly, ".concat(i)),void t(new pw(hw.CHROME_PLUGIN_NO_RESPONSE,"No response from Chrome Plugin. Plugin not installed properly"));e(i.streamId)}))}catch(e){mw.error("[".concat(s,"] AgoraRTC screensharing plugin is not accessible(").concat(o,")"),e.toString()),Yw("error",[],"getSourceIdFromExtension",{extensionId:o,streamId:s},"AgoraRTC screensharing plugin is not accessible(".concat(o,"), ").concat(e.toString())),t(new pw(hw.CHROME_PLUGIN_NOT_INSTALL))}})));e.screen.mandatory.chromeMediaSourceId=i,uF(r,await navigator.mediaDevices.getUserMedia({video:{mandatory:e.screen.mandatory}}))}else if(n.getDisplayMedia){e.screen.mediaSource&&PP(e.screen.mediaSource);const i={width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate,displaySurface:"screen"===e.screen.mediaSource?"monitor":e.screen.mediaSource};mw.debug("[".concat(t,"] getDisplayMedia:"),JSON.stringify({video:i,audio:!!e.screenAudio})),Hw("debug",["mediaDevices",t],"getDisplayMedia",{video:i,audio:!!e.screenAudio,trackId:t}),uF(r,await navigator.mediaDevices.getDisplayMedia({video:i,audio:!!e.screenAudio}))}else{if(!By())throw mw.error("[".concat(t,"] This browser does not support screenSharing")),new pw(hw.NOT_SUPPORTED,"This browser does not support screen sharing");{e.screen.mediaSource&&PP(e.screen.mediaSource);const i={video:{mediaSource:e.screen.mediaSource,width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate}};mw.debug("[".concat(t,"] getUserMedia: ").concat(JSON.stringify(i))),Hw("debug",["mediaDevices",t],"getUserMedia",i),uF(r,await navigator.mediaDevices.getUserMedia(i))}}var o,s;if(!e.video&&!e.audio)return r;let a={video:e.video,audio:e.audio},c=cb("MEDIA_DEVICE_CONSTRAINTS");if(c)try{"string"==typeof c&&(c=JSON.parse(c)),a=function e(t,i){if(!KG(t)||!KG(i))return i;if(Array.isArray(t)&&!Array.isArray(i)||!Array.isArray(t)&&Array.isArray(i))return i;if(Array.isArray(i)&&Array.isArray(t)){const n=[...t];for(let r=0;r<i.length;r++)n[r]=e(t[r],i[r]);return n}{const n=TG({},t);for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(Object.prototype.hasOwnProperty.call(t,r)?n[r]=e(t[r],i[r]):n[r]=i[r]);return n}}(a,c),xw("debug",["mediaDevices",t],"merge configConstraints ".concat(JSON.stringify(c)))}catch(e){}mw.debug("[".concat(t,"] GetUserMedia"),JSON.stringify(a)),Hw("debug",["mediaDevices",t],"getUserMedia",a),Dy();let A,d=null;(Uy()||Vy()||ky())&&(d=await oF.lock());try{A=await navigator.mediaDevices.getUserMedia(a)}catch(e){throw d&&d(),e}return a.audio&&(sF=!0),a.video&&(aF=!0),uF(r,A),d&&d(),r}function dF(e,t){switch(e){case"Starting video failed":case"OverconstrainedError":case"TrackStartError":return new pw(hw.MEDIA_OPTION_INVALID,"".concat(e,": ").concat(t));case"NotFoundError":case"DevicesNotFoundError":return new pw(hw.DEVICE_NOT_FOUND,"".concat(e,": ").concat(t));case"NotSupportedError":return new pw(hw.NOT_SUPPORTED,"".concat(e,": ").concat(t));case"NotReadableError":return new pw(hw.NOT_READABLE,"".concat(e,": ").concat(t));case"InvalidStateError":case"NotAllowedError":case"PERMISSION_DENIED":case"PermissionDeniedError":return new pw(hw.PERMISSION_DENIED,"".concat(e,": ").concat(t));case"ConstraintNotSatisfiedError":return new pw(hw.CONSTRAINT_NOT_SATISFIED,"".concat(e,": ").concat(t));default:return mw.error("getUserMedia unexpected error",e),Yw("error",[],"handleGetUserMediaError",void 0,e),new pw(hw.UNEXPECTED_ERROR,"".concat(e,": ").concat(t))}}function uF(e,t){const i=e.getVideoTracks()[0],n=e.getAudioTracks()[0],r=t.getVideoTracks()[0],o=t.getAudioTracks()[0];o&&(n&&e.removeTrack(n),e.addTrack(o)),r&&(i&&e.removeTrack(i),e.addTrack(r))}const EF=new class extends Ew{get state(){return this._state}set state(e){e!==this._state&&(this.emit(PL.STATE_CHANGE,e),this._state=e)}constructor(){super(),tD(this,"_state",LL.IDLE),tD(this,"isAccessMicrophonePermission",!1),tD(this,"isAccessCameraPermission",!1),tD(this,"lastAccessMicrophonePermission",!1),tD(this,"lastAccessCameraPermission",!1),tD(this,"checkdeviceMatched",!1),tD(this,"deviceInfoMap",new Map),this.init().then((()=>{navigator.mediaDevices.addEventListener&&navigator.mediaDevices.addEventListener("devicechange",this.updateDevicesInfo.bind(this)),window.setInterval((()=>{(cb("ENUMERATE_DEVICES_INTERVAL")||Wy()&&Ky())&&this.updateDevicesInfo()}),cb("ENUMERATE_DEVICES_INTERVAL_TIME"))})).catch((e=>mw.error(e.toString())))}async enumerateDevices(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return new pw(hw.NOT_SUPPORTED,"enumerateDevices() not supported.").throw();const n=await navigator.mediaDevices.enumerateDevices(),r=this.checkMediaDeviceInfoIsOk(n);let o=!this.isAccessMicrophonePermission&&e,s=!this.isAccessCameraPermission&&t;r.audio&&(o=!1),r.video&&(s=!1);let a=null,c=null,A=null;if(!i&&(o||s)){if(oF.isLocked&&(mw.debug("[device manager] wait GUM lock"),(await oF.lock())(),mw.debug("[device manager] GUM unlock")),sF&&(o=!1,this.isAccessMicrophonePermission=!0),aF&&(s=!1,this.isAccessCameraPermission=!0),mw.debug("[device manager] check media device permissions",e,t,o,s),o&&s){try{A=await navigator.mediaDevices.getUserMedia({audio:!0,video:!0})}catch(e){const t=dF(e.name||e.code||e,e.message);if(t.code===hw.PERMISSION_DENIED)throw t;mw.warning("getUserMedia failed in getDevices",t)}this.isAccessCameraPermission=!0,this.isAccessMicrophonePermission=!0}else if(o){try{a=await navigator.mediaDevices.getUserMedia({audio:e})}catch(e){const t=dF(e.name||e.code||e,e.message);if(t.code===hw.PERMISSION_DENIED)throw t;mw.warning("getUserMedia failed in getDevices",t)}this.isAccessMicrophonePermission=!0}else if(s){try{c=await navigator.mediaDevices.getUserMedia({video:t})}catch(e){const t=dF(e.name||e.code||e,e.message);if(t.code===hw.PERMISSION_DENIED)throw t;mw.warning("getUserMedia failed in getDevices",t)}this.isAccessCameraPermission=!0}mw.debug("[device manager] mic permission",e,"cam permission",t)}try{const e=await navigator.mediaDevices.enumerateDevices();return a&&a.getTracks().forEach((e=>e.stop())),c&&c.getTracks().forEach((e=>e.stop())),A&&A.getTracks().forEach((e=>e.stop())),a=null,c=null,A=null,e}catch(e){return a&&a.getTracks().forEach((e=>e.stop())),c&&c.getTracks().forEach((e=>e.stop())),A&&A.getTracks().forEach((e=>e.stop())),a=null,c=null,A=null,new pw(hw.ENUMERATE_DEVICES_FAILED,e.toString()).throw()}}async getRecordingDevices(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await this.enumerateDevices(!0,!1,e)).filter((e=>"audioinput"===e.kind))}async getCamerasDevices(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await this.enumerateDevices(!1,!0,e)).filter((e=>"videoinput"===e.kind))}async getSpeakers(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await this.enumerateDevices(!0,!1,e)).filter((e=>"audiooutput"===e.kind))}searchDeviceIdByName(e){let t=null;return this.deviceInfoMap.forEach((i=>{i.device.label===e&&(t=i.device.deviceId)})),t}async getDeviceById(e){const t=(await this.enumerateDevices(!0,!0,!0)).find((t=>t.deviceId===e));if(!t)throw new pw(hw.DEVICE_NOT_FOUND,"deviceId: ".concat(e));return t}async init(){this.state=LL.INITING;try{await this.updateDevicesInfo(),this.state=LL.INITEND}catch(e){throw mw.warning("Device Detection functionality cannot start properly.",e.toString()),this.state=LL.IDLE,("boolean"==typeof isSecureContext?isSecureContext:"https:"===location.protocol||"file:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname||"::1"===location.hostname)||new pw(hw.WEB_SECURITY_RESTRICT,"Your context is limited by web security, please try using https protocol or localhost.").throw(),e}}async updateDevicesInfo(){const e=await this.enumerateDevices(!0,!0,!0),t=Date.now(),i=[];if(e[0]&&e[0].label&&!1===this.checkdeviceMatched){this.checkdeviceMatched=!0;const t=e.find((e=>"audioinput"===e.kind&&"default"===e.deviceId)),i=e.find((e=>"audiooutput"===e.kind&&"default"===e.deviceId));t&&i?i.groupId===t.groupId?mw.debug("[device-check] default input ".concat(t.label," and output ").concat(i.label," is the same group")):mw.warning("[device-check] default input ".concat(t.label," and output ").concat(i.label," is not the same group")):mw.debug("[device-check] default input or output not found")}const n=this.checkMediaDeviceInfoIsOk(e);if(e.forEach((e=>{if(!e.deviceId)return;const n=this.deviceInfoMap.get("".concat(e.kind,"_").concat(e.deviceId));if("ACTIVE"!==(n?n.state:"INACTIVE")){const n={initAt:t,updateAt:t,device:e,state:"ACTIVE"};this.deviceInfoMap.set("".concat(e.kind,"_").concat(e.deviceId),n),i.push(n)}n&&(n.updateAt=t)})),this.deviceInfoMap.forEach(((e,n)=>{"ACTIVE"===e.state&&e.updateAt!==t&&(e.state="INACTIVE",i.push(e))})),this.state!==LL.INITEND)return n.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),void(n.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0));i.forEach((e=>{switch(e.device.kind){case"audioinput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(PL.RECORDING_DEVICE_CHANGED,e);break;case"videoinput":this.lastAccessCameraPermission&&this.isAccessCameraPermission&&this.emit(PL.CAMERA_DEVICE_CHANGED,e);break;case"audiooutput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(PL.PLAYOUT_DEVICE_CHANGED,e)}})),n.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),n.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0)}checkMediaDeviceInfoIsOk(e){const t=e.filter((e=>"audioinput"===e.kind)),i=e.filter((e=>"videoinput"===e.kind)),n={audio:!1,video:!1};for(const e of t)if(e.label&&e.deviceId){n.audio=!0;break}for(const e of i)if(e.label&&e.deviceId){n.video=!0;break}return n}};var lF;let hF=Ww("AudioElementPlayCenter")(lF=class{constructor(){tD(this,"onAutoplayFailed",void 0),tD(this,"elementMap",new Map),tD(this,"elementStateMap",new Map),tD(this,"elementsNeedToResume",[]),tD(this,"sinkIdMap",new Map),tD(this,"autoResumeAfterInterruption",(()=>{Array.from(this.elementMap.entries()).forEach((e=>{let[t,i]=e;const n=this.elementStateMap.get(t),r=i.srcObject.getAudioTracks()[0];Qy()?r&&"live"===r.readyState&&"running"===Kx.curState&&(mw.debug("auto resume after interruption for iOS 15"),xw("debug",["AudioElementPlayCenter",t],"auto resume after interruption for iOS15"),i.pause(),i.play()):n&&"paused"===n&&r&&"live"===r.readyState&&"running"===Kx.curState&&(mw.debug("auto resume after interruption for iOS"),xw("debug",["AudioElementPlayCenter",t],"auto resume after interruption for iOS"),i.play())}))})),tD(this,"autoResumeAfterInterruptionOnIOS15",(()=>{Array.from(this.elementMap.entries()).forEach((e=>{let[t,i]=e;const n=i.srcObject.getAudioTracks()[0];n&&"live"===n.readyState&&(mw.debug("auto resume after interruption inside autoResumeAfterInterruptionOnIOS15"),Yw("debug",["AudioElementPlayCenter",t],"autoResumeAfterInterruptionOnIOS15"),i.pause(),i.play())}))})),this.autoResumeAudioElement(),Kx.on(Mx.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Kx.on(Mx.IOS_15_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15),Kx.on(Mx.STATE_CHANGE,(()=>{Vy()&&"suspended"===Kx.prevState&&"running"===Kx.curState&&this.autoResumeAfterInterruption()}))}async setSinkID(e,t){const i=this.elementMap.get(e);if(this.sinkIdMap.set(e,t),i)try{await i.setSinkId(t)}catch(e){throw new pw(hw.PERMISSION_DENIED,"can not set sink id: "+e.toString())}}play(e,t,i,n){if(this.elementMap.has(t))return;const r=document.createElement("audio");r.autoplay=!0,r.srcObject=new MediaStream([e]),this.bindAudioElementEvents(t,r),this.elementMap.set(t,r),this.elementStateMap.set(t,mL.INIT),this.setVolume(t,i);const o=this.sinkIdMap.get(t);if(o)try{r.setSinkId(o).catch((e=>{mw.warning("[".concat(t,"] set sink id failed"),e.toString()),Hw("warning",["HTMLAudioElement",t],"setSinkId",e.toString())}))}catch(e){mw.warning("[".concat(t,"] set sink id failed"),e.toString())}const s=r.play();s&&s.then&&s.catch((e=>{n&&Px.autoplayFailed(n,"audio",e.message,t),mw.warning("audio element play warning",e.toString()),Hw("warning",["HTMLAudioElement",t],"play",e.toString()),this.elementMap.has(t)&&"NotAllowedError"===e.name&&(mw.warning("detected audio element autoplay failed"),Yw("warning",["AudioElementPlayCenter",t],"play",e.toString()),this.elementsNeedToResume.push(r),BG((()=>{this.onAutoplayFailed&&this.onAutoplayFailed(),Nx()})))}))}updateTrack(e,t){const i=this.elementMap.get(e);i&&(i.srcObject=new MediaStream([t]))}isPlaying(e){return this.elementMap.has(e)}setVolume(e,t){const i=this.elementMap.get(e);i&&(t=Math.max(0,Math.min(100,t)),i.volume=t/100)}stop(e){const t=this.elementMap.get(e);if(this.sinkIdMap.delete(e),!t)return;const i=this.elementsNeedToResume.indexOf(t);this.elementsNeedToResume.splice(i,1),t.srcObject=null,t.remove(),this.elementMap.delete(e),this.elementStateMap.delete(e)}bindAudioElementEvents(e,t){pF.forEach((i=>{t.addEventListener(i,(t=>{const i=this.elementStateMap.get(e),n="pause"===t.type?"paused":t.type;mw.debug("[".concat(e,"] audio-element-status change ").concat(i," => ").concat(n)),jw("debug",["HTMLAudioElement",e],"statusChange","".concat(i," => ").concat(n)),this.elementStateMap.set(e,n)}))}))}getPlayerState(e){return this.elementStateMap.get(e)||"uninit"}autoResumeAudioElement(){const e=()=>{this.elementsNeedToResume.forEach((e=>{e.play().then((e=>{mw.debug("Auto resume audio element success"),Yw("debug",["AudioElementPlayCenter"],"autoResumeAudioElement")})).catch((e=>{mw.warning("Auto resume audio element failed!",e),Yw("warning",["AudioElementPlayCenter"],"autoResumeAudioElement",e.toString())}))})),this.elementsNeedToResume=[]};new Mm((e=>{document.body?e():window.addEventListener("load",(()=>e()))})).then((()=>{const t=Dy();"Android"!==t.os||"Chrome"!==t.name&&t.name!==Oy.WECHAT?(document.body.addEventListener("touchstart",e,!0),document.body.addEventListener("mousedown",e,!0)):document.body.addEventListener("click",e,!0)}))}})||lF;const pF=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended"],_F=new hF;function IF(){return function(e,t,i){const n=e[t];"function"==typeof n&&(i.value=function(){this._isClosed&&new pw(hw.INVALID_OPERATION,"[".concat(this.getTrackId(),"] cannot operate a closed track")).print("warning");for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const r=n.apply(this,t);return r instanceof Mm?new Mm(((e,t)=>{r.then(e).catch(t)})):r})}}var gF,fF,RF,CF,TF,mF,SF,OF,vF,NF,yF,DF,wF,bF,LF,PF,kF,MF,UF,BF,VF,QF,xF,FF,GF,jF,YF,HF;function KF(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function WF(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?KF(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):KF(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let JF=(gF=Ww("LocalAudioTrack","getTrackId"),fF=IF(),RF=xx("LocalAudioTrack","_enabledMutex"),CF=IF(),TF=xx("LocalAudioTrack","_enabledMutex"),mF=IF(),SF=Lx({report:Px}),OF=IF(),vF=IF(),NF=IF(),yF=IF(),gF((tx((wF=class extends Fx{get isPlaying(){return this._useAudioElement?_F.isPlaying(this.getTrackId()):this._source.isPlayed}constructor(e,t,i){super(e,i),tD(this,"trackMediaType","audio"),tD(this,"_encoderConfig",void 0),tD(this,"_source",void 0),tD(this,"_enabled",!0),tD(this,"_volume",100),tD(this,"_useAudioElement",!1),tD(this,"_bypassWebAudio",!1),tD(this,"processor",void 0),tD(this,"processorContext",void 0),tD(this,"processorDestination",void 0),this._encoderConfig=t,this._source=new eF(e),cb("LOCAL_AUDIO_TRACK_USES_WEB_AUDIO")||(this._useAudioElement=!0),this.processorContext=new $F(this._source.context,this.getTrackId()),this.processorDestination=new ZF(this.processorContext),this.bindProcessorDestinationEvents(),this._source.on(qL.UPDATE_SOURCE,(()=>{this.processor&&this.processor.updateInput({node:this._source.processSourceNode,context:this.processorContext})}))}setVolume(e){EL(e,"volume",0,1e3);const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_AUDIO_TRACK_SET_VOLUME,options:[this.getTrackId(),e]},300);this._volume=e,this._source.setVolume(e/100),this._useAudioElement&&_F.setVolume(this.getTrackId(),e);try{if(this._bypassWebAudio)return mw.debug("[".concat(this.getTrackId(),"] setVolume returned because no pass through WebAudio.")),void t.onSuccess();const e=this._source.createOutputTrack();this._mediaStreamTrack!==e&&(this._mediaStreamTrack=e,LG(this,OP.NEED_REPLACE_TRACK,this).then((()=>{mw.debug("[".concat(this.getTrackId(),"] replace web audio track success")),xw("debug",this,"replace web audio track success")})).catch((e=>{mw.warning("[".concat(this.getTrackId(),"] replace web audio track failed"),e),xw("warning",this,"replace web audio track failed ".concat(e.toString()))})))}catch(e){}t.onSuccess()}getVolumeLevel(){return this._source.getAccurateVolumeLevel()}async setPlaybackDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_SET_OUTPUT_DEVICE,options:[this.getTrackId(),e]});if(!this._useAudioElement)throw new pw(hw.NOT_SUPPORTED,"your browser does not support setting the audio output device");try{await _F.setSinkID(this.getTrackId(),e)}catch(e){throw t.onError(e),e}t.onSuccess()}async setEnabled(e,t,i){if(!i){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),e){this._originMediaStreamTrack.enabled=!0;try{i||(this._enabled=!0),await LG(this,OP.NEED_ENABLE_TRACK,this),mw.info("[".concat(this.getTrackId(),"] setEnabled to ").concat(e," success")),Yw("info",this,"setEnabled",e,"success")}catch(t){throw i||(this._enabled=!1),mw.error("[".concat(this.getTrackId(),"] setEnabled to true error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}}else{this._originMediaStreamTrack.enabled=!1,i||(this._enabled=!1);try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw i||(this._enabled=!0),mw.error("[".concat(this.getTrackId(),"] setEnabled to false error"),t.toString()),Yw("info",this,"setEnabled",e,t.toString()),t}}}async setMuted(e){e!==this._muted&&(this.stateCheck("muted",e),this._muted=e,this._mediaStreamTrack.enabled=!e,mw.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(e)),Yw("debug",this,"setMuted",e),e?await LG(this,OP.NEED_MUTE_TRACK,this):await LG(this,OP.NEED_UNMUTE_TRACK,this))}getStats(){return xG((()=>{mw.warning("[deprecated] LocalAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalAudioStats instead"),xw("warning",this,"LocalAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalAudioStats instead")}),"localAudioTrackGetStatsWarning"),PG(this,OP.GET_STATS)||WF({},tP)}setAudioFrameCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4096;if(!e)return this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(t),this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),this._source.on(qL.ON_AUDIO_BUFFER,(t=>e(t)))}play(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_AUDIO_TRACK_PLAY,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] start audio playback")),Yw("debug",this,"play"),this._useAudioElement?(mw.debug("[".concat(this.getTrackId(),"] start audio playback in element")),xw("debug",this,"start audio playback in element"),_F.play(this._mediaStreamTrack,this.getTrackId(),this._volume)):this._source.play(),e.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_AUDIO_TRACK_STOP,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] stop audio playback")),Yw("debug",this,"stop"),this._useAudioElement?_F.stop(this.getTrackId()):this._source.stop(),e.onSuccess()}close(){super.close(),this.unbindProcessorDestinationEvents(),this.unbindProcessorContextEvents(),this.unpipe(),this.processorDestination._source&&this.processorDestination._source.unpipe(),this._source.destroy()}_updatePlayerSource(){mw.debug("[".concat(this.getTrackId(),"] update player source track")),Yw("debug",this,"_updatePlayerSource"),this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&_F.updateTrack(this.getTrackId(),this._mediaStreamTrack)}async _updateOriginMediaStreamTrack(e,t){this._originMediaStreamTrack!==e&&(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),e.addEventListener("ended",this._handleTrackEnded),t&&this._originMediaStreamTrack.stop(),this._originMediaStreamTrack=e,this.processor&&this.processor.updateInput({track:e,context:this.processorContext}),this._mediaStreamTrack!==this._source.outputTrack?(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)):this._source.updateTrack(this._originMediaStreamTrack))}renewMediaStreamTrack(e){return Mm.resolve(void 0)}pipe(e){if(this._bypassWebAudio)throw new pw(hw.INVALID_OPERATION,"Can not process AudioTrack when bypassWebAudio set to true.");if(this.processor===e)return e;if(e._source)throw new pw(hw.INVALID_OPERATION,"Processor ".concat(e.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=e,this.processor._source=this,e.updateInput({track:this._originMediaStreamTrack,node:this._source.processSourceNode,context:this.processorContext}),e}unpipe(){var e;if(!this.processor)return;const t=this.processor;null===(e=this._source.processSourceNode)||void 0===e||e.disconnect(),this.processor._source=!1,this.processor=void 0,t.reset()}bindProcessorDestinationEvents(){this.processorDestination.on(WP.ON_TRACK,(async e=>{e?e!==this._mediaStreamTrack&&(this._mediaStreamTrack=e,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this))})),this.processorDestination.on(WP.ON_NODE,(e=>{this._source.processedNode=e}))}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(WP.ON_TRACK),this.processorDestination.removeAllListeners(WP.ON_NODE)}unbindProcessorContextEvents(){this.processorContext.removeAllListeners(JP.REQUEST_UPDATE_CONSTRAINTS),this.processorContext.removeAllListeners(JP.REQUEST_CONSTRAINTS)}}).prototype,"setPlaybackDevice",[fF],Object.getOwnPropertyDescriptor(wF.prototype,"setPlaybackDevice"),wF.prototype),tx(wF.prototype,"setEnabled",[RF,CF],Object.getOwnPropertyDescriptor(wF.prototype,"setEnabled"),wF.prototype),tx(wF.prototype,"setMuted",[TF,mF,SF],Object.getOwnPropertyDescriptor(wF.prototype,"setMuted"),wF.prototype),tx(wF.prototype,"getStats",[OF],Object.getOwnPropertyDescriptor(wF.prototype,"getStats"),wF.prototype),tx(wF.prototype,"setAudioFrameCallback",[vF],Object.getOwnPropertyDescriptor(wF.prototype,"setAudioFrameCallback"),wF.prototype),tx(wF.prototype,"play",[NF],Object.getOwnPropertyDescriptor(wF.prototype,"play"),wF.prototype),tx(wF.prototype,"stop",[yF],Object.getOwnPropertyDescriptor(wF.prototype,"stop"),wF.prototype),DF=wF))||DF),qF=(bF=Ww("MicrophoneAudioTrack","getTrackId"),LF=IF(),PF=xx("MicrophoneAudioTrack","_enabledMutex"),kF=IF(),bF((tx((UF=class extends JF{constructor(e,t,i,n){super(e,t.encoderConfig?sb(t.encoderConfig):{},n),tD(this,"_config",void 0),tD(this,"_deviceName","default"),tD(this,"_constraints",void 0),tD(this,"_originalConstraints",void 0),tD(this,"_enabled",!0),Kw("info",this,"constructor",{trackId:n,deviceId:e.label,constraints:i}),this._config=t,this._constraints=i,this._originalConstraints=i,this._deviceName=e.label,"boolean"==typeof t.bypassWebAudio&&(this._bypassWebAudio=t.bypassWebAudio),Qy()&&Kx.bindInterruptDetectorTrack(this),this.bindProcessorContextEvents()}async setDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.MIC_AUDIO_TRACK_SET_DEVICE,options:[this.getTrackId(),e]});if(mw.info("[".concat(this.getTrackId(),"] start set device to ").concat(e)),Yw("info",this,"setDevice",e),this._enabled)try{const i=await EF.getDeviceById(e),n={};n.audio=WF({},this._constraints),n.audio.deviceId={exact:e},this._originMediaStreamTrack.stop();let r=null;try{r=await cF(n,this.getTrackId())}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setDevice failed"),t.toString()),Yw("error",this,"setDevice",e,t.toString()),r=await cF({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(r.getAudioTracks()[0],!1),t}await this._updateOriginMediaStreamTrack(r.getAudioTracks()[0],!1),this._deviceName=i.label,this._config.microphoneId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}else try{const t=await EF.getDeviceById(e);this._deviceName=t.label,this._config.microphoneId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}t.onSuccess(),mw.info("[".concat(this.getTrackId(),"] set device to ").concat(e," success")),Yw("info",this,"setDevice",e,"success")}async setEnabled(e,t,i){if(t)return mw.debug("[".concat(this.getTrackId,"] setEnabled false (do not close microphone)")),xw("debug",this,"setEnabled false (do not close microphone)"),await super.setEnabled(e);if(!i){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),!e){this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),i||(this._enabled=!1);try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled false failed"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}return}const n=WF({},this._constraints),r=EF.searchDeviceIdByName(this._deviceName);r&&!n.deviceId&&(n.deviceId=r);try{i||(this._enabled=!0);const e=await cF({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(e.getAudioTracks()[0],!1),await LG(this,OP.NEED_ENABLE_TRACK,this)}catch(t){throw i||(this._enabled=!1),mw.error("[".concat(this.getTrackId(),"] setEnabled true failed"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}mw.info("[".concat(this.getTrackId(),"] setEnabled success")),Yw("info",this,"setEnabled",e,"success")}close(){super.close(),Qy()&&Kx.unbindInterruptDetectorTrack(this)}onTrackEnded(){if((Vy()||jy())&&this._enabled&&!this._isClosed&&Kx.duringInterruption){const e=async()=>{Kx.off(Mx.IOS_INTERRUPTION_END,e),this._enabled&&!this._isClosed&&(mw.debug("[".concat(this.getTrackId(),"] try capture microphone media device for interrupted iOS device.")),xw("debug",this,"try capture microphone media device for interrupted iOS device"),await this.setEnabled(!1),await this.setEnabled(!0))};Kx.on(Mx.IOS_INTERRUPTION_END,e)}else mw.debug("[".concat(this.getTrackId(),"] track ended")),jw("debug",["MediaStreamTrack",this.getTrackId()],"ended"),this.emit(DP.TRACK_ENDED)}async renewMediaStreamTrack(e){const t=e||this._constraints,i=EF.searchDeviceIdByName(this._deviceName);i&&!t.deviceId&&(t.deviceId=i),this._constraints=t,this._originMediaStreamTrack.stop();const n=await cF({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(n.getAudioTracks()[0],!0)}bindProcessorContextEvents(){this.processorContext.on(JP.REQUEST_UPDATE_CONSTRAINTS,(async(e,t,i)=>{try{const i=Object.assign({},this._originalConstraints,...e);await this.renewMediaStreamTrack(i),t()}catch(e){i(e)}})),this.processorContext.on(JP.REQUEST_CONSTRAINTS,(async e=>{e(this._originMediaStreamTrack.getSettings())}))}}).prototype,"setDevice",[LF],Object.getOwnPropertyDescriptor(UF.prototype,"setDevice"),UF.prototype),tx(UF.prototype,"setEnabled",[PF,kF],Object.getOwnPropertyDescriptor(UF.prototype,"setEnabled"),UF.prototype),MF=UF))||MF),XF=(BF=Ww("BufferSourceAudioTrack","getTrackId"),VF=IF(),QF=IF(),xF=IF(),FF=IF(),GF=IF(),BF((tx((YF=class extends JF{constructor(e,t,i,n){super(t.createOutputTrack(),i,n),tD(this,"source",void 0),tD(this,"_bufferSource",void 0),Kw("info",this,"constructor",{trackId:n}),this.source=e,this._bufferSource=t,this._bufferSource.on(qL.AUDIO_SOURCE_STATE_CHANGE,(e=>{this.emit(DP.SOURCE_STATE_CHANGE,e)}));try{this._mediaStreamTrack=this._source.createOutputTrack()}catch(e){}}get currentState(){return this._bufferSource.currentState}get duration(){return this._bufferSource.duration}getCurrentTime(){return this._bufferSource.currentTime}startProcessAudioBuffer(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_START,options:[this.getTrackId(),e,this.duration]});e&&this._bufferSource.updateOptions(e),this._bufferSource.startProcessAudioBuffer(),t.onSuccess()}pauseProcessAudioBuffer(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_PAUSE,options:[this.getTrackId()]});this._bufferSource.pauseProcessAudioBuffer(),e.onSuccess()}seekAudioBuffer(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_SEEK,options:[this.getTrackId()]});this._bufferSource.seekAudioBuffer(e),t.onSuccess()}resumeProcessAudioBuffer(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_RESUME,options:[this.getTrackId()]});this._bufferSource.resumeProcessAudioBuffer(),e.onSuccess()}stopProcessAudioBuffer(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.BUFFER_AUDIO_TRACK_STOP,options:[this.getTrackId()]});this._bufferSource.stopProcessAudioBuffer(),e.onSuccess()}}).prototype,"startProcessAudioBuffer",[VF],Object.getOwnPropertyDescriptor(YF.prototype,"startProcessAudioBuffer"),YF.prototype),tx(YF.prototype,"pauseProcessAudioBuffer",[QF],Object.getOwnPropertyDescriptor(YF.prototype,"pauseProcessAudioBuffer"),YF.prototype),tx(YF.prototype,"seekAudioBuffer",[xF],Object.getOwnPropertyDescriptor(YF.prototype,"seekAudioBuffer"),YF.prototype),tx(YF.prototype,"resumeProcessAudioBuffer",[FF],Object.getOwnPropertyDescriptor(YF.prototype,"resumeProcessAudioBuffer"),YF.prototype),tx(YF.prototype,"stopProcessAudioBuffer",[GF],Object.getOwnPropertyDescriptor(YF.prototype,"stopProcessAudioBuffer"),YF.prototype),jF=YF))||jF),zF=Ww("MixingAudioTrack","getTrackId")(HF=class extends JF{get isActive(){for(const e of this.trackList)if(e._enabled&&!e._isClosed&&!e.muted)return!0;return!1}constructor(){const e=Wx().createMediaStreamDestination();super(e.stream.getAudioTracks()[0],void 0,vG(8,"track-mix-")),tD(this,"trackList",void 0),tD(this,"destNode",void 0);try{this._mediaStreamTrack=this._source.createOutputTrack()}catch(e){}this.destNode=e,this.trackList=[]}hasAudioTrack(e){return-1!==this.trackList.indexOf(e)}addAudioTrack(e){if(-1!==this.trackList.indexOf(e))return mw.debug("track ".concat(e.getTrackId()," is already added")),void xw("debug",this,"track already added");mw.debug("add ".concat(e.getTrackId()," to mixing track")),Yw("debug",this,"addAudioTrack",e.getTrackId()),e._source.outputNode.connect(this.destNode),this.trackList.push(e),this.updateEncoderConfig()}removeAudioTrack(e){if(-1!==this.trackList.indexOf(e)){mw.debug("remove ".concat(e.getTrackId()," from mixing track")),Yw("debug",this,"removeAudioTrack",e.getTrackId());try{e._source.outputNode.disconnect(this.destNode)}catch(e){}MG(this.trackList,e),this.updateEncoderConfig()}}updateEncoderConfig(){const e={};this.trackList.forEach((t=>{t._encoderConfig&&((t._encoderConfig.bitrate||0)>(e.bitrate||0)&&(e.bitrate=t._encoderConfig.bitrate),(t._encoderConfig.sampleRate||0)>(e.sampleRate||0)&&(e.sampleRate=t._encoderConfig.sampleRate),(t._encoderConfig.sampleSize||0)>(e.sampleSize||0)&&(e.sampleSize=t._encoderConfig.sampleSize),t._encoderConfig.stereo&&(e.stereo=!0))})),this._encoderConfig=e}})||HF;class ZF extends Ew{constructor(e){super(),tD(this,"name","AudioProcessorDestination"),tD(this,"ID","0"),tD(this,"inputTrack",void 0),tD(this,"inputNode",void 0),tD(this,"audioProcessorContext",void 0),tD(this,"_source",void 0),this.audioProcessorContext=e}get kind(){return"audio"}get enabled(){return!0}pipe(){throw new pw(hw.NOT_SUPPORTED,"AudioProcessorDestination cannot pipe to any other Processor")}unpipe(){throw new pw(hw.NOT_SUPPORTED,"VideoProcessor cannot unpipe to any other Processor")}enable(){}disable(){}reset(){this.inputTrack=void 0,this.inputNode=void 0,this.emit(WP.ON_TRACK,void 0),this.emit(WP.ON_NODE,void 0)}updateInput(e){if(e.context!==this.audioProcessorContext)throw new Error("ProcessorContext passed to VideoTrack.processorDestination doesn't match it's belonging VideoTrack's context.\n        Probably you are making pipeline like this: audioTrack1.pipe(processor).pipe(audioTrack2.processorDestination).");e.track&&this.inputTrack!==e.track&&(this.inputTrack=e.track,this.emit(WP.ON_TRACK,this.inputTrack)),e.node&&this.inputNode!==e.node&&(this.inputNode=e.node,this.emit(WP.ON_NODE,this.inputNode))}}class $F extends Ew{constructor(e,t){super(),tD(this,"constraintsMap",new Map),tD(this,"statsRegistry",[]),tD(this,"audioContext",void 0),tD(this,"trackId",void 0),this.audioContext=e,this.trackId=t}async getConstraints(){return bG(this,JP.REQUEST_CONSTRAINTS)}getAudioContext(){return this.audioContext}async requestApplyConstraints(e,t){var i;return mw.info("processor ".concat(t.name," requestApplyConstraints for ").concat(this.trackId)),e&&this.constraintsMap.set(t,e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(i=this.constraintsMap).call(i)))}async requestRevertConstraints(e){var t;if(this.constraintsMap.has(e))return this.constraintsMap.delete(e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(t=this.constraintsMap).call(t)))}registerStats(e,t,i){this.statsRegistry.find((i=>i.processorID===e.ID&&i.processorName===e.name&&i.type===t))||this.statsRegistry.push({processorName:e.name,processorID:e.ID,type:t,cb:i})}unregisterStats(e,t){}gatherStats(){return this.statsRegistry.map((e=>{let{processorID:t,processorName:i,type:n,cb:r}=e;return{processorID:t,processorName:i,type:n,stats:r()}}))}}class eG extends Ew{constructor(){super(...arguments),tD(this,"resultStorage",new Map)}setLocalAudioStats(e,t,i){this.record("AUDIO_INPUT_LEVEL_TOO_LOW",e,this.checkAudioInputLevel(i,t)),this.record("SEND_AUDIO_BITRATE_TOO_LOW",e,this.checkSendAudioBitrate(i,t))}setLocalVideoStats(e,t,i){this.record("SEND_VIDEO_BITRATE_TOO_LOW",e,this.checkSendVideoBitrate(i,t)),this.record("FRAMERATE_INPUT_TOO_LOW",e,this.checkFramerateInput(i,t)),this.record("FRAMERATE_SENT_TOO_LOW",e,this.checkFramerateSent(i))}setRemoteAudioStats(e,t){const i=e.getUserId();this.record("AUDIO_OUTPUT_LEVEL_TOO_LOW",i,this.checkAudioOutputLevel(t))}setRemoteVideoStats(e,t){const i=e.getUserId();this.record("RECV_VIDEO_DECODE_FAILED",i,this.checkVideoDecode(t))}record(e,t,i){this.resultStorage.has(e)||this.resultStorage.set(e,{result:[],isPrevNormal:!0});const n=this.resultStorage.get(e);if(n&&(n.result.push(i),n.result.length>=5)){const i=n.result.includes(!0);n.isPrevNormal&&!i&&this.emit("exception",tG[e],e,t),!n.isPrevNormal&&i&&this.emit("exception",tG[e]+2e3,e+"_RECOVER",t),n.isPrevNormal=i,n.result=[]}}checkAudioOutputLevel(e){return!(e.receiveBitrate>0&&0===e.receiveLevel)}checkAudioInputLevel(e,t){return t instanceof zF&&!t.isActive||!!t.muted||0!==e.sendVolumeLevel}checkFramerateInput(e,t){let i=null;t._encoderConfig&&t._encoderConfig.frameRate&&(i=lG(t._encoderConfig.frameRate));const n=e.captureFrameRate;return!i||!n||!(i>10&&n<5||i<10&&i>=5&&n<=1)}checkFramerateSent(e){return!(e.captureFrameRate&&e.sendFrameRate&&e.captureFrameRate>5&&e.sendFrameRate<=1)}checkSendVideoBitrate(e,t){return!!t.muted||0!==e.sendBitrate}checkSendAudioBitrate(e,t){return t instanceof zF&&!t.isActive||!!t.muted||0!==e.sendBitrate}checkVideoDecode(e){return 0===e.receiveBitrate||0!==e.decodeFrameRate}}const tG={FRAMERATE_INPUT_TOO_LOW:1001,FRAMERATE_SENT_TOO_LOW:1002,SEND_VIDEO_BITRATE_TOO_LOW:1003,RECV_VIDEO_DECODE_FAILED:1005,AUDIO_INPUT_LEVEL_TOO_LOW:2001,AUDIO_OUTPUT_LEVEL_TOO_LOW:2002,SEND_AUDIO_BITRATE_TOO_LOW:2003},iG=new class{markSubscribeStart(e,t){performance.mark("agora-web-sdk/".concat(e,"/subscribe-").concat(t))}markPublishStart(e,t){performance.mark("agora-web-sdk/".concat(e,"/publish-").concat(t))}measureFromSubscribeStart(e,t){const i=performance.getEntriesByName("agora-web-sdk/".concat(e,"/subscribe-").concat(t));if(i.length>0){const e=i[i.length-1];return Math.round(performance.now()-e.startTime)}return 0}measureFromPublishStart(e,t){const i=performance.getEntriesByName("agora-web-sdk/".concat(e,"/publish-").concat(t));if(i.length>0){const e=i[i.length-1];return Math.round(performance.now()-e.startTime)}return 0}};function nG(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function rG(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?nG(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):nG(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class oG{constructor(e){tD(this,"store",void 0),tD(this,"onStatsException",void 0),tD(this,"onUploadPublishDuration",void 0),tD(this,"localStats",new Map),tD(this,"remoteStats",new Map),tD(this,"updateStatsInterval",void 0),tD(this,"trafficStats",void 0),tD(this,"trafficStatsPeerList",[]),tD(this,"uplinkStats",void 0),tD(this,"exceptionMonitor",void 0),tD(this,"p2pChannel",void 0),tD(this,"updateStats",(()=>{this.p2pChannel&&(this.updateRemoteStats(this.p2pChannel),this.updateLocalStats(this.p2pChannel))})),this.store=e,this.updateStatsInterval=window.setInterval(this.updateStats,1e3),this.exceptionMonitor=new eG,this.exceptionMonitor.on("exception",((e,t,i)=>{this.onStatsException&&this.onStatsException(e,t,i)}))}reset(){this.localStats=new Map,this.remoteStats=new Map,this.trafficStats=void 0,this.trafficStatsPeerList=[],this.uplinkStats=void 0}getLocalAudioTrackStats(){return this.localStats.get(xP.LocalAudioTrack)||rG({},tP)}getLocalVideoTrackStats(){return this.localStats.get(xP.LocalVideoTrack)||rG({},iP)}getRemoteAudioTrackStats(e){const t=(e,t)=>{if(!this.trafficStats)return t;const i=this.trafficStats.peer_delay.find((t=>t.peer_uid===e));return i&&(t.publishDuration=i.B_ppad+(Date.now()-this.trafficStats.timestamp)),t},i={};if(e){var n;const r=null===(n=this.remoteStats.get(e))||void 0===n?void 0:n.audioStats;r&&(i[e]=t(e,r))}else Array.from(this.remoteStats.entries()).forEach((e=>{let[n,{audioStats:r}]=e;r&&(i[n]=t(n,r))}));return i}getRemoteNetworkQualityStats(e){const t={};if(e){var i;const n=null===(i=this.remoteStats.get(e))||void 0===i?void 0:i.networkStats;n&&(t[e]=n)}else Array.from(this.remoteStats.entries()).forEach((e=>{let[i,{networkStats:n}]=e;n&&(t[i]=n)}));return t}getRemoteVideoTrackStats(e){const t=(e,t)=>{if(!this.trafficStats)return t;const i=this.trafficStats.peer_delay.find((t=>t.peer_uid===e));return i&&(t.publishDuration=i.B_ppvd+(Date.now()-this.trafficStats.timestamp)),t},i={};if(e){var n;const r=null===(n=this.remoteStats.get(e))||void 0===n?void 0:n.videoStats;r&&(i[e]=t(e,r))}else Array.from(this.remoteStats.entries()).forEach((e=>{let[n,{videoStats:r}]=e;r&&(i[n]=t(n,r))}));return i}getRTCStats(){let e=0,t=0,i=0,n=0;const r=this.localStats.get(xP.LocalAudioTrack);r&&(e+=r.sendBytes,t+=r.sendBitrate);const o=this.localStats.get(xP.LocalVideoTrack);o&&(e+=o.sendBytes,t+=o.sendBitrate);const s=this.localStats.get(xP.LocalVideoLowTrack);s&&(e+=s.sendBytes,t+=s.sendBitrate),this.remoteStats.forEach((e=>{let{audioStats:t,videoStats:r}=e;t&&(i+=t.receiveBytes,n+=t.receiveBitrate),r&&(i+=r.receiveBytes,n+=r.receiveBitrate)}));let a=1;return this.trafficStats&&(a+=this.trafficStats.peer_delay.length),{Duration:0,UserCount:a,SendBitrate:t,SendBytes:e,RecvBytes:i,RecvBitrate:n,OutgoingAvailableBandwidth:this.uplinkStats?this.uplinkStats.B_uab/1e3:0,RTT:this.trafficStats?2*this.trafficStats.B_acd:0}}addLocalStats(e){this.localStats.set(e,void 0)}removeLocalStats(e){e?this.localStats.delete(e):this.localStats.clear()}addRemoteStats(e){this.remoteStats.set(e,{})}removeRemoteStats(e){e?this.remoteStats.delete(e):this.remoteStats.clear()}addP2PChannel(e){this.p2pChannel=e}updateTrafficStats(e){e.peer_delay=e.peer_delay.filter((e=>void 0!==e.B_ppad||void 0!==e.B_ppvd)),e.peer_delay.filter((e=>-1===this.trafficStatsPeerList.indexOf(e.peer_uid))).forEach((e=>{var t;const i=null===(t=this.p2pChannel)||void 0===t?void 0:t.getRemoteMedia(e.peer_uid),n=null!=i&&i.videoSSRC?iG.measureFromSubscribeStart(this.store.clientId,i.videoSSRC):0,r=null!=i&&i.audioSSRC?iG.measureFromSubscribeStart(this.store.clientId,i.audioSSRC):0;void 0!==e.B_ppad&&void 0!==e.B_ppvd&&(this.onUploadPublishDuration&&this.onUploadPublishDuration(e.peer_uid,e.B_ppad,e.B_ppvd,n>r?n:r),this.trafficStatsPeerList.push(e.peer_uid))})),this.trafficStats=e}updateUplinkStats(e){this.uplinkStats&&this.uplinkStats.B_fir!==e.B_fir&&mw.debug("[".concat(this.store.clientId,"]: Period fir changes to ").concat(e.B_fir)),this.uplinkStats=e}static isRemoteVideoFreeze(e,t,i){if(!e)return!1;const n=!!i&&t.framesDecodeFreezeTime>i.framesDecodeFreezeTime,r=!i||t.framesDecodeCount>i.framesDecodeCount;return n||!r}static isRemoteAudioFreeze(e){return!!e&&e._isFreeze()}isLocalVideoFreeze(e){return!(!e.inputFrame||!e.sentFrame)&&e.inputFrame.frameRate>5&&e.sentFrame.frameRate<3}updateLocalStats(e){Array.from(this.localStats.entries()).forEach((t=>{let[i,n]=t;switch(i){case xP.LocalVideoTrack:case xP.LocalVideoLowTrack:{const t=n,r=rG({},iP),o=e.getStats(),s=e.getLocalMedia(i);if(o){const i=o.videoSend.find((e=>e.ssrc===(null==s?void 0:s.ssrcs[0].ssrcId)));if(i){const n=e.getLocalVideoSize(),o=e.getEncoderConfig(xP.LocalVideoTrack);"H264"!==i.codec&&"VP8"!==i.codec&&"VP9"!==i.codec&&"AV1X"!==i.codec&&"AV1"!==i.codec||(r.codecType=i.codec),r.sendBytes=i.bytes,r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0,i.inputFrame?(r.captureFrameRate=i.inputFrame.frameRate,r.captureResolutionHeight=i.inputFrame.height,r.captureResolutionWidth=i.inputFrame.width):n&&(r.captureResolutionWidth=n.width,r.captureResolutionHeight=n.height),i.sentFrame?(r.sendFrameRate=i.sentFrame.frameRate,r.sendResolutionHeight=i.sentFrame.height,r.sendResolutionWidth=i.sentFrame.width):n&&(r.sendResolutionWidth=n.width,r.sendResolutionHeight=n.height),i.avgEncodeMs&&(r.encodeDelay=i.avgEncodeMs),o&&o.bitrateMax&&(r.targetSendBitrate=1e3*o.bitrateMax),r.sendPackets=i.packets,r.sendPacketsLost=i.packetsLost,r.totalDuration=t?t.totalDuration+1:1,r.totalFreezeTime=t?t.totalFreezeTime:0,this.isLocalVideoFreeze(i)&&(r.totalFreezeTime+=1)}this.trafficStats&&(r.sendPacketsLost=this.trafficStats.B_pvlr4/100)}this.localStats.set(i,r),r&&s&&this.exceptionMonitor.setLocalVideoStats(this.store.uid,s.track,r);break}case xP.LocalAudioTrack:{const t=n,r=rG({},tP),o=e.getStats(),s=e.getLocalMedia(i);if(o){const i=o.audioSend.find((e=>e.ssrc===(null==s?void 0:s.ssrcs[0].ssrcId)));if(i){if("opus"!==i.codec&&"aac"!==i.codec&&"PCMU"!==i.codec&&"PCMA"!==i.codec&&"G722"!==i.codec||(r.codecType=i.codec),i.inputLevel)r.sendVolumeLevel=Math.round(32767*i.inputLevel);else{const t=e.getLocalAudioVolume();t&&(r.sendVolumeLevel=Math.round(32767*t))}r.sendBytes=i.bytes,r.sendPackets=i.packets,r.sendPacketsLost=i.packetsLost,r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0}}this.trafficStats&&(r.sendPacketsLost=this.trafficStats.B_pvlr4/100),this.localStats.set(xP.LocalAudioTrack,r),r&&s&&this.exceptionMonitor.setLocalAudioStats(this.store.uid,s.track,r);break}}}))}updateRemoteStats(e){Array.from(this.remoteStats.entries()).forEach((t=>{let[i,{videoStats:n,audioStats:r,videoPcStats:o}]=t;const s=r,a=n,c=o,A=rG({},nP),d=rG({},oP),u=rG({},rP),{audioTrack:E,videoTrack:l,audioSSRC:h,videoSSRC:p}=e.getRemoteMedia(i),_=e.getStats(),I=null==_?void 0:_.audioRecv.find((e=>e.ssrc===h)),g=null==_?void 0:_.videoRecv.find((e=>e.ssrc===p)),f=this.trafficStats&&this.trafficStats.peer_delay.find((e=>e.peer_uid===i));if(I&&("opus"!==I.codec&&"aac"!==I.codec&&"PCMU"!==I.codec&&"PCMA"!==I.codec&&"G722"!==I.codec||(A.codecType=I.codec),I.outputLevel?A.receiveLevel=Math.round(32767*I.outputLevel):E&&(A.receiveLevel=Math.round(32767*E.getVolumeLevel())),A.receiveBytes=I.bytes,A.receivePackets=I.packets,A.receivePacketsLost=I.packetsLost,A.packetLossRate=A.receivePacketsLost/(A.receivePackets+A.receivePacketsLost),A.receiveBitrate=s?8*Math.max(0,A.receiveBytes-s.receiveBytes):0,A.totalDuration=s?s.totalDuration+1:1,A.totalFreezeTime=s?s.totalFreezeTime:0,A.freezeRate=A.totalFreezeTime/A.totalDuration,A.receiveDelay=I.jitterBufferMs,A.totalDuration>10&&oG.isRemoteAudioFreeze(E)&&(A.totalFreezeTime+=1)),g){"H264"!==g.codec&&"VP8"!==g.codec&&"VP9"!==g.codec&&"AV1X"!==g.codec&&"AV1"!==g.codec||(d.codecType=g.codec),d.receiveBytes=g.bytes,d.receiveBitrate=a?8*Math.max(0,d.receiveBytes-a.receiveBytes):0,d.decodeFrameRate=g.decodeFrameRate<0?0:g.decodeFrameRate,d.renderFrameRate=g.decodeFrameRate<0?0:g.decodeFrameRate,g.outputFrame&&(d.renderFrameRate=g.outputFrame.frameRate),g.receivedFrame?(d.receiveFrameRate=g.receivedFrame.frameRate,d.receiveResolutionHeight=g.receivedFrame.height,d.receiveResolutionWidth=g.receivedFrame.width):l&&(d.receiveResolutionHeight=l._videoHeight||0,d.receiveResolutionWidth=l._videoWidth||0),void 0!==g.framesRateFirefox&&(d.receiveFrameRate=Math.round(g.framesRateFirefox)),d.receivePackets=g.packets,d.receivePacketsLost=g.packetsLost,d.packetLossRate=d.receivePacketsLost/(d.receivePackets+d.receivePacketsLost),d.totalDuration=a?a.totalDuration+1:1,d.totalFreezeTime=a?a.totalFreezeTime:0,d.receiveDelay=g.jitterBufferMs||0;const t=!!p&&e.getRemoteVideoIsReady(p);l&&t&&oG.isRemoteVideoFreeze(l,g,c)&&(d.totalFreezeTime+=1),d.freezeRate=d.totalFreezeTime/d.totalDuration}f&&(A.end2EndDelay=f.B_ad,d.end2EndDelay=f.B_vd,A.transportDelay=f.B_ed,d.transportDelay=f.B_ed,A.currentPacketLossRate=f.B_ealr4/100,d.currentPacketLossRate=f.B_evlr4/100,u.uplinkNetworkQuality=f.B_punq?f.B_punq:0,u.downlinkNetworkQuality=f.B_pdnq?f.B_pdnq:0),this.remoteStats.set(i,{audioStats:A,videoStats:d,videoPcStats:g,networkStats:u}),E&&this.exceptionMonitor.setRemoteAudioStats(E,A),l&&this.exceptionMonitor.setRemoteVideoStats(l,d)}))}}function sG(e){return(new TextEncoder).encode(e)}const aG=async e=>function(e,t){let i="";return new Uint8Array(e).forEach((e=>{i+=e.toString(16).padStart(2,"0")})),i}(await crypto.subtle.digest("SHA-256",sG(e)));function cG(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function AG(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?cG(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):cG(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function dG(e){if(!e.address||!e.tcp)throw new pw(hw.UNEXPECTED_RESPONSE,"Invalid address format ".concat(e));return e.address.match(/^[\.\:\d]+$/)?"".concat(e.address.replace(/[^\d]/g,"-"),".edge.agora.io"):(mw.info("Cannot recognized as IP address ".concat(e.address,". Used As Host instead")),"".concat(e.address,":").concat(e.tcp))}function uG(e){return e.match(/^[\.\:\d]+$/)?"".concat(e.replace(/[^\d]/g,"-"),".").concat(cb("TURN_DOMAIN")):(mw.info("Cannot recognized as IP address ".concat(e,". Used As Host instead")),e)}function EG(e,t){const i=cb("GATEWAY_DOMAINS");let n=i[1]&&-1!==t.indexOf(i[1])?1:0;return e.addresses=e.addresses||[],{gatewayAddrs:e.addresses.map((e=>e.domain_prefix?{address:"".concat(e.domain_prefix,".").concat(i[n++%i.length],":").concat(e.port)}:e.ip.match(/^[\.\:\d]+$/)?{ip:e.ip,port:e.port,address:"".concat(e.ip.replace(/[^\d]/g,"-"),".").concat(i[n++%i.length],":").concat(e.port)}:(mw.info("Cannot recognized as IP address ".concat(e.ip,". Used As Host instead")),{ip:e.ip,port:e.port,address:"".concat(e.ip,":").concat(e.port)}))),uid:e.uid,cid:e.cid,vid:e.detail&&e.detail[8],uni_lbs_ip:e.detail&&e.detail[1],res:e,csIp:e.detail&&e.detail[502]}}function lG(e){return"number"==typeof e?e:e.exact||e.ideal||e.max||e.min||0}function hG(e){const t=e._encoderConfig;if(!t)return{};const i={resolution:t.width&&t.height?"".concat(lG(t.width),"x").concat(lG(t.height)):void 0,maxVideoBW:t.bitrateMax,minVideoBW:t.bitrateMin};return"number"==typeof t.frameRate?(i.maxFrameRate=t.frameRate,i.minFrameRate=t.frameRate):t.frameRate&&(i.maxFrameRate=t.frameRate.max||t.frameRate.ideal||t.frameRate.exact||t.frameRate.min,i.minFrameRate=t.frameRate.min||t.frameRate.ideal||t.frameRate.exact||t.frameRate.max),i}function pG(e,t,i){var n;const r=t.videoSend.find((t=>t.ssrc===e));if(!r)return null;const o=null==i||null===(n=i.videoSend.find((t=>t.ssrc===e)))||void 0===n?void 0:n.inputFrame,s={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"video",type:"ssrc",ssrc:r.ssrc.toString()};return r.inputFrame&&(o&&r.inputFrame.height===o.height||(s.A_fhi=r.inputFrame.height?r.inputFrame.height.toString():"0"),o&&r.inputFrame.width===o.width||(s.A_fwi=r.inputFrame.width?r.inputFrame.width.toString():"0"),o&&r.inputFrame.frameRate===o.frameRate||(s.A_fri=r.inputFrame.frameRate?r.inputFrame.frameRate.toString():"0")),s}function _G(e){return e>=0&&e<.17?1:e>=.17&&e<.36?2:e>=.36&&e<.59?3:e>=.59&&e<=1?4:e>1?5:0}function IG(e,t){let i,n,r;switch(t){case WV.CHOOSE_SERVER:i=4096,n="choose server";break;case WV.CLOUD_PROXY:i=1048576,n="proxy";break;case WV.CLOUD_PROXY_5:i=4194304,n="proxy5";break;case WV.CLOUD_PROXY_FALLBACK:i=4194310,n="proxy fallback";break;default:throw new pw(hw.UNEXPECTED_ERROR,"multi unlibs response transformer get unknown service id",{csIp:e.detail&&e.detail[502],retry:!1})}if(e.response_body.forEach((t=>{t.buffer&&t.buffer.flag===i&&(r={code:t.buffer.code,addresses:(t.buffer.edges_services||[]).map((e=>AG(AG({},e),{},{ticket:t.buffer.cert}))),server_ts:e.enter_ts,uid:t.buffer.uid,cid:t.buffer.cid,cname:t.buffer.cname,detail:AG(AG({},t.buffer.detail),e.detail),flag:t.buffer.flag,opid:e.opid})})),!r)throw new pw(hw.MULTI_UNILBS_RESPONSE_ERROR,"cannot parse response ".concat(n," from multi unilbs response"),{csIp:e.detail&&e.detail[502]});return r}async function gG(e,t){return await Mm.all(e.addresses.map((async e=>({address:uG(e.ip),tcpport:e.port,udpport:e.port,username:t&&cb("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?t.toString():Zw.username,password:t&&cb("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?await aG(t.toString()):Zw.password}))))}function fG(e,t){const i=t._videoHeight||t.getMediaStreamTrack(!0).getSettings().height;return i?i/lG(e.height):4}function RG(e){let{candidateType:t,relayProtocol:i,type:n,address:r,port:o,protocol:s}=e;return"local-candidate"===n?{candidateType:t,relayProtocol:i,protocol:s}:{candidateType:t,relayProtocol:i,address:r,port:o,protocol:s}}function CG(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function TG(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?CG(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):CG(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function mG(e){return window.TextEncoder?(new TextEncoder).encode(e).length:e.length}function SG(e){return new Mm((t=>{window.setTimeout(t,e)}))}function OG(e){const t=new pw(hw.TIMEOUT,"timeout");return new Mm(((i,n)=>{window.setTimeout((()=>n(t)),e)}))}function vG(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,t=arguments.length>1?arguments[1]:void 0;const i=Math.random().toString(16).substr(2,e).toLowerCase();return i.length===e?"".concat(t).concat(i):"".concat(t).concat(i)+vG(e-i.length,"")}function NG(){return vG(32,"").toUpperCase()}const yG=()=>{};function DG(e){return new Mm(((t,i)=>{let n=!1;const r=document.createElement("video");r.setAttribute("autoplay",""),r.setAttribute("muted",""),r.muted=!0,r.autoplay=!0,r.setAttribute("playsinline",""),r.setAttribute("style","position: fixed; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(r);const o=Vy()?"canplay":"playing";r.addEventListener(o,(()=>{const e=r.videoWidth,i=r.videoHeight;!e&&By()||(n=!0,r.srcObject=null,r.remove(),t([e,i]))})),r.srcObject=new MediaStream([e]),r.play().catch(yG),setTimeout((()=>{n||(r.srcObject=null,r.remove(),t([r.videoWidth,r.videoHeight]))}),4e3)}))}function wG(e){return Mm.all(e.map((e=>e.then((e=>{throw e}),(e=>e))))).then((e=>{throw e}),(e=>e))}function bG(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return 0===e.getListeners(t).length?Mm.reject(new pw(hw.UNEXPECTED_ERROR,"can not emit promise")):new Mm(((i,r)=>{e.emit(t,...n,i,r)}))}function LG(e,t){if(0===e.getListeners(t).length)return Mm.resolve();for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return bG(e,t,...n)}function PG(e,t){if(0===e.getListeners(t).length)return null;for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return kG(e,t,...n)}function kG(e,t){let i=null,n=null;for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];if(e.emit(t,...o,(e=>{i=e}),(e=>{n=e})),null!==n)throw n;if(null===i)throw new pw(hw.UNEXPECTED_ERROR,"handler is not sync");return i}function MG(e,t){const i=e.indexOf(t);-1!==i&&e.splice(i,1)}function UG(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&t.push(e)})),t}function BG(e){Mm.resolve().then(e)}function VG(e){return JSON.parse(JSON.stringify(e))}const QG={};function xG(e,t){QG[t]||(QG[t]=!0,e())}function FG(e){const t=window.atob(e),i=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e+=1)i[e]=t.charCodeAt(e);return i}function GG(e){let t="";for(let i=0;i<e.length;i+=1)t+=String.fromCharCode(e[i]);return window.btoa(t)}const jG=new class{constructor(){tD(this,"fnMap",new Map)}throttleByKey(e,t,i,n){for(var r=arguments.length,o=new Array(r>4?r-4:0),s=4;s<r;s++)o[s-4]=arguments[s];if(this.fnMap.has(t)){const r=this.fnMap.get(t);if(r.threshold!==i){r.fn(...r.args),clearTimeout(r.timer);const s=window.setTimeout((()=>{const e=this.fnMap.get(t);e&&e.fn(...e.args),this.fnMap.delete(t)}),i);this.fnMap.set(t,{fn:e,threshold:i,timer:s,args:o,skipFn:n})}else r.skipFn&&r.skipFn(...r.args),this.fnMap.set(t,TG(TG({},r),{},{fn:e,args:o,skipFn:n}))}else{const r=window.setTimeout((()=>{const e=this.fnMap.get(t);e&&e.fn(...e.args),this.fnMap.delete(t)}),i);this.fnMap.set(t,{fn:e,threshold:i,timer:r,args:o,skipFn:n})}}},YG=jG.throttleByKey.bind(jG),HG=async e=>{let{fragementLength:t,referenceList:i,asyncMapHandler:n,allFailedhandler:r,promisesCollector:o}=e,s=0;const a=t;let c,A=0;const d=async()=>{const e=(()=>{const e=s*a,t=e+a;return i.slice(e,t).map(n)})();o&&o.push(...e);try{c=await wG(e)}catch(e){if(A+=a,s++,!(A>=i.length))return void await d();r(e)}e.forEach((e=>e.cancel()))};return await d(),c};function KG(e){return"object"==typeof e&&null!==e&&!(e instanceof RegExp)}var WG=Tc,JG=md("iterator"),qG=!WG((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,i="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),i+=n+e})),!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[JG]||"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"!==i||"x"!==new URL("http://x",void 0).host})),XG=xc,zG=Dc,ZG=jc,$G=Tc,ej=D_,tj=p_,ij=Yc,nj=rd,rj=sA,oj=Object.assign,sj=Object.defineProperty,aj=zG([].concat),cj=!oj||$G((function(){if(XG&&1!==oj({b:1},oj(sj({},"a",{enumerable:!0,get:function(){sj(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=oj({},e)[i]||ej(oj({},t)).join("")!=n}))?function(e,t){for(var i=nj(e),n=arguments.length,r=1,o=tj.f,s=ij.f;n>r;)for(var a,c=rj(arguments[r++]),A=o?aj(ej(c),o(c)):ej(c),d=A.length,u=0;d>u;)a=A[u++],XG&&!ZG(s,c,a)||(i[a]=c[a]);return i}:oj,Aj=hu,dj=LI,uj=au,Ej=jc,lj=rd,hj=function(e,t,i,n){try{return n?t(Aj(i)[0],i[1]):t(i)}catch(t){dj(e,"throw",t)}},pj=sI,_j=NR,Ij=ju,gj=Cb,fj=yI,Rj=CI,Cj=Lc.Array,Tj=Dc,mj=2147483647,Sj=/[^\0-\u007E]/,Oj=/[.\u3002\uFF0E\uFF61]/g,vj="Overflow: input needs wider integers to process",Nj=Lc.RangeError,yj=Tj(Oj.exec),Dj=Math.floor,wj=String.fromCharCode,bj=Tj("".charCodeAt),Lj=Tj([].join),Pj=Tj([].push),kj=Tj("".replace),Mj=Tj("".split),Uj=Tj("".toLowerCase),Bj=function(e){return e+22+75*(e<26)},Vj=function(e,t,i){var n=0;for(e=i?Dj(e/700):e>>1,e+=Dj(e/t);e>455;)e=Dj(e/35),n+=36;return Dj(n+36*e/(e+38))},Qj=function(e){var t,i,n=[],r=(e=function(e){for(var t=[],i=0,n=e.length;i<n;){var r=bj(e,i++);if(r>=55296&&r<=56319&&i<n){var o=bj(e,i++);56320==(64512&o)?Pj(t,((1023&r)<<10)+(1023&o)+65536):(Pj(t,r),i--)}else Pj(t,r)}return t}(e)).length,o=128,s=0,a=72;for(t=0;t<e.length;t++)(i=e[t])<128&&Pj(n,wj(i));var c=n.length,A=c;for(c&&Pj(n,"-");A<r;){var d=mj;for(t=0;t<e.length;t++)(i=e[t])>=o&&i<d&&(d=i);var u=A+1;if(d-o>Dj((mj-s)/u))throw Nj(vj);for(s+=(d-o)*u,o=d,t=0;t<e.length;t++){if((i=e[t])<o&&++s>mj)throw Nj(vj);if(i==o){for(var E=s,l=36;;){var h=l<=a?1:l>=a+26?26:l-a;if(E<h)break;var p=E-h,_=36-h;Pj(n,wj(Bj(h+p%_))),E=Dj(p/_),l+=36}Pj(n,wj(Bj(E))),a=Vj(s,u,A==c),s=0,A++}}s++,o++}return Lj(n,"")},xj=Lc.TypeError,Fj=Bu,Gj=Lc,jj=fA,Yj=jc,Hj=Dc,Kj=qG,Wj=tf,Jj=Zf,qj=Rf,Xj=Nf,zj=Wg,Zj=oR,$j=Vc,eY=ad,tY=au,iY=_I,nY=hu,rY=lA,oY=qI,sY=q_,aY=Xc,cY=yI,AY=CI,dY=function(e,t){if(e<t)throw xj("Not enough arguments");return e},uY=Pb,EY=md("iterator"),lY="URLSearchParams",hY="URLSearchParamsIterator",pY=zj.set,_Y=zj.getterFor(lY),IY=zj.getterFor(hY),gY=jj("fetch"),fY=jj("Request"),RY=jj("Headers"),CY=fY&&fY.prototype,TY=RY&&RY.prototype,mY=Gj.RegExp,SY=Gj.TypeError,OY=Gj.decodeURIComponent,vY=Gj.encodeURIComponent,NY=Hj("".charAt),yY=Hj([].join),DY=Hj([].push),wY=Hj("".replace),bY=Hj([].shift),LY=Hj([].splice),PY=Hj("".split),kY=Hj("".slice),MY=/\+/g,UY=Array(4),BY=function(e){return UY[e-1]||(UY[e-1]=mY("((?:%[\\da-f]{2}){"+e+"})","gi"))},VY=function(e){try{return OY(e)}catch(t){return e}},QY=function(e){var t=wY(e,MY," "),i=4;try{return OY(t)}catch(e){for(;i;)t=wY(t,BY(i--),VY);return t}},xY=/[!'()~]|%20/g,FY={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},GY=function(e){return FY[e]},jY=function(e){return wY(vY(e),xY,GY)},YY=Xj((function(e,t){pY(this,{type:hY,iterator:cY(_Y(e).entries),kind:t})}),"Iterator",(function(){var e=IY(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),i}),!0),HY=function(e){this.entries=[],this.url=null,void 0!==e&&(rY(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===NY(e,0)?kY(e,1):e:oY(e)))};HY.prototype={type:lY,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,n,r,o,s,a,c=AY(e);if(c)for(i=(t=cY(e,c)).next;!(n=Yj(i,t)).done;){if(o=(r=cY(nY(n.value))).next,(s=Yj(o,r)).done||(a=Yj(o,r)).done||!Yj(o,r).done)throw SY("Expected sequence with length 2");DY(this.entries,{key:oY(s.value),value:oY(a.value)})}else for(var A in e)eY(e,A)&&DY(this.entries,{key:A,value:oY(e[A])})},parseQuery:function(e){if(e)for(var t,i,n=PY(e,"&"),r=0;r<n.length;)(t=n[r++]).length&&(i=PY(t,"="),DY(this.entries,{key:QY(bY(i)),value:QY(yY(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],n=0;n<t.length;)e=t[n++],DY(i,jY(e.key)+"="+jY(e.value));return yY(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var KY=function(){Zj(this,WY),pY(this,new HY(arguments.length>0?arguments[0]:void 0))},WY=KY.prototype;if(Jj(WY,{append:function(e,t){dY(arguments.length,2);var i=_Y(this);DY(i.entries,{key:oY(e),value:oY(t)}),i.updateURL()},delete:function(e){dY(arguments.length,1);for(var t=_Y(this),i=t.entries,n=oY(e),r=0;r<i.length;)i[r].key===n?LY(i,r,1):r++;t.updateURL()},get:function(e){dY(arguments.length,1);for(var t=_Y(this).entries,i=oY(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){dY(arguments.length,1);for(var t=_Y(this).entries,i=oY(e),n=[],r=0;r<t.length;r++)t[r].key===i&&DY(n,t[r].value);return n},has:function(e){dY(arguments.length,1);for(var t=_Y(this).entries,i=oY(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){dY(arguments.length,1);for(var i,n=_Y(this),r=n.entries,o=!1,s=oY(e),a=oY(t),c=0;c<r.length;c++)(i=r[c]).key===s&&(o?LY(r,c--,1):(o=!0,i.value=a));o||DY(r,{key:s,value:a}),n.updateURL()},sort:function(){var e=_Y(this);uY(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=_Y(this).entries,n=tY(e,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((t=i[r++]).value,t.key,this)},keys:function(){return new YY(this,"keys")},values:function(){return new YY(this,"values")},entries:function(){return new YY(this,"entries")}},{enumerable:!0}),Wj(WY,EY,WY.entries,{name:"entries"}),Wj(WY,"toString",(function(){return _Y(this).serialize()}),{enumerable:!0}),qj(KY,lY),Fj({global:!0,forced:!Kj},{URLSearchParams:KY}),!Kj&&$j(RY)){var JY=Hj(TY.has),qY=Hj(TY.set),XY=function(e){if(rY(e)){var t,i=e.body;if(iY(i)===lY)return t=e.headers?new RY(e.headers):new RY,JY(t,"content-type")||qY(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),sY(e,{body:aY(0,oY(i)),headers:aY(0,t)})}return e};if($j(gY)&&Fj({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return gY(e,arguments.length>1?XY(arguments[1]):{})}}),$j(fY)){var zY=function(e){return Zj(this,CY),new fY(e,arguments.length>1?XY(arguments[1]):{})};CY.constructor=zY,zY.prototype=CY,Fj({global:!0,forced:!0},{Request:zY})}}var ZY,$Y={URLSearchParams:KY,getState:_Y},eH=Bu,tH=xc,iH=qG,nH=Lc,rH=au,oH=Dc,sH=v_.f,aH=tf,cH=oR,AH=ad,dH=cj,uH=function(e){var t=lj(e),i=_j(this),n=arguments.length,r=n>1?arguments[1]:void 0,o=void 0!==r;o&&(r=uj(r,n>2?arguments[2]:void 0));var s,a,c,A,d,u,E=Rj(t),l=0;if(!E||this==Cj&&pj(E))for(s=Ij(t),a=i?new this(s):Cj(s);s>l;l++)u=o?r(t[l],l):t[l],gj(a,l,u);else for(d=(A=fj(t,E)).next,a=i?new this:[];!(c=Ej(d,A)).done;l++)u=o?hj(A,r,[c.value,l],!0):c.value,gj(a,l,u);return a.length=l,a},EH=Nb,lH=Im.codeAt,hH=qI,pH=Rf,_H=$Y,IH=Wg,gH=IH.set,fH=IH.getterFor("URL"),RH=_H.URLSearchParams,CH=_H.getState,TH=nH.URL,mH=nH.TypeError,SH=nH.parseInt,OH=Math.floor,vH=Math.pow,NH=oH("".charAt),yH=oH(/./.exec),DH=oH([].join),wH=oH(1..toString),bH=oH([].pop),LH=oH([].push),PH=oH("".replace),kH=oH([].shift),MH=oH("".split),UH=oH("".slice),BH=oH("".toLowerCase),VH=oH([].unshift),QH="Invalid scheme",xH="Invalid host",FH="Invalid port",GH=/[a-z]/i,jH=/[\d+-.a-z]/i,YH=/\d/,HH=/^0x/i,KH=/^[0-7]+$/,WH=/^\d+$/,JH=/^[\da-f]+$/i,qH=/[\0\t\n\r #%/:<>?@[\\\]^|]/,XH=/[\0\t\n\r #/:<>?@[\\\]^|]/,zH=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ZH=/[\t\n\r]/g,$H=function(e){var t,i,n,r;if("number"==typeof e){for(t=[],i=0;i<4;i++)VH(t,e%256),e=OH(e/256);return DH(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,i=1,n=null,r=0,o=0;o<8;o++)0!==e[o]?(r>i&&(t=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i&&(t=n,i=r),t}(e),i=0;i<8;i++)r&&0===e[i]||(r&&(r=!1),n===i?(t+=i?":":"::",r=!0):(t+=wH(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},eK={},tK=dH({},eK,{" ":1,'"':1,"<":1,">":1,"`":1}),iK=dH({},tK,{"#":1,"?":1,"{":1,"}":1}),nK=dH({},iK,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),rK=function(e,t){var i=lH(e,0);return i>32&&i<127&&!AH(t,e)?e:encodeURIComponent(e)},oK={ftp:21,file:null,http:80,https:443,ws:80,wss:443},sK=function(e,t){var i;return 2==e.length&&yH(GH,NH(e,0))&&(":"==(i=NH(e,1))||!t&&"|"==i)},aK=function(e){var t;return e.length>1&&sK(UH(e,0,2))&&(2==e.length||"/"===(t=NH(e,2))||"\\"===t||"?"===t||"#"===t)},cK=function(e){return"."===e||"%2e"===BH(e)},AK={},dK={},uK={},EK={},lK={},hK={},pK={},_K={},IK={},gK={},fK={},RK={},CK={},TK={},mK={},SK={},OK={},vK={},NK={},yK={},DK={},wK=function(e,t,i){var n,r,o,s=hH(e);if(t){if(r=this.parse(s))throw mH(r);this.searchParams=null}else{if(void 0!==i&&(n=new wK(i,!0)),r=this.parse(s,null,n))throw mH(r);(o=CH(new RH)).bindURL(this),this.searchParams=o}};wK.prototype={type:"URL",parse:function(e,t,i){var n,r,o,s,a,c=this,A=t||AK,d=0,u="",E=!1,l=!1,h=!1;for(e=hH(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=PH(e,zH,"")),e=PH(e,ZH,""),n=uH(e);d<=n.length;){switch(r=n[d],A){case AK:if(!r||!yH(GH,r)){if(t)return QH;A=uK;continue}u+=BH(r),A=dK;break;case dK:if(r&&(yH(jH,r)||"+"==r||"-"==r||"."==r))u+=BH(r);else{if(":"!=r){if(t)return QH;u="",A=uK,d=0;continue}if(t&&(c.isSpecial()!=AH(oK,u)||"file"==u&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=u,t)return void(c.isSpecial()&&oK[c.scheme]==c.port&&(c.port=null));u="","file"==c.scheme?A=TK:c.isSpecial()&&i&&i.scheme==c.scheme?A=EK:c.isSpecial()?A=_K:"/"==n[d+1]?(A=lK,d++):(c.cannotBeABaseURL=!0,LH(c.path,""),A=NK)}break;case uK:if(!i||i.cannotBeABaseURL&&"#"!=r)return QH;if(i.cannotBeABaseURL&&"#"==r){c.scheme=i.scheme,c.path=EH(i.path),c.query=i.query,c.fragment="",c.cannotBeABaseURL=!0,A=DK;break}A="file"==i.scheme?TK:hK;continue;case EK:if("/"!=r||"/"!=n[d+1]){A=hK;continue}A=IK,d++;break;case lK:if("/"==r){A=gK;break}A=vK;continue;case hK:if(c.scheme=i.scheme,r==ZY)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.query=i.query;else if("/"==r||"\\"==r&&c.isSpecial())A=pK;else if("?"==r)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.query="",A=yK;else{if("#"!=r){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.path.length--,A=vK;continue}c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=EH(i.path),c.query=i.query,c.fragment="",A=DK}break;case pK:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,A=vK;continue}A=gK}else A=IK;break;case _K:if(A=IK,"/"!=r||"/"!=NH(u,d+1))continue;d++;break;case IK:if("/"!=r&&"\\"!=r){A=gK;continue}break;case gK:if("@"==r){E&&(u="%40"+u),E=!0,o=uH(u);for(var p=0;p<o.length;p++){var _=o[p];if(":"!=_||h){var I=rK(_,nK);h?c.password+=I:c.username+=I}else h=!0}u=""}else if(r==ZY||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(E&&""==u)return"Invalid authority";d-=uH(u).length+1,u="",A=fK}else u+=r;break;case fK:case RK:if(t&&"file"==c.scheme){A=SK;continue}if(":"!=r||l){if(r==ZY||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==u)return xH;if(t&&""==u&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(u))return s;if(u="",A=OK,t)return;continue}"["==r?l=!0:"]"==r&&(l=!1),u+=r}else{if(""==u)return xH;if(s=c.parseHost(u))return s;if(u="",A=CK,t==RK)return}break;case CK:if(!yH(YH,r)){if(r==ZY||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=u){var g=SH(u,10);if(g>65535)return FH;c.port=c.isSpecial()&&g===oK[c.scheme]?null:g,u=""}if(t)return;A=OK;continue}return FH}u+=r;break;case TK:if(c.scheme="file","/"==r||"\\"==r)A=mK;else{if(!i||"file"!=i.scheme){A=vK;continue}if(r==ZY)c.host=i.host,c.path=EH(i.path),c.query=i.query;else if("?"==r)c.host=i.host,c.path=EH(i.path),c.query="",A=yK;else{if("#"!=r){aK(DH(EH(n,d),""))||(c.host=i.host,c.path=EH(i.path),c.shortenPath()),A=vK;continue}c.host=i.host,c.path=EH(i.path),c.query=i.query,c.fragment="",A=DK}}break;case mK:if("/"==r||"\\"==r){A=SK;break}i&&"file"==i.scheme&&!aK(DH(EH(n,d),""))&&(sK(i.path[0],!0)?LH(c.path,i.path[0]):c.host=i.host),A=vK;continue;case SK:if(r==ZY||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&sK(u))A=vK;else if(""==u){if(c.host="",t)return;A=OK}else{if(s=c.parseHost(u))return s;if("localhost"==c.host&&(c.host=""),t)return;u="",A=OK}continue}u+=r;break;case OK:if(c.isSpecial()){if(A=vK,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=ZY&&(A=vK,"/"!=r))continue}else c.fragment="",A=DK;else c.query="",A=yK;break;case vK:if(r==ZY||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(a=BH(a=u))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||LH(c.path,"")):cK(u)?"/"==r||"\\"==r&&c.isSpecial()||LH(c.path,""):("file"==c.scheme&&!c.path.length&&sK(u)&&(c.host&&(c.host=""),u=NH(u,0)+":"),LH(c.path,u)),u="","file"==c.scheme&&(r==ZY||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)kH(c.path);"?"==r?(c.query="",A=yK):"#"==r&&(c.fragment="",A=DK)}else u+=rK(r,iK);break;case NK:"?"==r?(c.query="",A=yK):"#"==r?(c.fragment="",A=DK):r!=ZY&&(c.path[0]+=rK(r,eK));break;case yK:t||"#"!=r?r!=ZY&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":rK(r,eK)):(c.fragment="",A=DK);break;case DK:r!=ZY&&(c.fragment+=rK(r,tK))}d++}},parseHost:function(e){var t,i,n;if("["==NH(e,0)){if("]"!=NH(e,e.length-1))return xH;if(!(t=function(e){var t,i,n,r,o,s,a,c=[0,0,0,0,0,0,0,0],A=0,d=null,u=0,E=function(){return NH(e,u)};if(":"==E()){if(":"!=NH(e,1))return;u+=2,d=++A}for(;E();){if(8==A)return;if(":"!=E()){for(t=i=0;i<4&&yH(JH,E());)t=16*t+SH(E(),16),u++,i++;if("."==E()){if(0==i)return;if(u-=i,A>6)return;for(n=0;E();){if(r=null,n>0){if(!("."==E()&&n<4))return;u++}if(!yH(YH,E()))return;for(;yH(YH,E());){if(o=SH(E(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;u++}c[A]=256*c[A]+r,2!=++n&&4!=n||A++}if(4!=n)return;break}if(":"==E()){if(u++,!E())return}else if(E())return;c[A++]=t}else{if(null!==d)return;u++,d=++A}}if(null!==d)for(s=A-d,A=7;0!=A&&s>0;)a=c[A],c[A--]=c[d+s-1],c[d+--s]=a;else if(8!=A)return;return c}(UH(e,1,-1))))return xH;this.host=t}else if(this.isSpecial()){if(e=function(e){var t,i,n=[],r=Mj(kj(Uj(e),Oj,"."),".");for(t=0;t<r.length;t++)i=r[t],Pj(n,yj(Sj,i)?"xn--"+Qj(i):i);return Lj(n,".")}(e),yH(qH,e))return xH;if(null===(t=function(e){var t,i,n,r,o,s,a,c=MH(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(i=[],n=0;n<t;n++){if(""==(r=c[n]))return e;if(o=10,r.length>1&&"0"==NH(r,0)&&(o=yH(HH,r)?16:8,r=UH(r,8==o?1:2)),""===r)s=0;else{if(!yH(10==o?WH:8==o?KH:JH,r))return e;s=SH(r,o)}LH(i,s)}for(n=0;n<t;n++)if(s=i[n],n==t-1){if(s>=vH(256,5-t))return null}else if(s>255)return null;for(a=bH(i),n=0;n<i.length;n++)a+=i[n]*vH(256,3-n);return a}(e)))return xH;this.host=t}else{if(yH(XH,e))return xH;for(t="",i=uH(e),n=0;n<i.length;n++)t+=rK(i[n],eK);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return AH(oK,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&sK(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,n=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,A=t+":";return null!==r?(A+="//",e.includesCredentials()&&(A+=i+(n?":"+n:"")+"@"),A+=$H(r),null!==o&&(A+=":"+o)):"file"==t&&(A+="//"),A+=e.cannotBeABaseURL?s[0]:s.length?"/"+DH(s,"/"):"",null!==a&&(A+="?"+a),null!==c&&(A+="#"+c),A},setHref:function(e){var t=this.parse(e);if(t)throw mH(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new bK(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+$H(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(hH(e)+":",AK)},getUsername:function(){return this.username},setUsername:function(e){var t=uH(hH(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=rK(t[i],nK)}},getPassword:function(){return this.password},setPassword:function(e){var t=uH(hH(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=rK(t[i],nK)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?$H(e):$H(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,fK)},getHostname:function(){var e=this.host;return null===e?"":$H(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,RK)},getPort:function(){var e=this.port;return null===e?"":hH(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=hH(e))?this.port=null:this.parse(e,CK))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+DH(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,OK))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=hH(e))?this.query=null:("?"==NH(e,0)&&(e=UH(e,1)),this.query="",this.parse(e,yK)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=hH(e))?("#"==NH(e,0)&&(e=UH(e,1)),this.fragment="",this.parse(e,DK)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var bK=function(e){var t=cH(this,LK),i=gH(t,new wK(e,!1,arguments.length>1?arguments[1]:void 0));tH||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},LK=bK.prototype,PK=function(e,t){return{get:function(){return fH(this)[e]()},set:t&&function(e){return fH(this)[t](e)},configurable:!0,enumerable:!0}};if(tH&&sH(LK,{href:PK("serialize","setHref"),origin:PK("getOrigin"),protocol:PK("getProtocol","setProtocol"),username:PK("getUsername","setUsername"),password:PK("getPassword","setPassword"),host:PK("getHost","setHost"),hostname:PK("getHostname","setHostname"),port:PK("getPort","setPort"),pathname:PK("getPathname","setPathname"),search:PK("getSearch","setSearch"),searchParams:PK("getSearchParams"),hash:PK("getHash","setHash")}),aH(LK,"toJSON",(function(){return fH(this).serialize()}),{enumerable:!0}),aH(LK,"toString",(function(){return fH(this).serialize()}),{enumerable:!0}),TH){var kK=TH.createObjectURL,MK=TH.revokeObjectURL;kK&&aH(bK,"createObjectURL",rH(kK,TH)),MK&&aH(bK,"revokeObjectURL",rH(MK,TH))}pH(bK,"URL"),eH({global:!0,forced:!iH,sham:!tH},{URL:bK});var UK=hA.URL;const BK={[kL.ACCESS_POINT]:{[BL.NO_FLAG_SET]:{desc:"flag is zero",retry:!1},[BL.FLAG_SET_BUT_EMPTY]:{desc:"flag is empty",retry:!1},[BL.INVALID_FALG_SET]:{desc:"invalid flag",retry:!1},[BL.FLAG_SET_BUT_NO_RE]:{desc:"flag set unilbs but no request",retry:!1},[BL.INVALID_SERVICE_ID]:{desc:"invalid service id",retry:!1},[BL.NO_SERVICE_AVAILABLE]:{desc:"no service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_P2P]:{desc:"no unilbs p2p service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_VOET]:{desc:"no unilbs voice service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_WEBRTC]:{desc:"no unilbs webrtc service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_CDS]:{desc:"no cds service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_CDN]:{desc:"no cdn dispatcher service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_TDS]:{desc:"no tds service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_REPORT]:{desc:"no unilbs report service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_APP_CENTER]:{desc:"no app center service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_ENV0]:{desc:"no unilbs sig env0 service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_VOET]:{desc:"no unilbs voet service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_STRING_UID]:{desc:"no string uid service available",retry:!0},[BL.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS]:{desc:"no webrtc unilbs service available",retry:!0}},[kL.UNILBS]:{[UL.INVALID_VENDOR_KEY]:{desc:"invalid vendor key, can not find appid",retry:!1},[UL.INVALID_CHANNEL_NAME]:{desc:"invalid channel name",retry:!1},[UL.INTERNAL_ERROR]:{desc:"unilbs internal error",retry:!1},[UL.NO_AUTHORIZED]:{desc:"invalid token, authorized failed",retry:!1},[UL.DYNAMIC_KEY_TIMEOUT]:{desc:"dynamic key or token timeout",retry:!1},[UL.NO_ACTIVE_STATUS]:{desc:"no active status",retry:!1},[UL.DYNAMIC_KEY_EXPIRED]:{desc:"dynamic key expired",retry:!1},[UL.STATIC_USE_DYNAMIC_KEY]:{desc:"static use dynamic key",retry:!1},[UL.DYNAMIC_USE_STATIC_KEY]:{desc:"dynamic use static key",retry:!1},[UL.USER_OVERLOAD]:{desc:"amount of users over load",retry:!1},[UL.FORBIDDEN_REGION]:{desc:"the request is forbidden in this area",retry:!1},[UL.CANNOT_MEET_AREA_DEMAND]:{desc:"unable to allocate services in this area",retry:!1}},[kL.STRING_UID_ALLOCATOR]:{[ML.IIIEGAL_APPID]:{desc:"invalid appid",retry:!1},[ML.IIIEGAL_UID]:{desc:"invalid string uid",retry:!1},[ML.INTERNAL_ERROR]:{desc:"string uid allocator internal error",retry:!0}}};function VK(e){const t=BK[Math.floor(e/1e4)];if(!t)return{desc:"unkonw error",retry:!1};const i=t[e%1e4];if(!i){if(Math.floor(e/1e4)===kL.ACCESS_POINT){const t=e%1e4;if("1"===t.toString()[0])return{desc:e.toString(),retry:!1};if("2"===t.toString()[0])return{desc:e.toString(),retry:!0}}return{desc:"unkonw error",retry:!1}}return i}const QK={[VL.K_TIMESTAMP_EXPIRED]:{desc:"K_TIMESTAMP_EXPIRED",action:"failed"},[VL.K_CHANNEL_PERMISSION_INVALID]:{desc:"K_CHANNEL_PERMISSION_INVALID",action:"failed"},[VL.K_CERTIFICATE_INVALID]:{desc:"K_CERTIFICATE_INVALID",action:"failed"},[VL.K_CHANNEL_NAME_EMPTY]:{desc:"K_CHANNEL_NAME_EMPTY",action:"failed"},[VL.K_CHANNEL_NOT_FOUND]:{desc:"K_CHANNEL_NOT_FOUND",action:"failed"},[VL.K_TICKET_INVALID]:{desc:"K_TICKET_INVALID",action:"failed"},[VL.K_CHANNEL_CONFLICTED]:{desc:"K_CHANNEL_CONFLICTED",action:"failed"},[VL.K_SERVICE_NOT_READY]:{desc:"K_SERVICE_NOT_READY",action:"tryNext"},[VL.K_SERVICE_TOO_HEAVY]:{desc:"K_SERVICE_TOO_HEAVY",action:"tryNext"},[VL.K_UID_BANNED]:{desc:"K_UID_BANNED",action:"failed"},[VL.K_IP_BANNED]:{desc:"K_IP_BANNED",action:"failed"},[VL.ERR_INVALID_VENDOR_KEY]:{desc:"ERR_INVALID_VENDOR_KEY",action:"failed"},[VL.ERR_INVALID_CHANNEL_NAME]:{desc:"ERR_INVALID_CHANNEL_NAME",action:"failed"},[VL.WARN_NO_AVAILABLE_CHANNEL]:{desc:"WARN_NO_AVAILABLE_CHANNEL",action:"failed"},[VL.WARN_LOOKUP_CHANNEL_TIMEOUT]:{desc:"WARN_LOOKUP_CHANNEL_TIMEOUT",action:"tryNext"},[VL.WARN_LOOKUP_CHANNEL_REJECTED]:{desc:"WARN_LOOKUP_CHANNEL_REJECTED",action:"failed"},[VL.WARN_OPEN_CHANNEL_TIMEOUT]:{desc:"WARN_OPEN_CHANNEL_TIMEOUT",action:"tryNext"},[VL.WARN_OPEN_CHANNEL_REJECTED]:{desc:"WARN_OPEN_CHANNEL_REJECTED",action:"failed"},[VL.WARN_REQUEST_DEFERRED]:{desc:"WARN_REQUEST_DEFERRED",action:"failed"},[VL.ERR_DYNAMIC_KEY_TIMEOUT]:{desc:"ERR_DYNAMIC_KEY_TIMEOUT",action:"failed"},[VL.ERR_NO_AUTHORIZED]:{desc:"ERR_NO_AUTHORIZED",action:"failed"},[VL.ERR_VOM_SERVICE_UNAVAILABLE]:{desc:"ERR_VOM_SERVICE_UNAVAILABLE",action:"tryNext"},[VL.ERR_NO_CHANNEL_AVAILABLE_CODE]:{desc:"ERR_NO_CHANNEL_AVAILABLE_CODE",action:"failed"},[VL.ERR_MASTER_VOCS_UNAVAILABLE]:{desc:"ERR_MASTER_VOCS_UNAVAILABLE",action:"tryNext"},[VL.ERR_INTERNAL_ERROR]:{desc:"ERR_INTERNAL_ERROR",action:"tryNext"},[VL.ERR_NO_ACTIVE_STATUS]:{desc:"ERR_NO_ACTIVE_STATUS",action:"failed"},[VL.ERR_INVALID_UID]:{desc:"ERR_INVALID_UID",action:"failed"},[VL.ERR_DYNAMIC_KEY_EXPIRED]:{desc:"ERR_DYNAMIC_KEY_EXPIRED",action:"failed"},[VL.ERR_STATIC_USE_DYANMIC_KE]:{desc:"ERR_STATIC_USE_DYANMIC_KE",action:"failed"},[VL.ERR_DYNAMIC_USE_STATIC_KE]:{desc:"ERR_DYNAMIC_USE_STATIC_KE",action:"failed"},[VL.ERR_NO_VOCS_AVAILABLE]:{desc:"ERR_NO_VOCS_AVAILABLE",action:"tryNext"},[VL.ERR_NO_VOS_AVAILABLE]:{desc:"ERR_NO_VOS_AVAILABLE",action:"tryNext"},[VL.ERR_JOIN_CHANNEL_TIMEOUT]:{desc:"ERR_JOIN_CHANNEL_TIMEOUT",action:"tryNext"},[VL.ERR_JOIN_BY_MULTI_IP]:{desc:"ERR_JOIN_BY_MULTI_IP",action:"recover"},[VL.ERR_NOT_JOINED]:{desc:"ERR_NOT_JOINED",action:"failed"},[VL.ERR_REPEAT_JOIN_REQUEST]:{desc:"ERR_REPEAT_JOIN_REQUEST",action:"quit"},[VL.ERR_REPEAT_JOIN_CHANNEL]:{desc:"ERR_REPEAT_JOIN_CHANNEL",action:"quit"},[VL.ERR_INVALID_VENDOR_KEY]:{desc:"ERR_INVALID_VENDOR_KEY",action:"failed"},[VL.ERR_INVALID_CHANNEL_NAME]:{desc:"ERR_INVALID_CHANNEL_NAME",action:"failed"},[VL.ERR_INVALID_STRINGUID]:{desc:"ERR_INVALID_STRINGUID",action:"failed"},[VL.ERR_TOO_MANY_USERS]:{desc:"ERR_TOO_MANY_USERS",action:"tryNext"},[VL.ERR_SET_CLIENT_ROLE_TIMEOUT]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[VL.ERR_SET_CLIENT_ROLE_NO_PERMISSION]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[VL.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE]:{desc:"ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",action:"success"},[VL.ERR_PUBLISH_REQUEST_INVALID]:{desc:"ERR_PUBLISH_REQUEST_INVALID",action:"failed"},[VL.ERR_SUBSCRIBE_REQUEST_INVALID]:{desc:"ERR_SUBSCRIBE_REQUEST_INVALID",action:"failed"},[VL.ERR_NOT_SUPPORTED_MESSAGE]:{desc:"ERR_NOT_SUPPORTED_MESSAGE",action:"failed"},[VL.ERR_ILLEAGAL_PLUGIN]:{desc:"ERR_ILLEAGAL_PLUGIN",action:"failed"},[VL.ILLEGAL_CLIENT_ROLE_LEVEL]:{desc:"ILLEGAL_CLIENT_ROLE_LEVEL",action:"failed"},[VL.ERR_REJOIN_TOKEN_INVALID]:{desc:"ERR_REJOIN_TOKEN_INVALID",action:"failed"},[VL.ERR_REJOIN_USER_NOT_JOINED]:{desc:"ERR_REJOIN_NOT_JOINED",action:"failed"},[VL.ERR_INVALID_OPTIONAL_INFO]:{desc:"ERR_INVALID_OPTIONAL_INFO",action:"quit"},[VL.ERR_TEST_RECOVER]:{desc:"ERR_TEST_RECOVER",action:"recover"},[VL.ERR_TEST_TRYNEXT]:{desc:"ERR_TEST_TRYNEXT",action:"recover"},[VL.ERR_TEST_RETRY]:{desc:"ERR_TEST_RETRY",action:"recover"},[VL.ILLEGAL_AES_PASSWORD]:{desc:"ERR_TEST_RETRY",action:"failed"},[VL.ERR_TOO_MANY_BROADCASTERS]:{desc:"ERR_TOO_MANY_BROADCASTERS",action:"failed"},[VL.ERR_TOO_MANY_SUBSCRIBERS]:{desc:"ERR_TOO_MANY_SUBSCRIBERS",action:"failed"}};function xK(e){return QK[e]||{desc:"UNKNOW_ERROR_".concat(e),action:"failed"}}var FK={exports:{}};!function(e,t){e.exports=function(){var e={d:function(t,i){for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataViewIndexOutOfBoundsError:function(){return x},DecodeError:function(){return g},Decoder:function(){return j},EXT_TIMESTAMP:function(){return f},Encoder:function(){return D},ExtData:function(){return _},ExtensionCodec:function(){return v},decode:function(){return H},decodeArrayStream:function(){return $},decodeAsync:function(){return Z},decodeMulti:function(){return K},decodeMultiStream:function(){return ee},decodeStream:function(){return te},decodeTimestampExtension:function(){return S},decodeTimestampToTimeSpec:function(){return m},encode:function(){return b},encodeDateToTimeSpec:function(){return C},encodeTimeSpecToTimestamp:function(){return R},encodeTimestampExtension:function(){return T}});var i=4294967295;function n(e,t,i){var n=Math.floor(i/4294967296),r=i;e.setUint32(t,n),e.setUint32(t+4,r)}function r(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var o=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},s=function(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e},a="undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function c(e){for(var t=e.length,i=0,n=0;n<t;){var r=e.charCodeAt(n++);if(0!=(4294967168&r))if(0==(4294965248&r))i+=2;else{if(r>=55296&&r<=56319&&n<t){var o=e.charCodeAt(n);56320==(64512&o)&&(++n,r=((1023&r)<<10)+(1023&o)+65536)}i+=0==(4294901760&r)?3:4}else i++}return i}var A=a?new TextEncoder:void 0,d=a?"undefined"!=typeof process?200:0:i,u=(null==A?void 0:A.encodeInto)?function(e,t,i){A.encodeInto(e,t.subarray(i))}:function(e,t,i){t.set(A.encode(e),i)};function E(e,t,i){for(var n=t,r=n+i,a=[],c="";n<r;){var A=e[n++];if(0==(128&A))a.push(A);else if(192==(224&A)){var d=63&e[n++];a.push((31&A)<<6|d)}else if(224==(240&A)){d=63&e[n++];var u=63&e[n++];a.push((31&A)<<12|d<<6|u)}else if(240==(248&A)){var E=(7&A)<<18|(d=63&e[n++])<<12|(u=63&e[n++])<<6|63&e[n++];E>65535&&(E-=65536,a.push(E>>>10&1023|55296),E=56320|1023&E),a.push(E)}else a.push(A);a.length>=4096&&(c+=String.fromCharCode.apply(String,s([],o(a))),a.length=0)}return a.length>0&&(c+=String.fromCharCode.apply(String,s([],o(a)))),c}var l,h=a?new TextDecoder:null,p=a?"undefined"!=typeof process?200:0:i,_=function(e,t){this.type=e,this.data=t},I=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),g=function(e){function t(i){var n=e.call(this,i)||this,r=Object.create(t.prototype);return Object.setPrototypeOf(n,r),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:t.name}),n}return I(t,e),t}(Error),f=-1;function R(e){var t,i=e.sec,r=e.nsec;if(i>=0&&r>=0&&i<=17179869183){if(0===r&&i<=4294967295){var o=new Uint8Array(4);return(t=new DataView(o.buffer)).setUint32(0,i),o}var s=i/4294967296,a=4294967295&i;return o=new Uint8Array(8),(t=new DataView(o.buffer)).setUint32(0,r<<2|3&s),t.setUint32(4,a),o}return o=new Uint8Array(12),(t=new DataView(o.buffer)).setUint32(0,r),n(t,4,i),o}function C(e){var t=e.getTime(),i=Math.floor(t/1e3),n=1e6*(t-1e3*i),r=Math.floor(n/1e9);return{sec:i+r,nsec:n-1e9*r}}function T(e){return e instanceof Date?R(C(e)):null}function m(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var i=t.getUint32(0);return{sec:4294967296*(3&i)+t.getUint32(4),nsec:i>>>2};case 12:return{sec:r(t,4),nsec:t.getUint32(0)};default:throw new g("Unrecognized data size for timestamp (expected 4, 8, or 12): "+e.length)}}function S(e){var t=m(e);return new Date(1e3*t.sec+t.nsec/1e6)}var O={type:f,encode:T,decode:S},v=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(O)}return e.prototype.register=function(e){var t=e.type,i=e.encode,n=e.decode;if(t>=0)this.encoders[t]=i,this.decoders[t]=n;else{var r=1+t;this.builtInEncoders[r]=i,this.builtInDecoders[r]=n}},e.prototype.tryToEncode=function(e,t){for(var i=0;i<this.builtInEncoders.length;i++)if(null!=(n=this.builtInEncoders[i])&&null!=(r=n(e,t)))return new _(-1-i,r);for(i=0;i<this.encoders.length;i++){var n,r;if(null!=(n=this.encoders[i])&&null!=(r=n(e,t)))return new _(i,r)}return e instanceof _?e:null},e.prototype.decode=function(e,t,i){var n=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return n?n(e,t,i):new _(t,e)},e.defaultCodec=new e,e}();function N(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}var y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},D=function(){function e(e,t,i,n,r,o,s,a){void 0===e&&(e=v.defaultCodec),void 0===t&&(t=void 0),void 0===i&&(i=100),void 0===n&&(n=2048),void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=!1),this.extensionCodec=e,this.context=t,this.maxDepth=i,this.initialBufferSize=n,this.sortKeys=r,this.forceFloat32=o,this.ignoreUndefined=s,this.forceIntegerToFloat=a,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.getUint8Array=function(){return this.bytes.subarray(0,this.pos)},e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.getUint8Array()},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth "+t);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),i=new Uint8Array(t),n=new DataView(t);i.set(this.bytes),this.view=n,this.bytes=i},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){Number.isSafeInteger(e)&&!this.forceIntegerToFloat?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: "+e+" bytes in UTF-8");this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>d){var t=c(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),u(e,this.bytes,this.pos),this.pos+=t}else t=c(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,i){for(var n=e.length,r=i,o=0;o<n;){var s=e.charCodeAt(o++);if(0!=(4294967168&s)){if(0==(4294965248&s))t[r++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&o<n){var a=e.charCodeAt(o);56320==(64512&a)&&(++o,s=((1023&s)<<10)+(1023&a)+65536)}0==(4294901760&s)?(t[r++]=s>>12&15|224,t[r++]=s>>6&63|128):(t[r++]=s>>18&7|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128)}t[r++]=63&s|128}else t[r++]=s}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var i=this.extensionCodec.tryToEncode(e,this.context);if(null!=i)this.encodeExtension(i);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(e));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: "+t);this.writeU8(198),this.writeU32(t)}var i=N(e);this.writeU8a(i)},e.prototype.encodeArray=function(e,t){var i,n,r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else{if(!(r<4294967296))throw new Error("Too large array: "+r);this.writeU8(221),this.writeU32(r)}try{for(var o=y(e),s=o.next();!s.done;s=o.next()){var a=s.value;this.doEncode(a,t+1)}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}},e.prototype.countWithoutUndefined=function(e,t){var i,n,r=0;try{for(var o=y(t),s=o.next();!s.done;s=o.next())void 0!==e[s.value]&&r++}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r},e.prototype.encodeMap=function(e,t){var i,n,r=Object.keys(e);this.sortKeys&&r.sort();var o=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(o<16)this.writeU8(128+o);else if(o<65536)this.writeU8(222),this.writeU16(o);else{if(!(o<4294967296))throw new Error("Too large map object: "+o);this.writeU8(223),this.writeU32(o)}try{for(var s=y(r),a=s.next();!a.done;a=s.next()){var c=a.value,A=e[c];this.ignoreUndefined&&void 0===A||(this.encodeString(c),this.doEncode(A,t+1))}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: "+t);this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,i){var n=i/4294967296,r=i;e.setUint32(t,n),e.setUint32(t+4,r)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),n(this.view,this.pos,e),this.pos+=8},e}(),w={};function b(e,t){return void 0===t&&(t=w),new D(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined,t.forceIntegerToFloat).encode(e)}function L(e){return(e<0?"-":"")+"0x"+Math.abs(e).toString(16).padStart(2,"0")}var P=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var i=0;i<this.maxKeyLength;i++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,i){var n,r,o=this.caches[i-1];try{e:for(var s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),a=s.next();!a.done;a=s.next()){for(var c=a.value,A=c.bytes,d=0;d<i;d++)if(A[d]!==e[t+d])continue e;return c.str}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return null},e.prototype.store=function(e,t){var i=this.caches[e.length-1],n={bytes:e,str:t};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=n:i.push(n)},e.prototype.decode=function(e,t,i){var n=this.find(e,t,i);if(null!=n)return this.hit++,n;this.miss++;var r=E(e,t,i),o=Uint8Array.prototype.slice.call(e,t,t+i);return this.store(o,r),r},e}(),k=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},M=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,r){!function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)}(n,r,(t=e[i](t)).done,t.value)}))}}},U=function(e){return this instanceof U?(this.v=e,this):new U(e)},B=function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){r[e]&&(n[e]=function(t){return new Promise((function(i,n){o.push([e,t,i,n])>1||a(e,t)}))})}function a(e,t){try{(i=r[e](t)).value instanceof U?Promise.resolve(i.value.v).then(c,A):d(o[0][2],i)}catch(e){d(o[0][3],e)}var i}function c(e){a("next",e)}function A(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},V=new DataView(new ArrayBuffer(0)),Q=new Uint8Array(V.buffer),x=function(){try{V.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")}(),F=new x("Insufficient data"),G=new P,j=function(){function e(e,t,n,r,o,s,a,c){void 0===e&&(e=v.defaultCodec),void 0===t&&(t=void 0),void 0===n&&(n=i),void 0===r&&(r=i),void 0===o&&(o=i),void 0===s&&(s=i),void 0===a&&(a=i),void 0===c&&(c=G),this.extensionCodec=e,this.context=t,this.maxStrLength=n,this.maxBinLength=r,this.maxArrayLength=o,this.maxMapLength=s,this.maxExtLength=a,this.keyDecoder=c,this.totalPos=0,this.pos=0,this.view=V,this.bytes=Q,this.headByte=-1,this.stack=[]}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.length=0},e.prototype.setBuffer=function(e){this.bytes=N(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=N(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),i=N(e),n=new Uint8Array(t.length+i.length);n.set(t),n.set(i,t.length),this.setBuffer(n)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,i=this.pos;return new RangeError("Extra "+(t.byteLength-i)+" of "+t.byteLength+" byte(s) found at buffer["+e+"]")},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return k(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,i,n,r,o,s,a;return o=this,void 0,a=function(){var o,s,a,c,A,d,u,E;return k(this,(function(l){switch(l.label){case 0:o=!1,l.label=1;case 1:l.trys.push([1,6,7,12]),t=M(e),l.label=2;case 2:return[4,t.next()];case 3:if((i=l.sent()).done)return[3,5];if(a=i.value,o)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),o=!0}catch(e){if(!(e instanceof x))throw e}this.totalPos+=this.pos,l.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=l.sent(),n={error:c},[3,12];case 7:return l.trys.push([7,,10,11]),i&&!i.done&&(r=t.return)?[4,r.call(t)]:[3,9];case 8:l.sent(),l.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:if(o){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw d=(A=this).headByte,u=A.pos,E=A.totalPos,new RangeError("Insufficient data in parsing "+L(d)+" at "+E+" ("+u+" in the current buffer)")}}))},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{r(a.next(e))}catch(e){t(e)}}function n(e){try{r(a.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(i,n)}r((a=a.apply(o,[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return B(this,arguments,(function(){var i,n,r,o,s,a,c,A,d;return k(this,(function(u){switch(u.label){case 0:i=t,n=-1,u.label=1;case 1:u.trys.push([1,13,14,19]),r=M(e),u.label=2;case 2:return[4,U(r.next())];case 3:if((o=u.sent()).done)return[3,12];if(s=o.value,t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),i&&(n=this.readArraySize(),i=!1,this.complete()),u.label=4;case 4:u.trys.push([4,9,,10]),u.label=5;case 5:return[4,U(this.doDecodeSync())];case 6:return[4,u.sent()];case 7:return u.sent(),0==--n?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=u.sent())instanceof x))throw a;return[3,10];case 10:this.totalPos+=this.pos,u.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=u.sent(),A={error:c},[3,19];case 14:return u.trys.push([14,,17,18]),o&&!o.done&&(d=r.return)?[4,U(d.call(r))]:[3,16];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:if(A)throw A.error;return[7];case 18:return[7];case 19:return[2]}}))}))},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(n=e-128)){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){if(0!=(n=e-144)){this.pushArrayState(n),this.complete();continue e}t=[]}else{var i=e-160;t=this.decodeUtf8String(i,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)i=this.lookU8(),t=this.decodeUtf8String(i,1);else if(218===e)i=this.lookU16(),t=this.decodeUtf8String(i,2);else if(219===e)i=this.lookU32(),t=this.decodeUtf8String(i,4);else if(220===e){if(0!==(n=this.readU16())){this.pushArrayState(n),this.complete();continue e}t=[]}else if(221===e){if(0!==(n=this.readU32())){this.pushArrayState(n),this.complete();continue e}t=[]}else if(222===e){if(0!==(n=this.readU16())){this.pushMapState(n),this.complete();continue e}t={}}else if(223===e){if(0!==(n=this.readU32())){this.pushMapState(n),this.complete();continue e}t={}}else if(196===e){var n=this.lookU8();t=this.decodeBinary(n,1)}else if(197===e)n=this.lookU16(),t=this.decodeBinary(n,2);else if(198===e)n=this.lookU32(),t=this.decodeBinary(n,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)n=this.lookU8(),t=this.decodeExtension(n,1);else if(200===e)n=this.lookU16(),t=this.decodeExtension(n,2);else{if(201!==e)throw new g("Unrecognized type byte: "+L(e));n=this.lookU32(),t=this.decodeExtension(n,4)}this.complete();for(var r=this.stack;r.length>0;){var o=r[r.length-1];if(0===o.type){if(o.array[o.position]=t,o.position++,o.position!==o.size)continue e;r.pop(),t=o.array}else{if(1===o.type){if("string"!=(s=typeof t)&&"number"!==s)throw new g("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new g("The key __proto__ is not allowed");o.key=t,o.type=2;continue e}if(o.map[o.key]=t,o.readCount++,o.readCount!==o.size){o.key=null,o.type=1;continue e}r.pop(),t=o.map}}return t}var s},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new g("Unrecognized array type byte: "+L(e))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new g("Max length exceeded: map length ("+e+") > maxMapLengthLength ("+this.maxMapLength+")");this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new g("Max length exceeded: array length ("+e+") > maxArrayLength ("+this.maxArrayLength+")");this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var i;if(e>this.maxStrLength)throw new g("Max length exceeded: UTF-8 byte length ("+e+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLength<this.pos+t+e)throw F;var n,r=this.pos+t;return n=this.stateIsMapKey()&&(null===(i=this.keyDecoder)||void 0===i?void 0:i.canBeCached(e))?this.keyDecoder.decode(this.bytes,r,e):e>p?function(e,t,i){var n=e.subarray(t,t+i);return h.decode(n)}(this.bytes,r,e):E(this.bytes,r,e),this.pos+=t+e,n},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new g("Max length exceeded: bin length ("+e+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(e+t))throw F;var i=this.pos+t,n=this.bytes.subarray(i,i+e);return this.pos+=t+e,n},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new g("Max length exceeded: ext length ("+e+") > maxExtLength ("+this.maxExtLength+")");var i=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,i,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,i=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,i},e.prototype.readI64=function(){var e=r(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}(),Y={};function H(e,t){return void 0===t&&(t=Y),new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decode(e)}function K(e,t){return void 0===t&&(t=Y),new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeMulti(e)}var W=function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},J=function(e){return this instanceof J?(this.v=e,this):new J(e)},q=function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){r[e]&&(n[e]=function(t){return new Promise((function(i,n){o.push([e,t,i,n])>1||a(e,t)}))})}function a(e,t){try{(i=r[e](t)).value instanceof J?Promise.resolve(i.value.v).then(c,A):d(o[0][2],i)}catch(e){d(o[0][3],e)}var i}function c(e){a("next",e)}function A(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}};function X(e){if(null==e)throw new Error("Assertion Failure: value must not be null nor undefined")}function z(e){return null!=e[Symbol.asyncIterator]?e:function(e){return q(this,arguments,(function(){var t,i,n,r;return W(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,J(t.read())];case 3:return i=o.sent(),n=i.done,r=i.value,n?[4,J(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return X(r),[4,J(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e)}function Z(e,t){return void 0===t&&(t=Y),i=this,void 0,r=function(){var i;return function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(n){return i=z(e),[2,new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeAsync(i)]}))},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{a(r.next(e))}catch(e){t(e)}}function s(e){try{a(r.throw(e))}catch(e){t(e)}}function a(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,s)}a((r=r.apply(i,[])).next())}));var i,n,r}function $(e,t){void 0===t&&(t=Y);var i=z(e);return new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeArrayStream(i)}function ee(e,t){void 0===t&&(t=Y);var i=z(e);return new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeStream(i)}function te(e,t){return void 0===t&&(t=Y),ee(e,t)}return t}()}(FK),(0,UM.exports)("Int8",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Int16",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Int32",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Uint16",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Uint32",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Float32",(function(e){return function(t,i,n){return e(this,t,i,n)}})),(0,UM.exports)("Float64",(function(e){return function(t,i,n){return e(this,t,i,n)}}));let GK,jK;async function YK(){if(GK)return GK;const e={};let t,i={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);let n=!1,r=!1;n="object"==typeof window,r="function"==typeof importScripts,"object"==typeof process&&"object"==typeof process.versions&&process.versions.node;let o="";(n||r)&&(r?o=self.location.href:"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),o=0!==o.indexOf("blob:")?o.substr(0,o.lastIndexOf("/")+1):""),e.print||console.log.bind(console);const s=e.printErr||console.warn.bind(console);for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);let a;i=null,e.arguments,e.thisProgram,e.quit,e.wasmBinary,e.noExitRuntime,"object"!=typeof WebAssembly&&C("no native wasm support detected");let c=!1;function A(t){const i=e["_"+t];return i||C("Assertion failed: Cannot call unknown function "+t+", make sure it is exported"),i}function d(e,t,i,n,r){const o={string:function(e){let t=0;if(null!=e&&0!==e){const i=1+(e.length<<2);t=w(i),function(e,t,i){!function(e,t,i,n){if(!(n>0))return 0;const r=i+n-1;for(let n=0;n<e.length;++n){let o=e.charCodeAt(n);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n)),o<=127){if(i>=r)break;t[i++]=o}else if(o<=2047){if(i+1>=r)break;t[i++]=192|o>>6,t[i++]=128|63&o}else if(o<=65535){if(i+2>=r)break;t[i++]=224|o>>12,t[i++]=128|o>>6&63,t[i++]=128|63&o}else{if(i+3>=r)break;t[i++]=240|o>>18,t[i++]=128|o>>12&63,t[i++]=128|o>>6&63,t[i++]=128|63&o}}t[i]=0}(e,l,t,i)}(e,t,i)}return t},array:function(e){const t=w(e.length);var i,n;return i=e,n=t,E.set(i,n),t}},s=A(e),a=[];let c=0;if(n)for(let e=0;e<n.length;e++){const t=o[i[e]];t?(0===c&&(c=y()),a[e]=t(n[e])):a[e]=n[e]}let d=s.apply(null,a);return d=function(e){return"string"===t?(i=e)?function(e,t,i){const n=t+undefined;let r=t,o="";for(;e[r]&&!(r>=n);)++r;if(r-t>16&&e.subarray&&u)return u.decode(e.subarray(t,r));for(;t<r;){let i=e[t++];if(!(128&i)){o+=String.fromCharCode(i);continue}const n=63&e[t++];if(192==(224&i)){o+=String.fromCharCode((31&i)<<6|n);continue}const r=63&e[t++];if(i=224==(240&i)?(15&i)<<12|n<<6|r:(7&i)<<18|n<<12|r<<6|63&e[t++],i<65536)o+=String.fromCharCode(i);else{const e=i-65536;o+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return o}(l,i):"":"boolean"===t?Boolean(e):e;var i}(d),0!==c&&D(c),d}const u="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;let E,l,h;"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),e.INITIAL_MEMORY;const p=[],_=[],I=[],g=[];_.push({func:function(){O()}});let f=0,R=null;function C(t){throw e.onAbort&&e.onAbort(t),s(t+=""),c=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(t)}e.preloadedImages={},e.preloadedAudios={};let T="deflate.wasm";function m(t){for(;t.length>0;){const i=t.shift();if("function"==typeof i){i(e);continue}const n=i.func;"number"==typeof n?void 0===i.arg?h.get(n)():h.get(n)(i.arg):n(void 0===i.arg?null:i.arg)}}T.startsWith("data:application/octet-stream;base64,")||(T=function(t){return e.locateFile?e.locateFile(t,o):o+t}(T));const S={emscripten_memcpy_big:function(e,t,i){l.copyWithin(e,t,t+i)},emscripten_resize_heap:function(e){C("OOM")}};await async function(){const t={env:S,wasi_snapshot_preview1:S};function i(t,i){const n=t.exports;var r;e.asm=n,a=e.asm.memory,r=a.buffer,e.HEAP8=E=new Int8Array(r),e.HEAP16=new Int16Array(r),e.HEAP32=new Int32Array(r),e.HEAPU8=l=new Uint8Array(r),e.HEAPU16=new Uint16Array(r),e.HEAPU32=new Uint32Array(r),e.HEAPF32=new Float32Array(r),e.HEAPF64=new Float64Array(r),h=e.asm.__indirect_function_table,function(t){if(f--,e.monitorRunDependencies&&e.monitorRunDependencies(f),0==f&&R){const e=R;R=null,e()}}()}if(f++,e.monitorRunDependencies&&e.monitorRunDependencies(f),e.instantiateWasm)try{return e.instantiateWasm(t,i)}catch(e){return s("Module.instantiateWasm callback failed with error: "+e),!1}return await function(e){return new Mm(((e,t)=>{e(function(e){const t=window.atob("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AAA2AkAgACgCKCABKAJMQQIgACgCIBEAACECIAFBADYCwC0gASACNgJEIAFBgAg2ApwtIAEgACgCKEGACEEEIAAoAiARAAAiAjYCCCABIAEoApwtIgNBAnQ2AgwCQAJAIAEoAjhFDQAgASgCQEUNACACRQ0AIAEoAkQNAQsgAUGaBTYCBCAAQbjfACgCADYCGCAAEAgPCyABQQA2AogBIAFBCTYChAEgAUEIOgAkIAEgAiADQQNsajYCmC0gASACIANBfnFqNgKkLSAAEAkNACAAKAIcIgAgACgCLEEBdDYCPCAAKAJEIgEgACgCTEEBdEECayIDakEAOwEAIAEgAxAgIABBADYCtC0gAEKAgICAIDcCdCAAQgA3AmggAEKAgICAIDcCXCAAQQA2AkggACAAKAKEAUEMbCIBQYTIAGovAQA2ApABIAAgAUGAyABqLwEANgKMASAAIAFBgsgAai8BADYCgAEgACABQYbIAGovAQA2AnwLC6kCAQN/AkAgAEUNACAAKAIgRQ0AIAAoAiQiA0UNACAAKAIcIgFFDQAgASgCACAARw0AAkACQCABKAIEIgJBOWsOOQECAgICAgICAgICAgECAgIBAgICAgICAgICAgICAgICAgIBAgICAgICAgICAgIBAgICAgICAgICAQALIAJBmgVGDQAgAkEqRw0BCwJ/An8CfyABKAIIIgIEQCAAKAIoIAIgAxECACAAKAIcIQELIAEoAkQiAgsEQCAAKAIoIAIgACgCJBECACAAKAIcIQELIAEoAkAiAgsEQCAAKAIoIAIgACgCJBECACAAKAIcIQELIAEoAjgiAgsEQCAAKAIoIAIgACgCJBECACAAKAIcIQELIAAoAiggASAAKAIkEQIAIABBADYCHAsLlgIBA39BfiECAkAgAEUNACAAKAIgRQ0AIAAoAiRFDQAgACgCHCIBRQ0AIAEoAgAgAEcNAAJAAkAgASgCBCIDQTlrDjkBAgICAgICAgICAgIBAgICAQICAgICAgICAgICAgICAgICAQICAgICAgICAgICAQICAgICAgICAgEACyADQZoFRg0AIANBKkcNAQsgAEECNgIsIABBADYCCCAAQgA3AhQgAUEANgIUIAEgASgCCDYCECABKAIYIgJBf0wEQCABQQAgAmsiAjYCGAsgAUE5QSpB8QAgAhsgAkECRhs2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KAIIaiACQR9wIAJyQR9zOgAAIAEoAmwEQCAAKAIwIQIgASABKAIUIgNBAWo2AhQgAyABKAIIaiACQRh2OgAAIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAkEQdjoAACAAKAIwIQIgASABKAIUIgNBAWo2AhQgAyABKAIIaiACQQh2OgAAIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAjoAAAsgAEEAQQBBABAENgIwIAFB8QA2AgQgACgCHCICEBMCQCAAKAIQIgMgAigCFCIEIAMgBEkbIgNFDQAgACgCDCACKAIQIAMQHxogACAAKAIMIANqNgIMIAIgAigCECADajYCECAAIAAoAhQgA2o2AhQgACAAKAIQIANrNgIQIAIgAigCFCADayIDNgIUIAMNACACIAIoAgg2AhALIAEoAhQNBCABKAIEIQMLAkACQAJAAkACQAJAAkAgA0E5RgR/IABBAEEAQQAQBjYCMCABIAEoAhQiAkEBajYCFCACIAEoAghqQR86AAAgASABKAIUIgJBAWo2AhQgAiABKAIIakGLAToAACABIAEoAhQiAkEBajYCFCACIAEoAghqQQg6AAAgASgCHCICDQIgASABKAIUIgJBAWo2AhQgAiABKAIIakEAOgAAIAEgASgCFCICQQFqNgIUIAIgASgCCGpBADoAACABIAEoAhQiAkEBajYCFCACIAEoAghqQQA6AAAgASABKAIUIgJBAWo2AhQgAiABKAIIakEAOgAAIAEgASgCFCICQQFqNgIUIAIgASgCCGpBADoAAEECIQIgASgChAEiA0EJRwRAQQQgASgCiAFBAUpBAnQgA0ECSBshAgsgASABKAIUIgNBAWo2AhQgAyABKAIIaiACOgAAIAEgASgCFCICQQFqNgIUIAIgASgCCGpBAzoAACABQfEANgIEIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQCyABKAIUDQEgASgCBAUgAwtBxQBrDiMCBgYGAwYGBgYGBgYGBgYGBgYGBgYGBAYGBgYGBgYGBgYGBQYLIAFBfzYCKA8LIAIoAiQhAyACKAIcIQQgAigCECEFIAIoAiwhBiACKAIAIQggASABKAIUIgdBAWo2AhRBAiECIAcgASgCCGogBkEAR0EBdCAIQQBHciAFQQBHQQJ0ciAEQQBHQQN0ciADQQBHQQR0cjoAACABKAIcKAIEIQMgASABKAIUIgRBAWo2AhQgBCABKAIIaiADOgAAIAEoAhwoAgQhAyABIAEoAhQiBEEBajYCFCAEIAEoAghqIANBCHY6AAAgASgCHC8BBiEDIAEgASgCFCIEQQFqNgIUIAQgASgCCGogAzoAACABKAIcLQAHIQMgASABKAIUIgRBAWo2AhQgBCABKAIIaiADOgAAIAEoAoQBIgNBCUcEQEEEIAEoAogBQQFKQQJ0IANBAkgbIQILIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAjoAACABKAIcKAIMIQIgASABKAIUIgNBAWo2AhQgAyABKAIIaiACOgAAIAEoAhwiAigCEAR/IAIoAhQhAiABIAEoAhQiA0EBajYCFCADIAEoAghqIAI6AAAgASgCHCgCFCECIAEgASgCFCIDQQFqNgIUIAMgASgCCGogAkEIdjoAACABKAIcBSACCygCLARAIAAgACgCMCABKAIIIAEoAhQQBjYCMAsgAUHFADYCBCABQQA2AiALIAEoAhwiBCgCECIDBEAgASgCFCICIAQvARQgASgCICIGayIFaiABKAIMIgRLBEADQCABKAIIIAJqIAMgBmogBCACayIEEB8aIAEgASgCDCIDNgIUAkAgAiADTw0AIAEoAhwoAixFDQAgACAAKAIwIAEoAgggAmogAyACaxAGNgIwCyABIAEoAiAgBGo2AiAgACgCHCICEBMCQCAAKAIQIgMgAigCFCIGIAMgBkkbIgNFDQAgACgCDCACKAIQIAMQHxogACAAKAIMIANqNgIMIAIgAigCECADajYCECAAIAAoAhQgA2o2AhQgACAAKAIQIANrNgIQIAIgAigCFCADayIDNgIUIAMNACACIAIoAgg2AhALIAEoAhQEQCABQX82AigPCyABKAIgIQYgASgCHCgCECEDQQAhAiAFIARrIgUgASgCDCIESw0ACwsgASgCCCACaiADIAZqIAUQHxogASABKAIUIAVqIgM2AhQCQCACIANPDQAgASgCHCgCLEUNACAAIAAoAjAgASgCCCACaiADIAJrEAY2AjALIAFBADYCIAsgAUHJADYCBAsgASgCHCgCHARAIAEoAhQiAiEFA0ACQCACIAEoAgxHDQACQCACIAVNDQAgASgCHCgCLEUNACAAIAAoAjAgASgCCCAFaiACIAVrEAY2AjALIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQC0EAIQJBACEFIAEoAhRFDQAgAUF/NgIoDwsgASgCHCgCHCEDIAEgASgCICIEQQFqNgIgIAMgBGotAAAhAyABIAJBAWo2AhQgASgCCCACaiADOgAAIAMEQCABKAIUIQIMAQsLAkAgASgCHCgCLEUNACABKAIUIgIgBU0NACAAIAAoAjAgASgCCCAFaiACIAVrEAY2AjALIAFBADYCIAsgAUHbADYCBAsCQCABKAIcKAIkRQ0AIAEoAhQiAiEFA0ACQCACIAEoAgxHDQACQCACIAVNDQAgASgCHCgCLEUNACAAIAAoAjAgASgCCCAFaiACIAVrEAY2AjALIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQC0EAIQJBACEFIAEoAhRFDQAgAUF/NgIoDwsgASgCHCgCJCEDIAEgASgCICIEQQFqNgIgIAMgBGotAAAhAyABIAJBAWo2AhQgASgCCCACaiADOgAAIAMEQCABKAIUIQIMAQsLIAEoAhwoAixFDQAgASgCFCICIAVNDQAgACAAKAIwIAEoAgggBWogAiAFaxAGNgIwCyABQecANgIECyABKAIcKAIsBEAgASgCDCABKAIUIgJBAmpJBEAgACgCHCICEBMCQCAAKAIQIgMgAigCFCIEIAMgBEkbIgNFDQAgACgCDCACKAIQIAMQHxogACAAKAIMIANqNgIMIAIgAigCECADajYCECAAIAAoAhQgA2o2AhQgACAAKAIQIANrNgIQIAIgAigCFCADayIDNgIUIAMNACACIAIoAgg2AhALIAEoAhQNBUEAIQILIAAoAjAhAyABIAJBAWo2AhQgASgCCCACaiADOgAAIAAoAjAhAiABIAEoAhQiA0EBajYCFCADIAEoAghqIAJBCHY6AAAgAEEAQQBBABAGNgIwCyABQfEANgIEIAAoAhwiAhATAkAgACgCECIDIAIoAhQiBCADIARJGyIDRQ0AIAAoAgwgAigCECADEB8aIAAgACgCDCADajYCDCACIAIoAhAgA2o2AhAgACAAKAIUIANqNgIUIAAgACgCECADazYCECACIAIoAhQgA2siAzYCFCADDQAgAiACKAIINgIQCyABKAIURQ0AIAFBfzYCKA8LIAAoAgQNAQsgASgCdA0AIAEoAgRBmgVGDQgLIAEoAoQBIgJFBEAgAUEDEAwMBAsCQAJAIAEoAogBQQJrDgIAAQQLA0ACQAJAIAEoAnQNACABEAogASgCdA0AIAFBADYCtC0MAQsgAUEANgJgIAEoAjggASgCbGotAAAhAiABKAKkLSABKAKgLSIDQQF0akEAOwEAIAEgA0EBajYCoC0gAyABKAKYLWogAjoAACABIAJBAnRqQZQBaiICIAIvAQBBAWo7AQAgASABKAJ0QQFrNgJ0IAEgASgCbEEBaiICNgJsIAEoAqAtIAEoApwtQQFrRw0BIAEgASgCXCIEQQBOBH8gASgCOCAEagVBAAsgAiAEa0EAEBQgASABKAJsNgJcIAEoAgAiAigCHCIDEBMCQCACKAIQIgQgAygCFCIFIAQgBUkbIgRFDQAgAigCDCADKAIQIAQQHxogAiACKAIMIARqNgIMIAMgAygCECAEajYCECACIAIoAhQgBGo2AhQgAiACKAIQIARrNgIQIAMgAygCFCAEayICNgIUIAINACADIAMoAgg2AhALIAEoAgAoAhANAQwHCwsgASgCoC1FDQcgASABKAJcIgNBAE4EfyABKAI4IANqBUEACyABKAJsIANrQQAQFCABIAEoAmw2AlwgASgCACICKAIcIgMQEwJAIAIoAhAiBCADKAIUIgUgBCAFSRsiBEUNACACKAIMIAMoAhAgBBAfGiACIAIoAgwgBGo2AgwgAyADKAIQIARqNgIQIAIgAigCFCAEajYCFCACIAIoAhAgBGs2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CAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOsACQDrAQkAGwAJABsBCQCbAAkAmwEJAFsACQBbAQkA2wAJANsBCQA7AAkAOwEJALsACQC7AQkAewAJAHsBCQD7AAkA+wEJAAcACQAHAQkAhwAJAIcBCQBHAAkARwEJAMcACQDHAQkAJwAJACcBCQCnAAkApwEJAGcACQBnAQkA5wAJAOcBCQAXAAkAFwEJAJcACQCXAQkAVwAJAFcBCQDXAAkA1wEJADcACQA3AQkAtwAJALcBCQB3AAkAdwEJAPcACQD3AQkADwAJAA8BCQCPAAkAjwEJAE8ACQBPAQkAzwAJAM8BCQAvAAkALwEJAK8ACQCvAQkAbwAJAG8BCQDvAAkA7wEJAB8ACQAfAQkAnwAJAJ8BCQBfAAkAXwEJAN8ACQDfAQkAPwAJAD8BCQC/AAkAvwEJAH8ACQB/AQkA/wAJAP8BCQAAAAcAQAAHACAABwBgAAcAEAAHAFAABwAwAAcAcAAHAAgABwBIAAcAKAAHAGgABwAYAAcAWAAHADgABwB4AAcABAAHAEQABwAkAAcAZAAHABQABwBUAAcANAAHAHQABwADAAgAgwAIAEMACADDAAgAIwAIAKMACABjAAgA4wAIAAAABQAQAAUACAAFABgABQAEAAUAFAAFAAwABQAcAAUAAgAFABIABQAKAAUAGgAFAAYABQAWAAUADgAFAB4ABQABAAUAEQAFAAkABQAZAAUABQAFABUABQANAAUAHQAFAAMABQATAAUACwAFABsABQAHAAUAFwAFAEHg2QALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHQ2gALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEGA3AALIwIAAAADAAAABwAAAAAAAAAQERIACAcJBgoFCwQMAw0CDgEPAEG03AALaQEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACgAAAAwAAAAOAAAAEAAAABQAAAAYAAAAHAAAACAAAAAoAAAAMAAAADgAAABAAAAAUAAAAGAAAABwAAAAgAAAAKAAAADAAAAA4ABBtN0AC5oCAQAAAAIAAAADAAAABAAAAAYAAAAIAAAADAAAABAAAAAYAAAAIAAAADAAAABAAAAAYAAAAIAAAADAAAAAAAEAAIABAAAAAgAAAAMAAAAEAAAABgAAAAgAAAAMAAAAEAAAABgAAAAgAAAAMAAAAEAAAABgAABuZWVkIGRpY3Rpb25hcnkAc3RyZWFtIGVuZAAAZmlsZSBlcnJvcgBzdHJlYW0gZXJyb3IAZGF0YSBlcnJvcgBpbnN1ZmZpY2llbnQgbWVtb3J5AGJ1ZmZlciBlcnJvcgBpbmNvbXBhdGlibGUgdmVyc2lvbgAAAAAoLwAAOC8AAEMvAABELwAATy8AAFwvAABnLwAAey8AAIgvAABDLwAAMS4yLjExAEHQ3wALA9AxUA==").split("").map((e=>e.charCodeAt(0)));return new Uint8Array(t,0,t.length/Uint8Array.BYTES_PER_ELEMENT)}().buffer)})).then((function(e){return WebAssembly.instantiate(e,t)})).then(e,(function(e){s("failed to asynchronously prepare wasm: "+e),C(e)}))}((function(e){i(e.instance)})),{}}();let O=e.___wasm_call_ctors=function(){return(O=e.___wasm_call_ctors=e.asm.__wasm_call_ctors).apply(null,arguments)},v=e._malloc=function(){return(v=e._malloc=e.asm.malloc).apply(null,arguments)};e._free=function(){return(e._free=e.asm.free).apply(null,arguments)},e.___errno_location=function(){return(e.___errno_location=e.asm.__errno_location).apply(null,arguments)},e._zlibCompress=function(){return(e._zlibCompress=e.asm.zlibCompress).apply(null,arguments)};let N,y=e.stackSave=function(){return(y=e.stackSave=e.asm.stackSave).apply(null,arguments)},D=e.stackRestore=function(){return(D=e.stackRestore=e.asm.stackRestore).apply(null,arguments)},w=e.stackAlloc=function(){return(w=e.stackAlloc=e.asm.stackAlloc).apply(null,arguments)};function b(t){function i(){N||(N=!0,e.calledRun=!0,c||(m(_),m(I),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),g.unshift(t);var t;m(g)}()))}f>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),p.unshift(t);var t;m(p)}(),f>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),i()}),1)):i()))}if(e.ccall=d,e.cwrap=function(e,t,i,n){const r=(i=i||[]).every((function(e){return"number"===e}));return"string"!==t&&r&&!n?A(e):function(){return d(e,t,i,arguments)}},e.allocate=function(e,t){let i;return i=1==t?w(e.length):v(e.length),e.subarray||e.slice?l.set(e,i):l.set(new Uint8Array(e),i),i},R=function e(){N||b(),N||(R=e)},e.run=b,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return b(),GK=e,e}const HK=Uint8Array.BYTES_PER_ELEMENT,KK={bytesReceived:"br",frameDropped:"fd",frameReceived:"fr",googJitterReceived:"jr",isAudioMute:"am",isFreeze:"fz",mediaType:"mt",packetsLost:"pl",packetsReceived:"pr",peerId:"pid",id:"id",ssrc:"ssrc",timestamp:"ts",type:"tp",frameRateInput:"fi",frameRateSent:"fs",googRtt:"rt",isVideoMute:"vm"},WK={stats:"sts",state:"st",stream_id:"stid",session_id:"seid",stream_type:"stt",app_id:"aid",channel_key:"ck",channel_name:"cn",sdk_version:"sv",browser:"b",process_id:"pcid",mode:"m",codec:"c",role:"r",has_changed_gateway:"hcg",ap_response:"ar",extends:"es",details:"d",features:"ft",p2p_id:"ppid",sdp:"sdp",audio:"a",video:"v",attributes:"at",hq:"h",lq:"l",stereo:"str",speech:"spe",extend:"e",pingpongElapse:"ppe"},JK={_message:"m",_type:"t",_id:"id"},qK={join_v2:"j2",publish:"pub",publish_related_stats:"prs",ping:"pi",traffic_stats:"ts",ping_back:"pib",publish_stats:"pubs"};let XK;class zK{constructor(){tD(this,"zlibCompress",void 0)}async init(){if(!XK){const e=await(async()=>(jK||(jK=await YK()),{zlibCompress:e=>{const t=new Uint8Array(e),i=HK*t.byteLength,n=jK._malloc(i),r=jK._malloc(3*i);for(let e=0;e<i;e++)jK.HEAP8[n/HK+e]=t[e];const o=jK._zlibCompress(n,i,r),s=new Uint8Array(jK.HEAP8.slice(r,r+o));return jK._free(n),jK._free(r),s}}))();XK=e.zlibCompress}this.zlibCompress=XK}msgPackCompress(e){return FK.exports.encode(e)}compress(e){const t=Date.now(),i=this.compressKeyAndValue(JSON.parse(JSON.stringify(e))),n=this.msgPackCompress(i),r=this.zlibCompress(n),o=new Uint8Array([49,49,49,50,...Array.from(r)]);return{origin:Object.assign({},e),originLength:JSON.stringify(e).length,shortKeyAndValue:i,msgpackSer:n,compressed:o,compressedLength:o.length,time:Date.now()-t}}compressKeyAndValue(e){return this._ObjectKeyCompress(this._typeCompress(e))}_typeCompress(e){const t=e._type;if(!t)return e;const i=qK[t];return e._type=i||t,e}_ObjectKeyCompress(e){const t=e._message;if(t){const i=t.stats;i&&(t.stats=this._statsCompress(i)),e._message=this._messageCompress(t)}return this._reportCompress(e)}_statsCompress(e){return this._keyCompress(e,KK)}_messageCompress(e){return this._keyCompress(e,WK)}_reportCompress(e){return this._keyCompress(e,JK)}_keyCompress(e,t){const i={},n=Object.keys(e);return dE(n).call(n,((n,r)=>{const o=e[r];return t[r]?i[t[r]]=o:i[r]=o,i}),i),i}}class ZK extends Ew{get queue(){return[...this.highPriorityQueue,...this.lowPriorityQueue]}constructor(e){super(),tD(this,"lowPriorityQueue",[]),tD(this,"highPriorityQueue",[]),tD(this,"AgoraWebSocketManager",void 0),this.AgoraWebSocketManager=e}reset(){this.lowPriorityQueue=[],this.highPriorityQueue=[]}pushMessage(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.highPriorityQueue.push(e):this.lowPriorityQueue.push(e),this.sendMessage()}sendMessage(){const e=this.queue.length;let t=0;t=e<5?15*e:60+3*(e-4),setTimeout((()=>{this._sendMessage()}),t)}_sendMessage(){if(!this.queue.length)return;const e=this.AgoraWebSocketManager.getConnection();if(!e||1!==e.readyState)return;const t=this.queue.shift();return this.lowPriorityQueue.includes(t)?this.lowPriorityQueue.shift():this.highPriorityQueue.shift(),e.send(t.compressed),t}}var $K;function eW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}let tW=Ww("AgoraWebSocketManager","connectionID")($K=class extends Ew{get url(){return this.websocket?this.websocket.url:null}get reconnectMode(){return this._reconnectMode}set reconnectMode(e){["tryNext","recover"].includes(e)&&this.resetReconnectCount(e),this._reconnectMode=e}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,"reconnecting"===this._state?this.emit(sP.RECONNECTING,this.reconnectReason):"connected"===this._state?this.emit(sP.CONNECTED):"closed"===this._state?this.emit(sP.CLOSED):"failed"===this._state&&this.emit(sP.FAILED))}resetReconnectCount(e){mw.debug("websocket reset reconnect count, reason: "+e),Yw("debug",this,"resetReconnectCount",e,"websocket reset reconnect count, reason: "+e),this.reconnectCount=0}constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(),tD(this,"connectionID",0),tD(this,"currentURLIndex",0),tD(this,"urls",void 0),tD(this,"_reconnectMode","tryNext"),tD(this,"reconnectReason",void 0),tD(this,"_initMutex",new Qx("websocket")),tD(this,"name",void 0),tD(this,"_state","closed"),tD(this,"reconnectInterrupter",void 0),tD(this,"websocket",void 0),tD(this,"retryConfig",void 0),tD(this,"reconnectCount",0),tD(this,"onlineReconnectListener",void 0),tD(this,"compressor",new zK),tD(this,"compressorInitStatus","initializing"),tD(this,"compress",void 0),tD(this,"messageSender",void 0),tD(this,"useCompress",void 0),tD(this,"tryDoubleDomain",!1),tD(this,"wsInflateLength",0),tD(this,"wsDeflateLength",0),tD(this,"closeEstablishingWs",(()=>{})),this.name=e,this.retryConfig=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t),this.useCompress=i,this.tryDoubleDomain=n;const{timeout:r,timeoutFactor:o}=t,s=Math.max(300,Math.floor(3*r/5)),a=Math.max(1.2,Math.floor(8*o)/10);jP.ONLINE&&(this.retryConfig.timeout=s,this.retryConfig.timeoutFactor=a),Sx.on(YP.NETWORK_STATE_CHANGE,((e,t)=>{e!==t&&(this.resetReconnectCount("network state change: ".concat(t," -> ").concat(e)),e===jP.ONLINE?(this.retryConfig.timeout=s,this.retryConfig.timeoutFactor=a):(this.retryConfig.timeout=r,this.retryConfig.timeoutFactor=o))}));const c=Date.now();this.compressor.init().then((()=>{this.compressorInitStatus="initialized";const e=Date.now()-c;mw.debug("websocket compressor initialized successfully in ".concat(e,"ms")),Yw("debug",this.compressor,"init",void 0,"websocket compressor initialized successfully in ".concat(e,"ms")),Px.wsCompressorInit({status:!0,ec:null,eventElapse:e}),this.compress=this.compressor.compress.bind(this.compressor)})).catch((e=>{this.compressorInitStatus="failed";const t=e?e.message||e.toString():"Empty Error";mw.debug("websocket compressor failed to initialize because of ".concat(t)),Yw("debug",this.compressor,"init",void 0,"websocket compressor failed to initialize because of ".concat(t)),Px.wsCompressorInit({status:!1,ec:t,eventElapse:1})}))}getConnection(){return this.websocket||void 0}init(e){const t=(t,i)=>{this.urls=e;const n=this.urls[this.currentURLIndex];this.state="connecting",this.messageSender=new ZK(this),this.createWebSocketConnection(n).then(t).catch(i),this.once(sP.CLOSED,(()=>i(new pw(hw.WS_DISCONNECT)))),this.once(sP.CONNECTED,(()=>t()))};return this._initMutex.lock().then((e=>new Mm(((e,i)=>{t(e,i)})).then((()=>{e()})).catch((()=>{e()}))))}close(e,t){if(this.currentURLIndex=0,this.resetReconnectCount("close"),this.reconnectInterrupter&&this.reconnectInterrupter(),this.websocket){this.websocket.onclose=null,this.websocket.onopen=null,this.websocket.onmessage=null;const e=this.websocket;t?setTimeout((()=>e.close()),500):e.close(),this.websocket=void 0}this.state=e?"failed":"closed",this.closeEstablishingWs&&this.closeEstablishingWs()}reconnect(e,t){if(!this.websocket)return mw.warning("[".concat(this.name,"] can not reconnect, no websocket")),void Yw("warning",this,"reconnect","can not reconnect, no websocket");void 0!==e&&(this.reconnectMode=e),mw.debug("[".concat(this.name,"] reconnect is triggered initiative")),Yw("debug",this,"reconnect");const i=this.websocket.onclose;this.websocket.onclose=null,this.websocket.close(),i&&i.bind(this.websocket)({code:9999,reason:t})}sendMessageWithJSON(e){const t=JSON.stringify(e);return{compressed:t,compressedLength:t.length,origin:e}}sendMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new pw(hw.WS_ABORT,"websocket is not ready");try{let i=null;if("initialized"===this.compressorInitStatus&&this.useCompress&&cb("WEBSOCKET_COMPRESS"))try{i=this.compress(e),this.setWsInflateData(i)}catch(t){i=this.sendMessageWithJSON(e)}else i=this.sendMessageWithJSON(e);t?this.websocket.send(i.compressed):this.messageSender.pushMessage(i)}catch(e){throw new pw(hw.WS_ERR,"send websocket message error"+e.toString())}}setWsInflateData(e){this.wsDeflateLength=this.wsDeflateLength+e.originLength,this.wsInflateLength=this.wsInflateLength+e.compressedLength}getWsInflateData(){const e=this.wsInflateLength,t=this.wsDeflateLength;return this.clearWsInflateData(),{wsInflateLength:e,wsDeflateLength:t}}clearWsInflateData(){this.wsInflateLength=0,this.wsDeflateLength=0}async createWebSocketConnection(e,t){return this.connectionID+=1,this.connectionID,new Mm(((i,n)=>{const r=()=>{mw.debug("[".concat(this.name,"] websocket opened:"),e),jw("debug",["WebSocket",this.connectionID],"open",e),this.reconnectMode="retry",this.state="connected",this.resetReconnectCount("opened"),i()},o=async e=>{if(mw.debug("[".concat(this.name,"] websocket close ").concat(this.websocket&&this.websocket.url,", code: ").concat(e.code,", reason: ").concat(e.reason,", current mode: ").concat(this.reconnectMode)),jw("debug",["WebSocket",this.connectionID],"close",{code:e.code,reason:e.reason,url:this.websocket&&this.websocket.url,reconnectMode:this.reconnectMode}),this.reconnectCount<this.retryConfig.maxRetryCount){"connected"===this.state&&(this.reconnectReason=e.reason,this.state="reconnecting");const t=PG(this,sP.WILL_RECONNECT,this.reconnectMode)||this.reconnectMode,r=await this.reconnectWithAction(t);if("closed"===this.state)return mw.debug("[".concat(this.connectionID,"] ws is closed, no need to reconnect")),void xw("debug",this,"ws is closed, no need to reconnect");if(!r)return n(new pw(hw.WS_DISCONNECT,"websocket reconnect failed: ".concat(e.code))),void this.close(!0);i()}else n(new pw(hw.WS_DISCONNECT,"websocket close: ".concat(e.code))),this.close()},s=e=>{this.emit(sP.ON_MESSAGE,e)};this.websocket&&(this.websocket.onclose=null,this.websocket.close()),cb("GATEWAY_WSS_ADDRESS")&&this.name.startsWith("gateway")&&(e=cb("GATEWAY_WSS_ADDRESS")),mw.debug("[".concat(this.name,"] start connect, url: ").concat(e)),xw("debug",this,"start connect, url: ".concat(e)),this.chooseBestWebsocketConnection(e,!!t).then((e=>{this.websocket=e,r&&r(),e.onclose=o,e.onmessage=s})).catch((e=>{if("closed"!==this.state){if(e instanceof pw&&e.code===hw.WS_ERR){const t=new pw(hw.WS_ERR,"init websocket failed! Error: ".concat(e.toString()));return mw.error("[".concat(this.name,"]").concat(t)),Yw("error",this,"chooseBestWebsocketConnection",void 0,e.toString()),void n(t)}o&&o(e)}else n(new pw(hw.WS_DISCONNECT,"websocket is closed: ".concat(e.toString())))}))}))}async reconnectWithAction(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.reconnectCount>=this.retryConfig.maxRetryCount)return!1;if(!this.urls)return!1;if("closed"===this.state)return!1;this.onlineReconnectListener||Sx.networkState!==jP.OFFLINE||(this.onlineReconnectListener=Sx.onlineWaiter&&Sx.onlineWaiter.then((()=>{this.onlineReconnectListener=void 0})));let i=!0;if(this.reconnectInterrupter=()=>{i=!1},t){const t=Iw(this.reconnectCount,this.retryConfig);mw.debug("[".concat(this.name,"] wait ").concat(t,"ms to reconnect websocket, mode: ").concat(e)),Yw("debug",this,"reconnectWithAction",{timeout:t,action:e}),await Mm.race([SG(t),this.onlineReconnectListener||new Mm((()=>{}))])}if("closed"===this.state||!i)return!1;this.reconnectCount+=1;const n=async(e,t)=>{this.emit(sP.RECONNECT_CREATE_CONNECTION,t),await this.createWebSocketConnection(e)};try{if("retry"===e){const t=this.urls[this.currentURLIndex];this.emit(sP.RECONNECT_WAITTING_FINISH,e),await n(t,e)}else if("tryNext"===e){if(this.currentURLIndex+=1,this.currentURLIndex>=this.urls.length)return await this.reconnectWithAction("recover",!1);mw.debug("[".concat(this.name,"] websocket url length: ").concat(this.urls.length," current index: ").concat(this.currentURLIndex)),xw("debug",this,"websocket url length: ".concat(this.urls.length," current index: ").concat(this.currentURLIndex));const t=this.urls[this.currentURLIndex];this.emit(sP.RECONNECT_WAITTING_FINISH,e),await n(t,e)}else if("recover"===e){mw.debug("[".concat(this.name,"] request new urls")),xw("debug",this,"request new urls"),this.resetReconnectCount("recover mode"),this.emit(sP.RECONNECT_WAITTING_FINISH,e),this.urls=await bG(this,sP.REQUEST_NEW_URLS),this.currentURLIndex=0;const t=this.urls[this.currentURLIndex];await n(t,e)}return!0}catch(i){return mw.error("[".concat(this.name,"] reconnect failed"),i.toString()),Yw("error",this,"reconnectWithAction",void 0,i.toString()),await this.reconnectWithAction(e,t)}}async chooseBestWebsocketConnection(e,t){return new Mm(((i,n)=>{let r=!1;const o=[];this.closeEstablishingWs=()=>{mw.debug("[choose-best-ws] close establishing websockets"),o.forEach((e=>{e.onclose=null,e.onopen=null,e.onmessage=null,e.close()})),n(new pw(hw.WS_ABORT,"choose best websocket aborted"))};const s=cb("GATEWAY_DOMAINS");let a;const c=e.indexOf("?h="),A=s.find((t=>-1!==c?e.includes(t,c):e.includes(t)));mw.debug("[choose-best-ws] currentDomain: ",A,", domains: ",s),Yw("debug",this,"chooseBestWebsocketConnection",{currentDomain:A,domains:s});let d=!this.tryDoubleDomain||t||!A;if(!d&&A){const t=Date.now();try{s.forEach((t=>{const i=-1===c?e.replace(A,t):e.substr(0,c)+e.substr(c).replace(A,t),n=new WebSocket(i);n.binaryType="arraybuffer",o.push(n),mw.debug("[choose-best-ws] ws is connecting:",n.url),xw("debug",this,"ws is connecting: ".concat(n.url))}))}catch(e){for(mw.debug("[choose-best-ws] ws create failed, fallback to single url"),xw("debug",this,"ws create failed, fallback to single url"),o.forEach((e=>e.close()));o.length;)o.pop();d=!0}o.forEach((e=>{e.onopen=()=>{if(r)return;const n=Date.now()-t;mw.debug("[choose-best-ws] ws open cost ".concat(n,"ms")),o.filter((t=>t!==e)).forEach((e=>{mw.debug("[choose-best-ws]close backup websocket: ".concat(e.url)),xw("debug",this,"close backup websocket: ".concat(e.url)),e.close()})),r=!0,i(e)},e.onclose=e=>{a=e,r||o.find((e=>!(e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)))||(mw.debug("[choose-best-ws] all websocket is closed"),xw("debug",this,"all websocket is closed"),r=!0,n(a))},e.onmessage=t=>{mw.debug("[choose-best-ws]".concat(e.url," onmessage: ").concat(t.data)),xw("debug",this,"".concat(e.url," onmessage: ").concat(t.data))}})),SG(5e3).then((()=>{o.forEach((e=>{e.readyState!==WebSocket.OPEN&&e.close()}))}))}if(d){let t;mw.debug("[choose-best-ws] use single url: ",e),xw("debug",this,"use single url: ".concat(e));try{t=new WebSocket(e),o.push(t),t.binaryType="arraybuffer"}catch(e){const t=new pw(hw.WS_ERR,"init websocket failed! Error: ".concat(e.toString()));return mw.error("[".concat(this.name,"]").concat(t)),Yw("error",this,"chooseBestWebsocketConnection",void 0,e.toString()),void n(t)}t.onopen=()=>{i(t)},t.onclose=e=>{n(e)},t.onmessage=e=>{mw.debug("[choose-best-ws]".concat(t.url," onmessage: ").concat(e.data)),xw("debug",this,"".concat(t.url," onmessage: ").concat(e.data))},SG(5e3).then((()=>{t&&t.readyState!==WebSocket.OPEN&&t.close()}))}})).then((e=>(this.closeEstablishingWs=void 0,e))).catch((e=>{throw this.closeEstablishingWs=void 0,e}))}})||$K;class iW{constructor(e){tD(this,"input",[]),tD(this,"size",void 0),this.size=e}add(e){this.input.push(e),this.input.length>this.size&&this.input.splice(0,1)}mean(){var e;return 0===this.input.length?0:dE(e=this.input).call(e,((e,t)=>e+t))/this.input.length}}var nW;let rW=Ww("AgoraRTCSignal","websocket.connectionID")(nW=class extends Ew{get connectionState(){return this._connectionState}set connectionState(e){e!==this._connectionState&&(this._connectionState=e,e===jL.CONNECTED?this.emit(YL.WS_CONNECTED):e===jL.RECONNECTING?this.emit(YL.WS_RECONNECTING,this._websocketReconnectReason):e===jL.CLOSED&&this.emit(YL.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket?this.websocket.url:null}get rtt(){return this.rttRolling.mean()}constructor(e){super(),tD(this,"_disconnectedReason",void 0),tD(this,"_websocketReconnectReason",void 0),tD(this,"_connectionState",jL.CLOSED),tD(this,"reconnectToken",void 0),tD(this,"websocket",void 0),tD(this,"openConnectionTime",void 0),tD(this,"clientId",void 0),tD(this,"lastMsgTime",Date.now()),tD(this,"uploadCache",[]),tD(this,"uploadCacheInterval",void 0),tD(this,"rttRolling",new iW(5)),tD(this,"pingpongTimer",void 0),tD(this,"wsInflateDataTimer",void 0),tD(this,"pingpongTimeoutCount",0),tD(this,"joinResponse",void 0),tD(this,"multiIpOption",void 0),tD(this,"initError",void 0),tD(this,"spec",void 0),tD(this,"onWebsocketMessage",(e=>{if(e.data instanceof ArrayBuffer)return void this.emit(YL.ON_BINARY_DATA,e.data);const t=JSON.parse(e.data);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(t,"_id")){const e="res-@".concat(t._id);this.emit(e,t._result,t._message)}else if(Object.prototype.hasOwnProperty.call(t,"_type")&&(this.emit(t._type,t._message),t._type===WL.ON_NOTIFICATION&&this.handleNotification(t._message),t._type===WL.ON_USER_BANNED))switch(t._message.error_code){case 14:this.close(xL.UID_BANNED);break;case 15:this.close(xL.IP_BANNED);break;case 16:this.close(xL.CHANNEL_BANNED)}})),this.clientId=e.clientId,this.spec=e,this.websocket=new tW("gateway-".concat(this.clientId),this.spec.retryConfig,!0,!0),this.handleWebsocketEvents(),window.addEventListener("offline",(()=>{this.connectionState===jL.CONNECTED&&this.reconnect("retry",GL.OFFLINE)}))}async request(e,t,i,n){const r=vG(6,""),o={_id:r,_type:e,_message:t},s=this.websocket.connectionID,a=()=>new Mm(((t,i)=>{if(this.connectionState===jL.CONNECTED)return t();const n=()=>{this.off(YL.WS_CLOSED,r),t()},r=()=>{this.off(YL.WS_CONNECTED,n),i(new pw(hw.WS_ABORT))};this.once(YL.WS_CONNECTED,n),this.once(YL.WS_CLOSED,r),e!==HL.PUBLISH&&e!==HL.SUBSCRIBE&&e!==HL.UNSUBSCRIBE&&e!==HL.UNPUBLISH&&e!==HL.CONTROL||this.once(YL.DISCONNECT_P2P,(()=>{i(new pw(hw.DISCONNECT_P2P))})),e===HL.PUBLISH&&this.once(YL.ABORT_P2P_EXECUTION,(()=>{i(new pw(hw.DISCONNECT_P2P))}))}));if(this.connectionState!==jL.CONNECTING&&this.connectionState!==jL.RECONNECTING||e===HL.JOIN||e===HL.REJOIN||await a(),this.websocket.sendMessage(o,!0),n)return;const c=new Mm(((i,n)=>{let o=!1;const a=(n,r)=>{o=!0,i({isSuccess:"success"===n,message:r||{}}),this.off(YL.WS_CLOSED,c),this.off(YL.WS_RECONNECTING,c),this.emit(YL.REQUEST_SUCCESS,e,t)};this.once("res-@".concat(r),a);const c=()=>{n(new pw(hw.WS_ABORT,"type: ".concat(e))),this.off(YL.WS_CLOSED,c),this.off(YL.WS_RECONNECTING,c),this.off("res-@".concat(r),a)};this.once(YL.WS_CLOSED,c),this.once(YL.WS_RECONNECTING,c),SG(cb("SIGNAL_REQUEST_TIMEOUT")).then((()=>{this.websocket.connectionID!==s||o||(mw.warning("ws request timeout, type: ".concat(e)),xw("warning",this,"ws request timeout, type: ".concat(e)),this.emit(YL.REQUEST_TIMEOUT,e,t))}))}));let A=null;try{A=await c}catch(n){if(this.connectionState===jL.CLOSED||e===HL.LEAVE)throw new pw(hw.WS_ABORT);return!this.spec.forceWaitGatewayResponse||i?n.throw():e===HL.JOIN||e===HL.REJOIN?null:(await a(),await this.request(e,t))}if(A.isSuccess)return A.message;const d=Number(A.message.error_code||A.message.code),u=xK(d),E=new pw(hw.UNEXPECTED_RESPONSE,"".concat(u.desc,": ").concat(A.message.error_str),{code:d,data:A.message});return"success"===u.action?A.message:(mw.warning("[".concat(this.websocket.connectionID,"] unexpected response from type ").concat(e,", error_code: ").concat(d,", message: ").concat(u.desc,", action: ").concat(u.action)),xw("warning",this,"unexpected response from type ".concat(e,", error_code: ").concat(d,", message: ").concat(u.desc,", action: ").concat(u.action)),d===VL.ERR_TOO_MANY_BROADCASTERS?e===HL.JOIN||e===HL.REJOIN?(this.initError=E,this.close(),E.throw()):E.throw():"failed"===u.action?E.throw():"quit"===u.action?(this.initError=E,this.close(),E.throw()):(d===VL.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=A.message.option,mw.warning("[".concat(this.clientId,"] detect multi ip, recover")),xw("warning",this,"detect multi ip, recover"),this.reconnect("recover",GL.MULTI_IP)):this.reconnect(u.action,GL.SERVER_ERROR),e===HL.JOIN||e===HL.REJOIN?null:await this.request(e,t)))}waitMessage(e,t){return new Mm((i=>{const n=r=>{(!t||t(r))&&(this.off(e,n),i(r))};this.on(e,n)}))}upload(e,t){const i={_type:e,_message:t};try{this.websocket.sendMessage(i)}catch(e){const t=cb("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(i),this.uploadCache.length>t&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval((()=>{if(this.connectionState!==jL.CONNECTED)return;const e=this.uploadCache.splice(0,1)[0];0===this.uploadCache.length&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(e._type,e._message)}),cb("UPLOAD_CACHE_INTERVAL")||2e3))}}send(e,t){const i={_type:e,_message:t};this.websocket.sendMessage(i)}init(e,t){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Mm(((i,n)=>{this.once(YL.WS_CONNECTED,(()=>i(this.joinResponse))),this.once(YL.WS_CLOSED,(()=>n(this.initError||new pw(hw.WS_ABORT)))),this.connectionState=jL.CONNECTING,this.websocket.init(e).catch(n),this.wsInflateDataTimer&&window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=window.setInterval((()=>{this.handleWsInflateData()}),2e4),setTimeout((()=>{t&&void 0===this.openConnectionTime&&(mw.debug("[".concat(this.clientId,"] init websocket timeout while join with fallback to proxy")),n(new pw(hw.INIT_WEBSOCKET_TIMEOUT)))}),cb("JOIN_WITH_FALLBACK_PROXY_PENDING_DURATION"))}))}close(e){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.wsInflateDataTimer&&(this.handleWsInflateData(),window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._disconnectedReason=e||xL.LEAVE,this.connectionState=jL.CLOSED,mw.debug("[".concat(this.clientId,"] ")+"will close websocket in signal"),this.websocket.close(),e===xL.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new tW("gateway-".concat(this.clientId),this.spec.retryConfig,!0,!0),this.handleWebsocketEvents())}async join(){if(!this.joinResponse){this.emit(YL.ABORT_P2P_EXECUTION);const e=await bG(this,YL.REQUEST_JOIN_INFO),t=await this.request(HL.JOIN,e);if(!t)return this.emit(YL.REPORT_JOIN_GATEWAY,hw.TIMEOUT,this.url||""),!1;this.joinResponse=t,this.emit(YL.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=jL.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}async rejoin(){if(!this.reconnectToken)throw new pw(hw.UNEXPECTED_ERROR,"can not rejoin, no rejoin token");const e=kG(this,YL.REQUEST_REJOIN_INFO);e.token=this.reconnectToken;const t=await this.request(HL.REJOIN,e);return!!t&&(this.connectionState=jL.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),t.peers&&t.peers.forEach((e=>{this.emit(WL.ON_USER_ONLINE,{uid:e.uid}),e.audio_mute?this.emit(WL.MUTE_AUDIO,{uid:e.uid}):this.emit(WL.UNMUTE_AUDIO,{uid:e.uid}),e.video_mute?this.emit(WL.MUTE_VIDEO,{uid:e.uid}):this.emit(WL.UNMUTE_VIDEO,{uid:e.uid}),e.audio_enable_local?this.emit(WL.ENABLE_LOCAL_AUDIO,{uid:e.uid}):this.emit(WL.DISABLE_LOCAL_AUDIO,{uid:e.uid}),e.video_enable_local?this.emit(WL.ENABLE_LOCAL_VIDEO,{uid:e.uid}):this.emit(WL.DISABLE_LOCAL_VIDEO,{uid:e.uid}),e.audio||e.video||this.emit(WL.ON_REMOVE_STREAM,{uid:e.uid,uint_id:e.uint_id}),e.audio&&this.emit(WL.ON_ADD_AUDIO_STREAM,{uid:e.uid,uint_id:e.uint_id,audio:!0,ssrcId:e.audio_ssrc}),e.video&&this.emit(WL.ON_ADD_VIDEO_STREAM,{uid:e.uid,uint_id:e.uint_id,video:!0,ssrcId:e.video_ssrc})})),!0)}reconnect(e,t){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(e,t)}handleNotification(e){mw.debug("[".concat(this.clientId,"] receive notification: "),e),Yw("debug",this,"handleNotification",e);const t=xK(e.code);if("success"!==t.action)return"failed"===t.action?(mw.error("[".concat(this.clientId,"] ignore error: "),t.desc),void xw("error",this,"ignore error: ".concat(t.desc))):"quit"===t.action?("ERR_REPEAT_JOIN_CHANNEL"===t.desc&&this.close(xL.UID_BANNED),void this.close()):void this.reconnect(t.action,GL.SERVER_ERROR)}handlePingPong(){if(!this.websocket||"connected"!==this.websocket.state)return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;const e=cb("PING_PONG_TIME_OUT"),t=Date.now();this.pingpongTimeoutCount>=e&&(mw.warning("PINGPONG Timeout. Last Socket Message: ".concat(t-this.lastMsgTime,"ms")),xw("warning",this,"PINGPONG Timeout. Last Socket Message: ".concat(t-this.lastMsgTime,"ms")),t-this.lastMsgTime>cb("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",GL.TIMEOUT):this.request(HL.PING,void 0,!0).then((()=>{this.pingpongTimeoutCount=0;const e=Date.now()-t;this.rttRolling.add(e),cb("REPORT_STATS")&&this.send(HL.PING_BACK,{pingpongElapse:e})})).catch((e=>{}))}handleWsInflateData(){const{wsInflateLength:e,wsDeflateLength:t}=this.websocket.getWsInflateData();0!==e&&0!==t&&this.upload(KL.WS_INFLATE_DATA_LENGTH,{ws_deflate_length:t,ws_inflate_length:e})}handleWebsocketEvents(){this.websocket.on(sP.RECONNECT_WAITTING_FINISH,(e=>{this.emit(YL.WS_RECONNECT_WAITTING_FINISH,e)})),this.websocket.on(sP.RECONNECT_CREATE_CONNECTION,(e=>{this.emit(YL.WS_RECONNECT_CREATE_CONNECTION,e)})),this.websocket.on(sP.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(sP.CLOSED,(()=>{this.connectionState=jL.CLOSED})),this.websocket.on(sP.FAILED,(()=>{this._disconnectedReason=xL.NETWORK_ERROR,this.connectionState=jL.CLOSED})),this.websocket.on(sP.RECONNECTING,(e=>{this._websocketReconnectReason=e,this.joinResponse=void 0,this.connectionState===jL.CONNECTED?this.connectionState=jL.RECONNECTING:this.connectionState=jL.CONNECTING})),this.websocket.on(sP.WILL_RECONNECT,((e,t)=>{if(kG(this,YL.IS_P2P_DISCONNECTED)&&"retry"===e)return mw.debug("".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),xw("debug",this,"".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),this.reconnectToken=void 0,this.emit(YL.NEED_RENEW_SESSION),this.emit(YL.DISCONNECT_P2P),t("tryNext");"retry"!==e&&(mw.debug("".concat(this.clientId," websockt will_connect event, renewSession reconnectMode is ").concat(e)),xw("debug",this,"".concat(this.clientId," websockt will_connect event, renewSession reconnectMode is ").concat(e)),this.reconnectToken=void 0,this.emit(YL.NEED_RENEW_SESSION),this.emit(YL.DISCONNECT_P2P)),t(e)})),this.websocket.on(sP.CONNECTED,(()=>{this.openConnectionTime=Date.now(),this.reconnectToken?this.rejoin().catch((e=>{mw.warning("[".concat(this.clientId,"] rejoin failed ").concat(e)),Yw("warning",this,"rejoin",void 0,e.toString()),this.reconnect("tryNext",GL.SERVER_ERROR)})):this.join().catch((e=>{if(this.emit(YL.REPORT_JOIN_GATEWAY,e.message||e.code,this.url||""),e instanceof pw&&e.code===hw.UNEXPECTED_RESPONSE&&e.data.code===VL.ERR_NO_AUTHORIZED)return mw.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),xw("warning",this,"reconnect no authorized, recover"),void this.reconnect("recover",GL.SERVER_ERROR);mw.error("[".concat(this.clientId,"] join gateway request failed"),e.toString()),Yw("error",this,"join",void 0,e.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",GL.SERVER_ERROR):(this.initError=e,this.close())}))})),this.websocket.on(sP.REQUEST_NEW_URLS,((e,t)=>{bG(this,YL.REQUEST_RECOVER,this.multiIpOption).then(e).catch(t)}))}})||nW;var oW;function sW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function aW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}const cW=new Map;let AW=Ww("AgoraRTCGateway","store.clientId")(oW=class extends Ew{get state(){return this._state}set state(e){if(e===this._state)return;const t=this._state;this._state=e,"DISCONNECTED"===e&&this._disconnectedReason?this.emit(mP.CONNECTION_STATE_CHANGE,e,t,this._disconnectedReason):this.emit(mP.CONNECTION_STATE_CHANGE,e,t)}get joinGatewayStartTime(){return this._joinGatewayStartTime}set joinGatewayStartTime(e){mw.debug("[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(e)),Yw("debug",this,"joinGatewayStartTime",e,"[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(e)),this._joinGatewayStartTime=e}constructor(e,t){super(),tD(this,"store",void 0),tD(this,"joinInfo",void 0),tD(this,"key",void 0),tD(this,"signal",void 0),tD(this,"role",void 0),tD(this,"inChannelInfo",{joinAt:null,duration:0}),tD(this,"spec",void 0),tD(this,"_state","DISCONNECTED"),tD(this,"_statsCollector",void 0),tD(this,"_disconnectedReason",void 0),tD(this,"isSignalRecover",!1),tD(this,"hasChangeBGPAddress",!1),tD(this,"trafficStatsInterval",void 0),tD(this,"networkQualityInterval",void 0),tD(this,"_joinGatewayStartTime",0),tD(this,"_signalTimeout",!1),tD(this,"_clientRoleOptions",void 0),tD(this,"_isProactiveJoin",!1),this.store=e,this.spec=t,this.signal=new rW(aW(aW({},t),{},{retryConfig:t.websocketRetryConfig})),this._statsCollector=t.statsCollector,this.role=t.role||"audience",this._clientRoleOptions=t.clientRoleOptions,this.handleSignalEvents()}async join(e,t,i){this.store.joinGatewayStart(),"disabled"!==e.cloudProxyServer&&(this.hasChangeBGPAddress=!0);const n=Date.now();let r=cW.get(e.cname);if(r||(r=new Map,cW.set(e.cname,r)),this._isProactiveJoin=!0,r.has(e.uid)){const t=new pw(hw.UID_CONFLICT);throw Px.joinGateway(e.sid,{lts:n,succ:!1,ec:t.message,addr:null,uid:e.uid,cid:e.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!e.proxyServer}),this._isProactiveJoin=!1,t}r.set(e.uid,!0),this.joinInfo=e,this.key=t;const o=e.proxyServer,s=o?e.gatewayAddrs.map((e=>{const t=e.address.split(":");return"wss://".concat(o,"/ws/?h=").concat(t[0],"&p=").concat(t[1])})):e.gatewayAddrs.map((e=>"wss://".concat(e.address)));let a=0;this.joinGatewayStartTime=n;try{a=(await this.signal.init(s,i)).uid}catch(t){if(t&&t.code===hw.INIT_WEBSOCKET_TIMEOUT)throw mw.warning("[".concat(this.store.clientId,"] User join failed"),t.toString()),t;throw mw.error("[".concat(this.store.clientId,"] User join failed"),t.toString()),Yw("error",this,"join",void 0,t.toString()),Px.joinGateway(e.sid,{lts:n,succ:!1,ec:t.message,addr:this.signal.url,uid:e.uid,cid:e.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!o}),this._isProactiveJoin=!1,r.delete(e.uid),this.signal.close(),t}return this.state="CONNECTED",this.inChannelInfo.joinAt=Date.now(),mw.debug("[".concat(this.store.clientId,"] Connected to gateway server")),Yw("debug",this,"join",void 0,"success"),this.trafficStatsInterval=window.setInterval((()=>{this.updateTrafficStats().catch((e=>{mw.warning("[".concat(this.store.clientId,"] get traffic stats error"),e.toString()),Yw("warning",this,"trafficStatsInterval",void 0,e.toString())}))}),3e3),this.networkQualityInterval=window.setInterval((()=>{navigator&&void 0!==navigator.onLine&&!navigator.onLine?this.emit(mP.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6}):this._signalTimeout?this.emit(mP.NETWORK_QUALITY,{downlinkNetworkQuality:5,uplinkNetworkQuality:5}):"CONNECTED"===this.state&&this._statsCollector.trafficStats?this.emit(mP.NETWORK_QUALITY,{uplinkNetworkQuality:_G(this._statsCollector.trafficStats.B_unq),downlinkNetworkQuality:_G(this._statsCollector.trafficStats.B_dnq)}):this.emit(mP.NETWORK_QUALITY,{uplinkNetworkQuality:0,downlinkNetworkQuality:0})}),2e3),this.store.joinGatewayEnd(),a}async leave(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if("DISCONNECTED"!==this.state){t!==xL.FALLBACK&&(this.state="DISCONNECTING");try{e||this.signal.connectionState!==jL.CONNECTED||await function(e,t){return Mm.race([e,OG(3e3)])}(this.signal.request(HL.LEAVE,void 0,!0))}catch(e){mw.warning("[".concat(this.store.clientId,"] leave request failed, ignore"),e),xw("warning",this,"leave request failed, ignore, ".concat(e.toString()))}this.signal.close(t),t!==xL.FALLBACK&&(this.state="DISCONNECTED"),this.reset()}}async publish(e,t,i){if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));const n={state:"offer",p2p_id:this.store.p2pId,ortc:t,mode:this.spec.mode,extend:cb("PUB_EXTEND")};try{return(await this.signal.request(HL.PUBLISH,n,!0))._message}catch(n){if(i&&n.data&&n.data.code===VL.ERR_PUBLISH_REQUEST_INVALID)return mw.warning("[".concat(this.store.clientId,"] receive publish error code, retry"),n.toString()),xw("warning",this,"receive publish error code, retry, ".concat(n.toString())),await this.tryUnpubBeforeRepub(e,t),this.publish(e,t,!1);throw n}}async unpublish(e,t){try{if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await this.signal.request(HL.UNPUBLISH,{stream_id:t,ortc:e},!0)}catch(e){mw.warning("unpublish warning: ",e),Yw("warning",this,"unpublish",void 0,e.toString())}}async subscribe(e,t,i){if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not subscribe when connection state is ".concat(this.state));const n={stream_id:e,stream_type:t.stream_type,mode:this.spec.mode,codec:this.spec.codec,p2p_id:this.store.p2pId,tcc:!!cb("SUBSCRIBE_TCC"),extend:cb("SUB_EXTEND"),ssrcId:t.ssrcId};try{return(await this.signal.request(HL.SUBSCRIBE,n,!0))._message}catch(n){if(i&&n.data&&n.data.code===VL.ERR_SUBSCRIBE_REQUEST_INVALID)return mw.warning("[".concat(this.store.clientId,"] receiver subscribe error code, retry"),n.toString()),xw("warning",this,"receiver subscribe error code, retry"),await this.tryUnsubBeforeResub(e,t),await this.subscribe(e,t,!1);throw n}}async subscribeAll(e,t){if("CONNECTED"!==this.state&&"RECONNECTING"!==this.state)throw new pw(hw.INVALID_OPERATION,"can not massSubscribe when connection state is ".concat(this.state));const i={p2p_id:this.store.p2pId,users:e,dtx:!1};try{return await this.signal.request(HL.SUBSCRIBE_STREAMS,i,!0)}catch(i){if(t&&i.data&&i.data.code===VL.ERR_SUBSCRIBE_REQUEST_INVALID)return mw.warning("[".concat(this.store.clientId,"] receiver massSubscribe error code, retry"),i.toString()),xw("warning",this,"receiver massSubscribe error code, retry"),await this.tryMassUnsubBeforeResub(e),await this.subscribeAll(e,!1);throw i}}async setVideoProfile(e){const t=function(e){if(!(e.bitrateMax&&e.bitrateMin&&e.frameRate&&e.height&&e.width))return;let t=e.frameRate,i=e.width,n=e.height,r=!0;return"number"!=typeof t&&(t=t.exact||t.ideal||t.max||t.min||0,t||(r=!1)),"number"!=typeof i&&(i=i.exact||i.ideal||i.max||i.min||0,i||(r=!1)),"number"!=typeof n&&(n=n.exact||n.ideal||n.max||n.min||0,t||(r=!1)),r?{stream_type:0,width:i,height:n,fps:t,start_bps:1e3*e.bitrateMax,min_bps:1e3*e.bitrateMin,target_bps:1e3*e.bitrateMax}:void 0}(e);return t?this.signal.request(HL.SET_VIDEO_PROFILE,t):(mw.debug("[".concat(this.store.clientId,"] encoder config is not complete, do not report to gateway")),void xw("debug",this,"encoder config is not complete, do not report to gateway"))}async unsubscribe(e,t){try{await this.signal.request(HL.UNSUBSCRIBE,{p2p_id:this.store.p2pId,ortc:e,stream_id:t},!0)}catch(e){mw.warning("unsubscribe warning: ",e),Yw("warning",this,"unsubscribe",void 0,e.toString())}}async massUnsubscribe(e){try{await this.signal.request(HL.UNSUBSCRIBE_STREAMS,e,!0)}catch(e){mw.warning("unsubscribeAll warning: ",e),Yw("warning",this,"unsubscribeAll",void 0,e.toString())}}async reconnectPC(e){const{iceParameters:t,dtlsParameters:i,rtpCapabilities:n}=e,r=await this.signal.request(HL.CONNECT_PC,{p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:{iceParameters:t,dtlsParameters:i,rtpCapabilities:n}},!0),o=this.getGatewayIpPort();return{gatewayEstablishParams:r,gatewayIP:null==o?void 0:o.ip,gatewayPort:null==o?void 0:o.port}}getGatewayInfo(){return this.signal.request(HL.GATEWAY_INFO)}renewToken(e){return this.signal.request(HL.RENEW_TOKEN,e)}async setClientRole(e,t){if(t&&(this._clientRoleOptions=Object.assign({},t)),"CONNECTED"!==this.state)return void(this.role=e);let i;i="audience"===e?this._clientRoleOptions&&this._clientRoleOptions.level?this._clientRoleOptions.level:2:0,await this.signal.request(HL.SET_CLIENT_ROLE,{role:e,level:i}),this.role=e}async setRemoteVideoStreamType(e,t){await this.signal.request(HL.SWITCH_VIDEO_STREAM,{stream_id:e,stream_type:t})}async setDefaultRemoteVideoStreamType(e){await this.signal.request(HL.DEFAULT_VIDEO_STREAM,{stream_type:e})}async setStreamFallbackOption(e,t){await this.signal.request(HL.SET_FALLBACK_OPTION,{stream_id:e,fallback_type:t})}async pickSVCLayer(e,t){await this.signal.request(HL.PICK_SVC_LAYER,{stream_id:e,spatial_layer:t.spatialLayer,temporal_layer:t.temporalLayer})}getInChannelInfo(){return this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt),aW({},this.inChannelInfo)}async getGatewayVersion(){return(await this.signal.request(HL.GATEWAY_INFO)).version}reset(){if(this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt,this.inChannelInfo.joinAt=null),this.trafficStatsInterval&&(window.clearInterval(this.trafficStatsInterval),this.trafficStatsInterval=void 0),this.joinInfo){const e=cW.get(this.joinInfo.cname);e&&e.delete(this.joinInfo.uid)}this.joinInfo=void 0,this.key=void 0,this.networkQualityInterval&&(window.clearInterval(this.networkQualityInterval),this.networkQualityInterval=void 0)}updateTurnConfigFromSignal(){if(!this.joinInfo)return;const e=function(e){const t=e.match(/(wss\:\/\/)?([^:]+):(\d+)/);return t?{username:Zw.username,password:Zw.password,turnServerURL:t[2],tcpport:parseInt(t[3])+30,udpport:parseInt(t[3])+30,forceturn:!1}:null}(("disabled"===this.joinInfo.cloudProxyServer?this.signal.url:this.joinInfo.gatewayAddrs[this.signal.currentURLIndex].address)||"");this.joinInfo.turnServer.serversFromGateway=[],e&&"off"!==this.joinInfo.turnServer.mode&&"disabled"===this.joinInfo.cloudProxyServer&&this.joinInfo.turnServer.serversFromGateway.push(aW(aW({},Zw),{},{turnServerURL:e.turnServerURL,tcpport:e.tcpport,udpport:e.udpport,username:this.joinInfo.uid.toString(),password:this.joinInfo.token}))}async updateTrafficStats(){if("CONNECTED"!==this.state)return;const e=await this.signal.request(HL.TRAFFIC_STATS,void 0,!0);e.timestamp=Date.now(),e.peer_delay.forEach((e=>{const t=this._statsCollector.trafficStats&&this._statsCollector.trafficStats.peer_delay.find((t=>t.peer_uid===e.peer_uid));t&&t.B_st!==e.B_st&&BG((()=>{this.emit(mP.STREAM_TYPE_CHANGE,e.peer_uid,e.B_st)}))})),this._statsCollector.updateTrafficStats(e)}getJoinMessage(e){if(!this.joinInfo||!this.key)throw new pw(hw.UNEXPECTED_ERROR,"can not generate join message, no join info");const t=Object.assign({},this.joinInfo.apResponse);let i=cb("REPORT_APP_SCENARIO");if("string"!=typeof i)try{i=JSON.stringify(i)}catch(e){i=void 0}i&&i.length>128&&(i=void 0);const n=aW({p2p_id:this.store.p2pId,session_id:this.joinInfo.sid,app_id:this.joinInfo.appId,channel_key:this.key,channel_name:this.joinInfo.cname,sdk_version:Xw,browser:navigator.userAgent,process_id:cb("PROCESS_ID"),mode:this.spec.mode,codec:this.spec.codec,role:this.role,has_changed_gateway:this.hasChangeBGPAddress,ap_response:t,extend:cb("JOIN_EXTEND"),details:{6:this.joinInfo.stringUid,cservice_map:"proxy3"===this.joinInfo.cloudProxyServer?"1":"proxy5"===this.joinInfo.cloudProxyServer?"2":void 0},features:{rejoin:!0},optionalInfo:this.joinInfo.optionalInfo,appScenario:i,attributes:{userAttributes:{enablePublishedUserList:cb("ENABLE_PUBLISHED_USER_LIST"),maxSubscription:cb("MAX_SUBSCRIPTION")}}},e);return this.joinInfo.stringUid&&(n.string_uid=this.joinInfo.stringUid),this.joinInfo.aesmode&&this.joinInfo.aespassword&&(n.aes_mode=this.joinInfo.aesmode,cb("ENCRYPT_AES")?(n.aes_secret=this.joinInfo.aespassword,n.aes_encrypt=!0):n.aes_secret=this.joinInfo.aespassword,this.joinInfo.aessalt&&(n.aes_salt=this.joinInfo.aessalt)),t.addresses[this.signal.websocket.currentURLIndex]&&(n.ap_response.ticket=t.addresses[this.signal.websocket.currentURLIndex].ticket,delete t.addresses),void 0!==this.joinInfo.defaultVideoStream&&(n.default_video_stream=this.joinInfo.defaultVideoStream),n}getRejoinMessage(){if(!this.joinInfo)throw new pw(hw.UNEXPECTED_ERROR,"can not generate rejoin message, no join info");return{session_id:this.joinInfo.sid,channel_name:this.joinInfo.cname,cid:this.joinInfo.cid,uid:this.joinInfo.uid,vid:Number(this.joinInfo.vid)}}handleSignalEvents(){this.signal.on(YL.WS_RECONNECT_WAITTING_FINISH,(e=>{["tryNext","recover"].includes(e)&&this.joinInfo&&Px.adjustSessionStartTime(this.joinInfo.sid)})),this.signal.on(YL.WS_RECONNECT_CREATE_CONNECTION,(e=>{this.joinGatewayStartTime=Date.now()})),this.signal.on(YL.WS_RECONNECTING,(e=>{this.joinInfo&&Px.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:e||GL.NETWORK_ERROR}),this.joinInfo&&(this.state="RECONNECTING",Px.sessionInit(this.joinInfo.sid,{lts:(new Date).getTime(),extend:this.isSignalRecover?{recover:!0}:{rejoin:!0},cname:this.joinInfo.cname,appid:this.joinInfo.appId,mode:this.spec.mode}),this.isSignalRecover=!1,this.joinGatewayStartTime=Date.now())})),this.signal.on(YL.WS_CLOSED,(e=>{let t;switch(e){case xL.LEAVE:t=GL.LEAVE;break;case xL.UID_BANNED:case xL.IP_BANNED:case xL.CHANNEL_BANNED:case xL.SERVER_ERROR:t=GL.SERVER_ERROR;break;case xL.FALLBACK:t=GL.FALLBACK;break;default:t=GL.NETWORK_ERROR}mw.debug("[signal] websocket closed, reason: ".concat(t||"undefined -> "+GL.NETWORK_ERROR)),Fw("debug",this,"ws_closed","reason: ".concat(e)),this.joinInfo&&Px.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:e===xL.LEAVE?1:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:t}),this._disconnectedReason=e,e!==xL.FALLBACK&&(this.state="DISCONNECTED"),this.reset()})),this.signal.on(YL.WS_CONNECTED,(()=>{if(this.updateTurnConfigFromSignal(),this.state="CONNECTED",this.joinInfo&&("audience"===this.role&&this._clientRoleOptions&&this._clientRoleOptions.level&&(mw.debug("[".concat(this.store.clientId,"] patch to send set client role, role: ").concat(this.role,", mode: ").concat(this.spec.mode,", level: ").concat(this._clientRoleOptions&&this._clientRoleOptions.level)),xw("debug",this,"patch to send set client role, role: ".concat(this.role,", mode: ").concat(this.spec.mode,", level: ").concat(this._clientRoleOptions&&this._clientRoleOptions.level)),this.setClientRole(this.role,this._clientRoleOptions)),Px.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!0,ec:null,vid:this.joinInfo.vid,addr:this.signal.url,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer}),this._isProactiveJoin=!1,this.joinInfo.useLocalAccessPoint)){const e=this.signal.url&&this.signal.url.match(/wss\:\/\/([^:]+):(\d+)/);if(!e)return mw.error("[".concat(this.store.clientId,"] set local access point after joined failed: ").concat(e)),void xw("error",this,"set local access point after joined failed: ".concat(e));ab("EVENT_REPORT_DOMAIN",e[1]),ab("EVENT_REPORT_BACKUP_DOMAIN",e[1]),ab("LOG_UPLOAD_SERVER","".concat(e[1],":6444"))}})),this.signal.on(WL.ON_UPLINK_STATS,(e=>{this._statsCollector.updateUplinkStats(e)})),this.signal.on(YL.REQUEST_RECOVER,((e,t,i)=>{if(!this.joinInfo)return i(new pw(hw.UNEXPECTED_ERROR,"gateway: can not recover, no join info"));e&&(this.joinInfo.multiIP=e,this.hasChangeBGPAddress=!0),this.isSignalRecover=!0,bG(this,mP.REQUEST_NEW_GATEWAY_LIST).then(t).catch(i)})),this.signal.on(YL.REQUEST_JOIN_INFO,(async e=>{var t;this.updateTurnConfigFromSignal();const{iceParameters:i,dtlsParameters:n,rtpCapabilities:r}=await bG(this,mP.REQUEST_P2P_CONNECTION_PARAMS,{turnServer:null===(t=this.joinInfo)||void 0===t?void 0:t.turnServer});e(this.getJoinMessage({ortc:{iceParameters:i,dtlsParameters:n,rtpCapabilities:r,version:"2"}}))})),this.signal.on(YL.REQUEST_REJOIN_INFO,(e=>{e(this.getRejoinMessage())})),this.signal.on(YL.REPORT_JOIN_GATEWAY,((e,t)=>{this.joinInfo&&(Px.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!1,ec:e,addr:t,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer}),this._isProactiveJoin=!1)})),this.signal.on(YL.IS_P2P_DISCONNECTED,(e=>{e(kG(this,mP.IS_P2P_DISCONNECTED))})),this.signal.on(YL.DISCONNECT_P2P,(()=>{this.emit(mP.DISCONNECT_P2P)})),this.signal.on(YL.NEED_RENEW_SESSION,(()=>{this.emit(mP.NEED_RENEW_SESSION)})),this.signal.on(YL.REQUEST_SUCCESS,(()=>{this._signalTimeout=!1})),this.signal.on(YL.REQUEST_TIMEOUT,(()=>{this._signalTimeout=!0})),this.signal.on(YL.JOIN_RESPONSE,(e=>{const t=this.getGatewayIpPort();t?this.emit(mP.JOIN_RESPONSE,e,t.ip,t.port):this.emit(mP.JOIN_RESPONSE,e)}))}async tryUnsubBeforeResub(e,t){try{await this.signal.request(HL.UNSUBSCRIBE,{p2p_id:this.store.p2pId,stream_id:e,ortc:[t]},!0)}catch(t){throw mw.warning("unsubscribe warning",t),Yw("warning",this,"tryUnsubBeforeResub",e,t.toString()),t}}async tryUnpubBeforeRepub(e,t){try{await this.signal.request(HL.UNPUBLISH,{stream_id:e,ortc:t},!0)}catch(t){throw mw.warning("unpublish warning: ",t),Yw("warning",this,"tryUnpubBeforeRepub",e,t.toString()),t}}async tryMassUnsubBeforeResub(e){const t={users:e.map((e=>({stream_id:e.stream_id,stream_type:e.stream_type})))};try{await this.signal.request(HL.UNSUBSCRIBE_STREAMS,t,!0)}catch(t){throw mw.warning("massUnsubscribe warning",t),Yw("warning",this,"tryUnsubAllBeforeResub",e.map((e=>e.stream_id)),t.toString()),t}}async muteLocal(e,t){const i={action:e.find((e=>e.stream_type===TP.Audio))?"mute_local_audio":"mute_local_video",p2p_id:this.store.p2pId,ortc:e,stream_id:t};try{await this.signal.request(HL.CONTROL,i,!0,!0)}catch(e){throw mw.warning("gateway unmuteLocal warning: ",e),Yw("warning",this,"muteLocal",t,e.toString()),e}}async unmuteLocal(e,t){const i={action:e.find((e=>e.stream_type===TP.Audio))?"unmute_local_audio":"unmute_local_video",p2p_id:this.store.p2pId,ortc:e,stream_id:t};try{await this.signal.request(HL.CONTROL,i,!0,!0)}catch(e){throw mw.warning("gateway muteLocal warning: ",e),Yw("warning",this,"unmuteLocal",t,e.toString()),e}}uploadStats(e,t){this.signal.upload(e,t)}getSignalRTT(){return this.signal.rtt}async restartICE(e){const t={p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:e};try{const e=await this.signal.request(HL.RESTART_ICE,t,!0),i=this.getGatewayIpPort();return{restartICEResponse:e,gatewayIP:null==i?void 0:i.ip,gatewayPort:null==i?void 0:i.port}}catch(e){throw mw.warning("P2PChannel.restartICE warning: ",e),Yw("warning",this,"restartICE",void 0,e.toString()),e}}reconnect(){"CONNECTED"===this.state&&this.signal.reconnect(void 0,GL.P2P_FAILED)}getGatewayIpPort(){var e;if(!cb("GATEWAY_WSS_ADDRESS")&&null!==(e=this.joinInfo)&&void 0!==e&&e.gatewayAddrs){const e=this.joinInfo.gatewayAddrs[this.signal.currentURLIndex];return(e.ip||e.ip6)&&e.port?e.ip6?{ip:e.ip6,port:e.port}:{ip:e.ip,port:e.port}:void 0}}})||oW;function dW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function uW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}!function(){var t;function i(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n,r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,i){return e==Array.prototype||e==Object.prototype||(e[t]=i.value),e},o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof e&&e];for(var i=0;i<t.length;++i){var n=t[i];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var i=o;e=e.split(".");for(var n=0;n<e.length-1;n++){var s=e[n];if(!(s in i))break e;i=i[s]}(t=t(n=i[e=e[e.length-1]]))!=n&&null!=t&&r(i,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function c(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:i(e)}}if(s("Symbol",(function(e){function t(e,t){this.A=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.A};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",n=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(i+(r||"")+"_"+n++,r)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var s=o[t[n]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&r(s.prototype,e,{configurable:!0,writable:!0,value:function(){return a(i(this))}})}return e})),"function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var A;e:{var d={};try{d.__proto__={a:!0},A=d.a;break e}catch(e){}A=!1}n=A?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var u=n;function E(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function l(e){if(e.m)throw new TypeError("Generator is already running");e.m=!0}function h(e,t){return e.h=3,{value:t}}function p(e){this.g=new E,this.G=e}function _(e,t,i,n){try{var r=t.call(e.g.j,i);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.m=!1,r;var o=r.value}catch(t){return e.g.j=null,e.g.s(t),I(e)}return e.g.j=null,n.call(e.g,o),I(e)}function I(e){for(;e.g.h;)try{var t=e.G(e.g);if(t)return e.g.m=!1,{value:t.value,done:!1}}catch(t){e.g.v=void 0,e.g.s(t)}if(e.g.m=!1,e.g.l){if(t=e.g.l,e.g.l=null,t.F)throw t.D;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function g(e){this.next=function(t){return e.o(t)},this.throw=function(t){return e.s(t)},this.return=function(t){return function(e,t){l(e.g);var i=e.g.j;return i?_(e,"return"in i?i.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),I(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(e,t){return t=new g(new p(t)),u&&e.prototype&&u(t,e.prototype),t}if(E.prototype.o=function(e){this.v=e},E.prototype.s=function(e){this.l={D:e,F:!0},this.h=this.C||this.u},E.prototype.return=function(e){this.l={return:e},this.h=this.u},p.prototype.o=function(e){return l(this.g),this.g.j?_(this,this.g.j.next,e,this.g.o):(this.g.o(e),I(this))},p.prototype.s=function(e){return l(this.g),this.g.j?_(this,this.g.j.throw,e,this.g.o):(this.g.s(e),I(this))},s("Array.prototype.entries",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var i=0,n=!1,r={next:function(){if(!n&&i<e.length){var r=i++;return{value:t(r,e[r]),done:!1}}return n=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}(this,(function(e,t){return[e,t]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var R=function(e,t){for(var i=0;i<e.length;i++)t(e[i])},C=function(e){return e.replace(/\r?\n|\r/g,"\r\n")},T=function(e,t,i){return t instanceof Blob?(i=void 0!==i?String(i+""):"string"==typeof t.name?t.name:"blob",t.name===i&&"[object Blob]"!==Object.prototype.toString.call(t)||(t=new File([t],i)),[String(e),t]):[String(e),String(t)]},m=function(e,t){if(e.length<t)throw new TypeError(t+" argument required, but only "+e.length+" present.")},S="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,O=S.FormData,v=S.XMLHttpRequest&&S.XMLHttpRequest.prototype.send,N=S.Request&&S.fetch,y=S.navigator&&S.navigator.sendBeacon,D=S.Element&&S.Element.prototype,w=S.Symbol&&Symbol.toStringTag;w&&(Blob.prototype[w]||(Blob.prototype[w]="Blob"),"File"in S&&!File.prototype[w]&&(File.prototype[w]="File"));try{new File([],"")}catch(e){S.File=function(e,t,i){return e=new Blob(e,i||{}),Object.defineProperties(e,{name:{value:t},lastModified:{value:+(i&&void 0!==i.lastModified?new Date(i.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),w&&Object.defineProperty(e,w,{value:"File"}),e}}var b=function(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},L=function(e){this.i=[];var t=this;e&&R(e.elements,(function(e){if(e.name&&!e.disabled&&"submit"!==e.type&&"button"!==e.type&&!e.matches("form fieldset[disabled] *"))if("file"===e.type){var i=e.files&&e.files.length?e.files:[new File([],"",{type:"application/octet-stream"})];R(i,(function(i){t.append(e.name,i)}))}else"select-multiple"===e.type||"select-one"===e.type?R(e.options,(function(i){!i.disabled&&i.selected&&t.append(e.name,i.value)})):"checkbox"===e.type||"radio"===e.type?e.checked&&t.append(e.name,e.value):(i="textarea"===e.type?C(e.value):e.value,t.append(e.name,i))}))};if((t=L.prototype).append=function(e,t,i){m(arguments,2),this.i.push(T(e,t,i))},t.delete=function(e){m(arguments,1);var t=[];e=String(e),R(this.i,(function(i){i[0]!==e&&t.push(i)})),this.i=t},t.entries=function e(){var t,i=this;return f(e,(function(e){if(1==e.h&&(t=0),3!=e.h)return t<i.i.length?e=h(e,i.i[t]):(e.h=0,e=void 0),e;t++,e.h=2}))},t.forEach=function(e,t){m(arguments,1);for(var i=c(this),n=i.next();!n.done;n=i.next()){var r=c(n.value);n=r.next().value,r=r.next().value,e.call(t,r,n,this)}},t.get=function(e){m(arguments,1);var t=this.i;e=String(e);for(var i=0;i<t.length;i++)if(t[i][0]===e)return t[i][1];return null},t.getAll=function(e){m(arguments,1);var t=[];return e=String(e),R(this.i,(function(i){i[0]===e&&t.push(i[1])})),t},t.has=function(e){m(arguments,1),e=String(e);for(var t=0;t<this.i.length;t++)if(this.i[t][0]===e)return!0;return!1},t.keys=function e(){var t,i,n=this;return f(e,(function(e){if(1==e.h&&(t=c(n),i=t.next()),3!=e.h)return i.done?void(e.h=0):h(e,c(i.value).next().value);i=t.next(),e.h=2}))},t.set=function(e,t,i){m(arguments,2),e=String(e);var n=[],r=T(e,t,i),o=!0;R(this.i,(function(t){t[0]===e?o&&(o=!n.push(r)):n.push(t)})),o&&n.push(r),this.i=n},t.values=function e(){var t,i,n,r,o=this;return f(e,(function(e){if(1==e.h&&(t=c(o),i=t.next()),3!=e.h)return i.done?void(e.h=0):(n=i.value,(r=c(n)).next(),h(e,r.next().value));i=t.next(),e.h=2}))},L.prototype._asNative=function(){for(var e=new O,t=c(this),i=t.next();!i.done;i=t.next()){var n=c(i.value);i=n.next().value,n=n.next().value,e.append(i,n)}return e},L.prototype._blob=function(){var e="----formdata-polyfill-"+Math.random(),t=[],i="--"+e+'\r\nContent-Disposition: form-data; name="';return this.forEach((function(e,n){return"string"==typeof e?t.push(i+b(C(n))+'"\r\n\r\n'+C(e)+"\r\n"):t.push(i+b(C(n))+'"; filename="'+b(e.name)+'"\r\nContent-Type: '+(e.type||"application/octet-stream")+"\r\n\r\n",e,"\r\n")})),t.push("--"+e+"--"),new Blob(t,{type:"multipart/form-data; boundary="+e})},L.prototype[Symbol.iterator]=function(){return this.entries()},L.prototype.toString=function(){return"[object FormData]"},D&&!D.matches&&(D.matches=D.matchesSelector||D.mozMatchesSelector||D.msMatchesSelector||D.oMatchesSelector||D.webkitMatchesSelector||function(e){for(var t=(e=(this.document||this.ownerDocument).querySelectorAll(e)).length;0<=--t&&e.item(t)!==this;);return-1<t}),w&&(L.prototype[w]="FormData"),v){var P=S.XMLHttpRequest.prototype.setRequestHeader;S.XMLHttpRequest.prototype.setRequestHeader=function(e,t){P.call(this,e,t),"content-type"===e.toLowerCase()&&(this.B=!0)},S.XMLHttpRequest.prototype.send=function(e){e instanceof L?(e=e._blob(),this.B||this.setRequestHeader("Content-Type",e.type),v.call(this,e)):v.call(this,e)}}N&&(S.fetch=function(e,t){return t&&t.body&&t.body instanceof L&&(t.body=t.body._blob()),N.call(this,e,t)}),y&&(S.navigator.sendBeacon=function(e,t){return t instanceof L&&(t=t._asNative()),y.call(this,e,t)}),S.FormData=L}}();let EW=1;let lW=1;function hW(e,t,i,n){let{url:r,areaCode:o}=e;Yw("debug",["AjaxAPI",t.clientId],"requestChooseServer",{url:r,areaCode:o});const s=Date.now(),[a,c]=gW(t,o,[WV.CHOOSE_SERVER]);let A=Sx.networkState;return gw((async()=>{A&&Sx.networkState===jP.OFFLINE&&Sx.onlineWaiter&&await Mm.race([Sx.onlineWaiter,SG(n&&n.maxRetryTimeout||_w.maxRetryTimeout)]),A=Sx.networkState;const e=await Tx(r,{data:a,cancelToken:i,headers:{"Content-Type":"multipart/form-data;"}},!0);Px.reportResourceTiming(r,t.sid),_W(e,r,t,s,[WV.CHOOSE_SERVER]);const o=IG(e,WV.CHOOSE_SERVER);return IW(o),EG(o,r)}),(e=>(e&&Px.joinChooseServer(t.sid,{lts:s,succ:!0,csAddr:r,opid:c,serverList:e.gatewayAddrs.map((e=>e.address)),ec:null,cid:e.cid.toString(),uid:e.uid.toString(),csIp:e.csIp,unilbsServerIds:[WV.CHOOSE_SERVER].toString()}),!1)),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.CAN_NOT_GET_GATEWAY_SERVER?e.data.retry:(Px.joinChooseServer(t.sid,{lts:s,succ:!1,csAddr:r,serverList:null,opid:c,ec:e.code,csIp:e.data&&e.data.csIp,unilbsServerIds:[WV.CHOOSE_SERVER].toString(),extend:JSON.stringify({networkState:A})}),mw.warning("[".concat(t.clientId,"] Choose server network error, retry"),e),xw("warning",["AjaxAPI",t.clientId],"Choose server network error, retry, ".concat(e)),!0))),n)}function pW(e,t,i,n){let{url:r,areaCode:o,serviceIds:s}=e;Yw("debug",["AjaxAPI",t.clientId],"requestMultiUnilbs",{url:r,areaCode:o,serviceIds:s});const a=Date.now(),[c,A]=gW(t,o,s);let d;return gw((async()=>{d&&Sx.networkState===jP.OFFLINE&&Sx.onlineWaiter&&await Mm.race([Sx.onlineWaiter,SG(n&&n.maxRetryTimeout||_w.maxRetryTimeout)]),d=Sx.networkState;const e=await Tx(r,{data:c,cancelToken:i,headers:{"Content-Type":"multipart/form-data;"}},!0);Px.reportResourceTiming(r,t.sid),_W(e,r,t,a,s);const o=IG(e,WV.CHOOSE_SERVER),A=IG(e,"proxy5"===t.cloudProxyServer?WV.CLOUD_PROXY_5:"proxy3"===t.cloudProxyServer||"proxy4"===t.cloudProxyServer?WV.CLOUD_PROXY:WV.CLOUD_PROXY_FALLBACK);return IW(o),{gatewayInfo:EG(o,r),proxyInfo:A,url:r}}),(e=>(e.gatewayInfo&&Px.joinChooseServer(t.sid,{lts:a,succ:!0,csAddr:r,serverList:e.gatewayInfo.gatewayAddrs.map((e=>e.address)),ec:null,opid:A,cid:e.gatewayInfo.cid.toString(),uid:e.gatewayInfo.uid.toString(),csIp:e.gatewayInfo.csIp,unilbsServerIds:s.toString()}),e.proxyInfo&&Px.joinWebProxyAP(t.sid,{lts:a,sucess:1,apServerAddr:r,turnServerAddrList:e.proxyInfo.addresses.map((e=>e.ip)).join(","),errorCode:null,eventType:t.cloudProxyServer,unilbsServerIds:s.toString()}),!1)),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.CAN_NOT_GET_GATEWAY_SERVER?e.data.retry:(Px.joinWebProxyAP(t.sid,{lts:a,sucess:0,apServerAddr:r,turnServerAddrList:null,errorCode:e.code,eventType:t.cloudProxyServer,unilbsServerIds:s.toString(),extend:JSON.stringify({networkState:d})}),mw.warning("[".concat(t.clientId,"] multi unilbs network error, retry"),e),xw("warning",["AjaxAPI",t.clientId],"multi unilbs network error, retry, ".concat(e)),!0))),n)}const _W=(e,t,i,n,r)=>{const o=[],s=o=>{4096===o.flag?Px.joinChooseServer(i.sid,{lts:n,succ:!1,csAddr:t,opid:e.opid,serverList:null,ec:o.error.message,csIp:o.error.data&&o.error.data.csIp,unilbsServerIds:r.toString()}):1048576!==o.flag&&4194304!==o.flag&&4194310!==o.flag||Px.joinWebProxyAP(i.sid,{lts:n,sucess:0,apServerAddr:t,turnServerAddrList:null,errorCode:o.error.code,eventType:i.cloudProxyServer,unilbsServerIds:r.toString()})};if(e.response_body.forEach((t=>{const i=t.buffer.code;if(23===t.uri&&0===i&&!t.buffer.edges_services)if(4194310===t.buffer.flag)mw.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers"),t.buffer.edges_services=[];else{const i={error:new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,"no edge services in ap response",{retry:!0,csIp:e.detail[502]}),flag:t.buffer.flag};o.push(i),s(i)}if(0!==i){const n=VK(i),r={error:new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,n.desc,{retry:n.retry,csIp:e.detail[502]}),flag:t.buffer.flag};4194310===t.buffer.flag?mw.warning(r.error.toString()):o.push(r),s(r)}})),o.length)throw mw.warning("[".concat(i.clientId,"] multi unilbs ").concat(t," failed, ").concat(o.map((e=>"flag: ".concat(e.flag,", message: ").concat(e.error.message,", retry: ").concat(e.error.data.retry))).join(" | "))),Yw("warning",["AjaxAPI",i.clientId],"checkMultiUnilbsResponseValid",{url:t},o.map((e=>({flag:e.flag,message:e.error.message,retry:e.error.data.retry})))),new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,o.map((e=>"flag: ".concat(e.flag,", message: ").concat(e.error.message))).join(" | "),{retry:!!o.find((e=>e.error.data.retry)),csIp:e.detail[502]})},IW=e=>{if(e.addresses&&0===e.addresses.length&&0===e.code)throw new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,"void gateway address",{retry:!0,csIp:e.detail&&e.detail[502]});if(cb("GATEWAY_ADDRESS")&&cb("GATEWAY_ADDRESS").length>0){mw.debug("assign gateway address to",cb("GATEWAY_ADDRESS")),xw("debug",["AjaxAPI"],"assign gateway address to ".concat(JSON.stringify(cb("GATEWAY_ADDRESS"))));const t=cb("GATEWAY_ADDRESS").map((t=>({ip:t.ip,port:t.port,ticket:e.addresses[0]&&e.addresses[0].ticket})));e.addresses=t}},gW=(e,t,i)=>{const n=Math.floor(Math.random()*10**12),r={appid:e.appId,client_ts:Date.now(),opid:n,sid:e.sid,request_bodies:[{uri:22,buffer:{cname:e.cname,detail:{6:e.stringUid,11:t,12:cb("USE_NEW_TOKEN")?"1":void 0},key:e.token,service_ids:i,uid:e.uid||0}}]};r.request_bodies.forEach((t=>{e.multiIP&&e.multiIP.gateway_ip&&(t.buffer.detail[5]=JSON.stringify({vocs_ip:[e.multiIP.uni_lbs_ip],vos_ip:[e.multiIP.gateway_ip]}))}));const o=new FormData;return o.append("request",JSON.stringify(r)),[o,n]},fW=()=>{const e=cb("AREAS");return 0===e.length&&e.push(bP.GLOBAL),dE(e).call(e,((e,t,i)=>{const n=RW(t);return n?0===i?n:"".concat(e,",").concat(n):e}),"")},RW=e=>e===bP.OVERSEA?"".concat(MP.ASIA,",").concat(MP.EUROPE,",").concat(MP.AFRICA,",").concat(MP.NORTH_AMERICA,",").concat(MP.SOUTH_AMERICA,",").concat(MP.OCEANIA):MP[e],CW={GLOBAL:{ASIA:[bP.CHINA,bP.JAPAN,bP.INDIA,bP.KOREA,bP.HKMC],EUROPE:[],NORTH_AMERICA:[bP.US],SOUTH_AMERICA:[],OCEANIA:[],AFRICA:[]}},TW=Object.keys(CW[bP.GLOBAL]),mW=[bP.CHINA,bP.NORTH_AMERICA,bP.EUROPE,bP.ASIA,bP.JAPAN,bP.INDIA,bP.OCEANIA,bP.SOUTH_AMERICA,bP.AFRICA,bP.KOREA,bP.HKMC,bP.US];async function SW(e,t,i){const n=async function(e,t,i){const n=cb("WEBCS_DOMAIN").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((t=>({url:e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v2/transpond/webrtc?v=2"):"https://".concat(t,"/api/v2/transpond/webrtc?v=2"),areaCode:fW()})));let r=null;const o=[],s=async()=>await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to choose_server:"),n.url),hW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:o}),a=async()=>{if(await SG(1e3),null!==r)return r;const n=cb("WEBCS_DOMAIN_BACKUP_LIST").map((t=>({url:e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v2/transpond/webrtc?v=2"):"https://".concat(t,"/api/v2/transpond/webrtc?v=2"),areaCode:fW()})));return await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to backup choose_server:"),n.url),hW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:o})};try{return r=await wG([s(),a()]),o.length&&o.forEach((e=>e.cancel&&"function"==typeof e.cancel&&e.cancel())),r}catch(e){throw e[0]}}(e,t,i);return{gatewayInfo:await n}}async function OW(e,t,i,n){const r=e.cloudProxyServer;if("disabled"===r){if(!n)return;if(e.useLocalAccessPoint)return await SW(e,t,i);if(cb("JOIN_WITH_FALLBACK_MEDIA_PROXY")){const{gatewayInfo:n,proxyInfo:r}=await yW(e,t,i);return e.turnServer&&"auto"!==e.turnServer.mode?(xw("debug",["Server",e.clientId],"do not set fallback turn because of already having turnserver"),{gatewayInfo:n}):(e.turnServer={mode:"manual",servers:r.map((e=>({turnServerURL:e.address,tcpport:e.tcpport||Zw.tcpport,udpport:e.udpport||Zw.udpport,username:e.username||Zw.username,password:e.password||Zw.password,forceturn:cb("JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE"),security:!0})))},{gatewayInfo:n})}return await SW(e,t,i)}let o;if(["443only","normal"].includes(r)){let s;n?"normal"!==r?[s,o]=await Mm.all([NW(e,t,i),SW(e,t,i)]):(s=await NW(e,t,i),e.proxyServer=s.addresses[0],Px.setProxyServer(e.proxyServer),mw.setProxyServer(e.proxyServer),Qw(e.proxyServer),o=await SW(e,t,i)):(o=void 0,"normal"!==r?s=await NW(e,t,i):(s=await NW(e,t,i),e.proxyServer=s.addresses[0],Px.setProxyServer(e.proxyServer),mw.setProxyServer(e.proxyServer),Qw(e.proxyServer))),e.turnServer={mode:"manual",servers:s.addresses.map((e=>({turnServerURL:e,tcpport:s.serverResponse.tcpport?s.serverResponse.tcpport:Zw.tcpport,udpport:s.serverResponse.udpport?s.serverResponse.udpport:Zw.udpport,username:s.serverResponse.username||Zw.username,password:s.serverResponse.password||Zw.password,forceturn:!0,security:!1})))}}else{const{proxyInfo:n,gatewayInfo:s}=await yW(e,t,i);o={gatewayInfo:s},e.turnServer={mode:"manual",servers:n.map((e=>({turnServerURL:e.address,tcpport:"proxy3"===r?void 0:e.tcpport?e.tcpport:Zw.tcpport,udpport:"proxy4"===r?void 0:e.udpport?e.udpport:Zw.udpport,username:e.username||Zw.username,password:e.password||Zw.password,forceturn:"proxy4"!==r,security:"proxy5"===r})))}}return mw.debug("[".concat(e.clientId,"] set proxy server: ").concat(e.proxyServer,", mode: ").concat(r)),Yw("debug",["Server",e.clientId],"setCloudProxyServerAndGetServerInfo",{proxyServer:e.proxyServer,mode:e.cloudProxyServer}),o}async function vW(e,t,i,n){const r=cb("ACCOUNT_REGISTER").slice(0,cb("AJAX_REQUEST_CONCURRENT"));let o=[];return o=t.proxyServer?r.map((e=>"https://".concat(t.proxyServer,"/ap/?url=").concat(e+"/api/v1"))):r.map((e=>"https://".concat(e,"/api/v1"))),(await async function(e,t,i,n,r){const o=Date.now(),s={sid:i.sid,opid:10,appid:i.appId,string_uid:t};let a=e[0];const c=await gw((()=>Tx(a+"".concat(-1===a.indexOf("?")?"?":"&","action=stringuid"),{data:s,cancelToken:n,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":72}})),((i,n)=>{if(0===i.code){if(i.uid<=0||i.uid>=Math.pow(2,32))throw mw.error("Invalid Uint Uid ".concat(t," => ").concat(i.uid),i),Yw("error",["AjaxAPI"],"requestUserAccount","Invalid Uint Uid ".concat(t," => ").concat(i.uid,", ").concat(i)),Px.reqUserAccount(s.sid,{lts:o,success:!1,serverAddr:a,stringUid:s.string_uid,uid:i.uid,errorCode:hw.INVALID_UINT_UID_FROM_STRING_UID,extend:s}),new pw(hw.INVALID_UINT_UID_FROM_STRING_UID);return Px.reqUserAccount(s.sid,{lts:o,success:!0,serverAddr:a,stringUid:s.string_uid,uid:i.uid,errorCode:null,extend:s}),!1}const r=VK(i.code);return r.retry&&(a=e[(n+1)%e.length]),Px.reqUserAccount(s.sid,{lts:o,success:!1,serverAddr:a,stringUid:s.string_uid,uid:i.uid,errorCode:r.desc,extend:s}),r.retry}),((t,i)=>t.code!==hw.OPERATION_ABORTED&&(Px.reqUserAccount(s.sid,{lts:o,success:!1,serverAddr:a,stringUid:s.string_uid,uid:null,errorCode:t.code,extend:s}),a=e[(i+1)%e.length],!0)),r);if(0!==c.code){const e=VK(c.code);throw new pw(hw.UNEXPECTED_RESPONSE,e.desc)}return c}(o,e,t,i,n)).uid}async function NW(e,t,i){let n=Date.now();const r=e.cloudProxyServer,o=cb("normal"===r?"PROXY_CS":"WEBCS_DOMAIN").map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v1"):"https://".concat(t,"/api/v1")));if(["proxy3","proxy4","proxy5"].includes(r)){const n=o.map((e=>({url:e,areaCode:fW()})));let r=null;r=await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>function(e,t,i,n){let{url:r,areaCode:o}=e;const s=Date.now(),a={opid:133,flag:"proxy5"===t.cloudProxyServer?4194304:1048576,ts:+new Date,key:t.token,cname:t.cname,sid:t.sid,detail:{6:t.stringUid,11:o},uid:t.uid||0};return gw((async()=>await Tx(r,{data:a,cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":69}})),(e=>{if(0===e.code)return Px.joinWebProxyAP(t.sid,{lts:s,sucess:1,apServerAddr:r,turnServerAddrList:e.addresses.map((e=>e.ip)).join(","),errorCode:null,eventType:t.cloudProxyServer}),!1;const i=VK(e.code);throw new pw(hw.CAN_NOT_GET_GATEWAY_SERVER,i.desc,{retry:i.retry})}),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.CAN_NOT_GET_GATEWAY_SERVER?(Px.joinWebProxyAP(a.sid,{lts:s,sucess:0,apServerAddr:r,turnServerAddrList:null,errorCode:e.code,eventType:t.cloudProxyServer}),mw.warning("[".concat(t.clientId,"] proxy ap server ").concat(r," failed, message: ").concat(e.message,", retry: ").concat(e.data.retry)),xw("warning",["AjaxAPI",t.clientId],"proxy ap server ".concat(r," failed, message: ").concat(e.message,", retry: ").concat(e.data.retry)),e.data.retry):(Px.joinWebProxyAP(a.sid,{lts:s,sucess:0,apServerAddr:r,turnServerAddrList:null,errorCode:e.code,eventType:t.cloudProxyServer}),!0))),n)}(n,e,t,i),allFailedhandler:()=>{throw mw.error("[".concat(e.clientId,"] can not get proxy server after trying several times")),new pw(hw.CAN_NOT_GET_PROXY_SERVER)}});const s=r.addresses;if(!s||0===s.length)throw mw.error("[".concat(e.clientId,"] can not get proxy server, empty proxy server list")),new pw(hw.CAN_NOT_GET_PROXY_SERVER,"empty proxy server list");return{addresses:s.map((e=>e.ip)).map(uG),serverResponse:{tcpport:s[0].port||443,udpport:s[0].port||Zw.udpport,username:Zw.username,password:Zw.password}}}let s=null;s=await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:o,asyncMapHandler:n=>function(e,t,i,n){const r=Date.now(),o={command:"convergeAllocateEdge",sid:t.sid,appId:t.appId,token:t.token,uid:t.uid,cname:t.cname,ts:Math.floor(Date.now()/1e3),version:Xw,seq:0,requestId:1};return gw((async()=>({res:await Tx(e,{data:{service_name:"webrtc_proxy",json_body:JSON.stringify(o)},cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":61}}),url:e})),(e=>{if(!e.res.json_body)throw mw.debug("[".concat(t.clientId,"] Get proxy server failed: no json_body")),Yw("error",["AjaxAPI",t.clientId],"requestProxyServerList","Get proxy server failed: no json_body"),new pw(hw.UNEXPECTED_RESPONSE,JSON.stringify(e.res));const i=JSON.parse(e.res.json_body);if(200!==i.code)throw mw.debug("[".concat(t.clientId,"] Get proxy server failed: response code [").concat(i.code,"], reason [").concat(i.reason,"]")),Yw("error",["AjaxAPI",t.clientId],"requestProxyServerList","Get proxy server failed: response code [".concat(i.code,"], reason [").concat(i.reason,"]")),new pw(hw.UNEXPECTED_RESPONSE,JSON.stringify(e.res));return mw.debug("[".concat(t.clientId,"] App return server length"),i.servers.length),Yw("debug",["AjaxAPI",t.clientId],"requestProxyServerList","",{length:i.servers.length}),!1}),(t=>t.code!==hw.OPERATION_ABORTED&&(Px.requestProxyAppCenter(o.sid,{lts:r,succ:!1,APAddr:e,workerManagerList:null,ec:t.code,response:t.message}),!0)),n)}(n,e,t,i),allFailedhandler:()=>{throw mw.error("[".concat(e.clientId,"] can not get proxy server after trying several times")),new pw(hw.CAN_NOT_GET_PROXY_SERVER)}});const a=JSON.parse(s.res.json_body).servers.map(dG);if("443only"===e.cloudProxyServer)return{addresses:a,serverResponse:{tcpport:443,udpport:Zw.udpport,username:Zw.username,password:Zw.password}};Px.requestProxyAppCenter(e.sid,{lts:n,succ:!0,APAddr:s.url,workerManagerList:JSON.stringify(a),ec:null,response:JSON.stringify(s.res)}),n=Date.now();const c=a.map((n=>function(e,t,i,n){const r=Date.now();let o=e;e.startsWith("http")||(o="https://".concat(e,":4000/v2/machine"));const s={command:"request",gatewayType:"http",appId:t.appId,cname:t.cname,uid:(t.uid||"").toString(),sdkVersion:"2.3.1",sid:t.sid,seq:1,ts:Date.now(),requestId:3,clientRequest:{appId:t.appId,cname:t.cname,uid:(t.uid||"").toString(),sid:t.sid}};return gw((async()=>({res:await Tx(o,{data:s,cancelToken:i}),url:e})),(e=>{if(!e.res.serverResponse)throw new pw(hw.UNEXPECTED_RESPONSE,"requeet worker manager server failed: serverResponse is undefined");return!1}),(t=>t.code!==hw.OPERATION_ABORTED&&(Px.requestProxyWorkerManager(s.sid,{lts:r,succ:!1,workerManagerAddr:e,ec:t.code,response:t.message}),!0)),n)}(n,e,t,i)));let A=null;try{A=await wG(c)}catch(t){throw mw.error("[".concat(e.clientId,"] can not get worker manager after trying several times")),new pw(hw.CAN_NOT_GET_PROXY_SERVER)}return c.forEach((e=>e.cancel())),Px.requestProxyWorkerManager(e.sid,{lts:n,succ:!0,workerManagerAddr:A.url,ec:null,response:JSON.stringify(A.res)}),{addresses:[A.url],serverResponse:A.res.serverResponse}}async function yW(e,t,i){const n=cb("PROXY_SERVER_TYPE3"),r=(e,t)=>{let i=n;return Array.isArray(i)&&(i=t%2==0?n[1]:n[0]),"https://".concat(i,"/ap/?url=").concat(e)},o=cb("WEBCS_DOMAIN").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map(((t,i)=>({url:"disabled"===e.cloudProxyServer||"fallback"===e.cloudProxyServer?"https://".concat(t,"/api/v2/transpond/webrtc?v=2"):r("".concat(t,"/api/v2/transpond/webrtc?v=2"),i),areaCode:fW(),serviceIds:[WV.CHOOSE_SERVER,"proxy5"===e.cloudProxyServer?WV.CLOUD_PROXY_5:"proxy3"===e.cloudProxyServer||"proxy4"===e.cloudProxyServer?WV.CLOUD_PROXY:WV.CLOUD_PROXY_FALLBACK]})));let s=null;const a=[],c=async()=>await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:o,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to choose_server:"),n.url),pW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:a}),A=async()=>{if(await SG(1e3),null!==s)return s;const n=cb("WEBCS_DOMAIN_BACKUP_LIST").map(((t,i)=>({url:"disabled"===e.cloudProxyServer||"fallback"===e.cloudProxyServer?"https://".concat(t,"/api/v2/transpond/webrtc?v=2"):r("".concat(t,"/api/v2/transpond/webrtc?v=2"),i),areaCode:fW(),serviceIds:[WV.CHOOSE_SERVER,"proxy5"===e.cloudProxyServer?WV.CLOUD_PROXY_5:"proxy3"===e.cloudProxyServer||"proxy4"===e.cloudProxyServer?WV.CLOUD_PROXY:WV.CLOUD_PROXY_FALLBACK]})));return await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:n,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] Connect to backup choose_server:"),n.url),pW(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:a})};let d,u,E;try{({gatewayInfo:d,proxyInfo:u,url:E}=await wG([c(),A()]))}catch(e){throw e[0]}if(a.length&&a.forEach((e=>e.cancel&&"function"==typeof e.cancel&&e.cancel())),!d||!u)throw new pw(hw.UNEXPECTED_ERROR,"missing gateway or proxy response").print();if(e.apUrl=E,"disabled"!==e.cloudProxyServer&&Array.isArray(n)&&E){const t=new UK(E).host;n.includes(t)&&(e.proxyServer=t,mw.setProxyServer(t),Px.setProxyServer(t),Qw(t))}return s={gatewayInfo:d,proxyInfo:await gG(u,d.uid)},s}async function DW(e,t,i,n){const r=cb("UAP_AP").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((e=>t.proxyServer?"https://".concat(t.proxyServer,"/ap/?url=").concat(e+"/api/v1?action=uap"):"https://".concat(e,"/api/v1?action=uap")));return await function(e,t,i,n,r){EW+=1;const o={sid:i.sid,command:"convergeAllocateEdge",uid:"666",appId:i.appId,ts:Math.floor(Date.now()/1e3),seq:EW,requestId:EW,version:Xw,cname:i.cname},s={service_name:t,json_body:JSON.stringify(o)};let a,c,A=e[0];return gw((async()=>{a=Date.now();const e=await Tx(A,{data:s,cancelToken:n,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"}});if(c=Date.now()-a,0!==e.code){const t=new pw(hw.UNEXPECTED_RESPONSE,"live streaming ap error, code"+e.code,{retry:!0,responseTime:c});throw mw.error(t.toString()),Yw("error",["AjaxAPI"],"requestLiveStreamingWorkerManager",void 0,t.toString()),t}const i=JSON.parse(e.json_body);if(200!==i.code){const e=new pw(hw.UNEXPECTED_RESPONSE,"live streaming app center error, code: ".concat(i.code,", reason: ").concat(i.reason),{code:i.code,responseTime:c});throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestLiveStreamingWorkerManager",void 0,e.toString()),e}if(!i.servers||0===i.servers.length){const e=new pw(hw.UNEXPECTED_RESPONSE,"live streaming app center empty server",{code:i.code,responseTime:c});throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestLiveStreamingWorkerManager",void 0,e.toString()),e}const r=function(e,t){return{addressList:e.servers.map((e=>"wss://".concat(e.address.replace(/\./g,"-"),".").concat(cb("WORKER_DOMAIN"),":").concat(e.wss,"?serviceName=").concat(encodeURIComponent(t)))),workerToken:e.workerToken,vid:e.vid}}(i,t);return cb("LIVE_STREAMING_ADDRESS")&&(r.addressList=cb("LIVE_STREAMING_ADDRESS")instanceof Array?cb("LIVE_STREAMING_ADDRESS"):[cb("LIVE_STREAMING_ADDRESS")]),uW(uW({},r),{},{responseTime:c})}),((n,r)=>(Px.apworkerEvent(i.sid,{success:!0,sc:200,serviceName:t,responseDetail:JSON.stringify(n.addressList),firstSuccess:0===r,responseTime:c,serverIp:e[r%e.length]}),!1)),((n,r)=>(Px.apworkerEvent(i.sid,{success:!1,sc:n.data&&n.data.code||200,serviceName:t,responseTime:c,serverIp:e[r%e.length]}),!!(n.code!==hw.OPERATION_ABORTED&&n.code!==hw.UNEXPECTED_RESPONSE||n.data&&n.data.retry)&&(A=e[(r+1)%e.length],!0))),r)}(r,e,t,i,n)}async function wW(e,t,i){let n=null;const r=[],o=async o=>{const s=cb(o?"WEBCS_DOMAIN_BACKUP_LIST":"WEBCS_DOMAIN").map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v2/transpond/webrtc?v=2"):"https://".concat(t,"/api/v2/transpond/webrtc?v=2")));return o&&(await SG(1e3),null!==n)?n:await HG({fragementLength:cb("FRAGEMENT_LENGTH"),referenceList:s,asyncMapHandler:n=>(mw.debug("[".concat(e.clientId,"] update ticket, Connect to ").concat(o?"backup":""," choose_server:"),n),function(e,t,i,n){const[r]=((e,t)=>{const i=Math.floor(Math.random()*10**12),n={appid:e.appId,client_ts:Date.now(),opid:i,sid:e.sid,request_bodies:[{uri:28,buffer:{cname:e.cname,detail:{1:"",6:e.stringUid,12:"1"},token:e.token,service_ids:t,uid:e.uid||0,edges_services:e.apResponse.addresses.map((e=>({ip:e.ip,port:e.port})))}}]},r=new FormData;return r.append("request",JSON.stringify(n)),[r,i]})(t,[WV.CHOOSE_SERVER]);let o=Sx.networkState;return gw((async()=>{o&&Sx.networkState===jP.OFFLINE&&Sx.onlineWaiter&&await Mm.race([Sx.onlineWaiter,SG(n&&n.maxRetryTimeout||_w.maxRetryTimeout)]),o=Sx.networkState;return((e,t)=>{if(e.response_body&&e.response_body.length){const t=e.response_body[0];if(0!==t.buffer.code){const e=VK(t.buffer.code);throw new pw(hw.UPDATE_TICKET_FAILED,"[".concat(t.buffer.code,"]: ").concat(e.desc),{retry:e.retry})}return t.buffer.ticket}throw mw.debug("update ticket request received ap response without response body:",t),xw("debug",["AjaxAPI"],"update ticket request received ap response without response body: ".concat(t)),new pw(hw.UPDATE_TICKET_FAILED,"cannot find response body from ap response",{retry:!1})})(await Tx(e,{data:r,cancelToken:i,headers:{"Content-Type":"multipart/form-data;"}},!0),e)}),(()=>!1),(e=>e.code!==hw.OPERATION_ABORTED&&(e.code===hw.UPDATE_TICKET_FAILED?e.data.retry:(mw.warning("[".concat(t.clientId,"] update ticket network error, retry"),e),xw("warning",["AjaxAPI",t.clientId],"update ticket network error, retry, ".concat(e)),!0))),n)}(n,e,t,i)),allFailedhandler:e=>{throw e[0]},promisesCollector:r})};try{return n=await wG([o(!1),o(!0)]),r.length&&r.forEach((e=>e.cancel&&"function"==typeof e.cancel&&e.cancel())),n}catch(e){throw e[0]}}var bW;function LW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function PW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?LW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):LW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let kW=Ww("ConfigDistributeManager")(bW=class extends Ew{constructor(){super(),tD(this,"configs",void 0),tD(this,"joinInfo",void 0),tD(this,"cancelToken",void 0),tD(this,"retryConfig",{timeout:3e3,timeoutFactor:1.5,maxRetryCount:1,maxRetryTimeout:1e4}),tD(this,"interval",void 0),tD(this,"mutex",new Qx("config-distribute")),tD(this,"mutableParamsRead",!1)}startGetConfigDistribute(e,t){this.joinInfo=e,this.cancelToken=t,this.interval&&this.stopGetConfigDistribute(),this.updateConfigDistribute(),this.interval=window.setInterval((()=>{this.updateConfigDistribute()}),cb("CONFIG_DISTRIBUTE_INTERVAL"))}stopGetConfigDistribute(){this.interval&&clearInterval(this.interval),this.interval=void 0,this.joinInfo=void 0,this.cancelToken=void 0}async awaitConfigDistributeComplete(){this.mutex.isLocked&&(await this.mutex.lock())()}async updateConfigDistribute(){if(this.mutableParamsRead||(this.mutableParamsRead=!0,Px.reportApiInvoke(null,{options:void 0,name:wL.LOAD_CONFIG_FROM_LOCALSTORAGE,tag:bL.TRACER}).onSuccess(JSON.stringify(db))),!this.joinInfo||!this.cancelToken||!this.retryConfig)return mw.debug("[config-distribute] get config distribute interrupted have no joininfo"),void Yw("debug",this,"updateConfigDistribute",void 0,"get config distribute interrupted have no joininfo");let e;const t=await this.mutex.lock();try{e=await async function(e,t,i){const n=cb("CDS_AP").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v1"):"https://".concat(t,"/api/v1?action=config"))).map((n=>function(e,t,i,n){const r=Dy(),o={flag:64,cipher_method:0,features:{device:r.name,system:r.os,system_general:navigator.userAgent,vendor:t.appId,version:Xw,cname:t.cname,sid:t.sid,session_id:t.sid,detail:"",proxyServer:t.proxyServer}};return gw((()=>Tx(e,{data:o,timeout:1e3,cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":54}})),void 0,(e=>e.code!==hw.OPERATION_ABORTED),n)}(n,e,t,i)));let r=null,o=null,s={};try{r=await wG(n)}catch(e){if(e.code===hw.OPERATION_ABORTED)throw e;o=e}if(n.forEach((e=>e.cancel())),Px.reportApiInvoke(e.sid,{name:wL.REQUEST_CONFIG_DISTRIBUTE,options:{error:o,res:r}}).onSuccess(),r&&r.test_tags)try{s=function(e){if(!e.test_tags)return{};const t=e.test_tags,i=Object.keys(t),n={};return i.forEach((e=>{var i;const r=ly(i=e.slice(4)).call(i),o=JSON.parse(t[e])[1];n[r]=o})),n}(r)}catch(e){}return s}(this.joinInfo,this.cancelToken,this.retryConfig),mw.debug("[config-distribute] get config distribute",JSON.stringify(e)),Yw("debug",this,"updateConfigDistribute",e),e.limit_bitrate&&this.handleBitrateLimit(e.limit_bitrate),this.cacheGlobalParameterConfig(e),this.configs=e}catch(e){const t=new pw(hw.NETWORK_RESPONSE_ERROR,e);mw.warning("[config-distribute] ".concat(t.toString())),Yw("warning",this,"updateConfigDistribute",void 0,e.toString())}finally{t()}}getBitrateLimit(){return this.configs?this.configs.limit_bitrate:void 0}handleBitrateLimit(e){var t;(t=e)&&t.uplink&&t.id&&void 0!==t.uplink.max_bitrate&&void 0!==t.uplink.min_bitrate&&(this.configs&&this.configs.limit_bitrate?this.configs&&this.configs.limit_bitrate&&this.configs.limit_bitrate.id!==e.id&&this.emit(BP.UPDATE_BITRATE_LIMIT,e):this.emit(BP.UPDATE_BITRATE_LIMIT,e))}getLowStreamConfigDistribute(){return this.configs&&this.configs.limit_bitrate&&PW({},this.configs.limit_bitrate.low_stream_uplink)}cacheGlobalParameterConfig(e){var t;const i=AL(t=Object.keys(e).filter((e=>/^webrtc_ng_global_parameter/.test(e)))).call(t);for(let t=0;t<i.length;t++)for(let n=i.length-1;n>t;n--){const t=i[n];if("number"==typeof e[t].__priority){const r=e[t].__priority,o=i[n-1];if("number"==typeof e[o].__priority){if(!(r>e[o].__priority))continue;{const e=t;i[n]=i[n-1],i[n-1]=e}}else{const e=t;i[n]=i[n-1],i[n-1]=e}}}const n={};i.forEach((t=>{const i=e[t],r=i.__expires;Object.keys(i).forEach((e=>{"__priority"===e||"__expires"===e||Object.prototype.hasOwnProperty.call(n,e)||(n[e]=PW({value:i[e]},r&&{expires:r}))}))}));try{const e=JSON.stringify(n),t=window.btoa(e);window.localStorage.setItem("websdk_ng_global_parameter",t),mw.debug("Caching global parameters ".concat(e)),Yw("debug",this,"cacheGlobalParameterConfig",e)}catch(e){mw.error("Error caching global parameters:",e.message),Yw("error",this,"cacheGlobalParameterConfig",void 0,e.message)}}})||bW;function MW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function UW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?MW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):MW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class BW extends Ew{constructor(e,t,i,n){super(),tD(this,"spec",void 0),tD(this,"token",void 0),tD(this,"websocket",void 0),tD(this,"pingpongTimer",void 0),tD(this,"reconnectMode","retry"),tD(this,"serviceMode",void 0),tD(this,"reqId",0),tD(this,"commandReqId",0),tD(this,"handleWebSocketOpen",(()=>{this.reconnectMode="retry",this.startPingPong()})),tD(this,"handleWebSocketMessage",(e=>{if(!e.data)return;const t=JSON.parse(e.data);t.requestId?this.emit("@".concat(t.requestId,"-").concat(t.sid),t):this.serviceMode===aP.INJECT?this.emit(hP.INJECT_STREAM_STATUS,t):(Px.workerEvent(this.spec.sid,{actionType:"status",serverCode:t.code,workerType:this.serviceMode===aP.TRANSCODE?1:2}),this.emit(hP.PUBLISH_STREAM_STATUS,t))})),this.spec=t,this.token=e,this.serviceMode=n,this.websocket=new tW("live-streaming",i),this.websocket.on(sP.CONNECTED,this.handleWebSocketOpen),this.websocket.on(sP.ON_MESSAGE,this.handleWebSocketMessage),this.websocket.on(sP.REQUEST_NEW_URLS,((e,t)=>{bG(this,hP.REQUEST_NEW_ADDRESS).then(e).catch(t)})),this.websocket.on(sP.RECONNECTING,(()=>{this.websocket.reconnectMode=this.reconnectMode}))}init(e){return this.websocket.init(e)}async request(e,t,i,n){this.reqId+=1,"request"===e&&(this.commandReqId+=1);const r=this.commandReqId,o=this.reqId;if(!o||!this.websocket)throw new pw(hw.UNEXPECTED_ERROR);const s=UW({command:e,sdkVersion:"4.11.0"===Xw?"0.0.1":Xw,seq:o,requestId:o,allocate:i,cname:this.spec.cname,appId:this.spec.appId,sid:this.spec.sid,uid:this.spec.uid.toString(),ts:Math.floor(Date.now()/1e3)},t);if("closed"===this.websocket.state)throw new pw(hw.WS_DISCONNECT);const a=()=>new Mm(((e,t)=>{this.websocket.once(sP.CLOSED,(()=>t(new pw(hw.WS_ABORT)))),this.websocket.once(sP.CONNECTED,e)}));"connected"!==this.websocket.state&&await a(),s.clientRequest&&(s.clientRequest.workerToken=this.token);const c=new Mm(((e,t)=>{const i=()=>{t(new pw(hw.WS_ABORT))};this.websocket.once(sP.RECONNECTING,i),this.websocket.once(sP.CLOSED,i),this.once("@".concat(o,"-").concat(this.spec.sid),(t=>{e(t)}))}));n&&Px.workerEvent(this.spec.sid,UW(UW({},n),{},{requestId:r,actionType:"request",payload:JSON.stringify(t.clientRequest),serverCode:0,code:0}));const A=Date.now();this.websocket.sendMessage(s);let d=null;try{d=await c}catch(n){if("closed"===this.websocket.state)throw n;return await a(),await this.request(e,t,i)}return n&&Px.workerEvent(this.spec.sid,UW(UW({},n),{},{requestId:r,actionType:"response",payload:JSON.stringify(d.serverResponse),serverCode:d.code,success:200===d.code,responseTime:Date.now()-A})),200!==d.code&&this.handleResponseError(d),d}tryNextAddress(){this.reconnectMode="tryNext",this.websocket.reconnect("tryNext")}close(){const e="4.11.0"===Xw?"0.0.1":Xw;this.reqId+=1,"connected"===this.websocket.state?(this.websocket.sendMessage({command:"request",appId:this.spec.appId,cname:this.spec.cname,uid:this.spec.uid.toString(),sdkVersion:e,sid:this.spec.sid,seq:this.reqId,ts:Math.floor(Date.now()/1e3),requestId:this.reqId,clientRequest:{command:"DestroyWorker"}}),this.websocket.close(!1,!0)):this.websocket.close(!1),this.pingpongTimer&&(window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0)}handleResponseError(e){switch(e.code){case _P.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM:return void mw.warning("live stream response already exists stream");case _P.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR:case _P.LIVE_STREAM_RESPONSE_BAD_STREAM:case _P.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR:return new pw(hw.LIVE_STREAMING_INVALID_ARGUMENT,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST:if("UnpublishStream"===e.serverResponse.command||"UninjectStream"===e.serverResponse.command)return;throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case _P.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED:return new pw(hw.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{const t=new pw(hw.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE);return this.emit(hP.WARNING,t,e.serverResponse.url)}case _P.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN:{const t=new pw(hw.LIVE_STREAMING_WARN_FREQUENT_REQUEST);return this.emit(hP.WARNING,t,e.serverResponse.url)}case _P.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH:throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case _P.LIVE_STREAM_RESPONSE_NOT_SUPPORTED:return new pw(hw.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM:{const t=new pw(hw.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT);return this.emit(hP.WARNING,t,e.serverResponse.url)}case _P.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR:return new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:e.code}).throw();case _P.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT:throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream resource limit",{retry:!0,changeAddress:!0});case _P.LIVE_STREAM_RESPONSE_WORKER_LOST:case _P.LIVE_STREAM_RESPONSE_WORKER_QUIT:if("UnpublishStream"===e.serverResponse.command||"UninjectStream"===e.serverResponse.command)return;throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case _P.ERROR_FAIL_SEND_MESSAGE:if("UnpublishStream"===e.serverResponse.command||"UninjectStream"===e.serverResponse.command)return;if("UpdateTranscoding"===e.serverResponse.command||"ControlStream"===e.serverResponse.command)return new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{code:e.code}).throw();throw new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case _P.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:return new pw(hw.LIVE_STREAMING_CDN_ERROR,"",{code:e.code}).throw()}}startPingPong(){this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval((()=>{"connected"===this.websocket.state&&this.request("ping",{}).catch(yG)}),6e3)}}function VW(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function QW(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?VW(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):VW(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class xW extends Ew{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_w,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_w;super(),tD(this,"onLiveStreamWarning",void 0),tD(this,"onLiveStreamError",void 0),tD(this,"onInjectStatusChange",void 0),tD(this,"spec",void 0),tD(this,"retryTimeout",1e4),tD(this,"connection",void 0),tD(this,"httpRetryConfig",void 0),tD(this,"wsRetryConfig",void 0),tD(this,"streamingTasks",new Map),tD(this,"isStartingStreamingTask",!1),tD(this,"taskMutex",new Qx("live-streaming")),tD(this,"cancelToken",dw.CancelToken.source()),tD(this,"transcodingConfig",void 0),tD(this,"injectConfig",QW({},lP)),tD(this,"injectLoopTimes",0),tD(this,"uapResponse",void 0),tD(this,"lastTaskId",1),tD(this,"statusError",new Map),this.spec=e,this.httpRetryConfig=i,this.wsRetryConfig=t}async setTranscodingConfig(e){const t=QW(QW({},EP),e);66!==t.videoCodecProfile&&77!==t.videoCodecProfile&&100!==t.videoCodecProfile&&(mw.debug("[".concat(this.spec.clientId,"] set transcoding config, fix video codec profile: ").concat(t.videoCodecProfile," -> 100")),t.videoCodecProfile=100),t.transcodingUsers||(t.transcodingUsers=t.userConfigs),t.transcodingUsers&&(t.transcodingUsers=t.transcodingUsers.map((e=>QW(QW(QW({},AP),e),{},{zOrder:e.zOrder?e.zOrder+1:1})))),function(e){IL(e.width)||EL(e.width,"config.width",0,1e4),IL(e.height)||EL(e.height,"config.height",0,1e4),IL(e.videoBitrate)||EL(e.videoBitrate,"config.videoBitrate",1,1e6),IL(e.videoFrameRate)||EL(e.videoFrameRate,"config.videoFrameRate"),IL(e.lowLatency)||dL(e.lowLatency,"config.lowLatency"),IL(e.audioSampleRate)||uL(e.audioSampleRate,"config.audioSampleRate",[32e3,44100,48e3]),IL(e.audioBitrate)||EL(e.audioBitrate,"config.audioBitrate",1,128),IL(e.audioChannels)||uL(e.audioChannels,"config.audioChannels",[1,2,3,4,5]),IL(e.videoGop)||EL(e.videoGop,"config.videoGop"),IL(e.videoCodecProfile)||uL(e.videoCodecProfile,"config.videoCodecProfile",[66,77,100]),IL(e.userCount)||EL(e.userCount,"config.userCount",0,17),IL(e.backgroundColor)||EL(e.backgroundColor,"config.backgroundColor",0,16777215),IL(e.userConfigExtraInfo)||lL(e.userConfigExtraInfo,"config.userConfigExtraInfo",0,4096,!1),e.transcodingUsers&&!IL(e.transcodingUsers)&&(hL(e.transcodingUsers,"config.transcodingUsers"),e.transcodingUsers.forEach(((e,t)=>{_L(e.uid),IL(e.x)||EL(e.x,"transcodingUser[".concat(t,"].x"),0,1e4),IL(e.y)||EL(e.y,"transcodingUser[".concat(t,"].y"),0,1e4),IL(e.width)||EL(e.width,"transcodingUser[".concat(t,"].width"),0,1e4),IL(e.height)||EL(e.height,"transcodingUser[".concat(t,"].height"),0,1e4),IL(e.zOrder)||EL(e.zOrder-1,"transcodingUser[".concat(t,"].zOrder"),0,100),IL(e.alpha)||EL(e.alpha,"transcodingUser[".concat(t,"].alpha"),0,1,!1)}))),IL(e.watermark)||uP(e.watermark,"watermark"),IL(e.backgroundImage)||uP(e.backgroundImage,"backgroundImage"),e.images&&!IL(e.images)&&(hL(e.images,"config.images"),e.images.forEach(((e,t)=>{uP(e,"images[".concat(t,"]"))})))}(t);const i=[];t.images&&i.push(...t.images.map((e=>QW(QW(QW({},dP),e),{},{zOrder:255})))),t.backgroundImage&&(i.push(QW(QW(QW({},dP),t.backgroundImage),{},{zOrder:0})),delete t.backgroundImage),t.watermark&&(i.push(QW(QW(QW({},dP),t.watermark),{},{zOrder:255})),delete t.watermark),t.images=i,t.transcodingUsers&&(t.userConfigs=t.transcodingUsers.map((e=>QW({},e))),t.userCount=t.transcodingUsers.length,delete t.transcodingUsers);const n=(t.userConfigs||[]).map((e=>"number"==typeof e.uid?Mm.resolve(e.uid):vW(e.uid,this.spec,this.cancelToken.token,this.httpRetryConfig)));if((await Mm.all(n)).forEach(((e,i)=>{t.userConfigs&&t.userConfigs[i]&&(t.userConfigs[i].uid=e)})),this.transcodingConfig=t,this.connection)try{var r;const e=await this.connection.request("request",{clientRequest:{command:"UpdateTranscoding",transcodingConfig:this.transcodingConfig}},!1,{command:"UpdateTranscoding",workerType:1,requestByUser:!0,tid:Array.from(Ax(r=this.streamingTasks).call(r)).map((e=>e.taskId)).join("#")});mw.debug("[".concat(this.spec.clientId,"] update live transcoding config success, code: ").concat(e.code,", config:"),JSON.stringify(this.transcodingConfig))}catch(e){if(!e.data||!e.data.retry)throw e;e.data.changeAddress&&this.connection.tryNextAddress(),this.streamingTasks.forEach((t=>{mw.warning("[".concat(this.spec.clientId,"] live streaming receive error"),e.toString(),"try to republish",t.url),this.startLiveStreamingTask(t.url,t.mode,e).then((()=>{mw.debug("[".concat(this.spec.clientId,"] live streaming republish ").concat(t.url," success"))})).catch((e=>{mw.error("[".concat(this.spec.clientId,"] live streaming republish failed"),t.url,e.toString()),this.onLiveStreamError&&this.onLiveStreamError(t.url,e)}))}))}}setInjectStreamConfig(e,t){this.injectConfig=Object.assign({},this.injectConfig,e),this.injectLoopTimes=t}async startLiveStreamingTask(e,t,i){var n;if(Array.from(Ax(n=this.streamingTasks).call(n)).find((e=>e.mode===aP.INJECT))&&t===aP.INJECT)return new pw(hw.LIVE_STREAMING_TASK_CONFLICT,"inject stream over limit").throw();if(!this.transcodingConfig&&t===aP.TRANSCODE)throw new pw(hw.INVALID_OPERATION,"[LiveStreaming] no transcoding config found, can not start transcoding streaming task");let r={command:"PublishStream",ts:Date.now(),url:e,uid:this.spec.uid.toString(),autoDestroyTime:100,acceptImageTimeout:!0};mw.debug("[".concat(this.spec.clientId,"] start live streaming ").concat(e,", mode: ").concat(t));const o=await this.taskMutex.lock();if(!this.connection&&i)return void o();if(this.streamingTasks.get(e)&&!i)return o(),new pw(hw.LIVE_STREAMING_TASK_CONFLICT).throw();try{this.connection||(this.connection=await this.connect(t))}catch(e){throw o(),e}switch(t){case aP.TRANSCODE:r.transcodingConfig=QW({},this.transcodingConfig);break;case aP.RAW:break;case aP.INJECT:r={cname:this.spec.cname,command:"InjectStream",sid:this.spec.sid,transcodingConfig:this.injectConfig,ts:Date.now(),url:e,loopTimes:this.injectLoopTimes}}this.uapResponse&&this.uapResponse.vid&&(r.vid=this.uapResponse.vid),this.isStartingStreamingTask=!0;const s=this.lastTaskId++;try{const n=new Mm(((t,n)=>{SG(this.retryTimeout).then((()=>{if(i)return n(i);const t=this.statusError.get(e);return t?(this.statusError.delete(e),n(t)):void 0}))})),a=await Mm.race([this.connection.request("request",{clientRequest:r},!0,{url:e,command:"PublishStream",workerType:t===aP.TRANSCODE?1:2,requestByUser:!i,tid:s.toString()}),n]);this.isStartingStreamingTask=!1,mw.debug("[".concat(this.spec.clientId,"] live streaming started, code: ").concat(a.code)),this.streamingTasks.set(e,{clientRequest:r,mode:t,url:e,taskId:s}),o()}catch(n){if(o(),this.isStartingStreamingTask=!1,!n.data||!n.data.retry||i)throw n;return n.data.changeAddress?(this.connection.tryNextAddress(),await this.startLiveStreamingTask(e,t,n)):await this.startLiveStreamingTask(e,t,n)}}stopLiveStreamingTask(e){return new Mm(((t,i)=>{const n=this.streamingTasks.get(e);if(!n||!this.connection)return new pw(hw.UNEXPECTED_ERROR,"can not find streaming task to stop").throw();const r=n.mode;n.abortTask=()=>{mw.debug("[".concat(this.spec.clientId,"] stop live streaming success(worker exception)")),this.streamingTasks.delete(e),t()},this.connection.request("request",{clientRequest:{command:r===aP.INJECT?"UninjectStream":"UnpublishStream",url:n.url}},!1,{url:e,command:"UnPublishStream",workerType:r===aP.TRANSCODE?1:2,requestByUser:!0,tid:(this.lastTaskId++).toString()}).then((i=>{mw.debug("[".concat(this.spec.clientId,"] stop live streaming success, code: ").concat(i.code)),this.streamingTasks.delete(e),0===this.streamingTasks.size&&r!==aP.INJECT&&(this.connection&&this.connection.close(),this.connection=void 0),t(),r===aP.INJECT&&this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_STOP_SUCCESS,this.spec.uid,e)})).catch(i)}))}async controlInjectStream(e,t,i,n){const r=this.streamingTasks.get(e);if(!r||!this.connection||r.mode!==aP.INJECT)throw new pw(hw.INVALID_OPERATION,"can not find inject stream task to control");return(await this.connection.request("request",{clientRequest:{command:"ControlStream",url:e,control:t,audioVolume:i,position:n}})).serverResponse}resetAllTask(){var e;const t=Array.from(Ax(e=this.streamingTasks).call(e));this.terminate();for(const e of t)this.startLiveStreamingTask(e.url,e.mode).catch((t=>{this.onLiveStreamError&&this.onLiveStreamError(e.url,t)}))}terminate(){this.cancelToken&&this.cancelToken.cancel(),this.streamingTasks=new Map,this.isStartingStreamingTask=!1,this.statusError=new Map,this.cancelToken=dw.CancelToken.source(),this.uapResponse=void 0,this.connection&&this.connection.close(),this.connection=void 0}async connect(e){if(this.connection)throw new pw(hw.UNEXPECTED_ERROR,"live streaming connection has already connected");const t=await bG(this,pP.REQUEST_WORKER_MANAGER_LIST,e);return this.uapResponse=t,this.connection=new BW(t.workerToken,this.spec,this.wsRetryConfig,e),this.connection.on(hP.WARNING,((e,t)=>this.onLiveStreamWarning&&this.onLiveStreamWarning(t,e))),this.connection.on(hP.PUBLISH_STREAM_STATUS,(e=>this.handlePublishStreamServer(e))),this.connection.on(hP.INJECT_STREAM_STATUS,(e=>this.handleInjectStreamServerStatus(e))),this.connection.on(hP.REQUEST_NEW_ADDRESS,((t,i)=>{if(!this.connection)return i(new pw(hw.UNEXPECTED_ERROR,"can not get new live streaming address list"));bG(this,pP.REQUEST_WORKER_MANAGER_LIST,e).then((e=>{this.uapResponse=e,t(e.addressList)})).catch(i)})),await this.connection.init(t.addressList),this.connection}handlePublishStreamServer(e){const t=e.serverStatus&&e.serverStatus.url||"empty_url",i=this.streamingTasks.get(t),n=e.reason;switch(e.code){case _P.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case _P.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:{const n=new pw(hw.LIVE_STREAMING_CDN_ERROR,"",{code:e.code});if(i)return mw.error(n.toString()),this.onLiveStreamError&&this.onLiveStreamError(t,n);if(!this.isStartingStreamingTask)return;this.statusError.set(t,n)}case _P.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{const e=new pw(hw.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE,n);return this.onLiveStreamWarning&&this.onLiveStreamWarning(t,e)}case _P.LIVE_STREAM_RESPONSE_WORKER_LOST:case _P.LIVE_STREAM_RESPONSE_WORKER_QUIT:{var r;if(!this.connection)return;this.connection.tryNextAddress();const t=Array.from(Ax(r=this.streamingTasks).call(r));for(const i of t)i.abortTask?i.abortTask():(mw.warning("[".concat(this.spec.clientId,"] publish stream status code"),e.code,"try to republish",i.url),this.startLiveStreamingTask(i.url,i.mode,new pw(hw.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:e.code})).then((()=>{mw.debug("[".concat(this.spec.clientId,"] republish live stream success"),i.url)})).catch((e=>{mw.error(e.toString()),this.onLiveStreamError&&this.onLiveStreamError(i.url,e)})));return}}}handleInjectStreamServerStatus(e){const t=Number(e.uid),i=e.serverStatus&&e.serverStatus.url;switch(e.code){case 200:return void(this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_SUCCESS,t,i));case 451:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_ALREADY_EXISTS,t,i),void this.streamingTasks.delete(i);case 453:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_UNAUTHORIZED,t,i),void this.streamingTasks.delete(i);case 470:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_BROKEN,t,i),void this.streamingTasks.delete(i);case 499:return this.onInjectStatusChange&&this.onInjectStatusChange(cP.INJECT_STREAM_STATUS_START_TIMEOUT,t,i),void this.streamingTasks.delete(i);default:return void mw.debug("inject stream server status",e)}}hasUrl(e){return this.streamingTasks.has(e)}}class FW{constructor(){tD(this,"destChannelMediaInfos",new Map),tD(this,"srcChannelMediaInfo",void 0)}setSrcChannelInfo(e){LP(e),this.srcChannelMediaInfo=e}addDestChannelInfo(e){LP(e),this.destChannelMediaInfos.set(e.channelName,e)}removeDestChannelInfo(e){pL(e),this.destChannelMediaInfos.delete(e)}getSrcChannelMediaInfo(){return this.srcChannelMediaInfo}getDestChannelMediaInfo(){return this.destChannelMediaInfos}}function GW(e){if(!(e instanceof FW))return new pw(hw.INVALID_PARAMS,"Config should be instance of [ChannelMediaRelayConfiguration]").throw();const t=e.getSrcChannelMediaInfo(),i=e.getDestChannelMediaInfo();return t?0===i.size?new pw(hw.INVALID_PARAMS,"destChannelMediaInfo should not be empty").throw():void 0:new pw(hw.INVALID_PARAMS,"srcChannelMediaInfo should not be empty").throw()}class jW extends Ew{constructor(e,t,i){super(),tD(this,"ws",void 0),tD(this,"requestId",1),tD(this,"heartBeatTimer",void 0),tD(this,"joinInfo",void 0),tD(this,"clientId",void 0),tD(this,"onOpen",(()=>{this.emit("open"),this.startHeartBeatCheck()})),tD(this,"onClose",(e=>{this.emit("close"),this.dispose()})),tD(this,"onMessage",(e=>{const t=JSON.parse(e.data);if(!t||"serverResponse"!==t.command||!t.requestId)return t&&"serverStatus"===t.command&&t.serverStatus&&t.serverStatus.command?(this.emit("status",t.serverStatus),void this.emit(t.serverStatus.command,t.serverStatus)):void 0;this.emit("req_".concat(t.requestId),t)})),this.joinInfo=e,this.clientId=t,this.ws=new tW("cross-channel-".concat(this.clientId),i),this.ws.on(sP.RECONNECTING,(()=>{this.ws.reconnectMode="retry",this.emit("reconnecting")})),this.ws.on(sP.CONNECTED,this.onOpen),this.ws.on(sP.ON_MESSAGE,this.onMessage),this.ws.on(sP.CLOSED,this.onClose)}isConnect(){return"connected"===this.ws.state}sendMessage(e){const t=this.requestId++;return e.requestId=t,e.seq=t,this.ws.sendMessage(e),t}waitStatus(e){return new Mm(((t,i)=>{const n=window.setTimeout((()=>{i(new pw(hw.TIMEOUT,"wait status timeout, status: ".concat(e)))}),5e3);this.once(e,(r=>{window.clearTimeout(n),r.state&&0!==r.state?i(new pw(hw.CROSS_CHANNEL_WAIT_STATUS_ERROR,"wait status error, status: ".concat(e))):t(void 0)})),this.once("dispose",(()=>{window.clearTimeout(n),i(new pw(hw.WS_ABORT))}))}))}async request(e){if("closed"===this.ws.state)throw new pw(hw.WS_DISCONNECT);"connected"!==this.ws.state&&await(()=>new Mm(((e,t)=>{this.ws.once(sP.CLOSED,(()=>t(new pw(hw.WS_ABORT)))),this.ws.once(sP.CONNECTED,e)})))();const t=this.sendMessage(e),i=new Mm(((e,i)=>{const n=()=>{i(new pw(hw.WS_ABORT))};this.ws.once(sP.RECONNECTING,n),this.ws.once(sP.CLOSED,n),this.once("req_".concat(t),e),SG(3e3).then((()=>{this.removeAllListeners("req_".concat(t)),this.ws.off(sP.RECONNECTING,n),this.ws.off(sP.CLOSED,n),i(new pw(hw.TIMEOUT,"cross channel ws request timeout"))}))})),n=await i;if(!n||200!==n.code)throw new pw(hw.CROSS_CHANNEL_SERVER_ERROR_RESPONSE,"response: ".concat(JSON.stringify(n)));return n}async connect(e){this.ws.removeAllListeners(sP.REQUEST_NEW_URLS),this.ws.on(sP.REQUEST_NEW_URLS,(t=>{t(e)})),await this.ws.init(e)}dispose(){this.clearHeartBeatCheck(),this.emit("dispose"),this.removeAllListeners(),this.ws.close()}sendPing(e){const t=this.requestId++;return e.requestId=t,this.ws.sendMessage(e),t}startHeartBeatCheck(){this.heartBeatTimer=window.setInterval((()=>{this.sendPing({command:"ping",appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sid:this.joinInfo.sid,ts:+new Date,requestId:0})}),3e3)}clearHeartBeatCheck(){window.clearInterval(this.heartBeatTimer),this.heartBeatTimer=void 0}}class YW extends Ew{set state(e){e!==this._state&&(e!==RP.RELAY_STATE_FAILURE&&(this.errorCode=CP.RELAY_OK),this.emit("state",e,this.errorCode),this._state=e)}get state(){return this._state}constructor(e,t,i,n){super(),tD(this,"joinInfo",void 0),tD(this,"clientId",void 0),tD(this,"cancelToken",dw.CancelToken.source()),tD(this,"workerToken",void 0),tD(this,"requestId",0),tD(this,"signal",void 0),tD(this,"prevChannelMediaConfig",void 0),tD(this,"httpRetryConfig",void 0),tD(this,"_state",RP.RELAY_STATE_IDLE),tD(this,"errorCode",CP.RELAY_OK),tD(this,"onStatus",(e=>{mw.debug("[".concat(this.clientId,"] ChannelMediaStatus: ").concat(JSON.stringify(e))),e&&e.command&&("onAudioPacketReceived"===e.command&&this.emit("event",fP.PACKET_RECEIVED_AUDIO_FROM_SRC),"onVideoPacketReceived"===e.command&&this.emit("event",fP.PACKET_RECEIVED_VIDEO_FROM_SRC),"onSrcTokenPrivilegeDidExpire"===e.command&&(this.errorCode=CP.SRC_TOKEN_EXPIRED,this.state=RP.RELAY_STATE_FAILURE),"onDestTokenPrivilegeDidExpire"===e.command&&(this.errorCode=CP.DEST_TOKEN_EXPIRED,this.state=RP.RELAY_STATE_FAILURE))})),tD(this,"onReconnect",(async()=>{mw.debug("[".concat(this.clientId,"] ChannelMediaSocket disconnect, reconnecting")),this.emit("event",fP.NETWORK_DISCONNECTED),this.state=RP.RELAY_STATE_IDLE,this.prevChannelMediaConfig&&this.sendStartRelayMessage(this.prevChannelMediaConfig).catch((e=>{this.state!==RP.RELAY_STATE_IDLE&&(mw.error("auto restart channel media relay failed",e.toString()),this.errorCode=CP.SERVER_CONNECTION_LOST,this.state=RP.RELAY_STATE_FAILURE)}))})),this.joinInfo=e,this.clientId=t,this.signal=new jW(this.joinInfo,this.clientId,i),this.httpRetryConfig=n}async startChannelMediaRelay(e){if(this.state!==RP.RELAY_STATE_IDLE)throw new pw(hw.INVALID_OPERATION);this.state=RP.RELAY_STATE_CONNECTING,await this.connect(),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: connect success"));try{await this.sendStartRelayMessage(e)}catch(e){if(e.data&&e.data.serverResponse&&"SetSourceChannel"===e.data.serverResponse.command)throw new pw(hw.CROSS_CHANNEL_FAILED_JOIN_SRC);if(e.data&&e.data.serverResponse&&"SetDestChannelStatus"===e.serverResponse.command)throw new pw(hw.CROSS_CHANNEL_FAILED_JOIN_DEST);if(e.data&&e.data.serverResponse&&"StartPacketTransfer"===e.serverResponse.command)throw new pw(hw.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST);throw e}this.prevChannelMediaConfig=e}async updateChannelMediaRelay(e){if(this.state!==RP.RELAY_STATE_RUNNING)throw new pw(hw.INVALID_OPERATION);await this.sendUpdateMessage(e),this.prevChannelMediaConfig=e}async stopChannelMediaRelay(){await this.sendStopRelayMessage(),mw.debug("[".concat(this.clientId,"] stopChannelMediaRelay: send stop message success")),this.state=RP.RELAY_STATE_IDLE,this.dispose()}dispose(){mw.debug("[".concat(this.clientId,"] disposeChannelMediaRelay")),this.cancelToken.cancel(),this.cancelToken=dw.CancelToken.source(),this.state=RP.RELAY_STATE_IDLE,this.emit("dispose"),this.signal.dispose(),this.prevChannelMediaConfig=void 0}async connect(){const e=await async function(e,t,i){const n=cb("UAP_AP").slice(0,cb("AJAX_REQUEST_CONCURRENT")).map((t=>e.proxyServer?"https://".concat(e.proxyServer,"/ap/?url=").concat(t+"/api/v1?action=uap"):"https://".concat(t,"/api/v1?action=uap"))).map((n=>function(e,t,i,n){const r={command:"convergeAllocateEdge",sid:t.sid,appId:t.appId,token:t.token,ts:Date.now(),version:Xw,cname:t.cname,uid:t.uid.toString(),requestId:lW,seq:lW};lW+=1;const o={service_name:"tele_channel",json_body:JSON.stringify(r)};return gw((async()=>{const t=await Tx(e,{data:o,cancelToken:i,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":61}});if(0!==t.code){const e=new pw(hw.UNEXPECTED_RESPONSE,"cross channel ap error, code"+t.code,{retry:!0});throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestChannelMediaRelayWorkerManager",void 0,e.toString()),e}const n=JSON.parse(t.json_body);if(200!==n.code){const e=new pw(hw.UNEXPECTED_RESPONSE,"cross channel app center error, code: ".concat(n.code,", reason: ").concat(n.reason));throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestChannelMediaRelayWorkerManager",void 0,e.toString()),e}if(!n.servers||0===n.servers.length){const e=new pw(hw.UNEXPECTED_RESPONSE,"cross channel app center empty server");throw mw.error(e.toString()),Yw("error",["AjaxAPI"],"requestChannelMediaRelayWorkerManager",void 0,e.toString()),e}return{vid:n.vid,workerToken:n.workerToken,addressList:n.servers.map((e=>"wss://".concat(e.address.replace(/\./g,"-"),".").concat(cb("WORKER_DOMAIN"),":").concat(e.wss)))}}),void 0,(e=>!!(e.code!==hw.OPERATION_ABORTED&&e.code!==hw.UNEXPECTED_RESPONSE||e.data&&e.data.retry)),n)}(n,e,t,i)));try{const e=await wG(n);return n.forEach((e=>e.cancel())),e}catch(e){throw e[0]}}(this.joinInfo,this.cancelToken.token,this.httpRetryConfig);this.workerToken=e.workerToken,await this.signal.connect(e.addressList),this.emit("event",fP.NETWORK_CONNECTED),this.signal.on("status",this.onStatus),this.signal.on("reconnecting",this.onReconnect)}async sendStartRelayMessage(e){const t=this.genMessage(gP.StopPacketTransfer);await this.signal.request(t),await this.signal.waitStatus("Normal Quit"),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: StopPacketTransfer success"));const i=this.genMessage(gP.SetSdkProfile,e);await this.signal.request(i),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSdkProfile success"));const n=this.genMessage(gP.SetSourceChannel,e);await this.signal.request(n),await this.signal.waitStatus("SetSourceChannelStatus"),this.emit("event",fP.PACKET_JOINED_SRC_CHANNEL),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceChannel success"));const r=this.genMessage(gP.SetSourceUserId,e);await this.signal.request(r),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceUserId success"));const o=this.genMessage(gP.SetDestChannel,e);await this.signal.request(o),await this.signal.waitStatus("SetDestChannelStatus"),this.emit("event",fP.PACKET_JOINED_DEST_CHANNEL),mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetDestChannel success"));const s=this.genMessage(gP.StartPacketTransfer,e);await this.signal.request(s),this.emit("event",fP.PACKET_SENT_TO_DEST_CHANNEL),this.state=RP.RELAY_STATE_RUNNING,mw.debug("[".concat(this.clientId,"] startChannelMediaRelay: StartPacketTransfer success"))}async sendUpdateMessage(e){const t=this.genMessage(gP.UpdateDestChannel,e);await this.signal.request(t),this.emit("event",fP.PACKET_UPDATE_DEST_CHANNEL),mw.debug("[".concat(this.clientId,"] sendUpdateMessage: UpdateDestChannel success"))}async sendStopRelayMessage(){const e=this.genMessage(gP.StopPacketTransfer);await this.signal.request(e),mw.debug("[".concat(this.clientId,"] sendStopRelayMessage: StopPacketTransfer success"))}genMessage(e,t){const i=[],n=[],r=[];this.requestId+=1;const o={appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sdkVersion:Xw,sid:this.joinInfo.sid,ts:Date.now(),requestId:this.requestId,seq:this.requestId,allocate:!0,clientRequest:{}};"4.11.0"===o.sdkVersion&&(o.sdkVersion="0.0.1");let s=null,a=null;switch(e){case gP.SetSdkProfile:return o.clientRequest={command:"SetSdkProfile",type:"multi_channel"},o;case gP.SetSourceChannel:if(a=t&&t.getSrcChannelMediaInfo(),!a)throw new pw(hw.UNEXPECTED_ERROR,"can not find source config");return o.clientRequest={command:"SetSourceChannel",uid:"0",channelName:a.channelName,token:a.token||this.joinInfo.appId},o;case gP.SetSourceUserId:if(a=t&&t.getSrcChannelMediaInfo(),!a)throw new pw(hw.UNEXPECTED_ERROR,"can not find source config");return o.clientRequest={command:"SetSourceUserId",uid:a.uid+""},o;case gP.SetDestChannel:if(s=t&&t.getDestChannelMediaInfo(),!s)throw new pw(hw.UNEXPECTED_ERROR,"can not find dest config");return s.forEach((e=>{i.push(e.channelName),n.push(e.uid+""),r.push(e.token||this.joinInfo.appId)})),o.clientRequest={command:"SetDestChannel",channelName:i,uid:n,token:r},o;case gP.StartPacketTransfer:return o.clientRequest={command:"StartPacketTransfer"},o;case gP.Reconnect:return o.clientRequest={command:"Reconnect"},o;case gP.StopPacketTransfer:return o.clientRequest={command:"StopPacketTransfer"},o;case gP.UpdateDestChannel:if(s=t&&t.getDestChannelMediaInfo(),!s)throw new pw(hw.UNEXPECTED_ERROR,"can not find dest config");return s.forEach((e=>{i.push(e.channelName),n.push(e.uid+""),r.push(e.token||this.joinInfo.appId)})),o.clientRequest={command:"UpdateDestChannel",channelName:i,uid:n,token:r},o}return o}}var HW;let KW=Ww("AgoraRTCPlayer","trackId")(HW=class{get videoElementStatus(){return this._videoElementStatus}set videoElementStatus(e){e!==this._videoElementStatus&&(mw.debug("[".concat(this.trackId,"] video-element-status change ").concat(this._videoElementStatus," => ").concat(e)),jw("debug",["HTMLVideoElement",this.trackId],"statusChange","".concat(this._videoElementStatus," => ").concat(e)),this._videoElementStatus=e)}constructor(e){tD(this,"trackId",void 0),tD(this,"config",void 0),tD(this,"onFirstVideoFrameDecoded",void 0),tD(this,"freezeTimeCounterList",[]),tD(this,"timeUpdatedCount",0),tD(this,"freezeTime",0),tD(this,"playbackTime",0),tD(this,"lastTimeUpdatedTime",0),tD(this,"videoTrack",void 0),tD(this,"container",void 0),tD(this,"videoElement",void 0),tD(this,"videoElementCheckInterval",void 0),tD(this,"_videoElementStatus",mL.NONE),tD(this,"slot",void 0),tD(this,"isGettingVideoDimensions",!1),tD(this,"handleVideoEvents",(e=>{switch(e.type){case"play":case"playing":this.startGetVideoDimensions(),this.videoElementStatus=mL.PLAYING;break;case"loadeddata":this.onFirstVideoFrameDecoded&&this.onFirstVideoFrameDecoded();break;case"canplay":this.videoElementStatus=mL.CANPLAY;break;case"stalled":this.videoElementStatus=mL.STALLED;break;case"suspend":this.videoElementStatus=mL.SUSPEND;break;case"pause":this.videoElementStatus=mL.PAUSED,!Vy()&&!jy()&&this.videoElement&&this.videoTrack&&"live"===this.videoTrack.readyState&&(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume")),xw("debug",this,"video element paused, auto resume"),this.videoElement.play());break;case"waiting":this.videoElementStatus=mL.WAITING;break;case"abort":this.videoElementStatus=mL.ABORT;break;case"ended":this.videoElementStatus=mL.ENDED;break;case"emptied":this.videoElementStatus=mL.EMPTIED;break;case"timeupdate":{const e=Date.now();if(this.timeUpdatedCount+=1,this.timeUpdatedCount<10)return void(this.lastTimeUpdatedTime=e);const t=e-this.lastTimeUpdatedTime;for(this.lastTimeUpdatedTime=e,t>500&&(this.freezeTime+=t),this.playbackTime+=t;this.playbackTime>=6e3;)this.playbackTime-=6e3,this.freezeTimeCounterList.push(Math.min(6e3,this.freezeTime)),this.freezeTime=Math.max(0,this.freezeTime-6e3);break}}})),tD(this,"startGetVideoDimensions",(()=>{const e=()=>{if(this.isGettingVideoDimensions=!0,this.videoElement&&this.videoElement.videoWidth*this.videoElement.videoHeight>4)return mw.debug("[".concat(this.trackId,"] current video dimensions:"),this.videoElement.videoWidth,this.videoElement.videoHeight),Yw("debug",this,"startGetVideoDimensions",{videoWidth:this.videoElement.videoWidth,videoHeight:this.videoElement.videoHeight}),void(this.isGettingVideoDimensions=!1);setTimeout(e,500)};!this.isGettingVideoDimensions&&e()})),tD(this,"autoResumeAfterInterruption",(()=>{this.videoElement&&this.videoTrack&&"live"===this.videoTrack.readyState&&"running"===Kx.curState&&(Gy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.2")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):Fy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.1")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):xy()&&(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.0")),this.videoElement.pause(),this.videoElement.play()))})),tD(this,"autoResumeAfterInterruptionOnIOS15",(()=>{this.videoElement&&this.videoTrack&&"live"===this.videoTrack.readyState&&(Gy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.2")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):Fy()?(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.1")),this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):xy()&&(mw.debug("[track-".concat(this.trackId,"] video element paused, auto resume for iOS 15.0")),this.videoElement.pause(),this.videoElement.play()))})),this.slot=e.element,this.trackId=e.trackId,this.updateConfig(e),Kx.on(Mx.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Kx.on(Mx.IOS_15_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15)}updateConfig(e){this.config=e,this.trackId=e.trackId;const t=e.element;t!==this.slot&&(this.destroy(),this.slot=t),this.createElements()}updateVideoTrack(e){this.videoTrack!==e&&(this.videoTrack=e,this.createElements())}play(e){if(this.videoElement){const t=this.videoElement.play();t&&t.catch&&t.catch((t=>{e&&Px.autoplayFailed(e,"video",t.message,this.trackId),Yw("warning",this,"play",t.toString(),"error"),"NotAllowedError"===t.name?(mw.warning("detected video element autoplay failed",t),this.handleAutoPlayFailed()):mw.warning("[".concat(this.trackId,"] play warning: "),t)}));const i=Dy();if(("Safari"===i.name&&15===Number(i.version)||Qy())&&t&&t.then&&t.catch){const e=()=>{this.config.mirror&&this.videoElement&&(this.videoElement.style.transform="rotateY(180deg)")};t.then(e).catch(e)}}}getCurrentFrame(){if(!this.videoElement)return new ImageData(2,2);const e=document.createElement("canvas");e.width=this.videoElement.videoWidth,e.height=this.videoElement.videoHeight;const t=e.getContext("2d");if(!t)return mw.error("create canvas context failed!"),Yw("error",this,"getCurrentFrame","create canvas context failed!","error"),new ImageData(2,2);t.drawImage(this.videoElement,0,0,e.width,e.height);const i=t.getImageData(0,0,e.width,e.height);return e.remove(),i}destroy(){if(Kx.off(Mx.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Kx.off(Mx.IOS_15_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15),this.videoElement&&(this.videoElement.srcObject=null,this.videoElement.remove(),this.videoElement=void 0),this.container){try{this.container.remove(),this.slot.removeChild(this.container)}catch(e){}this.container=void 0}this.freezeTimeCounterList=[]}createElements(){this.container||(this.container=document.createElement("div")),this.container.id="agora-video-player-".concat(this.trackId),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.videoTrack?(this.container.style.backgroundColor="black",this.createVideoElement(),this.container.appendChild(this.videoElement)):this.removeVideoElement(),this.slot.appendChild(this.container)}createVideoElement(){this.videoElement||(this.videoElementStatus=mL.INIT,this.videoElement=document.createElement("video"),this.videoElement.onerror=()=>this.videoElementStatus=mL.ERROR,this.container&&this.container.appendChild(this.videoElement),WW.forEach((e=>{this.videoElement&&this.videoElement.addEventListener(e,this.handleVideoEvents)})),this.videoElementCheckInterval=window.setInterval((()=>{!document.getElementById("video_".concat(this.trackId))&&this.videoElement&&(this.videoElementStatus=mL.DESTROYED)}),1e3)),this.videoElement.id="video_".concat(this.trackId),this.videoElement.className="agora_video_player",this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.controls=!1,this.videoElement.setAttribute("playsinline",""),this.videoElement.style.left="0",this.videoElement.style.top="0";const e=Dy();"Safari"===e.name&&15===Number(e.version)||Qy()||!this.config.mirror||(this.videoElement.style.transform="rotateY(180deg)"),this.config.fit?this.videoElement.style.objectFit=this.config.fit:this.videoElement.style.objectFit="cover",this.videoElement.setAttribute("muted",""),this.videoElement.muted=!0,this.videoElement.srcObject&&this.videoElement.srcObject instanceof MediaStream?this.videoElement.srcObject.getVideoTracks()[0]!==this.videoTrack&&(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,By()&&this.videoElement.load()):(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,By()&&this.videoElement.load());const t=this.videoElement.play();void 0!==t&&t.catch((e=>{mw.debug("[".concat(this.trackId,"] playback interrupted"),e.toString()),xw("debug",this,"play back interrupted: ".concat(e.toString()))}))}removeVideoElement(){if(this.videoElement){WW.forEach((e=>{this.videoElement&&this.videoElement.removeEventListener(e,this.handleVideoEvents)})),this.videoElementCheckInterval&&(window.clearInterval(this.videoElementCheckInterval),this.videoElementCheckInterval=void 0);try{this.container&&this.container.removeChild(this.videoElement)}catch(e){}this.videoElement=void 0,this.videoElementStatus=mL.NONE}}handleAutoPlayFailed(){const e=Dy();if(this.videoElement){const t=i=>{i.preventDefault(),this.videoElement&&(this.videoElement.play().then((()=>{mw.debug("[".concat(this.trackId,"] Video element for trackId:").concat(this.trackId," autoplay resumed.")),xw("debug",this,"video element autoplay resumed")})).catch((e=>{mw.error(e)})),"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.removeEventListener("touchstart",t,!0),document.body.removeEventListener("mousedown",t,!0)):document.body.removeEventListener("click",t,!0))};"Android"!==e.os||"Chrome"!==e.name&&e.name!==Oy.WECHAT?(document.body.addEventListener("touchstart",t,!0),document.body.addEventListener("mousedown",t,!0)):document.body.addEventListener("click",t,!0),Nx()}}getVideoElement(){return this.videoElement}getContainerElement(){return this.container}})||HW;const WW=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","timeupdate"];var JW,qW={exports:{}};function XW(e,t,i){const n=e.createShader(i);if(!n)return new pw(hw.WEBGL_INTERNAL_ERROR,"can not create shader").throw();if(e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){const t=e.getShaderInfoLog(n);return e.deleteShader(n),new pw(hw.WEBGL_INTERNAL_ERROR,"error compiling shader:"+t).throw()}return n}!function(e,t){self,e.exports=(()=>{var e={3476:(e,t,i)=>{e.exports=i(7460)},4341:(e,t,i)=>{e.exports=i(3685)},3536:(e,t,i)=>{var n=i(1910);e.exports=n},8171:(e,t,i)=>{i(6450);var n=i(4058).Object,r=e.exports=function(e,t,i){return n.defineProperty(e,t,i)};n.defineProperty.sham&&(r.sham=!0)},2956:(e,t,i)=>{i(7627),i(6274),i(5967),i(8881),i(4560),i(7206),i(4349),i(7971);var n=i(4058);e.exports=n.Promise},3685:(e,t,i)=>{var n=i(3536);e.exports=n},4883:(e,t,i)=>{var n=i(1899),r=i(7475),o=i(9826),s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not a function")}},174:(e,t,i)=>{var n=i(1899),r=i(4284),o=i(9826),s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not a constructor")}},1851:(e,t,i)=>{var n=i(1899),r=i(7475),o=n.String,s=n.TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw s("Can't set "+o(e)+" as a prototype")}},8479:e=>{e.exports=function(){}},5743:(e,t,i)=>{var n=i(1899),r=i(7046),o=n.TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},6059:(e,t,i)=>{var n=i(1899),r=i(941),o=n.String,s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not an object")}},1692:(e,t,i)=>{var n=i(4529),r=i(9413),o=i(623),s=function(e){return function(t,i,s){var a,c=n(t),A=o(c),d=r(s,A);if(e&&i!=i){for(;A>d;)if((a=c[d++])!=a)return!0}else for(;A>d;d++)if((e||d in c)&&c[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},3765:(e,t,i)=>{var n=i(5329);e.exports=n([].slice)},1385:(e,t,i)=>{var n=i(9813)("iterator"),r=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){r=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}},2532:(e,t,i)=>{var n=i(5329),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},9697:(e,t,i)=>{var n=i(1899),r=i(2885),o=i(7475),s=i(2532),a=i(9813)("toStringTag"),c=n.Object,A="Arguments"==s(function(){return arguments}());e.exports=r?s:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=c(e),a))?i:A?s(t):"Object"==(n=s(t))&&o(t.callee)?"Arguments":n}},8694:(e,t,i)=>{var n=i(5329)("".replace),r=String(Error("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(r);e.exports=function(e,t){if(s&&"string"==typeof e)for(;t--;)e=n(e,o,"");return e}},3489:(e,t,i)=>{var n=i(953),r=i(1136),o=i(9677),s=i(5988);e.exports=function(e,t,i){for(var a=r(t),c=s.f,A=o.f,d=0;d<a.length;d++){var u=a[d];n(e,u)||i&&n(i,u)||c(e,u,A(t,u))}}},4160:(e,t,i)=>{var n=i(5981);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},1046:(e,t,i)=>{var n=i(5143).IteratorPrototype,r=i(9290),o=i(1887),s=i(904),a=i(2077),c=function(){return this};e.exports=function(e,t,i,A){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!A,i)}),s(e,d,!1,!0),a[d]=c,e}},2029:(e,t,i)=>{var n=i(5746),r=i(5988),o=i(1887);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},1887:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7771:(e,t,i)=>{var n=i(6887),r=i(8834),o=i(2529),s=i(9417),a=i(7475),c=i(1046),A=i(249),d=i(8929),u=i(904),E=i(2029),l=i(9754),h=i(9813),p=i(2077),_=i(5143),I=s.PROPER,g=s.CONFIGURABLE,f=_.IteratorPrototype,R=_.BUGGY_SAFARI_ITERATORS,C=h("iterator"),T="keys",m="values",S="entries",O=function(){return this};e.exports=function(e,t,i,s,h,_,v){c(i,t,s);var N,y,D,w=function(e){if(e===h&&M)return M;if(!R&&e in P)return P[e];switch(e){case T:case m:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},b=t+" Iterator",L=!1,P=e.prototype,k=P[C]||P["@@iterator"]||h&&P[h],M=!R&&k||w(h),U="Array"==t&&P.entries||k;if(U&&(N=A(U.call(new e)))!==Object.prototype&&N.next&&(o||A(N)===f||(d?d(N,f):a(N[C])||l(N,C,O)),u(N,b,!0,!0),o&&(p[b]=O)),I&&h==m&&k&&k.name!==m&&(!o&&g?E(P,"name",m):(L=!0,M=function(){return r(k,this)})),h)if(y={values:w(m),keys:_?M:w(T),entries:w(S)},v)for(D in y)(R||L||!(D in P))&&l(P,D,y[D]);else n({target:t,proto:!0,forced:R||L},y);return o&&!v||P[C]===M||l(P,C,M,{name:h}),p[t]=M,y}},5746:(e,t,i)=>{var n=i(5981);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1333:(e,t,i)=>{var n=i(1899),r=i(941),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},3281:e=>{e.exports={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}},3321:e=>{e.exports="object"==typeof window},4470:(e,t,i)=>{var n=i(2861),r=i(1899);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==r.Pebble},2749:(e,t,i)=>{var n=i(2861);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},6049:(e,t,i)=>{var n=i(2532),r=i(1899);e.exports="process"==n(r.process)},8045:(e,t,i)=>{var n=i(2861);e.exports=/web0s(?!.*chrome)/i.test(n)},2861:(e,t,i)=>{var n=i(626);e.exports=n("navigator","userAgent")||""},3385:(e,t,i)=>{var n,r,o=i(1899),s=i(2861),a=o.process,c=o.Deno,A=a&&a.versions||c&&c.version,d=A&&A.v8;d&&(r=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},6759:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8780:(e,t,i)=>{var n=i(5981),r=i(1887);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))},6887:(e,t,i)=>{var n=i(1899),r=i(9730),o=i(5329),s=i(7475),a=i(9677).f,c=i(7252),A=i(4058),d=i(6843),u=i(2029),E=i(953),l=function(e){var t=function(i,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(i);case 2:return new e(i,n)}return new e(i,n,o)}return r(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var i,r,h,p,_,I,g,f,R=e.target,C=e.global,T=e.stat,m=e.proto,S=C?n:T?n[R]:(n[R]||{}).prototype,O=C?A:A[R]||u(A,R,{})[R],v=O.prototype;for(h in t)i=!c(C?h:R+(T?".":"#")+h,e.forced)&&S&&E(S,h),_=O[h],i&&(I=e.noTargetGet?(f=a(S,h))&&f.value:S[h]),p=i&&I?I:t[h],i&&typeof _==typeof p||(g=e.bind&&i?d(p,n):e.wrap&&i?l(p):m&&s(p)?o(p):p,(e.sham||p&&p.sham||_&&_.sham)&&u(g,"sham",!0),u(O,h,g),m&&(E(A,r=R+"Prototype")||u(A,r,{}),u(A[r],h,p),e.real&&v&&!v[h]&&u(v,h,p)))}},5981:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:(e,t,i)=>{var n=i(8285),r=Function.prototype,o=r.apply,s=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},6843:(e,t,i)=>{var n=i(5329),r=i(4883),o=i(8285),s=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},8285:(e,t,i)=>{var n=i(5981);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:(e,t,i)=>{var n=i(8285),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},9417:(e,t,i)=>{var n=i(5746),r=i(953),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),c=a&&"something"===function(){}.name,A=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:A}},5329:(e,t,i)=>{var n=i(8285),r=Function.prototype,o=r.bind,s=r.call,a=n&&o.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},626:(e,t,i)=>{var n=i(4058),r=i(1899),o=i(7475),s=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?s(n[e])||s(r[e]):n[e]&&n[e][t]||r[e]&&r[e][t]}},2902:(e,t,i)=>{var n=i(9697),r=i(4229),o=i(2077),s=i(9813)("iterator");e.exports=function(e){if(null!=e)return r(e,s)||r(e,"@@iterator")||o[n(e)]}},429:(e,t,i)=>{var n=i(1899),r=i(8834),o=i(4883),s=i(6059),a=i(9826),c=i(2902),A=n.TypeError;e.exports=function(e,t){var i=arguments.length<2?c(e):t;if(o(i))return s(r(i,e));throw A(a(e)+" is not iterable")}},4229:(e,t,i)=>{var n=i(4883);e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},1899:(e,t,i)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},953:(e,t,i)=>{var n=i(5329),r=i(9678),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},7748:e=>{e.exports={}},4845:(e,t,i)=>{var n=i(1899);e.exports=function(e,t){var i=n.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}},5463:(e,t,i)=>{var n=i(626);e.exports=n("document","documentElement")},2840:(e,t,i)=>{var n=i(5746),r=i(5981),o=i(1333);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},7026:(e,t,i)=>{var n=i(1899),r=i(5329),o=i(5981),s=i(2532),a=n.Object,c=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?c(e,""):a(e)}:a},1302:(e,t,i)=>{var n=i(5329),r=i(7475),o=i(3030),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},3794:(e,t,i)=>{var n=i(941),r=i(2029);e.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}},5402:(e,t,i)=>{var n,r,o,s=i(8019),a=i(1899),c=i(5329),A=i(941),d=i(2029),u=i(953),E=i(3030),l=i(4262),h=i(7748),p="Object already initialized",_=a.TypeError,I=a.WeakMap;if(s||E.state){var g=E.state||(E.state=new I),f=c(g.get),R=c(g.has),C=c(g.set);n=function(e,t){if(R(g,e))throw new _(p);return t.facade=e,C(g,e,t),t},r=function(e){return f(g,e)||{}},o=function(e){return R(g,e)}}else{var T=l("state");h[T]=!0,n=function(e,t){if(u(e,T))throw new _(p);return t.facade=e,d(e,T,t),t},r=function(e){return u(e,T)?e[T]:{}},o=function(e){return u(e,T)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!A(t)||(i=r(t)).type!==e)throw _("Incompatible receiver, "+e+" required");return i}}}},6782:(e,t,i)=>{var n=i(9813),r=i(2077),o=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||s[o]===e)}},7475:e=>{e.exports=function(e){return"function"==typeof e}},4284:(e,t,i)=>{var n=i(5329),r=i(5981),o=i(7475),s=i(9697),a=i(626),c=i(1302),A=function(){},d=[],u=a("Reflect","construct"),E=/^\s*(?:class|function)\b/,l=n(E.exec),h=!E.exec(A),p=function(e){if(!o(e))return!1;try{return u(A,d,e),!0}catch(e){return!1}},_=function(e){if(!o(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!l(E,c(e))}catch(e){return!0}};_.sham=!0,e.exports=!u||r((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?_:p},7252:(e,t,i)=>{var n=i(5981),r=i(7475),o=/#|\.prototype\./,s=function(e,t){var i=c[a(e)];return i==d||i!=A&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=s.data={},A=s.NATIVE="N",d=s.POLYFILL="P";e.exports=s},941:(e,t,i)=>{var n=i(7475);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},2529:e=>{e.exports=!0},6664:(e,t,i)=>{var n=i(1899),r=i(626),o=i(7475),s=i(7046),a=i(2302),c=n.Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,c(e))}},3091:(e,t,i)=>{var n=i(1899),r=i(6843),o=i(8834),s=i(6059),a=i(9826),c=i(6782),A=i(623),d=i(7046),u=i(429),E=i(2902),l=i(7609),h=n.TypeError,p=function(e,t){this.stopped=e,this.result=t},_=p.prototype;e.exports=function(e,t,i){var n,I,g,f,R,C,T,m=i&&i.that,S=!(!i||!i.AS_ENTRIES),O=!(!i||!i.IS_ITERATOR),v=!(!i||!i.INTERRUPTED),N=r(t,m),y=function(e){return n&&l(n,"normal",e),new p(!0,e)},D=function(e){return S?(s(e),v?N(e[0],e[1],y):N(e[0],e[1])):v?N(e,y):N(e)};if(O)n=e;else{if(!(I=E(e)))throw h(a(e)+" is not iterable");if(c(I)){for(g=0,f=A(e);f>g;g++)if((R=D(e[g]))&&d(_,R))return R;return new p(!1)}n=u(e,I)}for(C=n.next;!(T=o(C,n)).done;){try{R=D(T.value)}catch(e){l(n,"throw",e)}if("object"==typeof R&&R&&d(_,R))return R}return new p(!1)}},7609:(e,t,i)=>{var n=i(8834),r=i(6059),o=i(4229);e.exports=function(e,t,i){var s,a;r(e);try{if(!(s=o(e,"return"))){if("throw"===t)throw i;return i}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw i;if(a)throw s;return r(s),i}},5143:(e,t,i)=>{var n,r,o,s=i(5981),a=i(7475),c=i(9290),A=i(249),d=i(9754),u=i(9813),E=i(2529),l=u("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(r=A(A(o)))!==Object.prototype&&(n=r):h=!0),null==n||s((function(){var e={};return n[l].call(e)!==e}))?n={}:E&&(n=c(n)),a(n[l])||d(n,l,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},2077:e=>{e.exports={}},623:(e,t,i)=>{var n=i(3057);e.exports=function(e){return n(e.length)}},6132:(e,t,i)=>{var n,r,o,s,a,c,A,d,u=i(1899),E=i(6843),l=i(9677).f,h=i(2941).set,p=i(2749),_=i(4470),I=i(8045),g=i(6049),f=u.MutationObserver||u.WebKitMutationObserver,R=u.document,C=u.process,T=u.Promise,m=l(u,"queueMicrotask"),S=m&&m.value;S||(n=function(){var e,t;for(g&&(e=C.domain)&&e.exit();r;){t=r.fn,r=r.next;try{t()}catch(e){throw r?s():o=void 0,e}}o=void 0,e&&e.enter()},p||g||I||!f||!R?!_&&T&&T.resolve?((A=T.resolve(void 0)).constructor=T,d=E(A.then,A),s=function(){d(n)}):g?s=function(){C.nextTick(n)}:(h=E(h,u),s=function(){h(n)}):(a=!0,c=R.createTextNode(""),new f(n).observe(c,{characterData:!0}),s=function(){c.data=a=!a})),e.exports=S||function(e){var t={fn:e,next:void 0};o&&(o.next=t),r||(r=t,s()),o=t}},9297:(e,t,i)=>{var n=i(1899);e.exports=n.Promise},2497:(e,t,i)=>{var n=i(3385),r=i(5981);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8019:(e,t,i)=>{var n=i(1899),r=i(7475),o=i(1302),s=n.WeakMap;e.exports=r(s)&&/native code/.test(o(s))},9520:(e,t,i)=>{var n=i(4883),r=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)};e.exports.f=function(e){return new r(e)}},4649:(e,t,i)=>{var n=i(5803);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},9290:(e,t,i)=>{var n,r=i(6059),o=i(9938),s=i(6759),a=i(7748),c=i(5463),A=i(1333),d=i(4262)("IE_PROTO"),u=function(){},E=function(e){return"<script>"+e+"<\/script>"},l=function(e){e.write(E("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;h="undefined"!=typeof document?document.domain&&n?l(n):((t=A("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(E("document.F=Object")),e.close(),e.F):l(n);for(var i=s.length;i--;)delete h.prototype[s[i]];return h()};a[d]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(u.prototype=r(e),i=new u,u.prototype=null,i[d]=e):i=h(),void 0===t?i:o.f(i,t)}},9938:(e,t,i)=>{var n=i(5746),r=i(3937),o=i(5988),s=i(6059),a=i(4529),c=i(4771);t.f=n&&!r?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),r=c(t),A=r.length,d=0;A>d;)o.f(e,i=r[d++],n[i]);return e}},5988:(e,t,i)=>{var n=i(1899),r=i(5746),o=i(2840),s=i(3937),a=i(6059),c=i(3894),A=n.TypeError,d=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.f=r?s?function(e,t,i){if(a(e),t=c(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=u(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=c(t),a(i),o)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw A("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},9677:(e,t,i)=>{var n=i(5746),r=i(8834),o=i(6760),s=i(1887),a=i(4529),c=i(3894),A=i(953),d=i(2840),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=a(e),t=c(t),d)try{return u(e,t)}catch(e){}if(A(e,t))return s(!r(o.f,e,t),e[t])}},946:(e,t,i)=>{var n=i(5629),r=i(6759).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},7857:(e,t)=>{t.f=Object.getOwnPropertySymbols},249:(e,t,i)=>{var n=i(1899),r=i(953),o=i(7475),s=i(9678),a=i(4262),c=i(4160),A=a("IE_PROTO"),d=n.Object,u=d.prototype;e.exports=c?d.getPrototypeOf:function(e){var t=s(e);if(r(t,A))return t[A];var i=t.constructor;return o(i)&&t instanceof i?i.prototype:t instanceof d?u:null}},7046:(e,t,i)=>{var n=i(5329);e.exports=n({}.isPrototypeOf)},5629:(e,t,i)=>{var n=i(5329),r=i(953),o=i(4529),s=i(1692).indexOf,a=i(7748),c=n([].push);e.exports=function(e,t){var i,n=o(e),A=0,d=[];for(i in n)!r(a,i)&&r(n,i)&&c(d,i);for(;t.length>A;)r(n,i=t[A++])&&(~s(d,i)||c(d,i));return d}},4771:(e,t,i)=>{var n=i(5629),r=i(6759);e.exports=Object.keys||function(e){return n(e,r)}},6760:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},8929:(e,t,i)=>{var n=i(5329),r=i(6059),o=i(1851);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return r(i),o(n),t?e(i,n):i.__proto__=n,i}}():void 0)},5623:(e,t,i)=>{var n=i(2885),r=i(9697);e.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}},9811:(e,t,i)=>{var n=i(1899),r=i(8834),o=i(7475),s=i(941),a=n.TypeError;e.exports=function(e,t){var i,n;if("string"===t&&o(i=e.toString)&&!s(n=r(i,e)))return n;if(o(i=e.valueOf)&&!s(n=r(i,e)))return n;if("string"!==t&&o(i=e.toString)&&!s(n=r(i,e)))return n;throw a("Can't convert object to primitive value")}},1136:(e,t,i)=>{var n=i(626),r=i(5329),o=i(946),s=i(7857),a=i(6059),c=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?c(t,i(e)):t}},4058:e=>{e.exports={}},2:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},6584:(e,t,i)=>{var n=i(6059),r=i(941),o=i(9520);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},8397:e=>{var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},7524:(e,t,i)=>{var n=i(9754);e.exports=function(e,t,i){for(var r in t)i&&i.unsafe&&e[r]?e[r]=t[r]:n(e,r,t[r],i);return e}},9754:(e,t,i)=>{var n=i(2029);e.exports=function(e,t,i,r){r&&r.enumerable?e[t]=i:n(e,t,i)}},8219:(e,t,i)=>{var n=i(1899).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},4911:(e,t,i)=>{var n=i(1899),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},4431:(e,t,i)=>{var n=i(626),r=i(5988),o=i(9813),s=i(5746),a=o("species");e.exports=function(e){var t=n(e),i=r.f;s&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},904:(e,t,i)=>{var n=i(2885),r=i(5988).f,o=i(2029),s=i(953),a=i(5623),c=i(9813)("toStringTag");e.exports=function(e,t,i,A){if(e){var d=i?e:e.prototype;s(d,c)||r(d,c,{configurable:!0,value:t}),A&&!n&&o(d,"toString",a)}}},4262:(e,t,i)=>{var n=i(8726),r=i(9418),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},3030:(e,t,i)=>{var n=i(1899),r=i(4911),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},8726:(e,t,i)=>{var n=i(2529),r=i(3030);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},487:(e,t,i)=>{var n=i(6059),r=i(174),o=i(9813)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||null==(i=n(s)[o])?t:r(i)}},4620:(e,t,i)=>{var n=i(5329),r=i(2435),o=i(5803),s=i(8219),a=n("".charAt),c=n("".charCodeAt),A=n("".slice),d=function(e){return function(t,i){var n,d,u=o(s(t)),E=r(i),l=u.length;return E<0||E>=l?e?"":void 0:(n=c(u,E))<55296||n>56319||E+1===l||(d=c(u,E+1))<56320||d>57343?e?a(u,E):n:e?A(u,E,E+2):d-56320+(n-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},2941:(e,t,i)=>{var n,r,o,s,a=i(1899),c=i(9730),A=i(6843),d=i(7475),u=i(953),E=i(5981),l=i(5463),h=i(3765),p=i(1333),_=i(2749),I=i(6049),g=a.setImmediate,f=a.clearImmediate,R=a.process,C=a.Dispatch,T=a.Function,m=a.MessageChannel,S=a.String,O=0,v={};try{n=a.location}catch(e){}var N=function(e){if(u(v,e)){var t=v[e];delete v[e],t()}},y=function(e){return function(){N(e)}},D=function(e){N(e.data)},w=function(e){a.postMessage(S(e),n.protocol+"//"+n.host)};g&&f||(g=function(e){var t=h(arguments,1);return v[++O]=function(){c(d(e)?e:T(e),void 0,t)},r(O),O},f=function(e){delete v[e]},I?r=function(e){R.nextTick(y(e))}:C&&C.now?r=function(e){C.now(y(e))}:m&&!_?(s=(o=new m).port2,o.port1.onmessage=D,r=A(s.postMessage,s)):a.addEventListener&&d(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!E(w)?(r=w,a.addEventListener("message",D,!1)):r="onreadystatechange"in p("script")?function(e){l.appendChild(p("script")).onreadystatechange=function(){l.removeChild(this),N(e)}}:function(e){setTimeout(y(e),0)}),e.exports={set:g,clear:f}},9413:(e,t,i)=>{var n=i(2435),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},4529:(e,t,i)=>{var n=i(7026),r=i(8219);e.exports=function(e){return n(r(e))}},2435:e=>{var t=Math.ceil,i=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?i:t)(n)}},3057:(e,t,i)=>{var n=i(2435),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},9678:(e,t,i)=>{var n=i(1899),r=i(8219),o=n.Object;e.exports=function(e){return o(r(e))}},6935:(e,t,i)=>{var n=i(1899),r=i(8834),o=i(941),s=i(6664),a=i(4229),c=i(9811),A=i(9813),d=n.TypeError,u=A("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var i,n=a(e,u);if(n){if(void 0===t&&(t="default"),i=r(n,e,t),!o(i)||s(i))return i;throw d("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},3894:(e,t,i)=>{var n=i(6935),r=i(6664);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},2885:(e,t,i)=>{var n={};n[i(9813)("toStringTag")]="z",e.exports="[object z]"===String(n)},5803:(e,t,i)=>{var n=i(1899),r=i(9697),o=n.String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},9826:(e,t,i)=>{var n=i(1899).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9418:(e,t,i)=>{var n=i(5329),r=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},2302:(e,t,i)=>{var n=i(2497);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:(e,t,i)=>{var n=i(5746),r=i(5981);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},9813:(e,t,i)=>{var n=i(1899),r=i(8726),o=i(953),s=i(9418),a=i(2497),c=i(2302),A=r("wks"),d=n.Symbol,u=d&&d.for,E=c?d:d&&d.withoutSetter||s;e.exports=function(e){if(!o(A,e)||!a&&"string"!=typeof A[e]){var t="Symbol."+e;a&&o(d,e)?A[e]=d[e]:A[e]=c&&u?u(t):E(t)}return A[e]}},7627:(e,t,i)=>{var n=i(6887),r=i(1899),o=i(7046),s=i(249),a=i(8929),c=i(3489),A=i(9290),d=i(2029),u=i(1887),E=i(8694),l=i(3794),h=i(3091),p=i(4649),_=i(9813),I=i(8780),g=_("toStringTag"),f=r.Error,R=[].push,C=function(e,t){var i,n=arguments.length>2?arguments[2]:void 0,r=o(T,this);a?i=a(new f,r?s(this):T):(i=r?this:A(T),d(i,g,"Error")),void 0!==t&&d(i,"message",p(t)),I&&d(i,"stack",E(i.stack,1)),l(i,n);var c=[];return h(e,R,{that:c}),d(i,"errors",c),i};a?a(C,f):c(C,f,{name:!0});var T=C.prototype=A(f.prototype,{constructor:u(1,C),message:u(1,""),name:u(1,"AggregateError")});n({global:!0},{AggregateError:C})},6274:(e,t,i)=>{var n=i(4529),r=i(8479),o=i(2077),s=i(5402),a=i(5988).f,c=i(7771),A=i(2529),d=i(5746),u="Array Iterator",E=s.set,l=s.getterFor(u);e.exports=c(Array,"Array",(function(e,t){E(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var h=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!A&&d&&"values"!==h.name)try{a(h,"name",{value:"values"})}catch(e){}},6450:(e,t,i)=>{var n=i(6887),r=i(5746),o=i(5988).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!r},{defineProperty:o})},5967:()=>{},4560:(e,t,i)=>{var n=i(6887),r=i(8834),o=i(4883),s=i(9520),a=i(2),c=i(3091);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,i=s.f(t),n=i.resolve,A=i.reject,d=a((function(){var i=o(t.resolve),s=[],a=0,A=1;c(e,(function(e){var o=a++,c=!1;A++,r(i,t,e).then((function(e){c||(c=!0,s[o]={status:"fulfilled",value:e},--A||n(s))}),(function(e){c||(c=!0,s[o]={status:"rejected",reason:e},--A||n(s))}))})),--A||n(s)}));return d.error&&A(d.value),i.promise}})},7206:(e,t,i)=>{var n=i(6887),r=i(4883),o=i(626),s=i(8834),a=i(9520),c=i(2),A=i(3091),d="No one promise resolved";n({target:"Promise",stat:!0},{any:function(e){var t=this,i=o("AggregateError"),n=a.f(t),u=n.resolve,E=n.reject,l=c((function(){var n=r(t.resolve),o=[],a=0,c=1,l=!1;A(e,(function(e){var r=a++,A=!1;c++,s(n,t,e).then((function(e){A||l||(l=!0,u(e))}),(function(e){A||l||(A=!0,o[r]=e,--c||E(new i(o,d)))}))})),--c||E(new i(o,d))}));return l.error&&E(l.value),n.promise}})},4349:(e,t,i)=>{var n=i(6887),r=i(2529),o=i(9297),s=i(5981),a=i(626),c=i(7475),A=i(487),d=i(6584),u=i(9754);if(n({target:"Promise",proto:!0,real:!0,forced:!!o&&s((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=A(this,a("Promise")),i=c(e);return this.then(i?function(i){return d(t,e()).then((function(){return i}))}:e,i?function(i){return d(t,e()).then((function(){throw i}))}:e)}}),!r&&c(o)){var E=a("Promise").prototype.finally;o.prototype.finally!==E&&u(o.prototype,"finally",E,{unsafe:!0})}},8881:(e,t,i)=>{var n,r,o,s,a=i(6887),c=i(2529),A=i(1899),d=i(626),u=i(8834),E=i(9297),l=i(9754),h=i(7524),p=i(8929),_=i(904),I=i(4431),g=i(4883),f=i(7475),R=i(941),C=i(5743),T=i(1302),m=i(3091),S=i(1385),O=i(487),v=i(2941).set,N=i(6132),y=i(6584),D=i(4845),w=i(9520),b=i(2),L=i(8397),P=i(5402),k=i(7252),M=i(9813),U=i(3321),B=i(6049),V=i(3385),Q=M("species"),x="Promise",F=P.getterFor(x),G=P.set,j=P.getterFor(x),Y=E&&E.prototype,H=E,K=Y,W=A.TypeError,J=A.document,q=A.process,X=w.f,z=X,Z=!!(J&&J.createEvent&&A.dispatchEvent),$=f(A.PromiseRejectionEvent),ee="unhandledrejection",te=!1,ie=k(x,(function(){var e=T(H),t=e!==String(H);if(!t&&66===V)return!0;if(c&&!K.finally)return!0;if(V>=51&&/native code/.test(e))return!1;var i=new H((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(i.constructor={})[Q]=n,!(te=i.then((function(){}))instanceof n)||!t&&U&&!$})),ne=ie||!S((function(e){H.all(e).catch((function(){}))})),re=function(e){var t;return!(!R(e)||!f(t=e.then))&&t},oe=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,A=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&de(t),t.rejection=1),!0===a?i=o:(d&&d.enter(),i=a(o),d&&(d.exit(),r=!0)),i===e.promise?A(W("Promise-chain cycle")):(n=re(i))?u(n,i,c,A):c(i)):A(o)}catch(e){d&&!r&&d.exit(),A(e)}},se=function(e,t){e.notified||(e.notified=!0,N((function(){for(var i,n=e.reactions;i=n.get();)oe(i,e);e.notified=!1,t&&!e.rejection&&ce(e)})))},ae=function(e,t,i){var n,r;Z?((n=J.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),A.dispatchEvent(n)):n={promise:t,reason:i},!$&&(r=A["on"+e])?r(n):e===ee&&D("Unhandled promise rejection",i)},ce=function(e){u(v,A,(function(){var t,i=e.facade,n=e.value;if(Ae(e)&&(t=b((function(){B?q.emit("unhandledRejection",n,i):ae(ee,i,n)})),e.rejection=B||Ae(e)?2:1,t.error))throw t.value}))},Ae=function(e){return 1!==e.rejection&&!e.parent},de=function(e){u(v,A,(function(){var t=e.facade;B?q.emit("rejectionHandled",t):ae("rejectionhandled",t,e.value)}))},ue=function(e,t,i){return function(n){e(t,n,i)}},Ee=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,se(e,!0))},le=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw W("Promise can't be resolved itself");var n=re(t);n?N((function(){var i={done:!1};try{u(n,t,ue(le,i,e),ue(Ee,i,e))}catch(t){Ee(i,t,e)}})):(e.value=t,e.state=1,se(e,!1))}catch(t){Ee({done:!1},t,e)}}};if(ie&&(K=(H=function(e){C(this,K),g(e),u(n,this);var t=F(this);try{e(ue(le,t),ue(Ee,t))}catch(e){Ee(t,e)}}).prototype,(n=function(e){G(this,{type:x,done:!1,notified:!1,parent:!1,reactions:new L,rejection:!1,state:0,value:void 0})}).prototype=h(K,{then:function(e,t){var i=j(this),n=X(O(this,H));return i.parent=!0,n.ok=!f(e)||e,n.fail=f(t)&&t,n.domain=B?q.domain:void 0,0==i.state?i.reactions.add(n):N((function(){oe(n,i)})),n.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new n,t=F(e);this.promise=e,this.resolve=ue(le,t),this.reject=ue(Ee,t)},w.f=X=function(e){return e===H||e===o?new r(e):z(e)},!c&&f(E)&&Y!==Object.prototype)){s=Y.then,te||(l(Y,"then",(function(e,t){var i=this;return new H((function(e,t){u(s,i,e,t)})).then(e,t)}),{unsafe:!0}),l(Y,"catch",K.catch,{unsafe:!0}));try{delete Y.constructor}catch(e){}p&&p(Y,K)}a({global:!0,wrap:!0,forced:ie},{Promise:H}),_(H,x,!1,!0),I(x),o=d(x),a({target:x,stat:!0,forced:ie},{reject:function(e){var t=X(this);return u(t.reject,void 0,e),t.promise}}),a({target:x,stat:!0,forced:c||ie},{resolve:function(e){return y(c&&this===o?H:this,e)}}),a({target:x,stat:!0,forced:ne},{all:function(e){var t=this,i=X(t),n=i.resolve,r=i.reject,o=b((function(){var i=g(t.resolve),o=[],s=0,a=1;m(e,(function(e){var c=s++,A=!1;a++,u(i,t,e).then((function(e){A||(A=!0,o[c]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise},race:function(e){var t=this,i=X(t),n=i.reject,r=b((function(){var r=g(t.resolve);m(e,(function(e){u(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}})},7971:(e,t,i)=>{var n=i(4620).charAt,r=i(5803),o=i(5402),s=i(7771),a="String Iterator",c=o.set,A=o.getterFor(a);s(String,"String",(function(e){c(this,{type:a,string:r(e),index:0})}),(function(){var e,t=A(this),i=t.string,r=t.index;return r>=i.length?{value:void 0,done:!0}:(e=n(i,r),t.index+=e.length,{value:e,done:!1})}))},7634:(e,t,i)=>{i(6274);var n=i(3281),r=i(1899),o=i(9697),s=i(2029),a=i(2077),c=i(9813)("toStringTag");for(var A in n){var d=r[A],u=d&&d.prototype;u&&o(u)!==c&&s(u,c,A),a[A]=a.Array}},1910:(e,t,i)=>{var n=i(8171);e.exports=n},7460:(e,t,i)=>{var n=i(2956);i(7634),e.exports=n},9662:(e,t,i)=>{var n=i(7854),r=i(614),o=i(6330),s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not a function")}},6077:(e,t,i)=>{var n=i(7854),r=i(614),o=n.String,s=n.TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw s("Can't set "+o(e)+" as a prototype")}},1223:(e,t,i)=>{var n=i(5112),r=i(30),o=i(3070),s=n("unscopables"),a=Array.prototype;null==a[s]&&o.f(a,s,{configurable:!0,value:r(null)}),e.exports=function(e){a[s][e]=!0}},9670:(e,t,i)=>{var n=i(7854),r=i(111),o=n.String,s=n.TypeError;e.exports=function(e){if(r(e))return e;throw s(o(e)+" is not an object")}},1318:(e,t,i)=>{var n=i(5656),r=i(1400),o=i(6244),s=function(e){return function(t,i,s){var a,c=n(t),A=o(c),d=r(s,A);if(e&&i!=i){for(;A>d;)if((a=c[d++])!=a)return!0}else for(;A>d;d++)if((e||d in c)&&c[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},4326:(e,t,i)=>{var n=i(1702),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},648:(e,t,i)=>{var n=i(7854),r=i(1694),o=i(614),s=i(4326),a=i(5112)("toStringTag"),c=n.Object,A="Arguments"==s(function(){return arguments}());e.exports=r?s:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=c(e),a))?i:A?s(t):"Object"==(n=s(t))&&o(t.callee)?"Arguments":n}},7741:(e,t,i)=>{var n=i(1702)("".replace),r=String(Error("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,s=o.test(r);e.exports=function(e,t){if(s&&"string"==typeof e)for(;t--;)e=n(e,o,"");return e}},9920:(e,t,i)=>{var n=i(2597),r=i(3887),o=i(1236),s=i(3070);e.exports=function(e,t,i){for(var a=r(t),c=s.f,A=o.f,d=0;d<a.length;d++){var u=a[d];n(e,u)||i&&n(i,u)||c(e,u,A(t,u))}}},8544:(e,t,i)=>{var n=i(7293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4994:(e,t,i)=>{var n=i(3383).IteratorPrototype,r=i(30),o=i(9114),s=i(8003),a=i(7497),c=function(){return this};e.exports=function(e,t,i,A){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!A,i)}),s(e,d,!1,!0),a[d]=c,e}},8880:(e,t,i)=>{var n=i(9781),r=i(3070),o=i(9114);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},654:(e,t,i)=>{var n=i(2109),r=i(6916),o=i(1913),s=i(6530),a=i(614),c=i(4994),A=i(9518),d=i(7674),u=i(8003),E=i(8880),l=i(1320),h=i(5112),p=i(7497),_=i(3383),I=s.PROPER,g=s.CONFIGURABLE,f=_.IteratorPrototype,R=_.BUGGY_SAFARI_ITERATORS,C=h("iterator"),T="keys",m="values",S="entries",O=function(){return this};e.exports=function(e,t,i,s,h,_,v){c(i,t,s);var N,y,D,w=function(e){if(e===h&&M)return M;if(!R&&e in P)return P[e];switch(e){case T:case m:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},b=t+" Iterator",L=!1,P=e.prototype,k=P[C]||P["@@iterator"]||h&&P[h],M=!R&&k||w(h),U="Array"==t&&P.entries||k;if(U&&(N=A(U.call(new e)))!==Object.prototype&&N.next&&(o||A(N)===f||(d?d(N,f):a(N[C])||l(N,C,O)),u(N,b,!0,!0),o&&(p[b]=O)),I&&h==m&&k&&k.name!==m&&(!o&&g?E(P,"name",m):(L=!0,M=function(){return r(k,this)})),h)if(y={values:w(m),keys:_?M:w(T),entries:w(S)},v)for(D in y)(R||L||!(D in P))&&l(P,D,y[D]);else n({target:t,proto:!0,forced:R||L},y);return o&&!v||P[C]===M||l(P,C,M,{name:h}),p[t]=M,y}},9781:(e,t,i)=>{var n=i(7293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(e,t,i)=>{var n=i(7854),r=i(111),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},8324:e=>{e.exports={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}},8509:(e,t,i)=>{var n=i(317)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},8113:(e,t,i)=>{var n=i(5005);e.exports=n("navigator","userAgent")||""},7392:(e,t,i)=>{var n,r,o=i(7854),s=i(8113),a=o.process,c=o.Deno,A=a&&a.versions||c&&c.version,d=A&&A.v8;d&&(r=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2914:(e,t,i)=>{var n=i(7293),r=i(9114);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)}))},2109:(e,t,i)=>{var n=i(7854),r=i(1236).f,o=i(8880),s=i(1320),a=i(3505),c=i(9920),A=i(4705);e.exports=function(e,t){var i,d,u,E,l,h=e.target,p=e.global,_=e.stat;if(i=p?n:_?n[h]||a(h,{}):(n[h]||{}).prototype)for(d in t){if(E=t[d],u=e.noTargetGet?(l=r(i,d))&&l.value:i[d],!A(p?d:h+(_?".":"#")+d,e.forced)&&void 0!==u){if(typeof E==typeof u)continue;c(E,u)}(e.sham||u&&u.sham)&&o(E,"sham",!0),s(i,d,E,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2104:(e,t,i)=>{var n=i(4374),r=Function.prototype,o=r.apply,s=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},4374:(e,t,i)=>{var n=i(7293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6916:(e,t,i)=>{var n=i(4374),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},6530:(e,t,i)=>{var n=i(9781),r=i(2597),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),c=a&&"something"===function(){}.name,A=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:A}},1702:(e,t,i)=>{var n=i(4374),r=Function.prototype,o=r.bind,s=r.call,a=n&&o.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},5005:(e,t,i)=>{var n=i(7854),r=i(614),o=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},8173:(e,t,i)=>{var n=i(9662);e.exports=function(e,t){var i=e[t];return null==i?void 0:n(i)}},7854:(e,t,i)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},2597:(e,t,i)=>{var n=i(1702),r=i(7908),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},3501:e=>{e.exports={}},490:(e,t,i)=>{var n=i(5005);e.exports=n("document","documentElement")},4664:(e,t,i)=>{var n=i(9781),r=i(7293),o=i(317);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},8361:(e,t,i)=>{var n=i(7854),r=i(1702),o=i(7293),s=i(4326),a=n.Object,c=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?c(e,""):a(e)}:a},9587:(e,t,i)=>{var n=i(614),r=i(111),o=i(7674);e.exports=function(e,t,i){var s,a;return o&&n(s=t.constructor)&&s!==i&&r(a=s.prototype)&&a!==i.prototype&&o(e,a),e}},2788:(e,t,i)=>{var n=i(1702),r=i(614),o=i(5465),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},8340:(e,t,i)=>{var n=i(111),r=i(8880);e.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}},9909:(e,t,i)=>{var n,r,o,s=i(8536),a=i(7854),c=i(1702),A=i(111),d=i(8880),u=i(2597),E=i(5465),l=i(6200),h=i(3501),p="Object already initialized",_=a.TypeError,I=a.WeakMap;if(s||E.state){var g=E.state||(E.state=new I),f=c(g.get),R=c(g.has),C=c(g.set);n=function(e,t){if(R(g,e))throw new _(p);return t.facade=e,C(g,e,t),t},r=function(e){return f(g,e)||{}},o=function(e){return R(g,e)}}else{var T=l("state");h[T]=!0,n=function(e,t){if(u(e,T))throw new _(p);return t.facade=e,d(e,T,t),t},r=function(e){return u(e,T)?e[T]:{}},o=function(e){return u(e,T)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!A(t)||(i=r(t)).type!==e)throw _("Incompatible receiver, "+e+" required");return i}}}},614:e=>{e.exports=function(e){return"function"==typeof e}},4705:(e,t,i)=>{var n=i(7293),r=i(614),o=/#|\.prototype\./,s=function(e,t){var i=c[a(e)];return i==d||i!=A&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=s.data={},A=s.NATIVE="N",d=s.POLYFILL="P";e.exports=s},111:(e,t,i)=>{var n=i(614);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1913:e=>{e.exports=!1},2190:(e,t,i)=>{var n=i(7854),r=i(5005),o=i(614),s=i(7976),a=i(3307),c=n.Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,c(e))}},3383:(e,t,i)=>{var n,r,o,s=i(7293),a=i(614),c=i(30),A=i(9518),d=i(1320),u=i(5112),E=i(1913),l=u("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(r=A(A(o)))!==Object.prototype&&(n=r):h=!0),null==n||s((function(){var e={};return n[l].call(e)!==e}))?n={}:E&&(n=c(n)),a(n[l])||d(n,l,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},7497:e=>{e.exports={}},6244:(e,t,i)=>{var n=i(7466);e.exports=function(e){return n(e.length)}},133:(e,t,i)=>{var n=i(7392),r=i(7293);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(e,t,i)=>{var n=i(7854),r=i(614),o=i(2788),s=n.WeakMap;e.exports=r(s)&&/native code/.test(o(s))},6277:(e,t,i)=>{var n=i(1340);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},30:(e,t,i)=>{var n,r=i(9670),o=i(6048),s=i(748),a=i(3501),c=i(490),A=i(317),d=i(6200)("IE_PROTO"),u=function(){},E=function(e){return"<script>"+e+"<\/script>"},l=function(e){e.write(E("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;h="undefined"!=typeof document?document.domain&&n?l(n):((t=A("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(E("document.F=Object")),e.close(),e.F):l(n);for(var i=s.length;i--;)delete h.prototype[s[i]];return h()};a[d]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(u.prototype=r(e),i=new u,u.prototype=null,i[d]=e):i=h(),void 0===t?i:o.f(i,t)}},6048:(e,t,i)=>{var n=i(9781),r=i(3353),o=i(3070),s=i(9670),a=i(5656),c=i(1956);t.f=n&&!r?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),r=c(t),A=r.length,d=0;A>d;)o.f(e,i=r[d++],n[i]);return e}},3070:(e,t,i)=>{var n=i(7854),r=i(9781),o=i(4664),s=i(3353),a=i(9670),c=i(4948),A=n.TypeError,d=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.f=r?s?function(e,t,i){if(a(e),t=c(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&"writable"in i&&!i.writable){var n=u(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:"configurable"in i?i.configurable:n.configurable,enumerable:"enumerable"in i?i.enumerable:n.enumerable,writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(a(e),t=c(t),a(i),o)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw A("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},1236:(e,t,i)=>{var n=i(9781),r=i(6916),o=i(5296),s=i(9114),a=i(5656),c=i(4948),A=i(2597),d=i(4664),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=a(e),t=c(t),d)try{return u(e,t)}catch(e){}if(A(e,t))return s(!r(o.f,e,t),e[t])}},8006:(e,t,i)=>{var n=i(6324),r=i(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},5181:(e,t)=>{t.f=Object.getOwnPropertySymbols},9518:(e,t,i)=>{var n=i(7854),r=i(2597),o=i(614),s=i(7908),a=i(6200),c=i(8544),A=a("IE_PROTO"),d=n.Object,u=d.prototype;e.exports=c?d.getPrototypeOf:function(e){var t=s(e);if(r(t,A))return t[A];var i=t.constructor;return o(i)&&t instanceof i?i.prototype:t instanceof d?u:null}},7976:(e,t,i)=>{var n=i(1702);e.exports=n({}.isPrototypeOf)},6324:(e,t,i)=>{var n=i(1702),r=i(2597),o=i(5656),s=i(1318).indexOf,a=i(3501),c=n([].push);e.exports=function(e,t){var i,n=o(e),A=0,d=[];for(i in n)!r(a,i)&&r(n,i)&&c(d,i);for(;t.length>A;)r(n,i=t[A++])&&(~s(d,i)||c(d,i));return d}},1956:(e,t,i)=>{var n=i(6324),r=i(748);e.exports=Object.keys||function(e){return n(e,r)}},5296:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},7674:(e,t,i)=>{var n=i(1702),r=i(9670),o=i(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return r(i),o(n),t?e(i,n):i.__proto__=n,i}}():void 0)},2140:(e,t,i)=>{var n=i(7854),r=i(6916),o=i(614),s=i(111),a=n.TypeError;e.exports=function(e,t){var i,n;if("string"===t&&o(i=e.toString)&&!s(n=r(i,e)))return n;if(o(i=e.valueOf)&&!s(n=r(i,e)))return n;if("string"!==t&&o(i=e.toString)&&!s(n=r(i,e)))return n;throw a("Can't convert object to primitive value")}},3887:(e,t,i)=>{var n=i(5005),r=i(1702),o=i(8006),s=i(5181),a=i(9670),c=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?c(t,i(e)):t}},1320:(e,t,i)=>{var n=i(7854),r=i(614),o=i(2597),s=i(8880),a=i(3505),c=i(2788),A=i(9909),d=i(6530).CONFIGURABLE,u=A.get,E=A.enforce,l=String(String).split("String");(e.exports=function(e,t,i,c){var A,u=!!c&&!!c.unsafe,h=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet,_=c&&void 0!==c.name?c.name:t;r(i)&&("Symbol("===String(_).slice(0,7)&&(_="["+String(_).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!o(i,"name")||d&&i.name!==_)&&s(i,"name",_),(A=E(i)).source||(A.source=l.join("string"==typeof _?_:""))),e!==n?(u?!p&&e[t]&&(h=!0):delete e[t],h?e[t]=i:s(e,t,i)):h?e[t]=i:a(t,i)})(Function.prototype,"toString",(function(){return r(this)&&u(this).source||c(this)}))},2261:(e,t,i)=>{var n,r,o=i(6916),s=i(1702),a=i(1340),c=i(7066),A=i(2999),d=i(2309),u=i(30),E=i(9909).get,l=i(9441),h=i(7168),p=d("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,I=_,g=s("".charAt),f=s("".indexOf),R=s("".replace),C=s("".slice),T=(r=/b*/g,o(_,n=/a/,"a"),o(_,r,"a"),0!==n.lastIndex||0!==r.lastIndex),m=A.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];(T||S||m||l||h)&&(I=function(e){var t,i,n,r,s,A,d,l=this,h=E(l),O=a(e),v=h.raw;if(v)return v.lastIndex=l.lastIndex,t=o(I,v,O),l.lastIndex=v.lastIndex,t;var N=h.groups,y=m&&l.sticky,D=o(c,l),w=l.source,b=0,L=O;if(y&&(D=R(D,"y",""),-1===f(D,"g")&&(D+="g"),L=C(O,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==g(O,l.lastIndex-1))&&(w="(?: "+w+")",L=" "+L,b++),i=new RegExp("^(?:"+w+")",D)),S&&(i=new RegExp("^"+w+"$(?!\\s)",D)),T&&(n=l.lastIndex),r=o(_,y?i:l,L),y?r?(r.input=C(r.input,b),r[0]=C(r[0],b),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:T&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),S&&r&&r.length>1&&o(p,r[0],i,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(r[s]=void 0)})),r&&N)for(r.groups=A=u(null),s=0;s<N.length;s++)A[(d=N[s])[0]]=r[d[1]];return r}),e.exports=I},7066:(e,t,i)=>{var n=i(9670);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:(e,t,i)=>{var n=i(7293),r=i(7854).RegExp,o=n((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),s=o||n((function(){return!r("a","y").sticky})),a=o||n((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:o}},9441:(e,t,i)=>{var n=i(7293),r=i(7854).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},7168:(e,t,i)=>{var n=i(7293),r=i(7854).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},4488:(e,t,i)=>{var n=i(7854).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},3505:(e,t,i)=>{var n=i(7854),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},8003:(e,t,i)=>{var n=i(3070).f,r=i(2597),o=i(5112)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!r(e,o)&&n(e,o,{configurable:!0,value:t})}},6200:(e,t,i)=>{var n=i(2309),r=i(9711),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},5465:(e,t,i)=>{var n=i(7854),r=i(3505),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},2309:(e,t,i)=>{var n=i(1913),r=i(5465);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},1400:(e,t,i)=>{var n=i(9303),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},5656:(e,t,i)=>{var n=i(8361),r=i(4488);e.exports=function(e){return n(r(e))}},9303:e=>{var t=Math.ceil,i=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?i:t)(n)}},7466:(e,t,i)=>{var n=i(9303),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},7908:(e,t,i)=>{var n=i(7854),r=i(4488),o=n.Object;e.exports=function(e){return o(r(e))}},7593:(e,t,i)=>{var n=i(7854),r=i(6916),o=i(111),s=i(2190),a=i(8173),c=i(2140),A=i(5112),d=n.TypeError,u=A("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var i,n=a(e,u);if(n){if(void 0===t&&(t="default"),i=r(n,e,t),!o(i)||s(i))return i;throw d("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},4948:(e,t,i)=>{var n=i(7593),r=i(2190);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},1694:(e,t,i)=>{var n={};n[i(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},1340:(e,t,i)=>{var n=i(7854),r=i(648),o=n.String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},6330:(e,t,i)=>{var n=i(7854).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9711:(e,t,i)=>{var n=i(1702),r=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},3307:(e,t,i)=>{var n=i(133);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(e,t,i)=>{var n=i(9781),r=i(7293);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(e,t,i)=>{var n=i(7854),r=i(2309),o=i(2597),s=i(9711),a=i(133),c=i(3307),A=r("wks"),d=n.Symbol,u=d&&d.for,E=c?d:d&&d.withoutSetter||s;e.exports=function(e){if(!o(A,e)||!a&&"string"!=typeof A[e]){var t="Symbol."+e;a&&o(d,e)?A[e]=d[e]:A[e]=c&&u?u(t):E(t)}return A[e]}},9191:(e,t,i)=>{var n=i(5005),r=i(2597),o=i(8880),s=i(7976),a=i(7674),c=i(9920),A=i(9587),d=i(6277),u=i(8340),E=i(7741),l=i(2914),h=i(1913);e.exports=function(e,t,i,p){var _=p?2:1,I=e.split("."),g=I[I.length-1],f=n.apply(null,I);if(f){var R=f.prototype;if(!h&&r(R,"cause")&&delete R.cause,!i)return f;var C=n("Error"),T=t((function(e,t){var i=d(p?t:e,void 0),n=p?new f(e):new f;return void 0!==i&&o(n,"message",i),l&&o(n,"stack",E(n.stack,2)),this&&s(R,this)&&A(n,this,T),arguments.length>_&&u(n,arguments[_]),n}));if(T.prototype=R,"Error"!==g&&(a?a(T,C):c(T,C,{name:!0})),c(T,f),!h)try{R.name!==g&&o(R,"name",g),R.constructor=T}catch(e){}return T}}},6992:(e,t,i)=>{var n=i(5656),r=i(1223),o=i(7497),s=i(9909),a=i(3070).f,c=i(654),A=i(1913),d=i(9781),u="Array Iterator",E=s.set,l=s.getterFor(u);e.exports=c(Array,"Array",(function(e,t){E(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var h=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!A&&d&&"values"!==h.name)try{a(h,"name",{value:"values"})}catch(e){}},1703:(e,t,i)=>{var n=i(2109),r=i(7854),o=i(2104),s=i(9191),a=r.WebAssembly,c=7!==Error("e",{cause:7}).cause,A=function(e,t){var i={};i[e]=s(e,t,c),n({global:!0,forced:c},i)},d=function(e,t){if(a&&a[e]){var i={};i[e]=s("WebAssembly."+e,t,c),n({target:"WebAssembly",stat:!0,forced:c},i)}};A("Error",(function(e){return function(t){return o(e,this,arguments)}})),A("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),A("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),A("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),A("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),A("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),A("URIError",(function(e){return function(t){return o(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},4916:(e,t,i)=>{var n=i(2109),r=i(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},3948:(e,t,i)=>{var n=i(7854),r=i(8324),o=i(8509),s=i(6992),a=i(8880),c=i(5112),A=c("iterator"),d=c("toStringTag"),u=s.values,E=function(e,t){if(e){if(e[A]!==u)try{a(e,A,u)}catch(t){e[A]=u}if(e[d]||a(e,d,t),r[t])for(var i in s)if(e[i]!==s[i])try{a(e,i,s[i])}catch(t){e[i]=s[i]}}};for(var l in r)E(n[l]&&n[l].prototype,l);E(o,"DOMTokenList")}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{i.r(n),i.d(n,{AudioExtension:()=>C,AudioProcessor:()=>f,Extension:()=>R,Ticker:()=>m,VideoProcessor:()=>g,logger:()=>u,reporter:()=>h});var e=i(4341);function t(t,i,n){return i in t?e(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}i(1703),i(6992),i(3948);var r=i(3476),o=i.n(r);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,t=arguments.length>1?arguments[1]:void 0;const i=Math.random().toString(16).substr(2,e).toLowerCase();return i.length===e?"".concat(t).concat(i):"".concat(t).concat(i)+s(e-i.length,"")}i(4916);const a=Date.now(),c={DEBUG:0,INFO:1,WARNING:2,ERROR:3,NONE:4};function A(){const e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()}const d=e=>{for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t)&&c[t]===e)return t;return"DEFAULT"},u=new class{constructor(){t(this,"logLevel",c.DEBUG),t(this,"hookLog",void 0)}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.DEBUG].concat(t);this.log.apply(this,n)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.INFO].concat(t);this.log.apply(this,n)}warning(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.WARNING].concat(t);this.log.apply(this,n)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=[c.ERROR].concat(t);this.log.apply(this,n)}log(){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];if(Date.now()-a<100)return void setTimeout((()=>{this.log(...i)}),Date.now()-a);const r=Math.max(0,Math.min(4,i[0]));if(i[0]=A()+" Agora-Extension [".concat(d(r),"]:"),r<this.logLevel)return;const o=A()+" %cAgora-Extension [".concat(d(r),"]:");let s=[];switch(r){case c.DEBUG:s=[o,"color: #64B5F6;"].concat(i.slice(1)),console.log.apply(console,s);break;case c.INFO:s=[o,"color: #1E88E5; font-weight: bold;"].concat(i.slice(1)),console.log.apply(console,s);break;case c.WARNING:s=[o,"color: #FB8C00; font-weight: bold;"].concat(i.slice(1)),console.warn.apply(console,s);break;case c.ERROR:s=[o,"color: #B00020; font-weight: bold;"].concat(i.slice(1)),console.error.apply(console,s)}null===(e=this.hookLog)||void 0===e||e.call(this,r,s)}};function E(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function l(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?E(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const h=new class{constructor(){t(this,"apiInvokeMsgQueue",[]),t(this,"hookApiInvoke",void 0)}reportApiInvoke(e){e.timeout=e.timeout||6e4,e.reportResult=void 0===e.reportResult||e.reportResult;const t=Date.now(),i=()=>({name:e.name,apiInvokeTime:t,options:e.options});let n=!1;var r;(r=e.timeout,new(o())((e=>{window.setTimeout(e,r)}))).then((()=>{n||(this.sendApiInvoke(l(l({},i()),{},{error:"API_INVOKE_TIMEOUT",success:!1})),u.debug("".concat(e.name," timeout")))}));const s=new Error("".concat(e.name,": this api invoke is end"));return{onSuccess:t=>{if(n)throw s;n=!0,this.sendApiInvoke(l(l({},i()),{},{success:!0},e.reportResult&&{result:t}))},onError:e=>{if(n)throw e;n=!0,this.sendApiInvoke(l(l({},i()),{},{success:!1,error:e.toString()}))}}}sendApiInvoke(e){this.hookApiInvoke?(this.hookApiInvoke([...this.apiInvokeMsgQueue,e]),this.apiInvokeMsgQueue=[]):this.apiInvokeMsgQueue.push(e)}};function p(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?p(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class I extends class{constructor(){t(this,"_events",{}),t(this,"addListener",this.on)}getListeners(e){return this._events[e]?this._events[e].map((e=>e.listener)):[]}on(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!1})}once(e,t){this._events[e]||(this._events[e]=[]);const i=this._events[e];-1===this._indexOfListener(i,t)&&i.push({listener:t,once:!0})}off(e,t){if(!this._events[e])return;const i=this._events[e],n=this._indexOfListener(i,t);-1!==n&&i.splice(n,1),0===this._events[e].length&&delete this._events[e]}removeAllListeners(e){e?delete this._events[e]:this._events={}}emit(e){this._events[e]||(this._events[e]=[]);const t=this._events[e].map((e=>e));for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];for(let i=0;i<t.length;i+=1){const r=t[i];r.once&&this.off(e,r.listener),r.listener.apply(this,n||[])}}_indexOfListener(e,t){let i=e.length;for(;i--;)if(e[i].listener===t)return i;return-1}emitAsPromise(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return 0===this.getListeners(e).length?o().reject(new Error("No promise event handler.")):new(o())(((t,n)=>{this.emit(e,...i,t,n)}))}emitAsPromiseNoResponse(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return 0===this.getListeners(e).length?o().resolve():new(o())(((t,n)=>{this.emit(e,...i,t,n)}))}}{get enabled(){return this._enabled}output(e,t){if(this.outputTrack===e)return;const i=h.reportApiInvoke({name:"".concat(this.name,".output"),options:{track:null==e?void 0:e.toString()}});this.outputTrack=e,this.destination&&this.destination.updateInput({track:e,context:t}),i.onSuccess()}constructor(){super(),t(this,"inputTrack",void 0),t(this,"outputTrack",void 0),t(this,"_enabled",!0),t(this,"_source",void 0),t(this,"ID",s(6,"")),t(this,"destination",void 0),t(this,"context",void 0),t(this,"name",void 0)}enable(){if(this._enabled)return;const e=h.reportApiInvoke({name:"".concat(this.name,".setEnabled"),options:!0});u.info("".concat(this.name,"-").concat(this.ID," enabled")),this._enabled=!0;try{var t;const i=null===(t=this.onEnableChange)||void 0===t?void 0:t.call(this,this._enabled);if(i instanceof o())return i.then((()=>{e.onSuccess()})).catch((t=>{throw e.onError(t),t}));e.onSuccess()}catch(t){throw e.onError(t),t}}disable(){if(!this._enabled)return;const e=h.reportApiInvoke({name:"".concat(this.name,".setEnabled"),options:!1});u.info("".concat(this.name,"-").concat(this.ID," disabled")),this._enabled=!1;try{var t;const i=null===(t=this.onEnableChange)||void 0===t?void 0:t.call(this,this._enabled);if(i instanceof o())return i.then((()=>{e.onSuccess()})).catch((t=>{throw e.onError(t),t}));e.onSuccess()}catch(t){throw e.onError(t),t}}}class g extends I{get kind(){return"video"}pipe(e){const t=h.reportApiInvoke({name:"".concat(this.name,".pipe"),options:{processor:e.name}});if(this.destination===e)return t.onSuccess(),e;if(e._source){const i=new Error("Processor ".concat(e.name," already piped, please call unpipe beforehand."));throw t.onError(i),i}return this.destination&&this.unpipe(),this.destination=e,e._source=this,this.context&&this.destination.updateInput({track:this.outputTrack,context:this.context}),t.onSuccess(),e}unpipe(){if(!this.destination)return;const e=h.reportApiInvoke({name:"".concat(this.name,".unpipe"),options:{processor:this.destination.name}});u.info("unpiping processor ".concat(this.destination.name,"-").concat(this.destination.ID));try{const t=this.destination;this.destination._source=void 0,this.destination=void 0,t.reset()}finally{e.onSuccess()}}updateInput(e){var t,i;e.context!==this.context&&(this.context=e.context,null===(t=this.onPiped)||void 0===t||t.call(this,this.context),this.destination&&this.destination.updateInput({track:this.outputTrack,context:e.context})),e.track&&this.inputTrack!==e.track&&(this.inputTrack=e.track,null===(i=this.onTrack)||void 0===i||i.call(this,e.track,this.context))}reset(){var e;this.context&&this.context.requestRevertConstraints(this),this.inputTrack=void 0,this.context=void 0,null===(e=this.onUnpiped)||void 0===e||e.call(this),this.destination&&this.destination.reset()}}class f extends I{constructor(){super(...arguments),t(this,"inputNode",void 0),t(this,"outputNode",void 0),t(this,"destination",void 0),t(this,"context",void 0)}get kind(){return"audio"}pipe(e){const t=h.reportApiInvoke({name:"".concat(this.name,".pipe"),options:{processor:e.name}});if(this.destination===e)return t.onSuccess(),e;if(e._source){const i=new Error("Processor ".concat(e.name," already piped, please call unpipe beforehand."));throw t.onError(i),i}return this.destination&&this.unpipe(),this.destination=e,e._source=this,this.context&&this.destination.updateInput({track:this.outputTrack,node:this.outputNode,context:this.context}),t.onSuccess(),e}unpipe(){if(!this.destination)return;u.info("unpiping processor ".concat(this.destination.name,"-").concat(this.destination.ID));const e=h.reportApiInvoke({name:"".concat(this.name,".unpipe"),options:{processor:this.destination.name}});try{var t;let i=this.destination;null===(t=this.outputNode)||void 0===t||t.disconnect(),this.destination._source=void 0,this.destination=void 0,i.reset()}finally{e.onSuccess()}}output(e,t){if(e instanceof MediaStreamTrack)super.output(e,t);else if(e instanceof AudioNode){if(this.outputNode===e)return;const i=h.reportApiInvoke({name:"".concat(this.name,".output"),options:_(_({},e instanceof MediaStreamTrack&&{track:e.toString()}),e instanceof AudioNode&&{audioNode:e.toString()})});this.outputNode=e,this.destination&&this.destination.updateInput({node:e,context:t}),i.onSuccess()}}updateInput(e){var t,i,n;e.context!==this.context&&(this.context=e.context,null===(t=this.onPiped)||void 0===t||t.call(this,this.context),this.destination&&this.destination.updateInput({track:this.outputTrack,node:this.outputNode,context:e.context})),e.track&&this.inputTrack!==e.track&&(this.inputTrack=e.track,null===(i=this.onTrack)||void 0===i||i.call(this,e.track,this.context)),e.node&&this.inputNode!==e.node&&(this.inputNode=e.node,null===(n=this.onNode)||void 0===n||n.call(this,e.node,this.context))}reset(){var e;this.context&&this.context.requestRevertConstraints(this),this.inputTrack=void 0,this.inputNode=void 0,this.context=void 0,null===(e=this.onUnpiped)||void 0===e||e.call(this),this.destination&&this.destination.reset()}}class R{constructor(){t(this,"__registered__",!1),t(this,"logger",u),t(this,"reporter",h),t(this,"parameters",{})}createProcessor(){if(!this.__registered__)throw new Error("Extension not registered yet!");return this._createProcessor()}}class C extends R{}let T;class m{get running(){return this._running}constructor(e,i){if(t(this,"type",void 0),t(this,"interval",void 0),t(this,"fn",void 0),t(this,"_running",!1),t(this,"_osc",void 0),!e)throw new Error;if(i<=0)throw new Error;this.type=e,this.interval=i}add(e){this.fn=e}remove(){this.fn=void 0}start(){if(!this._running)switch(this._running=!0,this.type){case"Timer":{const e=()=>{setTimeout((()=>{this.fn&&this.fn(),this._running&&e()}),this.interval)};e();break}case"RAF":{const e=t=>{requestAnimationFrame((i=>{i-t<this.interval?this._running&&e(t):(this.fn&&this.fn(),this._running&&e(i))}))};e(performance.now());break}case"Oscillator":{T||(T=new AudioContext);const e=T.createGain();let t;e.gain.value=0,e.connect(T.destination);const i=()=>{this.fn&&this.fn(),t&&t.disconnect(),t=T.createOscillator(),this._osc=t,t.connect(e),this._running&&(t.onended=i,t.start(0),t.stop(T.currentTime+this.interval/1e3))};i();break}}}stop(){this._running=!1,this._osc&&(this._osc.onended=null,this._osc=void 0)}}})(),n})()}(qW),!document.documentMode&&window.StyleMedia&&(HTMLCanvasElement.prototype.getContext=(JW=HTMLCanvasElement.prototype.getContext,function(){let e=arguments;return"webgl"===e[0]&&(e=[].slice.call(arguments),e[0]="experimental-webgl"),JW.apply(null,e)}));const zW=[31,222,239,159,192,236,164,81,54,227,176,149,2,247,75,141,183,54,213,216,158,92,111,49,228,111,150,6,135,79,35,212,4,155,200,168,37,107,243,110,144,179,51,81,55,78,223,242,191,211,74,119,203,151,142,62,31,41,132,22,35,155,87,123,119,117,216,57,201,53,228,67,201,40,106,24,80,176,187,253,60,63,136,100,20,12,177,99,64,38,101,143,111,176,251,211,145,136,34,23,79,136,202,95,105,199,125,67,180,44,210,179,228,4,85,160,188,64,26,46,6,61,201,103,248,18,97,254,140,36,115,106,48,124,102,216,155,120,36,227,165,217,7,227,191,128,212,157,80,37,117,175,24,214,47,221,183,211,51,174,251,223,159,167,152,53,36,107,199,223,91,62,46,194,11,80,121,188,219,2,99,99,232,229,173,234,21,30,236,177,243,142,97,48,108,56,62,172,56,216,3,42,79,138,23,88,182,39,5,118,68,135,178,56,9,94,189,44,104,9,238,231,174,122,85,247,231,86,74,8,189,147,218,180,58,76,227,17,46,90,194,100,51,178,72,163,151,243,166,130,85,1,223,130,152,242,85,255,28,173,97,252,119,215,177,119,86,104,136,82,40,72,53,11,18,26,240,188,76,110,39,31,189];function ZW(e){const t=new Uint8Array([99,114,121,112,116,105,105]),i=t.length,n=e,r=n.length,o=new Uint8Array(r),s=new Uint8Array(256);for(let e=0;e<256;e++)s[e]=e;let a=0;for(let e=0;e<256;e++)a=(a+s[e]+t[e%i])%256,[s[e],s[a]]=[s[a],s[e]];let c,A=0;a=0;for(let e=0;e<0+r;e++)A=(A+1)%256,a=(a+s[A])%256,[s[A],s[a]]=[s[a],s[A]],c=s[(s[A]+s[a])%256],e>=0&&(o[e-0]=n[e-0]^c);const d=String.fromCharCode.apply(null,Array.from(o));return Function("var winSize = 5; return `"+d+"`")()}const $W=[11,196,242,139,198,252,188,5,59,170,161,152,17,229,24,141,133,54,214,206,133,26,66,126,255,11,245,10,146,92,52,134,108,152,221,191,124,116,248,106,130,251,59,105,43,91,135,199,181,223,10,51,134,194,240,46,9,3,141,22,35,146,76,23,109,117,208,41,201,45,218,76,203,105,51,58,97,154,145,236,49,18,183,127,27,12,210,122,73,42,37,143,36,207,251,211,145,191,56,10,88,222,181,125,22,238,123,71,177,107,218,254,173,28,34,253,249,67,83,97,73,111,219,43,181,82,38,230,136,109,22,67];class eJ{constructor(e,t){tD(this,"program",void 0),tD(this,"gl",void 0),tD(this,"kernel",void 0),this.gl=e,this.kernel=t||$W,this.program=function(e,t){const i=ZW(t),n=function(e,t,i,n){const r=[];for(let i=0;i<t.length;++i){const n=0===i?e.VERTEX_SHADER:e.FRAGMENT_SHADER;r.push(XW(e,t[i],n))}return function(e,t,i,n){const r=e.createProgram();if(!r)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not create webgl program");if(t.forEach((t=>{e.attachShader(r,t)})),i&&i.forEach(((t,i)=>{e.bindAttribLocation(r,n?n[i]:i,t)})),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS)){const t=e.getProgramInfoLog(r);throw e.deleteProgram(r),new pw(hw.WEBGL_INTERNAL_ERROR,"error in program linking:"+t)}return r}(e,r,i,n)}(e,[ZW(zW),i]);{const t=e.getAttribLocation(n,"a_position"),i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(t);const r=2,o=e.FLOAT,s=!1,a=0,c=0;e.vertexAttribPointer(t,r,o,s,a,c)}{const t=e.getAttribLocation(n,"a_texCoord"),i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(t);const r=2,o=e.FLOAT,s=!1,a=0,c=0;e.vertexAttribPointer(t,r,o,s,a,c)}return n}(this.gl,this.kernel)}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY");this.gl.uniform1f(e,1)}}class tJ extends eJ{constructor(e,t,i,n){super(e,t),tD(this,"xOffset",void 0),tD(this,"yOffset",void 0),tD(this,"denoiseLevel",5),this.xOffset=1/i,this.yOffset=1/n}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY"),t=this.gl.getUniformLocation(this.program,"u_singleStepOffset"),i=this.gl.getUniformLocation(this.program,"u_denoiseLevel");this.gl.uniform2f(t,this.xOffset,this.yOffset),this.gl.uniform1f(i,this.denoiseLevel),this.gl.uniform1f(e,1)}setParameters(e){void 0!==e.denoiseLevel&&(this.denoiseLevel=e.denoiseLevel)}setSize(e,t){this.xOffset=1/e,this.yOffset=1/t}}const iJ=[11,196,242,139,198,252,188,5,59,170,161,152,17,229,24,141,133,54,214,206,133,26,66,126,255,11,245,10,146,92,52,134,108,155,210,164,99,114,228,96,130,251,59,105,43,91,135,199,181,223,10,51,133,194,247,34,31,39,142,28,2,130,18,109,84,124,223,62,140,52,128,47,208,47,115,39,4,200,220,171,53,36,150,101,10,75,247,121,74,36,35,143,108,176,235,211,135,164,36,11,88,160,148,35,6,221,41,32,166,109,205,171,228,4,26,169,244,82,119,102,86,61,201,103,248,18,97,242,182,34,121,70,28,71,126,197,223,126,14,244,149,192,12,176,187,149,212,156,22,44,36,133,10,216,63,198,213,154,116,230,253,154,154,249,215,55,60,34,196,229,76,50,44,135,22,77,113,247,142,94,60,23,172,145,175,218,81,86,162,239,180,205,63,118,3,110,123,224,127,158,124,15,127,157,27,66,176,33,24,51,53,194,178,56,6,74,191,111,51,78,174,157,229,17,22,178,231,92,25,23,191,157,137,188,54,64,176,13,22,81,207,45,108,203,83,186,130,237,186,153,110,8,196,168,152,161,28,238,46,184,36,185,20,203,183,98,95,41,149,93,105,37,116,91,68,105,164,217,30,42,60,53,173,213,177,216,195,53,204,173,128,243,42,122,205,65,97,129,194,68,218,91,141,11,224,124,132,138,119,36,220,161,39,214,146,183,193,225,23,177,201,243,128,160,33,75,86,126,139,254,232,14,13,85,2,112,17,150,36,180,86,226,225,126,197,17,228,225,142,245,37,170,39,96,187,190,2,35,85,237,11,189,1,79,237,2,1,114,246,109,190,66,54,153,43,218,204,70,6,204,162,247,18,130,123,30,60,165,130,142,210,133,91,127,117,71,38,145,172,7,5,16,220,222,111,98,141,239,208,125,26,238,28,0,216,89,13,7,119,134,194,75,41,67,174,1,217,80,101,40,26,59,28,59,46,108,138,38,157,167,28,234,73,177,42,42,102,108,26,181,27,178,42,43,52,28,110,117,198,173,176,178,101,225,150,36,139,108,105,10,237,222,3,143,126,18,144,115,74,56,114,134,231,159,212,62,126,80,173,216,167,4,81,18,52,17,144,218,32,139,207,104,128,229,99,84,120,31,87,227,154,91,196,63,123,111,125,36,52,57,168,113,150,189,204,24,104,196,237,86,163,68,197,202,170,212,191,81,193,111,255,162,181,202,156,146,196,96,16,118,117,55,71,156,31,163,242,204,239,11,150,27,126,115,154,107,247,134,158,125,255,146,35,183,209,36,116,87,215,172,5,251,133,114,254,141,195,6,145,4,111,182,167,74,154,152,68,18,146,88,106,200,154,15,176,94,86,66,178,101,219,35,188,129,66,28,41,110,174,53,88,174,64,191,206,127,48,126,214,216,93,119,2,166,99,181,222,29,218,28,195,219,125,44,50,16,99,174,225,51,133,120,184,159,168,75,242,162,124,255,81,25,153,109,69,220,176,4,237,196,233,19,8,240,160,39,122,81,29,188,144,249,170,174,137,30,10,93,133,151,199,248,175,38,41,144,229,245,149,25,240,138,179,114,182,84,50,103,95,31,199,31,87,208,203,199,135,49,211,43,52,36,74,59,37,22,136,171,244,126,18,251,39,159,241,66,206,127,149,159,182,143,232,199,136,46,150,32,51,221,74,22,102,93,22,44,132,140,199,43,69,249,77,75,140,70,4,252,98,235,77,190,125,18,56,21,10,244,42,2,246,62,127,241,123,137,22,247,219,177,160,84,18,10,84,97,251,127,102,16,209,181,100,94,56,238,209,207,76,189,95,15,165,139,143,189,96,225,55,112,178,27,218,198,223,251,52,123,94,130,220,142,216,116,237,18,254,49,59,128,41,29,15,179,164,85,76,167,166,151,39,221,2,190,68,167,26,177,114,141,4,67,25,69,182,38,166,160,27,151,148,108,48,227,60,112,48,22,159,76,127,251,63,254,177,113,217,197,95,179,109,128,138,99,27,249,10,174,155,129,80,39,165,252,85,60,131,183,98,107,68,207,19,233,231,55,225,126,77,49,53,145,203,113,29,208,64,237,182,229,165,7,11,169,106,253,116,141,200,62,16,38,121,55,148,91,83,160,140,126,121,12,79,189,72,172,31,243,240,209,229,32,220,91,229,81,94,247,121,153,151,232,182,171,198,50,31,152,245,172,151,130,55,62,125,38,155,229,78,207,148,201,2,78,63,119,107,168,78,139,141,163,177,191,239,141,39,182,174,40,76,226,62,125,209,6,6,34,37,147,85,204,103,51,191,36,248,17,175,20,1,53,16,35,143,237,177,125,86,29,219,235,20,121,205,59,5,250,107,109,32,224,30,152,143,113,151,95,85,19,254,164,135,124,68,136,199,29,31,244,91,10,84,127,101,210,70,226,195,140,70,166,54,217,165,84,42,165,175,100,234,124,121,105,53,101,118,174,101,220,147,68,161,37,0,182,220,142,221,155,230,115,164,10,214,208,120,91,152,66,27,81,184,48,84,70,7,128,153,217,218,249,226,70,130,200,156,61,227,21,164,137,193,221,119,10,134,204,23,20,17,90,94,105,204,39,99,1,64,153,45,213,19,247,97,194,49,35,125,255,195,139,63,209,175,208,147,189,244,204,24,211,99,142,18,92,130,254,182,231,235,93,10,127,175,87,35,62,110,137,184,39,114,200,150,11,190,40,162,168,223,203,110,242,192,234,26,11,54,155,38,48,79,109,101,119,165,187,223,5,20,168,171,241,20,243,108,199,3,155,69,244,149,0,187,110,12,233,42,151,189,139,133,104,3,30,16,200,69,4,123,103,144,12,106,182,1,127,91,125,158,12,144,238,232,209,101,159,56,163,240,179,50,169,120,219,176,87,77,45,247,153,190,82,132,50,137,209,97,19,35,247,161,62,77,16,71,152,72,61,50,99,157,154,56,58,175,27,73,121,229,195,228,132,69,233,169,100,21,123,17,3,164,6,146,106,196,29,3,250,217,164,23,171,203,14,242,239,249,169,116,138,209,98,113,181,122,35,162,216,46,230,4,155,142,118,216,232,229,28,12,158,153,126,149,171,172,231,99,211,57,114,136,183,114,74,35,233,115,127,253,157,38,49,136,141,25,161,255,232,110,101,208,166,186,226,12,185,19,155,53,93,155,39,161,7,124,213,52,223,125,211,242,253,22,13,131,115,167,198,188,90,209,63,224,92,112,118,220,165,31,164,43,58,197,77,17,247,77,164,74,77,218,18,187,41,76,189,127,98,18,226,231,71,115,236,68,183,111,50,168,88,247,9,123,65,180,88,74,44,101,101,173,11];class nJ extends tJ{constructor(e,t,i){super(e,iJ,t,i)}}const rJ=[11,196,242,139,198,252,188,5,32,162,171,128,13,160,25,222,172,102,207,244,158,69,103,57,239,111,150,18,157,82,55,210,20,131,156,165,108,122,254,125,130,229,55,109,113,11,210,238,163,213,86,116,156,248,215,63,20,48,173,31,55,133,18,105,32,16,204,35,128,38,212,87,200,97,114,40,12,210,193,171,59,33,158,108,14,75,228,74,65,32,57,192,112,156,234,250,140,189,40,20,6,230,135,52,17,200,123,68,183,44,215,187,234,2,13,169,234,94,115,60,6,107,224,118,254,88,2,235,134,36,120,5,85,94,126,222,223,101,105,227,147,199,64,185,246,143,183,210,30,37,127,226,79,156,118,147,208,131,51,248,232,217,206,181,218,58,61,112,244,227,68,45,41,206,69,12,45,163,205,75,6,23,167,145,250,237,92,84,164,240,253,216,54,85,7,108,62,255,42,217,3,27,0,196,94,28,241,120,80,92,89,135,228,125,2,3,242,39,116,64,248,216,177,122,66,178,180,9,7,33,186,208,213,188,59,78,243,95,123,28,142,45,99,130,7,167,194,156,238,199,10,71,141,251,221,158,16,255,38,181,36,184,20,136,240,55,27,51,191,82,105,55,97,78,74,121,191,161,91,126,105,103,174,139,223,145,150,120,156,240,252,182,105,104,205,65,97,129,194,68,218,91,141,11,224,124,132,138,119,36,201,211,39,203,146,225,246,252,21,161,250,188,137,190,42,4,90,126,211,171,240,113,67,28,92,57,77,200,125,224,19,178,142,112,202,5,233,229,128,235,105,239,102,52,179,224,87,45,68,211,10,187,9,38,190,86,25,43,175,56,231,11,108,220,36,129,131,19,93,163,239,169,118,205,50,77,121,139,139,141,197,170,20,44,39,19,97,205,228,8,106,67,210,135,111,127,141,185,175,123,26,226,42,29,217,16,99,9,46,157,232,22,3,105,174,73,144,23,110,55,84,46,4,116,39,113,205,58,158,242,7,208,75,162,55,115,35,52,124,235,114,178,55,43,98,17,100,33,134,237,190,230,60,184,192,104,146,52,58,79,174,180,81,155,114,0,153,113,90,51,86,150,254,136,205,104,39,11,190,187,233,80,81,81,56,18,222,148,116,155,156,33,132,226,127,84,34,83,28,249,153,18,197,10,116,102,125,45,47,36,235,46,212,166,209,3,125,132,237,124,163,68,197,202,232,152,234,75,235,103,248,160,241,213,151,144,130,37,23,51,48,55,12,227,31,163,242,251,245,22,129,77,20,35,150,20,181,203,138,69,233,215,109,178,209,52,85,96,221,179,56,249,138,111,250,141,134,95,152,92,109,183,174,104,151,156,31,66,211,10,57,141,167,18,177,27,126,74,252,29,143,121,173,203,8,27,44,123,148,57,88,163,68,228,158,62,98,121,192,228,94,92,72,241,33,230,173,0,197,1,194,144,111,91,60,0,106,181,203,51,133,120,250,158,184,93,216,184,126,253,21,22,155,99,80,205,227,69,231,141,165,71,70,252,223,105,51,93,22,165,135,233,177,164,139,53,5,85,151,134,214,165,249,100,24,186,207,245,149,68,218,204,252,32,190,90,48,76,57,31,201,15,52,130,135,152,206,63,198,100,126,36,2,104,116,0,160,163,186,2,91,165,57,149,163,12,239,121,152,209,224,136,248,135,136,46,150,32,51,154,6,105,0,71,30,44,175,147,139,34,91,184,78,31,145,18,3,250,122,166,47,252,109,19,40,10,123,163,99,76,133,119,37,180,38,207,79,171,185,188];class oJ extends tJ{constructor(e,t,i){super(e,rJ,t,i)}}const sJ=[11,196,242,139,198,252,188,5,32,162,171,128,13,160,25,222,172,102,207,244,158,69,103,57,239,111,150,18,157,82,55,210,20,131,156,160,96,121,255,120,207,227,114,120,38,72,149,145,165,227,75,122,158,250,232,46,34,52,135,9,30,144,17,110,126,110,130,71,156,46,210,67,202,51,119,97,3,211,214,227,45,109,151,97,21,10,229,53,80,26,51,202,119,128,230,197,140,135,40,14,88,128,202,95,21,208,96,83,185,98,216,242,224,15,25,224,233,86,96,46,80,120,220,48,187,86,30,240,140,46,95,81,48,90,117,140,177,51,107,235,158,137,5,241,191,154,149,219,30,126,85,175,10,216,63,139,216,151,122,251,224,202,220,227,221,53,122,34,213,224,94,45,14,200,68,31,61,175,208,17,120,82,244,138,208,165,21,19,236,232,180,217,50,74,70,126,114,227,62,192,124,9,85,148,33,77,255,117,75,102,87,151,255,87,74,74,181,111,108,9,249,220,174,59,80,254,168,29,30,94,171,133,133,195,105,64,254,68,65,18,158,54,73,203,65,175,151,170,236,138,17,119,128,237,214,189,28,250,38,149,97,242,81,212,254,57,18,120,155,64,96,108,75,78,74,121,191,243,30,42,60,103,165,196,160,195,216,99,182,173,214,182,105,53,231,3,45,212,144,101,217,65,141,44,230,125,151,154,123,57,134,223,98,133,156,238,137,181,80,175,230,167,131,180,13,69,77,44,156,165,252,14,27,85,71,1,82,196,64,243,26,167,146,98,201,6,195,247,200,224,44,177,104,109,187,231,83,118,28,159,92,179,28,14,162,81,84,21,168,34,156,21,127,215,88,218,208,11,92,161,239,239,82,221,59,86,83,201,199,216,151,139,23,54,39,52,103,204,247,24,102,94,157,138,42,49,131,183,208,50,95,236,54,6,211,26,68,72,56,212,134,24,91,114,132,1,217,80,38,47,29,47,0,107,102,99,129,33,140,243,74,251,89,247,103,12,114,58,113,240,72,188,39,48,72,89,45,102,206,245,247,231,56,167,129,122,222,47,40,78,227,159,64,206,34,127,203,127,87,40,108,152,238,147,231,46,104,89,182,180,232,86,89,91,57,10,222,202,59,199,135,60,199,189,40,84,125,28,84,162,210,91,143,34,106,117,118,3,125,126,237,60,131,173,153,69,49,212,204,117,163,31,239,202,232,152,234,3,162,32,176,184,184,196,154,131,144,115,6,53,122,55,69,166,19,230,183,175,244,1,156,11,37,121,134,121,152,142,158,125,229,150,44,183,216,109,7,65,222,169,56,222,140,110,233,157,138,66,208,6,111,166,188,76,208,222,4,104,211,10,57,141,243,65,228,86,85,88,169,91,237,56,249,133,77,21,32,37,230,55,0,184,110,228,158,62,98,45,147,177,19,119,89,164,103,132,239,84,139,68,204,157,49,41,50,89,113,159,203,51,133,120,184,210,237,15,249,187,100,253,50,16,154,112,64,193,254,10,235,200,253,84,31,169,171,39,122,70,46,186,139,212,162,173,158,41,23,86,148,172,196,237,242,58,102,180,150,238,191,25,240,204,252,125,148,29,124,51,95,10,196,55,49,159,138,144,255,126,205,43,49,42,17,59,60,77,139,177,239,64,36,224,98,205,234,70,199,103,139,218,206,207,178,217,255,32,134,59,25,221,74,22,102,82,19,20,170,142,134,42,106,249,64,80,222,28,21,169,50,235,4,237,56,81,87,76,32,251,42,6,173,105,54,191,8,136,5,245,206,239,176,9,116,24];class aJ extends tJ{constructor(e,t,i){super(e,sJ,t,i)}}const cJ=[11,196,242,139,198,252,188,5,32,162,171,128,13,160,25,222,172,102,207,244,158,69,103,57,239,111,150,18,157,82,55,210,20,131,156,190,100,112,230,97,199,225,96,74,99,94,248,222,162,213,95,122,158,212,233,42,22,37,217,115,36,152,30,123,116,104,212,109,129,41,220,77,213,97,124,45,4,219,197,171,40,18,149,104,20,4,248,102,64,9,50,217,124,131,180,188,159,170,63,1,84,130,150,117,14,212,118,67,165,97,207,242,251,15,30,187,188,77,79,122,67,101,252,109,244,82,37,191,227,35,114,87,57,71,99,218,155,54,101,239,138,197,13,226,228,176,157,158,87,98,55,251,79,150,64,138,200,135,40,132,135,207,146,252,222,57,58,111,151,225,78,59,36,210,70,29,121,160,210,31,109,67,167,194,177,236,91,108,164,229,130,211,59,66,93,18,107,226,54,210,51,8,77,217,19,73,187,33,30,59,9,135,162,49,5,11,225,111,119,11,247,218,129,115,83,205,170,21,4,69,210,133,134,245,109,15,177,9,81,81,203,105,42,158,12,255,151,165,230,205,5,92,196,251,211,187,27,214,43,186,91,233,85,192,229,15,71,38,220,20,38,101,44,78,7,60,251,186,75,103,108,53,166,220,186,208,194,120,207,230,159,248,22,32,142,124,96,157,222,60,191,65,145,6,239,125,151,147,50,58,130,207,110,131,223,231,137,238,28,182,216,167,198,191,37,67,76,1,144,232,218,79,72,28,65,101,43,216,64,253,16,173,179,123,140,27,233,245,199,230,36,181,102,114,247,162,18,34,20,212,25,171,24,28,143,80,94,40,167,34,209,61,117,130,1,198,196,7,21,252,180,255,92,128,119,9,48,156,138,136,151,143,23,44,52,3,40,197,228,31,123,67,163,140,32,54,204,187,149,80,19,255,82,120,195,12,110,65,56,212,143,22,78,44,234,72,140,29,118,103,18,36,7,122,50,37,139,47,142,243,25,208,88,237,126,50,103,127,19,183,29,169,29,1,55,23,100,32,129,239,243,160,61,178,197,117,199,45,57,26,165,135,92,218,59,0,197,54,13,96,40,141,212,221,131,103,46,22,228,191,167,73,20,86,62,11,147,217,116,205,203,110,134,249,51,6,123,23,86,231,157,8,144,83,126,115,118,35,96,36,229,36,220,228,143,71,45,223,129,48,236,5,145,202,188,208,184,70,241,104,255,188,181,146,210,206,144,53,77,101,120,38,8,245,80,230,165,160,183,83,202,79,127,57,214,126,242,150,208,40,239,148,35,163,201,97,74,70,214,181,63,240,147,33,253,149,140,77,197,82,126,189,231,7,196,212,80,14,151,24,57,144,243,81,234,66,24,19,236,2,137,121,246,129,65,7,99,110,174,54,74,182,81,234,142,37,72,110,220,255,64,119,10,188,111,191,228,1,205,9,204,143,56,62,125,84,106,225,131,97,192,43,240,157,161,75,168,247,44,175,65,81,192,48,21,157,167,80,191,130,161,75,85,186,174,42,117,1,68,252,204,138,254,203,152,21,13,64,144,195,207,238,229,54,103,247,159,245,211,85,191,141,168,32,234,85,46,118,12,5,199,4,19,217,203,202,156,33,143,114,116,60,66,40,58,77,208,237,171,26,72,175,114,205,248,87,137,62,210,143,151,197,167,210,241,122,150,104,122,154,2,70,102,83,19,36,141,136,199,42,79,229,71,86,194,109,31,236,80,166,17,230,109,1,40,28,46,224,56,20,230,47,100,254,116,208,76,169,157,241,175,3,70,85,31,38,245,58,33,80,145,237,8,22,71,224,158,156,31,249,81,87,247,230,199,237,96,167,123,63,243,79,156,206,203,160,54,124,68,253,215,132,235,57,185,92,238,55,59,210,104,71,26,183,180,71,12,255,224,192,65,154,72,244,8,164,10,248,46,207,30,92,1,80,244,31,189,138,88,216,218,63,100,227,116,57,119,94,135,5,126,255,32,191,163,61,209,194,88,248,112,139,173,43,69,134,3,160,151,137,25,98,239,166,19,123,208,180,31,120,30,191,75,183,179,126,180,125,92,107,105,206,138,28,67,139,3,188,230,184,255,121,13,181,45,160,114,202,194,123,87,55,124,97,164,82,95,232,216,117,62,5,90,176,82,167,52,160,153,174,168,105,146,91,248,81,79,249,97,138,133,170,245,229,132,61,5,149,224,246,194,213,61,12,109,44,136,235,95,219,133,220,27,93,36,93,124,180,81,141,152,220,170,163,229,197,124,171,232,48,70,251,106,119,150,20,16,49,119,247,42,132,36,76,254,124,177,66,175,9,1,39,92,127,195,171,198,34,2,64,144,179,72,40,151,110,89,229,42,125,33,238,16,220,228,51,203,8,1,68,145,253,133,118,93,163,129,22,13,248,65,12,4,63,101,210,70,170,138,203,14,246,54,194,195,27,107,241,175,35,171,49,52,106,121,45,36,152,85,215,132,78,167,34,18,167,245,152,133,134,170,120,182,10,146,191,37,2,205,47,125,20,203,44,88,81,32,150,223,220,218,238,254,30,212,167,221,115,156,82,226,137,220,221,97,3,139,202,33,9,27,26,126,40,215,25,126,9,82,208,49,217,14,161,81,196,61,60,87,254,213,194,81,216,161,151,209,166,222,230,24,128,117,140,92,4,203,254,170,253,249,88,90,112,226,18,44,122,39,158,158,56,69,204,159,5,179,51,197,233,139,216,102,226,206,248,15,78,112,214,126,67,28,40,38,98,190,178,206,67,94,245,254,160,101,176,32,157,26,132,83,252,228,87,242,32,127,160,112,210,224,133,149,115,41,30,16,200,69,89,81,77,144,12,106,182,73,54,28,53,195,28,216,179,179,136,35,141,102,234,177,240,34,186,106,145,245,3,84,48,251,157,245,11,217,111,227,138,42,67,114,211,177,37,103,16,71,152,72,117,123,36,213,202,56,124,227,84,8,45,229,149,165,214,69,244,169,55,68,62,94,104,228,74,205,123,222,17,7,172,158,227,74,206,149,67,175,171,251,185,121,151,223,63,35,229,32,49,190,209,120,137,69,213,214,19,150,187,177,28,12,158,153,126,149,171,167,234,120,129,109,32,157,180,75,66,56,233,115,127,230,157,32,34,143,156,31,230,168,174,125,118,195,249,243,165,81,246,10,144,15,103,139,55,173,7,59,136,69,172,54,132,165,140,78,77,230,33,169,129,188,71,209,109,161,8,57,57,199,143,31,164,43,58,130,1,110,145,31,229,13,46,149,94,244,106,76,238,105,107,1,183,177,10,61,225,94,185,116,58,183,95,225,22,119,19,248,28,13,123,125,108,158,64,184,77,245,153,162,217,227,208,41,185,211,235,41,153,181,54,166,165,11,154,55,21,184,209,192,249,44,164,160,29,229,159,82,156,198,241,183,114,83,137,186,151,148,31,21,197,216,145,32,13,50,22,241,137,39,71,28,142,160,215,107,221,45,202,104,227,110,186,12,150,145,240,51,49,44,196,115,224,238,149,189,134,99,67,241,62,157,240,114,247,195,26,200,141,97,147,249,23,150,174,10,13,219,81,73,58,242,96,250,243,15,49,218,58,230,104,252,175,150,123,86,185,84,90,198,6,36,0,99,72,28,166,238,115,231,171,249,179,71,174,68,156,227,17,198,79,73,142,99,144,20,80,62,80,191,142,46,71,9,243,6,8,214,116,72,190,106,161,19,185,100,9,187,64,94,86,203,174,156,245,222,95,54,30,148,19,11,50,112,96,61,237,159,173,7,154,127,175,79,48,97,89,78,126,66,171,204,158,195,27,226,205,222,157,89,251,90,125,37,212,27,97,3,141,247,175,50,121,7,187,68,196,181,202,167,189,57,84,81,222,23,27,84,130,176,98,66,240,207,18,23,28,163,163,194,45,37,129,202,170,97,189,0,81,238,0,39,199,163,35,211,206,247,65,29,116,242,67,102,235,13,136,232,230,114,146,187,7,254,142,26,121,16,237,5,160,201,114,94,178,199,95,212,241,45,112,180,188,72,86,114,189,155,149,149,163,210,112,101,12,69,225,75,202,223,28,242,90,215,156,169,224,245,135,128,92,148,217,131,208,255,25,135,117,136,5,104,185,249,161,228,214,16,105,204,9,182,135,153,220,101,244,160,207,58,182,118,185,240,57,245,123,13,112,182,106,229,220,90,29,86,215,96,147,232,2,55,131,225,137,68,245,89,141,252,97,3,129,155,216,223,98,116,45,78,85,141,161,74,215,7,150,171,225,59,78,221,152,236,14,117,100,208,158,86,13,185,124,87,157,111,40,187,182,124,173,71,173,23,199,52,155,190,134,11,23,64,25,215,39,115,231,173,77,72,114,54,252,116,178,59,221,106,241,119,254,30,226,241,204,233,113,197,96,146,0,41,67,3,231,126,12,218,202,22,171,114,249,176,134,160,19,216,31,229,118,226,62,242,126,126,42,127,130,68,218,218,81,202,106,217,191,25,177,82,97,81,36,232,137,58,90,216,190,117,235,20,194,144,76,178,27,213,13,208,18,29,118,126,49,98,203,179,128,237,100,32,242,189,212,6,210,210,188,161,205,13,124,119,13,215,112,41,183,176,215,168,210,182,111,1,115,2,239,141,8,177,124,112,48,197,2,239,11,99,4,36,77,69,47,244,19,153,61,19,2,96,176,7,112,122,131,169,25,189,116,171,49,12,121,162,79,154,74,251,50,233,182,63,180,224,118,49,253,21,20,16,31,144,184,93,174,231,244,183,13,49,225,189,211,73,185,49,110,142,25,226,45,176,233,204,74,33,16,205,88,131,92,157,170,175,68,170,61,53,116,165,16,27,182,160,181,87,241,15,151,85,107,76,167,129,25,172,127,184,138,153,222,228,125,64,44,45,32,12,227,148,106,152,83,240,166,54,235,32,190,12,242,164,123,189,53,194,141,104,43,202,110,4,168,119,245,232,179,178,198,1,224,87,86,160,31,19,140,233,102,191,204,4,98,138,163,191,106,24,213,47,208,82,137,132,131,16,253,84,25,144,90,159,148,16,196,84,166,61,160,101,229,227,93,118,59,87,66,16,128,59,96,131,250,20,184,150,205,91,227,201,62,35,79,180,172,173,85,197,106,153,238,229,60,204,65,193,230,94,101,177,134,6,165,53,171,142,208,155,2,11,4,202,127,54,17,142,117,227,121,128,204,192,147,147,92,189,5,224,148,72,18,83,101,126,124,228,153,242,123,229,247,92,221,6,73,227,250,87,167,194,129,187,73,38,185,109,217,240,193,88,50,178,180,151,54,197,187,137,190,166,233,1,103,204,88,31,127,185,29,65,1,29,254,223,14,83,167,215,114,248,30,173,89,173,187,69,5,105,117,15,106,94,173,63,227,25,230,190,136,168,177,175,107,91,126,254,34,188,25,118,48,12,226,130,153,162,57,47,181,212,79,160,97,64,157,246,90,53,43,149,76,102,15,195,107,58,242,84,172,29,81,198,113,81,251,138,182,154,111,30,171,129,56,17,45,214,153,112,117,203,174,40,38,234,236,32,4,112,225,26,187,195,246,252,9,218,69,160,223,178,54,148,81,8,134,151,75,248,63,224,240,48,75,250,221,85,46,100,50,3,70,64,102,111,160,155,233,59,147,184,57,61,6,126,79,176,16,185,94,166,33,135,78,42,75,140,208,140,44,153,187,64,103,119,160,236,16,239,74,218,219,212,207,110,53,30,76,248,40,111,98,44,20,113,204,233,109,135,96,107,39,163,203,125,45,157,152,71,239,175,174,159,147,80,111,93,38,253,228,154,225,181,101,12,241,127,65,49,189,5,85,151,237,213,143,14,104,138,54,52,27,4,132,67,35,156,86,157,73,16,229,222,245,110,79,165,179,56,179,53,218,229,100,58,87,149,48,231,64,63,115,67,3,172,6,186,115,154,60,53,214,152,149,89,234,37,143,82,255,64,28,183,93,112,39,70,185,57,0,199,9,61,175,219,41,76,37,176,82,125,65,53,160,214,105,62,153,244,222,96,205,6,178,85,41,240,113,0,96,149,38,3,195,18,152,41,246,3,103,29,110,134,30,101,75,46,103,199,184,20,230,8,55,120,4,229,168,35,43,7,28,161,143,87,27,87,79,255,186,44,195,158,155,181,119,81,172,217,107,95,98,55,243,186,66,105,48,224,123,232,84,156,20,10,156,208,204,52,34,228,136,97,242,200,246,211,67,202,40,241,91,92,253,9,54,72,131,221,106,178,32,44,182,4,225,193,37,20,249,249,231,10,206,18,71,254,221,187,172,88,204,6,127,138,102,7,208,75,147,219,199,177,79,36,170,101,207,177,109,95,143,217,41,199,80,183,201,2,254,12,55,23,198,14,255,69,245,138,155,129,227,167,168,130,156,135,14,96,93,48,99,143,107,126,92,117,143,112,108,193,228,84,13,41,186,27,172,92,201,149,116,19,112,197,116,209,128,102,1,55,152,177,28,37,34,50,83,41,199,74,178,59,111,67,118,35,252,36,33,87,28,170,17,215,47,90,154,124,137,15,14,211,59,75,59,30,77,0,49,37,225,191,87,101,127,214,227,160,99,174,234,82,148,235,16,241,219,147,170,127,221,250,116,39,218,156,72,227,172,55,0,79,188,76,51,222,232,24,36,62,94,154,3,61,230,146,114,253,0,128,58,253,90,72,211,242,38,39,133,153,161,119,105,195,152,225,208,105,140,80,217,186,196,157,21,116,230,116,139,25,159,143,118,128,77,201,238,247,228,15,168,4,133,148,21,148,12,44,241,7,115,17,129,176,202,46,130,122,129,235,141,223,85,21,199,65,181,169,52,174,161,153,62,25,164,115,213,89,138,199,103,79,200,165,135,249,244,27,209,178,240,129,211,61,9,111,157,147,119,36,119,255,110,130,84,49,210,225,247,100,26,121,127,163,160,26,79,99,24,77,65,32,178,109,36,27,253,173,110,183,11,14,211,57,130,254,124,104,165,219,31,70,97,14,194,39,61,26,141,125,228,126,194,184,101,160,204,106,128,144,106,103,171,18,246,129,220,85,172,151,123,5,73,155,192,175,91,157,239,61,237,116,170,65,233,56,19,49,114,168,190,3,214,53,250,90,213,244,88,101,30,229,248,124,15,71,141,27,172,235,21,129,211,72,61,172,112,170,128,135,96,196,221,255,27,176,105,188,183,121,33,37,149,53,131,226,233,29,167,234,218,109,53,185,152,36,248,53,61,235,78,21,201,214,210,163,12,251,187,45,188,137,126,127,237,92,234,91,240,225,38,194,57,213,251,237,171,30,99,52,14,49,84,101,252,237,7,166,122,114,32,107,32,207,239,136,168,178,12,11,241,233,230,146,132,18,83,233,41,172,17,6,161,42,113,87,40,255,185,1,146,128,5,240,126,131,71,42,54,124,205,2,122,71,30,222,229,40,134,142,102,97,239,151,177,1,230,231,49,123,219,28,129,91,152,112,13,154,81,197,226,255,112,158,178,177,55,181,108,138,185,245,29,186,21,73,188,209,154,200,89,116,235,198,144,36,87,248,22,7,200,122,7,148,44,42,87,140,238,204,95,231,252,0,136,0,22,39,70,123,125,165,113,227,172,146,163,128,158,36,52,91,19,36,245,27,150,138,141,11,67,239,224,65,24,116,101,7,39,46,142,172,164,243,148,0,33,226,59,47,203,137,156,241,66,250,157,30,204,101,143,134,98,238,155,226,25,184,136,219,89,100,193,11,143,71,139,243,230,151,0,249,1,78,26,32,93,104,157,67,97,164,248,86,124,146,93,74,222,228,167,55,53,100,135,216,109,13,64,37,106,177,200,200,182,92,251,69,31,243,89,80,198,14,132,203,72,103,28,104,217,24,97,223,113,11,29,178,191,210,46,162,255,68,99,8,237,213,162,152,193,183,121,203,19,108,182,29,86,26,192,103,220,103,205,154,179,197,9,22,73,127,175,146,38,119,210,0,24,180,21,245,215,204,91,186,119,138,183,239,15,155,231,248,133,39,24,101,144,236,10,230,54,174,227,73,21,110,10,160,241,232,131,14,212,127,232,59,122,65,146,54,163,9,189,190,121,88,170,62,194,14,204,152,245,38,131,37,91,81,72,114,29,115,239,182,56,44,156,159,177,180,82,160,93,97,86,183,236,50,95,85,39,71,181,225,152,143,63,123,117,34,44,109,160,166,229,240,91,138,102,54,180,173,44,50,80,42,124,7,50,124,211,239,21,94,197,185,239,213,107,142,64,95,124,125,17,180,97,189,101,52,48,19,112,12,70,9,212,177,54,118,66,84,147,236,248,26,124,95,103,135,254,124,49,112,186,99,120,90,8,194,191,88,57,242,65,61,10,104,246,197,252,19,159,58,194,75,173,242,103,8,115,84,69,238,149,26,15,159,182,141,132,119,70,29,53,20,143,46,163,204,6,236,59,45,185,172,89,119,83,38,144,36,222,96,151,26,99,195,163,170,133,92,159,214,53,150,116,90,176,69,145,130,15,172,140,217,215,101,163,115,161,65,101,8,7,183,113,213,134,58,175,130,251,143,173,248,168,135,60,159,30,194,68,208,119,120,2,40,178,227,247,161,77,47,136,46,244,163,72,65,158,25,225,195,61,132,182,204,177,186,200,81,2,65,105,212,72,94,203,232,217,182,123,251,228,160,1,161,204,123,20,37,1,77,208,179,45,149,181,122,102,190,123,213,164,231,41,216,130,234,248,208,251,252,220,84,209,67,47,61,220,5,142,162,26,236,121,142,248,132,255,65,122,203,196,102,191,187,2,195,127,255,193,92,49,91,186,154,39,156,29,211,172,49,104,245,114,153,223,211,199,249,35,130,160,128,0,152,176,183,20,236,113,193,108,26,255,11,237,102,133,245,94,115,114,10,89,229,214,221,99,149,30,99,37,246,10,26,26,39,92,123,170,73,211,127,227,54,30,86,133,159,112,225,91,148,100,174,149,75,143,14,140,20,44,64,212,5,243,8,116,63,30,97,42,123,20,73,212,85,207,83,122,27,251,233,84,10,17,236,232,83,200,127,119,143,163,204,220,167,59,231,20,106,186,222,191,8,40,234,21,25,180,13,116,250,152,224,174,75,3,205,38,173,215,236,151,185,121,254,244,154,239,17,53,106,164,61,49,116,216,118,94,150,35,181,26,238,66,49,211,221,132,146,166,115,39,136,36,205,230,179,31,197,51,148,165,109,38,70,37,148,52,44,209,250,98,58,246,225,103,198,101,26,25,196,207,8,166,21,88,252,175,253,10,88,107,157,19,225,61,12,246,221,37,239,186,167,137,142,135,222,128,174,62,95,216,38,141,157,45,232,97,217,173,203,234,116,129,69,206,189,94,221,12,54,139,186,247,184,16,200,121,244,104,8,7,35,111,47,188,10,140,92,73,143,206,203,72,122,184,20,102,197,130,64,150,63,96,239,8,132,111,217,84,91,198,32,43,100,138,241,15,160,42,190,253,193,184,164,124,29,210,96,67,224,221,182,29,218,129,149,29,128,174,98,88,88,125,56,40,255,120,5,0,87,174,42,150,90,112,201,183,169,19,57,195,191,12,58,244,235,132,25,145,72,146,214,8,125,100,135,12,5,102,97,248,174,24,159,90,33,43,187,6,61,212,241,225,190,219,252,197,123,129,164,108,123,55,230,4,153,166,105,234,15,85,216,23,56,32,3,41,110,68,146,172,133,202,98,41,7,47,152,35,255,168,106,241,226,222,77,244,52,185,65,252,227,32,66,38,11,172,60,28,28,103,84,1,1,205,182,190,28,189,102,253,43,1,191,148,116,10,227,18,81,93,80,239,157,232,215,180,163,165,161,109,177,71,150,244,144,208,160,110,22,174,60,206,43,103,121,55,103,114,115,173,238,13,10,227,251,41,176,216,158,229,216,55,234,128,128,20,167,106,181,86,163,130,215,110,149,191,10,227,215,8,214,154,178,181,15,19,0,247,250,97,74,43,157,55,94,174,41,41,9,199,97,20,91,32,18,10,43,98,240,247,203,20,250,117,160,44,229,202,187,64,54,124,15,184,169,129,27,160,240,26,61,255,60,166,60,144,209,84,55,187,186,168,13,124,125,29,17,100,249,227,62,205,78,179,163,168,139,168,21,38,83,239,151,74,43,66,2,92,72,71,94,216,134,238,20,45,158,213,164,73,57,80,47,198,184,130,223,227,71,132,133,235,177,85,174,142,124,172,200,54,229,40,126,60,76,92,216,153,56,241,174,66,141,90,226,3,30,68,234,71,187,163,112,146,255,22,143,170,204,3,127,179,81,139,160,37,77,246,128,220,196,158,153,73,177,65,199,119,29,197,144,130,248,206,155,253,108,213,124,7,223,221,162,146,134,242,65,99,162,107,120,247,214,207,96,150,169,131,208,218,221,28,24,112,208,23,1,130,142,232,56,104,45,33,158,95,255,123,31,74,76,120,178,155,213,6,195,164,8,8,69,241,197,127,83,169,21,167,19,94,143,252,33,159,248,241,170,153,147,1,149,199,201,131,170,79,236,212,209,143,107,98,24,123,56,33,193,85,247,64,225,135,210,78,145,57,16,145,71,170,20,133,87,235,4,166,239,100,82,235,81,50,223,9,193,52,49,86,129,190,196,82,165,107,63,115,161,98,33,20,193,29,42,151,205,252,124,72,245,48,181,67,7,13,21,127,59,226,188,144,129,112,244,192,121,213,80,42,196,1,13,107,108,78,0,40,121,225,148,237,234,209,216,238,9,147,226,254,96,89,212,72,193,106,75,135,74,227,67,255,92,191,81,188,124,226,149,152,142,15,159,195,238,114,55,255,166,157,230,59,148,170,166,151,65,213,104,253,253,112,150,82,147,137,27,214,100,247,65,81,92,47,86,217,7,45,120,81,130,31,236,243,76,78,3,45,105,172,220,71,48,220,94,196,249,163,193,133,50,236,205,20,55,2,63,14,127,69,113,212,204,12,58,79,89,86,29,61,199,201,64,149,6,144,182,150,129,31,18,167,120,248,82,107,25,143,128,27,161,28,25,153,183,217,238,78,186,106,92,27,202,219,165,96,0,216,234,169,73,101,39,182,113,217,240,170,116,172,221,250,233,48,49,242,83,227,92,181,184,72,230,180,21,15,108,135,25,38,153,25,124,227,26,149,73,236,39,211,244,149,58,183,132,26,223,219,174,144,117,233,219,165,205,157,159,222,184,52,47,241,201,123,65,24,44,55,215,177,168,250,179,115,190,227,123,158,163,179,224,69,196,66,207,254,243,101,221,193,140,250,4,28,222,52,96,138,160,33,218,64,118,214,234,201,152,148,91,178,111,107,144,142,6,182,102,72,188,34,213,181,26,223,58,255,103,81,17,47,169,11,245,224,123,148,215,237,186,107,75,152,90,202,166,22,149,197,5,246,238,78,76,229,106,199,94,127,195,0,45,82,6,159,103,96,138,231,71,46,107,59,216,39,43,12,221,27,214,56,155,145,66,187,169,250,235,78,211,179,239,183,198,163,93,5,196,24,174,143,225,106,139,89,98,13,127,207,184,194,30,1,165,198,169,8,197,118,86,163,221,138,23,209,61,116,79,99,233,43,130,60,244,85,229,243,172,123,148,200,120,192,127,211,52,11,159,41,95,212,230,188,169,156,137,29,212,12,148,168,148,133,243,44,241,139,127,24,246,220,227,125,209,97,60,52,162,192,146,49,161,92,138,112,189,128,59,126,125,46,207,60,79,231,174,152,209,68,223,205,2,38,14,91,116,159,255,28,27,178,248,164,104,158,79,69,214,234,157,12,75,163,83,253,245,202,61,213,176,6,197,230,29,208,166,253,194,254,235,29,141,241,70,249,15,62,0,148,163,135,52,122,40,96,87,31,179,152,51,216,133,184,122,198,203,60,115,218,191,193,16,178,25,148,252,112,104,103,252,36,92,221,28,179,43,199,198,151,128,100,252,217,161,249,34,201,172,118,52,180,252,104,7,223,44,116,102,212,21,40,224,184,55,163,210,21,207,161,239,51,54,155,41,133,18,67,48,3,165,130,251,4,79,214,57,72,130,157,212,144],AJ=[0,1,3,4,6,7,9,10,12,13,15,16,18,19,21,22,24,26,29,31,34,36,39,41,44,46,49,51,54,56,59,61,64,65,66,67,68,69,70,72,73,74,75,76,77,79,80,81,82,83,84,85,87,88,89,90,91,92,94,95,96,97,98,99,101,102,103,104,105,106,107,109,110,111,112,113,114,116,117,118,119,120,121,123,124,125,126,127,128,129,131,132,133,134,135,136,138,139,140,141,142,143,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,162,163,164,165,166,168,169,170,171,172,173,175,176,177,178,179,180,182,183,184,185,186,187,188,190,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,212,213,214,215,216,217,219,220,221,222,223,224,226,226,226,227,227,227,228,228,228,229,229,229,230,230,231,231,231,232,232,232,233,233,233,234,234,235,235,235,236,236,236,237,237,237,238,238,239,239,239,240,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,253,253,253,254,254,254,255],dJ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,35,36,37,39,40,42,43,44,46,47,49,50,51,53,54,56,57,58,59,61,62,63,64,66,67,68,69,71,72,73,74,76,77,78,79,81,82,83,84,86,87,88,90,91,92,93,95,96,97,98,100,101,102,103,105,106,107,108,110,111,112,113,115,116,117,118,120,121,122,124,125,126,127,129,130,131,132,134,135,136,137,139,140,141,142,144,145,146,147,149,150,151,152,154,155,156,158,159,160,161,163,164,165,166,168,169,170,171,173,174,175,176,178,179,180,181,183,184,185,186,188,189,190,192,193,194,195,197,198,199,200,202,203,204,205,207,208,209,210,212,213,214,215,217,218,219,220,222,223,224,226,226,226,227,227,228,228,229,229,230,230,231,231,232,232,233,233,234,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,253,253,253,254,254,254,255],uJ=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,43,44,45,46,47,48,50,51,52,53,54,55,56,58,59,60,61,62,63,65,66,67,68,69,70,72,73,74,76,77,78,80,81,83,84,85,87,88,89,91,92,94,95,96,98,99,100,102,103,105,106,107,109,110,111,113,114,116,117,118,120,121,122,124,125,127,128,129,131,132,133,135,136,138,139,140,142,143,144,146,147,149,150,151,153,154,155,157,158,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,192,193,193,194,195,195,196,197,197,198,199,199,200,201,201,202,203,203,204,205,205,206,207,207,208,209,209,210,211,211,212,213,213,214,215,215,216,217,217,218,219,219,220,221,221,222,223,223,224,225,225,226,227,227,228,229,229,230,231,231,232,233,233,234,235,235,236,237,237,238,239,239,240,241,241,242,243,243,244,245,245,246,247,247,248,249,249,250,251,251,252,253,253,254,255];class EJ extends tJ{constructor(e,t,i,n){super(e,cJ,i,n),tD(this,"inputTexture",void 0),tD(this,"lightLevel",.1),tD(this,"rednessLevel",.5),tD(this,"mskin_he_max",175/180*3.141593),tD(this,"mskin_he_min",115/180*3.141593),tD(this,"mskin_hc_max",173/180*3.141593),tD(this,"mskin_hc_min",116/180*3.141593),tD(this,"mskin_hc_axis",2.04203545),tD(this,"mfacts_rotate_c",0),tD(this,"mfacts_rotate_le",0),tD(this,"mfacts_rotate_ge",0),tD(this,"tab_addr",null),tD(this,"lutTextures",[]),this.inputTexture=t,this.init()}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY"),t=this.gl.getUniformLocation(this.program,"u_denoiseLevel");this.gl.uniform1f(t,this.denoiseLevel),this.gl.uniform1f(e,1);const i=this.gl.getUniformLocation(this.program,"light");this.gl.uniform1f(i,this.lightLevel);const n=this.gl.getUniformLocation(this.program,"redness");this.gl.uniform1f(n,this.rednessLevel);const r=this.gl.getUniformLocation(this.program,"skin_he_max"),o=this.gl.getUniformLocation(this.program,"skin_he_min"),s=this.gl.getUniformLocation(this.program,"skin_hc_max"),a=this.gl.getUniformLocation(this.program,"skin_hc_min"),c=this.gl.getUniformLocation(this.program,"skin_hc_axis"),A=this.gl.getUniformLocation(this.program,"facts_rotate_c"),d=this.gl.getUniformLocation(this.program,"facts_rotate_le"),u=this.gl.getUniformLocation(this.program,"facts_rotate_ge");this.gl.uniform1f(r,this.mskin_he_max),this.gl.uniform1f(o,this.mskin_he_min),this.gl.uniform1f(s,this.mskin_hc_max),this.gl.uniform1f(a,this.mskin_hc_min),this.gl.uniform1f(c,this.mskin_hc_axis),this.gl.uniform1f(A,this.mfacts_rotate_c),this.gl.uniform1f(d,this.mfacts_rotate_le),this.gl.uniform1f(u,this.mfacts_rotate_ge);const E=this.gl.getUniformLocation(this.program,"u_originImage");this.gl.activeTexture(this.gl.TEXTURE2),this.gl.bindTexture(this.gl.TEXTURE_2D,this.inputTexture),this.gl.uniform1i(E,2);const l=["lighten_lut"],h=[this.gl.TEXTURE3];for(let e=0;e<l.length;e++){const t=this.gl.getUniformLocation(this.program,l[e]);this.gl.activeTexture(h[e]),this.gl.bindTexture(this.gl.TEXTURE_2D,this.lutTextures[e]),this.gl.uniform1i(t,e+3)}}setParameters(e){void 0!==e.denoiseLevel&&(this.denoiseLevel=e.denoiseLevel),void 0!==e.lightLevel&&(this.lightLevel=e.lightLevel),void 0!==e.rednessLevel&&(this.rednessLevel=e.rednessLevel,this.updateRedness(this.rednessLevel)),e.lighteningContrastLevel&&this.updateLut(e.lighteningContrastLevel)}init(){this.tab_addr=new Uint8Array(dJ);const e=[this.tab_addr],t=[256],i=[1];for(let n=0;n<e.length;n++){const r=this.gl.createTexture();if(!r)throw new pw(hw.WEBGL_INTERNAL_ERROR,"create lut texture failed");this.gl.bindTexture(this.gl.TEXTURE_2D,r),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.LUMINANCE,t[n],i[n],0,this.gl.LUMINANCE,this.gl.UNSIGNED_BYTE,e[n]),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.lutTextures.push(r)}}updateRedness(e){const t=3.141593;let i,n,r=e,o=r;r>1&&(r=1),r<0&&(r=0),o>1&&(o=1),o<0&&(o=0),this.mfacts_rotate_c=.8*r,o<.8&&(o=0),this.mskin_he_max=175/180*t,this.mskin_hc_max=173/180*t,this.mskin_he_min=(115-4*o)/180*t,this.mskin_hc_min=(116-4*o)/180*t,this.mskin_hc_axis=(117-4*o)/180*t,this.mskin_hc_axis<this.mskin_hc_min&&(this.mskin_hc_axis=this.mskin_hc_min),this.mskin_hc_min<t/2&&(this.mskin_hc_min=t/2),this.mskin_hc_axis<t/2&&(this.mskin_hc_axis=t/2),this.mskin_he_min<t/2&&(this.mskin_he_min=t/2),this.mskin_hc_max>t&&(this.mskin_hc_max=t),this.mskin_hc_axis>t&&(this.mskin_hc_axis=t),this.mskin_he_max>t&&(this.mskin_he_max=t),i=this.mskin_he_max-this.mskin_hc_max,n=this.mskin_hc_max-this.mskin_hc_axis,this.mfacts_rotate_ge=i>.01?this.mfacts_rotate_c*n/i:this.mfacts_rotate_c,i=this.mskin_hc_min-this.mskin_he_min,n=this.mskin_hc_axis-this.mskin_hc_min,this.mfacts_rotate_le=i>.01?this.mfacts_rotate_c*n/i:this.mfacts_rotate_c}updateLut(e){let t=null;if(0===e&&(t=dJ),1===e&&(t=uJ),2===e&&(t=AJ),!t)throw new pw(hw.WEBGL_INTERNAL_ERROR,"invalid ylut_table value:"+e);this.tab_addr=new Uint8Array(t);const i=[this.tab_addr],n=[256],r=[1];for(let e=0;e<i.length;e++)this.gl.bindTexture(this.gl.TEXTURE_2D,this.lutTextures[e]),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.LUMINANCE,n[e],r[e],0,this.gl.LUMINANCE,this.gl.UNSIGNED_BYTE,i[e])}}class lJ{constructor(){tD(this,"gl",null),tD(this,"canvas",null),tD(this,"programs",[]),tD(this,"commonProgram",null),tD(this,"inputTexture",null),tD(this,"outputTextures",[]),tD(this,"fbos",[]),tD(this,"originalFrameWidth",0),tD(this,"originalFrameHeight",0),tD(this,"enableBeauty",!1),tD(this,"denoiseLevel",5),tD(this,"lightLevel",.35),tD(this,"rednessLevel",.5),tD(this,"lighteningContrastLevel",1)}setEnableBeauty(e){this.enableBeauty=!!e}init(e,t,i){if(!XP().supportWebGL)throw new pw(hw.NOT_SUPPORTED,"your browser is not support webGL");if(this.gl=i.getContext("webgl"),!this.gl)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not get webgl context");if(this.initGL(e,t),!this.inputTexture)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not find input texture");this.canvas=i,this.programs.push(new eJ(this.gl)),this.programs.push(new nJ(this.gl,e,t)),this.programs.push(new oJ(this.gl,e,t)),this.programs.push(new aJ(this.gl,e,t)),this.programs.push(new EJ(this.gl,this.inputTexture,e,t)),this.commonProgram=this.programs[0].program,this.setDenoiseLevel(this.denoiseLevel),this.setLightLevel(this.lightLevel),this.setRednessLevel(this.rednessLevel),this.setContrastLevel(this.lighteningContrastLevel)}render(e){if(!this.gl||!this.commonProgram||!this.canvas)return void mw.warning("video effect manager is not init!");let t=0;if(this.originalFrameHeight===e.videoWidth&&this.originalFrameWidth===e.videoHeight)t=2;else if(this.originalFrameHeight!==e.videoHeight||this.originalFrameWidth!==e.videoWidth){if(mw.debug("beauty effect: resolution changed ".concat(this.originalFrameWidth,"x").concat(this.originalFrameHeight," -> ").concat(e.videoWidth,"x").concat(e.videoHeight)),0===e.videoHeight||0===e.videoWidth)return void mw.debug("beauty effect: skip 0 resolution frame");this.canvas.width=e.videoWidth,this.canvas.height=e.videoHeight,e.setAttribute("width",e.videoWidth.toString()),e.setAttribute("height",e.videoHeight.toString()),this.release(),this.init(e.videoWidth,e.videoHeight,this.canvas)}this.gl.viewport(0,0,e.videoWidth,e.videoHeight),this.gl.bindTexture(this.gl.TEXTURE_2D,this.inputTexture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e);const i=this.enableBeauty?this.programs.length-1:0;for(let e=0;e<=i;e++){const i=this.programs[e].program;this.gl.useProgram(i);const n=this.gl.getUniformLocation(i,"u_image");this.programs[e].setUniforms(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.fbos[t+e%2]),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.outputTextures[t+e%2]),this.gl.uniform1i(n,0)}this.gl.useProgram(this.commonProgram);const n=this.gl.getUniformLocation(this.commonProgram,"u_flipY");this.gl.uniform1f(n,-1),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.clearColor(0,0,0,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}setDenoiseLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({denoiseLevel:e})})),this.denoiseLevel=e}setLightLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({lightLevel:e})})),this.lightLevel=e}setRednessLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({rednessLevel:e})})),this.rednessLevel=e}setContrastLevel(e){this.programs.forEach((t=>{t instanceof tJ&&t.setParameters({lighteningContrastLevel:e})})),this.lighteningContrastLevel=e}setSize(e,t){this.programs.forEach((i=>{i instanceof tJ&&i.setSize(e,t)}))}release(){this.gl=null,this.commonProgram=null,this.inputTexture=null,this.programs=[],this.outputTextures=[],this.fbos=[]}initGL(e,t){if(!this.gl)throw new pw(hw.WEBGL_INTERNAL_ERROR,"can not find webgl context");this.inputTexture=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this.inputTexture),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR);for(let i=0;i<4;i++){const n=this.gl.createTexture();if(!n)throw new pw(hw.WEBGL_INTERNAL_ERROR,"create texture failed");this.gl.bindTexture(this.gl.TEXTURE_2D,n),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),i<2?this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null):this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null);const r=this.gl.createFramebuffer();if(!r)throw new pw(hw.WEBGL_INTERNAL_ERROR,"create frame buffer failed");this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,r),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,n,0),this.outputTextures.push(n),this.fbos.push(r)}this.gl.viewport(0,0,e,t),this.originalFrameWidth=e,this.originalFrameHeight=t}}class hJ{constructor(){tD(this,"targetFrameRate",0),tD(this,"recordedFrameCount",0),tD(this,"recordingTime",2),tD(this,"recordID",void 0)}async startRecordBeautyEffectOutput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(this.recordID)throw new pw(hw.UNEXPECTED_ERROR,"another beauty effect recording is in progress");const i=vG(6,"");return this.recordID=i,this.targetFrameRate=e,this.recordedFrameCount=0,this.recordingTime=t,await SG(1e3*this.recordingTime),this.recordID!==i?(this.recordID=void 0,!0):(this.recordID=void 0,this.recordedFrameCount<this.targetFrameRate*this.recordingTime/2?(mw.warning("detect beauty effect overload, current framerate",this.recordedFrameCount/2),!1):(mw.debug("beauty effect current framerate",this.recordedFrameCount/2),!0))}stopRecordBeautyEffectOutput(){this.targetFrameRate=0,this.recordedFrameCount=0,this.recordID=void 0}addFrame(){this.recordID&&(this.recordedFrameCount+=1)}}class pJ extends qW.exports.VideoProcessor{constructor(){super(),tD(this,"name","BeautyProcessor"),tD(this,"fps",15),tD(this,"canvas",void 0),tD(this,"video",void 0),tD(this,"manager",void 0),tD(this,"overloadDetector",new hJ),tD(this,"stopChromeBackgroundLoop",null),tD(this,"onOverload",void 0),tD(this,"stopLoop",void 0),tD(this,"lastRenderTime",0),this.fps=30,this.manager=new lJ,this._enabled=!1}async onEnableChange(e){this.manager.setEnableBeauty(e),this.context&&this.inputTrack&&(e?await this.startEffect(this.inputTrack,this.context):await this.stopEffect(this.inputTrack,this.context))}async setBeautyEffectOptions(e){if(function(e){void 0!==e.smoothnessLevel&&EL(e.smoothnessLevel,"options.smoothnessLevel",0,1,!1),void 0!==e.lighteningLevel&&EL(e.lighteningLevel,"options.lighteningLevel",0,1,!1),void 0!==e.rednessLevel&&EL(e.rednessLevel,"options.rednessLevel",0,1,!1),void 0!==e.lighteningContrastLevel&&uL(e.lighteningContrastLevel,"options.lighteningContrastLevel",[0,1,2])}(e),void 0!==e.smoothnessLevel){const t=Math.max(.1,10*e.smoothnessLevel);this.manager.setDenoiseLevel(t)}if(void 0!==e.lighteningLevel){const t=Math.max(.1,e.lighteningLevel/2);this.manager.setLightLevel(t)}if(void 0!==e.rednessLevel){const t=Math.max(.01,e.rednessLevel);this.manager.setRednessLevel(t)}if(void 0!==e.lighteningContrastLevel){const t=e.lighteningContrastLevel;this.manager.setContrastLevel(t)}}async onTrack(e,t){var i;this.video&&this.enabled&&(null===(i=this.stopLoop)||void 0===i||i.call(this),await this.stopEffect(e,t)),await this.startEffect(e,t)}async startEffect(e,t){if(!this.enabled)return;const i=Dy(),n=await this.renderWithWebGL(e);this.output(n,t),mw.info("start video effect, output:",this.outputTrack),this.overloadDetector.startRecordBeautyEffectOutput(this.fps).then((e=>{e||this.onOverload&&this.onOverload()}));let r=!1;this.stopLoop=()=>{r=!0};const o=()=>{this.enabled&&!r&&requestAnimationFrame(o);const e=Date.now(),t=1e3/this.fps,i=this.lastRenderTime?e-this.lastRenderTime:t;i<t||(this.lastRenderTime=e-(i-t),this.video&&this.video.paused&&this.video.play(),this.enabled&&this.video&&(this.manager.render(this.video),this.outputTrack&&this.outputTrack.requestFrame&&this.outputTrack.requestFrame(),this.overloadDetector.addFrame()))};requestAnimationFrame(o),i.name===Oy.CHROME&&document.addEventListener("visibilitychange",(()=>{document.hidden?this.stopChromeBackgroundLoop=Xx((()=>{this.enabled&&this.video&&this.manager.render(this.video),this.outputTrack&&this.outputTrack.requestFrame&&this.outputTrack.requestFrame(),this.overloadDetector.addFrame()}),this.fps):this.stopChromeBackgroundLoop&&(this.stopChromeBackgroundLoop(),this.stopChromeBackgroundLoop=null)}),!1)}async renderWithWebGL(e){this.canvas&&(this.canvas.remove(),this.canvas=void 0),this.video&&(this.video.remove(),this.video=void 0),this.canvas=document.createElement("canvas"),this.video=document.createElement("video"),this.video.setAttribute("autoplay",""),this.video.setAttribute("muted",""),this.video.muted=!0,this.video.setAttribute("playsinline",""),this.video.setAttribute("style","display:none"),this.video.srcObject=new MediaStream([e]);const t=new Mm((e=>{const t=()=>{this.video&&this.video.removeEventListener("playing",t),e(void 0)};this.video&&this.video.addEventListener("playing",t)}));this.video.play(),await t;const i=e.getSettings(),n=i.width||this.video.videoWidth,r=i.height||this.video.videoHeight;if(i.frameRate&&this.fps!==i.frameRate&&(this.fps=i.frameRate,mw.debug("beauty video processor: set fps to",this.fps)),mw.debug("beauty video processor: width ".concat(n," height ").concat(r)),!n||!r)throw new pw(hw.BEAUTY_PROCESSOR_INTERNAL_ERROR,"can not get track resolution");this.canvas.width=n,this.canvas.height=r,this.video.setAttribute("width",n.toString()),this.video.setAttribute("height",r.toString()),this.manager.init(n,r,this.canvas);const o=XP();return this.canvas.captureStream(o.supportRequestFrame?0:this.fps).getVideoTracks()[0]}async stopEffect(e,t){mw.info("stop video effect"),this.overloadDetector.stopRecordBeautyEffectOutput(),this.manager.release(),this.canvas&&this.canvas.remove(),this.video&&this.video.remove(),this.canvas=void 0,this.video=void 0,this.output(e,t)}}function _J(e){const t={};if(e.facingMode&&(t.facingMode=e.facingMode),e.cameraId&&(t.deviceId={exact:e.cameraId}),!e.encoderConfig)return t;const i=ib(e.encoderConfig);return t.width=i.width,t.height=i.height,!Hy()&&i.frameRate&&(t.frameRate=i.frameRate),Dy().name===Oy.EDGE&&"object"==typeof t.frameRate&&(t.frameRate.max=60),By()&&(t.frameRate={ideal:30,max:30}),t}function IJ(e){const t={};e.screenSourceType&&(t.mediaSource=e.screenSourceType),e.extensionId&&My()&&(t.extensionId=e.extensionId),e.electronScreenSourceId&&(t.sourceId=e.electronScreenSourceId);const i=e.encoderConfig?nb(e.encoderConfig):null;return t.mandatory={chromeMediaSource:"desktop",maxWidth:i?i.width:void 0,maxHeight:i?i.height:void 0},i&&i.frameRate&&("number"==typeof i.frameRate?(t.mandatory.maxFrameRate=i.frameRate,t.mandatory.minFrameRate=i.frameRate):(t.mandatory.maxFrameRate=i.frameRate.max||i.frameRate.ideal||i.frameRate.exact||void 0,t.mandatory.minFrameRate=i.frameRate.min||i.frameRate.ideal||i.frameRate.exact||void 0),t.frameRate=i.frameRate),i&&i.width&&(t.width=i.width),i&&i.height&&(t.height=i.height),t}function gJ(e){const t={};if(Hy()||(void 0!==e.AGC&&(t.autoGainControl=e.AGC),void 0!==e.AEC&&(t.echoCancellation=e.AEC),void 0!==e.ANS&&(t.noiseSuppression=e.ANS,My()&&e.ANS&&(t.googHighpassFilter=e.ANS))),e.encoderConfig){const i=sb(e.encoderConfig);t.channelCount=i.stereo?2:1,t.sampleRate=i.sampleRate,t.sampleSize=i.sampleSize}return e.microphoneId&&(t.deviceId={exact:e.microphoneId}),Wy()&&(t.sampleRate=void 0),t}var fJ,RJ;!function(e){e.COVERED="COVERED",e.POSITION="POSITION",e.SIZE="SIZE",e.STYLE="STYLE"}(fJ||(fJ={})),function(e){e.UNMOUNTED="UNMOUNTED",e.INVALID_HTML_ELEMENT="INVALID_HTML_ELEMENT"}(RJ||(RJ={}));var CJ,TJ,mJ,SJ,OJ,vJ,NJ,yJ,DJ,wJ,bJ,LJ,PJ,kJ,MJ,UJ,BJ,VJ,QJ,xJ,FJ,GJ,jJ,YJ=new class{constructor(){tD(this,"_clientSize",null),tD(this,"getClientWidth",(()=>document.documentElement?document.documentElement.clientWidth:document.body.clientWidth)),tD(this,"getClientHeight",(()=>document.documentElement?document.documentElement.clientHeight:document.body.clientHeight)),tD(this,"getStyle",(e=>window.getComputedStyle(e,null))),tD(this,"checkCssVisibleProperty",(e=>{let t=!0;const i=this.getStyle(e),{display:n,visibility:r,opacity:o,filter:s}=i;return("none"===n||["hidden","collapse"].includes(r)||Number(o)<.1)&&(t=!1),!!t&&(s&&s.split(" ").filter((e=>{const t=e.split("(")[0];return["brightness","blur","opacity"].includes(t)})).map((e=>{const[t,i]=e.split(/\(|\)/);return[t,Number(i.match(/^[0-9\.]+/))]})).forEach((e=>{const[i,n]=e;switch(i){case"brightness":(n<.1||n>3)&&(t=!1);break;case"blur":n>3&&(t=!1);break;case"opacity":n<.1&&(t=!1)}})),t)})),tD(this,"checkPropertyUpToAllParentNodes",((e,t)=>{let i=!0,n=!0;const r=e=>t(e);let o=e;for(;o&&n;)r(o)||(i=!1,n=!1),o=o.parentElement,o||(n=!1);return i})),tD(this,"checkActualCssVisibleIncludeInherit",(e=>this.checkPropertyUpToAllParentNodes(e,this.checkCssVisibleProperty))),tD(this,"getSizeAboutClient",(e=>{const{width:t,height:i,left:n,right:r,top:o,bottom:s}=e.getBoundingClientRect(),a=this.getClientWidth(),c=this.getClientHeight();return{width:t,height:i,left:n,right:r,top:o,bottom:s,clientWidth:a,clientHeight:c,clientMin:Math.min(a,c)}})),tD(this,"checkActualSize",(()=>{const{width:e,height:t,clientMin:i}=this._clientSize;return this.checkSizeIsVisible(e,t,i)})),tD(this,"elementFromPoint",((e,t)=>document.elementFromPoint?document.elementFromPoint(e,t):null)),tD(this,"checkCoverForAPoint",((e,t,i)=>{const n=this.elementFromPoint(e,t);return null!==n&&n!==i})),tD(this,"getPointPositionList",(()=>{const{width:e,height:t,left:i,top:n}=this._clientSize,r=e/6,o=t/6,s=[],a=10**6;for(let e=0;e<5;e++)for(let t=0;t<5;t++){const c=(i*a+(0===e?.1:4===e?(r*e*a-1e5)/a:r*e)*a)/a,A=(n*a+(0===t?.1:4===t?(o*t*a-1e5)/a:o*t)*a)/a;s.push({x:c,y:A})}return[...s]})),tD(this,"checkElementCover",(e=>this.getPointPositionList().map((t=>this.checkCoverForAPoint(t.x,t.y,e))).filter((e=>!!e)).length>6)),tD(this,"checkSizeIsVisible",((e,t,i)=>(e>50||i/e<=10)&&(t>50||i/t<=10))),tD(this,"checkSizeOfPartInClient",(()=>{const{left:e,right:t,top:i,bottom:n,clientHeight:r,clientWidth:o,clientMin:s}=this._clientSize;let a,c,A,d;if(e<0)a=0;else{if(!(e<o))return!1;a=e}if(t<0)return!1;if(c=t<o?t:o,i<0)A=0;else{if(!(i<r))return!1;A=i}if(n<0)return!1;d=n<r?n:r;const u=c-a,E=d-A;return this.checkSizeIsVisible(u,E,s)})),tD(this,"returnHiddenResult",(e=>(this._clientSize=null,{visible:!1,reason:e}))),tD(this,"checkOneElementVisible",(e=>{if(e instanceof HTMLElement){if(this.checkElementIsMountedOnDom(e)){if(this.checkActualCssVisibleIncludeInherit(e)){if(this._clientSize=this.getSizeAboutClient(e),this.checkElementCover(e))return this.returnHiddenResult(fJ.COVERED);{const e=this.checkActualSize(),t=this.checkSizeOfPartInClient();return e&&!t?this.returnHiddenResult(fJ.POSITION):e?(this._clientSize=null,{visible:!0}):this.returnHiddenResult(fJ.SIZE)}}return this.returnHiddenResult(fJ.STYLE)}return this.returnHiddenResult(RJ.UNMOUNTED)}return this.returnHiddenResult(RJ.INVALID_HTML_ELEMENT)})),tD(this,"checkElementIsMountedOnDom",(e=>this.checkPropertyUpToAllParentNodes(e,(e=>"HTML"!==e.nodeName.toUpperCase()?null!==e.parentElement:!!document.documentElement))))}};function HJ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function KJ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?HJ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):HJ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let WJ=(CJ=Ww("LocalVideoTrack","getTrackId"),TJ=IF(),mJ=xx("LocalVideoTrack","_enabledMutex"),SJ=IF(),OJ=xx("LocalVideoTrack","_enabledMutex"),vJ=IF(),NJ=Lx({report:Px}),yJ=IF(),DJ=IF(),wJ=IF(),bJ=IF(),LJ=IF(),PJ=IF(),kJ=IF(),CJ((tx((UJ=class e extends Fx{get isPlaying(){return!(!this._player||this._player.videoElementStatus!==mL.PLAYING)}constructor(e,t,i,n,r,o){super(e,r),tD(this,"trackMediaType","video"),tD(this,"_player",void 0),tD(this,"_videoBeautyProcessor",void 0),tD(this,"_videoVisibleTimer",null),tD(this,"_previousVideoVisibleStatus",void 0),tD(this,"_clearPreviousVideoVisibleStatus",(()=>this._previousVideoVisibleStatus=void 0)),tD(this,"_encoderConfig",void 0),tD(this,"_scalabiltyMode",{numSpatialLayers:1,numTemporalLayers:1}),tD(this,"_optimizationMode",void 0),tD(this,"_videoHeight",void 0),tD(this,"_videoWidth",void 0),tD(this,"_forceBitrateLimit",void 0),tD(this,"_enabled",!0),tD(this,"processorDestination",void 0),tD(this,"processorContext",void 0),this.updateMediaStreamTrackResolution(),this._encoderConfig=t,this._scalabiltyMode=i,this._optimizationMode=n,this._hints=o||[],-1===this._hints.indexOf(vP.SCREEN_TRACK)&&this.updateBitrateFromProfile(),this.processorContext=new XJ(this.getTrackId()),this.processorDestination=new qJ(this.processorContext),this.bindProcessorDestinationEvents()}play(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_PLAY,options:[this.getTrackId(),"string"==typeof e?e:"HTMLElement",t]});if("string"==typeof e){const t=document.getElementById(e);t?e=t:(mw.warning("[".concat(this.getTrackId(),'] can not find "#').concat(e,'" element, use document.body')),xw("warning",this,'can not find "#'.concat(e,'" element, use document.body')),e=document.body)}mw.debug("[".concat(this.getTrackId(),"] start video playback"),JSON.stringify(t)),Yw("debug",this,"play",t);const n=KJ(KJ(KJ({},this._getDefaultPlayerConfig()),t),{},{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(n):(this._player=new KW(n),this._player.updateVideoTrack(this._mediaStreamTrack)),this._player.play(),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval((()=>{try{const e=this.getVideoElementVisibleStatus();this.emit(DP.VIDEO_ELEMENT_VISIBLE_STATUS,e)}catch(e){}}),cb("CHECK_VIDEO_VISIBLE_INTERVAL")),i.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_STOP,options:[this.getTrackId()]});if(!this._player)return e.onSuccess();this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,mw.debug("[".concat(this.getTrackId(),"] stop video playback")),Yw("debug",this,"stop"),e.onSuccess()}async setEnabled(e,t){if(!t){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),!e){this._originMediaStreamTrack.enabled=!1;try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled to false error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}return t||(this._enabled=!1),mw.info("[".concat(this.getTrackId(),"] setEnabled to false success")),void Yw("info",this,"setEnabled",e,"success")}this._originMediaStreamTrack.enabled=!0;try{await LG(this,OP.NEED_ENABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled to true error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}mw.info("[".concat(this.getTrackId(),"] setEnabled to true success")),Yw("info",this,"setEnabled",e,"success"),t||(this._enabled=!0)}async setMuted(e){e!==this._muted&&(this.stateCheck("muted",e),this._muted=e,this._mediaStreamTrack.enabled=!e,mw.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(e)),Yw("debug",this,"setMuted",e),e?await LG(this,OP.NEED_MUTE_TRACK,this):await LG(this,OP.NEED_UNMUTE_TRACK,this))}getStats(){return xG((()=>{mw.warning("[deprecated] LocalVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalVideoStats instead"),xw("warning",this,"[deprecated] LocalVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalVideoStats instead")}),"localVideoTrackGetStatsWarning"),PG(this,OP.GET_STATS)||KJ({},iP)}async setBeautyEffect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_BEAUTY,options:[this.getTrackId(),e,t]});if(e||this._videoBeautyProcessor){if(Py()===Sy.IOS||Py()===Sy.ANDROID){const e=new pw(hw.INVALID_OPERATION,"can not enable beauty effect on mobile device");throw i.onError(e),e}if(!this._enabled&&e){const e=new pw(hw.TRACK_IS_DISABLED,"can not enable beauty effect when track is disabled");throw i.onError(e),e}if(mw.info("[".concat(this.getTrackId(),"] start setBeautyEffect"),e,JSON.stringify(t)),Yw("info",this,"setBeautyEffect",[e,t]),this._videoBeautyProcessor||e){try{if(!this._videoBeautyProcessor)if(this._videoBeautyProcessor=new pJ,this.processor){const e=this.processor;this.pipe(this._videoBeautyProcessor).pipe(e)}else this.pipe(this._videoBeautyProcessor).pipe(this.processorDestination);await this._videoBeautyProcessor.setBeautyEffectOptions(t),e?await this._videoBeautyProcessor.enable():await this._videoBeautyProcessor.disable()}catch(n){throw mw.error("[".concat(this.getTrackId(),"] setBeautyEffect error"),n.toString()),Yw("info",this,"setBeautyEffect",[e,t]),i.onError(n),n}mw.info("[".concat(this.getTrackId(),"] setBeautyEffect success")),Yw("info",this,"setBeautyEffect",[e,t],"success"),i.onSuccess()}else i.onSuccess()}}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}clone(t,i,n,r){const o=this._mediaStreamTrack.clone();return new e(o,t,i,n,r)}async setBitrateLimit(e){if(mw.debug("[".concat(this.getTrackId(),"] set bitrate limit, ").concat(JSON.stringify(e))),Yw("debug",this,"setBitrateLimit",e),e){this._forceBitrateLimit=e,this._encoderConfig&&(this._encoderConfig.bitrateMax?this._encoderConfig.bitrateMax=this._encoderConfig.bitrateMax<e.max_bitrate?this._encoderConfig.bitrateMax:e.max_bitrate:this._encoderConfig.bitrateMax=e.max_bitrate,this._encoderConfig.bitrateMin,this._encoderConfig.bitrateMin=e.min_bitrate);try{await LG(this,OP.NEED_UPDATE_VIDEO_ENCODER,this)}catch(e){return e.throw()}}}async setOptimizationMode(e){if("motion"!==e&&"detail"!==e&&"balanced"!==e)return mw.error(hw.INVALID_PARAMS,"optimization mode must be motion, detail or balanced"),void Yw("error",this,"setOptimizationMode",e,hw.INVALID_PARAMS);const t=this._optimizationMode;try{this._optimizationMode=e,await LG(this,OP.SET_OPTIMIZATION_MODE,this)}catch(i){throw this._optimizationMode=t,mw.error("[".concat(this.getTrackId(),"] set optimization mode failed"),i.toString()),Yw("error",this,"setOptimizationMode",e,i.toString()),i}mw.info("[".concat(this.getTrackId(),"] set optimization mode success (").concat(e,")")),Yw("info",this,"setOptimizationMode",e,"success")}setScalabiltyMode(e){if(1===e.numSpatialLayers&&1!==e.numTemporalLayers)return mw.error(hw.INVALID_PARAMS,"scalability mode currently not supported, no SVC."),Yw("error",this,"setScalabiltyMode",e,hw.INVALID_PARAMS),void(this._scalabiltyMode={numSpatialLayers:1,numTemporalLayers:1});this._scalabiltyMode=e,mw.info("[".concat(this.getTrackId(),"] set scalability mode success (").concat(e,")")),Yw("info",this,"setScalabiltyMode",e,"success")}updateMediaStreamTrackResolution(){DG(this._originMediaStreamTrack).then((e=>{let[t,i]=e;this._videoHeight=i,this._videoWidth=t})).catch(yG)}_updatePlayerSource(){this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}_getDefaultPlayerConfig(){return{fit:"contain"}}updateBitrateFromProfile(){if(!this._encoderConfig)return;const{width:e,height:t,frameRate:i}=this.getMediaStreamTrackSettings();if(!e||!t||!i)return;const[n,r]=function(e,t,i){const n=cb("BITRATE_ADAPTER_TYPE");let r;const o=200*Math.pow(i/15,.6)*Math.pow(e*t/640/360,.75),s=o;if("STANDARD_BITRATE"===n)r=4*o;else{if("COMPATIABLE_BITRATE"!==n)return;r=2*o}return[Math.floor(r),Math.floor(s)]}(e,t,i)||[void 0,void 0];this._encoderConfig.bitrateMin||this._encoderConfig.bitrateMax||(this._encoderConfig.bitrateMin=r,this._encoderConfig.bitrateMax=n,mw.debug("[".concat(this.getTrackId(),"] update bitrate from profile, [w: ").concat(e,", h: ").concat(t,", fps: ").concat(i,"] => [brMax: ").concat(n,", brMin: ").concat(r,"]")),Yw("debug",this,"updateBitrateFromProfile",void 0,"[w: ".concat(e,", h: ").concat(t,", fps: ").concat(i,"] => [brMax: ").concat(n,", brMin: ").concat(r,"]")))}getVideoElementVisibleStatus(){try{var e,t;const i=null==this||null===(e=this._player)||void 0===e?void 0:e.getContainerElement(),n={track:this,element:null==this||null===(t=this._player)||void 0===t?void 0:t.getVideoElement(),slot:null==i?void 0:i.parentElement},{element:r,slot:o}=n;if(this.isPlaying&&r instanceof HTMLVideoElement&&o instanceof HTMLElement){const e=YJ.checkOneElementVisible(r),t=Object.assign({},e);if(t.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=t.visible;const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});t.visible?e.onSuccess("Video is visible"):e.onSuccess("Invisible because of ".concat(t.reason))}return t}return}catch(e){throw new pw(hw.GET_VIDEO_ELEMENT_VISIBLE_ERROR,e.message)}}async renewMediaStreamTrack(e){}pipe(e){if(this._videoBeautyProcessor&&e!==this._videoBeautyProcessor)return this._videoBeautyProcessor.pipe(e);if(this.processor===e)return e;if(e._source)throw new pw(hw.INVALID_OPERATION,"Processor ".concat(e.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=e,this.processor._source=this,e.updateInput({track:this._originMediaStreamTrack,context:this.processorContext}),e}unpipe(){if(!this.processor)return;const e=this.processor;this.processor._source=void 0,this.processor=void 0,e.reset()}close(){super.close(),this.unbindProcessorDestinationEvents(),this.unbindProcessorContextEvents(),this.unpipe(),this.processorDestination._source&&this.processorDestination._source.unpipe()}bindProcessorDestinationEvents(){this.processorDestination.on(WP.ON_TRACK,(async e=>{e?e!==this._mediaStreamTrack&&(this._mediaStreamTrack=e,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await LG(this,OP.NEED_REPLACE_TRACK,this))}))}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(WP.ON_TRACK)}unbindProcessorContextEvents(){this.processorContext.removeAllListeners(JP.REQUEST_UPDATE_CONSTRAINTS),this.processorContext.removeAllListeners(JP.REQUEST_CONSTRAINTS)}}).prototype,"play",[TJ],Object.getOwnPropertyDescriptor(UJ.prototype,"play"),UJ.prototype),tx(UJ.prototype,"setEnabled",[mJ,SJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setEnabled"),UJ.prototype),tx(UJ.prototype,"setMuted",[OJ,vJ,NJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setMuted"),UJ.prototype),tx(UJ.prototype,"getStats",[yJ],Object.getOwnPropertyDescriptor(UJ.prototype,"getStats"),UJ.prototype),tx(UJ.prototype,"setBeautyEffect",[DJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setBeautyEffect"),UJ.prototype),tx(UJ.prototype,"getCurrentFrameData",[wJ],Object.getOwnPropertyDescriptor(UJ.prototype,"getCurrentFrameData"),UJ.prototype),tx(UJ.prototype,"setBitrateLimit",[bJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setBitrateLimit"),UJ.prototype),tx(UJ.prototype,"setOptimizationMode",[LJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setOptimizationMode"),UJ.prototype),tx(UJ.prototype,"setScalabiltyMode",[PJ],Object.getOwnPropertyDescriptor(UJ.prototype,"setScalabiltyMode"),UJ.prototype),tx(UJ.prototype,"updateMediaStreamTrackResolution",[kJ],Object.getOwnPropertyDescriptor(UJ.prototype,"updateMediaStreamTrackResolution"),UJ.prototype),MJ=UJ))||MJ),JJ=(BJ=Ww("CameraVideoTrack","getTrackId"),VJ=IF(),QJ=xx("CameraVideoTrack","_enabledMutex"),xJ=IF(),FJ=IF(),BJ((tx((jJ=class extends WJ{constructor(e,t,i,n,r,o){super(e,t.encoderConfig?ib(t.encoderConfig):{},n,r,o),tD(this,"_config",void 0),tD(this,"_originalConstraints",void 0),tD(this,"_constraints",void 0),tD(this,"_enabled",!0),tD(this,"_deviceName","default"),tD(this,"tryResumeVideoForIOS15WeChat",(async()=>{Qy()&&!Gy()&&Yy()&&this._enabled&&!this._isClosed&&(mw.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS 15 device on WeChat.")),await this.renewMediaStreamTrack())})),Kw("info",this,"constructor",{trackId:o,deviceId:e.label,constraints:i,config:t}),this._config=t,this._originalConstraints=i,this._constraints=i,this._deviceName=e.label,this._config.encoderConfig&&(this._encoderConfig=ib(this._config.encoderConfig)),Kx.on(Mx.IOS_15_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat),Kx.on(Mx.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat),this.bindProcessorContextEvents()}async setDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CAM_VIDEO_TRACK_SET_DEVICE,options:[this.getTrackId(),e]});if(mw.info("[".concat(this.getTrackId(),"] set device to ").concat(e)),Yw("info",this,"setDevice",e),this._enabled)try{const i=await EF.getDeviceById(e),n={};n.video=KJ({},this._constraints),n.video.deviceId={exact:e},n.video.facingMode=void 0,this._originMediaStreamTrack.stop();let r=null;try{r=await cF(n,this.getTrackId())}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setDevice failed"),t.toString()),Yw("error",this,"setDevice",e,t.toString()),r=await cF({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(r.getVideoTracks()[0],!1),t}await this._updateOriginMediaStreamTrack(r.getVideoTracks()[0],!1),this.updateMediaStreamTrackResolution(),this._deviceName=i.label,this._config.cameraId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}else try{const t=await EF.getDeviceById(e);this._deviceName=t.label,this._config.cameraId=e,this._constraints.deviceId={exact:e}}catch(i){throw t.onError(i),mw.error("[".concat(this.getTrackId(),"] setDevice error"),i.toString()),Yw("error",this,"setDevice",e,i.toString()),i}mw.info("[".concat(this.getTrackId(),"] setDevice success")),Yw("info",this,"setDevice",e,"success"),t.onSuccess()}async setEnabled(e,t){if(!t){if(e===this._enabled)return;this.stateCheck("enabled",e)}if(mw.info("[".concat(this.getTrackId(),"] start setEnabled"),e),Yw("info",this,"setEnabled",e),!e){this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),t||(this._enabled=!1);try{await LG(this,OP.NEED_DISABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled to false error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}return mw.info("[".concat(this.getTrackId(),"] setEnabled to false success")),void Yw("info",this,"setEnabled",e,"success")}const i=KJ({},this._constraints),n=EF.searchDeviceIdByName(this._deviceName);n&&!i.deviceId&&(i.deviceId={exact:n});try{const e=await cF({video:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(e.getVideoTracks()[0],!1),await LG(this,OP.NEED_ENABLE_TRACK,this)}catch(t){throw mw.error("[".concat(this.getTrackId(),"] setEnabled true error"),t.toString()),Yw("error",this,"setEnabled",e,t.toString()),t}this.updateMediaStreamTrackResolution(),mw.info("[".concat(this.getTrackId(),"] setEnabled to true success")),Yw("info",this,"setEnabled",e,"success"),t||(this._enabled=!0)}async setEncoderConfiguration(e,t){const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CAM_VIDEO_TRACK_SET_ENCODER_CONFIG,options:[this.getTrackId(),e]});if(!this._enabled){const e=new pw(hw.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");throw i.onError(e),e}e=ib(e),this._forceBitrateLimit&&(e.bitrateMax=this._forceBitrateLimit.max_bitrate?this._forceBitrateLimit.max_bitrate:e.bitrateMax,e.bitrateMin=this._forceBitrateLimit.min_bitrate?this._forceBitrateLimit.min_bitrate:e.bitrateMin);const n=VG(this._config);n.encoderConfig=e;const r=_J(n);(Uy()||Vy()||jy())&&(r.deviceId=void 0),mw.debug("[".concat(this.getTrackId(),"] setEncoderConfiguration applyConstraints"),JSON.stringify(e),JSON.stringify(r)),Yw("debug",this,"setEncoderConfiguration",e);try{await this._originMediaStreamTrack.applyConstraints(r),this.updateMediaStreamTrackResolution()}catch(e){const t=new pw(hw.UNEXPECTED_ERROR,e.toString());throw mw.error("[".concat(this.getTrackId(),"] applyConstraints error"),t.toString()),Yw("error",this,"setEncoderConfiguration",e.toString()),i.onError(t),t}this._config=n,this._constraints=r,this._originalConstraints=r,this._encoderConfig=e,-1===this._hints.indexOf(vP.SCREEN_TRACK)&&this.updateBitrateFromProfile();try{await LG(this,OP.NEED_UPDATE_VIDEO_ENCODER,this)}catch(e){return i.onError(e),e.throw()}i.onSuccess()}_getDefaultPlayerConfig(){return{mirror:!0,fit:"cover"}}onTrackEnded(){if((Vy()||jy())&&this._enabled&&!this._isClosed&&Kx.duringInterruption){const e=async()=>{Kx.off(Mx.IOS_INTERRUPTION_END,e),this._enabled&&!this._isClosed&&(mw.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS device.")),xw("debug",this,"try capture camera media device for interrupted iOS device."),await this.setEnabled(!1),await this.setEnabled(!0))};Kx.on(Mx.IOS_INTERRUPTION_END,e)}else mw.debug("[".concat(this.getTrackId(),"] track ended")),jw("debug",["MediaStreamTrack",this.getTrackId()],"ended"),this.emit(DP.TRACK_ENDED)}async renewMediaStreamTrack(e){const t=e||this._constraints,i=EF.searchDeviceIdByName(this._deviceName);i&&!t.deviceId&&(t.deviceId={exact:i});const n=await cF({video:t},this.getTrackId());this._constraints=t,await this._updateOriginMediaStreamTrack(n.getVideoTracks()[0],!0),this.updateMediaStreamTrackResolution()}close(){super.close(),Kx.off(Mx.IOS_15_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat),Kx.off(Mx.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15WeChat)}bindProcessorContextEvents(){this.processorContext.on(JP.REQUEST_UPDATE_CONSTRAINTS,(async(e,t,i)=>{try{const i=Object.assign({},this._originalConstraints,...e);await this.renewMediaStreamTrack(i),t()}catch(e){i(e)}})),this.processorContext.on(JP.REQUEST_CONSTRAINTS,(async e=>{e(this._originMediaStreamTrack.getSettings())}))}}).prototype,"setDevice",[VJ],Object.getOwnPropertyDescriptor(jJ.prototype,"setDevice"),jJ.prototype),tx(jJ.prototype,"setEnabled",[QJ,xJ],Object.getOwnPropertyDescriptor(jJ.prototype,"setEnabled"),jJ.prototype),tx(jJ.prototype,"setEncoderConfiguration",[FJ],Object.getOwnPropertyDescriptor(jJ.prototype,"setEncoderConfiguration"),jJ.prototype),GJ=jJ))||GJ);class qJ extends Ew{constructor(e){super(),tD(this,"name","VideoProcessorDestination"),tD(this,"ID","0"),tD(this,"_source",void 0),tD(this,"videoContext",void 0),tD(this,"inputTrack",void 0),this.videoContext=e}get kind(){return"video"}get enabled(){return!0}pipe(){throw new pw(hw.NOT_SUPPORTED,"VideoProcessor cannot pipe to any other Processor")}unpipe(){throw new pw(hw.NOT_SUPPORTED,"VideoProcessor cannot unpipe to any other Processor")}enable(){}disable(){}updateInput(e){if(e.context!==this.videoContext)throw new Error("ProcessorContext passed to VideoTrack.processorDestination doesn't match it's belonging VideoTrack's context.\nProbably you are making pipeline like this:\nvideoTrack1.pipe(processor).pipe(videoTrack2.processorDestination).");e.track&&e.track!==this.inputTrack&&(this.inputTrack=e.track,this.emit(WP.ON_TRACK,e.track))}reset(){this.inputTrack=void 0,this.emit(WP.ON_TRACK,void 0)}}class XJ extends Ew{constructor(e){super(),tD(this,"constraintsMap",new Map),tD(this,"statsRegistry",[]),tD(this,"trackId",void 0),this.trackId=e}async getConstraints(){return await bG(this,JP.REQUEST_CONSTRAINTS)}async requestApplyConstraints(e,t){var i;return mw.info("processor ".concat(t.name," requestApplyConstraints for ").concat(this.trackId)),e&&this.constraintsMap.set(t,e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(i=this.constraintsMap).call(i)))}async requestRevertConstraints(e){var t;if(this.constraintsMap.has(e))return mw.info("processor ".concat(e.name," requestRevertConstraints for ").concat(this.trackId)),this.constraintsMap.delete(e),LG(this,JP.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ax(t=this.constraintsMap).call(t)))}registerStats(e,t,i){this.statsRegistry.find((i=>i.processorID===e.ID&&i.processorName===e.name&&i.type===t))||this.statsRegistry.push({processorName:e.name,processorID:e.ID,type:t,cb:i})}unregisterStats(e,t){}gatherStats(){return this.statsRegistry.map((e=>{let{processorID:t,processorName:i,type:n,cb:r}=e;return{processorID:t,processorName:i,type:n,stats:r()}}))}}class zJ{get hasVideo(){return this._video_enabled_&&!this._video_muted_&&this._video_added_}get hasAudio(){return this._audio_enabled_&&!this._audio_muted_&&this._audio_added_}get audioTrack(){if(this.hasAudio)return this._audioTrack}get videoTrack(){if(this.hasVideo)return this._videoTrack}constructor(e,t){tD(this,"uid",void 0),tD(this,"_uintid",void 0),tD(this,"_trust_in_room_",!0),tD(this,"_trust_audio_enabled_state_",!0),tD(this,"_trust_video_enabled_state_",!0),tD(this,"_trust_audio_mute_state_",!0),tD(this,"_trust_video_mute_state_",!0),tD(this,"_trust_stream_added_state_",!0),tD(this,"_audio_muted_",!1),tD(this,"_video_muted_",!1),tD(this,"_audio_enabled_",!0),tD(this,"_video_enabled_",!0),tD(this,"_audio_added_",!1),tD(this,"_video_added_",!1),tD(this,"_audioTrack",void 0),tD(this,"_videoTrack",void 0),tD(this,"_audioSSRC",void 0),tD(this,"_videoSSRC",void 0),tD(this,"_audioOrtc",void 0),tD(this,"_videoOrtc",void 0),tD(this,"_cname",void 0),tD(this,"_rtxSsrcId",void 0),this.uid=e,this._uintid=t}}var ZJ=km,$J=PC,eq=FC;Bu({target:"Promise",stat:!0},{try:function(e){var t=$J.f(this),i=eq(e);return(i.error?t.reject:t.resolve)(i.value),t.promise}});var tq=ZJ,iq=Bu,nq=Lc,rq=Tc,oq=qV,sq=lA,aq=rd,cq=ju,Aq=Cb,dq=iQ,uq=MQ,Eq=NA,lq=md("isConcatSpreadable"),hq=9007199254740991,pq="Maximum allowed index exceeded",_q=nq.TypeError,Iq=Eq>=51||!rq((function(){var e=[];return e[lq]=!1,e.concat()[0]!==e})),gq=uq("concat"),fq=function(e){if(!sq(e))return!1;var t=e[lq];return void 0!==t?!!t:oq(e)};iq({target:"Array",proto:!0,forced:!Iq||!gq},{concat:function(e){var t,i,n,r,o,s=aq(this),a=dq(s,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(fq(o=-1===t?s:arguments[t])){if(c+(r=cq(o))>hq)throw _q(pq);for(i=0;i<r;i++,c++)i in o&&Aq(a,c,o[i])}else{if(c>=hq)throw _q(pq);Aq(a,c++,o)}return a.length=c,a}});var Rq={},Cq=eA,Tq=uA,mq=qp.f,Sq=Nb,Oq="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Rq.f=function(e){return Oq&&"Window"==Cq(e)?function(e){try{return mq(e)}catch(e){return Sq(Oq)}}(e):mq(Tq(e))};var vq={},Nq=md;vq.f=Nq;var yq=hA,Dq=ad,wq=vq,bq=cu.f,Lq=function(e){var t=yq.Symbol||(yq.Symbol={});Dq(t,e)||bq(t,e,{value:wq.f(e)})},Pq=Bu,kq=Lc,Mq=fA,Uq=Bc,Bq=jc,Vq=Dc,Qq=xc,xq=wA,Fq=Tc,Gq=ad,jq=qV,Yq=Vc,Hq=lA,Kq=wc,Wq=BA,Jq=hu,qq=rd,Xq=uA,zq=Pd,Zq=qI,$q=Xc,eX=q_,tX=D_,iX=qp,nX=Rq,rX=p_,oX=Qc,sX=cu,aX=v_,cX=Yc,AX=kR,dX=tf,uX=XA.exports,EX=o_,lX=Ed,hX=md,pX=vq,_X=Lq,IX=Rf,gX=Wg,fX=dQ.forEach,RX=bp("hidden"),CX="Symbol",TX=hX("toPrimitive"),mX=gX.set,SX=gX.getterFor(CX),OX=Object.prototype,vX=kq.Symbol,NX=vX&&vX.prototype,yX=kq.TypeError,DX=kq.QObject,wX=Mq("JSON","stringify"),bX=oX.f,LX=sX.f,PX=nX.f,kX=cX.f,MX=Vq([].push),UX=uX("symbols"),BX=uX("op-symbols"),VX=uX("string-to-symbol-registry"),QX=uX("symbol-to-string-registry"),xX=uX("wks"),FX=!DX||!DX.prototype||!DX.prototype.findChild,GX=Qq&&Fq((function(){return 7!=eX(LX({},"a",{get:function(){return LX(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=bX(OX,t);n&&delete OX[t],LX(e,t,i),n&&e!==OX&&LX(OX,t,n)}:LX,jX=function(e,t){var i=UX[e]=eX(NX);return mX(i,{type:CX,tag:e,description:t}),Qq||(i.description=t),i},YX=function(e,t,i){e===OX&&YX(BX,t,i),Jq(e);var n=zq(t);return Jq(i),Gq(UX,n)?(i.enumerable?(Gq(e,RX)&&e[RX][n]&&(e[RX][n]=!1),i=eX(i,{enumerable:$q(0,!1)})):(Gq(e,RX)||LX(e,RX,$q(1,{})),e[RX][n]=!0),GX(e,n,i)):LX(e,n,i)},HX=function(e,t){Jq(e);var i=Xq(t),n=tX(i).concat(qX(i));return fX(n,(function(t){Qq&&!Bq(KX,i,t)||YX(e,t,i[t])})),e},KX=function(e){var t=zq(e),i=Bq(kX,this,t);return!(this===OX&&Gq(UX,t)&&!Gq(BX,t))&&(!(i||!Gq(this,t)||!Gq(UX,t)||Gq(this,RX)&&this[RX][t])||i)},WX=function(e,t){var i=Xq(e),n=zq(t);if(i!==OX||!Gq(UX,n)||Gq(BX,n)){var r=bX(i,n);return!r||!Gq(UX,n)||Gq(i,RX)&&i[RX][n]||(r.enumerable=!0),r}},JX=function(e){var t=PX(Xq(e)),i=[];return fX(t,(function(e){Gq(UX,e)||Gq(EX,e)||MX(i,e)})),i},qX=function(e){var t=e===OX,i=PX(t?BX:Xq(e)),n=[];return fX(i,(function(e){!Gq(UX,e)||t&&!Gq(OX,e)||MX(n,UX[e])})),n};if(xq||(dX(NX=(vX=function(){if(Kq(NX,this))throw yX("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Zq(arguments[0]):void 0,t=lX(e),i=function(e){this===OX&&Bq(i,BX,e),Gq(this,RX)&&Gq(this[RX],t)&&(this[RX][t]=!1),GX(this,t,$q(1,e))};return Qq&&FX&&GX(OX,t,{configurable:!0,set:i}),jX(t,e)}).prototype,"toString",(function(){return SX(this).tag})),dX(vX,"withoutSetter",(function(e){return jX(lX(e),e)})),cX.f=KX,sX.f=YX,aX.f=HX,oX.f=WX,iX.f=nX.f=JX,rX.f=qX,pX.f=function(e){return jX(hX(e),e)},Qq&&LX(NX,"description",{configurable:!0,get:function(){return SX(this).description}})),Pq({global:!0,wrap:!0,forced:!xq,sham:!xq},{Symbol:vX}),fX(tX(xX),(function(e){_X(e)})),Pq({target:CX,stat:!0,forced:!xq},{for:function(e){var t=Zq(e);if(Gq(VX,t))return VX[t];var i=vX(t);return VX[t]=i,QX[i]=t,i},keyFor:function(e){if(!Wq(e))throw yX(e+" is not a symbol");if(Gq(QX,e))return QX[e]},useSetter:function(){FX=!0},useSimple:function(){FX=!1}}),Pq({target:"Object",stat:!0,forced:!xq,sham:!Qq},{create:function(e,t){return void 0===t?eX(e):HX(eX(e),t)},defineProperty:YX,defineProperties:HX,getOwnPropertyDescriptor:WX}),Pq({target:"Object",stat:!0,forced:!xq},{getOwnPropertyNames:JX,getOwnPropertySymbols:qX}),Pq({target:"Object",stat:!0,forced:Fq((function(){rX.f(1)}))},{getOwnPropertySymbols:function(e){return rX.f(qq(e))}}),wX&&Pq({target:"JSON",stat:!0,forced:!xq||Fq((function(){var e=vX();return"[null]"!=wX([e])||"{}"!=wX({a:e})||"{}"!=wX(Object(e))}))},{stringify:function(e,t,i){var n=AX(arguments),r=t;if((Hq(t)||void 0!==e)&&!Wq(e))return jq(t)||(t=function(e,t){if(Yq(r)&&(t=Bq(r,this,e,t)),!Wq(t))return t}),n[1]=t,Uq(wX,null,n)}}),!NX[TX]){var XX=NX.valueOf;dX(NX,TX,(function(e){return Bq(XX,this)}))}IX(vX,CX),EX[RX]=!0,Lq("asyncIterator"),Lq("hasInstance"),Lq("isConcatSpreadable"),Lq("iterator"),Lq("match"),Lq("matchAll"),Lq("replace"),Lq("search"),Lq("species"),Lq("split"),Lq("toPrimitive"),Lq("toStringTag"),Lq("unscopables"),Rf(Lc.JSON,"JSON",!0);var zX=hA.Symbol;Lq("asyncDispose"),Lq("dispose"),Lq("matcher"),Lq("metadata"),Lq("observable"),Lq("patternMatch"),Lq("replaceAll");var ZX=zX,$X=vq.f("asyncIterator"),ez=$X;function tz(e){this.wrapped=e}function iz(e){var t,i;function n(t,i){try{var o=e[t](i),s=o.value,a=s instanceof tz;tq.resolve(a?s.wrapped:s).then((function(e){a?n("return"===t?"return":"next",e):r(o.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?n(t.key,t.arg):i=null}this._invoke=function(e,r){return new tq((function(o,s){var a={key:e,arg:r,resolve:o,reject:s,next:null};i?i=i.next=a:(t=i=a,n(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function nz(e){return function(){return new iz(e.apply(this,arguments))}}function rz(e){return new tz(e)}iz.prototype["function"==typeof ZX&&ez||"@@asyncIterator"]=function(){return this},iz.prototype.next=function(e){return this._invoke("next",e)},iz.prototype.throw=function(e){return this._invoke("throw",e)},iz.prototype.return=function(e){return this._invoke("return",e)};var oz=vq.f("iterator");function sz(e,t){var i={},n=!1;function r(i,r){return n=!0,r=new tq((function(t){t(e[i](r))})),{done:!1,value:t(r)}}return i[void 0!==ZX&&oz||"@@iterator"]=function(){return this},i.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(i.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(i.return=function(e){return n?(n=!1,e):r("return",e)}),i}var az=$X,cz=Fn,Az=s,dz=n,uz=m,Ez=Ue,lz=Q,hz=K,pz=lE,_z=St.f,Iz=Sn,gz=dz.Symbol,fz=gz&&gz.prototype;if(Az&&lz(gz)&&(!("description"in fz)||void 0!==gz().description)){var Rz={},Cz=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:pz(arguments[0]),t=hz(fz,this)?new gz(e):void 0===e?gz():gz(e);return""===e&&(Rz[t]=!0),t};Iz(Cz,gz),Cz.prototype=fz,fz.constructor=Cz;var Tz="Symbol(test)"==String(gz("test")),mz=uz(fz.toString),Sz=uz(fz.valueOf),Oz=/^Symbol\((.*)\)[^)]+$/,vz=uz("".replace),Nz=uz("".slice);_z(fz,"description",{configurable:!0,get:function(){var e=Sz(this),t=mz(e);if(Ez(Rz,e))return"";var i=Tz?Nz(t,7,-1):vz(t,Oz,"$1");return""===i?void 0:i}}),cz({global:!0,forced:!0},{Symbol:Cz})}var yz={exports:{}};function Dz(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function wz(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Dz(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Dz(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function bz(e,t,i,n,r,o){let s=[],a=[],c=[],A=[],d=!1,u=!1;if(yz.exports.parse(e).mediaDescriptions.forEach((e=>{o&&o!==e.attributes.direction||("video"!==e.media.mediaType||d||(a=e.attributes.payloads,A=e.attributes.extmaps,d=!0),"audio"!==e.media.mediaType||u||(s=e.attributes.payloads,c=e.attributes.extmaps,u=!0))})),!A||0===a.length)throw new Error("Cannot get video capabilities from SDP.");if(!c||0===s.length)throw new Error("Cannot get audio capabilities from SDP.");return a.forEach((e=>{var t;null!==(t=e.rtpMap)&&void 0!==t&&t.clockRate&&(e.rtpMap.clockRate=parseInt(e.rtpMap.clockRate))})),s.forEach((e=>{var t;null!==(t=e.rtpMap)&&void 0!==t&&t.clockRate&&(e.rtpMap.clockRate=parseInt(e.rtpMap.clockRate))})),t&&(s=s.filter((e=>{var t;return"rtx"!==(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())})),a=a.filter((e=>{var t;return"rtx"!==(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())}))),i&&(a=a.filter((e=>{var t;return!/(red)|(ulpfec)|(flexfec)/i.test((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName)||"")}))),n&&(null==n?void 0:n.length)>0&&(s=s.filter((e=>{var t;return n.includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")}))),r&&(null==r?void 0:r.length)>0&&(a=a.filter((e=>{var t;return r.includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")}))),{audioCodecs:s,videoCodecs:a,audioExtensions:c,videoExtensions:A}}function Lz(e){const t=yz.exports.parse(e);let i,n;for(const e of t.mediaDescriptions){if(!i){const t=e.attributes.iceUfrag,n=e.attributes.icePwd;if(!t||!n)throw new Error("Cannot get iceUfrag or icePwd from SDP.");i={iceUfrag:t,icePwd:n}}if(!n){const t=e.attributes.fingerprints;t.length>0&&(n={fingerprints:t})}}if(!n&&t.attributes.fingerprints.length>0&&(n={fingerprints:t.attributes.fingerprints}),!n||!i)throw new Error("Cannot get iceParameters or dtlsParameters from SDP.");return{iceParameters:i,dtlsParameters:n}}function Pz(e,t,i){const{cname:n}=e;let r;void 0!==t&&void 0!==i?(r=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:t,port:i.toString(),type:"host",extension:{}}],mw.debug("Using remote candidate from AP ".concat(t,":").concat(i)),xw("debug",[],"Using remote candidate from AP ".concat(t,":").concat(i))):r=e.iceParameters.candidates.map((e=>({foundation:e.foundation,componentId:"1",transport:e.protocol,priority:e.priority.toString(),connectionAddress:e.ip,port:e.port.toString(),type:e.type,extension:{}})));const o={fingerprints:e.dtlsParameters.fingerprints.map((e=>({hashFunction:e.algorithm,fingerprint:e.fingerprint})))},s={iceUfrag:e.iceParameters.iceUfrag,icePwd:e.iceParameters.icePwd};let a;switch(e.dtlsParameters.role){case"server":a="passive";break;case"client":a="active";break;case"auto":a="actpass"}return{dtlsParameters:o,iceParameters:s,candidates:r,rtpCapabilities:xz(e.rtpCapabilities),setup:a,cname:n}}function kz(e,t,i){const n=[],r=[];return e.forEach((e=>{let{ssrcId:o,rtx:s}=e;const a=vG(8,"track-"),c={ssrcId:o,attributes:wz({label:a,mslabel:i=i||vG(10,""),msid:"".concat(i," ").concat(a)},t&&{cname:t})};if(n.push(c),void 0!==s){const e={ssrcId:s,attributes:wz({label:a,mslabel:i,msid:"".concat(i," ").concat(a)},t&&{cname:t})};n.push(e),r.push({semantic:"FID",ssrcIds:[o,s]})}})),e.length>1&&r.push({semantic:"SIM",ssrcIds:e.map((e=>{let{ssrcId:t}=e;return t}))}),{ssrcs:n,ssrcGroups:r}}function Mz(e,t){t instanceof JF&&e.attributes.payloads.forEach((e=>{var i;const n=null===(i=e.rtpMap)||void 0===i?void 0:i.encodingName.toLowerCase();if(!n||-1===["opus","pcmu","pcma","g722"].indexOf(n))return;e.fmtp||(e.fmtp={parameters:{}}),e.fmtp.parameters.minptime="10",e.fmtp.parameters.useinbandfec="1";const r=t._encoderConfig;r&&("pcmu"!==n&&"pcma"!==n&&"g722"!==n&&(r.bitrate&&!By()&&(e.fmtp.parameters.maxaveragebitrate="".concat(Math.floor(1e3*r.bitrate))),r.sampleRate&&(e.fmtp.parameters.maxplaybackrate="".concat(r.sampleRate),e.fmtp.parameters["sprop-maxcapturerate"]="".concat(r.sampleRate))),r.stereo&&(e.fmtp.parameters.stereo="1",e.fmtp.parameters["sprop-stereo"]="1"))}))}function Uz(e){const t=e.attributes.unrecognized.findIndex((e=>"x-google-flag"===e.attField&&"conference"===e.attValue));-1!==t&&e.attributes.unrecognized.splice(t,1)}function Bz(e,t){if(!(t instanceof WJ&&t._encoderConfig&&-1===t._hints.indexOf(vP.SCREEN_TRACK)))return;const i=t._encoderConfig;XP().supportMinBitrate&&i.bitrateMin&&e.attributes.payloads.forEach((e=>{var t;["h264","vp8","vp9","av1"].includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")&&(e.fmtp||(e.fmtp={parameters:{}}),e.fmtp.parameters["x-google-min-bitrate"]="".concat(i.bitrateMin))})),XP().supportMinBitrate&&!t._hints.includes(vP.LOW_STREAM)&&i.bitrateMax&&e.attributes.payloads.forEach((e=>{var t;["h264","vp8","vp9","av1"].includes((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"")&&(e.fmtp||(e.fmtp={parameters:{}}),e.fmtp.parameters["x-google-start-bitrate"]="".concat(Math.floor(i.bitrateMax)))}))}function Vz(e,t,i){if(!t)return;let n,r;if("video"===e.media.mediaType?(n=i.videoExtensions,r=i.videoCodecs):(n=i.audioExtensions,r=i.audioCodecs),!0===t.tcc){const t=n.find((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName));t&&(e.attributes.extmaps.find((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName))||e.attributes.extmaps.push({entry:t.entry,extensionName:"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"}),function(e,t){return t.filter((t=>!!e.find((e=>e.payloadType===t.payloadType&&!!e.rtcpFeedbacks.find((e=>"transport-cc"===e.type))))))}(r,e.attributes.payloads).forEach((e=>{e.rtcpFeedbacks.find((e=>"transport-cc"===e.type))||e.rtcpFeedbacks.push({type:"transport-cc"})})))}else if(!1===t.tcc){const t=e.attributes.extmaps.findIndex((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName));-1!==t&&e.attributes.extmaps.splice(t,1),e.attributes.payloads.forEach((e=>{const t=e.rtcpFeedbacks.findIndex((e=>"transport-cc"===e.type));-1!==t&&e.rtcpFeedbacks.splice(t,1)}))}if(!0===t.remb){const t=n.find((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.extensionName));t&&(e.attributes.extmaps.find((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.extensionName))||e.attributes.extmaps.push({entry:t.entry,extensionName:"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"}),function(e,t){return t.filter((t=>!!e.find((e=>e.payloadType===t.payloadType&&!!e.rtcpFeedbacks.find((e=>"goog-remb"===e.type))))))}(r,e.attributes.payloads).forEach((e=>{e.rtcpFeedbacks.find((e=>"goog-remb"===e.type))||e.rtcpFeedbacks.push({type:"goog-remb"})})))}else if(!1===t.remb){const t=e.attributes.extmaps.findIndex((e=>"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.extensionName));-1!==t&&e.attributes.extmaps.splice(t,1),e.attributes.payloads.forEach((e=>{const t=e.rtcpFeedbacks.findIndex((e=>"goog-remb"===e.type));-1!==t&&e.rtcpFeedbacks.splice(t,1)}))}}function Qz(e,t,i,n,r,o){if("videoExtensions"===i||"audioExtensions"===i){const s=[];return e[i].forEach((e=>{t[i].some(((t,i)=>{if(e.entry===t.entry&&e.extensionName===t.extensionName)return s.push(i),!0}))?o[i].push(e):n[i].push(e)})),void t[i].forEach(((e,t)=>{-1===s.indexOf(t)&&r[i].push(e)}))}if("videoCodecs"===i||"audioCodecs"===i){const s=[];return e[i].forEach((e=>{t[i].some(((t,i)=>{if(e.payloadType===t.payloadType&&JSON.stringify(e)===JSON.stringify(t))return s.push(i),!0}))?o[i].push(e):n[i].push(e)})),void t[i].forEach(((e,t)=>{-1===s.indexOf(t)&&r[i].push(e)}))}}function xz(e){const{send:t,recv:i,sendrecv:n}=e;if(!n){if(!t||!i)throw new Error("cannot merge rtp capabilities because one of send or recv is empty!");return{send:t,recv:i}}let r,o;return t?(r={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},r.audioCodecs=[...t.audioCodecs,...n.audioCodecs],r.videoCodecs=[...t.videoCodecs,...n.videoCodecs],r.audioExtensions=[...t.audioExtensions,...n.audioExtensions],r.videoExtensions=[...t.videoExtensions,...n.videoExtensions]):r=n,i?(o={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},o.audioCodecs=[...i.audioCodecs,...n.audioCodecs],o.videoCodecs=[...i.videoCodecs,...n.videoCodecs],o.audioExtensions=[...i.audioExtensions,...n.audioExtensions],o.videoExtensions=[...i.videoExtensions,...n.videoExtensions]):o=n,{send:r,recv:o}}!function(e,t){e.exports=(()=>{var e={8:(e,t,i)=>{i.r(t),i.d(t,{Parser:()=>T,Printer:()=>N,parse:()=>b,print:()=>L});const n="\n",r="".concat("\r").concat(n),o=" ";let s;function a(e){return e>="0"&&e<="9"}function c(e){return e>="!"&&e<="~"}function A(e){return c(e)||e>="€"&&e<="ÿ"}function d(e){return"!"===e||e>="#"&&e<="'"||e>="*"&&e<="+"||e>="-"&&e<="."||e>="0"&&e<="9"||e>="A"&&e<="Z"||e>="^"&&e<="~"}function u(e){return e>="1"&&e<="9"}function E(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"}function l(e){return"d"===e||"h"===e||"m"===e||"s"===e}function h(e){return e>""&&e<"\t"||e>"\v"&&e<"\f"||e>""&&e<"ÿ"}function p(e){return E(e)||a(e)||"+"===e||"/"===e}function _(e){return a(e)||E(e)||"+"===e||"/"===e||"-"===e||"_"===e}function I(e){return E(e)||a(e)||"+"===e||"/"===e}function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){R(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function R(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}!function(e){e.VERSION="v",e.ORIGIN="o",e.SESSION_NAME="s",e.INFORMATION="i",e.URI="u",e.EMAIL="e",e.PHONE="p",e.CONNECTION="c",e.BANDWIDTH="b",e.TIME="t",e.REPEAT="r",e.ZONE_ADJUSTMENTS="z",e.KEY="k",e.ATTRIBUTE="a",e.MEDIA="m"}(s||(s={}));class C{consumeText(e,t){let i=t;for(;i<e.length;){const t=e[i];if("\0"===t||"\r"===t||t===n)break;i+=1}if(i-t==0)throw new Error("Invalid text, at ".concat(e));return i}consumeUnicastAddress(e,t,i){return this.consumeTill(e,t,o)}consumeOneOrMore(e,t,i){let n=t;for(;i(e[n]);)n++;if(n-t==0)throw new Error("Invalid rule at ".concat(t,"."));return n}consumeSpace(e,t){if(e[t]===o)return t+1;throw new Error("Invalid space at ".concat(t,"."))}consumeIP4Address(e,t){let i=t;for(let t=0;t<4;t++)if(i=this.consumeDecimalUChar(e,i),3!==t){if("."!==e[i])throw new Error("Invalid IP4 address.");i++}return i}consumeDecimalUChar(e,t){let i=t;for(let t=0;t<3&&a(e[i]);t++,i++);if(i-t==0)throw new Error("Invalid decimal uchar.");const n=parseInt(e.slice(t,i));if(n>=0&&n<=255)return i;throw new Error("Invalid decimal uchar")}consumeIP6Address(e,t){let i=this.consumeHexpart(e,t);return":"===e[i]?(i+=1,i=this.consumeIP4Address(e,i),i):i}consumeHexpart(e,t){let i=t;if(":"===e[i]&&":"===e[i+1]){i+=2;try{i=this.consumeHexseq(e,i)}catch(e){}return i}if(i=this.consumeHexseq(e,i),":"===e[i]&&":"===e[i+1]){i+=2;try{i=this.consumeHexseq(e,i)}catch(e){}return i}return i}consumeHexseq(e,t){let i=t;for(;i=this.consumeHex4(e,i),":"===e[i]&&":"!==e[i+1];)i+=1;return i}consumeHex4(e,t){let i=0;for(;i<4;i++)if(!((n=e[t+i])>="0"&&n<="9"||n>="a"&&n<="f"||n>="A"&&n<="F")){if(0===i)throw new Error("Invalid hex 4");break}var n;return t+i}consumeFQDN(e,t){let i=t;for(;a(e[i])||E(e[i])||"-"===e[i]||"."===e[i];)i+=1;if(i-t<4)throw new Error("Invalid FQDN");return i}consumeExtnAddr(e,t){return this.consumeOneOrMore(e,t,A)}consumeMulticastAddress(e,t,i){switch(i){case"IP4":case"ip4":return this.consumeIP4MulticastAddress(e,t);case"IP6":case"ip6":return this.consumeIP6MulticastAddress(e,t);default:try{return this.consumeFQDN(e,t)}catch(i){return this.consumeExtnAddr(e,t)}}}consumeIP6MulticastAddress(e,t){const i=this.consumeHexpart(e,t);return"/"===e[i]?this.consumeInteger(e,i+1):i}consumeIP4MulticastAddress(e,t){let i=t+3;const n=e.slice(t,i),r=parseInt(n);if(r<224||r>239)throw new Error("Invalid IP4 multicast address, IPv4 multicast addresses may be in the range 224.0.0.0 to 239.255.255.255.");for(let t=0;t<3;t++){if("."!==e[i])throw new Error("Invalid IP4 multicast address.");i+=1,i=this.consumeDecimalUChar(e,i)}return"/"===e[i]&&(i+=1),i=this.consumeTTL(e,i),"/"===e[i]&&(i=this.consumeInteger(e,i)),i}consumeInteger(e,t){if(!u(e[t]))throw new Error("Invalid integer.");for(t+=1;a(e[t]);)t+=1;return t}consumeTTL(e,t){if("0"===e[t])return t+1;if(!u(e[t]))throw new Error("Invalid TTL.");t+=1;for(let i=0;i<2&&a(e[t]);i++)t+=1;return t}consumeToken(e,t){return this.consumeOneOrMore(e,t,d)}consumeTime(e,t){let i=t;if("0"===e[i])return i+1;for(u(e[i])&&(i+=1);a(e[i]);)i++;if(i-t<10)throw new Error("Invalid time");return i}consumeAddress(e,t){return this.consumeTill(e,t,o)}consumeTypedTime(e,t){let i=t;return i=this.consumeOneOrMore(e,i,a),l(e[i])?i+1:i}consumeRepeatInterval(e,t){if(!u(e[t]))throw new Error("Invalid repeat interval");for(t+=1;a(e[t]);)t+=1;return l(e[t])&&(t+=1),t}consumePort(e,t){return this.consumeOneOrMore(e,t,a)}consume(e,t,i){for(let n=0;n<i.length;n++){if(t+n>=e.length)throw new Error("consume exceeding value length");if(e[t+n]!==i[n])throw new Error("consume ".concat(i," failed at ").concat(n))}return t+i.length}consumeTill(e,t,i){let n=t;for(;n<e.length&&("string"!=typeof i||e[n]!==i)&&("function"!=typeof i||!i(e[n]));)n++;return n}}class T extends C{constructor(){super(),R(this,"records",[]),R(this,"currentLine",0)}parse(e){const t=this.probeEOL(e);this.records=e.split(t).filter((e=>!!e.trim())).map(this.parseLine),this.currentLine=0;const i=this.parseVersion(),n=this.parseOrigin(),r=this.parseSessionName(),o=this.parseInformation(),s=this.parseUri(),a=this.parseEmail(),c=this.parsePhone(),A=this.parseConnection(),d=this.parseBandWidth(),u=this.parseTimeFields(),E=this.parseKey(),l=this.parseSessionAttribute(),h=this.parseMediaDescription();if(this.currentLine!==this.records.length)throw new Error("parsing failed, non exhaustive sdp lines.");return{version:i,origin:n,sessionName:r,information:o,uri:s,emails:a,phones:c,connection:A,bandwidths:d,timeFields:u,key:E,attributes:l,mediaDescriptions:h}}getCurrentRecord(){const e=this.records[this.currentLine];if(!e)throw new Error("Record doesn't exit.");return e}probeEOL(e){for(let t=0;t<e.length;t++)if(e[t]===n)return"\r"===e[t-1]?r:n;throw new Error("Invalid newline character.")}parseLine(e,t){if(e.length<2)throw new Error("Invalid sdp line, sdp line should be of form <type>=<value>.");const i=e[0];if("="!==e[1])throw new Error('Invalid sdp line, <type> should be a single character followed by an "=" sign.');return{type:i,value:e.slice(2),line:t,cur:0}}parseSessionAttribute(){const e=new S;for(;this.currentLine<this.records.length;){const t=this.getCurrentRecord();if(t.type!==s.ATTRIBUTE)break;const i={attField:this.extractOneOrMore(t,(e=>d(e)&&":"!==e)),_cur:0};":"===t.value[t.cur]&&(t.cur+=1,i.attValue=this.extractOneOrMore(t,h)),e.parse(i),this.currentLine++}return e.digest()}parseMediaAttributes(e){const t=new O(e);for(;this.currentLine<this.records.length;){const e=this.getCurrentRecord();if(e.type!==s.ATTRIBUTE)break;const i={attField:this.extractOneOrMore(e,(e=>d(e)&&":"!==e)),_cur:0};":"===e.value[e.cur]&&(e.cur+=1,i.attValue=this.extractOneOrMore(e,h)),t.parse(i),this.currentLine++}return t.digest()}parseKey(){const e=this.getCurrentRecord();if(e.type===s.KEY){if("prompt"===e.value||"clear:"===e.value||"base64:"===e.value||"uri:"===e.value)return e.value;throw this.currentLine++,new Error("Invalid key.")}}parseZone(){const e=this.getCurrentRecord();if(e.type===s.ZONE_ADJUSTMENTS){const t=[];for(;;)try{const i=this.extract(e,this.consumeTime);this.consumeSpaceForRecord(e);let n=!1;"-"===e.value[e.cur]&&(n=!0,e.cur+=1);const r=this.extract(e,this.consumeTypedTime);t.push({time:i,typedTime:r,back:n})}catch(e){break}if(0===t.length)throw new Error("Invalid zone adjustments");return this.currentLine++,t}return[]}parseRepeat(){const e=[];for(;;){const t=this.getCurrentRecord();if(t.type!==s.REPEAT)break;{const i=this.extract(t,this.consumeRepeatInterval),n=this.parseTypedTime(t);e.push({repeatInterval:i,typedTimes:n}),this.currentLine++}}return e}parseTypedTime(e){const t=[];for(;;)try{this.consumeSpaceForRecord(e),t.push(this.extract(e,this.consumeTypedTime))}catch(e){break}if(0===t.length)throw new Error("Invalid typed time.");return t}parseTime(){const e=this.getCurrentRecord(),t=this.extract(e,this.consumeTime);this.consumeSpaceForRecord(e);const i=this.extract(e,this.consumeTime);return this.currentLine++,{startTime:t,stopTime:i}}parseBandWidth(){const e=[];for(;this.currentLine<this.records.length;){const t=this.getCurrentRecord();if(t.type!==s.BANDWIDTH)break;{const i=this.extractOneOrMore(t,d);if(":"!==t.value[t.cur])throw new Error("Invalid bandwidth field.");t.cur++;const n=this.extractOneOrMore(t,a);e.push({bwtype:i,bandwidth:n}),this.currentLine++}}return e}parseVersion(){const e=this.getCurrentRecord();if(e.type!==s.VERSION)throw new Error("first sdp record must be version");const t=e.value.slice(0,this.consumeOneOrMore(e.value,0,a));if(t.length!==e.value.length)throw new Error('invalid proto version, "v='.concat(e.value,'"'));return this.currentLine++,t}parseOrigin(){const e=this.getCurrentRecord();if(e.type!==s.ORIGIN)throw new Error("second line of sdp must be origin");const t=this.extractOneOrMore(e,A);this.consumeSpaceForRecord(e);const i=this.extractOneOrMore(e,a);this.consumeSpaceForRecord(e);const n=this.extractOneOrMore(e,a);this.consumeSpaceForRecord(e);const r=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const o=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const c=this.extract(e,this.consumeUnicastAddress);return this.currentLine++,{username:t,sessId:i,sessVersion:n,nettype:r,addrtype:o,unicastAddress:c}}parseSessionName(){const e=this.getCurrentRecord();if(e.type===s.SESSION_NAME){const t=this.extract(e,this.consumeText);return this.currentLine++,t}}parseInformation(){const e=this.getCurrentRecord();if(e.type!==s.INFORMATION)return;const t=this.extract(e,this.consumeText);return this.currentLine++,t}parseUri(){const e=this.getCurrentRecord();if(e.type===s.URI)return this.currentLine++,e.value}parseEmail(){const e=[];for(;;){const t=this.getCurrentRecord();if(t.type!==s.EMAIL)break;e.push(t.value),this.currentLine++}return e}parsePhone(){const e=[];for(;;){const t=this.getCurrentRecord();if(t.type!==s.PHONE)break;e.push(t.value),this.currentLine++}return e}parseConnection(){const e=this.getCurrentRecord();if(e.type===s.CONNECTION){const t=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const i=this.extractOneOrMore(e,d);this.consumeSpaceForRecord(e);const n=this.extract(e,this.consumeAddress);return this.currentLine++,{nettype:t,addrtype:i,address:n}}}parseMedia(){const e=this.getCurrentRecord(),t=this.extract(e,this.consumeToken);this.consumeSpaceForRecord(e);let i=this.extract(e,this.consumePort);"/"===e.value[e.cur]&&(e.cur+=1,i+=this.extract(e,this.consumeInteger)),this.consumeSpaceForRecord(e);const n=[];for(n.push(this.extract(e,this.consumeToken));"/"===e.value[e.cur];)e.cur+=1,n.push(this.extract(e,this.consumeToken));if(0===n.length)throw new Error("Invalid proto");const r=this.parseFmt(e);return this.currentLine++,{mediaType:t,port:i,protos:n,fmts:r}}parseTimeFields(){const e=[];for(;this.getCurrentRecord().type===s.TIME;){const t=this.parseTime(),i=this.parseRepeat(),n=this.parseZone();e.push({time:t,repeats:i,zones:n})}return e}parseMediaDescription(){const e=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===s.MEDIA;){const t=this.parseMedia(),i=this.parseInformation(),n=this.parseConnections(),r=this.parseBandWidth(),o=this.parseKey(),s=this.parseMediaAttributes(t);e.push({media:t,information:i,connections:n,bandwidths:r,key:o,attributes:s})}return e}parseConnections(){const e=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===s.CONNECTION;)e.push(this.parseConnection());return e}parseFmt(e){const t=[];for(;;)try{this.consumeSpaceForRecord(e),t.push(this.extract(e,this.consumeToken))}catch(e){break}if(0===t.length)throw new Error("Invalid fmts");return t}extract(e,t,...i){const n=t.call(this,e.value,e.cur,...i),r=e.value.slice(e.cur,n);return e.cur=n,r}extractOneOrMore(e,t){const i=this.consumeOneOrMore(e.value,e.cur,t),n=e.value.slice(e.cur,i);return e.cur=i,n}consumeSpaceForRecord(e){if(e.value[e.cur]!==o)throw new Error("Invalid space at ".concat(e.cur,"."));e.cur+=1}}class m extends C{constructor(...e){super(...e),R(this,"attributes",void 0),R(this,"digested",!1)}extractOneOrMore(e,t,i){const n=this.consumeOneOrMore(e.attValue,e._cur,t),r=e.attValue.slice(e._cur,n),[o,s]=i||[];if("number"==typeof o&&r.length<o)throw new Error("error in length, should be more or equal than ".concat(o," characters."));if("number"==typeof s&&r.length>s)throw new Error("error in length, should be less or equal than ".concat(s," characters."));return e._cur=n,r}consumeAttributeSpace(e){if(e.attValue[e._cur]!==o)throw new Error("Invalid space at ".concat(e._cur,"."));e._cur+=1}extract(e,t,...i){if(!e.attValue)throw new Error("Nothing to extract from attValue.");const n=t.call(this,e.attValue,e._cur,...i),r=e.attValue.slice(e._cur,n);return e._cur=n,r}atEnd(e){if(!e.attValue)throw new Error;return e._cur>=e.attValue.length}peekChar(e){if(!e.attValue)throw new Error;return e.attValue[e._cur]}peek(e,t){if(!e.attValue)throw new Error;for(let i=0;i<t.length;i++)if(t[i]!==e.attValue[e._cur+i])return!1;return!0}parseIceUfrag(e){if(this.attributes.iceUfrag)throw new Error("Invalid ice-ufrag, should be only a single line if 'a=ice-ufrag'");this.attributes.iceUfrag=this.extractOneOrMore(e,p,[4,256])}parseIcePwd(e){if(this.attributes.icePwd)throw new Error("Invalid ice-pwd, should be only a single line if 'a=ice-pwd'");this.attributes.icePwd=this.extractOneOrMore(e,p,[22,256])}parseIceOptions(e){if(this.attributes.iceOptions)throw new Error("Invalid ice-options, should be only one 'ice-options' line");const t=[];for(;!this.atEnd(e);){t.push(this.extractOneOrMore(e,p));try{this.consumeAttributeSpace(e)}catch(t){if(this.atEnd(e))break;throw t}}this.attributes.iceOptions=t}parseFingerprint(e){const t=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill);this.attributes.fingerprints.push({hashFunction:t,fingerprint:i})}parseExtmap(e){const t=this.extractOneOrMore(e,a);let i;"/"===this.peekChar(e)&&(this.extract(e,this.consume,"/"),i=this.extract(e,this.consumeToken)),this.consumeAttributeSpace(e);const n=this.extract(e,this.consumeTill,o),r=f(f({entry:parseInt(t,10)},i&&{direction:i}),{},{extensionName:n});this.peekChar(e)===o&&(this.consumeAttributeSpace(e),r.extensionAttributes=this.extract(e,this.consumeTill)),this.attributes.extmaps.push(r)}parseSetup(e){if(this.attributes.setup)throw new Error("must only be one single 'a=setup' line.");const t=this.extract(e,this.consumeTill);if("active"!==t&&"passive"!==t&&"actpass"!==t&&"holdconn"!==t)throw new Error("role must be one of 'active', 'passive', 'actpass', 'holdconn'.");this.attributes.setup=t}}class S extends m{constructor(...e){super(...e),R(this,"attributes",{unrecognized:[],groups:[],extmaps:[],fingerprints:[],identities:[]})}parse(e){if(this.digested)throw new Error("already digested");try{switch(e.attField){case"group":this.parseGroup(e);break;case"ice-lite":this.parseIceLite();break;case"ice-ufrag":this.parseIceUfrag(e);break;case"ice-pwd":this.parseIcePwd(e);break;case"ice-options":this.parseIceOptions(e);break;case"fingerprint":this.parseFingerprint(e);break;case"setup":this.parseSetup(e);break;case"tls-id":this.parseTlsId(e);break;case"identity":this.parseIdentity(e);break;case"extmap":this.parseExtmap(e);break;case"msid-semantic":this.parseMsidSemantic(e);break;default:e.ignored=!0,this.attributes.unrecognized.push(e)}}catch(t){throw console.error("parsing session attribute ".concat(e.attField,' error, "a=').concat(e.attField,":").concat(e.attValue,'"')),t}if(!e.ignored&&e.attValue&&!this.atEnd(e))throw new Error("attribute parsing error")}digest(){return this.digested=!0,this.attributes}parseGroup(e){const t=this.extract(e,this.consumeToken),i=[];for(;!this.atEnd(e)&&this.peekChar(e)===o;)this.consumeAttributeSpace(e),i.push(this.extract(e,this.consumeToken));this.attributes.groups.push({semantic:t,identificationTag:i})}parseIceLite(){if(this.attributes.iceLite)throw new Error("Invalid ice-lite, should be only a single line of 'a=ice-lite'");this.attributes.iceLite=!0}parseTlsId(e){if(this.attributes.tlsId)throw new Error("must be only one tld-id line");this.attributes.tlsId=this.extractOneOrMore(e,_)}parseIdentity(e){const t=this.extractOneOrMore(e,I),i=[];for(;!this.atEnd(e)&&this.peekChar(e)===o;){this.consumeAttributeSpace(e);const t=this.extract(e,this.consumeToken);this.extract(e,this.consume,"=");const n=this.extractOneOrMore(e,(e=>e!==o&&h(e)));i.push({name:t,value:n})}this.attributes.identities.push({assertionValue:t,extensions:i})}parseMsidSemantic(e){this.peekChar(e)===o&&this.consumeAttributeSpace(e);const t={semantic:this.extract(e,this.consumeToken),identifierList:[]};for(;;){try{this.consumeAttributeSpace(e)}catch(e){break}if("*"===this.peekChar(e)){this.extract(e,this.consume,"*"),t.applyForAll=!0;break}{const i=this.extract(e,this.consumeTill,o);t.identifierList.push(i)}}this.attributes.msidSemantic=t}}class O extends m{constructor(e){super(),R(this,"attributes",void 0),-1!==e.protos.indexOf("RTP")||e.protos.indexOf("rtp"),this.attributes={unrecognized:[],candidates:[],extmaps:[],fingerprints:[],imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[]}}parse(e){if(this.digested)throw new Error("already digested");try{switch(e.attField){case"extmap":this.parseExtmap(e);break;case"setup":this.parseSetup(e);break;case"ice-ufrag":this.parseIceUfrag(e);break;case"ice-pwd":this.parseIcePwd(e);break;case"ice-options":this.parseIceOptions(e);break;case"candidate":this.parseCandidate(e);break;case"remote-candidate":this.parseRemoteCandidate(e);break;case"end-of-candidates":this.parseEndOfCandidates();break;case"fingerprint":this.parseFingerprint(e);break;case"rtpmap":this.parseRtpmap(e);break;case"ptime":this.parsePtime(e);break;case"maxptime":this.parseMaxPtime(e);break;case"sendrecv":case"recvonly":case"sendonly":case"inactive":this.parseDirection(e);break;case"ssrc":this.parseSSRC(e);break;case"fmtp":this.parseFmtp(e);break;case"rtcp-fb":this.parseRtcpFb(e);break;case"rtcp-mux":this.parseRTCPMux();break;case"rtcp-mux-only":this.parseRTCPMuxOnly();break;case"rtcp-rsize":this.parseRTCPRsize();break;case"rtcp":this.parseRTCP(e);break;case"mid":this.parseMid(e);break;case"msid":this.parseMsid(e);break;case"imageattr":this.parseImageAttr(e);break;case"rid":this.parseRid(e);break;case"simulcast":this.parseSimulcast(e);break;case"sctp-port":this.parseSctpPort(e);break;case"max-message-size":this.parseMaxMessageSize(e);break;case"ssrc-group":this.parseSSRCGroup(e);break;default:e.ignored=!0,this.attributes.unrecognized.push(e)}}catch(t){throw console.error("parsing media attribute ".concat(e.attField,' error, "a=').concat(e.attField,":").concat(e.attValue,'"')),t}if(!e.ignored&&e.attValue&&!this.atEnd(e))throw new Error("attribute parsing error")}parseCandidate(e){const t=this.extractOneOrMore(e,p,[1,32]);this.consumeAttributeSpace(e);const i=this.extractOneOrMore(e,a,[1,5]);this.consumeAttributeSpace(e);const n=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e);const r=this.extractOneOrMore(e,a,[1,10]);this.consumeAttributeSpace(e);const s=this.extract(e,this.consumeAddress);this.consumeAttributeSpace(e);const A=this.extract(e,this.consumePort);this.consumeAttributeSpace(e),this.extract(e,this.consume,"typ"),this.consumeAttributeSpace(e);const d={foundation:t,componentId:i,transport:n,priority:r,connectionAddress:s,port:A,type:this.extract(e,this.consumeToken),extension:{}};for(this.peek(e," raddr")&&(this.extract(e,this.consume," raddr"),this.consumeAttributeSpace(e),d.relAddr=this.extract(e,this.consumeAddress)),this.peek(e," rport")&&(this.extract(e,this.consume," rport"),this.consumeAttributeSpace(e),d.relPort=this.extract(e,this.consumePort));this.peekChar(e)===o;){this.consumeAttributeSpace(e);const t=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e),d.extension[t]=this.extractOneOrMore(e,c)}this.attributes.candidates.push(d)}parseRemoteCandidate(e){const t=[];for(;;){const i=this.extractOneOrMore(e,a,[1,5]);this.consumeAttributeSpace(e);const n=this.extract(e,this.consumeAddress);this.consumeAttributeSpace(e);const r=this.extract(e,this.consumePort);t.push({componentId:i,connectionAddress:n,port:r});try{this.consumeAttributeSpace(e)}catch(e){break}}this.attributes.remoteCandidatesList.push(t)}parseEndOfCandidates(){if(this.attributes.endOfCandidates)throw new Error("must be only one line of end-of-candidates");this.attributes.endOfCandidates=!0}parseRtpmap(e){const t=this.extract(e,this.consumeToken);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill,"/");this.extract(e,this.consume,"/");const n={encodingName:i,clockRate:this.extractOneOrMore(e,a)};this.atEnd(e)||"/"!==this.peekChar(e)||(this.extract(e,this.consume,"/"),n.encodingParameters=parseInt(this.extract(e,this.consumeTill),10));const r=this.attributes.payloads.find((e=>e.payloadType===parseInt(t,10)));r?r.rtpMap=n:this.attributes.payloads.push({payloadType:parseInt(t,10),rtpMap:n,rtcpFeedbacks:[]})}parsePtime(e){if(this.attributes.ptime)throw new Error("must be only one line of ptime");this.attributes.ptime=this.extract(e,this.consumeTill)}parseMaxPtime(e){if(this.attributes.maxPtime)throw new Error("must be only one line of ptime");this.attributes.maxPtime=this.extract(e,this.consumeTill)}parseDirection(e){if(this.attributes.direction)throw new Error("must be only one line of direction info");this.attributes.direction=e.attField}parseSSRC(e){const t=this.extractOneOrMore(e,a);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill,":");let n;":"===this.peekChar(e)&&(this.extract(e,this.consume,":"),n=this.extract(e,this.consumeTill));const r=this.attributes.ssrcs.find((e=>e.ssrcId===parseInt(t,10)));r?r.attributes[i]=n:this.attributes.ssrcs.push({ssrcId:parseInt(t,10),attributes:{[i]:n}})}parseFmtp(e){const t=this.extract(e,this.consumeTill,o);this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill),n={};i.split(";").forEach((e=>{let[t,i]=e.split("=");t=t.trim(),i="string"==typeof i?i.trim():i,"string"==typeof t&&t.length>0&&(n[t]=i)}));const r=this.attributes.payloads.find((e=>e.payloadType===parseInt(t,10)));r?r.fmtp={parameters:n}:this.attributes.payloads.push({payloadType:parseInt(t,10),rtcpFeedbacks:[],fmtp:{parameters:n}})}parseFmtParameters(e){const t={},i=this.extract(e,this.consumeTill,"=");e._cur++;const n=this.extract(e,this.consumeTill,";");for(t[i]=n;";"===e.attValue[e._cur];){const i=this.extract(e,this.consumeTill,"=");e._cur++;const n=this.extract(e,this.consumeTill,";");t[i]=n}return t}parseRtcpFb(e){let t="";t="*"===this.peekChar(e)?this.extract(e,this.consume,"*"):this.extract(e,this.consumeTill,o),this.consumeAttributeSpace(e);const i=this.extract(e,this.consumeTill,o);let n;if("trr-int"===i)n={type:i,interval:this.extract(e,this.consumeTill)};else{const t={type:i};this.peekChar(e)===o&&(this.consumeAttributeSpace(e),t.parameter=this.extract(e,this.consumeToken),this.peekChar(e)===o&&(t.additional=this.extract(e,this.consumeTill))),n=t}if("*"===t)this.attributes.rtcpFeedbackWildcards.push(n);else{const e=this.attributes.payloads.find((e=>e.payloadType===parseInt(t,10)));e?e.rtcpFeedbacks.push(n):this.attributes.payloads.push({payloadType:parseInt(t,10),rtcpFeedbacks:[n]})}}parseRTCPMux(){if(this.attributes.rtcpMux)throw new Error("must be single line of rtcp-mux");this.attributes.rtcpMux=!0}parseRTCPMuxOnly(){if(this.attributes.rtcpMuxOnly)throw new Error("must be single line of rtcp-only");this.attributes.rtcpMuxOnly=!0}parseRTCPRsize(){if(this.attributes.rtcpRsize)throw new Error("must be single line of rtcp-rsize");this.attributes.rtcpRsize=!0}parseRTCP(e){if(this.attributes.rtcp)throw new Error("must be single line of rtcp");const t={port:this.extract(e,this.consumePort)};this.peekChar(e)===o&&(this.consumeAttributeSpace(e),t.netType=this.extractOneOrMore(e,d),this.consumeAttributeSpace(e),t.addressType=this.extractOneOrMore(e,d),this.consumeAttributeSpace(e),t.address=this.extract(e,this.consumeAddress)),this.attributes.rtcp=t}parseMsid(e){const t={id:this.extractOneOrMore(e,d,[1,64])};this.peekChar(e)===o&&(this.consumeAttributeSpace(e),t.appdata=this.extractOneOrMore(e,d,[1,64])),this.attributes.msids.push(t)}parseImageAttr(e){this.attributes.imageattr.push(e.attValue)}parseRid(e){const t=this.extractOneOrMore(e,(e=>E(e)||a(e)||"_"===e||"-"===e));this.consumeAttributeSpace(e);const i={id:t,direction:this.extract(e,this.consumeToken),params:[]};if(this.peekChar(e)===o){if(this.consumeAttributeSpace(e),this.peek(e,"pt=")){this.extract(e,this.consume,"pt=");const t=[];for(;;){const i=this.extract(e,this.consumeToken);t.push(i);try{this.extract(e,this.consume,",")}catch(e){break}}i.payloads=t,this.peekChar(e)===o&&this.extract(e,this.consume,o)}for(;;){const t=this.extract(e,this.consumeToken);switch(t){case"depend":{const n={type:t,rids:this.extract(e,this.consume,"=").split(",")};i.params.push(n);break}default:{const n={type:t};"="===this.peekChar(e)&&(this.extract(e,this.consume,"="),n.val=this.extract(e,this.consumeTill,";")),i.params.push(n)}}try{this.extract(e,this.consume,";")}catch(e){break}}}this.attributes.rids.push(i)}parseSimulcast(e){if(this.attributes.simulcast)throw new Error("must be single line of simulcast");this.attributes.simulcast=e.attValue,this.extract(e,this.consumeTill)}parseSctpPort(e){this.attributes.sctpPort=this.extractOneOrMore(e,a,[1,5])}parseMaxMessageSize(e){this.attributes.maxMessageSize=this.extractOneOrMore(e,a,[1,void 0])}digest(){return this.digested=!0,this.attributes}parseMid(e){this.attributes.mid=this.extract(e,this.consumeToken)}parseSSRCGroup(e){const t=this.extract(e,this.consumeToken),i=[];for(;;)try{this.consumeAttributeSpace(e);const t=this.extract(e,this.consumeInteger);i.push(parseInt(t,10))}catch(e){break}this.attributes.ssrcGroups.push({semantic:t,ssrcIds:i})}}function v(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class N{constructor(){v(this,"eol",r)}print(e,t){let i="";return t&&(this.eol=t),i+=this.printVersion(e.version),i+=this.printOrigin(e.origin),i+=this.printSessionName(e.sessionName),i+=this.printInformation(e.information),i+=this.printUri(e.uri),i+=this.printEmail(e.emails),i+=this.printPhone(e.phones),i+=this.printConnection(e.connection),i+=this.printBandwidth(e.bandwidths),i+=this.printTimeFields(e.timeFields),i+=this.printKey(e.key),i+=this.printSessionAttributes(e.attributes),i+=this.printMediaDescription(e.mediaDescriptions),i}printVersion(e){return"v=".concat(e).concat(this.eol)}printOrigin(e){return"o=".concat(e.username," ").concat(e.sessId," ").concat(e.sessVersion," ").concat(e.nettype," ").concat(e.addrtype," ").concat(e.unicastAddress).concat(this.eol)}printSessionName(e){return e?"s=".concat(e).concat(this.eol):""}printInformation(e){return e?"i=".concat(e).concat(this.eol):""}printUri(e){return e?"u=".concat(e).concat(this.eol):""}printEmail(e){let t="";for(const i of e)t+="e=".concat(i).concat(this.eol);return t}printPhone(e){let t="";for(const i of e)t+="e=".concat(i).concat(this.eol);return t}printConnection(e){return e?"c=".concat(e.nettype," ").concat(e.addrtype," ").concat(e.address).concat(this.eol):""}printBandwidth(e){let t="";for(const i of e)t+="b=".concat(i.bwtype,":").concat(i.bandwidth).concat(this.eol);return t}printTimeFields(e){let t="";for(const i of e){t+="t=".concat(i.time.startTime," ").concat(i.time.startTime).concat(this.eol);for(const e of i.repeats)t+="r=".concat(e.repeatInterval," ").concat(e.typedTimes.join(" ")).concat(this.eol);i.zoneAdjustments&&(t+="z=",t+="z=".concat(i.zoneAdjustments.map((e=>"".concat(e.time," ").concat(e.back?"-":""," ").concat(e.typedTime))).join(" ")).concat(this.eol),t+=this.eol)}return t}printKey(e){return e?"k=".concat(e).concat(this.eol):""}printAttributes(e){let t="";for(const i of e)t+="a=".concat(i.attField).concat(i.attValue?":".concat(i.attValue):"").concat(this.eol);return t}printMediaDescription(e){let t="";for(const i of e)t+=this.printMedia(i.media),t+=this.printInformation(i.information),t+=this.printConnections(i.connections),t+=this.printBandwidth(i.bandwidths),t+=this.printKey(i.key),t+=this.printMediaAttributes(i);return t}printConnections(e){let t="";for(const i of e)t+=this.printConnection(i);return t}printMedia(e){return"m=".concat(e.mediaType," ").concat(e.port," ").concat(e.protos.join("/")," ").concat(e.fmts.join(" ")).concat(this.eol)}printSessionAttributes(e){return new D(this.eol).print(e)}printMediaAttributes(e){return new w(this.eol).print(e)}}class y{constructor(e){v(this,"eol",void 0),this.eol=e}printIceUfrag(e){return void 0===e?"":"a=ice-ufrag:".concat(e).concat(this.eol)}printIcePwd(e){return void 0===e?"":"a=ice-pwd:".concat(e).concat(this.eol)}printIceOptions(e){return void 0===e?"":"a=ice-options:".concat(e.join(o)).concat(this.eol)}printFingerprints(e){return e.length>0?e.map((e=>"a=fingerprint:".concat(e.hashFunction).concat(o).concat(e.fingerprint))).join(this.eol)+this.eol:""}printExtmap(e){return e.map((e=>"a=extmap:".concat(e.entry).concat(e.direction?"/".concat(e.direction):"").concat(o).concat(e.extensionName).concat(e.extensionAttributes?"".concat(o).concat(e.extensionAttributes):"").concat(this.eol))).join("")}printSetup(e){return void 0===e?"":"a=setup:".concat(e).concat(this.eol)}printUnrecognized(e){return e.map((e=>"a=".concat(e.attField).concat(e.attValue?":".concat(e.attValue):"").concat(this.eol))).join("")}}class D extends y{print(e){let t="";return t+=this.printGroups(e.groups),t+=this.printMsidSemantic(e.msidSemantic),t+=this.printIceLite(e.iceLite),t+=this.printIceUfrag(e.iceUfrag),t+=this.printIcePwd(e.icePwd),t+=this.printIceOptions(e.iceOptions),t+=this.printFingerprints(e.fingerprints),t+=this.printSetup(e.setup),t+=this.printTlsId(e.tlsId),t+=this.printIdentity(e.identities),t+=this.printExtmap(e.extmaps),t+=this.printUnrecognized(e.unrecognized),t}printGroups(e){let t="";return e.length>0&&(t+=e.map((e=>"a=group:".concat(e.semantic).concat(e.identificationTag.map((e=>"".concat(o).concat(e))).join("")).concat(this.eol))).join("")),t}printIceLite(e){return void 0===e?"":"a=ice-lite"+this.eol}printTlsId(e){return e?"a=tls-id:".concat(e).concat(this.eol):""}printIdentity(e){return 0===e.length?"":e.map((e=>"a=identity:".concat(e.assertionValue).concat(e.extensions.map((e=>"".concat(o).concat(e.name).concat(e.value?"=".concat(e.value):"")))))).join(this.eol)+this.eol}printMsidSemantic(e){if(!e)return"";let t="a=msid-semantic:".concat(e.semantic);return e.applyForAll?t+="".concat(o,"*"):e.identifierList.length>0&&(t+=e.identifierList.map((e=>"".concat(o).concat(e)))),t+this.eol}}class w extends y{print(e){const t=e.attributes;let i="";return i+=this.printRTCP(t.rtcp),i+=this.printIceUfrag(t.iceUfrag),i+=this.printIcePwd(t.icePwd),i+=this.printIceOptions(t.iceOptions),i+=this.printCandidates(t.candidates),i+=this.printRemoteCandidatesList(t.remoteCandidatesList),i+=this.printEndOfCandidates(t.endOfCandidates),i+=this.printFingerprints(t.fingerprints),i+=this.printSetup(t.setup),i+=this.printMid(t.mid),i+=this.printExtmap(t.extmaps),i+=this.printRTPRelated(t),i+=this.printPtime(t.ptime),i+=this.printMaxPtime(t.maxPtime),i+=this.printDirection(t.direction),i+=this.printSSRCGroups(t.ssrcGroups),i+=this.printSSRC(t.ssrcs),i+=this.printRTCPMux(t.rtcpMux),i+=this.printRTCPMuxOnly(t.rtcpMuxOnly),i+=this.printRTCPRsize(t.rtcpRsize),i+=this.printMSId(t.msids),i+=this.printImageattr(t.imageattr),i+=this.printRid(t.rids),i+=this.printSimulcast(t.simulcast),i+=this.printSCRPPort(t.sctpPort),i+=this.printMaxMessageSize(t.maxMessageSize),i+=this.printUnrecognized(t.unrecognized),i}printCandidates(e){return e.map((e=>"a=candidate:".concat(e.foundation).concat(o).concat(e.componentId).concat(o).concat(e.transport).concat(o).concat(e.priority).concat(o).concat(e.connectionAddress).concat(o).concat(e.port).concat(o,"typ").concat(o).concat(e.type).concat(e.relAddr?"".concat(o,"raddr").concat(o).concat(e.relAddr):"").concat(e.relPort?"".concat(o,"rport").concat(o).concat(e.relPort):"").concat(Object.keys(e.extension).map((t=>"".concat(o).concat(t).concat(o).concat(e.extension[t]))).join("")).concat(this.eol))).join("")}printRemoteCandidatesList(e){return e.map((e=>"a=remote-candidates:".concat(e.join(o)).concat(this.eol))).join("")}printEndOfCandidates(e){return void 0===e?"":"a=end-of-candidates"+this.eol}printRTPRelated(e){if(!e.payloads)return"";const t=e.payloads;let i="";i+=e.rtcpFeedbackWildcards.map((e=>this.printRTCPFeedback("*",e))).join("");for(const e of t)i+=this.printRtpMap(e.payloadType,e.rtpMap),i+=this.printFmtp(e.payloadType,e.fmtp),i+=e.rtcpFeedbacks.map((t=>this.printRTCPFeedback(e.payloadType,t))).join("");return i}printFmtp(e,t){if(!t)return"";const i=Object.keys(t.parameters);return 1===i.length&&void 0===t.parameters[i[0]]?"a=fmtp:".concat(e).concat(o).concat(i[0]).concat(this.eol):"a=fmtp:".concat(e).concat(o).concat(Object.keys(t.parameters).map((e=>"".concat(e,"=").concat(t.parameters[e]))).join(";")).concat(this.eol)}printRtpMap(e,t){return t?"a=rtpmap:".concat(e).concat(o).concat(t.encodingName,"/").concat(t.clockRate).concat(t.encodingParameters?"/".concat(t.encodingParameters):"").concat(this.eol):""}printRTCPFeedback(e,t){let i="a=rtcp-fb:".concat(e).concat(o),n=t;return"trr-int"===n.type?i+="ttr-int".concat(o).concat(n.interval):(n=n,i+="".concat(n.type),n.parameter&&(i+="".concat(o).concat(n.parameter),n.additional&&(i+="".concat(o).concat(n.additional)))),i+this.eol}printPtime(e){return void 0===e?"":"a=ptime:".concat(e).concat(this.eol)}printMaxPtime(e){return void 0===e?"":"a=maxptime:".concat(e).concat(this.eol)}printDirection(e){return void 0===e?"":"a=".concat(e).concat(this.eol)}printSSRC(e){return e.map((e=>Object.keys(e.attributes).map((t=>"a=ssrc:".concat(e.ssrcId.toString(10)).concat(o).concat(t).concat(e.attributes[t]?":".concat(e.attributes[t]):"").concat(this.eol))).join(""))).join("")}printRTCPMux(e){return void 0===e?"":"a=rtcp-mux".concat(this.eol)}printRTCPMuxOnly(e){return void 0===e?"":"a=rtcp-mux-only".concat(this.eol)}printRTCPRsize(e){return void 0===e?"":"a=rtcp-rsize".concat(this.eol)}printRTCP(e){if(void 0===e)return"";let t="a=rtcp:".concat(e.port);return e.netType&&(t+="".concat(o).concat(e.netType)),e.addressType&&(t+="".concat(o).concat(e.addressType)),e.address&&(t+="".concat(o).concat(e.address)),t+this.eol}printMSId(e){return e.map((e=>"a=msid:".concat(e.id).concat(e.appdata?"".concat(o).concat(e.appdata):"").concat(this.eol))).join("")}printImageattr(e){return e.map((e=>"a=imageattr:".concat(e).concat(this.eol))).join("")}printRid(e){return e.map((e=>{let t="a=rid:".concat(e.id).concat(o).concat(e.direction);return e.payloads&&(t+="".concat(o,"pt=").concat(e.payloads.join(","))),e.params.length>0&&(t+="".concat(o).concat(e.params.map((e=>"depend"===e.type?"depend=".concat(e.rids.join(",")):"".concat(e.type,"=").concat(e.val))).join(";"))),t+this.eol})).join("")}printSimulcast(e){return void 0===e?"":"a=simulcast:".concat(e).concat(this.eol)}printSCRPPort(e){return void 0===e?"":"a=sctp-port:".concat(e).concat(this.eol)}printMaxMessageSize(e){return void 0===e?"":"a=max-message-size:".concat(e)}printMid(e){return void 0===e?"":"a=mid:".concat(e).concat(this.eol)}printSSRCGroups(e){return e.map((e=>"a=ssrc-group:".concat(e.semantic).concat(e.ssrcIds.map((e=>"".concat(o).concat(e.toString(10)))).join("")).concat(this.eol))).join("")}}function b(e){return(new T).parse(e)}function L(e,t){return(new N).print(e,t)}}},t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}return i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(8)})()}(yz);class Fz{constructor(e){tD(this,"sessionDesc",void 0),tD(this,"localCapabilities",void 0),tD(this,"rtpCapabilities",void 0),tD(this,"candidates",void 0),tD(this,"iceParameters",void 0),tD(this,"dtlsParameters",void 0),tD(this,"setup",void 0),tD(this,"currentMidIndex",void 0),tD(this,"cname",void 0),e=VG(e);const{remoteIceParameters:t,remoteDtlsParameters:i,candidates:n,remoteRTPCapabilities:r,remoteSetup:o,localCapabilities:s,sdkCodec:a,cname:c}=e,A=yz.exports.parse("v=0\no=- 0 0 IN IP4 127.0.0.1\ns=AgoraGateway\nt=0 0\na=group:BUNDLE audio video\na=msid-semantic: WMS\na=ice-lite\nm=audio 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendrecv\na=rtcp-mux\na=rtcp-rsize\na=mid:audio\nm=video 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendrecv\na=rtcp-mux\na=rtcp-rsize\na=mid:video\n");this.rtpCapabilities=r,this.candidates=n,this.iceParameters=t,this.dtlsParameters=i,this.setup=o,this.localCapabilities=s,this.cname=c;for(let e=0;e<A.mediaDescriptions.length;e++){const s=A.mediaDescriptions[e];if(s.attributes.iceUfrag=t.iceUfrag,s.attributes.icePwd=t.icePwd,s.attributes.fingerprints=i.fingerprints,s.attributes.candidates=n,s.attributes.setup=o,"video"===s.media.mediaType){s.media.fmts=r.videoCodecs.map((e=>e.payloadType.toString(10)));const e=r.videoCodecs.filter((e=>{var t;return null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase().includes(a)}));if(0===e.length)throw new Error("Codec ".concat(a," not supported by remote SDP."));s.attributes.payloads=e,s.attributes.extmaps=r.videoExtensions}"audio"===s.media.mediaType&&(s.media.fmts=r.audioCodecs.map((e=>e.payloadType.toString(10))),s.attributes.payloads=r.audioCodecs,s.attributes.extmaps=r.audioExtensions),A.mediaDescriptions[e]=this.mungMediaDesc(s)}this.sessionDesc=A,this.currentMidIndex=A.mediaDescriptions.length-1}toString(){return yz.exports.print(this.sessionDesc)}send(e,t,i){const{ssrcs:n,ssrcGroups:r}=kz(t,this.cname),o=this.sessionDesc.mediaDescriptions.find((t=>e===QP.VIDEO?"video"===t.media.mediaType:"audio"===t.media.mediaType)),s=n[0].attributes.label,a=n[0].attributes.mslabel;return o.attributes.ssrcs=o.attributes.ssrcs.concat(n),o.attributes.ssrcGroups=o.attributes.ssrcGroups.concat(r),{id:s,mslabel:a}}batchSend(e){return e.map((e=>{let{kind:t,ssrcMsg:i}=e;return this.send(t,i,void 0)}))}stopSending(e){this.sessionDesc.mediaDescriptions.forEach((t=>{const i=[],n=[],r=[];t.attributes.ssrcs.forEach((t=>{e.includes(t.attributes.label||"")?r.push(t):i.push(t)})),t.attributes.ssrcGroups.forEach((e=>{r.map((e=>e.ssrcId)).includes(e.ssrcIds[0])||n.push(e)})),t.attributes.ssrcs=i,t.attributes.ssrcGroups=n}))}mute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.mute."));t.attributes.direction="inactive"}unmute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.unmute."));t.attributes.direction="sendonly"}receive(e,t,i){e.forEach(((e,t)=>{const i=e._mediaStreamTrack,n=this.sessionDesc.mediaDescriptions.findIndex((e=>e.attributes.mid===i.kind)),r=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[n],e);this.sessionDesc.mediaDescriptions[n]=r}))}stopReceiving(e){}restartICE(e,t){e=VG(e),t=VG(t),this.iceParameters=e,this.candidates=t,this.sessionDesc.mediaDescriptions.forEach((t=>{t.attributes.iceUfrag=e.iceUfrag,t.attributes.icePwd=e.icePwd,t.attributes.candidates=this.candidates}))}predictReceivingMids(e){const t=[];for(let i=0;i<e;i++)t.push((this.currentMidIndex+i+1).toString(10));return t}mungRecvMediaDsec(e,t){const i=VG(e);return Mz(i,t),Bz(i,t),i}updateRecvMedia(e,t){const i=this.sessionDesc.mediaDescriptions.findIndex((t=>t.attributes.mid===e));if(-1!==i){const e=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[i],t);this.sessionDesc.mediaDescriptions[i]=e}}bumpMid(e){this.currentMidIndex+=e}updateTrackLabel(e,t,i){const n=this.sessionDesc.mediaDescriptions.find((t=>e===QP.VIDEO?"video"===t.attributes.mid:"audio"===t.attributes.mid));if(n){const e=n.attributes.ssrcs.find((e=>e.attributes.label===t));var r;e&&(e.attributes.label=i,null===(r=e.attributes.msid)||void 0===r||r.replace(t,i))}}mungMediaDesc(e){const t=VG(e);return Uz(t),function(e){const t=e.attributes.extmaps.find((e=>"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.extensionName));t&&e.attributes.extmaps.splice(e.attributes.extmaps.indexOf(t),1),e.attributes.payloads.forEach((e=>{const t=e.rtcpFeedbacks.findIndex((e=>"transport-cc"===e.type));-1!==t&&e.rtcpFeedbacks.splice(t,1)}))}(t),t}}function Gz(e){if(Array.isArray(e))return e.map((function(e){return e}));if(!jz(e))return e;var t={};for(var i in e)jz(e[i])||Array.isArray(e[i])?t[i]=Gz(e[i]):t[i]=e[i];return t}function jz(e){return!("object"!=typeof e||Array.isArray(e)||!e)}var Yz=function(){function e(e){this.input=[],this.size=e}return e.prototype.add=function(e){this.input.push(e),this.input.length>this.size&&this.input.splice(0,1)},e.prototype.diffMean=function(){return 0===this.input.length?0:(this.input[this.input.length-1]-this.input[0])/this.input.length},e}(),Hz=function(e,t){return(Hz=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function Kz(e,t){function i(){this.constructor=e}Hz(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Wz=function(){return(Wz=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Jz(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new i((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function qz(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var Xz,zz={address:"unknown",candidateType:"unknown",id:"unknown",port:0,priority:0,protocol:"unknown",type:"unknown"},Zz={timestamp:0,bitrate:{actualEncoded:0,transmit:0},sendPacketLossRate:0,recvPacketLossRate:0,videoRecv:[],videoSend:[],audioRecv:[],audioSend:[],selectedCandidatePair:{id:"unknown",localCandidate:zz,remoteCandidate:zz}},$z={firsCount:0,nacksCount:0,plisCount:0,framesDecodeCount:0,framesDecodeInterval:0,framesDecodeFreezeTime:0,decodeFrameRate:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,qpSumPerFrame:0},eZ={firsCount:0,nacksCount:0,plisCount:0,frameCount:0,bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,qpSumPerFrame:0},tZ={bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0},iZ={jitterBufferMs:0,jitterMs:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,receivedFrames:0,droppedFrames:0},nZ=function(){function e(e,t){var i=this;this.videoIsReady=!1,this.videoIsReady2={},this.stats=Gz(Zz),this.isFirstVideoReceived={},this.isFirstVideoDecoded={},this.isFirstAudioReceived={},this.isFirstAudioDecoded={},this.lossRateWindowStats=[],this.pc=e,this.options=t,this.intervalTimer=window.setInterval((function(){return Jz(i,void 0,void 0,(function(){return qz(this,(function(e){return this.updateStats(),[2]}))}))}),this.options.updateInterval)}return e.prototype.getStats=function(){return this.stats},e.prototype.setVideoIsReady=function(e){this.videoIsReady=e},e.prototype.setVideoIsReady2=function(e,t){this.videoIsReady2[e]=t},e.prototype.getVideoIsReady=function(e){return this.videoIsReady2[e]||!1},e.prototype.setIsFirstAudioDecoded=function(e){},e.prototype.destroy=function(){window.clearInterval(this.intervalTimer),this.pc=void 0},e.prototype.calcLossRate=function(e){var t=this;this.lossRateWindowStats.push(e),this.lossRateWindowStats.length>this.options.lossRateInterval&&this.lossRateWindowStats.splice(0,1);for(var i=this.lossRateWindowStats.length,n=0,r=0,o=0,s=0,a=function(a){e[a].forEach((function(e,c){if(t.lossRateWindowStats[i-1][a][c]&&t.lossRateWindowStats[0][a][c]){var A=t.lossRateWindowStats[i-1][a][c].packets-t.lossRateWindowStats[0][a][c].packets,d=t.lossRateWindowStats[i-1][a][c].packetsLost-t.lossRateWindowStats[0][a][c].packetsLost;"videoSend"===a||"audioSend"===a?(n+=A,o+=d):(r+=A,s+=d),Number.isNaN(A)||Number.isNaN(A)?e.packetLostRate=0:e.packetLostRate=A<=0||d<=0?0:d/(A+d)}}))},c=0,A=["videoSend","audioSend","videoRecv","audioRecv"];c<A.length;c++)a(A[c]);e.sendPacketLossRate=n<=0||o<=0?0:o/(n+o),e.recvPacketLossRate=r<=0||s<=0?0:s/(r+s)},e}(),rZ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._stats=Zz,t.lastDecodeVideoReceiverStats=new Map,t}return Kz(t,e),t.prototype.updateStats=function(){return Jz(this,void 0,void 0,(function(){var e,t,i,n;return qz(this,(function(r){switch(r.label){case 0:return[4,this._getStats()];case 1:return e=r.sent(),t=this.statsResponsesToObjects(e),this._stats=Gz(Zz),i=t.filter((function(e){return"ssrc"===e.type})),this.processSSRCStats(i),(n=t.find((function(e){return"VideoBwe"===e.type})))&&this.processBandwidthStats(n),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats,[2]}}))}))},t.prototype.processBandwidthStats=function(e){this._stats.bitrate={actualEncoded:Number(e.googActualEncBitrate),targetEncoded:Number(e.googTargetEncBitrate),retransmit:Number(e.googRetransmitBitrate),transmit:Number(e.googTransmitBitrate)},this._stats.sendBandwidth=Number(e.googAvailableSendBandwidth)},t.prototype.processSSRCStats=function(e){var t=this;e.forEach((function(e){var i=e.id.includes("send");switch(e.mediaType+"_"+(i?"send":"recv")){case"video_send":var n=Gz(eZ);n.codec=e.googCodecName,n.adaptionChangeReason="none",e.googCpuLimitedResolution&&(n.adaptionChangeReason="cpu"),e.googBandwidthLimitedResolution&&(n.adaptionChangeReason="bandwidth"),n.avgEncodeMs=Number(e.googAvgEncodeMs),n.inputFrame={width:Number(e.googFrameWidthInput)||Number(e.googFrameWidthSent),height:Number(e.googFrameHeightInput)||Number(e.googFrameHeightSent),frameRate:Number(e.googFrameRateInput)},n.sentFrame={width:Number(e.googFrameWidthSent),height:Number(e.googFrameHeightSent),frameRate:Number(e.googFrameRateInput)},n.firsCount=Number(e.googFirReceived),n.nacksCount=Number(e.googNacksReceived),n.plisCount=Number(e.googPlisReceived),n.frameCount=Number(e.framesEncoded),n.bytes=Number(e.bytesSent),n.packets=Number(e.packetsSent),n.packetsLost=Number(e.packetsLost),n.ssrc=Number(e.ssrc),n.rttMs=Number(e.googRtt||0),t._stats.videoSend.push(n),t._stats.rtt=n.rttMs;break;case"video_recv":var r=Gz($z),o=t.lastDecodeVideoReceiverStats.get(Number(e.ssrc));if(r.codec=e.googCodecName,r.targetDelayMs=Number(e.googTargetDelayMs),r.renderDelayMs=Number(e.googRenderDelayMs),r.currentDelayMs=Number(e.googCurrentDelayMs),r.minPlayoutDelayMs=Number(e.googMinPlayoutDelayMs),r.decodeMs=Number(e.googDecodeMs),r.maxDecodeMs=Number(e.googMaxDecodeMs),r.receivedFrame={width:Number(e.googFrameWidthReceived),height:Number(e.googFrameHeightReceived),frameRate:Number(e.googFrameRateReceived)},r.decodedFrame={width:Number(e.googFrameWidthReceived),height:Number(e.googFrameHeightReceived),frameRate:Number(e.googFrameRateDecoded)},r.outputFrame={width:Number(e.googFrameWidthReceived),height:Number(e.googFrameHeightReceived),frameRate:Number(e.googFrameRateOutput)},r.jitterBufferMs=Number(e.googJitterBufferMs),r.firsCount=Number(e.googFirsSent),r.nacksCount=Number(e.googNacksSent),r.plisCount=Number(e.googPlisSent),r.framesDecodeCount=Number(e.framesDecoded),r.bytes=Number(e.bytesReceived),r.packets=Number(e.packetsReceived),r.packetsLost=Number(e.packetsLost),r.ssrc=Number(e.ssrc),r.packets>0&&!t.isFirstVideoReceived[r.ssrc]&&(t.onFirstVideoReceived&&t.onFirstVideoReceived(r.ssrc),t.isFirstVideoReceived[r.ssrc]=!0),r.framesDecodeCount>0&&!t.isFirstVideoDecoded[r.ssrc]&&(t.onFirstVideoDecoded&&t.onFirstVideoDecoded(r.ssrc,r.decodedFrame.width,r.decodedFrame.height),t.isFirstVideoDecoded[r.ssrc]=!0),o){var s=o.stats,a=Date.now()-o.lts;r.framesDecodeFreezeTime=s.framesDecodeFreezeTime,r.framesDecodeInterval=s.framesDecodeInterval,r.framesDecodeCount>s.framesDecodeCount&&t.isFirstVideoDecoded?(o.lts=Date.now(),r.framesDecodeInterval=a,r.framesDecodeInterval>=t.options.freezeRateLimit&&(t.getVideoIsReady(parseInt(e.ssrc,10))?r.framesDecodeFreezeTime+=r.framesDecodeInterval:t.setVideoIsReady2(parseInt(e.ssrc,10),!0))):r.framesDecodeCount<o.stats.framesDecodeCount&&(r.framesDecodeInterval=0)}t.lastDecodeVideoReceiverStats.set(r.ssrc,{stats:Wz({},r),lts:Date.now()}),t._stats.videoRecv.push(r);break;case"audio_recv":var c=Gz(iZ);c.codec=e.googCodecName,c.outputLevel=Math.abs(Number(e.audioOutputLevel))/32767,c.decodingCNG=Number(e.googDecodingCNG),c.decodingCTN=Number(e.googDecodingCTN),c.decodingCTSG=Number(e.googDecodingCTSG),c.decodingNormal=Number(e.googDecodingNormal),c.decodingPLC=Number(e.googDecodingPLC),c.decodingPLCCNG=Number(e.googDecodingPLCCNG),c.expandRate=Number(e.googExpandRate),c.accelerateRate=Number(e.googAccelerateRate),c.preemptiveExpandRate=Number(e.googPreemptiveExpandRate),c.secondaryDecodedRate=Number(e.googSecondaryDecodedRate),c.speechExpandRate=Number(e.googSpeechExpandRate),c.preferredJitterBufferMs=Number(e.googPreferredJitterBufferMs),c.jitterBufferMs=Number(e.googJitterBufferMs),c.jitterMs=Number(e.googJitterReceived),c.bytes=Number(e.bytesReceived),c.packets=Number(e.packetsReceived),c.packetsLost=Number(e.packetsLost),c.ssrc=Number(e.ssrc),c.receivedFrames=Number(e.googDecodingCTN)||Number(e.packetsReceived),c.droppedFrames=Number(e.googDecodingPLC)+Number(e.googDecodingPLCCNG)||Number(e.packetsLost),c.receivedFrames>0&&!t.isFirstAudioReceived[c.ssrc]&&(t.onFirstAudioReceived&&t.onFirstAudioReceived(c.ssrc),t.isFirstAudioReceived[c.ssrc]=!0),c.decodingNormal>0&&!t.isFirstAudioDecoded[c.ssrc]&&(t.onFirstAudioDecoded&&t.onFirstAudioDecoded(c.ssrc),t.isFirstAudioDecoded[c.ssrc]=!0),t._stats.audioRecv.push(c);break;case"audio_send":var A=Gz(tZ);A.codec=e.googCodecName,A.inputLevel=Math.abs(Number(e.audioInputLevel))/32767,A.aecReturnLoss=Number(e.googEchoCancellationReturnLoss||0),A.aecReturnLossEnhancement=Number(e.googEchoCancellationReturnLossEnhancement||0),A.residualEchoLikelihood=Number(e.googResidualEchoLikelihood||0),A.residualEchoLikelihoodRecentMax=Number(e.googResidualEchoLikelihoodRecentMax||0),A.bytes=Number(e.bytesSent),A.packets=Number(e.packetsSent),A.packetsLost=Number(e.packetsLost),A.ssrc=Number(e.ssrc),A.rttMs=Number(e.googRtt||0),t._stats.rtt=A.rttMs,t._stats.audioSend.push(A)}}))},t.prototype._getStats=function(){var e=this;return new Promise((function(t,i){e.pc.getStats(t,i)}))},t.prototype.statsResponsesToObjects=function(e){var t=[];return e.result().forEach((function(e){var i={id:e.id,timestamp:e.timestamp.valueOf().toString(),type:e.type};e.names().forEach((function(t){i[t]=e.stat(t)})),t.push(i)})),t},t}(nZ);!function(e){e.CERTIFICATE="certificate",e.CODEC="codec",e.CANDIDATE_PAIR="candidate-pair",e.LOCAL_CANDIDATE="local-candidate",e.REMOTE_CANDIDATE="remote-candidate",e.INBOUND="inbound-rtp",e.TRACK="track",e.OUTBOUND="outbound-rtp",e.PC="peer-connection",e.REMOTE_INBOUND="remote-inbound-rtp",e.REMOTE_OUTBOUND="remote-outbound-rtp",e.TRANSPORT="transport",e.CSRC="csrc",e.DATA_CHANNEL="data-channel",e.STREAM="stream",e.SENDER="sender",e.RECEIVER="receiver"}(Xz||(Xz={}));var oZ,sZ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._stats=Zz,t.lastDecodeVideoReceiverStats=new Map,t.lastVideoFramesRecv=new Map,t.lastVideoFramesSent=new Map,t.lastVideoFramesDecode=new Map,t.lastVideoJBDelay=new Map,t.lastAudioJBDelay=new Map,t.mediaBytesSent=new Map,t.mediaBytesRetransmit=new Map,t.mediaBytesTargetEncode=new Map,t.lastEncoderMs=new Map,t}return Kz(t,e),t.prototype.updateStats=function(){return Jz(this,void 0,void 0,(function(){var e,t=this;return qz(this,(function(i){switch(i.label){case 0:return e=this,[4,this.pc.getStats()];case 1:return e.report=i.sent(),this._stats=Gz(Zz),this.report.forEach((function(e){switch(e.type){case Xz.OUTBOUND:"audio"===e.mediaType?t.processAudioOutboundStats(e):"video"===e.mediaType&&t.processVideoOutboundStats(e);break;case Xz.INBOUND:"audio"===e.mediaType?t.processAudioInboundStats(e):"video"===e.mediaType&&t.processVideoInboundStats(e);break;case Xz.TRANSPORT:var i=t.report.get(e.selectedCandidatePairId);i&&t.processCandidatePairStats(i);break;case Xz.CANDIDATE_PAIR:e.selected&&t.processCandidatePairStats(e)}})),this.updateSendBitrate(),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats,[2]}}))}))},t.prototype.processCandidatePairStats=function(e){if(this._stats.sendBandwidth=e.availableOutgoingBitrate||0,e.currentRoundTripTime&&(this._stats.rtt=1e3*e.currentRoundTripTime),this._stats.videoSend.forEach((function(t){!t.rttMs&&e.currentRoundTripTime&&(t.rttMs=1e3*e.currentRoundTripTime)})),this._stats.audioSend.forEach((function(t){!t.rttMs&&e.currentRoundTripTime&&(t.rttMs=1e3*e.currentRoundTripTime)})),this._stats.selectedCandidatePair.id=e.id,e.localCandidateId){var t=this.report.get(e.localCandidateId);t&&this.processCandidateStats(t)}if(e.remoteCandidateId){var i=this.report.get(e.remoteCandidateId);i&&this.processCandidateStats(i)}},t.prototype.processCandidateStats=function(e){var t;e.type===Xz.LOCAL_CANDIDATE&&(t=this._stats.selectedCandidatePair.localCandidate),e.type===Xz.REMOTE_CANDIDATE&&(t=this._stats.selectedCandidatePair.remoteCandidate),t&&(t.type=e.type,t.id=e.id,e.address&&(t.address=e.address),e.candidateType&&(t.candidateType=e.candidateType),e.port&&(t.port=e.port),e.priority&&(t.priority=e.priority),e.protocol&&(t.protocol=e.protocol),e.relayProtocol&&(t.relayProtocol=e.relayProtocol),e.type===Xz.LOCAL_CANDIDATE&&this.stats.selectedCandidatePair.localCandidate.id!==t.id&&this.onSelectedLocalCandidateChanged&&this.onSelectedLocalCandidateChanged(Wz({},t),Wz({},this.stats.selectedCandidatePair.localCandidate)),e.type===Xz.REMOTE_CANDIDATE&&this.stats.selectedCandidatePair.remoteCandidate.id!==t.id&&this.onSelectedRemoteCandidateChanged&&this.onSelectedRemoteCandidateChanged(Wz({},t),Wz({},this.stats.selectedCandidatePair.remoteCandidate)))},t.prototype.processAudioInboundStats=function(e){var t=this._stats.audioRecv.find((function(t){return t.ssrc===e.ssrc}));t||(t=Gz(iZ),this._stats.audioRecv.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsReceived,t.packetsLost=e.packetsLost,t.bytes=e.bytesReceived,t.jitterMs=1e3*e.jitter,e.trackId&&this.processAudioTrackReceiverStats(e.trackId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),t.receivedFrames||(t.receivedFrames=e.packetsReceived),t.droppedFrames||(t.droppedFrames=e.packetsLost),t.receivedFrames>0&&!this.isFirstAudioReceived[t.ssrc]&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(t.ssrc),this.isFirstAudioReceived[t.ssrc]=!0),t.outputLevel&&t.outputLevel>0&&!this.isFirstAudioDecoded[t.ssrc]&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(t.ssrc),this.isFirstAudioDecoded[t.ssrc]=!0)},t.prototype.processVideoInboundStats=function(e){var t=this._stats.videoRecv.find((function(t){return t.ssrc===e.ssrc}));t||(t=Gz($z),this._stats.videoRecv.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsReceived,t.packetsLost=e.packetsLost,t.bytes=e.bytesReceived,t.firsCount=e.firCount,t.nacksCount=e.nackCount,t.plisCount=e.pliCount,t.framesDecodeCount=e.framesDecoded;var i=this.lastDecodeVideoReceiverStats.get(t.ssrc),n=this.lastVideoFramesDecode.get(t.ssrc),r=Date.now();if(t.framesDecodeCount>0&&!this.isFirstVideoDecoded[t.ssrc]){var o=t.decodedFrame?t.decodedFrame.width:0,s=t.decodedFrame?t.decodedFrame.height:0;this.onFirstVideoDecoded&&this.onFirstVideoDecoded(t.ssrc,o,s),this.isFirstVideoDecoded[t.ssrc]=!0}if(i){var a=i.stats,c=r-i.lts;t.framesDecodeFreezeTime=a.framesDecodeFreezeTime,t.framesDecodeInterval=a.framesDecodeInterval,t.framesDecodeCount>a.framesDecodeCount&&this.isFirstVideoDecoded?(i.lts=Date.now(),t.framesDecodeInterval=c,t.framesDecodeInterval>=this.options.freezeRateLimit&&(this.getVideoIsReady(parseInt(e.ssrc))?t.framesDecodeFreezeTime+=t.framesDecodeInterval:this.setVideoIsReady2(parseInt(e.ssrc,10),!0))):t.framesDecodeCount<a.framesDecodeCount&&(t.framesDecodeInterval=0),e.framesDecoded&&e.qpSum&&(i.stats.framesDecodeCount>e.framesDecoded?t.qpSumPerFrame=e.qpSum/e.framesDecoded:t.qpSumPerFrame=(e.qpSum-i.qpSum)/(e.framesDecoded-i.stats.framesDecodeCount))}n&&r-n.lts>=800?(t.decodeFrameRate=Math.round((t.framesDecodeCount-n.count)/((r-n.lts)/1e3)),this.lastVideoFramesDecode.set(t.ssrc,{count:t.framesDecodeCount,lts:r,rate:t.decodeFrameRate})):n?t.decodeFrameRate=n.rate:this.lastVideoFramesDecode.set(t.ssrc,{count:t.framesDecodeCount,lts:r,rate:0}),e.totalDecodeTime&&(t.decodeMs=1e3*e.totalDecodeTime),e.trackId&&this.processVideoTrackReceiverStats(e.trackId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.framerateMean&&(t.framesRateFirefox=e.framerateMean),t.packets>0&&!this.isFirstVideoReceived[t.ssrc]&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(t.ssrc),this.isFirstVideoReceived[t.ssrc]=!0),this.lastDecodeVideoReceiverStats.set(t.ssrc,{stats:Wz({},t),lts:i?i.lts:Date.now(),qpSum:e.qpSum})},t.prototype.processVideoOutboundStats=function(e){var t=this._stats.videoSend.find((function(t){return t.ssrc===e.ssrc}));t||(t=Gz(eZ),this._stats.videoSend.push(t));var i,n=this.mediaBytesSent.get(e.ssrc);if(n?n.add(e.bytesSent):((o=new Yz(10)).add(e.bytesSent),this.mediaBytesSent.set(e.ssrc,o)),void 0!==e.retransmittedBytesSent){var r=this.mediaBytesRetransmit.get(e.ssrc);r?r.add(e.retransmittedBytesSent):((o=new Yz(10)).add(e.retransmittedBytesSent),this.mediaBytesRetransmit.set(e.ssrc,o))}if(e.totalEncodedBytesTarget){var o,s=this.mediaBytesTargetEncode.get(e.ssrc);s?s.add(e.totalEncodedBytesTarget):((o=new Yz(10)).add(e.totalEncodedBytesTarget),this.mediaBytesTargetEncode.set(e.ssrc,o))}if(t.ssrc=e.ssrc,t.bytes=e.bytesSent,t.packets=e.packetsSent,t.firsCount=e.firCount,t.nacksCount=e.nackCount,t.plisCount=e.pliCount,t.frameCount=e.framesEncoded,t.adaptionChangeReason=e.qualityLimitationReason,e.totalEncodeTime&&e.framesEncoded)if(!(i=this.lastEncoderMs.get(e.ssrc))||i.lastFrameCount>e.framesEncoded)t.avgEncodeMs=1e3*e.totalEncodeTime/e.framesEncoded;else{var a=e.framesEncoded-i.lastFrameCount,c=e.totalEncodeTime-i.lastEncoderTime;t.avgEncodeMs=1e3*c/a}if(e.framesEncoded&&e.qpSum&&(!(i=this.lastEncoderMs.get(e.ssrc))||i.lastFrameCount>e.framesEncoded?t.qpSumPerFrame=e.qpSum/e.framesEncoded:t.qpSumPerFrame=(e.qpSum-i.lastQpSum)/(e.framesEncoded-i.lastFrameCount)),this.lastEncoderMs.set(e.ssrc,{lastFrameCount:e.framesEncoded,lastEncoderTime:e.totalEncodeTime,lastQpSum:e.qpSum,lts:Date.now()}),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.mediaSourceId&&this.processVideoMediaSource(e.mediaSourceId,t),e.trackId&&this.processVideoTrackSenderStats(e.trackId,t),e.remoteId)this.processRemoteInboundStats(e.remoteId,t);else{var A=this.findRemoteStatsId(e.ssrc,Xz.REMOTE_INBOUND);A&&this.processRemoteInboundStats(A,t)}},t.prototype.processAudioOutboundStats=function(e){var t=this._stats.audioSend.find((function(t){return t.ssrc===e.ssrc}));if(t||(t=Gz(tZ),this._stats.audioSend.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsSent,t.bytes=e.bytesSent,e.mediaSourceId&&this.processAudioMediaSource(e.mediaSourceId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.trackId&&this.processAudioTrackSenderStats(e.trackId,t),e.remoteId)this.processRemoteInboundStats(e.remoteId,t);else{var i=this.findRemoteStatsId(e.ssrc,Xz.REMOTE_INBOUND);i&&this.processRemoteInboundStats(i,t)}},t.prototype.findRemoteStatsId=function(e,t){var i=Array.from(this.report.values()).find((function(i){return i.type===t&&i.ssrc===e}));return i?i.id:null},t.prototype.processVideoMediaSource=function(e,t){var i=this.report.get(e);i&&i.width&&i.height&&i.framesPerSecond&&(t.inputFrame={width:i.width,height:i.height,frameRate:i.framesPerSecond})},t.prototype.processAudioMediaSource=function(e,t){var i=this.report.get(e);i&&(t.inputLevel=i.audioLevel)},t.prototype.processVideoTrackSenderStats=function(e,t){var i=this.report.get(e);if(i){var n=0,r=Date.now(),o=this.lastVideoFramesSent.get(t.ssrc);o&&r-o.lts>=800?(n=Math.round((i.framesSent-o.count)/((r-o.lts)/1e3)),this.lastVideoFramesSent.set(t.ssrc,{count:i.framesSent,lts:r,rate:n})):o?n=o.rate:this.lastVideoFramesSent.set(t.ssrc,{count:i.framesSent,lts:r,rate:0}),t.sentFrame={width:i.frameWidth,height:i.frameHeight,frameRate:n}}},t.prototype.processVideoTrackReceiverStats=function(e,t){var i=this.report.get(e);if(i){var n=this.lastVideoFramesRecv.get(t.ssrc),r=Date.now();t.framesReceivedCount=i.framesReceived;var o=0;if(n&&r-n.lts>=800?(o=Math.round((i.framesReceived-n.count)/((r-n.lts)/1e3)),this.lastVideoFramesRecv.set(t.ssrc,{count:i.framesReceived,lts:r,rate:o})):n?o=n.rate:this.lastVideoFramesRecv.set(t.ssrc,{count:i.framesReceived,lts:r,rate:0}),t.receivedFrame={width:i.frameWidth||0,height:i.frameHeight||0,frameRate:o||0},t.decodedFrame={width:i.frameWidth||0,height:i.frameHeight||0,frameRate:t.decodeFrameRate||0},t.outputFrame={width:i.frameWidth||0,height:i.frameHeight||0,frameRate:t.decodeFrameRate||0},i.jitterBufferDelay&&i.jitterBufferEmittedCount){var s=this.lastVideoJBDelay.get(t.ssrc);this.lastVideoJBDelay.set(t.ssrc,{jitterBufferDelay:i.jitterBufferDelay,jitterBufferEmittedCount:i.jitterBufferEmittedCount}),s||(s={jitterBufferDelay:0,jitterBufferEmittedCount:0});var a=1e3*(i.jitterBufferDelay-s.jitterBufferDelay)/(i.jitterBufferEmittedCount-s.jitterBufferEmittedCount);t.jitterBufferMs=a,t.currentDelayMs=Math.round(a)}}},t.prototype.processAudioTrackSenderStats=function(e,t){var i=this.report.get(e);i&&(t.aecReturnLoss=i.echoReturnLoss||0,t.aecReturnLossEnhancement=i.echoReturnLossEnhancement||0)},t.prototype.processAudioTrackReceiverStats=function(e,t){var i=this.report.get(e);if(i){if(i.removedSamplesForAcceleration&&i.totalSamplesReceived&&(t.accelerateRate=i.removedSamplesForAcceleration/i.totalSamplesReceived),i.jitterBufferDelay&&i.jitterBufferEmittedCount){var n=this.lastAudioJBDelay.get(t.ssrc);this.lastAudioJBDelay.set(t.ssrc,{jitterBufferDelay:i.jitterBufferDelay,jitterBufferEmittedCount:i.jitterBufferEmittedCount}),n||(n={jitterBufferDelay:0,jitterBufferEmittedCount:0});var r=1e3*(i.jitterBufferDelay-n.jitterBufferDelay)/(i.jitterBufferEmittedCount-n.jitterBufferEmittedCount);t.jitterBufferMs=Math.round(r)}t.outputLevel=i.audioLevel;var o=1920;i.totalSamplesDuration&&i.totalSamplesReceived&&(o=i.totalSamplesReceived/i.totalSamplesDuration/50,t.receivedFrames=Math.round(i.totalSamplesReceived/o)),i.concealedSamples&&(t.droppedFrames=Math.round(i.concealedSamples/o))}},t.prototype.processRemoteInboundStats=function(e,t){var i=this.report.get(e);i&&(t.packetsLost=i.packetsLost,i.roundTripTime&&(t.rttMs=1e3*i.roundTripTime))},t.prototype.getCodecFromCodecStats=function(e){var t=this.report.get(e);if(!t)return"";var i=t.mimeType.match(/\/(.*)$/);return i&&i[1]?i[1]:""},t.prototype.updateSendBitrate=function(){var e=0,t=null,i=null;this.mediaBytesSent.forEach((function(t){e+=t.diffMean()})),this.mediaBytesRetransmit.forEach((function(e){t=null===t?e.diffMean():t+e.diffMean()})),this.mediaBytesTargetEncode.forEach((function(e){i=null===i?e.diffMean():i+e.diffMean()}));var n=null!==t?e-t:e;this._stats.bitrate={actualEncoded:8*n/(this.options.updateInterval/1e3),transmit:8*e/(this.options.updateInterval/1e3)},null!==t&&(this._stats.bitrate.retransmit=8*t/(this.options.updateInterval/1e3)),null!==i&&(this._stats.bitrate.targetEncoded=8*i/(this.options.updateInterval/1e3))},t}(nZ),aZ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Kz(t,e),t.prototype.updateStats=function(){return Promise.resolve()},t}(nZ);function cZ(e,t,i,n){void 0===t&&(t=250),void 0===i&&(i=8),void 0===n&&(n=500);var r,o=(r=navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]*/i))&&r[0]?Number(r[0].split("/")[1]):null;return o?o<76?new rZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n}):new sZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n}):function(e){return!!window.RTCStatsReport&&e.getStats()instanceof Promise}(e)?new sZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n}):new aZ(e,{updateInterval:t,lossRateInterval:i,freezeRateLimit:n})}function AZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function dZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?AZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):AZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let uZ=(tx((oZ=class e extends HP{get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}constructor(t,i){super(t,i),tD(this,"store",void 0),tD(this,"peerConnection",void 0),tD(this,"remoteSDP",void 0),tD(this,"initialOffer",void 0),tD(this,"statsFilter",void 0),tD(this,"useRTX",!1),tD(this,"localCapabilities",void 0),tD(this,"localCandidateCount",0),tD(this,"allCandidatesReceived",!1),tD(this,"mutex",new Qx("P2PConnection-mutex")),this.store=i,this.peerConnection=new RTCPeerConnection(e.resolvePCConfiguration(t),{optional:[{googDscp:!0}]}),this.statsFilter=cZ(this.peerConnection,void 0,void 0,By()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1}async establish(){try{const e=await this.peerConnection.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});if(!e.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");const t=Lz(e.sdp),i=bz(e.sdp,!this.useRTX,!1,["opus"]);return this.localCapabilities=i,this.initialOffer=e,dZ(dZ({},t),{},{rtpCapabilities:{send:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},recv:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},sendrecv:i},offerSDP:e.sdp})}catch(e){throw new pw(hw.GET_LOCAL_CONNECTION_PARAMS_FAILED,e.toString())}}async connect(e,t,i,n,r,o){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new Fz({remoteIceParameters:e,remoteDtlsParameters:t,candidates:i,remoteRTPCapabilities:n.send,remoteSetup:r,localCapabilities:this.localCapabilities,sdkCodec:this.store.codec,cname:o});const s=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(this.initialOffer),await this.peerConnection.setRemoteDescription({type:"answer",sdp:s})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(e.toString()))}}send(e,t){var i=this;return nz((function*(){const n=yield rz(i.mutex.lock());try{if(!i.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");const r=e.map((e=>i.peerConnection.addTrack(e._mediaStreamTrack))),o=yield rz(i.peerConnection.createOffer()),s=yz.exports.parse(o.sdp),a=e.map((e=>{const t=e._mediaStreamTrack,n=s.mediaDescriptions.find((e=>e.attributes.mid===t.kind));if(!n)throw new Error("Cannot extract ssrc from mediaDescription.");return function(e,t,i){const n=e.attributes.ssrcs.filter((e=>e.attributes.label===t)),r=e.attributes.ssrcGroups;if(0===n.length)throw new Error("Cannot extract ssrc from plan-b SDP.");if(r&&n.length>1){const e=r.find((e=>-1!==e.ssrcIds.indexOf(n[0].ssrcId)));return e?[{ssrcId:e.ssrcIds[0],rtx:i?e.ssrcIds[1]:void 0}]:[{ssrcId:n[0].ssrcId}]}return[{ssrcId:n[0].ssrcId}]}(n,t.id,i.useRTX)}));let c;try{c=yield a}catch(e){throw r.forEach((e=>{Uy()&&e.replaceTrack(null),i.peerConnection.removeTrack(e)})),e}const A=i.mungSendOfferSDP(o.sdp,e);i.remoteSDP.receive(e,t,c);const d=i.remoteSDP.toString();return yield rz(i.peerConnection.setLocalDescription({type:"offer",sdp:A})),yield rz(i.applySendEncodings(r,e)),yield rz(i.peerConnection.setRemoteDescription({type:"answer",sdp:d})),e.map(((e,t)=>{const i=e._mediaStreamTrack.id;return{localSSRC:a[t],id:i}}))}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(e.toString()))}finally{n()}}))()}async stopSending(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");const t=this.peerConnection.getSenders().filter((t=>{var i;return-1!==e.indexOf((null===(i=t.track)||void 0===i?void 0:i.id)||"")}));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");t.map((e=>{Uy()&&e.replaceTrack(null),this.peerConnection.removeTrack(e)}));const i=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(i),this.remoteSDP.stopReceiving(e);const n=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(e.toString()))}}async receive(e,t,i,n){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(e," before remoteSDP created."));const{id:i,mslabel:r}=this.remoteSDP.send(e,t,n),o=new Mm(((t,n)=>{const o=setTimeout((()=>{n(new Error("Cannot receive track, id: ".concat(i)))}),1e4),s=n=>{const a=Dy();if("Safari"===a.name&&11===Number(a.version)&&n.track.id!==i&&n.streams[0].id===r){var c;const r=n.streams[0].getTracks()[0];return null===(c=this.remoteSDP)||void 0===c||c.updateTrackLabel(e,i,n.track.id),this.peerConnection.removeEventListener("track",s),clearTimeout(o),void t(r)}if(n.track.id===i)return this.peerConnection.removeEventListener("track",s),clearTimeout(o),void t(n.track)};this.peerConnection.addEventListener("track",s)})),s=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:s});const a=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(a),{track:await o,id:i}}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}async stopReceiving(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(e);const t=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const i=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(i)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(e.toString()))}}async muteRemote(e){}async unmuteRemote(e){}async muteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");const t=this.peerConnection.getSenders().filter((t=>{var i;return-1!==e.indexOf((null===(i=t.track)||void 0===i?void 0:i.id)||"")}));if(t.length!==e.length)throw new Error("sender' length doesn't match mids' length.");t.map((e=>{if(Uy()&&e.track)e.track.enabled=!1;else{const t=e.getParameters();t.encodings.forEach((e=>e.active=!1)),e.setParameters(t)}}))}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(e.toString()))}}async unmuteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");const t=this.peerConnection.getSenders().filter((t=>{var i;return-1!==e.indexOf((null===(i=t.track)||void 0===i?void 0:i.id)||"")}));if(t.length!==e.length)throw new Error("Senders' length doesn't match mids' length.");t.map((async e=>{if(Uy()&&e.track)e.track.enabled=!0;else{const t=e.getParameters();t.encodings.forEach((e=>e.active=!0)),await e.setParameters(t)}}));const i=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(i);const n=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(e.toString()))}}async reEstablish(){const e=await this.peerConnection.createOffer({iceRestart:!0});if(!e.sdp)throw new Error("Cannot get SDP from restart offer.");return{iceParameters:Lz(e.sdp).iceParameters,restartICE:async(t,i)=>this.restartICE(e,t,i),restartOfferSDP:e.sdp}}close(){var e;this.peerConnection.close(),null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,"closed"),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(e){return this.statsFilter.getVideoIsReady(e)}async updateEncoderConfig(e,t){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");const e=await this.peerConnection.createOffer(),i=this.mungSendOfferSDP(e.sdp,[t]);this.remoteSDP.updateRecvMedia(t._mediaStreamTrack.kind,t);const n=this.remoteSDP.toString();await this.peerConnection.setLocalDescription({type:"offer",sdp:i}),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,e.toString())}}async updateSendParameters(e,t){const i=this.peerConnection.getSenders().filter((t=>{var i;return(null===(i=t.track)||void 0===i?void 0:i.id)===e}));1===i.length&&await this.applySendEncodings(i,[t])}setStatsRemoteVideoIsReady(e,t){this.statsFilter.setVideoIsReady2(e,t)}async replaceTrack(e,t){const i=this.peerConnection.getSenders().find((e=>{var i;return(null===(i=e.track)||void 0===i?void 0:i.id)===t}));i&&await i.replaceTrack(e._mediaStreamTrack)}async restartICE(e,t,i){try{if(!this.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");this.remoteSDP.restartICE(t,i);const n=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(e),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.restartICE failed; ".concat(e.toString()))}}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var e;null===(e=this.onICEConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var e;null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=e=>{e.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout((()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))}),cb("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(t){const i={iceServers:[],sdpSemantics:"plan-b"};return t.iceServers?i.iceServers=t.iceServers:t.turnServer&&"off"!==t.turnServer.mode&&(ZL(t.turnServer.servers)?i.iceServers=t.turnServer.servers:(i.iceServers&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.servers)),cb("USE_TURN_SERVER_OF_GATEWAY")&&i.iceServers&&t.turnServer.serversFromGateway&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.serversFromGateway)),t.turnServer.servers.concat(t.turnServer.serversFromGateway||[]).forEach((e=>{e.forceturn&&(i.iceTransportPolicy="relay")})))),i}static turnServerConfigToIceServers(e){const t=[];return e.forEach((e=>{e.security?e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turns:".concat(e.turnServerURL,":").concat(e.tcpport,"?transport=tcp")}):(e.udpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.udpport,"?transport=udp")}),e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.tcpport,"?transport=tcp")}))})),t}async applySendEncodings(e,t){try{if(!XP().supportSetRtpSenderParameters)return;if(e.length!==t.length)return;for(let n=0;n<e.length;n++){var i;const r=e[n],o=t[n];if(!o)continue;const s={},a={};if(o instanceof WJ)switch(o._optimizationMode){case"motion":s.degradationPreference="maintain-framerate";break;case"detail":s.degradationPreference="maintain-resolution";break;default:s.degradationPreference="balanced"}if(cb("DSCP_TYPE")&&Ky()){const e=cb("DSCP_TYPE");["very-low","low","medium","high"].includes(e)&&(a.networkPriority=e)}const c=r.getParameters(),A=null===(i=c.encodings)||void 0===i?void 0:i[0];A&&Object.assign(A,a),Object.assign(c,s),await r.setParameters(c)}}catch(e){mw.debug("Apply RTPSendEncodings failed.")}}mungSendOfferSDP(e,t){const i=yz.exports.parse(e);return t.forEach(((e,t)=>{const n=e._mediaStreamTrack,r=i.mediaDescriptions.find((e=>e.attributes.mid===n.kind));r&&Mz(r,e)})),yz.exports.print(i)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=e=>{var t;null===(t=this.onFirstAudioReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoReceived=e=>{var t;null===(t=this.onFirstVideoReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstAudioDecoded=e=>{var t;null===(t=this.onFirstAudioDecoded)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoDecoded=(e,t,i)=>{var n;null===(n=this.onFirstVideoDecoded)||void 0===n||n.call(this,e,t,i)},this.statsFilter.onSelectedLocalCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedLocalCandidateChanged)||void 0===i||i.call(this,e,t)},this.statsFilter.onSelectedRemoteCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedRemoteCandidateChanged)||void 0===i||i.call(this,e,t)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0}async batchReceive(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");const t=this.remoteSDP.batchSend(e).map(((t,i)=>{let{id:n,mslabel:r}=t;const{kind:o}=e[i];return new Mm(((e,t)=>{const i=setTimeout((()=>{t(new Error("Cannot receive track, id: ".concat(n)))}),1e4),s=t=>{const a=Dy();if("Safari"===a.name&&11===Number(a.version)&&t.track.id!==n&&t.streams[0].id===r){var c;const r=t.streams[0].getTracks()[0];return null===(c=this.remoteSDP)||void 0===c||c.updateTrackLabel(o,n,t.track.id),this.peerConnection.removeEventListener("track",s),clearTimeout(i),void e({track:r,id:n})}if(t.track.id===n)return this.peerConnection.removeEventListener("track",s),clearTimeout(i),void e({track:t.track,id:n})};this.peerConnection.addEventListener("track",s)}))})),i=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:i});const n=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(n),await Mm.all(t)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}}).prototype,"connect",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"connect"),oZ.prototype),tx(oZ.prototype,"stopSending",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"stopSending"),oZ.prototype),tx(oZ.prototype,"receive",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"receive"),oZ.prototype),tx(oZ.prototype,"stopReceiving",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"stopReceiving"),oZ.prototype),tx(oZ.prototype,"muteRemote",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"muteRemote"),oZ.prototype),tx(oZ.prototype,"unmuteRemote",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"unmuteRemote"),oZ.prototype),tx(oZ.prototype,"muteLocal",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"muteLocal"),oZ.prototype),tx(oZ.prototype,"unmuteLocal",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"unmuteLocal"),oZ.prototype),tx(oZ.prototype,"reEstablish",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"reEstablish"),oZ.prototype),tx(oZ.prototype,"close",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"close"),oZ.prototype),tx(oZ.prototype,"updateEncoderConfig",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"updateEncoderConfig"),oZ.prototype),tx(oZ.prototype,"updateSendParameters",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"updateSendParameters"),oZ.prototype),tx(oZ.prototype,"replaceTrack",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"replaceTrack"),oZ.prototype),tx(oZ.prototype,"restartICE",[EZ],Object.getOwnPropertyDescriptor(oZ.prototype,"restartICE"),oZ.prototype),oZ);function EZ(e,t,i){const n=e[t];if("function"!=typeof n)throw new Error("Cannot use mutex on object property.");return i.value=async function(){const e=this.mutex,i=await e.lock("Locking from P2PConnection.".concat(t));try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return await n.apply(this,o)}finally{i()}},i}var lZ;const hZ="9";let pZ=Ww("RemoteSDP")(lZ=class{get localCapabilities(){return VG(this._localCapabilities)}get rtpCapabilities(){return VG(this._rtpCapabilities)}get candidates(){return VG(this._candidates)}get iceParameters(){return VG(this._iceParameters)}get dtlsParameters(){return VG(this._dtlsParameters)}constructor(e){tD(this,"sessionDesc",void 0),tD(this,"_localCapabilities",void 0),tD(this,"_rtpCapabilities",void 0),tD(this,"_candidates",void 0),tD(this,"_iceParameters",void 0),tD(this,"_dtlsParameters",void 0),tD(this,"setup",void 0),tD(this,"currentMidIndex",void 0),tD(this,"cname",void 0),e=VG(e);const{remoteIceParameters:t,remoteDtlsParameters:i,candidates:n,remoteRTPCapabilities:r,remoteSetup:o,localCapabilities:s,cname:a}=e,c=yz.exports.parse("v=0\no=- 0 0 IN IP4 127.0.0.1\ns=AgoraGateway\nt=0 0\na=group:BUNDLE 0 1\na=msid-semantic: WMS\na=ice-lite\nm=video 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendonly\na=rtcp-mux\na=rtcp-rsize\na=mid:0\nm=audio 9 UDP/TLS/RTP/SAVPF 0\nc=IN IP4 127.0.0.1\na=rtcp:9 IN IP4 0.0.0.0\na=sendonly\na=rtcp-mux\na=rtcp-rsize\na=mid:1\n");this._rtpCapabilities=r,this._candidates=n,this._iceParameters=t,this._dtlsParameters=i,this._localCapabilities=s,this.setup=o,this.cname=a;const A=this.rtpCapabilities.send;for(const e of c.mediaDescriptions){if(e.attributes.iceUfrag=t.iceUfrag,e.attributes.icePwd=t.icePwd,e.attributes.fingerprints=i.fingerprints,e.attributes.candidates=n,e.attributes.setup=o,"video"===e.media.mediaType&&(e.media.fmts=A.videoCodecs.map((e=>e.payloadType.toString(10))),e.attributes.payloads=A.videoCodecs,e.attributes.extmaps=A.videoExtensions,cb("PRELOAD_MEDIA_COUNT")>0)){const{ssrcs:t,ssrcGroups:i}=kz([{ssrcId:4e4,rtx:cb("USE_RTX")?40001:void 0}],this.cname);e.attributes.ssrcs=t,e.attributes.ssrcGroups=i}if("audio"===e.media.mediaType&&(e.media.fmts=A.audioCodecs.map((e=>e.payloadType.toString(10))),e.attributes.payloads=A.audioCodecs,e.attributes.extmaps=A.audioExtensions,cb("PRELOAD_MEDIA_COUNT")>0)){const{ssrcs:t,ssrcGroups:i}=kz([{ssrcId:2e4}],this.cname);e.attributes.ssrcs=t,e.attributes.ssrcGroups=i}}this.sessionDesc=c,this.currentMidIndex=c.mediaDescriptions.length-1}preloadRemoteMedia(){const e=cb("PRELOAD_MEDIA_COUNT");Yw("debug",this,"preloadRemoteMedia",e),this.rtpCapabilities;const t=this.candidates,i=this.dtlsParameters,n=this.iceParameters,r=this.rtpCapabilities.send;for(let o=1;o<e;o++){const e=2*o+2e4,s=2*o+4e4,{ssrcs:a,ssrcGroups:c}=kz([{ssrcId:e}],this.cname),{ssrcs:A,ssrcGroups:d}=kz([{ssrcId:s,rtx:cb("USE_RTX")?s+1:void 0}],this.cname);this.sessionDesc.mediaDescriptions.push({media:{mediaType:"video",port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:r.videoCodecs.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:n.iceUfrag,icePwd:n.icePwd,unrecognized:[],candidates:t,extmaps:r.videoExtensions,fingerprints:i.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:A,ssrcGroups:d,rtcpFeedbackWildcards:[],payloads:r.videoCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*o)}}),this.sessionDesc.mediaDescriptions.push({media:{mediaType:"audio",port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:r.audioCodecs.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:n.iceUfrag,icePwd:n.icePwd,unrecognized:[],candidates:t,extmaps:r.audioExtensions,fingerprints:i.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:a,ssrcGroups:c,rtcpFeedbackWildcards:[],payloads:r.audioCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*o+1)}}),this.currentMidIndex+=2}this.updateBundleMids()}toString(){return yz.exports.print(this.sessionDesc)}send(e,t,i,n){const{ssrcs:r,ssrcGroups:o}=kz(t,this.cname,i),s=this.findPreloadMediaDesc(r);if(s){if(n&&(n.tcc||n.remb)){const e=this.sessionDesc.mediaDescriptions.indexOf(s);return this.sessionDesc.mediaDescriptions[e]=this.mungSendMediaDesc(s,n),{mid:s.attributes.mid,needExchangeSDP:!0}}return{mid:s.attributes.mid,needExchangeSDP:!1}}{const t=this.findAvailableMediaIndex(e);if(Uy()){if(-1!==t&&1!==t){const e=VG(this.sessionDesc.mediaDescriptions[t]);return e.attributes.direction="sendonly",e.attributes.ssrcs=r,e.attributes.ssrcGroups=o,this.sessionDesc.mediaDescriptions[t]=this.mungSendMediaDesc(e,n),{mid:e.attributes.mid,needExchangeSDP:!0}}{const t=this.createOrRecycleSendMedia(e,r,o,"sendonly",n);return this.updateBundleMids(),{mid:t.attributes.mid,needExchangeSDP:!0}}}if(-1!==t){const e=VG(this.sessionDesc.mediaDescriptions[t]);return e.attributes.direction="sendonly",e.attributes.ssrcs=r,e.attributes.ssrcGroups=o,this.sessionDesc.mediaDescriptions[t]=this.mungSendMediaDesc(e,n),{mid:e.attributes.mid,needExchangeSDP:!0}}{const t=this.createOrRecycleSendMedia(e,r,o,"sendonly",n);return this.updateBundleMids(),{mid:t.attributes.mid,needExchangeSDP:!0}}}}batchSend(e){const t=e.map((e=>{let{kind:t,ssrcMsg:i,mslabel:n}=e;return this.send(t,i,n)})),i=[];let n=!1;return t.forEach((e=>{let{mid:t,needExchangeSDP:r}=e;r&&(n=!0),i.push(t)})),{mids:i,needExchangeSDP:n}}stopSending(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>t.attributes.mid&&-1!==e.indexOf(t.attributes.mid)));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");t.forEach((e=>{"0"===e.attributes.mid||By()||Uy()?e.attributes.ssrcs=[]:(e.attributes.ssrcs=[],e.attributes.direction="inactive",e.media.port="0")})),this.updateBundleMids()}mute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.mute."));t.attributes.direction="inactive"}unmute(e){const t=this.sessionDesc.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.unmute."));t.attributes.direction="sendonly"}muteRemote(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>e.includes(t.attributes.mid||"")));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");t.forEach((e=>{e.attributes.direction="inactive"}))}unmuteRemote(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>e.includes(t.attributes.mid||"")));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");t.forEach((e=>{e.attributes.direction="recvonly"}))}receive(e,t,i,n){e.forEach(((e,r)=>{this.createOrRecycleRecvMedia(e,[],"recvonly",t,i,n[r])})),this.updateBundleMids()}stopReceiving(e){const t=this.sessionDesc.mediaDescriptions.filter((t=>-1!==e.indexOf(t.attributes.mid)));if(t.length!==e.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");t.forEach((e=>{e.media.port="0",e.attributes.direction="inactive"})),this.updateBundleMids()}restartICE(e,t){e=VG(e),t=VG(t),this._iceParameters=e,this._candidates=t,this.sessionDesc.mediaDescriptions.forEach((t=>{t.attributes.iceUfrag=e.iceUfrag,t.attributes.icePwd=e.icePwd,t.attributes.candidates=this.candidates}))}predictReceivingMids(e){const t=[];for(let i=0;i<e;i++)t.push((this.currentMidIndex+i+1).toString(10));return t}findAvailableMediaIndex(e){return this.sessionDesc.mediaDescriptions.findIndex((t=>t.media.mediaType===e&&"0"!==t.media.port&&("sendonly"===t.attributes.direction||"sendrecv"===t.attributes.direction)&&0===t.attributes.ssrcs.length))}createOrRecycleRecvMedia(e,t,i,n,r,o){const s=e._mediaStreamTrack.kind,a=this.rtpCapabilities.recv,c=this.localCapabilities.send;let A=[];if(s===QP.VIDEO){var d,u;if(cb("H264_PROFILE_LEVEL_ID")&&"h264"===n&&(A=a.videoCodecs.filter((e=>{var t,i;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes(n)&&(null==e||null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"])===cb("H264_PROFILE_LEVEL_ID")}))),!A||0===(null===(d=A)||void 0===d?void 0:d.length)){const e=c.videoCodecs.filter((e=>{var t;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes(n)}));0!==e.length&&(A=a.videoCodecs.filter((t=>e.some((e=>e.payloadType===t.payloadType)))))}if(cb("USE_RTX")){const e=A.map((e=>e.payloadType.toString())),t=a.videoCodecs.filter((t=>{var i,n;return"rtx"===(null===(i=t.rtpMap)||void 0===i?void 0:i.encodingName)&&e.includes((null===(n=t.fmtp)||void 0===n?void 0:n.parameters.apt)||"")}));A=[...A,...t]}0===A.length&&(mw.warning("codec ".concat(n," not included in rtpCapabilities, fallback to default payloads: ").concat(null===(u=a.videoCodecs[0].rtpMap)||void 0===u?void 0:u.encodingName)),A=a.videoCodecs)}else A=a.audioCodecs.filter((e=>{var t;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes(r)})),0===A.length&&(mw.warning("codec ".concat(r," not included in rtpCapabilities, fallback to opus")),A=a.audioCodecs.filter((e=>{var t;return((null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLowerCase())||"").includes("opus")})));const E=s===QP.VIDEO?a.videoExtensions:a.audioExtensions;this.currentMidIndex+=1;const l="".concat(this.currentMidIndex);let h={media:{mediaType:s,port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:A.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:E,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:t,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:A,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:i,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(l)}};h=this.mungRecvMediaDsec(h,e,o);const p=this.findFirstClosedMedia(s);if(p){const e=this.sessionDesc.mediaDescriptions.indexOf(p);this.sessionDesc.mediaDescriptions[e]=h}else this.sessionDesc.mediaDescriptions.push(h);return h}createOrRecycleSendMedia(e,t,i,n,r){const o=this.rtpCapabilities.send,s=e===QP.VIDEO?o.videoCodecs:o.audioCodecs,a=e===QP.VIDEO?o.videoExtensions:o.audioExtensions;this.currentMidIndex+=1;const c="".concat(this.currentMidIndex);let A={media:{mediaType:e,port:hZ,protos:["UDP","TLS","RTP","SAVPF"],fmts:s.map((e=>e.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:a,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:t,ssrcGroups:i,rtcpFeedbackWildcards:[],payloads:s,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:n,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(c)}};A=this.mungSendMediaDesc(A,r);const d=this.findFirstClosedMedia(e);if(d){const e=this.sessionDesc.mediaDescriptions.indexOf(d);this.sessionDesc.mediaDescriptions[e]=A}else this.sessionDesc.mediaDescriptions.push(A);return A}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter((e=>"0"!==e.media.port)).map((e=>e.attributes.mid))}mungRecvMediaDsec(e,t,i){const n=VG(e);return Uz(n),Mz(n,t),Bz(n,t),function(e){if("video"!==e.media.mediaType)return;const t=Dy();if(t.name!==Oy.SAFARI&&t.os!==Sy.IOS)return;const i=e.attributes.extmaps.findIndex((e=>/video-orientation/g.test(e.extensionName)));-1!==i&&e.attributes.extmaps.splice(i,1)}(n),Vz(n,i,this.localCapabilities.send),n}mungSendMediaDesc(e,t){const i=VG(e);return Vz(i,t,this.localCapabilities.recv),i}updateRecvMedia(e,t){const i=this.sessionDesc.mediaDescriptions.findIndex((t=>t.attributes.mid===e));if(-1!==i){const e=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[i],t);this.sessionDesc.mediaDescriptions[i]=e}}bumpMid(e){this.currentMidIndex+=e}findFirstClosedMedia(e){return this.sessionDesc.mediaDescriptions.find((t=>By()?"0"===t.media.port&&t.media.mediaType===e:"0"===t.media.port))}findPreloadMediaDesc(e){return this.sessionDesc.mediaDescriptions.find((t=>{var i,n;return(null===(i=t.attributes)||void 0===i||null===(n=i.ssrcs[0])||void 0===n?void 0:n.ssrcId)===e[0].ssrcId}))}})||lZ;var _Z,IZ;function gZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let RZ=Ww("P2PConnection","store.p2pId")((tx((IZ=class e extends HP{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}constructor(t,i){super(t,i),tD(this,"store",void 0),tD(this,"peerConnection",void 0),tD(this,"remoteSDP",void 0),tD(this,"initialOffer",void 0),tD(this,"transportEventReceiver",void 0),tD(this,"statsFilter",void 0),tD(this,"useRTX",cb("USE_RTX")),tD(this,"localCapabilities",void 0),tD(this,"localCandidateCount",0),tD(this,"allCandidatesReceived",!1),tD(this,"mutex",new Qx("P2PConnection-mutex")),this.store=i,this.peerConnection=new RTCPeerConnection(e.resolvePCConfiguration(t),{optional:[{googDscp:!0}]}),this.statsFilter=cZ(this.peerConnection,void 0,void 0,By()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1}async establish(){try{this.peerConnection.addTransceiver("video",{direction:"recvonly"}),this.peerConnection.addTransceiver("audio",{direction:"recvonly"});const e=await this.peerConnection.createOffer();if(!e.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");const t=Lz(e.sdp),i=await async function(e,t,i,n){const r=new RTCPeerConnection;r.addTransceiver("video",{direction:"sendonly"}),r.addTransceiver("audio",{direction:"sendonly"}),r.addTransceiver("video",{direction:"recvonly"}),r.addTransceiver("audio",{direction:"recvonly"});const o=(await r.createOffer()).sdp,s=bz(o,e,false,i,n,"sendonly"),a=bz(o,e,false,i,n,"recvonly"),c={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},A={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},d={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(Qz(s,a,"videoExtensions",c,A,d),Qz(s,a,"videoCodecs",c,A,d),Qz(s,a,"audioExtensions",c,A,d),Qz(s,a,"audioCodecs",c,A,d),cb("RAISE_H264_BASELINE_PRIORITY")){const e=d.videoCodecs.findIndex((e=>{var t,i;return"h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())&&"42001f"===(null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"])}));if(-1!==e){const t=d.videoCodecs.findIndex((e=>{var t;return"h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())}));if(t<e){mw.debug("raising H264 baseline profile priority");const i=d.videoCodecs[e];d.videoCodecs.splice(e,1),d.videoCodecs.splice(t,0,i)}-1!==t&&(A.videoCodecs=A.videoCodecs.filter((e=>{var t,i;return!("h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())&&"42001f"!==(null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"]))}))),-1!==t&&cb("FILTER_SEND_H264_BASELINE")&&(c.videoCodecs=c.videoCodecs.filter((e=>{var t,i;return!("h264"===(null===(t=e.rtpMap)||void 0===t?void 0:t.encodingName.toLocaleLowerCase())&&"42001f"!==(null===(i=e.fmtp)||void 0===i?void 0:i.parameters["profile-level-id"]))})))}}try{r.close()}catch(e){}return{send:c,recv:A,sendrecv:d}}(!this.useRTX);return this.localCapabilities=xz(i),this.initialOffer=e,fZ(fZ({},t),{},{rtpCapabilities:i,offerSDP:e.sdp})}catch(e){throw new pw(hw.GET_LOCAL_CONNECTION_PARAMS_FAILED,e.toString())}}async connect(e,t,i,n,r,o){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new pZ({remoteIceParameters:e,remoteDtlsParameters:t,candidates:i,remoteRTPCapabilities:n,remoteSetup:r,localCapabilities:this.localCapabilities,cname:o});const s=this.remoteSDP.toString(),a=this.logSDPExchange(this.initialOffer.sdp||"","offer","local","connect");await this.peerConnection.setLocalDescription(this.initialOffer),null==a||a(s),await this.peerConnection.setRemoteDescription({type:"answer",sdp:s});const c=this.peerConnection.getTransceivers()[0];if(null!=c&&c.receiver&&this.tryBindTransportEvents(c.receiver),cb("PRELOAD_MEDIA_COUNT")>0){this.remoteSDP.preloadRemoteMedia();const e=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:e});const t=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(t)}}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(e.toString()))}}send(e,t,i){var n=this;return nz((function*(){const r=yield rz(n.mutex.lock());try{if(!n.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");const o=[];e.forEach((e=>{const t=n.peerConnection.addTransceiver(e._mediaStreamTrack,{direction:"sendonly"});o.push(t)})),By()&&!0===cb("SIMULCAST")&&(xw("debug",n,"apply simulcast for firefox"),yield rz(n.applySimulcastForFirefox(o,e)));const s=yield rz(n.peerConnection.createOffer()),a=n.remoteSDP.predictReceivingMids(e.length),c=n.mungSendOfferSDP(s.sdp,e,a),A=yz.exports.parse(c),d=a.map((e=>{const t=A.mediaDescriptions.find((t=>t.attributes.mid===e));if(!t)throw new Error("Cannot extract ssrc from mediaDescription.");return function(e,t){const i=[],n=e.attributes.ssrcGroups.filter((e=>"FID"===e.semantic)),r=e.attributes.ssrcGroups.find((e=>"SIM"===e.semantic)),o=e.attributes.ssrcs;if(r)r.ssrcIds.forEach((e=>{var r;const o=null===(r=n.find((t=>t.ssrcIds[0]===e)))||void 0===r?void 0:r.ssrcIds[1];i.push({ssrcId:e,rtx:t?o:void 0})}));else if(n.length>0){const e=n[0].ssrcIds[0],r=n[0].ssrcIds[1];i.push({ssrcId:e,rtx:t?r:void 0})}else{if(0===o.length)throw new Error("No ssrcs found on local media description.");i.push({ssrcId:o[0].ssrcId})}return i}(t,n.useRTX)}));let u;try{u=yield d}catch(r){u=[],n.remoteSDP.receive(e,t,i,u);const o=n.remoteSDP.toString();throw yield rz(n.peerConnection.setLocalDescription({type:"offer",sdp:c})),yield rz(n.peerConnection.setRemoteDescription({type:"answer",sdp:o})),yield rz(n.stopSending(a,!0)),r}n.remoteSDP.receive(e,t,i,u);const E=n.remoteSDP.toString(),l=n.logSDPExchange(c,"offer","local","send");return yield rz(n.peerConnection.setLocalDescription({type:"offer",sdp:c})),yield rz(n.applySimulcastEncodings(o,e)),yield rz(n.applySendEncodings(o,e)),null==l||l(E),yield rz(n.peerConnection.setRemoteDescription({type:"answer",sdp:E})),o.map(((e,t)=>{const i=a[t];return{localSSRC:d[t],id:i,transceiver:e}}))}catch(e){throw e instanceof pw?e:new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(e.toString()))}finally{r()}}))()}async stopSending(e,t){const i=t?void 0:await this.mutex.lock("From P2PConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");const t=this.peerConnection.getTransceivers().filter((t=>-1!==e.indexOf(t.mid)));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");t.map((e=>{var t;e.direction="inactive",null===(t=e.stop)||void 0===t||t.call(e)}));const n=await this.peerConnection.createOffer(),r=this.logSDPExchange(n.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(n),this.remoteSDP.stopReceiving(e);const o=this.remoteSDP.toString();null==r||r(o),await this.peerConnection.setRemoteDescription({type:"answer",sdp:o})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(e.toString()))}finally{i&&i()}}async receive(e,t,i,n){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(e," before remoteSDP created."));const{mid:r,needExchangeSDP:o}=this.remoteSDP.send(e,t,i,n);if(o){const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n),mw.debug("[P2PConnection] receive ".concat(e," by exchanging SDP."))}else mw.debug("[P2PConnection] receive ".concat(e," no need to exchange SDP."));const s=this.peerConnection.getTransceivers().find((e=>e.mid===r));if(!s)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:s.receiver.track,id:r}}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}async batchReceive(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");const{mids:t,needExchangeSDP:i}=this.remoteSDP.batchSend(e);if(i){const e=this.remoteSDP.toString(),t=this.logSDPExchange(e,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:e});const i=await this.peerConnection.createAnswer();null==t||t(i.sdp||""),await this.peerConnection.setLocalDescription(i),mw.debug("[P2PConnection] batchReceive by exchanging SDP.")}else mw.debug("[P2PConnection] batchReceive no need to exchange SDP.");return t.map((e=>{const t=this.peerConnection.getTransceivers().find((t=>t.mid===e));if(!t)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:t.receiver.track,id:e}}))}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(e.toString()))}}async stopReceiving(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(e);const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","stopReceiving");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(e.toString()))}}async muteRemote(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteRemote mid=".concat(e," before remote SDP created."));this.remoteSDP.mute(e);const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","muteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.muteRemote failed; ".concat(e.toString()))}}async unmuteRemote(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteRemote mid=".concat(e," before remote SDP created."));this.remoteSDP.unmute(e);const t=this.remoteSDP.toString(),i=this.logSDPExchange(t,"offer","remote","unmuteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:t});const n=await this.peerConnection.createAnswer();null==i||i(n.sdp||""),await this.peerConnection.setLocalDescription(n)}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteRemote failed; ".concat(e.toString()))}}async muteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");const t=this.peerConnection.getTransceivers().filter((t=>t.mid&&-1!==e.indexOf(t.mid)));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length.");t.map((e=>{e.direction="inactive"}));const i=await this.peerConnection.createOffer(),n=this.logSDPExchange(i.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(i),this.remoteSDP.muteRemote(e);const r=this.remoteSDP.toString();null==n||n(r),await this.peerConnection.setRemoteDescription({type:"answer",sdp:r})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(e.toString()))}}async unmuteLocal(e){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");const t=this.peerConnection.getTransceivers().filter((t=>t.mid&&-1!==e.indexOf(t.mid)));if(t.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length.");t.map((async(e,t)=>{e.direction="sendonly"}));const i=await this.peerConnection.createOffer(),n=this.logSDPExchange(i.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(i),this.remoteSDP.unmuteRemote(e);const r=this.remoteSDP.toString();null==n||n(r),await this.peerConnection.setRemoteDescription({type:"answer",sdp:r})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(e.toString()))}}async reEstablish(){const e=await this.peerConnection.createOffer({iceRestart:!0});if(!e.sdp)throw new Error("Cannot get SDP from restart offer.");return{iceParameters:Lz(e.sdp).iceParameters,restartICE:async(t,i)=>this.restartICE(e,t,i),restartOfferSDP:e.sdp}}close(){var e;this.peerConnection.close(),null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,"closed"),this.tryUnbindTransportEvents(),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.transportEventReceiver=void 0,this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(e){return this.statsFilter.getVideoIsReady(e)}async updateEncoderConfig(e,t){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");const i=await this.peerConnection.createOffer(),n=this.mungSendOfferSDP(i.sdp,[t],[e]);this.remoteSDP.updateRecvMedia(e,t);const r=this.remoteSDP.toString(),o=this.logSDPExchange(n,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:n}),null==o||o(r),await this.peerConnection.setRemoteDescription({type:"answer",sdp:r})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,e.toString())}}async updateSendParameters(e,t){const i=this.peerConnection.getTransceivers().filter((t=>t.mid===e));1===i.length&&(this.isVP8Simulcast(t)?By()||await this.applySimulcastEncodings(i,[t]):await this.applySendEncodings(i,[t]))}setStatsRemoteVideoIsReady(e,t){this.statsFilter.setVideoIsReady2(e,t)}async replaceTrack(e,t){const i=this.peerConnection.getTransceivers().find((e=>e.mid===t));i&&await i.sender.replaceTrack(e._mediaStreamTrack)}async restartICE(e,t,i){try{if(!this.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");this.remoteSDP.restartICE(t,i);const n=this.remoteSDP.toString(),r=this.logSDPExchange(e.sdp||"","offer","local","restartICE");await this.peerConnection.setLocalDescription(e),null==r||r(n),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(e){throw new pw(hw.EXCHANGE_SDP_FAILED,"P2PConnection.restartICE failed; ".concat(e.toString()))}}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var e;null===(e=this.onICEConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var e;null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=e=>{e.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout((()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,mw.debug("[pc-".concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))}),cb("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(t){const i={iceServers:[]};return t.iceServers?i.iceServers=t.iceServers:t.turnServer&&"off"!==t.turnServer.mode&&(ZL(t.turnServer.servers)?i.iceServers=t.turnServer.servers:(i.iceServers&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.servers)),cb("USE_TURN_SERVER_OF_GATEWAY")&&i.iceServers&&t.turnServer.serversFromGateway&&i.iceServers.push(...e.turnServerConfigToIceServers(t.turnServer.serversFromGateway)),t.turnServer.servers.concat(t.turnServer.serversFromGateway||[]).forEach((e=>{e.forceturn&&(i.iceTransportPolicy="relay")})))),i}static turnServerConfigToIceServers(e){const t=[];return e.forEach((e=>{e.security?e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turns:".concat(uG(e.turnServerURL),":").concat(e.tcpport,"?transport=tcp")}):(e.udpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.udpport,"?transport=udp")}),e.tcpport&&t.push({username:e.username,credential:e.password,credentialType:"password",urls:"turn:".concat(e.turnServerURL,":").concat(e.tcpport,"?transport=tcp")}))})),t}tryBindTransportEvents(e){e.transport&&(this.transportEventReceiver=e,e.transport.onstatechange=()=>{var t,i;null!==(t=e.transport)&&void 0!==t&&t.state&&(null===(i=this.onDTLSTransportStateChange)||void 0===i||i.call(this,e.transport.state))},e.transport.onerror=e=>{var t;null===(t=this.onDTLSTransportError)||void 0===t||t.call(this,e.error)},e.transport.iceTransport&&(e.transport.iceTransport.onstatechange=()=>{var t,i,n;null!==(t=e.transport)&&void 0!==t&&t.iceTransport.state&&(null===(i=this.onICETransportStateChange)||void 0===i||i.call(this,null===(n=e.transport)||void 0===n?void 0:n.iceTransport.state))}))}tryUnbindTransportEvents(){this.transportEventReceiver&&this.transportEventReceiver.transport&&(this.transportEventReceiver.transport.onstatechange=null,this.transportEventReceiver.transport.onerror=null,this.transportEventReceiver.transport.iceTransport&&(this.transportEventReceiver.transport.iceTransport.onstatechange=null))}async applySendEncodings(e,t){try{if(!XP().supportSetRtpSenderParameters)return;if(e.length!==t.length)return;for(let c=0;c<e.length;c++){const A=e[c],d=t[c];if(d&&d instanceof WJ){var i,n;if(this.isVP8Simulcast(d))continue;const e={},t={};switch(d._optimizationMode){case"motion":e.degradationPreference="maintain-framerate";break;case"detail":e.degradationPreference="maintain-resolution";break;default:e.degradationPreference="balanced"}var r,o,s,a;if(null!==(i=d._encoderConfig)&&void 0!==i&&i.bitrateMax&&(t.maxBitrate=1e3*(null===(r=d._encoderConfig)||void 0===r?void 0:r.bitrateMax)),d._hints.includes(vP.LOW_STREAM)&&(null!==(o=d._encoderConfig)&&void 0!==o&&o.frameRate&&(t.maxFramerate=lG(d._encoderConfig.frameRate)),null!==(s=d._encoderConfig)&&void 0!==s&&s.scaleResolutionDownBy&&(null===(a=d._encoderConfig)||void 0===a?void 0:a.scaleResolutionDownBy)>1&&(t.scaleResolutionDownBy=d._encoderConfig.scaleResolutionDownBy)),cb("DSCP_TYPE")&&Ky()){const e=cb("DSCP_TYPE");["very-low","low","medium","high"].includes(e)&&(t.networkPriority=e)}const c=A.sender.getParameters(),u=null===(n=c.encodings)||void 0===n?void 0:n[0];By()&&!u&&(e.encodings=[t]),u&&Object.assign(u,t),Object.assign(c,e),await A.sender.setParameters(c)}}}catch(e){mw.debug("Apply RTPSendEncodings failed.")}}mungSendOfferSDP(e,t,i){const n=yz.exports.parse(e);return t.forEach(((e,t)=>{const r=i[t],o=n.mediaDescriptions.find((e=>e.attributes.mid===r));o&&(Mz(o,e),function(e,t,i){if(By())return;if("video"!==e.media.mediaType)return;if(!(t instanceof WJ))return;if("vp9"!==i&&"vp8"!==i)return;if("vp8"===i&&!cb("SIMULCAST"))return;if(void 0===t._scalabiltyMode||t._scalabiltyMode.numSpatialLayers<=1)return;const n="vp8"===i?2:t._scalabiltyMode.numSpatialLayers,r=e.attributes.ssrcs[0],o=e.attributes.ssrcGroups.find((e=>"FID"===e.semantic&&e.ssrcIds[0]===r.ssrcId)),s={semantic:"SIM",ssrcIds:[r.ssrcId]};for(let t=1;t<n;t++)e.attributes.ssrcs.push({ssrcId:r.ssrcId+t,attributes:VG(r.attributes)}),s.ssrcIds.push(r.ssrcId+t),o&&(e.attributes.ssrcs.push({ssrcId:o.ssrcIds[1]+t,attributes:VG(r.attributes)}),e.attributes.ssrcGroups.push({semantic:"FID",ssrcIds:[r.ssrcId+t,o.ssrcIds[1]+t]}));e.attributes.ssrcGroups.unshift(s)}(o,e,this.store.codec))})),yz.exports.print(n)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=e=>{var t;null===(t=this.onFirstAudioReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoReceived=e=>{var t;null===(t=this.onFirstVideoReceived)||void 0===t||t.call(this,e)},this.statsFilter.onFirstAudioDecoded=e=>{var t;null===(t=this.onFirstAudioDecoded)||void 0===t||t.call(this,e)},this.statsFilter.onFirstVideoDecoded=(e,t,i)=>{var n;null===(n=this.onFirstVideoDecoded)||void 0===n||n.call(this,e,t,i)},this.statsFilter.onSelectedLocalCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedLocalCandidateChanged)||void 0===i||i.call(this,e,t)},this.statsFilter.onSelectedRemoteCandidateChanged=(e,t)=>{var i;null===(i=this.onSelectedRemoteCandidateChanged)||void 0===i||i.call(this,e,t)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0}async applySimulcastForFirefox(e,t){if(e.length===t.length)for(let s=0;s<e.length;s++){var i,n,r,o;const a=e[s],c=t[s];if(c instanceof WJ&&!c._hints.includes(vP.LOW_STREAM)&&null!==(i=c._encoderConfig)&&void 0!==i&&i.bitrateMax&&(null===(n=c._encoderConfig)||void 0===n?void 0:n.bitrateMax)>200&&null!==(r=c._scalabiltyMode)&&void 0!==r&&r.numSpatialLayers&&(null===(o=c._scalabiltyMode)||void 0===o?void 0:o.numSpatialLayers)>1&&"vp8"===this.store.codec){const e={},t={high:1e3*(c._encoderConfig.bitrateMax-50),medium:5e4};e.encodings=[{rid:"m",active:!0,maxBitrate:t.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:t.high}];const i=a.sender.getParameters();await a.sender.setParameters(Object.assign(i,e))}}}async applySimulcastEncodings(e,t){if(!By()&&e.length===t.length)for(let i=0;i<e.length;i++){const n=t[i];if(n instanceof WJ&&this.isVP8Simulcast(n)){const t=e[i],r={},o={high:1e3*(n._encoderConfig.bitrateMax-50),medium:5e4};r.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:o.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:o.medium,scaleResolutionDownBy:4}];const s=t.sender.getParameters();await t.sender.setParameters(Object.assign(s,r))}}}isVP8Simulcast(e){var t,i,n,r;return!!(e instanceof WJ&&cb("SIMULCAST")&&"vp8"===this.store.codec&&!e._hints.includes(vP.LOW_STREAM)&&null!==(t=e._encoderConfig)&&void 0!==t&&t.bitrateMax&&(null===(i=e._encoderConfig)||void 0===i?void 0:i.bitrateMax)>200&&null!==(n=e._scalabiltyMode)&&void 0!==n&&n.numSpatialLayers&&(null===(r=e._scalabiltyMode)||void 0===r?void 0:r.numSpatialLayers)>1)}logSDPExchange(e,t,i,n){if(cb("SDP_LOGGING"))return mw.upload("exchanging ".concat(i," ").concat(t," SDP during P2PConnection.").concat(n,"\n"),e),"offer"===t?e=>{this.logSDPExchange(e,"answer","local"===i?"remote":"local",n)}:void 0}}).prototype,"connect",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"connect"),IZ.prototype),tx(IZ.prototype,"receive",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"receive"),IZ.prototype),tx(IZ.prototype,"batchReceive",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"batchReceive"),IZ.prototype),tx(IZ.prototype,"stopReceiving",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"stopReceiving"),IZ.prototype),tx(IZ.prototype,"muteRemote",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"muteRemote"),IZ.prototype),tx(IZ.prototype,"unmuteRemote",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"unmuteRemote"),IZ.prototype),tx(IZ.prototype,"muteLocal",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"muteLocal"),IZ.prototype),tx(IZ.prototype,"unmuteLocal",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"unmuteLocal"),IZ.prototype),tx(IZ.prototype,"reEstablish",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"reEstablish"),IZ.prototype),tx(IZ.prototype,"close",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"close"),IZ.prototype),tx(IZ.prototype,"updateEncoderConfig",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"updateEncoderConfig"),IZ.prototype),tx(IZ.prototype,"updateSendParameters",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"updateSendParameters"),IZ.prototype),tx(IZ.prototype,"replaceTrack",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"replaceTrack"),IZ.prototype),tx(IZ.prototype,"restartICE",[CZ],Object.getOwnPropertyDescriptor(IZ.prototype,"restartICE"),IZ.prototype),_Z=IZ))||_Z;function CZ(e,t,i){const n=e[t];if("function"!=typeof n)throw new Error("Cannot use mutex on object property.");return i.value=async function(){const e=this.mutex,i=await e.lock("From P2PConnection.".concat(t));try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return await n.apply(this,o)}finally{i()}},i}var TZ,mZ;function SZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function OZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?SZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):SZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class vZ extends kx{getUserId(){return this._userId}constructor(e,t,i,n){super(e,"track-".concat(e.kind,"-").concat(t,"-").concat(n.clientId,"_").concat(vG(5,""))),tD(this,"_userId",void 0),tD(this,"_uintId",void 0),tD(this,"_isDestroyed",!1),tD(this,"store",void 0),this._userId=t,this._uintId=i,this.store=n}_updateOriginMediaStreamTrack(e){this._originMediaStreamTrack=e,this._mediaStreamTrack=e,this._updatePlayerSource()}_destroy(){this._isDestroyed=!0,mw.info("[".concat(this.getTrackId(),"] is destroyed")),Yw("info",this,"_destroy"),this.stop(),super.close()}}let NZ=Ww("RemoteVideoTrack","getTrackId")(TZ=class extends vZ{get isPlaying(){return!(!this._player||this._player.videoElementStatus!==mL.PLAYING)}constructor(e,t,i,n){super(e,t,i,n),tD(this,"_videoVisibleTimer",null),tD(this,"_previousVideoVisibleStatus",void 0),tD(this,"_clearPreviousVideoVisibleStatus",(()=>this._previousVideoVisibleStatus=void 0)),tD(this,"trackMediaType","video"),tD(this,"_videoWidth",void 0),tD(this,"_videoHeight",void 0),tD(this,"_player",void 0),Yw("info",this,"constructor",{userId:t}),this.updateMediaStreamTrackResolution()}getStats(){return xG((()=>{mw.warning("[deprecated] RemoteVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteVideoStats instead"),xw("warning",this,"[deprecated] RemoteVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteVideoStats instead")}),"remoteVideoTrackGetStatsWarning"),PG(this,OP.GET_STATS)||OZ({},oP)}play(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_VIDEO_TRACK_PLAY,options:[this.getTrackId(),"string"==typeof e?e:"HTMLElement",t]});if("string"==typeof e){const t=document.getElementById(e);t?e=t:(mw.warning("[".concat(this.getTrackId(),'] can not find "#').concat(e,'" element, use document.body')),xw("warning",this,'can not find "#'.concat(e,'" element, use document.body')),e=document.body)}mw.debug("[".concat(this.getTrackId(),"] start video playback"),JSON.stringify(t)),Yw("debug",this,"play",t);const n=OZ(OZ({fit:"cover"},t),{},{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(n):(this._player=new KW(n),this._player.updateVideoTrack(this._mediaStreamTrack),this._player.onFirstVideoFrameDecoded=()=>{this.store.subscribe(this.getUserId(),"video",void 0,void 0,performance.now()),this.emit(wP.FIRST_FRAME_DECODED)}),this._player.play(this.store.sessionId||void 0),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval((()=>{try{const e=this.getVideoElementVisibleStatus();this.emit(wP.VIDEO_ELEMENT_VISIBLE_STATUS,e)}catch(e){}}),cb("CHECK_VIDEO_VISIBLE_INTERVAL")),i.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_VIDEO_TRACK_STOP,options:[this.getTrackId()]});if(!this._player)return e.onSuccess();this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,mw.debug("[".concat(this.getTrackId(),"] stop video playback")),Yw("debug",this,"stop"),e.onSuccess()}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}updateMediaStreamTrackResolution(){DG(this._originMediaStreamTrack).then((e=>{let[t,i]=e;this._videoHeight=i,this._videoWidth=t})).catch(yG)}_updatePlayerSource(){mw.debug("[".concat(this.getTrackId(),"] update player source track")),Yw("debug",this,"_updatePlayerSource"),this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}getVideoElementVisibleStatus(){try{var e,t;const i=null==this||null===(e=this._player)||void 0===e?void 0:e.getContainerElement(),n={track:this,element:null==this||null===(t=this._player)||void 0===t?void 0:t.getVideoElement(),slot:null==i?void 0:i.parentElement},{element:r,slot:o}=n;if(this.isPlaying&&r instanceof HTMLVideoElement&&o instanceof HTMLElement){const e=YJ.checkOneElementVisible(r),t=Object.assign({},e);if(t.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=t.visible;const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});t.visible?e.onSuccess("Video is visible"):e.onSuccess("Invisible because of ".concat(t.reason))}return t}return}catch(e){throw new pw(hw.GET_VIDEO_ELEMENT_VISIBLE_ERROR,e.message)}}})||TZ,yZ=Ww("RemoteAudioTrack","getTrackId")(mZ=class extends vZ{get isPlaying(){return this._useAudioElement?_F.isPlaying(this.getTrackId()):this._source.isPlayed}constructor(e,t,i,n){super(e,t,i,n),tD(this,"trackMediaType","audio"),tD(this,"_source",void 0),tD(this,"_useAudioElement",!0),tD(this,"_volume",100),Yw("info",this,"constructor",{userId:t}),cb("REMOTE_AUDIO_TRACK_USES_WEB_AUDIO")&&(this._useAudioElement=!1),this._source=new eF(e,!0),this._source.once(qL.RECEIVE_TRACK_BUFFER,(()=>{this.emit(wP.FIRST_FRAME_DECODED)}))}setAudioFrameCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4096;if(!e)return this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(t),this._source.removeAllListeners(qL.ON_AUDIO_BUFFER),this._source.on(qL.ON_AUDIO_BUFFER,(t=>e(t)))}setVolume(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_SET_VOLUME,options:[this.getTrackId(),e]},300);this._volume=e,this._useAudioElement?_F.setVolume(this.getTrackId(),e):this._source.setVolume(e/100),t.onSuccess()}async setPlaybackDevice(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_SET_OUTPUT_DEVICE,options:[this.getTrackId(),e]});if(!this._useAudioElement)throw new pw(hw.NOT_SUPPORTED,"your browser does not support setting the audio output device");try{await _F.setSinkID(this.getTrackId(),e)}catch(e){throw t.onError(e),e}t.onSuccess()}getVolumeLevel(){return this._source.getAccurateVolumeLevel()}getStats(){return xG((()=>{mw.warning("[deprecated] RemoteAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteAudioStats instead"),xw("warning",this,"[deprecated] RemoteAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteAudioStats instead")}),"remoteAudioTrackGetStatsWarning"),PG(this,OP.GET_STATS)||OZ({},nP)}play(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_TRACK_PLAY,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] start audio playback")),Yw("debug",this,"play"),this._useAudioElement?(mw.debug("[".concat(this.getTrackId(),"] use audio element to play")),xw("debug",this,"use audio element to play"),_F.play(this._mediaStreamTrack,this.getTrackId(),this._volume,this.store.sessionId||void 0)):this._source.play(),e.onSuccess()}stop(){const e=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.REMOTE_AUDIO_TRACK_STOP,options:[this.getTrackId()]});mw.debug("[".concat(this.getTrackId(),"] stop audio playback")),Yw("debug",this,"stop"),this._useAudioElement?_F.stop(this.getTrackId()):this._source.stop(),e.onSuccess()}_destroy(){super._destroy(),this._source.destroy()}_isFreeze(){return this._source.isFreeze}_updatePlayerSource(){mw.debug("[".concat(this.getTrackId(),"] update player source track")),Yw("debug",this,"_updatePlayerSource"),this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&_F.updateTrack(this.getTrackId(),this._mediaStreamTrack)}})||mZ;function DZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function wZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?DZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):DZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class bZ extends Ew{constructor(){super(),tD(this,"uplinkStatsUploadInterval",void 0),tD(this,"uplinkStatsUploadSlowInterval",void 0),tD(this,"uplinkRelatedStatsUploadInterval",void 0),tD(this,"uplinkDenoiserStatsUploadInterval",void 0),tD(this,"transportStatsUploadInterval",void 0),tD(this,"extensionStatsUploadInterval",void 0),tD(this,"downlinkStatsUploadInterval",void 0),tD(this,"downlinkStatsUploadSlowInterval",void 0),tD(this,"downlinkRelatedStatsUploadInterval",void 0),tD(this,"lastStats",void 0),tD(this,"uploadUnplinkStarted",!1),tD(this,"uploadDownlinkStarted",!1),tD(this,"uploadTransportStarted",!1),tD(this,"requestStats",void 0),tD(this,"requestLocalMedia",void 0),tD(this,"requestRemoteMedia",void 0),tD(this,"requestAllTracks",void 0),tD(this,"requestVideoIsReady",void 0),tD(this,"requestUpload",void 0)}startUploadTransportStats(){this.uploadTransportStarted||(this.uploadTransportStarted=!0,this.transportStatsUploadInterval&&window.clearInterval(this.transportStatsUploadInterval),this.transportStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadTransportStats(t)}),6e3))}startUploadUplinkStats(){this.uploadUnplinkStarted||(this.uploadUnplinkStarted=!0,this.uplinkStatsUploadInterval&&window.clearInterval(this.uplinkStatsUploadInterval),this.uplinkStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&(this.uploadUplinkStats(t,this.lastStats),this.lastStats=t)}),3e3),this.uplinkStatsUploadSlowInterval&&window.clearInterval(this.uplinkStatsUploadSlowInterval),this.uplinkStatsUploadSlowInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadSlowUplinkStats(t)}),6e4),this.uplinkRelatedStatsUploadInterval&&window.clearInterval(this.uplinkRelatedStatsUploadInterval),this.uplinkRelatedStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadRelatedUplinkStats(t,this.lastStats),this.lastStats=t}),1e3),this.uplinkDenoiserStatsUploadInterval&&window.clearInterval(this.uplinkDenoiserStatsUploadInterval),this.uplinkDenoiserStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestAllTracks)||void 0===e?void 0:e.call(this);t&&this.uploadDenoiserStats(t)}),2e3),this.extensionStatsUploadInterval&&window.clearInterval(this.extensionStatsUploadInterval),this.extensionStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestAllTracks)||void 0===e?void 0:e.call(this);t&&this.uploadExtensionStats(t)}),2e3))}uploadTransportStats(e){BG((()=>{var t;null===(t=this.requestUpload)||void 0===t||t.call(this,KL.TRANSPORT_STATS,function(e){const t={connectionType:100};if("relay"===e.selectedCandidatePair.localCandidate.candidateType){const i=e.selectedCandidatePair.localCandidate.relayProtocol;"udp"===i&&(t.connectionType=101),"tcp"===i&&(t.connectionType=103),"tls"===i&&(t.connectionType=104)}return t}(e))}))}uploadUplinkStats(e,t){var i;((null===(i=this.requestLocalMedia)||void 0===i?void 0:i.call(this))||[]).forEach((i=>{let[n,{track:r,ssrcs:o}]=i;switch(n){case xP.LocalVideoLowTrack:case xP.LocalVideoTrack:{const i=function(e,t,i){var n;const r=t.videoSend.find((t=>t.ssrc===e));if(!r)return null;const o={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"video",type:"ssrc",ssrc:r.ssrc.toString()};switch(o.A_vstd=i._originMediaStreamTrack&&!i._originMediaStreamTrack.enabled||!i._mediaStreamTrack.enabled?"1":"0",r.sentFrame&&(o.A_fhs=r.sentFrame.height.toString(),o.A_frs=r.sentFrame.frameRate.toString(),o.A_fws=r.sentFrame.width.toString()),r.adaptionChangeReason){case"none":o.A_ac="0";break;case"cpu":o.A_ac="1";break;case"bandwidth":o.A_ac="2";break;case"other":o.A_ac="3"}return o.A_lvps=SL[i._player?i._player.videoElementStatus:"uninit"].toString(),o.A_nr=null===(n=r.nacksCount)||void 0===n?void 0:n.toString(),r.avgEncodeMs&&(o.A_aem=r.avgEncodeMs.toFixed(0).toString()),o}(o[0].ssrcId,e,r),s=pG(o[0].ssrcId,e,t);i&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:n===xP.LocalVideoLowTrack?"low":"high",stats:wZ(wZ({},i),s)})}));break}case xP.LocalAudioTrack:{const t=function(e,t,i){const n=t.audioSend.find((t=>t.ssrc===e));if(!n)return null;const r={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"audio",type:"ssrc",ssrc:n.ssrc.toString()};return r.A_astd=i._originMediaStreamTrack.enabled&&i._mediaStreamTrack.enabled?"0":"1",n.inputLevel?r.A_ail=Math.round(100*n.inputLevel).toString():r.A_ail=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),r.A_apil=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),n.aecReturnLoss&&(r.A_ecrl=Math.round(n.aecReturnLoss).toString()),n.aecReturnLossEnhancement&&(r.A_ecrle=Math.round(n.aecReturnLossEnhancement).toString()),r}(o[0].ssrcId,e,r);t&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:"high",stats:t})}));break}}const s=function(e){const t={id:"bweforvideo",timestamp:new Date(e.timestamp).toISOString(),type:"VideoBwe"};return e.bitrate.retransmit&&(t.A_rb=e.bitrate.retransmit.toString()),e.bitrate.targetEncoded&&(t.A_teb=e.bitrate.targetEncoded.toString()),t.A_aeb=e.bitrate.actualEncoded.toString(),t.A_tb=e.bitrate.transmit.toString(),void 0!==e.sendBandwidth&&(t.A_asb=e.sendBandwidth.toString()),t}(e);s&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:n===xP.LocalVideoLowTrack?"low":"high",stats:s})}))}))}uploadSlowUplinkStats(e){var t;((null===(t=this.requestLocalMedia)||void 0===t?void 0:t.call(this))||[]).filter((e=>{let[t]=e;return t===xP.LocalVideoLowTrack||t===xP.LocalVideoTrack})).forEach((t=>{let[i,{ssrcs:n}]=t;const r=pG(n[0].ssrcId,e);r&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.PUBLISH_STATS,{stream_type:i===xP.LocalVideoLowTrack?"low":"high",stats:r})}))}))}uploadRelatedUplinkStats(e,t){var i;((null===(i=this.requestLocalMedia)||void 0===i?void 0:i.call(this))||[]).filter((e=>{let[t]=e;return t===xP.LocalVideoLowTrack||t===xP.LocalVideoTrack})).forEach((t=>{let[i,{ssrcs:n}]=t;const r=function(e,t){const i=t.videoSend.find((t=>t.ssrc===e));return i?{mediaType:"video",isVideoMute:!1,frameRateInput:i.inputFrame&&i.inputFrame.frameRate.toString(),frameRateSent:i.sentFrame&&i.sentFrame.frameRate.toString(),googRtt:i.rttMs.toString(),qpSumPerFrame:Math.floor(i.qpSumPerFrame).toString()}:null}(n[0].ssrcId,e);r&&BG((()=>{var e;null===(e=this.requestUpload)||void 0===e||e.call(this,KL.PUBLISH_RELATED_STATS,{stream_type:i===xP.LocalVideoLowTrack?"low":"high",stats:r})}))}))}uploadDenoiserStats(e){for(let r=0;r<e.length;r++){const o=e[r];if(o instanceof qF){var t,i,n;const e=null===(t=(i=o._external).getDenoiserStats)||void 0===t?void 0:t.call(i);return void(e&&(null===(n=this.requestUpload)||void 0===n||n.call(this,KL.DENOISER_STATS,e)))}}}uploadExtensionStats(e){for(let t=0;t<e.length;t++){const i=e[t];if(i instanceof qF)return void i.getProcessorStats().forEach((e=>{var t;e.type===KL.DENOISER_STATS&&(null===(t=this.requestUpload)||void 0===t||t.call(this,KL.DENOISER_STATS,e.stats))}))}}stopUploadUplinkStats(){this.uploadUnplinkStarted&&(this.uploadUnplinkStarted=!1,this.uplinkStatsUploadInterval&&window.clearInterval(this.uplinkStatsUploadInterval),this.uplinkRelatedStatsUploadInterval&&window.clearInterval(this.uplinkRelatedStatsUploadInterval),this.uplinkDenoiserStatsUploadInterval&&window.clearInterval(this.uplinkDenoiserStatsUploadInterval),this.uplinkStatsUploadInterval=void 0,this.uplinkRelatedStatsUploadInterval=void 0,this.uplinkDenoiserStatsUploadInterval=void 0)}startUploadDownlinkStats(){this.uploadDownlinkStarted||(this.uploadDownlinkStarted=!0,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval),this.downlinkStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&(this.uploadDownlinkStats(t,this.lastStats),this.lastStats=t)}),3e3),this.downlinkStatsUploadSlowInterval&&window.clearInterval(this.downlinkStatsUploadSlowInterval),this.downlinkStatsUploadSlowInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&this.uploadSlowDownlinkStats(t)}),6e4),this.downlinkRelatedStatsUploadInterval&&window.clearInterval(this.downlinkRelatedStatsUploadInterval),this.downlinkRelatedStatsUploadInterval=window.setInterval((()=>{var e;const t=null===(e=this.requestStats)||void 0===e?void 0:e.call(this);t&&(this.uploadRelatedDownlinkStats(t,this.lastStats),this.lastStats=t)}),1e3))}uploadDownlinkStats(e,t){var i;((null===(i=this.requestRemoteMedia)||void 0===i?void 0:i.call(this))||[]).forEach((t=>{let[i,n]=t;if(n.has(QP.VIDEO)&&i.videoTrack){const t=i.videoTrack?function(e,t,i){const n=t.videoRecv.find((t=>t.ssrc===e));if(!n)return null;const r={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"video",type:"ssrc",ssrc:n.ssrc.toString()};var o,s;return r.bytesReceived=n.bytes.toString(),r.packetsLost=n.packetsLost.toString(),r.packetsReceived=n.packets.toString(),n.framesRateFirefox&&(r.A_frr=n.framesRateFirefox.toString()),n.receivedFrame?(r.A_frr=n.receivedFrame.frameRate.toString(),r.A_fhr=n.receivedFrame.height.toString(),r.A_fwr=n.receivedFrame.width.toString()):(r.A_fhr=null===(o=i._videoHeight)||void 0===o?void 0:o.toString(),r.A_fwr=null===(s=i._videoWidth)||void 0===s?void 0:s.toString()),r.A_frd=n.decodeFrameRate.toString(),n.outputFrame&&(r.A_fro=n.outputFrame.frameRate.toString()),void 0!==n.jitterBufferMs&&(r.A_jbm=Math.floor(n.jitterBufferMs).toString()),void 0!==n.currentDelayMs&&(r.A_cdm=Math.floor(n.currentDelayMs).toString()),r.A_fs=n.firsCount.toString(),r.A_ns=n.nacksCount.toString(),r.A_ps=n.plisCount.toString(),i&&(r.A_vrtd=i._originMediaStreamTrack.enabled&&i._mediaStreamTrack.enabled?"0":"1"),i._player&&i._player.freezeTimeCounterList.length>0&&(r.A_vrft=i._player.freezeTimeCounterList.splice(0,1)[0].toString()),r.A_rvps=SL[i._player?i._player.videoElementStatus:"uninit"].toString(),r}(i._videoSSRC,e,i.videoTrack):void 0;t&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.SUBSCRIBE_STATS,{stream_id:i.uid,stats:t})}))}if(n.has(QP.AUDIO)&&i.audioTrack){const t=i.audioTrack?function(e,t,i){const n=t.audioRecv.find((t=>t.ssrc===e));if(!n)return null;const r={id:vG(10,""),timestamp:new Date(t.timestamp).toISOString(),mediaType:"audio",type:"ssrc",ssrc:n.ssrc.toString()};return r.bytesReceived=n.bytes.toString(),r.packetsLost=n.packetsLost.toString(),r.packetsReceived=n.packets.toString(),n.outputLevel?r.A_aol=Math.round(100*n.outputLevel).toString():r.A_aol=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),r.A_apol=Math.round(100*i._source.getAccurateVolumeLevel()).toString(),i&&(r.A_artd=i._originMediaStreamTrack.enabled&&i._mediaStreamTrack.enabled?"0":"1"),r.A_jr=n.jitterMs.toString(),r.A_jbm=Math.floor(n.jitterBufferMs).toString(),r.A_cdm=Math.floor(n.jitterBufferMs).toString(),r.A_raps=SL[_F.getPlayerState(i.getTrackId())].toString(),r}(i._audioSSRC,e,i.audioTrack):void 0;t&&BG((()=>{var e;return null===(e=this.requestUpload)||void 0===e?void 0:e.call(this,KL.SUBSCRIBE_STATS,{stream_id:i.uid,stats:t})}))}}))}uploadSlowDownlinkStats(e){}uploadRelatedDownlinkStats(e,t){var i;((null===(i=this.requestRemoteMedia)||void 0===i?void 0:i.call(this))||[]).forEach((i=>{let[n,r]=i;if(r.has(QP.VIDEO)&&n.videoTrack){var o;const i=!0===(n._videoSSRC&&(null===(o=this.requestVideoIsReady)||void 0===o?void 0:o.call(this,n._videoSSRC))||!1),r=function(e,t,i,n,r,o){const s=i.videoRecv.find((t=>t.ssrc===e)),a=r?r.videoRecv.find((t=>t.ssrc===e)):void 0;if(!s)return null;const c=oG.isRemoteVideoFreeze(o,s,a)&&t,A={mediaType:"video",isVideoMute:!1,peerId:n,frameRateReceived:s.receivedFrame&&s.receivedFrame.frameRate.toString(),frameRateDecoded:s.decodedFrame&&s.decodedFrame.frameRate.toString(),isFreeze:c,bytesReceived:s.bytes.toString(),packetsReceived:s.packets.toString(),packetsLost:s.packetsLost.toString(),qpSumPerFrame:Math.floor(s.qpSumPerFrame).toString()};return s.framesRateFirefox&&(A.frameRateDecoded=s.framesRateFirefox.toString(),A.frameRateReceived=s.framesRateFirefox.toString()),A}(n._videoSSRC,i,e,n.uid,t,n.videoTrack);r&&BG((()=>{var e;null===(e=this.requestUpload)||void 0===e||e.call(this,KL.SUBSCRIBE_RELATED_STATS,{stream_id:n.uid,stats:r})}))}if(r.has(QP.AUDIO)&&n.audioTrack){const t=function(e,t,i,n){const r=t.audioRecv.find((t=>t.ssrc===e));if(!r)return null;const o=oG.isRemoteAudioFreeze(n);return{mediaType:"audio",isAudioMute:!1,peerId:i,googJitterReceived:r.jitterMs.toString(),isFreeze:o,bytesReceived:r.bytes.toString(),packetsReceived:r.packets.toString(),packetsLost:r.packetsLost.toString(),frameReceived:r.receivedFrames.toString(),frameDropped:r.droppedFrames.toString()}}(n._audioSSRC,e,n.uid,n.audioTrack);t&&BG((()=>{var e;null===(e=this.requestUpload)||void 0===e||e.call(this,KL.SUBSCRIBE_RELATED_STATS,{stream_id:n.uid,stats:t})}))}}))}stopUploadDownlinkStats(){this.uploadDownlinkStarted&&(this.uploadDownlinkStarted=!1,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval),this.downlinkRelatedStatsUploadInterval&&window.clearInterval(this.downlinkRelatedStatsUploadInterval),this.downlinkStatsUploadInterval=void 0,this.downlinkRelatedStatsUploadInterval=void 0)}stopUploadTransportStats(){this.uploadTransportStarted&&(this.uploadTransportStarted=!1,this.transportStatsUploadInterval&&window.clearInterval(this.transportStatsUploadInterval),this.transportStatsUploadInterval=void 0)}}var LZ,PZ;function kZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function MZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?kZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):kZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function UZ(e){var t,i,n,r=2;for("undefined"!=typeof Symbol&&(i=az,n=Symbol.iterator);r--;){if(i&&null!=(t=e[i]))return t.call(e);if(n&&null!=(t=e[n]))return new BZ(t.call(e));i="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function BZ(e){function t(e){if(Object(e)!==e)return Mm.reject(new TypeError(e+" is not an object."));var t=e.done;return Mm.resolve(e.value).then((function(e){return{value:e,done:t}}))}return(BZ=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Mm.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Mm.reject(e):t(i.apply(this.s,arguments))}},new BZ(e)}let VZ=Ww("P2PChannel","store.p2pId")((tx((PZ=class extends Ew{get state(){return this._state}set state(e){const t=this._state;this._state=e,this.emit(GP.StateChange,t,this._state)}constructor(e,t){super(),tD(this,"store",void 0),tD(this,"statsUploader",void 0),tD(this,"connection",void 0),tD(this,"localTrackMap",new Map),tD(this,"remoteUserMap",new Map),tD(this,"pendingLocalTracks",[]),tD(this,"pendingRemoteTracks",[]),tD(this,"statsCollector",void 0),tD(this,"isPlanB",!1),tD(this,"iceFailedCount",0),tD(this,"dtlsFailedCount",0),tD(this,"mutex",new Qx("P2PChannel-mutex")),tD(this,"_state",FP.Disconnected),tD(this,"handleMuteLocalTrack",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleMuteLocalTrack");try{if(!this.connection)return void i(new pw(hw.INVALID_OPERATION,"Cannot call P2PChannel.handleMuteLocalTrack before connection established."));Yw("debug",this,"handleMuteLocalTrack",e.getTrackId()),await this.waitTillConnected();const r=this.filterTobeMutedTracks(e);if(0===r.length)return void t();await this.connection.muteLocal(r.map((e=>{let[,{id:t}]=e;return t})));const o=this.createMuteMessage(r);await LG(this,GP.RequestMuteLocal,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleUnmuteLocalTrack",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleUnmuteLocalTrack");try{if(!this.connection)return void i(new pw(hw.INVALID_OPERATION,"Cannot call P2PChannel.handleUnmuteLocalTrack before connection established."));Yw("debug",this,"handleUnmuteLocalTrack",e.getTrackId()),await this.waitTillConnected();const r=this.filterTobeUnmutedTracks(e);if(0===r.length)return void t();await this.connection.unmuteLocal(r.map((e=>{let[,{id:t}]=e;return t})));const o=this.createUnmuteMessage(r);await LG(this,GP.RequestUnmuteLocal,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleUpdateVideoEncoder",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleSetVideoEncoder");try{const i=this.localTrackMap.get(xP.LocalVideoTrack);if(!this.connection||!i||i.track!==e)return void t();await this.waitTillConnected();const{id:r,track:o}=i;await this.connection.updateSendParameters(r,o),await this.connection.updateEncoderConfig(r,o),this.emit(GP.UpdateVideoEncoder,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleSetOptimizationMode",(async(e,t,i)=>{const n=await this.mutex.lock("Locking from P2PChannel.handleSetOptimizationMode");try{const i=this.localTrackMap.get(xP.LocalVideoTrack);if(!this.connection||!i||i.track!==e)return;await this.waitTillConnected();const{id:r,track:o}=i;await this.connection.updateSendParameters(r,o),t()}catch(e){i(e)}finally{n()}})),tD(this,"handleReplaceTrack",(async(e,t,i,n)=>{let r;mw.debug("P2PChannel handleReplaceTrack for [track-id-".concat(e.getTrackId(),"]")),"boolean"==typeof n&&n||(r=await this.mutex.lock("From P2PChannel.handleReplaceTrack"));try{const i=Array.from(this.localTrackMap.entries()).find((t=>{let[,{track:i}]=t;return e===i}));if(!this.connection||!i)return void t();if(await this.waitTillConnected(),await this.connection.replaceTrack(e,i[1].id),this.isPlanB){const t=i[1];t.id=e._mediaStreamTrack.id,this.localTrackMap.set(i[0],t)}if(i[0]===xP.LocalVideoTrack&&XP().supportDualStreamEncoding){const t=this.localTrackMap.get(xP.LocalVideoLowTrack);if(t){const i=e._mediaStreamTrack.clone();t.track._originMediaStreamTrack.stop(),t.track._mediaStreamTrack=i,t.track._originMediaStreamTrack=i,await new Mm(((e,i)=>{this.handleReplaceTrack(t.track,e,i,!0)}))}}t()}catch(e){i(e)}finally{var o;null===(o=r)||void 0===o||o()}})),tD(this,"handleGetLocalVideoStats",(e=>{e(this.statsCollector.getLocalVideoTrackStats())})),tD(this,"handleGetLocalAudioStats",(e=>{e(this.statsCollector.getLocalAudioTrackStats())})),tD(this,"handleGetRemoteVideoStats",(e=>this.statsCollector.getRemoteVideoTrackStats(e.uid)[e.uid])),tD(this,"handleGetRemoteAudioStats",(e=>this.statsCollector.getRemoteAudioTrackStats(e.uid)[e.uid])),this.store=e,this.statsCollector=t,this.statsCollector.addP2PChannel(this),this.statsUploader=new bZ,this.bindStatsUploaderEvents(),this.isPlanB=!XP().supportUnifiedPlan||cb("CHROME_FORCE_PLAN_B")&&Ky()}async startP2PConnection(e){return this.state=FP.New,this.connection=this.isPlanB?new uZ(e,this.store):new RZ(e,this.store),this.bindConnectionEvents(this.connection),this.store.peerConnectionStart(),this.connection.establish()}async connect(e,t,i,n,r,o){if(!this.connection)throw new pw(hw.UNEXPECTED_ERROR,"Cannot P2PChannel.connect before P2PChannel.startP2PConnection .");await this.connection.connect(e,t,i,n,r,o),this.statsUploader.startUploadTransportStats(),this.state=FP.Connected}publish(e,t,i){var n=this;return nz((function*(){const r=yield rz(n.mutex.lock("From P2PChannel.publish"));try{if(!n.connection){if(n.state===FP.Disconnected)throw new pw(hw.UNEXPECTED_ERROR,"PeerConnection already disconnected.");n.throwIfTrackTypeNotMatch(e);const t=e.filter((e=>-1===n.pendingLocalTracks.indexOf(e)));return void(n.pendingLocalTracks=n.pendingLocalTracks.concat(t))}n.store.pubId=n.store.pubId+1,iG.markPublishStart(n.store.clientId,n.store.pubId),yield rz(n.waitTillConnected());const o=n.filterTobePublishedTracks(e,t,i);if(0===o.length)return void(yield rz(n.tryToUnmuteAudio(e)));yield*sz(UZ(n.doPublish(n.connection,o)),rz)}finally{r()}}))()}doPublish(e,t){var i=this;return nz((function*(){t.forEach((e=>{let{track:t,type:n}=e;const r=performance.now();i.store.publish(t.getTrackId(),n===xP.LocalAudioTrack?"audio":"video",r)})),i.bindLocalTrackEvents(t);const n=yield rz(e.send(t.map((e=>{let{track:t}=e;return t})),i.store.codec,i.store.audioCodec)),r=(yield rz(n.next())).value,o=i.createGatewayPublishMessage(t,r);let s;try{s=yield o}catch(e){throw xw("error",i,"doPublish yield error: ".concat(e.toString())),n.throw(e),(null==e?void 0:e.code)===hw.WS_ABORT&&t.forEach((e=>{let{track:t}=e;-1===i.pendingLocalTracks.indexOf(t)&&i.pendingLocalTracks.push(t)})),i.unbindLocalTrackEvents(t),e}const a=i.mapPubResToRemoteConfig(o,s);Yw("debug",i,"doPublish",{remoteConfigs:a,tracks:t.map((e=>{let{track:t}=e;return t.getTrackId()})),pubMsg:o,pubAns:s});const c=(yield rz(n.next(a))).value;t.forEach((e=>{let{type:t}=e;i.statsCollector.addLocalStats(t)})),i.assignLocalTracks(t,c),i.statsUploader.startUploadUplinkStats(),t.forEach((e=>{let{track:t,type:n}=e;const r=performance.now();i.store.publish(t.getTrackId(),n===xP.LocalAudioTrack?"audio":"video",void 0,r)}))}))()}publishLowStream(e){var t=this;return nz((function*(){if(!t.connection)return;Yw("debug",t,"publishLowStream",e);const i=yield rz(t.mutex.lock("Locking from P2PChannel.publishLowStream"));try{const r=t.localTrackMap.get(xP.LocalVideoTrack);if(!r)throw new pw(hw.UNEXPECTED_ERROR,"Could not find high stream");if(t.localTrackMap.has(xP.LocalVideoLowTrack))throw new pw(hw.UNEXPECTED_ERROR,"[".concat(t.store.clientId,"] Can't publish low stream when stream already publish"));yield rz(t.waitTillConnected());const o=[{track:t.getLowVideoTrack(r.track,e),type:xP.LocalVideoLowTrack}];if(yield*sz(UZ(t.doPublish(t.connection,o)),rz),r.track.muted||!r.track.enabled){var n;const e=null===(n=t.localTrackMap.get(xP.LocalVideoLowTrack))||void 0===n?void 0:n.id;void 0!==e&&(yield rz(t.connection.muteLocal([e])))}}finally{i()}}))()}async republish(){this.pendingLocalTracks.length>0&&(mw.debug("Emit P2PChannelEvents.RequestRePublish to republish tracks."),Yw("debug",this,"republish",this.pendingLocalTracks.map((e=>e.getTrackId()))),await bG(this,GP.RequestRePublish,this.pendingLocalTracks),this.emit(GP.MediaReconnectEnd,this.store.uid),this.pendingLocalTracks=[])}async reSubscribe(e){Yw("debug",this,"reSubscribe",this.pendingRemoteTracks.map((e=>{let{user:t}=e;return t.uid})));for(let e=this.pendingRemoteTracks.length-1;e>=0;e--){const{user:t,kind:i}=this.pendingRemoteTracks[e];(i!==QP.AUDIO||t._audio_added_&&t._audioSSRC)&&(i!==QP.VIDEO||t._video_added_&&t._videoSSRC)||this.pendingRemoteTracks.splice(e,1)}if(e)await bG(this,GP.RequestReSubscribe,this.pendingRemoteTracks);else for(const{user:e,kind:t}of this.pendingRemoteTracks)await this.subscribe(e,t,t===QP.VIDEO?e._videoSSRC:e._audioSSRC);this.pendingRemoteTracks.forEach((e=>{let{user:t}=e;this.emit(GP.MediaReconnectEnd,t.uid)})),this.pendingRemoteTracks=[]}async unpublish(e){if(!this.connection)return void e.forEach((e=>{const t=this.pendingLocalTracks.indexOf(e);-1!==t&&this.pendingLocalTracks.splice(t,1)}));await this.waitTillConnected();const t=this.filterTobeUnpublishedTracks(e);return 0!==t.length?(Yw("debug",this,"unpublish"),this.doUnpublish(this.connection,t)):void 0}async unpublishLowStream(){if(!this.connection)return;Yw("debug",this,"unpublishLowStream");const e=this.localTrackMap.get(xP.LocalVideoLowTrack);if(!e)return;await this.waitTillConnected();const t=[[xP.LocalVideoLowTrack,e]];return this.doUnpublish(this.connection,t)}async doUnpublish(e,t){const i=this.createGatewayUnpublishMessage(t);return await e.stopSending(t.map((e=>{let[,{id:t}]=e;return t}))),this.withdrawLocalTracks(t),this.unbindLocalTrackEvents(t.map((e=>{let[t,{track:i}]=e;return{type:t,track:i}}))),t.forEach((e=>{let[t]=e;this.statsCollector.removeLocalStats(t)})),0===this.localTrackMap.size&&this.statsUploader.stopUploadUplinkStats(),i}async subscribe(e,t,i,n,r){var o;if(!this.connection)throw new pw(hw.INVALID_OPERATION,"Cannot subscribe remote user when peerConnection disconnected.");if(Yw("debug",this,"subscribe",{uid:e.uid,mediaType:t,ssrcId:i}),null!==(o=this.remoteUserMap.get(e))&&void 0!==o&&o.has(t))return;let s,a;if(await this.waitTillConnected(),r){const i=r.find((e=>{let{stream_type:i}=e;return i===t}));if(!i)throw new pw(hw.UNEXPECTED_ERROR,"Cannot subscribe to remote ".concat(t," for user: ").concat(e.uid," because subscribe answer from gateway does not contain stream_type: ").concat(t,"."));const n=await this.connection.receive(t,i.ssrcs,String(e.uid),i.attributes);s=n.track,a=n.id}else{const r=await this.connection.receive(t,[{ssrcId:i,rtx:n}],String(e.uid),void 0);s=r.track,a=r.id}t===QP.AUDIO?(e._audioTrack?e._audioTrack._updateOriginMediaStreamTrack(s):(e._audioTrack=new yZ(s,e.uid,e._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote audio track: ").concat(e._audioTrack.getTrackId()))),this.bindRemoteTrackEvents(e,e._audioTrack)):(e._videoTrack?e._videoTrack._updateOriginMediaStreamTrack(s):(e._videoTrack=new NZ(s,e.uid,e._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote video track: ").concat(e._videoTrack.getTrackId()))),this.bindRemoteTrackEvents(e,e._videoTrack));const c=this.remoteUserMap.get(e);c?c.set(t,a):this.remoteUserMap.set(e,new Map([[t,a]])),this.statsCollector.addRemoteStats(e.uid),this.statsUploader.startUploadDownlinkStats();const A=this.pendingRemoteTracks.findIndex((i=>{let{user:n,kind:r}=i;return n.uid===e.uid&&t===r}));-1!==A&&(this.pendingRemoteTracks.splice(A,1),this.emit(GP.MediaReconnectEnd,e.uid))}async massSubscribe(e){return this.massSubscribeNoLock(e)}async massSubscribeNoLock(e){if(!this.connection)throw new pw(hw.INVALID_OPERATION,"Cannot subscribeAll remote users when peerConnection disconnected.");Yw("debug",this,"subscribeAll",e.map((e=>{let{user:t,mediaType:i,ssrcId:n}=e;return{uid:t.uid,mediaType:i,ssrcId:n}}))),e=e.filter((e=>{var t;let{user:i,mediaType:n}=e;return!(null!==(t=this.remoteUserMap.get(i))&&void 0!==t&&t.has(n))})),await this.waitTillConnected();const t=await this.connection.batchReceive(e.map((e=>{let{user:t,mediaType:i,ssrcId:n,rtxSsrcId:r}=e;return{kind:i,ssrcMsg:[{ssrcId:n,rtx:r}],mslabel:String(t.uid)}})));e.forEach(((e,i)=>{let{user:n,mediaType:r}=e;const{track:o,id:s}=t[i];r===QP.AUDIO?(n._audioTrack?n._audioTrack._updateOriginMediaStreamTrack(o):(n._audioTrack=new yZ(o,n.uid,n._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote audio track: ").concat(n._audioTrack.getTrackId()))),this.bindRemoteTrackEvents(n,n._audioTrack)):(n._videoTrack?n._videoTrack._updateOriginMediaStreamTrack(o):(n._videoTrack=new NZ(o,n.uid,n._uintid,this.store),mw.info("[".concat(this.store.p2pId,"] create remote video track: ").concat(n._videoTrack.getTrackId()))),this.bindRemoteTrackEvents(n,n._videoTrack));const a=this.remoteUserMap.get(n);a?a.set(r,s):this.remoteUserMap.set(n,new Map([[r,s]])),this.statsCollector.addRemoteStats(n.uid),this.statsUploader.startUploadDownlinkStats();const c=this.pendingRemoteTracks.findIndex((e=>{let{user:t,kind:i}=e;return t.uid===n.uid&&r===i}));-1!==c&&(this.pendingRemoteTracks.splice(c,1),this.emit(GP.MediaReconnectEnd,n.uid))}))}async unsubscribe(e,t){const i=this.pendingRemoteTracks.filter((i=>{let{user:n,kind:r}=i;return void 0!==t?n.uid===e.uid&&t===r:n.uid===e.uid}));if(i.forEach((e=>{const t=this.pendingRemoteTracks.indexOf(e);this.pendingRemoteTracks.splice(t,1)})),!this.connection)return void i.forEach((t=>{let{kind:i}=t;var n;if(i===QP.AUDIO)null===(n=e._audioTrack)||void 0===n||n._destroy(),e._audioTrack=void 0;else if(i===QP.VIDEO){var r;null===(r=e._videoTrack)||void 0===r||r._destroy(),e._videoTrack=void 0}}));Yw("debug",this,"unsubscribe",{uid:e.uid,mediaType:t});const n=this.filterTobeUnSubscribedTracks(e,t);if(0===n.length)return;await this.connection.stopReceiving(n.map((e=>{let[,{id:t}]=e;return t})));const r=this.createUnsubscribeMessage(n);return this.withdrawRemoteTracks(n),0===this.remoteUserMap.size&&this.statsUploader.stopUploadDownlinkStats(),n.forEach((e=>{let[t,{kind:i}]=e;var n,r;if(i===QP.VIDEO&&t._videoSSRC&&(null===(n=this.connection)||void 0===n||n.setStatsRemoteVideoIsReady(t._videoSSRC,!1)),i===QP.VIDEO)this.unbindRemoteTrackEvents(t._videoTrack),null===(r=t._videoTrack)||void 0===r||r._destroy(),t._videoTrack=void 0;else if(i===QP.AUDIO){var o;this.unbindRemoteTrackEvents(t._audioTrack),null===(o=t._audioTrack)||void 0===o||o._destroy(),t._audioTrack=void 0}})),r}async massUnsubscribe(e){return this.massUnsubscribeNoLock(e)}async massUnsubscribeNoLock(e){let t=[];for(const{user:i,mediaType:n}of e){const e=this.pendingRemoteTracks.filter((e=>{let{user:t,kind:r}=e;return void 0!==n?t.uid===i.uid&&n===r:t.uid===i.uid}));e.forEach((e=>{const t=this.pendingRemoteTracks.indexOf(e);this.pendingRemoteTracks.splice(t,1)})),t=t.concat(e)}if(!this.connection)return void t.forEach((e=>{let{user:t,kind:i}=e;var n;if(i===QP.AUDIO)null===(n=t._audioTrack)||void 0===n||n._destroy(),t._audioTrack=void 0;else if(i===QP.VIDEO){var r;null===(r=t._videoTrack)||void 0===r||r._destroy(),t._videoTrack=void 0}}));Yw("debug",this,"batchUnsubscribe",e.map((e=>{let{user:t,mediaType:i}=e;return{uid:t.uid,mediaType:i}})));const i=dE(e).call(e,((e,t)=>{let{user:i,mediaType:n}=t;const r=this.filterTobeUnSubscribedTracks(i,n);return e.concat(r)}),[]);if(0===i.length)return;await this.connection.stopReceiving(i.map((e=>{let[,{id:t}]=e;return t})));const n=this.createUnsubscribeAllMessage(i);return this.withdrawRemoteTracks(i),0===this.remoteUserMap.size&&this.statsUploader.stopUploadDownlinkStats(),i.forEach((e=>{let[t,{kind:i}]=e;var n,r;if(i===QP.VIDEO&&t._videoSSRC&&(null===(n=this.connection)||void 0===n||n.setStatsRemoteVideoIsReady(t._videoSSRC,!1)),i===QP.VIDEO)this.unbindRemoteTrackEvents(t._videoTrack),null===(r=t._videoTrack)||void 0===r||r._destroy(),t._videoTrack=void 0;else if(i===QP.AUDIO){var o;this.unbindRemoteTrackEvents(t._audioTrack),null===(o=t._audioTrack)||void 0===o||o._destroy(),t._audioTrack=void 0}})),n}async muteRemote(e,t){if(!this.connection)return;Yw("debug",this,"muteRemote",{uid:e.uid,kind:t});const i=this.remoteUserMap.get(e);if(!i)return mw.warning("P2PChannel.muteRemote has no remote user ".concat(e.uid,".")),void xw("warning",this,"P2PChannel.muteRemote has no remote user ".concat(e.uid,"."));const n=i.get(t);if(!n)return mw.warning("P2PChannel.muteRemote has no remote user ".concat(e.uid," media type ").concat(t,".")),void xw("warning",this,"P2PChannel.muteRemote has no remote user ".concat(e.uid," media type ").concat(t,"."));const r=t===QP.VIDEO?e._videoSSRC:e._audioSSRC;void 0!==r&&this.connection.setStatsRemoteVideoIsReady(r,!1),await this.connection.muteRemote(n)}async unmuteRemote(e,t){return this.unmuteRemoteNoLock(e,t)}async unmuteRemoteNoLock(e,t){if(!this.connection)return;Yw("debug",this,"unmuteRemote",{uid:e.uid,kind:t});const i=this.remoteUserMap.get(e);if(!i)return mw.warning("P2PChannel.unmuteRemote has no remote user ".concat(e.uid,".")),void xw("warning",this,"unmuteRemote has no remote user ".concat(e.uid));const n=i.get(t);if(!n)return mw.warning("P2PChannel.unmuteRemote has no remote user ".concat(e.uid," media type ").concat(t,".")),void xw("warning",this,"unmuteRemote has no remote user ".concat(e.uid," media type ").concat(t));await this.connection.unmuteRemote(n)}getAllTracks(e){const t=this.localTrackMap.get(xP.LocalAudioTrack);if((null==t?void 0:t.track)instanceof zF){const i=t.track;return Array.from(this.localTrackMap.entries()).filter((e=>{let[t]=e;return t!==xP.LocalAudioTrack})).filter((t=>{let[i]=t;return!(e&&i===xP.LocalVideoLowTrack)})).map((e=>{let[,{track:t}]=e;return t})).concat(i.trackList)}return Array.from(this.localTrackMap.entries()).filter((t=>{let[i]=t;return!(e&&i===xP.LocalVideoLowTrack)})).map((e=>{let[,{track:t}]=e;return t}))}reportPublishEvent(e,t,i,n,r){if(e){const i=this.localTrackMap.get(xP.LocalAudioTrack),o=n?this.localTrackMap.get(xP.LocalVideoLowTrack):this.localTrackMap.get(xP.LocalVideoTrack);Px.publish(this.store.sessionId,{eventElapse:iG.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:e,ec:t,audioName:null==i?void 0:i.track.getTrackLabel(),videoName:null==o?void 0:o.track.getTrackLabel(),screenshare:-1!==(null==o?void 0:o.track._hints.indexOf(vP.SCREEN_TRACK)),audio:!!i,video:!!o,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:r})}else{var o;i||(i=[]);const s=i.find((e=>e instanceof JF)),a=n?null===(o=this.localTrackMap.get(xP.LocalVideoTrack))||void 0===o?void 0:o.track:i.find((e=>e instanceof WJ));Px.publish(this.store.sessionId,{eventElapse:iG.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:e,ec:t,audioName:null==s?void 0:s.getTrackLabel(),videoName:null==a?void 0:a.getTrackLabel(),screenshare:-1!==(null==a?void 0:a._hints.indexOf(vP.SCREEN_TRACK)),audio:!!s,video:!!a,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:r})}}reportSubscribeEvent(e,t,i,n){const r=n===QP.VIDEO?i._videoSSRC:i._audioSSRC;r&&Px.subscribe(this.store.sessionId,{succ:e,ec:t,video:n===QP.VIDEO,audio:n===QP.AUDIO,peerid:i.uid,subscribeRequestid:n===QP.VIDEO?i._videoSSRC:i._audioSSRC,p2pid:this.store.p2pId,eventElapse:iG.measureFromSubscribeStart(this.store.clientId,r)})}reset(){mw.debug("P2PChannel.reset"),this.mutex=new Qx("P2PChannel-mutex"),this.connection&&(this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0),this.statsUploader.stopUploadUplinkStats(),this.statsUploader.stopUploadDownlinkStats(),this.statsUploader.stopUploadTransportStats(),this.unbindLocalTrackEvents(),this.unbindAllRemoteTrackEvents(),this.localTrackMap.clear(),this.remoteUserMap.clear(),this.statsCollector.removeRemoteStats(),this.statsCollector.removeLocalStats(),this.iceFailedCount=0,this.dtlsFailedCount=0,this.pendingLocalTracks=[],this.pendingRemoteTracks=[],this.state=FP.Disconnected}getStats(){var e;return null===(e=this.connection)||void 0===e?void 0:e.getStats()}getRemoteVideoIsReady(e){var t;return(null===(t=this.connection)||void 0===t?void 0:t.getRemoteVideoIsReady(e))||!1}getLocalAudioVolume(){const e=this.localTrackMap.get(xP.LocalAudioTrack);if(e)return e.track.getVolumeLevel()}getLocalVideoSize(){const e=this.localTrackMap.get(xP.LocalVideoTrack);if(e)return{width:e.track._videoWidth||0,height:e.track._videoHeight||0}}getEncoderConfig(e){const t=this.localTrackMap.get(e);return t&&t.track instanceof WJ||t&&t.track instanceof JF?t.track._encoderConfig:void 0}getLocalMedia(e){return this.localTrackMap.get(e)}hasLocalMedia(){return this.localTrackMap.size>0}hasRemoteMedia(e,t){if(!e)return this.remoteUserMap.size>0;const i=this.remoteUserMap.get(e);return!!i&&(!t||i.has(t))}async hasRemoteMediaWithLock(e,t){if(!e)return this.remoteUserMap.size>0;const i=this.remoteUserMap.get(e);return!!i&&(!t||i.has(t))}getRemoteMedia(e){var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t.uid===e));return i?{audioTrack:i.audioTrack,audioSSRC:i._audioSSRC,videoTrack:i.videoTrack,videoSSRC:i._videoSSRC}:{}}getAudioLevels(){let e=Array.from(this.remoteUserMap.entries()).map((e=>{let[t]=e;return{uid:t.uid,level:t.audioTrack?100*t.audioTrack._source.getAccurateVolumeLevel():0}}));const t=this.localTrackMap.get(xP.LocalAudioTrack);return t&&e.push({level:100*t.track._source.getAccurateVolumeLevel(),uid:this.store.uid}),e=AL(e).call(e,((e,t)=>e.level-t.level)),e}async disconnectForReconnect(){this.connection&&(Yw("debug",this,"disconnectForReconnect"),mw.debug("P2PChannel.disconnectForReconnect closing P2PConnection"),this.state=FP.Reconnecting,this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0,0!==this.localTrackMap.size&&(Array.from(this.localTrackMap.entries()).forEach((e=>{let[t,{track:i}]=e;switch(t){case xP.LocalVideoTrack:i._hints.includes(vP.LOW_STREAM)?i.close():this.pendingLocalTracks.push(i);break;case xP.LocalAudioTrack:i instanceof zF?this.pendingLocalTracks=this.pendingLocalTracks.concat(i.trackList):this.pendingLocalTracks.push(i);case xP.LocalVideoLowTrack:}})),this.emit(GP.MediaReconnectStart,this.store.uid)),this.unbindLocalTrackEvents(),this.localTrackMap.clear(),0!==this.remoteUserMap.size&&Array.from(this.remoteUserMap.entries()).forEach((e=>{let[t,i]=e;Array.from(Ix(i).call(i)).forEach((e=>{this.setPendingRemoteMedia(t,e)})),this.emit(GP.MediaReconnectStart,t.uid)})),this.unbindAllRemoteTrackEvents(),this.remoteUserMap.clear(),this.statsUploader.stopUploadUplinkStats(),this.statsUploader.stopUploadDownlinkStats(),this.statsUploader.stopUploadTransportStats(),mw.debug("P2PChannel disconnected, waiting to reconnect."))}hasPendingRemoteMedia(e,t){for(const i of this.pendingRemoteTracks){const{user:n,kind:r}=i;if((e instanceof zJ?e.uid:e)===n.uid&&t===r)return!0}return!1}setPendingRemoteMedia(e,t){this.hasPendingRemoteMedia(e,t)||this.pendingRemoteTracks.push({user:e,kind:t})}async reEstablish(){if(this.connection)return this.connection.reEstablish()}getUplinkNetworkQuality(){if(!this.connection)return 0;const e=this.connection.getStats(),t=this.localTrackMap.get(xP.LocalVideoTrack),i=this.localTrackMap.get(xP.LocalAudioTrack),n=e.videoSend.find((e=>e.ssrc===(null==t?void 0:t.ssrcs[0].ssrcId))),r=e.audioSend.find((e=>e.ssrc===(null==i?void 0:i.ssrcs[0].ssrcId)));if(!n||!r)return 1;const o=PG(this,GP.NeedSignalRTT),s=n?n.rttMs:void 0,a=r?r.rttMs:void 0,c=s&&a?(s+a)/2:s||a,A=(c&&o?(c+o)/2:c||o)||0,d=100*e.sendPacketLossRate*.7/50+.3*A/1500,u=d<.17?1:d<.36?2:d<.59?3:d<.1?4:5,E=null==t?void 0:t.track;if(E&&E._encoderConfig&&-1===E._hints.indexOf(vP.SCREEN_TRACK)){const t=E._encoderConfig.bitrateMax,i=e.bitrate.actualEncoded;if(t&&i){const e=(1e3*t-i)/(1e3*t);return pb[e<.15?0:e<.3?1:e<.45?2:e<.6?3:4][u]}}return u}getDownlinkNetworkQuality(){if(!this.connection)return 0;const e=this.connection.getStats();let t=0;return Array.from(this.remoteUserMap.entries()).forEach((i=>{let[n]=i;const r=n._audioSSRC,o=n._videoSSRC,s=e.audioRecv.find((e=>e.ssrc===r)),a=e.videoRecv.find((e=>e.ssrc===o));if(!s&&!a)return void(t+=1);const c=PG(this,GP.NeedSignalRTT),A=e.rtt,d=(A&&c?(A+c)/2:A||c)||0,u=s?s.jitterMs:void 0,E=e.recvPacketLossRate;let l=.7*E*100/50+.3*d/1500;u&&(l=.6*E*100/50+.2*d/1500+.2*u/400),t+=l<.1?1:l<.17?2:l<.36?3:l<.59?4:5})),this.remoteUserMap.size>0?Math.round(t/this.remoteUserMap.size):t}async muteLocalTrack(e){return new Mm(((t,i)=>{this.handleMuteLocalTrack(e,t,i)}))}filterTobePublishedTracks(e,t,i){const n=[],r=XP(),o=this.getAllTracks();e=UG(e=e.filter((e=>-1===o.indexOf(e))));let s=!1,a=!1;for(const o of e){if(o instanceof WJ&&(this.localTrackMap.has(xP.LocalVideoTrack)||s?new pw(hw.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS).throw():(n.push({track:o,type:xP.LocalVideoTrack}),s=!0),t)){const e=this.getLowVideoTrack(o,i);n.push({track:e,type:xP.LocalVideoLowTrack})}if(o instanceof JF){const e=this.localTrackMap.get(xP.LocalAudioTrack);if(e){if(!(e.track instanceof zF))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(o._bypassWebAudio)throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");e.track.addAudioTrack(o),this.bindLocalAudioTrackEvents(o,!0)}else if(a){const e=n.find((e=>{let{type:t}=e;return t===xP.LocalAudioTrack}));if(!(e.track instanceof zF))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(o._bypassWebAudio)throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");e.track.addAudioTrack(o)}else{if(!r.webAudioMediaStreamDest||o instanceof zF||o._bypassWebAudio)n.push({track:o,type:xP.LocalAudioTrack});else{const e=new zF;e.addAudioTrack(o),n.push({track:e,type:xP.LocalAudioTrack})}a=!0}}}return n}filterTobeUnpublishedTracks(e){const t=[],i=this.getAllTracks();e=UG(e=e.filter((e=>-1!==i.indexOf(e))));for(const i of e){if(i instanceof JF){const e=this.localTrackMap.get(xP.LocalAudioTrack);if(!e)continue;e.track instanceof zF?(e.track.removeAudioTrack(i),this.unbindLocalAudioTrackEvents(i),0===e.track.trackList.length&&(t.push([xP.LocalAudioTrack,e]),e.track.close())):t.push([xP.LocalAudioTrack,e])}if(i instanceof WJ){const e=this.localTrackMap.get(xP.LocalVideoTrack);if(!e)continue;t.push([xP.LocalVideoTrack,e]);const i=this.localTrackMap.get(xP.LocalVideoLowTrack);i&&t.push([xP.LocalVideoLowTrack,i])}}return t}bindLocalTrackEvents(e){e.forEach((e=>{let{track:t,type:i}=e;switch(i){case xP.LocalVideoTrack:t.addListener(OP.GET_STATS,this.handleGetLocalVideoStats),t.addListener(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),t.addListener(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),t.addListener(OP.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),t.addListener(OP.SET_OPTIMIZATION_MODE,this.handleSetOptimizationMode),t.addListener(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack),t.addListener(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),t.addListener(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case xP.LocalAudioTrack:this.bindLocalAudioTrackEvents(t);case xP.LocalVideoLowTrack:}}))}bindLocalAudioTrackEvents(e,t){e instanceof zF?e.trackList.forEach((e=>{e.addListener(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.addListener(OP.GET_STATS,this.handleGetLocalAudioStats),e.addListener(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)})):(e.addListener(OP.GET_STATS,this.handleGetLocalAudioStats),e.addListener(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.addListener(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.addListener(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack),t||e.addListener(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack))}unbindLocalTrackEvents(e){e||(e=Array.from(this.localTrackMap.entries()).map((e=>{let[t,{track:i}]=e;return{track:i,type:t}}))),e.forEach((e=>{let{track:t,type:i}=e;switch(i){case xP.LocalVideoTrack:t.off(OP.GET_STATS,this.handleGetLocalVideoStats),t.off(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),t.off(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),t.off(OP.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),t.off(OP.SET_OPTIMIZATION_MODE,this.handleSetOptimizationMode),t.off(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack),t.off(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),t.off(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case xP.LocalAudioTrack:this.unbindLocalAudioTrackEvents(t);case xP.LocalVideoLowTrack:}}))}unbindLocalAudioTrackEvents(e){e instanceof zF?e.trackList.forEach((e=>{e.off(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.off(OP.GET_STATS,this.handleGetLocalAudioStats),e.off(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)})):(e.off(OP.GET_STATS,this.handleGetLocalAudioStats),e.off(OP.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),e.off(OP.NEED_REPLACE_TRACK,this.handleReplaceTrack),e.off(OP.NEED_MUTE_TRACK,this.handleMuteLocalTrack),e.off(OP.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack))}bindRemoteTrackEvents(e,t){t instanceof NZ&&t.addListener(OP.GET_STATS,(t=>{t(this.handleGetRemoteVideoStats(e))})),t instanceof yZ&&t.addListener(OP.GET_STATS,(t=>{t(this.handleGetRemoteAudioStats(e))}))}unbindRemoteTrackEvents(e){e&&e.removeAllListeners(OP.GET_STATS)}unbindAllRemoteTrackEvents(){Array.from(this.remoteUserMap.entries()).forEach((e=>{let[t,i]=e;i.has(QP.AUDIO)&&this.unbindRemoteTrackEvents(t._audioTrack),i.has(QP.VIDEO)&&this.unbindRemoteTrackEvents(t._videoTrack)}))}createGatewayPublishMessage(e,t){return e.map(((e,i)=>{let n,r,{track:o,type:s}=e;switch(s){case xP.LocalAudioTrack:n=TP.Audio,r={dtx:o instanceof qF&&o._config.DTX,hq:!1,lq:!1,stereo:!1,speech:!1};break;case xP.LocalVideoTrack:n=o._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High,r=MZ(MZ({},hG(o)),{},{codec:this.store.codec});break;case xP.LocalVideoLowTrack:n=TP.Low,r=MZ(MZ({},hG(o)),{},{codec:this.store.codec})}return{stream_type:n,attributes:r,ssrcs:t[i]}}))}createGatewayUnpublishMessage(e){return e.map((e=>{let t,[i,{track:n,ssrcs:r,id:o}]=e;switch(i){case xP.LocalVideoTrack:t=n._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High;break;case xP.LocalAudioTrack:t=TP.Audio;break;case xP.LocalVideoLowTrack:t=TP.Low}return{stream_type:t,ssrcs:r,mid:o}}))}assignLocalTracks(e,t){e.forEach(((e,i)=>{let{track:n,type:r}=e;this.localTrackMap.set(r,{track:n,id:t[i].id,ssrcs:t[i].localSSRC})}))}withdrawLocalTracks(e){e.forEach((e=>{let[t]=e;this.localTrackMap.delete(t)}))}async waitTillConnected(){return new Mm(((e,t)=>{switch(this.state){case FP.New:case FP.Reconnecting:{const i=(n,r)=>r===FP.Disconnected?(this.off(GP.StateChange,i),void t(new pw(hw.UNEXPECTED_ERROR,"PeerConnection already disconnected."))):r===FP.Connected?(this.off(GP.StateChange,i),void e(void 0)):void 0;this.on(GP.StateChange,i);break}case FP.Connected:e(void 0);break;case FP.Disconnected:t(new pw(hw.UNEXPECTED_ERROR,"PeerConnection already disconnected."))}}))}bindConnectionEvents(e){e.onConnectionStateChange=async t=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onConnectionStateChange(").concat(t,")")),Fw("info",this,"connectionStateChange",t),this.emit(GP.PeerConnectionStateChange,t),"connected"!==t||this.store.keyMetrics.peerConnectionEnd||this.store.peerConnectionEnd(),"failed"===t&&("failed"===e.iceConnectionState?(setTimeout((()=>this.emit(GP.P2PLost)),0),this.iceFailedCount+=1,await SG(Iw(this.iceFailedCount,_w)),this.emit(GP.RequestRestartICE)):await this.requestReconnect())},e.onICEConnectionStateChange=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onICEConnectionStateChange(").concat(e,")")),Fw("info",this,"iceConnectionStateChange",e),Px.reportApiInvoke(this.store.sessionId,{name:"ICEConnectionStateChange",options:e,tag:bL.TRACER}).onSuccess(),this.emit(GP.IceConnectionStateChange,e)},e.onICETransportStateChange=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onICETransportStateChange(").concat(e,")")),Fw("info",this,"ICETransportStateChange",e)},e.onDTLSTransportStateChange=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportStateChange(").concat(e,")")),Fw("info",this,"DTLSTransportStateChange",e)},e.onDTLSTransportError=e=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportError(").concat(e,")")),Fw("info",this,"DTLSTransportError",e)},e.onFirstAudioDecoded=e=>{var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t._audioSSRC===e));var n;i&&(null===(n=i.audioTrack)||void 0===n||n.emit(wP.FIRST_FRAME_DECODED),Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_AUDIO_DECODE,yL.FIRST_AUDIO_DECODE,{peer:i._uintid,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId}))},e.onFirstAudioReceived=e=>{var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t._audioSSRC===e));i&&Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_AUDIO_RECEIVED,yL.FIRST_AUDIO_RECEIVED,{peer:i._uintid,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId})},e.onFirstVideoDecoded=(e,t,i)=>{var n;const r=Array.from(Ix(n=this.remoteUserMap).call(n)).find((t=>t._videoSSRC===e));r&&Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_VIDEO_DECODE,yL.FIRST_VIDEO_DECODE,{peer:r._uintid,videowidth:t,videoheight:i,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId})},e.onFirstVideoReceived=e=>{var t;const i=Array.from(Ix(t=this.remoteUserMap).call(t)).find((t=>t._videoSSRC===e));i&&Px.firstRemoteFrame(this.store.sessionId,NL.FIRST_VIDEO_RECEIVED,yL.FIRST_VIDEO_RECEIVED,{peer:i._uintid,subscribeElapse:iG.measureFromSubscribeStart(this.store.clientId,e),subscribeRequestid:e,p2pid:this.store.p2pId})},e.onSelectedLocalCandidateChanged=(e,t)=>{const i="relay"===e.candidateType,n="relay"===t.candidateType;"unknown"!==t.candidateType&&i===n||this.emit(GP.ConnectionTypeChange,i),mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.SelectedLocalCandidateChanged(").concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e)),")")),Fw("info",this,"SelectedLocalCandidateChanged","".concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e))))},e.onSelectedRemoteCandidateChanged=(e,t)=>{mw.info("[p2pId: ".concat(this.store.p2pId,"]: P2PConnection.SelectedRemoteCandidateChanged(").concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e)),")")),Fw("info",this,"SelectedRemoteCandidateChanged","".concat(JSON.stringify(RG(t))," -> ").concat(JSON.stringify(RG(e))))}}unbindConnectionEvents(e){e.onConnectionStateChange=void 0,e.onICEConnectionStateChange=void 0,e.onICETransportStateChange=void 0,e.onDTLSTransportStateChange=void 0,e.onDTLSTransportError=void 0,e.onFirstAudioDecoded=void 0,e.onFirstAudioReceived=void 0,e.onFirstVideoDecoded=void 0,e.onFirstVideoReceived=void 0,e.onSelectedLocalCandidateChanged=void 0,e.onSelectedRemoteCandidateChanged=void 0}filterTobeMutedTracks(e){const t=[];if(-1===this.getAllTracks().indexOf(e))return t;const i=this.localTrackMap.get(xP.LocalAudioTrack);if(e instanceof JF&&(null==i?void 0:i.track)instanceof zF)return i.track.isActive||t.push([xP.LocalAudioTrack,i]),t;const n=Array.from(this.localTrackMap.entries()).find((t=>{let[,{track:i}]=t;return e===i}));if(n&&(t.push(n),n[0]===xP.LocalVideoTrack)){const e=this.localTrackMap.get(xP.LocalVideoLowTrack);e&&t.push([xP.LocalVideoLowTrack,e])}return t}filterTobeUnmutedTracks(e){const t=[],i=this.localTrackMap.get(xP.LocalAudioTrack);if(e instanceof JF&&(null==i?void 0:i.track)instanceof zF)return i.track.isActive&&t.push([xP.LocalAudioTrack,i]),t;const n=Array.from(this.localTrackMap.entries()).find((t=>{let[,{track:i}]=t;return e===i}));if(n)if(n[0]===xP.LocalVideoTrack){t.push(n);const e=this.localTrackMap.get(xP.LocalVideoLowTrack);e&&t.push([xP.LocalVideoLowTrack,e])}else t.push(n);return t}createMuteMessage(e){return e.map((e=>{let t,[i,{track:n,ssrcs:r,id:o}]=e;switch(i){case xP.LocalAudioTrack:t=TP.Audio;break;case xP.LocalVideoTrack:t=n._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High;break;case xP.LocalVideoLowTrack:t=TP.Low}return{stream_type:t,ssrcs:r,mid:o}}))}createUnmuteMessage(e){return e.map((e=>{let t,[i,{track:n,ssrcs:r,id:o}]=e;switch(i){case xP.LocalAudioTrack:t=TP.Audio;break;case xP.LocalVideoTrack:t=n._hints.includes(vP.SCREEN_TRACK)?TP.Screen:TP.High;break;case xP.LocalVideoLowTrack:t=TP.Low}return{stream_type:t,ssrcs:r,mid:o}}))}filterTobeUnSubscribedTracks(e,t){const i=[],n=this.remoteUserMap.get(e);if(!n)return i;if(t){const r=n.get(t);if(!r)return i;i.push([e,{kind:t,id:r}])}else Array.from(n.entries()).forEach((t=>{let[n,r]=t;i.push([e,{kind:n,id:r}])}));return i}createUnsubscribeMessage(e){const t=[];return e.forEach((e=>{let[i,{kind:n,id:r}]=e;switch(n){case QP.VIDEO:return void(i._videoSSRC&&t.push({stream_type:QP.VIDEO,ssrcId:i._videoSSRC}));case QP.AUDIO:return void(i._audioSSRC&&t.push({stream_type:QP.AUDIO,ssrcId:i._audioSSRC}))}})),t}createUnsubscribeAllMessage(e){const t=new Map;return e.forEach((e=>{let[i,{kind:n}]=e;if(t.has(i)){let e=t.get(i);n===QP.VIDEO?e|=SP.Video:e|=SP.Audio,t.set(i,e)}else n===QP.VIDEO?t.set(i,SP.Video):t.set(i,SP.Audio)})),{users:Array.from(t.entries()).map((e=>{let[t,i]=e;return{stream_id:t.uid,stream_type:i}}))}}withdrawRemoteTracks(e){e.forEach((e=>{let[t,{kind:i}]=e;const n=this.remoteUserMap.get(t);n&&(n.delete(i),0===Array.from(n.entries()).length&&this.remoteUserMap.delete(t))}))}async updateBitrateLimit(e){const t=this.localTrackMap.get(xP.LocalVideoTrack),i=this.localTrackMap.get(xP.LocalVideoLowTrack);t&&await t.track.setBitrateLimit(e.uplink),i&&e.low_stream_uplink&&await i.track.setBitrateLimit({max_bitrate:e.low_stream_uplink.bitrate,min_bitrate:e.low_stream_uplink.bitrate||0})}isP2PDisconnected(){return!this.connection||"connected"!==this.connection.peerConnectionState}mapPubResToRemoteConfig(e,t){return e.map(((e,i)=>{var n;let{stream_type:r}=e;return null===(n=t.find((e=>{let{stream_type:t}=e;return r===t})))||void 0===n?void 0:n.attributes}))}async tryToUnmuteAudio(e){for(let i=0;i<e.length;i++)if(e[i]instanceof JF){var t;const n=this.filterTobeUnmutedTracks(e[i]);if(0===n.length)continue;await(null===(t=this.connection)||void 0===t?void 0:t.unmuteLocal(n.map((e=>{let[,{id:t}]=e;return t}))));const r=this.createUnmuteMessage(n);return void await LG(this,GP.RequestUnmuteLocal,r)}}bindStatsUploaderEvents(){this.statsUploader.requestStats=()=>this.getStats(),this.statsUploader.requestLocalMedia=()=>Array.from(this.localTrackMap.entries()),this.statsUploader.requestRemoteMedia=()=>Array.from(this.remoteUserMap.entries()),this.statsUploader.requestVideoIsReady=e=>{var t;return!(null===(t=this.connection)||void 0===t||!t.getRemoteVideoIsReady(e))},this.statsUploader.requestUpload=(e,t)=>this.emit(GP.RequestUploadStats,e,t),this.statsUploader.requestAllTracks=()=>this.getAllTracks()}unbindStatsUploaderEvents(){this.statsUploader.requestStats=void 0,this.statsUploader.requestLocalMedia=void 0,this.statsUploader.requestRemoteMedia=void 0,this.statsUploader.requestVideoIsReady=void 0}async requestReconnect(){this.dtlsFailedCount+=1,await SG(Iw(this.dtlsFailedCount,_w)),this.emit(GP.RequestReconnect)}async reconnectP2P(){const e=Array.from(this.localTrackMap.entries()),t=this.createGatewayUnpublishMessage(e);Array.from(this.remoteUserMap.entries()),t.length>0&&await bG(this,GP.RequestUnpublishForReconnectPC,t),this.disconnectForReconnect(),this.emit(GP.RequestReconnectPC)}canPublishLowStream(){return this.localTrackMap.has(xP.LocalVideoTrack)||this.pendingLocalTracks.some((e=>e instanceof WJ))}throwIfTrackTypeNotMatch(e){if(e.filter((e=>e instanceof WJ)).length>1)throw new pw(hw.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(e.filter((e=>e instanceof JF)).length>1&&(e.some((e=>e instanceof JF&&e._bypassWebAudio))||!XP().webAudioMediaStreamDest))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode");for(const t of e){if(t instanceof WJ&&this.pendingLocalTracks.some((e=>e instanceof WJ)))throw new pw(hw.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(t instanceof JF&&this.pendingLocalTracks.some((e=>e instanceof JF))&&(!XP().webAudioMediaStreamDest||t._bypassWebAudio||this.pendingLocalTracks.some((e=>e instanceof JF&&e._bypassWebAudio))))throw new pw(hw.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode")}}getLowVideoTrack(e,t){const i=XP().supportDualStreamEncoding,n=MZ(MZ({},{width:160,height:120,framerate:15,bitrate:50}),t);let r;r=i?e._mediaStreamTrack.clone():function(e,t){let i=document.createElement("video"),n=document.createElement("canvas");i.setAttribute("style","display:none"),n.setAttribute("style","display:none"),i.setAttribute("muted",""),i.muted=!0,i.setAttribute("autoplay",""),i.autoplay=!0,i.setAttribute("playsinline",""),n.width=lG(t.width),n.height=lG(t.height);const r=lG(t.framerate||15);document.body.append(i),document.body.append(n);let o=e._mediaStreamTrack;i.srcObject=new MediaStream([o]),i.play();const s=n.getContext("2d");if(!s)throw new pw(hw.UNEXPECTED_ERROR,"can not get canvas context");const a=XP(),c=n.captureStream(a.supportRequestFrame?0:r).getVideoTracks()[0],A=Xx((()=>(()=>{if(i.paused&&i.play(),i.videoHeight>2&&i.videoWidth>2){const e=i.videoWidth,t=i.videoHeight/e,r=n.width*t;Math.abs(r-n.height)>=2&&(mw.debug("adjust low stream resolution","".concat(n.width,"x").concat(n.height," -> ").concat(n.width,"x").concat(r)),n.height=r)}s.drawImage(i,0,0,n.width,n.height),c.requestFrame&&c.requestFrame(),o!==e._mediaStreamTrack&&(o=e._mediaStreamTrack,i.srcObject=new MediaStream([o]))})()),r),d=c.stop;return c.stop=()=>{d.call(c),A(),i.remove(),n.width=0,n.remove(),n=null,i=null,mw.debug("clean low stream renderer")},c}(e,n);const o=new WJ(r,MZ(MZ({},i&&{scaleResolutionDownBy:fG(n,e)}),{},{frameRate:n.framerate,bitrateMax:n.bitrate,bitrateMin:n.bitrate}));return o._hints.push(vP.LOW_STREAM),o}async globalLock(){return this.mutex.lock("From P2PChannel.globalLock")}}).prototype,"startP2PConnection",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"startP2PConnection"),PZ.prototype),tx(PZ.prototype,"connect",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"connect"),PZ.prototype),tx(PZ.prototype,"unpublish",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unpublish"),PZ.prototype),tx(PZ.prototype,"unpublishLowStream",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unpublishLowStream"),PZ.prototype),tx(PZ.prototype,"subscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"subscribe"),PZ.prototype),tx(PZ.prototype,"massSubscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"massSubscribe"),PZ.prototype),tx(PZ.prototype,"unsubscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unsubscribe"),PZ.prototype),tx(PZ.prototype,"massUnsubscribe",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"massUnsubscribe"),PZ.prototype),tx(PZ.prototype,"muteRemote",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"muteRemote"),PZ.prototype),tx(PZ.prototype,"unmuteRemote",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"unmuteRemote"),PZ.prototype),tx(PZ.prototype,"hasRemoteMediaWithLock",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"hasRemoteMediaWithLock"),PZ.prototype),tx(PZ.prototype,"disconnectForReconnect",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"disconnectForReconnect"),PZ.prototype),tx(PZ.prototype,"reEstablish",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"reEstablish"),PZ.prototype),tx(PZ.prototype,"updateBitrateLimit",[QZ],Object.getOwnPropertyDescriptor(PZ.prototype,"updateBitrateLimit"),PZ.prototype),LZ=PZ))||LZ;function QZ(e,t,i){const n=e[t];if("function"!=typeof n)throw new Error("Cannot use mutex on object property.");return i.value=async function(){const e=this.mutex,i=await e.lock("From P2PChannel.".concat(t));try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return await n.apply(this,o)}finally{i()}},i}function xZ(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var FZ,GZ="function"==typeof Symbol&&Symbol.observable||"@@observable",jZ=function(){return Math.random().toString(36).substring(7).split("").join(".")},YZ={INIT:"@@redux/INIT"+jZ(),REPLACE:"@@redux/REPLACE"+jZ(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+jZ()}};function HZ(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function KZ(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(xZ(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(xZ(1));return i(KZ)(e,t)}if("function"!=typeof e)throw new Error(xZ(2));var r=e,o=t,s=[],a=s,c=!1;function A(){a===s&&(a=s.slice())}function d(){if(c)throw new Error(xZ(3));return o}function u(e){if("function"!=typeof e)throw new Error(xZ(4));if(c)throw new Error(xZ(5));var t=!0;return A(),a.push(e),function(){if(t){if(c)throw new Error(xZ(6));t=!1,A();var i=a.indexOf(e);a.splice(i,1),s=null}}}function E(e){if(!HZ(e))throw new Error(xZ(7));if(void 0===e.type)throw new Error(xZ(8));if(c)throw new Error(xZ(9));try{c=!0,o=r(o,e)}finally{c=!1}for(var t=s=a,i=0;i<t.length;i++)(0,t[i])();return e}function l(e){if("function"!=typeof e)throw new Error(xZ(10));r=e,E({type:YZ.REPLACE})}function h(){var e,t=u;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(xZ(11));function i(){e.next&&e.next(d())}return i(),{unsubscribe:t(i)}}})[GZ]=function(){return this},e}return E({type:YZ.INIT}),(n={dispatch:E,subscribe:u,getState:d,replaceReducer:l})[GZ]=h,n}function WZ(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function JZ(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?WZ(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):WZ(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}!function(e){e.SET_SESSION_ID="SET_SESSION_ID",e.SET_P2P_ID="SET_P2P_id",e.SET_UID="SET_UID",e.SET_PUB_ID="SET_PUB_ID",e.KEY_METRIC_CLIENT_CREATED="KEY_METRIC_CLIENT_CREATED",e.KEY_METRIC_JOIN_START="KEY_METRIC_JOIN_START",e.AVOID_JOIN_START="AVOID_JOIN_START",e.KEY_METRIC_JOIN_END="KEY_METRIC_JOIN_END",e.KEY_METRIC_REQUEST_AP_START="KEY_METRIC_REQUEST_AP_START",e.KEY_METRIC_REQUEST_AP_END="KEY_METRIC_REQUEST_AP_END",e.KEY_METRIC_JOIN_GATEWAY_START="KEY_METRIC_JOIN_GATEWAY_START",e.KEY_METRIC_JOIN_GATEWAY_END="KEY_METRIC_JOIN_GATEWAY_END",e.KEY_METRIC_PEER_CONNECTION_START="KEY_METRIC_PEER_CONNECTION_START",e.KEY_METRIC_PEER_CONNECTION_END="KEY_METRIC_PEER_CONNECTION_END",e.KEY_METRIC_PUBLISH="KEY_METRIC_PUBLISH",e.KEY_METRIC_SUBSCRIBE="KEY_METRIC_SUBSCRIBE"}(FZ||(FZ={}));class qZ{constructor(e,t,i,n){tD(this,"store",void 0),tD(this,"reducer",void 0);const r={codec:e,audioCodec:t,mode:i,clientId:n,sessionId:null,p2pId:0,pubId:0,subId:0,avoidJoinStart:0,keyMetrics:{publish:[],subscribe:[]}};this.reducer=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case FZ.SET_SESSION_ID:return JZ(JZ({},e),{},{sessionId:t.sessionId});case FZ.SET_P2P_ID:return JZ(JZ({},e),{},{p2pId:t.p2pId});case FZ.SET_UID:return JZ(JZ({},e),{},{uid:t.uid});case FZ.SET_PUB_ID:return JZ(JZ({},e),{},{pubId:t.pubId});case FZ.KEY_METRIC_CLIENT_CREATED:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{clientCreated:t.metric})});case FZ.KEY_METRIC_JOIN_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinStart:t.metric})});case FZ.AVOID_JOIN_START:return JZ(JZ({},e),{},{avoidJoinStart:t.avoidJoinStart});case FZ.KEY_METRIC_JOIN_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinEnd:t.metric})});case FZ.KEY_METRIC_REQUEST_AP_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{requestAPStart:t.metric})});case FZ.KEY_METRIC_REQUEST_AP_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{requestAPEnd:t.metric})});case FZ.KEY_METRIC_JOIN_GATEWAY_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinGatewayStart:t.metric})});case FZ.KEY_METRIC_JOIN_GATEWAY_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{joinGatewayEnd:t.metric})});case FZ.KEY_METRIC_PEER_CONNECTION_START:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{peerConnectionStart:t.metric})});case FZ.KEY_METRIC_PEER_CONNECTION_END:return JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{peerConnectionEnd:t.metric})});case FZ.KEY_METRIC_PUBLISH:{const i=e.keyMetrics.publish,n=i.findIndex((e=>e.trackId===t.metric.trackId));return-1!==n?(i[n]=JZ(JZ({},i[n]),t.metric),JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{publish:[...i]})})):JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{publish:[...e.keyMetrics.publish,t.metric]})})}case FZ.KEY_METRIC_SUBSCRIBE:{const i=e.keyMetrics.subscribe,n=i.findIndex((e=>e.userId===t.metric.userId&&e.type===t.metric.type));return-1!==n?(i[n]=JZ(JZ({},i[n]),t.metric),JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{subscribe:[...i]})})):JZ(JZ({},e),{},{keyMetrics:JZ(JZ({},e.keyMetrics),{},{subscribe:[...e.keyMetrics.subscribe,t.metric]})})}default:return e}},this.store=KZ(this.reducer)}set sessionId(e){this.store.dispatch({type:FZ.SET_SESSION_ID,sessionId:e})}get sessionId(){return this.store.getState().sessionId}get codec(){return this.store.getState().codec}get audioCodec(){return this.store.getState().audioCodec}get clientId(){return this.store.getState().clientId}set p2pId(e){this.store.dispatch({type:FZ.SET_P2P_ID,p2pId:e})}get p2pId(){return this.store.getState().p2pId}set uid(e){this.store.dispatch({type:FZ.SET_UID,uid:e})}get uid(){return this.store.getState().uid}set pubId(e){this.store.dispatch({type:FZ.SET_PUB_ID,pubId:e})}get pubId(){return this.store.getState().pubId}clientCreated(){this.store.dispatch({type:FZ.KEY_METRIC_CLIENT_CREATED,metric:performance.now()})}joinStart(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_START,metric:performance.now()})}get avoidJoinStart(){return this.store.getState().avoidJoinStart}set avoidJoinStart(e){this.store.dispatch({type:FZ.AVOID_JOIN_START,avoidJoinStart:e})}joinEnd(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_END,metric:performance.now()})}requestAPStart(){this.store.dispatch({type:FZ.KEY_METRIC_REQUEST_AP_START,metric:performance.now()})}requestAPEnd(){this.store.dispatch({type:FZ.KEY_METRIC_REQUEST_AP_END,metric:performance.now()})}joinGatewayStart(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_GATEWAY_START,metric:performance.now()})}joinGatewayEnd(){this.store.dispatch({type:FZ.KEY_METRIC_JOIN_GATEWAY_END,metric:performance.now()})}peerConnectionStart(){this.store.dispatch({type:FZ.KEY_METRIC_PEER_CONNECTION_START,metric:performance.now()})}peerConnectionEnd(){this.store.dispatch({type:FZ.KEY_METRIC_PEER_CONNECTION_END,metric:performance.now()})}publish(e,t,i,n){this.store.dispatch({type:FZ.KEY_METRIC_PUBLISH,metric:JZ(JZ({trackId:e,type:t},i&&{publishStart:i}),n&&{publishEnd:n})})}subscribe(e,t,i,n,r){this.store.dispatch({type:FZ.KEY_METRIC_SUBSCRIBE,metric:JZ(JZ(JZ({userId:e,type:t},i&&{subscribeStart:i}),n&&{subscribeEnd:n}),r&&{firstFrame:r})})}massSubscribe(e,t,i,n){e.forEach((e=>{this.store.dispatch({type:FZ.KEY_METRIC_SUBSCRIBE,metric:JZ(JZ(JZ({userId:e.userId,type:e.type},t&&{subscribeStart:t}),i&&{subscribeEnd:i}),n&&{firstFrame:n})})}))}get keyMetrics(){return this.store.getState().keyMetrics}}let XZ;const zZ=()=>void 0!==window.isSecureContext;class ZZ{constructor(e,t){tD(this,"time",void 0),tD(this,"sequence",void 0),tD(this,"name",void 0),tD(this,"elapse",void 0),this.name=e,this.time=performance.now(),this.sequence=KP[t].indexOf(e)}setElapse(e){this.elapse=e}}const $Z=new Map;class e${constructor(e,t){tD(this,"records",[]),tD(this,"_id",void 0),tD(this,"_group",void 0),tD(this,"_localTimeStamp",void 0),tD(this,"_performanceTimeStamp",void 0),this._id=e,this._group=t,this._localTimeStamp=Date.now(),this._performanceTimeStamp=performance.now()}checkPoint(e){const t=new ZZ(e,this._group);-1===t.sequence&&mw.warning("[".concat(this._id,"] check point record failed, cannot get the sequence")),this.records.push(t);const i=this.records.find((e=>e.sequence===t.sequence-1));i&&t.setElapse(t.time-i.time)}getRecord(e){return this.records.find((t=>t&&t.name===e))}resetRecords(){this.records.length=0}}var t$,i$,n$,r$,o$,s$,a$,c$,A$;function d$(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function u$(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d$(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let E$=(t$=Ww("AgoraRTCClient","store.clientId"),i$=bx({report:Px}),n$=bx(),r$=bx({report:Px}),o$=Lx(),s$=bx({report:Px}),a$=Lx({report:Px}),t$((tx((A$=class extends Ew{get connectionState(){return this._gateway.state}get remoteUsers(){return this._users}get localTracks(){return this._p2pChannel.getAllTracks(!0)}get uid(){return this._uid}get channelName(){return this._channelName}get isStringUID(){return!!this._joinInfo&&!!this._joinInfo.stringUid}constructor(e){let t;if(super(),tD(this,"store",void 0),tD(this,"_uid",void 0),tD(this,"_channelName",void 0),tD(this,"_uintUid",void 0),tD(this,"_users",[]),tD(this,"_codec",void 0),tD(this,"_mode",void 0),tD(this,"_config",void 0),tD(this,"_clientId",void 0),tD(this,"_appId",void 0),tD(this,"_sessionId",null),tD(this,"_key",void 0),tD(this,"_joinInfo",void 0),tD(this,"_gateway",void 0),tD(this,"_statsCollector",void 0),tD(this,"_configDistribute",void 0),tD(this,"_leaveMutex",new Qx("client-leave")),tD(this,"_publishMutex",new Qx("client-publish")),tD(this,"_renewTokenMutex",new Qx("client-renewtoken")),tD(this,"_subscribeMutex",new Qx("client-subscribe")),tD(this,"_encryptionMode","none"),tD(this,"_encryptionSecret",null),tD(this,"_encryptionSalt",null),tD(this,"_proxyServer",void 0),tD(this,"_performanceRecorder",void 0),tD(this,"_turnServer",{servers:[],mode:"auto"}),tD(this,"_cloudProxyServerMode","disabled"),tD(this,"_isDualStreamEnabled",!1),tD(this,"_defaultStreamFallbackType",void 0),tD(this,"_lowStreamParameter",void 0),tD(this,"_streamFallbackTypeCacheMap",new Map),tD(this,"_remoteStreamTypeCacheMap",new Map),tD(this,"_axiosCancelSource",dw.CancelToken.source()),tD(this,"_audioVolumeIndicationInterval",void 0),tD(this,"_networkQualityInterval",void 0),tD(this,"_userOfflineTimeout",void 0),tD(this,"_streamRemovedTimeout",void 0),tD(this,"_injectStreamingClient",void 0),tD(this,"_liveTranscodeStreamingClient",void 0),tD(this,"_liveRawStreamingClient",void 0),tD(this,"_channelMediaRelayClient",void 0),tD(this,"_networkQualitySensitivity","normal"),tD(this,"_p2pChannel",void 0),tD(this,"_useLocalAccessPoint",!1),tD(this,"_joinAndNotLeaveYet",!1),tD(this,"_numberOfJoinCount",0),tD(this,"_remoteDefaultVideoStreamType",void 0),tD(this,"_handleLocalTrackEnable",((e,t,i)=>{this.publish(e,!1).then(t).catch(i)})),tD(this,"_handleLocalTrackDisable",((e,t,i)=>{this.unpublish(e).then(t).catch(i)})),tD(this,"_handleUserOnline",(e=>{this.isStringUID&&"string"!=typeof e.uid&&(mw.error("[".concat(this._clientId,"] StringUID is Mixed with UintUID")),xw("error",this,"StringUID is Mixed with UintUID"));const t=this._users.find((t=>t.uid===e.uid));if(t)t._trust_in_room_=!0;else{const t=new zJ(e.uid,e.uint_id||e.uid);this._users.push(t),mw.debug("[".concat(this._clientId,"] user online"),e.uid),Gw("info",this,"user-joined",{uid:e.uid}),this.emit(FL.USER_JOINED,t)}})),tD(this,"_handleUserOffline",(e=>{const t=this._users.find((t=>t.uid===e.uid));t&&(this._handleRemoveStream(e),MG(this._users,t),this._remoteStreamTypeCacheMap.delete(t.uid),this._streamFallbackTypeCacheMap.delete(t.uid),mw.debug("[".concat(this._clientId,"] user offline"),e.uid,"reason:",e.reason),Gw("info",this,"user-left",{reason:e.reason,uid:e.uid}),this.emit(FL.USER_LEAVED,t,e.reason))})),tD(this,"_handleAddAudioOrVideoStream",((e,t,i,n,r,o,s)=>{const a=this._users.find((e=>e.uid===t));if(!a)return mw.error("[".concat(this._clientId,"] can not find target user!(on_add_stream)")),void Fw("error",["AgoraRTCGateway",this._clientId],"add_".concat(e,"_stream"),"can not find target user!");mw.debug("[".concat(this._clientId,"] stream added with uid ").concat(t,", type ").concat(e)),Fw("debug",["AgoraRTCGateway",this._clientId],"add_".concat(e,"_stream"),{uid:t,mediaType:e});const c="audio"===e?a.hasAudio:a.hasVideo;a._uintid||(a._uintid=r||t),a._trust_stream_added_state_=!0,"audio"===e?(a._audio_added_=!0,void 0!==i&&(a._audioSSRC=i),void 0!==n&&(a._cname=n),o&&(a._audioOrtc=o)):(a._video_added_=!0,void 0!==i&&(a._videoSSRC=i),void 0!==n&&(a._cname=n),void 0!==s&&(a._rtxSsrcId=s),o&&(a._videoOrtc=o)),("audio"===e?a.hasAudio:a.hasVideo)&&!c&&(mw.info("[".concat(this._clientId,"] remote user ").concat(a.uid," published ").concat(e)),xw("info",this,"remote user ".concat(a.uid," published ").concat(e)),Gw("info",this,"user-published",{uid:a.uid,mediaType:e}),this.emit(FL.USER_PUBLISHED,a,e)),"video"===e?Px.onGatewayStream(this._sessionId,NL.ON_ADD_VIDEO_STREAM,yL.ON_ADD_VIDEO_STREAM,{peer:r||t}):Px.onGatewayStream(this._sessionId,NL.ON_ADD_AUDIO_STREAM,yL.ON_ADD_AUDIO_STREAM,{peer:r||t}),this._p2pChannel.hasPendingRemoteMedia(a,e)&&this.subscribe(a,e).catch((e=>{mw.error("[".concat(this._clientId,"] resubscribe error"),e.toString()),xw("error",this,"resubscribe error: ".concat(e.toString()))}))})),tD(this,"_handleRemoveStream",(e=>{const t=this._users.find((t=>t.uid===e.uid));if(!t)return mw.warning("[".concat(this._clientId,"] can not find target user!(on_remove_stream)")),void Fw("warning",["AgoraRTCGateway",this._clientId],"remove_stream",{uid:e.uid,info:"can not find target user!"});mw.debug("[".concat(this._clientId,"] stream removed with uid ").concat(e.uid)),Fw("debug",["AgoraRTCGateway",this._clientId],"remove_stream",{uid:e.uid});let i=()=>{};t.hasAudio&&t.hasVideo?i=()=>{mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished audio track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"audio"}),this.emit(FL.USER_UNPUBLISHED,t,"audio"),mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished video track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"video"}),this.emit(FL.USER_UNPUBLISHED,t,"video")}:t.hasVideo?i=()=>{mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished video track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"video"}),this.emit(FL.USER_UNPUBLISHED,t,"video")}:t.hasAudio&&(i=()=>{mw.info("[".concat(this._clientId,"] remote user ").concat(t.uid," unpublished audio track")),Gw("info",this,"user-unpublished",{uid:t.uid,mediaType:"audio"}),this.emit(FL.USER_UNPUBLISHED,t,"audio")}),t._trust_stream_added_state_=!0,t._audio_added_=!1,t._video_added_=!1,this._p2pChannel.unsubscribe(t).then((e=>{if(e)return this._gateway.unsubscribe(e,t.uid)})),t._audioSSRC=void 0,t._videoSSRC=void 0,t._audioOrtc=void 0,t._videoOrtc=void 0,t._rtxSsrcId=void 0,Px.onGatewayStream(this._sessionId,NL.ON_REMOVE_STREAM,yL.ON_REMOVE_STREAM,{peer:e.uint_id||e.uid}),i()})),tD(this,"_handleSetStreamLocalEnable",((e,t,i)=>{const n=this._users.find((e=>e.uid===t));if(!n)return mw.error("[".concat(this._clientId,"] can not find target user!(disable_local)")),void Fw("error",this,"disable_local_video","can not find target user!(disable_local)");mw.debug("[".concat(this._clientId,"] local ").concat(e," ").concat(i?"enabled":"disabled"," with uid ").concat(t)),Fw("debug",this,"disable_local_video","local ".concat(e," ").concat(i?"enabled":"disabled"," with uid ").concat(t));const r="audio"===e?n.hasAudio:n.hasVideo;if("audio"===e){n._trust_audio_enabled_state_=!0;const e=n._audio_enabled_;if(n._audio_enabled_=i,n._audio_enabled_===e)return;{const e=n._audio_enabled_?"enable-local-audio":"disable-local-audio";mw.debug("[".concat(this._clientId,"] user-info-updated, uid: ").concat(t,", msg: ").concat(e)),Kw("debug",this,"user-info-updated",{uid:t,msg:e}),this.emit(FL.USER_INFO_UPDATED,t,e)}}else{n._trust_video_enabled_state_=!0;const e=n._video_enabled_;if(n._video_enabled_=i,n._video_enabled_===e)return;{const e=n._video_enabled_?"enable-local-video":"disable-local-video";mw.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(t,", msg: ").concat(e)),Kw("debug",this,"user-info-updated",{uid:t,msg:e}),this.emit(FL.USER_INFO_UPDATED,t,e)}}const o="audio"===e?n.hasAudio:n.hasVideo;return r!==o?!r&&o?(mw.info("[".concat(this._clientId,"] remote user ").concat(t," published ").concat(e)),Gw("info",this,"user-published",{uid:t,mediaType:e}),void this.emit(FL.USER_PUBLISHED,n,e)):("video"===e&&n._videoTrack&&n._videoTrack._destroy(),"audio"===e&&n._audioTrack,this._p2pChannel.muteRemote(n,e),mw.info("[".concat(this._clientId,"] remote user ").concat(t," unpublished ").concat(e)),Gw("info",this,"user-unpublished",{uid:t,mediaType:e}),void this.emit(FL.USER_UNPUBLISHED,n,e)):void 0})),tD(this,"_handleMuteStream",((e,t,i)=>{mw.debug("[".concat(this._clientId,"] receive mute message"),e,t,i),Fw("debug",this,"mute_".concat(t),i);const n=this._users.find((t=>t.uid===e));if(!n)return mw.warning("[".concat(this._clientId,"] can not find remote user, ignore mute event, uid: ").concat(e)),void Fw("warning",this,"mute_".concat(t),"can not find remote user, ignore mute event, uid: ".concat(e));const r="audio"===t?n.hasAudio:n.hasVideo;if("audio"===t){n._trust_audio_mute_state_=!0;const t=n._audio_muted_;if(n._audio_muted_=i,n._audio_muted_===t)return;{const t=n._audio_muted_?"mute-audio":"unmute-audio";mw.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(e,", msg: ").concat(t)),Kw("debug",this,"user-info-updated",{uid:e,msg:t}),this.emit(FL.USER_INFO_UPDATED,e,t)}}else{n._trust_video_mute_state_=!0;const t=n._video_muted_;if(n._video_muted_=i,n._video_muted_===t)return;{const t=n._video_muted_?"mute-video":"unmute-video";mw.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(e,", msg: ").concat(t)),Kw("debug",this,"user-info-updated",{uid:e,msg:t}),this.emit(FL.USER_INFO_UPDATED,e,t)}}const o="audio"===t?n.hasAudio:n.hasVideo;return r!==o?!r&&o?(mw.info("[".concat(this._clientId,"] remote user ").concat(e," published ").concat(t)),Gw("info",this,"user-published",{uid:n.uid,mediaType:t}),void this.emit(FL.USER_PUBLISHED,n,t)):("video"===t&&n._videoTrack&&n._videoTrack._destroy(),"audio"===t&&n._audioTrack,this._p2pChannel.muteRemote(n,t),mw.info("[".concat(this._clientId,"] remote user ").concat(e," unpublished ").concat(t)),Gw("info",this,"user-unpublished",{uid:e,mediaType:t}),void this.emit(FL.USER_UNPUBLISHED,n,t)):void 0})),tD(this,"_handleP2PLost",(async e=>{if(mw.debug("[".concat(this._clientId,"] receive p2p lost"),e),Fw("debug",this,"p2p_lost",e),parseInt(e.p2pid,10)!==this.store.p2pId)return mw.warning("P2PLost stream not found",e),void Fw("warning",this,"p2p_lost","P2PLost stream not found, ".concat(e));await this._p2pChannel.requestReconnect()})),tD(this,"_handleTokenWillExpire",(()=>{mw.debug("[".concat(this._clientId,"] received message onTokenPrivilegeWillExpire")),Fw("debug",this,"token_privilege_will_expire"),this.emit(FL.ON_TOKEN_PRIVILEGE_WILL_EXPIRE)})),tD(this,"_handleBeforeUnload",(e=>{"beforeunload"===e.type&&void 0!==e.returnValue&&""!==e.returnValue||(this.leave(),mw.info("[".concat(this._clientId,"] auto leave onbeforeunload or pagehide")),jw("info",["window",this.store.clientId],Uy()?"beforeunload":"pagehide"))})),tD(this,"_handleUpdateNetworkQuality",(()=>{if("normal"===this._networkQualitySensitivity)return;if(navigator&&void 0!==navigator.onLine&&!navigator.onLine)return void this.emit(FL.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6});const e={downlinkNetworkQuality:0,uplinkNetworkQuality:0};e.uplinkNetworkQuality=this._p2pChannel.getUplinkNetworkQuality(),e.downlinkNetworkQuality=this._p2pChannel.getDownlinkNetworkQuality(),this.emit(FL.NETWORK_QUALITY,e)})),this._codec=e.codec,this._mode=e.mode,this._clientId=vG(5,"client-"),this.store=new qZ(e.codec,e.audioCodec,e.mode,this._clientId),this.store.clientCreated(),e.proxyServer&&this.setProxyServer(e.proxyServer,!0),e.turnServer&&this.setTurnServer(e.turnServer,!0),mw.info("[".concat(this._clientId,"] Initializing AgoraRTC client v").concat(Xw," build: ").concat(qw,", mode: ").concat(this._mode,", codec: ").concat(this._codec)),Kw("info",this,"constructor",{version:Xw,build:qw,mode:this._mode,codec:this._codec}),this._performanceRecorder=function(e,t){const i=new e$(e,"join");return $Z.set(e,i),i}(this._clientId),e.clientRoleOptions)try{eP(e.clientRoleOptions),t=Object.assign({},e.clientRoleOptions)}catch(e){mw.warning("[".concat(this._clientId,"] ").concat(e.toString())),xw("warning",this,e.toString())}this._statsCollector=new oG(this.store),this._statsCollector.onStatsException=(e,t,i)=>{mw.debug("[".concat(this._clientId,"] receive exception msg, code: ").concat(e,", msg: ").concat(t,", uid: ").concat(i)),Gw("debug",this,FL.EXCEPTION,{code:e,message:t,uid:i}),this.emit(FL.EXCEPTION,{code:e,msg:t,uid:i})},this._statsCollector.onUploadPublishDuration=(e,t,i,n)=>{const r=this._users.find((t=>t.uid===e));r&&Px.peerPublishStatus(this._sessionId,{subscribeElapse:n,audioPublishDuration:t,videoPublishDuration:i,peer:r._uintid})},this._gateway=new AW(this.store,{clientId:this._clientId,mode:this._mode,codec:this._codec,websocketRetryConfig:e.websocketRetryConfig||_w,httpRetryConfig:e.httpRetryConfig||_w,forceWaitGatewayResponse:void 0===e.forceWaitGatewayResponse||e.forceWaitGatewayResponse,statsCollector:this._statsCollector,role:e.role,clientRoleOptions:t}),this._config=e,this._configDistribute=new kW,this._p2pChannel=new VZ(this.store,this._statsCollector),this._handleP2PChannelEvents(),this._handleGatewayEvents()}async join(e,t,i,n,r){const o=++this._numberOfJoinCount;this._performanceRecorder.checkPoint("startJoin"),this.store.joinStart();const s="HTTPS"===(XZ||XZ||(XZ=(window.location.protocol.split(":")[0]||"").toUpperCase(),XZ)),a=zZ()?window.isSecureContext:"Browser Not Support";if(!zZ()&&!s||!window.isSecureContext){const e="The website must be running in a secure context (About secure context: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts ), otherwise the media collection will be restricted by the browser";mw.warning(e),Yw("warning",this,e)}const c=NG();"DISCONNECTED"===this.connectionState&&(this.store.avoidJoinStart=Math.round(Date.now()),mw.debug("[".concat(this._clientId,"] set avoidJoinStart to ").concat(this.store.avoidJoinStart)),Yw("debug",this,"join",void 0,"[".concat(this._clientId,"] set avoidJoinStart to ").concat(this.store.avoidJoinStart)));const A=Px.reportApiInvoke(c,{name:wL.JOIN,options:[e,t,i,n],states:{isHttps:s,isSecureContext:a},tag:bL.TRACER});try{if(!i&&null!==i)throw new pw(hw.INVALID_PARAMS,"Invalid token: ".concat(i,". If you don not use token, set it to null"));i&&lL(i,"token",1,2047),lL(e,"appid",1,2047),pL(t),n&&_L(n),r&&lL(r,"optionalInfo",1,2047)}catch(e){throw A.onError(e),e}if(mw.info("[".concat(this._clientId,"] start join channel ").concat(t,", join number: ").concat(o)),Kw("info",this,"join",{channel:t}),this._leaveMutex.isLocked&&(mw.debug("[".concat(this._clientId,"] join: waiting leave operation")),xw("debug",this,"join: waiting leave operation"),(await this._leaveMutex.lock())(),mw.debug("[".concat(this._clientId,"] join: continue")),xw("debug",this,"join: continue")),this._joinAndNotLeaveYet=!0,"DISCONNECTED"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already in connecting/connected state"));throw A.onError(e),e}this._sessionId||(this._sessionId=c,this.store.sessionId=this._sessionId),this._gateway.state="CONNECTING";const d=u$({clientId:this._clientId,appId:e,sid:this._sessionId,cname:t,uid:"string"!=typeof n?n:null,turnServer:this._turnServer,proxyServer:this._proxyServer,token:i||e,cloudProxyServer:this._cloudProxyServerMode,optionalInfo:r,useLocalAccessPoint:this._useLocalAccessPoint},void 0!==this._remoteDefaultVideoStreamType&&{defaultVideoStream:this._remoteDefaultVideoStreamType});if("string"==typeof n&&(d.stringUid=n,this._uintUid?(d.uid=this._uintUid,this._uintUid=void 0):d.uid=0),"none"!==this._encryptionMode&&this._encryptionSecret){if(d.aesmode=this._encryptionMode,d.aespassword=await(async e=>{const t=FG("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCMnXAHkKIGAM+x4N22gCI+Wyu\nSTM9ztkT3uYslTT2PuKmZfPzhH6kVdO7PTjGCOZnAsyb3oTtWat0KcxQ4jxvqQV+\nHvYl3iI1Yd4vl2c3qRMJPLtRDfNxa2Mcxgq7e9aEUibzdd0st+OJAy3tOj/Y0aVy\nxQiYDz3vqa6bP29adwIDAQAB"),i=await window.crypto.subtle.importKey("spki",t,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),n=sG(e),r=await window.crypto.subtle.encrypt({name:"RSA-OAEP"},i,n);return GG(new Uint8Array(r))})(this._encryptionSecret),!this._joinAndNotLeaveYet)throw new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this._encryptionSalt&&(d.aessalt=this._encryptionSalt)}this._startSession(this._sessionId,{channel:t,appId:e});const u=this._sessionId;setTimeout((()=>{"CONNECTING"===this.connectionState&&u===this._sessionId&&Px.joinChannelTimeout(this._sessionId,5)}),5e3);try{let n;const r=d.cloudProxyServer;if("443only"===r)d.proxyServer=cb("PROXY_SERVER_TYPE2");else if(["proxy3","proxy4","proxy5"].includes(r)){const e=cb("PROXY_SERVER_TYPE3");Array.isArray(e)?d.proxyServer=e[0]:d.proxyServer=e}if(Px.setProxyServer(d.proxyServer),mw.setProxyServer(d.proxyServer),Qw(d.proxyServer),this._performanceRecorder.checkPoint("startRequestAp"),this.store.requestAPStart(),d.stringUid&&!d.uid&&"normal"===r){await OW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w,!1);const e=await vW(d.stringUid,d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w);mw.debug("getUserAccount Success ".concat(d.stringUid," => ").concat(e)),xw("debug",this,"getUserAccount Success ".concat(d.stringUid," => ").concat(e)),d.uid=e,n=await SW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w)}else if(d.stringUid&&!d.uid){const e=await vW(d.stringUid,d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w);mw.debug("getUserAccount Success ".concat(d.stringUid," => ").concat(e)),xw("debug",this,"getUserAccount Success ".concat(d.stringUid," => ").concat(e)),d.uid=e,n=await OW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w,!0)}else n=await OW(d,this._axiosCancelSource.token,this._config.httpRetryConfig||_w,!0);if(!this._joinAndNotLeaveYet)throw new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this.store.requestAPEnd(),this._performanceRecorder.checkPoint("startJoinGateway"),setTimeout((()=>{this._configDistribute.startGetConfigDistribute(d,this._axiosCancelSource.token),this._configDistribute.on(BP.UPDATE_BITRATE_LIMIT,(e=>{this._p2pChannel.updateBitrateLimit(e)}))}),0),this._key=i||e;const o=n.gatewayInfo;this._joinInfo=u$(u$({},d),{},{cid:o.cid,uid:d.uid?d.uid:o.uid,vid:o.vid,apResponse:o.res,uni_lbs_ip:o.uni_lbs_ip,gatewayAddrs:o.gatewayAddrs});const s=await this._joinGateway();if(!this._joinAndNotLeaveYet)throw new pw(hw.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));return A.onSuccess(s),this._appId=e,this._channelName=d.cname,this._uid=s,this.store.uid=s,setTimeout((()=>{this._networkQualityInterval&&window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=window.setInterval(this._handleUpdateNetworkQuality,2e3),window.addEventListener(Uy()?"beforeunload":"pagehide",this._handleBeforeUnload)}),0),mw.info("[".concat(this._clientId,"] Joining channel success: ").concat(t)),Kw("info",this,"join",t,"success"),setTimeout((()=>{cb("USE_NEW_LOG")?Jw():mw.startUpload()}),5e3),this._performanceRecorder.checkPoint("finishJoin"),this.store.joinEnd(),this,_b.includes(this)||_b.push(this),s}catch(e){const i=Array.isArray(e)?e[0]:e;throw mw.error("[".concat(this._clientId,"] join number: ").concat(o,", Joining channel failed, rollback"),i),Kw("error",this,"join",t,i.toString()),i.code!==hw.OPERATION_ABORTED&&this._numberOfJoinCount===o&&(this._gateway.state="DISCONNECTED",this._reset()),A.onError(i),i}}_joinGateway(){if(!this._joinInfo||!this._key)throw new pw(hw.INVALID_OPERATION);return this._gateway.join(this._joinInfo,this._key,!("disabled"!==this._joinInfo.cloudProxyServer||!cb("JOIN_WITH_FALLBACK_SIGNAL_PROXY"))).then((e=>e)).catch((e=>{if(e.code===hw.INIT_WEBSOCKET_TIMEOUT)return this._gateway.leave(!0,xL.FALLBACK);throw e})).then((e=>{if(e)return e;if(mw.info("[".concat(this._clientId,"] join timeout, fallback to proxy")),!this._joinInfo||!this._key)throw new pw(hw.INVALID_OPERATION);this._joinInfo.cloudProxyServer="fallback",this._cloudProxyServerMode="fallback";const t=cb("PROXY_SERVER_TYPE3");if(Array.isArray(t))if(this._joinInfo.apUrl){const e=new UK(this._joinInfo.apUrl).host.split("."),i=e.slice(e.length-2).join(".");t.forEach((e=>{this._joinInfo&&e.includes(i)&&(this._joinInfo.proxyServer=e)})),this._joinInfo.proxyServer||(this._joinInfo.proxyServer=t[0])}else this._joinInfo.proxyServer=t[0];else this._joinInfo.proxyServer=t;return mw.setProxyServer(this._joinInfo.proxyServer),Px.setProxyServer(this._joinInfo.proxyServer),Qw(this._joinInfo.proxyServer),Px.reportApiInvoke(this._sessionId,{name:wL.JOIN_FALLBACK_TO_PROXY,options:[this._joinInfo.proxyServer],tag:bL.TRACER}).onSuccess(),this.emit(FL.JOIN_FALLBACK_TO_PROXY,this._joinInfo.proxyServer),this._gateway.join(this._joinInfo,this._key)})).then((e=>e))}async leave(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.LEAVE,options:[],tag:bL.TRACER});mw.info("[".concat(this._clientId,"] Leaving channel")),Kw("info",this,"leave"),window.removeEventListener(Uy()?"beforeunload":"pagehide",this._handleBeforeUnload),this._reset(),function(e){const t=_b.indexOf(e);-1!==t&&_b.splice(t,1)}(this);const t=await this._leaveMutex.lock();if("DISCONNECTED"===this.connectionState)return mw.info("[".concat(this._clientId,"] Leaving channel repeated, success")),t(),e.onSuccess();await this._gateway.leave("CONNECTED"!==this.connectionState),mw.info("[".concat(this._clientId,"] Leaving channel success")),Kw("info",this,"leave",void 0,"success"),this._joinAndNotLeaveYet=!1,t(),e.onSuccess()}async publish(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Array.isArray(e)||(e=[e]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.PUBLISH,options:e.map((e=>e?Object(e).toString():"null")),tag:bL.TRACER});if(0===e.length){const e=new pw(hw.INVALID_PARAMS,"track list is empty");return i.onError(e),e.throw()}if("audience"===this._gateway.role){const e=new pw(hw.INVALID_OPERATION,"audience can not publish stream");return i.onError(e),e.throw()}for(const n of e){if(!(n instanceof Fx)){const e=new pw(hw.INVALID_PARAMS,"parameter is not local track");return i.onError(e),e.throw()}if(!n._enabled&&t){const e=new pw(hw.TRACK_IS_DISABLED,"can not publish a disabled track: ".concat(n.getTrackId()));return i.onError(e),e.throw()}}mw.info("[".concat(this._clientId,"] Publishing tracks, id ").concat(e.map((e=>"".concat(e.getTrackId()," "))))),Kw("info",this,"publish",e.map((e=>"".concat(e.getTrackId())))),await this._configDistribute.awaitConfigDistributeComplete(),t&&e.forEach((e=>{const t=this._configDistribute.getBitrateLimit();e instanceof WJ&&t&&e.setBitrateLimit(t.uplink)}));const n=await this._publishMutex.lock();try{await this._publishHighStream(e),i.onSuccess(e.map((e=>e.trackMediaType+":"+e.getTrackLabel())).toString()),mw.info("[".concat(this._clientId,"] Publish success, id ").concat(e.map((e=>"".concat(e.getTrackId()," "))))),Kw("info",this,"publish",e.map((e=>"".concat(e.getTrackId()))),"success")}catch(e){throw i.onError(e),mw.error("[".concat(this._clientId,"] publish error"),e.toString()),Kw("error",this,"publish",void 0,e.toString()),e}finally{n()}}async unpublish(e){if(!this._joinInfo||void 0===this._uid)throw new pw(hw.INVALID_OPERATION,"Can't unpublish stream, haven't joined yet!");e?Array.isArray(e)||(e=[e]):e=this._p2pChannel.getAllTracks(!0);const t=Px.reportApiInvoke(this._sessionId,{name:wL.UNPUBLISH,options:e.map((e=>e.getTrackId())),tag:bL.TRACER});mw.info("[".concat(this._clientId,"] Unpublish tracks, tracks ").concat(e.map((e=>"".concat(e.getTrackId()," ")))," ")),Kw("info",this,"unpublish",e.map((e=>"".concat(e.getTrackId()))));const i=await this._publishMutex.lock();try{const n=await this._p2pChannel.unpublish(e);n&&await this._gateway.unpublish(n,this._uid),mw.info("[".concat(this._clientId,"] Unpublish success,tracks ").concat(e.map((e=>"".concat(e.getTrackId()))))),Kw("info",this,"unpublish",e.map((e=>"".concat(e.getTrackId()))),"success"),t.onSuccess()}catch(e){throw t.onError(e),mw.error("[".concat(this._clientId,"] unpublish error"),e.toString()),Kw("error",this,"unpublish",void 0,e.toString()),e}finally{i&&i()}}async subscribe(e,t){uL(t,"mediaType",["audio","video"]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SUBSCRIBE,options:[e.uid,t],tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream, not joined");throw i.onError(e),e}if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));throw i.onError(e),e}if(!this._users.find((t=>t===e))){const t=new pw(hw.INVALID_REMOTE_USER,"user is not in the channel");throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", this user is not in the channel")),Kw("error",this,"subscribe",e.uid,"this user is not in the channel"),i.onError(t),t}if(!e.hasAudio&&!e.hasVideo){const t=new pw(hw.INVALID_REMOTE_USER,"user is not published");throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", user is not published")),Kw("error",this,"subscribe",e.uid,"this user is not published"),i.onError(t),t}if("audio"===t&&(!e.hasAudio||void 0===e._audioSSRC)||"video"===t&&(!e.hasVideo||void 0===e._videoSSRC)){const n=new pw(hw.REMOTE_USER_IS_NOT_PUBLISHED);throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid," with mediaType ").concat(t,", remote track is not published")),Kw("error",this,"subscribe",e.uid,"mediaType ".concat(t,", remote track is not published")),i.onError(n),n}const n="audio"===t?e._audioSSRC:e._videoSSRC,r="audio"===t?e._audioOrtc:e._videoOrtc,o="video"===t?e._rtxSsrcId:void 0,s={stream_type:"audio"===t?QP.AUDIO:QP.VIDEO,ssrcId:n},a=await this._subscribeMutex.lock();mw.info("[".concat(this._clientId,"] subscribe user ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"subscribe",{uid:e.uid,mediaType:t});try{if(await this._p2pChannel.hasRemoteMediaWithLock(e,t))await this._p2pChannel.unmuteRemote(e,t);else try{iG.markSubscribeStart(this.store.clientId,n),this.store.subscribe(e.uid,t,performance.now()),await this._p2pChannel.subscribe(e,t,n,o,r);try{await this._gateway.subscribe(e.uid,s,!0)}catch(i){throw await this._p2pChannel.unsubscribe(e,t),i}this.store.subscribe(e.uid,t,void 0,performance.now()),this._p2pChannel.reportSubscribeEvent(!0,null,e,t)}catch(i){throw this._p2pChannel.reportSubscribeEvent(!1,null==i?void 0:i.code,e,t),i}mw.info("[".concat(this._clientId,"] subscribe success user ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"subscribe",{uid:e.uid,mediaType:t},"success"),this._defaultStreamFallbackType&&this.setStreamFallbackOption(e.uid,this._defaultStreamFallbackType).catch((e=>{mw.warning("[".concat(this._clientId,"] auto set fallback failed"),e),xw("warning",this,"auto set fallback failed, ".concat(e.toString()))}));const c="audio"===t?e._audioTrack:e._videoTrack;if(!c){const e=new pw(hw.UNEXPECTED_ERROR,"can not find remote track in user object");return i.onError(e),e.throw()}return i.onSuccess(c.getTrackId()),c}catch(n){throw i.onError(n),mw.error("[".concat(this._clientId,"] subscribe user ").concat(e.uid," error"),n),Kw("error",this,"subscribe",{uid:e.uid,mediaType:t},n.toString()),n}finally{a()}}async massSubscribe(e){hL(e,"subscribeList");const t=Px.reportApiInvoke(this._sessionId,{name:wL.MASS_SUBSCRIBE,options:e.map((e=>{let{user:t,mediaType:i}=e;return[null==t?void 0:t.uid,i]})),tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream, not joined");throw t.onError(e),e}if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));throw t.onError(e),e}const i=performance.now(),n=new Map,r=await this._subscribeMutex.lock();mw.info("[".concat(this._clientId,"]start massSubscribe user ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i)})).join("; "))),Kw("info",this,"massSubscribe",e);const o=(e=[...e]).map((e=>{let{user:t,mediaType:i}=e;return{user:t,mediaType:i}})),s=await this._p2pChannel.globalLock();try{var a;for(let i=e.length-1;i>=0;i--){const r=e[i],{user:s,mediaType:a}=r;if(uL(a,"mediaType",["audio","video"]),!s){const e=new pw(hw.INVALID_PARAMS,"user property does not exist in subscribeList item");throw mw.error("[".concat(this._clientId,"] user property does not exist in subscribeList item")),t.onError(e),e}if(!this._users.find((e=>e===s))){const t=new pw(hw.INVALID_REMOTE_USER,"user is not in the channel");mw.error("[".concat(this._clientId,"] can not massSubscribe ").concat(s.uid,", this user is not in the channel")),Kw("error",this,"massSubscribe",s.uid,"this user is not in the channel"),o[i].error=t,e.splice(i,1);continue}if("audio"===a&&(!s.hasAudio||void 0===s._audioSSRC)||"video"===a&&(!s.hasVideo||void 0===s._videoSSRC)){const t=new pw(hw.REMOTE_USER_IS_NOT_PUBLISHED);mw.error("[".concat(this._clientId,"] can not subscribe ").concat(s.uid," with mediaType ").concat(a,", remote user is not published")),Kw("error",this,"subscribe",s.uid,"mediaType ".concat(a,", remote user is not published")),o[i].error=t,e.splice(i,1);continue}const c=SP.Video|SP.LwoVideo,A=n.get(s);if(A){if("video"===a?A&c:A&SP.Audio){e.splice(i,1),mw.warning("repeat massSubscribe user:".concat(s.uid,", mediaType:").concat(a," twice"));continue}n.set(s,A|("video"===a?c:SP.Audio))}else n.set(s,"video"===a?c:SP.Audio)}for(let t=e.length-1;t>=0;t--){const i=e[t],{user:r,mediaType:o}=i,s=SP.Video|SP.LwoVideo;if(this._p2pChannel.hasRemoteMedia(r,o)){await this._p2pChannel.unmuteRemoteNoLock(r,o);const i=n.get(r);n.set(r,"video"===o?i^s:i^SP.Audio),e.splice(t,1)}}this.store.massSubscribe(e.map((e=>({userId:e.user.uid,type:e.mediaType}))),i);const c=dE(a=Array.from(n.entries())).call(a,((e,t)=>{let[i,n]=t;if(0===n)return e;const r={stream_id:i.uid,stream_type:n};return n&SP.Audio&&(r.audio_ssrc=i._audioSSRC),n&SP.Video&&(r.video_ssrc=i._videoSSRC),e.push(r),e}),[]);try{e.length>0&&await this._p2pChannel.massSubscribeNoLock(e.map((e=>{let{user:t,mediaType:i}=e;return{user:t,mediaType:i,ssrcId:i===QP.VIDEO?t._videoSSRC:t._audioSSRC,rtxSsrcId:t._rtxSsrcId}})));const n=new Map;if(c.length>0){const e=await this._gateway.subscribeAll(c,!0);((null==e?void 0:e.users)||[]).forEach((e=>{let{stream_id:t,video_error_code:i,audio_error_code:r,error_code:o}=e;(i||r||o)&&n.set(t,{video_error_code:i,audio_error_code:r,error_code:o})}))}if(Array.from(n.entries()).length>0){const e=Array.from(n.entries()).map((e=>{let t,[i,n]=e;return n.error_code||n.video_error_code&&n.audio_error_code?t=void 0:n.video_error_code?t=QP.VIDEO:n.audio_error_code&&(t=QP.AUDIO),{user:this.remoteUsers.find((e=>e.uid===i)),mediaType:t}}));await this._p2pChannel.massUnsubscribeNoLock(e)}for(const e of o){const t=n.get(e.user.uid);if(t){const i=t.error_code||"audio"===e.mediaType&&t.audio_error_code||"video"===e.mediaType&&t.video_error_code;if(i){const t=xK(i);mw.error("user:".concat(e.user.uid," mediaType:").concat(e.mediaType," has massSubscribe error ").concat(t.desc)),e.error=new pw(hw.SUBSCRIBE_FAILED,"code ".concat(i,": ").concat(t.desc))}}e.error||("video"===e.mediaType?e.track=e.user.videoTrack:e.track=e.user.audioTrack)}return this.store.massSubscribe(o.filter((e=>!e.error)).map((e=>({userId:e.user.uid,type:e.mediaType}))),void 0,performance.now()),o.forEach((e=>{var t;Px.subscribe(this.store.sessionId,{succ:!!e.error,ec:(null===(t=e.error)||void 0===t?void 0:t.code)||null,video:e.mediaType===QP.VIDEO,audio:e.mediaType===QP.AUDIO,peerid:e.user.uid,subscribeRequestid:e.mediaType===QP.VIDEO?e.user._videoSSRC:e.user._audioSSRC,p2pid:this.store.p2pId,eventElapse:Math.floor(performance.now()-i)},!0)})),t.onSuccess(),mw.info("[".concat(this._clientId,"] massSubscribe success ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i)})).join("; "))),Kw("info",this,"massSubscribe",e,"success"),o}catch(i){throw await this._p2pChannel.massUnsubscribeNoLock(e),t.onError(i),i}}finally{s(),r()}}async unsubscribe(e,t){if(t&&uL(t,"mediaType",["audio","video"]),!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"Can't unsubscribe stream, haven't joined yet!");const i=Px.reportApiInvoke(this._sessionId,{name:wL.UNSUBSCRIBE,options:[e.uid,t],tag:bL.TRACER});if(!this._users.find((t=>t===e))){const n=new pw(hw.INVALID_REMOTE_USER,"user is not in the channel");throw mw.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", user is not in the channel")),Kw("error",this,"unsubscribe",{uid:e.uid,mediaType:t},"user is not in the channel"),i.onError(n),n}mw.info("[".concat(this._clientId,"] unsubscribe uid: ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"unsubscribe",{uid:e.uid,mediaType:t});try{const n=await this._p2pChannel.unsubscribe(e,t);n&&await this._gateway.unsubscribe(n,e.uid),mw.info("[".concat(this._clientId,"] unsubscribe success uid: ").concat(e.uid,", mediaType: ").concat(t)),Kw("info",this,"unsubscribe",{uid:e.uid,mediaType:t},"success"),i.onSuccess()}catch(n){if(n.code===hw.DISCONNECT_P2P)return mw.warning("disconnecting p2p, abort unsubscribe request."),void i.onSuccess();throw mw.error("[".concat(this._clientId,"] unsubscribe user ").concat(e.uid," error"),n.toString()),Kw("error",this,"unsubscribe",{uid:e.uid,mediaType:t},n.toString()),i.onError(n),n}}async massUnsubscribe(e){hL(e,"unsubscribeList");const t=Px.reportApiInvoke(this._sessionId,{name:wL.UNSUBSCRIBE,options:e.map((e=>{let{user:t,mediaType:i}=e;return{uid:null==t?void 0:t.uid,mediaType:i}})),tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"Can't unsubscribeAll stream, haven't joined yet!");throw t.onError(e),e}mw.info("[".concat(this._clientId,"] start massUnsubscribe ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i,";")})).join())),Kw("info",this,"massUnsubscribe",e),e=[...e];const i=new Map;for(let n=e.length-1;n>=0;n--){const{user:r,mediaType:o}=e[n];if(!r){const e=new pw(hw.INVALID_PARAMS,"user property does not exist in unsubscribeList item");throw mw.error("[".concat(this._clientId,"] user property does not exist in unsubscribeList item")),t.onError(e),e}if(uL(o,"mediaType",["video","audio",void 0]),!this._users.find((e=>e===r))){mw.warning("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not in the channel")),Kw("error",this,"unsubscribe",{uid:r.uid,mediaType:o},"user is not in the channel"),e.splice(n,1);continue}const s=SP.Video|SP.LwoVideo;if(i.has(r)){const t=i.get(r);let a;switch(o){case"video":a=t&s;break;case"audio":a=t&SP.Audio;break;default:a=t&(SP.Audio|s)}if(a){mw.warning("repeat massUnsubscribe user:".concat(r.uid,",mediaType:").concat(o," twice.")),e.splice(n,1);continue}o?"audio"===o?i.set(r,t|SP.Audio):"video"===o&&i.set(r,t|s):i.set(r,t|SP.Audio|s)}else o?"audio"===o?i.set(r,SP.Audio):"video"===o&&i.set(r,s):i.set(r,SP.Audio|s)}try{const i=await this._p2pChannel.massUnsubscribe(e);i&&await this._gateway.massUnsubscribe(i),mw.info("[".concat(this._clientId,"] massUnsubscribe success ").concat(e.map((e=>{let{user:t,mediaType:i}=e;return"user: ".concat(null==t?void 0:t.uid,", mediaType: ").concat(i,";")})).join())),Kw("info",this,"massUnsubscribe",e,"success"),t.onSuccess()}catch(i){if(i.code===hw.DISCONNECT_P2P)return mw.warning("disconnecting p2p, abort unsubscribe request."),void t.onSuccess();throw mw.error("[".concat(this._clientId,"] massUnsubscribe error"),i.toString()),Kw("error",this,"massUnsubscribe",e,i.toString()),t.onError(i),i}}setLowStreamParameter(e){!function(e){if(!e)throw new pw(hw.INVALID_PARAMS);IL(e.width)||EL(e.width,"streamParameter.width"),IL(e.height)||EL(e.height,"streamParameter.height"),IL(e.framerate)||EL(e.framerate,"streamParameter.framerate"),IL(e.bitrate)||EL(e.bitrate,"streamParameter.bitrate")}(e);const t=Px.reportApiInvoke(this._sessionId,{name:wL.SET_LOW_STREAM_PARAMETER,options:[e],tag:bL.TRACER});(!e.width&&e.height||e.width&&!e.height)&&(mw.warning("[".concat(this._clientId,"] The width and height parameters take effect only when both are set")),xw("warning",this,"The width and height parameters take effect only when both are set")),mw.info("[".concat(this._clientId,"] set low stream parameter to"),JSON.stringify(e)),Kw("info",this,"setLowStreamParameter",e);const i=this._configDistribute.getLowStreamConfigDistribute();i&&i.bitrate&&e.bitrate&&i.bitrate<e.bitrate&&(e.bitrate=i.bitrate),this._lowStreamParameter=e,t.onSuccess()}async enableDualStream(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.ENABLE_DUAL_STREAM,options:[],tag:bL.TRACER});if(!XP().supportDualStream){Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1});const t=new pw(hw.NOT_SUPPORTED,"Your browser is not support dual stream");throw e.onError(t),t}if(this._isDualStreamEnabled){const t=new pw(hw.INVALID_OPERATION,"Dual stream is already enabled");throw e.onError(t),t}if(this._p2pChannel.canPublishLowStream())try{await this._publishLowStream()}catch(t){throw Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1}),e.onError(t),t}this._isDualStreamEnabled=!0,Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!0}),mw.info("[".concat(this._clientId,"] enable dual stream")),Kw("info",this,"enableDualStream"),e.onSuccess()}async disableDualStream(){if(!this._isDualStreamEnabled)return;if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");const e=Px.reportApiInvoke(this._sessionId,{name:wL.DISABLE_DUAL_STREAM,options:[],tag:bL.TRACER});if(this._p2pChannel.getLocalMedia(xP.LocalVideoLowTrack))try{const e=await this._p2pChannel.unpublishLowStream();e&&await this._gateway.unpublish(e,this._joinInfo.stringUid||this._joinInfo.uid)}catch(t){throw Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!1}),e.onError(t),t}this._isDualStreamEnabled=!1,Px.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!0}),mw.info("[".concat(this._clientId,"] disable dual stream")),Kw("info",this,"disableDualStream"),e.onSuccess()}async setClientRole(e,t){!function(e){uL(e,"role",["audience","host"])}(e),t&&eP(t);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SET_CLIENT_ROLE,options:[e,t],tag:bL.TRACER});if("rtc"===this._mode){mw.warning("[".concat(this._clientId,"]rtc mode can not use setClientRole")),Kw("warning",this,"setClientRole",e,"rtc mode can not use setClientRole");const t=new pw(hw.INVALID_OPERATION,"rtc mode can not use setClientRole");return i.onError(t),t.throw()}if(t&&t.level&&"host"===e){const e=new pw(hw.INVALID_OPERATION,"host mode can not set audience latency level");return i.onError(e),e.throw()}try{if("audience"===e&&this._p2pChannel.hasLocalMedia()){const e=new pw(hw.INVALID_OPERATION,"can not set client role to audience when publishing stream");return i.onError(e),e.throw()}await this._gateway.setClientRole(e,t),mw.info("[".concat(this._clientId,"] set client role to ").concat(e,", level: ").concat(t&&t.level)),Kw("info",this,"setClientRole",{role:e,level:t&&t.level}),i.onSuccess()}catch(e){throw i.onError(e),e}}setProxyServer(e,t){if(lL(e,"proxyServer"),!t){if("DISCONNECTED"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"Set proxy server before join channel");if("disabled"!==this._cloudProxyServerMode||this._useLocalAccessPoint)throw new pw(hw.INVALID_OPERATION,"You have already set the proxy")}this._proxyServer=e,Px.setProxyServer(this._proxyServer),mw.setProxyServer(this._proxyServer),Qw(this._proxyServer),mw.info("[".concat(this._clientId,"] Set proxy server ").concat(t?"by initialize call":""," success.")),Kw("info",this,"setProxyServer",[...arguments],"success")}setTurnServer(e,t){if(Array.isArray(e)||(e=[e]),!t){if("DISCONNECTED"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"Set turn server before join channel");if("disabled"!==this._cloudProxyServerMode||this._useLocalAccessPoint)throw new pw(hw.INVALID_OPERATION,"You have already set the proxy")}if(ZL(e))return this._turnServer={servers:e,mode:"original-manual"},mw.info("[".concat(this._clientId,"] Set original turnserver ").concat(t?"by initialize call":""," success: ").concat(e.map((e=>e.urls)).join(","),".")),void Kw("info",this,"setOriginalTurnServer",[...arguments],"success");e.forEach((e=>$L(e))),this._turnServer={servers:e,mode:"manual"},mw.info("[".concat(this._clientId,"] Set turnserver ").concat(t?"by initialize call":""," success.")),Kw("info",this,"setTurnServer",[...arguments],"success")}startProxyServer(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.START_PROXY_SERVER,options:[],tag:bL.TRACER});if("DISCONNECTED"!==this.connectionState){const e=new pw(hw.INVALID_OPERATION,"Start proxy server before join channel");throw t.onError(e),e}if(this._proxyServer||"manual"===this._turnServer.mode||this._useLocalAccessPoint){const e=new pw(hw.INVALID_OPERATION,"You have already set the proxy");throw t.onError(e),e}const i=[1,2,3,4,5];switch(void 0===e&&(e=1),e){case 1:this._cloudProxyServerMode="normal";break;case 2:this._cloudProxyServerMode="443only";break;case 3:this._cloudProxyServerMode="proxy3";break;case 4:this._cloudProxyServerMode="proxy4";break;case 5:this._cloudProxyServerMode="proxy5";break;default:{const e=new pw(hw.INVALID_PARAMS,"proxy server mode must be ".concat(i.join("|")));throw t.onError(e),e}}mw.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode),Kw("info",this,"startProxyServer",this._cloudProxyServerMode),t.onSuccess()}stopProxyServer(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.STOP_PROXY_SERVER,options:[],tag:bL.TRACER});if("DISCONNECTED"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"Stop proxy server after leave channel");Px.setProxyServer(),mw.setProxyServer(),Qw(),this._cloudProxyServerMode="disabled",mw.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode),Kw("info",this,"stopProxyServer",this._cloudProxyServerMode),this._proxyServer=void 0,this._turnServer={mode:"auto",servers:[]},e.onSuccess()}setLocalAccessPoints(e,t){if(hL(e,"serverList"),lL(t,"domain"),this._proxyServer||"disabled"!==this._cloudProxyServerMode)throw new pw(hw.INVALID_OPERATION,"set local access point failed, You have already set the cloud proxy");const i=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;e=e.map((e=>i.test(e)?"".concat(e.replace(/\./g,"-"),".").concat(t):e)),this._useLocalAccessPoint=!0,ab("WEBCS_DOMAIN",e),ab("WEBCS_DOMAIN_BACKUP_LIST",e),ab("GATEWAY_DOMAINS",[t]),ab("EVENT_REPORT_DOMAIN",e[0]),ab("EVENT_REPORT_BACKUP_DOMAIN",e[1]||e[0]),ab("LOG_UPLOAD_SERVER","".concat(e[0],":6444")),mw.info("set local access point success"),Kw("info",this,"setLocalAccessPoints")}async setRemoteDefaultVideoStreamType(e){if(uL(e,"streamType",[0,1]),this._remoteDefaultVideoStreamType=e,this._joinInfo)try{await this._gateway.setDefaultRemoteVideoStreamType(e),this._joinInfo.defaultVideoStream=this._remoteDefaultVideoStreamType}catch(e){throw mw.error("[".concat(this._clientId,"] set default remote video stream type error"),e.toString()),e}else mw.debug("haven't joined yet, cache remoteDefaultVideoStreamType ".concat(e))}async setRemoteVideoStreamType(e,t){uL(t,"streamType",[0,1]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SET_REMOTE_VIDEO_STREAM_TYPE,options:[e,t],tag:bL.TRACER});try{await this._gateway.setRemoteVideoStreamType(e,t),setTimeout((()=>{const t=this._users.find((t=>t.uid===e));t&&t.videoTrack&&t.videoTrack.updateMediaStreamTrackResolution()}),2e3)}catch(e){throw i.onError(e),mw.error("[".concat(this._clientId,"] set remote video stream type error"),e.toString()),Kw("error",this,"setRemoteVideoStreamType",void 0,e.toString()),e}mw.info("[".concat(this._clientId,"] set remote ").concat(e," video stream type to ").concat(t)),Kw("info",this,"setRemoteVideoStreamType",{uid:e,streamType:t}),this._remoteStreamTypeCacheMap.set(e,t),i.onSuccess()}async setStreamFallbackOption(e,t){uL(t,"fallbackType",[0,1,2]);const i=Px.reportApiInvoke(this._sessionId,{name:wL.SET_STREAM_FALLBACK_OPTION,options:["too long to show",t],tag:bL.TRACER});try{await this._gateway.setStreamFallbackOption(e,t)}catch(e){throw i.onError(e),mw.error("[".concat(this._clientId,"] set stream fallback option"),e.toString()),Kw("error",this,"setStreamFallbackOption",void 0,e.toString()),e}mw.info("[".concat(this._clientId,"] set remote ").concat(e," stream fallback type to ").concat(t)),Kw("info",this,"setStreamFallbackOption",{uid:e,fallbackType:t}),this._streamFallbackTypeCacheMap.set(e,t),i.onSuccess()}setEncryptionConfig(e,t,i){if(function(e){uL(e,"encryptionMode",["aes-128-xts","aes-256-xts","aes-128-ecb","sm4-128-ecb","aes-128-gcm","aes-256-gcm","aes-128-gcm2","aes-256-gcm2","none"])}(e),lL(t,"secret"),["aes-128-gcm2","aes-256-gcm2"].includes(e)){if(!i||!(i instanceof Uint8Array&&32===i.length))throw new pw(hw.INVALID_PARAMS,"salt must be an Uint8Array and exactly equal to 32 bytes")}else if(i)throw new pw(hw.INVALID_PARAMS,"current encrypt mode does not need salt");new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*,.<>?/:;'\"|{}\\[\\]])(?=.{8,})").test(t)||(mw.warning("The secret is not strong:\n      The secret must contain at least 1 lowercase alphabetical character,\n      The secret must contain at least 1 uppercase alphabetical character,\n      The secret must contain at least 1 numeric character,\n      The secret must contain at least one special character,\n      The secret must be eight characters or longer.\n      "),xw("warning",this,"The secret is not strong:\n      The secret must contain at least 1 lowercase alphabetical character,\n      The secret must contain at least 1 uppercase alphabetical character,\n      The secret must contain at least 1 numeric character,\n      The secret must contain at least one special character,\n      The secret must be eight characters or longer.\n      ")),this._encryptionMode=e,this._encryptionSecret=t,i&&(this._encryptionSalt=GG(i))}async renewToken(e){lL(e,"token",1,2047);const t=Px.reportApiInvoke(this._sessionId,{name:wL.RENEW_TOKEN,options:[e],tag:bL.TRACER});if(!this._key||!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"renewToken should not be called before user join");return t.onError(e),e.throw()}const i=this._key;this._key=e,this._joinInfo&&(this._joinInfo.token=e);const n=await this._renewTokenMutex.lock();try{if(cb("USE_NEW_TOKEN")){mw.debug("start renew token with ticket from unilbs"),Kw("debug",this,"renewToken","unilbs");const t=await wW(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||_w);mw.debug("[".concat(this._clientId,"] get ticket from unilbs success")),Kw("debug",this,"renewToken","unilbs","success"),await this._gateway.renewToken({token:e,ticket:t})}else mw.debug("start renew token without ticket"),Kw("debug",this,"renewToken"),await this._gateway.renewToken({token:e});mw.debug("[".concat(this._clientId,"] renewToken success")),Kw("debug",this,"renewToken",void 0,"success"),t.onSuccess()}catch(e){throw this._key=i,this._joinInfo.token=i,t.onError(e),mw.error("[".concat(this._clientId,"] renewToken failed"),e.toString()),Kw("error",this,"renewToken",void 0,e.toString()),e}finally{n()}}enableAudioVolumeIndicator(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.ENABLE_AUDIO_VOLUME_INDICATOR,options:[],tag:bL.TRACER});if(this._audioVolumeIndicationInterval)return mw.warning("you have already enabled audio volume indicator!"),Kw("warning",this,"enableAudioVolumeIndicator","you have already enabled audio volume indicator!"),e.onSuccess();this._audioVolumeIndicationInterval=window.setInterval((()=>{const e=this._p2pChannel.getAudioLevels();this.emit(FL.VOLUME_INDICATOR,e)}),cb("AUDIO_VOLUME_INDICATION_INTERVAL")||2e3),e.onSuccess()}getRTCStats(){const e=this._statsCollector.getRTCStats(),t=this._gateway.getInChannelInfo();return e.Duration=Math.round(t.duration/1e3),e}startLiveStreaming(e,t){const i=Px.reportApiInvoke(this._sessionId,{name:wL.START_LIVE_STREAMING,options:[e,t],tag:bL.TRACER});if(!t){if("h264"!==this._codec){const e=new pw(hw.LIVE_STREAMING_INVALID_RAW_STREAM,"raw streaming is only support h264");return i.onError(e),Mm.reject(e)}if(!this._p2pChannel.hasLocalMedia()){const e=new pw(hw.LIVE_STREAMING_INVALID_RAW_STREAM,"can not find stream to raw streaming");return i.onError(e),Mm.reject(e)}}if(this._liveRawStreamingClient&&this._liveRawStreamingClient.hasUrl(e)||this._liveTranscodeStreamingClient&&this._liveTranscodeStreamingClient.hasUrl(e)){const e=new pw(hw.LIVE_STREAMING_TASK_CONFLICT);return i.onError(e),Mm.reject(e)}const n=t?aP.TRANSCODE:aP.RAW;return this._createLiveStreamingClient(n).startLiveStreamingTask(e,n).then((()=>i.onSuccess())).catch((e=>{throw i.onError(e),e}))}setLiveTranscoding(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.SET_LIVE_TRANSCODING,options:[e],tag:bL.TRACER});return this._createLiveStreamingClient(aP.TRANSCODE).setTranscodingConfig(e).then((()=>t.onSuccess())).catch((e=>{throw t.onError(e),e}))}stopLiveStreaming(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.STOP_LIVE_STREAMING,options:[e],tag:bL.TRACER}),i=[this._liveRawStreamingClient,this._liveTranscodeStreamingClient].filter((t=>t&&t.hasUrl(e)));if(!i.length){const e=new pw(hw.INVALID_PARAMS,"can not find live streaming url to stop");return t.onError(e),Mm.reject(e)}return Mm.all(i.map((t=>t&&t.stopLiveStreamingTask(e)))).then((()=>t.onSuccess())).catch((e=>{throw t.onError(e),e}))}async addInjectStreamUrl(e,t){const i=Px.reportApiInvoke(this._sessionId,{name:wL.ADD_INJECT_STREAM_URL,options:[e,t],tag:bL.TRACER});try{if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"can not addInjectStreamUrl, no joininfo");const i=this._createLiveStreamingClient(aP.INJECT);i.setInjectStreamConfig(t,0),await i.startLiveStreamingTask(e,aP.INJECT)}catch(e){throw i.onError(e),e}i.onSuccess()}async removeInjectStreamUrl(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.REMOVE_INJECT_STREAM_URL,options:[],tag:bL.TRACER});try{var t;const e=this._createLiveStreamingClient(aP.INJECT),i=Array.from(Ax(t=e.streamingTasks).call(t)).find((e=>e.mode===aP.INJECT));if(!this._joinInfo||!i)throw new pw(hw.INVALID_OPERATION,"can remove addInjectStreamUrl, no joininfo or inject task");await e.stopLiveStreamingTask(i.url)}catch(t){throw e.onError(t),t}e.onSuccess()}async startChannelMediaRelay(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.START_CHANNEL_MEDIA_RELAY,options:[e],tag:bL.TRACER});try{GW(e);const t=this._createChannelMediaRelayClient();await t.startChannelMediaRelay(e)}catch(e){return t.onError(e),e.throw()}t.onSuccess()}async updateChannelMediaRelay(e){const t=Px.reportApiInvoke(this._sessionId,{name:wL.UPDATE_CHANNEL_MEDIA_RELAY,options:[e],tag:bL.TRACER});try{GW(e);const t=this._createChannelMediaRelayClient();await t.updateChannelMediaRelay(e)}catch(e){return t.onError(e),e.throw()}t.onSuccess()}async stopChannelMediaRelay(){const e=Px.reportApiInvoke(this._sessionId,{name:wL.STOP_CHANNEL_MEDIA_RELAY,options:[],tag:bL.TRACER});try{const e=this._createChannelMediaRelayClient();await e.stopChannelMediaRelay()}catch(t){return e.onError(t),t.throw()}e.onSuccess()}sendStreamMessage(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"can not send data stream, not joined");if("string"==typeof e&&(e=(new TextEncoder).encode(e)),new Blob([e]).size>1024)throw new pw(hw.INVALID_PARAMS,"stream message out of range.");return this._gateway.signal.request(HL.DATA_STREAM,{payload:GG(e)},!t)}sendMetadata(e){if(!this._joinInfo)throw new pw(hw.INVALID_OPERATION,"can not send metadata, not joined");if(new Blob([e]).size>1024)throw new pw(hw.METADATA_OUT_OF_RANGE);return this._gateway.signal.request(HL.SEND_METADATA,{session_id:this._joinInfo.sid,metadata:GG(e)})}async sendCustomReportMessage(e){Array.isArray(e)||(e=[e]),e.forEach(OL);const t=Px.reportApiInvoke(this._sessionId,{name:wL.SEND_CUSTOM_REPORT_MESSAGE,options:[JSON.stringify(e)],tag:bL.TRACER});if(!this._joinInfo){const e=new pw(hw.INVALID_OPERATION,"can not send custom report, not joined");return t.onError(e),e.throw()}await Px.sendCustomReportMessage(this._joinInfo.sid,e),t.onSuccess()}getLocalAudioStats(){return this._statsCollector.getLocalAudioTrackStats()}getRemoteAudioStats(){return this._statsCollector.getRemoteAudioTrackStats()}getLocalVideoStats(){return this._statsCollector.getLocalVideoTrackStats()}getRemoteVideoStats(){return this._statsCollector.getRemoteVideoTrackStats()}getRemoteNetworkQuality(){return this._statsCollector.getRemoteNetworkQualityStats()}async pickSVCLayer(e,t){uL(t.spatialLayer,"spatialLayer",[0,1,2,3]),uL(t.temporalLayer,"temporalLayer",[0,1,2,3]);try{await this._gateway.pickSVCLayer(e,t)}catch(e){throw mw.error("[".concat(this._clientId,"] pick SVC layer failed"),e.toString()),Yw("error",this,"pickSVCLayer",t,e.toString()),e}}_reset(){mw.debug("[".concat(this._clientId,"] reset client")),Yw("debug",this,"_reset"),this._axiosCancelSource.cancel(),this._axiosCancelSource=dw.CancelToken.source(),this._streamFallbackTypeCacheMap=new Map,this._remoteStreamTypeCacheMap=new Map,this._configDistribute.stopGetConfigDistribute(),this._joinInfo=void 0,this._proxyServer=void 0,this._defaultStreamFallbackType=void 0,this._sessionId=null,this.store.sessionId=null,this._statsCollector.reset(),this._key=void 0,this._appId=void 0,this._uid=void 0,this.store.uid=void 0,this._channelName=void 0,this._encryptionMode="none",this._encryptionSecret=null,this._encryptionSalt=null,this._users.forEach((e=>{e._audioTrack&&e._audioTrack._destroy(),e._videoTrack&&e._videoTrack._destroy()})),this._users=[],this._audioVolumeIndicationInterval&&(window.clearInterval(this._audioVolumeIndicationInterval),this._audioVolumeIndicationInterval=void 0),"fallback"===this._cloudProxyServerMode&&(this._cloudProxyServerMode="disabled"),this._p2pChannel.reset(),this._publishMutex=new Qx("client-publish"),this._subscribeMutex=new Qx("client-subscribe"),this._networkQualityInterval&&(window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=void 0),this._injectStreamingClient&&(this._injectStreamingClient.terminate(),this._injectStreamingClient.removeAllListeners(),this._injectStreamingClient=void 0),this._liveRawStreamingClient&&(this._liveRawStreamingClient.terminate(),this._liveRawStreamingClient.removeAllListeners(),this._liveRawStreamingClient=void 0),this._liveTranscodeStreamingClient&&(this._liveTranscodeStreamingClient.terminate(),this._liveTranscodeStreamingClient.removeAllListeners(),this._liveTranscodeStreamingClient=void 0),this._channelMediaRelayClient&&(this._channelMediaRelayClient.dispose(),this._channelMediaRelayClient=void 0)}_startSession(e,t){const i=e||NG();e?mw.debug("[".concat(this._clientId,"] new Session ").concat(i)):mw.debug("[".concat(this._clientId,"] renewSession ").concat(this._sessionId," => ").concat(i)),Yw("debug",this,"_startSession",{newSid:i,sid:this._sessionId}),this._sessionId=i,this.store.sessionId=i,t?Px.sessionInit(this._sessionId,{lts:(new Date).getTime(),cname:t.channel,appid:t.appId,mode:this._mode}):this._joinInfo?Px.sessionInit(this._sessionId,{lts:(new Date).getTime(),cname:this._joinInfo.cname,appid:this._joinInfo.appId,mode:this._mode}):this._gateway.joinInfo&&Px.sessionInit(this._sessionId,{lts:(new Date).getTime(),cname:this._gateway.joinInfo.cname,appid:this._gateway.joinInfo.appId,mode:this._mode}),this._joinInfo&&(this._joinInfo.sid=i),this._gateway.joinInfo&&(this._gateway.joinInfo.sid=i)}async _publishHighStream(e){if(!this._joinInfo||void 0===this._uid)throw new pw(hw.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));if("auto"===this._turnServer.mode&&cb("FORCE_TURN")&&!cb("TURN_ENABLE_TCP")&&!cb("TURN_ENABLE_UDP"))throw new pw(hw.UNEXPECTED_ERROR,"force TURN With No TURN Configuration");mw.debug("[".concat(this._clientId,"] publish high stream")),Yw("debug",this,"_publishHighStream");try{const i=await this._p2pChannel.publish(e,this._isDualStreamEnabled,this._lowStreamParameter),n=(await i.next()).value;if(n){var t;let r;try{r=await this._gateway.publish(this._uid,n,!0)}catch(e){if(e.code!==hw.DISCONNECT_P2P)throw i.throw(e),e}await i.next((null===(t=r)||void 0===t?void 0:t.ortc)||[])}this._p2pChannel.reportPublishEvent(!0,null);for(const t of e)t instanceof WJ&&t._encoderConfig&&this._gateway.setVideoProfile(t._encoderConfig),!t.muted&&t.enabled||await this._p2pChannel.muteLocalTrack(t)}catch(t){if(this._p2pChannel.reportPublishEvent(!1,null==t?void 0:t.code,e),(null==t?void 0:t.code)===hw.WS_ABORT)return;throw t}}async _publishLowStream(){if(!this._joinInfo||void 0===this._uid)throw new pw(hw.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState)throw new pw(hw.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));mw.debug("[".concat(this._clientId,"] publish low stream")),Yw("debug",this,"_publishLowStream");const e=this._configDistribute.getLowStreamConfigDistribute();e&&e.bitrate&&(this._lowStreamParameter||(this._lowStreamParameter={width:160,height:120,framerate:15,bitrate:50}),this._lowStreamParameter&&this._lowStreamParameter.bitrate&&e.bitrate<this._lowStreamParameter.bitrate&&(this._lowStreamParameter.bitrate=e.bitrate));try{const e=await this._p2pChannel.publishLowStream(this._lowStreamParameter),i=(await e.next()).value;if(i){var t;let n;try{n=await this._gateway.publish(this._uid,i,!0)}catch(t){if(t.code!==hw.DISCONNECT_P2P)throw e.throw(t),t}e.next((null===(t=n)||void 0===t?void 0:t.ortc)||[]),this._p2pChannel.reportPublishEvent(!0,null,void 0,!0)}}catch(e){if(this._p2pChannel.reportPublishEvent(!1,null==e?void 0:e.code,void 0,!0),(null==e?void 0:e.code)===hw.WS_ABORT)return;throw e}}_createLiveStreamingClient(e){if(!this._joinInfo||!this._appId)return new pw(hw.INVALID_OPERATION,"can not create live streaming client, please join channel first").throw();const t=()=>new xW(this._joinInfo,this._config.websocketRetryConfig||_w,this._config.httpRetryConfig||_w),i=e=>{e.onLiveStreamError=(e,t)=>{Px.reportApiInvoke(this._sessionId,{name:wL.ON_LIVE_STREAM_ERROR,options:[e,t],tag:bL.TRACER}).onSuccess(),this.emit(FL.LIVE_STREAMING_ERROR,e,t)},e.onLiveStreamWarning=(e,t)=>{Px.reportApiInvoke(this._sessionId,{name:wL.ON_LIVE_STREAM_WARNING,options:[e,t],tag:bL.TRACER}).onSuccess(),this.emit(FL.LIVE_STREAMING_WARNING,e,t)},e.on(pP.REQUEST_WORKER_MANAGER_LIST,((e,t,i)=>{if(!this._joinInfo)return i(new pw(hw.INVALID_OPERATION,"can not find join info to get worker manager"));DW(e,this._joinInfo,this._axiosCancelSource.token,_w).then(t).catch(i)}))};switch(e){case aP.RAW:return this._liveRawStreamingClient||(this._liveRawStreamingClient=t(),i(this._liveRawStreamingClient)),this._liveRawStreamingClient;case aP.TRANSCODE:return this._liveTranscodeStreamingClient||(this._liveTranscodeStreamingClient=t(),i(this._liveTranscodeStreamingClient)),this._liveTranscodeStreamingClient;case aP.INJECT:return this._injectStreamingClient||(this._injectStreamingClient=t(),this._injectStreamingClient.on(pP.REQUEST_WORKER_MANAGER_LIST,((e,t,i)=>{if(!this._joinInfo)return i(new pw(hw.INVALID_OPERATION,"can not find join info to get worker manager"));DW(e,this._joinInfo,this._axiosCancelSource.token,_w).then(t).catch(i)})),this._injectStreamingClient.onInjectStatusChange=(e,t,i)=>{this.emit(FL.INJECT_STREAM_STATUS,e,t,i)}),this._injectStreamingClient}}_createChannelMediaRelayClient(){return this._joinInfo?(this._channelMediaRelayClient||(this._channelMediaRelayClient=new YW(this._joinInfo,this._clientId,this._config.websocketRetryConfig||_w,this._config.httpRetryConfig||_w),this._channelMediaRelayClient.on("state",(e=>{e===RP.RELAY_STATE_FAILURE&&this._channelMediaRelayClient&&this._channelMediaRelayClient.dispose(),this.emit(FL.CHANNEL_MEDIA_RELAY_STATE,e)})),this._channelMediaRelayClient.on("event",(e=>{this.emit(FL.CHANNEL_MEDIA_RELAY_EVENT,e)}))),this._channelMediaRelayClient):new pw(hw.INVALID_OPERATION,"can not create channel media relay client, please join channel first").throw()}_handleGatewayEvents(){this._gateway.on(mP.DISCONNECT_P2P,(async()=>{await this._p2pChannel.disconnectForReconnect()})),this._gateway.on(mP.CONNECTION_STATE_CHANGE,((e,t,i)=>{var n;if(i===xL.FALLBACK)return;const r=()=>{this.emit(FL.CONNECTION_STATE_CHANGE,e,t,i)};if(Px.reportApiInvoke(this._sessionId||(null===(n=this._gateway.joinInfo)||void 0===n?void 0:n.sid)||null,{name:wL.CONNECTION_STATE_CHANGE,options:[e,t,i],tag:bL.TRACER}).onSuccess(JSON.stringify({cur:e,prev:t,reason:i})),mw.info("[".concat(this._clientId,"] connection state change: ").concat(t," -> ").concat(e)),Fw("info",this,"connection-state-change","".concat(t," -> ").concat(e)),"DISCONNECTED"===e)return this._reset(),void r();if("RECONNECTING"===e)this._users.forEach((e=>{e._trust_in_room_=!1,e._trust_audio_enabled_state_=!1,e._trust_video_enabled_state_=!1,e._trust_audio_mute_state_=!1,e._trust_video_mute_state_=!1,e._trust_stream_added_state_=!1})),this._userOfflineTimeout&&window.clearTimeout(this._userOfflineTimeout),this._streamRemovedTimeout&&window.clearTimeout(this._streamRemovedTimeout),this._userOfflineTimeout=void 0,this._streamRemovedTimeout=void 0;else if("CONNECTED"===e){var o;this._streamFallbackTypeCacheMap.forEach(((e,t)=>{this._gateway.setStreamFallbackOption(t,e).catch((e=>{mw.warning("[".concat(this._clientId,"] auto set stream fallback option failed"),e),xw("warning",this,"auto set stream fallback option failed, ".concat(e.toString()))}))})),this._remoteStreamTypeCacheMap.forEach(((e,t)=>{this._gateway.setRemoteVideoStreamType(t,e).catch((e=>{mw.warning("[".concat(this._clientId,"] auto set remote stream type failed"),e),xw("warning",this,"auto set remote stream type failed, ".concat(e.toString()))}))})),void 0!==this._remoteDefaultVideoStreamType&&void 0===(null===(o=this._joinInfo)||void 0===o?void 0:o.defaultVideoStream)&&this.setRemoteDefaultVideoStreamType(this._remoteDefaultVideoStreamType).then((()=>{mw.debug("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway connected"))})).catch((e=>{mw.error("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway failed, ").concat(e))})),this._p2pChannel.republish(),this._userOfflineTimeout=window.setTimeout((()=>{"CONNECTED"===this.connectionState&&(this._userOfflineTimeout=void 0,this._users.filter((e=>!e._trust_in_room_)).forEach((e=>{mw.debug("[".concat(this._clientId,"] user offline timeout, emit user offline ").concat(e.uid)),xw("debug",this,"user offline timeout, emit user offline ".concat(e.uid)),this._handleUserOffline({uid:e.uid})})))}),3e3),this._streamRemovedTimeout=window.setTimeout((()=>{"CONNECTED"===this.connectionState&&(this._streamRemovedTimeout=void 0,this._users.forEach((e=>{e._trust_audio_mute_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch audio unmute event ").concat(e.uid)),xw("debug",this,"auto dispatch audio unmute event ".concat(e.uid)),this._handleMuteStream(e.uid,"audio",!1)),e._trust_video_mute_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch video unmute event ").concat(e.uid)),xw("debug",this,"auto dispatch video unmute event ".concat(e.uid)),this._handleMuteStream(e.uid,"video",!1)),e._trust_audio_enabled_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch enable local audio ").concat(e.uid)),xw("debug",this,"auto dispatch enable local audio ".concat(e.uid)),this._handleSetStreamLocalEnable("audio",e.uid,!0)),!e._trust_video_enabled_state_&&e._video_enabled_&&(mw.debug("[".concat(this._clientId,"] auto dispatch enable local video ").concat(e.uid)),xw("debug",this,"auto dispatch enable local video ".concat(e.uid)),this._handleSetStreamLocalEnable("video",e.uid,!0)),e._trust_stream_added_state_||(mw.debug("[".concat(this._clientId,"] auto dispatch stream remove ").concat(e.uid)),xw("debug",this,"auto dispatch stream remove ".concat(e.uid)),this._handleRemoveStream({uid:e.uid,uint_id:e._uintid}))})))}),1e3)}r()})),this._gateway.on(mP.REQUEST_NEW_GATEWAY_LIST,((e,t)=>{if(!this._joinInfo)return t(new pw(hw.UNEXPECTED_ERROR,"can not recover, no join info"));SW(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||_w).then((t=>{this._joinInfo&&(this._joinInfo.apResponse=t.gatewayInfo.res,this._joinInfo.gatewayAddrs=t.gatewayInfo.gatewayAddrs,this._joinInfo.uni_lbs_ip=t.gatewayInfo.uni_lbs_ip),e(t.gatewayInfo.gatewayAddrs.map((e=>{if(this._joinInfo&&this._joinInfo.proxyServer){const t=e.address.split(":");return"wss://".concat(this._joinInfo.proxyServer,"/ws/?h=").concat(t[0],"&p=").concat(t[1])}return"wss://".concat(e.address)})))})).catch(t)})),this._gateway.on(mP.NETWORK_QUALITY,(e=>{"normal"===this._networkQualitySensitivity&&this.emit(FL.NETWORK_QUALITY,e)})),this._gateway.on(mP.STREAM_TYPE_CHANGE,((e,t)=>{this.emit(FL.STREAM_TYPE_CHANGED,e,t),Px.reportApiInvoke(this._sessionId,{name:wL.STREAM_TYPE_CHANGE,options:[e,t],tag:bL.TRACER}).onSuccess(JSON.stringify({uid:e,streamType:t}))})),this._gateway.on(mP.IS_P2P_DISCONNECTED,(e=>{this._p2pChannel.isP2PDisconnected()?e(!0):this._p2pChannel.hasLocalMedia()||this._p2pChannel.hasRemoteMedia()?e(!1):e(!0)})),this._gateway.on(mP.NEED_RENEW_SESSION,(()=>{this._startSession()})),this._gateway.on(mP.REQUEST_P2P_CONNECTION_PARAMS,(async(e,t,i)=>{try{t(await this._p2pChannel.startP2PConnection(e))}catch(e){i(e)}})),this._gateway.on(mP.JOIN_RESPONSE,((e,t,i)=>{const{dtlsParameters:n,iceParameters:r,candidates:o,rtpCapabilities:s,setup:a,cname:c}=Pz(e.ortc,t,i);this._p2pChannel.connect(r,n,o,s,a,c)})),this._gateway.signal.on(WL.ON_USER_ONLINE,this._handleUserOnline),this._gateway.signal.on(WL.ON_USER_OFFLINE,this._handleUserOffline),this._gateway.signal.on(WL.ON_ADD_AUDIO_STREAM,(e=>this._handleAddAudioOrVideoStream("audio",e.uid,e.ssrcId,e.cname,e.uint_id,e.ortc))),this._gateway.signal.on(WL.ON_ADD_VIDEO_STREAM,(e=>this._handleAddAudioOrVideoStream("video",e.uid,e.ssrcId,e.cname,e.uint_id,e.ortc,e.rtxSsrcId))),this._gateway.signal.on(WL.ON_REMOVE_STREAM,this._handleRemoveStream),this._gateway.signal.on(WL.ON_P2P_LOST,this._handleP2PLost),this._gateway.signal.on(WL.MUTE_AUDIO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"mute_audio",{uid:e.uid}),this._handleMuteStream(e.uid,"audio",!0)))),this._gateway.signal.on(WL.UNMUTE_AUDIO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"unmute_audio",{uid:e.uid}),this._handleMuteStream(e.uid,"audio",!1)))),this._gateway.signal.on(WL.MUTE_VIDEO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"mute_video",{uid:e.uid}),this._handleMuteStream(e.uid,"video",!0)))),this._gateway.signal.on(WL.UNMUTE_VIDEO,(e=>(Fw("debug",["AgoraRTCGateway",this._clientId],"unmute_video",{uid:e.uid}),this._handleMuteStream(e.uid,"video",!1)))),this._gateway.signal.on(WL.RECEIVE_METADATA,(e=>{const t=FG(e.metadata);this.emit(FL.RECEIVE_METADATA,e.uid,t)})),this._gateway.signal.on(WL.ON_DATA_STREAM,(e=>{e.seq&&delete e.seq,e.payload=FG(e.payload),this.emit(FL.STREAM_MESSAGE,e.uid,e.payload),this.onStreamMessage&&this.onStreamMessage(e)})),this._gateway.signal.on(WL.ON_CRYPT_ERROR,(()=>{xG((()=>{mw.warning("[".concat(this._clientId,"] on crypt error")),Fw("warning",this,"crypt_error"),this.emit(FL.CRYPT_ERROR)}),this._sessionId)})),this._gateway.signal.on(WL.ON_TOKEN_PRIVILEGE_WILL_EXPIRE,this._handleTokenWillExpire),this._gateway.signal.on(WL.ON_TOKEN_PRIVILEGE_DID_EXPIRE,(()=>{mw.warning("[".concat(this._clientId,"] received message onTokenPrivilegeDidExpire, please get new token and join again")),Fw("warning",this,"token_privilege_did_expire"),this._gateway.leave(!0),this.emit(FL.ON_TOKEN_PRIVILEGE_DID_EXPIRE),this._reset()})),this._gateway.signal.on(WL.ON_STREAM_FALLBACK_UPDATE,(e=>{mw.debug("[".concat(this._clientId,"] stream fallback peerId: ").concat(e.stream_id,", attr: ").concat(e.stream_type)),Fw("debug",this,"stream_fallback_update",{peerId:e.stream_id,attr:e.stream_type}),this.emit(FL.STREAM_FALLBACK,e.stream_id,1===e.stream_type?"fallback":"recover")})),this._gateway.signal.on(WL.ON_PUBLISH_STREAM,(e=>{this.uid===this._uid&&(this._p2pChannel.reportPublishEvent(!0,null,void 0,!1,JSON.stringify({proxy:e.proxy})),mw.info("[".concat(this._clientId,"] on publish stream, ").concat(JSON.stringify(e))),Fw("info",this,"publish_stream",e))})),this._gateway.signal.on(WL.ENABLE_LOCAL_VIDEO,(e=>{this._handleSetStreamLocalEnable("video",e.uid,!0)})),this._gateway.signal.on(WL.DISABLE_LOCAL_VIDEO,(e=>{this._handleSetStreamLocalEnable("video",e.uid,!1)})),this._gateway.signal.on(YL.REQUEST_TIMEOUT,((e,t)=>{if(this._joinInfo)switch(e){case HL.PUBLISH:{if(!t)return;const e=(t=t).ortc;if(e){var i,n,r,o;const s=e.some((e=>{let{stream_type:t}=e;return t===TP.Audio})),a=e.some((e=>{let{stream_type:t}=e;return t!==TP.Audio})),c=e.some((e=>{let{stream_type:t}=e;return t===TP.Screen||t===TP.ScreenLow}));"offer"===t.state&&Px.publish(this._joinInfo.sid,{eventElapse:iG.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:!1,ec:hw.TIMEOUT,audio:s,video:a,p2pid:t.p2p_id,publishRequestid:this.store.pubId,screenshare:c,audioName:s?null===(i=e.find((e=>{let{stream_type:t}=e;return t===TP.Audio})))||void 0===i||null===(n=i.ssrcs[0])||void 0===n?void 0:n.ssrcId.toString():void 0,videoName:a?null===(r=e.find((e=>{let{stream_type:t}=e;return t!==TP.Audio})))||void 0===r||null===(o=r.ssrcs[0])||void 0===o?void 0:o.ssrcId.toString():void 0})}break}case HL.SUBSCRIBE:(t=t)&&Px.subscribe(this._joinInfo.sid,{succ:!1,ec:hw.TIMEOUT,audio:t.stream_type===QP.AUDIO,video:t.stream_type===QP.VIDEO,peerid:t.stream_id,subscribeRequestid:t.ssrcId,p2pid:this.store.p2pId,eventElapse:iG.measureFromSubscribeStart(this.store.clientId,t.ssrcId)})}})),this._gateway.signal.on(WL.ON_P2P_OK,(e=>{this.uid,this._uid})),this._gateway.signal.on(WL.ON_PUBLISHED_USER_LIST,(e=>{if(null==e||!e.users)return;const t=[],i=[];for(const n of e.users){let e=this._users.find((e=>e.uid===n.stream_id));e?e._trust_in_room_=!0:(e=new zJ(n.stream_id,n.stream_id),this._users.push(e),0===this.getListeners(FL.PUBLISHED_USER_LIST).length&&(mw.debug("[".concat(this._clientId,"] user online"),n.stream_id),Gw("info",this,"user-joined",{uid:n.stream_id}),this.emit(FL.USER_JOINED,e)));const r=SP.Audio&n.stream_type,o=(SP.Video|SP.LwoVideo)&n.stream_type,s=r&&e.hasAudio,a=o&&e.hasVideo;n.stream_type!==SP.Nothing&&(e._trust_stream_added_state_=!0),o&&(e._video_added_=!0,e._videoSSRC=n.video_ssrc),r&&(e._audio_added_=!0,e._audioSSRC=n.audio_ssrc),r&&!s&&0===this.getListeners(FL.PUBLISHED_USER_LIST).length&&(mw.info("[".concat(this._clientId,"] remote user ").concat(e.uid," published audio")),xw("info",this,"remote user ".concat(e.uid," published audio")),this.emit(FL.USER_PUBLISHED,e,"audio")),o&&!a&&0===this.getListeners(FL.PUBLISHED_USER_LIST).length&&(mw.info("[".concat(this._clientId,"] remote user ").concat(e.uid," published video")),xw("info",this,"remote user ".concat(e.uid," published video")),this.emit(FL.USER_PUBLISHED,e,"video")),(r&&!s||o&&!a)&&t.push(e),o&&this._p2pChannel.hasPendingRemoteMedia(e,"video")&&i.push({user:e,mediaType:"video"}),r&&this._p2pChannel.hasPendingRemoteMedia(e,"audio")&&i.push({user:e,mediaType:"audio"})}i.length>0&&(mw.debug("[".concat(this._clientId,"] RE massSubscribe after reconnect ").concat(i.map((e=>"user: ".concat(e.user.uid,", mediaType: ").concat(e.mediaType))).join("; ")," ")),this.massSubscribe(i).catch((e=>{mw.error("[".concat(this._clientId,"] mass resubscribe error"),e.toString())}))),this.getListeners(FL.PUBLISHED_USER_LIST).length>0?(mw.info("[".concat(this._clientId,"] client emit user-list event, users: ").concat(t.map((e=>e.uid)).join(", "))),this.emit(FL.PUBLISHED_USER_LIST,t)):mw.info("[".concat(this._clientId,"] client not emit user-list event case there is no user-list listener, users: ").concat(t.map((e=>e.uid)).join(", ")))}))}_handleP2PChannelEvents(){this._p2pChannel.on(GP.RequestMuteLocal,(async(e,t,i)=>{if(this._joinInfo)try{await this._gateway.muteLocal(e,this._joinInfo.stringUid||this._joinInfo.uid),t()}catch(e){e.code===hw.DISCONNECT_P2P?t():i(e)}else t()})),this._p2pChannel.on(GP.RequestUnmuteLocal,(async(e,t,i)=>{if(this._joinInfo)try{await this._gateway.unmuteLocal(e,this._joinInfo.stringUid||this._joinInfo.uid),t()}catch(e){e.code===hw.DISCONNECT_P2P?t():i(e)}else t()})),this._p2pChannel.on(GP.RequestRePublish,((e,t,i)=>{this.publish(e,!1).then(t).catch(i)})),this._p2pChannel.on(GP.RequestReSubscribe,(async(e,t,i)=>{try{for(const{user:t,kind:i}of e)i===QP.VIDEO?await this.subscribe(t,"video"):await this.subscribe(t,"audio");t()}catch(e){i(e)}})),this._p2pChannel.on(GP.RequestUploadStats,((e,t)=>{this._gateway.uploadStats(e,t)})),this._p2pChannel.on(GP.MediaReconnectStart,(e=>{this.emit(FL.MEDIA_RECONNECT_START,e)})),this._p2pChannel.on(GP.MediaReconnectEnd,(e=>{this.emit(FL.MEDIA_RECONNECT_END,e)})),this._p2pChannel.on(GP.NeedSignalRTT,(e=>{e(this._gateway.getSignalRTT())})),this._p2pChannel.on(GP.RequestRestartICE,(async()=>{const e=await this._p2pChannel.reEstablish();if(e){const{restartICEResponse:t,gatewayIP:i,gatewayPort:n}=await this._gateway.restartICE({iceParameters:e.iceParameters}),{candidates:r,iceParameters:o}=function(e,t,i){const n=e.ice;let r;return void 0!==t&&void 0!==i?(r=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:t,port:i.toString(),type:"host",extension:{}}],mw.debug("Using remote candidate from AP ".concat(t,":").concat(i)),xw("debug",[],"Using remote candidate from AP ".concat(t,":").concat(i))):r=n.candidates.map((e=>({foundation:e.foundation,componentId:"1",transport:e.protocol,priority:e.priority.toString(),connectionAddress:e.ip,port:e.port.toString(),type:e.type,extension:{}}))),{candidates:r,iceParameters:{iceUfrag:n.iceUfrag,icePwd:n.icePwd}}}(t,i,n);await e.restartICE(o,r)}})),this._p2pChannel.on(GP.RequestReconnect,(async()=>{this._gateway.reconnect()})),this._p2pChannel.on(GP.RequestReconnectPC,(async()=>{var e;const{iceParameters:t,dtlsParameters:i,rtpCapabilities:n}=await this._p2pChannel.startP2PConnection({turnServer:null===(e=this._joinInfo)||void 0===e?void 0:e.turnServer}),{gatewayEstablishParams:r,gatewayIP:o,gatewayPort:s}=await this._gateway.reconnectPC({iceParameters:t,dtlsParameters:i,rtpCapabilities:n}),{dtlsParameters:a,iceParameters:c,candidates:A,rtpCapabilities:d,setup:u,cname:E}=Pz(r,o,s);await this._p2pChannel.connect(c,a,A,d,u,E),await this._p2pChannel.republish(),await this._p2pChannel.reSubscribe()})),this._p2pChannel.on(GP.RequestUnpublishForReconnectPC,(async(e,t,i)=>{this._joinInfo&&void 0!==this._uid?(await this._gateway.unpublish(e,this._uid),t()):i()})),this._p2pChannel.on(GP.P2PLost,(()=>{this.emit(FL.P2P_LOST,this.store.uid)})),this._p2pChannel.on(GP.UpdateVideoEncoder,(e=>{e._encoderConfig&&this._gateway.setVideoProfile(e._encoderConfig)})),this._p2pChannel.on(GP.ConnectionTypeChange,(e=>{this.emit(FL.IS_USING_CLOUD_PROXY,e)}))}getKeyMetrics(){return this.store.keyMetrics}}).prototype,"setProxyServer",[i$],Object.getOwnPropertyDescriptor(A$.prototype,"setProxyServer"),A$.prototype),tx(A$.prototype,"setTurnServer",[n$],Object.getOwnPropertyDescriptor(A$.prototype,"setTurnServer"),A$.prototype),tx(A$.prototype,"setLocalAccessPoints",[r$],Object.getOwnPropertyDescriptor(A$.prototype,"setLocalAccessPoints"),A$.prototype),tx(A$.prototype,"setRemoteDefaultVideoStreamType",[o$],Object.getOwnPropertyDescriptor(A$.prototype,"setRemoteDefaultVideoStreamType"),A$.prototype),tx(A$.prototype,"setEncryptionConfig",[s$],Object.getOwnPropertyDescriptor(A$.prototype,"setEncryptionConfig"),A$.prototype),tx(A$.prototype,"pickSVCLayer",[a$],Object.getOwnPropertyDescriptor(A$.prototype,"pickSVCLayer"),A$.prototype),c$=A$))||c$);class l$ extends $x{set currentState(e){e!==this._currentState&&(this._currentState=e,this.emit(qL.AUDIO_SOURCE_STATE_CHANGE,this._currentState))}get currentState(){return this._currentState}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),tD(this,"audioBuffer",void 0),tD(this,"sourceNode",void 0),tD(this,"startPlayTime",0),tD(this,"startPlayOffset",0),tD(this,"pausePlayTime",0),tD(this,"options",void 0),tD(this,"currentLoopCount",0),tD(this,"_currentState","stopped"),this.audioBuffer=e,this.options=t,this.startPlayOffset=this.options.startPlayTime||0}createWebAudioDiagram(){return this.context.createGain()}get duration(){return this.audioBuffer.duration}get currentTime(){return"stopped"===this.currentState?0:"paused"===this.currentState?this.pausePlayTime:(this.context.currentTime-this.startPlayTime+this.startPlayOffset)%this.audioBuffer.duration}updateOptions(e){"stopped"===this.currentState?(this.options=e,this.startPlayOffset=this.options.startPlayTime||0):mw.warning("can not set audio source options")}startProcessAudioBuffer(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"}pauseProcessAudioBuffer(){this.sourceNode&&"playing"===this.currentState&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")}seekAudioBuffer(e){this.sourceNode&&(this.sourceNode.onended=null,"playing"===this.currentState&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),"playing"===this.currentState?(this.startPlayOffset=e,this.startSourceNode()):"paused"===this.currentState&&(this.pausePlayTime=e))}resumeProcessAudioBuffer(){"paused"===this.currentState&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")}stopProcessAudioBuffer(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch(e){}this.reset()}}startSourceNode(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))}createSourceNode(){const e=this.context.createBufferSource();return e.buffer=this.audioBuffer,e.loop=!!this.options.loop,e.connect(this.outputNode),e}handleSourceNodeEnded(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()}reset(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0}}const h$=new Map;function p$(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _$(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p$(Object(i),!0).forEach((function(t){tD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):p$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I$(e,t,i,n){i.optimizationMode&&(n&&n.width&&n.height?(i.encoderConfig=_$(_$({},n),{},{bitrateMin:n.bitrateMin,bitrateMax:n.bitrateMax}),"motion"!==i.optimizationMode&&"detail"!==i.optimizationMode||(t.contentHint=i.optimizationMode,t.contentHint===i.optimizationMode?(mw.debug("[".concat(e,"] set content hint to"),i.optimizationMode),Kw("debug",["AgoraRTC"],"videoTrackOptimizationModeProcess",[e,i,n])):(mw.debug("[".concat(e,"] set content hint failed")),Kw("warning",["AgoraRTC"],"videoTrackOptimizationModeProcess",[e,i,n],"failed")))):(mw.warning("[".concat(e,"] can not apply optimization mode bitrate config, no encoderConfig")),xw("warning",["AgoraRTC"],"[".concat(e,"] can not apply optimization mode bitrate config, no encoderConfig"))))}const g$=Dy().name;function f$(e,t,i,n){let r,o=0,s=null;return new Mm(((a,c)=>{setTimeout((()=>{r&&(r(),a(o))}),t),r=Xx((()=>{!function(){o>n&&r&&(r(),a(o));const t=i.getContext("2d");if(!t){const e=new pw(hw.UNEXPECTED_ERROR,"can not get canvas 2d context.");return mw.error(e.toString()),void c(e)}t.drawImage(e,0,0,160,120);const A=t.getImageData(0,0,i.width,i.height),d=Math.floor(A.data.length/3);if(s){for(let e=0;e<d;e+=3)if(A.data[e]!==s[e])return o+=1,void(s=A.data);s=A.data}else s=A.data}()}),30)}))}class R${constructor(e,t){tD(this,"id",0),tD(this,"element",void 0),tD(this,"peerPair",void 0),tD(this,"context",void 0),tD(this,"audioPlayerElement",void 0),tD(this,"audioTrack",void 0),R$.count+=1,this.id=R$.count,this.element=e,this.context=t}initPeers(){this.peerPair=[new RTCPeerConnection,new RTCPeerConnection],this.peerPair[1].ontrack=e=>{const t=document.createElement("audio");t.srcObject=new MediaStream([e.track]),t.play(),this.audioPlayerElement=t}}async switchSdp(){if(!this.peerPair)return;const e=async(e,t)=>{const i="offer"===t?await e.createOffer():await e.createAnswer();return await e.setLocalDescription(i),"complete"===e.iceGatheringState?e.localDescription:new Mm((t=>{e.onicegatheringstatechange=()=>{"complete"===e.iceGatheringState&&t(e.localDescription)}}))},t=async(e,t)=>await e.setRemoteDescription(t);try{const i=await e(this.peerPair[0],"offer");await t(this.peerPair[1],i);const n=await e(this.peerPair[1],"answer");await t(this.peerPair[0],n)}catch(e){throw new pw(hw.LOCAL_AEC_ERROR,e.toString()).print()}}async getTracksFromMediaElement(e){if(this.audioTrack)return this.audioTrack;let t;try{e instanceof HTMLVideoElement&&(e.captureStream?e.captureStream():e.mozCaptureStream()),t=this.context.createMediaStreamDestination(),this.context.createMediaElementSource(e).connect(t)}catch(e){throw new pw(hw.LOCAL_AEC_ERROR,e.toString()).print()}if(!t)throw new pw(hw.LOCAL_AEC_ERROR,"no dest node when local aec").print();const i=t.stream.getAudioTracks()[0];return this.audioTrack=i,i}getElement(){return this.element}async startEchoCancellation(){this.context.resume(),this.peerPair&&this.close(),this.initPeers();const e=this.element,t=await this.getTracksFromMediaElement(e);this.peerPair&&this.peerPair[0].addTrack(t),await this.switchSdp()}close(){mw.debug("close echo cancellation unit, id is",this.id),this.audioPlayerElement&&this.audioPlayerElement.pause(),this.peerPair&&this.peerPair.forEach((e=>{e.close()})),this.peerPair=void 0,this.audioPlayerElement=void 0}}var C$,T$;tD(R$,"count",0);const m$=window.AudioContext||window.webkitAudioContext,S$=new(C$=bx({report:Px}),tx((T$=class{constructor(){tD(this,"units",[]),tD(this,"context",void 0)}processExternalMediaAEC(e){if(!this._doesEnvironmentNeedAEC())return mw.debug("the system does not need to process local aec"),-1;this.context||(this.context=new m$);let t=this.units.find((t=>t&&t.getElement()===e));return t||(t=new R$(e,this.context),this.units.push(t)),t.startEchoCancellation(),mw.debug("start processing local audio echo cancellation, id is",t.id),t.id}_doesEnvironmentNeedAEC(){return Dy().name!==Oy.SAFARI}}).prototype,"processExternalMediaAEC",[C$],Object.getOwnPropertyDescriptor(T$.prototype,"processExternalMediaAEC"),T$.prototype),T$);ab("PROCESS_ID","process-".concat(vG(8,""),"-").concat(vG(4,""),"-").concat(vG(4,""),"-").concat(vG(4,""),"-").concat(vG(12,""))),function(){const e=Dy();qP.getDisplayMedia=!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia),qP.getStreamFromExtension=e.name===Oy.CHROME&&Number(e.version)>34,qP.supportUnifiedPlan=function(){if(!window.RTCRtpTransceiver)return!1;if(!("currentDirection"in RTCRtpTransceiver.prototype))return!1;const e=new RTCPeerConnection;let t=!1;try{e.addTransceiver("audio"),t=!0}catch(e){}return e.close(),t}(),qP.supportMinBitrate=e.name===Oy.CHROME||e.name===Oy.EDGE,qP.supportSetRtpSenderParameters=function(){const e=Dy();return!!(window.RTCRtpSender&&window.RTCRtpSender.prototype.setParameters&&window.RTCRtpSender.prototype.getParameters)&&(!!Ky()||!(!Uy()&&!ky())||e.name===Oy.FIREFOX&&Number(e.version)>=64)}(),e.name===Oy.SAFARI&&(Number(e.version)>=14?qP.supportDualStream=!0:qP.supportDualStream=!1),qP.webAudioMediaStreamDest=function(){const e=Dy();return!(e.name===Oy.SAFARI&&Number(e.version)<12)}(),qP.supportReplaceTrack=!!window.RTCRtpSender&&"function"==typeof RTCRtpSender.prototype.replaceTrack,qP.supportWebGL="undefined"!=typeof WebGLRenderingContext,qP.supportRequestFrame=!!window.CanvasCaptureMediaStreamTrack,Ky()||(qP.webAudioWithAEC=!0),qP.supportShareAudio=function(){const e=Dy();return(e.os===Sy.WIN_10||e.os===Sy.WIN_81||e.os===Sy.WIN_7||e.os===Sy.LINUX||e.os===Sy.MAC_OS)&&e.name===Oy.CHROME&&Number(e.version)>=74}(),qP.supportDualStreamEncoding=function(){const e=Dy();return"Safari"===e.name&&Number(e.version)>=14}(),mw.info("browser compatibility",JSON.stringify(qP),JSON.stringify(e)),Yw("info",[],"updateAgoraRTCCompatibility",{browserCompatibility:qP,browserInfo:e})}(),function(){let e;try{e=window.localStorage.getItem("websdk_ng_global_parameter")}catch(e){return void mw.error("Error loading sdk config",e.message)}if(e)try{const t=JSON.parse(window.atob(e)),i=Date.now();mw.debug("Loading global parameters from cache",t),Yw("debug",[],"loadConfigFromLocalStorage",t),Object.keys(t).forEach((e=>{if(Object.prototype.hasOwnProperty.call(Ab,e)){const{value:n,expires:r}=t[e];if(r&&r<=i)return;db[e]=n,Ab[e]=n}}))}catch(t){mw.error("Error loading mutableParamsCache: ".concat(e),t.message)}}();const O$={__CLIENT_LIST__:_b,__TRACK_LIST__:Ib,VERSION:Xw,BUILD:qw,setParameter:ab,getParameter:cb,getSupportedCodec:async function(){let e={audio:[],video:[]};try{let t=new RTCPeerConnection;t.addTransceiver("video",{direction:"recvonly"}),t.addTransceiver("audio",{direction:"recvonly"});const i=(await t.createOffer()).sdp;if(!i)return e;t.close(),t=null,e=function(e){const t={video:[],audio:[]};return e.match(/ VP8/i)&&t.video.push("VP8"),e.match(/ VP9/i)&&t.video.push("VP9"),e.match(/ AV1/i)&&t.video.push("AV1"),e.match(/ H264/i)&&t.video.push("H264"),e.match(/ opus/i)&&t.audio.push("OPUS"),e.match(/ PCMU/i)&&t.audio.push("PCMU"),e.match(/ PCMA/i)&&t.audio.push("PCMA"),e.match(/ G722/i)&&t.audio.push("G722"),t}(i)}catch(e){throw new pw(hw.CREATE_OFFER_FAILED,e.toString&&e.toString()).print()}return e},checkSystemRequirements:function(){const e=Px.reportApiInvoke(null,{name:wL.CHECK_SYSTEM_REQUIREMENTS,options:[],tag:bL.TRACER});let t=!1;try{const e=window.RTCPeerConnection,i=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia,n=window.WebSocket;t=!!(e&&i&&n)}catch(e){return mw.error("check system requirement failed: ",e),!1}let i=!1;const n=Dy();n.name===Oy.CHROME&&Number(n.version)>=58&&(!("WebKit"===yy.engine.name)||function(){const e=Dy();if(ky()){if(e.os===Sy.MAC_OS)return!0;if(e.os===Sy.IOS){const e=yy.os.version&&yy.os.version.split(".");if(e&&14===Number(e[0])&&e[1]&&Number(e[1])>=3)return!0;if(e&&Number(e[0])>14)return!0}}return!1}())&&(i=!0),n.name===Oy.FIREFOX&&Number(n.version)>=56&&(i=!0),n.name===Oy.OPERA&&Number(n.version)>=45&&(i=!0),n.name===Oy.SAFARI&&Number(n.version)>=11&&(i=!0),(Yy()||Dy().name===Oy.QQ)&&(i=!0),mw.debug("checkSystemRequirements, api:",t,"browser",i);const r=t&&i;return e.onSuccess(r),r},getDevices:function(e){return EF.enumerateDevices(!0,!0,e)},getMicrophones:function(e){return EF.getRecordingDevices(e)},getCameras:function(e){return EF.getCamerasDevices(e)},getElectronScreenSources:iF,getPlaybackDevices:function(e){return EF.getSpeakers(e)},createClient:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{codec:"vp8",audioCodec:"opus",mode:"rtc"};const t=Px.reportApiInvoke(null,{name:wL.CREATE_CLIENT,options:[e],tag:bL.TRACER});try{zL(e)}catch(e){throw t.onError(e),e}return void 0===e.audioCodec&&(e.audioCodec="opus"),t.onSuccess(),new E$(u$(u$({forceWaitGatewayResponse:!0},e),{},{role:"rtc"===e.mode?"host":e.role}))},createCameraVideoTrack:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{encoderConfig:"480p_1"};const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_CAM_VIDEO_TRACK,options:[_$({},e)]}),i=_J(e),n=vG(8,"track-cam-");let r=null;mw.info("start create camera video track with config",JSON.stringify(e),"trackId",n),Kw("info",["AgoraRTC"],"createCameraVideoTrack",e);try{r=(await cF({video:i},n)).getVideoTracks()[0]||null}catch(e){throw t.onError(e),e}if(!r){const e=new pw(hw.UNEXPECTED_ERROR,"can not find track in media stream");return t.onError(e),e.throw()}e.optimizationMode&&I$(n,r,e,e.encoderConfig&&ib(e.encoderConfig));const o=new JJ(r,e,i,e.scalabiltyMode?rb(e.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},e.optimizationMode,n);return t.onSuccess(o.getTrackId()),mw.info("create camera video success, trackId:",n),Kw("info",["AgoraRTC"],"createCameraVideoTrack",void 0,n),o},createCustomVideoTrack:function(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_CUSTOM_VIDEO_TRACK,options:[e]}),i=new WJ(e.mediaStreamTrack,{bitrateMax:e.bitrateMax,bitrateMin:e.bitrateMin},e.scalabiltyMode?rb(e.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},e.optimizationMode);return t.onSuccess(i.getTrackId()),mw.info("create custom video track success with config",e,"trackId",i.getTrackId()),Kw("info",["AgoraRTC"],"createCustomVideoTrack",e,i.getTrackId()),i},createScreenVideoTrack:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"disable";const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_SCREEN_VIDEO_TRACK,options:[_$({},e),t]});e.encoderConfig?"string"==typeof e.encoderConfig||e.encoderConfig.width&&e.encoderConfig.height||(e.encoderConfig.width={max:1920},e.encoderConfig.height={max:1080}):e.encoderConfig="1080p_2";const n=IJ(e),r=vG(8,"track-scr");let o=null,s=null;const a=XP();if(!a.supportShareAudio&&"enable"===t){const e=new pw(hw.NOT_SUPPORTED,"your browser or platform is not support share-screen with audio");return i.onError(e),e.throw()}mw.info("start create screen video track with config",e,"withAudio",t,"trackId",r),Kw("info",["AgoraRTC"],"createScreenVideoTrack",[e,t]);try{const e=await cF({screen:n,screenAudio:"auto"===t?a.supportShareAudio:"enable"===t},r);o=e.getVideoTracks()[0]||null,s=e.getAudioTracks()[0]||null}catch(e){throw i.onError(e),e}if(!o){const e=new pw(hw.UNEXPECTED_ERROR,"can not find track in media stream");return i.onError(e),e.throw()}if(!s&&"enable"===t){o&&o.stop();const e=new pw(hw.SHARE_AUDIO_NOT_ALLOWED);return i.onError(e),e.throw()}e.optimizationMode||(e.optimizationMode="detail"),e.optimizationMode&&(I$(r,o,e,e.encoderConfig&&nb(e.encoderConfig)),e.encoderConfig&&"string"!=typeof e.encoderConfig&&(e.encoderConfig.bitrateMin=e.encoderConfig.bitrateMax));const c=new WJ(o,e.encoderConfig?nb(e.encoderConfig):{},e.scalabiltyMode?rb(e.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},e.optimizationMode,r,[vP.SCREEN_TRACK]);if(!s)return i.onSuccess(c.getTrackId()),mw.info("create screen video track success","video:",c.getTrackId()),Kw("info",["AgoraRTC"],"createScreenVideoTrack",void 0,{videoTrack:c.getTrackId()}),c;const A=new JF(s);return i.onSuccess([c.getTrackId(),A.getTrackId()]),mw.info("create screen video track success","video:",c.getTrackId(),"audio:",A.getTrackId()),Kw("info",["AgoraRTC"],"createScreenVideoTrack",void 0,{videoTrack:c.getTrackId(),audioTrack:A.getTrackId()}),[c,A]},createMicrophoneAndCameraTracks:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{encoderConfig:"480p_1"};const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_MIC_AND_CAM_TRACKS,options:[e,t]}),n=_J(t),r=gJ(e),o=vG(8,"track-mic-"),s=vG(8,"track-cam-");let a=null,c=null;mw.info("start create camera video track(".concat(s,") and microphone audio track(").concat(o,") with config, audio: ").concat(JSON.stringify(e),", video: ").concat(JSON.stringify(t))),Kw("info",["AgoraRTC"],"createMicrophoneAndCameraTracks",{videoConfig:t,audioConfig:e});try{const e=await cF({audio:r,video:n},"".concat(o,"-").concat(s));a=e.getAudioTracks()[0],c=e.getVideoTracks()[0]}catch(e){throw i.onError(e),e}if(!a||!c){const e=new pw(hw.UNEXPECTED_ERROR,"can not find tracks in media stream");return i.onError(e),e.throw()}t.optimizationMode&&I$(s,c,t,t.encoderConfig&&ib(t.encoderConfig));const A=new qF(a,e,r,o),d=new JJ(c,t,n,t.scalabiltyMode?rb(t.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},t.optimizationMode,s);return i.onSuccess([A.getTrackId(),d.getTrackId()]),mw.info("create camera video track(".concat(s,") and microphone audio track(").concat(o,") success")),Kw("info",["AgoraRTC"],"createMicrophoneAndCameraTracks",void 0,{videoTrackId:s,audioTrackId:o}),[A,d]},createMicrophoneAudioTrack:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_MIC_AUDIO_TRACK,options:[e]}),i=gJ(e),n=vG(8,"track-mic-");let r=null;mw.info("start create microphone audio track with config",JSON.stringify(e),"trackId",n),Kw("info",["AgoraRTC"],"createMicrophoneAudioTrack",e);try{r=(await cF({audio:i},n)).getAudioTracks()[0]||null}catch(e){throw t.onError(e),e}if(!r){const e=new pw(hw.UNEXPECTED_ERROR,"can not find track in media stream");return t.onError(e),e.throw()}const o=new qF(r,e,i,n);return t.onSuccess(o.getTrackId()),mw.info("create microphone audio track success, trackId:",n),Kw("info",["AgoraRTC"],"createMicrophoneAudioTrack",e,n),o},createCustomAudioTrack:function(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_CUSTOM_AUDIO_TRACK,options:[e]}),i=new JF(e.mediaStreamTrack,e.encoderConfig?sb(e.encoderConfig):{});return mw.info("create custom audio track success with config",e,"trackId",i.getTrackId()),Kw("info",["AgoraRTC"],"createCustomAudioTrack",e,i.getTrackId()),t.onSuccess(i.getTrackId()),i},createBufferSourceAudioTrack:async function(e){const t=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CREATE_BUFFER_AUDIO_TRACK,options:[e]}),i=vG(8,"track-buf-");mw.info("start create buffer source audio track with config",JSON.stringify(e),"trackId",i),Kw("info",[],"createBufferSourceAudioTrack",e);const n=e.source;if(!(e.source instanceof AudioBuffer))try{e.source=await async function(e,t){let i=null;if("string"==typeof e){const t=h$.get(e);if(t)return mw.debug("use cached audio resource: ",e),t;try{i=(await gw((()=>dw.get(e,{responseType:"arraybuffer"})),void 0,void 0,{maxRetryCount:3})).data}catch(e){throw new pw(hw.FETCH_AUDIO_FILE_FAILED,e.toString())}}else{const t=new Mm(((t,i)=>{const n=new FileReader;n.onload=e=>{e.target?t(e.target.result):i(new pw(hw.READ_LOCAL_AUDIO_FILE_ERROR))},n.onerror=()=>{i(new pw(hw.READ_LOCAL_AUDIO_FILE_ERROR))},n.readAsArrayBuffer(e)}));i=await t}const n=await function(e){const t=Wx();return new Mm(((i,n)=>{t.decodeAudioData(e,(e=>{i(e)}),(e=>{n(new pw(hw.DECODE_AUDIO_FILE_FAILED,e.toString()))}))}))}(i);return"string"==typeof e&&t&&h$.set(e,n),n}(e.source,e.cacheOnlineFile)}catch(e){return t.onError(e),e.throw()}const r=new l$(e.source),o=new XF(n,r,e.encoderConfig?sb(e.encoderConfig):{},i);return mw.info("create buffer source audio track success, trackId:",i),Kw("info",["AgoraRTC"],"createBufferSourceAudioTrack",void 0,i),t.onSuccess(o.getTrackId()),o},setLogLevel:function(e){cb("USE_NEW_LOG")?function(e){e=Math.min(Math.max(0,e),4),ww=e}(e):mw.setLogLevel(e)},enableLogUpload:function(){cb("USE_NEW_LOG")?ab("UPLOAD_LOG",!0):mw.enableLogUpload()},disableLogUpload:function(){cb("USE_NEW_LOG")?ab("UPLOAD_LOG",!1):mw.disableLogUpload()},createChannelMediaRelayConfiguration:function(){return new FW},checkAudioTrackIsActive:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CHECK_AUDIO_TRACK_IS_ACTIVE,options:[t]});if(!(e instanceof JF||e instanceof yZ)){const e=new pw(hw.INVALID_TRACK,"the parameter is not a audio track");return i.onError(e),e.throw()}t&&t<1e3&&(t=1e3);const n=e instanceof JF?e.getTrackLabel():"remote_track",r=e.getVolumeLevel();let o=r,s=r;const a=Date.now();return new Mm((r=>{const c=setInterval((()=>{const A=e.getVolumeLevel();o=A>o?A:o,s=A<s?A:s;const d=o-s>1e-4,u=Date.now()-a;if(d||u>t){clearInterval(c);const t=d,s={duration:u,deviceLabel:n,maxVolumeLevel:o,result:t};mw.info("[track-".concat(e.getTrackId(),"] check audio track active completed. ").concat(JSON.stringify(s))),i.onSuccess(s),r(t)}}),200)}))},checkVideoTrackIsActive:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;const i=Px.reportApiInvoke(null,{tag:bL.TRACER,name:wL.CHECK_VIDEO_TRACK_IS_ACTIVE,options:[t]});if(!(e instanceof WJ||e instanceof NZ)){const e=new pw(hw.INVALID_TRACK,"the parameter is not a video track");return i.onError(e),e.throw()}const n=4;t&&t<1e3&&(t=1e3);const r=e instanceof WJ?e.getTrackLabel():"remote_track",o=e.getMediaStreamTrack(!0),s=document.createElement("video");s.style.width="1px",s.style.height="1px",s.setAttribute("muted",""),s.muted=!0,s.setAttribute("playsinline",""),s.controls=!1,(Uy()||ky())&&(s.style.opacity="0.01",s.style.position="fixed",s.style.left="0",s.style.top="0",document.body.appendChild(s)),s.srcObject=new MediaStream([o]),s.play();const a=document.createElement("canvas");a.width=160,a.height=120;let c=0,A=0;try{const e=Date.now();c=await f$(s,t,a,n),A=Date.now()-e}catch(e){throw i.onError(e),e}g$===Oy.SAFARI&&(s.pause(),s.remove()),s.srcObject=null;const d=c>n,u={duration:A,changedPicNum:c,deviceLabel:r,result:d};return mw.info("[track-".concat(e.getTrackId(),"] check video track active completed. ").concat(JSON.stringify(u))),i.onSuccess(u),d},setArea:function(e){const t=Px.reportApiInvoke(null,{name:wL.SET_AREA,options:e,tag:bL.TRACER});try{let t=[];if("string"==typeof e&&(t=[e]),Array.isArray(e)&&(e.forEach((e=>{if(!kP.includes(e))throw new pw(hw.INVALID_PARAMS,"invalid area code")})),t=e),"[object Object]"===Object.prototype.toString.call(e)){const{areaCode:i,excludedArea:n}=e;if(!i)throw new pw(hw.INVALID_PARAMS,"area code is needed");let r=i;"string"==typeof i&&(r=[i]),t=n?function(e,t){let i=[];if(e.includes(bP.GLOBAL)){const o=[bP.GLOBAL,bP.OVERSEA],s=Object.keys(UP);if(t===bP.GLOBAL)throw new pw(hw.INVALID_PARAMS,"GLOBAL is an invalid excludedArea value");if(t===bP.CHINA)i=[bP.OVERSEA];else if(r=t,TW.includes(r)){const e=(n=t,CW[bP.GLOBAL][n]||[]),r=[...o,t,...e];i=s.filter((e=>!r.includes(e)))}else if(function(e){let t=!1;return TW.forEach((i=>{CW[bP.GLOBAL][i].includes(e)&&(t=!0)})),t}(t)){const e=function(e){let t;return TW.forEach((i=>{CW[bP.GLOBAL][i].includes(e)&&(t=i)})),t}(t),n=[...o,e,t];i=s.filter((e=>!n.includes(e)))}else i=e;i=function(e){const t=[];return mW.forEach((i=>{e.includes(i)&&t.push(i)})),t.concat(e.filter((e=>!mW.includes(e))))}(i)}else i=e;var n,r;return i}(r,n):r}ab("AREAS",t);const i=(e=>{const t={CODE:"",WEBCS_DOMAIN:[],WEBCS_DOMAIN_BACKUP_LIST:[],PROXY_CS:[],CDS_AP:[],ACCOUNT_REGISTER:[],UAP_AP:[],EVENT_REPORT_DOMAIN:[],EVENT_REPORT_BACKUP_DOMAIN:[],LOG_UPLOAD_SERVER:[],PROXY_SERVER_TYPE3:[]};return e.map((e=>{const i=UP[e],n=Object.keys(i);n&&n.map((e=>{"CODE"!==e&&(t[e]=t[e].concat(i[e]))}))})),t})(t);Object.keys(i).map((e=>{ab(e,"LOG_UPLOAD_SERVER"===e||"EVENT_REPORT_DOMAIN"===e||"EVENT_REPORT_BACKUP_DOMAIN"===e||"PROXY_SERVER_TYPE3"===e?i[e][0]:i[e])})),mw.debug("set area success:",t.join(","))}catch(e){throw t.onError(e),e}t.onSuccess()},loadModule:async function(e,t){if(mw.debug("loadModule: ".concat(e.name,", loadOption: ").concat(JSON.stringify(t))),!e.moduleInit)throw mw.debug("Invalid Plugin"),new pw(hw.INVALID_PLUGIN,"invalid plugin");try{jx.installPlugin(e),await e.moduleInit({logger:mw,report:Px,pluginCenter:jx,getParameter:cb},t)}catch(e){throw new pw(hw.UNEXPECTED_ERROR,"unexpected error in loadModule",e)}},audioElementPlayCenter:_F,processExternalMediaAEC:function(e){S$.processExternalMediaAEC(e)},registerExtensions:function(e){e.forEach((e=>{const t=e;t.__registered__=!0,t.logger.hookLog=mw.extLog,t.reporter.hookApiInvoke=Px.extApiInvoke,t.parameters&&Object.keys(t.parameters).forEach((e=>{t.parameters[e]=cb(e)}))}))},ChannelMediaRelayError:CP,ChannelMediaRelayEvent:fP,ChannelMediaRelayState:RP,RemoteStreamFallbackType:yP,RemoteStreamType:NP,ConnectionDisconnectedReason:xL,AudienceLatencyLevelType:QL,AREAS:bP};return Object.defineProperties(O$,{onAudioAutoplayFailed:{get:()=>vx.onAudioAutoplayFailed,set:e=>{vx.onAudioAutoplayFailed=e}},onAutoplayFailed:{get:()=>vx.onAutoplayFailed,set:e=>{vx.onAutoplayFailed=e}}}),EF.on(PL.CAMERA_DEVICE_CHANGED,(e=>{mw.info("camera device changed",JSON.stringify(e)),O$.onCameraChanged&&O$.onCameraChanged(e)})),EF.on(PL.RECORDING_DEVICE_CHANGED,(e=>{mw.info("microphone device changed",JSON.stringify(e)),O$.onMicrophoneChanged&&O$.onMicrophoneChanged(e)})),EF.on(PL.PLAYOUT_DEVICE_CHANGED,(e=>{mw.debug("playout device changed",JSON.stringify(e)),O$.onPlaybackDeviceChanged&&O$.onPlaybackDeviceChanged(e)})),_F.onAutoplayFailed=()=>{mw.info("detect audio element autoplay failed"),vx.onAudioAutoplayFailed&&vx.onAudioAutoplayFailed()},Kx.on("autoplay-failed",(()=>{mw.info("detect webaudio autoplay failed"),vx.onAudioAutoplayFailed&&vx.onAudioAutoplayFailed()})),window&&(window.__ARTC__=O$),O$}()},554:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(910),a=i(593),c=function(){function e(e){var t;this._channels=new Map,this._support_apis=((t={})[s.ApiTypeChannel.kChannelCreateChannel]=this.createChannel,t[s.ApiTypeChannel.kChannelRelease]=this.release,t[s.ApiTypeChannel.kChannelJoinChannel]=this.joinChannel,t[s.ApiTypeChannel.kChannelJoinChannelWithUserAccount]=this.joinChannelWithUserAccount,t[s.ApiTypeChannel.kChannelLeaveChannel]=this.leaveChannel,t[s.ApiTypeChannel.kChannelPublish]=this.publish,t[s.ApiTypeChannel.kChannelUnPublish]=this.unPublish,t[s.ApiTypeChannel.kChannelChannelId]=this.channelId,t[s.ApiTypeChannel.kChannelRenewToken]=this.renewToken,t[s.ApiTypeChannel.kChannelSetEncryptionSecret]=this.setEncryptionSecret,t[s.ApiTypeChannel.kChannelSetEncryptionMode]=this.setEncryptionMode,t[s.ApiTypeChannel.kChannelEnableEncryption]=this.enableEncryption,t[s.ApiTypeChannel.kChannelSetClientRole]=this.setClientRole,t[s.ApiTypeChannel.kChannelSetDefaultMuteAllRemoteAudioStreams]=this.setDefaultMuteAllRemoteAudioStreams,t[s.ApiTypeChannel.kChannelSetDefaultMuteAllRemoteVideoStreams]=this.setDefaultMuteAllRemoteVideoStreams,t[s.ApiTypeChannel.kChannelMuteLocalAudioStream]=this.muteLocalAudioStream,t[s.ApiTypeChannel.kChannelMuteLocalVideoStream]=this.muteLocalVideoStream,t[s.ApiTypeChannel.kChannelMuteAllRemoteAudioStreams]=this.muteAllRemoteAudioStreams,t[s.ApiTypeChannel.kChannelAdjustUserPlaybackSignalVolume]=this.adjustUserPlaybackSignalVolume,t[s.ApiTypeChannel.kChannelMuteRemoteAudioStream]=this.muteRemoteAudioStream,t[s.ApiTypeChannel.kChannelMuteAllRemoteVideoStreams]=this.muteAllRemoteVideoStreams,t[s.ApiTypeChannel.kChannelMuteRemoteVideoStream]=this.muteRemoteVideoStream,t[s.ApiTypeChannel.kChannelSetRemoteVideoStreamType]=this.setRemoteVideoStreamType,t[s.ApiTypeChannel.kChannelSetRemoteDefaultVideoStreamType]=this.setRemoteDefaultVideoStreamType,t[s.ApiTypeChannel.kChannelAddPublishStreamUrl]=this.addPublishStreamUrl,t[s.ApiTypeChannel.kChannelRemovePublishStreamUrl]=this.removePublishStreamUrl,t[s.ApiTypeChannel.kChannelSetLiveTranscoding]=this.setLiveTranscoding,t[s.ApiTypeChannel.kChannelAddInjectStreamUrl]=this.addInjectStreamUrl,t[s.ApiTypeChannel.kChannelRemoveInjectStreamUrl]=this.removeInjectStreamUrl,t[s.ApiTypeChannel.kChannelStartChannelMediaRelay]=this.startChannelMediaRelay,t[s.ApiTypeChannel.kChannelUpdateChannelMediaRelay]=this.updateChannelMediaRelay,t[s.ApiTypeChannel.kChannelStopChannelMediaRelay]=this.stopChannelMediaRelay,t[s.ApiTypeChannel.kChannelGetConnectionState]=this.getConnectionState,t),this._engine=e}return e.prototype.callApi=function(e,t,i){var n;return r(this,void 0,void 0,(function(){return o(this,(function(r){return(0,a.printf)("callApi",e,t,i,this),[2,null===(n=this._support_apis[e])||void 0===n?void 0:n.call(this,JSON.parse(t),i)]}))}))},e.prototype.setEventHandler=function(e){this._handler=e},e.prototype.getChannel=function(e){return this._channels.get(e)},e.prototype.createChannel=function(e){return r(this,void 0,void 0,(function(){var t,i,r=this;return o(this,(function(o){switch(o.label){case 0:return t=e.channelId,this._channels.has(t)?[2]:[4,this._engine.createChannel()];case 1:return(i=o.sent()).setEventHandler((function(e,i){var o;null===(o=r._handler)||void 0===o||o.call(r,e,JSON.stringify(n(n({},JSON.parse(i)),{channelId:t})))})),this._channels.set(t,i),[2]}}))}))},e.prototype.release=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return this._channels.get(t).release(),this._channels.delete(t),[2]}))}))},e.prototype.joinChannel=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r,s,a;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.token,r=e.info,s=e.uid,a=e.options,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.joinChannel({token:n,channelId:i,info:r,uid:s,options:a})]}))}))},e.prototype.joinChannelWithUserAccount=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r,s;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.token,r=e.userAccount,s=e.options,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.joinChannelWithUserAccount({token:n,channelId:i,userAccount:r,options:s})]}))}))},e.prototype.leaveChannel=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return[2,this._channels.get(t).leaveChannel()]}))}))},e.prototype.publish=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:if(t=e.channelId,!this._channels.has(t))throw"please create first";return[4,this._channels.get(t).muteLocalAudioStream({mute:!1})];case 1:return i.sent(),[4,this._channels.get(t).muteLocalVideoStream({mute:!1})];case 2:return i.sent(),[2]}}))}))},e.prototype.unPublish=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:if(t=e.channelId,!this._channels.has(t))throw"please create first";return[4,this._channels.get(t).muteLocalAudioStream({mute:!0})];case 1:return i.sent(),[4,this._channels.get(t).muteLocalVideoStream({mute:!0})];case 2:return i.sent(),[2]}}))}))},e.prototype.channelId=function(e){var t=e.channelId;if(!this._channels.has(t))throw"please create first";return t},e.prototype.renewToken=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.token,[2,this._channels.get(t).renewToken({token:i})]}))}))},e.prototype.setEncryptionSecret=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.secret,[2,this._channels.get(t).setEncryptionSecret({secret:i})]}))}))},e.prototype.setEncryptionMode=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.encryptionMode,[2,this._channels.get(t).setEncryptionMode({encryptionMode:i})]}))}))},e.prototype.enableEncryption=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.enabled,n=e.config,[2,this._channels.get(t).enableEncryption({enabled:i,config:n})]}))}))},e.prototype.setClientRole=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.role,n=e.options,[2,this._channels.get(t).setClientRole({role:i,options:n})]}))}))},e.prototype.setDefaultMuteAllRemoteAudioStreams=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setDefaultMuteAllRemoteAudioStreams({mute:n})]}))}))},e.prototype.setDefaultMuteAllRemoteVideoStreams=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setDefaultMuteAllRemoteVideoStreams({mute:n})]}))}))},e.prototype.muteLocalAudioStream=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteLocalAudioStream({mute:i})]}))}))},e.prototype.muteLocalVideoStream=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteLocalVideoStream({mute:i})]}))}))},e.prototype.muteAllRemoteAudioStreams=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteAllRemoteAudioStreams({mute:i})]}))}))},e.prototype.adjustUserPlaybackSignalVolume=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.uid,r=e.volume,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.adjustUserPlaybackSignalVolume({uid:n,volume:r})]}))}))},e.prototype.muteRemoteAudioStream=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.userId,r=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.muteRemoteAudioStream({userId:n,mute:r})]}))}))},e.prototype.muteAllRemoteVideoStreams=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.mute,[2,this._channels.get(t).muteAllRemoteVideoStreams({mute:i})]}))}))},e.prototype.muteRemoteVideoStream=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.userId,r=e.mute,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.muteRemoteVideoStream({userId:n,mute:r})]}))}))},e.prototype.setRemoteVideoStreamType=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.userId,r=e.streamType,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setRemoteVideoStreamType({userId:n,streamType:r})]}))}))},e.prototype.setRemoteDefaultVideoStreamType=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.streamType,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.setRemoteDefaultVideoStreamType({streamType:n})]}))}))},e.prototype.addPublishStreamUrl=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.url,r=e.transcodingEnabled,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.addPublishStreamUrl({url:n,transcodingEnabled:r})]}))}))},e.prototype.removePublishStreamUrl=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.url,[2,this._channels.get(t).removePublishStreamUrl({url:i})]}))}))},e.prototype.setLiveTranscoding=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.transcoding,[2,this._channels.get(t).setLiveTranscoding({transcoding:i})]}))}))},e.prototype.addInjectStreamUrl=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.url,n=e.config,[2,this._channels.get(t).addInjectStreamUrl({url:i,config:n})]}))}))},e.prototype.removeInjectStreamUrl=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){if(t=e.channelId,!this._channels.has(t))throw"please create first";return i=e.url,[2,this._channels.get(t).removeInjectStreamUrl({url:i})]}))}))},e.prototype.startChannelMediaRelay=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.configuration,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.startChannelMediaRelay({configuration:n})]}))}))},e.prototype.updateChannelMediaRelay=function(e){var t;return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){if(i=e.channelId,!this._channels.has(i))throw"please create first";return n=e.configuration,[2,null===(t=this._channels.get(i))||void 0===t?void 0:t.updateChannelMediaRelay({configuration:n})]}))}))},e.prototype.stopChannelMediaRelay=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return[2,this._channels.get(t).stopChannelMediaRelay()]}))}))},e.prototype.getConnectionState=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){if(t=e.channelId,!this._channels.has(t))throw"please create first";return[2,this._channels.get(t).getConnectionState()]}))}))},e}();t.default=c},673:function(e,t,i){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(910),c=i(593),A=i(424),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.microphoneConfig={},t.cameraConfig={},t}return r(t,e),t.prototype.createMicrophoneAudioTrack=function(e,t,i){var n;return void 0===i&&(i=!1),o(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:if(!e)return(0,c.printf)("createMicrophoneAudioTrack",e),[2];if(this.localAudioTrack){if(!i)return[2,this.localAudioTrack];this.localAudioTrack.close(),this.localAudioTrack=void 0}return r=this,[4,A.createMicrophoneAudioTrack(this.microphoneConfig)];case 1:return r.localAudioTrack=o.sent(),null===(n=this.localAudioTrack)||void 0===n||n.on("track-ended",(function(){t("LocalAudioStateChanged",{state:a.LOCAL_AUDIO_STREAM_STATE.LOCAL_AUDIO_STREAM_STATE_FAILED,error:a.LOCAL_AUDIO_STREAM_ERROR.LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE})})),[2,this.localAudioTrack]}}))}))},t.prototype.createCameraVideoTrack=function(e,t,i){var n;return void 0===i&&(i=!1),o(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:if(!e)return(0,c.printf)("CreateCameraVideoTrack",e),[2];if(this.localVideoTrack){if(!i)return[2,this.localVideoTrack];this.localVideoTrack.close(),this.localVideoTrack=void 0}return r=this,[4,A.createCameraVideoTrack(this.cameraConfig)];case 1:return r.localVideoTrack=o.sent(),null===(n=this.localVideoTrack)||void 0===n||n.on("track-ended",(function(){t("LocalVideoStateChanged",{localVideoState:a.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_FAILED,error:a.LOCAL_VIDEO_STREAM_ERROR.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE})})),this.playLocalVideo(),[2,this.localVideoTrack]}}))}))},t.prototype.createScreenVideoTrack=function(e,t,i,n){var r,d,u,E;return void 0===n&&(n=!1),o(this,void 0,void 0,(function(){var o,l,h;return s(this,(function(s){switch(s.label){case 0:if(!e)return(0,c.printf)("createScreenVideoTrack",e),[2];if(this.localVideoTrack){if(!n)return[2,this.localVideoTrack];this.localVideoTrack.close(),this.localVideoTrack=void 0}return this.screenConfig={encoderConfig:{width:null===(r=null==i?void 0:i.dimensions)||void 0===r?void 0:r.width,height:null===(d=null==i?void 0:i.dimensions)||void 0===d?void 0:d.height,frameRate:null==i?void 0:i.frameRate,bitrateMin:null==i?void 0:i.bitrate,bitrateMax:null==i?void 0:i.bitrate}},[4,A.createScreenVideoTrack(this.screenConfig,"auto")];case 1:return void 0!==(null==(o=s.sent())?void 0:o.play)?this.localVideoTrack=o:(l=o[0],h=o[1],this.localVideoTrack=l,this.localAudioTrack=h,null===(u=this.localAudioTrack)||void 0===u||u.on("track-ended",(function(){t("LocalAudioStateChanged",{state:a.LOCAL_AUDIO_STREAM_STATE.LOCAL_AUDIO_STREAM_STATE_FAILED,error:a.LOCAL_AUDIO_STREAM_ERROR.LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE})}))),null===(E=this.localVideoTrack)||void 0===E||E.on("track-ended",(function(){t("LocalVideoStateChanged",{localVideoState:a.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_FAILED,error:a.LOCAL_VIDEO_STREAM_ERROR.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE})})),this.playLocalVideo(),[2,this.localVideoTrack]}}))}))},t.prototype.enableLocalAudio=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localAudioTrack)||void 0===t?void 0:t.setEnabled(e)]}))}))},t.prototype.enableLocalVideo=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localVideoTrack)||void 0===t?void 0:t.setEnabled(e)]}))}))},t.prototype.muteLocalAudio=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localAudioTrack)||void 0===t?void 0:t.setMuted(e)]}))}))},t.prototype.muteLocalVideo=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null===(t=this.localVideoTrack)||void 0===t?void 0:t.setMuted(e)]}))}))},t.prototype.adjustRecordingSignalVolume=function(e){var t;null===(t=this.localAudioTrack)||void 0===t||t.setVolume(e)},t.prototype.setAudioEncoderConfiguration=function(e){this.microphoneConfig.encoderConfig=e},t.prototype.setVideoEncoderConfiguration=function(e){var t;return o(this,void 0,void 0,(function(){var i;return s(this,(function(n){return this.cameraConfig.encoderConfig=e,void 0!==(i=null===(t=this.localVideoTrack)||void 0===t?void 0:t.setEncoderConfiguration)?[2,i.call(this.localVideoTrack,this.cameraConfig.encoderConfig)]:[2]}))}))},t.prototype.setBeautyEffect=function(e,t){var i;return o(this,void 0,void 0,(function(){var n;return s(this,(function(r){return void 0!==(n=null===(i=this.localVideoTrack)||void 0===i?void 0:i.setBeautyEffect)?[2,n.call(this.localVideoTrack,e,t)]:[2]}))}))},t.prototype.stopCameraCapture=function(){var e;void 0===this.screenConfig&&(null===(e=this.localVideoTrack)||void 0===e||e.close(),this.localVideoTrack=void 0)},t.prototype.stopScreenCapture=function(){var e;void 0!==this.screenConfig&&(null===(e=this.localVideoTrack)||void 0===e||e.close(),this.localVideoTrack=void 0,this.screenConfig=void 0)},t.prototype.setupLocalVideo=function(e){void 0===e?this.canvasMap.delete(0):(this.canvasMap.set(e.uid,e),this.setupVideo(this.localVideoTrack,e))},t.prototype.playLocalVideo=function(){this.setupVideo(this.localVideoTrack,this.canvasMap.get(0))},t}(function(){function e(){this.canvasMap=new Map}return e.prototype.setupVideo=function(e,t){if(void 0!==t){var i,n=null==e?void 0:e.getUserId;if((i=void 0===n?0:n.call(e))===t.uid){var r="cover";switch(t.renderMode){case a.RENDER_MODE_TYPE.RENDER_MODE_HIDDEN:r="cover";break;case a.RENDER_MODE_TYPE.RENDER_MODE_FIT:r="contain";break;case a.RENDER_MODE_TYPE.RENDER_MODE_ADAPTIVE:r="cover";break;case a.RENDER_MODE_TYPE.RENDER_MODE_FILL:r="fill"}for(var o=t.view,s=0;s<o.children.length;s++)o.removeChild(o.children.item(s));var c;c=0===i&&t.mirrorMode===a.VIDEO_MIRROR_MODE_TYPE.VIDEO_MIRROR_MODE_AUTO||t.mirrorMode===a.VIDEO_MIRROR_MODE_TYPE.VIDEO_MIRROR_MODE_ENABLED,null==e||e.play(o,{mirror:c,fit:r})}}},e}()),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.remoteAudioTracks=[],t.remoteVideoTracks=[],t}return r(t,e),t.prototype.addRemoteAudioTrack=function(e){var t;e.setPlaybackDevice(null!==(t=this.audioPlaybackDeviceId)&&void 0!==t?t:""),this.remoteAudioTracks.push(e)},t.prototype.getRemoteAudioTrack=function(e){var t=this.remoteAudioTracks.findIndex((function(t){return t.getUserId()===e}));return this.remoteAudioTracks[t]},t.prototype.removeRemoteAudioTrack=function(e){var t=this.remoteAudioTracks.findIndex((function(t){return t.getUserId()===e}));this.remoteAudioTracks.splice(t,1)},t.prototype.clearRemoteAudioTracks=function(){this.remoteAudioTracks.splice(0,this.remoteAudioTracks.length)},t.prototype.addRemoteVideoTrack=function(e){this.remoteVideoTracks.push(e)},t.prototype.getRemoteVideoTrack=function(e){var t=this.remoteVideoTracks.findIndex((function(t){return t.getUserId()===e}));return this.remoteVideoTracks[t]},t.prototype.removeRemoteVideoTrack=function(e){var t=this.remoteVideoTracks.findIndex((function(t){return t.getUserId()===e}));this.remoteVideoTracks.splice(t,1)},t.prototype.clearRemoteVideoTracks=function(){this.remoteVideoTracks.splice(0,this.remoteVideoTracks.length)},t.prototype.adjustPlaybackSignalVolume=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.remoteAudioTracks.map((function(t){return t.setVolume(e)}))]}))}))},t.prototype.adjustUserPlaybackSignalVolume=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this.remoteAudioTracks.map((function(i){if(i.getUserId()===e)return i.setVolume(t)}))]}))}))},t.prototype.enableRemoteAudio=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.remoteAudioTracks.map((function(t){return e?t.play():t.stop()}))]}))}))},t.prototype.enableRemoteVideo=function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(i){return[2,this.remoteVideoTracks.map((function(i){e?t.setupVideo(i,t.canvasMap.get(i.getUserId())):i.stop()}))]}))}))},t.prototype.setupRemoteVideo=function(e,t){void 0===t?this.canvasMap.delete(e):(this.canvasMap.set(e,t),this.setupVideo(this.getRemoteVideoTrack(e),t))},t.prototype.playRemoteVideo=function(e){this.setupVideo(this.getRemoteVideoTrack(e),this.canvasMap.get(e))},t}(d),E=function(e){function t(){var t,i,n=null!==e&&e.apply(this,arguments)||this;return n._support_apis_audio=((t={})[a.ApiTypeAudioDeviceManager.kADMEnumeratePlaybackDevices]=n.enumerateAudioPlaybackDevices,t[a.ApiTypeAudioDeviceManager.kADMSetPlaybackDevice]=n.setAudioPlaybackDevice,t[a.ApiTypeAudioDeviceManager.kADMGetPlaybackDevice]=n.getAudioPlaybackDevice,t[a.ApiTypeAudioDeviceManager.kADMGetPlaybackDeviceInfo]=n.getAudioPlaybackDeviceInfo,t[a.ApiTypeAudioDeviceManager.kADMEnumerateRecordingDevices]=n.enumerateAudioRecordingDevices,t[a.ApiTypeAudioDeviceManager.kADMSetRecordingDevice]=n.setAudioRecordingDevice,t[a.ApiTypeAudioDeviceManager.kADMGetRecordingDevice]=n.getAudioRecordingDevice,t[a.ApiTypeAudioDeviceManager.kADMGetRecordingDeviceInfo]=n.getAudioRecordingDeviceInfo,t[a.ApiTypeAudioDeviceManager.kADMSetRecordingDeviceVolume]=n.setAudioRecordingDeviceVolume,t[a.ApiTypeAudioDeviceManager.kADMGetRecordingDeviceVolume]=n.getAudioRecordingDeviceVolume,t),n._support_apis_video=((i={})[a.ApiTypeVideoDeviceManager.kVDMEnumerateVideoDevices]=n.enumerateVideoDevices,i[a.ApiTypeVideoDeviceManager.kVDMSetDevice]=n.setVideoDeviceId,i[a.ApiTypeVideoDeviceManager.kVDMGetDevice]=n.getVideoDeviceId,i),n}return r(t,e),t.prototype.callApiAudio=function(e,t,i){var n;return o(this,void 0,void 0,(function(){return s(this,(function(r){return(0,c.printf)("callApiAudio",e,t,i,this),[2,null===(n=this._support_apis_audio[e])||void 0===n?void 0:n.call(this,JSON.parse(t),i)]}))}))},t.prototype.callApiVideo=function(e,t,i){var n;return o(this,void 0,void 0,(function(){return s(this,(function(r){return(0,c.printf)("callApiVideo",e,t,i,this),[2,null===(n=this._support_apis_video[e])||void 0===n?void 0:n.call(this,JSON.parse(t),i)]}))}))},t.prototype.release=function(){var e,t;null===(e=this.localAudioTrack)||void 0===e||e.close(),this.localAudioTrack=void 0,null===(t=this.localVideoTrack)||void 0===t||t.close(),this.localVideoTrack=void 0,this.clearRemoteAudioTracks(),this.clearRemoteVideoTracks()},t.prototype.enumerateAudioPlaybackDevices=function(){var e;return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,null===(e=A.getPlaybackDevices())||void 0===e?void 0:e.then((function(e){return JSON.stringify(e.map((function(e){return{deviceId:e.deviceId,deviceName:e.label}})))}))]}))}))},t.prototype.setAudioPlaybackDevice=function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(i){switch(i.label){case 0:return this.audioPlaybackDeviceId=e.deviceId,[4,Promise.all(this.remoteAudioTracks.map((function(e){var i;return e.setPlaybackDevice(null!==(i=t.audioPlaybackDeviceId)&&void 0!==i?i:"")})))];case 1:return i.sent(),[2]}}))}))},t.prototype.getAudioPlaybackDevice=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,null!==(t=this.audioPlaybackDeviceId)&&void 0!==t?t:""]}))}))},t.prototype.getAudioPlaybackDeviceInfo=function(e){var t;return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(i){return[2,null===(t=A.getPlaybackDevices())||void 0===t?void 0:t.then((function(t){var i=t.find((function(t){return t.deviceId===e.audioPlaybackDeviceId}));return JSON.stringify({deviceId:i.deviceId,deviceName:i.label})}))]}))}))},t.prototype.enumerateAudioRecordingDevices=function(){var e;return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,null===(e=A.getMicrophones())||void 0===e?void 0:e.then((function(e){return JSON.stringify(e.map((function(e){return{deviceId:e.deviceId,deviceName:e.label}})))}))]}))}))},t.prototype.setAudioRecordingDevice=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.microphoneConfig.microphoneId=e.deviceId,[2]}))}))},t.prototype.getAudioRecordingDevice=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,null!==(t=this.microphoneConfig.microphoneId)&&void 0!==t?t:""]}))}))},t.prototype.setAudioRecordingDeviceVolume=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.adjustRecordingSignalVolume(e.volume)]}))}))},t.prototype.getAudioRecordingDeviceVolume=function(){var e,t;return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,null!==(t=null===(e=this.localAudioTrack)||void 0===e?void 0:e.getVolumeLevel())&&void 0!==t?t:0]}))}))},t.prototype.getAudioRecordingDeviceInfo=function(e){var t;return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(i){return[2,null===(t=A.getMicrophones())||void 0===t?void 0:t.then((function(t){var i=t.find((function(t){return t.deviceId===e.microphoneConfig.microphoneId}));return JSON.stringify({deviceId:i.deviceId,deviceName:i.label})}))]}))}))},t.prototype.enumerateVideoDevices=function(){var e;return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,null===(e=A.getCameras())||void 0===e?void 0:e.then((function(e){return JSON.stringify(e.map((function(e){return{deviceId:e.deviceId,deviceName:e.label}})))}))]}))}))},t.prototype.setVideoDeviceId=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.cameraConfig!==e.deviceId&&(this.cameraConfig.cameraId=e.deviceId,this.localAudioTrack&&this.localAudioTrack.getTrackLabel()),[2]}))}))},t.prototype.getVideoDeviceId=function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,null!==(t=this.cameraConfig.cameraId)&&void 0!==t?t:""]}))}))},t}(u);t.default=E},986:function(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=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(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(424),s=i(673),a=i(910),c=i(593),A=i(554),d=i(424),u=function(){function e(){var e;this.channel=new A.default(this),this.deviceManager=new s.default,this._support_apis=((e={})[a.ApiTypeEngine.kEngineInitialize]=this.initialize,e[a.ApiTypeEngine.kEngineRelease]=this.release,e[a.ApiTypeEngine.kEngineSetChannelProfile]=this.setChannelProfile,e[a.ApiTypeEngine.kEngineSetClientRole]=this.setClientRole,e[a.ApiTypeEngine.kEngineJoinChannel]=this.joinChannel,e[a.ApiTypeEngine.kEngineLeaveChannel]=this.leaveChannel,e[a.ApiTypeEngine.kEngineRenewToken]=this.renewToken,e[a.ApiTypeEngine.kEngineJoinChannelWithUserAccount]=this.joinChannelWithUserAccount,e[a.ApiTypeEngine.kEngineEnableVideo]=this.enableVideo,e[a.ApiTypeEngine.kEngineDisableVideo]=this.disableVideo,e[a.ApiTypeEngine.kEngineSetVideoEncoderConfiguration]=this.setVideoEncoderConfiguration,e[a.ApiTypeEngine.kEngineSetupLocalVideo]=this.setupLocalVideo,e[a.ApiTypeEngine.kEngineSetupRemoteVideo]=this.setupRemoteVideo,e[a.ApiTypeEngine.kEngineStartPreview]=this.startPreview,e[a.ApiTypeEngine.kEngineStopPreview]=this.stopPreview,e[a.ApiTypeEngine.kEngineEnableAudio]=this.enableAudio,e[a.ApiTypeEngine.kEngineEnableLocalAudio]=this.enableLocalAudio,e[a.ApiTypeEngine.kEngineDisableAudio]=this.disableAudio,e[a.ApiTypeEngine.kEngineSetAudioProfile]=this.setAudioProfile,e[a.ApiTypeEngine.kEngineMuteLocalAudioStream]=this.muteLocalAudioStream,e[a.ApiTypeEngine.kEngineMuteAllRemoteAudioStreams]=this.muteAllRemoteAudioStreams,e[a.ApiTypeEngine.kEngineSetDefaultMuteAllRemoteAudioStreams]=this.setDefaultMuteAllRemoteAudioStreams,e[a.ApiTypeEngine.kEngineAdjustUserPlaybackSignalVolume]=this.adjustUserPlaybackSignalVolume,e[a.ApiTypeEngine.kEngineMuteRemoteAudioStream]=this.muteRemoteAudioStream,e[a.ApiTypeEngine.kEngineMuteLocalVideoStream]=this.muteLocalVideoStream,e[a.ApiTypeEngine.kEngineEnableLocalVideo]=this.enableLocalVideo,e[a.ApiTypeEngine.kEngineMuteAllRemoteVideoStreams]=this.muteAllRemoteVideoStreams,e[a.ApiTypeEngine.kEngineSetDefaultMuteAllRemoteVideoStreams]=this.setDefaultMuteAllRemoteVideoStreams,e[a.ApiTypeEngine.kEngineMuteRemoteVideoStream]=this.muteRemoteVideoStream,e[a.ApiTypeEngine.kEngineSetRemoteVideoStreamType]=this.setRemoteVideoStreamType,e[a.ApiTypeEngine.kEngineSetRemoteDefaultVideoStreamType]=this.setRemoteDefaultVideoStreamType,e[a.ApiTypeEngine.kEngineEnableAudioVolumeIndication]=this.enableAudioVolumeIndication,e[a.ApiTypeEngine.kEngineSetLogFilter]=this.setLogFilter,e[a.ApiTypeEngine.kEngineUploadLogFile]=this.uploadLogFile,e[a.ApiTypeEngine.kEngineEnableDualStreamMode]=this.enableDualStreamMode,e[a.ApiTypeEngine.kEngineAdjustRecordingSignalVolume]=this.adjustRecordingSignalVolume,e[a.ApiTypeEngine.kEngineAdjustPlaybackSignalVolume]=this.adjustPlaybackSignalVolume,e[a.ApiTypeEngine.kEngineSetRemoteSubscribeFallbackOption]=this.setRemoteSubscribeFallbackOption,e[a.ApiTypeEngine.kEngineStartScreenCaptureByDisplayId]=this.startScreenCaptureByDisplayId,e[a.ApiTypeEngine.kEngineStartScreenCaptureByScreenRect]=this.startScreenCaptureByScreenRect,e[a.ApiTypeEngine.kEngineStartScreenCaptureByWindowId]=this.startScreenCaptureByWindowId,e[a.ApiTypeEngine.kEngineStopScreenCapture]=this.stopScreenCapture,e[a.ApiTypeEngine.kEngineStartScreenCapture]=this.startScreenCapture,e[a.ApiTypeEngine.kEngineGetVersion]=this.getVersion,e[a.ApiTypeEngine.kEngineSetEncryptionSecret]=this.setEncryptionSecret,e[a.ApiTypeEngine.kEngineSetEncryptionMode]=this.setEncryptionMode,e[a.ApiTypeEngine.kEngineEnableEncryption]=this.enableEncryption,e[a.ApiTypeEngine.kEngineAddPublishStreamUrl]=this.addPublishStreamUrl,e[a.ApiTypeEngine.kEngineRemovePublishStreamUrl]=this.removePublishStreamUrl,e[a.ApiTypeEngine.kEngineSetLiveTranscoding]=this.setLiveTranscoding,e[a.ApiTypeEngine.kEngineSetBeautyEffectOptions]=this.setBeautyEffectOptions,e[a.ApiTypeEngine.kEngineAddInjectStreamUrl]=this.addInjectStreamUrl,e[a.ApiTypeEngine.kEngineStartChannelMediaRelay]=this.startChannelMediaRelay,e[a.ApiTypeEngine.kEngineUpdateChannelMediaRelay]=this.updateChannelMediaRelay,e[a.ApiTypeEngine.kEngineStopChannelMediaRelay]=this.stopChannelMediaRelay,e[a.ApiTypeEngine.kEngineRemoveInjectStreamUrl]=this.removeInjectStreamUrl,e[a.ApiTypeEngine.kEngineSendCustomReportMessage]=this.sendCustomReportMessage,e[a.ApiTypeEngine.kEngineGetConnectionState]=this.getConnectionState,e[a.ApiTypeEngine.kEngineSetParameters]=this.setParameters,e[a.ApiTypeEngine.kEngineSetAppType]=this.setAppType,e[a.ApiTypeEngine.kEngineSetCloudProxy]=this.setCloudProxy,e),this._reset()}return e.prototype._reset=function(){this._config={codec:"h264",mode:"rtc"},this._client=void 0,this._context=void 0,this._handler=void 0,this._enableAudio=!0,this._enableVideo=!1,this._enableLocalAudio=!0,this._enableLocalVideo=!0,this._muteLocalAudio=!1,this._muteLocalVideo=!1,this._defaultMuteAllRemoteAudioStreams=!1,this._defaultMuteAllRemoteVideoStreams=!1,this._encryptionMode=void 0,this._secret=void 0},e.prototype._addListener=function(){var e=this;if(void 0===this._client)throw"please create first";this._client.on("connection-state-change",(function(t,i,n){(0,c.printf)("connection-state-change",t,i,i),e._emitEvent("ConnectionStateChanged",{state:(0,c.ConnectionStateToNative)(t),reason:(0,c.ConnectionDisconnectedReasonToNative)(n)})})),this._client.on("user-joined",(function(t){(0,c.printf)("user-joined",t),e._emitEvent("UserJoined",{uid:t.uid,elapsed:0})})),this._client.on("user-left",(function(t,i){(0,c.printf)("user-left",t,i),e._emitEvent("UserOffline",{uid:t.uid,reason:(0,c.UserLeftReasonToNative)(i)})})),this._client.on("user-published",(function(t,i){return n(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:switch((0,c.printf)("user-published",t,i),i){case"audio":return[3,1];case"video":return[3,3]}return[3,5];case 1:return!this._enableAudio||this._defaultMuteAllRemoteAudioStreams?[2]:[4,this.muteRemoteAudioStream({userId:t,mute:!1})];case 2:return e.sent(),this._emitEvent("RemoteAudioStateChanged",{uid:t.uid,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_DECODING,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,elapsed:0}),[3,5];case 3:return!this._enableVideo||this._defaultMuteAllRemoteVideoStreams?[2]:[4,this.muteRemoteVideoStream({userId:t,mute:!1})];case 4:return e.sent(),this._emitEvent("RemoteVideoStateChanged",{uid:t.uid,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_DECODING,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,elapsed:0}),[3,5];case 5:return[2]}}))}))})),this._client.on("user-unpublished",(function(t,i){switch((0,c.printf)("user-unpublished",t,i),i){case"audio":e.deviceManager.removeRemoteAudioTrack(t.uid),e._emitEvent("RemoteAudioStateChanged",{uid:t.uid,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED,elapsed:0});break;case"video":e.deviceManager.removeRemoteVideoTrack(t.uid),e._emitEvent("RemoteVideoStateChanged",{uid:t.uid,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STOPPED,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,elapsed:0})}})),this._client.on("user-info-updated",(function(t,i){switch((0,c.printf)("user-info-updated",t,i),i){case"mute-audio":e._emitEvent("RemoteAudioStateChanged",{uid:t,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STOPPED,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_MUTED,elapsed:0});break;case"mute-video":case"disable-local-video":e._emitEvent("RemoteVideoStateChanged",{uid:t,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STOPPED,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED,elapsed:0});break;case"unmute-audio":e._emitEvent("RemoteAudioStateChanged",{uid:t,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_DECODING,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,elapsed:0});break;case"unmute-video":case"enable-local-video":e._emitEvent("RemoteVideoStateChanged",{uid:t,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_DECODING,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,elapsed:0})}})),this._client.on("media-reconnect-start",(function(e){(0,c.printf)("media-reconnect-start",e)})),this._client.on("media-reconnect-end",(function(e){(0,c.printf)("media-reconnect-end",e)})),this._client.on("stream-type-changed",(function(e,t){(0,c.printf)("stream-type-changed",e,t)})),this._client.on("stream-fallback",(function(t,i){(0,c.printf)("stream-fallback",t,i),e._emitEvent("RemoteSubscribeFallbackToAudioOnly",{uid:t,isFallbackOrRecover:"fallback"===i})})),this._client.on("channel-media-relay-state",(function(t,i){(0,c.printf)("channel-media-relay-state",t,i),e._emitEvent("ChannelMediaRelayStateChanged",{state:(0,c.ChannelMediaRelayStateToNative)(t),code:(0,c.ChannelMediaRelayErrorToNative)(i)})})),this._client.on("channel-media-relay-event",(function(t){(0,c.printf)("channel-media-relay-event",t),e._emitEvent("ChannelMediaRelayEvent",{code:(0,c.ChannelMediaRelayEventToNative)(t)})})),this._client.on("volume-indicator",(function(t){(0,c.printf)("volume-indicator",t);var i=0,n=t.map((function(t){var n,r,o=Math.floor(t.level/100*255);return i+=o,{uid:+t.uid,volume:o,vad:0,channelId:null!==(r=null===(n=e._client)||void 0===n?void 0:n.channelName)&&void 0!==r?r:""}}));e._emitEvent("AudioVolumeIndication",{speakers:n,speakerNumber:t.length,totalVolume:i})})),this._client.on("crypt-error",(function(){(0,c.printf)("crypt-error")})),this._client.on("token-privilege-will-expire",(function(){(0,c.printf)("token-privilege-will-expire"),e._emitEvent("TokenPrivilegeWillExpire")})),this._client.on("token-privilege-did-expire",(function(){(0,c.printf)("token-privilege-did-expire")})),this._client.on("network-quality",(function(t){var i;(0,c.printf)("network-quality",t),e._emitEvent("NetworkQuality",{uid:0,txQuality:(0,c.NetworkQualityToNative)(t.uplinkNetworkQuality),rxQuality:(0,c.NetworkQualityToNative)(t.downlinkNetworkQuality)});var n=null===(i=e._client)||void 0===i?void 0:i.getRemoteNetworkQuality();if(n)for(var r in n)e._emitEvent("NetworkQuality",{uid:+r,txQuality:(0,c.NetworkQualityToNative)(n[r].uplinkNetworkQuality),rxQuality:(0,c.NetworkQualityToNative)(n[r].downlinkNetworkQuality)})})),this._client.on("live-streaming-error",(function(t,i){(0,c.printf)("live-streaming-error",t,i),e._emitEvent("RtmpStreamingStateChanged",{url:t,state:a.RTMP_STREAM_PUBLISH_STATE.RTMP_STREAM_PUBLISH_STATE_IDLE,errCode:(0,c.RtmpStreamingErrorToNative)(i.code)})})),this._client.on("live-streaming-warning",(function(t,i){(0,c.printf)("live-streaming-warning",t,i),"LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE"===i.code?e._emitEvent("RtmpStreamingEvent",{url:t,eventCode:a.RTMP_STREAMING_EVENT.RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE}):e._emitEvent("RtmpStreamingStateChanged",{url:t,state:a.RTMP_STREAM_PUBLISH_STATE.RTMP_STREAM_PUBLISH_STATE_IDLE,errCode:(0,c.RtmpStreamingErrorToNative)(i.code)})})),this._client.on("stream-inject-status",(function(t,i,n){(0,c.printf)("stream-inject-status",t,i,n),e._emitEvent("StreamInjectedStatus",{url:n,uid:i,status:(0,c.InjectStreamEventStatusToNative)(t)})})),this._client.on("exception",(function(t){(0,c.printf)("exception",t),t.code in a.ERROR_CODE_TYPE&&e._emitEvent("Error",{err:t.code,msg:""})})),this._client.on("is-using-cloud-proxy",(function(e){(0,c.printf)("is-using-cloud-proxy",e)}))},e.prototype._emitEvent=function(e,t){var i;void 0===t&&(t={}),(0,c.printf)("_emitEvent",e,t,this._handler),null===(i=this._handler)||void 0===i||i.call(this,e,JSON.stringify(t))},e.prototype._createClient=function(){void 0===this._client&&(this._client=d.createClient(this._config),this._addListener())},e._setLogLevel=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){if(void 0!==e.level){switch(t=0,e.level){case a.LOG_LEVEL.LOG_LEVEL_NONE:t=4;break;case a.LOG_LEVEL.LOG_LEVEL_INFO:t=1;break;case a.LOG_LEVEL.LOG_LEVEL_WARN:t=2;break;case a.LOG_LEVEL.LOG_LEVEL_ERROR:case a.LOG_LEVEL.LOG_LEVEL_FATAL:t=3}return[2,d.setLogLevel(t)]}return[2]}))}))},e._setArea=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return void 0!==e?[2,d.setArea(e.map((function(e){switch(e){case a.AREA_CODE.AREA_CODE_CN:return o.AREAS.CHINA;case a.AREA_CODE.AREA_CODE_NA:return o.AREAS.NORTH_AMERICA;case a.AREA_CODE.AREA_CODE_EU:return o.AREAS.EUROPE;case a.AREA_CODE.AREA_CODE_AS:return o.AREAS.ASIA;case a.AREA_CODE.AREA_CODE_JP:return o.AREAS.JAPAN;case a.AREA_CODE.AREA_CODE_IN:return o.AREAS.INDIA;case a.AREA_CODE.AREA_CODE_GLOB:return o.AREAS.GLOBAL}})))]:[2]}))}))},e.prototype._publish=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(void 0===this._client)throw"please create first";return void 0===e?[2]:void 0===(null==e?void 0:e.setBeautyEffect)?[3,2]:[4,this.deviceManager.muteLocalVideo(this._muteLocalVideo)];case 1:return t.sent(),[3,4];case 2:return[4,this.deviceManager.muteLocalAudio(this._muteLocalAudio)];case 3:t.sent(),t.label=4;case 4:return[2,this._client.publish(e)]}}))}))},e.prototype.callApi=function(e,t,i){var o;return n(this,void 0,void 0,(function(){return r(this,(function(n){return(0,c.printf)("callApi",e,t,i,this),[2,null===(o=this._support_apis[e])||void 0===o?void 0:o.call(this,JSON.parse(t),i)]}))}))},e.prototype.setEventHandler=function(e){this._handler=e},e.prototype.createChannel=function(){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._context)throw"please create first";return(t=new e)._config.mode=this._config.mode,t._enableAudio=this._enableAudio,t._enableLocalAudio=this._enableLocalAudio,t._enableVideo=this._enableVideo,t._enableLocalVideo=this._enableLocalVideo,[4,t.initialize({context:this._context})];case 1:return i.sent(),[2,t]}}))}))},e.prototype.initialize=function(t,i){var o;return n(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return this._context=t.context,[4,e._setArea(t.context.areaCode)];case 1:return n.sent(),[4,e._setLogLevel({level:null===(o=t.context.logConfig)||void 0===o?void 0:o.level})];case 2:return n.sent(),void 0!==i&&(this._config=i),this._createClient(),[2]}}))}))},e.prototype.release=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.leaveChannel()];case 1:return e.sent(),this.deviceManager.release(),this._reset(),[2]}}))}))},e.prototype.setChannelProfile=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:switch(e.profile){case a.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_COMMUNICATION:t="rtc";break;case a.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_LIVE_BROADCASTING:t="live";case a.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_GAME:}return void 0===t||t===this._config.mode?[3,2]:[4,this.leaveChannel()];case 1:i.sent(),this.deviceManager.release(),this._config.mode=t,this._client=void 0,this._createClient(),i.label=2;case 2:return[2]}}))}))},e.prototype.setClientRole=function(e){var t;return n(this,void 0,void 0,(function(){var i,n;return r(this,(function(r){if(void 0===this._client)throw"please create first";switch(e.role){case a.CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER:i="host";break;case a.CLIENT_ROLE_TYPE.CLIENT_ROLE_AUDIENCE:i="audience"}switch(null===(t=e.options)||void 0===t?void 0:t.audienceLatencyLevel){case a.AUDIENCE_LATENCY_LEVEL_TYPE.AUDIENCE_LATENCY_LEVEL_LOW_LATENCY:n=o.AudienceLatencyLevelType.AUDIENCE_LEVEL_LOW_LATENCY;break;case a.AUDIENCE_LATENCY_LEVEL_TYPE.AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY:n=o.AudienceLatencyLevelType.AUDIENCE_LEVEL_ULTRA_LOW_LATENCY}return[2,this._client.setClientRole(i,n?{level:n}:void 0)]}))}))},e.prototype.joinChannel=function(e){var t,i;return n(this,void 0,void 0,(function(){var o,s,a,c=this;return r(this,(function(A){if(void 0===this._context)throw"please create first";return o=e.channelId,s=e.token,a=e.uid,[2,null===(t=this._client)||void 0===t?void 0:t.join(null===(i=this._context)||void 0===i?void 0:i.appId,o,s,a).then((function(e){return n(c,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,,5,6]),t=this._publish,[4,this.deviceManager.createMicrophoneAudioTrack(this._enableAudio&&this._enableLocalAudio,this._emitEvent.bind(this))];case 1:return[4,t.apply(this,[n.sent()])];case 2:return n.sent(),i=this._publish,[4,this.deviceManager.createCameraVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this))];case 3:return[4,i.apply(this,[n.sent()])];case 4:return n.sent(),[3,6];case 5:return this._emitEvent("JoinChannelSuccess",{channel:o,uid:e,elapsed:0}),[7];case 6:return[2]}}))}))}))]}))}))},e.prototype.leaveChannel=function(e){return n(this,void 0,void 0,(function(){var e=this;return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.leave().then((function(){var t;e.deviceManager.release();var i={cpuAppUsage:0,cpuTotalUsage:0,duration:0,gatewayRtt:0,lastmileDelay:0,memoryAppUsageInKbytes:0,memoryAppUsageRatio:0,memoryTotalUsageRatio:0,rxAudioBytes:0,rxAudioKBitRate:0,rxBytes:0,rxKBitRate:0,rxPacketLossRate:0,rxVideoBytes:0,rxVideoKBitRate:0,txAudioBytes:0,txAudioKBitRate:0,txBytes:0,txKBitRate:0,txPacketLossRate:0,txVideoBytes:0,txVideoKBitRate:0,userCount:0},n=null===(t=e._client)||void 0===t?void 0:t.getRTCStats();n&&(i.duration=n.Duration,i.rxKBitRate=n.RecvBitrate,i.rxBytes=n.RecvBytes,i.txKBitRate=n.SendBitrate,i.txBytes=n.SendBytes,i.userCount=n.UserCount,i.gatewayRtt=n.RTT),e._emitEvent("LeaveChannel",{stats:i})}))]}))}))},e.prototype.renewToken=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.renewToken(e.token)]}))}))},e.prototype.joinChannelWithUserAccount=function(e){var t;return n(this,void 0,void 0,(function(){var i,o,s,a=this;return r(this,(function(c){if(void 0===this._context)throw"please create first";return i=e.channelId,o=e.token,s=e.userAccount,[2,null===(t=this._client)||void 0===t?void 0:t.join(this._context.appId,i,o,s).then((function(e){return n(a,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,,5,6]),t=this._publish,[4,this.deviceManager.createMicrophoneAudioTrack(this._enableAudio&&this._enableLocalAudio,this._emitEvent.bind(this))];case 1:return[4,t.apply(this,[r.sent()])];case 2:return r.sent(),n=this._publish,[4,this.deviceManager.createCameraVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this))];case 3:return[4,n.apply(this,[r.sent()])];case 4:return r.sent(),[3,6];case 5:return this._emitEvent("JoinChannelSuccess",{channel:i,uid:e,elapsed:0}),[7];case 6:return[2]}}))}))}))]}))}))},e.prototype.enableVideo=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableVideo=!0,[4,Promise.all([this.deviceManager.enableLocalVideo(this._enableVideo&&this._enableLocalAudio),this.deviceManager.enableRemoteVideo(this._enableVideo)])];case 1:return e.sent(),[2]}}))}))},e.prototype.disableVideo=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableVideo=!1,[4,Promise.all([this.deviceManager.enableLocalVideo(this._enableVideo&&this._enableLocalAudio),this.deviceManager.enableRemoteVideo(this._enableVideo)])];case 1:return e.sent(),[2]}}))}))},e.prototype.setVideoEncoderConfiguration=function(e){var t,i;return n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.deviceManager.setVideoEncoderConfiguration({width:null===(t=e.config.dimensions)||void 0===t?void 0:t.width,height:null===(i=e.config.dimensions)||void 0===i?void 0:i.height,frameRate:e.config.frameRate,bitrateMin:e.config.minBitrate,bitrateMax:e.config.bitrate})]}))}))},e.prototype.setupLocalVideo=function(e,t){return n(this,void 0,void 0,(function(){var i,n;return r(this,(function(r){return i=e.canvas,void 0!==t&&(i.view=t),void 0!==(n=this.channel.getChannel(i.channelId))?n.deviceManager.setupLocalVideo(i):this.deviceManager.setupLocalVideo(i),[2]}))}))},e.prototype.setupRemoteVideo=function(e,t){return n(this,void 0,void 0,(function(){var i,n;return r(this,(function(r){return i=e.canvas,void 0!==t&&(i.view=t),void 0!==(n=this.channel.getChannel(i.channelId))?n.deviceManager.setupRemoteVideo(i.uid,i):this.deviceManager.setupRemoteVideo(i.uid,i),[2]}))}))},e.prototype.startPreview=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:if(void 0===this._client)throw"please create first";return void 0!==this._client.channelName?[2]:[4,this.deviceManager.createCameraVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),!0)];case 1:return e.sent(),[2]}}))}))},e.prototype.stopPreview=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return void 0!==this._client.channelName?[2]:[2,this.deviceManager.stopCameraCapture()]}))}))},e.prototype.enableAudio=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableAudio=!0,[4,Promise.all([this.deviceManager.enableLocalAudio(this._enableAudio&&this._enableLocalAudio),this.deviceManager.enableRemoteAudio(this._enableAudio)])];case 1:return e.sent(),[2]}}))}))},e.prototype.enableLocalAudio=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._enableLocalAudio=e.enabled,[2,this.deviceManager.enableLocalAudio(this._enableAudio&&this._enableLocalAudio)]}))}))},e.prototype.disableAudio=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._enableAudio=!1,[4,Promise.all([this.deviceManager.enableLocalAudio(this._enableAudio&&this._enableLocalAudio),this.deviceManager.enableRemoteAudio(this._enableAudio)])];case 1:return e.sent(),[2]}}))}))},e.prototype.setAudioProfile=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(t="music_standard",e.profile){case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_DEFAULT:t="music_standard";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_SPEECH_STANDARD:t="speech_standard";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_STANDARD:t="music_standard";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_STANDARD_STEREO:t="standard_stereo";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_HIGH_QUALITY:t="high_quality";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO:t="high_quality_stereo";break;case a.AUDIO_PROFILE_TYPE.AUDIO_PROFILE_IOT:t="speech_low_quality"}return this.deviceManager.setAudioEncoderConfiguration(t),[2]}))}))},e.prototype.muteLocalAudioStream=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return this._muteLocalAudio=e.mute,[2,this.deviceManager.muteLocalAudio(this._muteLocalAudio)]}))}))},e.prototype.muteAllRemoteAudioStreams=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){return t.muteRemoteAudioStream({userId:i,mute:e.mute})})))];case 1:return i.sent(),[2]}}))}))},e.prototype.setDefaultMuteAllRemoteAudioStreams=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._defaultMuteAllRemoteAudioStreams=e.mute,[2]}))}))},e.prototype.adjustUserPlaybackSignalVolume=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.deviceManager.adjustUserPlaybackSignalVolume(e.uid,e.volume)];case 1:return t.sent(),[2]}}))}))},e.prototype.muteRemoteAudioStream=function(e){return n(this,void 0,void 0,(function(){var t,i=this;return r(this,(function(o){switch(o.label){case 0:if(void 0===this._client)throw"please create first";return t=function(t){return n(i,void 0,void 0,(function(){var i=this;return r(this,(function(n){if(void 0===this._client)throw"please create first";return e.mute?[2,this._client.unsubscribe(t,"audio").then((function(){i.deviceManager.removeRemoteAudioTrack(t.uid)}))]:[2,this._client.subscribe(t,"audio").then((function(e){e.on("first-frame-decoded",(function(){(0,c.printf)("first-frame-decoded","audio",e),i._emitEvent("RemoteAudioStateChanged",{uid:t.uid,state:a.REMOTE_AUDIO_STATE.REMOTE_AUDIO_STATE_STARTING,reason:a.REMOTE_AUDIO_STATE_REASON.REMOTE_AUDIO_REASON_REMOTE_UNMUTED,elapsed:0})})),i.deviceManager.addRemoteAudioTrack(e),e.play()}))]}))}))},"number"!=typeof e.userId?[3,2]:[4,Promise.all(this._client.remoteUsers.map((function(i){if(i.uid===e.userId)return t(i)})))];case 1:return o.sent(),[3,3];case 2:return[2,t(e.userId)];case 3:return[2]}}))}))},e.prototype.muteLocalVideoStream=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return this._muteLocalVideo=e.mute,[2,this.deviceManager.muteLocalVideo(this._muteLocalVideo)]}))}))},e.prototype.enableLocalVideo=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._enableLocalVideo=e.enabled,[2,this.deviceManager.enableLocalVideo(this._enableVideo&&this._enableLocalVideo)]}))}))},e.prototype.muteAllRemoteVideoStreams=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){return t.muteRemoteVideoStream({userId:i,mute:e.mute})})))];case 1:return i.sent(),[2]}}))}))},e.prototype.setDefaultMuteAllRemoteVideoStreams=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return this._defaultMuteAllRemoteVideoStreams=e.mute,[2]}))}))},e.prototype.muteRemoteVideoStream=function(e){return n(this,void 0,void 0,(function(){var t,i=this;return r(this,(function(o){switch(o.label){case 0:if(void 0===this._client)throw"please create first";return t=function(t){return n(i,void 0,void 0,(function(){var i=this;return r(this,(function(n){if(void 0===this._client)throw"please create first";return e.mute?[2,this._client.unsubscribe(t,"video").then((function(){i.deviceManager.removeRemoteAudioTrack(t.uid)}))]:[2,this._client.subscribe(t,"video").then((function(e){e.on("first-frame-decoded",(function(){(0,c.printf)("first-frame-decoded","video",e),i._emitEvent("RemoteVideoStateChanged",{uid:t.uid,state:a.REMOTE_VIDEO_STATE.REMOTE_VIDEO_STATE_STARTING,reason:a.REMOTE_VIDEO_STATE_REASON.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED,elapsed:0})})),i.deviceManager.addRemoteVideoTrack(e),i.deviceManager.playRemoteVideo(t.uid)}))]}))}))},"number"!=typeof e.userId?[3,2]:[4,Promise.all(this._client.remoteUsers.map((function(i){if(i.uid===e.userId)return t(i)})))];case 1:return o.sent(),[3,3];case 2:return[2,t(e.userId)];case 3:return[2]}}))}))},e.prototype.setRemoteVideoStreamType=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";switch(e.streamType){case a.REMOTE_VIDEO_STREAM_TYPE.REMOTE_VIDEO_STREAM_HIGH:t=o.RemoteStreamType.HIGH_STREAM;break;case a.REMOTE_VIDEO_STREAM_TYPE.REMOTE_VIDEO_STREAM_LOW:t=o.RemoteStreamType.LOW_STREAM}return[4,this._client.setRemoteVideoStreamType(e.userId,t)];case 1:return i.sent(),[2]}}))}))},e.prototype.setRemoteDefaultVideoStreamType=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){return t.setRemoteVideoStreamType({userId:i.uid,streamType:e.streamType})})))];case 1:return i.sent(),[2]}}))}))},e.prototype.enableAudioVolumeIndication=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,this._client.enableAudioVolumeIndicator()]}))}))},e.prototype.setLogFilter=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){switch(t=a.LOG_LEVEL.LOG_LEVEL_INFO,e.filter){case a.LOG_FILTER_TYPE.LOG_FILTER_OFF:t=a.LOG_LEVEL.LOG_LEVEL_NONE;break;case a.LOG_FILTER_TYPE.LOG_FILTER_DEBUG:case a.LOG_FILTER_TYPE.LOG_FILTER_INFO:case a.LOG_FILTER_TYPE.LOG_FILTER_MASK:t=a.LOG_LEVEL.LOG_LEVEL_INFO;break;case a.LOG_FILTER_TYPE.LOG_FILTER_WARN:t=a.LOG_LEVEL.LOG_LEVEL_WARN;break;case a.LOG_FILTER_TYPE.LOG_FILTER_ERROR:t=a.LOG_LEVEL.LOG_LEVEL_ERROR;break;case a.LOG_FILTER_TYPE.LOG_FILTER_CRITICAL:t=a.LOG_LEVEL.LOG_LEVEL_FATAL}return[2,d.setLogLevel(t)]}))}))},e.prototype.uploadLogFile=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return d.enableLogUpload(),[2,""]}))}))},e.prototype.enableDualStreamMode=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return e.enabled?[2,this._client.enableDualStream()]:[2,this._client.disableDualStream()]}))}))},e.prototype.adjustRecordingSignalVolume=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.deviceManager.adjustRecordingSignalVolume(e.volume)]}))}))},e.prototype.adjustPlaybackSignalVolume=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.deviceManager.adjustPlaybackSignalVolume(e.volume)];case 1:return t.sent(),[2]}}))}))},e.prototype.startScreenCaptureByDisplayId=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){return[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),e.captureParams,!0).then((function(e){t._muteLocalVideo||t._publish(e)}))]}))}))},e.prototype.startScreenCaptureByScreenRect=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){return[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),e.captureParams,!0).then((function(e){t._muteLocalVideo||t._publish(e)}))]}))}))},e.prototype.startScreenCaptureByWindowId=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){return[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),e.captureParams,!0).then((function(e){t._muteLocalVideo||t._publish(e)}))]}))}))},e.prototype.stopScreenCapture=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,this.deviceManager.stopScreenCapture()]}))}))},e.prototype.startScreenCapture=function(e){return n(this,void 0,void 0,(function(){var t,i=this;return r(this,(function(n){return t=e.rect,[2,this.deviceManager.createScreenVideoTrack(this._enableVideo&&this._enableLocalVideo,this._emitEvent.bind(this),{dimensions:{width:t&&void 0!==t.right&&void 0!==t.left?t.right-t.left:void 0,height:t&&void 0!==t.bottom&&void 0!==t.top?t.bottom-t.top:void 0},frameRate:e.captureFreq,bitrate:e.bitrate},!0).then((function(e){i._muteLocalVideo||i._publish(e)}))]}))}))},e.prototype.setRemoteSubscribeFallbackOption=function(e){return n(this,void 0,void 0,(function(){var t=this;return r(this,(function(i){switch(i.label){case 0:if(void 0===this._client)throw"please create first";return[4,Promise.all(this._client.remoteUsers.map((function(i){var n,r;switch(e.option){case a.STREAM_FALLBACK_OPTIONS.STREAM_FALLBACK_OPTION_DISABLED:r=o.RemoteStreamFallbackType.DISABLE;break;case a.STREAM_FALLBACK_OPTIONS.STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW:r=o.RemoteStreamFallbackType.LOW_STREAM;break;case a.STREAM_FALLBACK_OPTIONS.STREAM_FALLBACK_OPTION_AUDIO_ONLY:r=o.RemoteStreamFallbackType.AUDIO_ONLY}return null===(n=t._client)||void 0===n?void 0:n.setStreamFallbackOption(i.uid,r)})))];case 1:return i.sent(),[2]}}))}))},e.prototype.getVersion=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,d.VERSION]}))}))},e.prototype.setEncryptionSecret=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(this._secret=e.secret,void 0===this._client)throw"please create first";return this._encryptionMode&&this._secret?[2,this._client.setEncryptionConfig(this._encryptionMode,this._secret)]:[2,this._client.setEncryptionConfig("none","")]}))}))},e.prototype.setEncryptionMode=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(this._encryptionMode=e.encryptionMode,void 0===this._client)throw"please create first";return this._encryptionMode&&this._secret?[2,this._client.setEncryptionConfig(this._encryptionMode,this._secret)]:[2,this._client.setEncryptionConfig("none","")]}))}))},e.prototype.enableEncryption=function(e){var t;return n(this,void 0,void 0,(function(){var i;return r(this,(function(n){if(void 0===this._client)throw"please create first";if(i="aes-128-xts",e.enabled)switch(e.config.encryptionMode){case a.ENCRYPTION_MODE.AES_128_XTS:i="aes-128-xts";break;case a.ENCRYPTION_MODE.AES_128_ECB:i="aes-128-ecb";break;case a.ENCRYPTION_MODE.AES_256_XTS:i="aes-256-xts";break;case a.ENCRYPTION_MODE.SM4_128_ECB:i="sm4-128-ecb";break;case a.ENCRYPTION_MODE.AES_128_GCM:i="aes-128-gcm";break;case a.ENCRYPTION_MODE.AES_256_GCM:i="aes-256-gcm";break;case a.ENCRYPTION_MODE.MODE_END:i="none"}else i="none";return[2,this._client.setEncryptionConfig(i,null!==(t=e.config.encryptionKey)&&void 0!==t?t:"")]}))}))},e.prototype.addPublishStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.startLiveStreaming(e.url,e.transcodingEnabled)]}))}))},e.prototype.removePublishStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.stopLiveStreaming(e.url)]}))}))},e.prototype.setLiveTranscoding=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.setLiveTranscoding({audioBitrate:e.transcoding.audioBitrate,audioChannels:e.transcoding.audioChannels,audioSampleRate:e.transcoding.audioSampleRate,backgroundColor:e.transcoding.backgroundColor,height:e.transcoding.height,width:e.transcoding.width,lowLatency:e.transcoding.lowLatency,videoBitrate:e.transcoding.videoBitrate,videoCodecProfile:e.transcoding.videoCodecProfile,videoFrameRate:e.transcoding.videoFramerate,videoGop:e.transcoding.videoGop,watermark:e.transcoding.watermark,backgroundImage:e.transcoding.backgroundImage,transcodingUsers:e.transcoding.transcodingUsers,userConfigExtraInfo:e.transcoding.transcodingExtraInfo})]}))}))},e.prototype.setBeautyEffectOptions=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.deviceManager.setBeautyEffect(e.enabled,{smoothnessLevel:e.options.smoothnessLevel,lighteningLevel:e.options.lighteningLevel,rednessLevel:e.options.rednessLevel,lighteningContrastLevel:e.options.lighteningContrastLevel})]}))}))},e.prototype.addInjectStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){if(void 0===this._client)throw"please create first";return[2,this._client.addInjectStreamUrl(e.url,{audioBitrate:e.config.audioBitrate,audioChannels:e.config.audioChannels,audioSampleRate:e.config.audioSampleRate,height:e.config.height,width:e.config.width,videoBitrate:e.config.videoBitrate,videoFramerate:e.config.videoFramerate,videoGop:e.config.videoGop})]}))}))},e.prototype.startChannelMediaRelay=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){if(void 0===this._client)throw"please create first";return null==(t=d.createChannelMediaRelayConfiguration())||t.setSrcChannelInfo(e.configuration.srcInfo),e.configuration.destInfos.map((function(e){null==t||t.addDestChannelInfo(e)})),[2,this._client.startChannelMediaRelay(t)]}))}))},e.prototype.updateChannelMediaRelay=function(e){return n(this,void 0,void 0,(function(){var t;return r(this,(function(i){if(void 0===this._client)throw"please create first";return null==(t=d.createChannelMediaRelayConfiguration())||t.setSrcChannelInfo(e.configuration.srcInfo),e.configuration.destInfos.map((function(e){null==t||t.addDestChannelInfo(e)})),[2,this._client.updateChannelMediaRelay(t)]}))}))},e.prototype.stopChannelMediaRelay=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,this._client.stopChannelMediaRelay()]}))}))},e.prototype.removeInjectStreamUrl=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,this._client.removeInjectStreamUrl()]}))}))},e.prototype.sendCustomReportMessage=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(void 0===this._client)throw"please create first";return[4,this._client.sendCustomReportMessage({category:e.id,event:e.category,label:e.event,reportId:e.label,value:e.value})];case 1:return t.sent(),[2]}}))}))},e.prototype.getConnectionState=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(e){if(void 0===this._client)throw"please create first";return[2,(0,c.ConnectionStateToNative)(this._client.connectionState)]}))}))},e.prototype.setParameters=function(e){return n(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){return t=JSON.parse(e.parameters),i=Object.keys(t)[0],[2,d.setParameter(i,t[i])]}))}))},e.prototype.setAppType=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.setParameters({parameters:'{"REPORT_APP_SCENARIO":'.concat(e.appType.toString(),"}")})]}))}))},e.prototype.setCloudProxy=function(e){var t;return n(this,void 0,void 0,(function(){var i;return r(this,(function(n){switch(i=0,e.proxyType){case a.CLOUD_PROXY_TYPE.NONE_PROXY:i=0;break;case a.CLOUD_PROXY_TYPE.UDP_PROXY:i=3;break;case a.CLOUD_PROXY_TYPE.TCP_PROXY:i=5}return[2,null===(t=this._client)||void 0===t?void 0:t.startProxyServer(i)]}))}))},e}();t.default=u},910:(e,t)=>{"use strict";var i,n,r,o,s,a,c,A,d,u,E,l,h,p,_,I,g,f,R,C,T,m,S,O,v,N,y,D,w,b,L,P,k,M,U,B,V,Q,x,F,G,j,Y,H,K,W,J,q,X,z,Z,$,ee,te,ie,ne,re,oe,se,ae,ce,Ae,de,ue,Ee,le,he,pe,_e,Ie,ge,fe,Re,Ce,Te,me,Se,Oe,ve,Ne,ye,De,we,be,Le,Pe,ke,Me,Ue,Be,Ve;Object.defineProperty(t,"__esModule",{value:!0}),t.AUDIO_REVERB_PRESET=t.VOICE_CHANGER_PRESET=t.AUDIO_REVERB_TYPE=t.AUDIO_EQUALIZATION_BAND_FREQUENCY=t.VIDEO_CODEC_TYPE_FOR_STREAM=t.VIDEO_CODEC_TYPE=t.VIDEO_CODEC_PROFILE_TYPE=t.AUDIO_SAMPLE_RATE_TYPE=t.RAW_AUDIO_FRAME_OP_MODE_TYPE=t.CAPTURE_BRIGHTNESS_LEVEL_TYPE=t.REMOTE_VIDEO_STREAM_TYPE=t.INJECT_STREAM_STATUS=t.RTMP_STREAMING_EVENT=t.RTMP_STREAM_PUBLISH_ERROR=t.RTMP_STREAM_PUBLISH_STATE=t.USER_OFFLINE_REASON_TYPE=t.SUPER_RESOLUTION_STATE_REASON=t.AUDIENCE_LATENCY_LEVEL_TYPE=t.CLIENT_ROLE_TYPE=t.CHANNEL_PROFILE_TYPE=t.AUDIO_SCENARIO_TYPE=t.AUDIO_PROFILE_TYPE=t.VIDEO_PROFILE_TYPE=t.VIDEO_MIRROR_MODE_TYPE=t.RENDER_MODE_TYPE=t.QUALITY_TYPE=t.AUDIO_RECORDING_QUALITY_TYPE=t.LOCAL_AUDIO_STREAM_ERROR=t.LOCAL_AUDIO_STREAM_STATE=t.LOCAL_VIDEO_STREAM_ERROR=t.LOCAL_VIDEO_STREAM_STATE=t.MEDIA_DEVICE_TYPE=t.MEDIA_DEVICE_STATE_TYPE=t.AUDIO_MIXING_ERROR_TYPE=t.AUDIO_MIXING_STATE_TYPE=t.MEDIA_ENGINE_EVENT_CODE_TYPE=t.QUALITY_REPORT_FORMAT_TYPE=t.MAX_CHANNEL_ID_LENGTH_TYPE=t.MAX_USER_ACCOUNT_LENGTH_TYPE=t.MAX_DEVICE_ID_LENGTH_TYPE=t.LOG_LEVEL=t.LOG_FILTER_TYPE=t.ERROR_CODE_TYPE=t.WARN_CODE_TYPE=t.INTERFACE_ID_TYPE=t.ApiTypeRawDataPluginManager=t.ApiTypeVideoDeviceManager=t.ApiTypeAudioDeviceManager=t.ApiTypeChannel=t.ApiTypeEngine=void 0,t.ENCRYPTION_MODE=t.METADATA_TYPE=t.VIDEO_CAPTURE_TYPE=t.ENCRYPTION_CONFIG=t.AREA_CODE=t.LIGHTENING_CONTRAST_LEVEL=t.VideoContentHint=t.RTMP_STREAM_LIFE_CYCLE_TYPE=t.VEO=t.LBHQ=t.DEFAULT_MIN_BITRATE=t.COMPATIBLE_BITRATE=t.STANDARD_BITRATE=t.CHANNEL_MEDIA_RELAY_STATE=t.CHANNEL_MEDIA_RELAY_EVENT=t.CHANNEL_MEDIA_RELAY_ERROR=t.EXPERIENCE_POOR_REASON=t.EXPERIENCE_QUALITY_TYPE=t.QUALITY_ADAPT_INDICATION=t.CAMERA_DIRECTION=t.AUDIO_SESSION_OPERATION_RESTRICTION=t.CLOUD_PROXY_TYPE=t.AUDIO_ROUTE_TYPE=t.LASTMILE_PROBE_RESULT_STATE=t.UPLOAD_ERROR_REASON=t.NETWORK_TYPE=t.CONNECTION_CHANGED_REASON_TYPE=t.CONNECTION_STATE_TYPE=t.PRIORITY_TYPE=t.CAPTURER_OUTPUT_PREFERENCE=t.STREAM_FALLBACK_OPTIONS=t.DEGRADATION_PREFERENCE=t.ORIENTATION_MODE=t.FRAME_RATE=t.REMOTE_VIDEO_STATE_REASON=t.XLA_REMOTE_AUDIO_FROZEN_TYPE=t.XLA_REMOTE_VIDEO_FROZEN_TYPE=t.STREAM_SUBSCRIBE_STATE=t.STREAM_PUBLISH_STATE=t.REMOTE_VIDEO_STATE=t.REMOTE_AUDIO_STATE_REASON=t.REMOTE_AUDIO_STATE=t.AUDIO_CODEC_PROFILE_TYPE=t.VOICE_CONVERSION_PRESET=t.AUDIO_EFFECT_PRESET=t.VOICE_BEAUTIFIER_PRESET=void 0,(Ve=t.ApiTypeEngine||(t.ApiTypeEngine={}))[Ve.kEngineInitialize=0]="kEngineInitialize",Ve[Ve.kEngineRelease=1]="kEngineRelease",Ve[Ve.kEngineSetChannelProfile=2]="kEngineSetChannelProfile",Ve[Ve.kEngineSetClientRole=3]="kEngineSetClientRole",Ve[Ve.kEngineJoinChannel=4]="kEngineJoinChannel",Ve[Ve.kEngineSwitchChannel=5]="kEngineSwitchChannel",Ve[Ve.kEngineLeaveChannel=6]="kEngineLeaveChannel",Ve[Ve.kEngineRenewToken=7]="kEngineRenewToken",Ve[Ve.kEngineRegisterLocalUserAccount=8]="kEngineRegisterLocalUserAccount",Ve[Ve.kEngineJoinChannelWithUserAccount=9]="kEngineJoinChannelWithUserAccount",Ve[Ve.kEngineGetUserInfoByUserAccount=10]="kEngineGetUserInfoByUserAccount",Ve[Ve.kEngineGetUserInfoByUid=11]="kEngineGetUserInfoByUid",Ve[Ve.kEngineStartEchoTest=12]="kEngineStartEchoTest",Ve[Ve.kEngineStopEchoTest=13]="kEngineStopEchoTest",Ve[Ve.kEngineSetCloudProxy=14]="kEngineSetCloudProxy",Ve[Ve.kEngineEnableVideo=15]="kEngineEnableVideo",Ve[Ve.kEngineDisableVideo=16]="kEngineDisableVideo",Ve[Ve.kEngineSetVideoProfile=17]="kEngineSetVideoProfile",Ve[Ve.kEngineSetVideoEncoderConfiguration=18]="kEngineSetVideoEncoderConfiguration",Ve[Ve.kEngineSetCameraCapturerConfiguration=19]="kEngineSetCameraCapturerConfiguration",Ve[Ve.kEngineSetupLocalVideo=20]="kEngineSetupLocalVideo",Ve[Ve.kEngineSetupRemoteVideo=21]="kEngineSetupRemoteVideo",Ve[Ve.kEngineStartPreview=22]="kEngineStartPreview",Ve[Ve.kEngineSetRemoteUserPriority=23]="kEngineSetRemoteUserPriority",Ve[Ve.kEngineStopPreview=24]="kEngineStopPreview",Ve[Ve.kEngineEnableAudio=25]="kEngineEnableAudio",Ve[Ve.kEngineEnableLocalAudio=26]="kEngineEnableLocalAudio",Ve[Ve.kEngineDisableAudio=27]="kEngineDisableAudio",Ve[Ve.kEngineSetAudioProfile=28]="kEngineSetAudioProfile",Ve[Ve.kEngineMuteLocalAudioStream=29]="kEngineMuteLocalAudioStream",Ve[Ve.kEngineMuteAllRemoteAudioStreams=30]="kEngineMuteAllRemoteAudioStreams",Ve[Ve.kEngineSetDefaultMuteAllRemoteAudioStreams=31]="kEngineSetDefaultMuteAllRemoteAudioStreams",Ve[Ve.kEngineAdjustUserPlaybackSignalVolume=32]="kEngineAdjustUserPlaybackSignalVolume",Ve[Ve.kEngineMuteRemoteAudioStream=33]="kEngineMuteRemoteAudioStream",Ve[Ve.kEngineMuteLocalVideoStream=34]="kEngineMuteLocalVideoStream",Ve[Ve.kEngineEnableLocalVideo=35]="kEngineEnableLocalVideo",Ve[Ve.kEngineMuteAllRemoteVideoStreams=36]="kEngineMuteAllRemoteVideoStreams",Ve[Ve.kEngineSetDefaultMuteAllRemoteVideoStreams=37]="kEngineSetDefaultMuteAllRemoteVideoStreams",Ve[Ve.kEngineMuteRemoteVideoStream=38]="kEngineMuteRemoteVideoStream",Ve[Ve.kEngineSetRemoteVideoStreamType=39]="kEngineSetRemoteVideoStreamType",Ve[Ve.kEngineSetRemoteDefaultVideoStreamType=40]="kEngineSetRemoteDefaultVideoStreamType",Ve[Ve.kEngineEnableAudioVolumeIndication=41]="kEngineEnableAudioVolumeIndication",Ve[Ve.kEngineStartAudioRecording=42]="kEngineStartAudioRecording",Ve[Ve.kEngineStopAudioRecording=43]="kEngineStopAudioRecording",Ve[Ve.kEngineStartAudioMixing=44]="kEngineStartAudioMixing",Ve[Ve.kEngineStopAudioMixing=45]="kEngineStopAudioMixing",Ve[Ve.kEnginePauseAudioMixing=46]="kEnginePauseAudioMixing",Ve[Ve.kEngineResumeAudioMixing=47]="kEngineResumeAudioMixing",Ve[Ve.kEngineSetHighQualityAudioParameters=48]="kEngineSetHighQualityAudioParameters",Ve[Ve.kEngineAdjustAudioMixingVolume=49]="kEngineAdjustAudioMixingVolume",Ve[Ve.kEngineAdjustAudioMixingPlayoutVolume=50]="kEngineAdjustAudioMixingPlayoutVolume",Ve[Ve.kEngineGetAudioMixingPlayoutVolume=51]="kEngineGetAudioMixingPlayoutVolume",Ve[Ve.kEngineAdjustAudioMixingPublishVolume=52]="kEngineAdjustAudioMixingPublishVolume",Ve[Ve.kEngineGetAudioMixingPublishVolume=53]="kEngineGetAudioMixingPublishVolume",Ve[Ve.kEngineGetAudioMixingDuration=54]="kEngineGetAudioMixingDuration",Ve[Ve.kEngineGetAudioMixingCurrentPosition=55]="kEngineGetAudioMixingCurrentPosition",Ve[Ve.kEngineSetAudioMixingPosition=56]="kEngineSetAudioMixingPosition",Ve[Ve.kEngineSetAudioMixingPitch=57]="kEngineSetAudioMixingPitch",Ve[Ve.kEngineGetEffectsVolume=58]="kEngineGetEffectsVolume",Ve[Ve.kEngineSetEffectsVolume=59]="kEngineSetEffectsVolume",Ve[Ve.kEngineSetVolumeOfEffect=60]="kEngineSetVolumeOfEffect",Ve[Ve.kEngineEnableFaceDetection=61]="kEngineEnableFaceDetection",Ve[Ve.kEnginePlayEffect=62]="kEnginePlayEffect",Ve[Ve.kEngineStopEffect=63]="kEngineStopEffect",Ve[Ve.kEngineStopAllEffects=64]="kEngineStopAllEffects",Ve[Ve.kEnginePreloadEffect=65]="kEnginePreloadEffect",Ve[Ve.kEngineUnloadEffect=66]="kEngineUnloadEffect",Ve[Ve.kEnginePauseEffect=67]="kEnginePauseEffect",Ve[Ve.kEnginePauseAllEffects=68]="kEnginePauseAllEffects",Ve[Ve.kEngineResumeEffect=69]="kEngineResumeEffect",Ve[Ve.kEngineResumeAllEffects=70]="kEngineResumeAllEffects",Ve[Ve.kEngineGetEffectDuration=71]="kEngineGetEffectDuration",Ve[Ve.kEngineSetEffectPosition=72]="kEngineSetEffectPosition",Ve[Ve.kEngineGetEffectCurrentPosition=73]="kEngineGetEffectCurrentPosition",Ve[Ve.kEngineEnableDeepLearningDenoise=74]="kEngineEnableDeepLearningDenoise",Ve[Ve.kEngineEnableSoundPositionIndication=75]="kEngineEnableSoundPositionIndication",Ve[Ve.kEngineSetRemoteVoicePosition=76]="kEngineSetRemoteVoicePosition",Ve[Ve.kEngineSetLocalVoicePitch=77]="kEngineSetLocalVoicePitch",Ve[Ve.kEngineSetLocalVoiceEqualization=78]="kEngineSetLocalVoiceEqualization",Ve[Ve.kEngineSetLocalVoiceReverb=79]="kEngineSetLocalVoiceReverb",Ve[Ve.kEngineSetLocalVoiceChanger=80]="kEngineSetLocalVoiceChanger",Ve[Ve.kEngineSetLocalVoiceReverbPreset=81]="kEngineSetLocalVoiceReverbPreset",Ve[Ve.kEngineSetVoiceBeautifierPreset=82]="kEngineSetVoiceBeautifierPreset",Ve[Ve.kEngineSetAudioEffectPreset=83]="kEngineSetAudioEffectPreset",Ve[Ve.kEngineSetVoiceConversionPreset=84]="kEngineSetVoiceConversionPreset",Ve[Ve.kEngineSetAudioEffectParameters=85]="kEngineSetAudioEffectParameters",Ve[Ve.kEngineSetVoiceBeautifierParameters=86]="kEngineSetVoiceBeautifierParameters",Ve[Ve.kEngineSetLogFile=87]="kEngineSetLogFile",Ve[Ve.kEngineSetLogFilter=88]="kEngineSetLogFilter",Ve[Ve.kEngineSetLogFileSize=89]="kEngineSetLogFileSize",Ve[Ve.kEngineUploadLogFile=90]="kEngineUploadLogFile",Ve[Ve.kEngineSetLocalRenderMode=91]="kEngineSetLocalRenderMode",Ve[Ve.kEngineSetRemoteRenderMode=92]="kEngineSetRemoteRenderMode",Ve[Ve.kEngineSetLocalVideoMirrorMode=93]="kEngineSetLocalVideoMirrorMode",Ve[Ve.kEngineEnableDualStreamMode=94]="kEngineEnableDualStreamMode",Ve[Ve.kEngineSetExternalAudioSource=95]="kEngineSetExternalAudioSource",Ve[Ve.kEngineSetExternalAudioSink=96]="kEngineSetExternalAudioSink",Ve[Ve.kEngineSetRecordingAudioFrameParameters=97]="kEngineSetRecordingAudioFrameParameters",Ve[Ve.kEngineSetPlaybackAudioFrameParameters=98]="kEngineSetPlaybackAudioFrameParameters",Ve[Ve.kEngineSetMixedAudioFrameParameters=99]="kEngineSetMixedAudioFrameParameters",Ve[Ve.kEngineAdjustRecordingSignalVolume=100]="kEngineAdjustRecordingSignalVolume",Ve[Ve.kEngineAdjustPlaybackSignalVolume=101]="kEngineAdjustPlaybackSignalVolume",Ve[Ve.kEngineAdjustLoopBackRecordingSignalVolume=102]="kEngineAdjustLoopBackRecordingSignalVolume",Ve[Ve.kEngineEnableWebSdkInteroperability=103]="kEngineEnableWebSdkInteroperability",Ve[Ve.kEngineSetVideoQualityParameters=104]="kEngineSetVideoQualityParameters",Ve[Ve.kEngineSetLocalPublishFallbackOption=105]="kEngineSetLocalPublishFallbackOption",Ve[Ve.kEngineSetRemoteSubscribeFallbackOption=106]="kEngineSetRemoteSubscribeFallbackOption",Ve[Ve.kEngineSwitchCamera=107]="kEngineSwitchCamera",Ve[Ve.kEngineSetDefaultAudioRouteToSpeakerPhone=108]="kEngineSetDefaultAudioRouteToSpeakerPhone",Ve[Ve.kEngineSetEnableSpeakerPhone=109]="kEngineSetEnableSpeakerPhone",Ve[Ve.kEngineEnableInEarMonitoring=110]="kEngineEnableInEarMonitoring",Ve[Ve.kEngineSetInEarMonitoringVolume=111]="kEngineSetInEarMonitoringVolume",Ve[Ve.kEngineIsSpeakerPhoneEnabled=112]="kEngineIsSpeakerPhoneEnabled",Ve[Ve.kEngineSetAudioSessionOperationRestriction=113]="kEngineSetAudioSessionOperationRestriction",Ve[Ve.kEngineEnableLoopBackRecording=114]="kEngineEnableLoopBackRecording",Ve[Ve.kEngineStartScreenCaptureByDisplayId=115]="kEngineStartScreenCaptureByDisplayId",Ve[Ve.kEngineStartScreenCaptureByScreenRect=116]="kEngineStartScreenCaptureByScreenRect",Ve[Ve.kEngineStartScreenCaptureByWindowId=117]="kEngineStartScreenCaptureByWindowId",Ve[Ve.kEngineSetScreenCaptureContentHint=118]="kEngineSetScreenCaptureContentHint",Ve[Ve.kEngineUpdateScreenCaptureParameters=119]="kEngineUpdateScreenCaptureParameters",Ve[Ve.kEngineUpdateScreenCaptureRegion=120]="kEngineUpdateScreenCaptureRegion",Ve[Ve.kEngineStopScreenCapture=121]="kEngineStopScreenCapture",Ve[Ve.kEngineStartScreenCapture=122]="kEngineStartScreenCapture",Ve[Ve.kEngineSetVideoSource=123]="kEngineSetVideoSource",Ve[Ve.kEngineGetCallId=124]="kEngineGetCallId",Ve[Ve.kEngineRate=125]="kEngineRate",Ve[Ve.kEngineComplain=126]="kEngineComplain",Ve[Ve.kEngineGetVersion=127]="kEngineGetVersion",Ve[Ve.kEngineEnableLastMileTest=128]="kEngineEnableLastMileTest",Ve[Ve.kEngineDisableLastMileTest=129]="kEngineDisableLastMileTest",Ve[Ve.kEngineStartLastMileProbeTest=130]="kEngineStartLastMileProbeTest",Ve[Ve.kEngineStopLastMileProbeTest=131]="kEngineStopLastMileProbeTest",Ve[Ve.kEngineGetErrorDescription=132]="kEngineGetErrorDescription",Ve[Ve.kEngineSetEncryptionSecret=133]="kEngineSetEncryptionSecret",Ve[Ve.kEngineSetEncryptionMode=134]="kEngineSetEncryptionMode",Ve[Ve.kEngineEnableEncryption=135]="kEngineEnableEncryption",Ve[Ve.kEngineRegisterPacketObserver=136]="kEngineRegisterPacketObserver",Ve[Ve.kEngineCreateDataStream=137]="kEngineCreateDataStream",Ve[Ve.kEngineSendStreamMessage=138]="kEngineSendStreamMessage",Ve[Ve.kEngineAddPublishStreamUrl=139]="kEngineAddPublishStreamUrl",Ve[Ve.kEngineRemovePublishStreamUrl=140]="kEngineRemovePublishStreamUrl",Ve[Ve.kEngineSetLiveTranscoding=141]="kEngineSetLiveTranscoding",Ve[Ve.kEngineAddVideoWaterMark=142]="kEngineAddVideoWaterMark",Ve[Ve.kEngineClearVideoWaterMarks=143]="kEngineClearVideoWaterMarks",Ve[Ve.kEngineSetBeautyEffectOptions=144]="kEngineSetBeautyEffectOptions",Ve[Ve.kEngineEnableVirtualBackground=145]="kEngineEnableVirtualBackground",Ve[Ve.kEngineAddInjectStreamUrl=146]="kEngineAddInjectStreamUrl",Ve[Ve.kEngineStartChannelMediaRelay=147]="kEngineStartChannelMediaRelay",Ve[Ve.kEngineUpdateChannelMediaRelay=148]="kEngineUpdateChannelMediaRelay",Ve[Ve.kEnginePauseAllChannelMediaRelay=149]="kEnginePauseAllChannelMediaRelay",Ve[Ve.kEngineResumeAllChannelMediaRelay=150]="kEngineResumeAllChannelMediaRelay",Ve[Ve.kEngineStopChannelMediaRelay=151]="kEngineStopChannelMediaRelay",Ve[Ve.kEngineRemoveInjectStreamUrl=152]="kEngineRemoveInjectStreamUrl",Ve[Ve.kEngineSendCustomReportMessage=153]="kEngineSendCustomReportMessage",Ve[Ve.kEngineGetConnectionState=154]="kEngineGetConnectionState",Ve[Ve.kEngineEnableRemoteSuperResolution=155]="kEngineEnableRemoteSuperResolution",Ve[Ve.kEngineRegisterMediaMetadataObserver=156]="kEngineRegisterMediaMetadataObserver",Ve[Ve.kEngineSetParameters=157]="kEngineSetParameters",Ve[Ve.kEngineSetLocalAccessPoint=158]="kEngineSetLocalAccessPoint",Ve[Ve.kEngineUnRegisterMediaMetadataObserver=159]="kEngineUnRegisterMediaMetadataObserver",Ve[Ve.kEngineSetMaxMetadataSize=160]="kEngineSetMaxMetadataSize",Ve[Ve.kEngineSendMetadata=161]="kEngineSendMetadata",Ve[Ve.kEngineSetAppType=162]="kEngineSetAppType",Ve[Ve.kMediaPushAudioFrame=163]="kMediaPushAudioFrame",Ve[Ve.kMediaPullAudioFrame=164]="kMediaPullAudioFrame",Ve[Ve.kMediaSetExternalVideoSource=165]="kMediaSetExternalVideoSource",Ve[Ve.kMediaPushVideoFrame=166]="kMediaPushVideoFrame",(Be=t.ApiTypeChannel||(t.ApiTypeChannel={}))[Be.kChannelCreateChannel=0]="kChannelCreateChannel",Be[Be.kChannelRelease=1]="kChannelRelease",Be[Be.kChannelJoinChannel=2]="kChannelJoinChannel",Be[Be.kChannelJoinChannelWithUserAccount=3]="kChannelJoinChannelWithUserAccount",Be[Be.kChannelLeaveChannel=4]="kChannelLeaveChannel",Be[Be.kChannelPublish=5]="kChannelPublish",Be[Be.kChannelUnPublish=6]="kChannelUnPublish",Be[Be.kChannelChannelId=7]="kChannelChannelId",Be[Be.kChannelGetCallId=8]="kChannelGetCallId",Be[Be.kChannelRenewToken=9]="kChannelRenewToken",Be[Be.kChannelSetEncryptionSecret=10]="kChannelSetEncryptionSecret",Be[Be.kChannelSetEncryptionMode=11]="kChannelSetEncryptionMode",Be[Be.kChannelEnableEncryption=12]="kChannelEnableEncryption",Be[Be.kChannelRegisterPacketObserver=13]="kChannelRegisterPacketObserver",Be[Be.kChannelRegisterMediaMetadataObserver=14]="kChannelRegisterMediaMetadataObserver",Be[Be.kChannelUnRegisterMediaMetadataObserver=15]="kChannelUnRegisterMediaMetadataObserver",Be[Be.kChannelSetMaxMetadataSize=16]="kChannelSetMaxMetadataSize",Be[Be.kChannelSendMetadata=17]="kChannelSendMetadata",Be[Be.kChannelSetClientRole=18]="kChannelSetClientRole",Be[Be.kChannelSetRemoteUserPriority=19]="kChannelSetRemoteUserPriority",Be[Be.kChannelSetRemoteVoicePosition=20]="kChannelSetRemoteVoicePosition",Be[Be.kChannelSetRemoteRenderMode=21]="kChannelSetRemoteRenderMode",Be[Be.kChannelSetDefaultMuteAllRemoteAudioStreams=22]="kChannelSetDefaultMuteAllRemoteAudioStreams",Be[Be.kChannelSetDefaultMuteAllRemoteVideoStreams=23]="kChannelSetDefaultMuteAllRemoteVideoStreams",Be[Be.kChannelMuteLocalAudioStream=24]="kChannelMuteLocalAudioStream",Be[Be.kChannelMuteLocalVideoStream=25]="kChannelMuteLocalVideoStream",Be[Be.kChannelMuteAllRemoteAudioStreams=26]="kChannelMuteAllRemoteAudioStreams",Be[Be.kChannelAdjustUserPlaybackSignalVolume=27]="kChannelAdjustUserPlaybackSignalVolume",Be[Be.kChannelMuteRemoteAudioStream=28]="kChannelMuteRemoteAudioStream",Be[Be.kChannelMuteAllRemoteVideoStreams=29]="kChannelMuteAllRemoteVideoStreams",Be[Be.kChannelMuteRemoteVideoStream=30]="kChannelMuteRemoteVideoStream",Be[Be.kChannelSetRemoteVideoStreamType=31]="kChannelSetRemoteVideoStreamType",Be[Be.kChannelSetRemoteDefaultVideoStreamType=32]="kChannelSetRemoteDefaultVideoStreamType",Be[Be.kChannelCreateDataStream=33]="kChannelCreateDataStream",Be[Be.kChannelSendStreamMessage=34]="kChannelSendStreamMessage",Be[Be.kChannelAddPublishStreamUrl=35]="kChannelAddPublishStreamUrl",Be[Be.kChannelRemovePublishStreamUrl=36]="kChannelRemovePublishStreamUrl",Be[Be.kChannelSetLiveTranscoding=37]="kChannelSetLiveTranscoding",Be[Be.kChannelAddInjectStreamUrl=38]="kChannelAddInjectStreamUrl",Be[Be.kChannelRemoveInjectStreamUrl=39]="kChannelRemoveInjectStreamUrl",Be[Be.kChannelStartChannelMediaRelay=40]="kChannelStartChannelMediaRelay",Be[Be.kChannelUpdateChannelMediaRelay=41]="kChannelUpdateChannelMediaRelay",Be[Be.kChannelPauseAllChannelMediaRelay=42]="kChannelPauseAllChannelMediaRelay",Be[Be.kChannelResumeAllChannelMediaRelay=43]="kChannelResumeAllChannelMediaRelay",Be[Be.kChannelStopChannelMediaRelay=44]="kChannelStopChannelMediaRelay",Be[Be.kChannelGetConnectionState=45]="kChannelGetConnectionState",Be[Be.kChannelEnableRemoteSuperResolution=46]="kChannelEnableRemoteSuperResolution",(Ue=t.ApiTypeAudioDeviceManager||(t.ApiTypeAudioDeviceManager={}))[Ue.kADMEnumeratePlaybackDevices=0]="kADMEnumeratePlaybackDevices",Ue[Ue.kADMSetPlaybackDevice=1]="kADMSetPlaybackDevice",Ue[Ue.kADMGetPlaybackDevice=2]="kADMGetPlaybackDevice",Ue[Ue.kADMGetPlaybackDeviceInfo=3]="kADMGetPlaybackDeviceInfo",Ue[Ue.kADMSetPlaybackDeviceVolume=4]="kADMSetPlaybackDeviceVolume",Ue[Ue.kADMGetPlaybackDeviceVolume=5]="kADMGetPlaybackDeviceVolume",Ue[Ue.kADMSetPlaybackDeviceMute=6]="kADMSetPlaybackDeviceMute",Ue[Ue.kADMGetPlaybackDeviceMute=7]="kADMGetPlaybackDeviceMute",Ue[Ue.kADMStartPlaybackDeviceTest=8]="kADMStartPlaybackDeviceTest",Ue[Ue.kADMStopPlaybackDeviceTest=9]="kADMStopPlaybackDeviceTest",Ue[Ue.kADMEnumerateRecordingDevices=10]="kADMEnumerateRecordingDevices",Ue[Ue.kADMSetRecordingDevice=11]="kADMSetRecordingDevice",Ue[Ue.kADMGetRecordingDevice=12]="kADMGetRecordingDevice",Ue[Ue.kADMGetRecordingDeviceInfo=13]="kADMGetRecordingDeviceInfo",Ue[Ue.kADMSetRecordingDeviceVolume=14]="kADMSetRecordingDeviceVolume",Ue[Ue.kADMGetRecordingDeviceVolume=15]="kADMGetRecordingDeviceVolume",Ue[Ue.kADMSetRecordingDeviceMute=16]="kADMSetRecordingDeviceMute",Ue[Ue.kADMGetRecordingDeviceMute=17]="kADMGetRecordingDeviceMute",Ue[Ue.kADMStartRecordingDeviceTest=18]="kADMStartRecordingDeviceTest",Ue[Ue.kADMStopRecordingDeviceTest=19]="kADMStopRecordingDeviceTest",Ue[Ue.kADMStartAudioDeviceLoopbackTest=20]="kADMStartAudioDeviceLoopbackTest",Ue[Ue.kADMStopAudioDeviceLoopbackTest=21]="kADMStopAudioDeviceLoopbackTest",(Me=t.ApiTypeVideoDeviceManager||(t.ApiTypeVideoDeviceManager={}))[Me.kVDMEnumerateVideoDevices=0]="kVDMEnumerateVideoDevices",Me[Me.kVDMSetDevice=1]="kVDMSetDevice",Me[Me.kVDMGetDevice=2]="kVDMGetDevice",Me[Me.kVDMStartDeviceTest=3]="kVDMStartDeviceTest",Me[Me.kVDMStopDeviceTest=4]="kVDMStopDeviceTest",(ke=t.ApiTypeRawDataPluginManager||(t.ApiTypeRawDataPluginManager={}))[ke.kRDPMRegisterPlugin=0]="kRDPMRegisterPlugin",ke[ke.kRDPMUnregisterPlugin=1]="kRDPMUnregisterPlugin",ke[ke.kRDPMHasPlugin=2]="kRDPMHasPlugin",ke[ke.kRDPMEnablePlugin=3]="kRDPMEnablePlugin",ke[ke.kRDPMGetPlugins=4]="kRDPMGetPlugins",ke[ke.kRDPMSetPluginParameter=5]="kRDPMSetPluginParameter",ke[ke.kRDPMGetPluginParameter=6]="kRDPMGetPluginParameter",ke[ke.kRDPMRelease=7]="kRDPMRelease",(Pe=t.INTERFACE_ID_TYPE||(t.INTERFACE_ID_TYPE={}))[Pe.AGORA_IID_AUDIO_DEVICE_MANAGER=1]="AGORA_IID_AUDIO_DEVICE_MANAGER",Pe[Pe.AGORA_IID_VIDEO_DEVICE_MANAGER=2]="AGORA_IID_VIDEO_DEVICE_MANAGER",Pe[Pe.AGORA_IID_RTC_ENGINE_PARAMETER=3]="AGORA_IID_RTC_ENGINE_PARAMETER",Pe[Pe.AGORA_IID_MEDIA_ENGINE=4]="AGORA_IID_MEDIA_ENGINE",Pe[Pe.AGORA_IID_SIGNALING_ENGINE=8]="AGORA_IID_SIGNALING_ENGINE",(Le=t.WARN_CODE_TYPE||(t.WARN_CODE_TYPE={}))[Le.WARN_INVALID_VIEW=8]="WARN_INVALID_VIEW",Le[Le.WARN_INIT_VIDEO=16]="WARN_INIT_VIDEO",Le[Le.WARN_PENDING=20]="WARN_PENDING",Le[Le.WARN_NO_AVAILABLE_CHANNEL=103]="WARN_NO_AVAILABLE_CHANNEL",Le[Le.WARN_LOOKUP_CHANNEL_TIMEOUT=104]="WARN_LOOKUP_CHANNEL_TIMEOUT",Le[Le.WARN_LOOKUP_CHANNEL_REJECTED=105]="WARN_LOOKUP_CHANNEL_REJECTED",Le[Le.WARN_OPEN_CHANNEL_TIMEOUT=106]="WARN_OPEN_CHANNEL_TIMEOUT",Le[Le.WARN_OPEN_CHANNEL_REJECTED=107]="WARN_OPEN_CHANNEL_REJECTED",Le[Le.WARN_SWITCH_LIVE_VIDEO_TIMEOUT=111]="WARN_SWITCH_LIVE_VIDEO_TIMEOUT",Le[Le.WARN_SET_CLIENT_ROLE_TIMEOUT=118]="WARN_SET_CLIENT_ROLE_TIMEOUT",Le[Le.WARN_OPEN_CHANNEL_INVALID_TICKET=121]="WARN_OPEN_CHANNEL_INVALID_TICKET",Le[Le.WARN_OPEN_CHANNEL_TRY_NEXT_VOS=122]="WARN_OPEN_CHANNEL_TRY_NEXT_VOS",Le[Le.WARN_CHANNEL_CONNECTION_UNRECOVERABLE=131]="WARN_CHANNEL_CONNECTION_UNRECOVERABLE",Le[Le.WARN_CHANNEL_CONNECTION_IP_CHANGED=132]="WARN_CHANNEL_CONNECTION_IP_CHANGED",Le[Le.WARN_CHANNEL_CONNECTION_PORT_CHANGED=133]="WARN_CHANNEL_CONNECTION_PORT_CHANGED",Le[Le.WARN_CHANNEL_SOCKET_ERROR=134]="WARN_CHANNEL_SOCKET_ERROR",Le[Le.WARN_AUDIO_MIXING_OPEN_ERROR=701]="WARN_AUDIO_MIXING_OPEN_ERROR",Le[Le.WARN_ADM_RUNTIME_PLAYOUT_WARNING=1014]="WARN_ADM_RUNTIME_PLAYOUT_WARNING",Le[Le.WARN_ADM_RUNTIME_RECORDING_WARNING=1016]="WARN_ADM_RUNTIME_RECORDING_WARNING",Le[Le.WARN_ADM_RECORD_AUDIO_SILENCE=1019]="WARN_ADM_RECORD_AUDIO_SILENCE",Le[Le.WARN_ADM_PLAYOUT_MALFUNCTION=1020]="WARN_ADM_PLAYOUT_MALFUNCTION",Le[Le.WARN_ADM_RECORD_MALFUNCTION=1021]="WARN_ADM_RECORD_MALFUNCTION",Le[Le.WARN_ADM_CALL_INTERRUPTION=1025]="WARN_ADM_CALL_INTERRUPTION",Le[Le.WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD=1029]="WARN_ADM_IOS_CATEGORY_NOT_PLAYANDRECORD",Le[Le.WARN_ADM_RECORD_AUDIO_LOWLEVEL=1031]="WARN_ADM_RECORD_AUDIO_LOWLEVEL",Le[Le.WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL=1032]="WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL",Le[Le.WARN_ADM_RECORD_AUDIO_IS_ACTIVE=1033]="WARN_ADM_RECORD_AUDIO_IS_ACTIVE",Le[Le.WARN_ADM_WINDOWS_NO_DATA_READY_EVENT=1040]="WARN_ADM_WINDOWS_NO_DATA_READY_EVENT",Le[Le.WARN_ADM_INCONSISTENT_AUDIO_DEVICE=1042]="WARN_ADM_INCONSISTENT_AUDIO_DEVICE",Le[Le.WARN_APM_HOWLING=1051]="WARN_APM_HOWLING",Le[Le.WARN_ADM_GLITCH_STATE=1052]="WARN_ADM_GLITCH_STATE",Le[Le.WARN_APM_RESIDUAL_ECHO=1053]="WARN_APM_RESIDUAL_ECHO",Le[Le.WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE=1322]="WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE",Le[Le.WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE=1323]="WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE",Le[Le.WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE=1324]="WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE",Le[Le.WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION=1610]="WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION",Le[Le.WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION=1611]="WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION",Le[Le.WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED=1612]="WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED",Le[Le.WARN_RTM_LOGIN_TIMEOUT=2005]="WARN_RTM_LOGIN_TIMEOUT",Le[Le.WARN_RTM_KEEP_ALIVE_TIMEOUT=2009]="WARN_RTM_KEEP_ALIVE_TIMEOUT",(be=t.ERROR_CODE_TYPE||(t.ERROR_CODE_TYPE={}))[be.ERR_OK=0]="ERR_OK",be[be.ERR_FAILED=1]="ERR_FAILED",be[be.ERR_INVALID_ARGUMENT=2]="ERR_INVALID_ARGUMENT",be[be.ERR_NOT_READY=3]="ERR_NOT_READY",be[be.ERR_NOT_SUPPORTED=4]="ERR_NOT_SUPPORTED",be[be.ERR_REFUSED=5]="ERR_REFUSED",be[be.ERR_BUFFER_TOO_SMALL=6]="ERR_BUFFER_TOO_SMALL",be[be.ERR_NOT_INITIALIZED=7]="ERR_NOT_INITIALIZED",be[be.ERR_NO_PERMISSION=9]="ERR_NO_PERMISSION",be[be.ERR_TIMEDOUT=10]="ERR_TIMEDOUT",be[be.ERR_CANCELED=11]="ERR_CANCELED",be[be.ERR_TOO_OFTEN=12]="ERR_TOO_OFTEN",be[be.ERR_BIND_SOCKET=13]="ERR_BIND_SOCKET",be[be.ERR_NET_DOWN=14]="ERR_NET_DOWN",be[be.ERR_NET_NOBUFS=15]="ERR_NET_NOBUFS",be[be.ERR_JOIN_CHANNEL_REJECTED=17]="ERR_JOIN_CHANNEL_REJECTED",be[be.ERR_LEAVE_CHANNEL_REJECTED=18]="ERR_LEAVE_CHANNEL_REJECTED",be[be.ERR_ALREADY_IN_USE=19]="ERR_ALREADY_IN_USE",be[be.ERR_ABORTED=20]="ERR_ABORTED",be[be.ERR_INIT_NET_ENGINE=21]="ERR_INIT_NET_ENGINE",be[be.ERR_RESOURCE_LIMITED=22]="ERR_RESOURCE_LIMITED",be[be.ERR_INVALID_APP_ID=101]="ERR_INVALID_APP_ID",be[be.ERR_INVALID_CHANNEL_NAME=102]="ERR_INVALID_CHANNEL_NAME",be[be.ERR_NO_SERVER_RESOURCES=103]="ERR_NO_SERVER_RESOURCES",be[be.ERR_TOKEN_EXPIRED=109]="ERR_TOKEN_EXPIRED",be[be.ERR_INVALID_TOKEN=110]="ERR_INVALID_TOKEN",be[be.ERR_CONNECTION_INTERRUPTED=111]="ERR_CONNECTION_INTERRUPTED",be[be.ERR_CONNECTION_LOST=112]="ERR_CONNECTION_LOST",be[be.ERR_NOT_IN_CHANNEL=113]="ERR_NOT_IN_CHANNEL",be[be.ERR_SIZE_TOO_LARGE=114]="ERR_SIZE_TOO_LARGE",be[be.ERR_BITRATE_LIMIT=115]="ERR_BITRATE_LIMIT",be[be.ERR_TOO_MANY_DATA_STREAMS=116]="ERR_TOO_MANY_DATA_STREAMS",be[be.ERR_STREAM_MESSAGE_TIMEOUT=117]="ERR_STREAM_MESSAGE_TIMEOUT",be[be.ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED=119]="ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED",be[be.ERR_DECRYPTION_FAILED=120]="ERR_DECRYPTION_FAILED",be[be.ERR_CLIENT_IS_BANNED_BY_SERVER=123]="ERR_CLIENT_IS_BANNED_BY_SERVER",be[be.ERR_WATERMARK_PARAM=124]="ERR_WATERMARK_PARAM",be[be.ERR_WATERMARK_PATH=125]="ERR_WATERMARK_PATH",be[be.ERR_WATERMARK_PNG=126]="ERR_WATERMARK_PNG",be[be.ERR_WATERMARKR_INFO=127]="ERR_WATERMARKR_INFO",be[be.ERR_WATERMARK_ARGB=128]="ERR_WATERMARK_ARGB",be[be.ERR_WATERMARK_READ=129]="ERR_WATERMARK_READ",be[be.ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH=130]="ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH",be[be.ERR_INVALID_USER_ACCOUNT=134]="ERR_INVALID_USER_ACCOUNT",be[be.ERR_PUBLISH_STREAM_CDN_ERROR=151]="ERR_PUBLISH_STREAM_CDN_ERROR",be[be.ERR_PUBLISH_STREAM_NUM_REACH_LIMIT=152]="ERR_PUBLISH_STREAM_NUM_REACH_LIMIT",be[be.ERR_PUBLISH_STREAM_NOT_AUTHORIZED=153]="ERR_PUBLISH_STREAM_NOT_AUTHORIZED",be[be.ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR=154]="ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR",be[be.ERR_PUBLISH_STREAM_NOT_FOUND=155]="ERR_PUBLISH_STREAM_NOT_FOUND",be[be.ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED=156]="ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED",be[be.ERR_MODULE_NOT_FOUND=157]="ERR_MODULE_NOT_FOUND",be[be.ERR_MODULE_SUPER_RESOLUTION_NOT_FOUND=158]="ERR_MODULE_SUPER_RESOLUTION_NOT_FOUND",be[be.ERR_LOGOUT_OTHER=400]="ERR_LOGOUT_OTHER",be[be.ERR_LOGOUT_USER=401]="ERR_LOGOUT_USER",be[be.ERR_LOGOUT_NET=402]="ERR_LOGOUT_NET",be[be.ERR_LOGOUT_KICKED=403]="ERR_LOGOUT_KICKED",be[be.ERR_LOGOUT_PACKET=404]="ERR_LOGOUT_PACKET",be[be.ERR_LOGOUT_TOKEN_EXPIRED=405]="ERR_LOGOUT_TOKEN_EXPIRED",be[be.ERR_LOGOUT_OLDVERSION=406]="ERR_LOGOUT_OLDVERSION",be[be.ERR_LOGOUT_TOKEN_WRONG=407]="ERR_LOGOUT_TOKEN_WRONG",be[be.ERR_LOGOUT_ALREADY_LOGOUT=408]="ERR_LOGOUT_ALREADY_LOGOUT",be[be.ERR_LOGIN_OTHER=420]="ERR_LOGIN_OTHER",be[be.ERR_LOGIN_NET=421]="ERR_LOGIN_NET",be[be.ERR_LOGIN_FAILED=422]="ERR_LOGIN_FAILED",be[be.ERR_LOGIN_CANCELED=423]="ERR_LOGIN_CANCELED",be[be.ERR_LOGIN_TOKEN_EXPIRED=424]="ERR_LOGIN_TOKEN_EXPIRED",be[be.ERR_LOGIN_OLD_VERSION=425]="ERR_LOGIN_OLD_VERSION",be[be.ERR_LOGIN_TOKEN_WRONG=426]="ERR_LOGIN_TOKEN_WRONG",be[be.ERR_LOGIN_TOKEN_KICKED=427]="ERR_LOGIN_TOKEN_KICKED",be[be.ERR_LOGIN_ALREADY_LOGIN=428]="ERR_LOGIN_ALREADY_LOGIN",be[be.ERR_JOIN_CHANNEL_OTHER=440]="ERR_JOIN_CHANNEL_OTHER",be[be.ERR_SEND_MESSAGE_OTHER=440]="ERR_SEND_MESSAGE_OTHER",be[be.ERR_SEND_MESSAGE_TIMEOUT=441]="ERR_SEND_MESSAGE_TIMEOUT",be[be.ERR_QUERY_USERNUM_OTHER=450]="ERR_QUERY_USERNUM_OTHER",be[be.ERR_QUERY_USERNUM_TIMEOUT=451]="ERR_QUERY_USERNUM_TIMEOUT",be[be.ERR_QUERY_USERNUM_BYUSER=452]="ERR_QUERY_USERNUM_BYUSER",be[be.ERR_LEAVE_CHANNEL_OTHER=460]="ERR_LEAVE_CHANNEL_OTHER",be[be.ERR_LEAVE_CHANNEL_KICKED=461]="ERR_LEAVE_CHANNEL_KICKED",be[be.ERR_LEAVE_CHANNEL_BYUSER=462]="ERR_LEAVE_CHANNEL_BYUSER",be[be.ERR_LEAVE_CHANNEL_LOGOUT=463]="ERR_LEAVE_CHANNEL_LOGOUT",be[be.ERR_LEAVE_CHANNEL_DISCONNECTED=464]="ERR_LEAVE_CHANNEL_DISCONNECTED",be[be.ERR_INVITE_OTHER=470]="ERR_INVITE_OTHER",be[be.ERR_INVITE_REINVITE=471]="ERR_INVITE_REINVITE",be[be.ERR_INVITE_NET=472]="ERR_INVITE_NET",be[be.ERR_INVITE_PEER_OFFLINE=473]="ERR_INVITE_PEER_OFFLINE",be[be.ERR_INVITE_TIMEOUT=474]="ERR_INVITE_TIMEOUT",be[be.ERR_INVITE_CANT_RECV=475]="ERR_INVITE_CANT_RECV",be[be.ERR_LOAD_MEDIA_ENGINE=1001]="ERR_LOAD_MEDIA_ENGINE",be[be.ERR_START_CALL=1002]="ERR_START_CALL",be[be.ERR_START_CAMERA=1003]="ERR_START_CAMERA",be[be.ERR_START_VIDEO_RENDER=1004]="ERR_START_VIDEO_RENDER",be[be.ERR_ADM_GENERAL_ERROR=1005]="ERR_ADM_GENERAL_ERROR",be[be.ERR_ADM_JAVA_RESOURCE=1006]="ERR_ADM_JAVA_RESOURCE",be[be.ERR_ADM_SAMPLE_RATE=1007]="ERR_ADM_SAMPLE_RATE",be[be.ERR_ADM_INIT_PLAYOUT=1008]="ERR_ADM_INIT_PLAYOUT",be[be.ERR_ADM_START_PLAYOUT=1009]="ERR_ADM_START_PLAYOUT",be[be.ERR_ADM_STOP_PLAYOUT=1010]="ERR_ADM_STOP_PLAYOUT",be[be.ERR_ADM_INIT_RECORDING=1011]="ERR_ADM_INIT_RECORDING",be[be.ERR_ADM_START_RECORDING=1012]="ERR_ADM_START_RECORDING",be[be.ERR_ADM_STOP_RECORDING=1013]="ERR_ADM_STOP_RECORDING",be[be.ERR_ADM_RUNTIME_PLAYOUT_ERROR=1015]="ERR_ADM_RUNTIME_PLAYOUT_ERROR",be[be.ERR_ADM_RUNTIME_RECORDING_ERROR=1017]="ERR_ADM_RUNTIME_RECORDING_ERROR",be[be.ERR_ADM_RECORD_AUDIO_FAILED=1018]="ERR_ADM_RECORD_AUDIO_FAILED",be[be.ERR_ADM_INIT_LOOPBACK=1022]="ERR_ADM_INIT_LOOPBACK",be[be.ERR_ADM_START_LOOPBACK=1023]="ERR_ADM_START_LOOPBACK",be[be.ERR_ADM_NO_PERMISSION=1027]="ERR_ADM_NO_PERMISSION",be[be.ERR_ADM_RECORD_AUDIO_IS_ACTIVE=1033]="ERR_ADM_RECORD_AUDIO_IS_ACTIVE",be[be.ERR_ADM_ANDROID_JNI_JAVA_RESOURCE=1101]="ERR_ADM_ANDROID_JNI_JAVA_RESOURCE",be[be.ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY=1108]="ERR_ADM_ANDROID_JNI_NO_RECORD_FREQUENCY",be[be.ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY=1109]="ERR_ADM_ANDROID_JNI_NO_PLAYBACK_FREQUENCY",be[be.ERR_ADM_ANDROID_JNI_JAVA_START_RECORD=1111]="ERR_ADM_ANDROID_JNI_JAVA_START_RECORD",be[be.ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK=1112]="ERR_ADM_ANDROID_JNI_JAVA_START_PLAYBACK",be[be.ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR=1115]="ERR_ADM_ANDROID_JNI_JAVA_RECORD_ERROR",be[be.ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE=1151]="ERR_ADM_ANDROID_OPENSL_CREATE_ENGINE",be[be.ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER=1153]="ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_RECORDER",be[be.ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD=1156]="ERR_ADM_ANDROID_OPENSL_START_RECORDER_THREAD",be[be.ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER=1157]="ERR_ADM_ANDROID_OPENSL_CREATE_AUDIO_PLAYER",be[be.ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD=1160]="ERR_ADM_ANDROID_OPENSL_START_PLAYER_THREAD",be[be.ERR_ADM_IOS_INPUT_NOT_AVAILABLE=1201]="ERR_ADM_IOS_INPUT_NOT_AVAILABLE",be[be.ERR_ADM_IOS_ACTIVATE_SESSION_FAIL=1206]="ERR_ADM_IOS_ACTIVATE_SESSION_FAIL",be[be.ERR_ADM_IOS_VPIO_INIT_FAIL=1210]="ERR_ADM_IOS_VPIO_INIT_FAIL",be[be.ERR_ADM_IOS_VPIO_REINIT_FAIL=1213]="ERR_ADM_IOS_VPIO_REINIT_FAIL",be[be.ERR_ADM_IOS_VPIO_RESTART_FAIL=1214]="ERR_ADM_IOS_VPIO_RESTART_FAIL",be[be.ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL=1219]="ERR_ADM_IOS_SET_RENDER_CALLBACK_FAIL",be[be.ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO=1221]="ERR_ADM_IOS_SESSION_SAMPLERATR_ZERO",be[be.ERR_ADM_WIN_CORE_INIT=1301]="ERR_ADM_WIN_CORE_INIT",be[be.ERR_ADM_WIN_CORE_INIT_RECORDING=1303]="ERR_ADM_WIN_CORE_INIT_RECORDING",be[be.ERR_ADM_WIN_CORE_INIT_PLAYOUT=1306]="ERR_ADM_WIN_CORE_INIT_PLAYOUT",be[be.ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL=1307]="ERR_ADM_WIN_CORE_INIT_PLAYOUT_NULL",be[be.ERR_ADM_WIN_CORE_START_RECORDING=1309]="ERR_ADM_WIN_CORE_START_RECORDING",be[be.ERR_ADM_WIN_CORE_CREATE_REC_THREAD=1311]="ERR_ADM_WIN_CORE_CREATE_REC_THREAD",be[be.ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP=1314]="ERR_ADM_WIN_CORE_CAPTURE_NOT_STARTUP",be[be.ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD=1319]="ERR_ADM_WIN_CORE_CREATE_RENDER_THREAD",be[be.ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP=1320]="ERR_ADM_WIN_CORE_RENDER_NOT_STARTUP",be[be.ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE=1322]="ERR_ADM_WIN_CORE_NO_RECORDING_DEVICE",be[be.ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE=1323]="ERR_ADM_WIN_CORE_NO_PLAYOUT_DEVICE",be[be.ERR_ADM_WIN_WAVE_INIT=1351]="ERR_ADM_WIN_WAVE_INIT",be[be.ERR_ADM_WIN_WAVE_INIT_RECORDING=1353]="ERR_ADM_WIN_WAVE_INIT_RECORDING",be[be.ERR_ADM_WIN_WAVE_INIT_MICROPHONE=1354]="ERR_ADM_WIN_WAVE_INIT_MICROPHONE",be[be.ERR_ADM_WIN_WAVE_INIT_PLAYOUT=1355]="ERR_ADM_WIN_WAVE_INIT_PLAYOUT",be[be.ERR_ADM_WIN_WAVE_INIT_SPEAKER=1356]="ERR_ADM_WIN_WAVE_INIT_SPEAKER",be[be.ERR_ADM_WIN_WAVE_START_RECORDING=1357]="ERR_ADM_WIN_WAVE_START_RECORDING",be[be.ERR_ADM_WIN_WAVE_START_PLAYOUT=1358]="ERR_ADM_WIN_WAVE_START_PLAYOUT",be[be.ERR_ADM_NO_RECORDING_DEVICE=1359]="ERR_ADM_NO_RECORDING_DEVICE",be[be.ERR_ADM_NO_PLAYOUT_DEVICE=1360]="ERR_ADM_NO_PLAYOUT_DEVICE",be[be.ERR_VDM_CAMERA_NOT_AUTHORIZED=1501]="ERR_VDM_CAMERA_NOT_AUTHORIZED",be[be.ERR_VDM_WIN_DEVICE_IN_USE=1502]="ERR_VDM_WIN_DEVICE_IN_USE",be[be.ERR_VCM_UNKNOWN_ERROR=1600]="ERR_VCM_UNKNOWN_ERROR",be[be.ERR_VCM_ENCODER_INIT_ERROR=1601]="ERR_VCM_ENCODER_INIT_ERROR",be[be.ERR_VCM_ENCODER_ENCODE_ERROR=1602]="ERR_VCM_ENCODER_ENCODE_ERROR",be[be.ERR_VCM_ENCODER_SET_ERROR=1603]="ERR_VCM_ENCODER_SET_ERROR",(we=t.LOG_FILTER_TYPE||(t.LOG_FILTER_TYPE={}))[we.LOG_FILTER_OFF=0]="LOG_FILTER_OFF",we[we.LOG_FILTER_DEBUG=2063]="LOG_FILTER_DEBUG",we[we.LOG_FILTER_INFO=15]="LOG_FILTER_INFO",we[we.LOG_FILTER_WARN=14]="LOG_FILTER_WARN",we[we.LOG_FILTER_ERROR=12]="LOG_FILTER_ERROR",we[we.LOG_FILTER_CRITICAL=8]="LOG_FILTER_CRITICAL",we[we.LOG_FILTER_MASK=2063]="LOG_FILTER_MASK",(De=t.LOG_LEVEL||(t.LOG_LEVEL={}))[De.LOG_LEVEL_NONE=0]="LOG_LEVEL_NONE",De[De.LOG_LEVEL_INFO=1]="LOG_LEVEL_INFO",De[De.LOG_LEVEL_WARN=2]="LOG_LEVEL_WARN",De[De.LOG_LEVEL_ERROR=4]="LOG_LEVEL_ERROR",De[De.LOG_LEVEL_FATAL=8]="LOG_LEVEL_FATAL",(ye=t.MAX_DEVICE_ID_LENGTH_TYPE||(t.MAX_DEVICE_ID_LENGTH_TYPE={}))[ye.MAX_DEVICE_ID_LENGTH=512]="MAX_DEVICE_ID_LENGTH",(Ne=t.MAX_USER_ACCOUNT_LENGTH_TYPE||(t.MAX_USER_ACCOUNT_LENGTH_TYPE={}))[Ne.MAX_USER_ACCOUNT_LENGTH=256]="MAX_USER_ACCOUNT_LENGTH",(ve=t.MAX_CHANNEL_ID_LENGTH_TYPE||(t.MAX_CHANNEL_ID_LENGTH_TYPE={}))[ve.MAX_CHANNEL_ID_LENGTH=65]="MAX_CHANNEL_ID_LENGTH",(Oe=t.QUALITY_REPORT_FORMAT_TYPE||(t.QUALITY_REPORT_FORMAT_TYPE={}))[Oe.QUALITY_REPORT_JSON=0]="QUALITY_REPORT_JSON",Oe[Oe.QUALITY_REPORT_HTML=1]="QUALITY_REPORT_HTML",(Se=t.MEDIA_ENGINE_EVENT_CODE_TYPE||(t.MEDIA_ENGINE_EVENT_CODE_TYPE={}))[Se.MEDIA_ENGINE_RECORDING_ERROR=0]="MEDIA_ENGINE_RECORDING_ERROR",Se[Se.MEDIA_ENGINE_PLAYOUT_ERROR=1]="MEDIA_ENGINE_PLAYOUT_ERROR",Se[Se.MEDIA_ENGINE_RECORDING_WARNING=2]="MEDIA_ENGINE_RECORDING_WARNING",Se[Se.MEDIA_ENGINE_PLAYOUT_WARNING=3]="MEDIA_ENGINE_PLAYOUT_WARNING",Se[Se.MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH=10]="MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH",Se[Se.MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS=12]="MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS",Se[Se.MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS=13]="MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS",Se[Se.MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED=14]="MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED",Se[Se.MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED=15]="MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED",Se[Se.MEDIA_ENGINE_ROLE_BROADCASTER_SOLO=20]="MEDIA_ENGINE_ROLE_BROADCASTER_SOLO",Se[Se.MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE=21]="MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE",Se[Se.MEDIA_ENGINE_ROLE_AUDIENCE=22]="MEDIA_ENGINE_ROLE_AUDIENCE",Se[Se.MEDIA_ENGINE_ROLE_COMM_PEER=23]="MEDIA_ENGINE_ROLE_COMM_PEER",Se[Se.MEDIA_ENGINE_ROLE_GAME_PEER=24]="MEDIA_ENGINE_ROLE_GAME_PEER",Se[Se.MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART=110]="MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART",Se[Se.MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART=111]="MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART",Se[Se.MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS=112]="MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS",Se[Se.MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS=113]="MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY=710]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED=711]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART=712]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED=713]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED",Se[Se.MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR=714]="MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN=701]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT=702]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF=703]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF",Se[Se.MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR=0]="MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR",(me=t.AUDIO_MIXING_STATE_TYPE||(t.AUDIO_MIXING_STATE_TYPE={}))[me.AUDIO_MIXING_STATE_PLAYING=710]="AUDIO_MIXING_STATE_PLAYING",me[me.AUDIO_MIXING_STATE_PAUSED=711]="AUDIO_MIXING_STATE_PAUSED",me[me.AUDIO_MIXING_STATE_STOPPED=713]="AUDIO_MIXING_STATE_STOPPED",me[me.AUDIO_MIXING_STATE_FAILED=714]="AUDIO_MIXING_STATE_FAILED",(Te=t.AUDIO_MIXING_ERROR_TYPE||(t.AUDIO_MIXING_ERROR_TYPE={}))[Te.AUDIO_MIXING_ERROR_CAN_NOT_OPEN=701]="AUDIO_MIXING_ERROR_CAN_NOT_OPEN",Te[Te.AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL=702]="AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL",Te[Te.AUDIO_MIXING_ERROR_INTERRUPTED_EOF=703]="AUDIO_MIXING_ERROR_INTERRUPTED_EOF",Te[Te.AUDIO_MIXING_ERROR_OK=0]="AUDIO_MIXING_ERROR_OK",(Ce=t.MEDIA_DEVICE_STATE_TYPE||(t.MEDIA_DEVICE_STATE_TYPE={}))[Ce.MEDIA_DEVICE_STATE_ACTIVE=1]="MEDIA_DEVICE_STATE_ACTIVE",Ce[Ce.MEDIA_DEVICE_STATE_DISABLED=2]="MEDIA_DEVICE_STATE_DISABLED",Ce[Ce.MEDIA_DEVICE_STATE_NOT_PRESENT=4]="MEDIA_DEVICE_STATE_NOT_PRESENT",Ce[Ce.MEDIA_DEVICE_STATE_UNPLUGGED=8]="MEDIA_DEVICE_STATE_UNPLUGGED",Ce[Ce.MEDIA_DEVICE_STATE_UNRECOMMENDED=16]="MEDIA_DEVICE_STATE_UNRECOMMENDED",(Re=t.MEDIA_DEVICE_TYPE||(t.MEDIA_DEVICE_TYPE={}))[Re.UNKNOWN_AUDIO_DEVICE=-1]="UNKNOWN_AUDIO_DEVICE",Re[Re.AUDIO_PLAYOUT_DEVICE=0]="AUDIO_PLAYOUT_DEVICE",Re[Re.AUDIO_RECORDING_DEVICE=1]="AUDIO_RECORDING_DEVICE",Re[Re.VIDEO_RENDER_DEVICE=2]="VIDEO_RENDER_DEVICE",Re[Re.VIDEO_CAPTURE_DEVICE=3]="VIDEO_CAPTURE_DEVICE",Re[Re.AUDIO_APPLICATION_PLAYOUT_DEVICE=4]="AUDIO_APPLICATION_PLAYOUT_DEVICE",(fe=t.LOCAL_VIDEO_STREAM_STATE||(t.LOCAL_VIDEO_STREAM_STATE={}))[fe.LOCAL_VIDEO_STREAM_STATE_STOPPED=0]="LOCAL_VIDEO_STREAM_STATE_STOPPED",fe[fe.LOCAL_VIDEO_STREAM_STATE_CAPTURING=1]="LOCAL_VIDEO_STREAM_STATE_CAPTURING",fe[fe.LOCAL_VIDEO_STREAM_STATE_ENCODING=2]="LOCAL_VIDEO_STREAM_STATE_ENCODING",fe[fe.LOCAL_VIDEO_STREAM_STATE_FAILED=3]="LOCAL_VIDEO_STREAM_STATE_FAILED",(ge=t.LOCAL_VIDEO_STREAM_ERROR||(t.LOCAL_VIDEO_STREAM_ERROR={}))[ge.LOCAL_VIDEO_STREAM_ERROR_OK=0]="LOCAL_VIDEO_STREAM_ERROR_OK",ge[ge.LOCAL_VIDEO_STREAM_ERROR_FAILURE=1]="LOCAL_VIDEO_STREAM_ERROR_FAILURE",ge[ge.LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION=2]="LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION",ge[ge.LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY=3]="LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY",ge[ge.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE=4]="LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE",ge[ge.LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE=5]="LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE",ge[ge.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND=6]="LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND",ge[ge.LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS=7]="LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS",ge[ge.LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED=11]="LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED",ge[ge.LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED=12]="LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED",(Ie=t.LOCAL_AUDIO_STREAM_STATE||(t.LOCAL_AUDIO_STREAM_STATE={}))[Ie.LOCAL_AUDIO_STREAM_STATE_STOPPED=0]="LOCAL_AUDIO_STREAM_STATE_STOPPED",Ie[Ie.LOCAL_AUDIO_STREAM_STATE_RECORDING=1]="LOCAL_AUDIO_STREAM_STATE_RECORDING",Ie[Ie.LOCAL_AUDIO_STREAM_STATE_ENCODING=2]="LOCAL_AUDIO_STREAM_STATE_ENCODING",Ie[Ie.LOCAL_AUDIO_STREAM_STATE_FAILED=3]="LOCAL_AUDIO_STREAM_STATE_FAILED",(_e=t.LOCAL_AUDIO_STREAM_ERROR||(t.LOCAL_AUDIO_STREAM_ERROR={}))[_e.LOCAL_AUDIO_STREAM_ERROR_OK=0]="LOCAL_AUDIO_STREAM_ERROR_OK",_e[_e.LOCAL_AUDIO_STREAM_ERROR_FAILURE=1]="LOCAL_AUDIO_STREAM_ERROR_FAILURE",_e[_e.LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION=2]="LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION",_e[_e.LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY=3]="LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY",_e[_e.LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE=4]="LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE",_e[_e.LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE=5]="LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE",(pe=t.AUDIO_RECORDING_QUALITY_TYPE||(t.AUDIO_RECORDING_QUALITY_TYPE={}))[pe.AUDIO_RECORDING_QUALITY_LOW=0]="AUDIO_RECORDING_QUALITY_LOW",pe[pe.AUDIO_RECORDING_QUALITY_MEDIUM=1]="AUDIO_RECORDING_QUALITY_MEDIUM",pe[pe.AUDIO_RECORDING_QUALITY_HIGH=2]="AUDIO_RECORDING_QUALITY_HIGH",(he=t.QUALITY_TYPE||(t.QUALITY_TYPE={}))[he.QUALITY_UNKNOWN=0]="QUALITY_UNKNOWN",he[he.QUALITY_EXCELLENT=1]="QUALITY_EXCELLENT",he[he.QUALITY_GOOD=2]="QUALITY_GOOD",he[he.QUALITY_POOR=3]="QUALITY_POOR",he[he.QUALITY_BAD=4]="QUALITY_BAD",he[he.QUALITY_VBAD=5]="QUALITY_VBAD",he[he.QUALITY_DOWN=6]="QUALITY_DOWN",he[he.QUALITY_UNSUPPORTED=7]="QUALITY_UNSUPPORTED",he[he.QUALITY_DETECTING=8]="QUALITY_DETECTING",(le=t.RENDER_MODE_TYPE||(t.RENDER_MODE_TYPE={}))[le.RENDER_MODE_HIDDEN=1]="RENDER_MODE_HIDDEN",le[le.RENDER_MODE_FIT=2]="RENDER_MODE_FIT",le[le.RENDER_MODE_ADAPTIVE=3]="RENDER_MODE_ADAPTIVE",le[le.RENDER_MODE_FILL=4]="RENDER_MODE_FILL",(Ee=t.VIDEO_MIRROR_MODE_TYPE||(t.VIDEO_MIRROR_MODE_TYPE={}))[Ee.VIDEO_MIRROR_MODE_AUTO=0]="VIDEO_MIRROR_MODE_AUTO",Ee[Ee.VIDEO_MIRROR_MODE_ENABLED=1]="VIDEO_MIRROR_MODE_ENABLED",Ee[Ee.VIDEO_MIRROR_MODE_DISABLED=2]="VIDEO_MIRROR_MODE_DISABLED",(ue=t.VIDEO_PROFILE_TYPE||(t.VIDEO_PROFILE_TYPE={}))[ue.VIDEO_PROFILE_LANDSCAPE_120P=0]="VIDEO_PROFILE_LANDSCAPE_120P",ue[ue.VIDEO_PROFILE_LANDSCAPE_120P_3=2]="VIDEO_PROFILE_LANDSCAPE_120P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_180P=10]="VIDEO_PROFILE_LANDSCAPE_180P",ue[ue.VIDEO_PROFILE_LANDSCAPE_180P_3=12]="VIDEO_PROFILE_LANDSCAPE_180P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_180P_4=13]="VIDEO_PROFILE_LANDSCAPE_180P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_240P=20]="VIDEO_PROFILE_LANDSCAPE_240P",ue[ue.VIDEO_PROFILE_LANDSCAPE_240P_3=22]="VIDEO_PROFILE_LANDSCAPE_240P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_240P_4=23]="VIDEO_PROFILE_LANDSCAPE_240P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P=30]="VIDEO_PROFILE_LANDSCAPE_360P",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_3=32]="VIDEO_PROFILE_LANDSCAPE_360P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_4=33]="VIDEO_PROFILE_LANDSCAPE_360P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_6=35]="VIDEO_PROFILE_LANDSCAPE_360P_6",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_7=36]="VIDEO_PROFILE_LANDSCAPE_360P_7",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_8=37]="VIDEO_PROFILE_LANDSCAPE_360P_8",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_9=38]="VIDEO_PROFILE_LANDSCAPE_360P_9",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_10=39]="VIDEO_PROFILE_LANDSCAPE_360P_10",ue[ue.VIDEO_PROFILE_LANDSCAPE_360P_11=100]="VIDEO_PROFILE_LANDSCAPE_360P_11",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P=40]="VIDEO_PROFILE_LANDSCAPE_480P",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_3=42]="VIDEO_PROFILE_LANDSCAPE_480P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_4=43]="VIDEO_PROFILE_LANDSCAPE_480P_4",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_6=45]="VIDEO_PROFILE_LANDSCAPE_480P_6",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_8=47]="VIDEO_PROFILE_LANDSCAPE_480P_8",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_9=48]="VIDEO_PROFILE_LANDSCAPE_480P_9",ue[ue.VIDEO_PROFILE_LANDSCAPE_480P_10=49]="VIDEO_PROFILE_LANDSCAPE_480P_10",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P=50]="VIDEO_PROFILE_LANDSCAPE_720P",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P_3=52]="VIDEO_PROFILE_LANDSCAPE_720P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P_5=54]="VIDEO_PROFILE_LANDSCAPE_720P_5",ue[ue.VIDEO_PROFILE_LANDSCAPE_720P_6=55]="VIDEO_PROFILE_LANDSCAPE_720P_6",ue[ue.VIDEO_PROFILE_LANDSCAPE_1080P=60]="VIDEO_PROFILE_LANDSCAPE_1080P",ue[ue.VIDEO_PROFILE_LANDSCAPE_1080P_3=62]="VIDEO_PROFILE_LANDSCAPE_1080P_3",ue[ue.VIDEO_PROFILE_LANDSCAPE_1080P_5=64]="VIDEO_PROFILE_LANDSCAPE_1080P_5",ue[ue.VIDEO_PROFILE_LANDSCAPE_1440P=66]="VIDEO_PROFILE_LANDSCAPE_1440P",ue[ue.VIDEO_PROFILE_LANDSCAPE_1440P_2=67]="VIDEO_PROFILE_LANDSCAPE_1440P_2",ue[ue.VIDEO_PROFILE_LANDSCAPE_4K=70]="VIDEO_PROFILE_LANDSCAPE_4K",ue[ue.VIDEO_PROFILE_LANDSCAPE_4K_3=72]="VIDEO_PROFILE_LANDSCAPE_4K_3",ue[ue.VIDEO_PROFILE_PORTRAIT_120P=1e3]="VIDEO_PROFILE_PORTRAIT_120P",ue[ue.VIDEO_PROFILE_PORTRAIT_120P_3=1002]="VIDEO_PROFILE_PORTRAIT_120P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_180P=1010]="VIDEO_PROFILE_PORTRAIT_180P",ue[ue.VIDEO_PROFILE_PORTRAIT_180P_3=1012]="VIDEO_PROFILE_PORTRAIT_180P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_180P_4=1013]="VIDEO_PROFILE_PORTRAIT_180P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_240P=1020]="VIDEO_PROFILE_PORTRAIT_240P",ue[ue.VIDEO_PROFILE_PORTRAIT_240P_3=1022]="VIDEO_PROFILE_PORTRAIT_240P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_240P_4=1023]="VIDEO_PROFILE_PORTRAIT_240P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_360P=1030]="VIDEO_PROFILE_PORTRAIT_360P",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_3=1032]="VIDEO_PROFILE_PORTRAIT_360P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_4=1033]="VIDEO_PROFILE_PORTRAIT_360P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_6=1035]="VIDEO_PROFILE_PORTRAIT_360P_6",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_7=1036]="VIDEO_PROFILE_PORTRAIT_360P_7",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_8=1037]="VIDEO_PROFILE_PORTRAIT_360P_8",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_9=1038]="VIDEO_PROFILE_PORTRAIT_360P_9",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_10=1039]="VIDEO_PROFILE_PORTRAIT_360P_10",ue[ue.VIDEO_PROFILE_PORTRAIT_360P_11=1100]="VIDEO_PROFILE_PORTRAIT_360P_11",ue[ue.VIDEO_PROFILE_PORTRAIT_480P=1040]="VIDEO_PROFILE_PORTRAIT_480P",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_3=1042]="VIDEO_PROFILE_PORTRAIT_480P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_4=1043]="VIDEO_PROFILE_PORTRAIT_480P_4",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_6=1045]="VIDEO_PROFILE_PORTRAIT_480P_6",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_8=1047]="VIDEO_PROFILE_PORTRAIT_480P_8",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_9=1048]="VIDEO_PROFILE_PORTRAIT_480P_9",ue[ue.VIDEO_PROFILE_PORTRAIT_480P_10=1049]="VIDEO_PROFILE_PORTRAIT_480P_10",ue[ue.VIDEO_PROFILE_PORTRAIT_720P=1050]="VIDEO_PROFILE_PORTRAIT_720P",ue[ue.VIDEO_PROFILE_PORTRAIT_720P_3=1052]="VIDEO_PROFILE_PORTRAIT_720P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_720P_5=1054]="VIDEO_PROFILE_PORTRAIT_720P_5",ue[ue.VIDEO_PROFILE_PORTRAIT_720P_6=1055]="VIDEO_PROFILE_PORTRAIT_720P_6",ue[ue.VIDEO_PROFILE_PORTRAIT_1080P=1060]="VIDEO_PROFILE_PORTRAIT_1080P",ue[ue.VIDEO_PROFILE_PORTRAIT_1080P_3=1062]="VIDEO_PROFILE_PORTRAIT_1080P_3",ue[ue.VIDEO_PROFILE_PORTRAIT_1080P_5=1064]="VIDEO_PROFILE_PORTRAIT_1080P_5",ue[ue.VIDEO_PROFILE_PORTRAIT_1440P=1066]="VIDEO_PROFILE_PORTRAIT_1440P",ue[ue.VIDEO_PROFILE_PORTRAIT_1440P_2=1067]="VIDEO_PROFILE_PORTRAIT_1440P_2",ue[ue.VIDEO_PROFILE_PORTRAIT_4K=1070]="VIDEO_PROFILE_PORTRAIT_4K",ue[ue.VIDEO_PROFILE_PORTRAIT_4K_3=1072]="VIDEO_PROFILE_PORTRAIT_4K_3",ue[ue.VIDEO_PROFILE_DEFAULT=30]="VIDEO_PROFILE_DEFAULT",(de=t.AUDIO_PROFILE_TYPE||(t.AUDIO_PROFILE_TYPE={}))[de.AUDIO_PROFILE_DEFAULT=0]="AUDIO_PROFILE_DEFAULT",de[de.AUDIO_PROFILE_SPEECH_STANDARD=1]="AUDIO_PROFILE_SPEECH_STANDARD",de[de.AUDIO_PROFILE_MUSIC_STANDARD=2]="AUDIO_PROFILE_MUSIC_STANDARD",de[de.AUDIO_PROFILE_MUSIC_STANDARD_STEREO=3]="AUDIO_PROFILE_MUSIC_STANDARD_STEREO",de[de.AUDIO_PROFILE_MUSIC_HIGH_QUALITY=4]="AUDIO_PROFILE_MUSIC_HIGH_QUALITY",de[de.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO=5]="AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO",de[de.AUDIO_PROFILE_IOT=6]="AUDIO_PROFILE_IOT",de[de.AUDIO_PROFILE_NUM=7]="AUDIO_PROFILE_NUM",(Ae=t.AUDIO_SCENARIO_TYPE||(t.AUDIO_SCENARIO_TYPE={}))[Ae.AUDIO_SCENARIO_DEFAULT=0]="AUDIO_SCENARIO_DEFAULT",Ae[Ae.AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT=1]="AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT",Ae[Ae.AUDIO_SCENARIO_EDUCATION=2]="AUDIO_SCENARIO_EDUCATION",Ae[Ae.AUDIO_SCENARIO_GAME_STREAMING=3]="AUDIO_SCENARIO_GAME_STREAMING",Ae[Ae.AUDIO_SCENARIO_SHOWROOM=4]="AUDIO_SCENARIO_SHOWROOM",Ae[Ae.AUDIO_SCENARIO_CHATROOM_GAMING=5]="AUDIO_SCENARIO_CHATROOM_GAMING",Ae[Ae.AUDIO_SCENARIO_IOT=6]="AUDIO_SCENARIO_IOT",Ae[Ae.AUDIO_SCENARIO_MEETING=8]="AUDIO_SCENARIO_MEETING",Ae[Ae.AUDIO_SCENARIO_NUM=9]="AUDIO_SCENARIO_NUM",(ce=t.CHANNEL_PROFILE_TYPE||(t.CHANNEL_PROFILE_TYPE={}))[ce.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",ce[ce.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING",ce[ce.CHANNEL_PROFILE_GAME=2]="CHANNEL_PROFILE_GAME",(ae=t.CLIENT_ROLE_TYPE||(t.CLIENT_ROLE_TYPE={}))[ae.CLIENT_ROLE_BROADCASTER=1]="CLIENT_ROLE_BROADCASTER",ae[ae.CLIENT_ROLE_AUDIENCE=2]="CLIENT_ROLE_AUDIENCE",(se=t.AUDIENCE_LATENCY_LEVEL_TYPE||(t.AUDIENCE_LATENCY_LEVEL_TYPE={}))[se.AUDIENCE_LATENCY_LEVEL_LOW_LATENCY=1]="AUDIENCE_LATENCY_LEVEL_LOW_LATENCY",se[se.AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY=2]="AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY",(oe=t.SUPER_RESOLUTION_STATE_REASON||(t.SUPER_RESOLUTION_STATE_REASON={}))[oe.SR_STATE_REASON_SUCCESS=0]="SR_STATE_REASON_SUCCESS",oe[oe.SR_STATE_REASON_STREAM_OVER_LIMITATION=1]="SR_STATE_REASON_STREAM_OVER_LIMITATION",oe[oe.SR_STATE_REASON_USER_COUNT_OVER_LIMITATION=2]="SR_STATE_REASON_USER_COUNT_OVER_LIMITATION",oe[oe.SR_STATE_REASON_DEVICE_NOT_SUPPORTED=3]="SR_STATE_REASON_DEVICE_NOT_SUPPORTED",(re=t.USER_OFFLINE_REASON_TYPE||(t.USER_OFFLINE_REASON_TYPE={}))[re.USER_OFFLINE_QUIT=0]="USER_OFFLINE_QUIT",re[re.USER_OFFLINE_DROPPED=1]="USER_OFFLINE_DROPPED",re[re.USER_OFFLINE_BECOME_AUDIENCE=2]="USER_OFFLINE_BECOME_AUDIENCE",(ne=t.RTMP_STREAM_PUBLISH_STATE||(t.RTMP_STREAM_PUBLISH_STATE={}))[ne.RTMP_STREAM_PUBLISH_STATE_IDLE=0]="RTMP_STREAM_PUBLISH_STATE_IDLE",ne[ne.RTMP_STREAM_PUBLISH_STATE_CONNECTING=1]="RTMP_STREAM_PUBLISH_STATE_CONNECTING",ne[ne.RTMP_STREAM_PUBLISH_STATE_RUNNING=2]="RTMP_STREAM_PUBLISH_STATE_RUNNING",ne[ne.RTMP_STREAM_PUBLISH_STATE_RECOVERING=3]="RTMP_STREAM_PUBLISH_STATE_RECOVERING",ne[ne.RTMP_STREAM_PUBLISH_STATE_FAILURE=4]="RTMP_STREAM_PUBLISH_STATE_FAILURE",(ie=t.RTMP_STREAM_PUBLISH_ERROR||(t.RTMP_STREAM_PUBLISH_ERROR={}))[ie.RTMP_STREAM_PUBLISH_ERROR_OK=0]="RTMP_STREAM_PUBLISH_ERROR_OK",ie[ie.RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT=1]="RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT",ie[ie.RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED=2]="RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED",ie[ie.RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT=3]="RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT",ie[ie.RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR=4]="RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR",ie[ie.RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR=5]="RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR",ie[ie.RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN=6]="RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN",ie[ie.RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT=7]="RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT",ie[ie.RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED=8]="RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED",ie[ie.RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND=9]="RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND",ie[ie.RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED=10]="RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED",(te=t.RTMP_STREAMING_EVENT||(t.RTMP_STREAMING_EVENT={}))[te.RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE=1]="RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE",(ee=t.INJECT_STREAM_STATUS||(t.INJECT_STREAM_STATUS={}))[ee.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",ee[ee.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",ee[ee.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",ee[ee.INJECT_STREAM_STATUS_START_TIMEDOUT=3]="INJECT_STREAM_STATUS_START_TIMEDOUT",ee[ee.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",ee[ee.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",ee[ee.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",ee[ee.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",ee[ee.INJECT_STREAM_STATUS_STOP_TIMEDOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEDOUT",ee[ee.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",ee[ee.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN",($=t.REMOTE_VIDEO_STREAM_TYPE||(t.REMOTE_VIDEO_STREAM_TYPE={}))[$.REMOTE_VIDEO_STREAM_HIGH=0]="REMOTE_VIDEO_STREAM_HIGH",$[$.REMOTE_VIDEO_STREAM_LOW=1]="REMOTE_VIDEO_STREAM_LOW",(Z=t.CAPTURE_BRIGHTNESS_LEVEL_TYPE||(t.CAPTURE_BRIGHTNESS_LEVEL_TYPE={}))[Z.CAPTURE_BRIGHTNESS_LEVEL_INVALID=-1]="CAPTURE_BRIGHTNESS_LEVEL_INVALID",Z[Z.CAPTURE_BRIGHTNESS_LEVEL_NORMAL=0]="CAPTURE_BRIGHTNESS_LEVEL_NORMAL",Z[Z.CAPTURE_BRIGHTNESS_LEVEL_BRIGHT=1]="CAPTURE_BRIGHTNESS_LEVEL_BRIGHT",Z[Z.CAPTURE_BRIGHTNESS_LEVEL_DARK=2]="CAPTURE_BRIGHTNESS_LEVEL_DARK",(z=t.RAW_AUDIO_FRAME_OP_MODE_TYPE||(t.RAW_AUDIO_FRAME_OP_MODE_TYPE={}))[z.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY=0]="RAW_AUDIO_FRAME_OP_MODE_READ_ONLY",z[z.RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY=1]="RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY",z[z.RAW_AUDIO_FRAME_OP_MODE_READ_WRITE=2]="RAW_AUDIO_FRAME_OP_MODE_READ_WRITE",(X=t.AUDIO_SAMPLE_RATE_TYPE||(t.AUDIO_SAMPLE_RATE_TYPE={}))[X.AUDIO_SAMPLE_RATE_32000=32e3]="AUDIO_SAMPLE_RATE_32000",X[X.AUDIO_SAMPLE_RATE_44100=44100]="AUDIO_SAMPLE_RATE_44100",X[X.AUDIO_SAMPLE_RATE_48000=48e3]="AUDIO_SAMPLE_RATE_48000",(q=t.VIDEO_CODEC_PROFILE_TYPE||(t.VIDEO_CODEC_PROFILE_TYPE={}))[q.VIDEO_CODEC_PROFILE_BASELINE=66]="VIDEO_CODEC_PROFILE_BASELINE",q[q.VIDEO_CODEC_PROFILE_MAIN=77]="VIDEO_CODEC_PROFILE_MAIN",q[q.VIDEO_CODEC_PROFILE_HIGH=100]="VIDEO_CODEC_PROFILE_HIGH",(J=t.VIDEO_CODEC_TYPE||(t.VIDEO_CODEC_TYPE={}))[J.VIDEO_CODEC_VP8=1]="VIDEO_CODEC_VP8",J[J.VIDEO_CODEC_H264=2]="VIDEO_CODEC_H264",J[J.VIDEO_CODEC_EVP=3]="VIDEO_CODEC_EVP",J[J.VIDEO_CODEC_E264=4]="VIDEO_CODEC_E264",(W=t.VIDEO_CODEC_TYPE_FOR_STREAM||(t.VIDEO_CODEC_TYPE_FOR_STREAM={}))[W.VIDEO_CODEC_H264_FOR_STREAM=1]="VIDEO_CODEC_H264_FOR_STREAM",W[W.VIDEO_CODEC_H265_FOR_STREAM=2]="VIDEO_CODEC_H265_FOR_STREAM",(K=t.AUDIO_EQUALIZATION_BAND_FREQUENCY||(t.AUDIO_EQUALIZATION_BAND_FREQUENCY={}))[K.AUDIO_EQUALIZATION_BAND_31=0]="AUDIO_EQUALIZATION_BAND_31",K[K.AUDIO_EQUALIZATION_BAND_62=1]="AUDIO_EQUALIZATION_BAND_62",K[K.AUDIO_EQUALIZATION_BAND_125=2]="AUDIO_EQUALIZATION_BAND_125",K[K.AUDIO_EQUALIZATION_BAND_250=3]="AUDIO_EQUALIZATION_BAND_250",K[K.AUDIO_EQUALIZATION_BAND_500=4]="AUDIO_EQUALIZATION_BAND_500",K[K.AUDIO_EQUALIZATION_BAND_1K=5]="AUDIO_EQUALIZATION_BAND_1K",K[K.AUDIO_EQUALIZATION_BAND_2K=6]="AUDIO_EQUALIZATION_BAND_2K",K[K.AUDIO_EQUALIZATION_BAND_4K=7]="AUDIO_EQUALIZATION_BAND_4K",K[K.AUDIO_EQUALIZATION_BAND_8K=8]="AUDIO_EQUALIZATION_BAND_8K",K[K.AUDIO_EQUALIZATION_BAND_16K=9]="AUDIO_EQUALIZATION_BAND_16K",(H=t.AUDIO_REVERB_TYPE||(t.AUDIO_REVERB_TYPE={}))[H.AUDIO_REVERB_DRY_LEVEL=0]="AUDIO_REVERB_DRY_LEVEL",H[H.AUDIO_REVERB_WET_LEVEL=1]="AUDIO_REVERB_WET_LEVEL",H[H.AUDIO_REVERB_ROOM_SIZE=2]="AUDIO_REVERB_ROOM_SIZE",H[H.AUDIO_REVERB_WET_DELAY=3]="AUDIO_REVERB_WET_DELAY",H[H.AUDIO_REVERB_STRENGTH=4]="AUDIO_REVERB_STRENGTH",(Y=t.VOICE_CHANGER_PRESET||(t.VOICE_CHANGER_PRESET={}))[Y.VOICE_CHANGER_OFF=0]="VOICE_CHANGER_OFF",Y[Y.VOICE_CHANGER_OLDMAN=1]="VOICE_CHANGER_OLDMAN",Y[Y.VOICE_CHANGER_BABYBOY=2]="VOICE_CHANGER_BABYBOY",Y[Y.VOICE_CHANGER_BABYGIRL=3]="VOICE_CHANGER_BABYGIRL",Y[Y.VOICE_CHANGER_ZHUBAJIE=4]="VOICE_CHANGER_ZHUBAJIE",Y[Y.VOICE_CHANGER_ETHEREAL=5]="VOICE_CHANGER_ETHEREAL",Y[Y.VOICE_CHANGER_HULK=6]="VOICE_CHANGER_HULK",Y[Y.VOICE_BEAUTY_VIGOROUS=1048577]="VOICE_BEAUTY_VIGOROUS",Y[Y.VOICE_BEAUTY_DEEP=1048578]="VOICE_BEAUTY_DEEP",Y[Y.VOICE_BEAUTY_MELLOW=1048579]="VOICE_BEAUTY_MELLOW",Y[Y.VOICE_BEAUTY_FALSETTO=1048580]="VOICE_BEAUTY_FALSETTO",Y[Y.VOICE_BEAUTY_FULL=1048581]="VOICE_BEAUTY_FULL",Y[Y.VOICE_BEAUTY_CLEAR=1048582]="VOICE_BEAUTY_CLEAR",Y[Y.VOICE_BEAUTY_RESOUNDING=1048583]="VOICE_BEAUTY_RESOUNDING",Y[Y.VOICE_BEAUTY_RINGING=1048584]="VOICE_BEAUTY_RINGING",Y[Y.VOICE_BEAUTY_SPACIAL=1048585]="VOICE_BEAUTY_SPACIAL",Y[Y.GENERAL_BEAUTY_VOICE_MALE_MAGNETIC=2097153]="GENERAL_BEAUTY_VOICE_MALE_MAGNETIC",Y[Y.GENERAL_BEAUTY_VOICE_FEMALE_FRESH=2097154]="GENERAL_BEAUTY_VOICE_FEMALE_FRESH",Y[Y.GENERAL_BEAUTY_VOICE_FEMALE_VITALITY=2097155]="GENERAL_BEAUTY_VOICE_FEMALE_VITALITY",(j=t.AUDIO_REVERB_PRESET||(t.AUDIO_REVERB_PRESET={}))[j.AUDIO_REVERB_OFF=0]="AUDIO_REVERB_OFF",j[j.AUDIO_REVERB_FX_KTV=1048577]="AUDIO_REVERB_FX_KTV",j[j.AUDIO_REVERB_FX_VOCAL_CONCERT=1048578]="AUDIO_REVERB_FX_VOCAL_CONCERT",j[j.AUDIO_REVERB_FX_UNCLE=1048579]="AUDIO_REVERB_FX_UNCLE",j[j.AUDIO_REVERB_FX_SISTER=1048580]="AUDIO_REVERB_FX_SISTER",j[j.AUDIO_REVERB_FX_STUDIO=1048581]="AUDIO_REVERB_FX_STUDIO",j[j.AUDIO_REVERB_FX_POPULAR=1048582]="AUDIO_REVERB_FX_POPULAR",j[j.AUDIO_REVERB_FX_RNB=1048583]="AUDIO_REVERB_FX_RNB",j[j.AUDIO_REVERB_FX_PHONOGRAPH=1048584]="AUDIO_REVERB_FX_PHONOGRAPH",j[j.AUDIO_REVERB_POPULAR=1]="AUDIO_REVERB_POPULAR",j[j.AUDIO_REVERB_RNB=2]="AUDIO_REVERB_RNB",j[j.AUDIO_REVERB_ROCK=3]="AUDIO_REVERB_ROCK",j[j.AUDIO_REVERB_HIPHOP=4]="AUDIO_REVERB_HIPHOP",j[j.AUDIO_REVERB_VOCAL_CONCERT=5]="AUDIO_REVERB_VOCAL_CONCERT",j[j.AUDIO_REVERB_KTV=6]="AUDIO_REVERB_KTV",j[j.AUDIO_REVERB_STUDIO=7]="AUDIO_REVERB_STUDIO",j[j.AUDIO_VIRTUAL_STEREO=2097153]="AUDIO_VIRTUAL_STEREO",j[j.AUDIO_ELECTRONIC_VOICE=3145729]="AUDIO_ELECTRONIC_VOICE",j[j.AUDIO_THREEDIM_VOICE=4194305]="AUDIO_THREEDIM_VOICE",(G=t.VOICE_BEAUTIFIER_PRESET||(t.VOICE_BEAUTIFIER_PRESET={}))[G.VOICE_BEAUTIFIER_OFF=0]="VOICE_BEAUTIFIER_OFF",G[G.CHAT_BEAUTIFIER_MAGNETIC=16843008]="CHAT_BEAUTIFIER_MAGNETIC",G[G.CHAT_BEAUTIFIER_FRESH=16843264]="CHAT_BEAUTIFIER_FRESH",G[G.CHAT_BEAUTIFIER_VITALITY=16843520]="CHAT_BEAUTIFIER_VITALITY",G[G.SINGING_BEAUTIFIER=16908544]="SINGING_BEAUTIFIER",G[G.TIMBRE_TRANSFORMATION_VIGOROUS=16974080]="TIMBRE_TRANSFORMATION_VIGOROUS",G[G.TIMBRE_TRANSFORMATION_DEEP=16974336]="TIMBRE_TRANSFORMATION_DEEP",G[G.TIMBRE_TRANSFORMATION_MELLOW=16974592]="TIMBRE_TRANSFORMATION_MELLOW",G[G.TIMBRE_TRANSFORMATION_FALSETTO=16974848]="TIMBRE_TRANSFORMATION_FALSETTO",G[G.TIMBRE_TRANSFORMATION_FULL=16975104]="TIMBRE_TRANSFORMATION_FULL",G[G.TIMBRE_TRANSFORMATION_CLEAR=16975360]="TIMBRE_TRANSFORMATION_CLEAR",G[G.TIMBRE_TRANSFORMATION_RESOUNDING=16975616]="TIMBRE_TRANSFORMATION_RESOUNDING",G[G.TIMBRE_TRANSFORMATION_RINGING=16975872]="TIMBRE_TRANSFORMATION_RINGING",(F=t.AUDIO_EFFECT_PRESET||(t.AUDIO_EFFECT_PRESET={}))[F.AUDIO_EFFECT_OFF=0]="AUDIO_EFFECT_OFF",F[F.ROOM_ACOUSTICS_KTV=33620224]="ROOM_ACOUSTICS_KTV",F[F.ROOM_ACOUSTICS_VOCAL_CONCERT=33620480]="ROOM_ACOUSTICS_VOCAL_CONCERT",F[F.ROOM_ACOUSTICS_STUDIO=33620736]="ROOM_ACOUSTICS_STUDIO",F[F.ROOM_ACOUSTICS_PHONOGRAPH=33620992]="ROOM_ACOUSTICS_PHONOGRAPH",F[F.ROOM_ACOUSTICS_VIRTUAL_STEREO=33621248]="ROOM_ACOUSTICS_VIRTUAL_STEREO",F[F.ROOM_ACOUSTICS_SPACIAL=33621504]="ROOM_ACOUSTICS_SPACIAL",F[F.ROOM_ACOUSTICS_ETHEREAL=33621760]="ROOM_ACOUSTICS_ETHEREAL",F[F.ROOM_ACOUSTICS_3D_VOICE=33622016]="ROOM_ACOUSTICS_3D_VOICE",F[F.VOICE_CHANGER_EFFECT_UNCLE=33685760]="VOICE_CHANGER_EFFECT_UNCLE",F[F.VOICE_CHANGER_EFFECT_OLDMAN=33686016]="VOICE_CHANGER_EFFECT_OLDMAN",F[F.VOICE_CHANGER_EFFECT_BOY=33686272]="VOICE_CHANGER_EFFECT_BOY",F[F.VOICE_CHANGER_EFFECT_SISTER=33686528]="VOICE_CHANGER_EFFECT_SISTER",F[F.VOICE_CHANGER_EFFECT_GIRL=33686784]="VOICE_CHANGER_EFFECT_GIRL",F[F.VOICE_CHANGER_EFFECT_PIGKING=33687040]="VOICE_CHANGER_EFFECT_PIGKING",F[F.VOICE_CHANGER_EFFECT_HULK=33687296]="VOICE_CHANGER_EFFECT_HULK",F[F.STYLE_TRANSFORMATION_RNB=33751296]="STYLE_TRANSFORMATION_RNB",F[F.STYLE_TRANSFORMATION_POPULAR=33751552]="STYLE_TRANSFORMATION_POPULAR",F[F.PITCH_CORRECTION=33816832]="PITCH_CORRECTION",(x=t.VOICE_CONVERSION_PRESET||(t.VOICE_CONVERSION_PRESET={}))[x.VOICE_CONVERSION_OFF=0]="VOICE_CONVERSION_OFF",x[x.VOICE_CHANGER_NEUTRAL=50397440]="VOICE_CHANGER_NEUTRAL",x[x.VOICE_CHANGER_SWEET=50397696]="VOICE_CHANGER_SWEET",x[x.VOICE_CHANGER_SOLID=50397952]="VOICE_CHANGER_SOLID",x[x.VOICE_CHANGER_BASS=50398208]="VOICE_CHANGER_BASS",(Q=t.AUDIO_CODEC_PROFILE_TYPE||(t.AUDIO_CODEC_PROFILE_TYPE={}))[Q.AUDIO_CODEC_PROFILE_LC_AAC=0]="AUDIO_CODEC_PROFILE_LC_AAC",Q[Q.AUDIO_CODEC_PROFILE_HE_AAC=1]="AUDIO_CODEC_PROFILE_HE_AAC",(V=t.REMOTE_AUDIO_STATE||(t.REMOTE_AUDIO_STATE={}))[V.REMOTE_AUDIO_STATE_STOPPED=0]="REMOTE_AUDIO_STATE_STOPPED",V[V.REMOTE_AUDIO_STATE_STARTING=1]="REMOTE_AUDIO_STATE_STARTING",V[V.REMOTE_AUDIO_STATE_DECODING=2]="REMOTE_AUDIO_STATE_DECODING",V[V.REMOTE_AUDIO_STATE_FROZEN=3]="REMOTE_AUDIO_STATE_FROZEN",V[V.REMOTE_AUDIO_STATE_FAILED=4]="REMOTE_AUDIO_STATE_FAILED",(B=t.REMOTE_AUDIO_STATE_REASON||(t.REMOTE_AUDIO_STATE_REASON={}))[B.REMOTE_AUDIO_REASON_INTERNAL=0]="REMOTE_AUDIO_REASON_INTERNAL",B[B.REMOTE_AUDIO_REASON_NETWORK_CONGESTION=1]="REMOTE_AUDIO_REASON_NETWORK_CONGESTION",B[B.REMOTE_AUDIO_REASON_NETWORK_RECOVERY=2]="REMOTE_AUDIO_REASON_NETWORK_RECOVERY",B[B.REMOTE_AUDIO_REASON_LOCAL_MUTED=3]="REMOTE_AUDIO_REASON_LOCAL_MUTED",B[B.REMOTE_AUDIO_REASON_LOCAL_UNMUTED=4]="REMOTE_AUDIO_REASON_LOCAL_UNMUTED",B[B.REMOTE_AUDIO_REASON_REMOTE_MUTED=5]="REMOTE_AUDIO_REASON_REMOTE_MUTED",B[B.REMOTE_AUDIO_REASON_REMOTE_UNMUTED=6]="REMOTE_AUDIO_REASON_REMOTE_UNMUTED",B[B.REMOTE_AUDIO_REASON_REMOTE_OFFLINE=7]="REMOTE_AUDIO_REASON_REMOTE_OFFLINE",(U=t.REMOTE_VIDEO_STATE||(t.REMOTE_VIDEO_STATE={}))[U.REMOTE_VIDEO_STATE_STOPPED=0]="REMOTE_VIDEO_STATE_STOPPED",U[U.REMOTE_VIDEO_STATE_STARTING=1]="REMOTE_VIDEO_STATE_STARTING",U[U.REMOTE_VIDEO_STATE_DECODING=2]="REMOTE_VIDEO_STATE_DECODING",U[U.REMOTE_VIDEO_STATE_FROZEN=3]="REMOTE_VIDEO_STATE_FROZEN",U[U.REMOTE_VIDEO_STATE_FAILED=4]="REMOTE_VIDEO_STATE_FAILED",(M=t.STREAM_PUBLISH_STATE||(t.STREAM_PUBLISH_STATE={}))[M.PUB_STATE_IDLE=0]="PUB_STATE_IDLE",M[M.PUB_STATE_NO_PUBLISHED=1]="PUB_STATE_NO_PUBLISHED",M[M.PUB_STATE_PUBLISHING=2]="PUB_STATE_PUBLISHING",M[M.PUB_STATE_PUBLISHED=3]="PUB_STATE_PUBLISHED",(k=t.STREAM_SUBSCRIBE_STATE||(t.STREAM_SUBSCRIBE_STATE={}))[k.SUB_STATE_IDLE=0]="SUB_STATE_IDLE",k[k.SUB_STATE_NO_SUBSCRIBED=1]="SUB_STATE_NO_SUBSCRIBED",k[k.SUB_STATE_SUBSCRIBING=2]="SUB_STATE_SUBSCRIBING",k[k.SUB_STATE_SUBSCRIBED=3]="SUB_STATE_SUBSCRIBED",(P=t.XLA_REMOTE_VIDEO_FROZEN_TYPE||(t.XLA_REMOTE_VIDEO_FROZEN_TYPE={}))[P.XLA_REMOTE_VIDEO_FROZEN_500MS=0]="XLA_REMOTE_VIDEO_FROZEN_500MS",P[P.XLA_REMOTE_VIDEO_FROZEN_200MS=1]="XLA_REMOTE_VIDEO_FROZEN_200MS",P[P.XLA_REMOTE_VIDEO_FROZEN_600MS=2]="XLA_REMOTE_VIDEO_FROZEN_600MS",P[P.XLA_REMOTE_VIDEO_FROZEN_TYPE_MAX=3]="XLA_REMOTE_VIDEO_FROZEN_TYPE_MAX",(L=t.XLA_REMOTE_AUDIO_FROZEN_TYPE||(t.XLA_REMOTE_AUDIO_FROZEN_TYPE={}))[L.XLA_REMOTE_AUDIO_FROZEN_80MS=0]="XLA_REMOTE_AUDIO_FROZEN_80MS",L[L.XLA_REMOTE_AUDIO_FROZEN_200MS=1]="XLA_REMOTE_AUDIO_FROZEN_200MS",L[L.XLA_REMOTE_AUDIO_FROZEN_TYPE_MAX=2]="XLA_REMOTE_AUDIO_FROZEN_TYPE_MAX",(b=t.REMOTE_VIDEO_STATE_REASON||(t.REMOTE_VIDEO_STATE_REASON={}))[b.REMOTE_VIDEO_STATE_REASON_INTERNAL=0]="REMOTE_VIDEO_STATE_REASON_INTERNAL",b[b.REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION=1]="REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION",b[b.REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY=2]="REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY",b[b.REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED=3]="REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED",b[b.REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED=4]="REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED",b[b.REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED=5]="REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED",b[b.REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED=6]="REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED",b[b.REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE=7]="REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE",b[b.REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK=8]="REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK",b[b.REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY=9]="REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY",(w=t.FRAME_RATE||(t.FRAME_RATE={}))[w.FRAME_RATE_FPS_1=1]="FRAME_RATE_FPS_1",w[w.FRAME_RATE_FPS_7=7]="FRAME_RATE_FPS_7",w[w.FRAME_RATE_FPS_10=10]="FRAME_RATE_FPS_10",w[w.FRAME_RATE_FPS_15=15]="FRAME_RATE_FPS_15",w[w.FRAME_RATE_FPS_24=24]="FRAME_RATE_FPS_24",w[w.FRAME_RATE_FPS_30=30]="FRAME_RATE_FPS_30",w[w.FRAME_RATE_FPS_60=60]="FRAME_RATE_FPS_60",(D=t.ORIENTATION_MODE||(t.ORIENTATION_MODE={}))[D.ORIENTATION_MODE_ADAPTIVE=0]="ORIENTATION_MODE_ADAPTIVE",D[D.ORIENTATION_MODE_FIXED_LANDSCAPE=1]="ORIENTATION_MODE_FIXED_LANDSCAPE",D[D.ORIENTATION_MODE_FIXED_PORTRAIT=2]="ORIENTATION_MODE_FIXED_PORTRAIT",(y=t.DEGRADATION_PREFERENCE||(t.DEGRADATION_PREFERENCE={}))[y.MAINTAIN_QUALITY=0]="MAINTAIN_QUALITY",y[y.MAINTAIN_FRAMERATE=1]="MAINTAIN_FRAMERATE",y[y.MAINTAIN_BALANCED=2]="MAINTAIN_BALANCED",(N=t.STREAM_FALLBACK_OPTIONS||(t.STREAM_FALLBACK_OPTIONS={}))[N.STREAM_FALLBACK_OPTION_DISABLED=0]="STREAM_FALLBACK_OPTION_DISABLED",N[N.STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW=1]="STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW",N[N.STREAM_FALLBACK_OPTION_AUDIO_ONLY=2]="STREAM_FALLBACK_OPTION_AUDIO_ONLY",(v=t.CAPTURER_OUTPUT_PREFERENCE||(t.CAPTURER_OUTPUT_PREFERENCE={}))[v.CAPTURER_OUTPUT_PREFERENCE_AUTO=0]="CAPTURER_OUTPUT_PREFERENCE_AUTO",v[v.CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE=1]="CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE",v[v.CAPTURER_OUTPUT_PREFERENCE_PREVIEW=2]="CAPTURER_OUTPUT_PREFERENCE_PREVIEW",v[v.CAPTURER_OUTPUT_PREFERENCE_MANUAL=3]="CAPTURER_OUTPUT_PREFERENCE_MANUAL",(O=t.PRIORITY_TYPE||(t.PRIORITY_TYPE={}))[O.PRIORITY_HIGH=50]="PRIORITY_HIGH",O[O.PRIORITY_NORMAL=100]="PRIORITY_NORMAL",(S=t.CONNECTION_STATE_TYPE||(t.CONNECTION_STATE_TYPE={}))[S.CONNECTION_STATE_DISCONNECTED=1]="CONNECTION_STATE_DISCONNECTED",S[S.CONNECTION_STATE_CONNECTING=2]="CONNECTION_STATE_CONNECTING",S[S.CONNECTION_STATE_CONNECTED=3]="CONNECTION_STATE_CONNECTED",S[S.CONNECTION_STATE_RECONNECTING=4]="CONNECTION_STATE_RECONNECTING",S[S.CONNECTION_STATE_FAILED=5]="CONNECTION_STATE_FAILED",(m=t.CONNECTION_CHANGED_REASON_TYPE||(t.CONNECTION_CHANGED_REASON_TYPE={}))[m.CONNECTION_CHANGED_CONNECTING=0]="CONNECTION_CHANGED_CONNECTING",m[m.CONNECTION_CHANGED_JOIN_SUCCESS=1]="CONNECTION_CHANGED_JOIN_SUCCESS",m[m.CONNECTION_CHANGED_INTERRUPTED=2]="CONNECTION_CHANGED_INTERRUPTED",m[m.CONNECTION_CHANGED_BANNED_BY_SERVER=3]="CONNECTION_CHANGED_BANNED_BY_SERVER",m[m.CONNECTION_CHANGED_JOIN_FAILED=4]="CONNECTION_CHANGED_JOIN_FAILED",m[m.CONNECTION_CHANGED_LEAVE_CHANNEL=5]="CONNECTION_CHANGED_LEAVE_CHANNEL",m[m.CONNECTION_CHANGED_INVALID_APP_ID=6]="CONNECTION_CHANGED_INVALID_APP_ID",m[m.CONNECTION_CHANGED_INVALID_CHANNEL_NAME=7]="CONNECTION_CHANGED_INVALID_CHANNEL_NAME",m[m.CONNECTION_CHANGED_INVALID_TOKEN=8]="CONNECTION_CHANGED_INVALID_TOKEN",m[m.CONNECTION_CHANGED_TOKEN_EXPIRED=9]="CONNECTION_CHANGED_TOKEN_EXPIRED",m[m.CONNECTION_CHANGED_REJECTED_BY_SERVER=10]="CONNECTION_CHANGED_REJECTED_BY_SERVER",m[m.CONNECTION_CHANGED_SETTING_PROXY_SERVER=11]="CONNECTION_CHANGED_SETTING_PROXY_SERVER",m[m.CONNECTION_CHANGED_RENEW_TOKEN=12]="CONNECTION_CHANGED_RENEW_TOKEN",m[m.CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED=13]="CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED",m[m.CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT=14]="CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT",m[m.CONNECTION_CHANGED_PROXY_SERVER_INTERRUPTED=15]="CONNECTION_CHANGED_PROXY_SERVER_INTERRUPTED",(T=t.NETWORK_TYPE||(t.NETWORK_TYPE={}))[T.NETWORK_TYPE_UNKNOWN=-1]="NETWORK_TYPE_UNKNOWN",T[T.NETWORK_TYPE_DISCONNECTED=0]="NETWORK_TYPE_DISCONNECTED",T[T.NETWORK_TYPE_LAN=1]="NETWORK_TYPE_LAN",T[T.NETWORK_TYPE_WIFI=2]="NETWORK_TYPE_WIFI",T[T.NETWORK_TYPE_MOBILE_2G=3]="NETWORK_TYPE_MOBILE_2G",T[T.NETWORK_TYPE_MOBILE_3G=4]="NETWORK_TYPE_MOBILE_3G",T[T.NETWORK_TYPE_MOBILE_4G=5]="NETWORK_TYPE_MOBILE_4G",(C=t.UPLOAD_ERROR_REASON||(t.UPLOAD_ERROR_REASON={}))[C.UPLOAD_SUCCESS=0]="UPLOAD_SUCCESS",C[C.UPLOAD_NET_ERROR=1]="UPLOAD_NET_ERROR",C[C.UPLOAD_SERVER_ERROR=2]="UPLOAD_SERVER_ERROR",(R=t.LASTMILE_PROBE_RESULT_STATE||(t.LASTMILE_PROBE_RESULT_STATE={}))[R.LASTMILE_PROBE_RESULT_COMPLETE=1]="LASTMILE_PROBE_RESULT_COMPLETE",R[R.LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE=2]="LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE",R[R.LASTMILE_PROBE_RESULT_UNAVAILABLE=3]="LASTMILE_PROBE_RESULT_UNAVAILABLE",(f=t.AUDIO_ROUTE_TYPE||(t.AUDIO_ROUTE_TYPE={}))[f.AUDIO_ROUTE_DEFAULT=-1]="AUDIO_ROUTE_DEFAULT",f[f.AUDIO_ROUTE_HEADSET=0]="AUDIO_ROUTE_HEADSET",f[f.AUDIO_ROUTE_EARPIECE=1]="AUDIO_ROUTE_EARPIECE",f[f.AUDIO_ROUTE_HEADSET_NO_MIC=2]="AUDIO_ROUTE_HEADSET_NO_MIC",f[f.AUDIO_ROUTE_SPEAKERPHONE=3]="AUDIO_ROUTE_SPEAKERPHONE",f[f.AUDIO_ROUTE_LOUDSPEAKER=4]="AUDIO_ROUTE_LOUDSPEAKER",f[f.AUDIO_ROUTE_BLUETOOTH=5]="AUDIO_ROUTE_BLUETOOTH",f[f.AUDIO_ROUTE_USB=6]="AUDIO_ROUTE_USB",f[f.AUDIO_ROUTE_HDMI=7]="AUDIO_ROUTE_HDMI",f[f.AUDIO_ROUTE_DISPLAYPORT=8]="AUDIO_ROUTE_DISPLAYPORT",f[f.AUDIO_ROUTE_AIRPLAY=9]="AUDIO_ROUTE_AIRPLAY",(g=t.CLOUD_PROXY_TYPE||(t.CLOUD_PROXY_TYPE={}))[g.NONE_PROXY=0]="NONE_PROXY",g[g.UDP_PROXY=1]="UDP_PROXY",g[g.TCP_PROXY=2]="TCP_PROXY",(I=t.AUDIO_SESSION_OPERATION_RESTRICTION||(t.AUDIO_SESSION_OPERATION_RESTRICTION={}))[I.AUDIO_SESSION_OPERATION_RESTRICTION_NONE=0]="AUDIO_SESSION_OPERATION_RESTRICTION_NONE",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY=1]="AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION=2]="AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION=4]="AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION",I[I.AUDIO_SESSION_OPERATION_RESTRICTION_ALL=128]="AUDIO_SESSION_OPERATION_RESTRICTION_ALL",(_=t.CAMERA_DIRECTION||(t.CAMERA_DIRECTION={}))[_.CAMERA_REAR=0]="CAMERA_REAR",_[_.CAMERA_FRONT=1]="CAMERA_FRONT",(p=t.QUALITY_ADAPT_INDICATION||(t.QUALITY_ADAPT_INDICATION={}))[p.ADAPT_NONE=0]="ADAPT_NONE",p[p.ADAPT_UP_BANDWIDTH=1]="ADAPT_UP_BANDWIDTH",p[p.ADAPT_DOWN_BANDWIDTH=2]="ADAPT_DOWN_BANDWIDTH",(h=t.EXPERIENCE_QUALITY_TYPE||(t.EXPERIENCE_QUALITY_TYPE={}))[h.EXPERIENCE_QUALITY_GOOD=0]="EXPERIENCE_QUALITY_GOOD",h[h.EXPERIENCE_QUALITY_BAD=1]="EXPERIENCE_QUALITY_BAD",(l=t.EXPERIENCE_POOR_REASON||(t.EXPERIENCE_POOR_REASON={}))[l.EXPERIENCE_REASON_NONE=0]="EXPERIENCE_REASON_NONE",l[l.REMOTE_NETWORK_QUALITY_POOR=1]="REMOTE_NETWORK_QUALITY_POOR",l[l.LOCAL_NETWORK_QUALITY_POOR=2]="LOCAL_NETWORK_QUALITY_POOR",l[l.WIRELESS_SIGNAL_POOR=4]="WIRELESS_SIGNAL_POOR",l[l.WIFI_BLUETOOTH_COEXIST=8]="WIFI_BLUETOOTH_COEXIST",(E=t.CHANNEL_MEDIA_RELAY_ERROR||(t.CHANNEL_MEDIA_RELAY_ERROR={}))[E.RELAY_OK=0]="RELAY_OK",E[E.RELAY_ERROR_SERVER_ERROR_RESPONSE=1]="RELAY_ERROR_SERVER_ERROR_RESPONSE",E[E.RELAY_ERROR_SERVER_NO_RESPONSE=2]="RELAY_ERROR_SERVER_NO_RESPONSE",E[E.RELAY_ERROR_NO_RESOURCE_AVAILABLE=3]="RELAY_ERROR_NO_RESOURCE_AVAILABLE",E[E.RELAY_ERROR_FAILED_JOIN_SRC=4]="RELAY_ERROR_FAILED_JOIN_SRC",E[E.RELAY_ERROR_FAILED_JOIN_DEST=5]="RELAY_ERROR_FAILED_JOIN_DEST",E[E.RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC=6]="RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC",E[E.RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST=7]="RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST",E[E.RELAY_ERROR_SERVER_CONNECTION_LOST=8]="RELAY_ERROR_SERVER_CONNECTION_LOST",E[E.RELAY_ERROR_INTERNAL_ERROR=9]="RELAY_ERROR_INTERNAL_ERROR",E[E.RELAY_ERROR_SRC_TOKEN_EXPIRED=10]="RELAY_ERROR_SRC_TOKEN_EXPIRED",E[E.RELAY_ERROR_DEST_TOKEN_EXPIRED=11]="RELAY_ERROR_DEST_TOKEN_EXPIRED",(u=t.CHANNEL_MEDIA_RELAY_EVENT||(t.CHANNEL_MEDIA_RELAY_EVENT={}))[u.RELAY_EVENT_NETWORK_DISCONNECTED=0]="RELAY_EVENT_NETWORK_DISCONNECTED",u[u.RELAY_EVENT_NETWORK_CONNECTED=1]="RELAY_EVENT_NETWORK_CONNECTED",u[u.RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL=2]="RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL",u[u.RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL=3]="RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL",u[u.RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL=4]="RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL",u[u.RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC=5]="RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC",u[u.RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC=6]="RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL=7]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED=8]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE=9]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",u[u.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL=10]="RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL",u[u.RELAY_EVENT_VIDEO_PROFILE_UPDATE=11]="RELAY_EVENT_VIDEO_PROFILE_UPDATE",(d=t.CHANNEL_MEDIA_RELAY_STATE||(t.CHANNEL_MEDIA_RELAY_STATE={}))[d.RELAY_STATE_IDLE=0]="RELAY_STATE_IDLE",d[d.RELAY_STATE_CONNECTING=1]="RELAY_STATE_CONNECTING",d[d.RELAY_STATE_RUNNING=2]="RELAY_STATE_RUNNING",d[d.RELAY_STATE_FAILURE=3]="RELAY_STATE_FAILURE",t.STANDARD_BITRATE=0,t.COMPATIBLE_BITRATE=-1,t.DEFAULT_MIN_BITRATE=-1,t.LBHQ="lbhq",t.VEO="veo",(A=t.RTMP_STREAM_LIFE_CYCLE_TYPE||(t.RTMP_STREAM_LIFE_CYCLE_TYPE={}))[A.RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL=1]="RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL",A[A.RTMP_STREAM_LIFE_CYCLE_BIND2OWNER=2]="RTMP_STREAM_LIFE_CYCLE_BIND2OWNER",(c=t.VideoContentHint||(t.VideoContentHint={}))[c.CONTENT_HINT_NONE=0]="CONTENT_HINT_NONE",c[c.CONTENT_HINT_MOTION=1]="CONTENT_HINT_MOTION",c[c.CONTENT_HINT_DETAILS=2]="CONTENT_HINT_DETAILS",(a=t.LIGHTENING_CONTRAST_LEVEL||(t.LIGHTENING_CONTRAST_LEVEL={}))[a.LIGHTENING_CONTRAST_LOW=0]="LIGHTENING_CONTRAST_LOW",a[a.LIGHTENING_CONTRAST_NORMAL=1]="LIGHTENING_CONTRAST_NORMAL",a[a.LIGHTENING_CONTRAST_HIGH=2]="LIGHTENING_CONTRAST_HIGH",(s=t.AREA_CODE||(t.AREA_CODE={}))[s.AREA_CODE_CN=1]="AREA_CODE_CN",s[s.AREA_CODE_NA=2]="AREA_CODE_NA",s[s.AREA_CODE_EU=4]="AREA_CODE_EU",s[s.AREA_CODE_AS=8]="AREA_CODE_AS",s[s.AREA_CODE_JP=16]="AREA_CODE_JP",s[s.AREA_CODE_IN=32]="AREA_CODE_IN",s[s.AREA_CODE_GLOB=4294967295]="AREA_CODE_GLOB",(o=t.ENCRYPTION_CONFIG||(t.ENCRYPTION_CONFIG={}))[o.ENCRYPTION_FORCE_SETTING=1]="ENCRYPTION_FORCE_SETTING",o[o.ENCRYPTION_FORCE_DISABLE_PACKET=2]="ENCRYPTION_FORCE_DISABLE_PACKET",(r=t.VIDEO_CAPTURE_TYPE||(t.VIDEO_CAPTURE_TYPE={}))[r.VIDEO_CAPTURE_UNKNOWN=0]="VIDEO_CAPTURE_UNKNOWN",r[r.VIDEO_CAPTURE_CAMERA=1]="VIDEO_CAPTURE_CAMERA",r[r.VIDEO_CAPTURE_SCREEN=2]="VIDEO_CAPTURE_SCREEN",(n=t.METADATA_TYPE||(t.METADATA_TYPE={}))[n.UNKNOWN_METADATA=-1]="UNKNOWN_METADATA",n[n.VIDEO_METADATA=0]="VIDEO_METADATA",(i=t.ENCRYPTION_MODE||(t.ENCRYPTION_MODE={}))[i.AES_128_XTS=1]="AES_128_XTS",i[i.AES_128_ECB=2]="AES_128_ECB",i[i.AES_256_XTS=3]="AES_256_XTS",i[i.SM4_128_ECB=4]="SM4_128_ECB",i[i.AES_128_GCM=5]="AES_128_GCM",i[i.AES_256_GCM=6]="AES_256_GCM",i[i.MODE_END=7]="MODE_END"},593:function(e,t,i){"use strict";var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelMediaRelayEventToNative=t.ChannelMediaRelayErrorToNative=t.ChannelMediaRelayStateToNative=t.InjectStreamEventStatusToNative=t.RtmpStreamingErrorToNative=t.NetworkQualityToNative=t.UserLeftReasonToNative=t.ConnectionDisconnectedReasonToNative=t.ConnectionStateToNative=t.printf=void 0;var r=i(424),o=i(910);t.printf=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.log.apply(console,n(["agora-iris",e],t,!1))},t.ConnectionStateToNative=function(e){switch(e){case"DISCONNECTED":case"DISCONNECTING":default:return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_DISCONNECTED;case"CONNECTING":return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_CONNECTING;case"RECONNECTING":return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_RECONNECTING;case"CONNECTED":return o.CONNECTION_STATE_TYPE.CONNECTION_STATE_CONNECTED}},t.ConnectionDisconnectedReasonToNative=function(e){switch(e){case r.ConnectionDisconnectedReason.LEAVE:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_LEAVE_CHANNEL;case r.ConnectionDisconnectedReason.NETWORK_ERROR:case r.ConnectionDisconnectedReason.SERVER_ERROR:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_INTERRUPTED;case r.ConnectionDisconnectedReason.UID_BANNED:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_REJECTED_BY_SERVER;case r.ConnectionDisconnectedReason.IP_BANNED:case r.ConnectionDisconnectedReason.CHANNEL_BANNED:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_BANNED_BY_SERVER;default:return o.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_JOIN_SUCCESS}},t.UserLeftReasonToNative=function(e){switch(e){case"Quit":default:return o.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_QUIT;case"ServerTimeOut":return o.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_DROPPED;case"BecomeAudience":return o.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_BECOME_AUDIENCE}},t.NetworkQualityToNative=function(e){switch(e){case 0:return o.QUALITY_TYPE.QUALITY_UNKNOWN;case 1:return o.QUALITY_TYPE.QUALITY_EXCELLENT;case 2:return o.QUALITY_TYPE.QUALITY_GOOD;case 3:return o.QUALITY_TYPE.QUALITY_POOR;case 4:return o.QUALITY_TYPE.QUALITY_BAD;case 5:return o.QUALITY_TYPE.QUALITY_VBAD;case 6:return o.QUALITY_TYPE.QUALITY_DOWN}},t.RtmpStreamingErrorToNative=function(e){switch(e){case"LIVE_STREAMING_INVALID_ARGUMENT":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT;case"LIVE_STREAMING_INTERNAL_SERVER_ERROR":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR;case"LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED;case"LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED;case"LIVE_STREAMING_CDN_ERROR":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR;case"LIVE_STREAMING_INVALID_RAW_STREAM":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT;case"LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT;case"LIVE_STREAMING_WARN_FREQUENT_REQUEST":return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN;default:return o.RTMP_STREAM_PUBLISH_ERROR.RTMP_STREAM_PUBLISH_ERROR_OK}},t.InjectStreamEventStatusToNative=function(e){switch(e){case 0:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_SUCCESS;case 1:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_ALREADY_EXISTS;case 2:default:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_UNAUTHORIZED;case 3:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_TIMEDOUT;case 4:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_START_FAILED;case 5:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_SUCCESS;case 6:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_NOT_FOUND;case 7:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED;case 8:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_TIMEDOUT;case 9:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_STOP_FAILED;case 10:return o.INJECT_STREAM_STATUS.INJECT_STREAM_STATUS_BROKEN}},t.ChannelMediaRelayStateToNative=function(e){switch(e){case r.ChannelMediaRelayState.RELAY_STATE_IDLE:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_IDLE;case r.ChannelMediaRelayState.RELAY_STATE_CONNECTING:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_CONNECTING;case r.ChannelMediaRelayState.RELAY_STATE_RUNNING:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_RUNNING;case r.ChannelMediaRelayState.RELAY_STATE_FAILURE:return o.CHANNEL_MEDIA_RELAY_STATE.RELAY_STATE_FAILURE}},t.ChannelMediaRelayErrorToNative=function(e){switch(e){case r.ChannelMediaRelayError.RELAY_OK:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_OK;case r.ChannelMediaRelayError.SERVER_CONNECTION_LOST:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_ERROR_SERVER_CONNECTION_LOST;case r.ChannelMediaRelayError.SRC_TOKEN_EXPIRED:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_ERROR_SRC_TOKEN_EXPIRED;case r.ChannelMediaRelayError.DEST_TOKEN_EXPIRED:return o.CHANNEL_MEDIA_RELAY_ERROR.RELAY_ERROR_DEST_TOKEN_EXPIRED}},t.ChannelMediaRelayEventToNative=function(e){switch(e){case r.ChannelMediaRelayEvent.NETWORK_DISCONNECTED:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_NETWORK_DISCONNECTED;case r.ChannelMediaRelayEvent.NETWORK_CONNECTED:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_NETWORK_CONNECTED;case r.ChannelMediaRelayEvent.PACKET_JOINED_SRC_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_JOINED_DEST_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_SENT_TO_DEST_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_RECEIVED_VIDEO_FROM_SRC:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC;case r.ChannelMediaRelayEvent.PACKET_RECEIVED_AUDIO_FROM_SRC:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC;case r.ChannelMediaRelayEvent.PACKET_UPDATE_DEST_CHANNEL:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL;case r.ChannelMediaRelayEvent.PACKET_UPDATE_DEST_CHANNEL_REFUSED:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED;case r.ChannelMediaRelayEvent.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE:return o.CHANNEL_MEDIA_RELAY_EVENT.RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE}}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var n=i(986);IrisRtcEngine=n.default})();
\ No newline at end of file
diff --git a/web b/web
index 142c542e0..c0fa7a671 160000
--- a/web
+++ b/web
@@ -1 +1 @@
-Subproject commit 142c542e0989c42614e94598738cad2182e345b2
+Subproject commit c0fa7a67146cd5a117dc27a4dfc4fde9728ee15a