tcplayer.js 5.3.4-beta.17 → 5.3.4-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TXLivePlayer=t()}(this,(function(){"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n=function(e){try{return!!e()}catch(e){return!0}},i=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),o=i,a=Function.prototype,s=a.call,c=o&&a.bind.bind(s,s),u=o?c:function(e){return function(){return s.apply(e,arguments)}},l=u({}.isPrototypeOf),d=function(e){return e&&e.Math===Math&&e},p=d("object"==typeof globalThis&&globalThis)||d("object"==typeof window&&window)||d("object"==typeof self&&self)||d("object"==typeof t&&t)||d("object"==typeof t&&t)||function(){return this}()||Function("return this")(),f=i,h=Function.prototype,m=h.apply,v=h.call,y="object"==typeof Reflect&&Reflect.apply||(f?v.bind(m):function(){return v.apply(m,arguments)}),g=u,b=g({}.toString),C=g("".slice),S=function(e){return C(b(e),8,-1)},T=S,_=u,w=function(e){if("Function"===T(e))return _(e)},R="object"==typeof document&&document.all,E=void 0===R&&void 0!==R?function(e){return"function"==typeof e||e===R}:function(e){return"function"==typeof e},P={},k=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),A=i,I=Function.prototype.call,L=A?I.bind(I):function(){return I.apply(I,arguments)},x={},D={}.propertyIsEnumerable,O=Object.getOwnPropertyDescriptor,N=O&&!D.call({1:2},1);x.f=N?function(e){var t=O(this,e);return!!t&&t.enumerable}:D;var M,U,V=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},F=n,j=S,B=Object,W=u("".split),G=F((function(){return!B("z").propertyIsEnumerable(0)}))?function(e){return"String"===j(e)?W(e,""):B(e)}:B,Z=function(e){return null==e},Y=Z,X=TypeError,H=function(e){if(Y(e))throw new X("Can't call method on "+e);return e},K=G,J=H,Q=function(e){return K(J(e))},z=E,q=function(e){return"object"==typeof e?null!==e:z(e)},$={},ee=$,te=p,re=E,ne=function(e){return re(e)?e:void 0},ie=function(e,t){return arguments.length<2?ne(ee[e])||ne(te[e]):ee[e]&&ee[e][t]||te[e]&&te[e][t]},oe=p.navigator,ae=oe&&oe.userAgent,se=ae?String(ae):"",ce=p,ue=se,le=ce.process,de=ce.Deno,pe=le&&le.versions||de&&de.version,fe=pe&&pe.v8;fe&&(U=(M=fe.split("."))[0]>0&&M[0]<4?1:+(M[0]+M[1])),!U&&ue&&(!(M=ue.match(/Edge\/(\d+)/))||M[1]>=74)&&(M=ue.match(/Chrome\/(\d+)/))&&(U=+M[1]);var he=U,me=he,ve=n,ye=p.String,ge=!!Object.getOwnPropertySymbols&&!ve((function(){var e=Symbol("symbol detection");return!ye(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&me&&me<41})),be=ge&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ce=ie,Se=E,Te=l,_e=Object,we=be?function(e){return"symbol"==typeof e}:function(e){var t=Ce("Symbol");return Se(t)&&Te(t.prototype,_e(e))},Re=String,Ee=function(e){try{return Re(e)}catch(e){return"Object"}},Pe=E,ke=Ee,Ae=TypeError,Ie=function(e){if(Pe(e))return e;throw new Ae(ke(e)+" is not a function")},Le=Ie,xe=Z,De=function(e,t){var r=e[t];return xe(r)?void 0:Le(r)},Oe=L,Ne=E,Me=q,Ue=TypeError,Ve={exports:{}},Fe=p,je=Object.defineProperty,Be=p,We=function(e,t){try{je(Fe,e,{value:t,configurable:!0,writable:!0})}catch(r){Fe[e]=t}return t},Ge="__core-js_shared__",Ze=Ve.exports=Be[Ge]||We(Ge,{});(Ze.versions||(Ze.versions=[])).push({version:"3.45.1",mode:"pure",copyright:"漏 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ye=Ve.exports,Xe=function(e,t){return Ye[e]||(Ye[e]=t||{})},He=H,Ke=Object,Je=function(e){return Ke(He(e))},Qe=Je,ze=u({}.hasOwnProperty),qe=Object.hasOwn||function(e,t){return ze(Qe(e),t)},$e=u,et=0,tt=Math.random(),rt=$e(1.1.toString),nt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+rt(++et+tt,36)},it=Xe,ot=qe,at=nt,st=ge,ct=be,ut=p.Symbol,lt=it("wks"),dt=ct?ut.for||ut:ut&&ut.withoutSetter||at,pt=function(e){return ot(lt,e)||(lt[e]=st&&ot(ut,e)?ut[e]:dt("Symbol."+e)),lt[e]},ft=L,ht=q,mt=we,vt=De,yt=function(e,t){var r,n;if("string"===t&&Ne(r=e.toString)&&!Me(n=Oe(r,e)))return n;if(Ne(r=e.valueOf)&&!Me(n=Oe(r,e)))return n;if("string"!==t&&Ne(r=e.toString)&&!Me(n=Oe(r,e)))return n;throw new Ue("Can't convert object to primitive value")},gt=TypeError,bt=pt("toPrimitive"),Ct=function(e,t){if(!ht(e)||mt(e))return e;var r,n=vt(e,bt);if(n){if(void 0===t&&(t="default"),r=ft(n,e,t),!ht(r)||mt(r))return r;throw new gt("Can't convert object to primitive value")}return void 0===t&&(t="number"),yt(e,t)},St=Ct,Tt=we,_t=function(e){var t=St(e,"string");return Tt(t)?t:t+""},wt=q,Rt=p.document,Et=wt(Rt)&&wt(Rt.createElement),Pt=function(e){return Et?Rt.createElement(e):{}},kt=Pt,At=!k&&!n((function(){return 7!==Object.defineProperty(kt("div"),"a",{get:function(){return 7}}).a})),It=k,Lt=L,xt=x,Dt=V,Ot=Q,Nt=_t,Mt=qe,Ut=At,Vt=Object.getOwnPropertyDescriptor;P.f=It?Vt:function(e,t){if(e=Ot(e),t=Nt(t),Ut)try{return Vt(e,t)}catch(e){}if(Mt(e,t))return Dt(!Lt(xt.f,e,t),e[t])};var Ft=n,jt=E,Bt=/#|\.prototype\./,Wt=function(e,t){var r=Zt[Gt(e)];return r===Xt||r!==Yt&&(jt(t)?Ft(t):!!t)},Gt=Wt.normalize=function(e){return String(e).replace(Bt,".").toLowerCase()},Zt=Wt.data={},Yt=Wt.NATIVE="N",Xt=Wt.POLYFILL="P",Ht=Wt,Kt=Ie,Jt=i,Qt=w(w.bind),zt=function(e,t){return Kt(e),void 0===t?e:Jt?Qt(e,t):function(){return e.apply(t,arguments)}},qt={},$t=k&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),er=q,tr=String,rr=TypeError,nr=function(e){if(er(e))return e;throw new rr(tr(e)+" is not an object")},ir=k,or=At,ar=$t,sr=nr,cr=_t,ur=TypeError,lr=Object.defineProperty,dr=Object.getOwnPropertyDescriptor,pr="enumerable",fr="configurable",hr="writable";qt.f=ir?ar?function(e,t,r){if(sr(e),t=cr(t),sr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&hr in r&&!r.writable){var n=dr(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:fr in r?r.configurable:n.configurable,enumerable:pr in r?r.enumerable:n.enumerable,writable:!1})}return lr(e,t,r)}:lr:function(e,t,r){if(sr(e),t=cr(t),sr(r),or)try{return lr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new ur("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var mr=qt,vr=V,yr=k?function(e,t,r){return mr.f(e,t,vr(1,r))}:function(e,t,r){return e[t]=r,e},gr=p,br=y,Cr=w,Sr=E,Tr=P.f,_r=Ht,wr=$,Rr=zt,Er=yr,Pr=qe,kr=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return br(e,this,arguments)};return t.prototype=e.prototype,t},Ar=function(e,t){var r,n,i,o,a,s,c,u,l,d=e.target,p=e.global,f=e.stat,h=e.proto,m=p?gr:f?gr[d]:gr[d]&&gr[d].prototype,v=p?wr:wr[d]||Er(wr,d,{})[d],y=v.prototype;for(o in t)n=!(r=_r(p?o:d+(f?".":"#")+o,e.forced))&&m&&Pr(m,o),s=v[o],n&&(c=e.dontCallGetSet?(l=Tr(m,o))&&l.value:m[o]),a=n&&c?c:t[o],(r||h||typeof s!=typeof a)&&(u=e.bind&&n?Rr(a,gr):e.wrap&&n?kr(a):h&&Sr(a)?Cr(a):a,(e.sham||a&&a.sham||s&&s.sham)&&Er(u,"sham",!0),Er(v,o,u),h&&(Pr(wr,i=d+"Prototype")||Er(wr,i,{}),Er(wr[i],o,a),e.real&&y&&(r||!y[o])&&Er(y,o,a)))},Ir=u([].slice),Lr=u,xr=Ie,Dr=q,Or=qe,Nr=Ir,Mr=i,Ur=Function,Vr=Lr([].concat),Fr=Lr([].join),jr={},Br=function(e,t,r){if(!Or(jr,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";jr[t]=Ur("C,a","return new C("+Fr(n,",")+")")}return jr[t](e,r)},Wr=Mr?Ur.bind:function(e){var t=xr(this),r=t.prototype,n=Nr(arguments,1),i=function(){var r=Vr(n,Nr(arguments));return this instanceof i?Br(t,r.length,r):t.apply(e,r)};return Dr(r)&&(i.prototype=r),i},Gr=Wr;Ar({target:"Function",proto:!0,forced:Function.bind!==Gr},{bind:Gr});var Zr=p,Yr=$,Xr=function(e,t){var r=Yr[e+"Prototype"],n=r&&r[t];if(n)return n;var i=Zr[e],o=i&&i.prototype;return o&&o[t]},Hr=Xr("Function","bind"),Kr=l,Jr=Hr,Qr=Function.prototype,zr=function(e){var t=e.bind;return e===Qr||Kr(Qr,e)&&t===Qr.bind?Jr:t},qr=S,$r=Array.isArray||function(e){return"Array"===qr(e)},en=Math.ceil,tn=Math.floor,rn=Math.trunc||function(e){var t=+e;return(t>0?tn:en)(t)},nn=function(e){var t=+e;return t!=t||0===t?0:rn(t)},on=nn,an=Math.min,sn=function(e){var t=on(e);return t>0?an(t,9007199254740991):0},cn=sn,un=function(e){return cn(e.length)},ln=TypeError,dn=function(e){if(e>9007199254740991)throw ln("Maximum allowed index exceeded");return e},pn=k,fn=qt,hn=V,mn=function(e,t,r){pn?fn.f(e,t,hn(0,r)):e[t]=r},vn={};vn[pt("toStringTag")]="z";var yn="[object z]"===String(vn),gn=yn,bn=E,Cn=S,Sn=pt("toStringTag"),Tn=Object,_n="Arguments"===Cn(function(){return arguments}()),wn=gn?Cn:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Tn(e),Sn))?r:_n?Cn(t):"Object"===(n=Cn(t))&&bn(t.callee)?"Arguments":n},Rn=u,En=E,Pn=Ve.exports,kn=Rn(Function.toString);En(Pn.inspectSource)||(Pn.inspectSource=function(e){return kn(e)});var An=Pn.inspectSource,In=u,Ln=n,xn=E,Dn=wn,On=An,Nn=function(){},Mn=ie("Reflect","construct"),Un=/^\s*(?:class|function)\b/,Vn=In(Un.exec),Fn=!Un.test(Nn),jn=function(e){if(!xn(e))return!1;try{return Mn(Nn,[],e),!0}catch(e){return!1}},Bn=function(e){if(!xn(e))return!1;switch(Dn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Fn||!!Vn(Un,On(e))}catch(e){return!0}};Bn.sham=!0;var Wn=!Mn||Ln((function(){var e;return jn(jn.call)||!jn(Object)||!jn((function(){e=!0}))||e}))?Bn:jn,Gn=$r,Zn=Wn,Yn=q,Xn=pt("species"),Hn=Array,Kn=function(e){var t;return Gn(e)&&(t=e.constructor,(Zn(t)&&(t===Hn||Gn(t.prototype))||Yn(t)&&null===(t=t[Xn]))&&(t=void 0)),void 0===t?Hn:t},Jn=function(e,t){return new(Kn(e))(0===t?0:t)},Qn=n,zn=he,qn=pt("species"),$n=function(e){return zn>=51||!Qn((function(){var t=[];return(t.constructor={})[qn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},ei=Ar,ti=n,ri=$r,ni=q,ii=Je,oi=un,ai=dn,si=mn,ci=Jn,ui=$n,li=he,di=pt("isConcatSpreadable"),pi=li>=51||!ti((function(){var e=[];return e[di]=!1,e.concat()[0]!==e})),fi=function(e){if(!ni(e))return!1;var t=e[di];return void 0!==t?!!t:ri(e)};ei({target:"Array",proto:!0,arity:1,forced:!pi||!ui("concat")},{concat:function(e){var t,r,n,i,o,a=ii(this),s=ci(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(fi(o=-1===t?a:arguments[t]))for(i=oi(o),ai(c+i),r=0;r<i;r++,c++)r in o&&si(s,c,o[r]);else ai(c+1),si(s,c++,o);return s.length=c,s}});var hi=Xr("Array","concat"),mi=l,vi=hi,yi=Array.prototype,gi=function(e){var t=e.concat;return e===yi||mi(yi,e)&&t===yi.concat?vi:t},bi=nn,Ci=Math.max,Si=Math.min,Ti=function(e,t){var r=bi(e);return r<0?Ci(r+t,0):Si(r,t)},_i=Q,wi=Ti,Ri=un,Ei=function(e){return function(t,r,n){var i=_i(t),o=Ri(i);if(0===o)return!e&&-1;var a,s=wi(n,o);if(e&&r!=r){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},Pi={includes:Ei(!0),indexOf:Ei(!1)},ki=Pi.includes;Ar({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(e){return ki(this,e,arguments.length>1?arguments[1]:void 0)}});var Ai=Xr("Array","includes"),Ii=q,Li=S,xi=pt("match"),Di=function(e){var t;return Ii(e)&&(void 0!==(t=e[xi])?!!t:"RegExp"===Li(e))},Oi=TypeError,Ni=function(e){if(Di(e))throw new Oi("The method doesn't accept regular expressions");return e},Mi=wn,Ui=String,Vi=function(e){if("Symbol"===Mi(e))throw new TypeError("Cannot convert a Symbol value to a string");return Ui(e)},Fi=pt("match"),ji=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[Fi]=!1,"/./"[e](t)}catch(e){}}return!1},Bi=Ar,Wi=Ni,Gi=H,Zi=Vi,Yi=ji,Xi=u("".indexOf);Bi({target:"String",proto:!0,forced:!Yi("includes")},{includes:function(e){return!!~Xi(Zi(Gi(this)),Zi(Wi(e)),arguments.length>1?arguments[1]:void 0)}});var Hi=Xr("String","includes"),Ki=l,Ji=Ai,Qi=Hi,zi=Array.prototype,qi=String.prototype,$i=function(e){var t=e.includes;return e===zi||Ki(zi,e)&&t===zi.includes?Ji:"string"==typeof e||e===qi||Ki(qi,e)&&t===qi.includes?Qi:t},eo=zt,to=G,ro=Je,no=un,io=Jn,oo=u([].push),ao=function(e){var t=1===e,r=2===e,n=3===e,i=4===e,o=6===e,a=7===e,s=5===e||o;return function(c,u,l,d){for(var p,f,h=ro(c),m=to(h),v=no(m),y=eo(u,l),g=0,b=d||io,C=t?b(c,v):r||a?b(c,0):void 0;v>g;g++)if((s||g in m)&&(f=y(p=m[g],g,h),e))if(t)C[g]=f;else if(f)switch(e){case 3:return!0;case 5:return p;case 6:return g;case 2:oo(C,p)}else switch(e){case 4:return!1;case 7:oo(C,p)}return o?-1:n||i?i:C}},so={forEach:ao(0),map:ao(1),filter:ao(2),some:ao(3),every:ao(4),find:ao(5),findIndex:ao(6),filterReject:ao(7)},co=n,uo=function(e,t){var r=[][e];return!!r&&co((function(){r.call(null,t||function(){return 1},1)}))},lo=so.forEach,po=uo("forEach")?[].forEach:function(e){return lo(this,e,arguments.length>1?arguments[1]:void 0)};Ar({target:"Array",proto:!0,forced:[].forEach!==po},{forEach:po});var fo=Xr("Array","forEach"),ho=wn,mo=qe,vo=l,yo=fo,go=Array.prototype,bo={DOMTokenList:!0,NodeList:!0},Co=function(e){var t=e.forEach;return e===go||vo(go,e)&&t===go.forEach||mo(bo,ho(e))?yo:t},So=p,To=se,_o=S,wo=function(e){return To.slice(0,e.length)===e},Ro=wo("Bun/")?"BUN":wo("Cloudflare-Workers")?"CLOUDFLARE":wo("Deno/")?"DENO":wo("Node.js/")?"NODE":So.Bun&&"string"==typeof Bun.version?"BUN":So.Deno&&"object"==typeof Deno.version?"DENO":"process"===_o(So.process)?"NODE":So.window&&So.document?"BROWSER":"REST",Eo=TypeError,Po=function(e,t){if(e<t)throw new Eo("Not enough arguments");return e},ko=p,Ao=y,Io=E,Lo=Ro,xo=se,Do=Ir,Oo=Po,No=ko.Function,Mo=/MSIE .\./.test(xo)||"BUN"===Lo&&function(){var e=ko.Bun.version.split(".");return e.length<3||"0"===e[0]&&(e[1]<3||"3"===e[1]&&"0"===e[2])}(),Uo=function(e,t){var r=t?2:1;return Mo?function(n,i){var o=Oo(arguments.length,1)>r,a=Io(n)?n:No(n),s=o?Do(arguments,r):[],c=o?function(){Ao(a,this,s)}:a;return t?e(c,i):e(c)}:e},Vo=Ar,Fo=p,jo=Uo(Fo.setInterval,!0);Vo({global:!0,bind:!0,forced:Fo.setInterval!==jo},{setInterval:jo});var Bo=Ar,Wo=p,Go=Uo(Wo.setTimeout,!0);Bo({global:!0,bind:!0,forced:Wo.setTimeout!==Go},{setTimeout:Go});var Zo=$.setInterval,Yo=$.setTimeout,Xo=Ar,Ho=Pi.indexOf,Ko=uo,Jo=w([].indexOf),Qo=!!Jo&&1/Jo([1],1,-0)<0;Xo({target:"Array",proto:!0,forced:Qo||!Ko("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Qo?Jo(this,e,t)||0:Ho(this,e,t)}});var zo=Xr("Array","indexOf"),qo=l,$o=zo,ea=Array.prototype,ta=function(e){var t=e.indexOf;return e===ea||qo(ea,e)&&t===ea.indexOf?$o:t},ra=Ar,na=sn,ia=Vi,oa=Ni,aa=H,sa=ji,ca=w("".slice),ua=Math.min;ra({target:"String",proto:!0,forced:!sa("startsWith")},{startsWith:function(e){var t=ia(aa(this));oa(e);var r=na(ua(arguments.length>1?arguments[1]:void 0,t.length)),n=ia(e);return ca(t,r,r+n.length)===n}});var la=Xr("String","startsWith"),da=l,pa=la,fa=String.prototype,ha=function(e){var t=e.startsWith;return"string"==typeof e||e===fa||da(fa,e)&&t===fa.startsWith?pa:t},ma=so.filter;Ar({target:"Array",proto:!0,forced:!$n("filter")},{filter:function(e){return ma(this,e,arguments.length>1?arguments[1]:void 0)}});var va=Xr("Array","filter"),ya=l,ga=va,ba=Array.prototype,Ca=function(e){var t=e.filter;return e===ba||ya(ba,e)&&t===ba.filter?ga:t},Sa=function(e,t){return Sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Sa(e,t)};function Ta(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Sa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var _a=function(){return _a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_a.apply(this,arguments)};function wa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function Ra(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function Ea(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function Pa(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.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.")}function ka(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function Aa(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}let Ia=!0,La=!0;function xa(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseFloat(n[r],10)}function Da(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(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),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),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 Oa(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ia=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Na(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(La=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Ma(){if("object"==typeof window){if(Ia)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function Ua(e,t){La&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Va(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fa(e){return Va(e)?Object.keys(e).reduce((function(t,r){const n=Va(e[r]),i=n?Fa(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function ja(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?ja(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{ja(e,e.get(t),r)}))})))}function Ba(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&ja(e,r,i)}))})),i}const Wa=Ma;function Ga(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=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[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=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 a=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||a)){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 r.mediaDevices.enumerateDevices().then((r=>{let a=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&r.length&&t.includes("back")&&(a=r[r.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=n(e.video),Wa("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return Wa("chrome: "+JSON.stringify(e)),i(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(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(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=>Promise.reject(o(e))))))}}}function Za(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Ya(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",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Da(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Xa(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 r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};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 r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.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 Ha(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 r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Ba(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}),Da(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Ba(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,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Ka(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,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=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();r.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 i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function Ja(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Ka(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.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 r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}function a(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.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,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((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 i=this.getSenders().find((e=>e.track===t));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),s.apply(this,arguments)):s.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((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Qa(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function za(e,t){Da(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}var qa=Object.freeze({__proto__:null,shimMediaStream:Za,shimOnTrack:Ya,shimGetSendersWithDtmf:Xa,shimSenderReceiverGetStats:Ha,shimAddTrackRemoveTrackWithNative:Ka,shimAddTrackRemoveTrack:Ja,shimPeerConnection:Qa,fixNegotiationNeeded:za,shimGetUserMedia:Ga});function $a(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){Ua("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function es(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 ts(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 r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={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,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function rs(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 r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ns(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}),Da(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function is(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){Ua("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function os(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function as(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const r=e.length>0;r&&e.forEach((e=>{if("rid"in e){if(!/^[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(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function ss(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 cs(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?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function us(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?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var ls=Object.freeze({__proto__:null,shimOnTrack:es,shimPeerConnection:ts,shimSenderGetStats:rs,shimReceiverGetStats:ns,shimRemoveStream:is,shimRTCDataChannel:os,shimAddTransceiver:as,shimGetParameters:ss,shimCreateOffer:cs,shimCreateAnswer:us,shimGetUserMedia:$a,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}});function ds(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((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.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 r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function ps(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 r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function fs(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=s,s=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=s,s=function(e,t,r){const n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=s}function hs(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r(ms(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function ms(e){return e&&void 0!==e.video?Object.assign({},e,{video:Fa(e.video)}):e}function vs(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];void 0===n.urls&&n.url?(Ua("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function ys(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 gs(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",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function bs(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Cs=Object.freeze({__proto__:null,shimLocalStreamsAPI:ds,shimRemoteStreamsAPI:ps,shimCallbacksAPI:fs,shimGetUserMedia:hs,shimConstraints:ms,shimRTCIceServerUrls:vs,shimTrackEventTransceiver:ys,shimCreateOfferLegacy:gs,shimAudioContext:bs}),Ss={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&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.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(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;const t=e.substring(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,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],a=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){const n=t.parseRtpMap(a),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>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",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[0].ssrc;let c;const u=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));u.length>0&&u[0].length>1&&u[0][0]===s&&(c=u[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&s&&r.push({ssrc:s});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=l}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="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&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(Ss);var Ts=Ss.exports,_s=e({__proto__:null,default:Ts},[Ss.exports]);function ws(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.substring(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Ts.parseCandidate(e.candidate);for(const e in n)e in r||Object.defineProperty(r,e,{value:n[e]});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,Da(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Rs(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||Da(e,"icecandidate",(e=>{if(e.candidate){const t=Ts.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Es(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 r=function(e){if(!e||!e.sdp)return!1;const t=Ts.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Ts.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 r=parseInt(t[1],10);return r!=r?-1:r},i=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r},o=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Ts.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n},a=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(r(arguments[0])){const e=n(arguments[0]),t=i(e),r=o(arguments[0],e);let a;a=0===t&&0===r?Number.POSITIVE_INFINITY:0===t||0===r?Math.max(t,r):Math.min(t,r);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>a}),this._sctp=s}return a.apply(this,arguments)}}function Ps(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},Da(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function ks(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 r=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 r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function As(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t._safariVersion>=13.1)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function Is(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.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?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ls(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return r.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>r.apply(this,[e])))})}var xs=Object.freeze({__proto__:null,shimRTCIceCandidate:ws,shimRTCIceCandidateRelayProtocol:Rs,shimMaxMessageSize:Es,shimSendThrowTypeError:Ps,shimConnectionState:ks,removeExtmapAllowMixed:As,shimAddIceCandidateNullOrEmpty:Is,shimParameterlessSetLocalDescription:Ls});const Ds=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=Ma,n=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.userAgentData&&r.userAgentData.brands){const e=r.userAgentData.brands.find((e=>"Chromium"===e.brand));if(e)return{browser:"chrome",version:parseInt(e.version,10)}}if(r.mozGetUserMedia)t.browser="firefox",t.version=parseInt(xa(r.userAgent,/Firefox\/(\d+)\./,1));else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=parseInt(xa(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=parseInt(xa(r.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype,t._safariVersion=xa(r.userAgent,/Version\/(\d+(\.?\d+))/,1)}return t}(e),i={browserDetails:n,commonShim:xs,extractVersion:xa,disableLog:Oa,disableWarnings:Na,sdp:_s};switch(n.browser){case"chrome":if(!qa||!Qa||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(null===n.version)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=qa,Is(e,n),Ls(e),Ga(e,n),Za(e),Qa(e,n),Ya(e),Ja(e,n),Xa(e),Ha(e),za(e,n),ws(e),Rs(e),ks(e),Es(e,n),Ps(e),As(e,n);break;case"firefox":if(!ls||!ts||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=ls,Is(e,n),Ls(e),$a(e,n),ts(e,n),es(e),is(e),rs(e),ns(e),os(e),as(e),ss(e),cs(e),us(e),ws(e),ks(e),Es(e,n),Ps(e);break;case"safari":if(!Cs||!t.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=Cs,Is(e,n),Ls(e),vs(e),gs(e),fs(e),ds(e),ps(e),ys(e),hs(e),bs(e),ws(e),Rs(e),Es(e,n),Ps(e),As(e,n);break;default:r("Unsupported browser!")}return i}({window:"undefined"==typeof window?void 0:window});let Os=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t};var Ns={exports:{}};!function(e,t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),a=Math.max(i,o),s=0,c=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===s)return 0;a-=1}else if(c[0][a]<c[1][a])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var s=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)s();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv",bot:"bot"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(r=null)&&a(t.prototype,r),n&&a(t,n),e}();t.default=s,e.exports=t.default},91:function(e,t,r){t.__esModule=!0,t.default=void 0;var n=c(r(92)),i=c(r(93)),o=c(r(94)),a=c(r(95)),s=c(r(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},o=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(i[t]=a,o+=1):"object"==typeof a&&(r[t]=a,n+=1)})),n>0){var a=Object.keys(r),c=s.default.find(a,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(r[c]);if(void 0!==u)return u}var l=s.default.find(a,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(r[l]);if(void 0!==d)return d}}if(o>0){var p=Object.keys(i),f=s.default.find(p,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(s.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:[/googlebot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=i.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),r={type:o.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(r.model=t),r}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})}(Ns);var Ms=r(Ns.exports),Us={},Vs={},Fs=qe,js=Q,Bs=Pi.indexOf,Ws=Vs,Gs=u([].push),Zs=function(e,t){var r,n=js(e),i=0,o=[];for(r in n)!Fs(Ws,r)&&Fs(n,r)&&Gs(o,r);for(;t.length>i;)Fs(n,r=t[i++])&&(~Bs(o,r)||Gs(o,r));return o},Ys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xs=Zs,Hs=Ys,Ks=Object.keys||function(e){return Xs(e,Hs)},Js=k,Qs=$t,zs=qt,qs=nr,$s=Q,ec=Ks;Us.f=Js&&!Qs?Object.defineProperties:function(e,t){qs(e);for(var r,n=$s(t),i=ec(t),o=i.length,a=0;o>a;)zs.f(e,r=i[a++],n[r]);return e};var tc,rc=ie("document","documentElement"),nc=nt,ic=Xe("keys"),oc=function(e){return ic[e]||(ic[e]=nc(e))},ac=nr,sc=Us,cc=Ys,uc=Vs,lc=rc,dc=Pt,pc=oc("IE_PROTO"),fc=function(){},hc=function(e){return"<script>"+e+"</"+"script>"},mc=function(e){e.write(hc("")),e.close();var t=e.parentWindow.Object;return e=null,t},vc=function(){try{tc=new ActiveXObject("htmlfile")}catch(e){}var e,t;vc="undefined"!=typeof document?document.domain&&tc?mc(tc):((t=dc("iframe")).style.display="none",lc.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(hc("document.F=Object")),e.close(),e.F):mc(tc);for(var r=cc.length;r--;)delete vc.prototype[cc[r]];return vc()};uc[pc]=!0;var yc=Object.create||function(e,t){var r;return null!==e?(fc.prototype=ac(e),r=new fc,fc.prototype=null,r[pc]=e):r=vc(),void 0===t?r:sc.f(r,t)},gc={},bc=Zs,Cc=Ys.concat("length","prototype");gc.f=Object.getOwnPropertyNames||function(e){return bc(e,Cc)};var Sc={},Tc=S,_c=Q,wc=gc.f,Rc=Ir,Ec="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Sc.f=function(e){return Ec&&"Window"===Tc(e)?function(e){try{return wc(e)}catch(e){return Rc(Ec)}}(e):wc(_c(e))};var Pc={};Pc.f=Object.getOwnPropertySymbols;var kc=yr,Ac=function(e,t,r,n){return n&&n.enumerable?e[t]=r:kc(e,t,r),e},Ic=qt,Lc=function(e,t,r){return Ic.f(e,t,r)},xc={},Dc=pt;xc.f=Dc;var Oc,Nc,Mc,Uc=$,Vc=qe,Fc=xc,jc=qt.f,Bc=function(e){var t=Uc.Symbol||(Uc.Symbol={});Vc(t,e)||jc(t,e,{value:Fc.f(e)})},Wc=L,Gc=ie,Zc=pt,Yc=Ac,Xc=function(){var e=Gc("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=Zc("toPrimitive");t&&!t[n]&&Yc(t,n,(function(e){return Wc(r,this)}),{arity:1})},Hc=wn,Kc=yn?{}.toString:function(){return"[object "+Hc(this)+"]"},Jc=yn,Qc=qt.f,zc=yr,qc=qe,$c=Kc,eu=pt("toStringTag"),tu=function(e,t,r,n){var i=r?e:e&&e.prototype;i&&(qc(i,eu)||Qc(i,eu,{configurable:!0,value:t}),n&&!Jc&&zc(i,"toString",$c))},ru=E,nu=p.WeakMap,iu=ru(nu)&&/native code/.test(String(nu)),ou=p,au=q,su=yr,cu=qe,uu=Ve.exports,lu=oc,du=Vs,pu="Object already initialized",fu=ou.TypeError,hu=ou.WeakMap;if(iu||uu.state){var mu=uu.state||(uu.state=new hu);mu.get=mu.get,mu.has=mu.has,mu.set=mu.set,Oc=function(e,t){if(mu.has(e))throw new fu(pu);return t.facade=e,mu.set(e,t),t},Nc=function(e){return mu.get(e)||{}},Mc=function(e){return mu.has(e)}}else{var vu=lu("state");du[vu]=!0,Oc=function(e,t){if(cu(e,vu))throw new fu(pu);return t.facade=e,su(e,vu,t),t},Nc=function(e){return cu(e,vu)?e[vu]:{}},Mc=function(e){return cu(e,vu)}}var yu={set:Oc,get:Nc,has:Mc,enforce:function(e){return Mc(e)?Nc(e):Oc(e,{})},getterFor:function(e){return function(t){var r;if(!au(t)||(r=Nc(t)).type!==e)throw new fu("Incompatible receiver, "+e+" required");return r}}},gu=Ar,bu=p,Cu=L,Su=u,Tu=k,_u=ge,wu=n,Ru=qe,Eu=l,Pu=nr,ku=Q,Au=_t,Iu=Vi,Lu=V,xu=yc,Du=Ks,Ou=gc,Nu=Sc,Mu=Pc,Uu=P,Vu=qt,Fu=Us,ju=x,Bu=Ac,Wu=Lc,Gu=Xe,Zu=Vs,Yu=nt,Xu=pt,Hu=xc,Ku=Bc,Ju=Xc,Qu=tu,zu=yu,qu=so.forEach,$u=oc("hidden"),el="Symbol",tl=zu.set,rl=zu.getterFor(el),nl=Object.prototype,il=bu.Symbol,ol=il&&il.prototype,al=bu.RangeError,sl=bu.TypeError,cl=bu.QObject,ul=Uu.f,ll=Vu.f,dl=Nu.f,pl=ju.f,fl=Su([].push),hl=Gu("symbols"),ml=Gu("op-symbols"),vl=Gu("wks"),yl=!cl||!cl.prototype||!cl.prototype.findChild,gl=function(e,t,r){var n=ul(nl,t);n&&delete nl[t],ll(e,t,r),n&&e!==nl&&ll(nl,t,n)},bl=Tu&&wu((function(){return 7!==xu(ll({},"a",{get:function(){return ll(this,"a",{value:7}).a}})).a}))?gl:ll,Cl=function(e,t){var r=hl[e]=xu(ol);return tl(r,{type:el,tag:e,description:t}),Tu||(r.description=t),r},Sl=function(e,t,r){e===nl&&Sl(ml,t,r),Pu(e);var n=Au(t);return Pu(r),Ru(hl,n)?(r.enumerable?(Ru(e,$u)&&e[$u][n]&&(e[$u][n]=!1),r=xu(r,{enumerable:Lu(0,!1)})):(Ru(e,$u)||ll(e,$u,Lu(1,xu(null))),e[$u][n]=!0),bl(e,n,r)):ll(e,n,r)},Tl=function(e,t){Pu(e);var r=ku(t),n=Du(r).concat(El(r));return qu(n,(function(t){Tu&&!Cu(_l,r,t)||Sl(e,t,r[t])})),e},_l=function(e){var t=Au(e),r=Cu(pl,this,t);return!(this===nl&&Ru(hl,t)&&!Ru(ml,t))&&(!(r||!Ru(this,t)||!Ru(hl,t)||Ru(this,$u)&&this[$u][t])||r)},wl=function(e,t){var r=ku(e),n=Au(t);if(r!==nl||!Ru(hl,n)||Ru(ml,n)){var i=ul(r,n);return!i||!Ru(hl,n)||Ru(r,$u)&&r[$u][n]||(i.enumerable=!0),i}},Rl=function(e){var t=dl(ku(e)),r=[];return qu(t,(function(e){Ru(hl,e)||Ru(Zu,e)||fl(r,e)})),r},El=function(e){var t=e===nl,r=dl(t?ml:ku(e)),n=[];return qu(r,(function(e){!Ru(hl,e)||t&&!Ru(nl,e)||fl(n,hl[e])})),n};_u||(il=function(){if(Eu(ol,this))throw new sl("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Iu(arguments[0]):void 0,t=Yu(e),r=function(e){var n=void 0===this?bu:this;n===nl&&Cu(r,ml,e),Ru(n,$u)&&Ru(n[$u],t)&&(n[$u][t]=!1);var i=Lu(1,e);try{bl(n,t,i)}catch(e){if(!(e instanceof al))throw e;gl(n,t,i)}};return Tu&&yl&&bl(nl,t,{configurable:!0,set:r}),Cl(t,e)},Bu(ol=il.prototype,"toString",(function(){return rl(this).tag})),Bu(il,"withoutSetter",(function(e){return Cl(Yu(e),e)})),ju.f=_l,Vu.f=Sl,Fu.f=Tl,Uu.f=wl,Ou.f=Nu.f=Rl,Mu.f=El,Hu.f=function(e){return Cl(Xu(e),e)},Tu&&Wu(ol,"description",{configurable:!0,get:function(){return rl(this).description}})),gu({global:!0,constructor:!0,wrap:!0,forced:!_u,sham:!_u},{Symbol:il}),qu(Du(vl),(function(e){Ku(e)})),gu({target:el,stat:!0,forced:!_u},{useSetter:function(){yl=!0},useSimple:function(){yl=!1}}),gu({target:"Object",stat:!0,forced:!_u,sham:!Tu},{create:function(e,t){return void 0===t?xu(e):Tl(xu(e),t)},defineProperty:Sl,defineProperties:Tl,getOwnPropertyDescriptor:wl}),gu({target:"Object",stat:!0,forced:!_u},{getOwnPropertyNames:Rl}),Ju(),Qu(il,el),Zu[$u]=!0;var Pl=ge&&!!Symbol.for&&!!Symbol.keyFor,kl=Ar,Al=ie,Il=qe,Ll=Vi,xl=Xe,Dl=Pl,Ol=xl("string-to-symbol-registry"),Nl=xl("symbol-to-string-registry");kl({target:"Symbol",stat:!0,forced:!Dl},{for:function(e){var t=Ll(e);if(Il(Ol,t))return Ol[t];var r=Al("Symbol")(t);return Ol[t]=r,Nl[r]=t,r}});var Ml=Ar,Ul=qe,Vl=we,Fl=Ee,jl=Pl,Bl=Xe("symbol-to-string-registry");Ml({target:"Symbol",stat:!0,forced:!jl},{keyFor:function(e){if(!Vl(e))throw new TypeError(Fl(e)+" is not a symbol");if(Ul(Bl,e))return Bl[e]}});var Wl=$r,Gl=E,Zl=S,Yl=Vi,Xl=u([].push),Hl=Ar,Kl=ie,Jl=y,Ql=L,zl=u,ql=n,$l=E,ed=we,td=Ir,rd=function(e){if(Gl(e))return e;if(Wl(e)){for(var t=e.length,r=[],n=0;n<t;n++){var i=e[n];"string"==typeof i?Xl(r,i):"number"!=typeof i&&"Number"!==Zl(i)&&"String"!==Zl(i)||Xl(r,Yl(i))}var o=r.length,a=!0;return function(e,t){if(a)return a=!1,t;if(Wl(this))return t;for(var n=0;n<o;n++)if(r[n]===e)return t}}},nd=ge,id=String,od=Kl("JSON","stringify"),ad=zl(/./.exec),sd=zl("".charAt),cd=zl("".charCodeAt),ud=zl("".replace),ld=zl(1.1.toString),dd=/[\uD800-\uDFFF]/g,pd=/^[\uD800-\uDBFF]$/,fd=/^[\uDC00-\uDFFF]$/,hd=!nd||ql((function(){var e=Kl("Symbol")("stringify detection");return"[null]"!==od([e])||"{}"!==od({a:e})||"{}"!==od(Object(e))})),md=ql((function(){return'"\\udf06\\ud834"'!==od("\udf06\ud834")||'"\\udead"'!==od("\udead")})),vd=function(e,t){var r=td(arguments),n=rd(t);if($l(n)||void 0!==e&&!ed(e))return r[1]=function(e,t){if($l(n)&&(t=Ql(n,this,id(e),t)),!ed(t))return t},Jl(od,null,r)},yd=function(e,t,r){var n=sd(r,t-1),i=sd(r,t+1);return ad(pd,e)&&!ad(fd,i)||ad(fd,e)&&!ad(pd,n)?"\\u"+ld(cd(e,0),16):e};od&&Hl({target:"JSON",stat:!0,arity:3,forced:hd||md},{stringify:function(e,t,r){var n=td(arguments),i=Jl(hd?vd:od,null,n);return md&&"string"==typeof i?ud(i,dd,yd):i}});var gd=Pc,bd=Je;Ar({target:"Object",stat:!0,forced:!ge||n((function(){gd.f(1)}))},{getOwnPropertySymbols:function(e){var t=gd.f;return t?t(bd(e)):[]}}),Bc("asyncDispose"),Bc("asyncIterator"),Bc("dispose"),Bc("hasInstance"),Bc("isConcatSpreadable"),Bc("iterator"),Bc("match"),Bc("matchAll"),Bc("replace"),Bc("search"),Bc("species"),Bc("split");var Cd=Xc;Bc("toPrimitive"),Cd();var Sd=ie,Td=tu;Bc("toStringTag"),Td(Sd("Symbol"),"Symbol"),Bc("unscopables"),tu(p.JSON,"JSON",!0);var _d,wd,Rd,Ed=$.Symbol,Pd={},kd=k,Ad=qe,Id=Function.prototype,Ld=kd&&Object.getOwnPropertyDescriptor,xd=Ad(Id,"name"),Dd={EXISTS:xd,PROPER:xd&&"something"===function(){}.name,CONFIGURABLE:xd&&(!kd||kd&&Ld(Id,"name").configurable)},Od=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Nd=qe,Md=E,Ud=Je,Vd=Od,Fd=oc("IE_PROTO"),jd=Object,Bd=jd.prototype,Wd=Vd?jd.getPrototypeOf:function(e){var t=Ud(e);if(Nd(t,Fd))return t[Fd];var r=t.constructor;return Md(r)&&t instanceof r?r.prototype:t instanceof jd?Bd:null},Gd=n,Zd=E,Yd=q,Xd=yc,Hd=Wd,Kd=Ac,Jd=pt("iterator"),Qd=!1;[].keys&&("next"in(Rd=[].keys())?(wd=Hd(Hd(Rd)))!==Object.prototype&&(_d=wd):Qd=!0);var zd=!Yd(_d)||Gd((function(){var e={};return _d[Jd].call(e)!==e}));Zd((_d=zd?{}:Xd(_d))[Jd])||Kd(_d,Jd,(function(){return this}));var qd={IteratorPrototype:_d,BUGGY_SAFARI_ITERATORS:Qd},$d=qd.IteratorPrototype,ep=yc,tp=V,rp=tu,np=Pd,ip=function(){return this},op=u,ap=Ie,sp=q,cp=function(e){return sp(e)||null===e},up=String,lp=TypeError,dp=function(e,t,r){try{return op(ap(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},pp=q,fp=H,hp=function(e){if(cp(e))return e;throw new lp("Can't set "+up(e)+" as a prototype")},mp=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=dp(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return fp(r),hp(n),pp(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0),vp=Ar,yp=L,gp=Dd,bp=function(e,t,r,n){var i=t+" Iterator";return e.prototype=ep($d,{next:tp(+!n,r)}),rp(e,i,!1,!0),np[i]=ip,e},Cp=Wd,Sp=tu,Tp=Ac,_p=Pd,wp=qd,Rp=gp.PROPER,Ep=wp.BUGGY_SAFARI_ITERATORS,Pp=pt("iterator"),kp="keys",Ap="values",Ip="entries",Lp=function(){return this},xp=function(e,t,r,n,i,o,a){bp(r,t,n);var s,c,u,l=function(e){if(e===i&&m)return m;if(!Ep&&e&&e in f)return f[e];switch(e){case kp:case Ap:case Ip:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",p=!1,f=e.prototype,h=f[Pp]||f["@@iterator"]||i&&f[i],m=!Ep&&h||l(i),v="Array"===t&&f.entries||h;if(v&&(s=Cp(v.call(new e)))!==Object.prototype&&s.next&&(Sp(s,d,!0,!0),_p[d]=Lp),Rp&&i===Ap&&h&&h.name!==Ap&&(p=!0,m=function(){return yp(h,this)}),i)if(c={values:l(Ap),keys:o?m:l(kp),entries:l(Ip)},a)for(u in c)(Ep||p||!(u in f))&&Tp(f,u,c[u]);else vp({target:t,proto:!0,forced:Ep||p},c);return a&&f[Pp]!==m&&Tp(f,Pp,m,{name:i}),_p[t]=m,c},Dp=function(e,t){return{value:e,done:t}},Op=Q,Np=function(){},Mp=Pd,Up=yu;qt.f;var Vp=xp,Fp=Dp,jp="Array Iterator",Bp=Up.set,Wp=Up.getterFor(jp);Vp(Array,"Array",(function(e,t){Bp(this,{type:jp,target:Op(e),index:0,kind:t})}),(function(){var e=Wp(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Fp(void 0,!0);switch(e.kind){case"keys":return Fp(r,!1);case"values":return Fp(t[r],!1)}return Fp([r,t[r]],!1)}),"values"),Mp.Arguments=Mp.Array,Np(),Np(),Np();var Gp={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},Zp=p,Yp=tu,Xp=Pd;for(var Hp in Gp)Yp(Zp[Hp],Hp),Xp[Hp]=Xp.Array;var Kp=Ed,Jp=pt,Qp=qt.f,zp=Jp("metadata"),qp=Function.prototype;void 0===qp[zp]&&Qp(qp,zp,{value:null}),Bc("metadata");var $p=Kp,ef=u,tf=ie("Symbol"),rf=tf.keyFor,nf=ef(tf.prototype.valueOf),of=tf.isRegisteredSymbol||function(e){try{return void 0!==rf(nf(e))}catch(e){return!1}};Ar({target:"Symbol",stat:!0},{isRegisteredSymbol:of});for(var af=Xe,sf=ie,cf=u,uf=we,lf=pt,df=sf("Symbol"),pf=df.isWellKnownSymbol,ff=sf("Object","getOwnPropertyNames"),hf=cf(df.prototype.valueOf),mf=af("wks"),vf=0,yf=ff(df),gf=yf.length;vf<gf;vf++)try{var bf=yf[vf];uf(df[bf])&&lf(bf)}catch(e){}var Cf=function(e){if(pf&&pf(e))return!0;try{for(var t=hf(e),r=0,n=ff(mf),i=n.length;r<i;r++)if(mf[n[r]]==t)return!0}catch(e){}return!1};Ar({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Cf}),Bc("customMatcher"),Bc("observable"),Ar({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:of}),Ar({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:Cf}),Bc("matcher"),Bc("metadataKey"),Bc("patternMatch"),Bc("replaceAll");var Sf=$p,Tf=u,_f=nn,wf=Vi,Rf=H,Ef=Tf("".charAt),Pf=Tf("".charCodeAt),kf=Tf("".slice),Af=function(e){return function(t,r){var n,i,o=wf(Rf(t)),a=_f(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=Pf(o,a))<55296||n>56319||a+1===s||(i=Pf(o,a+1))<56320||i>57343?e?Ef(o,a):n:e?kf(o,a,a+2):i-56320+(n-55296<<10)+65536}},If={codeAt:Af(!1),charAt:Af(!0)},Lf=If.charAt,xf=Vi,Df=yu,Of=xp,Nf=Dp,Mf="String Iterator",Uf=Df.set,Vf=Df.getterFor(Mf);Of(String,"String",(function(e){Uf(this,{type:Mf,string:xf(e),index:0})}),(function(){var e,t=Vf(this),r=t.string,n=t.index;return n>=r.length?Nf(void 0,!0):(e=Lf(r,n),t.index+=e.length,Nf(e,!1))}));var Ff=xc.f("iterator");function jf(e){return jf="function"==typeof Sf&&"symbol"==typeof Ff?function(e){return typeof e}:function(e){return e&&"function"==typeof Sf&&e.constructor===Sf&&e!==Sf.prototype?"symbol":typeof e},jf(e)}Ar({target:"Object",stat:!0,sham:!k},{create:yc});var Bf=$.Object,Wf=function(e,t){return Bf.create(e,t)},Gf=Ar,Zf=$r,Yf=Wn,Xf=q,Hf=Ti,Kf=un,Jf=Q,Qf=mn,zf=pt,qf=Ir,$f=$n("slice"),eh=zf("species"),th=Array,rh=Math.max;Gf({target:"Array",proto:!0,forced:!$f},{slice:function(e,t){var r,n,i,o=Jf(this),a=Kf(o),s=Hf(e,a),c=Hf(void 0===t?a:t,a);if(Zf(o)&&(r=o.constructor,(Yf(r)&&(r===th||Zf(r.prototype))||Xf(r)&&null===(r=r[eh]))&&(r=void 0),r===th||void 0===r))return qf(o,s,c);for(n=new(void 0===r?th:r)(rh(c-s,0)),i=0;s<c;s++,i++)s in o&&Qf(n,i,o[s]);return n.length=i,n}});var nh=Xr("Array","slice"),ih=l,oh=nh,ah=Array.prototype,sh=function(e){var t=e.slice;return e===ah||ih(ah,e)&&t===ah.slice?oh:t},ch=$.Object.getOwnPropertySymbols,uh={exports:{}},lh=Ar,dh=k,ph=qt.f;lh({target:"Object",stat:!0,forced:Object.defineProperty!==ph,sham:!dh},{defineProperty:ph});var fh=$.Object,hh=uh.exports=function(e,t,r){return fh.defineProperty(e,t,r)};fh.defineProperty.sham&&(hh.sham=!0);var mh=uh.exports,vh=Je,yh=Ks;Ar({target:"Object",stat:!0,forced:n((function(){yh(1)}))},{keys:function(e){return yh(vh(e))}});var gh=$.Object.keys,bh={exports:{}},Ch=Ar,Sh=n,Th=Q,_h=P.f,wh=k;Ch({target:"Object",stat:!0,forced:!wh||Sh((function(){_h(1)})),sham:!wh},{getOwnPropertyDescriptor:function(e,t){return _h(Th(e),t)}});var Rh=$.Object,Eh=bh.exports=function(e,t){return Rh.getOwnPropertyDescriptor(e,t)};Rh.getOwnPropertyDescriptor.sham&&(Eh.sham=!0);var Ph=bh.exports,kh=ie,Ah=gc,Ih=Pc,Lh=nr,xh=u([].concat),Dh=kh("Reflect","ownKeys")||function(e){var t=Ah.f(Lh(e)),r=Ih.f;return r?xh(t,r(e)):t},Oh=Dh,Nh=Q,Mh=P,Uh=mn;Ar({target:"Object",stat:!0,sham:!k},{getOwnPropertyDescriptors:function(e){for(var t,r,n=Nh(e),i=Mh.f,o=Oh(n),a={},s=0;o.length>s;)void 0!==(r=i(n,t=o[s++]))&&Uh(a,t,r);return a}});var Vh=$.Object.getOwnPropertyDescriptors,Fh={exports:{}},jh=Ar,Bh=k,Wh=Us.f;jh({target:"Object",stat:!0,forced:Object.defineProperties!==Wh,sham:!Bh},{defineProperties:Wh});var Gh=$.Object,Zh=Fh.exports=function(e,t){return Gh.defineProperties(e,t)};Gh.defineProperties.sham&&(Zh.sham=!0);var Yh=Fh.exports,Xh=xc.f("toPrimitive"),Hh=y,Kh=Q,Jh=nn,Qh=un,zh=uo,qh=Math.min,$h=[].lastIndexOf,em=!!$h&&1/[1].lastIndexOf(1,-0)<0,tm=zh("lastIndexOf"),rm=em||!tm?function(e){if(em)return Hh($h,this,arguments)||0;var t=Kh(this),r=Qh(t);if(0===r)return-1;var n=r-1;for(arguments.length>1&&(n=qh(n,Jh(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:$h;Ar({target:"Array",proto:!0,forced:rm!==[].lastIndexOf},{lastIndexOf:rm});var nm=Xr("Array","lastIndexOf"),im=l,om=nm,am=Array.prototype,sm=function(e){var t=e.lastIndexOf;return e===am||im(am,e)&&t===am.lastIndexOf?om:t},cm=k,um=u,lm=L,dm=n,pm=Ks,fm=Pc,hm=x,mm=Je,vm=G,ym=Object.assign,gm=Object.defineProperty,bm=um([].concat),Cm=!ym||dm((function(){if(cm&&1!==ym({b:1},ym(gm({},"a",{enumerable:!0,get:function(){gm(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!==ym({},e)[r]||pm(ym({},t)).join("")!==n}))?function(e,t){for(var r=mm(e),n=arguments.length,i=1,o=fm.f,a=hm.f;n>i;)for(var s,c=vm(arguments[i++]),u=o?bm(pm(c),o(c)):pm(c),l=u.length,d=0;l>d;)s=u[d++],cm&&!lm(a,c,s)||(r[s]=c[s]);return r}:ym,Sm=Cm;Ar({target:"Object",stat:!0,arity:2,forced:Object.assign!==Sm},{assign:Sm});var Tm=$.Object.assign,_m={exports:{}},wm=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Rm=n,Em=q,Pm=S,km=wm,Am=Object.isExtensible,Im=Rm((function(){Am(1)}))||km?function(e){return!!Em(e)&&((!km||"ArrayBuffer"!==Pm(e))&&(!Am||Am(e)))}:Am,Lm=!n((function(){return Object.isExtensible(Object.preventExtensions({}))})),xm=Ar,Dm=u,Om=Vs,Nm=q,Mm=qe,Um=qt.f,Vm=gc,Fm=Sc,jm=Im,Bm=Lm,Wm=!1,Gm=nt("meta"),Zm=0,Ym=function(e){Um(e,Gm,{value:{objectID:"O"+Zm++,weakData:{}}})},Xm=_m.exports={enable:function(){Xm.enable=function(){},Wm=!0;var e=Vm.f,t=Dm([].splice),r={};r[Gm]=1,e(r).length&&(Vm.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===Gm){t(n,i,1);break}return n},xm({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Fm.f}))},fastKey:function(e,t){if(!Nm(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Mm(e,Gm)){if(!jm(e))return"F";if(!t)return"E";Ym(e)}return e[Gm].objectID},getWeakData:function(e,t){if(!Mm(e,Gm)){if(!jm(e))return!0;if(!t)return!1;Ym(e)}return e[Gm].weakData},onFreeze:function(e){return Bm&&Wm&&jm(e)&&!Mm(e,Gm)&&Ym(e),e}};Om[Gm]=!0;var Hm=Pd,Km=pt("iterator"),Jm=Array.prototype,Qm=wn,zm=De,qm=Z,$m=Pd,ev=pt("iterator"),tv=function(e){if(!qm(e))return zm(e,ev)||zm(e,"@@iterator")||$m[Qm(e)]},rv=L,nv=Ie,iv=nr,ov=Ee,av=tv,sv=TypeError,cv=L,uv=nr,lv=De,dv=function(e,t,r){var n,i;uv(e);try{if(!(n=lv(e,"return"))){if("throw"===t)throw r;return r}n=cv(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return uv(n),r},pv=zt,fv=L,hv=nr,mv=Ee,vv=function(e){return void 0!==e&&(Hm.Array===e||Jm[Km]===e)},yv=un,gv=l,bv=function(e,t){var r=arguments.length<2?av(e):t;if(nv(r))return iv(rv(r,e));throw new sv(ov(e)+" is not iterable")},Cv=tv,Sv=dv,Tv=TypeError,_v=function(e,t){this.stopped=e,this.result=t},wv=_v.prototype,Rv=function(e,t,r){var n,i,o,a,s,c,u,l=r&&r.that,d=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),m=pv(t,l),v=function(e){return n&&Sv(n,"normal"),new _v(!0,e)},y=function(e){return d?(hv(e),h?m(e[0],e[1],v):m(e[0],e[1])):h?m(e,v):m(e)};if(p)n=e.iterator;else if(f)n=e;else{if(!(i=Cv(e)))throw new Tv(mv(e)+" is not iterable");if(vv(i)){for(o=0,a=yv(e);a>o;o++)if((s=y(e[o]))&&gv(wv,s))return s;return new _v(!1)}n=bv(e,i)}for(c=p?e.next:n.next;!(u=fv(c,n)).done;){try{s=y(u.value)}catch(e){Sv(n,"throw",e)}if("object"==typeof s&&s&&gv(wv,s))return s}return new _v(!1)},Ev=l,Pv=TypeError,kv=function(e,t){if(Ev(t,e))return e;throw new Pv("Incorrect invocation")},Av=Ar,Iv=p,Lv=_m.exports,xv=n,Dv=yr,Ov=Rv,Nv=kv,Mv=E,Uv=q,Vv=Z,Fv=tu,jv=qt.f,Bv=so.forEach,Wv=k,Gv=yu.set,Zv=yu.getterFor,Yv=function(e,t,r){var n,i=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),a=i?"set":"add",s=Iv[e],c=s&&s.prototype,u={};if(Wv&&Mv(s)&&(o||c.forEach&&!xv((function(){(new s).entries().next()})))){var l=(n=t((function(t,r){Gv(Nv(t,l),{type:e,collection:new s}),Vv(r)||Ov(r,t[a],{that:t,AS_ENTRIES:i})}))).prototype,d=Zv(e);Bv(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"===e||"set"===e;!(e in c)||o&&"clear"===e||Dv(l,e,(function(r,n){var i=d(this).collection;if(!t&&o&&!Uv(r))return"get"===e&&void 0;var a=i[e](0===r?0:r,n);return t?this:a}))})),o||jv(l,"size",{configurable:!0,get:function(){return d(this).collection.size}})}else n=r.getConstructor(t,e,i,a),Lv.enable();return Fv(n,e,!1,!0),u[e]=n,Av({global:!0,forced:!0},u),o||r.setStrong(n,e,i),n},Xv=Ac,Hv=ie,Kv=Lc,Jv=k,Qv=pt("species"),zv=function(e){var t=Hv(e);Jv&&t&&!t[Qv]&&Kv(t,Qv,{configurable:!0,get:function(){return this}})},qv=yc,$v=Lc,ey=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:Xv(e,n,t[n],r);return e},ty=zt,ry=kv,ny=Z,iy=Rv,oy=xp,ay=Dp,sy=zv,cy=k,uy=_m.exports.fastKey,ly=yu.set,dy=yu.getterFor,py={getConstructor:function(e,t,r,n){var i=e((function(e,i){ry(e,o),ly(e,{type:t,index:qv(null),first:null,last:null,size:0}),cy||(e.size=0),ny(i)||iy(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=dy(t),s=function(e,t,r){var n,i,o=a(e),s=c(e,t);return s?s.value=r:(o.last=s={index:i=uy(t,!0),key:t,value:r,previous:n=o.last,next:null,removed:!1},o.first||(o.first=s),n&&(n.next=s),cy?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var r,n=a(e),i=uy(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return ey(o,{clear:function(){for(var e=a(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=qv(null),cy?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=c(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first===n&&(r.first=i),r.last===n&&(r.last=o),cy?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=ty(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),ey(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),cy&&$v(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=dy(t),o=dy(n);oy(e,t,(function(e,t){ly(this,{type:n,target:e,state:i(e),kind:t,last:null})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?ay("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,ay(void 0,!0))}),r?"entries":"values",!r,!0),sy(t)}};Yv("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),py);var fy=Ee,hy=TypeError,my=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"add"in e&&"delete"in e&&"keys"in e)return e;throw new hy(fy(e)+" is not a set")},vy=function(e,t){return 1===t?function(t,r){return t[e](r)}:function(t,r,n){return t[e](r,n)}},yy=vy,gy=ie("Set"),by=gy.prototype,Cy={Set:gy,add:yy("add",1),has:yy("has",1),remove:yy("delete",1),proto:by},Sy=L,Ty=function(e,t,r){for(var n,i,o=r?e:e.iterator,a=e.next;!(n=Sy(a,o)).done;)if(void 0!==(i=t(n.value)))return i},_y=Ty,wy=function(e,t,r){return r?_y(e.keys(),t,!0):e.forEach(t)},Ry=wy,Ey=Cy.Set,Py=Cy.add,ky=function(e){var t=new Ey;return Ry(e,(function(e){Py(t,e)})),t},Ay=function(e){return e.size},Iy=Ie,Ly=nr,xy=L,Dy=nn,Oy=function(e){return{iterator:e,next:e.next,done:!1}},Ny="Invalid size",My=RangeError,Uy=TypeError,Vy=Math.max,Fy=function(e,t){this.set=e,this.size=Vy(t,0),this.has=Iy(e.has),this.keys=Iy(e.keys)};Fy.prototype={getIterator:function(){return Oy(Ly(xy(this.keys,this.set)))},includes:function(e){return xy(this.has,this.set,e)}};var jy=function(e){Ly(e);var t=+e.size;if(t!=t)throw new Uy(Ny);var r=Dy(t);if(r<0)throw new My(Ny);return new Fy(e,r)},By=my,Wy=ky,Gy=Ay,Zy=jy,Yy=wy,Xy=Ty,Hy=Cy.has,Ky=Cy.remove,Jy=function(e){var t=By(this),r=Zy(e),n=Wy(t);return Gy(t)<=r.size?Yy(t,(function(e){r.includes(e)&&Ky(n,e)})):Xy(r.getIterator(),(function(e){Hy(n,e)&&Ky(n,e)})),n},Qy=function(){return!1},zy=Jy,qy=n;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()||qy((function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var r=e++>1;return t.has(1)&&t.clear(),{done:r,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size}))},{difference:zy});var $y=my,eg=Ay,tg=jy,rg=wy,ng=Ty,ig=Cy.Set,og=Cy.add,ag=Cy.has,sg=function(e){var t=$y(this),r=tg(e),n=new ig;return eg(t)>r.size?ng(r.getIterator(),(function(e){ag(t,e)&&og(n,e)})):rg(t,(function(e){r.includes(e)&&og(n,e)})),n},cg=n,ug=sg;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()||cg((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:ug});var lg=my,dg=Cy.has,pg=Ay,fg=jy,hg=wy,mg=Ty,vg=dv,yg=function(e){var t=lg(this),r=fg(e);if(pg(t)<=r.size)return!1!==hg(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==mg(n,(function(e){if(dg(t,e))return vg(n,"normal",!1)}))},gg=yg;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()},{isDisjointFrom:gg});var bg=my,Cg=Ay,Sg=wy,Tg=jy,_g=function(e){var t=bg(this),r=Tg(e);return!(Cg(t)>r.size)&&!1!==Sg(t,(function(e){if(!r.includes(e))return!1}),!0)},wg=_g;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()},{isSubsetOf:wg});var Rg=my,Eg=Cy.has,Pg=Ay,kg=jy,Ag=Ty,Ig=dv,Lg=function(e){var t=Rg(this),r=kg(e);if(Pg(t)<r.size)return!1;var n=r.getIterator();return!1!==Ag(n,(function(e){if(!Eg(t,e))return Ig(n,"normal",!1)}))},xg=Lg;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()},{isSupersetOf:xg});var Dg=my,Og=ky,Ng=jy,Mg=Ty,Ug=Cy.add,Vg=Cy.has,Fg=Cy.remove,jg=function(e){var t=Dg(this),r=Ng(e).getIterator(),n=Og(t);return Mg(r,(function(e){Vg(t,e)?Fg(n,e):Ug(n,e)})),n},Bg=function(e){try{var t=new Set,r={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},n=t[e](r);return 1===n.size&&4===n.values().next().value}catch(e){return!1}},Wg=jg,Gg=Bg;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()||!Gg("symmetricDifference")},{symmetricDifference:Wg});var Zg=my,Yg=Cy.add,Xg=ky,Hg=jy,Kg=Ty,Jg=function(e){var t=Zg(this),r=Hg(e).getIterator(),n=Xg(t);return Kg(r,(function(e){Yg(n,e)})),n},Qg=Jg,zg=Bg;Ar({target:"Set",proto:!0,real:!0,forced:!Qy()||!zg("union")},{union:Qg});var qg=$.Set,$g=zt,eb=nr,tb=Je,rb=Rv,nb=function(e,t,r){return function(n){var i=tb(n),o=arguments.length,a=o>1?arguments[1]:void 0,s=void 0!==a,c=s?$g(a,o>2?arguments[2]:void 0):void 0,u=new e,l=0;return rb(i,(function(e){var n=s?c(e,l++):e;r?t(u,eb(n)[0],n[1]):t(u,n)})),u}};Ar({target:"Set",stat:!0,forced:!0},{from:nb(Cy.Set,Cy.add,!1)});var ib=nr,ob=function(e,t,r){return function(){for(var n=new e,i=arguments.length,o=0;o<i;o++){var a=arguments[o];r?t(n,ib(a)[0],a[1]):t(n,a)}return n}};Ar({target:"Set",stat:!0,forced:!0},{of:ob(Cy.Set,Cy.add,!1)});var ab=my,sb=Cy.add;Ar({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=ab(this),t=0,r=arguments.length;t<r;t++)sb(e,arguments[t]);return e}});var cb=my,ub=Cy.remove;Ar({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=cb(this),r=!0,n=0,i=arguments.length;n<i;n++)e=ub(t,arguments[n]),r=r&&e;return!!r}});var lb=zt,db=my,pb=wy;Ar({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=db(this),r=lb(e,arguments.length>1?arguments[1]:void 0);return!1!==pb(t,(function(e){if(!r(e,e,t))return!1}),!0)}});var fb=wn,hb=qe,mb=Z,vb=Pd,yb=pt("iterator"),gb=Object,bb=E,Cb=function(e){if(mb(e))return!1;var t=gb(e);return void 0!==t[yb]||"@@iterator"in t||hb(vb,fb(t))},Sb=q,Tb=ie("Set"),_b=function(e){return function(e){return Sb(e)&&"number"==typeof e.size&&bb(e.has)&&bb(e.keys)}(e)?e:Cb(e)?new Tb(e):e},wb=L,Rb=_b,Eb=Jy;Ar({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return wb(Eb,this,Rb(e))}});var Pb=zt,kb=my,Ab=wy,Ib=Cy.Set,Lb=Cy.add;Ar({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=kb(this),r=Pb(e,arguments.length>1?arguments[1]:void 0),n=new Ib;return Ab(t,(function(e){r(e,e,t)&&Lb(n,e)})),n}});var xb=zt,Db=my,Ob=wy;Ar({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=Db(this),r=xb(e,arguments.length>1?arguments[1]:void 0),n=Ob(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}});var Nb=L,Mb=_b,Ub=sg;Ar({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return Nb(Ub,this,Mb(e))}});var Vb=L,Fb=_b,jb=yg;Ar({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return Vb(jb,this,Fb(e))}});var Bb=L,Wb=_b,Gb=_g;Ar({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return Bb(Gb,this,Wb(e))}});var Zb=L,Yb=_b,Xb=Lg;Ar({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return Zb(Xb,this,Yb(e))}});var Hb=Ar,Kb=u,Jb=my,Qb=wy,zb=Vi,qb=Kb([].join),$b=Kb([].push);Hb({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=Jb(this),r=void 0===e?",":zb(e),n=[];return Qb(t,(function(e){$b(n,e)})),qb(n,r)}});var eC=zt,tC=my,rC=wy,nC=Cy.Set,iC=Cy.add;Ar({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=tC(this),r=eC(e,arguments.length>1?arguments[1]:void 0),n=new nC;return rC(t,(function(e){iC(n,r(e,e,t))})),n}});var oC=Ie,aC=my,sC=wy,cC=TypeError;Ar({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=aC(this),r=arguments.length<2,n=r?void 0:arguments[1];if(oC(e),sC(t,(function(i){r?(r=!1,n=i):n=e(n,i,i,t)})),r)throw new cC("Reduce of empty set with no initial value");return n}});var uC=zt,lC=my,dC=wy;Ar({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=lC(this),r=uC(e,arguments.length>1?arguments[1]:void 0);return!0===dC(t,(function(e){if(r(e,e,t))return!0}),!0)}});var pC=L,fC=_b,hC=jg;Ar({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return pC(hC,this,fC(e))}});var mC=L,vC=_b,yC=Jg;Ar({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return mC(yC,this,vC(e))}});var gC=qg;Yv("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),py);var bC=vy,CC=ie("Map"),SC={Map:CC,set:bC("set",2),get:bC("get",1),has:bC("has",1),remove:bC("delete",1),proto:CC.prototype},TC=Ar,_C=Ie,wC=H,RC=Rv,EC=SC.Map,PC=SC.has,kC=SC.get,AC=SC.set,IC=u([].push);TC({target:"Map",stat:!0,forced:true},{groupBy:function(e,t){wC(e),_C(t);var r=new EC,n=0;return RC(e,(function(e){var i=t(e,n++);PC(r,i)?IC(kC(r,i),e):AC(r,i,[e])})),r}});var LC=$.Map,xC=Ee,DC=TypeError,OC=function(e){if("object"==typeof e&&"size"in e&&"has"in e&&"get"in e&&"set"in e&&"delete"in e&&"entries"in e)return e;throw new DC(xC(e)+" is not a map")},NC=OC,MC=SC.get,UC=SC.has,VC=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:true},{getOrInsert:function(e,t){return UC(NC(this),e)?MC(this,e):(VC(this,e,t),t)}});var FC=Ie,jC=OC,BC=SC.get,WC=SC.has,GC=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:true},{getOrInsertComputed:function(e,t){if(jC(this),FC(t),WC(this,e))return BC(this,e);0===e&&1/e==-1/0&&(e=0);var r=t(e);return GC(this,e,r),r}});var ZC=LC;Ar({target:"Map",stat:!0,forced:!0},{from:nb(SC.Map,SC.set,!0)});Ar({target:"Map",stat:!0,forced:!0},{of:ob(SC.Map,SC.set,!0)});var YC=L,XC=Rv,HC=E,KC=Ie,JC=SC.Map;Ar({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var r=new(HC(this)?this:JC);KC(t);var n=KC(r.set);return XC(e,(function(e){YC(n,r,t(e),e)})),r}});var QC=OC,zC=SC.remove;Ar({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=QC(this),r=!0,n=0,i=arguments.length;n<i;n++)e=zC(t,arguments[n]),r=r&&e;return!!r}});var qC=OC,$C=SC.get,eS=SC.has,tS=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var r,n,i=qC(this);return eS(i,e)?(r=$C(i,e),"update"in t&&(r=t.update(r,e,i),tS(i,e,r)),r):(n=t.insert(e,i),tS(i,e,n),n)}});var rS=Ty,nS=function(e,t,r){return r?rS(e.entries(),(function(e){return t(e[1],e[0])}),!0):e.forEach(t)},iS=zt,oS=OC,aS=nS;Ar({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=oS(this),r=iS(e,arguments.length>1?arguments[1]:void 0);return!1!==aS(t,(function(e,n){if(!r(e,n,t))return!1}),!0)}});var sS=zt,cS=OC,uS=nS,lS=SC.Map,dS=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=cS(this),r=sS(e,arguments.length>1?arguments[1]:void 0),n=new lS;return uS(t,(function(e,i){r(e,i,t)&&dS(n,i,e)})),n}});var pS=zt,fS=OC,hS=nS;Ar({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=fS(this),r=pS(e,arguments.length>1?arguments[1]:void 0),n=hS(t,(function(e,n){if(r(e,n,t))return{value:e}}),!0);return n&&n.value}});var mS=zt,vS=OC,yS=nS;Ar({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=vS(this),r=mS(e,arguments.length>1?arguments[1]:void 0),n=yS(t,(function(e,n){if(r(e,n,t))return{key:n}}),!0);return n&&n.key}});var gS=function(e,t){return e===t||e!=e&&t!=t},bS=OC,CS=nS;Ar({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===CS(bS(this),(function(t){if(gS(t,e))return!0}),!0)}});var SS=OC,TS=nS;Ar({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=TS(SS(this),(function(t,r){if(t===e)return{key:r}}),!0);return t&&t.key}});var _S=zt,wS=OC,RS=nS,ES=SC.Map,PS=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=wS(this),r=_S(e,arguments.length>1?arguments[1]:void 0),n=new ES;return RS(t,(function(e,i){PS(n,r(e,i,t),e)})),n}});var kS=zt,AS=OC,IS=nS,LS=SC.Map,xS=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=AS(this),r=kS(e,arguments.length>1?arguments[1]:void 0),n=new LS;return IS(t,(function(e,i){xS(n,i,r(e,i,t))})),n}});var DS=OC,OS=Rv,NS=SC.set;Ar({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=DS(this),r=arguments.length,n=0;n<r;)OS(arguments[n++],(function(e,r){NS(t,e,r)}),{AS_ENTRIES:!0});return t}});var MS=Ie,US=OC,VS=nS,FS=TypeError;Ar({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=US(this),r=arguments.length<2,n=r?void 0:arguments[1];if(MS(e),VS(t,(function(i,o){r?(r=!1,n=i):n=e(n,i,o,t)})),r)throw new FS("Reduce of empty map with no initial value");return n}});var jS=zt,BS=OC,WS=nS;Ar({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=BS(this),r=jS(e,arguments.length>1?arguments[1]:void 0);return!0===WS(t,(function(e,n){if(r(e,n,t))return!0}),!0)}});var GS=Ie,ZS=OC,YS=TypeError,XS=SC.get,HS=SC.has,KS=SC.set;Ar({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var r=ZS(this),n=arguments.length;GS(t);var i=HS(r,e);if(!i&&n<3)throw new YS("Updating absent value");var o=i?XS(r,e):GS(n>2?arguments[2]:void 0)(e,r);return KS(r,e,t(o,e,r)),r}});var JS=L,QS=Ie,zS=E,qS=nr,$S=TypeError,eT=function(e,t){var r,n=qS(this),i=QS(n.get),o=QS(n.has),a=QS(n.set),s=arguments.length>2?arguments[2]:void 0;if(!zS(t)&&!zS(s))throw new $S("At least one callback required");return JS(o,n,e)?(r=JS(i,n,e),zS(t)&&(r=t(r),JS(a,n,e,r))):zS(s)&&(r=s(),JS(a,n,e,r)),r};Ar({target:"Map",proto:!0,real:!0,forced:!0},{upsert:eT}),Ar({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:eT});var tT=ZC,rT=Ar,nT=Date,iT=u(nT.prototype.getTime);rT({target:"Date",stat:!0},{now:function(){return iT(new nT)}});var oT=$.Date.now,aT=Ie,sT=Je,cT=G,uT=un,lT=TypeError,dT="Reduce of empty array with no initial value",pT=function(e){return function(t,r,n,i){var o=sT(t),a=cT(o),s=uT(o);if(aT(r),0===s&&n<2)throw new lT(dT);var c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw new lT(dT)}for(;e?c>=0:s>c;c+=u)c in a&&(i=r(i,a[c],c,o));return i}},fT="NODE"===Ro,hT={left:pT(!1),right:pT(!0)}.left;Ar({target:"Array",proto:!0,forced:!fT&&he>79&&he<83||!uo("reduce")},{reduce:function(e){var t=arguments.length;return hT(this,e,t,t>1?arguments[1]:void 0)}});var mT=Xr("Array","reduce"),vT=l,yT=mT,gT=Array.prototype,bT=function(e){var t=e.reduce;return e===gT||vT(gT,e)&&t===gT.reduce?yT:t},CT=If.codeAt;Ar({target:"String",proto:!0},{codePointAt:function(e){return CT(this,e)}});var ST=Xr("String","codePointAt"),TT=l,_T=ST,wT=String.prototype,RT=function(e){var t=e.codePointAt;return"string"==typeof e||e===wT||TT(wT,e)&&t===wT.codePointAt?_T:t},ET=Ar,PT=u,kT=Ti,AT=RangeError,IT=String.fromCharCode,LT=String.fromCodePoint,xT=PT([].join);ET({target:"String",stat:!0,arity:1,forced:!!LT&&1!==LT.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],kT(t,1114111)!==t)throw new AT(t+" is not a valid code point");r[i]=t<65536?IT(t):IT(55296+((t-=65536)>>10),t%1024+56320)}return xT(r,"")}});var DT=$.String.fromCodePoint,OT=nn,NT=Vi,MT=H,UT=RangeError,VT=u,FT=sn,jT=Vi,BT=H,WT=VT((function(e){var t=NT(MT(this)),r="",n=OT(e);if(n<0||n===1/0)throw new UT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),GT=VT("".slice),ZT=Math.ceil,YT=function(e){return function(t,r,n){var i,o,a=jT(BT(t)),s=FT(r),c=a.length,u=void 0===n?" ":jT(n);return s<=c||""===u?a:((o=WT(u,ZT((i=s-c)/u.length))).length>i&&(o=GT(o,0,i)),e?a+o:o+a)}},XT=u,HT=n,KT={start:YT(!1),end:YT(!0)}.start,JT=RangeError,QT=isFinite,zT=Math.abs,qT=Date.prototype,$T=qT.toISOString,e_=XT(qT.getTime),t_=XT(qT.getUTCDate),r_=XT(qT.getUTCFullYear),n_=XT(qT.getUTCHours),i_=XT(qT.getUTCMilliseconds),o_=XT(qT.getUTCMinutes),a_=XT(qT.getUTCMonth),s_=XT(qT.getUTCSeconds),c_=HT((function(){return"0385-07-25T07:06:39.999Z"!==$T.call(new Date(-50000000000001))}))||!HT((function(){$T.call(new Date(NaN))}))?function(){if(!QT(e_(this)))throw new JT("Invalid time value");var e=this,t=r_(e),r=i_(e),n=t<0?"-":t>9999?"+":"";return n+KT(zT(t),n?6:4,0)+"-"+KT(a_(e)+1,2,0)+"-"+KT(t_(e),2,0)+"T"+KT(n_(e),2,0)+":"+KT(o_(e),2,0)+":"+KT(s_(e),2,0)+"."+KT(r,3,0)+"Z"}:$T,u_=L,l_=Je,d_=Ct,p_=c_,f_=S;Ar({target:"Date",proto:!0,forced:n((function(){return null!==new Date(NaN).toJSON()||1!==u_(Date.prototype.toJSON,{toISOString:function(){return 1}})}))},{toJSON:function(e){var t=l_(this),r=d_(t,"number");return"number"!=typeof r||isFinite(r)?"toISOString"in t||"Date"!==f_(t)?t.toISOString():u_(p_,t):null}});var h_=$,m_=y;h_.JSON||(h_.JSON={stringify:JSON.stringify});var v_=function(e,t,r){return m_(h_.JSON.stringify,null,arguments)},y_=v_,g_=qe,b_=Dh,C_=P,S_=qt,T_=q,__=yr,w_=Error,R_=u("".replace),E_=String(new w_("zxcasd").stack),P_=/\n\s*at [^:]*:[^\n]*/,k_=P_.test(E_),A_=V,I_=!n((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",A_(1,7)),7!==e.stack)})),L_=yr,x_=function(e,t){if(k_&&"string"==typeof e&&!w_.prepareStackTrace)for(;t--;)e=R_(e,P_,"");return e},D_=I_,O_=Error.captureStackTrace,N_=Vi,M_=Ar,U_=l,V_=Wd,F_=mp,j_=function(e,t,r){for(var n=b_(t),i=S_.f,o=C_.f,a=0;a<n.length;a++){var s=n[a];g_(e,s)||r&&g_(r,s)||i(e,s,o(t,s))}},B_=yc,W_=yr,G_=V,Z_=function(e,t){T_(t)&&"cause"in t&&__(e,"cause",t.cause)},Y_=function(e,t,r,n){D_&&(O_?O_(e,t):L_(e,"stack",x_(r,n)))},X_=Rv,H_=function(e,t){return void 0===e?arguments.length<2?"":t:N_(e)},K_=pt("toStringTag"),J_=Error,Q_=[].push,z_=function(e,t){var r,n=U_(q_,this);F_?r=F_(new J_,n?V_(this):q_):(r=n?this:B_(q_),W_(r,K_,"Error")),void 0!==t&&W_(r,"message",H_(t)),Y_(r,z_,r.stack,1),arguments.length>2&&Z_(r,arguments[2]);var i=[];return X_(e,Q_,{that:i}),W_(r,"errors",i),r};F_?F_(z_,J_):j_(z_,J_,{name:!0});var q_=z_.prototype=B_(J_.prototype,{constructor:G_(1,z_),message:G_(1,""),name:G_(1,"AggregateError")});M_({global:!0,constructor:!0,arity:2},{AggregateError:z_});var $_,ew,tw,rw,nw=Wn,iw=Ee,ow=TypeError,aw=nr,sw=function(e){if(nw(e))return e;throw new ow(iw(e)+" is not a constructor")},cw=Z,uw=pt("species"),lw=function(e,t){var r,n=aw(e).constructor;return void 0===n||cw(r=aw(n)[uw])?t:sw(r)},dw=/(?:ipad|iphone|ipod).*applewebkit/i.test(se),pw=p,fw=y,hw=zt,mw=E,vw=qe,yw=n,gw=rc,bw=Ir,Cw=Pt,Sw=Po,Tw=dw,_w=fT,ww=pw.setImmediate,Rw=pw.clearImmediate,Ew=pw.process,Pw=pw.Dispatch,kw=pw.Function,Aw=pw.MessageChannel,Iw=pw.String,Lw=0,xw={},Dw="onreadystatechange";yw((function(){$_=pw.location}));var Ow=function(e){if(vw(xw,e)){var t=xw[e];delete xw[e],t()}},Nw=function(e){return function(){Ow(e)}},Mw=function(e){Ow(e.data)},Uw=function(e){pw.postMessage(Iw(e),$_.protocol+"//"+$_.host)};ww&&Rw||(ww=function(e){Sw(arguments.length,1);var t=mw(e)?e:kw(e),r=bw(arguments,1);return xw[++Lw]=function(){fw(t,void 0,r)},ew(Lw),Lw},Rw=function(e){delete xw[e]},_w?ew=function(e){Ew.nextTick(Nw(e))}:Pw&&Pw.now?ew=function(e){Pw.now(Nw(e))}:Aw&&!Tw?(rw=(tw=new Aw).port2,tw.port1.onmessage=Mw,ew=hw(rw.postMessage,rw)):pw.addEventListener&&mw(pw.postMessage)&&!pw.importScripts&&$_&&"file:"!==$_.protocol&&!yw(Uw)?(ew=Uw,pw.addEventListener("message",Mw,!1)):ew=Dw in Cw("script")?function(e){gw.appendChild(Cw("script")).onreadystatechange=function(){gw.removeChild(this),Ow(e)}}:function(e){setTimeout(Nw(e),0)});var Vw={set:ww,clear:Rw},Fw=p,jw=k,Bw=Object.getOwnPropertyDescriptor,Ww=function(){this.head=null,this.tail=null};Ww.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Gw,Zw,Yw,Xw,Hw,Kw=Ww,Jw=/ipad|iphone|ipod/i.test(se)&&"undefined"!=typeof Pebble,Qw=/web0s(?!.*chrome)/i.test(se),zw=p,qw=function(e){if(!jw)return Fw[e];var t=Bw(Fw,e);return t&&t.value},$w=zt,eR=Vw.set,tR=Kw,rR=dw,nR=Jw,iR=Qw,oR=fT,aR=zw.MutationObserver||zw.WebKitMutationObserver,sR=zw.document,cR=zw.process,uR=zw.Promise,lR=qw("queueMicrotask");if(!lR){var dR=new tR,pR=function(){var e,t;for(oR&&(e=cR.domain)&&e.exit();t=dR.get();)try{t()}catch(e){throw dR.head&&Gw(),e}e&&e.enter()};rR||oR||iR||!aR||!sR?!nR&&uR&&uR.resolve?((Xw=uR.resolve(void 0)).constructor=uR,Hw=$w(Xw.then,Xw),Gw=function(){Hw(pR)}):oR?Gw=function(){cR.nextTick(pR)}:(eR=$w(eR,zw),Gw=function(){eR(pR)}):(Zw=!0,Yw=sR.createTextNode(""),new aR(pR).observe(Yw,{characterData:!0}),Gw=function(){Yw.data=Zw=!Zw}),lR=function(e){dR.head||Gw(),dR.add(e)}}var fR=lR,hR=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},mR=p.Promise,vR=p,yR=mR,gR=E,bR=Ht,CR=An,SR=pt,TR=Ro,_R=he,wR=yR&&yR.prototype,RR=SR("species"),ER=!1,PR=gR(vR.PromiseRejectionEvent),kR=bR("Promise",(function(){var e=CR(yR),t=e!==String(yR);if(!t&&66===_R)return!0;if(!wR.catch||!wR.finally)return!0;if(!_R||_R<51||!/native code/.test(e)){var r=new yR((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[RR]=n,!(ER=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==TR&&"DENO"!==TR||PR)})),AR={CONSTRUCTOR:kR,REJECTION_EVENT:PR,SUBCLASSING:ER},IR={},LR=Ie,xR=TypeError,DR=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new xR("Bad Promise constructor");t=e,r=n})),this.resolve=LR(t),this.reject=LR(r)};IR.f=function(e){return new DR(e)};var OR,NR,MR,UR=Ar,VR=fT,FR=p,jR=$,BR=L,WR=Ac,GR=tu,ZR=zv,YR=Ie,XR=E,HR=q,KR=kv,JR=lw,QR=Vw.set,zR=fR,qR=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}},$R=hR,eE=Kw,tE=yu,rE=mR,nE=IR,iE="Promise",oE=AR.CONSTRUCTOR,aE=AR.REJECTION_EVENT,sE=tE.getterFor(iE),cE=tE.set,uE=rE&&rE.prototype,lE=rE,dE=uE,pE=FR.TypeError,fE=FR.document,hE=FR.process,mE=nE.f,vE=mE,yE=!!(fE&&fE.createEvent&&FR.dispatchEvent),gE="unhandledrejection",bE=function(e){var t;return!(!HR(e)||!XR(t=e.then))&&t},CE=function(e,t){var r,n,i,o=t.value,a=1===t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&RE(t),t.rejection=1),!0===s?r=o:(l&&l.enter(),r=s(o),l&&(l.exit(),i=!0)),r===e.promise?u(new pE("Promise-chain cycle")):(n=bE(r))?BR(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},SE=function(e,t){e.notified||(e.notified=!0,zR((function(){for(var r,n=e.reactions;r=n.get();)CE(r,e);e.notified=!1,t&&!e.rejection&&_E(e)})))},TE=function(e,t,r){var n,i;yE?((n=fE.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),FR.dispatchEvent(n)):n={promise:t,reason:r},!aE&&(i=FR["on"+e])?i(n):e===gE&&qR("Unhandled promise rejection",r)},_E=function(e){BR(QR,FR,(function(){var t,r=e.facade,n=e.value;if(wE(e)&&(t=$R((function(){VR?hE.emit("unhandledRejection",n,r):TE(gE,r,n)})),e.rejection=VR||wE(e)?2:1,t.error))throw t.value}))},wE=function(e){return 1!==e.rejection&&!e.parent},RE=function(e){BR(QR,FR,(function(){var t=e.facade;VR?hE.emit("rejectionHandled",t):TE("rejectionhandled",t,e.value)}))},EE=function(e,t,r){return function(n){e(t,n,r)}},PE=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,SE(e,!0))},kE=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new pE("Promise can't be resolved itself");var n=bE(t);n?zR((function(){var r={done:!1};try{BR(n,t,EE(kE,r,e),EE(PE,r,e))}catch(t){PE(r,t,e)}})):(e.value=t,e.state=1,SE(e,!1))}catch(t){PE({done:!1},t,e)}}};oE&&(dE=(lE=function(e){KR(this,dE),YR(e),BR(OR,this);var t=sE(this);try{e(EE(kE,t),EE(PE,t))}catch(e){PE(t,e)}}).prototype,(OR=function(e){cE(this,{type:iE,done:!1,notified:!1,parent:!1,reactions:new eE,rejection:!1,state:0,value:null})}).prototype=WR(dE,"then",(function(e,t){var r=sE(this),n=mE(JR(this,lE));return r.parent=!0,n.ok=!XR(e)||e,n.fail=XR(t)&&t,n.domain=VR?hE.domain:void 0,0===r.state?r.reactions.add(n):zR((function(){CE(n,r)})),n.promise})),NR=function(){var e=new OR,t=sE(e);this.promise=e,this.resolve=EE(kE,t),this.reject=EE(PE,t)},nE.f=mE=function(e){return e===lE||e===MR?new NR(e):vE(e)}),UR({global:!0,constructor:!0,wrap:!0,forced:oE},{Promise:lE}),MR=jR.Promise,GR(lE,iE,!1,!0),ZR(iE);var AE=pt("iterator"),IE=!1;try{var LE=0,xE={next:function(){return{done:!!LE++}},return:function(){IE=!0}};xE[AE]=function(){return this},Array.from(xE,(function(){throw 2}))}catch(e){}var DE=mR,OE=function(e,t){try{if(!t&&!IE)return!1}catch(e){return!1}var r=!1;try{var n={};n[AE]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NE=AR.CONSTRUCTOR||!OE((function(e){DE.all(e).then(void 0,(function(){}))})),ME=L,UE=Ie,VE=IR,FE=hR,jE=Rv;Ar({target:"Promise",stat:!0,forced:NE},{all:function(e){var t=this,r=VE.f(t),n=r.resolve,i=r.reject,o=FE((function(){var r=UE(t.resolve),o=[],a=0,s=1;jE(e,(function(e){var c=a++,u=!1;s++,ME(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise}});var BE=Ar,WE=AR.CONSTRUCTOR;mR&&mR.prototype,BE({target:"Promise",proto:!0,forced:WE,real:!0},{catch:function(e){return this.then(void 0,e)}});var GE=L,ZE=Ie,YE=IR,XE=hR,HE=Rv;Ar({target:"Promise",stat:!0,forced:NE},{race:function(e){var t=this,r=YE.f(t),n=r.reject,i=XE((function(){var i=ZE(t.resolve);HE(e,(function(e){GE(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var KE=IR;Ar({target:"Promise",stat:!0,forced:AR.CONSTRUCTOR},{reject:function(e){var t=KE.f(this);return(0,t.reject)(e),t.promise}});var JE=nr,QE=q,zE=IR,qE=function(e,t){if(JE(e),QE(t)&&t.constructor===e)return t;var r=zE.f(e);return(0,r.resolve)(t),r.promise},$E=Ar,eP=mR,tP=AR.CONSTRUCTOR,rP=qE,nP=ie("Promise"),iP=!tP;$E({target:"Promise",stat:!0,forced:true},{resolve:function(e){return rP(iP&&this===nP?eP:this,e)}});var oP=L,aP=Ie,sP=IR,cP=hR,uP=Rv;Ar({target:"Promise",stat:!0,forced:NE},{allSettled:function(e){var t=this,r=sP.f(t),n=r.resolve,i=r.reject,o=cP((function(){var r=aP(t.resolve),i=[],o=0,a=1;uP(e,(function(e){var s=o++,c=!1;a++,oP(r,t,e).then((function(e){c||(c=!0,i[s]={status:"fulfilled",value:e},--a||n(i))}),(function(e){c||(c=!0,i[s]={status:"rejected",reason:e},--a||n(i))}))})),--a||n(i)}));return o.error&&i(o.value),r.promise}});var lP=L,dP=Ie,pP=ie,fP=IR,hP=hR,mP=Rv,vP="No one promise resolved";Ar({target:"Promise",stat:!0,forced:NE},{any:function(e){var t=this,r=pP("AggregateError"),n=fP.f(t),i=n.resolve,o=n.reject,a=hP((function(){var n=dP(t.resolve),a=[],s=0,c=1,u=!1;mP(e,(function(e){var l=s++,d=!1;c++,lP(n,t,e).then((function(e){d||u||(u=!0,i(e))}),(function(e){d||u||(d=!0,a[l]=e,--c||o(new r(a,vP)))}))})),--c||o(new r(a,vP))}));return a.error&&o(a.value),n.promise}});var yP=Ar,gP=y,bP=Ir,CP=IR,SP=Ie,TP=hR,_P=p.Promise,wP=!1;yP({target:"Promise",stat:!0,forced:!_P||!_P.try||TP((function(){_P.try((function(e){wP=8===e}),8)})).error||!wP},{try:function(e){var t=arguments.length>1?bP(arguments,1):[],r=CP.f(this),n=TP((function(){return gP(SP(e),void 0,t)}));return(n.error?r.reject:r.resolve)(n.value),r.promise}});var RP=IR;Ar({target:"Promise",stat:!0},{withResolvers:function(){var e=RP.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var EP=Ar,PP=mR,kP=n,AP=ie,IP=E,LP=lw,xP=qE,DP=PP&&PP.prototype;EP({target:"Promise",proto:!0,real:!0,forced:!!PP&&kP((function(){DP.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=LP(this,AP("Promise")),r=IP(e);return this.then(r?function(r){return xP(t,e()).then((function(){return r}))}:e,r?function(r){return xP(t,e()).then((function(){throw r}))}:e)}});var OP=$.Promise,NP="\t\n\v\f\r 聽釟€鈥€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029\ufeff",MP=H,UP=Vi,VP=NP,FP=u("".replace),jP=RegExp("^["+VP+"]+"),BP=RegExp("(^|[^"+VP+"])["+VP+"]+$"),WP=function(e){return function(t){var r=UP(MP(t));return 1&e&&(r=FP(r,jP,"")),2&e&&(r=FP(r,BP,"$1")),r}},GP={start:WP(1),end:WP(2),trim:WP(3)},ZP=p,YP=n,XP=u,HP=Vi,KP=GP.trim,JP=NP,QP=ZP.parseInt,zP=ZP.Symbol,qP=zP&&zP.iterator,$P=/^[+-]?0x/i,ek=XP($P.exec),tk=8!==QP(JP+"08")||22!==QP(JP+"0x16")||qP&&!YP((function(){QP(Object(qP))}))?function(e,t){var r=KP(HP(e));return QP(r,t>>>0||(ek($P,r)?16:10))}:QP;Ar({global:!0,forced:parseInt!==tk},{parseInt:tk});var rk=$.parseInt,nk=so.map;Ar({target:"Array",proto:!0,forced:!$n("map")},{map:function(e){return nk(this,e,arguments.length>1?arguments[1]:void 0)}});var ik=Xr("Array","map"),ok=l,ak=ik,sk=Array.prototype,ck=function(e){var t=e.map;return e===sk||ok(sk,e)&&t===sk.map?ak:t},uk=Xr("Array","entries"),lk=wn,dk=qe,pk=l,fk=uk,hk=Array.prototype,mk={DOMTokenList:!0,NodeList:!0},vk=function(e){var t=e.entries;return e===hk||pk(hk,e)&&t===hk.entries||dk(mk,lk(e))?fk:t},yk=k,gk=$r,bk=TypeError,Ck=Object.getOwnPropertyDescriptor,Sk=yk&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),Tk=Ee,_k=TypeError,wk=function(e,t){if(!delete e[t])throw new _k("Cannot delete property "+Tk(t)+" of "+Tk(e))},Rk=Ar,Ek=Je,Pk=Ti,kk=nn,Ak=un,Ik=Sk?function(e,t){if(gk(e)&&!Ck(e,"length").writable)throw new bk("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Lk=dn,xk=Jn,Dk=mn,Ok=wk,Nk=$n("splice"),Mk=Math.max,Uk=Math.min;Rk({target:"Array",proto:!0,forced:!Nk},{splice:function(e,t){var r,n,i,o,a,s,c=Ek(this),u=Ak(c),l=Pk(e,u),d=arguments.length;for(0===d?r=n=0:1===d?(r=0,n=u-l):(r=d-2,n=Uk(Mk(kk(t),0),u-l)),Lk(u+r-n),i=xk(c,n),o=0;o<n;o++)(a=l+o)in c&&Dk(i,o,c[a]);if(i.length=n,r<n){for(o=l;o<u-n;o++)s=o+r,(a=o+n)in c?c[s]=c[a]:Ok(c,s);for(o=u;o>u-n+r;o--)Ok(c,o-1)}else if(r>n)for(o=u-n;o>l;o--)s=o+r-1,(a=o+n-1)in c?c[s]=c[a]:Ok(c,s);for(o=0;o<r;o++)c[o+l]=arguments[o+2];return Ik(c,u-n+r),i}});var Vk=Xr("Array","splice"),Fk=l,jk=Vk,Bk=Array.prototype,Wk=function(e){var t=e.splice;return e===Bk||Fk(Bk,e)&&t===Bk.splice?jk:t},Gk=Ar,Zk=so.find,Yk="find",Xk=!0;Yk in[]&&Array(1).find((function(){Xk=!1})),Gk({target:"Array",proto:!0,forced:Xk},{find:function(e){return Zk(this,e,arguments.length>1?arguments[1]:void 0)}});var Hk=Xr("Array","find"),Kk=l,Jk=Hk,Qk=Array.prototype,zk=function(e){var t=e.find;return e===Qk||Kk(Qk,e)&&t===Qk.find?Jk:t},qk={exports:{}};!function(e,t){self,e.exports=function(){var e={729:function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Wf&&(n.prototype=Wf(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?sh(n).call(n,1):n);return ch?gi(i).call(i,ch(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,i),!0;case 5:return l.fn.call(l.context,t,n,i,o),!0;case 6:return l.fn.call(l.context,t,n,i,o,a),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,f=l.length;for(u=0;u<f;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,i);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||i&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s},961:function(e,t,r){var n,i=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function i(e,t){if(!n[e]){n[e]={};for(var r=0;r<e.length;r++)n[e][e.charAt(r)]=r}return n[e][t]}var o={compressToBase64:function(e){if(null==e)return"";var r=o._compress(e,6,(function(e){return t.charAt(e)}));switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:o._decompress(e.length,32,(function(r){return i(t,e.charAt(r))}))},compressToUTF16:function(t){return null==t?"":o._compress(t,15,(function(t){return e(t+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:o._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=o.compress(e),r=new Uint8Array(2*t.length),n=0,i=t.length;n<i;n++){var a=t.charCodeAt(n);r[2*n]=a>>>8,r[2*n+1]=a%256}return r},decompressFromUint8Array:function(t){if(null==t)return o.decompress(t);for(var r=new Array(t.length/2),n=0,i=r.length;n<i;n++)r[n]=256*t[2*n]+t[2*n+1];var a=[];return Co(r).call(r,(function(t){a.push(e(t))})),o.decompress(a.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":o._compress(e,6,(function(e){return r.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),o._decompress(e.length,32,(function(t){return i(r,e.charAt(t))})))},compress:function(t){return o._compress(t,16,(function(t){return e(t)}))},_compress:function(e,t,r){if(null==e)return"";var n,i,o,a={},s={},c="",u="",l="",d=2,p=3,f=2,h=[],m=0,v=0;for(o=0;o<e.length;o+=1)if(c=e.charAt(o),Object.prototype.hasOwnProperty.call(a,c)||(a[c]=p++,s[c]=!0),u=l+c,Object.prototype.hasOwnProperty.call(a,u))l=u;else{if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(n=0;n<f;n++)m<<=1,v==t-1?(v=0,h.push(r(m)),m=0):v++;for(i=l.charCodeAt(0),n=0;n<8;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1}else{for(i=1,n=0;n<f;n++)m=m<<1|i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i=0;for(i=l.charCodeAt(0),n=0;n<16;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1}0==--d&&(d=Math.pow(2,f),f++),delete s[l]}else for(i=a[l],n=0;n<f;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1;0==--d&&(d=Math.pow(2,f),f++),a[u]=p++,l=String(c)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(n=0;n<f;n++)m<<=1,v==t-1?(v=0,h.push(r(m)),m=0):v++;for(i=l.charCodeAt(0),n=0;n<8;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1}else{for(i=1,n=0;n<f;n++)m=m<<1|i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i=0;for(i=l.charCodeAt(0),n=0;n<16;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1}0==--d&&(d=Math.pow(2,f),f++),delete s[l]}else for(i=a[l],n=0;n<f;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1;0==--d&&(d=Math.pow(2,f),f++)}for(i=2,n=0;n<f;n++)m=m<<1|1&i,v==t-1?(v=0,h.push(r(m)),m=0):v++,i>>=1;for(;;){if(m<<=1,v==t-1){h.push(r(m));break}v++}return h.join("")},decompress:function(e){return null==e?"":""==e?null:o._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,r,n){var i,o,a,s,c,u,l,d=[],p=4,f=4,h=3,m="",v=[],y={val:n(0),position:r,index:1};for(i=0;i<3;i+=1)d[i]=i;for(a=0,c=Math.pow(2,2),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;switch(a){case 0:for(a=0,c=Math.pow(2,8),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;l=e(a);break;case 1:for(a=0,c=Math.pow(2,16),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;l=e(a);break;case 2:return""}for(d[3]=l,o=l,v.push(l);;){if(y.index>t)return"";for(a=0,c=Math.pow(2,h),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;switch(l=a){case 0:for(a=0,c=Math.pow(2,8),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;d[f++]=e(a),l=f-1,p--;break;case 1:for(a=0,c=Math.pow(2,16),u=1;u!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=r,y.val=n(y.index++)),a|=(s>0?1:0)*u,u<<=1;d[f++]=e(a),l=f-1,p--;break;case 2:return v.join("")}if(0==p&&(p=Math.pow(2,h),h++),d[l])m=d[l];else{if(l!==f)return null;m=o+o.charAt(0)}v.push(m),d[f++]=o+m.charAt(0),o=m,0==--p&&(p=Math.pow(2,h),h++)}}};return o}();void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&mh(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){r.d(n,{default:function(){return or}});var e=r(729),t=r.n(e),i="LEBP2PInnerEvent",o="LEBP2PEvent",a={ERR_LOAD_TIMEOUT:1003,ERR_LOAD_REACH_MAX_RETRY:1004,ERR_PLAY_WEBRTC_FAIL:1005,ERR_FETCH_REQUEST_FAIL:1006,ERR_PLAY_REQUEST_PULL_FAIL:1007,ERR_PLAY_REQUEST_STOP_FAIL:1008,INF_PLAY_EVT_SERVER_CONNECTED:3001,INF_PLAY_EVT_SERVER_RECONNECT:3002,INF_PLAY_EVT_REQUEST_PULL_BEGIN:3003,INF_PLAY_EVT_REQUEST_PULL_SUCCESS:3004,INF_PLAY_EVT_STREAM_FIRST_AUDIO_FRAME:3005,INF_PLAY_EVT_STREAM_FIRST_VIDEO_FRAME:3006,INF_PLAY_EVT_STREAM_CLOSED:3007,INF_PLAY_EVT_STREAM_SWITCH:3008};function s(e,t){var r=gh(e);if(ch){var n=ch(e);t&&(n=Ca(n).call(n,(function(t){return Ph(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Co(r=s(Object(i),!0)).call(r,(function(t){u(e,t,i[t])})):Vh?Yh(e,Vh(i)):Co(n=s(Object(i))).call(n,(function(t){mh(e,t,Ph(i,t))}))}return e}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l={streamUrl:"",streamId:function(){return function(e){var t=e.split("?")[0];return sh(t).call(t,sm(t).call(t,"/")+1)}(this.streamUrl)},pullStreamDomain:"https://overseas-webrtc.liveplay.myqcloud.com",stopStreamDomain:"https://overseas-webrtc.liveplay.myqcloud.com",get pullStreamUrl(){return"".concat(this.pullStreamDomain,"/webrtc/v1/pullstream")},get stopStreamUrl(){return"".concat(this.stopStreamDomain,"/webrtc/v1/stopstream")}},d=c(c(c(c(c(c(c(c({},{cloudAppid:0,xp2pAppid:"",token:"",xp2pDomain:""}),l),{confBaseUrl:"https://conf.qvb.qcloud.com/api/v3/live/h5/",reportUrl:"https://log.qvb.qcloud.com/reporter/vlive",signal:"wss://signal.qvb.qcloud.com/",stun:"127.0.0.1"}),{trackerUrl:"https://tracker-00.qvb.qcloud.com/api/tracker/v2/htbt",trackerInterval:5e3,trackerVersion:"v1"}),{maxCandidate:5,maxConnected:5,maxConnecting:5,tickInterval:1e4}),{stuckFrameRateRatio:.6}),{subscribeCoolingTime:2e4}),{connectRetryCount:3,connectRetryDelay:1e3});function p(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f,h=function(){function e(){p(this,"config",Tm({},d))}return e.prototype.update=function(e){Tm(this.config,e)},e.prototype.get=function(e){return this.config[e]},e.prototype.set=function(e,t){this.config[e]=t},e}();function m(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.base=0]="base",e[e.number=1]="number",e[e.boolean=2]="boolean",e[e.string=3]="string",e[e.array=4]="array",e[e.object=5]="object"}(f||(f={}));var v=function(){function e(e){var t=e.initVal,r=e.defaultVal;m(this,"type",f.base),m(this,"val",void 0),this.val=void 0===t?r:t}return e.prototype.set=function(e){return this.val=e,this},mh(e.prototype,"value",{get:function(){return this.val},enumerable:!1,configurable:!0}),e.prototype.isString=function(){return this.type===f.string},e.prototype.isBoolean=function(){return this.type===f.boolean},e.prototype.isNumber=function(){return this.type===f.number},e}(),y=function(e){function t(t){var r=this;return m(r=e.call(this,{initVal:t,defaultVal:0})||this,"type",f.number),r}return Ta(t,e),t.prototype.plus=function(e){this.val+=e},t.prototype.minus=function(e){this.val-=e},t}(v),g=function(e){function t(t){var r=this;return m(r=e.call(this,{initVal:t,defaultVal:!1})||this,"type",f.boolean),r}return Ta(t,e),t}(v),b=function(e){function t(t){var r=this;return m(r=e.call(this,{initVal:t,defaultVal:""})||this,"type",f.string),r}return Ta(t,e),t.prototype.append=function(e){this.val+=e},t}(v),C=function(e){function t(t){var r=this;return m(r=e.call(this,{initVal:t,defaultVal:[]})||this,"type",f.array),r}return Ta(t,e),t}(v),S=function(e){function t(t){var r=this;return m(r=e.call(this,{initVal:t,defaultVal:{}})||this,"type",f.object),r}return Ta(t,e),t}(v),T=function(){function e(){}return e.create=function(e,t){switch(e){case f.number:return new y(t);case f.boolean:return new g(t);case f.string:return new b(t);case f.array:return new C(t);case f.object:return new S(t)}},e}();function _(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w=function(){function e(){_(this,"config",{deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),_(this,"registeredReportCallback",new gC),_(this,"storedFields",new tT),_(this,"preHooks",new tT)}return e.prototype.destroy=function(){this.config=null,this.reset()},e.prototype.configure=function(e){this.config=e},e.prototype.reset=function(){this.registeredReportCallback.clear(),this.preHooks.clear()},e.prototype.string=function(e){return this.findOrCreate(f.string,e)},e.prototype.number=function(e){return this.findOrCreate(f.number,e)},e.prototype.bool=function(e){return this.findOrCreate(f.boolean,e)},e.prototype.array=function(e){return this.findOrCreate(f.array,e)},e.prototype.object=function(e){return this.findOrCreate(f.object,e)},e.prototype.deleteField=function(e){this.storedFields.delete(e)},e.prototype.generate=function(){var e,t,r=this;Co(e=this.preHooks).call(e,(function(e){e()}));var n={};return Co(t=this.storedFields).call(t,(function(e,t){var i,o;r.config&&(!r.config.deleteZeroNumber||$i(i=r.config.fieldsReportedWithZeroNumber).call(i,t)||e.isBoolean()||e.isString()||e.value)&&(n[t]=e.value,$i(o=r.config.fieldsReservedValueAfterReport).call(o,t)||r.storedFields.delete(t))})),n},e.prototype.registerPreHook=function(e,t){this.preHooks.has(e)||this.preHooks.set(e,t)},e.prototype.deletePreHook=function(e){this.preHooks.delete(e)},e.prototype.findOrCreate=function(e,t,r){var n=this.storedFields.get(t);return n?(n.type!==e&&(n=T.create(e,r),this.storedFields.set(t,n)),n):(n=T.create(e,r),this.storedFields.set(t,n),n)},e}(),R=function(){function e(){_(this,"reportUnits",new tT)}return e.prototype.registerReportUint=function(e,t){this.reportUnits.has(e)||this.reportUnits.set(e,t)},e.prototype.deleteReportUint=function(e){this.reportUnits.delete(e)},e.prototype.generate=function(){var e,t={};return Co(e=this.reportUnits).call(e,(function(e){Tm(t,e.generate())})),t},e}();function E(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P,k=0,A=function(e){function t(){var t=this;return E(t=e.call(this)||this,"tagName","Base"),E(t,"objId",0),E(t,"reporter",null),E(t,"bus",null),t.objId=k,k+=1,t}return Ta(t,e),mh(t.prototype,"objName",{get:function(){var e;return gi(e="".concat(this.tagName,"_")).call(e,this.objId)},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){this.reporter=null,this.removeAllListeners()},t.prototype.setReporter=function(e){return e&&(this.reporter=e),this},t.prototype.setBus=function(e){return this.bus=e,this},t}(t());function I(e,t){var r=gh(e);if(ch){var n=ch(e);t&&(n=Ca(n).call(n,(function(t){return Ph(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Co(r=I(Object(i),!0)).call(r,(function(t){x(e,t,i[t])})):Vh?Yh(e,Vh(i)):Co(n=I(Object(i))).call(n,(function(t){mh(e,t,Ph(i,t))}))}return e}function x(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.STALL=0]="STALL",e[e.FINE=1]="FINE"}(P||(P={}));var D=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return x(n=e.apply(this,Aa([],ka(t),!1))||this,"stallState",P.FINE),x(n,"config",{detectSensitivity:1e3}),x(n,"timer",null),x(n,"lastFreshTime",0),n}return Ta(t,e),t.prototype.configure=function(e){return this.config=L(L({},this.config),e),this},t.prototype.init=function(){return this.clearTimer(),this.startTimer(),this},t.prototype.destroy=function(){this.clearTimer()},t.prototype.fresh=function(){this.stallState===P.STALL&&this.emit("recover",{stallDuration:oT()-this.lastFreshTime}),this.lastFreshTime=oT(),this.stallState=P.FINE},t.prototype.check=function(){this.stallState!==P.STALL&&this.lastFreshTime&&oT()-this.lastFreshTime>this.config.detectSensitivity&&(this.stallState=P.STALL,this.emit("stall"))},t.prototype.startTimer=function(){var e=this;this.timer=Zo((function(){e.check()}),this.config.detectSensitivity)},t.prototype.clearTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},t}(e.EventEmitter);function O(e,t){var r=gh(e);if(ch){var n=ch(e);t&&(n=Ca(n).call(n,(function(t){return Ph(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Co(r=O(Object(i),!0)).call(r,(function(t){M(e,t,i[t])})):Vh?Yh(e,Vh(i)):Co(n=O(Object(i))).call(n,(function(t){mh(e,t,Ph(i,t))}))}return e}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var U=N(N(N(N(N(N(N(N({},{APPID:"appid",PLATFORM:"platform",TYPE:"type",PARTNER:"partner",UUID:"str_user_id",PLAY_ID:"str_play_id",REFERER:"referer",USER_AGENT:"user_agent",VERSION:"version",CURRENT_TIME:"cur_time",DATA_TIME:"data_time",DATA_TYPE:"data_type",VIDEO_TYPE:"str_video_type",URL:"url",STREAM_ID:"stream_id",BROWSER_NAME:"browser_name",BROWSER_MAJOR:"browser_major",BROWSER_VERSION:"browser_version"}),{CDN_BYTES:"cdn_bytes",P2P_BYTES:"p2p_bytes",UPLOAD_BYTES:"upload_bytes"}),{PLAY_STARTED:"play_started",PLAY_TIME:"play_time",REQUEST:"request",LOAD_OK_TIME:"loadok_t",EXIT_REASON:"exit_reason",ROLLBACK_REASON:"rollback_reason"}),{CONN_TRY:"conn_try",CONN_TRY_TOTAL:"conn_try_total",CONN_SUCC:"conn_succ",CONN_SUCC_TOTAL:"conn_succ_total",CONNECTED:"connected",INIT_PC_TIMEOUT:"init_pc_timeout"}),{PULL_CDN_STREAM:"pull_cdn_stream",PULL_CDN_SUCC:"pull_cdn_succ",PULL_CDN_TIMEOUT:"pull_cdn_timeout",PULL_CDN_FAILED:"pull_cdn_failed",PULL_CDN_ERROR:"pull_cdn_error",BACK_CDN_STREAM:"back_cdn_stream",BACK_CDN_STREAM_REASON:"back_cdn_stream_reason"}),{SUBSCRIBE_CNT:"subscribe_request_c",SUBSCRIBE_TIMEOUT_CNT:"subscribe_timeout_c",SUBSCRIBE_SUCCESS_CNT:"subscribe_success_c",SUBSCRIBE_FAIL_CNT:"subscribe_failure_c",RECV_SUBSCRIBE:"recv_subscribe",RECV_SUBSCRIBE_SUCC:"recv_subscribe_succ",RECV_SUBSCRIBE_CANCEL:"recv_subscribe_cancel"}),{STUCK_COUNT:"stuck_count",SUBSCRIBE_P2P_STUCK:"p2p_stuck_c",STUCK_AVG_DURATION:"stuck_avg_duration",CDN_AV_DIFF:"cdn_av_diff",P2P_AV_DIFF:"p2p_av_diff"}),{FRAME_RATE:"frame_rate",VIDEO_CODEC:"vcodec",AUDIO_CODEC:"acodec",VIDEO_BITRATE:"v_bitrate",AUDIO_BITRATE:"a_bitrate",VIDEO_CLOCK_RATE:"v_clock_rate",AUDIO_CLOCK_RATE:"a_clock_rate"});function V(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F=function(e){function t(){var t=this;return V(t=e.call(this)||this,"tagName","MediaStreamProcessor"),V(t,"mediaStream",void 0),V(t,"trackGenerator",void 0),V(t,"vwriter",void 0),V(t,"destroyed",!1),V(t,"stallDetector",void 0),V(t,"reportUnit",void 0),t.stallDetector=new D,t.reportUnit=new w,t.mediaStream=new MediaStream,t.trackGenerator=new MediaStreamTrackGenerator({kind:"video"}),t.vwriter=t.trackGenerator.writable.getWriter(),t.mediaStream.addTrack(t.trackGenerator),t}return Ta(t,e),t.prototype.setReporter=function(t){var r=this;return this.reportUnit.configure({deleteZeroNumber:!0,fieldsReservedValueAfterReport:[],fieldsReportedWithZeroNumber:[]}),null==t||t.registerReportUint(this.objName,this.reportUnit),this.reportUnit.registerPreHook(this.objName,(function(){var e;r.reportUnit.number(U.STUCK_AVG_DURATION).set(0===(e=r.reportUnit.array("stallDuration").value).length?0:bT(e).call(e,(function(e,t){return e+t}))/e.length),r.reportUnit.deleteField("stallDuration")})),e.prototype.setReporter.call(this,t)},t.prototype.init=function(){var t=this;return this.stallDetector.configure({detectSensitivity:500}).init(),this.stallDetector.on("stall",(function(){t.reportUnit.number(U.STUCK_COUNT).plus(1)})),this.stallDetector.on("recover",(function(e){var r=e.stallDuration;t.reportUnit.array("stallDuration").value.push(r)})),e.prototype.init.call(this)},t.prototype.destroy=function(){this.stallDetector.destroy(),this.destroyed=!0,this.vwriter.abort(),this.stopTrack()},t.prototype.getMediaObj=function(){return this.mediaStream},t.prototype.addMediaStreamTrack=function(e){"video"===e.kind?this.onNewVideoTrack(e):"audio"===e.kind&&this.onNewAudioTrack(e)},t.prototype.onNewVideoTrack=function(e){var t=this,r=new MediaStreamTrackProcessor({track:e}),n=new MediaStreamTrackGenerator({kind:"video"}),i=new TransformStream({transform:function(e,r){t.destroyed||(t.stallDetector.fresh(),t.vwriter.write(e))}});r.readable.pipeThrough(i).pipeTo(n.writable)},t.prototype.onNewAudioTrack=function(e){this.replaceTrack(this.mediaStream,e)},t.prototype.replaceTrack=function(e,t){var r,n,i=e.getTracks();try{for(var o=Pa(i),a=o.next();!a.done;a=o.next()){var s=a.value;t.kind===s.kind&&e.removeTrack(s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}e.addTrack(t)},t.prototype.stopTrack=function(){var e;Co(e=this.mediaStream.getTracks()).call(e,(function(e){e.stop()}))},t}(A);function j(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var B=function(){function e(e,t,r,n){j(this,"config",void 0),j(this,"requestInfo",void 0),j(this,"init",void 0),j(this,"callbacks",void 0),j(this,"retryTimes",0),j(this,"timeoutTimer",null),j(this,"abortController",null),j(this,"stats",{}),j(this,"res",null),this.config=e,this.requestInfo=t,this.init=r,this.callbacks=n,this.load()}return e.prototype.destroy=function(){this.clearCallbacks(),this.clearTimer(),this.abort()},e.prototype.stat=function(){},e.prototype.abort=function(){var e;this.clearTimer(),null===(e=this.abortController)||void 0===e||e.abort()},e.prototype.load=function(){this.abort(),this.setupRequest()},e.prototype.retry=function(){if(this.abort(),this.retryTimes>=this.config.retry)return this.callbacks.onTimeout(),void this.destroy();this.retryTimes+=1,this.load()},e.prototype.setupRequest=function(){var e=this;this.abortController=new AbortController,this.init.signal=this.abortController.signal,this.res=fetch(this.requestInfo,this.init),this.setupResponse(this.res),this.clearTimer(),this.timeoutTimer=Yo((function(){e.retry()}),this.config.timeout||5e3)},e.prototype.setupResponse=function(e){var t=this;e.then((function(e){return t.clearTimer(),e})).then((function(e){return e.ok?"text"===t.config.resType?e.text():"arraybuffer"===t.config.resType?e.arrayBuffer():e.json():(t.callbacks.onError({status:e.status}),void t.destroy())})).then((function(e){t.callbacks.onSuccess({resData:e}),t.destroy()})).catch((function(e){t.callbacks.onError({status:0}),t.destroy()}))},e.prototype.clearTimer=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},e.prototype.clearCallbacks=function(){this.callbacks={onError:function(){},onSuccess:function(){},onTimeout:function(){}}},e}();function W(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var G=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return W(n=e.apply(this,Aa([],ka(t),!1))||this,"req",null),W(n,"config",null),n}return Ta(t,e),t.prototype.configure=function(e){this.config=e},t.prototype.destroy=function(){this.abort()},t.prototype.load=function(){var e,t,r;if(this.abort(),this.config){var n=this.createUrl();this.req=new B({retry:2,timeout:5e3,resType:"text"},n,{method:"GET"},{onError:zr(e=this.onError).call(e,this),onSuccess:zr(t=this.onSuccess).call(t,this),onTimeout:zr(r=this.onTimeout).call(r,this)})}},t.prototype.onTimeout=function(){this.emit("EVENT_CONF_LOADER_TIMEOUT")},t.prototype.onSuccess=function(e){var t=e.resData;this.emit("EVENT_CONF_LOADER_LOADED",function(e){for(var t="",r=[99,117,105],n=0;n<e.length;n++){var i=RT(e).call(e,n)^r[n%r.length];t+=DT(i)}return JSON.parse(t)}(t))},t.prototype.onError=function(e){e.status,this.emit("EVENT_CONF_LOADER_ERROR")},t.prototype.createUrl=function(){var e,t,r;if(!this.config)throw Error("[ConfLoader] [createUrl] empty conf");return gi(e=gi(t=gi(r="".concat(this.config.confBaseUrl)).call(r,this.config.streamId,"?domain=")).call(t,this.config.domain,"&d=0×tamp=")).call(e,oT())},t.prototype.abort=function(){this.req&&(this.req.destroy(),this.req=null)},t}(e.EventEmitter);function Z(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Y=function(){function e(){Z(this,"config",null),Z(this,"confLoader",new G),Z(this,"confTimer",null)}return e.prototype.destroy=function(){this.stop(),this.config=null,this.confLoader.destroy()},e.prototype.configure=function(e){this.config=e,this.confLoader.configure(e)},e.prototype.start=function(){var e=this;if(this.config&&!this.confTimer&&this.config.confInterval){var t=Math.max(this.config.confInterval,6e4);this.confTimer=Zo((function(){e.confLoader.load()}),t)}},e.prototype.stop=function(){this.clearTimer()},e.prototype.restart=function(){this.stop(),this.start()},mh(e.prototype,"loader",{get:function(){return this.config?this.confLoader:null},enumerable:!1,configurable:!0}),e.prototype.clearTimer=function(){this.confTimer&&(clearTimeout(this.confTimer),this.confTimer=null)},e}();function X(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var H=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return X(n=e.apply(this,Aa([],ka(t),!1))||this,"confService",new Y),n}return Ta(t,e),t.prototype.destroy=function(){this.confService.destroy()},t.prototype.configure=function(e){this.confService.configure(e);var t=this.confService.loader;t&&this.setupLoader(t)},t.prototype.start=function(){this.confService.start()},t.prototype.load=function(){this.confService.loader&&this.confService.loader.load()},t.prototype.setupLoader=function(e){var t=this;e.on("EVENT_CONF_LOADER_LOADED",(function(e){t.emit("EVENT_CONF_LOADED",e)})),e.on("EVENT_CONF_LOADER_TIMEOUT",(function(){})),e.on("EVENT_CONF_LOADER_ERROR",(function(){}))},t}(e.EventEmitter);function K(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J=function(){function e(){K(this,"config",null),K(this,"backgroundReportFlag",!1),K(this,"currentReportReq",null)}return e.prototype.destroy=function(){this.config=null,this.clearReportReq()},e.prototype.configure=function(e){this.config=e},e.prototype.enableBackgroundReport=function(){this.backgroundReportFlag=!0},e.prototype.disableBackgroundReport=function(){this.backgroundReportFlag=!1},e.prototype.reportString=function(e){var t=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=[99,117,105],i=0;i<e.length;i++)r[i]=RT(e).call(e,i)^n[i%n.length];return r}(e);this.report(t)},e.prototype.report=function(e){this.config&&(this.backgroundReportFlag?this.sendBackground(this.config.reportUrl,e):this.sendWithFetch(this.config.reportUrl,e))},e.prototype.sendBackground=function(e,t){var r;null!==(r=navigator)&&void 0!==r&&r.sendBeacon&&navigator.sendBeacon(e,t)},e.prototype.sendWithFetch=function(e,t){this.currentReportReq=new B({retry:2,timeout:6e3,resType:"text"},e,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:t},{onError:function(){},onSuccess:function(){},onTimeout:function(){}})},e.prototype.clearReportReq=function(){this.currentReportReq&&(this.currentReportReq.destroy(),this.currentReportReq=null)},e}();function Q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var z=function(){function e(){Q(this,"beforeUnloadListener",null),Q(this,"beforeUnloadCallback",null),Q(this,"collectCallback",null),Q(this,"reportTimer",null),Q(this,"reporter",new J),Q(this,"config",null)}return e.prototype.destroy=function(){var e;this.stop(),this.collectCallback=null,this.config=null,this.removeBeforeUnloadReport(),null===(e=this.reporter)||void 0===e||e.destroy(),this.reporter=null},e.prototype.configure=function(e){var t;this.config=e,null===(t=this.reporter)||void 0===t||t.configure(e)},e.prototype.setCollectCallback=function(e){this.collectCallback=e},e.prototype.start=function(){var e,t=this;this.reportTimer||(this.reportTimer=Zo((function(){t.autoCollectAndReport()}),Math.max((null===(e=this.config)||void 0===e?void 0:e.interval)||0,6e4)))},e.prototype.stop=function(){this.clearTimer()},e.prototype.restart=function(){this.stop(),this.start()},e.prototype.backgroundAutoReport=function(){var e,t;null===(e=this.reporter)||void 0===e||e.enableBackgroundReport(),this.autoCollectAndReport(),null===(t=this.reporter)||void 0===t||t.disableBackgroundReport()},e.prototype.autoCollectAndReport=function(){var e;if(this.collectCallback){var t=this.collectCallback(),r=y_(t);null===(e=this.reporter)||void 0===e||e.reportString(r)}},e.prototype.manualReport=function(e){var t,r=y_(e);null===(t=this.reporter)||void 0===t||t.reportString(r)},e.prototype.enableBeforeUnloadReport=function(e){var t=this;this.removeBeforeUnloadReport(),this.beforeUnloadCallback=e||null,this.beforeUnloadListener=function(){t.beforeUnloadCallback&&t.beforeUnloadCallback(),t.backgroundAutoReport()},window.addEventListener("beforeunload",this.beforeUnloadListener)},e.prototype.removeBeforeUnloadReport=function(){this.beforeUnloadListener&&(this.beforeUnloadCallback=null,window.removeEventListener("beforeunload",this.beforeUnloadListener),this.beforeUnloadListener=null)},e.prototype.clearTimer=function(){this.reportTimer&&(clearInterval(this.reportTimer),this.reportTimer=null)},e}(),q=function(){var e="qvb_leb_uuid",t=localStorage.getItem(e);return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),localStorage.setItem(e,t)),t},$="",ee=function(){return $};q();var te,re="1.0.9";function ne(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.beforeunload=0]="beforeunload",e[e.destroy=1]="destroy",e[e.rollback=2]="rollback"}(te||(te={}));var ie,oe=function(){function e(){var e;ne(this,"reportService",new z),ne(this,"dataCollector",new R),ne(this,"basicReportUnit",new w),ne(this,"detailReportUint",new w),ne(this,"config",null),ne(this,"startTime",oT()),this.basicReportUnit.configure({deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),this.detailReportUint.configure({deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),this.reportService.setCollectCallback(zr(e=this.collectCallback).call(e,this))}return e.prototype.destroy=function(){this.tryToSetCloseReason(te.destroy),this.reportService.backgroundAutoReport(),this.reportService.destroy()},e.prototype.configure=function(e){return this.config=e,this.reportService.configure(e),this},e.prototype.init=function(){var e=this;this.reportService.enableBeforeUnloadReport((function(){e.beforeFinalReport(),e.tryToSetCloseReason(te.beforeunload)})),this.registerReportUint("reporterDetailUint",this.detailReportUint)},e.prototype.start=function(){this.reportService.start()},e.prototype.registerReportUint=function(e,t){this.dataCollector.registerReportUint(e,t)},e.prototype.deleteReportUint=function(e){this.dataCollector.deleteReportUint(e)},e.prototype.beforeFinalReport=function(){this.detailReportUint.number(U.PLAY_TIME).set(Math.floor((oT()-this.startTime)/1e3))},e.prototype.tryToSetCloseReason=function(e){e!==te.beforeunload?e!==te.rollback?e===te.destroy&&(this.basicReportUnit.string("exit_reason").value||this.basicReportUnit.string("exit_reason").set("destroy")):this.basicReportUnit.string("exit_reason").set("rollback"):this.basicReportUnit.string("exit_reason").set("close")},e.prototype.initBasicReportField=function(){if(!this.config)throw Error("report missing config");var e=this.basicReportUnit;return e.number(U.APPID).set(this.config.cloudAppid),e.number(U.PARTNER).set(this.config.xp2pAppid),e.number(U.PLATFORM).set(31),e.string(U.UUID).set(q()),e.string(U.PLAY_ID).set(ee()),e.string(U.REFERER).set(window.location.href),e.string(U.USER_AGENT).set(window.navigator.userAgent),e.number(U.CURRENT_TIME).set(oT()),e.string(U.VERSION).set(re),e.number(U.DATA_TIME).set(Math.round(oT()/1e3)),e.number(U.DATA_TYPE).set(2),e.string(U.URL).set(this.config.streamUrl),e.string(U.VIDEO_TYPE).set("webrtc"),e.string(U.STREAM_ID).set(this.config.streamId()),e.generate()},e.prototype.collectCallback=function(){var e=this.initBasicReportField();return this.detailReportUint.number(U.PLAY_STARTED).set(Math.floor((oT()-this.startTime)/1e3)),e.i=this.dataCollector.generate(),e},e}();function ae(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.new=0]="new",e[e.connecting=1]="connecting",e[e.connected=2]="connected",e[e.disconnected=3]="disconnected",e[e.closed=4]="closed",e[e.fail=5]="fail",e[e.timeout=6]="timeout"}(ie||(ie={}));var se="closed",ce="timeout",ue="disconnect",le="track",de="connected",pe="error",fe="failed",he="stuck",me=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return ae(n=e.apply(this,Aa([],ka(t),!1))||this,"videoEncodedFrameCache",null),ae(n,"audioEncodedFrameCache",null),ae(n,"sourceConfig",null),ae(n,"peer",null),ae(n,"statUnit",null),ae(n,"reportUnit",new w),ae(n,"timeoutTimer",null),ae(n,"closed",!1),ae(n,"peerManager",null),ae(n,"syncController",null),ae(n,"streamInfo",null),n}return Ta(t,e),t.prototype.destroy=function(){this.peerManager=null,this.syncController=null,this.peer=null,this.streamInfo=null,e.prototype.destroy.call(this)},t.prototype.load=function(){this.setTimeout()},t.prototype.close=function(){var e,t=this;if(!this.sourceConfig)throw new Error;this.peerManager&&(this.closed=!0,this.clearTimeout(),null===(e=this.peerManager.getPeer(this.sourceConfig.srcPid))||void 0===e||e.getConnection().destroy(),Yo((function(){t.destroy()})))},t.prototype.isLeb=function(){return!1},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.setStatUnit=function(e){return this.statUnit=e,this},mh(t.prototype,"pid",{get:function(){var e;return null===(e=this.sourceConfig)||void 0===e?void 0:e.srcPid},enumerable:!1,configurable:!0}),t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.setEncodedVideoChunkCache=function(e){return this.videoEncodedFrameCache=e,this},t.prototype.setEncodedAudioChunkCache=function(e){return this.audioEncodedFrameCache=e,this},t.prototype.setSyncController=function(e){return this.syncController=e,this},t.prototype.setStreamInfo=function(e){return this.streamInfo=e,this},t.prototype.setTimeout=function(){var e=this;this.timeoutTimer=Yo((function(){e.emit(ce)}),5e3)},t.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},t.prototype.listenConnection=function(e){var t,r=this,n={srcPid:null===(t=this.sourceConfig)||void 0===t?void 0:t.srcPid};e.on("closed",(function(){r.emit(se,n)})),e.on("failed",(function(){r.emit(fe,n)})),e.on("disconnected",(function(){r.emit(ue,n)})),e.on("connected",(function(){r.emit(de,n)})),e.on("error",(function(e){r.emit(pe,e)})),e.on(i,(function(e){r.emit(i,e)})),e.pc.setOnTrackCallback((function(t){r.clearTimeout(),r.onTrack(t,e)}))},t.prototype.onTrack=function(e,t){},t.prototype.emitTrack=function(e,t){var r;this.emit(le,{srcPid:null===(r=this.sourceConfig)||void 0===r?void 0:r.srcPid,track:e,rtcPeerConnction:t.getRTCPeerConnection()})},t}(A);function ve(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ye,ge=function(){function e(){}return e.create=function(){return"lebcdn_".concat(oT())},e.isCdnPid=function(e){return ha(e).call(e,"lebcdn_")},e}();!function(e){e.P2P="P2P",e.CDN="CDN",e.None="None"}(ye||(ye={}));var be=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return ve(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","Dispatch"),ve(n,"mediaStreamProcessor",null),ve(n,"streamUrl",""),ve(n,"cdnPid",""),ve(n,"p2pTimer",null),ve(n,"subscriber",null),ve(n,"config",null),ve(n,"sourceType",ye.None),ve(n,"reportUnit",new w),ve(n,"statsVar",{loadok:!1,loadStartTime:0}),ve(n,"cdnRetryCtrl",{totalRetryTimes:3,leftRetryTimes:3,retryDelay:0,reset:function(){this.leftRetryTimes=this.totalRetryTimes},retry:function(){this.leftRetryTimes-=1},allowedToRetry:function(){return this.leftRetryTimes>0}}),n}return Ta(t,e),t.prototype.destroy=function(){this.clearP2PTimer()},t.prototype.setMediaStreamProcessor=function(e){this.mediaStreamProcessor=e},t.prototype.setSubscriber=function(e){this.subscriber=e},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.configure=function(e){this.config=e,this.configCdnRetryCtrl(e)},t.prototype.load=function(e){var t=this;this.streamUrl=e,this.reportUnit.number(U.REQUEST).set(1),this.statsVar.loadStartTime=oT();var r=this.loadFromCdn(this.streamUrl);return r&&this.statsStartStream(r),this.clearP2PTimer(),this.p2pTimer=Zo((function(){t.loadFromP2P()}),5e3),OP.resolve()},t.prototype.configCdnRetryCtrl=function(e){this.cdnRetryCtrl.totalRetryTimes=e.connectRetryCount,this.cdnRetryCtrl.leftRetryTimes=e.connectRetryCount,this.cdnRetryCtrl.retryDelay=e.connectRetryDelay},t.prototype.loadFromCdn=function(e){var t=this;if(!this.subscriber)throw Error("missing subscriber");if(!this.config)throw Error("missing config");if(!this.cdnRetryCtrl.allowedToRetry())return this.reportUnit.string(U.ROLLBACK_REASON).set("".concat(a.ERR_LOAD_REACH_MAX_RETRY)),void Yo((function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.ERR_LOAD_REACH_MAX_RETRY,msg:"宸茶揪鏈€澶DN閲嶈瘯娆℃暟: ".concat(t.cdnRetryCtrl.totalRetryTimes)})}));this.cdnRetryCtrl.retry();var r=ge.create(),n=this.subscriber.subscribeLEB({pullStreamUrl:this.config.pullStreamUrl,stopStreamUrl:this.config.stopStreamUrl,streamUrl:e,srcPid:r,param:{uuid:q(),playid:ee()}});return n.on(le,(function(e){var r;"video"===e.track.kind&&t.cdnRetryCtrl.reset(),t.sourceType!==ye.CDN&&(t.sourceType=ye.CDN,null===(r=t.bus)||void 0===r||r.emit(o,{code:a.INF_PLAY_EVT_STREAM_SWITCH,msg:"鍒囨崲鍒癈DN鎷夋祦",data:{source:"CDN"}})),t.onNewSourceTrack(e)})).once(de,(function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.INF_PLAY_EVT_SERVER_CONNECTED,msg:"宸茬粡杩炴帴鍒癱dn鏈嶅姟鍣�"})})).once(ue,(function(){var e;t.reloadCDNAsync({from:"cdn",reason:"".concat(r,"-DISCONNECT")}),null===(e=t.bus)||void 0===e||e.emit(o,{code:a.INF_PLAY_EVT_SERVER_RECONNECT,msg:"杩炴帴cdn鏈嶅姟鍣ㄥけ璐ワ紝宸插惎鍔ㄨ嚜鍔ㄩ噸杩炴仮澶�"})})).once(fe,(function(){t.reloadCDNAsync({from:"cdn",reason:"".concat(r,"-FAILED")})})).once(pe,(function(e){t.reloadCDNAsync({from:"cdn",reason:"".concat(r,"-ERROR")})})).once(se,(function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.INF_PLAY_EVT_STREAM_CLOSED,msg:"娴佽鍏抽棴浜�"})})),n},t.prototype.loadFromP2P=function(e){var t=this;if(this.subscriber){var r=this.subscriber.subscribeP2P(e);return r?(r.on(le,(function(e){var r;t.sourceType!==ye.P2P&&(t.sourceType=ye.P2P,null===(r=t.bus)||void 0===r||r.emit(o,{code:a.INF_PLAY_EVT_STREAM_SWITCH,msg:"鍒囨崲鍒癙2P鎷夋祦",data:{source:"P2P"}})),t.onNewSourceTrack(e)})).once(ue,(function(){t.reloadCDNAsync({from:"p2p",reason:"p2p-DISCONNECT"})})).once(he,(function(){t.reloadCDNAsync({from:"p2p",reason:"p2p-STUCK"})})).once(se,(function(){})),r):void 0}},t.prototype.onNewSourceTrack=function(e){var t=this;return new OP((function(t){t(e)})).then((function(){if(!t.mediaStreamProcessor)throw Error("miss mediaStreamProcessor");t.mediaStreamProcessor.addMediaStreamTrack(e.track)})).catch((function(e){e.fatal}))},t.prototype.reloadCDNAsync=function(e){var t=this,r=e.from,n=e.reason;"p2p"===r&&(this.reportUnit.number(U.BACK_CDN_STREAM).plus(1),this.reportUnit.string(U.BACK_CDN_STREAM_REASON).set(n));var i="p2p"===r?0:this.cdnRetryCtrl.retryDelay;Yo((function(){t.loadFromCdn(t.streamUrl)}),i)},t.prototype.statsStartStream=function(e){var t=this;e.on(ce,(function(){t.statsVar.loadok||t.reportUnit.string(U.ROLLBACK_REASON).set("".concat(a.ERR_LOAD_TIMEOUT)),Yo((function(){var e;null===(e=t.bus)||void 0===e||e.emit(o,{code:a.ERR_LOAD_TIMEOUT,msg:"鎷夋祦瓒呮椂"})}))})).on(le,(function(e){"video"===e.track.kind&&(t.statsVar.loadok||(t.reportUnit.number(U.LOAD_OK_TIME).set(oT()-t.statsVar.loadStartTime),t.statsVar.loadok=!0))})).on(i,(function(e){var r;e.code>=1e3&&e.code<2e3&&t.reportUnit.string(U.ROLLBACK_REASON).set("".concat(e.code)),null===(r=t.bus)||void 0===r||r.emit(o,e)}))},t.prototype.clearP2PTimer=function(){this.p2pTimer&&(clearInterval(this.p2pTimer),this.p2pTimer=null)},t}(A);function Ce(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Se=function(e){function t(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this;return Ce(i=e.apply(this,Aa([],ka(r),!1))||this,"serverName","DefaultServer"),Ce(i,"transport",null),Ce(i,"router",new tT),Ce(i,"triggerHandler",zr(t=i.triggerAPI).call(t,i)),i}return Ta(t,e),t.prototype.destroy=function(){var t;null===(t=this.transport)||void 0===t||t.removeListener(this.serverName,this.triggerHandler),e.prototype.destroy.call(this)},t.prototype.setTransport=function(e){this.transport=e,e.on(this.serverName,this.triggerHandler)},t.prototype.registerAPI=function(e,t){this.router.set(e,t)},t.prototype.deleteAPI=function(e){this.router.delete(e)},t.prototype.triggerAPI=function(e){var t=this.router.get("".concat(e.path));t&&t(e)},t}(A);function Te(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _e=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Te(n=e.apply(this,Aa([],ka(t),!1))||this,"serverName","P2PServer"),n}return Ta(t,e),t}(Se);function we(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Re=0,Ee=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return we(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","TempClient"),we(n,"transport",null),we(n,"localPid",""),n}return Ta(t,e),t.prototype.setTransport=function(e){this.transport=e},t.prototype.setLocalPid=function(e){this.localPid=e},t.prototype.destroy=function(){this.transport=null,e.prototype.destroy.call(this)},t.prototype.request=function(e){var t,r;null===(r=this.transport)||void 0===r||r.send({host:e.host,path:"".concat(e.path),from:e.from||this.localPid,to:e.to,type:e.type||"app",payload:e.payload,requestId:gi(t="req_".concat(oT(),"_")).call(t,Re+=1)})},t}(A);function Pe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ke=function(e){function t(t,r){var n=this;return Pe(n=e.call(this)||this,"tag","WS"),Pe(n,"url",""),Pe(n,"id",""),Pe(n,"options",{retry:0}),Pe(n,"ws",null),n.url=t,n.options=r,n.init(),n}return Ta(t,e),t.prototype.destroy=function(){var t;null===(t=this.ws)||void 0===t||t.close(),this.ws=null,this.id="",e.prototype.destroy.call(this)},t.prototype.send=function(e,t){var r,n;null===(n=this.ws)||void 0===n||n.send(gi(r="S ".concat(e," ")).call(r,t))},t.prototype.init=function(){var e,t,r,n;WebSocket&&(this.ws=new WebSocket(this.url),this.ws.onopen=zr(e=this.onOpen).call(e,this),this.ws.onmessage=zr(t=this.onMessage).call(t,this),this.ws.onclose=zr(r=this.onClose).call(r,this),this.ws.onerror=zr(n=this.onError).call(n,this))},t.prototype.onOpen=function(){},t.prototype.onMessage=function(e){var t=e.data.substring(0,1);if("C"===t)this.id=e.data.substring(2),this.emit("EVENT_WS_ID",this.id);else if("S"===t){var r=e.data.substring(29);this.emit("EVENT_WS_MESSAGE",r)}},t.prototype.onClose=function(){},t.prototype.onError=function(){},t}(A),Ae=r(961),Ie=r.n(Ae);function Le(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xe=function(){function e(){Le(this,"totalBlock",0),Le(this,"recvBlock",0),Le(this,"blocks",new tT)}return e.prototype.getFullContent=function(){if(!this.complete())return null;for(var e="",t=0;t<this.totalBlock;t+=1)e+=this.blocks.get(t);return e},e.prototype.set=function(e,t,r){this.blocks.has(e)||(this.blocks.set(e,t),this.totalBlock=r,this.recvBlock+=1)},e.prototype.complete=function(){return this.totalBlock===this.recvBlock},e}(),De=function(){function e(){Le(this,"messages",new tT)}return e.prototype.set=function(e,t){var r=t.curIndex,n=t.total,i=t.block,o=this.messages.get(e);o||(o=new xe,this.messages.set(e,o)),o.set(r,i,n)},e.prototype.get=function(e){var t;return null===(t=this.messages.get(e))||void 0===t?void 0:t.getFullContent()},e.prototype.delete=function(e){this.messages.delete(e)},e}(),Oe=function(){function e(){}return e.split=function(e){for(var t=oT(),r=[],n=5e3,i=Math.ceil(e.length/n),o=0;o<i;o++){var a,s,c,u=gi(a=gi(s="".concat(t,"-")).call(s,o,"-")).call(a,i,"#");r.push(gi(c="".concat(u)).call(c,sh(e).call(e,o*n,(o+1)*n)))}return r},e.extract=function(e){var t=ta(e).call(e,"#"),r=sh(e).call(e,0,t+1),n=sh(e).call(e,t+1),i=ka(r.split("-"),3),o=i[0],a=i[1],s=i[2];return{key:o,index:rk(a,10),total:rk(s,10),content:n}},e}();function Ne(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Me="EVENT_SIGNAL_ID",Ue="EVENT_SIGNAL_MESSAGE",Ve=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Ne(n=e.apply(this,Aa([],ka(t),!1))||this,"id",""),Ne(n,"tag","Signal"),Ne(n,"messageCache",new De),Ne(n,"ws",null),Ne(n,"url",""),n}return Ta(t,e),t.prototype.connect=function(e){this.url=e,this.init()},t.prototype.destroy=function(){this.ws&&this.ws.destroy(),this.ws=null,this.id="",e.prototype.destroy.call(this)},t.prototype.ready=function(){return!!this.id},t.prototype.send=function(e,t){var r,n=this,i=Ie().compressToBase64(t);Co(r=Oe.split(i)).call(r,(function(t){var r;null===(r=n.ws)||void 0===r||r.send(e,t)}))},t.prototype.init=function(){var e=this;this.ws||(this.ws=new ke(this.url,{retry:0}),this.ws.on("EVENT_WS_ID",(function(t){e.id=t,e.emit("EVENT_SIGNAL_ID",t)})),this.ws.on("EVENT_WS_MESSAGE",(function(t){var r=Oe.extract(t);e.messageCache.set(r.key,{curIndex:r.index,total:r.total,block:r.content});var n=e.messageCache.get(r.key);if(n){e.messageCache.delete(r.key);var i=Ie().decompressFromBase64(n);e.emit("EVENT_SIGNAL_MESSAGE",i)}})))},t}(A);function Fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var je=function(){function e(){Fe(this,"rules",new gC)}return e.prototype.destroy=function(){this.rules.clear()},e.prototype.addRule=function(e){this.rules.add(e)},e.prototype.match=function(e){var t,r;try{for(var n=Pa(this.rules),i=n.next();!i.done;i=n.next())if(i.value.match(e))return!0}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},e}(),Be=function(){function e(){}return e.prototype.destroy=function(){},e.prototype.score=function(){return 0},e}();function We(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ge=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return We(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","Peer"),We(n,"pid",""),We(n,"refreshTime",oT()),We(n,"info",null),We(n,"scorer",new Be),We(n,"filter",new je),We(n,"connection",null),n}return Ta(t,e),t.prototype.setPid=function(e){this.pid=e},t.prototype.setConnection=function(e){this.connection=e},t.prototype.getConnection=function(){if(!this.connection)throw Error("empty conn");return this.connection},t.prototype.setFilter=function(e){this.filter=e},t.prototype.setScorer=function(e){this.scorer=e},t.prototype.destroy=function(){var t;this.scorer.destroy(),Ca(this).destroy(),null===(t=this.connection)||void 0===t||t.destroy(),this.connection=null,e.prototype.destroy.call(this)},t.prototype.fresh=function(){return oT()-this.refreshTime<6e4},t}(A);function Ze(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ye=function(e){function t(t,r){var n,i,o=t.pid,a=this;return Ze(a=e.call(this)||this,"rtcPC",void 0),Ze(a,"pid",""),Ze(a,"onIceCandidateCallback",null),a.pid=o,a.tagName="PeerConnection_".concat(o),a.rtcPC=new RTCPeerConnection(r),a.rtcPC.onicecandidate=zr(n=a.onIceCandidate).call(n,a),a.rtcPC.oniceconnectionstatechange=zr(i=a.onIceConnectionStateChange).call(i,a),a}return Ta(t,e),t.prototype.destroy=function(){this.rtcPC.close(),this.onIceCandidateCallback=null,e.prototype.destroy.call(this)},t.prototype.setOnTrackCallback=function(e){this.rtcPC.ontrack=e},t.prototype.clearOnTrackCallbak=function(){this.rtcPC.ontrack=null},t.prototype.setOnIceCandidateCallback=function(e){this.onIceCandidateCallback=e},t.prototype.createOffer=function(e){var t=this;return this.rtcPC.createOffer(e).then((function(e){return e.sdp=function(e,t){var r=e.split("\r\n"),n=[];Co(r).call(r,(function(e){var t=e.toLowerCase();$i(t).call(t,"a=rtpmap")&&$i(t).call(t,"h264")&&n.push(e)}));var i=Ca(t=ck(n).call(n,(function(e){var t=/a=rtpmap:(\d+)\s/.exec(e);return t&&t.length>1?t[1]:null}))).call(t,(function(e){return null!==e})),o=[];return Co(r).call(r,(function(e){var t=e;if($i(e).call(e,"a=fmtp:111")&&(t="".concat(e,";stereo=1")),$i(e).call(e,"a=fmtp")){var r=/a=fmtp:(\d+)\s/.exec(e);r&&r.length>1&&$i(i).call(i,r[1])&&(t="".concat(e,";sps-pps-idr-in-keyframe=1"))}o.push(t)})),o.join("\r\n")}(e.sdp||""),t.rtcPC.setLocalDescription(e)})).then((function(){return t.rtcPC.localDescription})).catch((function(t){return OP.reject({code:a.ERR_PLAY_WEBRTC_FAIL,msg:"createOffer fail, offer: ".concat(e)})}))},t.prototype.recvOffer=function(e){return this.rtcPC.setRemoteDescription(new RTCSessionDescription(e))},t.prototype.createAnswer=function(){var e=this;return this.rtcPC.createAnswer().then((function(t){return e.rtcPC.setLocalDescription(t)})).then((function(){return e.rtcPC.localDescription}))},t.prototype.recvAnswer=function(e){return this.rtcPC.setRemoteDescription(new RTCSessionDescription(e)).catch((function(t){return OP.reject({code:a.ERR_PLAY_WEBRTC_FAIL,msg:"setRemoteDescription fail, answer: ".concat(e.sdp)})}))},t.prototype.recvCandidate=function(e){if(e)return this.rtcPC.addIceCandidate(new RTCIceCandidate(e))},t.prototype.onIceCandidate=function(e){var t=null==e?void 0:e.candidate;null!=t&&t.candidate&&this.onIceCandidateCallback&&this.onIceCandidateCallback(t.toJSON())},t.prototype.onIceConnectionStateChange=function(){this.rtcPC.iceConnectionState,"failed"===this.rtcPC.iceConnectionState&&this.rtcPC.restartIce()},t}(A);function Xe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var He=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Xe(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","DataChannel"),Xe(n,"rtcDataChannel",null),Xe(n,"config",null),Xe(n,"pc",null),n}return Ta(t,e),t.prototype.configure=function(e){return this.config=e,this},t.prototype.destroy=function(){var e;null===(e=this.rtcDataChannel)||void 0===e||e.close(),this.rtcDataChannel=null,this.pc=null},t.prototype.setRTCPeerConnection=function(e){return this.pc=e,this},t.prototype.init=function(){if(!this.config||!this.pc)throw Error("missing param");return this.rtcDataChannel=this.pc.createDataChannel(this.config.label,{id:this.config.id,negotiated:!0}),this.setCallback(this.rtcDataChannel),this},t.prototype.setCallback=function(e){var t=this;e.onopen=function(){t.emit("open")},e.onmessage=function(e){t.emit(e.data)},e.onerror=function(e){t.emit("error")},e.onclosing=function(){t.emit("closing")},e.onclose=function(){t.emit("close")}},t}(A);function Ke(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Je=function(e){function t(t,r){var n=this;return Ke(n=e.call(this)||this,"tagName","P2PConnection"),Ke(n,"pc",void 0),Ke(n,"connInit",void 0),Ke(n,"makingOffer",!1),Ke(n,"isSettingRemoteAnswerPending",!1),Ke(n,"closed",!1),Ke(n,"connectTimer",null),Ke(n,"nego",!1),Ke(n,"dc",void 0),Ke(n,"destroyed",!1),n.connInit=t,n.tagName="P2PConnection_".concat(n.connInit.targetPid),n.pc=new Ye({pid:t.targetPid},r),n.dc=new He,n}return Ta(t,e),t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dc.destroy(),this.pc.destroy(),this.close(),e.prototype.destroy.call(this))},t.prototype.getRTCPeerConnection=function(){return this.pc.rtcPC},t.prototype.init=function(){var e,t=this;this.on("EVENT_P2P_SIGNAL_RECV",zr(e=this.recvSignalMessage).call(e,this)),this.pc.setOnIceCandidateCallback((function(e){t.sendSignal({from:t.connInit.localPid,to:t.connInit.targetPid,type:"iceCandidate",payload:e})})),this.pc.rtcPC.onnegotiationneeded=function(){return Ra(t,void 0,void 0,(function(){return Ea(this,(function(e){switch(e.label){case 0:return this.nego=!0,[4,this.connect()];case 1:return e.sent(),this.nego=!1,[2]}}))}))},this.pc.rtcPC.onconnectionstatechange=function(){var e=t.pc.rtcPC.connectionState;t.emit(e)},this.dc.setRTCPeerConnection(this.pc.rtcPC).configure({label:"base",id:0}).init().on("error",(function(){t.emit("disconnected")}))},t.prototype.recvSignalMessage=function(e){return Ra(this,void 0,void 0,(function(){var t;return Ea(this,(function(r){switch(r.label){case 0:switch(e.type){case"answer":return[3,1];case"offer":return[3,5];case"iceCandidate":return[3,10]}return[3,13];case 1:return r.trys.push([1,3,,4]),this.isSettingRemoteAnswerPending=!0,[4,this.pc.recvAnswer(e.payload)];case 2:return r.sent(),this.isSettingRemoteAnswerPending=!1,[3,4];case 3:return r.sent(),[3,4];case 4:case 9:return[3,13];case 5:return r.trys.push([5,8,,9]),this.ignoreOffer?[2]:[4,this.pc.recvOffer(e.payload)];case 6:return r.sent(),[4,this.pc.rtcPC.setLocalDescription()];case 7:return r.sent(),(t=this.pc.rtcPC.localDescription)?(this.sendSignal({from:this.connInit.localPid,to:this.connInit.targetPid,type:"answer",payload:t}),[3,9]):[2];case 8:return r.sent(),[3,9];case 10:return r.trys.push([10,12,,13]),[4,this.pc.recvCandidate(e.payload)];case 11:return r.sent(),[3,13];case 12:return r.sent(),this.ignoreOffer,[3,13];case 13:return[2]}}))}))},t.prototype.connect=function(){return Ra(this,void 0,void 0,(function(){var e,t;return Ea(this,(function(r){switch(r.label){case 0:if(!this.nego)return[2];e={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.makingOffer=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.pc.createOffer(e)];case 2:return(t=r.sent())?(this.sendSignal({from:this.connInit.localPid,to:this.connInit.targetPid,type:"offer",payload:t}),[3,5]):[2];case 3:return r.sent(),[3,5];case 4:return this.makingOffer=!1,[7];case 5:return[2]}}))}))},t.prototype.close=function(){this.closed||(this.closed=!0,this.emit("closed"))},t.prototype.sendSignal=function(e){this.emit("EVENT_P2P_SIGNAL_SEND",e)},mh(t.prototype,"politeRole",{get:function(){var e=this.connInit;return e.localPid>e.targetPid},enumerable:!1,configurable:!0}),mh(t.prototype,"readyForOffer",{get:function(){return!this.makingOffer&&("stable"===this.pc.rtcPC.signalingState||this.isSettingRemoteAnswerPending)},enumerable:!1,configurable:!0}),mh(t.prototype,"offerCollision",{get:function(){return!this.readyForOffer},enumerable:!1,configurable:!0}),mh(t.prototype,"ignoreOffer",{get:function(){return!this.politeRole&&this.offerCollision},enumerable:!1,configurable:!0}),t}(A);function Qe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ze=0,qe=function(e){function t(t,r){var n,i=this;return Qe(i=e.call(this)||this,"tagName","LEBConnection"),Qe(i,"pc",void 0),Qe(i,"initConfig",void 0),Qe(i,"svrSig",""),Qe(i,"closed",!1),Qe(i,"sessionId",oT()),Qe(i,"destroyed",!1),i.initConfig=t,i.tagName=gi(n="".concat(i.tagName,"_")).call(n,i.initConfig.srcPid),i.pc=new Ye({pid:t.srcPid},r),i.pc.rtcPC.onconnectionstatechange=function(){var e=i.pc.rtcPC.connectionState;i.emit(e)},i.pc.rtcPC.oniceconnectionstatechange=function(){i.pc.rtcPC.connectionState},i}return Ta(t,e),mh(t.prototype,"isSdpStreamUrl",{get:function(){return/^https?:\/\/.+\.sdp/.test(this.initConfig.streamUrl)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.close(),this.pc.destroy(),e.prototype.destroy.call(this))},t.prototype.getRTCPeerConnection=function(){return this.pc.rtcPC},t.prototype.connect=function(){return Ra(this,void 0,void 0,(function(){var e,t,r,n,o;return Ea(this,(function(s){switch(s.label){case 0:e={offerToReceiveAudio:!0,offerToReceiveVideo:!0,voiceActivityDetection:!1},s.label=1;case 1:return s.trys.push([1,7,,8]),[4,this.pc.createOffer(e)];case 2:return t=s.sent(),this.emit(i,{code:a.INF_PLAY_EVT_REQUEST_PULL_BEGIN,msg:"寮€濮嬫媺娴佹椂瑙﹀彂",data:{localsdp:null==t?void 0:t.sdp,sessionid:this.sessionId}}),this.isSdpStreamUrl?[4,this.fetchStreamSdp(t)]:[3,4];case 3:return n=s.sent(),[3,6];case 4:return[4,this.fetchStream(t)];case 5:n=s.sent(),s.label=6;case 6:return r=n,this.svrSig=r.svrsig,this.emit(i,{code:a.INF_PLAY_EVT_REQUEST_PULL_SUCCESS,msg:"鎷夋祦鎴愬姛鍚庤Е鍙�",data:{localsdp:null==t?void 0:t.sdp,remotesdp:r.remotesdp.sdp,sessionid:this.sessionId}}),this.pc.recvAnswer(r.remotesdp),[3,8];case 7:return o=s.sent(),this.emit(i,o),this.emit("error",{errcode:0,errmsg:"leb pull stream fetch error: ".concat(o)}),[3,8];case 8:return[2]}}))}))},t.prototype.fetchStream=function(e){return Ra(this,void 0,void 0,(function(){var t,r,n,i;return Ea(this,(function(o){var s,c,u,l,d;switch(o.label){case 0:t={streamurl:"".concat(this.initConfig.streamUrl),sessionid:this.sessionId,clientinfo:this.initConfig.param.uuid,localsdp:e,seipass:1},r=gi(s=gi(c=gi(u=gi(l=gi(d="".concat(this.initConfig.pullStreamUrl,"?from=")).call(d,this.initConfig.srcPid,"&uuid=")).call(l,this.initConfig.param.uuid,"&playid=")).call(u,this.initConfig.param.playid,"&sessionid=")).call(c,this.sessionId,"&reqCounter=")).call(s,ze+=1),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(r,{method:"POST",body:y_(t),headers:{"Content-Type":"application/json"}})];case 2:return[4,o.sent().json()];case 3:return[2,(n=o.sent()).errcode||!n.svrsig?OP.reject({code:a.ERR_PLAY_REQUEST_PULL_FAIL,msg:"鎷夋祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:n}):n];case 4:return i=o.sent(),[2,OP.reject({code:a.ERR_FETCH_REQUEST_FAIL,msg:"鎷夋祦鎺モ紳缃戠粶寮傚父",data:{from:"PULL_STREAM",url:r,error:i}})];case 5:return[2]}}))}))},t.prototype.fetchStreamSdp=function(e){return Ra(this,void 0,void 0,(function(){var t,r,n,i,o,s,c,u;return Ea(this,(function(l){switch(l.label){case 0:return t={version:"v1.0",sessionid:this.sessionId,localSdp:e},[4,fetch(this.initConfig.streamUrl,{method:"POST",body:y_(t),headers:{"Content-Type":"application/json"}})];case 1:r=l.sent(),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,r.json()];case 3:return n=l.sent(),i=n.code,o=n.message,s=n.remoteSdp,c=n.svrsig,200!==i?[2,OP.reject({code:a.ERR_PLAY_REQUEST_PULL_FAIL,msg:"鎷夋祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:n})]:[2,{remotesdp:s,svrsig:c,errcode:0,errmsg:o}];case 4:return u=l.sent(),[2,OP.reject({code:a.ERR_FETCH_REQUEST_FAIL,msg:"鎷夋祦鎺モ紳缃戠粶寮傚父",data:{from:"PULL_STREAM",url:this.initConfig.streamUrl,error:u}})];case 5:return[2]}}))}))},t.prototype.close=function(){return Ra(this,void 0,void 0,(function(){return Ea(this,(function(e){switch(e.label){case 0:return this.closed?[3,2]:(this.closed=!0,this.emit("closed"),[4,this.closeLeb()]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.closeLeb=function(){return Ra(this,void 0,void 0,(function(){var e,t,r;return Ea(this,(function(n){var o,s;switch(n.label){case 0:if(this.isSdpStreamUrl&&!this.svrSig)return[2];e={streamurl:this.initConfig.streamUrl,svrsig:this.svrSig},t=gi(o="".concat(this.initConfig.stopStreamUrl,"?from=")).call(o,this.initConfig.srcPid),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t,{method:"post",body:y_(e),headers:{"Content-Type":"application/json"}})];case 2:return[4,n.sent().json()];case 3:return(r=n.sent()).errcode&&(this.emit("error",{errcode:1,errmsg:gi(s="leb stop stream response error: errcode: ".concat(r.errcode,", errmsg: ")).call(s,r.errmsg)}),this.emit(i,{code:a.ERR_PLAY_REQUEST_STOP_FAIL,msg:"鍋滄祦鎺モ紳鍚庡彴杩斿洖鎶ラ敊",data:{url:t}})),[3,5];case 4:return n.sent(),this.emit(i,{code:a.ERR_FETCH_REQUEST_FAIL,msg:"鍋滄祦鎺モ紳缃戠粶寮傚父",data:{from:"STOP_STREAM",url:t}}),[3,5];case 5:return[2]}}))}))},t}(A);function $e(e,t){var r=gh(e);if(ch){var n=ch(e);t&&(n=Ca(n).call(n,(function(t){return Ph(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Co(r=$e(Object(i),!0)).call(r,(function(t){tt(e,t,i[t])})):Vh?Yh(e,Vh(i)):Co(n=$e(Object(i))).call(n,(function(t){mh(e,t,Ph(i,t))}))}return e}function tt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rt=function(){function e(){}return e.prototype.create=function(e){var t=this.createPeer({pid:e.srcPid}),r=this.createConnection(e);return t.setConnection(r),t},e.prototype.createConnection=function(e){return new qe(e,{iceServers:[],encodedInsertableStreams:!0})},e.prototype.createPeer=function(e){var t=e.pid,r=new Ge;return r.setPid(t),r},e}(),nt=function(){function e(){tt(this,"client",null),tt(this,"server",null),tt(this,"localPid",""),tt(this,"config",null)}return e.prototype.create=function(e){var t=this.createConnection(e),r=this.createPeer({pid:e.targetPid});return r.setConnection(t),r},e.prototype.setClient=function(e){return this.client=e,this},e.prototype.setServer=function(e){return this.server=e,this},e.prototype.setLocalPid=function(e){return this.localPid=e,this},e.prototype.configure=function(e){this.config=e},e.prototype.createConnection=function(e){var t=this;if(!this.server)throw Error("P2PPeerBuilder empty server");if(!this.config)throw Error("P2PPeerBuilder empty config");var r=new Je({targetPid:e.targetPid,localPid:this.localPid},{iceServers:[{urls:["stun:".concat(this.config.stun)]}],encodedInsertableStreams:!0});return r.on("EVENT_P2P_SIGNAL_SEND",(function(e){if(!t.server||!t.client||!t.localPid)throw Error("P2PPeerBuilder param error");var r=et(et({},e),{},{from:t.localPid,path:"signal",host:t.server.serverName});t.client.request(r)})),r.init(),r},e.prototype.createPeer=function(e){var t=e.pid,r=new Ge;return r.setPid(t),r},e}();function it(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ot=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ta(t,e),t.prototype.send=function(e){},t.prototype.recv=function(e){},t}(t()),at=function(e){function t(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this;return it(i=e.apply(this,Aa([],ka(r),!1))||this,"signal",null),it(i,"recvHandler",zr(t=i.recv).call(t,i)),i}return Ta(t,e),t.prototype.destroy=function(){var e;null===(e=this.signal)||void 0===e||e.removeListener(Ue,this.recvHandler),this.signal=null,this.removeAllListeners()},t.prototype.setSignal=function(e){this.signal=e,e.on(Ue,this.recvHandler)},t.prototype.send=function(e){var t;null===(t=this.signal)||void 0===t||t.send(e.to,y_(e))},t.prototype.recv=function(e){var t;try{t=JSON.parse(e)}catch(e){return}this.emit(t.host,t)},t}(ot);function st(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ct=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return st(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","PeerPool"),st(n,"reportUnit",new w),st(n,"candidate",new tT),st(n,"connected",new tT),st(n,"connecting",new tT),st(n,"config",null),st(n,"tickTimer",null),n}return Ta(t,e),t.prototype.configure=function(e){var t=this;this.config=e,this.reportUnit.configure({deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:["conn_try_total","conn_succ_total"]}),this.reportUnit.registerPreHook(this.objName,(function(){var e=t.stats();t.reportUnit.number("connected").set(e.connected)}))},t.prototype.init=function(){var e;if(!this.config)throw Error("missing config");this.clearTimer(),this.tickTimer=Zo(zr(e=this.tick).call(e,this),this.config.tickInterval)},t.prototype.destroy=function(){var t,r,n;this.clearTimer(),Co(t=this.connecting).call(t,(function(e){e.destroy()})),this.connecting.clear(),Co(r=this.candidate).call(r,(function(e){e.destroy()})),this.candidate.clear(),Co(n=this.connected).call(n,(function(e){e.destroy()})),this.connected.clear(),this.config=null,e.prototype.destroy.call(this)},t.prototype.stats=function(){return{connected:this.connected.size,connecting:this.connecting.size,candidate:this.candidate.size}},t.prototype.addCandidate=function(e){this.get(e.pid)||(this.candidate.set(e.pid,e),this.tick())},t.prototype.addConnecting=function(e){this.get(e.pid)||(this.connecting.set(e.pid,e),this.setupConnection(e))},t.prototype.tick=function(){if(this.config&&!(this.connecting.size>this.config.maxConnecting)){var e=this.config.maxConnected-this.connected.size;if(e)for(var t,r=vk(t=this.candidate).call(t),n=function(){var e=r.next();return e.done?null:e.value[1]},i=e;i>0;){var o=n();if(!o)return void this.emit("EVENT_LESS_CANDIDATE",{lackCnt:e});o.fresh()?this.connecting.has(o.pid)||this.connected.has(o.pid)||(this.reportUnit.number("conn_try").plus(1),this.reportUnit.number("conn_try_total").plus(1),this.candidate.delete(o.pid),this.prepareConnectCandiate(o),i-=1):this.remove(o.pid)}}},t.prototype.bestOne=function(e){var t,r;try{for(var n=Pa(this.connected),i=n.next();!i.done;i=n.next()){var o=ka(i.value,2),a=o[0],s=o[1];if(!$i(e).call(e,a))return s}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return null},t.prototype.get=function(e){return this.candidate.get(e)||this.connected.get(e)||this.connecting.get(e)},t.prototype.getConnected=function(e){return this.connected.get(e)},t.prototype.remove=function(e){var t=this.get(e);t&&(this.connecting.delete(e),this.connected.delete(e),this.candidate.delete(e),Yo((function(){t.destroy()})))},t.prototype.prepareConnectCandiate=function(e){this.setupConnection(e),this.connected.delete(e.pid),this.connecting.set(e.pid,e),e.getConnection().connect()},t.prototype.setupConnection=function(e){var t=this,r=function(r){t.remove(e.pid)},n=Yo((function(){t.reportUnit.number("init_pc_timeout").plus(1),r()}),1e4),i=e.getConnection();i.on("connected",(function(){t.reportUnit.number("conn_succ").plus(1),t.reportUnit.number("conn_succ_total").plus(1),clearTimeout(n),t.connecting.delete(e.pid),t.connected.set(e.pid,e)})),i.on("closed",(function(){clearTimeout(n),r()})),i.on("disconnected",(function(){r()})),i.on("failed",(function(){r()}))},t.prototype.clearTimer=function(){this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=null)},t}(A);function ut(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var lt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return ut(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","PeerManager"),ut(n,"peerPool",new ct),ut(n,"peerCache",null),ut(n,"peerBuilder",null),ut(n,"config",null),n}return Ta(t,e),t.prototype.destroy=function(){this.peerPool&&this.peerPool.destroy(),this.peerBuilder=null,e.prototype.destroy.call(this)},t.prototype.configure=function(e){this.config=e,this.peerPool.configure(e)},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.peerPool.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.init=function(){var e=this;this.peerPool.on("EVENT_LESS_CANDIDATE",(function(t){if(t.lackCnt,!e.peerCache)throw Error("missing param");var r=e.peerCache.getPid();e.addPeerId(r)})),this.peerPool.init()},t.prototype.setPeerBuilder=function(e){return this.peerBuilder=e,this},t.prototype.setPeerCache=function(e){return this.peerCache=e,this},t.prototype.setSortStrategy=function(){},t.prototype.setKickStrategy=function(){},t.prototype.addPeerId=function(e){if(e&&!this.peerPool.get(e)&&this.peerBuilder&&this.config){var t=this.peerBuilder.create({targetPid:e});this.addPeer(t)}},t.prototype.addPeer=function(e){this.peerPool.addCandidate(e)},t.prototype.addConnectingPeer=function(e){this.peerPool.addConnecting(e)},t.prototype.getPeer=function(e){return this.peerPool.get(e)},t.prototype.getConnectedPeer=function(e){return this.peerPool.getConnected(e)},t.prototype.getBestPeer=function(e){var t=e.excludePeerId;return this.peerPool.bestOne(t)},t}(A);function dt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var pt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return dt(n=e.apply(this,Aa([],ka(t),!1))||this,"pid",""),dt(n,"streamId",""),dt(n,"timer",null),dt(n,"config",null),n}return Ta(t,e),t.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.removeAllListeners(),this.timer=null},t.prototype.configure=function(e){this.config=e},t.prototype.setPid=function(e){return this.pid=e,this},t.prototype.setStreamId=function(e){return this.streamId=e,this},t.prototype.start=function(){var e=this;if(!this.config)throw Error("missing config");!this.timer&&this.config.trackerInterval&&(this.timer=Zo((function(){e.request()}),this.config.trackerInterval))},t.prototype.ready=function(){return this.pid&&this.streamId},t.prototype.request=function(){var e,t,r,n,i=this;if(!this.config)throw Error("missing config");if(this.ready()){var o=gi(e=gi(t=gi(r=gi(n="".concat(this.config.trackerUrl,"?pid=")).call(n,this.pid,"&channel=")).call(r,this.config.cloudAppid,"_")).call(t,this.streamId,"_")).call(e,this.config.trackerVersion,"&streamId=0&mode=bat");fetch(o).then((function(e){return e.text()})).then((function(e){return JSON.parse(e)})).then((function(e){i.parsePeer(e)})).catch((function(e){}))}},t.prototype.parsePeer=function(e){var t,r=this;Co(t=e.peers).call(t,(function(e){var t=e.pid;r.emit("EVENT_NEW_PEER",{pid:t})}))},t}(t());function ft(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ht=function(){function e(){ft(this,"defaultMaxCandidateSize",100),ft(this,"localPid",""),ft(this,"peers",new gC),ft(this,"tracker",new pt),ft(this,"config",null)}return e.prototype.destroy=function(){this.tracker.destroy(),this.peers.clear(),this.config=null},e.prototype.setStreamId=function(e){return this.tracker.setStreamId(e),this},e.prototype.setPeerId=function(e){return this.tracker.setPid(e),this},e.prototype.start=function(){this.tracker.start()},e.prototype.configure=function(e){this.config=e,this.tracker.configure(this.config)},e.prototype.init=function(){var e=this;if(!this.config)throw Error("miss config");this.tracker.on("EVENT_NEW_PEER",(function(t){var r=t.pid;e.addPid(r)}))},e.prototype.addPid=function(e){var t;if(this.peers.has(e)&&this.peers.delete(e),this.peers.add(e),this.peers.size>((null===(t=this.config)||void 0===t?void 0:t.maxCandidateSize)||this.defaultMaxCandidateSize)){var r=this.getOldestPid();r&&this.peers.delete(r)}},e.prototype.getPid=function(){var e=this.getFreshPid();return e&&this.peers.delete(e),e},e.prototype.getFreshPid=function(){return this.peers.size?Aa([],ka(this.peers),!1)[this.peers.size-1]:null},e.prototype.getOldestPid=function(){return this.peers.size?Aa([],ka(this.peers),!1)[0]:null},e}();function mt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vt=function(){function e(){mt(this,"path","signal"),mt(this,"peerManager",null),mt(this,"peerBuilder",null),mt(this,"server",null)}return e.prototype.destroy=function(){this.server&&(this.server.deleteAPI(this.path),this.server=null)},e.prototype.setPeerManager=function(e){return this.peerManager=e,this},e.prototype.setPeerBuilder=function(e){return this.peerBuilder=e,this},e.prototype.setServer=function(e){var t;return this.server=e,this.server.registerAPI(this.path,zr(t=this.handler).call(t,this)),this},e.prototype.handler=function(e){var t;if(this.peerBuilder&&this.peerManager){var r=null===(t=this.peerManager)||void 0===t?void 0:t.getPeer(e.from);"offer"===e.type&&(r||(r=this.peerBuilder.create({targetPid:e.from}),this.peerManager.addConnectingPeer(r))),r&&r.getConnection().emit("EVENT_P2P_SIGNAL_RECV",e)}},e}();function yt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var gt=function(){function e(){yt(this,"path","SubscribeTrack"),yt(this,"server",null),yt(this,"subscriber",null)}return e.prototype.destroy=function(){var e;null===(e=this.server)||void 0===e||e.deleteAPI(this.path),this.server=null,this.subscriber=null},e.prototype.setServer=function(e){var t;return this.server=e,this.server.registerAPI(this.path,zr(t=this.handler).call(t,this)),this},e.prototype.setSubscriber=function(e){this.subscriber=e},e.prototype.handler=function(e){if(this.subscriber){var t=e.from;"subscribe"===e.payload?this.subscriber.onSubscribe(t):"cancelSubscribe"===e.payload&&this.subscriber.onCancelSubscribe(t)}},e}();function bt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ct,St=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return bt(n=e.apply(this,Aa([],ka(t),!1))||this,"chunks",[]),bt(n,"rtcEncodedStreams",null),bt(n,"aborted",!1),bt(n,"lastTimestamp",0),bt(n,"maxCache",200),n}return Ta(t,e),t.prototype.destroy=function(){this.lastTimestamp=0,this.chunks=[],e.prototype.removeAllListeners.call(this)},t.prototype.configure=function(e){var t=e.max;this.maxCache=t},t.prototype.reset=function(){this.chunks=[]},t.prototype.getHead=function(){return this.chunks[0]},t.prototype.shift=function(){return this.chunks.shift()},t.prototype.removeHead=function(){return this.chunks.shift()},mh(t.prototype,"size",{get:function(){return this.chunks.length},enumerable:!1,configurable:!0}),t.prototype.cache=function(e){this.lastTimestamp=e.timestamp;var t={type:e.type,timestamp:e.timestamp,data:new Uint8Array(e.data).buffer,chunk:e.chunk};this.chunks.push(t),this.chunks.length>this.maxCache&&this.removeHead(),this.emit("new_chunk",t)},t.prototype.remove=function(e){for(var t;this.chunks.length>e;)this.chunks.shift();var r=this.chunks.length;return r<=e?0:Wk(t=this.chunks).call(t,0,r-e)},t.prototype.dropOutdateChunk=function(e){for(var t=this.getHead();t&&t.timestamp<e;)this.removeHead(),t=this.getHead()},t}(e.EventEmitter);function Tt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.key=31]="key",e[e.delta=32]="delta",e[e.empty=33]="empty"}(Ct||(Ct={}));var _t=function(){function e(){}return e.encode=function(e){var t=e.chunkData.byteLength+4+1,r=new Rt({totalBytes:t});return r.setArraybuffer(e.chunkData),r.setUint32(e.timestamp),r.setUnit8(Ct[e.type]),r.getArraybuffer()},e.decode=function(e){var t=new wt(e),r=t.getArraybuffer(e.byteLength-5);return{timestamp:t.getUint32(),type:Ct[t.getUint8()],chunkData:r}},e}(),wt=function(){function e(e){Tt(this,"u8a",void 0),Tt(this,"dataview",void 0),Tt(this,"bytesOffset",0),Tt(this,"totalBytes",0),this.u8a=new Uint8Array(e),this.dataview=new DataView(e),this.totalBytes=e.byteLength}return e.prototype.getUint8=function(){var e=this.dataview.getUint8(this.bytesOffset);return this.bytesOffset+=1,e},e.prototype.getUint32=function(){var e=this.dataview.getUint32(this.bytesOffset);return this.bytesOffset+=4,e},e.prototype.getArraybuffer=function(e,t){var r;void 0===t&&(t=0);var n=sh(r=this.u8a).call(r,t,e);return this.bytesOffset+=t+e,n.buffer},e}(),Rt=function(){function e(e){var t=e.totalBytes;Tt(this,"totalBytes",0),Tt(this,"u8a",void 0),Tt(this,"dataview",void 0),Tt(this,"bytesOffset",0),this.totalBytes=t,this.u8a=new Uint8Array(t),this.dataview=new DataView(this.u8a.buffer)}return e.prototype.setUnit8=function(e){this.dataview.setUint8(this.bytesOffset,e),this.bytesOffset+=1},e.prototype.setUint32=function(e){this.dataview.setUint32(this.bytesOffset,e),this.bytesOffset+=4},e.prototype.setArraybuffer=function(e){this.u8a.set(new Uint8Array(e),this.bytesOffset),this.bytesOffset+=e.byteLength},e.prototype.getArraybuffer=function(){return this.u8a.buffer},e}();function Et(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Pt=function(){function e(){Et(this,"videoTrack",new MediaStreamTrackGenerator({kind:"video"})),Et(this,"audioTrack",new MediaStreamTrackGenerator({kind:"audio"})),Et(this,"videoWriter",this.videoTrack.writable.getWriter()),Et(this,"audioWriter",this.audioTrack.writable.getWriter()),Et(this,"timer",null)}return e.prototype.destroy=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},e.prototype.getVideoTrack=function(){return this.videoTrack},e.prototype.getAudioTrack=function(){return this.audioTrack},e.prototype.writeAudioDataToTrack=function(){var e=this.createAudioData();this.audioWriter.write(e).catch((function(e){}))},e.prototype.writeVideoFrameToTrack=function(e){var t=e.timestamp,r=this.createVideoFrame({timestamp:t});return this.videoWriter.write(r).catch((function(e){})),r},e.prototype.createAudioData=function(){var e={timestamp:oT(),data:new ArrayBuffer(10),sampleRate:48e3,format:"u8",numberOfFrames:1,numberOfChannels:1};return new AudioData(e)},e.prototype.createVideoFrame=function(e){for(var t={format:"I420",codedHeight:16,codedWidth:16,colorSpace:{matrix:"bt709",primaries:"bt709",transfer:"bt709"},displayHeight:16,displayWidth:16,timestamp:e.timestamp},r=new Uint8Array(t.codedWidth*t.codedHeight*4),n=0;n<t.codedWidth;n++)for(var i=0;i<t.codedHeight;i++){var o=4*(i*t.codedWidth+n);r[o]=127,r[o+1]=255,r[o+2]=212,r[o+3]=255}return new VideoFrame(r,t)},e}();function kt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var At=function(e,t){var r,n,i,o=null===(i=RTCRtpReceiver.getCapabilities(t))||void 0===i?void 0:i.codecs,a=[];if(!o)return a;try{for(var s=Pa(o),c=s.next();!c.done;c=s.next()){var u=c.value;u.mimeType===e&&a.push(u)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return a},It=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return kt(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","StreamTrackProvider"),kt(n,"targetPid",""),kt(n,"srcPid",""),kt(n,"peerManager",null),kt(n,"driverTrack",new Pt),kt(n,"videoEncodedFrameCache",null),kt(n,"audioEncodedFrameCache",null),kt(n,"statUnit",null),kt(n,"reportUnit",new w),kt(n,"audioAbortController",new AbortController),kt(n,"videoAbortController",new AbortController),kt(n,"newVideoChunkHandler",null),kt(n,"videoEmitChunkTimer",null),n}return Ta(t,e),t.prototype.destroy=function(){var t;this.clearTimer(),this.onCancelSubscribe(),this.driverTrack.destroy(),this.peerManager=null,this.audioAbortController.abort("StreamTrackProvider_abort_audio"),this.videoAbortController.abort("StreamTrackProvider_abort_video"),this.newVideoChunkHandler&&(null===(t=this.videoEncodedFrameCache)||void 0===t||t.off("new_chunk",this.newVideoChunkHandler)),this.videoEncodedFrameCache=null,this.audioEncodedFrameCache=null,e.prototype.destroy.call(this)},t.prototype.setStatUnit=function(e){return this.statUnit=e,this},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.setVideoEncodedFrameCache=function(e){return this.videoEncodedFrameCache=e,this},t.prototype.setAudioEncodedFrameCache=function(e){return this.audioEncodedFrameCache=e,this},t.prototype.setTargetPid=function(e){return this.targetPid=e,this},t.prototype.setSrcPid=function(e){return this.srcPid=e,this},t.prototype.setReporter=function(t){return null==t||t.registerReportUint(this.objName,this.reportUnit),e.prototype.setReporter.call(this,t)},t.prototype.onSubscribe=function(){var e,t,r=null===(e=this.peerManager)||void 0===e?void 0:e.getPeer(this.targetPid),n=null===(t=this.peerManager)||void 0===t?void 0:t.getPeer(this.srcPid);if(!r)return!1;if(!n)return!1;var i=r.getConnection().getRTCPeerConnection(),o=n.getConnection().getRTCPeerConnection();return"closed"!==i.signalingState&&(this.listenConnection(r.getConnection()),this.provideVideoTrack(o,i),this.provideAudioTrack(o,i),!0)},t.prototype.onCancelSubscribe=function(){var e,t=null===(e=this.peerManager)||void 0===e?void 0:e.getPeer(this.targetPid);if(!t)return!1;t.getConnection().destroy()},t.prototype.updateTrack=function(e,t){var r,n,i;this.srcPid=t;var o=null===(i=this.peerManager)||void 0===i?void 0:i.getPeer(this.targetPid);if(!o)return!1;if("video"!==e.kind){var a=o.getConnection().getRTCPeerConnection().getSenders();try{for(var s=Pa(a),c=s.next();!c.done;c=s.next()){var u,l=c.value;if(e.kind===(null===(u=l.track)||void 0===u?void 0:u.kind)){l.replaceTrack(e);break}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0}},t.prototype.provideAudioTrack=function(e,t){var r,n,i,o,a,s,c=this,u=e.getReceivers();try{for(var l=Pa(u),d=l.next();!d.done;d=l.next()){var p=d.value;if("audio"===p.track.kind){t.addTrack(p.track);break}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}var f=t.getTransceivers();try{for(var h=Pa(f),m=h.next();!m.done;m=h.next()){var v,y=m.value;if("audio"===(null===(v=y.sender.track)||void 0===v?void 0:v.kind)){y.setCodecPreferences(At("audio/opus","audio"));break}}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}var g,b=t.getSenders(),C=function(e){if("audio"!==(null===(g=e.track)||void 0===g?void 0:g.kind))return"continue";var t=!1,r=e.createEncodedStreams();return r.readable.pipeThrough(new TransformStream({transform:function(e,r){if(c.audioEncodedFrameCache){if(!t){var n=1;c.audioEncodedFrameCache.remove(n),t=!0}var i=c.audioEncodedFrameCache.shift();i&&(e.data=_t.encode({chunkData:i.data,timestamp:i.timestamp,type:"key"}),r.enqueue(e))}}})).pipeThrough(new TransformStream({transform:function(e,t){var r,n;null===(r=c.statUnit)||void 0===r||r.number("uploadBytes").plus(e.data.byteLength),null===(n=c.statUnit)||void 0===n||n.number("uploadAuidoBytes").plus(e.data.byteLength),c.reportUnit.number(U.UPLOAD_BYTES).plus(e.data.byteLength),t.enqueue(e)}})).pipeTo(r.writable,{signal:S.audioAbortController.signal}).catch((function(e){})),"break"},S=this;try{for(var T=Pa(b),_=T.next();!_.done&&"break"!==C(_.value);_=T.next());}catch(e){a={error:e}}finally{try{_&&!_.done&&(s=T.return)&&s.call(T)}finally{if(a)throw a.error}}},t.prototype.provideVideoTrack=function(e,t){var r,n,i,o,a,s=this,c=this.driverTrack.getVideoTrack();t.addTrack(c),this.newVideoChunkHandler=function(){s.driverTrack.writeVideoFrameToTrack({timestamp:0})},null===(a=this.videoEncodedFrameCache)||void 0===a||a.on("new_chunk",this.newVideoChunkHandler),this.clearTimer(),this.videoEmitChunkTimer=Zo((function(){s.videoEncodedFrameCache&&s.videoEncodedFrameCache.size>1&&s.driverTrack.writeVideoFrameToTrack({timestamp:0}),s.driverTrack.writeVideoFrameToTrack({timestamp:0})}),30);var u=t.getTransceivers();try{for(var l=Pa(u),d=l.next();!d.done;d=l.next()){var p,f=d.value;if("video"===(null===(p=f.sender.track)||void 0===p?void 0:p.kind)){f.setCodecPreferences(At("video/H264","video"));break}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}var h,m=t.getSenders(),v=function(e){if("video"!==(null===(h=e.track)||void 0===h?void 0:h.kind))return"continue";var t=e.createEncodedStreams(),r=!1;return t.readable.pipeThrough(new TransformStream({transform:function(e,t){if(!s.videoEncodedFrameCache)throw Error("provideVideoTrack missing param");if(!r){var n=1;s.videoEncodedFrameCache.remove(n),r=!0}var i=s.videoEncodedFrameCache.shift();i&&(e.data=_t.encode({chunkData:i.data,timestamp:i.timestamp,type:i.type}),t.enqueue(e))}})).pipeThrough(new TransformStream({transform:function(e,t){var r,n;null===(r=s.statUnit)||void 0===r||r.number("uploadBytes").plus(e.data.byteLength),null===(n=s.statUnit)||void 0===n||n.number("uploadVideoBytes").plus(e.data.byteLength),s.reportUnit.number(U.UPLOAD_BYTES).plus(e.data.byteLength),t.enqueue(e)}})).pipeTo(t.writable,{signal:y.videoAbortController.signal}).catch((function(e){})),"break"},y=this;try{for(var g=Pa(m),b=g.next();!b.done&&"break"!==v(b.value);b=g.next());}catch(e){i={error:e}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}},t.prototype.listenConnection=function(e){var t=this;e.on("disconnected",(function(){t.emit("EVENT_RPOVIDER_DISCONNECT")})),e.on("failed",(function(){t.emit("EVENT_RPOVIDER_FAILED")}))},t.prototype.clearTimer=function(){this.videoEmitChunkTimer&&(clearInterval(this.videoEmitChunkTimer),this.videoEmitChunkTimer=null)},t}(A);function Lt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xt=function(){function e(){Lt(this,"config",null),Lt(this,"coolingPeers",new gC)}return e.prototype.configure=function(e){this.config=e},e.prototype.destroy=function(){this.coolingPeers.clear()},e.prototype.add=function(e){var t,r=this;if(!this.config)throw Error("PeerCooler missing param");this.coolingPeers.add(e),Yo((function(){r.coolingPeers.delete(e)}),null===(t=this.config)||void 0===t?void 0:t.coolingTime)},e.prototype.getList=function(){return Aa([],ka(this.coolingPeers),!1)},e}();function Dt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ot,Nt=function(){function e(){Dt(this,"lastWriteAudioTimestamp",0),Dt(this,"lastWriteVideoTimestamp",0),Dt(this,"p2pVideoRecvEnough",!1),Dt(this,"_prepareToStopCdn",!1),Dt(this,"_cdnStoppingReady",!1),Dt(this,"_lastestCdnKeyTimestamp",0),Dt(this,"_lastRecvCdnVideoTimestamp",0),Dt(this,"_lastRecvCdnAudioTimestamp",0)}return mh(e.prototype,"lastRecvCdnVideoTimestamp",{get:function(){return this._lastRecvCdnVideoTimestamp},set:function(e){this._lastRecvCdnVideoTimestamp=e},enumerable:!1,configurable:!0}),mh(e.prototype,"lastRecvCdnAudioTimestamp",{get:function(){return this._lastRecvCdnAudioTimestamp},set:function(e){this._lastRecvCdnAudioTimestamp=e},enumerable:!1,configurable:!0}),mh(e.prototype,"prepareToStopCdn",{get:function(){return this._prepareToStopCdn},set:function(e){this._prepareToStopCdn=e},enumerable:!1,configurable:!0}),mh(e.prototype,"cdnStoppingReady",{get:function(){return this._cdnStoppingReady},set:function(e){this._cdnStoppingReady=e},enumerable:!1,configurable:!0}),mh(e.prototype,"lastestCdnKeyTimestamp",{get:function(){return this._lastestCdnKeyTimestamp},set:function(e){this._lastestCdnKeyTimestamp=e},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._prepareToStopCdn=!1,this._cdnStoppingReady=!1,this._lastestCdnKeyTimestamp=0,this._lastRecvCdnVideoTimestamp=0,this._lastRecvCdnAudioTimestamp=0,this.lastWriteAudioTimestamp=0,this.lastWriteVideoTimestamp=0,this.p2pVideoRecvEnough=!1},e}();function Mt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.smooth=0]="smooth",e[e.recentAvg=1]="recentAvg",e[e.latestOne=2]="latestOne"}(Ot||(Ot={}));var Ut=function(){function e(){Mt(this,"cnt",0),Mt(this,"frameRateRecords",[]),Mt(this,"config",{maxFrameRateRecordsLen:10}),Mt(this,"timer",null)}return e.prototype.configure=function(e){this.config=e},e.prototype.destroy=function(){this.clearTimer()},e.prototype.reset=function(){this.frameRateRecords=[],this.clearTimer()},e.prototype.getFrameRate=function(e){return this.frameRateRecords.length?e===Ot.smooth?this.smooth(this.frameRateRecords):e===Ot.recentAvg?this.recentAvg(this.frameRateRecords):this.latestOne(this.frameRateRecords):null},e.prototype.sample=function(){this.start(),this.cnt+=1},e.prototype.start=function(){this.setTimer()},e.prototype.stop=function(){this.clearTimer()},e.prototype.setTimer=function(){var e=this;this.timer||(this.timer=Zo((function(){e.frameRateRecords.push(e.cnt),e.frameRateRecords.length>e.config.maxFrameRateRecordsLen&&e.frameRateRecords.shift(),e.cnt=0}),1e3))},e.prototype.clearTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},e.prototype.smooth=function(e){if(e.length<5)return null;var t=sh(e).call(e,3);return Math.floor(bT(t).call(t,(function(e,t){return e+t}))/t.length)},e.prototype.recentAvg=function(e){if(e.length<3)return null;var t=sh(e).call(e,e.length-3);return Math.floor(bT(t).call(t,(function(e,t){return e+t}))/t.length)},e.prototype.latestOne=function(e){return e.length?e[this.frameRateRecords.length-1]:null},e}();function Vt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ft=function(){function e(){Vt(this,"audioClockRate",0),Vt(this,"videoClockRate",0),Vt(this,"videoMimeType",""),Vt(this,"audioMimeType",""),Vt(this,"frameRate",new Ut)}return e.prototype.reset=function(){this.audioClockRate=0,this.videoClockRate=0},e.prototype.ready=function(){return this.audioClockRate&&this.videoClockRate},e.prototype.sample=function(e){var t,r=this;Co(t=e.getReceivers()).call(t,(function(e){r.sampleClockRate(e)}))},e.prototype.sampleClockRate=function(e){var t=this;e.getStats().then((function(e){var r,n;try{for(var i=Pa(e),o=i.next();!o.done;o=i.next()){var a,s,c=o.value,u=zk(c).call(c,(function(e){return"codec"===e.type}));u&&"number"==typeof u.clockRate&&(ha(a=u.mimeType).call(a,"audio")?(t.audioClockRate=u.clockRate,t.audioMimeType=u.mimeType):ha(s=u.mimeType).call(s,"video")&&(t.videoClockRate=u.clockRate,t.videoMimeType=u.mimeType))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}))},e}();function jt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Bt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return jt(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","LEBSource"),jt(n,"sourceConfig",null),jt(n,"stopWriting",!1),jt(n,"videoAbortController",new AbortController),jt(n,"audioAbortController",new AbortController),n}return Ta(t,e),t.prototype.configure=function(e){var t=this;return this.sourceConfig=e,this.reportUnit.configure({deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[U.CDN_BYTES],fieldsReservedValueAfterReport:[]}),this.reportUnit.registerPreHook(this.objName,(function(){if(t.syncController){var e=t.syncController,r=e.lastRecvCdnVideoTimestamp,n=e.lastRecvCdnAudioTimestamp;t.reportUnit.number(U.CDN_AV_DIFF).set(r-n)}})),this},t.prototype.isLeb=function(){return!0},t.prototype.load=function(){if(!this.sourceConfig)throw new Error;if(!this.peerManager)throw new Error("miss peerManager");e.prototype.load.call(this);var t=(new rt).create(Tm({targetPid:this.sourceConfig.srcPid},this.sourceConfig));this.peer=t,this.peerManager.addPeer(t),this.listenConnection(t.getConnection())},t.prototype.close=function(){this.closed||(this.audioAbortController.abort("LEBSource_abort_audio"),this.videoAbortController.abort("LEBSource_abort_video"),e.prototype.close.call(this))},t.prototype.onTrack=function(e,t){var r=this;if(!this.videoEncodedFrameCache||!this.audioEncodedFrameCache)throw Error("miss cache");var n=e.track,o=e.receiver.createEncodedStreams();if(o){if(!this.syncController)throw Error("missing param");if(!this.streamInfo)throw Error("missing param");var s=o.readable.pipeThrough(new TransformStream({transform:function(t,n){if(!r.closed){if(!r.syncController)throw Error("missing param");if(!r.stopWriting){var o,s,c;if(!r.stopWriting&&r.syncController.prepareToStopCdn&&"video"===e.track.kind&&"key"===t.type)return r.syncController.cdnStoppingReady=!0,r.syncController.lastestCdnKeyTimestamp=t.timestamp,r.stopWriting=!0,void(null===(o=r.streamInfo)||void 0===o||o.frameRate.stop());r.syncController&&("audio"===e.track.kind?(null!==(s=r.syncController)&&void 0!==s&&s.lastRecvCdnAudioTimestamp||r.emit(i,{code:a.INF_PLAY_EVT_STREAM_FIRST_AUDIO_FRAME,msg:"鏀跺埌浜嗙涓€涓煶棰戝抚"}),r.syncController.lastRecvCdnAudioTimestamp=t.timestamp):(null!==(c=r.syncController)&&void 0!==c&&c.lastRecvCdnVideoTimestamp||r.emit(i,{code:a.INF_PLAY_EVT_STREAM_FIRST_VIDEO_FRAME,msg:"鏀跺埌浜嗙涓€涓棰戝抚"}),r.syncController.lastRecvCdnVideoTimestamp=t.timestamp)),n.enqueue(t)}}}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i;null===(n=r.statUnit)||void 0===n||n.number("cdnDownloadBytes").plus(e.data.byteLength),null===(i=r.reportUnit)||void 0===i||i.number(U.CDN_BYTES).plus(e.data.byteLength),t.enqueue(e)}}));"video"===n.kind?s.pipeThrough(new TransformStream({transform:function(e,t){var n;null===(n=r.statUnit)||void 0===n||n.number("cdnDownloadVideoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i;null===(n=r.streamInfo)||void 0===n||n.frameRate.sample(),null===(i=r.videoEncodedFrameCache)||void 0===i||i.cache(e),t.enqueue(e)}})).pipeTo(o.writable,{signal:this.videoAbortController.signal}).catch((function(e){})):s.pipeThrough(new TransformStream({transform:function(e,t){var n;null===(n=r.statUnit)||void 0===n||n.number("cdnDownloadAuidoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n;null===(n=r.audioEncodedFrameCache)||void 0===n||n.cache(e),t.enqueue(e)}})).pipeTo(o.writable,{signal:this.audioAbortController.signal}).catch((function(e){})),this.emitTrack(n,t)}},t}(me);function Wt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gt=function(){function e(){Wt(this,"targetWritableStream",null),Wt(this,"targetWriter",null),Wt(this,"proxiedWritableStream",null),Wt(this,"getNextChunkCb",null)}return e.prototype.destroy=function(){var e;this.targetWritableStream=null,null===(e=this.targetWriter)||void 0===e||e.abort(),this.targetWriter=null,this.proxiedWritableStream=null,this.getNextChunkCb=null},e.prototype.setTargetWriableStream=function(e){return this.targetWritableStream=e,this.targetWriter=e.getWriter(),this},e.prototype.setGetNextChunkCb=function(e){this.getNextChunkCb=e},e.prototype.getStream=function(){var e=this;if(this.proxiedWritableStream)return this.proxiedWritableStream;var t=new CountQueuingStrategy({highWaterMark:10});return this.proxiedWritableStream=new WritableStream({write:function(t){e.writeChunk()},close:function(){},abort:function(e){}},t),this.proxiedWritableStream},e.prototype.write=function(){this.writeChunk()},e.prototype.writeChunk=function(){if(!this.getNextChunkCb)throw Error("missing param");for(var e=this.getNextChunkCb();e;){var t;null===(t=this.targetWriter)||void 0===t||t.write(e).catch((function(e){})),e=this.getNextChunkCb()}},e}();function Zt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Yt,Xt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Zt(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","P2PSource"),Zt(n,"sourceConfig",null),Zt(n,"p2pClient",null),Zt(n,"videoReady",!1),Zt(n,"p2pAudioCache",new St),Zt(n,"p2pVideoCache",new St),Zt(n,"audioProxyStream",new Gt),Zt(n,"videoProxyStream",new Gt),Zt(n,"recvFrameRate",new Ut),Zt(n,"audioAbortController",new AbortController),Zt(n,"videoAbortController",new AbortController),n}return Ta(t,e),t.prototype.configure=function(e){var t=this;return this.sourceConfig=e,this.reportUnit.configure({deleteZeroNumber:!0,fieldsReportedWithZeroNumber:[U.P2P_BYTES,U.P2P_AV_DIFF],fieldsReservedValueAfterReport:[]}),this.reportUnit.registerPreHook(this.objName,(function(){if(t.syncController){var e=t.syncController,r=e.lastWriteAudioTimestamp,n=e.lastWriteVideoTimestamp;t.reportUnit.number(U.P2P_AV_DIFF).set(n-r)}})),this},t.prototype.setClient=function(e){return this.p2pClient=e,this},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.destroy=function(){this.p2pAudioCache.destroy(),this.p2pVideoCache.destroy(),this.audioProxyStream.destroy(),this.videoProxyStream.destroy(),this.audioAbortController.abort("P2PSource_abort_audio"),this.videoAbortController.abort("P2PSource_abort_video"),e.prototype.destroy.call(this)},t.prototype.isLeb=function(){return!1},t.prototype.load=function(){if(!this.sourceConfig)throw new Error("missing p2p source config");if(this.peerManager&&this.p2pClient){var t=this.peerManager.getPeer(this.sourceConfig.srcPid);if(t){this.peer=t;var r=t.getConnection();r&&(e.prototype.load.call(this),this.p2pClient.request({host:"P2PServer",to:this.sourceConfig.srcPid,path:"SubscribeTrack",payload:"subscribe",type:"app"}),this.listenConnection(r))}}},t.prototype.close=function(){if(!this.sourceConfig)throw new Error("missing p2p source config");this.p2pClient&&(this.closed||(this.p2pClient.request({host:"P2PServer",to:this.sourceConfig.srcPid,path:"SubscribeTrack",payload:"cancelSubscribe",type:"app"}),e.prototype.close.call(this)))},t.prototype.onTrack=function(e,t){var r=e.track;"video"===r.kind?this.onVideoTrack(e,t):"audio"===r.kind&&this.onAudioTrack(e,t)},t.prototype.onAudioTrack=function(e,t){var r=this,n=e.receiver.createEncodedStreams();this.audioProxyStream.setTargetWriableStream(n.writable).setGetNextChunkCb((function(){var e;if(r.syncController&&r.p2pAudioCache&&r.videoReady&&r.streamInfo&&r.streamInfo.ready()&&null!==(e=r.syncController)&&void 0!==e&&e.cdnStoppingReady&&r.syncController.p2pVideoRecvEnough){var t=r.p2pAudioCache.getHead();return t?(r.p2pAudioCache.removeHead(),r.syncController.lastWriteAudioTimestamp=t.timestamp,r.videoProxyStream.write(),t.chunk):void 0}})),n.readable.pipeThrough(new TransformStream({transform:function(e,t){r.closed||t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i,o;null===(n=r.reportUnit)||void 0===n||n.number(U.P2P_BYTES).plus(e.data.byteLength),null===(i=r.statUnit)||void 0===i||i.number("p2pDownloadBytes").plus(e.data.byteLength),null===(o=r.statUnit)||void 0===o||o.number("p2pDownloadAuidoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){if(0!==e.data.byteLength){if(r.syncController){var n=_t.decode(e.data);n.timestamp<r.syncController.lastRecvCdnAudioTimestamp||(e.data=n.chunkData,r.p2pAudioCache.cache({data:n.chunkData,timestamp:n.timestamp,type:n.type,chunk:e}),t.enqueue({}))}}else t.enqueue(e)}})).pipeTo(this.audioProxyStream.getStream(),{signal:this.audioAbortController.signal}).catch((function(e){})),this.emitTrack(e.track,t)},t.prototype.onVideoTrack=function(e,t){var r=this,n=e.receiver,i=1,o=0,a=n.createEncodedStreams();this.videoProxyStream.setTargetWriableStream(a.writable).setGetNextChunkCb((function(){if(r.syncController&&r.p2pVideoCache&&r.streamInfo&&r.streamInfo.ready()&&(r.p2pVideoCache.size>5&&!r.syncController.p2pVideoRecvEnough&&(r.syncController.p2pVideoRecvEnough=!0),r.syncController.lastWriteAudioTimestamp)){var e=r.p2pVideoCache.getHead();if(e){var t=r.syncController,n=t.lastRecvCdnVideoTimestamp,i=t.lastRecvCdnAudioTimestamp,o=r.streamInfo,a=o.videoClockRate,s=o.audioClockRate,c=i/s-n/a;return r.syncController.lastWriteAudioTimestamp/s-c<e.timestamp/a+.1?void 0:(r.p2pVideoCache.removeHead(),e.chunk)}}})),a.readable.pipeThrough(new TransformStream({transform:function(e,t){r.closed||t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){if(!r.streamInfo||!r.sourceConfig)throw Error("missing param");r.recvFrameRate.sample();var n=r.recvFrameRate.getFrameRate(Ot.recentAvg),i=r.streamInfo.frameRate.getFrameRate(Ot.smooth);null!==n&&null!==i&&n<i*r.sourceConfig.stuckFrameRateRatio&&2===(o+=1)?r.emit(he):t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(e,t){var n,i,o;null===(n=r.reportUnit)||void 0===n||n.number(U.P2P_BYTES).plus(e.data.byteLength),null===(i=r.statUnit)||void 0===i||i.number("p2pDownloadBytes").plus(e.data.byteLength),null===(o=r.statUnit)||void 0===o||o.number("p2pDownloadVideoBytes").plus(e.data.byteLength),t.enqueue(e)}})).pipeThrough(new TransformStream({transform:function(n,o){if(r.syncController){if(n.data.byteLength){var a=_t.decode(n.data);if("key"===a.type&&(i-=1),n.data=a.chunkData,r.syncController.prepareToStopCdn||"key"!==a.type||0!==i||(r.syncController.prepareToStopCdn=!0),!r.syncController.cdnStoppingReady)return;if(a.timestamp<r.syncController.lastestCdnKeyTimestamp)return;a.timestamp,r.syncController.lastestCdnKeyTimestamp,r.videoReady||(r.videoReady=!0,r.emitTrack(e.track,t)),r.p2pVideoCache.cache({data:a.chunkData,timestamp:a.timestamp,type:a.type,chunk:n})}o.enqueue(n)}}})).pipeTo(this.videoProxyStream.getStream(),{signal:this.videoAbortController.signal}).catch((function(e){}))},t}(me);!function(e){e[e.LEB=0]="LEB",e[e.P2P=1]="P2P"}(Yt||(Yt={}));var Ht,Kt=function(){function e(){}return e.create=function(e){switch(e){case Yt.LEB:return new Bt;case Yt.P2P:return new Xt}},e}();function Jt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e[e.IDEL=0]="IDEL",e[e.WAITING=1]="WAITING",e[e.COMPLETE=2]="COMPLETE"}(Ht||(Ht={}));var Qt=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this;return Jt(n=e.apply(this,Aa([],ka(t),!1))||this,"tagName","Subscriber"),Jt(n,"parent",{pid:""}),Jt(n,"child",{pid:""}),Jt(n,"subscribeStatus",{status:Ht.IDEL,pid:""}),Jt(n,"config",null),Jt(n,"p2pClient",null),Jt(n,"peerManager",null),Jt(n,"videoEncodedFrameCache",new St),Jt(n,"audioEncodedFrameCache",new St),Jt(n,"statUnit",null),Jt(n,"peerCooler",new xt),Jt(n,"syncController",new Nt),Jt(n,"streamInfo",new Ft),Jt(n,"sampleTimer",null),Jt(n,"reportUnit",new w),Jt(n,"lebSource",null),Jt(n,"p2pSource",null),n}return Ta(t,e),t.prototype.destroy=function(){this.peerManager=null,this.reporter=null,this.p2pClient=null,this.peerCooler.destroy(),this.cancelsubscribe(),this.removeChild(this.child.pid),this.clearSampleTimer(),this.closeSource(Yt.LEB),this.closeSource(Yt.P2P),e.prototype.destroy.call(this)},t.prototype.configure=function(e){return this.config=e,this.peerCooler.configure({coolingTime:this.config.subscribeCoolingTime}),this.reportUnit.configure({deleteZeroNumber:!0,fieldsReservedValueAfterReport:[],fieldsReportedWithZeroNumber:[]}),this},t.prototype.setPeerManager=function(e){return this.peerManager=e,this},t.prototype.setReporter=function(t){var r=this;return null==t||t.registerReportUint(this.objName,this.reportUnit),this.reportUnit.registerPreHook(this.objName,(function(){var e=r.streamInfo.frameRate.getFrameRate(Ot.recentAvg);null!==e&&r.reportUnit.number(U.FRAME_RATE).set(e);var t=r.streamInfo,n=t.videoMimeType,i=t.videoClockRate,o=t.audioClockRate,a=t.audioMimeType;r.reportUnit.number(U.AUDIO_CLOCK_RATE).set(o),r.reportUnit.number(U.VIDEO_CLOCK_RATE).set(i),r.reportUnit.string(U.AUDIO_CODEC).set(a),r.reportUnit.string(U.VIDEO_CODEC).set(n)})),e.prototype.setReporter.call(this,t)},t.prototype.setClient=function(e){return this.p2pClient=e,this},t.prototype.setStatUnit=function(e){this.statUnit=e},mh(t.prototype,"currentSourcePeerconnection",{get:function(){var e,t;return this.parent.pid&&(null===(e=this.peerManager)||void 0===e||null===(t=e.getPeer(this.parent.pid))||void 0===t?void 0:t.getConnection().getRTCPeerConnection())||null},enumerable:!1,configurable:!0}),t.prototype.subscribeLEB=function(e){var t=this;if(!this.peerManager||!this.statUnit)throw Error("subscribeLEB missing param");this.syncController.reset(),this.streamInfo.reset(),this.streamInfo.frameRate.reset(),this.reportUnit.number(U.PULL_CDN_STREAM).plus(1);var r=Kt.create(Yt.LEB);return this.lebSource=r,r.configure(e).setSyncController(this.syncController).setReporter(this.reporter).setPeerManager(this.peerManager).setEncodedVideoChunkCache(this.videoEncodedFrameCache).setEncodedAudioChunkCache(this.audioEncodedFrameCache).setStatUnit(this.statUnit).setStreamInfo(this.streamInfo).on(le,(function(e){"video"===e.track.kind&&(t.reportUnit.number(U.PULL_CDN_SUCC).plus(1),t.updateParent({pid:e.srcPid,source:r}),t.updateChildTrack(e.track,{srcPid:e.srcPid}),t.sampleTimer||(t.sampleTimer=Zo((function(){t.streamInfo.ready()?t.clearSampleTimer():t.streamInfo.sample(e.rtcPeerConnction)}),1e3)))})).once(ce,(function(){t.reportUnit.number(U.PULL_CDN_TIMEOUT).plus(1),t.closeSource(Yt.LEB)})).once(fe,(function(e){e.srcPid,t.reportUnit.number(U.PULL_CDN_FAILED).plus(1),t.closeSource(Yt.LEB)})).once(ue,(function(e){e.srcPid,t.closeSource(Yt.LEB)})).once(pe,(function(e){e.srcPid,t.reportUnit.number(U.PULL_CDN_ERROR).plus(1),t.closeSource(Yt.LEB)})).load(),r},t.prototype.subscribeP2P=function(e){var t=this;if(!(this.p2pClient&&this.peerManager&&this.statUnit&&this.config))throw Error("[Subscriber] [subscribeP2P] missing param");if(!0===this.allowSubscribe()){var r=e||this.selectAvaliableSubscribePeer();if(r){var n=Kt.create(Yt.P2P);return this.p2pSource=n,this.parent.pid&&this.parent.source&&this.parent.source.setSyncController(this.syncController),this.reportUnit.number(U.SUBSCRIBE_CNT).plus(1),n.configure({srcPid:r,stuckFrameRateRatio:this.config.stuckFrameRateRatio}).setReporter(this.reporter).setClient(this.p2pClient).setPeerManager(this.peerManager).setStatUnit(this.statUnit).setSyncController(this.syncController).setStreamInfo(this.streamInfo).on(le,(function(e){"video"===e.track.kind&&t.updateParent({pid:e.srcPid,source:n})})).once(ce,(function(){t.reportUnit.number(U.SUBSCRIBE_TIMEOUT_CNT).plus(1),t.peerCooler.add(r),t.closeSource(Yt.P2P),t.unmarkSubscribeP2P()})).once(fe,(function(e){e.srcPid,t.reportUnit.number(U.SUBSCRIBE_FAIL_CNT).plus(1),t.closeSource(Yt.P2P),t.unmarkSubscribeP2P()})).once(ue,(function(){t.closeSource(Yt.P2P),t.unmarkSubscribeP2P()})).once(pe,(function(){t.closeSource(Yt.P2P),t.unmarkSubscribeP2P()})).once(he,(function(){t.reportUnit.number(U.SUBSCRIBE_P2P_STUCK).plus(1),t.closeSource(Yt.P2P),t.unmarkSubscribeP2P()})).on(le,(function(e){"video"===e.track.kind&&(t.reportUnit.number(U.SUBSCRIBE_SUCCESS_CNT).plus(1),t.subscribeStatus.status=Ht.COMPLETE)})).load(),this.markSubscribeP2P(),n}}},t.prototype.cancelsubscribe=function(){this.parent.pid&&this.parent.source&&(this.parent.source.close(),this.parent.pid="",this.parent.source=void 0)},t.prototype.onSubscribe=function(e){var t=this;if(this.reportUnit.number(U.RECV_SUBSCRIBE).plus(1),!this.peerManager||!this.statUnit)throw Error("[Subscriber] [onSubscribe] missing param");if(!0===this.allowToBeSubscribed()){var r=new It,n=r.setSrcPid(this.parent.pid).setTargetPid(e).setReporter(this.reporter).setPeerManager(this.peerManager).setVideoEncodedFrameCache(this.videoEncodedFrameCache).setAudioEncodedFrameCache(this.audioEncodedFrameCache).setStatUnit(this.statUnit).onSubscribe();r.on("EVENT_RPOVIDER_DISCONNECT",(function(){t.removeChild(e)})).on("EVENT_RPOVIDER_FAILED",(function(){t.removeChild(e)})),n?(this.setChild(e,r),this.reportUnit.number(U.RECV_SUBSCRIBE_SUCC).plus(1)):r.destroy()}},t.prototype.onCancelSubscribe=function(e){this.reportUnit.number(U.RECV_SUBSCRIBE_CANCEL).plus(1),this.removeChild(e)},t.prototype.getParentId=function(){return this.parent.pid},t.prototype.getChildId=function(){return this.child.pid},t.prototype.allowToBeSubscribed=function(){var e;return this.parent.pid&&this.parent.source?""!==this.child.pid?"鏈夊瓙鑺傜偣":!!(null===(e=this.parent.source)||void 0===e?void 0:e.isLeb())||"鐖惰妭鐐逛笉鏄痗dn":"鏃犱笂娓歌妭鐐�"},t.prototype.allowSubscribe=function(){var e;return this.child.pid?"鏈夊瓙鑺傜偣":this.streamInfo.ready()?this.subscribeStatus.status===Ht.WAITING?"姝e湪璁㈤槄涓�":this.subscribeStatus.status===Ht.COMPLETE?"宸茬粡璁㈤槄":!(this.parent.pid&&(null===(e=this.parent.source)||void 0===e||!e.isLeb()))||"鐖惰妭鐐逛笉鏄痗dn":"娴佷俊鎭湭閲囬泦鍒�"},t.prototype.selectAvaliableSubscribePeer=function(){var e,t="";if(this.parent.pid&&null!==(e=this.parent.source)&&void 0!==e&&e.isLeb()){var r,n=this.peerCooler.getList(),i=null===(r=this.peerManager)||void 0===r?void 0:r.getBestPeer({excludePeerId:Aa([this.parent.pid],ka(n),!1)});i&&(t=i.pid)}return t},t.prototype.closeSource=function(e){var t,r;e===Yt.LEB&&(null===(t=this.lebSource)||void 0===t||t.close(),this.lebSource=null),e===Yt.P2P&&(null===(r=this.p2pSource)||void 0===r||r.close(),this.p2pSource=null)},t.prototype.removeChild=function(e){var t;this.child.pid&&e!==this.child.pid||(this.child.pid="",null===(t=this.child.provider)||void 0===t||t.destroy(),this.child.provider=void 0)},t.prototype.setChild=function(e,t){this.child.pid=e,this.child.provider=t},t.prototype.updateParent=function(e){e.pid!==this.parent.pid&&this.cancelsubscribe(),e.source&&(this.parent.pid=e.pid,this.parent.source=e.source)},t.prototype.updateChildTrack=function(e,t){this.child.pid&&this.child.provider&&this.child.provider.updateTrack(e,t.srcPid)},t.prototype.markSubscribeP2P=function(){this.subscribeStatus.status=Ht.WAITING},t.prototype.unmarkSubscribeP2P=function(){this.subscribeStatus.status=Ht.IDEL},t.prototype.clearSampleTimer=function(){this.sampleTimer&&(clearTimeout(this.sampleTimer),this.sampleTimer=null)},t}(A);function zt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var qt=function(e){function t(){var t=this;return zt(t=e.call(this)||this,"tagName","StreamSourceModule"),zt(t,"config",null),zt(t,"reporter",null),zt(t,"dispatch",new be),zt(t,"signal",new Ve),zt(t,"p2pServer",new _e),zt(t,"p2pClient",new Ee),zt(t,"signalTransport",new at),zt(t,"p2pPeerBuilder",new nt),zt(t,"peerManager",new lt),zt(t,"peerCache",new ht),zt(t,"signalApi",new vt),zt(t,"subscribeTrackApi",new gt),zt(t,"subscriber",new Qt),t.signal.on(Me,(function(e){if(!t.config)throw Error("missing config");t.p2pClient.setLocalPid(e),t.p2pPeerBuilder.setLocalPid(e),t.peerCache.setPeerId(e).setStreamId(t.config.streamId()),t.peerCache.start()})),t.signalTransport.setSignal(t.signal),t.p2pClient.setTransport(t.signalTransport),t.p2pServer.setTransport(t.signalTransport),t.p2pPeerBuilder.setClient(t.p2pClient).setServer(t.p2pServer),t.peerManager.setPeerCache(t.peerCache).setPeerBuilder(t.p2pPeerBuilder),t.subscriber.setClient(t.p2pClient).setPeerManager(t.peerManager),t.subscribeTrackApi.setSubscriber(t.subscriber),t.dispatch.setSubscriber(t.subscriber),t.initApi(),t}return Ta(t,e),mh(t.prototype,"currentSourcePeerconnection",{get:function(){return this.subscriber.currentSourcePeerconnection},enumerable:!1,configurable:!0}),t.prototype.setMediaStreamProcessor=function(e){return this.dispatch.setMediaStreamProcessor(e),this},t.prototype.setReporter=function(e){return this.reporter=e,this.subscriber.setReporter(e),this.dispatch.setReporter(e),this.peerManager.setReporter(e),this},t.prototype.setStatUnit=function(e){return this.subscriber.setStatUnit(e),this},t.prototype.setBus=function(t){return e.prototype.setBus.call(this,t),this.dispatch.setBus(t),this},t.prototype.destroy=function(){this.dispatch.destroy(),this.peerCache.destroy(),this.peerManager.destroy(),this.p2pClient.destroy(),this.p2pServer.destroy(),this.signal.destroy(),this.signalApi.destroy(),this.subscribeTrackApi.destroy(),this.subscriber.destroy(),e.prototype.destroy.call(this)},t.prototype.configure=function(e){return this.config=e,this.peerCache.configure(this.config),this.peerManager.configure(this.config),this.p2pPeerBuilder.configure(this.config),this.dispatch.configure(e),this.subscriber.configure(e),this},t.prototype.init=function(){if(!this.config)throw Error("missing config");this.peerCache.init(),this.peerManager.init(),this.signal.connect(this.config.signal),this.dispatch.init()},t.prototype.load=function(e){var t=e.streamUrl;if(!this.config)throw Error("missing config");return this.dispatch.load(t)},t.prototype.initApi=function(){this.signalApi.setPeerBuilder(this.p2pPeerBuilder).setPeerManager(this.peerManager).setServer(this.p2pServer),this.subscribeTrackApi.setServer(this.p2pServer)},t}(A),$t=function(){try{var e,t,r;return!!(window.MediaStreamTrack&&window.MediaStream&&window.MediaStreamTrack&&null!==(e=window.RTCPeerConnection)&&void 0!==e&&e.prototype.getReceivers&&null!==(t=window.RTCPeerConnection)&&void 0!==t&&t.prototype.getSenders&&null!==(r=window.RTCRtpReceiver)&&void 0!==r&&r.prototype.createEncodedStreams&&window.HTMLCanvasElement.prototype.captureStream&&window.MediaStreamTrackGenerator&&window.MediaStreamTrackProcessor)}catch(e){return!1}};function er(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tr=function(){function e(){er(this,"video",null)}return e.prototype.destroy=function(){this.video&&(this.video.srcObject=null,this.video=null)},e.prototype.setVideoSrcObj=function(e){if(!this.video)throw Error("miss video");var t=this.video;t.onwaiting=function(){},t.ontimeupdate=function(){},t.onplay=function(){},t.onplaying=function(){},t.onpause=function(){},t.srcObject=e,t.onseeking=function(e){},t.onseeked=function(e){}},e.prototype.play=function(){var e;null===(e=this.video)||void 0===e||e.play()},e.prototype.setVideo=function(e){this.video=e},e}();function rr(e,t){var r=gh(e);if(ch){var n=ch(e);t&&(n=Ca(n).call(n,(function(t){return Ph(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r,n,i=null!=arguments[t]?arguments[t]:{};t%2?Co(r=rr(Object(i),!0)).call(r,(function(t){ir(e,t,i[t])})):Vh?Yh(e,Vh(i)):Co(n=rr(Object(i))).call(n,(function(t){mh(e,t,Ph(i,t))}))}return e}function ir(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=jf(e)||null===e)return e;var r=e[Xh];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jf(t)?t:String(t)}(t))in e?mh(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var or=function(e){function t(){var t,r=this;return ir(r=e.call(this)||this,"player",new tr),ir(r,"mediaStreamProcessor",new F),ir(r,"source",new qt),ir(r,"reporter",new oe),ir(r,"stats",new w),ir(r,"statsTotal",new w),ir(r,"config",new h),ir(r,"conf",new H),$=gi(t="".concat(oT(),"_")).call(t,q().split("-")[0]),r.stats.configure({deleteZeroNumber:!1,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:[]}),r.statsTotal.configure({deleteZeroNumber:!1,fieldsReportedWithZeroNumber:[],fieldsReservedValueAfterReport:["uploadBytesTotal","uploadAuidoBytesTotal","uploadVideoBytesTotal","cdnDownloadBytesTotal","cdnDownloadAuidoBytesTotal","cdnDownloadVideoBytesTotal","p2pDownloadBytesTotal","p2pDownloadAuidoBytesTotal","p2pDownloadVideoBytesTotal"]}),r.source.setMediaStreamProcessor(r.mediaStreamProcessor).setReporter(r.reporter).setStatUnit(r.stats).setBus(r),r.source.configure(r.config.config),r.reporter.configure(r.config.config).init(),r.mediaStreamProcessor.init(),r.conf.on("EVENT_CONF_LOADED",(function(e){r.config.update(e.pconf)})).once("EVENT_CONF_LOADED",(function(){r.source.init()})),r.reporter.start(),r}return Ta(t,e),t.support=function(){return $t()},t.create=function(e){var r=new t;return r.configure(e),r},mh(t,"Event",{get:function(){return o},enumerable:!1,configurable:!0}),mh(t,"EventCode",{get:function(){return a},enumerable:!1,configurable:!0}),mh(t,"version",{get:function(){return re},enumerable:!1,configurable:!0}),mh(t,"uuid",{get:function(){return q()},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.removeAllListeners(),this.reporter.destroy(),this.conf.destroy(),this.source.destroy(),this.mediaStreamProcessor.destroy(),this.player.destroy()},t.prototype.load=function(e){return Ra(this,void 0,void 0,(function(){var t=this;return Ea(this,(function(r){return[2,(this.config.update({streamUrl:e}),this.source.load({streamUrl:e}).then((function(){t.conf.configure({confBaseUrl:t.config.config.confBaseUrl,confInterval:0,domain:t.config.config.xp2pDomain,streamId:t.config.config.streamId()}),t.conf.load()})),{srcObject:this.mediaStreamProcessor.getMediaObj()})]}))}))},t.prototype.setVideoHtmlElement=function(e){this.player.setVideo(e),this.player.setVideoSrcObj(this.mediaStreamProcessor.getMediaObj())},t.prototype.getSDKStats=function(){return this.stats.number("uploadBytes").plus(0),this.stats.number("uploadAuidoBytes").plus(0),this.stats.number("uploadVideoBytes").plus(0),this.stats.number("cdnDownloadBytes").plus(0),this.stats.number("cdnDownloadAuidoBytes").plus(0),this.stats.number("cdnDownloadVideoBytes").plus(0),this.stats.number("p2pDownloadBytes").plus(0),this.stats.number("p2pDownloadAuidoBytes").plus(0),this.stats.number("p2pDownloadVideoBytes").plus(0),this.statsTotal.number("uploadBytesTotal").plus(this.stats.number("uploadBytes").value),this.statsTotal.number("uploadAuidoBytesTotal").plus(this.stats.number("uploadAuidoBytes").value),this.statsTotal.number("uploadVideoBytesTotal").plus(this.stats.number("uploadVideoBytes").value),this.statsTotal.number("cdnDownloadBytesTotal").plus(this.stats.number("cdnDownloadBytes").value),this.statsTotal.number("cdnDownloadAuidoBytesTotal").plus(this.stats.number("cdnDownloadAuidoBytes").value),this.statsTotal.number("cdnDownloadVideoBytesTotal").plus(this.stats.number("cdnDownloadVideoBytes").value),this.statsTotal.number("p2pDownloadBytesTotal").plus(this.stats.number("p2pDownloadBytes").value),this.statsTotal.number("p2pDownloadAuidoBytesTotal").plus(this.stats.number("p2pDownloadAuidoBytes").value),this.statsTotal.number("p2pDownloadVideoBytesTotal").plus(this.stats.number("p2pDownloadVideoBytes").value),nr(nr({},this.stats.generate()),this.statsTotal.generate())},t.prototype.getStats=function(){var e=this.source.currentSourcePeerconnection;return null==e?void 0:e.getStats()},mh(t.prototype,"playId",{get:function(){return ee()},enumerable:!1,configurable:!0}),t.prototype.configure=function(e){this.config.update(e)},t}(e.EventEmitter)}(),n.default}()}(qk);var $k,eA,tA,rA,nA,iA,oA,aA,sA=r(qk.exports),cA="1.3.7-beta.0",uA=["overseas-webrtc.tlivewebrtc.com","oswebrtc-lint.tliveplay.com"],lA="TX_LIVE_PLAYER_SIGNAL_DATA",dA=["webrtc-signal-scheduler.tlivesource.com","bak-webrtc-signal-scheduler.tlivesource.com"],pA="max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;",fA="kdccmd",hA="kdccmdp",mA="RequestSignalError",vA="background-color:#2A80EB;color:#FFF;padding:2px 1px;border-radius:2px;",yA="background-color:#F59B00;color:#FFF;padding:2px 1px;border-radius:2px;",gA="background-color:#EB4646;color:#FFF;padding:2px 1px;border-radius:2px;";!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}($k||($k={})),function(e){e[e.FAILURE=-1]="FAILURE",e[e.SUCCESS=0]="SUCCESS"}(eA||(eA={})),function(e){e[e.NEED_RECONNECT=-1]="NEED_RECONNECT",e[e.MANUAL_CLOSE=0]="MANUAL_CLOSE"}(tA||(tA={})),function(e){e[e.SEND=0]="SEND",e[e.RECEIVE=1]="RECEIVE"}(rA||(rA={})),function(e){e[e.INIT=0]="INIT",e[e.PLAYING=1]="PLAYING",e[e.WAITING=2]="WAITING"}(nA||(nA={})),function(e){e[e.PLAY_EVT_STREAM_BEGIN=1001]="PLAY_EVT_STREAM_BEGIN",e[e.PLAY_EVT_SERVER_CONNECTED=1002]="PLAY_EVT_SERVER_CONNECTED",e[e.PLAY_EVT_PLAY_BEGIN=1003]="PLAY_EVT_PLAY_BEGIN",e[e.PLAY_EVT_PLAY_STOP=1004]="PLAY_EVT_PLAY_STOP",e[e.PLAY_EVT_SERVER_RECONNECT=1005]="PLAY_EVT_SERVER_RECONNECT",e[e.PLAY_EVT_STREAM_EMPTY=1006]="PLAY_EVT_STREAM_EMPTY",e[e.PLAY_EVT_REQUEST_PULL_BEGIN=1007]="PLAY_EVT_REQUEST_PULL_BEGIN",e[e.PLAY_EVT_REQUEST_PULL_SUCCESS=1008]="PLAY_EVT_REQUEST_PULL_SUCCESS",e[e.PLAY_EVT_PLAY_WAITING_BEGIN=1009]="PLAY_EVT_PLAY_WAITING_BEGIN",e[e.PLAY_EVT_PLAY_WAITING_STOP=1010]="PLAY_EVT_PLAY_WAITING_STOP",e[e.PLAY_ERR_WEBRTC_FAIL=-2001]="PLAY_ERR_WEBRTC_FAIL",e[e.PLAY_ERR_REQUEST_PULL_FAIL=-2002]="PLAY_ERR_REQUEST_PULL_FAIL",e[e.PLAY_ERR_PLAY_FAIL=-2003]="PLAY_ERR_PLAY_FAIL",e[e.PLAY_ERR_SERVER_DISCONNECT=-2004]="PLAY_ERR_SERVER_DISCONNECT",e[e.PLAY_ERR_DECODE_FAIL=-2005]="PLAY_ERR_DECODE_FAIL",e[e.PLAY_ERR_REQUEST_ABR_FAIL=-2006]="PLAY_ERR_REQUEST_ABR_FAIL",e[e.PLAY_EVT_P2P_START_SUCCESS=3001]="PLAY_EVT_P2P_START_SUCCESS",e[e.PLAY_EVT_P2P_SOURCE_SWITCH=3002]="PLAY_EVT_P2P_SOURCE_SWITCH",e[e.PLAY_ERR_P2P_START_FAIL=-4001]="PLAY_ERR_P2P_START_FAIL"}(iA||(iA={}));var bA,CA,SA,TA=/tbs\/(\d+) /i,_A=/OS (\d+)_(\d+)_?(\d+)?/,wA=TA.test(navigator.userAgent),RA=/firefox\/(\d+)\./i.test(navigator.userAgent),EA=RA,PA=/UCBrowser\/(\d+)\./i.test(navigator.userAgent),kA=/safari\/(\d+)\./i.test(navigator.userAgent)&&!/chrome\/(\d+)\./i.test(navigator.userAgent),AA=/iPhone|iPad|iOS/i.test(navigator.userAgent),IA=AA,LA=function(){var e=navigator.userAgent.match(_A);return e&&[rk(e[1],10),rk(e[2],10),rk(e[3]||"0",10)]||[]},xA=!!(null===(oA=window.RTCRtpReceiver)||void 0===oA?void 0:oA.prototype.createEncodedStreams),DA=!!(null===(aA=window.RTCRtpReceiver)||void 0===aA?void 0:aA.prototype.getSynchronizationSources),OA=function(e,t,r){var n=e.match(t);return n&&n.length>=r&&rk(n[r],10)},NA=function(){try{return function(){var e,t,r,n=Ms.parse(window.navigator.userAgent),i=((null===(e=n.browser)||void 0===e?void 0:e.name)||"").toLowerCase(),o=((null===(t=n.engine)||void 0===t?void 0:t.name)||"").toLowerCase();return"ios"!==((null===(r=n.os)||void 0===r?void 0:r.name)||"").toLowerCase()&&("chrome"===i||"microsoft edge"===i||"edge"===i)&&"blink"===o}()}catch(e){return function(){var e=window.navigator.userAgent;if(/iPhone|iPad|iPod/i.test(e)||/CriOS/i.test(e)||/EdgiOS/i.test(e))return!1;var t=/Edg\/\d+/i.test(e);return/Chrome\/\d+/i.test(e)&&!/OPR\/|Opera\/|Edge\/|Brave\//i.test(e)||t}()}},MA=function(e,t){var r,n,i=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)([^?#]*)/.exec(e);if(i){var o=i[1].split("&");try{for(var a=Pa(o),s=a.next();!s.done;s=a.next()){var c=ka(s.value.split("="),2),u=c[0],l=c[1];if(u===t)return l}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}return null},UA=function(e,t,r){var n,i,o=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)([^?#]*)/.exec(e);if(o){var a,s,c=o[1],u=[],l=gi(a="".concat(t,"=")).call(a,r);try{for(var d=Pa(c.split("&")),p=d.next();!p.done;p=d.next()){var f,h=ka(p.value.split("="),2),m=h[0],v=h[1];if(m===t)null!==r&&u.push(l);else u.push(gi(f="".concat(m,"=")).call(f,v))}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return null===r||$i(u).call(u,l)||u.push(l),gi(s="".concat(e.replace(c,""))).call(s,u.join("&"))}return e},VA={},FA=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],jA=FA[0];try{for(var BA=Pa(FA),WA=BA.next();!WA.done;WA=BA.next()){var GA=WA.value;if(GA[1]in document){SA=GA;break}}}catch(e){bA={error:e}}finally{try{WA&&!WA.done&&(CA=BA.return)&&CA.call(BA)}finally{if(bA)throw bA.error}}if(SA)for(var ZA=0;ZA<SA.length;ZA++)VA[jA[ZA]]=SA[ZA];var YA,XA=function(e){if("function"==typeof e.webkitEnterFullScreen){var t=navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1};!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.EXCELLENT=1]="EXCELLENT",e[e.GOOD=2]="GOOD",e[e.POOR=3]="POOR",e[e.BAD=4]="BAD",e[e.VERY_BAD=5]="VERY_BAD"}(YA||(YA={}));var HA=function(e){var t,r=e.split("\r\n"),n=[];Co(r).call(r,(function(e){var t=e.toLowerCase();$i(t).call(t,"a=rtpmap")&&$i(t).call(t,"h264")&&n.push(e)}));var i=Ca(t=ck(n).call(n,(function(e){var t=/a=rtpmap:(\d+)\s/.exec(e);return t&&t.length>1?t[1]:null}))).call(t,(function(e){return null!==e})),o=[];return Co(r).call(r,(function(e){var t=e;if($i(e).call(e,"a=fmtp:111")&&(t="".concat(e,";stereo=1")),$i(e).call(e,"a=fmtp")){var r=/a=fmtp:(\d+)\s/.exec(e);r&&r.length>1&&$i(i).call(i,r[1])&&(t="".concat(e,";sps-pps-idr-in-keyframe=1"))}o.push(t)})),function(e){var t;if(!EA)return e;var r=e.split("\r\n"),n=[],i=[];Co(r).call(r,(function(e){var t=e.toLowerCase();$i(t).call(t,"a=rtpmap")&&$i(t).call(t,"h264")&&n.push(e)})),n.length>1&&i.push.apply(i,Aa([],ka(sh(n).call(n,1)),!1));var o=Ca(t=ck(i).call(i,(function(e){var t=/a=rtpmap:(\d+)\s/.exec(e);return t&&t.length>1?t[1]:null}))).call(t,(function(e){return null!==e})),a=[];return Co(r).call(r,(function(e){var t,r=e;if($i(e).call(e,"a=setup")&&(r="a=setup:passive"),($i(e).call(e,"m=audio")||$i(e).call(e,"m=video"))&&(r=Ca(t=e.split(" ")).call(t,(function(e,t){return t<3||!$i(o).call(o,e)})).join(" ")),$i(e).call(e,"a=fmtp")||$i(e).call(e,"a=rtcp-fb")||$i(e).call(e,"a=rtpmap")){var n=/a=(?:fmtp|rtcp-fb|rtpmap):(\d+)\s/.exec(e);if(n&&n.length>1&&$i(o).call(o,n[1]))return}a.push(r)})),a.join("\r\n")}(o.join("\r\n"))},KA=function(e){var t,r,n="",i="";return Co(t=e.split("\r\n")).call(t,(function(e){var t=/(?:a=ice-ufrag:)(.+)/.exec(e);if(t)n=t[1];else{var r=/(?:a=ice-pwd:)(.+)/.exec(e);r&&(i=r[1])}})),gi(r="".concat(n,"_")).call(r,i)};Ar({target:"Array",stat:!0},{isArray:$r});var JA=$.Array.isArray,QA=Ir,zA=Math.floor,qA=function(e,t){var r=e.length;if(r<8)for(var n,i,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var a=zA(r/2),s=qA(QA(e,0,a),t),c=qA(QA(e,a),t),u=s.length,l=c.length,d=0,p=0;d<u||p<l;)e[d+p]=d<u&&p<l?t(s[d],c[p])<=0?s[d++]:c[p++]:d<u?s[d++]:c[p++];return e},$A=qA,eI=se.match(/firefox\/(\d+)/i),tI=!!eI&&+eI[1],rI=/MSIE|Trident/.test(se),nI=se.match(/AppleWebKit\/(\d+)\./),iI=!!nI&&+nI[1],oI=Ar,aI=u,sI=Ie,cI=Je,uI=un,lI=wk,dI=Vi,pI=n,fI=$A,hI=uo,mI=tI,vI=rI,yI=he,gI=iI,bI=[],CI=aI(bI.sort),SI=aI(bI.push),TI=pI((function(){bI.sort(void 0)})),_I=pI((function(){bI.sort(null)})),wI=hI("sort"),RI=!pI((function(){if(yI)return yI<70;if(!(mI&&mI>3)){if(vI)return!0;if(gI)return gI<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)bI.push({k:t+n,v:r})}for(bI.sort((function(e,t){return t.v-e.v})),n=0;n<bI.length;n++)t=bI[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));oI({target:"Array",proto:!0,forced:TI||!_I||!wI||!RI},{sort:function(e){void 0!==e&&sI(e);var t=cI(this);if(RI)return void 0===e?CI(t):CI(t,e);var r,n,i=[],o=uI(t);for(n=0;n<o;n++)n in t&&SI(i,t[n]);for(fI(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:dI(t)>dI(r)?1:-1}}(e)),r=uI(i),n=0;n<r;)t[n]=i[n++];for(;n<o;)lI(t,n++);return t}});var EI=Xr("Array","sort"),PI=l,kI=EI,AI=Array.prototype,II=function(e){var t=e.sort;return e===AI||PI(AI,e)&&t===AI.sort?kI:t},LI=Xr("Array","keys"),xI=wn,DI=qe,OI=l,NI=LI,MI=Array.prototype,UI={DOMTokenList:!0,NodeList:!0},VI=function(e){var t=e.keys;return e===MI||OI(MI,e)&&t===MI.keys||DI(UI,xI(e))?NI:t},FI={exports:{}},jI={};Object.defineProperty(jI,"__esModule",{value:!0});var BI=function(e){this.bitReservoir=e,this.originalBitReservoir=e};jI.ExpGolombDecoder=BI,BI.prototype.byteAlign=function(){var e=8*Math.ceil((this.originalBitReservoir.length-this.bitReservoir.length)/8),t=this.originalBitReservoir.length-e,r=this.bitReservoir.length-t;return this.readRawBits(r)},BI.prototype.countLeadingZeros=function(){for(var e=0;e<this.bitReservoir.length;e++)if("1"===this.bitReservoir[e])return e;return-1},BI.prototype.readUnsignedExpGolomb=function(){var e=this.countLeadingZeros(),t=e+1;if(-1===e)throw new Error("Error reading exp-golomb value.");this.readBits(e);var r=this.readBits(t);return r-=1},BI.prototype.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 0!==e&&(e=1&e?(e+1)/2:-e/2),e},BI.prototype.readBits=function(e){if(this.bitReservoir.length<e)throw new Error("Error reading bit stream value expected ("+e+") bits remaining but found ("+this.bitReservoir.length+")");var t=parseInt(this.bitReservoir.slice(0,e),2);return this.bitReservoir=this.bitReservoir.slice(e),t},BI.prototype.readRawBits=function(e){if(this.bitReservoir.length<e)throw new Error("Error reading bit stream value expected ("+e+") bits remaining but found ("+this.bitReservoir.length+")");var t=this.bitReservoir.slice(0,e);return this.bitReservoir=this.bitReservoir.slice(e),t},BI.prototype.readUnsignedByte=function(){return this.readBits(8)};var WI=function(e){this.bitReservoir=e||""};jI.ExpGolombEncoder=WI,WI.prototype.writeUnsignedExpGolomb=function(e){for(var t="",r=(e+1).toString(2),n=r.length-1,i=0;i<n;i++)t+="0";this.bitReservoir+=t+r},WI.prototype.writeExpGolomb=function(e){e=e<=0?2*-e:2*e-1,this.writeUnsignedExpGolomb(e)},WI.prototype.writeBits=function(e,t){for(var r="",n=(t&(1<<e)-1).toString(2),i=e-n.length,o=0;o<i;o++)r+="0";this.bitReservoir+=r+n},WI.prototype.writeRawBits=function(e,t){for(var r="",n=e-t.length,i=0;i<n;i++)r+="0";this.bitReservoir+=r+t},WI.prototype.writeUnsignedByte=function(e){this.writeBits(8,e)};var GI={},ZI={};Object.defineProperty(ZI,"__esModule",{value:!0});ZI.typedArrayToBitString=function(e){for(var t=[],r=e.BYTES_PER_ELEMENT||1,n="",i=0;i<e.length;i++)t.push(e[i]);for(i=0;i<r;i++)n+="00000000";return t.map((function(e){return(n+e.toString(2)).slice(8*-r)})).join("")};ZI.bitStringToTypedArray=function(e){for(var t=8-e.length%8,r=0;8!==t&&r<t;r++)e+="0";var n=e.match(/(.{8})/g).map((function(e){return parseInt(e,2)}));return new Uint8Array(n)};ZI.removeRBSPTrailingBits=function(e){return e.split(/10*$/)[0]};ZI.appendRBSPTrailingBits=function(e){var t=e+"10000000",r=t.length%8;return 0===r?t:t.slice(0,-r)};var YI={};Object.defineProperty(YI,"__esModule",{value:!0});YI.mergeObj=function(e,t){var r={};return e&&Object.keys(e).forEach((function(t){r[t]=e[t]})),t&&Object.keys(t).forEach((function(e){r[e]=t[e]})),r};var XI={};Object.defineProperty(XI,"__esModule",{value:!0});XI.list=function(e,t){return{decode:function(r){var n=r.expGolomb,i=r.output,o=r.options,a=r.indexes,s=r.path,c=t?s:s.concat("[list]");return e.forEach((function(e){i=e.decode({expGolomb:n,output:i,options:o,indexes:a,path:c})||i})),i},encode:function(t,r,n,i){e.forEach((function(e){e.encode(t,r,n,i)}))}}};var HI={};Object.defineProperty(HI,"__esModule",{value:!0});HI.propertyHandler=function(e){var t=e.split("["),r=t[0],n=null;return t.length>1&&(n=t.slice(1).map(parseFloat)),{propertyName:r,indexArray:n}};var KI={};Object.defineProperty(KI,"__esModule",{value:!0});KI.getProperty=function(e,t,r,n){var i=e[r]||t[r];return n.length?n.reduce((function(e,t){return Array.isArray(e)||Object.isObject(e)?e[t]:e}),i):i};KI.writeProperty=function(e,t,r,n,i){var o=e[r]||t[r],a=n[n.length-1];if(!o){if(!n.length)return void(e[r]=i);o=e[r]=[]}n.slice(0,-1).reduce((function(e,t){return e[t],Array.isArray(e[t])||(e[t]=[]),e[t]}),o)[a]=i};KI.indexArrayMerge=function(e,t){return e.slice(-t.length).map((function(e,r){return isNaN(t[r])?e:t[r]}))},Object.defineProperty(GI,"__esModule",{value:!0});var JI=jI,QI=ZI,zI=XI,qI=HI,$I=KI,eL=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=(0,zI.list)(r,!0);return{decode:function(t,r,n){var o=(0,QI.typedArrayToBitString)(t),a=o;n=n||{},(r=r||{}).no_trailer_bits||(a=(0,QI.removeRBSPTrailingBits)(o));var s=new JI.ExpGolombDecoder(a);try{return i.decode({options:r,output:n,expGolomb:s,indexes:[],path:[e]})}catch(e){return n}},encode:function(t,r){var n=new JI.ExpGolombEncoder;r=r||{},i.encode({options:r,input:t,expGolomb:n,indexes:[],path:[e]});var o=n.bitReservoir,a=(0,QI.appendRBSPTrailingBits)(o);return(0,QI.bitStringToTypedArray)(a)}}};GI.start=eL;GI.startArray=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=eL.apply(void 0,[e].concat(r));return{decode:function(e,t){return i.decode(e,t,[])},encode:i.encode}};GI.data=function(e,t){var r=(0,qI.propertyHandler)(e),n=r.propertyName,i=r.indexArray;return{name:e,decode:function(e){var r=e.expGolomb,o=e.output,a=e.options,s=e.indexes,c=e.path,u=void 0;try{u=t.read(r,o,a,s)}catch(e){throw o["Parse Error:"]=e.message+" at "+c.join("/"),e}return i?(0,$I.writeProperty)(o,a,n,(0,$I.indexArrayMerge)(s,i),u):o[n]=u,o},encode:function(e){var r=e.expGolomb,o=e.input,a=e.options,s=e.indexes;e.path;var c=void 0;"number"==typeof(c=i?(0,$I.getProperty)(o,a,n,(0,$I.indexArrayMerge)(s,i)):o[n])&&(c=t.write(r,o,a,s,c))}}};GI.debug=function(e){return{decode:function(t){var r=t.expGolomb,n=t.output,i=t.options,o=t.indexes,a=t.path;console.log(e,a.join(","),r.bitReservoir,n,i,o)},encode:function(t){var r=t.expGolomb,n=t.input,i=t.options,o=t.indexes,a=t.path;console.log(e,a.join(","),r.bitReservoir,n,i,o)}}};GI.newObj=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=(0,qI.propertyHandler)(e),o=i.propertyName,a=i.indexArray,s=(0,zI.list)(r,!0);return{name:e,decode:function(t){var r=t.expGolomb,n=t.output,i=t.options,c=t.indexes,u=t.path.concat(e),l=s.decode({expGolomb:r,output:Object.create(n),options:i,indexes:c,path:u});return a?(0,$I.writeProperty)(n,i,o,(0,$I.indexArrayMerge)(c,a),l):n[o]=l,n},encode:function(t){var r=t.expGolomb,n=t.input,i=t.options,c=t.indexes,u=void 0;if("number"==typeof(u=nameArray?(0,$I.getProperty)(n,i,o,(0,$I.indexArrayMerge)(c,a)):n[o])){var l=path.concat(e);s.encode({expGolomb:r,input:u,options:i,indexes:c,path:l})}}}};GI.verify=function(e){return{decode:function(t){var r=t.expGolomb,n=t.output;t.options,t.indexes;var i=r.bitReservoir.length;0!==i&&(n["Validation Error:"]=e+" was not completely parsed - there were ("+i+") bits remaining")},encode:function(e){e.expGolomb,e.input,e.options,e.indexes}}};var tL={};Object.defineProperty(tL,"__esModule",{value:!0});var rL=XI,nL=HI,iL=KI;tL.when=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=(0,rL.list)(r,!0);return{decode:function(t){var r=t.expGolomb,n=t.output,o=t.options,a=t.indexes,s=t.path.concat("[when]");return e(n,o,a)?i.decode({expGolomb:r,output:n,options:o,indexes:a,path:s}):n},encode:function(t){var r=t.expGolomb,n=t.input,o=t.options,a=t.indexes,s=t.path.concat("[when]");e(n,o,a)&&i.encode({expGolomb:r,input:n,options:o,indexes:a,path:s})}}};tL.each=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=(0,rL.list)(r,!0);return{decode:function(t){var r=t.expGolomb,n=t.output,o=t.options,a=t.indexes,s=t.path.concat("[each]"),c=a.length;for(a[c]=0;e(a[c],n,o);)i.decode({expGolomb:r,output:n,options:o,indexes:a,path:s}),a[c]++;return a.length=c,n},encode:function(t){var r=t.expGolomb,n=t.input,o=t.options,a=t.indexes,s=t.path.concat("[each]"),c=a.length;for(a[c]=0;e(a[c],n,o);)i.encode({expGolomb:r,input:n,options:o,indexes:a,path:s}),a[c]++;a.length=c}}};tL.inArray=function(e,t){var r=(0,nL.propertyHandler)(e),n=r.propertyName,i=r.indexArray;return function(e,r,o){return i?-1!==t.indexOf((0,iL.getProperty)(e,r,n,(0,iL.indexArrayMerge)(o,i))):-1!==t.indexOf(e[n])||-1!==t.indexOf(r[n])}};tL.equals=function(e,t){var r=(0,nL.propertyHandler)(e),n=r.propertyName,i=r.indexArray;return function(e,r,o){return i?(0,iL.getProperty)(e,r,n,(0,iL.indexArrayMerge)(o,i))===t:e[n]===t||r[n]===t}};tL.gt=function(e,t){var r=(0,nL.propertyHandler)(e),n=r.propertyName,i=r.indexArray;return function(e,r,o){return i?(0,iL.getProperty)(e,r,n,(0,iL.indexArrayMerge)(o,i))===t:e[n]>t||r[n]>t}};tL.not=function(e){return function(t,r,n){return!e(t,r,n)}};tL.some=function(e){return function(t,r,n){return e.some((function(e){return e(t,r,n)}))}};tL.every=function(e){return function(t,r,n){return e.every((function(e){return e(t,r,n)}))}};tL.whenMoreData=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=(0,rL.list)(t,!0);return{decode:function(e){var t=e.expGolomb,r=e.output,i=e.options,o=e.indexes,a=e.path.concat("[whenMoreData]");return t.bitReservoir.length?n.decode({expGolomb:t,output:r,options:i,indexes:o,path:a}):r},encode:function(e){var t=e.expGolomb,r=e.input,i=e.options,o=e.indexes,a=e.path.concat("[whenMoreData]");n.encode({expGolomb:t,input:r,options:i,indexes:o,path:a})}}};tL.whileMoreData=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=(0,rL.list)(t,!0);return{decode:function(e){var t=e.expGolomb,r=e.output,i=e.options,o=e.indexes,a=e.path.concat("[whileMoreData]"),s=o.length;for(o[s]=0;t.bitReservoir.length;)n.decode({expGolomb:t,output:r,options:i,indexes:o,path:a}),o[s]++;return o.length=s,r},encode:function(e){var t=e.expGolomb,r=e.input,i=e.options,o=e.indexes,a=e.path.concat("[whenMoreData]"),s=o.length;o[s]=0;var c=0;for(Array.isArray(r)&&(c=r.length);index<c;)n.encode({expGolomb:t,input:r,options:i,indexes:o,path:a}),o[s]++;o.length=s}}};var oL={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t,r,n,i){return"function"==typeof e?e(t,r,n,i):e},n={u:function(e){return{read:function(t,n,i,o){var a=r(e,t,n,i,o);return t.readBits(a)},write:function(t,n,i,o,a){var s=r(e,t,n,i,o);t.writeBits(s,a)}}},f:function(e){return{read:function(t,n,i,o){var a=r(e,t,n,i,o);return t.readBits(a)},write:function(t,n,i,o,a){var s=r(e,t,n,i,o);t.writeBits(s,a)}}},ue:function(){return{read:function(e,t,r,n){return e.readUnsignedExpGolomb()},write:function(e,t,r,n,i){e.writeUnsignedExpGolomb(i)}}},se:function(){return{read:function(e,t,r,n){return e.readExpGolomb()},write:function(e,t,r,n,i){e.writeExpGolomb(i)}}},b:function(){return{read:function(e,t,r,n){return e.readUnsignedByte()},write:function(e,t,r,n,i){e.writeUnsignedByte(i)}}},val:function(e){return{read:function(t,r,n,i){return"function"==typeof e?e(t,r,n,i):e},write:function(t,r,n,i,o){"function"==typeof e&&e(ExpGolomb,output,n,i)}}},byteAlign:function(){return{read:function(e,t,r,n){return e.byteAlign()},write:function(e,t,r,n,i){}}}};t.default=n,e.exports=t.default}(oL,oL.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=jI,n=GI,i=XI,o=tL,a=oL.exports,s=ZI;(0,i.list)([]);var c=function(e,t,r,n){return r.initial_cpb_removal_delay_length_minus1+1},u={0:{name:"buffering_period",codec:(0,i.list)([(0,n.data)("seq_parameter_set_id",(0,a.ue)(null)),(0,o.when)((0,o.equals)("nal_hrd_parameters_present_flag",1),(0,o.each)((function(e,t,r){return e<=r.cpb_cnt_minus1}),(0,n.data)("initial_cpb_removal_delay[]",(0,a.u)(c)),(0,n.data)("initial_cpb_removal_delay_offset[]",(0,a.u)(c)))),(0,o.when)((0,o.equals)("vcl_hrd_parameters_present_flag",1),(0,o.each)((function(e,t,r){return e<=r.cpb_cnt_minus1}),(0,n.data)("initial_cpb_removal_delay[]",(0,a.u)(c)),(0,n.data)("initial_cpb_removal_delay_offset[]",(0,a.u)(c))))])},1:{name:"pic_timing",codec:(0,i.list)([(0,o.when)((0,o.some)([(0,o.equals)("nal_hrd_parameters_present_flag",1),(0,o.equals)("vcl_hrd_parameters_present_flag",1)]),(0,n.data)("cpb_removal_delay",(0,a.u)((function(e,t,r,n){return r.cpb_removal_delay_length_minus1+1}))),(0,n.data)("dpb_output_delay",(0,a.u)((function(e,t,r,n){return r.dpb_output_delay_length_minus1+1})))),(0,o.when)((0,o.equals)("pic_struct_present_flag",1),(0,n.data)("pic_struct",(0,a.u)(4)),(0,o.when)((0,o.equals)("pic_struct",0),(0,n.data)("NumClockTS",(0,a.val)(1))),(0,o.when)((0,o.equals)("pic_struct",1),(0,n.data)("NumClockTS",(0,a.val)(1))),(0,o.when)((0,o.equals)("pic_struct",2),(0,n.data)("NumClockTS",(0,a.val)(1))),(0,o.when)((0,o.equals)("pic_struct",3),(0,n.data)("NumClockTS",(0,a.val)(2))),(0,o.when)((0,o.equals)("pic_struct",4),(0,n.data)("NumClockTS",(0,a.val)(2))),(0,o.when)((0,o.equals)("pic_struct",5),(0,n.data)("NumClockTS",(0,a.val)(3))),(0,o.when)((0,o.equals)("pic_struct",6),(0,n.data)("NumClockTS",(0,a.val)(3))),(0,o.when)((0,o.equals)("pic_struct",7),(0,n.data)("NumClockTS",(0,a.val)(2))),(0,o.when)((0,o.equals)("pic_struct",8),(0,n.data)("NumClockTS",(0,a.val)(2))),(0,o.each)((function(e,t){return e<t.NumClockTS}),(0,n.data)("clock_timestamp_flag[]",(0,a.u)(1)),(0,o.when)((0,o.equals)("clock_timestamp_flag[]",1),(0,n.data)("ct_type[]",(0,a.u)(2)),(0,n.data)("nuit_field_based_flag[]",(0,a.u)(1)),(0,n.data)("counting_type[]",(0,a.u)(5)),(0,n.data)("full_timestamp_flag[]",(0,a.u)(1)),(0,n.data)("discontinuity_flag[]",(0,a.u)(1)),(0,n.data)("cnt_dropped_flag[]",(0,a.u)(1)),(0,n.data)("n_frames[]",(0,a.u)(8)),(0,o.when)((0,o.equals)("full_timestamp_flag[]",1),(0,n.data)("seconds_value[]",(0,a.u)(6)),(0,n.data)("minutes_value[]",(0,a.u)(6)),(0,n.data)("hours_value[]",(0,a.u)(5))),(0,o.when)((0,o.equals)("full_timestamp_flag[]",0),(0,n.data)("seconds_flag[]",(0,a.u)(1)),(0,o.when)((0,o.equals)("seconds_flag[]",1),(0,n.data)("seconds_value[]",(0,a.u)(6)),(0,n.data)("minutes_flag[]",(0,a.u)(1)),(0,o.when)((0,o.equals)("minutes_flag[]",1),(0,n.data)("minutes_value[]",(0,a.u)(6)),(0,n.data)("hours_flag[]",(0,a.u)(1)),(0,o.when)((0,o.equals)("hours_flag[]",1),(0,n.data)("hours_value[]",(0,a.u)(5)))))),(0,o.when)((0,o.gt)("time_offset_length",0),(0,n.data)("time_offset",(0,a.u)((function(e,t,r,n){return r.time_offset_length})))))))])},2:{name:"pan_scan_rect"},3:{name:"filler_payload"},4:{name:"user_data_registered_itu_t_t35",codec:(0,i.list)([(0,n.data)("itu_t_t35_country_code",(0,a.u)(8)),(0,n.data)("itu_t_t35_provider_code",(0,a.u)(16)),(0,o.when)((0,o.equals)("itu_t_t35_provider_code",49),(0,n.data)("ATSC_user_identifier",(0,a.u)(32))),(0,o.when)((0,o.inArray)("itu_t_t35_provider_code",[47,49]),(0,n.data)("ATSC1_data_user_data_type_code",(0,a.u)(8))),(0,o.when)((0,o.equals)("itu_t_t35_provider_code",47),(0,n.data)("DIRECTV_user_data_length",(0,a.u)(8))),(0,n.data)("process_em_data_flag",(0,a.u)(1)),(0,n.data)("process_cc_data_flag",(0,a.u)(1)),(0,n.data)("additional_data_flag",(0,a.u)(1)),(0,n.data)("cc_count",(0,a.u)(5)),(0,n.data)("em_data",(0,a.u)(8)),(0,o.each)((function(e,t){return e<t.cc_count}),(0,n.newObj)("cc_data_pkts[]",(0,n.data)("type",(0,a.val)("cc_data_pkt")),(0,n.data)("marker_bits",(0,a.u)(5)),(0,n.data)("cc_valid",(0,a.u)(1)),(0,n.data)("cc_type",(0,a.u)(2)),(0,n.data)("cc_data_1",(0,a.u)(8)),(0,n.data)("cc_data_2",(0,a.u)(8)))),(0,n.data)("marker_bits",(0,a.u)(8))])},5:{name:"user_data_unregistered"},6:{name:"recovery_point",codec:(0,i.list)([(0,n.data)("recovery_frame_cnt",(0,a.ue)(null)),(0,n.data)("exact_match_flag",(0,a.u)(1)),(0,n.data)("broken_link_flag",(0,a.u)(1)),(0,n.data)("changing_slice_group_idc",(0,a.u)(2))])},7:{name:"dec_ref_pic_marking_repetition"},8:{name:"spare_pic"},9:{name:"scene_info"},10:{name:"sub_seq_info"},11:{name:"sub_seq_layer_characteristics"},12:{name:"sub_seq_characteristics"},13:{name:"full_frame_freeze"},14:{name:"full_frame_freeze_release"},15:{name:"full_frame_snapshot"},16:{name:"progressive_refinement_segment_start"},17:{name:"progressive_refinement_segment_end"},18:{name:"motion_constrained_slice_group_set"},19:{name:"film_grain_characteristics"},20:{name:"deblocking_filter_display_preference"},21:{name:"stereo_video_info"},22:{name:"post_filter_hint"},23:{name:"tone_mapping_info"},24:{name:"scalability_info"},25:{name:"sub_pic_scalable_layer"},26:{name:"non_required_layer_rep"},27:{name:"priority_layer_info"},28:{name:"layers_not_present"},29:{name:"layer_dependency_change"},30:{name:"scalable_nesting"},31:{name:"base_layer_temporal_hrd"},32:{name:"quality_layer_integrity_check"},33:{name:"redundant_pic_property"},34:{name:"tl"},35:{name:"tl_switching_point"},36:{name:"parallel_decoding_info"},37:{name:"mvc_scalable_nesting"},38:{name:"view_scalability_info"},39:{name:"multiview_scene_info"},40:{name:"multiview_acquisition_info"},41:{name:"non_required_view_component"},42:{name:"view_dependency_change"},43:{name:"operation_points_not_present"},44:{name:"base_view_temporal_hrd"},45:{name:"frame_packing_arrangement"}},l={decode:function(e){var t=e.expGolomb,n=e.output,i=e.options,o=e.indexes,a=e.path,c=o[0],l={payloadType:0,payloadSize:0},d=void 0;do{d=t.readUnsignedByte(),l.payloadType+=d}while(255===d);do{d=t.readUnsignedByte(),l.payloadSize+=d}while(255===d);var p=u[l.payloadType],f=t.readRawBits(8*l.payloadSize);if(p)if(l.type=p.name,p.codec){var h=new r.ExpGolombDecoder(f);p.codec.decode({expGolomb:h,output:l,options:i,path:a,indexes:o})}else l.data=(0,s.bitStringToTypedArray)(f);else l.type="unknown type",l.data=(0,s.bitStringToTypedArray)(f);return n[c]=l,n},encode:function(e){for(var t=e.expGolomb,n=e.input,i=e.options,o=e.indexes,a=e.path,c=n[o[0]],l=c.payloadType;l>255;)l-=255,t.writeUnsignedByte(255);t.writeUnsignedByte(l);for(var d=c.payloadSize;d>255;)d-=255,t.writeUnsignedByte(255);t.writeUnsignedByte(d);var p=u[c.payloadType];if(p&&p.codec){var f=new r.ExpGolombEncoder;p.codec.encode({expGolomb:f,input:c,options:i,path:a,indexes:o});var h=f.bitReservoir;h.length%8!=0&&(h=(0,s.appendRBSPTrailingBits)(h)),t.writeRawBits(8*c.payloadSize,h)}else c.data?t.writeRawBits(8*c.payloadSize,(0,s.typedArrayToBitString)(c.data)):t.writeRawBits(8*c.payloadSize,"")}},d=(0,n.startArray)("sei_message",(0,o.whileMoreData)(l));t.default=d,e.exports=t.default}(FI,FI.exports);var aL=r(FI.exports),sL=function(e){return aL.decode(e)},cL=function(){function e(){this.isLoggingEnabled=!1}return e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.printLog.apply(this,Aa([vA],ka(e),!1))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.printLog.apply(this,Aa([yA],ka(e),!1))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.printLog.apply(this,Aa([gA],ka(e),!1))},e.prototype.enableLogging=function(e){this.isLoggingEnabled=e},e.prototype.printLog=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.isLoggingEnabled&&console.log.apply(console,Aa(["%c LEB ",e],ka(t),!1))},e}(),uL=new cL;function lL(e,t,r){var n=void 0===t?null:t,i=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),o=i.indexOf("\n",10)+1,a=i.substring(o)+(n?"//# sourceMappingURL="+n:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var dL,pL,fL,hL,mL=(dL="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9InVuZGVmaW5lZCIhPXR5cGVvZiBnbG9iYWxUaGlzP2dsb2JhbFRoaXM6InVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3c/d2luZG93OiJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsP2dsb2JhbDoidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGY/c2VsZjp7fSxlPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0Lk1hdGg9PT1NYXRoJiZ0fSxuPWUoIm9iamVjdCI9PXR5cGVvZiBnbG9iYWxUaGlzJiZnbG9iYWxUaGlzKXx8ZSgib2JqZWN0Ij09dHlwZW9mIHdpbmRvdyYmd2luZG93KXx8ZSgib2JqZWN0Ij09dHlwZW9mIHNlbGYmJnNlbGYpfHxlKCJvYmplY3QiPT10eXBlb2YgdCYmdCl8fGUoIm9iamVjdCI9PXR5cGVvZiB0JiZ0KXx8ZnVuY3Rpb24oKXtyZXR1cm4gdGhpc30oKXx8RnVuY3Rpb24oInJldHVybiB0aGlzIikoKSxyPWZ1bmN0aW9uKHQpe3RyeXtyZXR1cm4hIXQoKX1jYXRjaCh0KXtyZXR1cm4hMH19LG89IXIoKGZ1bmN0aW9uKCl7dmFyIHQ9ZnVuY3Rpb24oKXt9LmJpbmQoKTtyZXR1cm4iZnVuY3Rpb24iIT10eXBlb2YgdHx8dC5oYXNPd25Qcm9wZXJ0eSgicHJvdG90eXBlIil9KSksaT1vLHU9RnVuY3Rpb24ucHJvdG90eXBlLGM9dS5hcHBseSxmPXUuY2FsbCxhPSJvYmplY3QiPT10eXBlb2YgUmVmbGVjdCYmUmVmbGVjdC5hcHBseXx8KGk/Zi5iaW5kKGMpOmZ1bmN0aW9uKCl7cmV0dXJuIGYuYXBwbHkoYyxhcmd1bWVudHMpfSksbD1vLHM9RnVuY3Rpb24ucHJvdG90eXBlLHA9cy5jYWxsLGI9bCYmcy5iaW5kLmJpbmQocCxwKSx5PWw/YjpmdW5jdGlvbih0KXtyZXR1cm4gZnVuY3Rpb24oKXtyZXR1cm4gcC5hcHBseSh0LGFyZ3VtZW50cyl9fSx2PXksZD12KHt9LnRvU3RyaW5nKSxoPXYoIiIuc2xpY2UpLGc9ZnVuY3Rpb24odCl7cmV0dXJuIGgoZCh0KSw4LC0xKX0sbT1nLHc9eSxqPWZ1bmN0aW9uKHQpe2lmKCJGdW5jdGlvbiI9PT1tKHQpKXJldHVybiB3KHQpfSxPPSJvYmplY3QiPT10eXBlb2YgZG9jdW1lbnQmJmRvY3VtZW50LmFsbCxTPXZvaWQgMD09PU8mJnZvaWQgMCE9PU8/ZnVuY3Rpb24odCl7cmV0dXJuImZ1bmN0aW9uIj09dHlwZW9mIHR8fHQ9PT1PfTpmdW5jdGlvbih0KXtyZXR1cm4iZnVuY3Rpb24iPT10eXBlb2YgdH0sRT17fSxQPSFyKChmdW5jdGlvbigpe3JldHVybiA3IT09T2JqZWN0LmRlZmluZVByb3BlcnR5KHt9LDEse2dldDpmdW5jdGlvbigpe3JldHVybiA3fX0pWzFdfSkpLFQ9byxEPUZ1bmN0aW9uLnByb3RvdHlwZS5jYWxsLE49VD9ELmJpbmQoRCk6ZnVuY3Rpb24oKXtyZXR1cm4gRC5hcHBseShELGFyZ3VtZW50cyl9LEk9e30saz17fS5wcm9wZXJ0eUlzRW51bWVyYWJsZSxDPU9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IsQj1DJiYhay5jYWxsKHsxOjJ9LDEpO0kuZj1CP2Z1bmN0aW9uKHQpe3ZhciBlPUModGhpcyx0KTtyZXR1cm4hIWUmJmUuZW51bWVyYWJsZX06azt2YXIgRixMLF89ZnVuY3Rpb24odCxlKXtyZXR1cm57ZW51bWVyYWJsZTohKDEmdCksY29uZmlndXJhYmxlOiEoMiZ0KSx3cml0YWJsZTohKDQmdCksdmFsdWU6ZX19LFI9cix6PWcsTT1PYmplY3QsQT15KCIiLnNwbGl0KSxVPVIoKGZ1bmN0aW9uKCl7cmV0dXJuIU0oInoiKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKX0pKT9mdW5jdGlvbih0KXtyZXR1cm4iU3RyaW5nIj09PXoodCk/QSh0LCIiKTpNKHQpfTpNLHg9ZnVuY3Rpb24odCl7cmV0dXJuIG51bGw9PXR9LFc9eCxHPVR5cGVFcnJvcixWPWZ1bmN0aW9uKHQpe2lmKFcodCkpdGhyb3cgbmV3IEcoIkNhbid0IGNhbGwgbWV0aG9kIG9uICIrdCk7cmV0dXJuIHR9LFk9VSxxPVYsSD1TLEo9ZnVuY3Rpb24odCl7cmV0dXJuIm9iamVjdCI9PXR5cGVvZiB0P251bGwhPT10OkgodCl9LEs9e30sUT1LLFg9bixaPVMsJD1mdW5jdGlvbih0KXtyZXR1cm4gWih0KT90OnZvaWQgMH0sdHQ9eSh7fS5pc1Byb3RvdHlwZU9mKSxldD1uLm5hdmlnYXRvcixudD1ldCYmZXQudXNlckFnZW50LHJ0PW50P1N0cmluZyhudCk6IiIsb3Q9bixpdD1ydCx1dD1vdC5wcm9jZXNzLGN0PW90LkRlbm8sZnQ9dXQmJnV0LnZlcnNpb25zfHxjdCYmY3QudmVyc2lvbixhdD1mdCYmZnQudjg7YXQmJihMPShGPWF0LnNwbGl0KCIuIikpWzBdPjAmJkZbMF08ND8xOisoRlswXStGWzFdKSksIUwmJml0JiYoIShGPWl0Lm1hdGNoKC9FZGdlXC8oXGQrKS8pKXx8RlsxXT49NzQpJiYoRj1pdC5tYXRjaCgvQ2hyb21lXC8oXGQrKS8pKSYmKEw9K0ZbMV0pO3ZhciBsdD1MLHN0PXIscHQ9bi5TdHJpbmcsYnQ9ISFPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzJiYhc3QoKGZ1bmN0aW9uKCl7dmFyIHQ9U3ltYm9sKCJzeW1ib2wgZGV0ZWN0aW9uIik7cmV0dXJuIXB0KHQpfHwhKE9iamVjdCh0KWluc3RhbmNlb2YgU3ltYm9sKXx8IVN5bWJvbC5zaGFtJiZsdCYmbHQ8NDF9KSkseXQ9YnQmJiFTeW1ib2wuc2hhbSYmInN5bWJvbCI9PXR5cGVvZiBTeW1ib2wuaXRlcmF0b3IsdnQ9ZnVuY3Rpb24odCxlKXtyZXR1cm4gYXJndW1lbnRzLmxlbmd0aDwyPyQoUVt0XSl8fCQoWFt0XSk6UVt0XSYmUVt0XVtlXXx8WFt0XSYmWFt0XVtlXX0sZHQ9UyxodD10dCxndD1PYmplY3QsbXQ9eXQ/ZnVuY3Rpb24odCl7cmV0dXJuInN5bWJvbCI9PXR5cGVvZiB0fTpmdW5jdGlvbih0KXt2YXIgZT12dCgiU3ltYm9sIik7cmV0dXJuIGR0KGUpJiZodChlLnByb3RvdHlwZSxndCh0KSl9LHd0PVN0cmluZyxqdD1TLE90PWZ1bmN0aW9uKHQpe3RyeXtyZXR1cm4gd3QodCl9Y2F0Y2godCl7cmV0dXJuIk9iamVjdCJ9fSxTdD1UeXBlRXJyb3IsRXQ9ZnVuY3Rpb24odCl7aWYoanQodCkpcmV0dXJuIHQ7dGhyb3cgbmV3IFN0KE90KHQpKyIgaXMgbm90IGEgZnVuY3Rpb24iKX0sUHQ9RXQsVHQ9eCxEdD1OLE50PVMsSXQ9SixrdD1UeXBlRXJyb3IsQ3Q9e2V4cG9ydHM6e319LEJ0PW4sRnQ9T2JqZWN0LmRlZmluZVByb3BlcnR5LEx0PW4sX3Q9ZnVuY3Rpb24odCxlKXt0cnl7RnQoQnQsdCx7dmFsdWU6ZSxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITB9KX1jYXRjaChuKXtCdFt0XT1lfXJldHVybiBlfSxSdD0iX19jb3JlLWpzX3NoYXJlZF9fIix6dD1DdC5leHBvcnRzPUx0W1J0XXx8X3QoUnQse30pOyh6dC52ZXJzaW9uc3x8KHp0LnZlcnNpb25zPVtdKSkucHVzaCh7dmVyc2lvbjoiMy40NS4xIixtb2RlOiJwdXJlIixjb3B5cmlnaHQ6IsKpIDIwMTQtMjAyNSBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSIsbGljZW5zZToiaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvYmxvYi92My40NS4xL0xJQ0VOU0UiLHNvdXJjZToiaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMifSk7dmFyIE10PUN0LmV4cG9ydHMsQXQ9VixVdD1PYmplY3QseHQ9ZnVuY3Rpb24odCl7cmV0dXJuIFV0KEF0KHQpKX0sV3Q9eSh7fS5oYXNPd25Qcm9wZXJ0eSksR3Q9T2JqZWN0Lmhhc093bnx8ZnVuY3Rpb24odCxlKXtyZXR1cm4gV3QoeHQodCksZSl9LFZ0PXksWXQ9MCxxdD1NYXRoLnJhbmRvbSgpLEh0PVZ0KDEuMS50b1N0cmluZyksSnQ9ZnVuY3Rpb24odCxlKXtyZXR1cm4gTXRbdF18fChNdFt0XT1lfHx7fSl9LEt0PUd0LFF0PWZ1bmN0aW9uKHQpe3JldHVybiJTeW1ib2woIisodm9pZCAwPT09dD8iIjp0KSsiKV8iK0h0KCsrWXQrcXQsMzYpfSxYdD1idCxadD15dCwkdD1uLlN5bWJvbCx0ZT1KdCgid2tzIiksZWU9WnQ/JHQuZm9yfHwkdDokdCYmJHQud2l0aG91dFNldHRlcnx8UXQsbmU9TixyZT1KLG9lPW10LGllPWZ1bmN0aW9uKHQsZSl7dmFyIG49dFtlXTtyZXR1cm4gVHQobik/dm9pZCAwOlB0KG4pfSx1ZT1mdW5jdGlvbih0LGUpe3ZhciBuLHI7aWYoInN0cmluZyI9PT1lJiZOdChuPXQudG9TdHJpbmcpJiYhSXQocj1EdChuLHQpKSlyZXR1cm4gcjtpZihOdChuPXQudmFsdWVPZikmJiFJdChyPUR0KG4sdCkpKXJldHVybiByO2lmKCJzdHJpbmciIT09ZSYmTnQobj10LnRvU3RyaW5nKSYmIUl0KHI9RHQobix0KSkpcmV0dXJuIHI7dGhyb3cgbmV3IGt0KCJDYW4ndCBjb252ZXJ0IG9iamVjdCB0byBwcmltaXRpdmUgdmFsdWUiKX0sY2U9VHlwZUVycm9yLGZlPWZ1bmN0aW9uKHQpe3JldHVybiBLdCh0ZSx0KXx8KHRlW3RdPVh0JiZLdCgkdCx0KT8kdFt0XTplZSgiU3ltYm9sLiIrdCkpLHRlW3RdfSgidG9QcmltaXRpdmUiKSxhZT1mdW5jdGlvbih0LGUpe2lmKCFyZSh0KXx8b2UodCkpcmV0dXJuIHQ7dmFyIG4scj1pZSh0LGZlKTtpZihyKXtpZih2b2lkIDA9PT1lJiYoZT0iZGVmYXVsdCIpLG49bmUocix0LGUpLCFyZShuKXx8b2UobikpcmV0dXJuIG47dGhyb3cgbmV3IGNlKCJDYW4ndCBjb252ZXJ0IG9iamVjdCB0byBwcmltaXRpdmUgdmFsdWUiKX1yZXR1cm4gdm9pZCAwPT09ZSYmKGU9Im51bWJlciIpLHVlKHQsZSl9LGxlPW10LHNlPWZ1bmN0aW9uKHQpe3ZhciBlPWFlKHQsInN0cmluZyIpO3JldHVybiBsZShlKT9lOmUrIiJ9LHBlPUosYmU9bi5kb2N1bWVudCx5ZT1wZShiZSkmJnBlKGJlLmNyZWF0ZUVsZW1lbnQpLHZlPWZ1bmN0aW9uKHQpe3JldHVybiB5ZT9iZS5jcmVhdGVFbGVtZW50KHQpOnt9fSxkZT0hUCYmIXIoKGZ1bmN0aW9uKCl7cmV0dXJuIDchPT1PYmplY3QuZGVmaW5lUHJvcGVydHkodmUoImRpdiIpLCJhIix7Z2V0OmZ1bmN0aW9uKCl7cmV0dXJuIDd9fSkuYX0pKSxoZT1QLGdlPU4sbWU9SSx3ZT1fLGplPWZ1bmN0aW9uKHQpe3JldHVybiBZKHEodCkpfSxPZT1zZSxTZT1HdCxFZT1kZSxQZT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yO0UuZj1oZT9QZTpmdW5jdGlvbih0LGUpe2lmKHQ9amUodCksZT1PZShlKSxFZSl0cnl7cmV0dXJuIFBlKHQsZSl9Y2F0Y2godCl7fWlmKFNlKHQsZSkpcmV0dXJuIHdlKCFnZShtZS5mLHQsZSksdFtlXSl9O3ZhciBUZT1yLERlPVMsTmU9LyN8XC5wcm90b3R5cGVcLi8sSWU9ZnVuY3Rpb24odCxlKXt2YXIgbj1DZVtrZSh0KV07cmV0dXJuIG49PT1GZXx8biE9PUJlJiYoRGUoZSk/VGUoZSk6ISFlKX0sa2U9SWUubm9ybWFsaXplPWZ1bmN0aW9uKHQpe3JldHVybiBTdHJpbmcodCkucmVwbGFjZShOZSwiLiIpLnRvTG93ZXJDYXNlKCl9LENlPUllLmRhdGE9e30sQmU9SWUuTkFUSVZFPSJOIixGZT1JZS5QT0xZRklMTD0iUCIsTGU9SWUsX2U9RXQsUmU9byx6ZT1qKGouYmluZCksTWU9e30sQWU9UCYmcigoZnVuY3Rpb24oKXtyZXR1cm4gNDIhPT1PYmplY3QuZGVmaW5lUHJvcGVydHkoKGZ1bmN0aW9uKCl7fSksInByb3RvdHlwZSIse3ZhbHVlOjQyLHdyaXRhYmxlOiExfSkucHJvdG90eXBlfSkpLFVlPUoseGU9U3RyaW5nLFdlPVR5cGVFcnJvcixHZT1QLFZlPWRlLFllPUFlLHFlPWZ1bmN0aW9uKHQpe2lmKFVlKHQpKXJldHVybiB0O3Rocm93IG5ldyBXZSh4ZSh0KSsiIGlzIG5vdCBhbiBvYmplY3QiKX0sSGU9c2UsSmU9VHlwZUVycm9yLEtlPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxRZT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yLFhlPSJlbnVtZXJhYmxlIixaZT0iY29uZmlndXJhYmxlIiwkZT0id3JpdGFibGUiO01lLmY9R2U/WWU/ZnVuY3Rpb24odCxlLG4pe2lmKHFlKHQpLGU9SGUoZSkscWUobiksImZ1bmN0aW9uIj09dHlwZW9mIHQmJiJwcm90b3R5cGUiPT09ZSYmInZhbHVlImluIG4mJiRlIGluIG4mJiFuLndyaXRhYmxlKXt2YXIgcj1RZSh0LGUpO3ImJnIud3JpdGFibGUmJih0W2VdPW4udmFsdWUsbj17Y29uZmlndXJhYmxlOlplIGluIG4/bi5jb25maWd1cmFibGU6ci5jb25maWd1cmFibGUsZW51bWVyYWJsZTpYZSBpbiBuP24uZW51bWVyYWJsZTpyLmVudW1lcmFibGUsd3JpdGFibGU6ITF9KX1yZXR1cm4gS2UodCxlLG4pfTpLZTpmdW5jdGlvbih0LGUsbil7aWYocWUodCksZT1IZShlKSxxZShuKSxWZSl0cnl7cmV0dXJuIEtlKHQsZSxuKX1jYXRjaCh0KXt9aWYoImdldCJpbiBufHwic2V0ImluIG4pdGhyb3cgbmV3IEplKCJBY2Nlc3NvcnMgbm90IHN1cHBvcnRlZCIpO3JldHVybiJ2YWx1ZSJpbiBuJiYodFtlXT1uLnZhbHVlKSx0fTt2YXIgdG49TWUsZW49Xyxubj1QP2Z1bmN0aW9uKHQsZSxuKXtyZXR1cm4gdG4uZih0LGUsZW4oMSxuKSl9OmZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4gdFtlXT1uLHR9LHJuPW4sb249YSx1bj1qLGNuPVMsZm49RS5mLGFuPUxlLGxuPUssc249ZnVuY3Rpb24odCxlKXtyZXR1cm4gX2UodCksdm9pZCAwPT09ZT90OlJlP3plKHQsZSk6ZnVuY3Rpb24oKXtyZXR1cm4gdC5hcHBseShlLGFyZ3VtZW50cyl9fSxwbj1ubixibj1HdCx5bj1mdW5jdGlvbih0KXt2YXIgZT1mdW5jdGlvbihuLHIsbyl7aWYodGhpcyBpbnN0YW5jZW9mIGUpe3N3aXRjaChhcmd1bWVudHMubGVuZ3RoKXtjYXNlIDA6cmV0dXJuIG5ldyB0O2Nhc2UgMTpyZXR1cm4gbmV3IHQobik7Y2FzZSAyOnJldHVybiBuZXcgdChuLHIpfXJldHVybiBuZXcgdChuLHIsbyl9cmV0dXJuIG9uKHQsdGhpcyxhcmd1bWVudHMpfTtyZXR1cm4gZS5wcm90b3R5cGU9dC5wcm90b3R5cGUsZX0sdm49ZnVuY3Rpb24odCxlKXt2YXIgbixyLG8saSx1LGMsZixhLGwscz10LnRhcmdldCxwPXQuZ2xvYmFsLGI9dC5zdGF0LHk9dC5wcm90byx2PXA/cm46Yj9ybltzXTpybltzXSYmcm5bc10ucHJvdG90eXBlLGQ9cD9sbjpsbltzXXx8cG4obG4scyx7fSlbc10saD1kLnByb3RvdHlwZTtmb3IoaSBpbiBlKXI9IShuPWFuKHA/aTpzKyhiPyIuIjoiIyIpK2ksdC5mb3JjZWQpKSYmdiYmYm4odixpKSxjPWRbaV0sciYmKGY9dC5kb250Q2FsbEdldFNldD8obD1mbih2LGkpKSYmbC52YWx1ZTp2W2ldKSx1PXImJmY/ZjplW2ldLChufHx5fHx0eXBlb2YgYyE9dHlwZW9mIHUpJiYoYT10LmJpbmQmJnI/c24odSxybik6dC53cmFwJiZyP3luKHUpOnkmJmNuKHUpP3VuKHUpOnUsKHQuc2hhbXx8dSYmdS5zaGFtfHxjJiZjLnNoYW0pJiZwbihhLCJzaGFtIiwhMCkscG4oZCxpLGEpLHkmJihibihsbixvPXMrIlByb3RvdHlwZSIpfHxwbihsbixvLHt9KSxwbihsbltvXSxpLHUpLHQucmVhbCYmaCYmKG58fCFoW2ldKSYmcG4oaCxpLHUpKSl9LGRuPW4saG49cnQsZ249Zyxtbj1mdW5jdGlvbih0KXtyZXR1cm4gaG4uc2xpY2UoMCx0Lmxlbmd0aCk9PT10fSx3bj1tbigiQnVuLyIpPyJCVU4iOm1uKCJDbG91ZGZsYXJlLVdvcmtlcnMiKT8iQ0xPVURGTEFSRSI6bW4oIkRlbm8vIik/IkRFTk8iOm1uKCJOb2RlLmpzLyIpPyJOT0RFIjpkbi5CdW4mJiJzdHJpbmciPT10eXBlb2YgQnVuLnZlcnNpb24/IkJVTiI6ZG4uRGVubyYmIm9iamVjdCI9PXR5cGVvZiBEZW5vLnZlcnNpb24/IkRFTk8iOiJwcm9jZXNzIj09PWduKGRuLnByb2Nlc3MpPyJOT0RFIjpkbi53aW5kb3cmJmRuLmRvY3VtZW50PyJCUk9XU0VSIjoiUkVTVCIsam49eShbXS5zbGljZSksT249VHlwZUVycm9yLFNuPW4sRW49YSxQbj1TLFRuPXduLERuPXJ0LE5uPWpuLEluPWZ1bmN0aW9uKHQsZSl7aWYodDxlKXRocm93IG5ldyBPbigiTm90IGVub3VnaCBhcmd1bWVudHMiKTtyZXR1cm4gdH0sa249U24uRnVuY3Rpb24sQ249L01TSUUgLlwuLy50ZXN0KERuKXx8IkJVTiI9PT1UbiYmZnVuY3Rpb24oKXt2YXIgdD1Tbi5CdW4udmVyc2lvbi5zcGxpdCgiLiIpO3JldHVybiB0Lmxlbmd0aDwzfHwiMCI9PT10WzBdJiYodFsxXTwzfHwiMyI9PT10WzFdJiYiMCI9PT10WzJdKX0oKSxCbj1mdW5jdGlvbih0LGUpe3ZhciBuPWU/MjoxO3JldHVybiBDbj9mdW5jdGlvbihyLG8pe3ZhciBpPUluKGFyZ3VtZW50cy5sZW5ndGgsMSk+bix1PVBuKHIpP3I6a24ociksYz1pP05uKGFyZ3VtZW50cyxuKTpbXSxmPWk/ZnVuY3Rpb24oKXtFbih1LHRoaXMsYyl9OnU7cmV0dXJuIGU/dChmLG8pOnQoZil9OnR9LEZuPXZuLExuPW4sX249Qm4oTG4uc2V0SW50ZXJ2YWwsITApO0ZuKHtnbG9iYWw6ITAsYmluZDohMCxmb3JjZWQ6TG4uc2V0SW50ZXJ2YWwhPT1fbn0se3NldEludGVydmFsOl9ufSk7dmFyIFJuPXZuLHpuPW4sTW49Qm4oem4uc2V0VGltZW91dCwhMCk7Um4oe2dsb2JhbDohMCxiaW5kOiEwLGZvcmNlZDp6bi5zZXRUaW1lb3V0IT09TW59LHtzZXRUaW1lb3V0Ok1ufSk7dmFyIEFuPUsuc2V0SW50ZXJ2YWwsVW49ITEseG49bnVsbDtzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLChmdW5jdGlvbih0KXt2YXIgZT10LmRhdGEsbj1lLnR5cGUscj1lLmRhdGE7c3dpdGNoKG4pe2Nhc2Uic3RhcnQiOlVufHwoVW49ITAseG49QW4oKGZ1bmN0aW9uKCl7VW49ITEsc2VsZi5wb3N0TWVzc2FnZSgidGljayIpfSksci50aW1lKSk7YnJlYWs7Y2FzZSJzdG9wIjpjbGVhckludGVydmFsKHhuKSxVbj0hMX19KSwhMSk7cmV0dXJue319KCk7Cgo=",pL=null,fL=!1,function(e){return hL=hL||lL(dL,pL,fL),new Worker(hL,e)}),vL=function(){function e(e){void 0===e&&(e=60),this.times=60,this.worker=null,this.times=e,this.worker=new mL}return e.prototype.tick=function(e){this.requestAnimationFrameWrapper(e)},e.prototype.destroy=function(){var e;null===(e=this.worker)||void 0===e||e.terminate(),this.worker=null},e.prototype.setWorkerInterval=function(e,t){var r,n,i=this;null===(r=this.worker)||void 0===r||r.addEventListener("message",e),null===(n=this.worker)||void 0===n||n.postMessage({type:"start",data:{time:t}});return function(){var t,r;null===(t=i.worker)||void 0===t||t.postMessage({type:"stop"}),null===(r=i.worker)||void 0===r||r.removeEventListener("message",e)}},e.prototype.requestAnimationFrameWrapper=function(e){var t=!1,r=this.setWorkerInterval((function(){!t&&document.hidden&&(t=!0,r(),e())}),1e3/this.times);requestAnimationFrame((function(){t||(t=!0,r(),e())}))},e}(),yL=function(){function e(){var e,t,r,n,i,o,a,s;this.peerConnection=null,this.dataChannel=null,this.clientSideDescription=null,this.serverSideDescription=null,this.connectStatus=$k.DISCONNECTED,this.connectDirection=rA.RECEIVE,this.connectConfig=null,this.negotiating=!1,this.ticker=null,this.seiDataMap=null,this.onAddTrack=null,this.onConnect=null,this.onDisconnect=null,this.onSetLocalDescription=null,this.onError=null,this.onReceiveSEI=null,this.onTrack=zr(e=this.onTrack).call(e,this),this.onIceConnectionStateChange=zr(t=this.onIceConnectionStateChange).call(t,this),this.onSignalingStateChange=zr(r=this.onSignalingStateChange).call(r,this),this.onConnectionStateChange=zr(n=this.onConnectionStateChange).call(n,this),this.onNegotiationNeeded=zr(i=this.onNegotiationNeeded).call(i,this),this.onDataChannelOpen=zr(o=this.onDataChannelOpen).call(o,this),this.onDataChannelMessage=zr(a=this.onDataChannelMessage).call(a,this),this.handleSeiData=zr(s=this.handleSeiData).call(s,this)}return e.prototype.init=function(e){var t=void 0===e?{}:e,r=t.onAddTrack,n=void 0===r?null:r,i=t.onConnect,o=void 0===i?null:i,a=t.onDisconnect,s=void 0===a?null:a,c=t.onSetLocalDescription,u=void 0===c?null:c,l=t.onError,d=void 0===l?null:l,p=t.onReceiveSEI,f=void 0===p?null:p;this.onAddTrack=n,this.onConnect=o,this.onDisconnect=s,this.onSetLocalDescription=u,this.onError=d,this.onReceiveSEI=f},e.prototype.initWebRTCConnect=function(e){var t,r=void 0===e?{}:e,n=r.config,i=void 0===n?{}:n,o=r.direction,a=void 0===o?rA.RECEIVE:o,s=r.stream;uL.log("WebRTC init"),this.peerConnection?uL.warn("peerConnection is existed"):(this.connectDirection=a,this.connectConfig=null!==(t=i.connection)&&void 0!==t?t:{},this.createWebRTCConnect(i,s))},e.prototype.connect=function(e){e&&this.onAnswer(e)},e.prototype.disconnect=function(e){var t,r=void 0===e?{}:e,n=r.msg,i=void 0===n?"":n,o=r.code,a=void 0===o?tA.MANUAL_CLOSE:o;uL.log("connection close".concat(a===tA.NEED_RECONNECT?", needs to reconnect":"")),this.connectStatus!==$k.DISCONNECTED&&(this.connectStatus=$k.DISCONNECTED,this.negotiating=!1,this.peerConnection&&(this.peerConnection.removeEventListener("track",this.onTrack),this.peerConnection.removeEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.removeEventListener("signalingstatechange",this.onSignalingStateChange),this.peerConnection.removeEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.removeEventListener("negotiationneeded",this.onNegotiationNeeded),this.peerConnection.close(),this.peerConnection=null),this.dataChannel&&(this.dataChannel.removeEventListener("open",this.onDataChannelOpen),this.dataChannel.removeEventListener("message",this.onDataChannelMessage),this.dataChannel.close(),this.dataChannel=null),this.seiDataMap&&(this.seiDataMap.clear(),this.seiDataMap=null),this.ticker&&(this.ticker.destroy(),this.ticker=null),this.clientSideDescription=null,this.serverSideDescription=null,null===(t=this.onDisconnect)||void 0===t||t.call(this,{code:a,msg:i}))},e.prototype.getClientSideDescription=function(){return this.clientSideDescription||uL.warn("WebRTC is not initialized"),this.clientSideDescription},e.prototype.getConnectStatus=function(){return this.connectStatus},e.prototype.getStats=function(){return Ra(this,void 0,void 0,(function(){return Ea(this,(function(e){switch(e.label){case 0:return this.peerConnection?[4,this.peerConnection.getStats(null)]:[2];case 1:return[2,e.sent()]}}))}))},e.prototype.createWebRTCConnect=function(e,t){var r,n,i,o=this,a=null!==(r=e.connection)&&void 0!==r?r:{},s=a.isReceiveSEI,c=void 0!==s&&s,u=a.isCreateSEIDataChannel,l=void 0!==u&&u;try{var d={iceServers:[],sdpSemantics:"unified-plan",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",tcpCandidatePolicy:"disable",IceTransportsType:"nohost"};c&&(xA?(uL.log("enable insertable streams"),d.encodedInsertableStreams=!0):uL.warn("insertable streams is not supported")),this.peerConnection=new RTCPeerConnection(d)}catch(e){return uL.error("create RTCPeerConnection error",e),void(null===(n=this.onError)||void 0===n||n.call(this,"create WebRTC connection is failed"))}if(this.connectStatus=$k.CONNECTING,this.negotiating=!1,this.peerConnection.addEventListener("track",this.onTrack),this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.addEventListener("signalingstatechange",this.onSignalingStateChange),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.addEventListener("negotiationneeded",this.onNegotiationNeeded),c&&!xA&&l)if(DA){uL.log("create data channel to receive sei messages");var p=fA,f=hA;this.dataChannel=this.peerConnection.createDataChannel(p,{protocol:f,ordered:!1,maxPacketLifeTime:100}),this.dataChannel.binaryType="arraybuffer",this.ticker=new vL(40),this.seiDataMap=new tT,this.dataChannel.addEventListener("open",this.onDataChannelOpen),this.dataChannel.addEventListener("message",this.onDataChannelMessage)}else uL.warn("RTCRtpReceiver getSynchronizationSources is not supported");this.connectDirection===rA.SEND&&t instanceof MediaStream&&Co(i=t.getTracks()).call(i,(function(e){o.peerConnection.addTrack(e,t)}));this.connectDirection===rA.RECEIVE&&this.createOffer(e.offer)},e.prototype.onTrack=function(e){var t,r,n,i=this;uL.log("".concat(e.track.kind," track added to peerConnection")),null===(t=this.onAddTrack)||void 0===t||t.call(this,e.track);var o=this.connectConfig.isReceiveSEI;if(void 0!==o&&o&&xA)if("video"===e.track.kind){uL.log("insertable streams for video is started");try{var a=e.receiver.createEncodedStreams(),s=new TransformStream({transform:function(e,t){var r,n,o=function(e){var t=new DataView(e);if(t.byteLength<3)return[];for(var r=[],n=0;n<t.byteLength-2;n++)if(0===t.getUint8(n)&&0===t.getUint8(n+1)&&1===t.getUint8(n+2)){var i=3==(c=n>0&&0===t.getUint8(n-1)?4:3)?n:n-1;r.push({startOffset:i,startCodeSize:c}),n+=2}for(var o=[],a=0;a<r.length;a++){for(var s=r[a],c=(i=s.startOffset,s.startCodeSize),u=i,l=r[a+1]?r[a+1].startOffset:t.byteLength,d=31&t.getUint8(u+c),p=l-u-c-1,f=new Uint8Array(p),h=0;h<p;h++)f[h]=t.getUint8(u+c+1+h);o.push({nalUnitType:d,rbspData:f})}return o}(e.data);try{for(var a=Pa(o),s=a.next();!s.done;s=a.next()){var c=s.value,u=c.nalUnitType,l=c.rbspData;if(6===u){var d=sL(l);Co(d).call(d,(function(e){var t;null===(t=i.onReceiveSEI)||void 0===t||t.call(i,e)}))}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}t.enqueue(e)}});a.readable.pipeThrough(s).pipeTo(a.writable)}catch(e){uL.error("insertable streams for video has error,",e),null===(r=this.onError)||void 0===r||r.call(this,"parse video data is failed")}}else{uL.log("insertable streams for audio is started");try{(a=e.receiver.createEncodedStreams()).readable.pipeTo(a.writable)}catch(e){uL.error("insertable streams for audio has error,",e),null===(n=this.onError)||void 0===n||n.call(this,"parse audio data is failed")}}},e.prototype.onIceConnectionStateChange=function(){var e;switch(uL.log("onIceConnectionStateChange",this.peerConnection.iceConnectionState),this.peerConnection.iceConnectionState){case"failed":case"disconnected":uL.warn("iceConnection disconnected"),this.disconnect({code:tA.NEED_RECONNECT,msg:"Connection disconnected, please try again"});break;case"connected":case"completed":if(!EA)return;if(this.connectStatus===$k.CONNECTED)return;uL.log("iceConnection connected"),this.connectStatus=$k.CONNECTED,null===(e=this.onConnect)||void 0===e||e.call(this,{code:eA.SUCCESS,msg:"Connection connected"})}},e.prototype.onSignalingStateChange=function(){uL.log("onSignalingStateChange",this.peerConnection.signalingState)},e.prototype.onConnectionStateChange=function(){var e;switch(uL.log("onConnectionStateChange",this.peerConnection.connectionState),this.peerConnection.connectionState){case"failed":case"disconnected":uL.warn("connection disconnected"),this.disconnect({code:tA.NEED_RECONNECT,msg:"Connection disconnected, please try again"});break;case"connected":if(this.connectStatus===$k.CONNECTED)return;uL.log("connection connected"),this.connectStatus=$k.CONNECTED,null===(e=this.onConnect)||void 0===e||e.call(this,{code:eA.SUCCESS,msg:"Connection connected"})}},e.prototype.onNegotiationNeeded=function(){if(uL.log("peerConnection need negotiation"),this.connectDirection!==rA.RECEIVE)try{if(this.negotiating||"stable"!==this.peerConnection.signalingState)return;this.negotiating=!0,this.createOffer()}catch(e){uL.warn("onNegotiationNeeded error,",e)}finally{this.negotiating=!1}},e.prototype.createOffer=function(e){var t;return void 0===e&&(e={}),Ra(this,void 0,void 0,(function(){var r,n,i,o,a,s,c;return Ea(this,(function(u){switch(u.label){case 0:r=e.offerToReceiveVideo,n=void 0===r||r,i=e.offerToReceiveAudio,o=void 0===i||i,a={voiceActivityDetection:!1},this.connectDirection===rA.RECEIVE&&(!!this.peerConnection.addTransceiver?(uL.log("peerConnection addTransceiver"),o&&this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),n&&this.peerConnection.addTransceiver("video",{direction:"recvonly"})):(uL.log("init createOffer options"),a=_a(_a({},a),{offerToReceiveVideo:n,offerToReceiveAudio:o}))),u.label=1;case 1:return u.trys.push([1,3,,4]),uL.log("createOffer start"),[4,this.peerConnection.createOffer(a)];case 2:return s=u.sent(),uL.log("createOffer success"),this.onOffer(s),[3,4];case 3:return c=u.sent(),uL.error("createOffer error,",c),this.disconnect({code:tA.NEED_RECONNECT,msg:"create offer is failed"}),null===(t=this.onError)||void 0===t||t.call(this,"create offer is failed"),[3,4];case 4:return[2]}}))}))},e.prototype.onOffer=function(e){var t,r;return Ra(this,void 0,void 0,(function(){var n,i;return Ea(this,(function(o){switch(o.label){case 0:n=e.sdp,n=this.connectDirection===rA.RECEIVE?HA(n):ck(a=n.split("\r\n")).call(a,(function(e){return $i(e).call(e,"a=fmtp:111")?"".concat(e,";stereo=1"):e})).join("\r\n"),e.sdp=n,o.label=1;case 1:return o.trys.push([1,3,,4]),uL.log("setLocalDescription start"),[4,this.peerConnection.setLocalDescription(e)];case 2:return o.sent(),uL.log("setLocalDescription success"),this.clientSideDescription=this.peerConnection.localDescription,null===(t=this.onSetLocalDescription)||void 0===t||t.call(this,this.clientSideDescription),[3,4];case 3:return i=o.sent(),uL.error("setLocalDescription error,",i),null===(r=this.onError)||void 0===r||r.call(this,"set local sdp is failed"),[3,4];case 4:return[2]}var a}))}))},e.prototype.onAnswer=function(e){var t;return Ra(this,void 0,void 0,(function(){var r;return Ea(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),uL.log("setRemoteDescription start"),[4,this.peerConnection.setRemoteDescription(new RTCSessionDescription(e))];case 1:return n.sent(),uL.log("setRemoteDescription success"),this.serverSideDescription=this.peerConnection.remoteDescription,[3,3];case 2:return r=n.sent(),uL.error("setRemoteDescription error,",r),null===(t=this.onError)||void 0===t||t.call(this,"set remote sdp is failed"),[3,3];case 3:return[2]}}))}))},e.prototype.onDataChannelOpen=function(){uL.log("data channel open"),this.handleSeiData()},e.prototype.onDataChannelMessage=function(e){var t=this;if(e.data&&this.seiDataMap)try{var r=String.fromCharCode.apply(null,new Uint8Array(e.data)),n=JSON.parse(r),i=JA(n)?n:[n];Co(i).call(i,(function(e){var r,n=e.type,i=e.rtp_time,o=e.data;if("sync_sei"===n){var a=new Uint8Array(ck(r=o.match(/[\da-f]{2}/gi)).call(r,(function(e){return rk(e,16)}))),s=sL(a);Co(s).call(s,(function(e){var r=t.seiDataMap.get(i)||[];t.seiDataMap.set(i,Aa(Aa([],ka(r),!1),[e],!1))}))}}))}catch(t){uL.warn("data channel error: data parsing failed",t,e.data)}},e.prototype.handleSeiData=function(){var e,t=this;if(this.ticker&&this.seiDataMap&&this.peerConnection){var r=this.connectConfig.maxSEIDelayTime,n=void 0===r?100:r,i=zk(e=this.peerConnection.getReceivers()).call(e,(function(e){return e.track&&"video"===e.track.kind}));if(i){var o=i.getSynchronizationSources();if(o.length>0){var a,s,c=o[0].rtpTimestamp,u=II(a=Aa([],ka(VI(s=this.seiDataMap).call(s)),!1)).call(a,(function(e,t){return Number(e)-Number(t)}));Co(u).call(u,(function(e){if(void 0===c){var r=t.seiDataMap.get(e)||[];return Co(r).call(r,(function(e){var r;null===(r=t.onReceiveSEI)||void 0===r||r.call(t,e)})),void t.seiDataMap.delete(e)}var i=90*n,o=c-e;if(o>=0&&o<=i){r=t.seiDataMap.get(e)||[];Co(r).call(r,(function(e){var r;null===(r=t.onReceiveSEI)||void 0===r||r.call(t,e)})),t.seiDataMap.delete(e)}else o>i&&t.seiDataMap.delete(e)}))}}this.ticker.tick(this.handleSeiData)}else uL.log("sei data handler stop")},e}(),gL=Dd.PROPER,bL=n,CL=NP,SL=GP.trim;Ar({target:"String",proto:!0,forced:function(e){return bL((function(){return!!CL[e]()||"鈥嬄呩爭"!=="鈥嬄呩爭"[e]()||gL&&CL[e].name!==e}))}("trim")},{trim:function(){return SL(this)}});var TL=Xr("String","trim"),_L=l,wL=TL,RL=String.prototype,EL=function(e){var t=e.trim;return"string"==typeof e||e===RL||_L(RL,e)&&t===RL.trim?wL:t},PL=function(){function e(){this.timeMark=null,this.commonData=null,this.reportData=null,this.tempData=null,this.onReport=null,this.timeMark=new tT,this.commonData={},this.initCommonData(),this.reportData=_a({},this.commonData),this.tempData={}}return e.prototype.setData=function(e,t,r){void 0===r&&(r=!1),this.reportData[e]=t,r&&(this.commonData[e]=t)},e.prototype.setTempData=function(e,t){this.tempData[e]=t},e.prototype.getTempData=function(e){return this.tempData[e]},e.prototype.startReport=function(e){var t;switch(e){case"start":this.setData("uint32_data_type",1),this.setData("uint32_command",40101);break;case"interval":this.setData("uint32_data_type",2),this.setData("uint32_command",40100);break;case"stop":this.setData("uint32_data_type",1),this.setData("uint32_command",40102)}var r=(new Date).getTime();this.setData("uint64_data_time",Math.round(r/1e3)),null===(t=this.onReport)||void 0===t||t.call(this,this.reportData),this.reportData=_a({},this.commonData)},e.prototype.setHandler=function(e){this.onReport=e},e.prototype.markTime=function(e){this.timeMark.set(e,(new Date).getTime())},e.prototype.measureTime=function(e,t,r,n){if(void 0===n&&(n=!1),this.timeMark.has(t)&&this.timeMark.has(r)){var i=Math.round(this.timeMark.get(r)-this.timeMark.get(t));this.setData(e,i),n&&this.setTempData(e,i)}},e.prototype.clearData=function(){this.timeMark?this.timeMark.clear():this.timeMark=new tT,this.commonData={},this.initCommonData(),this.reportData=_a({},this.commonData),this.tempData={}},e.prototype.destroy=function(){var e;null===(e=this.timeMark)||void 0===e||e.clear(),this.timeMark=null,this.commonData=null,this.reportData=null,this.tempData=null,this.onReport=null},e.prototype.initCommonData=function(){var e,t;this.commonData.str_app_version="TXLivePlayer-".concat(cA),this.commonData.bytes_version="TXLivePlayer-".concat(cA);var r=window.navigator.userAgent,n=Ms.parse(r),i=n.platform,o=n.os,a=n.browser;this.commonData.str_device_type=i.model||i.vendor||"",this.commonData.str_os_info=EL(e=gi(t="".concat(o.name||""," ")).call(t,o.version||"")).call(e),this.commonData.str_browser_model=a.name||"",this.commonData.str_browser_version=a.version||"",this.commonData.str_user_agent=r,this.commonData.u32_link_type=4,this.commonData.u32_channel_type=3},e}(),kL=function(e,t,r){return void 0===r&&(r={}),Ra(void 0,void 0,void 0,(function(){var n,i,o,a,s,c;return Ea(this,(function(u){switch(u.label){case 0:return n=r.timeout,i=void 0===n?10:n,o=null,a=null,s={},window.AbortController&&(o=new window.AbortController,s={signal:o.signal},a=Yo((function(){return o.abort()}),1e3*i)),[4,fetch(e,_a({body:y_(t),cache:"no-cache",credentials:"same-origin",headers:{"content-type":"text/plain;charset=utf-8"},method:"POST",mode:"cors"},s))];case 1:if(c=u.sent(),a&&window.clearTimeout(a),200!==c.status)throw new Error("Network Error, status code:".concat(c.status));return[2,c.json()]}}))}))},AL=function(){function e(){this.baseUrl="",this.signalConfig={protocol:"https",domain:"",query:!0,timeout:3}}return e.prototype.setSignalConfig=function(e){this.signalConfig=_a(_a({},this.signalConfig),e)},e.prototype.fetchPullStream=function(e){var t;return Ra(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,l,d,p=this;return Ea(this,(function(f){switch(f.label){case 0:return r=function(e,t,r){return Ra(p,void 0,void 0,(function(){var n,i,o,a,s,c,u;return Ea(this,(function(l){switch(l.label){case 0:return n="".concat(e,"/webrtc/v1/pullstream"),[4,kL(n,t,{timeout:r})];case 1:var d;if(i=l.sent(),o=i.errcode,a=i.errmsg,s=i.remotesdp,c=i.svrsig,0!==o)throw(u=new Error(gi(d="errCode:".concat(o,", errMsg:")).call(d,a))).name=mA,u;return[2,{url:e,remoteSdp:s,svrSig:c}]}}))}))},this.baseUrl?[4,r(this.baseUrl,e,this.signalConfig.timeout)]:[3,2];case 1:return n=f.sent(),u=n.url,[2,l=wa(n,["url"])];case 2:i=this.signalConfig,o=i.protocol,a=i.timeout,f.label=3;case 3:return f.trys.push([3,5,,6]),s=ck(uA).call(uA,(function(t){var n;return r(gi(n="".concat(o,"://")).call(n,t),e,a)})),[4,OP.any(s)];case 4:return c=f.sent(),u=c.url,l=wa(c,["url"]),this.baseUrl=u,[2,l];case 5:throw d=f.sent(),(null===(t=null==d?void 0:d.errors)||void 0===t?void 0:t[0])||d;case 6:return[2]}}))}))},e.prototype.fetchStopStream=function(e){return Ra(this,void 0,void 0,(function(){var t,r,n,i;return Ea(this,(function(o){switch(o.label){case 0:if(!this.baseUrl)throw new Error("signal domain name is empty");return t="".concat(this.baseUrl,"/webrtc/v1/stopstream"),[4,kL(t,e,{timeout:this.signalConfig.timeout})];case 1:var a;if(r=o.sent(),n=r.errcode,i=r.errmsg,0!==n)throw new Error(gi(a="errCode:".concat(n,", errmsg:")).call(a,i));return[2,r]}}))}))},e.prototype.fetchStreamSdp=function(e){return Ra(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,c;return Ea(this,(function(u){switch(u.label){case 0:return t=e.streamurl,r=e.sessionid,n=e.localsdp,[4,kL(t,{version:"v1.0",sessionId:r,localSdp:n},{timeout:this.signalConfig.timeout})];case 1:var l;if(i=u.sent(),o=i.code,a=i.message,s=i.remoteSdp,200!==o)throw(c=new Error(gi(l="errCode:".concat(o,", errMsg:")).call(l,a))).name=mA,c;return[2,{remoteSdp:s,svrSig:null}]}}))}))},e.prototype.fetchAbrControl=function(e){return Ra(this,void 0,void 0,(function(){var t,r,n,i;return Ea(this,(function(o){switch(o.label){case 0:if(!this.baseUrl)throw new Error("signal domain name is empty");return t="".concat(this.baseUrl,"/webrtc/v1/tabrctl"),[4,kL(t,e,{timeout:this.signalConfig.timeout})];case 1:var a;if(r=o.sent(),n=r.errcode,i=r.seq,0!==n)throw new Error(gi(a="errCode:".concat(n,", errMsg:")).call(a,403===n?"not allowed error":"error"));return[2,{seq:i}]}}))}))},e.prototype.updateSignalDomain=function(e){var t,r=this.signalConfig,n=r.protocol,i=r.domain,o=r.query;if(e&&o){var a=window.localStorage.getItem(lA);if(a){var s=JSON.parse(a)[e];if(s){var c,u=s.signal,l=s.expire;return(new Date).getTime()>l&&this.fetchSignalDomain(e,dA[0]),void(this.baseUrl=gi(c="".concat(n,"://")).call(c,u))}}this.baseUrl=i?gi(t="".concat(n,"://")).call(t,i):"",this.fetchSignalDomain(e,dA[0])}else{var d;this.baseUrl=i?gi(d="".concat(n,"://")).call(d,i):""}},e.prototype.getSignalDomain=function(){return this.baseUrl},e.prototype.fetchSignalDomain=function(e,t){return Ra(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,l;return Ea(this,(function(d){switch(d.label){case 0:if(!e||!t)return[2];r="https://".concat(t,"/signal_query"),d.label=1;case 1:return d.trys.push([1,3,,4]),[4,kL(r,{domain:e,requestid:Os(16),client_type:"Web",client_info:window.navigator.userAgent})];case 2:if(n=d.sent(),i=n.errcode,o=n.data,0===i){a=o.signal_domain,s=o.cache_time,c={},(u=window.localStorage.getItem(lA))&&(c=JSON.parse(u)),c[e]={signal:a,expire:(new Date).getTime()+1e3*s};try{window.localStorage.setItem(lA,y_(c))}catch(e){}}return[3,4];case 3:return d.sent(),-1!==(l=ta(dA).call(dA,t))&&this.fetchSignalDomain(e,dA[l+1]),[3,4];case 4:return[2]}}))}))},e}(),IL=window.LEBP2P||sA,LL=function(){function e(){var e,t,r,n,i,o,a,s,c,u,l;this.playerView=null,this.playUrl=null,this.rawUrl=null,this.isVideoExisted=!1,this.webrtcConnection=null,this.svrSig=null,this.stream=null,this.timer={retryTimeout:null,disconnectTimeout:null,statsInterval:null,reportInterval:null},this.connectTimeout=3,this.connectRetry={maxNum:1,curNum:0,delay:1,playing:!1},this.streamDecodeFail={maxNum:3,curNum:0},this.streamReceiveFail={maxNum:5,curNum:0},this.streamPlaying={threshold:5,status:nA.INIT},this.docOrigOverflow=null,this.receiveConfig={video:!0,audio:!0},this.seiConfig={enable:!1,fallback:!1,maxDelayTime:100},this.listener={onPlayEvent:null,onPlayStats:null,onPlayReport:null,onPlaySEI:null},this.lastStatsReport=null,this.report=null,this.signal=null,this.abrClient={curBitrate:"",seq:0},this.p2pMode={enable:!1,config:{cloudAppid:0,xp2pAppid:"",appKey:"",appSecret:"",xp2pDomain:""},source:""},this.p2pConnection=null,this.report=new PL,this.signal=new AL,this.onAddTrack=zr(e=this.onAddTrack).call(e,this),this.onSetLocalDescription=zr(t=this.onSetLocalDescription).call(t,this),this.onConnect=zr(r=this.onConnect).call(r,this),this.onDisconnect=zr(n=this.onDisconnect).call(n,this),this.onError=zr(i=this.onError).call(i,this),this.onStats=zr(o=this.onStats).call(o,this),this.onBeforeUnload=zr(a=this.onBeforeUnload).call(a,this),this.onPagehide=zr(s=this.onPagehide).call(s,this),this.onP2PEvent=zr(c=this.onP2PEvent).call(c,this),this.onReceiveSEI=zr(u=this.onReceiveSEI).call(u,this),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("pagehide",this.onPagehide);var d=Ds.browserDetails,p=d.browser,f=d.version;uL.log(gi(l="browser is ".concat(p,", version is ")).call(l,f))}return e.checkSupport=function(e){Ra(void 0,void 0,void 0,(function(){var e,t,r;return Ea(this,(function(n){var i;switch(n.label){case 0:return e=!1,Co(i=["RTCPeerConnection","webkitRTCPeerConnection"]).call(i,(function(t){e||t in window&&(e=!0)})),wA||(PA&&AA||kA&&AA&&(0===(t=LA()).length||t[0]<11||11===t[0]&&t[1]<1||11===t[0]&&1===t[1]&&t[2]<2))&&(e=!1),[4,Ra(void 0,void 0,void 0,(function(){var e,t,r,n;return Ea(this,(function(i){var o;switch(i.label){case 0:return i.trys.push([0,2,,3]),e=new RTCPeerConnection({iceServers:[],sdpSemantics:"unified-plan"}),t={},e.addTransceiver?(e.addTransceiver("audio",{direction:"recvonly"}),e.addTransceiver("video",{direction:"recvonly"})):t={offerToReceiveVideo:!0,offerToReceiveAudio:!0},[4,e.createOffer(t)];case 1:return r=i.sent(),n=ta(o=r.sdp.toLowerCase()).call(o,"h264")>-1,e.close(),[2,n];case 2:return i.sent(),[2,!1];case 3:return[2]}}))}))];case 1:return r=n.sent(),[2,{support:e,isTbs:wA,tbsVersion:wA?OA(navigator.userAgent,TA,1):null,isFirefox:RA,isSafari:kA,isIOS:AA,iOSVersion:AA?LA().join("."):null,h264Support:r}]}}))})).then((function(t){var r=t.support,n=t.h264Support;null==e||e({support:r,h264Support:n,p2pSupport:IL.support()})}))},e.prototype.setConfig=function(e){var t=e.connectRetryCount,r=e.connectRetryDelay,n=e.connectTimeout,i=e.receiveVideo,o=e.receiveAudio,a=e.receiveSEI,s=e.showLog,c=e.p2pEnable,u=e.p2pConfig,l=e.signalDomain,d=e.signalTimeout,p=e.maxDecodeFailCount,f=e.maxReceiveFailCount,h=e.minDecodeFramerate;if(void 0!==t&&("number"==typeof t&&t>=0?this.connectRetry.maxNum=t:uL.warn("connectRetryCount must be a number greater than or equal to 0")),void 0!==r&&("number"==typeof r&&r>=0?this.connectRetry.delay=r:uL.warn("connectRetryDelay must be a number greater than or equal to 0")),void 0!==n&&("number"==typeof n&&n>=0?this.connectTimeout=n:uL.warn("connectTimeout must be a number greater than or equal to 0")),void 0!==i&&(this.receiveConfig.video=!!i),void 0!==o&&(this.receiveConfig.audio=!!o),void 0!==a)if("boolean"==typeof a)this.seiConfig={enable:a,fallback:!1,maxDelayTime:100};else{var m=null!=a?a:{},v=m.fallback,y=void 0!==v&&v,g=m.maxDelayTime,b=void 0===g?100:g;this.seiConfig={enable:!0,fallback:y,maxDelayTime:b}}if(void 0!==s&&uL.enableLogging(!!s),void 0!==c&&(this.p2pMode.enable=!!c),void 0!==u){var C=null!=u?u:{},S=C.cloudAppid,T=C.appKey,_=C.appSecret,w=C.xp2pAppid,R=C.xp2pDomain;this.p2pMode.config=_a(_a({},this.p2pMode.config),{cloudAppid:S,appKey:T,appSecret:_,xp2pAppid:w,xp2pDomain:R})}if(void 0!==l)if("string"==typeof l)this.signal.setSignalConfig({domain:l});else{var E,P=null!=l?l:{},k=P.protocol,A=P.domain,I=P.query;this.signal.setSignalConfig({protocol:$i(E=["https","http"]).call(E,k)?k:"https",domain:A,query:I})}void 0!==d&&("number"==typeof d&&d>=0?this.signal.setSignalConfig({timeout:d}):uL.warn("signalTimeout must be a number greater than or equal to 0")),void 0!==p&&("number"==typeof p&&p>=0?this.streamDecodeFail.maxNum=p:uL.warn("maxDecodeFailCount must be a number greater than or equal to 0")),void 0!==f&&("number"==typeof f&&f>=0?this.streamReceiveFail.maxNum=f:uL.warn("maxReceiveFailCount must be a number greater than or equal to 0")),void 0!==h&&("number"==typeof h&&h>=0?this.streamPlaying.threshold=h:uL.warn("minDecodeFramerate must be a number greater than or equal to 0"))},e.prototype.setPlayListener=function(e){var t=this,r=["onPlayEvent","onPlayStats","onPlayReport","onPlaySEI"];Co(r).call(r,(function(r){var n=e[r];void 0!==n&&("function"==typeof n?(t.listener[r]=n,"onPlayReport"===r&&t.report.setHandler(n)):uL.warn("".concat(r," must be function")))}))},e.prototype.setPlayerView=function(e){if(this.playerView)uL.warn("player view is existed");else{var t="string"==typeof e?document.getElementById(e):e;if(t&&(t instanceof HTMLDivElement||t instanceof HTMLVideoElement))if(t instanceof HTMLVideoElement)this.playerView=t;else{var r=document.createElement("video");r.autoplay=!0,r.muted=!0,r.controls=!0,r.playsInline=!0,r.setAttribute("webkit-playsinline",""),r.setAttribute("x5-playsinline",""),r.setAttribute("style",pA),t.appendChild(r),this.playerView=r}else uL.warn("Require container element id or HTMLDivElement")}},e.prototype.startPlay=function(e){var t,r,n,i,o=this;if(this.playerView){var a=function(e){var t=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)([^?#]*)(?:\?*)(?:[^?#]*)/.exec(e);if(t)return t[1];var r=/^(?:https?:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)([^?#]*)(?:\.sdp)(?:\?*)(?:[^?#]*)/.exec(e);return r?r[1]:null}(e);if(null!==a)if(this.isVideoExisted)uL.warn("Video is existed, please stop playing first");else if(this.receiveConfig.video||this.receiveConfig.audio){var s=(new Date).getTime();this.report.clearData(),this.report.setData("u64_timestamp",s),this.report.setTempData("pull_start_time",s),this.report.markTime("pull_start"),this.report.setData("bytes_stream_id",a,!0),this.report.setData("str_stream_url",e,!0);var c=function(e){var t=/^(?:webrtc:\/\/)([0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_=]+)(?:\/)(?:[^?#]*)(?:\?*)(?:[^?#]*)/.exec(e);return t?t[1]:null}(e);if(this.signal.updateSignalDomain(c),this.rawUrl=e,this.playUrl=function(e){var t=MA(e,"tabr_bitrates"),r=MA(e,"tabr_start_bitrate"),n=MA(e,"tabr_control"),i=e;return t&&r&&(i=UA(i,"tabr_control",null),i=UA(i,"webrtc_tabr_level","auto"===n?"server_control":"client_control")),i}(e),this.streamReceiveFail.curNum=0,this.streamDecodeFail.curNum=0,this.streamPlaying.status=nA.INIT,this.abrClient.seq=0,this.p2pMode.source="",this.p2pMode.enable){if(this.p2pConnection)return void uL.warn("p2p connection is existed, please stop playing first");if(IL.support()&&this.receiveConfig.video&&this.receiveConfig.audio&&!function(e){var t=MA(e,"tabr_bitrates"),r=MA(e,"tabr_start_bitrate");return!(!t||!r)}(e)){this.report.setData("u32_isp2p",1,!0),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,iA.PLAY_EVT_P2P_START_SUCCESS);var u=this.signal.getSignalDomain();return this.p2pConnection=IL.create(_a(_a({},this.p2pMode.config),{connectRetryCount:this.connectRetry.maxNum,connectRetryDelay:1e3*this.connectRetry.delay,pullStreamDomain:u,stopStreamDomain:u})),this.p2pConnection.on(IL.Event,this.onP2PEvent),void this.p2pConnection.load(this.playUrl).then((function(e){var t=e.srcObject;o.stream=t,o.onAddStream(o.stream)}))}uL.error("p2p mode start failed"),null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,iA.PLAY_ERR_P2P_START_FAIL)}this.report.setData("u32_isp2p",0,!0),this.webrtcConnection||(this.webrtcConnection=new yL,this.webrtcConnection.init({onAddTrack:this.onAddTrack,onSetLocalDescription:this.onSetLocalDescription,onConnect:this.onConnect,onDisconnect:this.onDisconnect,onError:this.onError,onReceiveSEI:this.onReceiveSEI})),this.webrtcConnection.initWebRTCConnect({config:{connection:{isReceiveSEI:this.seiConfig.enable&&this.receiveConfig.video,isCreateSEIDataChannel:this.seiConfig.fallback,maxSEIDelayTime:this.seiConfig.maxDelayTime},offer:{offerToReceiveVideo:this.receiveConfig.video,offerToReceiveAudio:this.receiveConfig.audio}}})}else uL.warn("Both receiveVideo and receiveAudio are false");else uL.warn("Play url is not correct")}else uL.warn("Please set player view first")},e.prototype.stopPlay=function(e){var t,r,n;return void 0===e&&(e=!0),Ra(this,void 0,void 0,(function(){return Ea(this,(function(i){switch(i.label){case 0:return this.isVideoExisted?(this.isVideoExisted=!1,this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.abrClient.curBitrate="",this.connectRetry.curNum=0,this.connectRetry.playing=!1,this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),this.playUrl&&this.svrSig&&(this.signal.fetchStopStream({streamurl:this.playUrl,svrsig:this.svrSig}).catch((function(e){uL.warn("request stopStream error,",e)})),this.playUrl=null,this.svrSig=null),[4,this.startReport("stop")]):(uL.warn("Video is not existed"),[2]);case 1:var o;if(i.sent(),this.p2pConnection?(this.p2pConnection.destroy(),this.p2pConnection=null):this.webrtcConnection.disconnect(),e)null===(t=this.stream)||void 0===t||Co(o=t.getTracks()).call(o,(function(e){e.stop()}));return this.stream=null,this.playerView&&(this.playerView.pause(),e&&(this.playerView.srcObject=null,this.playerView.load())),null===(n=(r=this.listener).onPlayEvent)||void 0===n||n.call(r,iA.PLAY_EVT_PLAY_STOP),[2]}}))}))},e.prototype.switchStream=function(e){var t,r;return Ra(this,void 0,void 0,(function(){var n,i,o;return Ea(this,(function(a){switch(a.label){case 0:if(s=this.rawUrl,c=e,u=function(e){var t=MA(e,"tabr_bitrates"),r=MA(e,"tabr_start_bitrate"),n=MA(e,"tabr_control");return!(!t||!r||"auto"===n)},!u(s)||!u(c)||UA(s,"tabr_start_bitrate",null)!==UA(c,"tabr_start_bitrate",null))return[3,5];if(!this.svrSig)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),n=MA(e,"tabr_start_bitrate"),uL.log("abr control: switch ".concat(n)),this.abrClient.seq=this.abrClient.seq+1,[4,this.signal.fetchAbrControl({svrsig:this.svrSig,seq:this.abrClient.seq,bitrate_name:n})];case 2:return i=a.sent().seq,this.abrClient.seq=Math.max(this.abrClient.seq,i),this.abrClient.curBitrate=n,[3,4];case 3:return o=a.sent(),uL.error("abr control switch failed",o),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,iA.PLAY_ERR_REQUEST_ABR_FAIL,{message:o.message}),[3,4];case 4:return[3,7];case 5:return[4,this.stopPlay()];case 6:a.sent(),this.startPlay(e),a.label=7;case 7:return[2]}var s,c,u}))}))},e.prototype.isPlaying=function(){return this.isVideoExisted&&this.isVideoPlaying()},e.prototype.pause=function(){this.playerView&&this.isVideoExisted&&this.isVideoPlaying()&&(this.playerView.pause(),NA()&&this.setPosterFromCurrentFrame())},e.prototype.resume=function(){return Ra(this,void 0,void 0,(function(){var e,t,r;return Ea(this,(function(n){switch(n.label){case 0:if(!this.playerView||!this.isVideoExisted||this.isVideoPlaying())return[3,4];var i;if(NA()&&this.playerView.srcObject)e=this.playerView.srcObject,t=new MediaStream,Co(i=e.getTracks()).call(i,(function(e){t.addTrack(e)})),this.stream=t,this.playerView.srcObject=t;n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.playerView.play()];case 2:return n.sent(),this.playerView.removeAttribute("poster"),[3,4];case 3:return r=n.sent(),uL.warn("resume failed",r),[3,4];case 4:return[2]}}))}))},e.prototype.setMute=function(e){this.playerView&&(this.playerView.muted=!!e)},e.prototype.setVolume=function(e){"number"==typeof e&&e>=0&&e<=100?this.playerView&&(this.playerView.volume=e/100):uL.warn("volume must be a number between 0 and 100")},e.prototype.setControls=function(e){this.playerView&&(this.playerView.controls=!!e)},e.prototype.setFullscreen=function(e){this.playerView&&(e?this.requestFullscreen():this.exitFullscreen())},e.prototype.getVideoElement=function(){return this.playerView},e.prototype.destroy=function(){return Ra(this,void 0,void 0,(function(){return Ea(this,(function(e){switch(e.label){case 0:return window.removeEventListener("pagehide",this.onPagehide),window.removeEventListener("beforeunload",this.onBeforeUnload),this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),this.isVideoExisted&&(this.webrtcConnection||this.p2pConnection)?[4,this.startReport("stop")]:[3,2];case 1:e.sent(),e.label=2;case 2:var t;if(this.stream)Co(t=this.stream.getTracks()).call(t,(function(e){e.stop()})),this.stream=null;return this.playerView&&(this.playerView.pause(),this.playerView.srcObject=null,this.playerView.parentElement.removeChild(this.playerView),this.playerView=null),this.p2pConnection&&(this.p2pConnection.destroy(),this.p2pConnection=null),this.webrtcConnection&&(this.webrtcConnection.disconnect(),this.webrtcConnection=null),this.lastStatsReport=null,this.report&&(this.report.destroy(),this.report=null),this.signal=null,[2]}}))}))},e.prototype.isVideoPlaying=function(){return!(!this.playerView||!1!==this.playerView.paused)},e.prototype.setPosterFromCurrentFrame=function(){return Ra(this,void 0,void 0,(function(){var e,t,r,n,i,o;return Ea(this,(function(a){try{if(!this.playerView)return[2];if(e=this.playerView,t=e.videoWidth,r=e.videoHeight,!t||!r)return[2];if((n=document.createElement("canvas")).width=t,n.height=r,!(i=n.getContext("2d")))return[2];i.drawImage(e,0,0,t,r),o=n.toDataURL("image/png"),e.poster=o}catch(e){uL.warn("set poster from current frame failed",e)}return[2]}))}))},e.prototype.requestFullscreen=function(){var e=VA;try{e.requestFullscreen?this.playerView[e.requestFullscreen]({navigationUI:"hide"}):XA(this.playerView)?this.playerView.webkitEnterFullScreen():this.enterFullWindow()}catch(e){uL.warn("enter full screen failed, ",e)}},e.prototype.exitFullscreen=function(){var e,t=VA;try{if(t.requestFullscreen){var r=document[t.exitFullscreen]();null===(e=null==r?void 0:r.catch)||void 0===e||e.call(r,(function(e){return uL.warn("exit full screen failed, ",null==e?void 0:e.message)}))}else XA(this.playerView)?this.playerView.webkitExitFullScreen():this.exitFullWindow()}catch(e){uL.warn("exit full screen failed, ",e)}},e.prototype.enterFullWindow=function(){this.docOrigOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden",this.playerView.setAttribute("style","position:fixed;overflow:hidden;z-index:9999;left:0;top:0;bottom:0;right:0;width:100% !important;height:100% !important;padding-top:0 !important;background-color:#000;")},e.prototype.exitFullWindow=function(){document.documentElement.style.overflow=this.docOrigOverflow,this.playerView.setAttribute("style",pA)},e.prototype.onAddStream=function(e){var t,r,n,i;return Ra(this,void 0,void 0,(function(){var o,a,s,c,u,l=this;return Ea(this,(function(d){switch(d.label){case 0:if(null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,iA.PLAY_EVT_STREAM_BEGIN),!this.playerView)return[2];if(o=function(){l.playerView.removeEventListener("loadedmetadata",o),l.playerView.removeEventListener("canplay",o),l.report.markTime("video_play"),l.receiveConfig.video?(l.report.measureTime("u32_first_video_decode_time","pull_start","video_play"),l.report.measureTime("u32_first_i_frame","pull_start","video_play",!0)):(l.report.setData("u32_first_video_decode_time",0),l.report.setData("u32_first_i_frame",0),l.report.setTempData("u32_first_i_frame",0)),l.receiveConfig.audio?l.report.measureTime("u32_first_audio_render_time","pull_start","video_play"):l.report.setData("u32_first_audio_render_time",0),l.startReport("start"),l.timer.reportInterval&&(window.clearInterval(l.timer.reportInterval),l.timer.reportInterval=null),l.timer.reportInterval=Zo((function(){l.startReport("interval")}),5e3)},this.playerView.addEventListener("loadedmetadata",o),this.playerView.addEventListener("canplay",o),this.playerView.srcObject=e,this.isVideoExisted=!0,!this.playerView.autoplay&&!this.connectRetry.playing)return[2];a=function(e){var t,r,n;uL.error("video play failed,",e),l.isVideoExisted&&($i(t=e.toString()).call(t,"NotAllowedError")?Yo((function(){var t;null===(t=l.getConnectionStats())||void 0===t||t.then((function(t){var r,n,i,o,a=function(e){if(e){var t=null,r=null;Co(e).call(e,(function(e){"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?t=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(r=e.id))}));var n=e.get(t),i=e.get(r);return{video:{bytesReceived:null==n?void 0:n.bytesReceived},audio:{bytesReceived:null==i?void 0:i.bytesReceived}}}}(t);null===(n=(r=l.listener).onPlayEvent)||void 0===n||n.call(r,iA.PLAY_ERR_PLAY_FAIL,{message:e.toString(),videoActive:(null===(i=null==a?void 0:a.video)||void 0===i?void 0:i.bytesReceived)>0,audioActive:(null===(o=null==a?void 0:a.audio)||void 0===o?void 0:o.bytesReceived)>0})}))}),1e3):null===(n=(r=l.listener).onPlayEvent)||void 0===n||n.call(r,iA.PLAY_ERR_PLAY_FAIL,{message:e.toString()}))},d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this.playerView.play()];case 2:return d.sent(),s=LA(),IA&&s.length>0&&13===s[0]?(this.playerView.pause(),c=function(){return Ra(l,void 0,void 0,(function(){var e,t,r;return Ea(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.playerView.play()];case 1:return n.sent(),uL.log("video play ok ios"),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,iA.PLAY_EVT_PLAY_BEGIN),[3,3];case 2:return e=n.sent(),a(e),[3,3];case 3:return[2]}}))}))},Yo((function(){c()}),200)):(uL.log("video play ok"),null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,iA.PLAY_EVT_PLAY_BEGIN)),[3,4];case 3:return u=d.sent(),a(u),[3,4];case 4:return[2]}}))}))},e.prototype.onAddTrack=function(e){"video"===e.kind?(this.report.markTime("video_down"),this.report.measureTime("u32_first_frame_down","pull_start","video_down")):"audio"===e.kind&&(this.report.markTime("audio_down"),this.report.measureTime("u32_first_audio_frame_down","pull_start","audio_down")),this.stream||(this.stream=new MediaStream),this.stream.addTrack(e)},e.prototype.onSetLocalDescription=function(e){var t,r,n,i;return Ra(this,void 0,void 0,(function(){var o,a,s,c,u,l,d,p,f,h,m,v,y,g,b,C=this;return Ea(this,(function(S){var T,_,w,R,E;switch(S.label){case 0:return S.trys.push([0,5,,6]),o=Os(),a=KA(e.sdp),s=ta(T=e.sdp.toLowerCase()).call(T,"h264")>-1,c=Ms.parse(window.navigator.userAgent),u=c.browser,l=c.os,d=gi(_=gi(w=gi(R="".concat(l.name||"other"," ")).call(R,l.version,";")).call(w,u.name||"other"," ")).call(_,u.version),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,iA.PLAY_EVT_REQUEST_PULL_BEGIN,{localSdp:e,iceInfo:a,sessionId:o}),this.report.setData("str_session_id",o,!0),this.report.setData("bytes_token",o,!0),this.report.setData("str_ice_info",a,!0),this.report.markTime("request_start"),uL.log("H264 is ".concat(s?"":"not ","supported")),uL.log("traceId is webrtc_user=".concat(a)),uL.log("request pullStream start"),p=null,ha(E=this.playUrl).call(E,"webrtc")?[4,this.signal.fetchPullStream({streamurl:this.playUrl,sessionid:o,clientinfo:d,localsdp:e})]:[3,2];case 1:return p=S.sent(),[3,4];case 2:return[4,this.signal.fetchStreamSdp({streamurl:this.playUrl,sessionid:o,localsdp:e})];case 3:p=S.sent(),S.label=4;case 4:return uL.log("request pullStream success"),this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end"),f=p.remoteSdp,h=p.svrSig,m=f.client_vip,v=void 0===m?"":m,y=wa(f,["client_vip"]),g=function(e){var t,r,n=e.split("\r\n");try{for(var i=Pa(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(ha(a).call(a,"i="))return a.replace("i=","")}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return""}(y.sdp),null===(i=(n=this.listener).onPlayEvent)||void 0===i||i.call(n,iA.PLAY_EVT_REQUEST_PULL_SUCCESS,{remoteSdp:y,clientIp:v}),this.report.setData("bytes_server_label",g,!0),this.webrtcConnection.connect(y),this.svrSig=h,this.timer.disconnectTimeout&&window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=Yo((function(){uL.warn("connect timeout, try reconnect"),C.webrtcConnection.disconnect({code:tA.NEED_RECONNECT,msg:"Connection disconnected, please try again"})}),1e3*this.connectTimeout),[3,6];case 5:return b=S.sent(),uL.error("request pullStream error,",b),b.name===mA?(this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end"),this.webrtcConnection.disconnect(),this.onPlayError(iA.PLAY_ERR_REQUEST_PULL_FAIL,{message:b.message})):(uL.warn("request signal ".concat("AbortError"===b.name?"timeout":"failed",", try reconnect")),this.webrtcConnection.disconnect({code:tA.NEED_RECONNECT,msg:"request signal failed, please try again"})),[3,6];case 6:return[2]}}))}))},e.prototype.onConnect=function(e){var t,r,n=this;e.code===eA.SUCCESS&&(this.stream&&this.onAddStream(this.stream),this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.startStat(),null===(r=(t=this.listener).onPlayEvent)||void 0===r||r.call(t,iA.PLAY_EVT_SERVER_CONNECTED),this.abrClient.curBitrate&&this.svrSig&&(uL.log("abr control: reconnect ".concat(this.abrClient.curBitrate)),this.abrClient.seq=this.abrClient.seq+1,this.signal.fetchAbrControl({svrsig:this.svrSig,seq:this.abrClient.seq,bitrate_name:this.abrClient.curBitrate}).then((function(e){var t=e.seq;n.abrClient.seq=Math.max(n.abrClient.seq,t)})).catch((function(e){uL.warn("abr control reconnect failed",e)}))))},e.prototype.onDisconnect=function(e){var t=this;if(this.lastStatsReport=null,this.streamReceiveFail.curNum=0,this.streamDecodeFail.curNum=0,this.streamPlaying.status=nA.INIT,this.timer.disconnectTimeout&&(window.clearTimeout(this.timer.disconnectTimeout),this.timer.disconnectTimeout=null),this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),e.code===tA.NEED_RECONNECT){var r;if(0===this.connectRetry.curNum&&(this.connectRetry.playing=this.isPlaying()),this.playUrl&&this.svrSig&&(this.signal.fetchStopStream({streamurl:this.playUrl,svrsig:this.svrSig}).catch((function(e){uL.warn("request stopStream error,",e)})),this.svrSig=null),this.stream)Co(r=this.stream.getTracks()).call(r,(function(e){e.stop()})),this.stream=null;this.isVideoExisted&&this.playerView&&(this.playerView.pause(),this.playerView.srcObject=null,this.playerView.load(),this.isVideoExisted=!1),this.timer.retryTimeout&&(window.clearTimeout(this.timer.retryTimeout),this.timer.retryTimeout=null),this.timer.retryTimeout=Yo((function(){var e,r,n;t.connectRetry.curNum+=1;var i=t.connectRetry,o=i.curNum,a=i.maxNum;uL.log(gi(e="current retry num: ".concat(o,", max retry num: ")).call(e,a)),o<=a?(uL.log("start connection retry"),null===(n=(r=t.listener).onPlayEvent)||void 0===n||n.call(r,iA.PLAY_EVT_SERVER_RECONNECT),t.startPlay(t.rawUrl)):(uL.error("stop connection retry, connection is disconnected"),t.onPlayError(iA.PLAY_ERR_SERVER_DISCONNECT),t.connectRetry.curNum=0,t.connectRetry.playing=!1),t.timer.retryTimeout=null}),1e3*this.connectRetry.delay)}},e.prototype.onError=function(e){this.onPlayError(iA.PLAY_ERR_WEBRTC_FAIL,{message:e})},e.prototype.startStat=function(){return Ra(this,void 0,void 0,(function(){var e,t=this;return Ea(this,(function(r){switch(r.label){case 0:return this.report.markTime("server_connected"),this.report.measureTime("u32_connect_server_time","pull_start","server_connected"),this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),[4,this.getConnectionStats()];case 1:return(e=r.sent())&&(this.report.setTempData("start_stats",e),this.report.setTempData("last_stats",e),this.report.setTempData("last_time",(new Date).getTime()),this.onStats(e)),this.timer.statsInterval=Zo((function(){var e;null===(e=t.getConnectionStats())||void 0===e||e.then((function(e){e&&t.onStats(e)}))}),1e3),[2]}}))}))},e.prototype.onStats=function(e){var t,r,n,i,o,a,s,c,u,l,d=function(e,t){var r,n,i,o,a;if(void 0===t&&(t=null),t){var s=null,c=null,u=null,l=null,d=null;Co(e).call(e,(function(e){"track"===e.type&&("video"===e.kind||e.frameWidth?s=e.id:("audio"===e.kind||e.audioLevel)&&(u=e.id)),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?c=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(l=e.id)),"candidate-pair"===e.type&&e.selected?d=e.id:"transport"===e.type&&e.selectedCandidatePairId&&(d=e.selectedCandidatePairId)}));var p=e.get(s),f=e.get(c),h=t.get(s),m=t.get(c),v=0;void 0!==(null==f?void 0:f.timestamp)&&void 0!==(null==m?void 0:m.timestamp)&&(v=(f.timestamp-m.timestamp)/1e3);var y=void 0;if((null==f?void 0:f.codecId)&&(L=e.get(f.codecId))){var g,b,C=L.mimeType,S=L.payloadType,T=L.sdpFmtpLine;y=(null==C?void 0:C.replace("video/",""))||"",S&&T&&(y=gi(g=gi(b="".concat(y," (")).call(b,S,", ")).call(g,T,")"))}var _=void 0;void 0!==(null==f?void 0:f.framesPerSecond)?_=f.framesPerSecond:void 0!==(null==f?void 0:f.framerateMean)?_=f.framerateMean:void 0!==(null==f?void 0:f.framesReceived)&&void 0!==(null==m?void 0:m.framesReceived)&&v?_=(f.framesReceived-m.framesReceived)/v:void 0!==(null==p?void 0:p.framesReceived)&&void 0!==(null==h?void 0:h.framesReceived)&&v&&(_=(p.framesReceived-h.framesReceived)/v);var w=void 0;void 0!==(null==f?void 0:f.framesDecoded)&&void 0!==(null==m?void 0:m.framesDecoded)&&v&&(w=(f.framesDecoded-m.framesDecoded)/v);var R=void 0;void 0!==(null==f?void 0:f.bytesReceived)&&void 0!==(null==m?void 0:m.bytesReceived)&&v&&(R=8*(f.bytesReceived-m.bytesReceived)/v);var E=void 0;void 0!==(null==f?void 0:f.jitterBufferDelay)&&void 0!==(null==f?void 0:f.jitterBufferEmittedCount)&&void 0!==(null==m?void 0:m.jitterBufferDelay)&&void 0!==(null==m?void 0:m.jitterBufferEmittedCount)&&(f.jitterBufferEmittedCount-m.jitterBufferEmittedCount?E=(f.jitterBufferDelay-m.jitterBufferDelay)/(f.jitterBufferEmittedCount-m.jitterBufferEmittedCount)*1e3:f.jitterBufferEmittedCount&&(E=f.jitterBufferDelay/f.jitterBufferEmittedCount*1e3));var P=void 0;void 0!==(null==f?void 0:f.totalDecodeTime)&&void 0!==(null==f?void 0:f.framesDecoded)&&void 0!==(null==m?void 0:m.totalDecodeTime)&&void 0!==(null==m?void 0:m.framesDecoded)&&(f.framesDecoded-m.framesDecoded?P=(f.totalDecodeTime-m.totalDecodeTime)/(f.framesDecoded-m.framesDecoded)*1e3:f.framesDecoded&&(P=f.totalDecodeTime/f.framesDecoded*1e3));var k=e.get(u),A=e.get(l),I=t.get(l);void 0!==(null==A?void 0:A.timestamp)&&void 0!==(null==I?void 0:I.timestamp)&&(v=(A.timestamp-I.timestamp)/1e3);var L,x,D,O=void 0;if((null==A?void 0:A.codecId)&&(L=e.get(A.codecId)))C=L.mimeType,S=L.payloadType,T=L.sdpFmtpLine,O=(null==C?void 0:C.replace("audio/",""))||"",S&&T&&(O=gi(x=gi(D="".concat(O," (")).call(D,S,", ")).call(x,T,")"));var N=void 0;void 0!==(null==A?void 0:A.audioLevel)?N=null==A?void 0:A.audioLevel:void 0!==(null==k?void 0:k.audioLevel)&&(N=null==k?void 0:k.audioLevel);var M=void 0;void 0!==(null==A?void 0:A.bytesReceived)&&void 0!==(null==I?void 0:I.bytesReceived)&&v&&(M=8*(A.bytesReceived-I.bytesReceived)/v);var U=void 0;void 0!==(null==A?void 0:A.jitterBufferDelay)&&void 0!==(null==A?void 0:A.jitterBufferEmittedCount)&&void 0!==(null==I?void 0:I.jitterBufferDelay)&&void 0!==(null==I?void 0:I.jitterBufferEmittedCount)&&(A.jitterBufferEmittedCount-I.jitterBufferEmittedCount?U=(A.jitterBufferDelay-I.jitterBufferDelay)/(A.jitterBufferEmittedCount-I.jitterBufferEmittedCount)*1e3:A.jitterBufferEmittedCount&&(U=A.jitterBufferDelay/A.jitterBufferEmittedCount*1e3));var V=e.get(d),F=void 0;void 0!==(null==V?void 0:V.currentRoundTripTime)&&(F=1e3*V.currentRoundTripTime);var j=void 0,B=void 0,W=void 0,G=void 0;void 0===(null==f?void 0:f.packetsLost)&&void 0===(null==A?void 0:A.packetsLost)||(j=((null==f?void 0:f.packetsLost)||0)+((null==A?void 0:A.packetsLost)||0)),void 0===(null==f?void 0:f.packetsReceived)&&void 0===(null==A?void 0:A.packetsReceived)||(B=((null==f?void 0:f.packetsReceived)||0)+((null==A?void 0:A.packetsReceived)||0)),void 0===(null==m?void 0:m.packetsLost)&&void 0===(null==I?void 0:I.packetsLost)||(W=((null==m?void 0:m.packetsLost)||0)+((null==I?void 0:I.packetsLost)||0)),void 0===(null==m?void 0:m.packetsReceived)&&void 0===(null==I?void 0:I.packetsReceived)||(G=((null==m?void 0:m.packetsReceived)||0)+((null==I?void 0:I.packetsReceived)||0));var Z=void 0;if(void 0!==j&&void 0!==B&&void 0!==W&&void 0!==G){var Y=j-W,X=B-G;Z=Y<=0||X<0?0:Y/(Y+X)*100}var H=YA.UNKNOWN;return void 0===F&&void 0===Z||(Z>50||F>500?H=YA.VERY_BAD:Z>30||F>350?H=YA.BAD:Z>20||F>200?H=YA.POOR:Z>10||F>100?H=YA.GOOD:(Z>=0||F>=0)&&(H=YA.EXCELLENT)),{timestamp:(null==f?void 0:f.timestamp)||(null==A?void 0:A.timestamp),video:{codec:y,bitrate:R&&Number(R.toFixed(2)),framesPerSecond:_&&Math.round(_),framesDecodedPerSecond:w&&Math.round(w),frameWidth:null!==(r=null==f?void 0:f.frameWidth)&&void 0!==r?r:null==p?void 0:p.frameWidth,frameHeight:null!==(n=null==f?void 0:f.frameHeight)&&void 0!==n?n:null==p?void 0:p.frameHeight,framesDecoded:null!==(i=null==f?void 0:f.framesDecoded)&&void 0!==i?i:null==p?void 0:p.framesDecoded,framesDropped:null!==(o=null==f?void 0:f.framesDropped)&&void 0!==o?o:null==p?void 0:p.framesDropped,framesReceived:null!==(a=null==f?void 0:f.framesReceived)&&void 0!==a?a:null==p?void 0:p.framesReceived,packetsLost:null==f?void 0:f.packetsLost,packetsReceived:null==f?void 0:f.packetsReceived,nackCount:null==f?void 0:f.nackCount,firCount:null==f?void 0:f.firCount,pliCount:null==f?void 0:f.pliCount,jitterBufferDelay:E&&Number(E.toFixed(2)),frameDecodeAvgTime:P&&Number(P.toFixed(2))},audio:{codec:O,audioLevel:N,bitrate:M&&Number(M.toFixed(2)),packetsLost:null==A?void 0:A.packetsLost,packetsReceived:null==A?void 0:A.packetsReceived,nackCount:null==A?void 0:A.nackCount,jitterBufferDelay:U&&Number(U.toFixed(2))},network:{roundTripTime:F,quality:H}}}}(e,this.lastStatsReport);if(this.lastStatsReport=e,d){d.video.frameWidth=d.video.frameWidth||(null===(t=this.playerView)||void 0===t?void 0:t.videoWidth)||void 0,d.video.frameHeight=d.video.frameHeight||(null===(r=this.playerView)||void 0===r?void 0:r.videoHeight)||void 0;var p={};if(this.p2pConnection){var f=this.p2pConnection.getSDKStats(),h=f.uploadBytesTotal,m=f.uploadAuidoBytesTotal,v=f.uploadVideoBytesTotal,y=f.cdnDownloadBytesTotal,g=f.cdnDownloadAuidoBytesTotal,b=f.cdnDownloadVideoBytesTotal,C=f.p2pDownloadBytesTotal,S=f.p2pDownloadAuidoBytesTotal,T=f.p2pDownloadVideoBytesTotal;p.p2p={uploadBytes:h,uploadAuidoBytes:m,uploadVideoBytes:v,cdnDownloadBytes:y,cdnDownloadAuidoBytes:g,cdnDownloadVideoBytes:b,p2pDownloadBytes:C,p2pDownloadAuidoBytes:S,p2pDownloadVideoBytes:T}}if(null===(i=(n=this.listener).onPlayStats)||void 0===i||i.call(n,_a(_a({},d),p)),d.video.bitrate||d.audio.bitrate)this.streamReceiveFail.curNum=0,this.connectRetry.curNum=0;else if(this.streamReceiveFail.curNum+=1,this.streamReceiveFail.curNum>=this.streamReceiveFail.maxNum)return null===(a=(o=this.listener).onPlayEvent)||void 0===a||a.call(o,iA.PLAY_EVT_STREAM_EMPTY),uL.warn("stream is empty, try reconnect"),void this.webrtcConnection.disconnect({code:tA.NEED_RECONNECT,msg:"stream is empty, please try again"})}if((null==d?void 0:d.video)&&this.receiveConfig.video&&this.isVideoExisted){var _=d.video,w=_.bitrate,R=_.framesPerSecond,E=_.framesDecoded,P=_.framesDecodedPerSecond;if(w&&R&&!E?(this.streamDecodeFail.curNum+=1,this.streamDecodeFail.curNum===this.streamDecodeFail.maxNum&&(uL.error("video decoding failed"),this.onPlayError(iA.PLAY_ERR_DECODE_FAIL,{message:"decode failed",bitrate:w,framesPerSecond:R}))):this.streamDecodeFail.curNum=0,P>=0||R>=0)if(P<=this.streamPlaying.threshold||R<=this.streamPlaying.threshold){var k=this.report.getTempData("freeze_interval_count")||0;this.report.setTempData("freeze_interval_count",k+1),this.streamPlaying.status!==nA.WAITING&&(this.streamPlaying.status=nA.WAITING,this.report.setTempData("freeze_start_time",(new Date).getTime()),null===(c=(s=this.listener).onPlayEvent)||void 0===c||c.call(s,iA.PLAY_EVT_PLAY_WAITING_BEGIN))}else{if(this.streamPlaying.status===nA.WAITING){var A=this.report.getTempData("freeze_start_time"),I=(new Date).getTime(),L=I-A,x=this.report.getTempData("video_freeze")||{},D=x.count,O=void 0===D?0:D,N=x.totalTime,M=void 0===N?0:N,U=x.maxTime,V=void 0===U?0:U,F=x.endTimes,j=void 0===F?[]:F;O+=1,M+=L,V=Math.max(L,V),j=Aa(Aa([],ka(j),!1),[I],!1),this.report.setTempData("video_freeze",{count:O,totalTime:M,maxTime:V,endTimes:j}),null===(l=(u=this.listener).onPlayEvent)||void 0===l||l.call(u,iA.PLAY_EVT_PLAY_WAITING_STOP)}this.streamPlaying.status=nA.PLAYING}}},e.prototype.startReport=function(e,t){var r,n;return void 0===t&&(t=""),Ra(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,d,p,f,h,m,v,y,g,b,C,S,T,_,w,R,E,P,k,A,I,L,x,D,O,N,M,U;return Ea(this,(function(V){switch(V.label){case 0:return i=(new Date).getTime(),o=this.report.getTempData("pull_start_time"),"stop"===e?(a=this.report.getTempData("u32_first_i_frame")||0,this.report.setData("u64_timestamp",i),this.report.setData("u64_begin_timestamp",o),this.report.setData("u32_result",Math.round((i-o)/1e3)),this.report.setData("u32_first_i_frame",a),this.report.setData("u32_first_frame_black",a>1e4?1:0),s=this.report.getTempData("video_freeze")||{},c=s.count,v=void 0===c?0:c,u=s.totalTime,l=void 0===u?0:u,d=s.maxTime,p=void 0===d?0:d,this.report.setData("u64_block_count",v),this.report.setData("u32_video_block_time",l),this.report.setData("u64_block_duration_max",p),this.report.setData("u32_avg_block_time",l&&v?Math.round(l/v):0),this.report.setData("u32_delay_report",t?1:0)):"interval"===e&&(this.report.setData("u64_timestamp",i),this.report.setData("u64_playtime",i-o),f=(this.report.getTempData("video_freeze")||{}).endTimes,h=void 0===f?[]:f,m=this.report.getTempData("last_time")||0,v=Ca(h).call(h,(function(e){return e>=m&&e<i})).length,this.report.setData("u32_video_block_count",v),this.report.setTempData("last_time",i),y=this.report.getTempData("freeze_interval_count")||0,this.report.setData("u32_block_usage",y/5*1e3),this.report.setTempData("freeze_interval_count",0)),g=null,"stop"!==e||"pagehide"!==t?[3,1]:(g=this.report.getTempData("last_stats"),[3,3]);case 1:return[4,this.getConnectionStats()];case 2:g=V.sent(),V.label=3;case 3:var F,j;if(g)b=function(e){var t=null;Co(e).call(e,(function(r){var n;"candidate-pair"===r.type&&r.selected?t=r.remoteCandidateId:"transport"===r.type&&r.selectedCandidatePairId&&(t=null===(n=e.get(r.selectedCandidatePairId))||void 0===n?void 0:n.remoteCandidateId)}));var r=e.get(t)||{},n=r.address,i=void 0===n?"":n,o=r.port;return{address:i,port:void 0===o?"":o}}(g),C=b.address,S=b.port,this.report.setData("u32_server_ip",gi(F=gi(j="".concat(C)).call(j,S?":":"")).call(F,S)),"stop"===e?(T=this.report.getTempData("start_stats"),_=function(e,t){var r,n,i=null,o=null,a=null;Co(e).call(e,(function(e){"track"!==e.type||"video"!==e.kind&&!e.frameWidth||(i=e.id),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?o=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(a=e.id))}));var s=e.get(i),c=e.get(o),u=e.get(a),l=null==t?void 0:t.get(o),d=0;void 0!==(null==c?void 0:c.timestamp)&&void 0!==(null==l?void 0:l.timestamp)&&(d=(c.timestamp-l.timestamp)/1e3);var p=0;void 0!==(null==c?void 0:c.packetsLost)&&void 0!==(null==c?void 0:c.packetsReceived)&&(p=c.packetsLost/(c.packetsLost+c.packetsReceived)*1e3);var f=0;void 0!==(null==u?void 0:u.packetsLost)&&void 0!==(null==u?void 0:u.packetsReceived)&&(f=u.packetsLost/(u.packetsLost+u.packetsReceived)*1e3);var h=0;return void 0!==(null==c?void 0:c.framesDecoded)&&void 0!==(null==l?void 0:l.framesDecoded)&&d&&(h=Math.round((c.framesDecoded-l.framesDecoded)/d)),{width:(null!==(r=null==c?void 0:c.frameWidth)&&void 0!==r?r:null==s?void 0:s.frameWidth)||0,height:(null!==(n=null==c?void 0:c.frameHeight)&&void 0!==n?n:null==s?void 0:s.frameHeight)||0,videoFractionLost:Number(p.toFixed(2)),audioFractionLost:Number(f.toFixed(2)),framerateMean:h}}(g,T),w=_.width,R=_.height,M=_.videoFractionLost,L=_.audioFractionLost,E=_.framerateMean,this.report.setData("u32_video_width",w||(null===(r=this.playerView)||void 0===r?void 0:r.videoWidth)),this.report.setData("u32_video_height",R||(null===(n=this.playerView)||void 0===n?void 0:n.videoHeight)),this.report.setData("u32_video_drop_usage",M),this.report.setData("u32_audio_drop_usage",L),this.report.setData("u32_video_avg_fps",E)):"interval"===e&&(P=this.report.getTempData("last_stats"),k=function(e,t){var r=null,n=null,i=null,o=null;Co(e).call(e,(function(e){"track"===e.type&&("video"===e.kind||e.frameWidth)&&(r=e.id),"inbound-rtp"===e.type&&("video"===e.kind||"video"===e.mediaType?n=e.id:"audio"!==e.kind&&"audio"!==e.mediaType||(i=e.id)),"candidate-pair"===e.type&&e.selected?o=e.id:"transport"===e.type&&e.selectedCandidatePairId&&(o=e.selectedCandidatePairId)}));var a=e.get(r),s=e.get(n),c=null==t?void 0:t.get(r),u=null==t?void 0:t.get(n),l=0;void 0!==(null==s?void 0:s.timestamp)&&void 0!==(null==u?void 0:u.timestamp)&&(l=(s.timestamp-u.timestamp)/1e3);var d=0;void 0!==(null==s?void 0:s.packetsLost)&&void 0!==(null==u?void 0:u.packetsLost)&&(d=s.packetsLost-u.packetsLost);var p=0;void 0!==(null==s?void 0:s.framesReceived)&&void 0!==(null==u?void 0:u.framesReceived)&&l?p=(s.framesReceived-u.framesReceived)/l:void 0!==(null==a?void 0:a.framesReceived)&&void 0!==(null==c?void 0:c.framesReceived)&&l?p=(a.framesReceived-c.framesReceived)/l:void 0!==(null==s?void 0:s.framerateMean)&&void 0!==(null==u?void 0:u.framerateMean)&&(p=(s.framerateMean+u.framerateMean)/2);var f=0;void 0!==(null==s?void 0:s.framesDecoded)&&void 0!==(null==u?void 0:u.framesDecoded)&&l&&(f=(s.framesDecoded-u.framesDecoded)/l);var h=0;void 0!==(null==s?void 0:s.bytesReceived)&&void 0!==(null==u?void 0:u.bytesReceived)&&l&&(h=8*(s.bytesReceived-u.bytesReceived)/l/1024);var m=0;void 0!==(null==s?void 0:s.packetsLost)&&void 0!==(null==s?void 0:s.packetsReceived)&&void 0!==(null==u?void 0:u.packetsLost)&&void 0!==(null==u?void 0:u.packetsReceived)&&(m=(C=s.packetsLost-u.packetsLost)/(C+(s.packetsReceived-u.packetsReceived))*1e3);var v=e.get(i),y=null==t?void 0:t.get(i);void 0!==(null==v?void 0:v.timestamp)&&void 0!==(null==y?void 0:y.timestamp)&&(l=(v.timestamp-y.timestamp)/1e3);var g=0;void 0!==(null==v?void 0:v.packetsLost)&&void 0!==(null==y?void 0:y.packetsLost)&&(g=v.packetsLost-y.packetsLost);var b=0;void 0!==(null==v?void 0:v.bytesReceived)&&void 0!==(null==y?void 0:y.bytesReceived)&&l&&(b=8*(v.bytesReceived-y.bytesReceived)/l/1024);var C,S=0;void 0!==(null==v?void 0:v.packetsLost)&&void 0!==(null==v?void 0:v.packetsReceived)&&void 0!==(null==y?void 0:y.packetsLost)&&void 0!==(null==y?void 0:y.packetsReceived)&&(S=(C=v.packetsLost-y.packetsLost)/(C+(v.packetsReceived-y.packetsReceived))*1e3);var T=e.get(o),_=null==t?void 0:t.get(o),w=0;return void 0!==(null==T?void 0:T.totalRoundTripTime)&&void 0!==(null==T?void 0:T.responsesReceived)&&void 0!==(null==_?void 0:_.totalRoundTripTime)&&void 0!==(null==_?void 0:_.responsesReceived)&&(w=(T.totalRoundTripTime-_.totalRoundTripTime)/(T.responsesReceived-_.responsesReceived)*1e3),{videoPacketsLost:Math.max(d,0),videoReceiveFps:Math.round(p),videoDecodeFps:Math.round(f),videoBitrate:Number(h.toFixed(2)),videoFractionLost:Math.max(Math.round(m),0),audioPacketsLost:Math.max(g,0),audioBitrate:Number(b.toFixed(2)),audioFractionLost:Math.max(Math.round(S),0),roundTripTime:Math.round(w)}}(g,P),A=k.audioPacketsLost,I=k.audioBitrate,L=k.audioFractionLost,x=k.videoReceiveFps,D=k.videoDecodeFps,O=k.videoBitrate,N=k.videoPacketsLost,M=k.videoFractionLost,U=k.roundTripTime,this.report.setData("u32_audio_drop",A),this.report.setData("u32_audio_drop_usage",L),this.report.setData("u32_avg_audio_bitrate",I),this.report.setData("u32_video_drop",N),this.report.setData("u32_video_drop_usage",M),this.report.setData("u32_video_recv_fps",x),this.report.setData("u32_fps",D),this.report.setData("u32_avg_video_bitrate",O),this.report.setData("u32_avg_net_speed",Number((O+I).toFixed(2))),this.report.setData("u64_rtt",U),this.report.setTempData("last_stats",g));return this.report.startReport(e),[2]}}))}))},e.prototype.onPlayError=function(e,t){var r,n,i=(t||{}).message;null===(n=(r=this.listener).onPlayEvent)||void 0===n||n.call(r,e,t),this.report.setData("u64_err_code",e),this.report.setData("str_err_info",i||""),e===iA.PLAY_ERR_SERVER_DISCONNECT?this.startReport("stop"):this.startReport("start")},e.prototype.onBeforeUnload=function(){window.removeEventListener("pagehide",this.onPagehide),this.isVideoExisted&&(this.webrtcConnection||this.p2pConnection)&&this.report&&this.startReport("stop","beforeunload")},e.prototype.onPagehide=function(){this.isVideoExisted&&(this.webrtcConnection||this.p2pConnection)&&this.report&&this.startReport("stop","pagehide")},e.prototype.getConnectionStats=function(){return this.p2pConnection?this.p2pConnection.getStats():this.webrtcConnection?this.webrtcConnection.getStats():void 0},e.prototype.onP2PEvent=function(e){var t,r,n,i,o,a,s,c,u,l,d,p,f=e.code,h=e.msg,m=e.data;switch(uL.log(gi(t="P2P Event, code: ".concat(f,", msg: ")).call(t,h,", data:"),m),f){case IL.EventCode.INF_PLAY_EVT_STREAM_FIRST_AUDIO_FRAME:this.report.markTime("audio_down"),this.report.measureTime("u32_first_audio_frame_down","pull_start","audio_down");break;case IL.EventCode.INF_PLAY_EVT_STREAM_FIRST_VIDEO_FRAME:this.report.markTime("video_down"),this.report.measureTime("u32_first_frame_down","pull_start","video_down");break;case IL.EventCode.INF_PLAY_EVT_REQUEST_PULL_BEGIN:var v={type:"offer",sdp:m.localsdp},y=m.sessionid;null===(n=(r=this.listener).onPlayEvent)||void 0===n||n.call(r,iA.PLAY_EVT_REQUEST_PULL_BEGIN,{localSdp:v}),this.report.setData("str_session_id",y,!0),this.report.setData("bytes_token",y,!0),this.report.setData("str_ice_info",KA(v.sdp),!0),this.report.markTime("request_start");break;case IL.EventCode.INF_PLAY_EVT_REQUEST_PULL_SUCCESS:var g={type:"answer",sdp:m.remotesdp};null===(o=(i=this.listener).onPlayEvent)||void 0===o||o.call(i,iA.PLAY_EVT_REQUEST_PULL_SUCCESS,{remoteSdp:g}),this.report.markTime("request_end"),this.report.measureTime("u32_signal_time","request_start","request_end");break;case IL.EventCode.ERR_PLAY_REQUEST_PULL_FAIL:this.onPlayError(iA.PLAY_ERR_REQUEST_PULL_FAIL,{message:h});break;case IL.EventCode.ERR_FETCH_REQUEST_FAIL:"PULL_STREAM"===m.from&&this.onPlayError(iA.PLAY_ERR_REQUEST_PULL_FAIL,{message:h});break;case IL.EventCode.INF_PLAY_EVT_SERVER_CONNECTED:this.startStat(),null===(s=(a=this.listener).onPlayEvent)||void 0===s||s.call(a,iA.PLAY_EVT_SERVER_CONNECTED);break;case IL.EventCode.INF_PLAY_EVT_SERVER_RECONNECT:this.connectRetry.playing=this.isPlaying(),null===(u=(c=this.listener).onPlayEvent)||void 0===u||u.call(c,iA.PLAY_EVT_SERVER_RECONNECT);break;case IL.EventCode.ERR_LOAD_REACH_MAX_RETRY:this.onPlayError(iA.PLAY_ERR_SERVER_DISCONNECT);break;case IL.EventCode.ERR_PLAY_WEBRTC_FAIL:this.onPlayError(iA.PLAY_ERR_WEBRTC_FAIL,{message:h});break;case IL.EventCode.INF_PLAY_EVT_STREAM_SWITCH:var b=null===(l=m.source)||void 0===l?void 0:l.toLowerCase();this.p2pMode.source=b,null===(p=(d=this.listener).onPlayEvent)||void 0===p||p.call(d,iA.PLAY_EVT_P2P_SOURCE_SWITCH,{source:b})}if(f>1e3&&f<2e3){var C;if(this.lastStatsReport=null,this.timer.statsInterval&&(window.clearInterval(this.timer.statsInterval),this.timer.statsInterval=null),this.timer.reportInterval&&(window.clearInterval(this.timer.reportInterval),this.timer.reportInterval=null),this.stream)Co(C=this.stream.getTracks()).call(C,(function(e){e.stop()})),this.stream=null;this.isVideoExisted&&this.playerView&&(this.playerView.pause(),this.playerView.srcObject=null,this.playerView.load(),this.isVideoExisted=!1),this.p2pConnection.destroy(),this.p2pConnection=null}},e.prototype.onReceiveSEI=function(e){var t,r;null===(r=(t=this.listener).onPlaySEI)||void 0===r||r.call(t,e)},e.version=cA,e}();return LL}));
|